Merge pull request #5848 from jsangmeister/adjust-ds-interface

Adjust datastore interface
This commit is contained in:
Finn Stutzenstein 2021-02-04 13:49:41 +01:00 committed by GitHub
commit f41349f038
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -53,6 +53,9 @@ Interface ModelLockedData {
/** /**
* Writes Events into the datastore. * Writes Events into the datastore.
* If multiple WriteRequests are given, they are fully executed one-by-one, meaning
* if a earlier event invalidates the locked_field of a later WriteRequest, an
* exception is thrown.
* Url: POST to /internal/datastore/writer/write * Url: POST to /internal/datastore/writer/write
* *
* @throws ModelDoesNotExist * @throws ModelDoesNotExist
@ -61,7 +64,7 @@ Interface ModelLockedData {
* @throws InvalidFormat * @throws InvalidFormat
* @throws ModelNotDeleted * @throws ModelNotDeleted
*/ */
write(request: WriteRequest): void publishes ModifiedFieldsEvent write(request: WriteRequest | WriteRequest[]): void publishes ModifiedFieldsEvent
Interface WriteRequest { Interface WriteRequest {
events: (CreateEvent | RestoreEvent | UpdateEvent | DeleteEvent)[]; events: (CreateEvent | RestoreEvent | UpdateEvent | DeleteEvent)[];