Merge branch 'master' of http://git2.aycode.com/Adam/TourIAm
This commit is contained in:
commit
0bee047217
|
|
@ -0,0 +1,7 @@
|
|||
using AyCode.Core.Interfaces;
|
||||
|
||||
namespace TIAM.Core.Interfaces;
|
||||
|
||||
public interface ISerializableToJson : IAcSerializableToJson
|
||||
{
|
||||
}
|
||||
|
|
@ -0,0 +1,23 @@
|
|||
using AyCode.Core.Interfaces;
|
||||
using Newtonsoft.Json;
|
||||
using TIAM.Core.Interfaces;
|
||||
|
||||
namespace TIAM.Core;
|
||||
|
||||
public static class SerializeObjectToJsonExtensions
|
||||
{
|
||||
private static string SerializeObjectToJson<T>(T source)
|
||||
{
|
||||
JsonSerializerSettings options = new()
|
||||
{
|
||||
ReferenceLoopHandling = ReferenceLoopHandling.Ignore,
|
||||
NullValueHandling = NullValueHandling.Ignore
|
||||
};
|
||||
|
||||
return JsonConvert.SerializeObject(source, options);
|
||||
}
|
||||
|
||||
public static string ToJson<T>(this T source) where T : class, IAcSerializableToJson => SerializeObjectToJson(source);
|
||||
public static string ToJson<T>(this IQueryable<T> source) where T : class, IAcSerializableToJson => SerializeObjectToJson(source);
|
||||
public static string ToJson<T>(this IEnumerable<T> source) where T : class, IAcSerializableToJson => SerializeObjectToJson(source);
|
||||
}
|
||||
|
|
@ -6,4 +6,18 @@
|
|||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Folder Include="Interfaces\" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Reference Include="AyCode.Core">
|
||||
<HintPath>..\..\AyCode.Core\AyCode.Services.Server\bin\Debug\net8.0\AyCode.Core.dll</HintPath>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
|
|
|||
|
|
@ -1,25 +1,14 @@
|
|||
using AyCode.Database.Tests;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using AyCode.Database.DataLayers.Users;
|
||||
using AyCode.Utils.Extensions;
|
||||
using Newtonsoft.Json;
|
||||
using TIAM.Core;
|
||||
using TIAM.Core.Enums;
|
||||
using TIAM.Database.DataLayers.Admins;
|
||||
//using TIAM.Database.DataLayers.ServiceProviders;
|
||||
using TIAM.Database.DataLayers.Users;
|
||||
using TIAM.Database.DbContexts.Admins;
|
||||
using TIAM.Database.DbContexts.ServiceProviders;
|
||||
using TIAM.Database.DbSets.Permissions;
|
||||
using TIAM.Database.DbSets.Transfers;
|
||||
using TIAM.Entities.Drivers;
|
||||
using TIAM.Entities.Products;
|
||||
using TIAM.Entities.Users;
|
||||
using TIAM.Models.Dtos.Users;
|
||||
using TIAM.Entities.TransferDestinations;
|
||||
using TIAM.Entities.Transfers;
|
||||
|
||||
namespace TIAM.Database.Test
|
||||
|
|
@ -44,7 +33,7 @@ namespace TIAM.Database.Test
|
|||
var permMapping = Dal.GetPermissionContextsViewBySubjectId(subjectId).ToList();
|
||||
|
||||
Assert.IsNotNull(permMapping, "PermissionContextsView is null");
|
||||
Assert.IsTrue(permMapping.Count > 0, "PermissionContextsView count: 0");
|
||||
Assert.IsTrue(permMapping.Count != 0, "PermissionContextsView count: 0");
|
||||
}
|
||||
|
||||
[DataTestMethod]
|
||||
|
|
@ -55,7 +44,7 @@ namespace TIAM.Database.Test
|
|||
var permMapping = Dal.GetPermissionContextsViewByContextId(contextId).ToList();
|
||||
|
||||
Assert.IsNotNull(permMapping, "PermissionContextsView is null");
|
||||
Assert.IsTrue(permMapping.Count > 0, "PermissionContextsView count: 0");
|
||||
Assert.IsTrue(permMapping.Count != 0, "PermissionContextsView count: 0");
|
||||
}
|
||||
|
||||
[DataTestMethod]
|
||||
|
|
@ -66,7 +55,7 @@ namespace TIAM.Database.Test
|
|||
var permMapping = await Dal.GetPermissionContextsViewByContextIdAsync(contextId);
|
||||
|
||||
Assert.IsNotNull(permMapping, "PermissionContextsView is null");
|
||||
Assert.IsTrue(permMapping.Count > 0, "PermissionContextsView count: 0");
|
||||
Assert.IsTrue(permMapping.Count != 0, "PermissionContextsView count: 0");
|
||||
}
|
||||
|
||||
public Product GetProductById_ReturnsProduct_WhenProductExists(string productIdString)
|
||||
|
|
@ -105,7 +94,7 @@ namespace TIAM.Database.Test
|
|||
{
|
||||
var product = GetProductById_ReturnsProduct_WhenProductExists(productIdString);
|
||||
|
||||
Assert.IsTrue(product.UserProductMappings.Count > 0, "UserProductMappings count: 0");
|
||||
Assert.IsTrue(product.UserProductMappings.Count != 0, "UserProductMappings count: 0");
|
||||
|
||||
Assert.IsNotNull(product.UserProductMappings[0].User, "User is null");
|
||||
Assert.IsNotNull(product.ServiceProvider, "ServiceProvider is null");
|
||||
|
|
@ -121,14 +110,15 @@ namespace TIAM.Database.Test
|
|||
Assert.IsNotNull(user);
|
||||
|
||||
Assert.IsTrue(user.Id == userId, "user.Id != userId");
|
||||
Assert.IsTrue(user.UserProductMappings.Count > 0, "UserProductMappings count: 0");
|
||||
Assert.IsTrue(user.UserProductMappings.Count != 0, "UserProductMappings count: 0");
|
||||
|
||||
Assert.IsNotNull(user.UserProductMappings[0].Product, "Product is null");
|
||||
}
|
||||
|
||||
#region UserProductMapping
|
||||
[DataTestMethod]
|
||||
[DataRow("a24bf07a-76a7-48a4-813f-4a77e515b2f3")]
|
||||
//[DataRow("a24bf07a-76a7-48a4-813f-4a77e515b2f3")]
|
||||
[DataRow("71392cfd-fb9c-45c1-9540-7be3782cf26a")]
|
||||
public void GetUserProductMappingById_ReturnsUserProductMapping_WhenHasUserAndProductRelation(string userProductMappingIdString)
|
||||
{
|
||||
var userProductMappingId = Guid.Parse(userProductMappingIdString);
|
||||
|
|
@ -138,6 +128,7 @@ namespace TIAM.Database.Test
|
|||
Assert.IsNotNull(userProductMapping.User, "User is null");
|
||||
Assert.IsNotNull(userProductMapping.Product, "Product is null");
|
||||
|
||||
Assert.IsTrue(userProductMapping.Transfers?.Count != 0, "Transfers?.Count == 0");
|
||||
Assert.IsTrue(userProductMapping.Id == userProductMappingId, "userProductMapping.Id != userProductMappingId");
|
||||
}
|
||||
|
||||
|
|
@ -166,6 +157,7 @@ namespace TIAM.Database.Test
|
|||
Assert.IsNotNull(userProductMapping.JsonDetailModel, "User is null");
|
||||
Assert.IsNotNull(userProductMapping.JsonDetailModel.Cars, "Product is null");
|
||||
|
||||
Assert.IsTrue(userProductMapping.Transfers?.Count != 0);
|
||||
Assert.IsTrue(userProductMapping.JsonDetailModel.Cars.Count == 1);
|
||||
Assert.IsTrue(userProductMapping.JsonDetailModel.Cars[0].UserProductCarId == userProductCarId, "userProductMapping.JsonDetailModel.Cars[0].UserProductCarId == userProductCarId");
|
||||
}
|
||||
|
|
@ -237,11 +229,11 @@ namespace TIAM.Database.Test
|
|||
|
||||
if (userId != Guid.Parse("540271F6-C604-4C16-8160-D5A7CAFEDF00")) return; //csak az "540271F6.."-nek van product-ja! - J.
|
||||
|
||||
Assert.IsTrue(userModel.Products.Count > 0);
|
||||
Assert.IsTrue(userModel.UserProductMappings.Count > 0);
|
||||
Assert.IsTrue(userModel.Products.Count != 0);
|
||||
Assert.IsTrue(userModel.UserProductMappings.Count != 0);
|
||||
|
||||
Assert.IsTrue(userModel.ServiceProviders.Count > 0);
|
||||
Assert.IsTrue(userModel.UserToServiceProviders.Count > 0);
|
||||
Assert.IsTrue(userModel.ServiceProviders.Count != 0);
|
||||
Assert.IsTrue(userModel.UserToServiceProviders.Count != 0);
|
||||
}
|
||||
|
||||
[DataTestMethod]
|
||||
|
|
@ -264,11 +256,11 @@ namespace TIAM.Database.Test
|
|||
|
||||
if (userId != Guid.Parse("540271F6-C604-4C16-8160-D5A7CAFEDF00")) return; //csak az "540271F6.."-nek van product-ja! - J.
|
||||
|
||||
Assert.IsTrue(user.Products.Count > 0);
|
||||
Assert.IsTrue(user.UserProductMappings.Count > 0);
|
||||
Assert.IsTrue(user.Products.Count != 0);
|
||||
Assert.IsTrue(user.UserProductMappings.Count != 0);
|
||||
|
||||
Assert.IsTrue(user.ServiceProviders.Count > 0);
|
||||
Assert.IsTrue(user.UserToServiceProviders.Count > 0);
|
||||
Assert.IsTrue(user.ServiceProviders.Count != 0);
|
||||
Assert.IsTrue(user.UserToServiceProviders.Count != 0);
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
|
|
@ -293,6 +285,8 @@ namespace TIAM.Database.Test
|
|||
var transfer = Dal.GetTransferById(transferId);
|
||||
|
||||
Assert.IsNotNull(transfer);
|
||||
Assert.IsNotNull(transfer.UserProductMapping);
|
||||
|
||||
Assert.IsTrue(transfer.Id == transferId, "transfer.Id != transferId");
|
||||
}
|
||||
|
||||
|
|
@ -308,7 +302,7 @@ namespace TIAM.Database.Test
|
|||
|
||||
Assert.IsTrue(transferDestination.Id == transferDestinationId, "transferDestination.Id != transferDestinationId");
|
||||
|
||||
//Assert.IsTrue(user.UserProductMappings.Count > 0, "UserProductMappings count: 0");
|
||||
//Assert.IsTrue(user.UserProductMappings.Count != 0, "UserProductMappings count: 0");
|
||||
//Assert.IsNotNull(user.UserProductMappings[0].Product, "Product is null");
|
||||
}
|
||||
|
||||
|
|
@ -346,6 +340,7 @@ namespace TIAM.Database.Test
|
|||
transfer = Dal.GetTransferById(transferId);
|
||||
|
||||
Assert.IsNotNull(transfer);
|
||||
Assert.IsNull(transfer.UserProductMapping);
|
||||
|
||||
transfer.Payed = true;
|
||||
transfer.UserProductToCarId = userProductToCarId;
|
||||
|
|
@ -358,6 +353,8 @@ namespace TIAM.Database.Test
|
|||
transfer = Dal.GetTransferById(transferId);
|
||||
|
||||
Assert.IsNotNull(transfer);
|
||||
Assert.IsNotNull(transfer.UserProductMapping);
|
||||
|
||||
Assert.IsTrue(transfer.Payed);
|
||||
Assert.IsTrue(transfer.UserProductToCarId == userProductToCarId);
|
||||
Assert.IsTrue(transfer.TransferStatusType == TransferStatusType.AssignedToDriver);
|
||||
|
|
|
|||
|
|
@ -25,6 +25,7 @@
|
|||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\TIAM.Core\TIAM.Core.csproj" />
|
||||
<ProjectReference Include="..\TIAM.Database\TIAM.Database.csproj" />
|
||||
<ProjectReference Include="..\TIAM.Entities.Server\TIAM.Entities.Server.csproj" />
|
||||
<ProjectReference Include="..\TIAM.Entities\TIAM.Entities.csproj" />
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
using AyCode.Database.DbSets.Users;
|
||||
using AyCode.Models.Enums;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using TIAM.Core;
|
||||
//using TIAM.Database.DataLayers.ServiceProviders;
|
||||
using TIAM.Database.DbContexts.Admins;
|
||||
using TIAM.Database.DbSets.Permissions;
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ using System.Collections.Generic;
|
|||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using TIAM.Core.Interfaces;
|
||||
using TIAM.Database.DbContexts.Admins;
|
||||
using TIAM.Database.DbContexts.ServiceProviders;
|
||||
using TIAM.Database.DbSets.Permissions;
|
||||
|
|
@ -19,28 +20,6 @@ namespace TIAM.Database.DataLayers.Admins
|
|||
{
|
||||
public static class AdminDalDbContextExtension
|
||||
{
|
||||
public static string ToJson<T>(this T source) where T : class, IEntity
|
||||
{
|
||||
JsonSerializerSettings options = new()
|
||||
{
|
||||
ReferenceLoopHandling = ReferenceLoopHandling.Ignore,
|
||||
NullValueHandling = NullValueHandling.Ignore
|
||||
};
|
||||
|
||||
return JsonConvert.SerializeObject(source, options);
|
||||
}
|
||||
|
||||
public static string ToJson<T>(this IQueryable<T> source) where T : class, IEntity
|
||||
{
|
||||
JsonSerializerSettings options = new()
|
||||
{
|
||||
ReferenceLoopHandling = ReferenceLoopHandling.Ignore,
|
||||
NullValueHandling = NullValueHandling.Ignore
|
||||
};
|
||||
|
||||
return JsonConvert.SerializeObject(source, options);
|
||||
}
|
||||
|
||||
public static IQueryable<UserProductMapping> GetUserProductMappingsByPermissionGroupId(this IAdminDbContext ctx, Guid permissionGroupId)
|
||||
{
|
||||
return ctx.UserProductMappings
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ using System.Threading.Tasks;
|
|||
using AyCode.Database.DbContexts;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using TIAM.Database.ModelBuilders.Products;
|
||||
using TIAM.Database.ModelBuilders.Transfers;
|
||||
using TIAM.Database.ModelBuilders.Users;
|
||||
using TIAM.Entities.Addresses;
|
||||
using TIAM.Entities.Drivers;
|
||||
|
|
@ -55,9 +56,11 @@ namespace TIAM.Database.DbContexts.Admins
|
|||
base.OnModelCreating(modelBuilder);
|
||||
|
||||
new UserEntityTypeDefaultConfiguration().Configure(modelBuilder.Entity<User>());
|
||||
//new UserProductMappingEntityTypeDefaultConfiguration().Configure(modelBuilder.Entity<UserProductMapping>());
|
||||
new UserProductMappingEntityTypeDefaultConfiguration().Configure(modelBuilder.Entity<UserProductMapping>());
|
||||
|
||||
new ProductEntityTypeDefaultConfiguration().Configure(modelBuilder.Entity<Product>());
|
||||
|
||||
new TransferEntityTypeDefaultConfigurations().Configure(modelBuilder.Entity<Transfer>());
|
||||
modelBuilder.Entity<TransferDestination>().Navigation(e => e.Address).AutoInclude(true);
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,23 @@
|
|||
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
||||
using TIAM.Database.ModelBuilders.Users;
|
||||
using TIAM.Entities.Transfers;
|
||||
using TIAM.Entities.Users;
|
||||
|
||||
namespace TIAM.Database.ModelBuilders.Transfers;
|
||||
|
||||
public static class TransferEntityTypeBuilderExtensions
|
||||
{
|
||||
/// <summary>
|
||||
/// Mapping Transfer to UserProductMapping relation
|
||||
/// </summary>
|
||||
public static void BuildTransferToProductMappingToRelation(this EntityTypeBuilder<Transfer> modelBuilder, bool autoInclude)
|
||||
{
|
||||
modelBuilder
|
||||
.HasOne(x => x.UserProductMapping)
|
||||
.WithMany(x => x.Transfers)
|
||||
.HasForeignKey(x => x.UserProductMappingId);
|
||||
|
||||
modelBuilder.Navigation(e => e.UserProductMapping).AutoInclude(autoInclude);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,14 @@
|
|||
using AyCode.Database.DbContexts;
|
||||
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
||||
using TIAM.Entities.Products;
|
||||
using TIAM.Entities.Transfers;
|
||||
|
||||
namespace TIAM.Database.ModelBuilders.Transfers;
|
||||
|
||||
public class TransferEntityTypeDefaultConfigurations: IAcEntityTypeConfiguration<Transfer>
|
||||
{
|
||||
public void Configure(EntityTypeBuilder<Transfer> builder)
|
||||
{
|
||||
builder.BuildTransferToProductMappingToRelation(true);
|
||||
}
|
||||
}
|
||||
|
|
@ -4,6 +4,7 @@ using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
|||
using System.Numerics;
|
||||
using AyCode.Interfaces.Profiles;
|
||||
using TIAM.Entities.Products;
|
||||
using TIAM.Entities.Transfers;
|
||||
using TIAM.Entities.Users;
|
||||
|
||||
namespace TIAM.Database.ModelBuilders.Users;
|
||||
|
|
@ -67,5 +68,17 @@ public static class UserEntityTypeBuilderExtensions
|
|||
modelBuilder.Navigation(e => e.Product).AutoInclude(autoInclude);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Mapping User relation
|
||||
/// </summary>
|
||||
public static void BuildTransferToUserProductMappingRelation(this EntityTypeBuilder<UserProductMapping> modelBuilder, bool autoInclude)
|
||||
{
|
||||
modelBuilder
|
||||
.HasMany(e => e.Transfers)
|
||||
.WithOne(e => e.UserProductMapping).HasForeignKey(x => x.UserProductMappingId);
|
||||
|
||||
modelBuilder.Navigation(e => e.Transfers).AutoInclude(autoInclude);
|
||||
}
|
||||
|
||||
#endregion UserProductMapping
|
||||
}
|
||||
|
|
@ -1,6 +1,7 @@
|
|||
using AyCode.Database.DbContexts;
|
||||
using AyCode.Database.ModelBuilders.Users;
|
||||
using AyCode.Interfaces.Users;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
||||
using TIAM.Entities.Profiles;
|
||||
using TIAM.Entities.ServiceProviders;
|
||||
|
|
@ -13,9 +14,17 @@ public class UserProductMappingEntityTypeDefaultConfiguration : IAcEntityTypeCon
|
|||
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> //IAcEntityTypeConfiguration<User>//
|
||||
{
|
||||
public override void Configure(EntityTypeBuilder<User> builder)
|
||||
|
|
|
|||
|
|
@ -23,6 +23,7 @@
|
|||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\TIAM.Core\TIAM.Core.csproj" />
|
||||
<ProjectReference Include="..\TIAM.Entities.Server\TIAM.Entities.Server.csproj" />
|
||||
<ProjectReference Include="..\TIAM.Entities\TIAM.Entities.csproj" />
|
||||
<ProjectReference Include="..\TIAM.Models\TIAM.Models.csproj" />
|
||||
|
|
|
|||
|
|
@ -0,0 +1,28 @@
|
|||
using System.Collections.Specialized;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using AyCode.Interfaces.Entities;
|
||||
using AyCode.Interfaces.TimeStampInfo;
|
||||
|
||||
namespace TIAM.Entities.Emails;
|
||||
|
||||
[Table(nameof(EmailMessage))]
|
||||
public class EmailMessage : IEntityGuid, ITimeStampInfo
|
||||
{
|
||||
[Key, DatabaseGenerated(DatabaseGeneratedOption.None)]
|
||||
public Guid Id { get; set; }
|
||||
|
||||
public Guid ForeignKey { get; set; }
|
||||
public Guid UserProductMappingId { get; set; }
|
||||
public Guid UserId { get; set; }
|
||||
|
||||
public bool SentToUser { get; set; }
|
||||
[MaxLength(150)]
|
||||
public string EmailAddress { get; set; }
|
||||
[MaxLength(100)]
|
||||
public string Subject { get; set; }
|
||||
public string Text { get; set; }
|
||||
|
||||
public DateTime Created { get; set; }
|
||||
public DateTime Modified { get; set; }
|
||||
}
|
||||
|
|
@ -6,18 +6,25 @@ using System.Text.Json.Serialization;
|
|||
using TIAM.Core.Enums;
|
||||
using TIAM.Entities.Drivers;
|
||||
using TIAM.Entities.Products;
|
||||
using TIAM.Entities.Users;
|
||||
|
||||
namespace TIAM.Entities.Transfers;
|
||||
|
||||
[Table(nameof(Transfer))]
|
||||
public class Transfer: IEntityGuid, ITimeStampInfo, IProductForeignKey
|
||||
public class Transfer: IEntityGuid, ITimeStampInfo, IProductForeignKey, IUserProductMappingForeignKey<Guid?>
|
||||
{
|
||||
[Key, DatabaseGenerated(DatabaseGeneratedOption.None)]
|
||||
public Guid Id { get; set; }
|
||||
|
||||
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||
public int OrderId { get; }
|
||||
|
||||
public Guid ProductId { get; set; }
|
||||
public Guid? UserProductMappingId { get; set; }
|
||||
public Guid? UserProductToCarId { get; set; }
|
||||
|
||||
public virtual UserProductMapping? UserProductMapping { get; set; }
|
||||
|
||||
[Required] public TransferStatusType TransferStatusType { get; set; } = TransferStatusType.OrderSubmitted;
|
||||
|
||||
[Required] public DateTime Appointment { get; set; }
|
||||
|
|
|
|||
|
|
@ -0,0 +1,9 @@
|
|||
namespace TIAM.Entities.Users;
|
||||
|
||||
public interface IUserProductMappingForeignKey<T>
|
||||
{
|
||||
public T UserProductMappingId { get; set; }
|
||||
}
|
||||
|
||||
public interface IUserProductMappingForeignKey : IUserProductMappingForeignKey<Guid>
|
||||
{ }
|
||||
|
|
@ -7,6 +7,7 @@ using AyCode.Interfaces.TimeStampInfo;
|
|||
using AyCode.Interfaces.Users;
|
||||
using TIAM.Entities.Drivers;
|
||||
using TIAM.Entities.Products;
|
||||
using TIAM.Entities.Transfers;
|
||||
|
||||
namespace TIAM.Entities.Users;
|
||||
|
||||
|
|
@ -20,6 +21,7 @@ public class UserProductMapping : IEntityGuid, IUserForeignKey, IProductForeignK
|
|||
|
||||
public virtual User User { get; set; }
|
||||
public virtual Product Product { get; set; }
|
||||
public virtual List<Transfer>? Transfers { get; set; }
|
||||
|
||||
public int Permissions { get; set; } = 1;
|
||||
public bool IsAdmin { get; set; }
|
||||
|
|
|
|||
Loading…
Reference in New Issue