-
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.
[shopsys] promo code for free transport and payment (#3625)
- Loading branch information
Showing
7 changed files
with
56 additions
and
5 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
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,18 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Shopsys\FrontendApiBundle\Model\Cart; | ||
|
||
class PromoCodeData | ||
{ | ||
/** | ||
* @param string $code | ||
* @param string $type | ||
*/ | ||
public function __construct( | ||
public readonly string $code, | ||
public readonly string $type, | ||
) { | ||
} | ||
} |
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
15 changes: 15 additions & 0 deletions
15
src/Resources/config/graphql-types/EnumType/PromoCodeTypeEnumDecorator.types.yaml
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,15 @@ | ||
PromoCodeTypeEnumDecorator: | ||
type: enum | ||
decorator: true | ||
config: | ||
description: "One of possible promo code types" | ||
values: | ||
percent: | ||
value: '@=constant("Shopsys\\FrameworkBundle\\Model\\Order\\PromoCode\\PromoCodeTypeEnum::DISCOUNT_TYPE_PERCENT")' | ||
description: "Discount type percent" | ||
nominal: | ||
value: '@=constant("Shopsys\\FrameworkBundle\\Model\\Order\\PromoCode\\PromoCodeTypeEnum::DISCOUNT_TYPE_NOMINAL")' | ||
description: "Discount type nominal" | ||
free_transport_payment: | ||
value: '@=constant("Shopsys\\FrameworkBundle\\Model\\Order\\PromoCode\\PromoCodeTypeEnum::DISCOUNT_TYPE_FREE_TRANSPORT_PAYMENT")' | ||
description: "Discount type free transport and payment" |
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
11 changes: 11 additions & 0 deletions
11
src/Resources/config/graphql-types/ModelType/Cart/PromoCodeDecorator.types.yaml
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 @@ | ||
PromoCodeDecorator: | ||
type: object | ||
decorator: true | ||
config: | ||
fields: | ||
code: | ||
type: "String!" | ||
description: "Code of the promo code" | ||
type: | ||
type: "PromoCodeTypeEnum!" | ||
description: "Type of the promo code" |