package com.red.circle.order.app.dto.clientobject.pay;

import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.red.circle.framework.dto.ClientObject;
import com.red.circle.other.inner.model.dto.sys.SysCountryCodeDTO;
import com.red.circle.tool.core.text.StringUtils;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

/**
 * <p>
 * 开通支付国家.
 * </p>
 *
 * @author pengshigang
 * @since 2021-12-08
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
public class PayCountryCO extends ClientObject {

  private static final long serialVersionUID = 1L;

  /**
   * 主键标识.
   */
  @JsonSerialize(using = ToStringSerializer.class)
  private Long id;

  /**
   * 国家id.
   */
  @JsonSerialize(using = ToStringSerializer.class)
  private Long countryId;

  /**
   * 国家信息.
   */
  private SysCountryCodeDTO country;

  public String getCountryName() {
    return StringUtils.isBlankOrElse(country.getAliasName(), country.getCountryName());
  }
}
