From 1db3bdb9444c19c81f0ac531a7eec7974c24eb52 Mon Sep 17 00:00:00 2001 From: Grigory Boyko Date: Tue, 2 Aug 2022 16:21:00 +0700 Subject: [PATCH] feat: Update podspec to 1.27, small models changes --- LeadKit.podspec | 2 +- TIAppleMapUtils/TIAppleMapUtils.podspec | 2 +- TIAuth/TIAuth.podspec | 2 +- .../Sources/Classes/CartRequestExecutor.swift | 10 +++---- .../Models/BaseErrorResponseBody.swift | 2 +- TIEcommerce/Sources/Models/Cart.swift | 2 +- TIEcommerce/Sources/Models/CartProduct.swift | 2 +- TIEcommerce/Sources/Models/CartService.swift | 12 ++++---- TIEcommerce/Sources/Models/Price.swift | 29 ------------------- TIEcommerce/Sources/Models/Promocode.swift | 3 +- TIEcommerce/TIEcommerce.podspec | 2 +- TIFoundationUtils/TIFoundationUtils.podspec | 2 +- TIGoogleMapUtils/TIGoogleMapUtils.podspec | 2 +- TIKeychainUtils/TIKeychainUtils.podspec | 2 +- TIMapUtils/TIMapUtils.podspec | 2 +- TIMoyaNetworking/TIMoyaNetworking.podspec | 2 +- TINetworking/TINetworking.podspec | 2 +- TINetworkingCache/TINetworkingCache.podspec | 2 +- TIPagination/TIPagination.podspec | 2 +- TISwiftUICore/TISwiftUICore.podspec | 2 +- TISwiftUtils/TISwiftUtils.podspec | 2 +- TITableKitUtils/TITableKitUtils.podspec | 2 +- TITransitions/TITransitions.podspec | 2 +- TIUIElements/TIUIElements.podspec | 2 +- TIUIKitCore/TIUIKitCore.podspec | 2 +- TIYandexMapUtils/TIYandexMapUtils.podspec | 2 +- 26 files changed, 34 insertions(+), 64 deletions(-) delete mode 100644 TIEcommerce/Sources/Models/Price.swift diff --git a/LeadKit.podspec b/LeadKit.podspec index 336bb65a..f2a981bd 100644 --- a/LeadKit.podspec +++ b/LeadKit.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = "LeadKit" - s.version = "1.25.0" + s.version = "1.27" s.summary = "iOS framework with a bunch of tools for rapid development" s.homepage = "https://github.com/TouchInstinct/LeadKit" s.license = "Apache License, Version 2.0" diff --git a/TIAppleMapUtils/TIAppleMapUtils.podspec b/TIAppleMapUtils/TIAppleMapUtils.podspec index 6abd13a9..ebbd201b 100644 --- a/TIAppleMapUtils/TIAppleMapUtils.podspec +++ b/TIAppleMapUtils/TIAppleMapUtils.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = 'TIAppleMapUtils' - s.version = '1.25.0' + s.version = '1.27' s.summary = 'Set of helpers for map objects clustering and interacting using Apple MapKit.' s.homepage = 'https://github.com/TouchInstinct/LeadKit/tree/' + s.version.to_s + '/' + s.name s.license = { :type => 'MIT', :file => 'LICENSE' } diff --git a/TIAuth/TIAuth.podspec b/TIAuth/TIAuth.podspec index d8652513..abc1035e 100644 --- a/TIAuth/TIAuth.podspec +++ b/TIAuth/TIAuth.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = 'TIAuth' - s.version = '1.25.0' + s.version = '1.27' s.summary = 'Login, registration, confirmation and other related actions' s.homepage = 'https://github.com/TouchInstinct/LeadKit/tree/' + s.version.to_s + '/' + s.name s.license = { :type => 'MIT', :file => 'LICENSE' } diff --git a/TIEcommerce/Sources/Classes/CartRequestExecutor.swift b/TIEcommerce/Sources/Classes/CartRequestExecutor.swift index e37e53e2..0dccc3a1 100644 --- a/TIEcommerce/Sources/Classes/CartRequestExecutor.swift +++ b/TIEcommerce/Sources/Classes/CartRequestExecutor.swift @@ -32,14 +32,14 @@ open class CartRequestExecutor: Cancellable { public var successCompletion: SuccessCompletion private var executingRequest: Cancellable? - private var numberOfAttempts: Int + private var attemptsLeft: Int public init(executionClosure: @escaping ExecutionClosure, successCompletion: @escaping SuccessCompletion, - numberOfAttempts: Int = 3) { + attemptsLeft: Int = 3) { self.executionClosure = executionClosure self.successCompletion = successCompletion - self.numberOfAttempts = numberOfAttempts + self.attemptsLeft = attemptsLeft } open func execute() { @@ -60,8 +60,8 @@ open class CartRequestExecutor: Cancellable { } open func handle(failure: ErrorCollection>) { - if shouldRetry(failure: failure) && numberOfAttempts > 0 { - numberOfAttempts -= 1 + if shouldRetry(failure: failure) && attemptsLeft > 0 { + attemptsLeft -= 1 execute() } } diff --git a/TIEcommerce/Sources/Models/BaseErrorResponseBody.swift b/TIEcommerce/Sources/Models/BaseErrorResponseBody.swift index 541b79a2..9600e880 100644 --- a/TIEcommerce/Sources/Models/BaseErrorResponseBody.swift +++ b/TIEcommerce/Sources/Models/BaseErrorResponseBody.swift @@ -21,7 +21,7 @@ import Foundation -public protocol BaseErrorResponseBody: Decodable, Hashable { +public protocol BaseErrorResponseBody { ///Код ошибки var errorCode: Int { get } ///Текст сообщения об ошибке diff --git a/TIEcommerce/Sources/Models/Cart.swift b/TIEcommerce/Sources/Models/Cart.swift index 86aaeb9c..6f294719 100644 --- a/TIEcommerce/Sources/Models/Cart.swift +++ b/TIEcommerce/Sources/Models/Cart.swift @@ -25,7 +25,7 @@ public protocol Cart { ///Продукты в корзине пользователя var products: [CartProduct] { get } ///Применённые промокоды - var promocodes: [String] { get } + var promocodes: [Promocode] { get } ///Количество доступных бонусов для использования var availableBonuses: Int? { get } } diff --git a/TIEcommerce/Sources/Models/CartProduct.swift b/TIEcommerce/Sources/Models/CartProduct.swift index 8c3873bb..e4bac41e 100644 --- a/TIEcommerce/Sources/Models/CartProduct.swift +++ b/TIEcommerce/Sources/Models/CartProduct.swift @@ -25,7 +25,7 @@ public protocol CartProduct { ///Идентификатор продукта var id: String { get } ///Цена в определённой валюте - var price: Price { get } + var price: Int { get } ///Сколько единиц есть доступно var availableCount: Int? { get } ///Варианты товара (фасовка, цвет, размер, и т.п.) diff --git a/TIEcommerce/Sources/Models/CartService.swift b/TIEcommerce/Sources/Models/CartService.swift index baf29b08..ec8f449b 100644 --- a/TIEcommerce/Sources/Models/CartService.swift +++ b/TIEcommerce/Sources/Models/CartService.swift @@ -30,20 +30,18 @@ public protocol CartService { var localCart: CartType? { get } var removedProducts: [CartProductType] { get } var notAvailableProducts: [CartProductType] { get } - ///Примененные промокоды - var promocodes: [Promocode] { get } ///Примененные бонусы var appliedBonuses: Int? { get } //MARK: - Work with products func updateCountInCart(for product: CartProductType, count: Int) - func updateCountInCart(for productId: Int, count: Int) + func updateCountInCart(for productId: String, count: Int) ///Возможность вернуть товар в корзину - func recoverProductBy(id: Int) + func recoverProductBy(id: String) //MARK: - Work with promocodes - ///Применить какой-нибудь промокод + ///Применить промокод func applyPromocode(_ promocode: String, successCompletion: ParameterClosure?, failureCompletion: ParameterClosure?) @@ -75,6 +73,6 @@ public protocol CartService { //MARK: - Subscribe on changes ///Подписаться на изменение корзины func subscribeOnCartChanging(completion: ParameterClosure) -> Cancellable - //Подписаться на изменение продукта по ID - func subscribeOnProductChanging(productId: Int, completion: ParameterClosure) -> Cancellable + ///Подписаться на изменение продукта по ID + func subscribeOnProductChanging(productId: String, completion: ParameterClosure) -> Cancellable } diff --git a/TIEcommerce/Sources/Models/Price.swift b/TIEcommerce/Sources/Models/Price.swift deleted file mode 100644 index e94558d6..00000000 --- a/TIEcommerce/Sources/Models/Price.swift +++ /dev/null @@ -1,29 +0,0 @@ -// -// Copyright (c) 2022 Touch Instinct -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the Software), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -import Foundation - -public protocol Price { - ///Стоимость - var value: Int { get } - ///Трехсимвольный код валюты в ISO 4217 - var currencyCode: String { get } -} diff --git a/TIEcommerce/Sources/Models/Promocode.swift b/TIEcommerce/Sources/Models/Promocode.swift index 58ab9faa..9ad5ed9f 100644 --- a/TIEcommerce/Sources/Models/Promocode.swift +++ b/TIEcommerce/Sources/Models/Promocode.swift @@ -22,5 +22,6 @@ import Foundation public protocol Promocode { - var discount: Price? { get } + var code: String { get } + var discount: Int? { get } } diff --git a/TIEcommerce/TIEcommerce.podspec b/TIEcommerce/TIEcommerce.podspec index becd7e54..0751e8f3 100644 --- a/TIEcommerce/TIEcommerce.podspec +++ b/TIEcommerce/TIEcommerce.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = 'TIEcommerce' - s.version = '1.25.0' + s.version = '1.27' s.summary = 'Cart, products, promocodes, bonuses, receipt and other related actions' s.homepage = 'https://github.com/TouchInstinct/LeadKit/tree/' + s.version.to_s + '/' + s.name s.license = { :type => 'MIT', :file => 'LICENSE' } diff --git a/TIFoundationUtils/TIFoundationUtils.podspec b/TIFoundationUtils/TIFoundationUtils.podspec index 810a7f45..96851218 100644 --- a/TIFoundationUtils/TIFoundationUtils.podspec +++ b/TIFoundationUtils/TIFoundationUtils.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = 'TIFoundationUtils' - s.version = '1.25.0' + s.version = '1.27' s.summary = 'Set of helpers for Foundation framework classes.' s.homepage = 'https://github.com/TouchInstinct/LeadKit/tree/' + s.version.to_s + '/' + s.name s.license = { :type => 'MIT', :file => 'LICENSE' } diff --git a/TIGoogleMapUtils/TIGoogleMapUtils.podspec b/TIGoogleMapUtils/TIGoogleMapUtils.podspec index 790c4dd8..7dcb60d5 100644 --- a/TIGoogleMapUtils/TIGoogleMapUtils.podspec +++ b/TIGoogleMapUtils/TIGoogleMapUtils.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = 'TIGoogleMapUtils' - s.version = '1.25.0' + s.version = '1.27' s.summary = 'Set of helpers for map objects clustering and interacting using Google Maps SDK.' s.homepage = 'https://github.com/TouchInstinct/LeadKit/tree/' + s.version.to_s + '/' + s.name s.license = { :type => 'MIT', :file => 'LICENSE' } diff --git a/TIKeychainUtils/TIKeychainUtils.podspec b/TIKeychainUtils/TIKeychainUtils.podspec index 39854a47..f6b2e1e9 100644 --- a/TIKeychainUtils/TIKeychainUtils.podspec +++ b/TIKeychainUtils/TIKeychainUtils.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = 'TIKeychainUtils' - s.version = '1.25.0' + s.version = '1.27' s.summary = 'Set of helpers for Keychain classes.' s.homepage = 'https://github.com/TouchInstinct/LeadKit/tree/' + s.version.to_s + '/' + s.name s.license = { :type => 'MIT', :file => 'LICENSE' } diff --git a/TIMapUtils/TIMapUtils.podspec b/TIMapUtils/TIMapUtils.podspec index a1a7209e..f9a311d0 100644 --- a/TIMapUtils/TIMapUtils.podspec +++ b/TIMapUtils/TIMapUtils.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = 'TIMapUtils' - s.version = '1.25.0' + s.version = '1.27' s.summary = 'Set of helpers for map objects clustering and interacting.' s.homepage = 'https://github.com/TouchInstinct/LeadKit/tree/' + s.version.to_s + '/' + s.name s.license = { :type => 'MIT', :file => 'LICENSE' } diff --git a/TIMoyaNetworking/TIMoyaNetworking.podspec b/TIMoyaNetworking/TIMoyaNetworking.podspec index dc0a75de..c33a5086 100644 --- a/TIMoyaNetworking/TIMoyaNetworking.podspec +++ b/TIMoyaNetworking/TIMoyaNetworking.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = 'TIMoyaNetworking' - s.version = '1.25.0' + s.version = '1.27' s.summary = 'Moya + Swagger network service.' s.homepage = 'https://github.com/TouchInstinct/LeadKit/tree/' + s.version.to_s + '/' + s.name s.license = { :type => 'MIT', :file => 'LICENSE' } diff --git a/TINetworking/TINetworking.podspec b/TINetworking/TINetworking.podspec index 21b43ccc..edeb8160 100644 --- a/TINetworking/TINetworking.podspec +++ b/TINetworking/TINetworking.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = 'TINetworking' - s.version = '1.25.0' + s.version = '1.27' s.summary = 'Swagger-frendly networking layer helpers.' s.homepage = 'https://github.com/TouchInstinct/LeadKit/tree/' + s.version.to_s + '/' + s.name s.license = { :type => 'MIT', :file => 'LICENSE' } diff --git a/TINetworkingCache/TINetworkingCache.podspec b/TINetworkingCache/TINetworkingCache.podspec index c6fa6d8c..010d4d98 100644 --- a/TINetworkingCache/TINetworkingCache.podspec +++ b/TINetworkingCache/TINetworkingCache.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = 'TINetworkingCache' - s.version = '1.25.0' + s.version = '1.27' s.summary = 'Caching results of EndpointRequests.' s.homepage = 'https://github.com/TouchInstinct/LeadKit/tree/' + s.version.to_s + '/' + s.name s.license = { :type => 'MIT', :file => 'LICENSE' } diff --git a/TIPagination/TIPagination.podspec b/TIPagination/TIPagination.podspec index 09bb506a..2e9a2946 100644 --- a/TIPagination/TIPagination.podspec +++ b/TIPagination/TIPagination.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = 'TIPagination' - s.version = '1.25.0' + s.version = '1.27' s.summary = 'Generic pagination component.' s.homepage = 'https://github.com/TouchInstinct/LeadKit/tree/' + s.version.to_s + '/' + s.name s.license = { :type => 'MIT', :file => 'LICENSE' } diff --git a/TISwiftUICore/TISwiftUICore.podspec b/TISwiftUICore/TISwiftUICore.podspec index ef648a77..b3a99ac9 100644 --- a/TISwiftUICore/TISwiftUICore.podspec +++ b/TISwiftUICore/TISwiftUICore.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = 'TISwiftUICore' - s.version = '1.25.0' + s.version = '1.27' s.summary = 'Core UI elements: protocols, views and helpers..' s.homepage = 'https://github.com/TouchInstinct/LeadKit/tree/' + s.version.to_s + '/' + s.name s.license = { :type => 'MIT', :file => 'LICENSE' } diff --git a/TISwiftUtils/TISwiftUtils.podspec b/TISwiftUtils/TISwiftUtils.podspec index 97617f0c..8fb7ae49 100644 --- a/TISwiftUtils/TISwiftUtils.podspec +++ b/TISwiftUtils/TISwiftUtils.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = 'TISwiftUtils' - s.version = '1.25.0' + s.version = '1.27' s.summary = 'Bunch of useful helpers for Swift development.' s.homepage = 'https://github.com/TouchInstinct/LeadKit/tree/' + s.version.to_s + '/' + s.name s.license = { :type => 'MIT', :file => 'LICENSE' } diff --git a/TITableKitUtils/TITableKitUtils.podspec b/TITableKitUtils/TITableKitUtils.podspec index ccc38b69..5266a9ab 100644 --- a/TITableKitUtils/TITableKitUtils.podspec +++ b/TITableKitUtils/TITableKitUtils.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = 'TITableKitUtils' - s.version = '1.25.0' + s.version = '1.27' s.summary = 'Set of helpers for TableKit classes.' s.homepage = 'https://github.com/TouchInstinct/LeadKit/tree/' + s.version.to_s + '/' + s.name s.license = { :type => 'MIT', :file => 'LICENSE' } diff --git a/TITransitions/TITransitions.podspec b/TITransitions/TITransitions.podspec index b8d87899..957d2b0a 100644 --- a/TITransitions/TITransitions.podspec +++ b/TITransitions/TITransitions.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = 'TITransitions' - s.version = '1.25.0' + s.version = '1.27' s.summary = 'Set of custom transitions to present controller. ' s.homepage = 'https://github.com/TouchInstinct/LeadKit/tree/' + s.version.to_s + '/' + s.name s.license = { :type => 'MIT', :file => 'LICENSE' } diff --git a/TIUIElements/TIUIElements.podspec b/TIUIElements/TIUIElements.podspec index cef0fd05..89988d44 100644 --- a/TIUIElements/TIUIElements.podspec +++ b/TIUIElements/TIUIElements.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = 'TIUIElements' - s.version = '1.25.0' + s.version = '1.27' s.summary = 'Bunch of useful protocols and views.' s.homepage = 'https://github.com/TouchInstinct/LeadKit/tree/' + s.version.to_s + '/' + s.name s.license = { :type => 'MIT', :file => 'LICENSE' } diff --git a/TIUIKitCore/TIUIKitCore.podspec b/TIUIKitCore/TIUIKitCore.podspec index 89449881..e944c129 100644 --- a/TIUIKitCore/TIUIKitCore.podspec +++ b/TIUIKitCore/TIUIKitCore.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = 'TIUIKitCore' - s.version = '1.25.0' + s.version = '1.27' s.summary = 'Core UI elements: protocols, views and helpers.' s.homepage = 'https://github.com/TouchInstinct/LeadKit/tree/' + s.version.to_s + '/' + s.name s.license = { :type => 'MIT', :file => 'LICENSE' } diff --git a/TIYandexMapUtils/TIYandexMapUtils.podspec b/TIYandexMapUtils/TIYandexMapUtils.podspec index bff21073..41926ac0 100644 --- a/TIYandexMapUtils/TIYandexMapUtils.podspec +++ b/TIYandexMapUtils/TIYandexMapUtils.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = 'TIYandexMapUtils' - s.version = '1.25.0' + s.version = '1.27' s.summary = 'Set of helpers for map objects clustering and interacting using Yandex Maps SDK.' s.homepage = 'https://github.com/TouchInstinct/LeadKit/tree/' + s.version.to_s + '/' + s.name s.license = { :type => 'MIT', :file => 'LICENSE' }