Skip to content

Commit

Permalink
Adjust namespaces
Browse files Browse the repository at this point in the history
  • Loading branch information
alexeybusygin committed Aug 17, 2024
1 parent 6a38cfa commit cc16674
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 18 deletions.
2 changes: 1 addition & 1 deletion ShippingRates/Models/PackageKgCm.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace ShippingRates.Models
namespace ShippingRates
{
/// <summary>
/// Package object with dimensions in kgs and cm
Expand Down
2 changes: 1 addition & 1 deletion ShippingRates/Models/UnitsSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
using System.Text;
using System.Threading.Tasks;

namespace ShippingRates.Models
namespace ShippingRates
{
public enum UnitsSystem
{
Expand Down
8 changes: 4 additions & 4 deletions ShippingRates/ShippingProviders/DHLProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -143,10 +143,10 @@ private string BuildRatesRequestMessage(
{
writer.WriteStartElement("Piece");
writer.WriteElementString("PieceID", $"{i + 1}");
writer.WriteElementString("Height", Shipment.Packages[i].GetRoundedHeight(Models.UnitsSystem.USCustomary).ToString(requestCulture));
writer.WriteElementString("Depth", Shipment.Packages[i].GetRoundedLength(Models.UnitsSystem.USCustomary).ToString(requestCulture));
writer.WriteElementString("Width", Shipment.Packages[i].GetRoundedWidth(Models.UnitsSystem.USCustomary).ToString(requestCulture));
writer.WriteElementString("Weight", Shipment.Packages[i].GetRoundedWeight(Models.UnitsSystem.USCustomary).ToString(requestCulture));
writer.WriteElementString("Height", Shipment.Packages[i].GetRoundedHeight(UnitsSystem.USCustomary).ToString(requestCulture));
writer.WriteElementString("Depth", Shipment.Packages[i].GetRoundedLength(UnitsSystem.USCustomary).ToString(requestCulture));
writer.WriteElementString("Width", Shipment.Packages[i].GetRoundedWidth(UnitsSystem.USCustomary).ToString(requestCulture));
writer.WriteElementString("Weight", Shipment.Packages[i].GetRoundedWeight(UnitsSystem.USCustomary).ToString(requestCulture));
writer.WriteEndElement(); // </Piece>
}
writer.WriteEndElement(); // </Pieces>
Expand Down
8 changes: 4 additions & 4 deletions ShippingRates/ShippingProviders/FedExBaseProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -265,16 +265,16 @@ protected void SetPackageLineItems(RateRequest request)
{
Units = WeightUnits.LB, // TODO: Add support for CM and KG
UnitsSpecified = true,
Value = Shipment.Packages[i].GetRoundedWeight(Models.UnitsSystem.USCustomary),
Value = Shipment.Packages[i].GetRoundedWeight(UnitsSystem.USCustomary),
ValueSpecified = true
},

// Package dimensions
Dimensions = new Dimensions()
{
Length = Shipment.Packages[i].GetRoundedLength(Models.UnitsSystem.USCustomary).ToString(),
Width = Shipment.Packages[i].GetRoundedWidth(Models.UnitsSystem.USCustomary).ToString(),
Height = Shipment.Packages[i].GetRoundedHeight(Models.UnitsSystem.USCustomary).ToString(),
Length = Shipment.Packages[i].GetRoundedLength(UnitsSystem.USCustomary).ToString(),
Width = Shipment.Packages[i].GetRoundedWidth(UnitsSystem.USCustomary).ToString(),
Height = Shipment.Packages[i].GetRoundedHeight(UnitsSystem.USCustomary).ToString(),
Units = LinearUnits.IN, // TODO: Add support for CM and KG
UnitsSpecified = true
}
Expand Down
8 changes: 4 additions & 4 deletions ShippingRates/ShippingProviders/USPSInternationalProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -149,10 +149,10 @@ private string GetRequestXmlString()
writer.WriteElementString("ValueOfContents", package.InsuredValue.ToString());
writer.WriteElementString("Country", Shipment.DestinationAddress.GetCountryName());
writer.WriteElementString("Container", string.IsNullOrEmpty(package.Container) ? "RECTANGULAR" : package.Container);
writer.WriteElementString("Width", package.GetRoundedWidth(Models.UnitsSystem.USCustomary).ToString());
writer.WriteElementString("Length", package.GetRoundedLength(Models.UnitsSystem.USCustomary).ToString());
writer.WriteElementString("Height", package.GetRoundedHeight(Models.UnitsSystem.USCustomary).ToString());
writer.WriteElementString("Girth", package.GetCalculatedGirth(Models.UnitsSystem.USCustomary).ToString());
writer.WriteElementString("Width", package.GetRoundedWidth(UnitsSystem.USCustomary).ToString());
writer.WriteElementString("Length", package.GetRoundedLength(UnitsSystem.USCustomary).ToString());
writer.WriteElementString("Height", package.GetRoundedHeight(UnitsSystem.USCustomary).ToString());
writer.WriteElementString("Girth", package.GetCalculatedGirth(UnitsSystem.USCustomary).ToString());
writer.WriteElementString("OriginZip", Shipment.OriginAddress.PostalCode);
writer.WriteElementString("CommercialFlag", Commercial ? "Y" : "N");

Expand Down
8 changes: 4 additions & 4 deletions ShippingRates/ShippingProviders/USPSProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -178,10 +178,10 @@ private string GetRequestXmlString(List<SpecialServices> specialServices)
writer.WriteElementString("Ounces", package.PoundsAndOunces.Ounces.ToString());

writer.WriteElementString("Container", string.IsNullOrEmpty(package.Container) ? string.Empty : package.Container);
writer.WriteElementString("Width", package.GetRoundedWidth(Models.UnitsSystem.USCustomary).ToString());
writer.WriteElementString("Length", package.GetRoundedLength(Models.UnitsSystem.USCustomary).ToString());
writer.WriteElementString("Height", package.GetRoundedHeight(Models.UnitsSystem.USCustomary).ToString());
writer.WriteElementString("Girth", package.GetCalculatedGirth(Models.UnitsSystem.USCustomary).ToString());
writer.WriteElementString("Width", package.GetRoundedWidth(UnitsSystem.USCustomary).ToString());
writer.WriteElementString("Length", package.GetRoundedLength(UnitsSystem.USCustomary).ToString());
writer.WriteElementString("Height", package.GetRoundedHeight(UnitsSystem.USCustomary).ToString());
writer.WriteElementString("Girth", package.GetCalculatedGirth(UnitsSystem.USCustomary).ToString());
writer.WriteElementString("Value", package.InsuredValue.ToString());
if (RequiresMachinable(_configuration.Service))
{
Expand Down

0 comments on commit cc16674

Please sign in to comment.