package com.bocloud.ims.entity.common;

import com.alibaba.fastjson.JSONArray;
import com.bocloud.entity.annotations.Column;
import com.bocloud.entity.annotations.IgnoreAll;
import com.bocloud.entity.annotations.PK;
import com.bocloud.entity.annotations.Table;
import com.bocloud.entity.bean.GenericEntity;
import com.bocloud.entity.meta.PKStrategy;
import com.bocloud.ims.entity.resource.ResourceQuota;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;

import java.util.List;

@Data
@EqualsAndHashCode(callSuper = true)
@AllArgsConstructor
@NoArgsConstructor
@Table("project")
public class Project extends GenericEntity {

	@PK(PKStrategy.AUTO)
	private Long id;// ID
	@Column("visibility")
	private String visibility;// 可见性(内部项目/公共项目/默认项目)
	@Column("tenant_id")
	private Long tenantId;// 租户ID
	@Column("tenant_ids")
	private String tenantIds;// 租户ID
	@Column("business_id")
	private Long businessId;// 所属业务ID
	@Column("code")
	private String code;// 编码
	@Column("guid")
	private String guid;// 项目唯一标识
	@Column("manager_ids")
	private String managerIds;// 项目经理Id集合
	@Column("provider_ids")
	private String providerIds;// 项目供应商Id集合
	@IgnoreAll
	private JSONArray quotas;// 配额
	@IgnoreAll
	private String tenantName;// 租户名称
	@IgnoreAll
	private String tenantNames;// 租户名称集合
	@IgnoreAll
	private List<String> tenantNameList;// 租户名称集合
	@IgnoreAll
	private int resourceNum;// 资源数量
	@IgnoreAll
	private Long managerId;// 项目负责人ID
	@IgnoreAll
	private String managerName;// 项目负责人名称
	@IgnoreAll
	private List<String> managerNameList;// 项目负责人名称集合
	@IgnoreAll
	private String providerName;// 供应商负责人名称
	@IgnoreAll
	private List<String> providerNameList;// 项供应商负责人名称集合
	@IgnoreAll
	private Integer userCount;// 用户数
	@IgnoreAll
	private String businessName;
	@IgnoreAll
	private List<ResourceQuota> resourceQuotas;// 租户配额

	/**
	 * @param visibility
	 * @param tenantId
	 */
	public Project(String visibility, Long tenantId) {
		this.visibility = visibility;
		this.tenantId = tenantId;
	}
}
