﻿using Composite.Core.WebClient.Renderings.Data;
using Composite.Data;
using Composite.Data.DynamicTypes;
using Composite.Data.Hierarchy;
using Composite.Data.Hierarchy.DataAncestorProviders;

namespace Composite.Demo
{
    [AutoUpdateble]
    [KeyPropertyName("Id")]
    [DataScope(DataScopeIdentifier.PublicName)]
    [ImmutableTypeId("{A058AC94-BD56-4A96-ABE4-F182BF977BC6}")]
    [LabelPropertyName("Name")]
    [RelevantToUserType(UserType.Developer)]
    [DataAncestorProvider(typeof(NoAncestorDataAncestorProvider))]
    [KeyTemplatedXhtmlRenderer(XhtmlRenderingType.Embedable, "<a href='~/car({id})'>{Name}</a>")]
    public interface ICar : IData
    {
        [StoreFieldType(PhysicalStoreFieldType.String, 8, IsNullable = false)]
        [DefaultFieldRandomStringValue(8, true)]
        [ImmutableFieldId("{172DD44C-426B-4812-834B-6B45366E78CB}")]
        string Id { get; set; }

        [ImmutableFieldId("{CBDC4D3D-FA2A-496a-BBE9-91CFEB88336F}")]
        [StoreFieldType(PhysicalStoreFieldType.String, 255)]
        string Name { get; set; }

        [StoreFieldType(PhysicalStoreFieldType.LargeString, IsNullable = false)]
        [ImmutableFieldId("{ADB24D3D-FA2A-496a-BBE9-91CFEB88336F}")]
        string Description { get; set; }
    }
}