Files
raspberry/iOS/Wallet/Sources/Inheritance/Service/InheritanceServiceInformation.swift
2022-05-27 20:21:01 +03:00

39 lines
1.0 KiB
Swift

//
// InheritanceServiceInformation.swift
// PayCash
//
// Created by Igor on 11.03.2021.
// Copyright © 2021 AM. All rights reserved.
//
import Foundation
extension Inheritance.Service {
class Information: Common.Service.Provider {
var contract = Contract.cash
private(set) var object: Model?
}
}
extension Inheritance.Service.Information {
func fetch(completion: @escaping () -> Void) {
Network.table.fetch(
code: Network.servers.current.contract(contract),
table: "inheritance",
scope: Network.servers.current.contract(contract),
limit: 1,
lowerBound: Accounts().current?.username,
upperBound: Accounts().current?.username,
type: Inheritance.Model.Information.self
) { (collection) in
self.object = collection.first
completion()
}
}
}
extension Inheritance.Service.Information {
typealias Contract = Network.Model.Contract
typealias Model = Inheritance.Model.Information
}