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
@@ -30,7 +30,13 @@ export class SupportPlanRepository extends Repository<SupportPlan> {
}
async getSupportPlansListUser() {
return this.find({ where: { isActive: true, deletedAt: IsNull() }, order: { price: "ASC" }, relations: { features: true } });
return this.createQueryBuilder("supportPlan")
.leftJoinAndSelect("supportPlan.features", "features")
.where("supportPlan.isActive = :isActive", { isActive: true })
.andWhere("supportPlan.deletedAt IS NULL")
.orderBy("supportPlan.price", "ASC")
.addOrderBy("features.featureKey", "ASC")
.getMany();
}
//***************************************** */
async getSupportPlanById(id: string) {