diff --git a/src/Dto/FinishTermDto.php b/src/Dto/FinishTermDto.php index 7f9ba4a..a82c4fa 100644 --- a/src/Dto/FinishTermDto.php +++ b/src/Dto/FinishTermDto.php @@ -5,7 +5,7 @@ class FinishTermDto extends BaseDto { protected string $term; - protected ?string $finishedAt; + protected ?string $finishedAt = null; protected function setTerm(string $term): void { diff --git a/src/Http/Resources/ConsultationTermsResource.php b/src/Http/Resources/ConsultationTermsResource.php index 90e890a..0443062 100644 --- a/src/Http/Resources/ConsultationTermsResource.php +++ b/src/Http/Resources/ConsultationTermsResource.php @@ -65,6 +65,17 @@ class ConsultationTermsResource extends JsonResource * ), * ), * ), + * @OA\Property( + * property="finished_at", + * description="consultation term finished date", + * type="datetime", + * example="2022-04-15T04:00:00.000Z", + * ), + * @OA\Property( + * property="consultation_id", + * description="consultation ID", + * type="int", + * ), * ) * */ @@ -96,6 +107,7 @@ public function toArray($request) 'busy_terms' => ConsultationTermResource::collection($consultationServiceContract->getBusyTermsFormatDate($this->resource->consultation_id)), 'author' => $this->resource->author ? ConsultationAuthorResource::make($this->resource->author) : null, 'finished_at' => $this->resource->finished_at, + 'consultation_id' => $this->resource->consultation_id, ]; return self::apply($fields, $this); } diff --git a/src/Http/Resources/ConsultationUserTermsResource.php b/src/Http/Resources/ConsultationUserTermsResource.php index 433879c..2c8b7fc 100644 --- a/src/Http/Resources/ConsultationUserTermsResource.php +++ b/src/Http/Resources/ConsultationUserTermsResource.php @@ -65,6 +65,17 @@ class ConsultationUserTermsResource extends JsonResource * ), * ), * ), + * @OA\Property( + * property="finished_at", + * description="consultation term finished date", + * type="datetime", + * example="2022-04-15T04:00:00.000Z", + * ), + * @OA\Property( + * property="consultation_id", + * description="consultation ID", + * type="int", + * ), * ) * */ @@ -100,6 +111,7 @@ public function toArray($request) 'busy_terms' => ConsultationTermResource::collection($consultationServiceContract->getBusyTermsFormatDate($consultation->getKey())), 'author' => $consultation->author ? ConsultationAuthorResource::make($consultation->author) : null, 'finished_at' => $this->resource->finished_at, + 'consultation_id' => $consultation->getKey(), ]; return self::apply($fields, $this); }