<?php

namespace App\Enums;

/**
 * Canonical reminder / notification types for logging, templates, and deduplication.
 */
enum ReminderType: string
{
    case InvoiceCreated = 'invoice_created';
    case InvoiceDueSoon = 'invoice_due_soon';
    case InvoiceOverdue = 'invoice_overdue';
    case InvoicePaid = 'invoice_paid';
    case PartialPaymentReceived = 'partial_payment_received';
    case QuotationCreated = 'quotation_created';
    case QuotationExpiry = 'quotation_expiry';
    case QuotationAccepted = 'quotation_accepted';
    case QuotationRejected = 'quotation_rejected';
    case PurchaseOrderCreated = 'purchase_order_created';
    case RecurringInvoiceGenerated = 'recurring_invoice_generated';
    case PaymentReceipt = 'payment_receipt';
    case ManualReminder = 'manual_reminder';
    case FollowUpReminder = 'follow_up_reminder';
    case CustomerWelcome = 'customer_welcome';

    public function templateSlug(): string
    {
        return match ($this) {
            self::InvoiceCreated => 'invoice_created',
            self::InvoiceDueSoon => 'invoice_due_reminder',
            self::InvoiceOverdue => 'invoice_overdue_reminder',
            self::InvoicePaid => 'invoice_paid',
            self::PartialPaymentReceived => 'partial_payment_received',
            self::QuotationCreated => 'quotation_created',
            self::QuotationExpiry => 'quotation_expiry_reminder',
            self::QuotationAccepted => 'quotation_accepted',
            self::QuotationRejected => 'quotation_rejected',
            self::PurchaseOrderCreated => 'purchase_order_notification',
            self::RecurringInvoiceGenerated => 'recurring_invoice_generated',
            self::PaymentReceipt => 'payment_receipt',
            self::ManualReminder => 'manual_reminder',
            self::FollowUpReminder => 'follow_up_reminder',
            self::CustomerWelcome => 'welcome_email',
        };
    }
}
