Skip to content

Commit

Permalink
Merge pull request #117 from EscolaLMS/feature/REK-38
Browse files Browse the repository at this point in the history
Added consultation_id to resource
  • Loading branch information
daVitekPL authored Nov 8, 2024
2 parents b20ee20 + 20dbfba commit 5b08230
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/Dto/FinishTermDto.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
class FinishTermDto extends BaseDto
{
protected string $term;
protected ?string $finishedAt;
protected ?string $finishedAt = null;

protected function setTerm(string $term): void
{
Expand Down
12 changes: 12 additions & 0 deletions src/Http/Resources/ConsultationTermsResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -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",
* ),
* )
*
*/
Expand Down Expand Up @@ -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);
}
Expand Down
12 changes: 12 additions & 0 deletions src/Http/Resources/ConsultationUserTermsResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -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",
* ),
* )
*
*/
Expand Down Expand Up @@ -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);
}
Expand Down

0 comments on commit 5b08230

Please sign in to comment.