# services/orders/app/models/enums.py
"""
Enum definitions for Orders Service
Following the pattern used in the Inventory Service for better type safety and maintainability
"""

import enum


class CustomerType(enum.Enum):
    """Customer type classifications"""
    INDIVIDUAL = "individual"
    BUSINESS = "business"
    CENTRAL_BAKERY = "central_bakery"
    RETAIL = "RETAIL"
    WHOLESALE = "WHOLESALE"
    RESTAURANT = "RESTAURANT"
    HOTEL = "HOTEL"
    ENTERPRISE = "ENTERPRISE"


class DeliveryMethod(enum.Enum):
    """Order delivery methods"""
    DELIVERY = "delivery"
    PICKUP = "pickup"
    STANDARD = "standard"  # Standard delivery method


class PaymentTerms(enum.Enum):
    """Payment terms for customers and orders"""
    IMMEDIATE = "immediate"
    NET_15 = "net_15"
    NET_30 = "net_30"
    NET_60 = "net_60"


class PaymentMethod(enum.Enum):
    """Payment methods for orders"""
    CASH = "cash"
    CARD = "card"
    CREDIT_CARD = "credit_card"  # Credit card payment
    CHECK = "check"  # Bank check/cheque payment
    BANK_TRANSFER = "bank_transfer"
    ACCOUNT = "account"


class PaymentStatus(enum.Enum):
    """Payment status for orders"""
    PENDING = "pending"
    PARTIAL = "partial"
    PAID = "paid"
    FAILED = "failed"
    REFUNDED = "refunded"


class CustomerSegment(enum.Enum):
    """Customer segmentation categories"""
    VIP = "vip"
    REGULAR = "regular"
    WHOLESALE = "wholesale"


class PriorityLevel(enum.Enum):
    """Priority levels for orders and customers"""
    URGENT = "urgent"
    HIGH = "high"
    NORMAL = "normal"
    LOW = "low"


class OrderType(enum.Enum):
    """Order type classifications"""
    STANDARD = "standard"
    RUSH = "rush"
    RECURRING = "recurring"
    SPECIAL = "special"


class OrderStatus(enum.Enum):
    """Order status workflow"""
    PENDING = "pending"
    CONFIRMED = "confirmed"
    IN_PRODUCTION = "in_production"
    READY = "ready"
    OUT_FOR_DELIVERY = "out_for_delivery"
    DELIVERED = "delivered"
    CANCELLED = "cancelled"
    FAILED = "failed"


class OrderSource(enum.Enum):
    """Source of order creation"""
    MANUAL = "manual"
    ONLINE = "online"
    PHONE = "phone"
    APP = "app"
    API = "api"


class SalesChannel(enum.Enum):
    """Sales channel classification"""
    DIRECT = "direct"
    WHOLESALE = "wholesale"
    RETAIL = "retail"


class BusinessModel(enum.Enum):
    """Business model types"""
    INDIVIDUAL_BAKERY = "individual_bakery"
    CENTRAL_BAKERY = "central_bakery"


# Procurement-related enums
class ProcurementPlanType(enum.Enum):
    """Procurement plan types"""
    REGULAR = "regular"
    EMERGENCY = "emergency"
    SEASONAL = "seasonal"


class ProcurementStrategy(enum.Enum):
    """Procurement strategies"""
    JUST_IN_TIME = "just_in_time"
    BULK = "bulk"
    MIXED = "mixed"


class RiskLevel(enum.Enum):
    """Risk level classifications"""
    LOW = "low"
    MEDIUM = "medium"
    HIGH = "high"
    CRITICAL = "critical"


class RequirementStatus(enum.Enum):
    """Procurement requirement status"""
    PENDING = "pending"
    APPROVED = "approved"
    ORDERED = "ordered"
    PARTIALLY_RECEIVED = "partially_received"
    RECEIVED = "received"
    CANCELLED = "cancelled"


class PlanStatus(enum.Enum):
    """Procurement plan status"""
    DRAFT = "draft"
    PENDING_APPROVAL = "pending_approval"
    APPROVED = "approved"
    IN_EXECUTION = "in_execution"
    COMPLETED = "completed"
    CANCELLED = "cancelled"


class DeliveryStatus(enum.Enum):
    """Delivery status for procurement"""
    PENDING = "pending"
    IN_TRANSIT = "in_transit"
    DELIVERED = "delivered"
    DELAYED = "delayed"
    CANCELLED = "cancelled"