Skip to content

Domain Enum Reference

Yaya Engine represents every state machine and category in its domain as a PHP backed enum under app/Enums/, rather than as a database check constraint or a free-text string column. There are 23 of these enums, and they cluster into four domains: messaging and channels, alerts, user actions/verifications/payouts, and locale/admin. Each enum below is listed with its case values and the notable behavior methods it carries beyond the usual label(). See Domain model for how these enums attach to Eloquent models, and Preparation plans for how the action/step/ payout group forms one lifecycle.

Messaging and channels

Enum Cases Notes
ChannelTypeEnum whatsapp, sms, pwa, telegram Carries requiresPhoneNumber(): true for sms/whatsapp, false for pwa/telegram — the fact the channel abstraction uses to decide whether a channel needs a phone number to route through [@channel-type-enum]
ConversationStatusEnum active, closed, archived [@conversation-status-enum]
MessageDirectionEnum inbound, outbound [@message-direction-enum]
DeliveryLogEventTypeEnum sent, delivered, read, failed, webhook_received [@delivery-log-event-type-enum]
ErrorCategoryEnum permanent, retryable, rate_limit Classifies a delivery failure so the messaging pipeline knows whether to retry [@error-category-enum]
MessageBatchStatusEnum pending, processing, dispatched, completed, failed [@message-batch-status-enum]
SmsBroadcastStatusEnum queued, completed, failed [@sms-broadcast-status-enum]

Alerts

Enum Cases Notes
AlertTypeEnum yellow, orange, red [@alert-type-enum]
AlertSeverityEnum yellow, orange, red Same three values as AlertTypeEnum but a distinct enum — type and severity are tracked as separate columns on Alert [@alert-severity-enum]
AlertSubscriptionStatusEnum inactive, active Whether a user currently receives alert dispatches [@alert-subscription-status-enum]
AlertSendStrategyEnum default, custom [@alert-send-strategy-enum]
AlertLevelFitEnum pre-alert, yellow, orange, red Adds a pre-alert case ahead of the three severity colors, used where a preparation action needs to fit against a pre-alert window as well as a live severity [@alert-level-fit-enum]

Actions, verifications, and payouts

These three enums track one lifecycle end to end: a UserAction moves through UserActionStatusEnum, each of its UserActionStep rows moves through UserActionStepStatusEnum, a rejected step records why via RejectionReasonCategoryEnum, and completing every step can produce a RequestedPayout that moves through PayoutStatusEnum. This is the same chain the MCP verification and payout tools read and write.

Enum Cases Notes
UserActionStatusEnum assigned, active, expired, completed [@user-action-status-enum]
UserActionStepStatusEnum pending, evidence_uploaded, approved, rejected, completed evidence_uploaded is the state ListPendingVerificationsTool queries for its review queue [@user-action-step-status-enum]
RejectionReasonCategoryEnum image_unclear, wrong_evidence, fraud Chosen so the user receives a tailored rejection notification per category [@rejection-reason-category-enum]
PayoutStatusEnum pending, approved, paid, cancelled [@payout-status-enum]
FeasibilityEnum high, moderate, low [@feasibility-enum]
LoanOfferingTypeEnum ussd, url Implements Filament's HasLabel directly (getLabel()) rather than the plain label() every other enum here uses, since it renders inside a Filament form field [@loan-offering-type-enum]

Locale and admin

Enum Cases Notes
LocaleEnum en (English), sw (Swahili), es (Spanish), am (Amharic) The four locales yaya-engine ships copy for; see verified vs onboarded and the Telegram locale override decision for how a user's locale is resolved [@locale-enum]
GenderEnum male, female, other [@gender-enum]
AdminRoleEnum admin, verifier, viewer A legacy admin-panel role enum, distinct from the Spatie permission roles (super_admin, mcp_admin, mcp_viewer, manager) that AdminAccess::roles() defines for RBAC [@admin-role-enum] [@admin-access]
NotificationTypeEnum validation_pending, validation_approved, validation_rejected, payout_requested, payout_processed, new_user, alert_triggered Categorizes manager-facing in-app notifications [@notification-type-enum]
PhoneRequestReasonEnum payout_created, registration_reminder, post_alert_immediate, post_alert_followup Has no label() method — it exists purely as a typed reason code passed between the phone-request commands and jobs [@phone-request-reason-enum]
TelegramLocationRequestVariant generic, flood Not a persisted-state enum but a broadcast-copy selector: it exposes sentAtColumn(), requestKey(), buttonKey(), and mixpanelSource() so the generic (ENG-374) and Ethiopia flood/rain (ENG-539) location-share campaigns track "prompted once" independently and never collide. Selection is a command flag on telegram:broadcast-location-request, never derived from the user's locale [@telegram-location-request-variant]