package kr.lunaticbum.back.lun.repository

import kr.lunaticbum.back.lun.model.PostHistory
import org.springframework.data.mongodb.repository.ReactiveMongoRepository
import org.springframework.stereotype.Repository
import reactor.core.publisher.Flux


// 2. PostHistory를 위한 Repository 인터페이스
@Repository
interface PostHistoryRepository : ReactiveMongoRepository<PostHistory, String> {
    // [추가] postId로 모든 히스토리를 최신순으로 조회
    fun findByPostIdOrderByArchivedAtDesc(postId: String): Flux<PostHistory>
}