import 'package:krow_domain/krow_domain.dart';

// TODO: Implement EventRepositoryInterface once defined in a feature package.
class EventRepositoryMock {
  Future<Assignment> applyForPosition(String positionId, String staffId) async {
    await Future<void>.delayed(const Duration(milliseconds: 600));
    return Assignment(
      id: 'assign_1',
      positionId: positionId,
      staffId: staffId,
      status: AssignmentStatus.assigned,
    );
  }

  Future<Event?> getEvent(String id) async {
    await Future<void>.delayed(const Duration(milliseconds: 300));
    return _mockEvent;
  }

  Future<List<EventShift>> getEventShifts(String eventId) async {
    await Future<void>.delayed(const Duration(milliseconds: 300));
    return <EventShift>[
      const EventShift(
        id: 'shift_1',
        eventId: 'event_1',
        name: 'Morning Setup',
        address: 'Hyde Park, London',
      ),
    ];
  }

  Future<List<Assignment>> getStaffAssignments(String staffId) async {
    await Future<void>.delayed(const Duration(milliseconds: 500));
    return <Assignment>[
      const Assignment(
        id: 'assign_1',
        positionId: 'pos_1',
        staffId: 'staff_1',
        status: AssignmentStatus.confirmed,
      ),
    ];
  }

  Future<List<Event>> getUpcomingEvents() async {
    await Future<void>.delayed(const Duration(milliseconds: 800));
    return <Event>[_mockEvent];
  }

  static final Event _mockEvent = Event(
    id: 'event_1',
    businessId: 'biz_1',
    hubId: 'hub_1',
    name: 'Summer Festival 2026',
    date: DateTime.now().add(const Duration(days: 10)),
    status: EventStatus.active,
    contractType: 'freelance',
  );
}