import { InjectionToken, inject } from '@angular/core';
import { environment } from '../../../../environments/environment';
import { MallContentGateway } from './mall-content-gateway.interface';
import { MallContentLocalGateway } from './mall-content-local.gateway';
import { MallContentApiGateway } from './mall-content-api.gateway';

/** Swap point for docs/backend/PHASE-10-CONTENT-MODULES-CONTRACT.md. */
export const MALL_CONTENT_GATEWAY = new InjectionToken<MallContentGateway>('MALL_CONTENT_GATEWAY', {
  providedIn: 'root',
  factory: () => (environment.useMockData ? inject(MallContentLocalGateway) : inject(MallContentApiGateway)),
});
