Skip to content

Commit

Permalink
Merge branch 'main' into fix-decimal-edge-case
Browse files Browse the repository at this point in the history
  • Loading branch information
razvancapra committed Jan 30, 2025
2 parents a6f07f8 + f7aae12 commit 071e663
Show file tree
Hide file tree
Showing 14 changed files with 44 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ on:
jobs:
prepare-frameworks:
name: Create Release
runs-on: macos-14
runs-on: macos-15
steps:
- uses: maxim-lobanov/[email protected]
with:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ protocol EditLineItemViewModelDelegate: AnyObject {
final class EditLineItemViewModel {
weak var delegate: EditLineItemViewModelDelegate?
private var lineItem: DigitalInvoice.LineItem
private (set) var itemsChanged: [GiniLineItemAnalytics] = []
private(set) var itemsChanged: [GiniLineItemAnalytics] = []

var name: String? {
return lineItem.name
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ final class SkontoDocumentPagesViewModel: DocumentPagesViewModelProtocol {
private var expiryDate: Date

// Information to be displayed in the screen after highlighting Skonto details
private (set) var processedImages = [UIImage]()
private(set) var processedImages = [UIImage]()
static var screenTitle = NSLocalizedStringPreferredGiniBankFormat("ginibank.skonto.document.pages.screen.title",
comment: "Skonto discount details")
var bottomInfoItems: [String] {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,21 +26,21 @@ class SkontoViewModel {
var proceedAction: (() -> Void)?

private let skontoDiscounts: SkontoDiscounts
private (set) var isWithDiscountSwitchAvailable: Bool
private(set) var isWithDiscountSwitchAvailable: Bool
private var skontoPercentage: Double

private (set) var isSkontoApplied: Bool = true
private (set) var amountToPay: Price
private (set) var skontoAmountToPay: Price
private(set) var isSkontoApplied: Bool = true
private(set) var amountToPay: Price
private(set) var skontoAmountToPay: Price

private (set) var dueDate: Date
private (set) var amountDiscounted: Price
private (set) var currencyCode: String
private (set) var remainingDays: Int
private (set) var paymentMethod: SkontoDiscountDetails.PaymentMethod
private (set) var edgeCase: SkontoEdgeCase?
private(set) var dueDate: Date
private(set) var amountDiscounted: Price
private(set) var currencyCode: String
private(set) var remainingDays: Int
private(set) var paymentMethod: SkontoDiscountDetails.PaymentMethod
private(set) var edgeCase: SkontoEdgeCase?

private (set) var documentPagesViewModel: SkontoDocumentPagesViewModel?
private(set) var documentPagesViewModel: SkontoDocumentPagesViewModel?

private var maximumAmountToPayValue: Decimal = 99999.99

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class TransactionDocsItemView: UIView {

private let configuration = GiniBankConfiguration.shared

private (set) var transactionDocsItem: TransactionDoc?
private(set) var transactionDocsItem: TransactionDoc?

var optionsAction: (() -> Void)?

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -198,19 +198,26 @@ public final class DocumentPickerCoordinator: NSObject {
/// A UIDocumentPickerViewController that sets navigation bar buttons' tint color to a correct one, instead of using the accent color specified by app
private class GiniDocumentPickerViewController: UIDocumentPickerViewController {
var initialTintColor: UIColor? = navBarInstance.tintColor
var initialButtonTintColor: UIColor? = barButtonInstance.tintColor

override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
Self.navBarInstance.tintColor = .GiniCapture.accent1
Self.barButtonInstance.tintColor = .GiniCapture.accent1
}
override func viewDidDisappear(_ animated: Bool) {
super.viewDidDisappear(animated)
// make sure to revert the tint color, otherwise it will affect document pickers/browsers from the host app
Self.navBarInstance.tintColor = initialTintColor
Self.navBarInstance.tintColor = initialTintColor ?? UINavigationBar.appearance().tintColor
Self.barButtonInstance.tintColor = initialButtonTintColor ?? UIBarButtonItem.appearance().tintColor
}
static var navBarInstance: UINavigationBar {
UINavigationBar.appearance(whenContainedInInstancesOf: [UIDocumentBrowserViewController.self])
}

static var barButtonInstance: UIBarButtonItem {
UIBarButtonItem.appearance(whenContainedInInstancesOf: [UIDocumentBrowserViewController.self])
}
}

fileprivate extension DocumentPickerCoordinator {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ final class HelpFormatsViewController: UIViewController, HelpBottomBarEnabledVie
tableView.translatesAutoresizingMaskIntoConstraints = false
return tableView
}()
private (set) var dataSource: HelpFormatsDataSource
private(set) var dataSource: HelpFormatsDataSource
private var giniConfiguration: GiniConfiguration
private let tableRowHeight: CGFloat = 44
private let sectionHeight: CGFloat = 70
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ protocol HelpMenuViewControllerDelegate: AnyObject {
final class HelpMenuViewController: UIViewController, HelpBottomBarEnabledViewController {

weak var delegate: HelpMenuViewControllerDelegate?
private (set) var dataSource: HelpMenuDataSource
private(set) var dataSource: HelpMenuDataSource
private let giniConfiguration: GiniConfiguration
private let tableRowHeight: CGFloat = 44
var navigationBarBottomAdapter: HelpBottomNavigationBarAdapter?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ final class HelpTipsViewController: UIViewController, HelpBottomBarEnabledViewCo
tableView.translatesAutoresizingMaskIntoConstraints = false
return tableView
}()
private (set) var dataSource: HelpTipsDataSource
private(set) var dataSource: HelpTipsDataSource
private var giniConfiguration: GiniConfiguration
private let tableRowHeight: CGFloat = 76

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ final class BottomButtonsViewModel {

init(retakeBlock: (() -> Void)? = nil,
manuallyPressed: (() -> Void)? = nil,
cancelPressed: @escaping(() -> Void)) {
cancelPressed: @escaping (() -> Void)) {
self.retakePressed = retakeBlock
self.enterManuallyPressed = manuallyPressed
self.cancelPressed = cancelPressed
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ final class NoResultScreenViewController: UIViewController {
}
fatalError("No result header not found")
}()
private (set) var dataSource: HelpDataSource
private(set) var dataSource: HelpDataSource
private var giniConfiguration: GiniConfiguration
private let type: NoResultType
private let viewModel: BottomButtonsViewModel
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ class OnboardingDataSource: NSObject, BaseCollectionViewDataSource {

weak var delegate: OnboardingScreen?
var isProgrammaticScroll = false

private let giniConfiguration: GiniConfiguration
private (set) var currentPageIndex = 0
private(set) var currentPageIndex = 0
private var isInitialScroll = true

lazy var pageModels: [OnboardingPageModel] = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class OnboardingViewController: UIViewController {
@IBOutlet weak var pagesCollection: UICollectionView!
@IBOutlet weak var pageControl: UIPageControl!
@IBOutlet weak var nextButton: MultilineTitleButton!
private (set) var dataSource: OnboardingDataSource
private(set) var dataSource: OnboardingDataSource
private let configuration = GiniConfiguration.shared
private var navigationBarBottomAdapter: OnboardingNavigationBarBottomAdapter?
private var bottomNavigationBar: UIView?
Expand Down
13 changes: 13 additions & 0 deletions HealthSDK/GiniHealthSDK/Documentation/source/Integration.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,19 @@ dispatchGroup.notify(queue: .main) {
}
```

## Check if the document contains multiple invoices

GiniHealth provides a method to check whether a document contains multiple invoices:

```swift
healthSDK.checkIfDocumentContainsMultipleInvoices(docId: String, completion: @escaping (Result<Bool, GiniHealthError>) -> Void)
```

The method returns `true` in the success case if the `contains_multiple_docs` field was extracted and its value is `true`.

> - Recommendation: Use this check in a specific order. First, call the `checkIfDocumentIsPayable` method, and then call `checkIfDocumentContainsMultipleInvoices` method.

## Integrate the Payment flow

We provide a custom payment flow for the users to pay the invoice/document/digital payment .
Expand Down

0 comments on commit 071e663

Please sign in to comment.