Tripinger Docs
Database

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.

ValueMeaningNotes
TRAVELERStandard customer account for public trip planning and booking.Used for public traveler features.
PARTNERGeneric supply-side account.Useful as a platform-level umbrella role.
HOTEL_PARTNERPartner account focused on accommodation inventory.May coexist with partner-type metadata.
VEHICLE_OWNERPartner account for vehicle supply.Matches the vehicle marketplace direction.
RESTAURANT_PARTNERPartner account for food-related inventory or reservations.Present in the partner workflow scope.
GUIDE_PARTNERPartner account for guided experiences or tours.Aligns with activity and guide flows.
ADMINInternal operations access.For moderation and platform control.
SUPER_ADMINHighest privileged internal role.Use sparingly and audit closely.
SUPPORT_AGENTInternal support-focused role.Mentioned in admin and API role guidance.
CONTENT_MODERATORInternal moderation role.Useful for reviews and community workflows.
COMPLIANCE_REVIEWERInternal verification and trust role.Aligns with listing and document review.
FINANCE_OPSInternal 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.

ValueMeaningNotes
PENDING_VERIFICATIONAccount exists but required identity verification is incomplete.Useful for email or phone verification steps.
ACTIVEAccount is active and allowed to use permitted features.Default operational state after verification.
SUSPENDEDAccount access is temporarily restricted.Should preserve auditability.
DISABLEDAccount is administratively disabled.Stronger restriction than suspension.
DELETEDAccount 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.

ValueMeaningNotes
INVITEDPartner has been invited but has not completed registration.Optional if invite-based onboarding exists.
REGISTEREDPartner account exists but onboarding is not complete.Early-stage state after sign-up.
ONBOARDINGPartner is actively completing onboarding requirements.Covers profile and document setup.
PENDING_VERIFICATIONSubmission is awaiting admin review.Distinct from identity login state.
APPROVEDPartner can access approved operational features.Enables listing and booking workflows.
REJECTEDSubmission was reviewed and not approved.Should usually pair with review notes.
SUSPENDEDPartner 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.

ValueMeaningNotes
HOTELAccommodation supplier.Includes hotels, villas, guesthouses, and similar stay providers.
VEHICLEMobility supplier.Includes tuk-tuks, bikes, scooters, cars, or fleets.
RESTAURANTFood or reservation partner.For dining and meal-related inventory.
ACTIVITYExperience or activity operator.For tours and structured experiences.
GUIDEGuide-led service provider.Useful when guide credentials need separate treatment.
EXPERIENCE_HOSTGeneral 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.

ValueMeaningNotes
NOT_SUBMITTEDRequired verification item has not been provided.Good for completeness checks.
SUBMITTEDItem was uploaded or submitted for review.Awaiting reviewer action.
UNDER_REVIEWReview has started.Useful when review queues are explicit.
APPROVEDItem passed verification.Enables dependent workflows.
REJECTEDItem failed review.Should pair with rejection reason metadata.
EXPIREDPreviously 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.

ValueMeaningNotes
DRAFTListing exists but is not ready for review or publication.Partner-editable working state.
PENDING_REVIEWListing awaits admin or automated checks.Particularly useful for launch-stage trust workflows.
APPROVEDListing passed review requirements.Not necessarily public unless publication rules require it.
PUBLISHEDListing is visible to users.Public marketplace state.
UNPUBLISHEDListing is hidden without being deleted.For temporary removal or content issues.
SUSPENDEDListing is blocked for trust, policy, or compliance reasons.Requires strong audit context.
ARCHIVEDListing 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.

ValueMeaningNotes
AVAILABLEInventory is open for booking.Standard bookable state.
UNAVAILABLEInventory cannot be booked.General blocked state.
BLOCKEDInventory intentionally withheld by partner or admin.Useful for maintenance or owner holdback.
RESERVEDInventory is tentatively held.Use carefully with timeout rules.
BOOKEDInventory 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.

ValueMeaningNotes
DRAFTBooking has been initiated but not submitted or confirmed.Useful for itinerary-linked or pre-checkout flows.
PENDING_CONFIRMATIONBooking request exists but awaits a required action.May be used for supply requiring manual confirmation.
PENDING_PAYMENTBooking is awaiting successful payment completion.Should not be treated as confirmed inventory unless rules say so.
CONFIRMEDBooking is valid and accepted.Core post-payment or post-approval state.
IN_PROGRESSBooking is currently being fulfilled.Useful for check-in, active rental, or ongoing experience states.
COMPLETEDBooking successfully concluded.Enables review and reporting workflows.
CANCELLEDBooking was cancelled before completion.Should pair with cancellation metadata.
REFUNDEDBooking financial outcome includes refund completion.Consider whether this is booking state or payment state in implementation.
FAILEDBooking 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.

ValueMeaningNotes
INITIATEDPayment intent or transaction has been created.Earliest durable state.
PENDINGProvider outcome is not final yet.Common for asynchronous gateways.
AUTHORIZEDPayment is authorized but not fully captured.Use only if provider flow requires it.
SUCCEEDEDPayment completed successfully.Core success state.
FAILEDPayment attempt failed.Keep provider reason codes separately.
CANCELLEDPayment was cancelled before completion.Distinct from booking cancellation.
REFUNDEDFunds were returned after success.May be partial or full, tracked by related fields.
DISPUTEDPayment 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.

ValueMeaningNotes
PENDINGPayout is expected but not yet released.Default state after eligible earnings accrue.
PROCESSINGPayout is actively being processed.Useful for batch or provider-driven settlement steps.
PAIDPayout completed successfully.Final success state.
FAILEDPayout attempt failed.Should preserve operator follow-up context.
BLOCKEDPayout 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.

ValueMeaningNotes
PENDINGReview exists but is not yet visible or finalized.Useful for pre-moderation or eligibility checks.
PUBLISHEDReview is visible in the product.Standard public state.
FLAGGEDReview requires moderation attention.Used for trust and abuse control.
HIDDENReview is retained but not publicly visible.Useful for investigations and temporary actions.
REMOVEDReview 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.

ValueMeaningNotes
OPENModeration case has not been resolved.Default review queue state.
IN_REVIEWA moderator is actively investigating.Useful for operational assignment flows.
ACTIONEDA moderation decision has been applied.Works with linked resolution metadata.
DISMISSEDReport or flag did not require action.Important for audit clarity.
ESCALATEDCase 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.

ValueMeaningNotes
OPENCase has been created and awaits handling.Initial service state.
IN_PROGRESSAn agent is actively working the case.Core operational state.
WAITING_ON_USERProgress is blocked pending user input.Useful for account or booking clarifications.
WAITING_ON_PARTNERProgress is blocked pending supplier input.Common in booking disputes or operations.
RESOLVEDCase reached a satisfactory outcome.Closure-ready state.
CLOSEDCase is formally closed.Final archived operational state.
ESCALATEDCase 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.

ValueMeaningNotes
LOWLimited operational impact.Minor issue with no immediate risk.
MEDIUMMaterial issue needing prompt review.Important but not urgent crisis level.
HIGHSerious issue with trust, financial, or service impact.Requires prioritized handling.
CRITICALSevere 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.

ValueMeaningNotes
EMAILEmail delivery channel.For confirmations, resets, and transactional notices.
SMSText messaging channel.For urgent short-form communication.
WHATSAPPWhatsApp-based delivery where enabled.Mentioned as optional messaging flow.
PUSHMobile or browser push notification.Useful for future mobile and realtime flows.
IN_APPIn-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_STATUS is about whether an account can use the platform.
  • PARTNER_ACCOUNT_STATE is about where a supplier sits in onboarding or approval.
  • VERIFICATION_STATUS is about the review result for a document, identity item, or trust-sensitive submission.
  • LISTING_STATUS is about whether inventory is drafted, approved, visible, or blocked.
  • BOOKING_STATUS is about reservation lifecycle.
  • PAYMENT_STATUS is 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.md if rollout guidance changes,
  • update docs/database/ERD.md if 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.

On this page