jest.mock('./wc2026-outright.sync', () => ({
  syncWc2026OutrightMarket: jest.fn().mockResolvedValue(undefined),
}));

import { OutrightService } from './outright.service';

describe('OutrightService listForPlayer', () => {
  let prisma: { match: { findMany: jest.Mock } };
  let service: OutrightService;

  beforeEach(() => {
    prisma = {
      match: { findMany: jest.fn().mockResolvedValue([]) },
    };
    service = new OutrightService(prisma as never, {} as never);
  });

  it('returns only published outright markets for player browse', async () => {
    await service.listForPlayer('zh-CN');

    expect(prisma.match.findMany).toHaveBeenCalledWith(
      expect.objectContaining({
        where: expect.objectContaining({
          status: 'PUBLISHED',
          isOutright: true,
          sportType: 'FOOTBALL',
          deletedAt: null,
          league: { isActive: true, deletedAt: null },
        }),
      }),
    );
  });
});
