package kr.co.zioinfo.web.service;

import kr.co.zioinfo.web.model.Inquiry;
import kr.co.zioinfo.web.repository.InquiryRepository;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

@Service
@RequiredArgsConstructor
@Slf4j
public class InquiryService {
    private final InquiryRepository repo;

    public Inquiry save(Inquiry inquiry) {
        Inquiry saved = repo.save(inquiry);
        log.info("문의 접수: id={} name={} subject={}", saved.getId(), saved.getName(), saved.getSubject());
        // TODO: 이메일 발송 (MailService 연동)
        return saved;
    }
}
