feat: add support plan features and user support plan functionality

This commit is contained in:
mahyargdz
2025-05-07 09:24:59 +03:30
parent 8b4267807b
commit 263de161b1
5 changed files with 65 additions and 5 deletions
@@ -173,6 +173,15 @@ export class SupportPlansService {
return { userSupportPlan };
}
//***************************************** */
async getUsersOfSupportPlan(supportPlanId: string) {
const users = await this.userSupportPlanRepo.find({
where: { supportPlan: { id: supportPlanId }, status: UserSupportPlanStatus.ACTIVE },
relations: { user: true, supportPlan: true },
});
return users;
}
//***************************************** */
async upgradeSupportPlan(newPlanId: string, userId: string) {
const queryRunner = this.dataSource.createQueryRunner();