MNFAccount

Objective-C

@interface MNFAccount : MNFObject

Swift

class MNFAccount : MNFObject

The MNFAccount class encapsulates account json data from the Meniga PFM server in an object.

An account should not be directly initialized but instead should be constructed with data from the server. The response from the server will be automatically converted to an MNFAccount object.

An account has two mutable properties which can be changed. If you change said properties you should remember to save the account so your changes will be saved on the server. If you do not save your changes they may be overwritten if you update the account with server data. A boolean property ‘isDirty’ keeps track of unsaved changes, which can then be reverted.

Immutable properties

  • @abstract The bank identifier of an account.

    @discussion This value is an identifier for the account set by the originating bank. This identifier is used when getting account statements.

    Declaration

    Objective-C

    @property (nonatomic, copy, readonly) NSString *_Nonnull accountIdentifier;

    Swift

    var accountIdentifier: String { get }
  • @abstract The realm identifier of an account.

    Declaration

    Objective-C

    @property (nonatomic, copy, readonly) NSString *_Nonnull realmIdentifier;

    Swift

    var realmIdentifier: String { get }
  • @abstract The account type identifier of an account.

    @discussion This value is an identifier for the type (savings, checking, etc.) of an account.

    Declaration

    Objective-C

    @property (nonatomic, strong, readonly) NSNumber *_Nonnull accountTypeId;

    Swift

    var accountTypeId: NSNumber { get }
  • @abstract The balance of an account.

    Declaration

    Objective-C

    @property (nonatomic, strong, readonly) NSNumber *_Nonnull balance;

    Swift

    var balance: NSNumber { get }
  • The balance of an account in the users currency.

    Declaration

    Objective-C

    @property (nonatomic, strong, readonly) NSNumber *_Nonnull balanceInUserCurrency;

    Swift

    var balanceInUserCurrency: NSNumber { get }
  • @abstract The currency code of the account. Expressed in a ISO 4217 string.

    Declaration

    Objective-C

    @property (nonatomic, strong, readonly) NSString *_Nonnull currencyCode;

    Swift

    var currencyCode: String { get }
  • @abstract The limit or overdraft of an account.

    Declaration

    Objective-C

    @property (nonatomic, strong, readonly) NSNumber *_Nonnull limit;

    Swift

    var limit: NSNumber { get }
  • The limit or overdraft of an account in the users currency.

    Declaration

    Objective-C

    @property (nonatomic, strong, readonly) NSNumber *_Nonnull limitInUserCurrency;

    Swift

    var limitInUserCurrency: NSNumber { get }
  • @abstract The account class of an account.

    @description This value is for example used for displaying an image for an account in CSS.

    Declaration

    Objective-C

    @property (nonatomic, copy, readonly) NSString *_Nonnull accountClass;

    Swift

    var accountClass: String { get }
  • @abstract The organization name of an account.

    Declaration

    Objective-C

    @property (nonatomic, copy, readonly) NSString *_Nonnull organizationName;

    Swift

    var organizationName: String { get }
  • @abstract The organization identifier for an account.

    @discussion This value is a code that identifies the organization associated with this account globally, such as Swift code.

    Declaration

    Objective-C

    @property (nonatomic, copy, readonly) NSString *_Nonnull organizationIdentifier;

    Swift

    var organizationIdentifier: String { get }
  • @abstract The realm credentials identifier for an account.

    @discussion This value is an identifier for an online bank user that owns the account.

    Declaration

    Objective-C

    @property (nonatomic, strong, readonly, nullable) NSNumber *realmCredentialsId;

    Swift

    var realmCredentialsId: NSNumber? { get }
  • @abstract The account authorization type for an account.

    @discussion This value indicates the type of account authorization during account aggregation.

    Declaration

    Objective-C

    @property (nonatomic, copy, readonly) NSString *_Nonnull accountAuthorizationType;

    Swift

    var accountAuthorizationType: String { get }
  • @abstract Whether an account issues transactions to be imported manually or not.

    Declaration

    Objective-C

    @property (nonatomic, strong, readonly) NSNumber *_Nonnull isImportAccount;

    Swift

    var isImportAccount: NSNumber { get }
  • @abstract The last update time of an account.

    @discussion This value indicates when the account was last updated on the server.

    Declaration

    Objective-C

    @property (nonatomic, strong, readonly, nullable) NSDate *lastUpdate;

    Swift

    var lastUpdate: Date? { get }
  • @abstract The identifier of the person who owns the account.

    Declaration

    Objective-C

    @property (nonatomic, strong, readonly, nullable) NSNumber *personId;

    Swift

    var personId: NSNumber? { get }
  • @abstract The email of the person who owns the account.

    Declaration

    Objective-C

    @property (nonatomic, copy, readonly) NSString *_Nonnull userEmail;

    Swift

    var userEmail: String { get }
  • @abstract The time the account was created.

    Declaration

    Objective-C

    @property (nonatomic, strong, readonly, nullable) NSDate *createDate;

    Swift

    var createDate: Date? { get }
  • @abstract The category of the account.

    @discussion Indicates if the account is a checking, savings or credit account.

    Declaration

    Objective-C

    @property (nonatomic, copy, readonly) NSString *_Nonnull accountCategory;

    Swift

    var accountCategory: String { get }
  • @abstract Whether the account is inactive.

    Declaration

    Objective-C

    @property (nonatomic, strong, readonly) NSNumber *_Nonnull inactive;

    Swift

    var inactive: NSNumber { get }
  • @abstract The time when the user added this account to the PFM database.

    Declaration

    Objective-C

    @property (nonatomic, strong, readonly, nullable) NSDate *attachedToUserDate;

    Swift

    var attachedToUserDate: Date? { get }
  • @abstract Whether automatic synchronization is paused for the account

    Declaration

    Objective-C

    @property (nonatomic, strong, readonly) NSNumber *_Nonnull synchronizationIsPaused;

    Swift

    var synchronizationIsPaused: NSNumber { get }
  • @abstract Whether the account is used for budget calculations.

    Declaration

    Objective-C

    @property (nonatomic, strong, readonly) NSNumber *_Nonnull hasInactiveBudget;

    Swift

    var hasInactiveBudget: NSNumber { get }
  • @abstract Whether transactions from the account are not used in the transaction list.

    Declaration

    Objective-C

    @property (nonatomic, strong, readonly) NSNumber *_Nonnull hasInactiveTransactions;

    Swift

    var hasInactiveTransactions: NSNumber { get }
  • @abstract The custom meta data of the account.

    Declaration

    Objective-C

    @property (nonatomic, copy, readonly) NSArray<NSDictionary *> *_Nonnull metadata;

    Swift

    var metadata: [[AnyHashable : Any]] { get }
  • The account role external.

    Declaration

    Objective-C

    @property (nonatomic, copy, readonly) NSString *_Nonnull accountRoleExternal;

    Swift

    var accountRoleExternal: String { get }
  • The account status external.

    Declaration

    Objective-C

    @property (nonatomic, copy, readonly) NSString *_Nonnull accountStatusExternal;

    Swift

    var accountStatusExternal: String { get }

