import { InjectionToken, inject } from '@angular/core';
import { environment } from '../../../../environments/environment';
import { MarketplaceGateway } from './marketplace-gateway.interface';
import { MarketplaceLocalGateway } from './marketplace-local.gateway';
import { MarketplaceApiGateway } from './marketplace-api.gateway';

/** Swap point for docs/backend/PHASE-9-TENANT-REGISTRY-DOMAINS-CONTRACT.md. */
export const MARKETPLACE_GATEWAY = new InjectionToken<MarketplaceGateway>('MARKETPLACE_GATEWAY', {
  providedIn: 'root',
  factory: () => (environment.useMockData ? inject(MarketplaceLocalGateway) : inject(MarketplaceApiGateway)),
});
