using AyCode.Database.DbContexts;
using AyCode.Database.ModelBuilders.Users;
using AyCode.Interfaces.Users;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
using TIAM.Entities.Addresses;
using TIAM.Entities.Profiles;
using TIAM.Entities.ServiceProviders;
using TIAM.Entities.Users;
using static AyCode.Database.ModelBuilders.Profiles.AcProfileEntityTypeConfigurations;

namespace TIAM.Database.ModelBuilders.Users;

public class UserProductMappingEntityTypeDefaultConfiguration : IAcEntityTypeConfiguration<UserProductMapping>
{
    public void Configure(EntityTypeBuilder<UserProductMapping> builder)
    {
        builder.BuildUserProductMappingToRelations(false);
        builder.BuildTransferToUserProductMappingRelation(true);
    }
}

public class UserProductMappingEntityTypeTransferConfiguration : IAcEntityTypeConfiguration<UserProductMapping>
{
    public void Configure(EntityTypeBuilder<UserProductMapping> builder)
    {
        builder.BuildUserProductMappingToRelations(false);
    }
}
public class UserEntityTypeDefaultConfiguration : AcUserEntityTypeDefaultConfiguration<User, Profile, TiamServiceProvider, UserToServiceProvider, Address> //IAcEntityTypeConfiguration<User>//
{
    public override void Configure(EntityTypeBuilder<User> builder)
    {
        base.Configure(builder);

        builder.BuildUserToUserProductMappingRelation();
    }
}

public class ProfileEntityTypeConfigurations : AcProfileEntityTypeDefaultConfiguration<Profile, Address>
{
    public override void Configure(EntityTypeBuilder<Profile> builder)
    {
        base.Configure(builder);

        //builder.BuildEntityToAddressRelation();
    }
}


