-
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(associate-role): create associate role package and model #435
Conversation
🦋 Changeset detectedLatest commit: 77960b4 The changes in this PR will be included in the next version bump. This PR includes changesets to release 29 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 |
models/associate-role/package.json
Outdated
@@ -0,0 +1,28 @@ | |||
{ | |||
"name": "@commercetools-test-data/associate-role", | |||
"version": "6.4.2", |
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.
"version": "6.4.2", | |
"version": "6.5.0", |
const generator = Generator<TAssociateRoleDraft>({ | ||
fields: { | ||
key: fake((f) => f.string.alphanumeric(10)), | ||
name: fake((f) => f.string.alphanumeric(15)), | ||
buyerAssignable: fake((f) => f.datatype.boolean()), | ||
permissions: [], | ||
custom: 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.
💯
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.
I think we're missing a draft transformer?
models/associate-role/src/index.ts
Outdated
|
||
export { default as random } from './builder'; | ||
export * as presets from './presets'; | ||
export { default as draftPresets } from './associate-role-draft/presets'; |
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.
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.
In this case we felt that having them for the final was probably more useful but I am totally open to changing it later
id: fake((f) => f.string.uuid()), | ||
version: sequence(), | ||
createdAt: fake(getOlderDate), | ||
createdBy: fake(() => ClientLogging.random()), | ||
lastModifiedAt: fake(getNewerDate), | ||
lastModifiedBy: fake(() => ClientLogging.random()), | ||
key: fake((f) => f.string.alphanumeric(10)), | ||
name: fake((f) => f.string.alphanumeric(15)), | ||
buyerAssignable: fake((f) => f.datatype.boolean()), | ||
permissions: [], | ||
custom: 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.
id: fake((f) => f.string.uuid()), | |
version: sequence(), | |
createdAt: fake(getOlderDate), | |
createdBy: fake(() => ClientLogging.random()), | |
lastModifiedAt: fake(getNewerDate), | |
lastModifiedBy: fake(() => ClientLogging.random()), | |
key: fake((f) => f.string.alphanumeric(10)), | |
name: fake((f) => f.string.alphanumeric(15)), | |
buyerAssignable: fake((f) => f.datatype.boolean()), | |
permissions: [], | |
custom: null, | |
id: fake((f) => f.string.uuid()), | |
version: sequence(), | |
key: fake((f) => f.string.alphanumeric(10)), | |
buyerAssignable: fake((f) => f.datatype.boolean()), | |
name: fake((f) => f.string.alphanumeric(15)), | |
permissions: [], | |
custom: null, | |
createdAt: fake(getOlderDate), | |
createdBy: fake(() => ClientLogging.random()), | |
lastModifiedAt: fake(getNewerDate), | |
lastModifiedBy: fake(() => ClientLogging.random()), |
Absolutely nothing wrong with the way you had it, it's just easier to keep in the same order as the docs...trust me.
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.
@ChristianMoll thank you so much for your contribution! 🙌🏻
I left a few comments/suggestions, but overall you killed it.
I will go ahead and approve it, but please make sure you update the version number in the json packge. It isn't displaying any errors, but iirc, i think it will cause issues down the line?
Disclaimer-I did not go over the draft/final graphql transformation in great detail, so that shape may/may not need a little more massaging.
Adds the associate role package and model
I tried my best to make it fit the standards of the other models but as this is my first contribution I look forward to your feedback 🙇