export interface CreateClubDto {
  name: string;
  slug: string;
  ownerId?: string;
  settings?: Record<string, unknown>;
}

export interface Club {
  id: string;
  name: string;
  slug: string;
  isActive: boolean;
  createdAt: Date;
  updatedAt: Date;
}

/**
 * TenantStrategy — abstraction for multi-tenancy isolation.
 *
 * MVP: RlsTenantStrategy (Shared DB + RLS).
 * Post-MVP: DbPerTenantStrategy, K8sNamespaceStrategy.
 */
export interface TenantStrategy {
  /**
   * Resolve the club (tenant) ID from the incoming request.
   */
  resolve(req: unknown): string;

  /**
   * Apply data isolation for the given club.
   * For RLS: SET app.club_id = clubId.
   */
  applyIsolation(clubId: string): Promise<void>;

  /**
   * Provision a new club environment.
   * For RLS: create a row in the clubs table.
   * For DB-per-tenant: create a new database.
   */
  provision(club: CreateClubDto): Promise<Club>;

  /**
   * Deprovision (deactivate) a club environment.
   */
  deprovision(clubId: string): Promise<void>;
}
