package cn.axzo.msg.center.inside.notices.config;

import lombok.Getter;
import lombok.Setter;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.context.annotation.Configuration;

import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;

/**
 * @description
 *   待办日历模版配置
 * @author cold_blade
 * @date 2023/8/31
 * @version 1.0
 */
@Setter
@Getter
@RefreshScope
@Configuration
@ConfigurationProperties(prefix = "calendar.template")
public class PendingCalendarCodeConfig {

    private List<String> constructionCodes;
    private List<String> clockInCodes;
    private List<String> punchInCodes;

    public List<String> getCalendarAllCodes() {
        return Arrays.asList(constructionCodes, clockInCodes, punchInCodes)
                .stream()
                .flatMap(List::stream)
                .collect(Collectors.toList());
    }
}
