Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions src/Controller/Attendee/UpdateController.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,18 @@ public function __construct(
}

/**
* @OA\Put(tags={"Attendee"})
* @OA\Put(
* tags={"Attendee"},
* deprecated=true,
* description="This endpoint is deprecated, please don't rely on it anymore."
* )
*/
public function __invoke(Request $request, Attendee $attendee, UpdateAttendeeModel $updateAttendeeModel)
{
$this->attendeeUpdater->update($attendee, $updateAttendeeModel);

return new Response(null, Response::HTTP_NO_CONTENT);
return new Response(null, Response::HTTP_NO_CONTENT, [
'Sunset' => (new \DateTime())->modify('+ 1 year')->format(DATE_RFC7231), // HTTP Date by RFC 7231
]);
}
}
14 changes: 14 additions & 0 deletions src/Domain/Model/CreateAttendeeModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,31 @@

namespace App\Domain\Model;

use OpenApi\Annotations\Property;
use Symfony\Component\Validator\Constraints\Email;
use Symfony\Component\Validator\Constraints\NotBlank;

final class CreateAttendeeModel
{
// be aware that deprecating properties means you still need to support both ways of creating attendees

/**
* @Property(deprecated=true, description="Property firstname is deprecated, use property name instead.")
*/
//#[NotBlank(allowNull: true)]
#[NotBlank]
public string $firstname;

/**
* @Property(deprecated=true, description="Property lastname is deprecated, use property name instead.")
*/
//#[NotBlank(allowNull: true)]
#[NotBlank]
public string $lastname;

#[NotBlank(allowNull: true)]
public string $name;

#[NotBlank]
#[Email]
public string $email;
Expand Down