package com.changhu.pojo.dto;

import com.alibaba.fastjson2.annotation.JSONField;
import com.changhu.common.db.enums.IsOrNot;
import com.changhu.common.db.enums.ServiceProjectType;
import com.changhu.common.db.enums.Sex;
import com.changhu.module.management.pojo.model.LegalPersonInfo;
import com.changhu.support.fastjson2.serializer.MinioPrefixSerializer;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.time.LocalDateTime;
import java.util.List;

/**
 * @author 20252
 * @createTime 2024/10/10 上午9:35
 * @desc ServiceProjectDTO...
 */
@Data
public class ServiceProjectDTO {
    @Schema(description = "服务项目id")
    private Long snowFlakeId;
    @Schema(description = "项目经理信息")
    private ProjectManagerInfo projectManagerInfo;
    @Schema(description = "保安单位信息")
    private SecurityUnitInfo securityUnitInfo;
    @Schema(description = "名字")
    private String name;
    @Schema(description = "类型")
    private ServiceProjectType type;
    @Schema(description = "是否自招保安")
    private IsOrNot isRecruitSecurity;
    @Schema(description = "保安证号")
    private String idNumber;
    @Schema(description = "服务面积")
    private Double serviceArea;
    @Schema(description = "楼栋数量")
    private Integer buildingTotal;
    @Schema(description = "户数")
    private Integer houseTotal;
    @Schema(description = "工作人员数量")
    private Integer staffTotal;
    @Schema(description = "保安人员数量")
    private Integer securityUserTotal;
    @Schema(description = "备注")
    private String remark;
    @Schema(description = "创建时间")
    private LocalDateTime createTime;

    @Schema(description = "保安人员列表")
    private List<SecurityUserInfo> securityUserList;

    @Data
    static class SecurityUnitInfo {
        @Schema(description = "保安单位名称")
        private String name;
        @Schema(description = "统一社会编码")
        private String socialCode;
        @JSONField(serializeUsing = MinioPrefixSerializer.class)
        @Schema(description = "营业执照")
        private String businessLicense;
        @Schema(description = "法人信息")
        private LegalPersonInfo legalPersonInfo;
        @Schema(description = "详细地址")
        private String address;
        @Schema(description = "公司性质")
        private String nature;
    }

    @Data
    static class ProjectManagerInfo {
        @Schema(description = "名称")
        private String name;
        @Schema(description = "性别")
        private Sex sex;
        @Schema(description = "手机号")
        private String telephone;
        @Schema(description = "身份证")
        private String idCard;
    }

    @Data
    static class SecurityUserInfo {
        @Schema(description = "id")
        private Long snowFlakeId;
        @Schema(description = "名字")
        private String name;
        @Schema(description = "手机号")
        private String telephone;
        @Schema(description = "工作岗位")
        private String workPost;
        @Schema(description = "性别")
        private Sex sex;
        @Schema(description = "户籍地")
        private String nativePlace;
        @Schema(description = "身份证")
        private String idCard;
        @Schema(description = "出身日期")
        private java.time.LocalDate dateOfBirth;
        @Schema(description = "保安证号")
        private String securityNumber;
        @Schema(description = "家庭住址")
        private String homeAddress;
        @Schema(description = "备注")
        private String remark;
        @Schema(description = "创建时间")
        private String createTime;
    }
}
