package de.szut.casino.health;

import de.szut.casino.security.service.EmailService;
import de.szut.casino.user.UserEntity;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

@RestController
public class HealthController {

    @Autowired
    private EmailService emailService;

    @GetMapping("/health")
    public Map<String, String> healthCheck() {
        UserEntity user = new UserEntity();
        user.setEmail("user@mail.com");
        user.setUsername("user");

        this.emailService.sendRegistrationEmail(user);

        return Map.of("status", "UP");
    }
}
