package shop.alien.entity.store.vo;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.List;

/**
 * 商家经营统计数据对比VO（包含当期、上期和变化率）
 *
 * @author system
 * @version 1.0
 * @date 2026/01/05
 */
@Data
@ApiModel(value = "StoreOperationalStatisticsComparisonVo对象", description = "商家经营统计数据对比")
public class StoreOperationalStatisticsComparisonVo implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty("当期开始时间")
    private String currentStartTime;

    @ApiModelProperty("当期结束时间")
    private String currentEndTime;

    @ApiModelProperty("上期开始时间")
    private String previousStartTime;

    @ApiModelProperty("上期结束时间")
    private String previousEndTime;

    @ApiModelProperty("历史记录ID（用于后续更新PDF URL）")
    private Integer historyId;

    /**
     * 流量数据对比
     */
    @ApiModelProperty("流量数据对比")
    private TrafficDataComparison trafficData;

    /**
     * 互动数据对比
     */
    @ApiModelProperty("互动数据对比")
    private InteractionDataComparison interactionData;

    /**
     * 优惠券数据对比
     */
    @ApiModelProperty("优惠券数据对比")
    private CouponDataComparison couponData;

    /**
     * 代金券数据对比
     */
    @ApiModelProperty("代金券数据对比")
    private VoucherDataComparison voucherData;

    /**
     * 服务质量数据对比
     */
    @ApiModelProperty("服务质量数据对比")
    private ServiceQualityDataComparison serviceQualityData;

    /**
     * 价目表排名数据对比
     */
    @ApiModelProperty("价目表排名数据对比")
    private List<PriceListRankingComparison> priceListRanking;

    /**
     * 基础对比数据
     */
    @Data
    @ApiModel("基础对比数据")
    public static class BaseComparisonData implements Serializable {
        @ApiModelProperty("当期值")
        private Object current;

        @ApiModelProperty("上期值")
        private Object previous;

        @ApiModelProperty("变化率（百分比）")
        private BigDecimal changeRate;
    }

    /**
     * 流量数据对比
     */
    @Data
    @ApiModel("流量数据对比")
    public static class TrafficDataComparison implements Serializable {
        @ApiModelProperty("店铺搜索量对比")
        private BaseComparisonData storeSearchVolume;

        @ApiModelProperty("浏览量对比")
        private BaseComparisonData pageViews;

        @ApiModelProperty("访客数对比")
        private BaseComparisonData visitors;

        @ApiModelProperty("新增访客数对比")
        private BaseComparisonData newVisitors;

        @ApiModelProperty("访问时长对比")
        private BaseComparisonData visitDuration;

        @ApiModelProperty("平均访问时长对比")
        private BaseComparisonData avgVisitDuration;
    }

    /**
     * 互动数据对比
     */
    @Data
    @ApiModel("互动数据对比")
    public static class InteractionDataComparison implements Serializable {
        @ApiModelProperty("店铺收藏次数对比")
        private BaseComparisonData storeCollectionCount;

        @ApiModelProperty("店铺分享次数对比")
        private BaseComparisonData storeShareCount;

        @ApiModelProperty("店铺打卡次数对比")
        private BaseComparisonData storeCheckInCount;

        @ApiModelProperty("咨询商家次数对比")
        private BaseComparisonData consultMerchantCount;

        @ApiModelProperty("好友数量对比")
        private BaseComparisonData friendsCount;

        @ApiModelProperty("关注数量对比")
        private BaseComparisonData followCount;

        @ApiModelProperty("粉丝数量对比")
        private BaseComparisonData fansCount;

        @ApiModelProperty("发布动态数量对比")
        private BaseComparisonData postsPublishedCount;

        @ApiModelProperty("动态点赞数量对比")
        private BaseComparisonData postLikesCount;

        @ApiModelProperty("动态评论数量对比")
        private BaseComparisonData postCommentsCount;

        @ApiModelProperty("动态转发数量对比")
        private BaseComparisonData postSharesCount;

        @ApiModelProperty("被举报次数对比")
        private BaseComparisonData reportedCount;

        @ApiModelProperty("被拉黑次数对比")
        private BaseComparisonData blockedCount;
    }

    /**
     * 优惠券数据对比
     */
    @Data
    @ApiModel("优惠券数据对比")
    public static class CouponDataComparison implements Serializable {
        @ApiModelProperty("赠送好友数量对比")
        private BaseComparisonData giftToFriendsCount;

        @ApiModelProperty("赠送好友金额合计对比")
        private BaseComparisonData giftToFriendsAmount;

        @ApiModelProperty("赠送好友使用数量对比")
        private BaseComparisonData giftToFriendsUsedCount;

        @ApiModelProperty("赠送好友使用金额合计对比")
        private BaseComparisonData giftToFriendsUsedAmount;

        @ApiModelProperty("赠送好友使用金额占比对比")
        private BaseComparisonData giftToFriendsUsedAmountRatio;

        @ApiModelProperty("好友赠送数量对比")
        private BaseComparisonData friendsGiftCount;

        @ApiModelProperty("好友赠送金额合计对比")
        private BaseComparisonData friendsGiftAmount;

        @ApiModelProperty("好友赠送使用数量对比")
        private BaseComparisonData friendsGiftUsedCount;

        @ApiModelProperty("好友赠送使用金额合计对比")
        private BaseComparisonData friendsGiftUsedAmount;

        @ApiModelProperty("好友赠送使用金额占比对比")
        private BaseComparisonData friendsGiftUsedAmountRatio;
    }

    /**
     * 代金券数据对比
     */
    @Data
    @ApiModel("代金券数据对比")
    public static class VoucherDataComparison implements Serializable {
        @ApiModelProperty("赠送好友数量对比")
        private BaseComparisonData giftToFriendsCount;

        @ApiModelProperty("赠送好友金额合计对比")
        private BaseComparisonData giftToFriendsAmount;

        @ApiModelProperty("赠送好友使用数量对比")
        private BaseComparisonData giftToFriendsUsedCount;

        @ApiModelProperty("赠送好友使用金额合计对比")
        private BaseComparisonData giftToFriendsUsedAmount;

        @ApiModelProperty("赠送好友使用金额占比对比")
        private BaseComparisonData giftToFriendsUsedAmountRatio;

        @ApiModelProperty("好友赠送数量对比")
        private BaseComparisonData friendsGiftCount;

        @ApiModelProperty("好友赠送金额合计对比")
        private BaseComparisonData friendsGiftAmount;

        @ApiModelProperty("好友赠送使用数量对比")
        private BaseComparisonData friendsGiftUsedCount;

        @ApiModelProperty("好友赠送使用金额合计对比")
        private BaseComparisonData friendsGiftUsedAmount;

        @ApiModelProperty("好友赠送使用金额占比对比")
        private BaseComparisonData friendsGiftUsedAmountRatio;
    }

    /**
     * 服务质量数据对比
     */
    @Data
    @ApiModel("服务质量数据对比")
    public static class ServiceQualityDataComparison implements Serializable {
        @ApiModelProperty("店铺评分对比")
        private BaseComparisonData storeRating;

        @ApiModelProperty("评分1对比")
        private BaseComparisonData scoreOne;

        @ApiModelProperty("评分2对比")
        private BaseComparisonData scoreTwo;

        @ApiModelProperty("评分3对比")
        private BaseComparisonData scoreThree;

        @ApiModelProperty("评价数量对比")
        private BaseComparisonData totalReviews;

        @ApiModelProperty("好评数量对比")
        private BaseComparisonData positiveReviews;

        @ApiModelProperty("中评数量对比")
        private BaseComparisonData neutralReviews;

        @ApiModelProperty("差评数量对比")
        private BaseComparisonData negativeReviews;

        @ApiModelProperty("差评占比对比")
        private BaseComparisonData negativeReviewRatio;

        @ApiModelProperty("差评申诉次数对比")
        private BaseComparisonData negativeReviewAppealsCount;

        @ApiModelProperty("差评申诉成功次数对比")
        private BaseComparisonData negativeReviewAppealsSuccessCount;

        @ApiModelProperty("差评申诉成功占比对比")
        private BaseComparisonData negativeReviewAppealsSuccessRatio;
    }

    /**
     * 价目表排名数据对比
     */
    @Data
    @ApiModel("价目表排名数据对比")
    public static class PriceListRankingComparison implements Serializable {
        @ApiModelProperty("价目表ID")
        private Integer priceId;

        @ApiModelProperty("价目表名称")
        private String priceListItemName;

        @ApiModelProperty("浏览量对比")
        private BaseComparisonData pageViews;

        @ApiModelProperty("访客数对比")
        private BaseComparisonData visitors;

        @ApiModelProperty("分享数对比")
        private BaseComparisonData shares;
    }
}
