package com.example.cezenPBX.controller;

import com.example.cezenPBX.DTO.ReturnStatus;
import com.example.cezenPBX.DTO.user.AdminSetPasswordDTO;
import com.example.cezenPBX.service.PbxUserService;
import jakarta.validation.Valid;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/open")
public class SignUpController {

    @Autowired
    private PbxUserService pbxUserService;

    //sign up route
    @PostMapping("/signup")
    public ReturnStatus signUp(@RequestBody @Valid AdminSetPasswordDTO adminSetPasswordDTO){

        return this.pbxUserService.adminSetUserNamePasswordSet(
                adminSetPasswordDTO.userName(),
                adminSetPasswordDTO.password(),
                adminSetPasswordDTO.confirmPassword(),
                adminSetPasswordDTO.email()
        );
    }

    // and a login route
    @GetMapping("/login")
    public ReturnStatus login(){
        return  new ReturnStatus(true, "Welcome user authenticated successfully", "");
    }



    // forgot password
}
