package org.wyona.webapp.controllers.v2;

import io.swagger.annotations.*;

import lombok.AllArgsConstructor;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;

import org.wyona.webapp.models.LanguageEmail;

import lombok.extern.slf4j.Slf4j;
import org.wyona.webapp.models.katie.Domain;

/**
 * 'Katie Mockup Connector' Controller
 */
@Slf4j
@RestController
@RequestMapping(value = "/api/v2")
@AllArgsConstructor
public class KatieMockupConnectorController {

    /**
     * Create tenant
     */
    @PostMapping("/tenant")
    @ApiOperation(value = "Create tenant")
    ResponseEntity<String> createTenant(@RequestBody Domain domain
            ){
        log.info("TODO: Create tenant associated with Katie domain ID '" + domain.getId() + "' ...");
        return new ResponseEntity<>("{}", HttpStatus.OK);
    }

    /**
     * Delete tenant
     */
    @DeleteMapping("/tenant/{domain-id}")
    @ApiOperation(value = "Delete tenant")
    ResponseEntity<?> deleteTenant(
            @ApiParam(name = "domain-id", value = "Katie domain ID", required = true)
            @PathVariable(name = "domain-id", required = true) String domainId
    ){
        log.info("TODO: Delete tenant associated with Katie domain ID '" + domainId + "' ...");
        return new ResponseEntity<>(HttpStatus.OK);
    }
}

@@ -371,16 +371,58 @@
 .Domain;
+%0Aimport org.wyona.webapp.models.katie.QnA;
 %0A%0A/**%0A *
@@ -588,39 +588,144 @@
 ler 
-%7B%0A%0A    /**%0A     * Create tenant
+implements KatieConnectorController %7B%0A%0A    /**%0A     * @see org.wyona.webapp.controllers.v2.KatieConnectorController#createTenant(Domain)
 %0A   
@@ -796,32 +796,39 @@
 te tenant%22)%0A    
+public 
 ResponseEntity%3CS
@@ -877,22 +877,10 @@
 main
-%0A            
 )
+ 
 %7B%0A  
@@ -1059,29 +1059,98 @@
 %0A     * 
-Delete tenant
+@see org.wyona.webapp.controllers.v2.KatieConnectorController#deleteTenant(String)
 %0A     */
@@ -1239,16 +1239,23 @@
 t%22)%0A    
+public 
 Response
@@ -1603,11 +1603,339 @@
 );%0A    %7D
+%0A%0A    /**%0A     * @see org.wyona.webapp.controllers.v2.KatieConnectorController#train(QnA)%0A     */%0A    @PostMapping(%22/qna%22)%0A    @ApiOperation(value = %22Add QnA%22)%0A    public ResponseEntity%3CString%3E train(@RequestBody QnA qna) %7B%0A        log.info(%22TODO: Train QnA ...%22);%0A        return new ResponseEntity%3C%3E(%22%7B%7D%22, HttpStatus.OK);%0A    %7D
 %0A%7D%0A

implement interface