Mutable properties

  • @abstract The name of the account.

    @discussion The name can be set by the user or the originating bank.

    Declaration

    Objective-C

    @property (nonatomic, copy) NSString *_Nonnull name;

    Swift

    var name: String { get set }
  • @abstract The order identifier for an account.

    @discussion Accounts are ordered in ascending order by this order key.

    Declaration

    Objective-C

    @property (nonatomic, strong) NSNumber *_Nonnull orderId;

    Swift

    var orderId: NSNumber { get set }
  • @abstract Whether the account should be hidden in overview.

    Declaration

    Objective-C

    @property (nonatomic, strong) NSNumber *_Nonnull isHidden;

    Swift

    var isHidden: NSNumber { get set }
  • @abstract Whether the account is excluded from all calculations.

    Declaration

    Objective-C

    @property (nonatomic, strong, nullable) NSNumber *isDisabled;

    Swift

    var isDisabled: NSNumber? { get set }
  • @abstract The emergency fund balance limit of the account.

    Declaration

    Objective-C

    @property (nonatomic, strong, nullable) NSNumber *emergencyFundBalanceLimit;

    Swift

    var emergencyFundBalanceLimit: NSNumber? { get set }

Fetching

  • @abstract Fetches an object with a given identifier from the server.

    Declaration

    Objective-C

    + (nonnull MNFJob *)fetchWithId:(nonnull NSNumber *)identifier
                         completion:
                             (nullable MNFAccountCompletionHandler)completion;

    Swift

    class func fetch(withId identifier: NSNumber, completion: MNFAccountCompletionHandler? = nil) -> MNFJob

    Parameters

    identifier

    The server identifier for the account.

    completion

    A completion block returns an instance of MNFAccount and an error.

    Return Value

    MNFJob A job containing a result, metadata and error.

  • @abstract Fetches all accounts for the user.

    Declaration

    Objective-C

    + (nonnull MNFJob *)
        fetchAccountsWithFilter:(nullable MNFAccountFilter *)filter
                     completion:
                         (nullable MNFMultipleAccountsCompletionHandler)completion;

    Swift

    class func fetchAccounts(with filter: MNFAccountFilter?, completion: MNFMultipleAccountsCompletionHandler? = nil) -> MNFJob

    Parameters

    completion

    A completion block returns an array of MNFAccount instances and an error.

    Return Value

    MNFJob A job containing an array of MNFAccount instances or an error.

