package sg.ncl.service.registration.controllers;

import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.*;
import sg.ncl.service.registration.RegistrationService;
import sg.ncl.service.registration.dtos.RegistrationInfo;

import javax.inject.Inject;

/**
 * @author Te Ye & Desmond
 */
@RestController
@RequestMapping(path = "/registrations", produces = MediaType.APPLICATION_JSON_VALUE)
public class RegistrationController {

    private final RegistrationService registrationService;

    @Inject
    protected RegistrationController(final RegistrationService registrationService) {
        this.registrationService = registrationService;
    }

    @RequestMapping(method = RequestMethod.POST)
    @ResponseStatus(HttpStatus.OK)
    public void register(@RequestBody RegistrationInfo registrationInfo) {
        registrationService.register(registrationInfo.getCredentials(), registrationInfo.getUser(), registrationInfo.getTeam(), registrationInfo.getIsJoinTeam());
    }
}

@@ -236,16 +236,74 @@
 ervice;%0A
+import sg.ncl.service.registration.dtos.RegistrationData;%0A
 import s
@@ -934,24 +934,293 @@
 tionInfo) %7B%0A
+//        System.out.println(%22User: %22 + registrationInfo.getUser());%0A//        System.out.println(%22Team: %22 + registrationInfo.getTeam());%0A//        System.out.println(%22Registration: %22 + registrationInfo.getRegistration());%0A        if (registrationInfo.getIsJoinTeam())%0A
         regi

Revert "remove line to apply for new team"