package com.qunzhixinxi.hnqz.common.taxhelper.enums;

import lombok.Getter;

/**
 * 税邦云发票信息枚举
 *
 * @author Hengchen.Sun
 * @version 1.0.0
 * @date 2021/06/22
 */
@Getter
public enum InvoiceInfo {

	PROFESSIONAL_TECHNICAL_SERVICE(2,"专业技术人员","3040105000000000000","专业技术服务"),

	HEALTH_CONSULTATION_SERVICE_FEE(12,"健康咨询师","3040603000000000000","健康咨询服务费"),
	MEDICAL_CONSULTATION_SERVICE_FEE(12,"健康咨询师","3040603000000000000","医疗咨询服务费"),
	MEDICAL_AND_HEALTH_CONSULTATION_SERVICE_FEE(12,"健康咨询师","3040603000000000000","医疗健康咨询服务费"),

	PROMOTION_SERVICE_FEE(16,"推广服务费","3049900000000000000","推广服务费"),
	MARKETING_SERVICE_FEE(16,"营销服务费","3049900000000000000","营销服务费"),
	INFORMATION_SERVICE_FEE(16,"信息服务费","3049900000000000000","信息服务费"),

	;
	private int typeId;
	private String target;
	private String InvoiceCode;
	private String category;

	InvoiceInfo(int typeId, String target, String invoiceCode, String category) {
		this.typeId = typeId;
		this.target = target;
		this.InvoiceCode = invoiceCode;
		this.category = category;
	}

	/**
	 * 根据发票类目获取发票信息
	 *
	 * @param category 发票类目
	 * @return 税邦云发票信息，如果类型不存在，返回{@code null}
	 */
	public static InvoiceInfo resolveByCategory(String category) {
		for (InvoiceInfo info : InvoiceInfo.values()) {
			if (info.category.equals(category)) {
				return info;
			}
		}
		return null;
	}
}
