Skip to content

Commit

Permalink
Refactor Amazon shipping functionality and structure
Browse files Browse the repository at this point in the history
- Removed `AmazonConsoleApp` and its related files.
- Added `EasyKeys.Shipping.Amazon.Shipment` project for better organization.
- Updated `.editorconfig` for consistent coding styles.
- Introduced `AmazonShippingShipmentProvider` and `IAmazonShippingShipmentProvider` interface for shipment operations.
- Created `ShippingDetails` class to encapsulate shipment information.
- Enhanced `AmazonShippingRateProvider` to use dynamic package dimensions and weights.
- Implemented error handling in the new shipment provider.
  • Loading branch information
Brandon Moffett committed Dec 16, 2024
1 parent 59779fa commit 0ef5294
Show file tree
Hide file tree
Showing 9 changed files with 313 additions and 221 deletions.
28 changes: 14 additions & 14 deletions EasyKeys.Shipping.sln
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EasyKeys.Shipping.Amazon.Ab
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EasyKeys.Shipping.Amazon.Rates", "src\EasyKeys.Shipping.Amazon.Rates\EasyKeys.Shipping.Amazon.Rates.csproj", "{3668E9A5-CB31-4FC9-9918-B5046B67651A}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AmazonConsoleApp", "src\AmazonConsoleApp\AmazonConsoleApp.csproj", "{5051C834-91A0-4D77-B1F4-1E00C11D53FC}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EasyKeys.Shipping.Amazon.Shipment", "src\EasyKeys.Shipping.Amazon.Shipment\EasyKeys.Shipping.Amazon.Shipment.csproj", "{8B109CC8-6252-4668-983F-B0877710827C}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down Expand Up @@ -375,18 +375,18 @@ Global
{3668E9A5-CB31-4FC9-9918-B5046B67651A}.Release|x64.Build.0 = Release|Any CPU
{3668E9A5-CB31-4FC9-9918-B5046B67651A}.Release|x86.ActiveCfg = Release|Any CPU
{3668E9A5-CB31-4FC9-9918-B5046B67651A}.Release|x86.Build.0 = Release|Any CPU
{5051C834-91A0-4D77-B1F4-1E00C11D53FC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{5051C834-91A0-4D77-B1F4-1E00C11D53FC}.Debug|Any CPU.Build.0 = Debug|Any CPU
{5051C834-91A0-4D77-B1F4-1E00C11D53FC}.Debug|x64.ActiveCfg = Debug|Any CPU
{5051C834-91A0-4D77-B1F4-1E00C11D53FC}.Debug|x64.Build.0 = Debug|Any CPU
{5051C834-91A0-4D77-B1F4-1E00C11D53FC}.Debug|x86.ActiveCfg = Debug|Any CPU
{5051C834-91A0-4D77-B1F4-1E00C11D53FC}.Debug|x86.Build.0 = Debug|Any CPU
{5051C834-91A0-4D77-B1F4-1E00C11D53FC}.Release|Any CPU.ActiveCfg = Release|Any CPU
{5051C834-91A0-4D77-B1F4-1E00C11D53FC}.Release|Any CPU.Build.0 = Release|Any CPU
{5051C834-91A0-4D77-B1F4-1E00C11D53FC}.Release|x64.ActiveCfg = Release|Any CPU
{5051C834-91A0-4D77-B1F4-1E00C11D53FC}.Release|x64.Build.0 = Release|Any CPU
{5051C834-91A0-4D77-B1F4-1E00C11D53FC}.Release|x86.ActiveCfg = Release|Any CPU
{5051C834-91A0-4D77-B1F4-1E00C11D53FC}.Release|x86.Build.0 = Release|Any CPU
{8B109CC8-6252-4668-983F-B0877710827C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{8B109CC8-6252-4668-983F-B0877710827C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8B109CC8-6252-4668-983F-B0877710827C}.Debug|x64.ActiveCfg = Debug|Any CPU
{8B109CC8-6252-4668-983F-B0877710827C}.Debug|x64.Build.0 = Debug|Any CPU
{8B109CC8-6252-4668-983F-B0877710827C}.Debug|x86.ActiveCfg = Debug|Any CPU
{8B109CC8-6252-4668-983F-B0877710827C}.Debug|x86.Build.0 = Debug|Any CPU
{8B109CC8-6252-4668-983F-B0877710827C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8B109CC8-6252-4668-983F-B0877710827C}.Release|Any CPU.Build.0 = Release|Any CPU
{8B109CC8-6252-4668-983F-B0877710827C}.Release|x64.ActiveCfg = Release|Any CPU
{8B109CC8-6252-4668-983F-B0877710827C}.Release|x64.Build.0 = Release|Any CPU
{8B109CC8-6252-4668-983F-B0877710827C}.Release|x86.ActiveCfg = Release|Any CPU
{8B109CC8-6252-4668-983F-B0877710827C}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down Expand Up @@ -420,7 +420,7 @@ Global
{02EA681E-C7D8-13C7-8484-4AC65E1B71E8} = {BCBBDD1A-FF30-41E8-B7C1-9BB2A441FF83}
{3B6980FA-333A-46AD-9F33-0D9BFBD853A8} = {02EA681E-C7D8-13C7-8484-4AC65E1B71E8}
{3668E9A5-CB31-4FC9-9918-B5046B67651A} = {02EA681E-C7D8-13C7-8484-4AC65E1B71E8}
{5051C834-91A0-4D77-B1F4-1E00C11D53FC} = {02EA681E-C7D8-13C7-8484-4AC65E1B71E8}
{8B109CC8-6252-4668-983F-B0877710827C} = {02EA681E-C7D8-13C7-8484-4AC65E1B71E8}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {0FBE81B8-162F-4342-BABD-0FFFD0C99331}
Expand Down
202 changes: 0 additions & 202 deletions src/AmazonConsoleApp/Program.cs

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,9 @@ public async Task<Shipment> GetRatesAsync(Shipment shipment, CancellationToken c
Dimensions = new ()
{
Unit = DimensionsUnit.INCH,
Length = 1,
Width = 1,
Height = 1
Length = (double)shipment.Packages.Max(x => x.Dimensions.RoundedLength),
Width = (double)shipment.Packages.Max(x => x.Dimensions.RoundedWidth),
Height = (double)shipment.Packages.Max(x => x.Dimensions.RoundedHeight)
},
Weight = new ()
{
Expand All @@ -82,7 +82,7 @@ public async Task<Shipment> GetRatesAsync(Shipment shipment, CancellationToken c
{
Unit = LiquidVolumeUnit.ML
},
Description = "asdf",
Description = "Package",
Quantity = 1
}
}
Expand Down
File renamed without changes.
Loading

0 comments on commit 0ef5294

Please sign in to comment.