Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Info Seller View #121

Open
wants to merge 12 commits into
base: develop
Choose a base branch
from
29 changes: 29 additions & 0 deletions Core/Sources/Core/Models/DomainConvertible/SellerInfo.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
//
// File.swift
//
//
// Created by raniazeid on 30/08/2022.
//

import Domain
import Networking

extension Networking.SellerInfo: DomainConvertible {

func toDomain() -> Domain.SellerInfo {
return Domain.SellerInfo(sellerName: sellerName,
reviews: reviews,
location: location,
workTime: workTime,
followers: followers,
productsCount: productsCount,
createdAt: createdAt,
products: products.map { $0.toDomain() })
}
}

extension Networking.Products: DomainConvertible {
func toDomain() -> Domain.Products {
return Domain.Products(title: title, image: image, price: price, review: review, totalRevieews: totalReviews)
}
}
34 changes: 34 additions & 0 deletions Core/Sources/Core/Repository/SellerInfoRepository.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
//
// File.swift
//
//
// Created by raniazeid on 30/08/2022.
//

import Domain
import Foundation
import Networking

/// Implementation of `Domain.SellerInfoRepository`
///
struct SellerInfoRepository: Domain.SellerInfoRepository {

let remote: SellerInfoProtocol

init(remote: SellerInfoProtocol) {
self.remote = remote
}

func loadSellerInfo(completion: @escaping (Result<Domain.SellerInfo, Error>) -> Void) {
remote.getAllSellerInfo(completion: {
result in
switch result {
case let .success(list):
let domainList = list.toDomain()
completion(.success(domainList))
case let .failure(error):
completion(.failure(error))
}
})
}
}
4 changes: 4 additions & 0 deletions Core/Sources/Core/Tools/RepositoryProvider.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ public struct DefaultRepositoryProvider {
// MARK: - DefaultRepositoryProvider

extension DefaultRepositoryProvider: RepositoryProvider {
public func makeSellerInfoRepository() -> Domain.SellerInfoRepository {
let remote = SellerInfoRemote(network: network)
return SellerInfoRepository(remote: remote)
}

public func makeProductRepository() -> Domain.ProductRepository {
let remote = ProductsRemote(network: network)
Expand Down
73 changes: 60 additions & 13 deletions Dokan/Dokan.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,11 @@
437D1B1E2870F2C400B972BC /* Core in Frameworks */ = {isa = PBXBuildFile; productRef = 437D1B1D2870F2C400B972BC /* Core */; };
43D4BF0928918F9A0023190F /* FeaturedProductTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 43D4BF0828918F9A0023190F /* FeaturedProductTests.swift */; };
43D4BF0B2891A5C50023190F /* FeaturedProductCollectionViewCellTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 43D4BF0A2891A5C50023190F /* FeaturedProductCollectionViewCellTests.swift */; };
51A04FAD289335FF00900EFF /* ReviewerTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 51A04FAB289335FF00900EFF /* ReviewerTableViewCell.swift */; };
51934C8F28AD91B60078FD3C /* SellerInfoCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 51934C8D28AD91B60078FD3C /* SellerInfoCell.swift */; };
51934C9028AD91B60078FD3C /* SellerInfoCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 51934C8E28AD91B60078FD3C /* SellerInfoCell.xib */; };
519D380428A05AD90029B722 /* Kingfisher in Frameworks */ = {isa = PBXBuildFile; productRef = 519D380328A05AD90029B722 /* Kingfisher */; };
519D380728A05B860029B722 /* UIImage+Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = 519D380628A05B860029B722 /* UIImage+Extension.swift */; };
51A04FAD289335FF00900EFF /* ReviewerTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 51A04FAB289335FF00900EFF /* ReviewerTableViewCell.swift */; };
856E36AF2889229B00735EF2 /* InfoSellerView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 856E36AE2889229B00735EF2 /* InfoSellerView.swift */; };
856E36B1288922EF00735EF2 /* InfoSellerView.xib in Resources */ = {isa = PBXBuildFile; fileRef = 856E36B0288922EF00735EF2 /* InfoSellerView.xib */; };
856E36B928893C9A00735EF2 /* UIDokan in Frameworks */ = {isa = PBXBuildFile; productRef = AAE1A1C0285E1A3D00A4EBB0 /* UIDokan */; };
Expand All @@ -36,9 +38,14 @@
85B31DBD2870BEDE00B1C9E8 /* LoginViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 85B31DB92870BEDE00B1C9E8 /* LoginViewController.xib */; };
85DA676428928F1500DCABD2 /* InfoSellerViewDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 85DA676328928F1500DCABD2 /* InfoSellerViewDelegate.swift */; };
85F6B6DA28919C87007730AB /* ProductDetailsNavigationBarBehavior.swift in Sources */ = {isa = PBXBuildFile; fileRef = 85F6B6D928919C87007730AB /* ProductDetailsNavigationBarBehavior.swift */; };
9900241E28B15F9E00D1D722 /* InfoSellerViewModelType.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9900241A28B15F9E00D1D722 /* InfoSellerViewModelType.swift */; };
9900241F28B15F9E00D1D722 /* InfoSellerViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9900241B28B15F9E00D1D722 /* InfoSellerViewController.swift */; };
9900242028B15F9E00D1D722 /* InfoSellerViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9900241C28B15F9E00D1D722 /* InfoSellerViewModel.swift */; };
9900242128B15F9E00D1D722 /* InfoSellerViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 9900241D28B15F9E00D1D722 /* InfoSellerViewController.xib */; };
99091F1828895D96000FA9C9 /* ProductTitleQuantityView.xib in Resources */ = {isa = PBXBuildFile; fileRef = 99091F1728895D96000FA9C9 /* ProductTitleQuantityView.xib */; };
99091F1A28895DC1000FA9C9 /* ProductTitleQuantityView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 99091F1928895DC1000FA9C9 /* ProductTitleQuantityView.swift */; };
99CC7308288E2FE400503D86 /* Colors.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 99CC7307288E2FE400503D86 /* Colors.xcassets */; };
99E2C0A528C2A7DE0063874E /* InfoSellerViewController+CollectionView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 99E2C0A428C2A7DE0063874E /* InfoSellerViewController+CollectionView.swift */; };
AA21B43628537E0400E4F217 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA21B43528537E0400E4F217 /* AppDelegate.swift */; };
AA21B43828537E0400E4F217 /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA21B43728537E0400E4F217 /* SceneDelegate.swift */; };
AA21B43A28537E0400E4F217 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA21B43928537E0400E4F217 /* ViewController.swift */; };
Expand Down Expand Up @@ -95,9 +102,11 @@
437B99AB289082BC00F59B06 /* FeaturedProductCollectionViewCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = FeaturedProductCollectionViewCell.xib; sourceTree = "<group>"; };
43D4BF0828918F9A0023190F /* FeaturedProductTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FeaturedProductTests.swift; sourceTree = "<group>"; };
43D4BF0A2891A5C50023190F /* FeaturedProductCollectionViewCellTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FeaturedProductCollectionViewCellTests.swift; sourceTree = "<group>"; };
51934C8D28AD91B60078FD3C /* SellerInfoCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SellerInfoCell.swift; sourceTree = "<group>"; };
51934C8E28AD91B60078FD3C /* SellerInfoCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = SellerInfoCell.xib; sourceTree = "<group>"; };
519D380628A05B860029B722 /* UIImage+Extension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIImage+Extension.swift"; sourceTree = "<group>"; };
51A04FAB289335FF00900EFF /* ReviewerTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ReviewerTableViewCell.swift; sourceTree = "<group>"; };
51A04FAC289335FF00900EFF /* ReviewerTableViewCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = ReviewerTableViewCell.xib; sourceTree = "<group>"; };
519D380628A05B860029B722 /* UIImage+Extension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIImage+Extension.swift"; sourceTree = "<group>"; };
856E36AE2889229B00735EF2 /* InfoSellerView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = InfoSellerView.swift; sourceTree = "<group>"; };
856E36B0288922EF00735EF2 /* InfoSellerView.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = InfoSellerView.xib; sourceTree = "<group>"; };
85B31DB62870BEDE00B1C9E8 /* LoginViewModelType.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LoginViewModelType.swift; sourceTree = "<group>"; };
Expand All @@ -106,9 +115,14 @@
85B31DB92870BEDE00B1C9E8 /* LoginViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = LoginViewController.xib; sourceTree = "<group>"; };
85DA676328928F1500DCABD2 /* InfoSellerViewDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = InfoSellerViewDelegate.swift; sourceTree = "<group>"; };
85F6B6D928919C87007730AB /* ProductDetailsNavigationBarBehavior.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ProductDetailsNavigationBarBehavior.swift; sourceTree = "<group>"; };
9900241A28B15F9E00D1D722 /* InfoSellerViewModelType.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = InfoSellerViewModelType.swift; sourceTree = "<group>"; };
9900241B28B15F9E00D1D722 /* InfoSellerViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = InfoSellerViewController.swift; sourceTree = "<group>"; };
9900241C28B15F9E00D1D722 /* InfoSellerViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = InfoSellerViewModel.swift; sourceTree = "<group>"; };
9900241D28B15F9E00D1D722 /* InfoSellerViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = InfoSellerViewController.xib; sourceTree = "<group>"; };
99091F1728895D96000FA9C9 /* ProductTitleQuantityView.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = ProductTitleQuantityView.xib; sourceTree = "<group>"; };
99091F1928895DC1000FA9C9 /* ProductTitleQuantityView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ProductTitleQuantityView.swift; sourceTree = "<group>"; };
99CC7307288E2FE400503D86 /* Colors.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Colors.xcassets; sourceTree = "<group>"; };
99E2C0A428C2A7DE0063874E /* InfoSellerViewController+CollectionView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "InfoSellerViewController+CollectionView.swift"; sourceTree = "<group>"; };
AA21B43228537E0400E4F217 /* Dokan.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Dokan.app; sourceTree = BUILT_PRODUCTS_DIR; };
AA21B43528537E0400E4F217 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
AA21B43728537E0400E4F217 /* SceneDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -247,11 +261,19 @@
path = FeaturedProduct;
sourceTree = "<group>";
};
51A04FAA289334A800900EFF /* Cell */ = {
51934C8728AD911A0078FD3C /* SellerInfo */ = {
isa = PBXGroup;
children = (
51A04FAB289335FF00900EFF /* ReviewerTableViewCell.swift */,
51A04FAC289335FF00900EFF /* ReviewerTableViewCell.xib */,
51934C8828AD91320078FD3C /* Cell */,
);
path = SellerInfo;
sourceTree = "<group>";
};
51934C8828AD91320078FD3C /* Cell */ = {
isa = PBXGroup;
children = (
51934C8D28AD91B60078FD3C /* SellerInfoCell.swift */,
51934C8E28AD91B60078FD3C /* SellerInfoCell.xib */,
);
path = Cell;
sourceTree = "<group>";
Expand All @@ -264,6 +286,15 @@
path = Extension;
sourceTree = "<group>";
};
51A04FAA289334A800900EFF /* Cell */ = {
isa = PBXGroup;
children = (
51A04FAB289335FF00900EFF /* ReviewerTableViewCell.swift */,
51A04FAC289335FF00900EFF /* ReviewerTableViewCell.xib */,
);
path = Cell;
sourceTree = "<group>";
};
856E36AD2889224B00735EF2 /* InfoSellerView */ = {
isa = PBXGroup;
children = (
Expand All @@ -285,6 +316,18 @@
path = Login;
sourceTree = "<group>";
};
9900241928B15F5A00D1D722 /* InfoSeller */ = {
isa = PBXGroup;
children = (
99E2C0A328C2A7BD0063874E /* CollectionView */,
9900241A28B15F9E00D1D722 /* InfoSellerViewModelType.swift */,
9900241B28B15F9E00D1D722 /* InfoSellerViewController.swift */,
9900241C28B15F9E00D1D722 /* InfoSellerViewModel.swift */,
9900241D28B15F9E00D1D722 /* InfoSellerViewController.xib */,
);
path = InfoSeller;
sourceTree = "<group>";
};
99091F1628895CFF000FA9C9 /* TitleQuantity */ = {
isa = PBXGroup;
children = (
Expand All @@ -294,15 +337,12 @@
path = TitleQuantity;
sourceTree = "<group>";
};
276889D92874162B0091ACEB /* Registration */ = {
99E2C0A328C2A7BD0063874E /* CollectionView */ = {
isa = PBXGroup;
children = (
276889DA287417730091ACEB /* RegisterViewController.swift */,
276889DB287417730091ACEB /* RegisterViewController.xib */,
276889DE28741F750091ACEB /* RegisterViewModel.swift */,
276889E0287420980091ACEB /* RegisterViewModelType.swift */,
99E2C0A428C2A7DE0063874E /* InfoSellerViewController+CollectionView.swift */,
);
path = Registration;
path = CollectionView;
sourceTree = "<group>";
};
AA21B42928537E0400E4F217 = {
Expand Down Expand Up @@ -357,6 +397,7 @@
AA57CB322881B22000FE62C8 /* ProductDetails */ = {
isa = PBXGroup;
children = (
9900241928B15F5A00D1D722 /* InfoSeller */,
51A04FAA289334A800900EFF /* Cell */,
2768DEEB28A42292004C6A5B /* SliderView */,
99091F1628895CFF000FA9C9 /* TitleQuantity */,
Expand All @@ -375,8 +416,8 @@
AA57CB332881B50500FE62C8 /* Views */ = {
isa = PBXGroup;
children = (
51934C8728AD911A0078FD3C /* SellerInfo */,
E2DADBAA288A53D9005E483A /* ButtonsView */,
AAC39E13289DD9CA0069822D /* ReviewerTableViewCell */,
856E36AD2889224B00735EF2 /* InfoSellerView */,
437B99A428907E6C00F59B06 /* FeaturedProduct */,
85F6B6D928919C87007730AB /* ProductDetailsNavigationBarBehavior.swift */,
Expand Down Expand Up @@ -566,12 +607,13 @@
files = (
437B99AD289082BC00F59B06 /* FeaturedProductCollectionViewCell.xib in Resources */,
99CC7308288E2FE400503D86 /* Colors.xcassets in Resources */,
51934C9028AD91B60078FD3C /* SellerInfoCell.xib in Resources */,
2768DEF428A422F3004C6A5B /* SliderView.xib in Resources */,
9900242128B15F9E00D1D722 /* InfoSellerViewController.xib in Resources */,
85B31DBD2870BEDE00B1C9E8 /* LoginViewController.xib in Resources */,
E251D05028784A050065C852 /* VerificationViewController.xib in Resources */,
AA21B44228537E0500E4F217 /* LaunchScreen.storyboard in Resources */,
276889DD287417730091ACEB /* RegisterViewController.xib in Resources */,
AAC39E17289DD9DE0069822D /* ReviewerTableViewCell.xib in Resources */,
2768DEEF28A422D2004C6A5B /* SliderCollectionViewCell.xib in Resources */,
432EF5D4288F078E0073FB1D /* Localizable.strings in Resources */,
AAA2E17D285CBB9100EAD189 /* GoogleService-Info.plist in Resources */,
Expand Down Expand Up @@ -678,6 +720,7 @@
files = (
E2CC398828A4A933008AE48B /* LoadingButton.swift in Sources */,
85B31DBB2870BEDE00B1C9E8 /* LoginViewController.swift in Sources */,
9900242028B15F9E00D1D722 /* InfoSellerViewModel.swift in Sources */,
85B31DBA2870BEDE00B1C9E8 /* LoginViewModelType.swift in Sources */,
856E36AF2889229B00735EF2 /* InfoSellerView.swift in Sources */,
E251D04E28784A050065C852 /* VerificationViewController.swift in Sources */,
Expand All @@ -686,8 +729,11 @@
B82D6D4F2892FF290035D30C /* UIModels.swift in Sources */,
51A04FAD289335FF00900EFF /* ReviewerTableViewCell.swift in Sources */,
AA21B43A28537E0400E4F217 /* ViewController.swift in Sources */,
99E2C0A528C2A7DE0063874E /* InfoSellerViewController+CollectionView.swift in Sources */,
51934C8F28AD91B60078FD3C /* SellerInfoCell.swift in Sources */,
276889E1287420980091ACEB /* RegisterViewModelType.swift in Sources */,
99091F1A28895DC1000FA9C9 /* ProductTitleQuantityView.swift in Sources */,
9900241F28B15F9E00D1D722 /* InfoSellerViewController.swift in Sources */,
276889DF28741F750091ACEB /* RegisterViewModel.swift in Sources */,
276889DC287417730091ACEB /* RegisterViewController.swift in Sources */,
437B99AC289082BC00F59B06 /* FeaturedProductCollectionViewCell.swift in Sources */,
Expand All @@ -708,6 +754,7 @@
AA98C0762867EAC0004C5967 /* Logging.swift in Sources */,
85B31DBC2870BEDE00B1C9E8 /* LoginViewModel.swift in Sources */,
437B99A828907F2A00F59B06 /* FeaturedProductView.swift in Sources */,
9900241E28B15F9E00D1D722 /* InfoSellerViewModelType.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"images" : [
{
"filename" : "vector.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "vector.png",
"idiom" : "universal",
"scale" : "2x"
},
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 21 additions & 0 deletions Dokan/Dokan/Assets.xcassets/marker-time.imageset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"images" : [
{
"filename" : "marker-time.svg",
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading