improvements, fixes, etc...
This commit is contained in:
parent
158713a869
commit
e918a77db3
|
|
@ -9,6 +9,9 @@ namespace FruitBank.Common.Entities;
|
|||
public class Partner : MgEntityBase, IPartner
|
||||
{
|
||||
public string Name { get; set; }
|
||||
public string TaxId { get; set; }
|
||||
public string CertificationNumber { get; set; }
|
||||
|
||||
public string PostalCode { get; set; }
|
||||
public string Country { get; set; }
|
||||
public string State { get; set; }
|
||||
|
|
|
|||
|
|
@ -8,7 +8,6 @@ namespace FruitBank.Common.Entities;
|
|||
[System.ComponentModel.DataAnnotations.Schema.Table(FruitBankConstClient.ShippingDbTableName)]
|
||||
public class Shipping : MgEntityBase, IShipping
|
||||
{
|
||||
public int PartnerId { get; set; }
|
||||
public DateTime ShippingDate { get; set; }
|
||||
public string LicencePlate { get; set; }
|
||||
public bool IsAllMeasured { get; set; }
|
||||
|
|
|
|||
|
|
@ -9,9 +9,13 @@ namespace FruitBank.Common.Entities;
|
|||
public class ShippingDocument : MgEntityBase, IShippingDocument
|
||||
{
|
||||
public int PartnerId { get; set; }
|
||||
public int ShippingId { get; set; }
|
||||
public int? ShippingId { get; set; }
|
||||
|
||||
public string DocumentIdNumber { get; set; }
|
||||
public DateTime ShippingDate { get; set; }
|
||||
public string Country { get; set; }
|
||||
public int TotalPallets { get; set; }
|
||||
|
||||
public bool IsAllMeasured { get; set; }
|
||||
|
||||
[Association(ThisKey = nameof(ShippingId), OtherKey = nameof(Shipping.Id), CanBeNull = true)]
|
||||
|
|
|
|||
|
|
@ -22,6 +22,9 @@ public class ShippingItem : MgEntityBase, IShippingItem
|
|||
public int ShippingDocumentId { get; set; }
|
||||
public string Name { get; set; }
|
||||
|
||||
public string PalletSize { get; set; }
|
||||
public int PalletsOnDocument { get; set; }
|
||||
|
||||
public int QuantityOnDocument { get; set; }
|
||||
|
||||
[Column(DataType = DataType.DecFloat)] public double NetWeightOnDocument { get; set; }
|
||||
|
|
|
|||
|
|
@ -10,7 +10,6 @@ namespace FruitBank.Common.Interfaces;
|
|||
public interface IFruitBankDataControllerCommon
|
||||
{
|
||||
public Task<List<MeasuringModel>?> GetMeasuringModels();
|
||||
public Task<MeasuringModel?> GetMeasuringModelByShippingId(int shippingId);
|
||||
|
||||
#region Partner
|
||||
public Task<List<Partner>?> GetPartners();
|
||||
|
|
|
|||
|
|
@ -6,6 +6,8 @@ namespace FruitBank.Common.Interfaces;
|
|||
public interface IPartner : IEntityInt, ITimeStampInfo
|
||||
{
|
||||
string Name { get; set; }
|
||||
string TaxId { get; set; }
|
||||
string CertificationNumber { get; set; }
|
||||
string PostalCode { get; set; }
|
||||
string Country { get; set; }
|
||||
string State { get; set; }
|
||||
|
|
|
|||
|
|
@ -6,7 +6,6 @@ namespace FruitBank.Common.Interfaces;
|
|||
|
||||
public interface IShipping : IEntityInt, ITimeStampInfo
|
||||
{
|
||||
int PartnerId { get; set; }
|
||||
DateTime ShippingDate { get; set; }
|
||||
string LicencePlate { get; set; }
|
||||
bool IsAllMeasured { get; set; }
|
||||
|
|
|
|||
|
|
@ -7,12 +7,37 @@ namespace FruitBank.Common.Interfaces;
|
|||
public interface IShippingDocument: IEntityInt, ITimeStampInfo
|
||||
{
|
||||
public int PartnerId { get; set; }
|
||||
public int ShippingId { get; set; }
|
||||
public int? ShippingId { get; set; }
|
||||
|
||||
public string DocumentIdNumber { get; set; }
|
||||
|
||||
public DateTime ShippingDate { get; set; }
|
||||
public string Country { get; set; }
|
||||
|
||||
int TotalPallets { get; set; }
|
||||
|
||||
public bool IsAllMeasured { get; set; }
|
||||
|
||||
public Partner? Partner { get; set; }
|
||||
public Shipping? Shipping{ get; set; }
|
||||
public List<ShippingItem>? ShippingItems { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//Shipping:
|
||||
//PartnerId kivesz a db-ből
|
||||
//string adószám taxId
|
||||
//string CertificationNumber
|
||||
|
||||
//ShippingDocument:
|
||||
//nullable ShippingId
|
||||
//string DocumentIdNumber
|
||||
//string PalletSize
|
||||
|
||||
//ShippingItem:
|
||||
//int PalletNumberOnDocument
|
||||
//string CertificationNumber
|
||||
|
||||
//Files:
|
||||
//string ForeignTable
|
||||
//string ForeignKey
|
||||
|
|
@ -11,6 +11,10 @@ public interface IShippingItem : IEntityInt, ITimeStampInfo
|
|||
int? ProductId { get; set; }
|
||||
|
||||
string Name { get; set; }
|
||||
|
||||
string PalletSize { get; set; }
|
||||
int PalletsOnDocument { get; set; }
|
||||
|
||||
int QuantityOnDocument { get; set; }
|
||||
double NetWeightOnDocument { get; set; }
|
||||
double GrossWeightOnDocument { get; set; }
|
||||
|
|
|
|||
|
|
@ -7,7 +7,6 @@ public class SignalRTags : AcSignalRTags
|
|||
public const int GetSiteViewModelByUserId = int.MaxValue;
|
||||
|
||||
public const int GetMeasuringModels = 10;
|
||||
public const int GetMeasuringModelByShippingId = 11;
|
||||
|
||||
public const int GetPartners = 20;
|
||||
public const int GetPartnerById = 21;
|
||||
|
|
|
|||
|
|
@ -66,18 +66,20 @@ namespace FruitBankHybrid.Shared.Tests
|
|||
var newName = GetFixtureName(partner.Name);
|
||||
|
||||
partner.Name = newName;
|
||||
await _signalRClient.UpdatePartner(partner);
|
||||
partner = await _signalRClient.UpdatePartner(partner);
|
||||
|
||||
partner = await GetPartnerByIdTest(partnerId);
|
||||
Assert.IsNotNull(partner);
|
||||
Assert.IsTrue(partner.Name == newName);
|
||||
|
||||
partner.Name = GetOriginalName(partner.Name);
|
||||
await _signalRClient.UpdatePartner(partner);
|
||||
partner = await _signalRClient.UpdatePartner(partner);
|
||||
|
||||
Assert.IsNotNull(partner);
|
||||
Assert.IsTrue(partner.Id == partnerId);
|
||||
}
|
||||
#endregion Partner
|
||||
|
||||
#region Shipping
|
||||
|
||||
[TestMethod]
|
||||
public async Task GetShippingsTest()
|
||||
{
|
||||
|
|
@ -124,10 +126,14 @@ namespace FruitBankHybrid.Shared.Tests
|
|||
await _signalRClient.UpdateShipping(shipping);
|
||||
|
||||
shipping = await GetShippingByIdTest(shippingId);
|
||||
|
||||
Assert.IsTrue(shipping.Id == shippingId);
|
||||
Assert.IsTrue(shipping.LicencePlate == newLicencePlate);
|
||||
|
||||
shipping.LicencePlate = GetOriginalName(shipping.LicencePlate);
|
||||
await _signalRClient.UpdateShipping(shipping);
|
||||
|
||||
Assert.IsTrue(shipping.Id == shippingId);
|
||||
}
|
||||
|
||||
#endregion Shipping
|
||||
|
|
|
|||
|
|
@ -22,16 +22,6 @@ namespace FruitBankHybrid.Shared.Services.SignalRs
|
|||
ConstHelper.NameByValue<SignalRTags>(0);
|
||||
}
|
||||
|
||||
public Task<MeasuringModel?> GetMeasuringModelByShippingId(int shippingId)
|
||||
=> GetByIdAsync<MeasuringModel>(SignalRTags.GetMeasuringModelByShippingId, shippingId);
|
||||
|
||||
//public Task GetWelcomeMessageAsync(string message, Action? callback = null)
|
||||
//{
|
||||
// Logger.Detail($"GetWelcomeMessageAsync client called; message: {message}");
|
||||
|
||||
// return GetAllAsync<string>(SignalRTags.GetAllTransferDestinations, callback);
|
||||
//}
|
||||
|
||||
public Task<List<MeasuringModel>?> GetMeasuringModels()
|
||||
=> GetAllAsync<List<MeasuringModel>>(SignalRTags.GetMeasuringModels);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue