<?php
/**
 * DB — single source of truth for all Autopilot table names.
 *
 * Usage: DB::workflows(), DB::logs(), etc.
 * Eliminates scattered string literals across the codebase.
 *
 * @package CartCue
 */

namespace CartCue;

defined( 'ABSPATH' ) || exit;

final class DB {

	public static function workflows(): string {
		global $wpdb;
		return $wpdb->prefix . 'ap_workflows';
	}

	public static function logs(): string {
		global $wpdb;
		return $wpdb->prefix . 'ap_logs';
	}

	public static function carts(): string {
		global $wpdb;
		return $wpdb->prefix . 'ap_carts';
	}

	/** Per-customer play frequency tracking. */
	public static function play_runs(): string {
		global $wpdb;
		return $wpdb->prefix . 'ap_play_runs';
	}

	/** Email open & click tracking. */
	public static function email_tracking(): string {
		global $wpdb;
		return $wpdb->prefix . 'ap_email_tracking';
	}

	/** Revenue attribution — links plays to orders. */
	public static function conversions(): string {
		global $wpdb;
		return $wpdb->prefix . 'ap_conversions';
	}

	/** Campaign grouping metadata. */
	public static function campaigns(): string {
		global $wpdb;
		return $wpdb->prefix . 'ap_campaigns';
	}

	/** Guest marketing consent records. */
	public static function consents(): string {
		global $wpdb;
		return $wpdb->prefix . 'ap_consents';
	}

	/** Unsubscribe reason survey responses. */
	public static function unsubscribe_reasons(): string {
		global $wpdb;
		return $wpdb->prefix . 'ap_unsubscribe_reasons';
	}

	/** Per-customer automation journey events. */
	public static function journey_events(): string {
		global $wpdb;
		return $wpdb->prefix . 'ap_journey_events';
	}
}
