Skip to content
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

[Fix] Changes Money.amount type to string following GraphQL schema Decimal type #1854

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .changeset/green-zoos-lie.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@shopify/shopify-app-remix': patch
'@shopify/shopify-api': patch
---

Fixes Money.amount type from number to string to follow GraphQL schema Decimal type
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ export const SUBSCRIPTIONS_WITH_USAGE_PLANS_RESPONSE = JSON.stringify({
plan: {
pricingDetails: {
balanceUsed: {
amount: 0,
amount: '0',
currencyCode: 'USD',
},
cappedAmount: {
Expand Down Expand Up @@ -339,7 +339,7 @@ export const SUBSCRIPTIONS_WITH_USAGE_PLANS_NOT_ACTIVE_RESPONSE =

export const USAGE_RECORD_DESCRIPTION = 'Usage record description';
export const USAGE_RECORD_PRICE = {
amount: 1.0,
amount: '1.0',
currencyCode: 'USD',
} as Money;
export const USAGE_RECORD_SUBSCRIPTION_ID = 'gid://456';
Expand Down
6 changes: 3 additions & 3 deletions packages/apps/shopify-api/lib/billing/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,7 @@ export interface UsageAppPlan {
}

export interface Money {
amount: number;
amount: string;
currencyCode: string;
}

Expand Down Expand Up @@ -506,7 +506,7 @@ export interface BillingCreateUsageRecordParams {
/**
* The amount to charge for this usage record.
*/
amount: number;
amount: string;
/**
* The currency code for this usage record.
*/
Expand Down Expand Up @@ -542,7 +542,7 @@ export interface UsageRecord {
/**
* The amount to charge for this usage record.
*/
amount: number;
amount: string;
/**
* The currency code for this usage record.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -672,7 +672,7 @@
"filePath": "src/server/authenticate/admin/billing/types.ts",
"syntaxKind": "PropertySignature",
"name": "price",
"value": "{ amount: number; currencyCode: string; }",
"value": "{ amount: string; currencyCode: string; }",
"description": "The price of the app usage record."
},
{
Expand All @@ -684,7 +684,7 @@
"isOptional": true
}
],
"value": "export interface CreateUsageRecordOptions {\n /**\n * The description of the app usage record.\n */\n description: string;\n /**\n * The price of the app usage record.\n */\n price: {\n /**\n * The amount to charge for this usage record.\n */\n amount: number;\n /**\n * The currency code for this usage record.\n */\n currencyCode: string;\n };\n /**\n * Whether to use the test mode. This prevents the credit card from being charged.\n */\n isTest: boolean;\n /*\n * Defines the usage pricing plan the merchant is subscribed to.\n */\n subscriptionLineItemId?: string;\n /*\n * A unique key generated to avoid duplicate charges.\n */\n idempotencyKey?: string;\n}"
"value": "export interface CreateUsageRecordOptions {\n /**\n * The description of the app usage record.\n */\n description: string;\n /**\n * The price of the app usage record.\n */\n price: {\n /**\n * The amount to charge for this usage record.\n */\n amount: string;\n /**\n * The currency code for this usage record.\n */\n currencyCode: string;\n };\n /**\n * Whether to use the test mode. This prevents the credit card from being charged.\n */\n isTest: boolean;\n /*\n * Defines the usage pricing plan the merchant is subscribed to.\n */\n subscriptionLineItemId?: string;\n /*\n * A unique key generated to avoid duplicate charges.\n */\n idempotencyKey?: string;\n}"
},
"RequestBillingOptions": {
"filePath": "src/server/authenticate/admin/billing/types.ts",
Expand Down Expand Up @@ -1747,7 +1747,7 @@
"filePath": "src/server/authenticate/admin/billing/types.ts",
"syntaxKind": "PropertySignature",
"name": "price",
"value": "{ amount: number; currencyCode: string; }",
"value": "{ amount: string; currencyCode: string; }",
"description": "The price of the app usage record."
},
{
Expand All @@ -1759,7 +1759,7 @@
"isOptional": true
}
],
"value": "export interface CreateUsageRecordOptions {\n /**\n * The description of the app usage record.\n */\n description: string;\n /**\n * The price of the app usage record.\n */\n price: {\n /**\n * The amount to charge for this usage record.\n */\n amount: number;\n /**\n * The currency code for this usage record.\n */\n currencyCode: string;\n };\n /**\n * Whether to use the test mode. This prevents the credit card from being charged.\n */\n isTest: boolean;\n /*\n * Defines the usage pricing plan the merchant is subscribed to.\n */\n subscriptionLineItemId?: string;\n /*\n * A unique key generated to avoid duplicate charges.\n */\n idempotencyKey?: string;\n}"
"value": "export interface CreateUsageRecordOptions {\n /**\n * The description of the app usage record.\n */\n description: string;\n /**\n * The price of the app usage record.\n */\n price: {\n /**\n * The amount to charge for this usage record.\n */\n amount: string;\n /**\n * The currency code for this usage record.\n */\n currencyCode: string;\n };\n /**\n * Whether to use the test mode. This prevents the credit card from being charged.\n */\n isTest: boolean;\n /*\n * Defines the usage pricing plan the merchant is subscribed to.\n */\n subscriptionLineItemId?: string;\n /*\n * A unique key generated to avoid duplicate charges.\n */\n idempotencyKey?: string;\n}"
},
"RequestBillingOptions": {
"filePath": "src/server/authenticate/admin/billing/types.ts",
Expand Down Expand Up @@ -5249,7 +5249,7 @@
"filePath": "src/server/authenticate/admin/billing/types.ts",
"syntaxKind": "PropertySignature",
"name": "price",
"value": "{ amount: number; currencyCode: string; }",
"value": "{ amount: string; currencyCode: string; }",
"description": "The price of the app usage record."
},
{
Expand All @@ -5261,7 +5261,7 @@
"isOptional": true
}
],
"value": "export interface CreateUsageRecordOptions {\n /**\n * The description of the app usage record.\n */\n description: string;\n /**\n * The price of the app usage record.\n */\n price: {\n /**\n * The amount to charge for this usage record.\n */\n amount: number;\n /**\n * The currency code for this usage record.\n */\n currencyCode: string;\n };\n /**\n * Whether to use the test mode. This prevents the credit card from being charged.\n */\n isTest: boolean;\n /*\n * Defines the usage pricing plan the merchant is subscribed to.\n */\n subscriptionLineItemId?: string;\n /*\n * A unique key generated to avoid duplicate charges.\n */\n idempotencyKey?: string;\n}"
"value": "export interface CreateUsageRecordOptions {\n /**\n * The description of the app usage record.\n */\n description: string;\n /**\n * The price of the app usage record.\n */\n price: {\n /**\n * The amount to charge for this usage record.\n */\n amount: string;\n /**\n * The currency code for this usage record.\n */\n currencyCode: string;\n };\n /**\n * Whether to use the test mode. This prevents the credit card from being charged.\n */\n isTest: boolean;\n /*\n * Defines the usage pricing plan the merchant is subscribed to.\n */\n subscriptionLineItemId?: string;\n /*\n * A unique key generated to avoid duplicate charges.\n */\n idempotencyKey?: string;\n}"
},
"RequestBillingOptions": {
"filePath": "src/server/authenticate/admin/billing/types.ts",
Expand Down
Loading
Loading