diff --git a/libs/stripe/src/lib/dto/update-subscription.dto.ts b/libs/stripe/src/lib/dto/update-subscription.dto.ts index 1346d84..2ae7927 100644 --- a/libs/stripe/src/lib/dto/update-subscription.dto.ts +++ b/libs/stripe/src/lib/dto/update-subscription.dto.ts @@ -60,6 +60,15 @@ export class SubscriptionUpdateItemDto { @IsOptional() @IsPositive() quantity?: number; + + @ApiPropertyOptional() + @IsOptional() + deleted?: boolean; + + @ApiPropertyOptional() + @IsOptional() + @IsString() + metadata?: Stripe.MetadataParam; } export class SubscriptionUpdateBillingThresholdsDto { diff --git a/libs/stripe/src/lib/stripe.service.ts b/libs/stripe/src/lib/stripe.service.ts index bc09c7d..04c7f59 100644 --- a/libs/stripe/src/lib/stripe.service.ts +++ b/libs/stripe/src/lib/stripe.service.ts @@ -751,8 +751,10 @@ export class StripeService { id: i.id, price: i.priceId, plan: i.planId, - quantity: i.quantity - })), + quantity: i.quantity, + deleted: i.deleted, + metadata: i.metadata, + } as Stripe.SubscriptionUpdateParams.Item)), add_invoice_items: dto.addInvoiceItems?.map(i => ({ price: i.priceId, quantity:i.quantity, @@ -1387,7 +1389,7 @@ export class StripeService { //#endregion //#region Test Clocks - async createTestClock(frozenTime: number = Date.now(), name = ''): Promise> { + async createTestClock(frozenTime: number, name = ''): Promise> { try { const testClock = await this.stripe.testHelpers.testClocks.create({ name,