audit log

This commit is contained in:
Yuri Kuznetsov
2024-02-08 15:53:01 +02:00
parent 2681acebc6
commit 246ece8e3d
13 changed files with 504 additions and 7 deletions
+38
View File
@@ -115,6 +115,30 @@ class Stream
];
}
/**
* @throws BadRequest
* @throws Forbidden
* @throws NotFound
*/
public function getActionListUpdates(Request $request): stdClass
{
$id = $request->getRouteParam('id');
$scope = $request->getRouteParam('scope');
if ($scope === null || $id === null) {
throw new BadRequest();
}
$searchParams = $this->fetchSearchParams($request);
$result = $this->service->findUpdates($scope, $id, $searchParams);
return (object) [
'total' => $result->getTotal(),
'list' => $result->getValueMapList(),
];
}
/**
* @throws BadRequest
* @throws Forbidden
@@ -146,6 +170,20 @@ class Stream
$searchParams = $searchParams->withBoolFilterAdded('skipOwn');
}
$beforeNumber = $request->getQueryParam('beforeNumber');
if ($beforeNumber) {
$searchParams = $searchParams
->withWhereAdded(
WhereItem
::createBuilder()
->setAttribute('number')
->setType(WhereItem\Type::LESS_THAN)
->setValue($beforeNumber)
->build()
);
}
return $searchParams;
}
}