package com.social.media.application.content.handler;

import com.social.media.application.content.command.DeletePostCommand;
import com.social.media.domain.content.repository.PostRepository;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service
@Transactional
public class DeletePostCommandHandler {
    
    private final PostRepository postRepository;
    
    public DeletePostCommandHandler(PostRepository postRepository) {
        this.postRepository = postRepository;
    }
    
    public void handle(DeletePostCommand command) {
        // Delete the post (hard delete)
        postRepository.deleteById(command.postId());
    }
}

