using System;
using adMoto.Payments.Core.Interfaces;

namespace adMoto.Payments.Core.Data
{
    public partial class PotwierdzeniaEcard : IIdentifiable
    {
        public int Id
        {
            get { return id; }
        }

// ReSharper disable InconsistentNaming
        partial void OnVALIDATIONCODEChanging(string value)
// ReSharper restore InconsistentNaming
        {
            if (string.IsNullOrEmpty(value)) return;

            if (value.Length > 3) throw new ArgumentException("VALIDATIONCODE must be max 3 characters long.");
        }
        partial void OnBINChanging(string value)
        {
            if (string.IsNullOrEmpty(value)) return;

            if (value.Length > 6) throw new ArgumentException("BIN must be max 6 characters long.");
        }
        partial void OnMERCHANTNUMBERChanging(string value)
        {
            if (string.IsNullOrEmpty(value)) return;

            if (value.Length > 50) throw new ArgumentException("MERCHANTNUMBER must be 50 characters long.");
        }
        partial void OnCOMMTYPEChanging(string value)
        {
            if (string.IsNullOrEmpty(value)) return;

            if (value.Length > 50) throw new ArgumentException("COMMTYPE must be 50 characters long.");
        }
        partial void OnCURRENTSTATEChanging(string value)
        {
            if (string.IsNullOrEmpty(value)) return;

            if (value.Length > 50) throw new ArgumentException("CURRENTSTATE must be 50 characters long.");
        }
        partial void OnPREVIOUSSTATEChanging(string value)
        {
            if (string.IsNullOrEmpty(value)) return;

            if (value.Length > 50) throw new ArgumentException("PREVIOUSSTATE must be 50 characters long.");
        }
        partial void OnAPPROVALCODEChanging(string value)
        {
            if (string.IsNullOrEmpty(value)) return;

            if (value.Length > 50) throw new ArgumentException("APPROVALCODE must be 50 characters long.");
        }
        partial void OnTYPEChanging(string value)
        {
            if (string.IsNullOrEmpty(value)) return;

            if (value.Length > 2) throw new ArgumentException("TYPE must be 2 characters long.");
        }
        partial void OnWITHCVCChanging(string value)
        {
            if (string.IsNullOrEmpty(value)) return;

            if (value.Length > 3) throw new ArgumentException("WITHCVC must be 4 characters long.");
        }
       
    }
}