chore: add new route to get user of support plan
This commit is contained in:
@@ -9,6 +9,7 @@ import { InvoicesService } from "../../invoices/providers/invoices.service";
|
||||
import { UsersService } from "../../users/providers/users.service";
|
||||
import { CreateSupportPlanDto } from "../DTO/create-support-plan.dto";
|
||||
import { GetSupportPlanListQueryDto } from "../DTO/get-support-plan-list-query.dto";
|
||||
import { SearchSupportPlanUsersQueryDto } from "../DTO/search-support-plan-users-query.dto";
|
||||
import { UpdateSupportPlanDto } from "../DTO/update-support-plan-feature.dto";
|
||||
import { UserSupportPlanStatus } from "../enums/user-support-plan-status.enum";
|
||||
import { SupportPlanFeatureRepository } from "../repositories/support-plan-feature.repository";
|
||||
@@ -181,12 +182,9 @@ export class SupportPlansService {
|
||||
}
|
||||
|
||||
//***************************************** */
|
||||
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 getSupportPlanUsers(supportPlanId: string, queryDto: SearchSupportPlanUsersQueryDto) {
|
||||
const [users, count] = await this.userSupportPlanRepo.getSupportPlanUsers(supportPlanId, queryDto);
|
||||
return { users, count, paginate: true };
|
||||
}
|
||||
//***************************************** */
|
||||
async upgradeSupportPlan(newPlanId: string, userId: string) {
|
||||
|
||||
Reference in New Issue
Block a user