Saving

  • @abstract Saves changes to the account to the server.

    Declaration

    Objective-C

    - (nonnull MNFJob *)saveWithCompletion:
        (nullable MNFErrorOnlyCompletionHandler)completion;

    Swift

    func save(completion: MNFErrorOnlyCompletionHandler? = nil) -> MNFJob

    Parameters

    completion

    A completion block returns a result and an error.

    Return Value

    MNFJob A job containing a result and an error.

Refreshing

  • @abstract Refreshes the account with data from the server.

    Declaration

    Objective-C

    - (nonnull MNFJob *)refreshWithCompletion:
        (nullable MNFErrorOnlyCompletionHandler)completion;

    Swift

    func refresh(completion: MNFErrorOnlyCompletionHandler? = nil) -> MNFJob

    Parameters

    completion

    A completion block returns an error.

    Return Value

    MNFJob A job containing an error.

Deleting

  • @abstract Deletes the account from the PFM server.

    Declaration

    Objective-C

    - (nonnull MNFJob *)deleteAccountWithCompletion:
        (nullable MNFErrorOnlyCompletionHandler)completion;

    Swift

    func delete(completion: MNFErrorOnlyCompletionHandler? = nil) -> MNFJob

    Parameters

    completion

    A completion block returns a result and an error. The result will always be nil.

    Return Value

    MNFJob A job containing a result or an error. The result will always be nil.

