2025-09-19 11:44:38 +02:00
|
|
|
# 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"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class DeliveryMethod(enum.Enum):
|
|
|
|
|
"""Order delivery methods"""
|
|
|
|
|
DELIVERY = "delivery"
|
|
|
|
|
PICKUP = "pickup"
|
2025-10-17 07:31:14 +02:00
|
|
|
STANDARD = "standard" # Standard delivery method
|
2025-09-19 11:44:38 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
class PaymentTerms(enum.Enum):
|
|
|
|
|
"""Payment terms for customers and orders"""
|
|
|
|
|
IMMEDIATE = "immediate"
|
2025-10-17 07:31:14 +02:00
|
|
|
NET_15 = "net_15"
|
2025-09-19 11:44:38 +02:00
|
|
|
NET_30 = "net_30"
|
|
|
|
|
NET_60 = "net_60"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class PaymentMethod(enum.Enum):
|
|
|
|
|
"""Payment methods for orders"""
|
|
|
|
|
CASH = "cash"
|
|
|
|
|
CARD = "card"
|
2025-10-17 07:31:14 +02:00
|
|
|
CREDIT_CARD = "credit_card" # Credit card payment
|
|
|
|
|
CHECK = "check" # Bank check/cheque payment
|
2025-09-19 11:44:38 +02:00
|
|
|
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"""
|
2025-10-21 19:50:07 +02:00
|
|
|
URGENT = "urgent"
|
2025-09-19 11:44:38 +02:00
|
|
|
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"
|