Skip to content

Add ProjectResource with list and get#2

Merged
jhhazelaar merged 2 commits intomainfrom
feature/project-resource
May 5, 2026
Merged

Add ProjectResource with list and get#2
jhhazelaar merged 2 commits intomainfrom
feature/project-resource

Conversation

@jhhazelaar
Copy link
Copy Markdown
Member

Summary

  • Add ProjectResource exposing list() and get(string $uuid) returning Saloon\Http\Response
  • Add GetProjectsRequest and GetProjectRequest under Requests/Projects
  • Expose the resource on the connector as $nbo->projects()

Endpoints

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

Tests

  • GetProjectsRequest: HTTP method and resolved endpoint
  • GetProjectRequest: HTTP method, uuid public property, and resolved endpoint
  • ProjectResource: list() and get() dispatch the right request and return the mocked response (verified with MockClient::assertSent), plus direct instantiation
  • NieuwbouwOffice: projects() returns a ProjectResource

All 16 tests pass locally with vendor/bin/pest (22 assertions).

Usage

$nbo = new NieuwbouwOffice('token');

$projects = $nbo->projects()->list()->json();
$project  = $nbo->projects()->get('uuid-here')->json();

jhhazelaar and others added 2 commits May 5, 2026 16:29
Introduce a ProjectResource on the connector exposing list() and get(uuid)
that dispatch GetProjectsRequest and GetProjectRequest respectively. The
requests live under Requests/Projects and target /projects/ and
/projects/{uuid}/. Cover the new code with focused request tests and
MockClient-backed resource tests.
@jhhazelaar jhhazelaar merged commit bf1724a into main May 5, 2026
@jhhazelaar jhhazelaar deleted the feature/project-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