Account types

  • @abstract Fetches a list of all available account types.

    Declaration

    Objective-C

    + (nonnull MNFJob *)fetchAccountCategoriesWithCompletion:
        (nullable MNFMultipleAccountCategoriesCompletionHandler)completion;

    Swift

    class func fetchCategories(completion: MNFMultipleAccountCategoriesCompletionHandler? = nil) -> MNFJob

    Parameters

    completion

    A completion block returns an array of account category types and an error.

    Return Value

    MNFJob A job containing an array of account types or an error.

  • @abstract Fetches a list of all available account authorization types.

    Declaration

    Objective-C

    + (nonnull MNFJob *)fetchAccountAuthorizationTypesWithCompletion:
        (nullable MNFMultipleAccountAuthorizationTypesCompletionHandler)completion;

    Swift

    class func fetchAuthorizationTypes(completion: MNFMultipleAccountAuthorizationTypesCompletionHandler? = nil) -> MNFJob

    Parameters

    completion

    A completion block returns an array of account authorization types and an error.

    Return Value

    MNFJob A job containing an array of account authorization types or an error.

  • Deprecated

    Please use fetch method in MNFAccountType.h instead.

    @abstract Fetches a list of all realm account types.

    Declaration

    Objective-C

    + (nonnull MNFJob *)fetchAccountTypesWithCompletion:
        (nullable MNFMultipleAccountTypesCompletionHandler)completion;

    Swift

    class func fetchTypes(completion: MNFMultipleAccountTypesCompletionHandler? = nil) -> MNFJob

    Parameters

    completion

    A completion block returning a list of realm account types and an error.

    Return Value

    An MNFJob containing a list of realm account types and an error.

Metadata

  • @abstract Fetches account metadata for the account.

    Declaration

    Objective-C

    - (nonnull MNFJob *)fetchMetadataWithCompletion:
        (nullable MNFMultipleMetadataCompletionHandlers)completion;

    Swift

    func fetchMetadata(completion: MNFMultipleMetadataCompletionHandlers? = nil) -> MNFJob

    Parameters

    completion

    A completion block returning a list of NSDictionary of metadata and an error.

    Return Value

    An MNFJob containing a list of NSdictionary of metadata and an error.

  • @abstract Fetches account metadata for the account.

    Declaration

    Objective-C

    - (nonnull MNFJob *)
        fetchMetadataForKey:(nonnull NSString *)key
             withCompletion:(nullable MNFMetadataValueCompletionHandler)completion;

    Swift

    func fetchMetadata(forKey key: String, withCompletion completion: MNFMetadataValueCompletionHandler? = nil) -> MNFJob

    Parameters

    completion

    A completion block returning a list of NSDictionary of metadata and an error.

    Return Value

    An MNFJob containing a list of NSdictionary of metadata and an error.

  • @abstract Creates or updates metadata for the defined key.

    Declaration

    Objective-C

    - (nonnull MNFJob *)setMetadataValue:(nonnull NSString *)value
                                  forKey:(nonnull NSString<NSCopying> *)aKey
                              completion:(nullable MNFErrorOnlyCompletionHandler)
                                             completion;

    Swift

    func setMetadataValue(_ value: String, forKey aKey: String, completion: MNFErrorOnlyCompletionHandler? = nil) -> MNFJob

    Parameters

    value

    The value of the metadata.

    aKey

    The key of the metadata.

    completion

    A completion block returning an error.

    Return Value

    MNFJob A job containing an NSNumber with a boolean true or an error.

  • @abstract Fetches account balance history entries.

    Declaration

    Objective-C

    - (nonnull MNFJob *)
        fetchHistoryFromDate:(nonnull NSDate *)fromDate
                      toDate:(nonnull NSDate *)toDate
                      sortBy:(nullable NSString *)sortBy
                   ascending:(BOOL)ascending
                  completion:(nullable MNFMultipleAccountHistoryCompletionHandler)
                                 completion;

    Swift

    func fetchHistory(from fromDate: Date, to toDate: Date, sortBy: String?, ascending: Bool, completion: MNFMultipleAccountHistoryCompletionHandler? = nil) -> MNFJob

    Parameters

    fromDate

    The date from which to fetch.

    toDate

    The date to which to fetch.

    sortBy

    A sort descriptor to order results from either balance date or balance. The only accepted descriptors are @“Balance” and @“BalanceDate”. Any other descriptor will return an error. The default behavior is sort by balance date.

    ascending

    Whether to sort the result in ascending or descending order.

    completion

    A completion block returning a list of balance history entries and an error.

    Return Value

    An MNFJob containing a list of balance history entries and an error.