import { InjectionToken, inject } from '@angular/core';
import { environment } from '../../../../../environments/environment';
import { AdminOrdersGateway } from './admin-orders-gateway.interface';
import { AdminOrdersLocalGateway } from './admin-orders-local.gateway';
import { AdminOrdersApiGateway } from './admin-orders-api.gateway';

/** Swap point for docs/backend/PHASE-2-ORDERS-NOTIFICATIONS-CONTRACT.md. */
export const ADMIN_ORDERS_GATEWAY = new InjectionToken<AdminOrdersGateway>('ADMIN_ORDERS_GATEWAY', {
  providedIn: 'root',
  factory: () => (environment.useMockData ? inject(AdminOrdersLocalGateway) : inject(AdminOrdersApiGateway)),
});
