﻿using System;

namespace Carbon.Data
{
    public interface IMember
    {
        string Name { get; }

        Type Type { get; } // e.g. property type -- if nullable, lyfted type
        
        // The (maximum) size of the member in bytes
        int? Size { get; } // Fixed?

        /// <summary>
        /// The number of digits in a number or characters in a string
        /// </summary>
        int? Precision { get; }

        /// <summary>
        /// The number of digits to the right of the decimal point in a number
        /// </summary>
        int? Scale { get; }

        int Order { get; }

        #region Flags

        bool IsAscii { get; }

        bool IsKey { get; }

        bool IsOptional { get; }

        bool IsEnum { get; } 

        bool IsMutable { get; }

        bool IsGenerated { get; }

        bool IsTimestamp { get; }

        bool IsFixedSize { get; }

        bool IsIndexed { get; }

        bool IsUnique { get; }

        bool IsVersion { get; }

        object DefaultValue { get; }

        bool IsNullable { get; }

        #endregion

        string PropertyName { get; }

        object GetValue(object instance);

        void SetValue(object instance, object value);
    }
}

// Precision is the number of digits in a number. 
// Scale is the number of digits to the right of the decimal point in a number.
// For example, the number 123.45 has a precision of 5 and a scale of 2.