Commit 9a0f9d7a authored by Jacob Priddy's avatar Jacob Priddy 👌

Add some local entries and test the routes. Logging is done

parent 8eaaa638
Pipeline #5600 failed with stages
in 3 minutes and 50 seconds
......@@ -87,7 +87,6 @@ Route::group(['middleware' => 'auth:api'], static function () {
Route::group([
'prefix' => 'entries',
], static function () {
Route::get('user/{userId}/door/{doorId}', [EntriesController::class, 'doorUserEntries']);
Route::get('door/{doorId}/user/{userId}', [EntriesController::class, 'doorUserEntries']);
});
......
......@@ -3,6 +3,24 @@
namespace Source\Gateways\Attempts;
use Carbon\Carbon;
use Source\Entities\Attempt;
use Source\Gateways\Doors\LocalDoorsRepository;
class LocalAttemptsRepository extends InMemoryAttemptsRepository
{
public function __construct()
{
$this->add(new Attempt(
1,
LocalDoorsRepository::getTheBatCave()->getId(),
Carbon::now()
));
$this->add(new Attempt(
2,
LocalDoorsRepository::getAmazonDoor()->getId(),
Carbon::now()->subDays(10)
));
}
}
......@@ -3,6 +3,48 @@
namespace Source\Gateways\Entries;
use Carbon\Carbon;
use Source\Entities\Entry;
use Source\Gateways\Doors\LocalDoorsRepository;
use Source\Gateways\Users\LocalUsersRepository;
class LocalEntriesRepository extends InMemoryEntriesRepository
{
/**
* @throws \Exception
*/
public function __construct()
{
$this->add(new Entry(
1,
LocalUsersRepository::getEngineeringLabAccessStudent()->getId(),
LocalDoorsRepository::getAmazonDoor()->getId(),
false,
Carbon::now()->subDays(1)
));
$this->add(new Entry(
2,
LocalUsersRepository::getEngineeringLabAccessStudent()->getId(),
LocalDoorsRepository::getTheBatCave()->getId(),
true,
Carbon::now()->subDays(1)
));
$this->add(new Entry(
3,
LocalUsersRepository::getComputerScienceStudent()->getId(),
LocalDoorsRepository::getAmazonDoor()->getId(),
true,
Carbon::now()->subMinutes(4)
));
$this->add(new Entry(
4,
LocalUsersRepository::getComputerScienceStudent()->getId(),
LocalDoorsRepository::getTheBatCave()->getId(),
false,
Carbon::now()->subYear()
));
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment