package com.interplug.qcast.biz.specialNote;

import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseStatus;
import org.springframework.web.bind.annotation.RestController;
import com.interplug.qcast.biz.specialNote.dto.SpecialNoteItemRequest;
import com.interplug.qcast.biz.specialNote.dto.SpecialNoteRequest;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;

@Slf4j
@RestController
@RequestMapping("/api/special-note")
@RequiredArgsConstructor
@Tag(name = "SpecialNoteController", description = "견적 특이사항 관련 API")
public class SpecialNoteController {

  private final SpecialNoteService specialNoteService;

  /**
   * 견적 특이사항 정보 등록/수정
   * 
   * @param specialNoteRequest
   * @throws Exception
   */
  @Operation(description = "견적 특이사항 정보를 등록/수정한다. (동기화)")
  @PostMapping("/special-note-save")
  @ResponseStatus(HttpStatus.OK)
  public void setSpecialNoteSave(@RequestBody SpecialNoteRequest specialNoteRequest)
      throws Exception {
    specialNoteService.setSpecialNoteSave(specialNoteRequest);
  }

  /**
   * 견적 특이사항 ITEM 정보 등록/수정
   * 
   * @param specialNoteItemRequest
   * @throws Exception
   */
  @Operation(description = "견적 특이사항 ITEM 정보를 등록/수정한다. (동기화)")
  @PostMapping("/special-note-item-save")
  @ResponseStatus(HttpStatus.OK)
  public void setSpecialNoteItemSave(@RequestBody SpecialNoteItemRequest specialNoteItemRequest)
      throws Exception {
    specialNoteService.setSpecialNoteItemSave(specialNoteItemRequest);
  }

}
