package ru.yandex.direct.web.entity.uac.service.history.parser

import org.springframework.stereotype.Component
import ru.yandex.direct.core.entity.uac.repository.ydb.model.UacYdbCampaign
import ru.yandex.direct.core.grut.model.GrutHistoryEventEntry
import ru.yandex.direct.web.entity.uac.model.history.GrutHistoryOutputCategory
import ru.yandex.direct.web.entity.uac.model.history.event.GrutAppLinkInfoHistoryView

@Component
class AppLinkInfoHistoryEventParser : BaseGrutCampaignHistoryEventParser() {
    override fun generateEvent(historyEntry: GrutHistoryEventEntry<UacYdbCampaign>): Any {
        return GrutAppLinkInfoHistoryView(
            historyEntry.value.appId,
            historyEntry.value.storeUrl
        )
    }

    override fun getOutputCategory(): GrutHistoryOutputCategory = GrutHistoryOutputCategory.CAMPAIGN_APP_LINK_INFO
}
