-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #105 from heseya/feature/SK-923
Fix phone in address
- Loading branch information
Showing
6 changed files
with
87 additions
and
8 deletions.
There are no files selected for viewing
42 changes: 42 additions & 0 deletions
42
src/Domain/Manufacturer/Dtos/ManufacturerAddressStoreDto.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Domain\Manufacturer\Dtos; | ||
|
||
use Spatie\LaravelData\Attributes\Validation\Max; | ||
use Spatie\LaravelData\Attributes\Validation\Nullable; | ||
use Spatie\LaravelData\Attributes\Validation\Required; | ||
use Spatie\LaravelData\Attributes\Validation\StringType; | ||
use Spatie\LaravelData\Data; | ||
use Spatie\LaravelData\Optional; | ||
use Spatie\LaravelData\Support\Validation\ValidationContext; | ||
|
||
final class ManufacturerAddressStoreDto extends Data | ||
{ | ||
public function __construct( | ||
public string $name, | ||
#[Required, StringType, Max(255)] | ||
public string $address, | ||
#[Nullable, StringType, Max(20)] | ||
public Optional|string $phone, | ||
#[Required, StringType, Max(16)] | ||
public string $zip, | ||
#[Required, StringType, Max(255)] | ||
public string $city, | ||
#[Required, StringType, Max(2)] | ||
public string $country, | ||
#[Nullable, StringType, Max(15)] | ||
public Optional|string|null $vat, | ||
) {} | ||
|
||
/** | ||
* @return array<string,array<int,mixed>> | ||
*/ | ||
public static function rules(ValidationContext $context): array | ||
{ | ||
return [ | ||
'name' => ['required', 'string', 'max:255'], | ||
]; | ||
} | ||
} |
41 changes: 41 additions & 0 deletions
41
src/Domain/Manufacturer/Dtos/ManufacturerAddressUpdateDto.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Domain\Manufacturer\Dtos; | ||
|
||
use Spatie\LaravelData\Attributes\Validation\Max; | ||
use Spatie\LaravelData\Attributes\Validation\Nullable; | ||
use Spatie\LaravelData\Attributes\Validation\StringType; | ||
use Spatie\LaravelData\Data; | ||
use Spatie\LaravelData\Optional; | ||
use Spatie\LaravelData\Support\Validation\ValidationContext; | ||
|
||
final class ManufacturerAddressUpdateDto extends Data | ||
{ | ||
public function __construct( | ||
public string $name, | ||
#[StringType, Max(255)] | ||
public string $address, | ||
#[StringType, Max(20)] | ||
public Optional|string $phone, | ||
#[StringType, Max(16)] | ||
public string $zip, | ||
#[StringType, Max(255)] | ||
public string $city, | ||
#[StringType, Max(2)] | ||
public string $country, | ||
#[Nullable, StringType, Max(15)] | ||
public Optional|string|null $vat, | ||
) {} | ||
|
||
/** | ||
* @return array<string,array<int,mixed>> | ||
*/ | ||
public static function rules(ValidationContext $context): array | ||
{ | ||
return [ | ||
'name' => ['string', 'max:255'], | ||
]; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters