-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 2c93677
Showing
195 changed files
with
11,778 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
build/ | ||
Carthage/ | ||
/.DS_Store | ||
.DS_Store | ||
|
||
TRPDataLayer.xcodeproj/xcuserdata/cemcaygoz.xcuserdatad/xcschemes/xcschememanagement.plist | ||
xcuserdata/ |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
|
||
# git "file:///Users/evrenyasar/Xcode/ModularIOS/TRPRestKit" "api_v3" | ||
git "https://github.com/Tripian-inc/TRPRestKit" "api_v3" | ||
git "https://github.com/Tripian-inc/TRPFoundationKit" "master" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
github "Tripian-inc/TRPFoundationKit" "da5b4ecd4b958df1d4c2a3b6fbc357d37eb1e338" | ||
github "Tripian-inc/TRPRestKit" "e0f19eb60172642c326e32d0f107a2c98353e167" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
// swift-tools-version: 6.0 | ||
// The swift-tools-version declares the minimum version of Swift required to build this package. | ||
|
||
import PackageDescription | ||
|
||
let package = Package( | ||
name: "TRPDataLayer", | ||
products: [ | ||
// Products define the executables and libraries a package produces, making them visible to other packages. | ||
.library( | ||
name: "TRPDataLayer", | ||
targets: ["TRPDataLayer"]), | ||
], | ||
targets: [ | ||
// Targets are the basic building blocks of a package, defining a module or a test suite. | ||
// Targets can depend on other targets in this package and products from dependencies. | ||
.target( | ||
name: "TRPDataLayer"), | ||
.testTarget( | ||
name: "TRPDataLayerTests", | ||
dependencies: ["TRPDataLayer"] | ||
), | ||
] | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
// The Swift Programming Language | ||
// https://docs.swift.org/swift-book |
Large diffs are not rendered by default.
Oops, something went wrong.
7 changes: 7 additions & 0 deletions
7
TRPDataLayer.xcodeproj/project.xcworkspace/contents.xcworkspacedata
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
8 changes: 8 additions & 0 deletions
8
TRPDataLayer.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | ||
<plist version="1.0"> | ||
<dict> | ||
<key>IDEDidComputeMac32BitWarning</key> | ||
<true/> | ||
</dict> | ||
</plist> |
77 changes: 77 additions & 0 deletions
77
TRPDataLayer.xcodeproj/xcshareddata/xcschemes/TRPDataLayer.xcscheme
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<Scheme | ||
LastUpgradeVersion = "1340" | ||
version = "1.3"> | ||
<BuildAction | ||
parallelizeBuildables = "YES" | ||
buildImplicitDependencies = "YES"> | ||
<BuildActionEntries> | ||
<BuildActionEntry | ||
buildForTesting = "YES" | ||
buildForRunning = "YES" | ||
buildForProfiling = "YES" | ||
buildForArchiving = "YES" | ||
buildForAnalyzing = "YES"> | ||
<BuildableReference | ||
BuildableIdentifier = "primary" | ||
BlueprintIdentifier = "B25D35B524C4F0020015F66C" | ||
BuildableName = "TRPDataLayer.framework" | ||
BlueprintName = "TRPDataLayer" | ||
ReferencedContainer = "container:TRPDataLayer.xcodeproj"> | ||
</BuildableReference> | ||
</BuildActionEntry> | ||
</BuildActionEntries> | ||
</BuildAction> | ||
<TestAction | ||
buildConfiguration = "Debug" | ||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" | ||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" | ||
shouldUseLaunchSchemeArgsEnv = "YES"> | ||
<Testables> | ||
<TestableReference | ||
skipped = "NO"> | ||
<BuildableReference | ||
BuildableIdentifier = "primary" | ||
BlueprintIdentifier = "B25D35BE24C4F0020015F66C" | ||
BuildableName = "TRPDataLayerTests.xctest" | ||
BlueprintName = "TRPDataLayerTests" | ||
ReferencedContainer = "container:TRPDataLayer.xcodeproj"> | ||
</BuildableReference> | ||
</TestableReference> | ||
</Testables> | ||
</TestAction> | ||
<LaunchAction | ||
buildConfiguration = "Debug" | ||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" | ||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" | ||
launchStyle = "0" | ||
useCustomWorkingDirectory = "NO" | ||
ignoresPersistentStateOnLaunch = "NO" | ||
debugDocumentVersioning = "YES" | ||
debugServiceExtension = "internal" | ||
allowLocationSimulation = "YES"> | ||
</LaunchAction> | ||
<ProfileAction | ||
buildConfiguration = "Release" | ||
shouldUseLaunchSchemeArgsEnv = "YES" | ||
savedToolIdentifier = "" | ||
useCustomWorkingDirectory = "NO" | ||
debugDocumentVersioning = "YES"> | ||
<MacroExpansion> | ||
<BuildableReference | ||
BuildableIdentifier = "primary" | ||
BlueprintIdentifier = "B25D35B524C4F0020015F66C" | ||
BuildableName = "TRPDataLayer.framework" | ||
BlueprintName = "TRPDataLayer" | ||
ReferencedContainer = "container:TRPDataLayer.xcodeproj"> | ||
</BuildableReference> | ||
</MacroExpansion> | ||
</ProfileAction> | ||
<AnalyzeAction | ||
buildConfiguration = "Debug"> | ||
</AnalyzeAction> | ||
<ArchiveAction | ||
buildConfiguration = "Release" | ||
revealArchiveInOrganizer = "YES"> | ||
</ArchiveAction> | ||
</Scheme> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
// | ||
// Cancellable.swift | ||
// TRPDataLayer | ||
// | ||
// Created by Evren Yaşar on 20.07.2020. | ||
// Copyright © 2020 Tripian Inc. All rights reserved. | ||
// | ||
|
||
import Foundation | ||
public protocol Cancellable { | ||
func cancel() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
// | ||
// ObserverController.swift | ||
// TRPDataLayer | ||
// | ||
// Created by Evren Yaşar on 28.07.2020. | ||
// Copyright © 2020 Tripian Inc. All rights reserved. | ||
// | ||
|
||
import Foundation | ||
public protocol ObserverController { | ||
func remove() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
// | ||
// UseCase.swift | ||
// TRPDataLayer | ||
// | ||
// Created by Evren Yaşar on 20.07.2020. | ||
// Copyright © 2020 Tripian Inc. All rights reserved. | ||
// | ||
|
||
import Foundation | ||
public protocol UseCase { | ||
@discardableResult | ||
func start() -> Cancellable? | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
// | ||
// CityLocalStorage.swift | ||
// TRPDataLayer | ||
// | ||
// Created by Evren Yaşar on 29.07.2020. | ||
// Copyright © 2020 Tripian Inc. All rights reserved. | ||
// | ||
|
||
import Foundation | ||
import TRPRestKit | ||
public protocol CityLocalStorage { | ||
func fetchLocalCity(id: Int, completion: @escaping (CityResultValue) -> Void) | ||
} | ||
|
||
public class TRPCityLocalStorage: CityLocalStorage { | ||
|
||
private(set) var file = FileIO.shared | ||
|
||
public init() {} | ||
|
||
public func fetchLocalCity(id: Int, completion: @escaping (CityResultValue) -> Void) { | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
// | ||
// TRPCityLocalStorage.swift | ||
// TRPDataLayer | ||
// | ||
// Created by Evren Yaşar on 29.07.2020. | ||
// Copyright © 2020 Tripian Inc. All rights reserved. | ||
// | ||
|
||
import Foundation |
16 changes: 16 additions & 0 deletions
16
TRPDataLayer/Data/CoreData/Companion/CompanionLocalStorage.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// | ||
// CompanionLocalStorage.swift | ||
// TRPDataLayer | ||
// | ||
// Created by Evren Yaşar on 4.08.2020. | ||
// Copyright © 2020 Tripian Inc. All rights reserved. | ||
// | ||
|
||
import Foundation | ||
public protocol CompanionLocalStorage {} | ||
|
||
public class TRPCompanionLocalStorage: CompanionLocalStorage { | ||
|
||
public init() {} | ||
|
||
} |
14 changes: 14 additions & 0 deletions
14
TRPDataLayer/Data/CoreData/Favorite/FavoriteLocalStorage.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
// | ||
// FavoriteLocalStorage.swift | ||
// TRPDataLayer | ||
// | ||
// Created by Evren Yaşar on 27.07.2020. | ||
// Copyright © 2020 Tripian Inc. All rights reserved. | ||
// | ||
|
||
import Foundation | ||
public protocol FavoriteLocalStorage { | ||
func fetchLocalPoi(completion: @escaping (FavoriteResultsValue) -> Void) | ||
|
||
func saveFavorites(cityId: String, data: [TRPFavorite]) | ||
} |
35 changes: 35 additions & 0 deletions
35
TRPDataLayer/Data/CoreData/Favorite/TRPFavoriteLocalStorage.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
// | ||
// TRPFavoriteLocalStorage.swift | ||
// TRPDataLayer | ||
// | ||
// Created by Evren Yaşar on 27.07.2020. | ||
// Copyright © 2020 Tripian Inc. All rights reserved. | ||
// | ||
|
||
import Foundation | ||
import TRPRestKit | ||
public class TRPFavoriteLocalStorage: FavoriteLocalStorage { | ||
|
||
private(set) var file = FileIO.shared | ||
|
||
public init() {} | ||
|
||
public func fetchLocalPoi(completion: @escaping (FavoriteResultsValue) -> Void) { | ||
do { | ||
let city = CruiseDataHolderUseCase.shared.cityId ?? 0 | ||
let json = try file.read([TRPFavorite].self, "city_favorite_\(city)", false) | ||
completion(.success(json)) | ||
}catch let error { | ||
completion(.failure(error)) | ||
} | ||
} | ||
|
||
public func saveFavorites(cityId: String, data: [TRPFavorite]) { | ||
do { | ||
let fileName = "city_favorite_\(cityId)" | ||
try file.write(data, fileName) | ||
}catch let _error { | ||
print("[ERROR] \(_error)") | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
// | ||
// PoiLocalStorage.swift | ||
// TRPDataLayer | ||
// | ||
// Created by Evren Yaşar on 17.08.2020. | ||
// Copyright © 2020 Tripian Inc. All rights reserved. | ||
// | ||
|
||
import Foundation | ||
import TRPRestKit | ||
public protocol PoiLocalStorage { | ||
func fetchLocalPoi(completion: @escaping (PoiResultsValue) -> Void) | ||
} | ||
|
||
public class TRPPoiLocalStorage: PoiLocalStorage { | ||
private(set) var file = FileIO.shared | ||
|
||
public init() {} | ||
|
||
public func fetchLocalPoi(completion: @escaping (PoiResultsValue) -> Void) { | ||
do { | ||
let city = CruiseDataHolderUseCase.shared.cityId ?? 0 | ||
//TODO: - CİTYID GELECEK | ||
let json = try file.read(TRPGenericParser<[TRPPoiInfoModel]>.self, "city_\(city)", true) | ||
if let result = json.data { | ||
let converted = PoiMapper().map(result) | ||
completion((.success(converted), nil)) | ||
} | ||
}catch let error { | ||
print("[Offline] \(error)") | ||
completion((.failure(error), nil)) | ||
} | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
TRPDataLayer/Data/CoreData/Questions/QuestionLocalStorage.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
// | ||
// QuestionLocalStorage.swift | ||
// TRPDataLayer | ||
// | ||
// Created by Evren Yaşar on 30.07.2020. | ||
// Copyright © 2020 Tripian Inc. All rights reserved. | ||
// | ||
|
||
import Foundation | ||
public protocol QuestionLocalStorage {} |
12 changes: 12 additions & 0 deletions
12
TRPDataLayer/Data/CoreData/Questions/TRPQuestionLocalStorage.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
// | ||
// TRPQuestionLocalStorage.swift | ||
// TRPDataLayer | ||
// | ||
// Created by Evren Yaşar on 30.07.2020. | ||
// Copyright © 2020 Tripian Inc. All rights reserved. | ||
// | ||
|
||
import Foundation | ||
public class TRPQuestionLocalStorage: QuestionLocalStorage { | ||
public init() {} | ||
} |
16 changes: 16 additions & 0 deletions
16
TRPDataLayer/Data/CoreData/Reservation/UserReservationLocalStorage.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// | ||
// UserReservationLocalStorage.swift | ||
// TRPDataLayer | ||
// | ||
// Created by Evren Yaşar on 25.08.2020. | ||
// Copyright © 2020 Tripian Inc. All rights reserved. | ||
// | ||
|
||
import Foundation | ||
public protocol UserReservationLocalStorage {} | ||
|
||
public class TRPUserReservationLocalStorage: UserReservationLocalStorage { | ||
|
||
public init() {} | ||
|
||
} |
Oops, something went wrong.