using Edge.Core.Parser.BinaryParser.Attributes;
using HengshanPaymentTerminal.Support;
using System;
using System.Collections.Generic;
using System.Text;

namespace HengshanPaymentTerminal.MessageEntity.Outgoing
{
    /// <summary>
    /// Card validation result.
    /// 验卡结果，后台返回。
    /// </summary>
    public class ValidateCardResult : CardMessageBase
    {
        public ValidateCardResult() : base(Command.ValidateCardRequest)
        {
        }

        [Format(10, EncodingType.BcdString, -90)]
        public string Asn { get; set; }

        [Format(3, EncodingType.BIN, -89)]
        public int MaxAllowedAmount { get; set; }

        [Format(4, EncodingType.BIN, -88)]
        public long PhysicalCardNo { get; set; }

        [Format(2, EncodingType.BIN, -87)]
        public ushort DiscountNo { get; set; }

        [Format(4, EncodingType.BIN, -86)]
        public int CardBalance { get; set; }

        [Format(1, EncodingType.BIN, -85)]
        public CardState CardState { get; set; }

        [Format(1, EncodingType.BIN, -84)]
        public byte AdditionalInfoLength { get; set; }

        [EnumerableFormat("AdditionalInfoLength", -83)]
        public List<byte> AdditionalInfo { get; set; }
    }
}
