package com.liquidnet.service.goblin.service;

import com.liquidnet.service.base.ResponseDto;
import com.liquidnet.service.goblin.dto.vo.GoblinMailTrackCache;
import com.liquidnet.service.goblin.dto.vo.GoblinMailTrackInfoVo;
import com.liquidnet.service.goblin.dto.vo.GoblinMailVo;
import com.liquidnet.service.goblin.dto.vo.GoblinStoreRecommendGoodsVo;

import java.util.List;
import java.util.Map;

/**
 * 快递100物流轨迹服务
 */
public interface IGoblinMailTrackService {

    /**
     * 发货后初始化并异步订阅
     */
    void initAndSubscribeAsync(String orderId, String mailId, String mailNo, String logisticsCode, String logisticsCompany);

    /**
     * C 端读路径：按订阅状态决定只读 / 重订 / 主动查询
     */
    GoblinMailTrackCache resolveTrackForRead(String orderId, String mailId);

    /**
     * 填充邮件摘要字段
     */
    void fillMailSummary(GoblinMailVo mailVo, GoblinMailTrackCache cache);

    /**
     * 快递100地图订阅回调
     */
    Map<String, Object> handleCallback(String param, String sign, String mailId, String orderId);

    /**
     * Admin：查看完整 Redis 缓存
     */
    ResponseDto<GoblinMailTrackCache> adminGetTrack(String orderId, String mailId);

    /**
     * Admin：主动同步物流
     */
    ResponseDto<GoblinMailTrackInfoVo> adminSyncTrack(String orderId, String mailId);

    /**
     * Admin：重新订阅
     */
    ResponseDto<Boolean> adminResubscribe(String orderId, String mailId);

    /**
     * 同店最新上架商品前 2 个
     */
    ResponseDto<List<GoblinStoreRecommendGoodsVo>> recommendStoreGoods(String orderId);
}
