Add UserProductMappingId to Transfer;

This commit is contained in:
jozsef.b@aycode.com 2024-01-18 20:37:02 +01:00
parent 8fc36ad0c1
commit b058d80c2e
2 changed files with 8 additions and 5 deletions

View File

@ -294,11 +294,12 @@ namespace TIAM.Database.Test
}
[DataTestMethod]
[DataRow(["8f38f8e3-a92c-4979-88b1-dc812a82245f", "814b5495-c2e9-4f1d-a73f-37cd5d353078"])]
public async Task TransferCrudTest(string[] transferIdProductIdStrings)
[DataRow(["8f38f8e3-a92c-4979-88b1-dc812a82245f", "814b5495-c2e9-4f1d-a73f-37cd5d353078", "71392CFD-FB9C-45C1-9540-7BE3782CF26A"])]
public async Task TransferCrudTest(string[] transferIdProductIdUserProductIdStrings)
{
var transferId = Guid.Parse(transferIdProductIdStrings[0]);
var productId = Guid.Parse(transferIdProductIdStrings[1]);
var transferId = Guid.Parse(transferIdProductIdUserProductIdStrings[0]);
var productId = Guid.Parse(transferIdProductIdUserProductIdStrings[1]);
var userProductMappingId = Guid.Parse(transferIdProductIdUserProductIdStrings[2]);
var fromAddress = "Budapest, Liszt Ferenc tér";
var toAddress = "1211 Budapest, Kossuth Lajos utca 145";
@ -328,6 +329,7 @@ namespace TIAM.Database.Test
transfer.Payed = true;
transfer.UserProductToCarId = userProductToCarId;
transfer.UserProductMappingId = userProductMappingId;
transfer.TransferStatusType = TransferStatusType.AssignedToDriver;

View File

@ -15,7 +15,8 @@ public class Transfer: IEntityGuid, ITimeStampInfo, IProductForeignKey<Guid?>
[Key, DatabaseGenerated(DatabaseGeneratedOption.None)]
public Guid Id { get; set; }
[Required] public Guid UserProductToCarId { get; set; }
public Guid? UserProductMappingId { get; set; }
public Guid? UserProductToCarId { get; set; }
[Required] public TransferStatusType TransferStatusType { get; set; } = TransferStatusType.OrderSubmitted;
[Required] public DateTime Appointment { get; set; }