-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(test-data): create StandalonePrice
model and associated draft
#472
Conversation
🦋 Changeset detectedLatest commit: 4b60553 The changes in this PR will be included in the next version bump. This PR includes changesets to release 34 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
): TReferenceGraphql<'customer-group'>; | ||
|
||
// Create a customer group reference depending on `id` or `key` field availability | ||
function createCustomerGroupReference( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
key
is optional in CustomerGroup
- I wanted consumers to get the type of reference they intended, so I opted to create a KeyReference
if key
was provided, otherwise create an id
Reference
(rather than defaulting to an id
Reference
)
discounted: null, | ||
staged: null, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Both of these models (DiscountedPrice
and StagedStandalonePrice
) are not necessary for our effort and were omitted from creation, in the interest of time
// Remove `expiresAt` from the fields | ||
const { expiresAt, ...rest } = fields; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sheer curiosity: do we know why these two representations deviate with this field?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nope!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Your types.ts files are always literal art 🧑🎨 🔥
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code looks good. Maybe an unknown piece but there are models inside the priceless repo.
models/standalone-price/src/standalone-price-draft/builder.spec.ts
Outdated
Show resolved
Hide resolved
In the long run, our idea is to replace those linked models with |
Summary
This PR creates the
StandalonePrice
model and associated draft for use with our B2B dataset support effort.Standalone prices REST documentation
Graphql structure:
Base model:
Draft model: