package com.kamco.cd.kamcoback.members.service;

import com.kamco.cd.kamcoback.members.dto.MembersDto;
import com.kamco.cd.kamcoback.postgres.core.MembersCoreService;
import java.util.UUID;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service
@Transactional(readOnly = true)
@RequiredArgsConstructor
public class AdminService {

  private final MembersCoreService membersCoreService;

  /**
   * 관리자 계정 등록
   *
   * @param addReq
   * @return
   */
  @Transactional
  public Long saveMember(MembersDto.AddReq addReq) {
    return membersCoreService.saveMembers(addReq);
  }

  /**
   * 관리자 계정 수정
   *
   * @param uuid
   * @param updateReq
   */
  @Transactional
  public void updateMembers(UUID uuid, MembersDto.UpdateReq updateReq) {
    membersCoreService.updateMembers(uuid, updateReq);
  }


  /**
   * 관리자 계정 미사용 처리
   *
   * @param uuid
   */
  @Transactional
  public void deleteAccount(UUID uuid) {
    membersCoreService.deleteAccount(uuid);
  }
}
