-
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.
FEC-39: Fix models related to Batch 2 (Part 1) (#650)
* feat: add discounted price type in commons model * fix: make supply channel optional in inventory-entry * chore: add enum lenum presets and total in transformer * chore: changeset * fix: lint issue * refactor(discounted-price): adjust graphql types * refactor(inventory-entry): adjust graphql types * refactor(reference): adjust graphql types * refactor(inventory-entry): supply channel is optional * fix(inventory-entry): adjust tests --------- Co-authored-by: Carlos Cortizas <[email protected]>
- Loading branch information
1 parent
33a191d
commit 8038c61
Showing
23 changed files
with
200 additions
and
71 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,17 @@ | ||
--- | ||
'@commercetools-test-data/product-type': minor | ||
'@commercetools-test-data/commons': minor | ||
'@commercetools-test-data/inventory-entry': patch | ||
--- | ||
|
||
### Common Model (`common`) | ||
|
||
- Introduced a new model called `discounted-price`. | ||
|
||
### Inventory Entry Model (`inventory-entry`) | ||
|
||
- Updated the transformer file to conditionally send the supply channel, making it optional. | ||
|
||
### Product Type (`product-type`) | ||
|
||
- Added new presets for enum and localized enum types. |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
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
44 changes: 43 additions & 1 deletion
44
models/product-type/src/attribute-definition/presets/index.ts
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 |
---|---|---|
@@ -1,3 +1,45 @@ | ||
const presets = {}; | ||
import { LocalizedString } from '@commercetools-test-data/commons'; | ||
import { | ||
AttributeEnumType, | ||
AttributeNumberType, | ||
AttributeTextType, | ||
} from '../..'; | ||
import AttributeDefinition from '../builder'; | ||
|
||
const presets = { | ||
number: () => | ||
AttributeDefinition() | ||
.type(AttributeNumberType.random()) | ||
.name('Number Attribute Definition') | ||
.label( | ||
LocalizedString.presets | ||
.empty() | ||
.en(`Number Attribute Definition's Label`) | ||
) | ||
.inputTip( | ||
LocalizedString.presets | ||
.empty() | ||
.en(`Number Attribute Definition's Input Tip`) | ||
), | ||
|
||
countryOfOrigin: () => | ||
AttributeDefinition() | ||
.attributeConstraint('None') | ||
.name('country-of-origin') | ||
.label(LocalizedString.presets.empty().en('Country of Origin')) | ||
.isRequired(true) | ||
.type(AttributeTextType.random()), | ||
|
||
size: () => | ||
AttributeDefinition() | ||
.attributeConstraint('None') | ||
.name('size') | ||
.label(LocalizedString.presets.empty().en('Size')) | ||
.inputTip(LocalizedString.presets.empty().en('Size of a product')) | ||
.inputHint('SingleLine') | ||
.isRequired(true) | ||
.isSearchable(true) | ||
.type(AttributeEnumType.presets.allSizesEnum()), | ||
}; | ||
|
||
export default presets; |
24 changes: 23 additions & 1 deletion
24
models/product-type/src/attribute-enum-type/presets/index.ts
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 |
---|---|---|
@@ -1,3 +1,25 @@ | ||
const presets = {}; | ||
import { AttributePlainEnumValue } from '../..'; | ||
import AttributeEnumType from '../builder'; | ||
|
||
const presets = { | ||
allSizesEnum: () => | ||
AttributeEnumType().values([ | ||
AttributePlainEnumValue.presets.s(), | ||
AttributePlainEnumValue.presets.m(), | ||
AttributePlainEnumValue.presets.l(), | ||
AttributePlainEnumValue.presets.xl(), | ||
]), | ||
smallSizesEnum: () => | ||
AttributeEnumType().values([ | ||
AttributePlainEnumValue.presets.s(), | ||
AttributePlainEnumValue.presets.m(), | ||
]), | ||
|
||
bigSizesEnum: () => | ||
AttributeEnumType().values([ | ||
AttributePlainEnumValue.presets.l(), | ||
AttributePlainEnumValue.presets.xl(), | ||
]), | ||
}; | ||
|
||
export default presets; |
Oops, something went wrong.