package com.zhongshu.card.server.core.domain.devices.permiss;

import com.zhongshu.card.client.model.devices.permiss.TimeSlotWeekModel;
import com.zhongshu.card.client.type.DataState;
import com.zhongshu.card.client.type.device.TimeSlotType;
import com.zhongshu.card.server.core.domain.base.SuperMain;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.data.mongodb.core.mapping.Document;

import java.util.ArrayList;
import java.util.List;

/**
 * 权限时间段
 *
 * @author TRX
 * @date 2024/12/19
 */
@Data
@Document
@NoArgsConstructor
@AllArgsConstructor
public class PermissTimeSlot extends SuperMain {

    @Schema(description = "名称")
    private String name;

    @Schema(description = "时间段类型")
    private TimeSlotType type;

    @Schema(description = "星期数据")
    private List<TimeSlotWeekModel> timeSlotWeekModels = new ArrayList<>();

    @Schema(description = "状态")
    private DataState state;

    @Schema(description = "关联的设备权限id")
    private List<String> permissSettingIds = new ArrayList<>();

    public static PermissTimeSlot build(String id) {
        PermissTimeSlot permissTimeSlot = new PermissTimeSlot();
        permissTimeSlot.setId(id);
        return permissTimeSlot;
    }
}
