/**
* @subject com.test.action.test
*/
public function testSubject(IncomingRequest $request)
{
...
$request->acknowledge();
}
/**
* @subject com.test.action.test
*/
public function testSubject(IncomingRequest $request, GetUserById $payload)
{
$user = $this->userRepository->getById($payload->userId)';
...
$request->sendResponse($userPayload);
}
//config/serializer.php
'mapping' => [
Domain\User\Entities\User::class => [
'to' => Payloads\User::class,
'attributes' => [
'id' => ['type' => 'string'],
'username' => ['type' => 'string'],
'email' => ['type' => 'string'],
'createdAt' => ['type' => \Carbon\Carbon::class]
]
],
Domain\Model\Entities\Model::class => [
'to' => Payloads\Model::class,
'extends' => Domain\User\Entities\User::class, // Here we extend attributes from User
'attributes' => [
'studio' => ['type' => Domain\Model\Entities\Model::class,]
]
],
],