Enums
This document defines the shared enum vocabulary intended for Tripinger's relational database layer.
Document Purpose
This document defines the shared enum vocabulary intended for Tripinger's relational database layer. It exists so schema design, API behavior, partner workflows, admin tooling, and frontend state handling can use the same approved status language instead of drifting into inconsistent field values across modules.
The root documentation map already reserves this file as the dedicated reference for shared enum definitions inside docs/database/. That makes this document the canonical place to describe lifecycle values, role values, and constrained status sets that recur across identity, listings, bookings, payments, reviews, and operational workflows.
Why Enums Matter
Tripinger is planned as a multi-surface platform with a public traveler application, partner portal, admin dashboard, and shared backend API. Because the same business entities move through onboarding, approval, publication, booking, payment, moderation, and support flows across all of those surfaces, the platform needs a consistent status language that can be enforced at the schema level and understood at the application level.
The architecture and API direction both emphasize explicit workflow state, auditability, and role-aware operations. Shared enums help support those goals by making lifecycle transitions visible, constrained, and predictable instead of leaving core business state to loosely typed strings or undocumented conventions.
Enum Design Rules
The following rules should guide enum design throughout the database module.
- Prefer enums for stable business vocabularies that are reused across services or UI surfaces.
- Use descriptive values that reflect business meaning, not UI wording or color labels.
- Keep enum names singular and uppercase in documentation, while allowing implementation naming to follow the ORM or SQL conventions chosen later.
- Add values conservatively, because enum growth affects schema changes, API contracts, validation logic, analytics, and admin tooling.
- Document every enum change alongside migration changes and ERD changes when relationships or workflow meaning are affected.
- Treat enums as shared product language, not only database implementation details.
Enum Usage Guidance
Not every constrained field must be an actual database enum type. In some cases, a check constraint, lookup table, or application-layer validation model may be more appropriate depending on change frequency and reporting needs. This document still defines the approved business vocabulary even when the final physical implementation differs.
A practical rule for Tripinger is:
- use enums for stable workflow states and roles,
- consider lookup tables for admin-managed or frequently expanding taxonomies,
- and avoid duplicating near-identical status sets under slightly different names across modules.
Shared Enum Catalog
The following enums are the recommended baseline for the current documented platform scope. They reflect the workflows already implied by the platform overview, architecture, admin app, partner portal, and API documents.
USER_ROLE
Defines broad platform access roles used for authorization and operational separation. The API direction already identifies traveler, partner, admin, and internal staff style roles, while the admin and partner application documents further refine internal and partner access patterns.
| Value | Meaning | Notes |
|---|---|---|
| TRAVELER | Standard customer account for public trip planning and booking. | Used for public traveler features. |
| PARTNER | Generic supply-side account. | Useful as a platform-level umbrella role. |
| HOTEL_PARTNER | Partner account focused on accommodation inventory. | May coexist with partner-type metadata. |
| VEHICLE_OWNER | Partner account for vehicle supply. | Matches the vehicle marketplace direction. |
| RESTAURANT_PARTNER | Partner account for food-related inventory or reservations. | Present in the partner workflow scope. |
| GUIDE_PARTNER | Partner account for guided experiences or tours. | Aligns with activity and guide flows. |
| ADMIN | Internal operations access. | For moderation and platform control. |
| SUPER_ADMIN | Highest privileged internal role. | Use sparingly and audit closely. |
| SUPPORT_AGENT | Internal support-focused role. | Mentioned in admin and API role guidance. |
| CONTENT_MODERATOR | Internal moderation role. | Useful for reviews and community workflows. |
| COMPLIANCE_REVIEWER | Internal verification and trust role. | Aligns with listing and document review. |
| FINANCE_OPS | Internal role for payment and payout visibility. | Aligns with operational finance workflows. |
ACCOUNT_STATUS
Defines the state of a user account at the identity and access layer. This should be distinct from partner approval state or listing publication state so authentication logic does not become entangled with marketplace workflow state.
| Value | Meaning | Notes |
|---|---|---|
| PENDING_VERIFICATION | Account exists but required identity verification is incomplete. | Useful for email or phone verification steps. |
| ACTIVE | Account is active and allowed to use permitted features. | Default operational state after verification. |
| SUSPENDED | Account access is temporarily restricted. | Should preserve auditability. |
| DISABLED | Account is administratively disabled. | Stronger restriction than suspension. |
| DELETED | Account is logically removed or no longer usable. | Prefer soft-delete semantics where needed for audit. |
PARTNER_ACCOUNT_STATE
Defines where a partner sits in the supply-side lifecycle. The partner portal explicitly describes account states such as invited, registered, onboarding, pending verification, approved, and suspended, making this one of the clearest enum candidates in the current documentation set.
| Value | Meaning | Notes |
|---|---|---|
| INVITED | Partner has been invited but has not completed registration. | Optional if invite-based onboarding exists. |
| REGISTERED | Partner account exists but onboarding is not complete. | Early-stage state after sign-up. |
| ONBOARDING | Partner is actively completing onboarding requirements. | Covers profile and document setup. |
| PENDING_VERIFICATION | Submission is awaiting admin review. | Distinct from identity login state. |
| APPROVED | Partner can access approved operational features. | Enables listing and booking workflows. |
| REJECTED | Submission was reviewed and not approved. | Should usually pair with review notes. |
| SUSPENDED | Partner access or trading capability is temporarily blocked. | For trust, safety, or compliance reasons. |
PARTNER_TYPE
Defines the supply-side business category associated with a partner organization or owner profile. The platform scope and partner portal both describe multiple provider classes, including hotels, vehicle owners, restaurants, guides, activities, and broader local experiences.
| Value | Meaning | Notes |
|---|---|---|
| HOTEL | Accommodation supplier. | Includes hotels, villas, guesthouses, and similar stay providers. |
| VEHICLE | Mobility supplier. | Includes tuk-tuks, bikes, scooters, cars, or fleets. |
| RESTAURANT | Food or reservation partner. | For dining and meal-related inventory. |
| ACTIVITY | Experience or activity operator. | For tours and structured experiences. |
| GUIDE | Guide-led service provider. | Useful when guide credentials need separate treatment. |
| EXPERIENCE_HOST | General local host or niche operator. | Supports future growth without overloading other types. |
VERIFICATION_STATUS
Defines the review result for compliance-sensitive records such as partner applications, documents, and trust-related checks. The admin and partner docs both rely on clear verification visibility and approval workflows.
| Value | Meaning | Notes |
|---|---|---|
| NOT_SUBMITTED | Required verification item has not been provided. | Good for completeness checks. |
| SUBMITTED | Item was uploaded or submitted for review. | Awaiting reviewer action. |
| UNDER_REVIEW | Review has started. | Useful when review queues are explicit. |
| APPROVED | Item passed verification. | Enables dependent workflows. |
| REJECTED | Item failed review. | Should pair with rejection reason metadata. |
| EXPIRED | Previously accepted item is no longer valid. | Important for licenses and insurance. |
LISTING_STATUS
Defines the publication state of supply-side inventory such as hotels, vehicles, activities, or restaurants. This should remain separate from verification status because a verified listing may still be unpublished, paused, or archived for business reasons.
| Value | Meaning | Notes |
|---|---|---|
| DRAFT | Listing exists but is not ready for review or publication. | Partner-editable working state. |
| PENDING_REVIEW | Listing awaits admin or automated checks. | Particularly useful for launch-stage trust workflows. |
| APPROVED | Listing passed review requirements. | Not necessarily public unless publication rules require it. |
| PUBLISHED | Listing is visible to users. | Public marketplace state. |
| UNPUBLISHED | Listing is hidden without being deleted. | For temporary removal or content issues. |
| SUSPENDED | Listing is blocked for trust, policy, or compliance reasons. | Requires strong audit context. |
| ARCHIVED | Listing is no longer active but retained for history. | Supports long-term reporting and references. |
AVAILABILITY_STATUS
Defines slot or inventory availability states used by hotels, vehicles, restaurants, and activities. The partner portal and product scope both depend on availability management as a core workflow.
| Value | Meaning | Notes |
|---|---|---|
| AVAILABLE | Inventory is open for booking. | Standard bookable state. |
| UNAVAILABLE | Inventory cannot be booked. | General blocked state. |
| BLOCKED | Inventory intentionally withheld by partner or admin. | Useful for maintenance or owner holdback. |
| RESERVED | Inventory is tentatively held. | Use carefully with timeout rules. |
| BOOKED | Inventory is committed to a booking. | Finalized occupancy state. |
BOOKING_STATUS
Defines the booking lifecycle. Booking state is one of the most important workflow vocabularies in the platform because the architecture centers booking creation, validation, payment confirmation, cancellation, and downstream notifications around it.
| Value | Meaning | Notes |
|---|---|---|
| DRAFT | Booking has been initiated but not submitted or confirmed. | Useful for itinerary-linked or pre-checkout flows. |
| PENDING_CONFIRMATION | Booking request exists but awaits a required action. | May be used for supply requiring manual confirmation. |
| PENDING_PAYMENT | Booking is awaiting successful payment completion. | Should not be treated as confirmed inventory unless rules say so. |
| CONFIRMED | Booking is valid and accepted. | Core post-payment or post-approval state. |
| IN_PROGRESS | Booking is currently being fulfilled. | Useful for check-in, active rental, or ongoing experience states. |
| COMPLETED | Booking successfully concluded. | Enables review and reporting workflows. |
| CANCELLED | Booking was cancelled before completion. | Should pair with cancellation metadata. |
| REFUNDED | Booking financial outcome includes refund completion. | Consider whether this is booking state or payment state in implementation. |
| FAILED | Booking could not be completed due to validation or transaction failure. | Useful for error handling and analytics. |
PAYMENT_STATUS
Defines the lifecycle of a payment record. The platform uses PayHere for local flows and Stripe for international flows, and the architecture stresses that booking state transitions should follow verified payment outcomes rather than frontend callbacks alone.
| Value | Meaning | Notes |
|---|---|---|
| INITIATED | Payment intent or transaction has been created. | Earliest durable state. |
| PENDING | Provider outcome is not final yet. | Common for asynchronous gateways. |
| AUTHORIZED | Payment is authorized but not fully captured. | Use only if provider flow requires it. |
| SUCCEEDED | Payment completed successfully. | Core success state. |
| FAILED | Payment attempt failed. | Keep provider reason codes separately. |
| CANCELLED | Payment was cancelled before completion. | Distinct from booking cancellation. |
| REFUNDED | Funds were returned after success. | May be partial or full, tracked by related fields. |
| DISPUTED | Payment is under dispute or chargeback review. | Important for finance operations. |
PAYOUT_STATUS
Defines the state of partner payout processing. Both the admin and partner documentation mention payout visibility, settlement awareness, and finance-related review workflows.
| Value | Meaning | Notes |
|---|---|---|
| PENDING | Payout is expected but not yet released. | Default state after eligible earnings accrue. |
| PROCESSING | Payout is actively being processed. | Useful for batch or provider-driven settlement steps. |
| PAID | Payout completed successfully. | Final success state. |
| FAILED | Payout attempt failed. | Should preserve operator follow-up context. |
| BLOCKED | Payout cannot proceed due to verification, dispute, or policy issue. | Important for finance and compliance views. |
REVIEW_STATUS
Defines moderation and publication state for user reviews. Verified reviews and moderation workflows are central to the trust model described across the project documents.
| Value | Meaning | Notes |
|---|---|---|
| PENDING | Review exists but is not yet visible or finalized. | Useful for pre-moderation or eligibility checks. |
| PUBLISHED | Review is visible in the product. | Standard public state. |
| FLAGGED | Review requires moderation attention. | Used for trust and abuse control. |
| HIDDEN | Review is retained but not publicly visible. | Useful for investigations and temporary actions. |
| REMOVED | Review was removed due to policy or operational decision. | Preserve moderation history separately. |
MODERATION_STATUS
Defines the internal moderation state for reviews, posts, listings, or reported content. The admin app expects dedicated moderation workflows, including flag handling, visibility changes, abuse review, and appeal notes.
| Value | Meaning | Notes |
|---|---|---|
| OPEN | Moderation case has not been resolved. | Default review queue state. |
| IN_REVIEW | A moderator is actively investigating. | Useful for operational assignment flows. |
| ACTIONED | A moderation decision has been applied. | Works with linked resolution metadata. |
| DISMISSED | Report or flag did not require action. | Important for audit clarity. |
| ESCALATED | Case has been pushed to a higher-trust or specialized queue. | Useful for legal, safety, or fraud concerns. |
SUPPORT_CASE_STATUS
Defines the lifecycle of internal or user-facing support cases. The admin app explicitly includes support searches, internal notes, escalation handling, and safe support workflows.
| Value | Meaning | Notes |
|---|---|---|
| OPEN | Case has been created and awaits handling. | Initial service state. |
| IN_PROGRESS | An agent is actively working the case. | Core operational state. |
| WAITING_ON_USER | Progress is blocked pending user input. | Useful for account or booking clarifications. |
| WAITING_ON_PARTNER | Progress is blocked pending supplier input. | Common in booking disputes or operations. |
| RESOLVED | Case reached a satisfactory outcome. | Closure-ready state. |
| CLOSED | Case is formally closed. | Final archived operational state. |
| ESCALATED | Case was escalated to a specialized team. | For finance, compliance, or incident review. |
INCIDENT_SEVERITY
Defines the severity level for safety, fraud, compliance, or operational incidents. The platform documents mention complaint records, safety report intake, emergency escalation flags, and high-risk booking visibility, which supports a severity-based classification model.
| Value | Meaning | Notes |
|---|---|---|
| LOW | Limited operational impact. | Minor issue with no immediate risk. |
| MEDIUM | Material issue needing prompt review. | Important but not urgent crisis level. |
| HIGH | Serious issue with trust, financial, or service impact. | Requires prioritized handling. |
| CRITICAL | Severe issue requiring immediate escalation. | Use for emergency, fraud, or major safety events. |
NOTIFICATION_CHANNEL
Defines outbound communication channels used for transactional and operational messaging. The platform architecture includes email, SMS or WhatsApp, push notifications, and related notification workflows.
| Value | Meaning | Notes |
|---|---|---|
| Email delivery channel. | For confirmations, resets, and transactional notices. | |
| SMS | Text messaging channel. | For urgent short-form communication. |
| WhatsApp-based delivery where enabled. | Mentioned as optional messaging flow. | |
| PUSH | Mobile or browser push notification. | Useful for future mobile and realtime flows. |
| IN_APP | In-product notification record. | Useful for dashboards and account centers. |
Separation Rules
Several enums may look similar but should remain distinct because they describe different business concerns.
ACCOUNT_STATUSis about whether an account can use the platform.PARTNER_ACCOUNT_STATEis about where a supplier sits in onboarding or approval.VERIFICATION_STATUSis about the review result for a document, identity item, or trust-sensitive submission.LISTING_STATUSis about whether inventory is drafted, approved, visible, or blocked.BOOKING_STATUSis about reservation lifecycle.PAYMENT_STATUSis about money movement and gateway outcome.
Keeping these vocabularies separate prevents the common mistake of overloading one status field to represent multiple kinds of business state at once.
Implementation Notes
The final schema implementation may use native PostgreSQL enums, ORM-managed enum types, check constraints, or reference tables depending on the migration strategy and ORM selection used in the repository. The API documentation currently suggests a NestJS backend with a relational database setup and a likely Prisma-based workflow, but exact implementation details should remain aligned with the committed codebase once scaffolding is finalized.
Regardless of the physical implementation, the following should remain true:
- enum names and meanings should be documented here first,
- migration changes should preserve backward compatibility where feasible,
- API response and validation conventions should reuse the same status vocabulary,
- and admin or partner interfaces should not invent parallel labels for the same business state without explicit translation rules.
Change Management
Any enum change can affect schema migrations, seed data, API validation, filters, analytics, dashboards, and role-based behavior across the public web app, admin dashboard, and partner portal. For that reason, enum changes should be treated as cross-cutting changes rather than minor local edits.
When adding or changing an enum:
- update this file,
- update
docs/database/MIGRATIONS.mdif rollout guidance changes, - update
docs/database/ERD.mdif entity relationships or state meaning are affected, - and verify that application-facing documentation remains aligned where relevant.
Current Status
This enum catalog defines the recommended shared vocabulary for the current documented scope of Tripinger. It should evolve as concrete schemas and workflows are committed, but it should continue to preserve a clear principle: stable business states need shared names, shared meanings, and shared rules across the entire platform.