-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merging the branch next into the branch main
- Loading branch information
Showing
115 changed files
with
21,459 additions
and
18,984 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import { IsArray, IsString } from 'class-validator'; | ||
|
||
export class CancelSubscriptionDto { | ||
@IsArray() | ||
@IsString({ each: true }) | ||
reasons: string[]; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 12 additions & 4 deletions
16
apps/api/src/app/user/usecases/checkout/checkout.usecase.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 10 additions & 3 deletions
13
apps/api/src/app/user/usecases/get-transaction-history/get-transaction-history.usecase.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 11 additions & 3 deletions
14
apps/api/src/app/user/usecases/retrive-payment-methods/retrive-payment-methods.usecase.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,19 @@ | ||
import { Injectable } from '@nestjs/common'; | ||
import { PaymentAPIService } from '@impler/services'; | ||
import { EnvironmentRepository } from '@impler/dal'; | ||
|
||
@Injectable() | ||
export class RetrievePaymentMethods { | ||
constructor(private paymentApiService: PaymentAPIService) {} | ||
constructor( | ||
private paymentApiService: PaymentAPIService, | ||
private environmentRepository: EnvironmentRepository | ||
) {} | ||
|
||
async execute(email: string) { | ||
return await this.paymentApiService.retriveUserPaymentMethods(email); | ||
async execute(projectId: string) { | ||
const teamOwner = await this.environmentRepository.getTeamOwnerDetails(projectId); | ||
|
||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment | ||
//@ts-ignore | ||
return await this.paymentApiService.retriveUserPaymentMethods(teamOwner._userId.email); | ||
} | ||
} |
15 changes: 12 additions & 3 deletions
15
apps/api/src/app/user/usecases/save-payment-intent-id/save-paymentintentid.usecase.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,20 @@ | ||
import { Injectable } from '@nestjs/common'; | ||
import { PaymentAPIService } from '@impler/services'; | ||
import { EnvironmentRepository } from '@impler/dal'; | ||
|
||
@Injectable() | ||
export class ConfirmIntentId { | ||
constructor(private paymentApiService: PaymentAPIService) {} | ||
constructor( | ||
private paymentApiService: PaymentAPIService, | ||
private environmentRepository: EnvironmentRepository | ||
) {} | ||
|
||
async execute(email: string, intentId: string) { | ||
return await this.paymentApiService.confirmPaymentIntentId(email, intentId); | ||
async execute(projectId: string, intentId: string) { | ||
const teamOwner = await this.environmentRepository.getTeamOwnerDetails(projectId); | ||
|
||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment | ||
//@ts-ignore | ||
|
||
return await this.paymentApiService.confirmPaymentIntentId(teamOwner._userId.email, intentId); | ||
} | ||
} |
14 changes: 11 additions & 3 deletions
14
apps/api/src/app/user/usecases/setup-payment-intent/setup-payment-intent.usecase.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,19 @@ | ||
import { Injectable } from '@nestjs/common'; | ||
import { PaymentAPIService } from '@impler/services'; | ||
import { EnvironmentRepository } from '@impler/dal'; | ||
|
||
@Injectable() | ||
export class UpdatePaymentMethod { | ||
constructor(private paymentApiService: PaymentAPIService) {} | ||
constructor( | ||
private paymentApiService: PaymentAPIService, | ||
private environmentRepository: EnvironmentRepository | ||
) {} | ||
|
||
async execute(email: string, paymentId: string) { | ||
return await this.paymentApiService.updatePaymentMethod(email, paymentId); | ||
async execute(projectId: string, paymentMethodId: string) { | ||
const teamOwner = await this.environmentRepository.getTeamOwnerDetails(projectId); | ||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment | ||
//@ts-ignore | ||
|
||
return await this.paymentApiService.updatePaymentMethod(teamOwner._userId.email, paymentMethodId); | ||
} | ||
} |
16 changes: 12 additions & 4 deletions
16
apps/api/src/app/user/usecases/subscription/subscription.usecase.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.