Skip to content

Commit

Permalink
Update README.md and CHANGELOG.md
Browse files Browse the repository at this point in the history
  • Loading branch information
Art4 committed Mar 7, 2024
1 parent 8c902d2 commit a9ea96e
Show file tree
Hide file tree
Showing 3 changed files with 67 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added

- New method `Art4\Wegliphant\Client::authenticate()` to set your API key for authorized API requests.
- New method `Art4\Wegliphant\Client::listOwnNotices()` to list all notices for the authorized user.
- New class `Art4\Wegliphant\Exception\UnexpectedResponseException` that will be thrown if an error happens while processing the response.

### Changed
Expand Down
63 changes: 63 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,69 @@ You can find your API key [here](https://www.weg.li/user/edit).
$client->authenticate($apiKey);
```

### List all own notices

```php
$notices = $client->listOwnNotices();

// $notices contains:
[
[...],
[
'token' => '8843d7f92416211de9ebb963ff4ce281',
'status' => 'shared',
'street' => 'Musterstraße 123',
'city' => 'Berlin',
'zip' => '12305',
'latitude' => 52.5170365,
'longitude' => 13.3888599,
'registration' => 'EX AM 713',
'color' => 'white',
'brand' => 'Car brand',
'charge' => [
'tbnr' => '141312',
'description' => 'Sie parkten im absoluten Haltverbot (Zeichen 283).',
'fine' => '25.0',
'bkat' => '§ 41 Abs. 1 iVm Anlage 2, § 49 StVO; § 24 Abs. 1, 3 Nr. 5 StVG; 52 BKat',
'penalty' => null,
'fap' => null,
'points' => 0,
'valid_from' => '2021-11-09T00:00:00.000+01:00',
'valid_to' => null,
'implementation' => null,
'classification' => 5,
'variant_table_id' => 741017,
'rule_id' => 39,
'table_id' => null,
'required_refinements' => '00000000000000000000000000000000',
'number_required_refinements' => 0,
'max_fine' => '0.0',
'created_at' => '2023-09-18T15:30:43.312+02:00',
'updated_at' => '2023-09-18T15:30:43.312+02:00',
],
'tbnr' => '141312',
'start_date' => '2023-11-12T11:31:00.000+01:00',
'end_date' => '2023-11-12T11:36:00.000+01:00',
'note' => 'Some user notes',
'photos' => [
[
'filename' => 'IMG_20231124_113156.jpg',
'url' => 'https://example.com/storage/IMG_20231124_113156.jpg',
],
],
'created_at' => '2023-11-12T11:33:29.423+01:00',
'updated_at' => '2023-11-12T11:49:24.383+01:00',
'sent_at' => '2023-11-12T11:49:24.378+01:00',
'vehicle_empty' => true,
'hazard_lights' => false,
'expired_tuv' => false,
'expired_eco' => false,
'over_2_8_tons' => false,
],
[...],
],
```

### List all districts

```php
Expand Down
6 changes: 3 additions & 3 deletions tests/Unit/Client/ListOwnNoticesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public function testListOwnNoticesReturnsArray(): void
{
$expected = [
[
'token' => '7a473465c3cbbc6c90781b5e798966ce',
'token' => '8843d7f92416211de9ebb963ff4ce281',
'status' => 'shared',
'street' => 'Musterstraße 123',
'city' => 'Berlin',
Expand Down Expand Up @@ -59,8 +59,8 @@ public function testListOwnNoticesReturnsArray(): void
'note' => 'Some user notes',
'photos' => [
[
'filename' => 'IMG_20231124_113156.jpg',
'url' => 'https://example.com/storage/IMG_20231124_113156.jpg',
'filename' => 'IMG_20231112_113156.jpg',
'url' => 'https://example.com/storage/IMG_20231112_113156.jpg',
],
],
'created_at' => '2023-11-12T11:33:29.423+01:00',
Expand Down

0 comments on commit a9ea96e

Please sign in to comment.