Skip to content

Commit

Permalink
Exposed status change origin
Browse files Browse the repository at this point in the history
  • Loading branch information
mroloux committed Jun 25, 2019
1 parent 848c384 commit afc0cff
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 2 deletions.
6 changes: 5 additions & 1 deletion src/Events/StatusChange.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,8 @@ class StatusChange
* @var object
*/
public $extraData;
}
/**
* @var StatusChangeOrigin
*/
public $origin;
}
17 changes: 17 additions & 0 deletions src/Events/StatusChangeOrigin.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?php


namespace Seatsio\Events;


class StatusChangeOrigin
{
/**
* @var string
*/
public $type;
/**
* @var string
*/
public $ip;
}
4 changes: 3 additions & 1 deletion tests/Events/ListStatusChangesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ public function testPropertiesOfStatusChange()
self::assertEquals(ObjectStatus::$BOOKED, $statusChange->status);
self::assertEquals($event->id, $statusChange->eventId);
self::assertEquals((object)["foo" => "bar"], $statusChange->extraData);
self::assertEquals("API_CALL", $statusChange->origin->type);
self::assertNotNull($statusChange->origin->ip);
}

public function testFilter()
Expand Down Expand Up @@ -134,4 +136,4 @@ public function testSortDesc()

self::assertEquals(["B-1", "A-3", "A-2", "A-1"], array_values($objectIds));
}
}
}

0 comments on commit afc0cff

Please sign in to comment.