Closed c9845 closed 1 year ago
Patch and project coverage have no change.
Comparison is base (
0319854
) 100.00% compared to head (510c8c0
) 100.00%.:exclamation: Current head 510c8c0 differs from pull request most recent head e2934a0. Consider uploading reports for the commit e2934a0 to get more accurate results
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
This needs a rebase plz.
@oliver006 I rebased as requested.
Of note, it looks like similar work has already been done for payouts, wee PayoutStatus
and the related const definitions.
The PayoutStatus
type could be unexported though. It only needs to be exported to allow for creating of a PayoutStatus
with something like var customPayoutStatus PayoutStatus = "custom"
. But this really should never be needed since the applicable values are defined by Shopify and, even in the off case someone does need a custom value, they can just provide a string to the field in the struct.
Define types and constants for well-defined field values to aid in code editor type checking and auto-completion and in reducing back-and-forth between code and Shopify docs to check acceptable values. Since Shopify limits the values certain fields can accept, this library should do so as well!
Shopify defines acceptable values for certain fields. This defines those values, and an associated type, so that users are less likely to provide an unacceptable value. Code editors may even provide a list of acceptable values for a field for auto-completion. This is really just a code-writing improvement to prevent having to look up the acceptable values for a field in the Shopify API docs.
This should not break any existing code since the new types are all strings and string values, in existing code, will still be accepted.