update

abstract suspend fun update(obj: BusinessObject): Either<StoreError, BusinessObject>

Updates the BusinessObject with the given id and replaces it in this BusinessObjectStore if it exists.

Return

The updated BusinessObject if it was successfully updated

A RecordNotFoundError if the BusinessObject does not exist in this EventStore

A StoreError if the BusinessObject could not be updated

Parameters

obj

The BusinessObject to update. The obj.id must match the id of the BusinessObject to update.


open suspend fun update(obj: Collection<BusinessObject>): EitherNel<StoreError, List<BusinessObject>>