import { Body, Controller, Get, Post } from '@nestjs/common';
import { DEMO_CHARACTER_ID } from '../demo/demo-character.constants';
import { StartTravelDto } from './dto/start-travel.dto';
import { TravelService } from './travel.service';

@Controller('travel')
export class TravelController {
  constructor(private readonly travelService: TravelService) {}

  @Post()
  startTravel(@Body() request: StartTravelDto) {
    return this.travelService.startTravel(
      DEMO_CHARACTER_ID,
      request.targetLocationId,
    );
  }

  @Get('current')
  getCurrentTravel() {
    return this.travelService.completeTravelIfDue(DEMO_CHARACTER_ID);
  }
}
