diff --git a/.DS_Store b/.DS_Store index 61bd139..e665115 100644 Binary files a/.DS_Store and b/.DS_Store differ diff --git a/mobile-courier-app.xcodeproj/project.pbxproj b/mobile-courier-app.xcodeproj/project.pbxproj index 4504475..6a815f1 100644 --- a/mobile-courier-app.xcodeproj/project.pbxproj +++ b/mobile-courier-app.xcodeproj/project.pbxproj @@ -3,73 +3,34 @@ archiveVersion = 1; classes = { }; - objectVersion = 56; + objectVersion = 60; objects = { /* Begin PBXBuildFile section */ - 1B07BC8D2BFD677900D8B149 /* RippleSpinnerView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1B07BC8C2BFD677900D8B149 /* RippleSpinnerView.swift */; }; - 1B2DDEF22C1E7C95003EC97C /* WithdrawnPackagesView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1B2DDEF12C1E7C95003EC97C /* WithdrawnPackagesView.swift */; }; - 1B2DDEF42C1E7DD4003EC97C /* PackagePlaceholderView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1B2DDEF32C1E7DD4003EC97C /* PackagePlaceholderView.swift */; }; - 1B2DDEF62C1E9202003EC97C /* WithdrawnPackagesViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1B2DDEF52C1E9202003EC97C /* WithdrawnPackagesViewModel.swift */; }; - 1B2DDF022C1E9AC8003EC97C /* WithdrawnPackagesViewModelMock.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1B2DDF012C1E9AC8003EC97C /* WithdrawnPackagesViewModelMock.swift */; }; - 1B2DDF042C1E9B12003EC97C /* PackagesRepositoryMock.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1B2DDF032C1E9B12003EC97C /* PackagesRepositoryMock.swift */; }; - 1B2DDF062C1E9F85003EC97C /* GroupedPackageRowView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1B2DDF052C1E9F85003EC97C /* GroupedPackageRowView.swift */; }; - 1B4047192C2782B300101DF4 /* HomeViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1B4047182C2782B300101DF4 /* HomeViewModel.swift */; }; - 1B40471B2C27854200101DF4 /* AddressEntityMock.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1B40471A2C27854200101DF4 /* AddressEntityMock.swift */; }; - 1B40471D2C27C3CB00101DF4 /* GroupedPackageStyleModifier.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1B40471C2C27C3CB00101DF4 /* GroupedPackageStyleModifier.swift */; }; - 1B4047242C27DF9600101DF4 /* SettingsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1B4047232C27DF9600101DF4 /* SettingsView.swift */; }; - 1B4047282C27E04600101DF4 /* AppDIContainerMock.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1B4047272C27E04600101DF4 /* AppDIContainerMock.swift */; }; - 1B40472A2C27E99D00101DF4 /* AppDataMock.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1B4047292C27E99D00101DF4 /* AppDataMock.swift */; }; 1B58EF772BE6BBE90066F447 /* MobileCourierApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1B58EF762BE6BBE90066F447 /* MobileCourierApp.swift */; }; - 1B58EF792BE6BBE90066F447 /* CoordinatorRootView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1B58EF782BE6BBE90066F447 /* CoordinatorRootView.swift */; }; 1B58EF7B2BE6BBEA0066F447 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 1B58EF7A2BE6BBEA0066F447 /* Assets.xcassets */; }; 1B58EF7F2BE6BBEA0066F447 /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 1B58EF7E2BE6BBEA0066F447 /* Preview Assets.xcassets */; }; 1B58EF892BE6BBEA0066F447 /* LoginViewModelTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1B58EF882BE6BBEA0066F447 /* LoginViewModelTests.swift */; }; 1B58EF932BE6BBEA0066F447 /* MobileCourierAppUITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1B58EF922BE6BBEA0066F447 /* MobileCourierAppUITests.swift */; }; - 1B58EFA32BE6BF9A0066F447 /* LoginView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1B58EFA22BE6BF9A0066F447 /* LoginView.swift */; }; - 1B58EFA52BE6BFBB0066F447 /* LoginViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1B58EFA42BE6BFBB0066F447 /* LoginViewModel.swift */; }; - 1B58EFA92BE6C0070066F447 /* BorderedViewModifier.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1B58EFA82BE6C0070066F447 /* BorderedViewModifier.swift */; }; 1B58EFAB2BE6C1F30066F447 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 1B58EFAA2BE6C1F30066F447 /* LaunchScreen.storyboard */; }; - 1B58EFAE2BE6C2BE0066F447 /* CourierTextFieldStyle.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1B58EFAD2BE6C2BE0066F447 /* CourierTextFieldStyle.swift */; }; - 1B5E849F2C267F9600EDFDE2 /* DIContainerProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1B5E849E2C267F9600EDFDE2 /* DIContainerProtocol.swift */; }; 1B5E84A12C267FE200EDFDE2 /* AppDIContainer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1B5E84A02C267FE200EDFDE2 /* AppDIContainer.swift */; }; - 1B64291C2C3E27310001AD58 /* JustACourierAppData in Frameworks */ = {isa = PBXBuildFile; productRef = 1B64291B2C3E27310001AD58 /* JustACourierAppData */; }; - 1B6590E02C22853400D46A27 /* PackagesForWithdrawalView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1B6590DF2C22853400D46A27 /* PackagesForWithdrawalView.swift */; }; - 1B6590E22C22856F00D46A27 /* PackagesForWithdrawalViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1B6590E12C22856F00D46A27 /* PackagesForWithdrawalViewModel.swift */; }; - 1B6590E42C228DD700D46A27 /* PackagesForWithdrawalViewModelMock.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1B6590E32C228DD700D46A27 /* PackagesForWithdrawalViewModelMock.swift */; }; - 1B6D70972C3E23F1003E2781 /* JustACourierAppDomain in Frameworks */ = {isa = PBXBuildFile; productRef = 1B6D70962C3E23F1003E2781 /* JustACourierAppDomain */; }; - 1B6D75172C23BE5E0067BB56 /* GroupedPackageReadyView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1B6D75162C23BE5E0067BB56 /* GroupedPackageReadyView.swift */; }; - 1B6D75192C23BFB30067BB56 /* RoundedIndicatorViewModifier.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1B6D75182C23BFB30067BB56 /* RoundedIndicatorViewModifier.swift */; }; - 1B6D751C2C23DF910067BB56 /* ShipmentDetailView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1B6D751B2C23DF910067BB56 /* ShipmentDetailView.swift */; }; + 1B6177D92C3E2E5000324A69 /* JustACourierAppPresentation in Frameworks */ = {isa = PBXBuildFile; productRef = 1B6177D82C3E2E5000324A69 /* JustACourierAppPresentation */; }; + 1B6177DC2C3E2F2100324A69 /* JustACourierAppData in Frameworks */ = {isa = PBXBuildFile; productRef = 1B6177DB2C3E2F2100324A69 /* JustACourierAppData */; }; + 1B6177DF2C3E2F2B00324A69 /* JustACourierAppDomain in Frameworks */ = {isa = PBXBuildFile; productRef = 1B6177DE2C3E2F2B00324A69 /* JustACourierAppDomain */; }; + 1B6177E22C3E2F3B00324A69 /* JustACourierAppPresentation in Frameworks */ = {isa = PBXBuildFile; productRef = 1B6177E12C3E2F3B00324A69 /* JustACourierAppPresentation */; }; 1B6E61772C3642E600562112 /* JustACourierAppDomain in Frameworks */ = {isa = PBXBuildFile; productRef = 1B6E61762C3642E600562112 /* JustACourierAppDomain */; }; - 1B6F7C332C2BA9D6005F0476 /* RippleSpinnerModifier.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1B6F7C322C2BA9D6005F0476 /* RippleSpinnerModifier.swift */; }; - 1B85000E2C10033D006E96A0 /* ToastView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1B85000D2C10033D006E96A0 /* ToastView.swift */; }; - 1B8500102C1004D0006E96A0 /* ToastModifier.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1B85000F2C1004D0006E96A0 /* ToastModifier.swift */; }; - 1B8500152C100DF1006E96A0 /* ProfileView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1B8500142C100DF1006E96A0 /* ProfileView.swift */; }; - 1B8B0A442C1BDDE600D1A7AC /* HeaderView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1B8B0A432C1BDDE600D1A7AC /* HeaderView.swift */; }; 1B96E9AF2C3E1A3000ECC3F6 /* JustACourierAppDomain in Frameworks */ = {isa = PBXBuildFile; productRef = 1B96E9AE2C3E1A3000ECC3F6 /* JustACourierAppDomain */; }; 1B96E9B22C3E1A4500ECC3F6 /* JustACourierAppData in Frameworks */ = {isa = PBXBuildFile; productRef = 1B96E9B12C3E1A4500ECC3F6 /* JustACourierAppData */; }; 1B98EDCC2C37902800FD5F04 /* JustACourierAppDomain in Frameworks */ = {isa = PBXBuildFile; productRef = 1B98EDCB2C37902800FD5F04 /* JustACourierAppDomain */; }; - 1BA99DD32C2A6712003D38F8 /* SettingsViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1BA99DD22C2A6712003D38F8 /* SettingsViewModel.swift */; }; 1BAB0EE62BFEE2D9004DF155 /* Localizable.xcstrings in Resources */ = {isa = PBXBuildFile; fileRef = 1BAB0EE52BFEE2D9004DF155 /* Localizable.xcstrings */; }; - 1BC0717A2C140C6A006EC08E /* HomeViewModelMock.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1BC071792C140C6A006EC08E /* HomeViewModelMock.swift */; }; - 1BC0717C2C140CA9006EC08E /* AddressesRepositoryMock.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1BC0717B2C140CA9006EC08E /* AddressesRepositoryMock.swift */; }; - 1BC0717E2C140F86006EC08E /* ShipmentRowView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1BC0717D2C140F86006EC08E /* ShipmentRowView.swift */; }; - 1BD17E632C0EB438009B6C67 /* Coordinator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1BD17E622C0EB438009B6C67 /* Coordinator.swift */; }; - 1BE58CA62C05727500C7DF63 /* AuthRepositoryMock.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1BE58CA52C05727500C7DF63 /* AuthRepositoryMock.swift */; }; - 1BE58CA82C0572B400C7DF63 /* StorageMock.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1BE58CA72C0572B400C7DF63 /* StorageMock.swift */; }; - 1BE58CAA2C05731B00C7DF63 /* LoginViewModelMock.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1BE58CA92C05731B00C7DF63 /* LoginViewModelMock.swift */; }; + 1BE1152F2C3E2A260018958E /* JustACourierAppDomain in Frameworks */ = {isa = PBXBuildFile; productRef = 1BE1152E2C3E2A260018958E /* JustACourierAppDomain */; }; 1BE58CAE2C05757000C7DF63 /* AuthRepositorySpy.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1BE58CAD2C05757000C7DF63 /* AuthRepositorySpy.swift */; }; 1BE58CB02C05757C00C7DF63 /* StorageSpy.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1BE58CAF2C05757C00C7DF63 /* StorageSpy.swift */; }; - 1BE58CB32C0585C400C7DF63 /* HomeView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1BE58CB22C0585C400C7DF63 /* HomeView.swift */; }; - 1BE63F712BE980D60016A26E /* Storage.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1BE63F702BE980D60016A26E /* Storage.swift */; }; - 1BE7837B2C2E503000D2093E /* AccessibilityIdentifiers.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1BE7837A2C2E503000D2093E /* AccessibilityIdentifiers.swift */; }; + 1BE63F712BE980D60016A26E /* UserDefaultsStorage.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1BE63F702BE980D60016A26E /* UserDefaultsStorage.swift */; }; 1BE7837E2C2E61BE00D2093E /* LoginScreen.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1BE7837D2C2E61BE00D2093E /* LoginScreen.swift */; }; 1BE783802C2E61CA00D2093E /* HomeScreen.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1BE7837F2C2E61CA00D2093E /* HomeScreen.swift */; }; 1BE783822C2E61D400D2093E /* Screen.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1BE783812C2E61D400D2093E /* Screen.swift */; }; 1BE783852C2E630000D2093E /* XCUIElement+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1BE783842C2E630000D2093E /* XCUIElement+Extensions.swift */; }; - 1BEE841F2C17D6FF00B8A367 /* RowView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1BEE841E2C17D6FF00B8A367 /* RowView.swift */; }; - 1BFD1EAF2C2A688B002E4232 /* SettingsViewModelMock.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1BFD1EAE2C2A688B002E4232 /* SettingsViewModelMock.swift */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -90,22 +51,8 @@ /* End PBXContainerItemProxy section */ /* Begin PBXFileReference section */ - 1B07BC8C2BFD677900D8B149 /* RippleSpinnerView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RippleSpinnerView.swift; sourceTree = ""; }; - 1B2DDEF12C1E7C95003EC97C /* WithdrawnPackagesView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WithdrawnPackagesView.swift; sourceTree = ""; }; - 1B2DDEF32C1E7DD4003EC97C /* PackagePlaceholderView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PackagePlaceholderView.swift; sourceTree = ""; }; - 1B2DDEF52C1E9202003EC97C /* WithdrawnPackagesViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WithdrawnPackagesViewModel.swift; sourceTree = ""; }; - 1B2DDF012C1E9AC8003EC97C /* WithdrawnPackagesViewModelMock.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WithdrawnPackagesViewModelMock.swift; sourceTree = ""; }; - 1B2DDF032C1E9B12003EC97C /* PackagesRepositoryMock.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PackagesRepositoryMock.swift; sourceTree = ""; }; - 1B2DDF052C1E9F85003EC97C /* GroupedPackageRowView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GroupedPackageRowView.swift; sourceTree = ""; }; - 1B4047182C2782B300101DF4 /* HomeViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HomeViewModel.swift; sourceTree = ""; }; - 1B40471A2C27854200101DF4 /* AddressEntityMock.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AddressEntityMock.swift; sourceTree = ""; }; - 1B40471C2C27C3CB00101DF4 /* GroupedPackageStyleModifier.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GroupedPackageStyleModifier.swift; sourceTree = ""; }; - 1B4047232C27DF9600101DF4 /* SettingsView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SettingsView.swift; sourceTree = ""; }; - 1B4047272C27E04600101DF4 /* AppDIContainerMock.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDIContainerMock.swift; sourceTree = ""; }; - 1B4047292C27E99D00101DF4 /* AppDataMock.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDataMock.swift; sourceTree = ""; }; 1B58EF732BE6BBE90066F447 /* mobile-courier-app.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "mobile-courier-app.app"; sourceTree = BUILT_PRODUCTS_DIR; }; 1B58EF762BE6BBE90066F447 /* MobileCourierApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MobileCourierApp.swift; sourceTree = ""; }; - 1B58EF782BE6BBE90066F447 /* CoordinatorRootView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CoordinatorRootView.swift; sourceTree = ""; }; 1B58EF7A2BE6BBEA0066F447 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 1B58EF7C2BE6BBEA0066F447 /* mobile_courier_app.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = mobile_courier_app.entitlements; sourceTree = ""; }; 1B58EF7E2BE6BBEA0066F447 /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Preview Assets.xcassets"; sourceTree = ""; }; @@ -113,45 +60,17 @@ 1B58EF882BE6BBEA0066F447 /* LoginViewModelTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LoginViewModelTests.swift; sourceTree = ""; }; 1B58EF8E2BE6BBEA0066F447 /* mobile-courier-appUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "mobile-courier-appUITests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; 1B58EF922BE6BBEA0066F447 /* MobileCourierAppUITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MobileCourierAppUITests.swift; sourceTree = ""; }; - 1B58EFA22BE6BF9A0066F447 /* LoginView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LoginView.swift; sourceTree = ""; }; - 1B58EFA42BE6BFBB0066F447 /* LoginViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LoginViewModel.swift; sourceTree = ""; }; - 1B58EFA82BE6C0070066F447 /* BorderedViewModifier.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BorderedViewModifier.swift; sourceTree = ""; }; 1B58EFAA2BE6C1F30066F447 /* LaunchScreen.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = LaunchScreen.storyboard; sourceTree = ""; }; - 1B58EFAD2BE6C2BE0066F447 /* CourierTextFieldStyle.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CourierTextFieldStyle.swift; sourceTree = ""; }; - 1B5E849E2C267F9600EDFDE2 /* DIContainerProtocol.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DIContainerProtocol.swift; sourceTree = ""; }; 1B5E84A02C267FE200EDFDE2 /* AppDIContainer.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDIContainer.swift; sourceTree = ""; }; - 1B6590DF2C22853400D46A27 /* PackagesForWithdrawalView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PackagesForWithdrawalView.swift; sourceTree = ""; }; - 1B6590E12C22856F00D46A27 /* PackagesForWithdrawalViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PackagesForWithdrawalViewModel.swift; sourceTree = ""; }; - 1B6590E32C228DD700D46A27 /* PackagesForWithdrawalViewModelMock.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PackagesForWithdrawalViewModelMock.swift; sourceTree = ""; }; - 1B6D75162C23BE5E0067BB56 /* GroupedPackageReadyView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GroupedPackageReadyView.swift; sourceTree = ""; }; - 1B6D75182C23BFB30067BB56 /* RoundedIndicatorViewModifier.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RoundedIndicatorViewModifier.swift; sourceTree = ""; }; - 1B6D751B2C23DF910067BB56 /* ShipmentDetailView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ShipmentDetailView.swift; sourceTree = ""; }; - 1B6F7C322C2BA9D6005F0476 /* RippleSpinnerModifier.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RippleSpinnerModifier.swift; sourceTree = ""; }; - 1B85000D2C10033D006E96A0 /* ToastView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ToastView.swift; sourceTree = ""; }; - 1B85000F2C1004D0006E96A0 /* ToastModifier.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ToastModifier.swift; sourceTree = ""; }; - 1B8500142C100DF1006E96A0 /* ProfileView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ProfileView.swift; sourceTree = ""; }; - 1B8B0A432C1BDDE600D1A7AC /* HeaderView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HeaderView.swift; sourceTree = ""; }; - 1BA99DD22C2A6712003D38F8 /* SettingsViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SettingsViewModel.swift; sourceTree = ""; }; 1BAB0EE52BFEE2D9004DF155 /* Localizable.xcstrings */ = {isa = PBXFileReference; lastKnownFileType = text.json.xcstrings; path = Localizable.xcstrings; sourceTree = ""; }; - 1BC071792C140C6A006EC08E /* HomeViewModelMock.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HomeViewModelMock.swift; sourceTree = ""; }; - 1BC0717B2C140CA9006EC08E /* AddressesRepositoryMock.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AddressesRepositoryMock.swift; sourceTree = ""; }; - 1BC0717D2C140F86006EC08E /* ShipmentRowView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ShipmentRowView.swift; sourceTree = ""; }; - 1BD17E622C0EB438009B6C67 /* Coordinator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Coordinator.swift; sourceTree = ""; }; - 1BE58CA52C05727500C7DF63 /* AuthRepositoryMock.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AuthRepositoryMock.swift; sourceTree = ""; }; - 1BE58CA72C0572B400C7DF63 /* StorageMock.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StorageMock.swift; sourceTree = ""; }; - 1BE58CA92C05731B00C7DF63 /* LoginViewModelMock.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LoginViewModelMock.swift; sourceTree = ""; }; 1BE58CAD2C05757000C7DF63 /* AuthRepositorySpy.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AuthRepositorySpy.swift; sourceTree = ""; }; 1BE58CAF2C05757C00C7DF63 /* StorageSpy.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StorageSpy.swift; sourceTree = ""; }; - 1BE58CB22C0585C400C7DF63 /* HomeView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HomeView.swift; sourceTree = ""; }; - 1BE63F702BE980D60016A26E /* Storage.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Storage.swift; sourceTree = ""; }; + 1BE63F702BE980D60016A26E /* UserDefaultsStorage.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UserDefaultsStorage.swift; sourceTree = ""; }; 1BE63F722BE98ADD0016A26E /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist; path = Info.plist; sourceTree = ""; }; - 1BE7837A2C2E503000D2093E /* AccessibilityIdentifiers.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AccessibilityIdentifiers.swift; sourceTree = ""; }; 1BE7837D2C2E61BE00D2093E /* LoginScreen.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LoginScreen.swift; sourceTree = ""; }; 1BE7837F2C2E61CA00D2093E /* HomeScreen.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HomeScreen.swift; sourceTree = ""; }; 1BE783812C2E61D400D2093E /* Screen.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Screen.swift; sourceTree = ""; }; 1BE783842C2E630000D2093E /* XCUIElement+Extensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "XCUIElement+Extensions.swift"; sourceTree = ""; }; - 1BEE841E2C17D6FF00B8A367 /* RowView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RowView.swift; sourceTree = ""; }; - 1BFD1EAE2C2A688B002E4232 /* SettingsViewModelMock.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SettingsViewModelMock.swift; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -159,11 +78,14 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 1B6D70972C3E23F1003E2781 /* JustACourierAppDomain in Frameworks */, 1B98EDCC2C37902800FD5F04 /* JustACourierAppDomain in Frameworks */, - 1B64291C2C3E27310001AD58 /* JustACourierAppData in Frameworks */, + 1B6177D92C3E2E5000324A69 /* JustACourierAppPresentation in Frameworks */, + 1B6177DF2C3E2F2B00324A69 /* JustACourierAppDomain in Frameworks */, + 1BE1152F2C3E2A260018958E /* JustACourierAppDomain in Frameworks */, 1B6E61772C3642E600562112 /* JustACourierAppDomain in Frameworks */, + 1B6177E22C3E2F3B00324A69 /* JustACourierAppPresentation in Frameworks */, 1B96E9B22C3E1A4500ECC3F6 /* JustACourierAppData in Frameworks */, + 1B6177DC2C3E2F2100324A69 /* JustACourierAppData in Frameworks */, 1B96E9AF2C3E1A3000ECC3F6 /* JustACourierAppDomain in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; @@ -185,39 +107,6 @@ /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ - 1B07BC8B2BFD676100D8B149 /* Helpers */ = { - isa = PBXGroup; - children = ( - 1B58EFAC2BE6C2A70066F447 /* Styles */, - 1B58EFA72BE6BFDF0066F447 /* Modifiers */, - 1B07BC8C2BFD677900D8B149 /* RippleSpinnerView.swift */, - 1B85000D2C10033D006E96A0 /* ToastView.swift */, - 1B8B0A432C1BDDE600D1A7AC /* HeaderView.swift */, - 1B2DDEF32C1E7DD4003EC97C /* PackagePlaceholderView.swift */, - 1BE7837A2C2E503000D2093E /* AccessibilityIdentifiers.swift */, - ); - path = Helpers; - sourceTree = ""; - }; - 1B2DDEF02C1E652A003EC97C /* WithdrawnPackages */ = { - isa = PBXGroup; - children = ( - 1B2DDEF12C1E7C95003EC97C /* WithdrawnPackagesView.swift */, - 1B2DDEF52C1E9202003EC97C /* WithdrawnPackagesViewModel.swift */, - 1B2DDF052C1E9F85003EC97C /* GroupedPackageRowView.swift */, - ); - path = WithdrawnPackages; - sourceTree = ""; - }; - 1B40471E2C27DF3100101DF4 /* Settings */ = { - isa = PBXGroup; - children = ( - 1B4047232C27DF9600101DF4 /* SettingsView.swift */, - 1BA99DD22C2A6712003D38F8 /* SettingsViewModel.swift */, - ); - path = Settings; - sourceTree = ""; - }; 1B58EF6A2BE6BBE90066F447 = { isa = PBXGroup; children = ( @@ -243,7 +132,6 @@ isa = PBXGroup; children = ( 1B5E849D2C267F7B00EDFDE2 /* App */, - 1B85E8EB2BFC4EAB003040CC /* Presentation */, 1BE63F722BE98ADD0016A26E /* Info.plist */, 1B58EFA62BE6BFD70066F447 /* Utilities */, 1B58EF7A2BE6BBEA0066F447 /* Assets.xcassets */, @@ -281,100 +169,24 @@ path = "mobile-courier-appUITests"; sourceTree = ""; }; - 1B58EFA12BE6BF870066F447 /* Login */ = { - isa = PBXGroup; - children = ( - 1B58EFA22BE6BF9A0066F447 /* LoginView.swift */, - 1B58EFA42BE6BFBB0066F447 /* LoginViewModel.swift */, - ); - path = Login; - sourceTree = ""; - }; 1B58EFA62BE6BFD70066F447 /* Utilities */ = { isa = PBXGroup; children = ( 1BAB0EE52BFEE2D9004DF155 /* Localizable.xcstrings */, - 1BE63F702BE980D60016A26E /* Storage.swift */, ); path = Utilities; sourceTree = ""; }; - 1B58EFA72BE6BFDF0066F447 /* Modifiers */ = { - isa = PBXGroup; - children = ( - 1B58EFA82BE6C0070066F447 /* BorderedViewModifier.swift */, - 1B85000F2C1004D0006E96A0 /* ToastModifier.swift */, - 1B6D75182C23BFB30067BB56 /* RoundedIndicatorViewModifier.swift */, - 1B40471C2C27C3CB00101DF4 /* GroupedPackageStyleModifier.swift */, - 1B6F7C322C2BA9D6005F0476 /* RippleSpinnerModifier.swift */, - ); - path = Modifiers; - sourceTree = ""; - }; - 1B58EFAC2BE6C2A70066F447 /* Styles */ = { - isa = PBXGroup; - children = ( - 1B58EFAD2BE6C2BE0066F447 /* CourierTextFieldStyle.swift */, - ); - path = Styles; - sourceTree = ""; - }; 1B5E849D2C267F7B00EDFDE2 /* App */ = { isa = PBXGroup; children = ( 1B58EF762BE6BBE90066F447 /* MobileCourierApp.swift */, - 1B5E849E2C267F9600EDFDE2 /* DIContainerProtocol.swift */, 1B5E84A02C267FE200EDFDE2 /* AppDIContainer.swift */, + 1BE63F702BE980D60016A26E /* UserDefaultsStorage.swift */, ); path = App; sourceTree = ""; }; - 1B6D75152C23BDA40067BB56 /* PackagesForWithdrawal */ = { - isa = PBXGroup; - children = ( - 1B6590DF2C22853400D46A27 /* PackagesForWithdrawalView.swift */, - 1B6590E12C22856F00D46A27 /* PackagesForWithdrawalViewModel.swift */, - 1B6D75162C23BE5E0067BB56 /* GroupedPackageReadyView.swift */, - ); - path = PackagesForWithdrawal; - sourceTree = ""; - }; - 1B6D751A2C23DF820067BB56 /* ShipmentDetail */ = { - isa = PBXGroup; - children = ( - 1B6D751B2C23DF910067BB56 /* ShipmentDetailView.swift */, - ); - path = ShipmentDetail; - sourceTree = ""; - }; - 1B8500132C100DE2006E96A0 /* Profile */ = { - isa = PBXGroup; - children = ( - 1B8500142C100DF1006E96A0 /* ProfileView.swift */, - 1BC0717D2C140F86006EC08E /* ShipmentRowView.swift */, - 1BEE841E2C17D6FF00B8A367 /* RowView.swift */, - ); - path = Profile; - sourceTree = ""; - }; - 1B85E8EB2BFC4EAB003040CC /* Presentation */ = { - isa = PBXGroup; - children = ( - 1B58EF782BE6BBE90066F447 /* CoordinatorRootView.swift */, - 1B40471E2C27DF3100101DF4 /* Settings */, - 1B6D751A2C23DF820067BB56 /* ShipmentDetail */, - 1B6D75152C23BDA40067BB56 /* PackagesForWithdrawal */, - 1B2DDEF02C1E652A003EC97C /* WithdrawnPackages */, - 1B8500132C100DE2006E96A0 /* Profile */, - 1BE58CB12C0585B400C7DF63 /* Home */, - 1B58EFA12BE6BF870066F447 /* Login */, - 1BD17E612C0EB42B009B6C67 /* Navigation */, - 1B07BC8B2BFD676100D8B149 /* Helpers */, - 1BE58CA42C05725500C7DF63 /* Previews */, - ); - path = Presentation; - sourceTree = ""; - }; 1B9D15A02C02D904001F47E8 /* Frameworks */ = { isa = PBXGroup; children = ( @@ -382,33 +194,6 @@ name = Frameworks; sourceTree = ""; }; - 1BD17E612C0EB42B009B6C67 /* Navigation */ = { - isa = PBXGroup; - children = ( - 1BD17E622C0EB438009B6C67 /* Coordinator.swift */, - ); - path = Navigation; - sourceTree = ""; - }; - 1BE58CA42C05725500C7DF63 /* Previews */ = { - isa = PBXGroup; - children = ( - 1B4047272C27E04600101DF4 /* AppDIContainerMock.swift */, - 1BE58CA52C05727500C7DF63 /* AuthRepositoryMock.swift */, - 1BE58CA72C0572B400C7DF63 /* StorageMock.swift */, - 1BE58CA92C05731B00C7DF63 /* LoginViewModelMock.swift */, - 1BC071792C140C6A006EC08E /* HomeViewModelMock.swift */, - 1BC0717B2C140CA9006EC08E /* AddressesRepositoryMock.swift */, - 1B2DDF012C1E9AC8003EC97C /* WithdrawnPackagesViewModelMock.swift */, - 1B2DDF032C1E9B12003EC97C /* PackagesRepositoryMock.swift */, - 1B6590E32C228DD700D46A27 /* PackagesForWithdrawalViewModelMock.swift */, - 1B40471A2C27854200101DF4 /* AddressEntityMock.swift */, - 1B4047292C27E99D00101DF4 /* AppDataMock.swift */, - 1BFD1EAE2C2A688B002E4232 /* SettingsViewModelMock.swift */, - ); - path = Previews; - sourceTree = ""; - }; 1BE58CAB2C05755100C7DF63 /* Doubles */ = { isa = PBXGroup; children = ( @@ -426,15 +211,6 @@ path = Spy; sourceTree = ""; }; - 1BE58CB12C0585B400C7DF63 /* Home */ = { - isa = PBXGroup; - children = ( - 1BE58CB22C0585C400C7DF63 /* HomeView.swift */, - 1B4047182C2782B300101DF4 /* HomeViewModel.swift */, - ); - path = Home; - sourceTree = ""; - }; 1BE7837C2C2E619A00D2093E /* Screens */ = { isa = PBXGroup; children = ( @@ -475,8 +251,11 @@ 1B98EDCB2C37902800FD5F04 /* JustACourierAppDomain */, 1B96E9AE2C3E1A3000ECC3F6 /* JustACourierAppDomain */, 1B96E9B12C3E1A4500ECC3F6 /* JustACourierAppData */, - 1B6D70962C3E23F1003E2781 /* JustACourierAppDomain */, - 1B64291B2C3E27310001AD58 /* JustACourierAppData */, + 1BE1152E2C3E2A260018958E /* JustACourierAppDomain */, + 1B6177D82C3E2E5000324A69 /* JustACourierAppPresentation */, + 1B6177DB2C3E2F2100324A69 /* JustACourierAppData */, + 1B6177DE2C3E2F2B00324A69 /* JustACourierAppDomain */, + 1B6177E12C3E2F3B00324A69 /* JustACourierAppPresentation */, ); productName = "mobile-courier-app"; productReference = 1B58EF732BE6BBE90066F447 /* mobile-courier-app.app */; @@ -552,8 +331,9 @@ ); mainGroup = 1B58EF6A2BE6BBE90066F447; packageReferences = ( - 1B6D70952C3E23F1003E2781 /* XCRemoteSwiftPackageReference "mobile-courier-app-domain" */, - 1B64291A2C3E27310001AD58 /* XCRemoteSwiftPackageReference "mobile-courier-app-data" */, + 1B6177DA2C3E2F2100324A69 /* XCRemoteSwiftPackageReference "mobile-courier-app-data" */, + 1B6177DD2C3E2F2A00324A69 /* XCRemoteSwiftPackageReference "mobile-courier-app-domain" */, + 1B6177E02C3E2F3B00324A69 /* XCLocalSwiftPackageReference "../mobile-courier-app-presentation" */, ); productRefGroup = 1B58EF742BE6BBE90066F447 /* Products */; projectDirPath = ""; @@ -621,51 +401,9 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - 1B4047242C27DF9600101DF4 /* SettingsView.swift in Sources */, - 1B2DDEF42C1E7DD4003EC97C /* PackagePlaceholderView.swift in Sources */, - 1B07BC8D2BFD677900D8B149 /* RippleSpinnerView.swift in Sources */, - 1B4047282C27E04600101DF4 /* AppDIContainerMock.swift in Sources */, - 1BE58CA82C0572B400C7DF63 /* StorageMock.swift in Sources */, - 1BFD1EAF2C2A688B002E4232 /* SettingsViewModelMock.swift in Sources */, - 1B8B0A442C1BDDE600D1A7AC /* HeaderView.swift in Sources */, - 1B6590E02C22853400D46A27 /* PackagesForWithdrawalView.swift in Sources */, - 1BE58CAA2C05731B00C7DF63 /* LoginViewModelMock.swift in Sources */, - 1B40471D2C27C3CB00101DF4 /* GroupedPackageStyleModifier.swift in Sources */, - 1BE63F712BE980D60016A26E /* Storage.swift in Sources */, - 1B85000E2C10033D006E96A0 /* ToastView.swift in Sources */, - 1B8500102C1004D0006E96A0 /* ToastModifier.swift in Sources */, - 1B2DDEF62C1E9202003EC97C /* WithdrawnPackagesViewModel.swift in Sources */, - 1B6590E42C228DD700D46A27 /* PackagesForWithdrawalViewModelMock.swift in Sources */, - 1B4047192C2782B300101DF4 /* HomeViewModel.swift in Sources */, - 1B58EFA52BE6BFBB0066F447 /* LoginViewModel.swift in Sources */, - 1B58EFAE2BE6C2BE0066F447 /* CourierTextFieldStyle.swift in Sources */, - 1B58EFA32BE6BF9A0066F447 /* LoginView.swift in Sources */, - 1BEE841F2C17D6FF00B8A367 /* RowView.swift in Sources */, - 1BC0717E2C140F86006EC08E /* ShipmentRowView.swift in Sources */, - 1B58EF792BE6BBE90066F447 /* CoordinatorRootView.swift in Sources */, + 1BE63F712BE980D60016A26E /* UserDefaultsStorage.swift in Sources */, 1B5E84A12C267FE200EDFDE2 /* AppDIContainer.swift in Sources */, - 1B2DDF042C1E9B12003EC97C /* PackagesRepositoryMock.swift in Sources */, - 1B2DDEF22C1E7C95003EC97C /* WithdrawnPackagesView.swift in Sources */, - 1B6D75172C23BE5E0067BB56 /* GroupedPackageReadyView.swift in Sources */, - 1B6590E22C22856F00D46A27 /* PackagesForWithdrawalViewModel.swift in Sources */, - 1B58EFA92BE6C0070066F447 /* BorderedViewModifier.swift in Sources */, - 1BC0717C2C140CA9006EC08E /* AddressesRepositoryMock.swift in Sources */, - 1B40471B2C27854200101DF4 /* AddressEntityMock.swift in Sources */, - 1B8500152C100DF1006E96A0 /* ProfileView.swift in Sources */, - 1B6F7C332C2BA9D6005F0476 /* RippleSpinnerModifier.swift in Sources */, - 1B6D751C2C23DF910067BB56 /* ShipmentDetailView.swift in Sources */, - 1B5E849F2C267F9600EDFDE2 /* DIContainerProtocol.swift in Sources */, - 1BA99DD32C2A6712003D38F8 /* SettingsViewModel.swift in Sources */, 1B58EF772BE6BBE90066F447 /* MobileCourierApp.swift in Sources */, - 1B2DDF022C1E9AC8003EC97C /* WithdrawnPackagesViewModelMock.swift in Sources */, - 1B40472A2C27E99D00101DF4 /* AppDataMock.swift in Sources */, - 1BC0717A2C140C6A006EC08E /* HomeViewModelMock.swift in Sources */, - 1B6D75192C23BFB30067BB56 /* RoundedIndicatorViewModifier.swift in Sources */, - 1BE58CA62C05727500C7DF63 /* AuthRepositoryMock.swift in Sources */, - 1BE58CB32C0585C400C7DF63 /* HomeView.swift in Sources */, - 1B2DDF062C1E9F85003EC97C /* GroupedPackageRowView.swift in Sources */, - 1BE7837B2C2E503000D2093E /* AccessibilityIdentifiers.swift in Sources */, - 1BD17E632C0EB438009B6C67 /* Coordinator.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1039,8 +777,15 @@ }; /* End XCConfigurationList section */ +/* Begin XCLocalSwiftPackageReference section */ + 1B6177E02C3E2F3B00324A69 /* XCLocalSwiftPackageReference "../mobile-courier-app-presentation" */ = { + isa = XCLocalSwiftPackageReference; + relativePath = "../mobile-courier-app-presentation"; + }; +/* End XCLocalSwiftPackageReference section */ + /* Begin XCRemoteSwiftPackageReference section */ - 1B64291A2C3E27310001AD58 /* XCRemoteSwiftPackageReference "mobile-courier-app-data" */ = { + 1B6177DA2C3E2F2100324A69 /* XCRemoteSwiftPackageReference "mobile-courier-app-data" */ = { isa = XCRemoteSwiftPackageReference; repositoryURL = "https://github.com/vespinola/mobile-courier-app-data"; requirement = { @@ -1048,7 +793,7 @@ kind = branch; }; }; - 1B6D70952C3E23F1003E2781 /* XCRemoteSwiftPackageReference "mobile-courier-app-domain" */ = { + 1B6177DD2C3E2F2A00324A69 /* XCRemoteSwiftPackageReference "mobile-courier-app-domain" */ = { isa = XCRemoteSwiftPackageReference; repositoryURL = "https://github.com/vespinola/mobile-courier-app-domain.git"; requirement = { @@ -1059,16 +804,24 @@ /* End XCRemoteSwiftPackageReference section */ /* Begin XCSwiftPackageProductDependency section */ - 1B64291B2C3E27310001AD58 /* JustACourierAppData */ = { + 1B6177D82C3E2E5000324A69 /* JustACourierAppPresentation */ = { isa = XCSwiftPackageProductDependency; - package = 1B64291A2C3E27310001AD58 /* XCRemoteSwiftPackageReference "mobile-courier-app-data" */; + productName = JustACourierAppPresentation; + }; + 1B6177DB2C3E2F2100324A69 /* JustACourierAppData */ = { + isa = XCSwiftPackageProductDependency; + package = 1B6177DA2C3E2F2100324A69 /* XCRemoteSwiftPackageReference "mobile-courier-app-data" */; productName = JustACourierAppData; }; - 1B6D70962C3E23F1003E2781 /* JustACourierAppDomain */ = { + 1B6177DE2C3E2F2B00324A69 /* JustACourierAppDomain */ = { isa = XCSwiftPackageProductDependency; - package = 1B6D70952C3E23F1003E2781 /* XCRemoteSwiftPackageReference "mobile-courier-app-domain" */; + package = 1B6177DD2C3E2F2A00324A69 /* XCRemoteSwiftPackageReference "mobile-courier-app-domain" */; productName = JustACourierAppDomain; }; + 1B6177E12C3E2F3B00324A69 /* JustACourierAppPresentation */ = { + isa = XCSwiftPackageProductDependency; + productName = JustACourierAppPresentation; + }; 1B6E61762C3642E600562112 /* JustACourierAppDomain */ = { isa = XCSwiftPackageProductDependency; productName = JustACourierAppDomain; @@ -1085,6 +838,10 @@ isa = XCSwiftPackageProductDependency; productName = JustACourierAppDomain; }; + 1BE1152E2C3E2A260018958E /* JustACourierAppDomain */ = { + isa = XCSwiftPackageProductDependency; + productName = JustACourierAppDomain; + }; /* End XCSwiftPackageProductDependency section */ }; rootObject = 1B58EF6B2BE6BBE90066F447 /* Project object */; diff --git a/mobile-courier-app.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/mobile-courier-app.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved index 87a84b2..44e90aa 100644 --- a/mobile-courier-app.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/mobile-courier-app.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -1,5 +1,5 @@ { - "originHash" : "9ed4fa45ac266d93bff72a791dc7731864c23b807ee4df7dd56eb5962a0cac96", + "originHash" : "0f502daa2445a10fd648289bde29bb746f017e259762f763b2851221883cb8b0", "pins" : [ { "identity" : "mobile-courier-app-data", diff --git a/mobile-courier-app/App/AppDIContainer.swift b/mobile-courier-app/App/AppDIContainer.swift index b14d543..d92116b 100644 --- a/mobile-courier-app/App/AppDIContainer.swift +++ b/mobile-courier-app/App/AppDIContainer.swift @@ -8,6 +8,7 @@ import Foundation import JustACourierAppDomain import JustACourierAppData +import JustACourierAppPresentation final class AppDIContainer: DIContainerProtocol { private var services: [String: Any] = [:] diff --git a/mobile-courier-app/App/DIContainerProtocol.swift b/mobile-courier-app/App/DIContainerProtocol.swift deleted file mode 100644 index e9e039b..0000000 --- a/mobile-courier-app/App/DIContainerProtocol.swift +++ /dev/null @@ -1,13 +0,0 @@ -// -// DIContainerProtocol.swift -// mobile-courier-app -// -// Created by Vladimir Espinola on 2024-06-21. -// - -import Foundation - -protocol DIContainerProtocol { - func register(_ service: T, for type: T.Type) - func resolve(_ type: T.Type) -> T -} diff --git a/mobile-courier-app/App/MobileCourierApp.swift b/mobile-courier-app/App/MobileCourierApp.swift index c6bc9cc..16dfce6 100644 --- a/mobile-courier-app/App/MobileCourierApp.swift +++ b/mobile-courier-app/App/MobileCourierApp.swift @@ -7,6 +7,7 @@ import SwiftUI import JustACourierAppDomain +import JustACourierAppPresentation @main struct MobileCourierApp: App { diff --git a/mobile-courier-app/Utilities/Storage.swift b/mobile-courier-app/App/UserDefaultsStorage.swift similarity index 73% rename from mobile-courier-app/Utilities/Storage.swift rename to mobile-courier-app/App/UserDefaultsStorage.swift index b647d48..1efd69c 100644 --- a/mobile-courier-app/Utilities/Storage.swift +++ b/mobile-courier-app/App/UserDefaultsStorage.swift @@ -6,15 +6,7 @@ // import Foundation - -protocol Storage { - func getBool(forKey key: String) -> Bool - func setBool(_ value: Bool, forKey key: String) - func getString(forKey key: String) -> String? - func setString(_ value: String, forKey key: String) - - func delete(forKey: String) -} +import JustACourierAppPresentation final class UserDefaultsStorage: Storage { func getString(forKey key: String) -> String? { diff --git a/mobile-courier-app/Assets.xcassets/logo.imageset/Contents.json b/mobile-courier-app/Assets.xcassets/logo.imageset/Contents.json deleted file mode 100644 index f2ec2d1..0000000 --- a/mobile-courier-app/Assets.xcassets/logo.imageset/Contents.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "images" : [ - { - "filename" : "Logotipo.png", - "idiom" : "universal" - } - ], - "info" : { - "author" : "xcode", - "version" : 1 - } -} diff --git a/mobile-courier-app/Assets.xcassets/logo.imageset/Logotipo.png b/mobile-courier-app/Assets.xcassets/logo.imageset/Logotipo.png deleted file mode 100644 index 61f4dbb..0000000 Binary files a/mobile-courier-app/Assets.xcassets/logo.imageset/Logotipo.png and /dev/null differ diff --git a/mobile-courier-app/Assets.xcassets/shortLogo.imageset/Contents.json b/mobile-courier-app/Assets.xcassets/shortLogo.imageset/Contents.json deleted file mode 100644 index 03d01a9..0000000 --- a/mobile-courier-app/Assets.xcassets/shortLogo.imageset/Contents.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "images" : [ - { - "filename" : "shortLogo.pdf", - "idiom" : "universal" - } - ], - "info" : { - "author" : "xcode", - "version" : 1 - } -} diff --git a/mobile-courier-app/Assets.xcassets/shortLogo.imageset/shortLogo.pdf b/mobile-courier-app/Assets.xcassets/shortLogo.imageset/shortLogo.pdf deleted file mode 100644 index 14fc17a..0000000 Binary files a/mobile-courier-app/Assets.xcassets/shortLogo.imageset/shortLogo.pdf and /dev/null differ diff --git a/mobile-courier-app/Assets.xcassets/surface.colorset/Contents.json b/mobile-courier-app/Assets.xcassets/surface.colorset/Contents.json deleted file mode 100644 index e5f8e60..0000000 --- a/mobile-courier-app/Assets.xcassets/surface.colorset/Contents.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "colors" : [ - { - "color" : { - "color-space" : "srgb", - "components" : { - "alpha" : "1.000", - "blue" : "0xF1", - "green" : "0xE1", - "red" : "0xE2" - } - }, - "idiom" : "universal" - }, - { - "appearances" : [ - { - "appearance" : "luminosity", - "value" : "dark" - } - ], - "color" : { - "color-space" : "srgb", - "components" : { - "alpha" : "1.000", - "blue" : "0x52", - "green" : "0x46", - "red" : "0x45" - } - }, - "idiom" : "universal" - } - ], - "info" : { - "author" : "xcode", - "version" : 1 - } -} diff --git a/mobile-courier-app/Presentation/CoordinatorRootView.swift b/mobile-courier-app/Presentation/CoordinatorRootView.swift deleted file mode 100644 index 543fd7f..0000000 --- a/mobile-courier-app/Presentation/CoordinatorRootView.swift +++ /dev/null @@ -1,27 +0,0 @@ -// -// ContentView.swift -// mobile-courier-app -// -// Created by Vladimir Espinola on 2024-05-04. -// - -import SwiftUI -import JustACourierAppDomain - -struct CoordinatorRootView: View { - @EnvironmentObject private var coordinator: Coordinator - @EnvironmentObject private var appData: AppData - - var body: some View { - NavigationStack(path: $coordinator.path) { - coordinator.build(page: .login) - .navigationDestination(for: Page.self) { page in - coordinator.build(page: page) - } - } - } -} - -#Preview { - CoordinatorRootView() -} diff --git a/mobile-courier-app/Presentation/Helpers/AccessibilityIdentifiers.swift b/mobile-courier-app/Presentation/Helpers/AccessibilityIdentifiers.swift deleted file mode 100644 index 8f96472..0000000 --- a/mobile-courier-app/Presentation/Helpers/AccessibilityIdentifiers.swift +++ /dev/null @@ -1,33 +0,0 @@ -// -// AccessibilityIdentifiers.swift -// mobile-courier-app -// -// Created by Vladimir Espinola on 2024-06-27. -// - -import Foundation - -enum AccessibilityIdentifiers { - enum Login { - static var emailTextField: String { "Login-Email" } - static var passwordTextField: String { "Login-Password" } - static var loginButton: String { "Login-Button" } - } - - enum Home { - static var homeTab: String { "Home-HomeTab" } - static var withdrawnTab: String { "Home-WithdrawnTab" } - static var profileTab: String { "Home-ProfileTab" } - static var settingsTab: String { "Home-SettingsTab" } - } - - enum HeaderView { - static var usernameLabel: String { "HeaderView-UsernameLabel" } - } - - enum GroupedPackageRowView { - static func get(identifier: String) -> String { - "GroupedPackageRowView-\(identifier)" - } - } -} diff --git a/mobile-courier-app/Presentation/Helpers/HeaderView.swift b/mobile-courier-app/Presentation/Helpers/HeaderView.swift deleted file mode 100644 index b15a909..0000000 --- a/mobile-courier-app/Presentation/Helpers/HeaderView.swift +++ /dev/null @@ -1,56 +0,0 @@ -// -// HeaderView.swift -// mobile-courier-app -// -// Created by Vladimir Espinola on 2024-06-13. -// - -import SwiftUI -import JustACourierAppDomain - -struct HeaderView: View { - @EnvironmentObject var appData: AppData - - var body: some View { - HStack { - HStack { - Image("shortLogo") - .resizable() - .renderingMode(.template) - .foregroundStyle(.white) - .aspectRatio(contentMode: .fit) - .padding(.init( - top: 16, - leading: 16, - bottom: 16, - trailing: .zero) - ) - .frame(height: 60) - .accessibilityHidden(true) - } - - if let username = appData.username?.capitalized { - HStack { - Text("Hi, \(username)!") - .font(.title3) - .fontWeight(.bold) - .foregroundStyle(.white) - .accessibilityIdentifier( - AccessibilityIdentifiers.HeaderView.usernameLabel - ) - } - } - - Spacer() - } - .frame(maxWidth: .infinity) - .background(.accent) - } -} - -#Preview { - let appData = AppData.mock - appData.username = "John Doe" - return HeaderView() - .environmentObject(appData) -} diff --git a/mobile-courier-app/Presentation/Helpers/Modifiers/BorderedViewModifier.swift b/mobile-courier-app/Presentation/Helpers/Modifiers/BorderedViewModifier.swift deleted file mode 100644 index 1695392..0000000 --- a/mobile-courier-app/Presentation/Helpers/Modifiers/BorderedViewModifier.swift +++ /dev/null @@ -1,27 +0,0 @@ -// -// BorderedViewModifier.swift -// mobile-courier-app -// -// Created by Vladimir Espinola on 2024-05-04. -// - -import SwiftUI - -struct BorderedViewModifier: ViewModifier { - func body(content: Content) -> some View { - content - .padding(EdgeInsets(top: 8, leading: 16, bottom: 8, trailing: 16)) - .background(Color.clear) - .overlay( - RoundedRectangle(cornerRadius: 8) - .stroke(lineWidth: 2) - .foregroundColor(Color.accentColor.opacity(0.6)) - ) - } -} - -extension View { - func bordered() -> some View { - ModifiedContent(content: self, modifier: BorderedViewModifier()) - } -} diff --git a/mobile-courier-app/Presentation/Helpers/Modifiers/GroupedPackageStyleModifier.swift b/mobile-courier-app/Presentation/Helpers/Modifiers/GroupedPackageStyleModifier.swift deleted file mode 100644 index 1de8b41..0000000 --- a/mobile-courier-app/Presentation/Helpers/Modifiers/GroupedPackageStyleModifier.swift +++ /dev/null @@ -1,24 +0,0 @@ -// -// GroupedPackageStyleModifier.swift -// mobile-courier-app -// -// Created by Vladimir Espinola on 2024-06-22. -// - -import SwiftUI - -struct GroupedPackageStyleModifier: ViewModifier { - func body(content: Content) -> some View { - content - .listRowBackground(EmptyView()) - .listRowSeparator(.hidden) - .listRowSpacing(.zero) - .listRowInsets(.none) - } -} - -extension View { - func groupedPackageRowStyle() -> some View { - self.modifier(GroupedPackageStyleModifier()) - } -} diff --git a/mobile-courier-app/Presentation/Helpers/Modifiers/RippleSpinnerModifier.swift b/mobile-courier-app/Presentation/Helpers/Modifiers/RippleSpinnerModifier.swift deleted file mode 100644 index 5f8bfd3..0000000 --- a/mobile-courier-app/Presentation/Helpers/Modifiers/RippleSpinnerModifier.swift +++ /dev/null @@ -1,32 +0,0 @@ -// -// RippleSpinnerModifier.swift -// mobile-courier-app -// -// Created by Vladimir Espinola on 2024-06-25. -// - -import SwiftUI - -struct RippleSpinnerModifier: ViewModifier { - @Binding var isLoading: Bool - - func body(content: Content) -> some View { - if isLoading { - ZStack { - content - - if isLoading { - RippleSpinnerView() - } - } - } else { - content - } - } -} - -extension View { - func showRippleSpinner(isLoading: Binding) -> some View { - self.modifier(RippleSpinnerModifier(isLoading: isLoading)) - } -} diff --git a/mobile-courier-app/Presentation/Helpers/Modifiers/RoundedIndicatorViewModifier.swift b/mobile-courier-app/Presentation/Helpers/Modifiers/RoundedIndicatorViewModifier.swift deleted file mode 100644 index 8a17678..0000000 --- a/mobile-courier-app/Presentation/Helpers/Modifiers/RoundedIndicatorViewModifier.swift +++ /dev/null @@ -1,26 +0,0 @@ -// -// RoundedIndicatorViewModifier.swift -// mobile-courier-app -// -// Created by Vladimir Espinola on 2024-06-19. -// - -import SwiftUI - -struct RoundedIndicatorViewModifier: ViewModifier { - func body(content: Content) -> some View { - content - .padding(4) - .foregroundStyle(.white) - .background( - RoundedRectangle(cornerRadius: 8) - .foregroundStyle(.accent) - ) - } -} - -extension View { - func roundedIndicator() -> some View { - ModifiedContent(content: self, modifier: RoundedIndicatorViewModifier()) - } -} diff --git a/mobile-courier-app/Presentation/Helpers/Modifiers/ToastModifier.swift b/mobile-courier-app/Presentation/Helpers/Modifiers/ToastModifier.swift deleted file mode 100644 index 9177d15..0000000 --- a/mobile-courier-app/Presentation/Helpers/Modifiers/ToastModifier.swift +++ /dev/null @@ -1,40 +0,0 @@ -// -// ToastModifier.swift -// mobile-courier-app -// -// Created by Vladimir Espinola on 2024-06-04. -// - -import SwiftUI - -struct ToastModifier: ViewModifier { - @Binding var message: String? - let duration: TimeInterval - - func body(content: Content) -> some View { - ZStack { - content - - if let message = message, !message.isEmpty { - VStack { - ToastView(message: message) - .onAppear { - DispatchQueue.main.asyncAfter(deadline: .now() + duration) { - withAnimation(.easeInOut) { - self.message = nil - } - } - } - Spacer() - } - .transition(.move(edge: .top)) - } - } - } -} - -extension View { - func toast(message: Binding, duration: TimeInterval = 2) -> some View { - self.modifier(ToastModifier(message: message, duration: duration)) - } -} diff --git a/mobile-courier-app/Presentation/Helpers/PackagePlaceholderView.swift b/mobile-courier-app/Presentation/Helpers/PackagePlaceholderView.swift deleted file mode 100644 index c9bec4b..0000000 --- a/mobile-courier-app/Presentation/Helpers/PackagePlaceholderView.swift +++ /dev/null @@ -1,35 +0,0 @@ -// -// PackagePlaceholderView.swift -// mobile-courier-app -// -// Created by Vladimir Espinola on 2024-06-15. -// - -import SwiftUI - -struct PackagePlaceholderView: View { - var body: some View { - VStack { - Image(systemName: "shippingbox.circle.fill") - .resizable() - .aspectRatio(1, contentMode: .fit) - .frame(height: 80) - .foregroundStyle(.accent) - .padding(.bottom, 8) - - VStack(alignment: .center) { - Text("You have no packages") - .padding(.bottom, 4) - .fontWeight(.bold) - .foregroundStyle(.accent) - Text("Your packages will be displayed here when they arrive at your mailbox") - } - .multilineTextAlignment(.center) - .padding(20) - } - } -} - -#Preview { - PackagePlaceholderView() -} diff --git a/mobile-courier-app/Presentation/Helpers/RippleSpinnerView.swift b/mobile-courier-app/Presentation/Helpers/RippleSpinnerView.swift deleted file mode 100644 index 8338aea..0000000 --- a/mobile-courier-app/Presentation/Helpers/RippleSpinnerView.swift +++ /dev/null @@ -1,60 +0,0 @@ -// -// RippleSpinnerView.swift -// mobile-courier-app -// -// Created by Vladimir Espinola on 2024-05-21. -// - -import SwiftUI - -struct RippleView: View { - @State private var scale: CGFloat = 0.5 - @State private var opacity: Double = 1.0 - - var body: some View { - Circle() - .stroke(lineWidth: 10) - .scaleEffect(scale) - .foregroundStyle(.accent) - .opacity(opacity) - .onAppear { - let baseAnimation = Animation.easeOut(duration: 1.5) - withAnimation(baseAnimation.repeatForever(autoreverses: false)) { - scale = 1.5 - opacity = .zero - } - } - } -} - -struct RippleSpinnerView: View { - var body: some View { - ZStack { - ZStack { - ForEach(0..<3) { i in - RippleView() - .animation( - Animation.easeOut(duration: 1.5) - .repeatForever(autoreverses: false) - .delay(Double(i) * 0.3) - ) - } - Image("launchIcon") - .resizable() - .frame(width: 80, height: 80) - .aspectRatio(1, contentMode: .fit) - .clipShape(Circle()) - } - .frame(width: 100, height: 100) - } - .ignoresSafeArea() - .frame(maxWidth: .infinity, maxHeight: .infinity) - .background( - Color.white.opacity(0.5) - ) - } -} - -#Preview { - RippleSpinnerView() -} diff --git a/mobile-courier-app/Presentation/Helpers/Styles/CourierTextFieldStyle.swift b/mobile-courier-app/Presentation/Helpers/Styles/CourierTextFieldStyle.swift deleted file mode 100644 index 3634b16..0000000 --- a/mobile-courier-app/Presentation/Helpers/Styles/CourierTextFieldStyle.swift +++ /dev/null @@ -1,16 +0,0 @@ -// -// CourierTextFieldStyle.swift -// mobile-courier-app -// -// Created by Vladimir Espinola on 2024-05-04. -// - -import SwiftUI - -struct CourierTextFieldStyle: TextFieldStyle { - func _body(configuration: TextField) -> some View { - configuration - .frame(minHeight: 35) - .bordered() - } -} diff --git a/mobile-courier-app/Presentation/Helpers/ToastView.swift b/mobile-courier-app/Presentation/Helpers/ToastView.swift deleted file mode 100644 index 98150d7..0000000 --- a/mobile-courier-app/Presentation/Helpers/ToastView.swift +++ /dev/null @@ -1,35 +0,0 @@ -// -// ToastView.swift -// mobile-courier-app -// -// Created by Vladimir Espinola on 2024-06-04. -// - -import SwiftUI - -struct ToastView: View { - let message: String - - var body: some View { - Text(message) - .frame(maxWidth: .infinity) - .font(.body) - .foregroundStyle(.white) - .padding( - .init( - top: 16, - leading: 20, - bottom: 16, - trailing: 20 - ) - ) - .background(Color.accent) - .clipShape(RoundedRectangle(cornerRadius: 8)) - .padding(.horizontal, 16) - - } -} - -#Preview { - ToastView(message: "Hi toast") -} diff --git a/mobile-courier-app/Presentation/Home/HomeView.swift b/mobile-courier-app/Presentation/Home/HomeView.swift deleted file mode 100644 index 439af8b..0000000 --- a/mobile-courier-app/Presentation/Home/HomeView.swift +++ /dev/null @@ -1,92 +0,0 @@ -// -// HomeView.swift -// mobile-courier-app -// -// Created by Vladimir Espinola on 2024-05-27. -// - -import SwiftUI -import JustACourierAppDomain - -struct HomeView: View { - @EnvironmentObject var coordinator: Coordinator - @ObservedObject var viewModel: HomeViewModel - - @State var selectedTab = 0 - - var body: some View { - VStack(spacing: .zero) { - HeaderView() - - getTabView() - .navigationTitle("") - .toolbar(.hidden) - .sheet(item: $coordinator.sheet) { sheet in - coordinator.build(sheet: sheet) - } - .toast(message: $viewModel.toastMessage) - .onAppear { - Task { - await viewModel.getAddresses() - } - } - } - } - - @ViewBuilder - private func getTabView() -> some View { - TabView(selection: $selectedTab) { - coordinator.build(page: .packagesForWithdrawl) - .tabItem { - Label("Home", systemImage: "house") - .accessibilityIdentifier( - AccessibilityIdentifiers.Home.homeTab - ) - } - .tag(0) - - coordinator.build(page: .withdrawnPackages) - .tabItem { - Label("Withdrawn", systemImage: "bag") - .accessibilityIdentifier( - AccessibilityIdentifiers.Home.withdrawnTab - ) - } - .tag(1) - - getProfileChildView(addresses: viewModel.addresses) - .tabItem { - Label("Profile", systemImage: "person") - .accessibilityIdentifier( - AccessibilityIdentifiers.Home.profileTab - ) - } - .tag(2) - - coordinator.build(page: .configurations) - .tabItem { - Label("Settings", systemImage: "gear") - .accessibilityIdentifier( - AccessibilityIdentifiers.Home.settingsTab - ) - } - .tag(3) - } - } - - @ViewBuilder - private func getProfileChildView(addresses: AddressesEntity?) -> some View { - if let addresses = addresses { - coordinator.build(page: .profile) - .environmentObject(addresses) - } else { - Text("Loading...") - } - } -} - -#Preview { - HomeView(viewModel: .previewInstance()) - .environmentObject(Coordinator(diContainer: AppDIContainerMock())) - .environmentObject(AppData.mock) -} diff --git a/mobile-courier-app/Presentation/Home/HomeViewModel.swift b/mobile-courier-app/Presentation/Home/HomeViewModel.swift deleted file mode 100644 index ec9fd28..0000000 --- a/mobile-courier-app/Presentation/Home/HomeViewModel.swift +++ /dev/null @@ -1,30 +0,0 @@ -// -// HomeViewModel.swift -// mobile-courier-app -// -// Created by Vladimir Espinola on 2024-06-22. -// - -import Foundation -import JustACourierAppDomain - -final class HomeViewModel: ObservableObject { - @Published var toastMessage: String? - @Published var addresses: AddressesEntity? - - private let addressesRepository: AddressRepositoryProtocol - - init(addressesRepository: AddressRepositoryProtocol) { - self.addressesRepository = addressesRepository - } - - @MainActor - func getAddresses() async { - guard addresses == nil else { return } - do { - addresses = try await addressesRepository.getAddress() - } catch { - toastMessage = error.localizedDescription - } - } -} diff --git a/mobile-courier-app/Presentation/Login/LoginView.swift b/mobile-courier-app/Presentation/Login/LoginView.swift deleted file mode 100644 index f674db0..0000000 --- a/mobile-courier-app/Presentation/Login/LoginView.swift +++ /dev/null @@ -1,96 +0,0 @@ -// -// LoginView.swift -// mobile-courier-app -// -// Created by Vladimir Espinola on 2024-05-04. -// - -import SwiftUI - -struct LoginView: View { - public enum Field: Hashable { - case email - case password - } - - @ObservedObject var viewModel: LoginViewModel - @FocusState private var focusField: Field? - @EnvironmentObject var coordinator: Coordinator - - public var body: some View { - VStack(spacing: 16) { - Spacer() - Image("logo") - .resizable() - .renderingMode(.template) - .foregroundStyle(.accent) - .aspectRatio(contentMode: .fit) - .padding(.bottom, 16) - .accessibilityHidden(true) - - TextField("Email", text: $viewModel.email) - .focused($focusField, equals: .email) - .textFieldStyle(CourierTextFieldStyle()) - .keyboardType(.emailAddress) - .autocorrectionDisabled() - .autocapitalization(.none) - .submitLabel(.next) - .onSubmit { - focusField = .password - } - .accessibilityIdentifier( - AccessibilityIdentifiers.Login.emailTextField - ) - .accessibilityLabel("Email") - - SecureField("Password", text: $viewModel.password) - .focused($focusField, equals: .password) - .textFieldStyle(CourierTextFieldStyle()) - .submitLabel(.done) - .textContentType(.password) - .onSubmit { - navigateToLogin() - } - .accessibilityIdentifier( - AccessibilityIdentifiers.Login.passwordTextField - ) - .accessibilityLabel("Password") - - Button("Log In") { - navigateToLogin() - } - .frame(maxWidth: .infinity, minHeight: 44) - .background( - viewModel.buttonIsEnabled - ? .accent - : .accent.opacity(0.6) - ) - .foregroundStyle(.white) - .cornerRadius(16) - .disabled(!viewModel.buttonIsEnabled) - .accessibilityIdentifier( - AccessibilityIdentifiers.Login.loginButton - ) - - Spacer() - } - .padding(20) - .showRippleSpinner(isLoading: $viewModel.isLoading) - .toast(message: $viewModel.toastMessage) - } - - private func navigateToLogin() { - focusField = nil - - Task { - guard await viewModel.doLogin() else { return } - coordinator.push(.home) - } - } -} - -#Preview { - LoginView( - viewModel: .previewInstance() - ) -} diff --git a/mobile-courier-app/Presentation/Login/LoginViewModel.swift b/mobile-courier-app/Presentation/Login/LoginViewModel.swift deleted file mode 100644 index dbc1b11..0000000 --- a/mobile-courier-app/Presentation/Login/LoginViewModel.swift +++ /dev/null @@ -1,46 +0,0 @@ -// -// LoginViewModel.swift -// mobile-courier-app -// -// Created by Vladimir Espinola on 2024-05-04. -// - -import Foundation -import JustACourierAppDomain - -final class LoginViewModel: ObservableObject { - @Published var password: String = "" - @Published var email: String = "" - @Published var isLoading = false - @Published var toastMessage: String? - - var buttonIsEnabled: Bool { - !password.isEmpty && !email.isEmpty - } - - private let authRepository: AuthRepositoryProtocol - private let storage: Storage - - init(authRepository: AuthRepositoryProtocol, storage: Storage) { - self.authRepository = authRepository - self.storage = storage - - guard let savedEmail = storage.getString(forKey: "userEmail"), !savedEmail.isEmpty else { return } - self.email = savedEmail - } - - @MainActor - func doLogin() async -> Bool { - do { - isLoading = true - try await authRepository.performLogin(email: email, password: password) - storage.setString(email, forKey: "userEmail") - isLoading = false - return true - } catch { - isLoading = false - toastMessage = error.localizedDescription - return false - } - } -} diff --git a/mobile-courier-app/Presentation/Navigation/Coordinator.swift b/mobile-courier-app/Presentation/Navigation/Coordinator.swift deleted file mode 100644 index ff4fc85..0000000 --- a/mobile-courier-app/Presentation/Navigation/Coordinator.swift +++ /dev/null @@ -1,101 +0,0 @@ -// -// Coordinator.swift -// mobile-courier-app -// -// Created by Vladimir Espinola on 2024-06-03. -// - -import SwiftUI -import JustACourierAppDomain - -enum Page: String, Identifiable { - case login - case home - case profile - case withdrawnPackages - case packagesForWithdrawl - case configurations - - var id: String { - self.rawValue - } -} - -enum Sheet: Identifiable { - case shipmentDetail(groupedPackage: GroupedPackageEntity) - - var id: String { - switch self { - case .shipmentDetail: - return "shipmentDetail" - } - } -} - -final class Coordinator: ObservableObject { - @Published var path = NavigationPath() - @Published var sheet: Sheet? - - private var diContainer: DIContainerProtocol - - init(diContainer: DIContainerProtocol) { - self.diContainer = diContainer - } - - func push(_ page: Page) { - path.append(page) - } - - func present(sheet: Sheet) { - self.sheet = sheet - } - - func pop() { - path.removeLast() - } - - func popToRoot() { - path.removeLast(path.count) - } - - func dismissSheet() { - self.sheet = nil - } - - // MARK: Views - - @ViewBuilder - func build(page: Page) -> some View { - switch page { - case .login: - LoginView( - viewModel: diContainer.resolve(LoginViewModel.self) - ) - case .profile: - ProfileView() - case .home: - HomeView( - viewModel: diContainer.resolve(HomeViewModel.self) - ) - case .withdrawnPackages: - WithdrawnPackagesView( - viewModel: diContainer.resolve(WithdrawnPackagesViewModel.self) - ) - case .packagesForWithdrawl: - PackagesForWithdrawalView( - viewModel: diContainer.resolve(PackagesForWithdrawalViewModel.self) - ) - case .configurations: - SettingsView(viewModel: diContainer.resolve(SettingsViewModel.self)) - } - } - - @ViewBuilder - func build(sheet: Sheet) -> some View { - switch sheet { - case .shipmentDetail(let groupedPackage): - ShipmentDetailView(groupedPackage: groupedPackage) - .presentationDetents([.fraction(0.5), .fraction(0.8)]) - } - } -} diff --git a/mobile-courier-app/Presentation/PackagesForWithdrawal/GroupedPackageReadyView.swift b/mobile-courier-app/Presentation/PackagesForWithdrawal/GroupedPackageReadyView.swift deleted file mode 100644 index 291c8b0..0000000 --- a/mobile-courier-app/Presentation/PackagesForWithdrawal/GroupedPackageReadyView.swift +++ /dev/null @@ -1,65 +0,0 @@ -// -// GroupedPackageReadyView.swift -// mobile-courier-app -// -// Created by Vladimir Espinola on 2024-06-19. -// - -import SwiftUI -import JustACourierAppDomain - -struct GroupedPackageReadyView: View { - - var groupedPackage: GroupedPackageEntity - - var body: some View { - VStack(spacing: 8) { - HStack(alignment: .center) { - Text("At the branch") - .roundedIndicator() - - Spacer() - - VStack(alignment: .trailing) { - Text("\(groupedPackage.totalWeight) Kg") - } - } - - HStack { - Text("\(groupedPackage.packages.count) packages") - - Spacer() - - Text("Gs \(groupedPackage.formattedTotalCost)") - .foregroundStyle(.accent) - .font(.title2) - .fontWeight(.bold) - } - - } - .frame(maxWidth: .infinity) - .padding(.init( - top: 8, - leading: 16, - bottom: 8, - trailing: 16) - ) - .foregroundStyle(.black) - .background( - RoundedRectangle(cornerRadius: 6) - .fill(Color.surface) - ) - .clipped() - } -} - -#Preview { - GroupedPackageReadyView( - groupedPackage: .init( - shipmentCode: 2000, - packages: [ - .mock - ] - ) - ) -} diff --git a/mobile-courier-app/Presentation/PackagesForWithdrawal/PackagesForWithdrawalView.swift b/mobile-courier-app/Presentation/PackagesForWithdrawal/PackagesForWithdrawalView.swift deleted file mode 100644 index e06a407..0000000 --- a/mobile-courier-app/Presentation/PackagesForWithdrawal/PackagesForWithdrawalView.swift +++ /dev/null @@ -1,93 +0,0 @@ -// -// PackagesForWithdrawalView.swift -// mobile-courier-app -// -// Created by Vladimir Espinola on 2024-06-18. -// - -import SwiftUI -import JustACourierAppDomain - -struct PackagesForWithdrawalView: View { - @ObservedObject var viewModel: PackagesForWithdrawalViewModel - @EnvironmentObject var coordinator: Coordinator - - var body: some View { - ZStack { - if let groupedPackagesEntity = viewModel.groupedPackagesEntity { - content(for: groupedPackagesEntity) - } - } - .onAppear { - getPackages() - } - .refreshable { - getPackages(forceUpdate: true) - } - .showRippleSpinner(isLoading: $viewModel.isLoading) - .toast(message: $viewModel.toastMessage) - } - - private func getPackages(forceUpdate: Bool = false) { - Task { - await viewModel.getPackages(forceUpdate: forceUpdate) - } - } - - @ViewBuilder - private func content(for groupedPackages: [GroupedPackageEntity]) -> some View { - if groupedPackages.isEmpty { - PackagePlaceholderView() - } else { - packageList(groupedPackages) - } - } - - @ViewBuilder - private func packageList(_ groupedPackages: [GroupedPackageEntity]) -> some View { - List { - ForEach(ShipmentStatus.allCases) { status in - if !groupedPackages.filterGroupedPackages(by: status).isEmpty { - getSection(for: status, groupedPackages: groupedPackages) - } - } - } - .listStyle(.plain) - } - - @ViewBuilder - private func getSection(for status: ShipmentStatus, groupedPackages: [GroupedPackageEntity]) -> some View { - Section(header: Text(status.localized)) { - ForEach(groupedPackages.filter { $0.packageCurrentStatus == status }) { currentGroupedPackage in - getGroupedPackageView(for: currentGroupedPackage) - .groupedPackageRowStyle() - .onTapGesture { - coordinator.present( - sheet: .shipmentDetail(groupedPackage: currentGroupedPackage) - ) - } - .accessibilityElement(children: .ignore) - .accessibilityLabel(currentGroupedPackage.accessibilityLabel) - .accessibilityIdentifier( - AccessibilityIdentifiers - .GroupedPackageRowView - .get(identifier: "\(currentGroupedPackage.id)") - ) - } - } - } - - @ViewBuilder - private func getGroupedPackageView(for groupedPackage: GroupedPackageEntity) -> some View { - if groupedPackage.packageCurrentStatus == .readyForPickup { - GroupedPackageReadyView(groupedPackage: groupedPackage) - } else { - GroupedPackageRowView(groupedPackage: groupedPackage) - } - } -} - -#Preview { - PackagesForWithdrawalView(viewModel: .previewInstance()) - .environmentObject(Coordinator(diContainer: AppDIContainerMock())) -} diff --git a/mobile-courier-app/Presentation/PackagesForWithdrawal/PackagesForWithdrawalViewModel.swift b/mobile-courier-app/Presentation/PackagesForWithdrawal/PackagesForWithdrawalViewModel.swift deleted file mode 100644 index 57857f9..0000000 --- a/mobile-courier-app/Presentation/PackagesForWithdrawal/PackagesForWithdrawalViewModel.swift +++ /dev/null @@ -1,35 +0,0 @@ -// -// PackagesForWithdrawalViewModel.swift -// mobile-courier-app -// -// Created by Vladimir Espinola on 2024-06-18. -// - -import Foundation -import JustACourierAppDomain - -final class PackagesForWithdrawalViewModel: ObservableObject { - @Published var isLoading: Bool = false - @Published var toastMessage: String? - @Published var groupedPackagesEntity: [GroupedPackageEntity]? - - private let packagesRepository: PackagesRepositoryProtocol - - init(packagesRepository: PackagesRepositoryProtocol) { - self.packagesRepository = packagesRepository - } - - @MainActor - func getPackages(forceUpdate: Bool = false) async { - guard groupedPackagesEntity == nil || forceUpdate else { return } - - defer { isLoading = false } - - do { - isLoading = true - groupedPackagesEntity = try await packagesRepository.getPackagesForWithdrawl() - } catch { - toastMessage = error.localizedDescription - } - } -} diff --git a/mobile-courier-app/Presentation/Previews/AddressEntityMock.swift b/mobile-courier-app/Presentation/Previews/AddressEntityMock.swift deleted file mode 100644 index b3d186f..0000000 --- a/mobile-courier-app/Presentation/Previews/AddressEntityMock.swift +++ /dev/null @@ -1,85 +0,0 @@ -// -// AddressEntityMock.swift -// mobile-courier-app -// -// Created by Vladimir Espinola on 2024-06-22. -// - -import Foundation -import JustACourierAppDomain - -extension AddressesEntity { - static var mock: AddressesEntity { - let client = ClientEntity( - id: 12345, - authorizeEmail: 1, - authorizedCi: "1234567-3", - city: 1, - clientCellPhone: "0981123123", - clientCi: "12345678", - clientPhone: "0982123321", - taxId: "1112223-4", - rate: 22.5, - userName: "test@gmail.com" - ) - - let seaShipments = ShipmentsEntity( - city: "Asuncion", - client: client, - address: "Direccion", - company: "empresa", - country: "Paraguay", - phone: "0982333111" - ) - - let airShipments = seaShipments - - return .init(airShipments: airShipments, seaShipments: seaShipments) - } -} - -extension PackageEntity { - static var mock: PackageEntity { - .init( - status: "c", - shipmentStatus: "c", - packagePickupDate: "2024-05-10T04:00:00Z", - shipmentMethod: "Air shipment", - clientPriceRate: 22, - packageDescription: "It's a package", - packageTrackingNumber: "Tracking", - quotation: 7450, - shipmentDate: "2024-05-10T04:00:00Z", - packageWeight: 1.2, - shipmentCode: 2143, - id: 1, - packagePrice: 5000 - ) - } - - static var atBranchMock: PackageEntity { - .init( - status: "B", - shipmentStatus: "ASUNCION", - packagePickupDate: "2024-05-10T04:00:00Z", - shipmentMethod: "Air shipment", - clientPriceRate: 22, - packageDescription: "It's a package", - packageTrackingNumber: "Tracking", - quotation: 7450, - shipmentDate: "2024-05-10T04:00:00Z", - packageWeight: 1.2, - shipmentCode: 2142, - id: 1, - packagePrice: 5000 - ) - } -} - -extension GroupedPackageEntity { - static var mock: GroupedPackageEntity { - .init(shipmentCode: 2223, packages: [ - .mock, - ]) - } -} diff --git a/mobile-courier-app/Presentation/Previews/AddressesRepositoryMock.swift b/mobile-courier-app/Presentation/Previews/AddressesRepositoryMock.swift deleted file mode 100644 index f797a97..0000000 --- a/mobile-courier-app/Presentation/Previews/AddressesRepositoryMock.swift +++ /dev/null @@ -1,15 +0,0 @@ -// -// AddressesRepositoryMock.swift -// mobile-courier-app -// -// Created by Vladimir Espinola on 2024-06-07. -// - -import Foundation -import JustACourierAppDomain - -struct AddressesRepositoryMock: AddressRepositoryProtocol { - func getAddress() async throws -> AddressesEntity { - .mock - } -} diff --git a/mobile-courier-app/Presentation/Previews/AppDIContainerMock.swift b/mobile-courier-app/Presentation/Previews/AppDIContainerMock.swift deleted file mode 100644 index a8ded20..0000000 --- a/mobile-courier-app/Presentation/Previews/AppDIContainerMock.swift +++ /dev/null @@ -1,49 +0,0 @@ -// -// AppDIContainerMock.swift -// mobile-courier-app -// -// Created by Vladimir Espinola on 2024-06-23. -// - -import Foundation - -final class AppDIContainerMock: DIContainerProtocol { - private var services: [String: Any] = [:] - - init() { - // ViewModels - register( - LoginViewModel.previewInstance(), - for: LoginViewModel.self - ) - register( - HomeViewModel.previewInstance(), - for: HomeViewModel.self - ) - register( - WithdrawnPackagesViewModel.previewInstance(), - for: WithdrawnPackagesViewModel.self - ) - register( - PackagesForWithdrawalViewModel.previewInstance(), - for: PackagesForWithdrawalViewModel.self - ) - register( - SettingsViewModel.previewInstance(), - for: SettingsViewModel.self - ) - } - - func register(_ service: T, for type: T.Type) { - let key = String(describing: type) - services[key] = service - } - - func resolve(_ type: T.Type) -> T { - let key = String(describing: type) - guard let service = services[key] as? T else { - fatalError("Service for \(type) not found") - } - return service - } -} diff --git a/mobile-courier-app/Presentation/Previews/AppDataMock.swift b/mobile-courier-app/Presentation/Previews/AppDataMock.swift deleted file mode 100644 index 4284f33..0000000 --- a/mobile-courier-app/Presentation/Previews/AppDataMock.swift +++ /dev/null @@ -1,17 +0,0 @@ -// -// AppDataMock.swift -// mobile-courier-app -// -// Created by Vladimir Espinola on 2024-06-23. -// - -import Foundation -import JustACourierAppDomain - -extension AppData { - static var mock: AppData { - let data = AppData() - data.username = "John Doe" - return data - } -} diff --git a/mobile-courier-app/Presentation/Previews/AuthRepositoryMock.swift b/mobile-courier-app/Presentation/Previews/AuthRepositoryMock.swift deleted file mode 100644 index 0cbd53c..0000000 --- a/mobile-courier-app/Presentation/Previews/AuthRepositoryMock.swift +++ /dev/null @@ -1,13 +0,0 @@ -// -// AuthRepositoryMock.swift -// mobile-courier-app -// -// Created by Vladimir Espinola on 2024-05-27. -// - -import Foundation -import JustACourierAppDomain - -final class AuthRepositoryMock: AuthRepositoryProtocol { - func performLogin(email: String, password: String) async throws { } -} diff --git a/mobile-courier-app/Presentation/Previews/HomeViewModelMock.swift b/mobile-courier-app/Presentation/Previews/HomeViewModelMock.swift deleted file mode 100644 index 431f25c..0000000 --- a/mobile-courier-app/Presentation/Previews/HomeViewModelMock.swift +++ /dev/null @@ -1,14 +0,0 @@ -// -// ProfileViewModelMock.swift -// mobile-courier-app -// -// Created by Vladimir Espinola on 2024-06-07. -// - -import Foundation - -extension HomeViewModel { - static func previewInstance() -> HomeViewModel { - .init(addressesRepository: AddressesRepositoryMock()) - } -} diff --git a/mobile-courier-app/Presentation/Previews/LoginViewModelMock.swift b/mobile-courier-app/Presentation/Previews/LoginViewModelMock.swift deleted file mode 100644 index ad8533d..0000000 --- a/mobile-courier-app/Presentation/Previews/LoginViewModelMock.swift +++ /dev/null @@ -1,14 +0,0 @@ -// -// LoginViewModelMock.swift -// mobile-courier-app -// -// Created by Vladimir Espinola on 2024-05-27. -// - -import Foundation - -extension LoginViewModel { - static func previewInstance() -> LoginViewModel { - .init(authRepository: AuthRepositoryMock(), storage: StorageMock()) - } -} diff --git a/mobile-courier-app/Presentation/Previews/PackagesForWithdrawalViewModelMock.swift b/mobile-courier-app/Presentation/Previews/PackagesForWithdrawalViewModelMock.swift deleted file mode 100644 index 9283a6c..0000000 --- a/mobile-courier-app/Presentation/Previews/PackagesForWithdrawalViewModelMock.swift +++ /dev/null @@ -1,14 +0,0 @@ -// -// PackagesForWithdrawalViewModelMock.swift -// mobile-courier-app -// -// Created by Vladimir Espinola on 2024-06-18. -// - -import Foundation - -extension PackagesForWithdrawalViewModel { - static func previewInstance() -> PackagesForWithdrawalViewModel { - .init(packagesRepository: PackagesRepositoryMock()) - } -} diff --git a/mobile-courier-app/Presentation/Previews/PackagesRepositoryMock.swift b/mobile-courier-app/Presentation/Previews/PackagesRepositoryMock.swift deleted file mode 100644 index 0542577..0000000 --- a/mobile-courier-app/Presentation/Previews/PackagesRepositoryMock.swift +++ /dev/null @@ -1,28 +0,0 @@ -// -// PackagesRepositoryMock.swift -// mobile-courier-app -// -// Created by Vladimir Espinola on 2024-06-16. -// - -import Foundation -import JustACourierAppDomain - -struct PackagesRepositoryMock: PackagesRepositoryProtocol { - func getPackagesForWithdrawl() async throws -> [GroupedPackageEntity] { - [ - .init(shipmentCode: 2223, packages: [ - .mock, - ]), - .init(shipmentCode: 2221, packages: [ - .atBranchMock - ]), - ] - } - - func getWithdrawnPackages() async throws -> [GroupedPackageEntity] { - [ - .init(shipmentCode: 2143, packages: [ .mock ]) - ] - } -} diff --git a/mobile-courier-app/Presentation/Previews/SettingsViewModelMock.swift b/mobile-courier-app/Presentation/Previews/SettingsViewModelMock.swift deleted file mode 100644 index 2b941e3..0000000 --- a/mobile-courier-app/Presentation/Previews/SettingsViewModelMock.swift +++ /dev/null @@ -1,14 +0,0 @@ -// -// SettingsViewModelMock.swift -// mobile-courier-app -// -// Created by Vladimir Espinola on 2024-06-24. -// - -import Foundation - -extension SettingsViewModel { - static func previewInstance() -> SettingsViewModel { - .init(authRepository: AuthRepositoryMock()) - } -} diff --git a/mobile-courier-app/Presentation/Previews/StorageMock.swift b/mobile-courier-app/Presentation/Previews/StorageMock.swift deleted file mode 100644 index c1648b3..0000000 --- a/mobile-courier-app/Presentation/Previews/StorageMock.swift +++ /dev/null @@ -1,20 +0,0 @@ -// -// StorageMock.swift -// mobile-courier-app -// -// Created by Vladimir Espinola on 2024-05-27. -// - -import Foundation - -final class StorageMock: Storage { - func getBool(forKey key: String) -> Bool { false } - - func setBool(_ value: Bool, forKey key: String) { } - - func getString(forKey key: String) -> String? { "" } - - func setString(_ value: String, forKey key: String) { } - - func delete(forKey: String) { } -} diff --git a/mobile-courier-app/Presentation/Previews/WithdrawnPackagesViewModelMock.swift b/mobile-courier-app/Presentation/Previews/WithdrawnPackagesViewModelMock.swift deleted file mode 100644 index 6281c58..0000000 --- a/mobile-courier-app/Presentation/Previews/WithdrawnPackagesViewModelMock.swift +++ /dev/null @@ -1,14 +0,0 @@ -// -// PackagesViewModelMock.swift -// mobile-courier-app -// -// Created by Vladimir Espinola on 2024-06-16. -// - -import Foundation - -extension WithdrawnPackagesViewModel { - static func previewInstance() -> WithdrawnPackagesViewModel { - .init(packagesRepository: PackagesRepositoryMock()) - } -} diff --git a/mobile-courier-app/Presentation/Profile/ProfileView.swift b/mobile-courier-app/Presentation/Profile/ProfileView.swift deleted file mode 100644 index a862a57..0000000 --- a/mobile-courier-app/Presentation/Profile/ProfileView.swift +++ /dev/null @@ -1,62 +0,0 @@ -// -// ProfileView.swift -// mobile-courier-app -// -// Created by Vladimir Espinola on 2024-06-04. -// - -import SwiftUI -import JustACourierAppDomain - -struct ProfileView: View { - @EnvironmentObject var addresses: AddressesEntity - - var body: some View { - content(addressEntity: addresses) - } - - @ViewBuilder - private func content(addressEntity: AddressesEntity) -> some View { - List { - Section { - RowView( - title: String(localized: "Document Number"), - subtitle: addressEntity.documentNumber - ) - RowView( - title: String(localized: "Phone Number"), - subtitle: addressEntity.phoneNumber - ) - RowView( - title: String(localized: "Email"), - subtitle: addressEntity.email - ) - } - - Section { - ShipmentRowView( - shipment: addressEntity.airShipments, - title: String(localized: "Air Shipments") - ) - ShipmentRowView( - shipment: addressEntity.seaShipments, - title: String(localized: "Sea Shipments") - ) - } - } - } -} - -#Preview { - VStack { - HeaderView() - .environmentObject(AppData.mock) - ProfileView() - .environmentObject(AddressesEntity.mock) - } -} - -#Preview { - ProfileView() - .environmentObject(AddressesEntity.mock) -} diff --git a/mobile-courier-app/Presentation/Profile/RowView.swift b/mobile-courier-app/Presentation/Profile/RowView.swift deleted file mode 100644 index a3d0ce6..0000000 --- a/mobile-courier-app/Presentation/Profile/RowView.swift +++ /dev/null @@ -1,35 +0,0 @@ -// -// RowView.swift -// mobile-courier-app -// -// Created by Vladimir Espinola on 2024-06-10. -// - -import SwiftUI - -struct RowView: View { - var title: String - var subtitle: String - - var body: some View { - VStack(alignment: .leading) { - Text(title) - .fontWeight(.bold) - .foregroundStyle(.accent) - .padding(.bottom, 2) - Text(subtitle) - .font(.caption) - .frame(maxWidth: .infinity, alignment: .leading) - } - .padding(.init( - top: 8, - leading: 20, - bottom: .zero, - trailing: 20) - ) - } -} - -#Preview { - RowView(title: "Document Number", subtitle: "1234567") -} diff --git a/mobile-courier-app/Presentation/Profile/ShipmentRowView.swift b/mobile-courier-app/Presentation/Profile/ShipmentRowView.swift deleted file mode 100644 index a767f91..0000000 --- a/mobile-courier-app/Presentation/Profile/ShipmentRowView.swift +++ /dev/null @@ -1,51 +0,0 @@ -// -// EnviosView.swift -// mobile-courier-app -// -// Created by Vladimir Espinola on 2024-06-08. -// - -import SwiftUI -import JustACourierAppDomain - -struct ShipmentRowView: View { - var shipment: ShipmentsEntity - var title: String - - var body: some View { - VStack(alignment: .leading) { - Text(title) - .fontWeight(.bold) - .foregroundStyle(.accent) - .padding(.bottom, 4) - Group { - Text(shipment.address) - Text(shipment.city) - Text(shipment.phone) - Text(shipment.country) - } - .font(.caption) - .frame(maxWidth: .infinity, alignment: .leading) - } - .padding(.init( - top: .zero, - leading: 20, - bottom: .zero, - trailing: 20) - ) - } -} - -#Preview { - ShipmentRowView( - shipment: - .init( - city: "Boston", - address: "164 NW STE 32", - company: "", - country: "Argentina", - phone: "(301) 123-1234" - ), - title: "Envíos Marítimos" - ) -} diff --git a/mobile-courier-app/Presentation/Settings/SettingsView.swift b/mobile-courier-app/Presentation/Settings/SettingsView.swift deleted file mode 100644 index 035d6f4..0000000 --- a/mobile-courier-app/Presentation/Settings/SettingsView.swift +++ /dev/null @@ -1,36 +0,0 @@ -// -// SettingsView.swift -// mobile-courier-app -// -// Created by Vladimir Espinola on 2024-06-23. -// - -import SwiftUI - -struct SettingsView: View { - @AppStorage("isDarkMode") var darkModeOn: Bool = false - @EnvironmentObject var coordinator: Coordinator - @ObservedObject var viewModel: SettingsViewModel - - var body: some View { - VStack { - List { - Section { - Toggle("Dark Mode", isOn: $darkModeOn) - } - - Section { - Button("Log out", role: .destructive) { - viewModel.doLogout() - coordinator.popToRoot() - } - } - } - } - } -} - -#Preview { - SettingsView(viewModel: .previewInstance()) - .environmentObject(Coordinator(diContainer: AppDIContainerMock())) -} diff --git a/mobile-courier-app/Presentation/Settings/SettingsViewModel.swift b/mobile-courier-app/Presentation/Settings/SettingsViewModel.swift deleted file mode 100644 index 000b795..0000000 --- a/mobile-courier-app/Presentation/Settings/SettingsViewModel.swift +++ /dev/null @@ -1,21 +0,0 @@ -// -// SettingsViewModel.swift -// mobile-courier-app -// -// Created by Vladimir Espinola on 2024-06-24. -// - -import Foundation -import JustACourierAppDomain - -final class SettingsViewModel: ObservableObject { - private let authRepository: AuthRepositoryProtocol - - init(authRepository: AuthRepositoryProtocol) { - self.authRepository = authRepository - } - - func doLogout() { - authRepository.performLogout() - } -} diff --git a/mobile-courier-app/Presentation/ShipmentDetail/ShipmentDetailView.swift b/mobile-courier-app/Presentation/ShipmentDetail/ShipmentDetailView.swift deleted file mode 100644 index ee8d2b7..0000000 --- a/mobile-courier-app/Presentation/ShipmentDetail/ShipmentDetailView.swift +++ /dev/null @@ -1,107 +0,0 @@ -// -// ShipmentDetailView.swift -// mobile-courier-app -// -// Created by Vladimir Espinola on 2024-06-19. -// - -import SwiftUI -import JustACourierAppDomain - -struct ShipmentDetailView: View { - - var groupedPackage: GroupedPackageEntity - - var body: some View { - VStack { - getHeader() - - Text("Packages") - .frame(maxWidth: .infinity, alignment: .leading) - - Divider() - .background(.accent) - - getPackageList() - - Divider() - .background(.accent) - - getFooter() - - Spacer() - } - .padding() - .background(.surface) - } - - @ViewBuilder - private func getHeader() -> some View { - HStack(alignment: .top) { - Text("Shipment #\(groupedPackage.formattedId)") - .foregroundStyle(.accent) - .fontWeight(.bold) - Spacer() - VStack(alignment: .trailing) { - Image(systemName: "shippingbox.circle") - .resizable() - .renderingMode(.template) - .aspectRatio(1, contentMode: .fit) - .foregroundStyle(.accent) - .frame(height: 40) - Text(groupedPackage.formattedDate) - .font(.caption) - } - } - .padding(.top, 20) - } - - @ViewBuilder - private func getPackageList() -> some View { - List(groupedPackage.packages) { currentPackage in - HStack { - VStack(alignment: .leading) { - Text(currentPackage.packageDescription) - .fontWeight(.bold) - Text(currentPackage.packageTrackingNumber) - .font(.caption) - } - - Spacer() - - VStack(alignment: .trailing) { - Text("Gs \(currentPackage.formattedCost)") - .foregroundStyle(.accent) - .fontWeight(.bold) - Text("\(currentPackage.packageWeight) Kg") - .font(.caption) - } - } - .listRowSeparator(.hidden) - .listRowBackground(EmptyView()) - .listRowInsets(.init()) - } - .listStyle(.plain) - } - - @ViewBuilder - private func getFooter() -> some View { - HStack { - Text("Total") - .fontWeight(.bold) - Spacer() - - VStack(alignment: .trailing) { - Text("Gs \(groupedPackage.formattedTotalCost)") - .foregroundStyle(.accent) - .fontWeight(.bold) - Text("\(groupedPackage.totalWeight) Kg") - .font(.caption) - } - } - } -} - -#Preview { - ShipmentDetailView(groupedPackage: .mock) -} diff --git a/mobile-courier-app/Presentation/WithdrawnPackages/GroupedPackageRowView.swift b/mobile-courier-app/Presentation/WithdrawnPackages/GroupedPackageRowView.swift deleted file mode 100644 index cfadaaf..0000000 --- a/mobile-courier-app/Presentation/WithdrawnPackages/GroupedPackageRowView.swift +++ /dev/null @@ -1,64 +0,0 @@ -// -// PackageRowView.swift -// mobile-courier-app -// -// Created by Vladimir Espinola on 2024-06-16. -// - -import SwiftUI -import JustACourierAppDomain - -struct GroupedPackageRowView: View { - - var groupedPackage: GroupedPackageEntity - - var body: some View { - VStack(spacing: 8) { - HStack(alignment: .top) { - Text("N° \(groupedPackage.formattedId)") - .roundedIndicator() - - Spacer() - - VStack(alignment: .trailing) { - Text("Gs \(groupedPackage.formattedTotalCost)") - .foregroundStyle(.accent) - .fontWeight(.bold) - Text("\(groupedPackage.totalWeight) Kg") - } - } - - HStack { - Text(groupedPackage.formattedDate) - .frame(maxWidth: .infinity, alignment: .leading) - - Spacer() - - Text("\(groupedPackage.packages.count) packages") - } - - } - .frame(maxWidth: .infinity) - .padding(.init( - top: 8, - leading: 16, - bottom: 8, - trailing: 16) - ) - .foregroundStyle(.black) - .background( - RoundedRectangle(cornerRadius: 6) - .fill(Color.surface) - ) - .clipped() - } -} - -#Preview { - GroupedPackageRowView( - groupedPackage: .init( - shipmentCode: 2000, - packages: [.mock] - ) - ) -} diff --git a/mobile-courier-app/Presentation/WithdrawnPackages/WithdrawnPackagesView.swift b/mobile-courier-app/Presentation/WithdrawnPackages/WithdrawnPackagesView.swift deleted file mode 100644 index 69e44b7..0000000 --- a/mobile-courier-app/Presentation/WithdrawnPackages/WithdrawnPackagesView.swift +++ /dev/null @@ -1,82 +0,0 @@ -// -// WithdrawnPackagesView.swift -// mobile-courier-app -// -// Created by Vladimir Espinola on 2024-06-15. -// - -import SwiftUI -import JustACourierAppDomain - -struct WithdrawnPackagesView: View { - @ObservedObject var viewModel: WithdrawnPackagesViewModel - @EnvironmentObject var coordinator: Coordinator - - var body: some View { - ZStack { - if let groupedPackagesEntity = viewModel.filteredGroupedPackages { - content(for: groupedPackagesEntity) - } - } - .onAppear { - getPackages() - } - .refreshable { - getPackages(forceUpdate: true) - } - .showRippleSpinner(isLoading: $viewModel.isLoading) - .toast(message: $viewModel.toastMessage) - } - - private func getPackages(forceUpdate: Bool = false) { - Task { - await viewModel.getPackages(forceUpdate: forceUpdate) - } - } - - @ViewBuilder - private func content(for groupedPackages: [GroupedPackageEntity]) -> some View { - if groupedPackages.isEmpty { - PackagePlaceholderView() - } else { - VStack { - getYearPicker() - packagesList(groupedPackages) - } - } - } - - @ViewBuilder - private func getYearPicker() -> some View { - HStack(alignment: .top) { - Text("Please select a year for filtering your shipments") - Spacer() - Picker("Select Year", selection: $viewModel.selectedYear) { - ForEach(viewModel.getYearsForFiltering, id: \.self) { - Text($0) - } - } - .pickerStyle(.menu) - } - .padding([.leading, .trailing, .top], 20) - } - - @ViewBuilder - private func packagesList(_ groupedPackages: [GroupedPackageEntity]) -> some View { - List(groupedPackages) { row in - GroupedPackageRowView(groupedPackage: row) - .groupedPackageRowStyle() - .onTapGesture { - coordinator.present( - sheet: .shipmentDetail(groupedPackage: row) - ) - } - } - .listStyle(.plain) - } -} - -#Preview { - WithdrawnPackagesView(viewModel: .previewInstance()) - .environmentObject(Coordinator(diContainer: AppDIContainerMock())) -} diff --git a/mobile-courier-app/Presentation/WithdrawnPackages/WithdrawnPackagesViewModel.swift b/mobile-courier-app/Presentation/WithdrawnPackages/WithdrawnPackagesViewModel.swift deleted file mode 100644 index 4d7f786..0000000 --- a/mobile-courier-app/Presentation/WithdrawnPackages/WithdrawnPackagesViewModel.swift +++ /dev/null @@ -1,52 +0,0 @@ -// -// WithdrawnPackagesViewModel.swift -// mobile-courier-app -// -// Created by Vladimir Espinola on 2024-06-15. -// - -import Foundation -import JustACourierAppDomain - -final class WithdrawnPackagesViewModel: ObservableObject { - private enum Constants { - static var currentYear: String { "\(Date.now.getYear())" } - } - - @Published var isLoading: Bool = false - @Published var toastMessage: String? - @Published var groupedPackagesEntity: [GroupedPackageEntity]? - @Published var selectedYear: String = Constants.currentYear - - var filteredGroupedPackages: [GroupedPackageEntity]? { - groupedPackagesEntity?.filter { $0.formattedDate.contains(selectedYear) } - } - - var getYearsForFiltering: [String] { - groupedPackagesEntity?.getYears() ?? [] - } - - private let packagesRepository: PackagesRepositoryProtocol - - init(packagesRepository: PackagesRepositoryProtocol) { - self.packagesRepository = packagesRepository - } - - @MainActor - func getPackages(forceUpdate: Bool = false) async { - guard groupedPackagesEntity == nil || forceUpdate else { return } - - if forceUpdate { - selectedYear = Constants.currentYear - } - - defer { isLoading = false } - - do { - isLoading = true - groupedPackagesEntity = try await packagesRepository.getWithdrawnPackages() - } catch { - toastMessage = error.localizedDescription - } - } -} diff --git a/mobile-courier-app/Utilities/Localizable.xcstrings b/mobile-courier-app/Utilities/Localizable.xcstrings index 35375e9..398a1bc 100644 --- a/mobile-courier-app/Utilities/Localizable.xcstrings +++ b/mobile-courier-app/Utilities/Localizable.xcstrings @@ -1,10 +1,8 @@ { "sourceLanguage" : "en", "strings" : { - "" : { - - }, "%lld packages" : { + "extractionState" : "stale", "localizations" : { "en" : { "variations" : { @@ -45,6 +43,7 @@ } }, "Air Shipments" : { + "extractionState" : "stale", "localizations" : { "es" : { "stringUnit" : { @@ -55,6 +54,7 @@ } }, "At the branch" : { + "extractionState" : "stale", "localizations" : { "es" : { "stringUnit" : { @@ -65,6 +65,7 @@ } }, "Dark Mode" : { + "extractionState" : "stale", "localizations" : { "es" : { "stringUnit" : { @@ -103,6 +104,7 @@ } }, "Gs %@" : { + "extractionState" : "stale", "localizations" : { "es" : { "stringUnit" : { @@ -113,6 +115,7 @@ } }, "Hi, %@!" : { + "extractionState" : "stale", "localizations" : { "es" : { "stringUnit" : { @@ -123,6 +126,7 @@ } }, "Home" : { + "extractionState" : "stale", "localizations" : { "es" : { "stringUnit" : { @@ -133,6 +137,7 @@ } }, "Loading..." : { + "extractionState" : "stale", "localizations" : { "es" : { "stringUnit" : { @@ -160,6 +165,7 @@ } }, "Log out" : { + "extractionState" : "stale", "localizations" : { "es" : { "stringUnit" : { @@ -170,6 +176,7 @@ } }, "N° %@" : { + "extractionState" : "stale", "localizations" : { "es" : { "stringUnit" : { @@ -180,6 +187,7 @@ } }, "Packages" : { + "extractionState" : "stale", "localizations" : { "es" : { "stringUnit" : { @@ -207,6 +215,7 @@ } }, "Phone Number" : { + "extractionState" : "stale", "localizations" : { "es" : { "stringUnit" : { @@ -217,6 +226,7 @@ } }, "Please select a year for filtering your shipments" : { + "extractionState" : "stale", "localizations" : { "es" : { "stringUnit" : { @@ -227,6 +237,7 @@ } }, "Profile" : { + "extractionState" : "stale", "localizations" : { "es" : { "stringUnit" : { @@ -254,6 +265,7 @@ } }, "Sea Shipments" : { + "extractionState" : "stale", "localizations" : { "es" : { "stringUnit" : { @@ -264,6 +276,7 @@ } }, "Select Year" : { + "extractionState" : "stale", "localizations" : { "es" : { "stringUnit" : { @@ -274,6 +287,7 @@ } }, "Settings" : { + "extractionState" : "stale", "localizations" : { "es" : { "stringUnit" : { @@ -284,6 +298,7 @@ } }, "Shipment #%@" : { + "extractionState" : "stale", "localizations" : { "es" : { "stringUnit" : { @@ -294,6 +309,7 @@ } }, "Total" : { + "extractionState" : "stale", "localizations" : { "es" : { "stringUnit" : { @@ -304,6 +320,7 @@ } }, "Withdrawn" : { + "extractionState" : "stale", "localizations" : { "es" : { "stringUnit" : { @@ -314,6 +331,7 @@ } }, "You have no packages" : { + "extractionState" : "stale", "localizations" : { "es" : { "stringUnit" : { @@ -324,6 +342,7 @@ } }, "Your packages will be displayed here when they arrive at your mailbox" : { + "extractionState" : "stale", "localizations" : { "es" : { "stringUnit" : {