package com.spring.web.controller;

import java.util.List;
import java.util.stream.Collectors;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import com.spring.domain.user.entity.AgentUserRole;

@Controller
@RequestMapping("/")
public class SignController {
    
    @GetMapping
	public String signIn(Model model) {
		List<AgentUserRole> roles = List.of(AgentUserRole.values()).stream()
			.filter(role -> !role.getRole().equals(AgentUserRole.ROLE_SUPER.name()))
			.collect(Collectors.toList()); 	
		model.addAttribute("roles", roles);
		return "pages/sign/sign-in";
	}

}
