Skip to content

Commit

Permalink
Merge pull request #147 from wri/feat/TM-741-workdays-be
Browse files Browse the repository at this point in the history
[TM-741] Turns Workdays into a BE concern
  • Loading branch information
roguenet authored Apr 17, 2024
2 parents be521e9 + 8292b99 commit 1c39e14
Show file tree
Hide file tree
Showing 16 changed files with 4 additions and 548 deletions.
19 changes: 0 additions & 19 deletions app/Http/Controllers/V2/Workdays/DeleteWorkdayController.php

This file was deleted.

61 changes: 0 additions & 61 deletions app/Http/Controllers/V2/Workdays/StoreWorkdayController.php

This file was deleted.

20 changes: 0 additions & 20 deletions app/Http/Controllers/V2/Workdays/UpdateWorkdayController.php

This file was deleted.

7 changes: 4 additions & 3 deletions app/Models/Traits/UsesLinkedFields.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,8 @@ public function updateFromForm(array $formData): void
} else {
$property = data_get($relationsConfig, "$question->linked_field_key.property");
if (! empty($property)) {
$this->syncRelation($property, collect(data_get($formData, $question->uuid)));
$inputType = data_get($relationsConfig, "$question->linked_field_key.input_type");
$this->syncRelation($property, $inputType, collect(data_get($formData, $question->uuid)));
}
}

Expand Down Expand Up @@ -242,10 +243,10 @@ private function updateLinkedFieldValue(array $linkedFieldInfo, $answer): void
}
}

private function syncRelation(string $property, $data): void
private function syncRelation(string $property, string $inputType, $data): void
{
// This will expand as we complete more tickets in TM-747, until eventually we support all form relations.
if ($property != 'treeSpecies') {
if (! in_array($inputType, ['treeSpecies', 'workdays'])) {
return;
}

Expand Down
19 changes: 0 additions & 19 deletions openapi-src/V2/definitions/V2WorkdayCreate.yml

This file was deleted.

15 changes: 0 additions & 15 deletions openapi-src/V2/definitions/V2WorkdayUpdate.yml

This file was deleted.

4 changes: 0 additions & 4 deletions openapi-src/V2/definitions/_index.yml
Original file line number Diff line number Diff line change
Expand Up @@ -152,10 +152,6 @@ V2SeedingPaginated:
$ref: './V2SeedingPaginated.yml'
V2WorkdayRead:
$ref: './V2WorkdayRead.yml'
V2WorkdayCreate:
$ref: './V2WorkdayCreate.yml'
V2WorkdayUpdate:
$ref: './V2WorkdayUpdate.yml'
V2WorkdaysPaginated:
$ref: './V2WorkdaysPaginated.yml'
V2DisturbanceRead:
Expand Down
12 changes: 0 additions & 12 deletions openapi-src/V2/paths/Workdays/delete-v2-workday-uuid.yml

This file was deleted.

14 changes: 0 additions & 14 deletions openapi-src/V2/paths/Workdays/patch-v2-workday-uuid.yml

This file was deleted.

14 changes: 0 additions & 14 deletions openapi-src/V2/paths/Workdays/post-v2-workday.yml

This file was deleted.

8 changes: 0 additions & 8 deletions openapi-src/V2/paths/_index.yml
Original file line number Diff line number Diff line change
Expand Up @@ -104,14 +104,6 @@
/v2/update-requests/{ENTITY}/{UUID}:
get:
$ref: './UpdateRequests/get-v2-update-requests-entity-uuid.yml'
/v2/workdays:
post:
$ref: './Workdays/post-v2-workday.yml'
/v2/workdays/{UUID}:
patch:
$ref: './Workdays/patch-v2-workday-uuid.yml'
delete:
$ref: './Workdays/delete-v2-workday-uuid.yml'
/v2/workdays/{ENTITY}/{UUID}:
get:
$ref: './Workdays/get-v2-workdays-entity-uuid.yml'
Expand Down
Loading

0 comments on commit 1c39e14

Please sign in to comment.