Added ip lookup on registration, fixes ST-245

This commit is contained in:
Constantin Graf
2024-06-25 11:48:24 +02:00
committed by Gregor Vostrak
parent 364168debd
commit de1accba4a
5 changed files with 89 additions and 28 deletions

View File

@@ -0,0 +1,23 @@
<?php
declare(strict_types=1);
namespace App\Service\IpLookup;
use App\Enums\Weekday;
class IpLookupResponseDto
{
public ?string $timezone;
public ?Weekday $startOfWeek;
public ?string $currency;
public function __construct(?string $timezone, ?Weekday $startOfWeek, ?string $currency)
{
$this->timezone = $timezone;
$this->startOfWeek = $startOfWeek;
$this->currency = $currency;
}
}

View File

@@ -0,0 +1,10 @@
<?php
declare(strict_types=1);
namespace App\Service\IpLookup;
interface IpLookupServiceContract
{
public function lookup(string $ip): ?IpLookupResponseDto;
}

View File

@@ -0,0 +1,13 @@
<?php
declare(strict_types=1);
namespace App\Service\IpLookup;
class NoIpLookupService implements IpLookupServiceContract
{
public function lookup(string $ip): ?IpLookupResponseDto
{
return null;
}
}