package com.zhongshu.card.server.core.domain.visitor;

import com.zhongshu.card.client.model.form.ComponentFormModel;
import com.zhongshu.card.server.core.domain.base.SuperMain;
import com.zhongshu.card.server.core.domain.org.Role;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.checkerframework.common.aliasing.qual.NonLeaked;
import org.springframework.data.mongodb.core.index.Indexed;
import org.springframework.data.mongodb.core.mapping.DBRef;
import org.springframework.data.mongodb.core.mapping.Document;

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

/**
 * 组件的访客配置
 *
 * @author TRX
 * @date 2025/2/11
 */
@Data
@Document
@AllArgsConstructor
@NoArgsConstructor
@NonLeaked
public class VisitorSetting extends SuperMain {

    @Schema(description = "组件id")
    @Indexed
    private String sceneComponentId;

    @Schema(description = "被访人类型设置")
    @DBRef(lazy = true)
    private List<Role> visitorRoles;

    @Schema(description = "访客类型，值从字典来")
    private List<String> visitorTypes;

    @Schema(description = "授权时间(小时)提前")
    private Long minutes;

    @Schema(description = "表单列表")
    private List<ComponentFormModel> fields = new ArrayList<ComponentFormModel>();

}
