-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9516eaa
commit 5fd80e9
Showing
13 changed files
with
579 additions
and
9 deletions.
There are no files selected for viewing
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,11 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Vanilo\Admin\Contracts\Requests; | ||
|
||
use Konekt\Concord\Contracts\BaseRequest; | ||
|
||
interface CreatePromotion extends BaseRequest | ||
{ | ||
} |
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,11 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Vanilo\Admin\Contracts\Requests; | ||
|
||
use Konekt\Concord\Contracts\BaseRequest; | ||
|
||
interface UpdatePromotion extends BaseRequest | ||
{ | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Vanilo\Admin\Http\Requests; | ||
|
||
use Illuminate\Foundation\Http\FormRequest; | ||
use Konekt\AppShell\Validation\CurrencyExists; | ||
use Vanilo\Admin\Contracts\Requests\CreatePromotion as CreatePromotionContract; | ||
|
||
|
||
class CreatePromotion extends FormRequest implements CreatePromotionContract | ||
{ | ||
public function rules() | ||
{ | ||
return [ | ||
'name' => 'required|string|min:1|max:255', | ||
'description' => 'nullable|string|min:1|max:65000', | ||
'priority' => 'required|integer|min:0', | ||
'is_exclusive' => 'required|boolean', | ||
'usage_limit' => 'nullable|integer|min:0', | ||
'is_coupon_based' => 'required|boolean', | ||
'starts_at' => 'required|date|before:ends_at', | ||
'ends_at' => 'required|date|after:starts_at', | ||
'applies_to_discounted' => 'required|boolean', | ||
]; | ||
} | ||
|
||
public function authorize() | ||
{ | ||
return true; | ||
} | ||
} |
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,32 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Vanilo\Admin\Http\Requests; | ||
|
||
use Illuminate\Foundation\Http\FormRequest; | ||
use Konekt\AppShell\Validation\CurrencyExists; | ||
use Vanilo\Admin\Contracts\Requests\UpdatePromotion as UpdatePromotionContract; | ||
|
||
class UpdatePromotion extends FormRequest implements UpdatePromotionContract | ||
{ | ||
public function rules() | ||
{ | ||
return [ | ||
'name' => 'required|string|min:1|max:255', | ||
'description' => 'nullable|string|min:1|max:65000', | ||
'priority' => 'required|integer|min:0', | ||
'is_exclusive' => 'required|boolean', | ||
'usage_limit' => 'nullable|integer|min:0', | ||
'is_coupon_based' => 'required|boolean', | ||
'starts_at' => 'required|date|before:ends_at', | ||
'ends_at' => 'required|date|after:starts_at', | ||
'applies_to_discounted' => 'required|boolean', | ||
]; | ||
} | ||
|
||
public function authorize() | ||
{ | ||
return true; | ||
} | ||
} |
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
Oops, something went wrong.