package cn.teammodel.model.entity.weekDuty;

import cn.teammodel.model.entity.BaseItem;
import com.azure.spring.data.cosmos.core.mapping.Container;
import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.util.List;


/**
 * 每个学校值周评分标准 (一个学校只有一套)
 * @author winter
 * @create 2024-01-02 17:05
 */
@EqualsAndHashCode(callSuper = true)
@Container(containerName = "School")
@Data
@JsonInclude(JsonInclude.Include.NON_NULL)
public class WeekDuty extends BaseItem {
    private String schoolId;
    private List<DutyTreeNode> nodes;
    /**
    * 打卡地标
    */
    private List<DutySpot> spots;

    @Data
    @JsonInclude(JsonInclude.Include.NON_NULL)
    public static class DutyTreeNode {
        private String id;
        private String pid;
        private String name;
        private String desc;
        private Integer score;
        private Integer order;
        /**
        * 加分还是减分
        */
        private Boolean positive;
        /**
        * 只有三级有
        */
        private String[] path;
        private List<DutyTreeNode> children;
        private String creator;
        private String creatorId;
        private Long createTime;
    }
    @Data
    @AllArgsConstructor
    @JsonInclude(JsonInclude.Include.NON_NULL)
    public static class DutySpot {
        private String id;
        private String name;
    }

}

