Skip to content

Add UnitTypeResource scoped to a project - #3

Merged
jhhazelaar merged 1 commit into
mainfrom
feature/unit-type-resource
May 5, 2026
Merged

Add UnitTypeResource scoped to a project#3
jhhazelaar merged 1 commit into
mainfrom
feature/unit-type-resource

Conversation

@jhhazelaar

Copy link
Copy Markdown
Member

Summary

  • Add UnitTypeResource exposing list() and get(string $uuid) returning Saloon\Http\Response
  • Add GetUnitTypesRequest and GetUnitTypeRequest under Requests/UnitTypes, both scoped to a project uuid
  • Expose the resource on the connector as $nbo->unitTypes(string $projectUuid)

Endpoints

  • list()GET /projects/{projectUuid}/projectwoningen/
  • get($uuid)GET /projects/{projectUuid}/projectwoningen/{uuid}/

Tests

  • GetUnitTypesRequest: HTTP method, public projectUuid, resolved endpoint
  • GetUnitTypeRequest: HTTP method, public projectUuid and uuid, resolved endpoint
  • UnitTypeResource: list() and get() dispatch the right project-scoped request and return the mocked response (verified with closure-based MockClient::assertSent checking the project uuid, uuid, and resolved endpoint), plus direct instantiation
  • NieuwbouwOffice: unitTypes(string $projectUuid) returns a UnitTypeResource

26 tests passing locally with vendor/bin/pest (37 assertions).

Usage

$nbo = new NieuwbouwOffice('token');

$unitTypes = $nbo->unitTypes('project-uuid')->list()->json();
$unitType  = $nbo->unitTypes('project-uuid')->get('unit-type-uuid')->json();

Expose unitTypes(string $projectUuid) on the connector returning a
UnitTypeResource with list() and get(string $uuid). Both methods
dispatch project-scoped Saloon requests against
/projects/{projectUuid}/projectwoningen/ and its detail endpoint.
Cover the new code with focused request and MockClient-backed
resource tests.
@jhhazelaar
jhhazelaar merged commit e456c5d into main May 5, 2026
25 of 26 checks passed
@jhhazelaar
jhhazelaar deleted the feature/unit-type-resource branch May 5, 2026 19:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant