ProfileCoreDataStore

public class ProfileCoreDataStore : ProfileDataStore, CoreDataCrudable

Store for fetching, creating, updating or deleting Profiles on the provided CoreDataController [REQ:BSI-eRp-ePA:O.Source_2#4] CoreDataStore adapter for Profiles

  • Initialize a Profile Core Data Store

    Declaration

    Swift

    public init(
        coreDataControllerFactory: CoreDataControllerFactory,
        foregroundQueue: AnySchedulerOf<DispatchQueue> = AnyScheduler.main,
        backgroundQueue: AnySchedulerOf<DispatchQueue> = DispatchQueue(label: "profile-queue", qos: .userInitiated)
            .eraseToAnyScheduler(),
        dateProvider: @escaping () -> Date = { Date() }
    )

    Parameters

    coreDataControllerFactory

    Factory that is capable of providing a CoreDataController

    foregroundQueue

    read queue, remember never to access the read NSManagedObjects properties/relations on any other queue (Default: DispatchQueue.main)

    backgroundQueue

    write queue (Default: DispatchQueue(label: “profile-queue”, qos: .userInitiated))

  • Declaration

    Swift

    public func fetchProfile(by identifier: Profile.ID)
        -> AnyPublisher<Profile?, LocalStoreError>
  • Declaration

    Swift

    public func hasProfile() throws -> Bool
  • Declaration

    Swift

    public func createProfile(with name: String) throws -> Profile
  • Declaration

    Swift

    public func listAllProfiles() -> AnyPublisher<[Profile], LocalStoreError>
  • Declaration

    Swift

    public func save(profiles: [Profile]) -> AnyPublisher<Bool, LocalStoreError>
  • Declaration

    Swift

    public func update(
        profileId: UUID,
        mutating: @escaping (inout Profile) -> Void
    ) -> AnyPublisher<Bool, LocalStoreError>
  • Declaration

    Swift

    public func delete(profiles: [Profile]) -> AnyPublisher<Bool, LocalStoreError>
  • Declaration

    Swift

    public enum Error : Swift.Error