chore: add new feature to the enum key for support plan
This commit is contained in:
@@ -2,6 +2,7 @@ import { Decimal } from "decimal.js";
|
|||||||
import { Column, DeleteDateColumn, Entity, OneToMany } from "typeorm";
|
import { Column, DeleteDateColumn, Entity, OneToMany } from "typeorm";
|
||||||
|
|
||||||
import { SupportPlanFeature } from "./support-plan-feature.entity";
|
import { SupportPlanFeature } from "./support-plan-feature.entity";
|
||||||
|
import { UserSupportPlan } from "./user-support-plan.entity";
|
||||||
import { BaseEntity } from "../../../common/entities/base.entity";
|
import { BaseEntity } from "../../../common/entities/base.entity";
|
||||||
import { DecimalTransformer } from "../../../common/transformers/decimal.transformer";
|
import { DecimalTransformer } from "../../../common/transformers/decimal.transformer";
|
||||||
@Entity()
|
@Entity()
|
||||||
@@ -27,6 +28,9 @@ export class SupportPlan extends BaseEntity {
|
|||||||
@OneToMany(() => SupportPlanFeature, (feature) => feature.supportPlan, { cascade: true })
|
@OneToMany(() => SupportPlanFeature, (feature) => feature.supportPlan, { cascade: true })
|
||||||
features: SupportPlanFeature[];
|
features: SupportPlanFeature[];
|
||||||
|
|
||||||
|
@OneToMany(() => UserSupportPlan, (userSupportPlan) => userSupportPlan.supportPlan)
|
||||||
|
users: UserSupportPlan[];
|
||||||
|
|
||||||
@DeleteDateColumn({ nullable: true })
|
@DeleteDateColumn({ nullable: true })
|
||||||
deletedAt?: Date;
|
deletedAt?: Date;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,11 +1,13 @@
|
|||||||
export enum SupportPlanFeatureKey {
|
export enum SupportPlanFeatureKey {
|
||||||
LEARNING_DOCS = "learning_docs", // راهنما و مستندات آموزشی
|
LEARNING_DOCS = "learning_docs", // راهنما و مستندات آموزشی
|
||||||
TICKET_SUPPORT = "ticket_support", // ارسال تیکت
|
TICKET_SUPPORT = "ticket_support", // ارسال تیکت
|
||||||
|
TICKET_LIMIT = "ticket_limit", // ظرفیت ارسال تیکت
|
||||||
RESPONSE_TIME = "response_time", // زمان پاسخگویی به تیکت
|
RESPONSE_TIME = "response_time", // زمان پاسخگویی به تیکت
|
||||||
PHONE_SUPPORT = "phone_support", // پاسخگویی تلفنی
|
PHONE_SUPPORT = "phone_support", // پاسخگویی تلفنی
|
||||||
BACKUP_VERSION = "backup_version", // نسخه بکاپ
|
TECHNICAL_ISSUE_RESOLUTION = "technical_issue_resolution", // رفع ایراد فنی
|
||||||
TECHNICAL_EXPERT_ACCESS = "technical_expert_access", // دسترسی به متخصصین فنی
|
TECHNICAL_EXPERT_ACCESS = "technical_expert_access", // دسترسی به متخصصین فنی
|
||||||
|
BACKUP_VERSION = "backup_version", // نسخه بکاپ
|
||||||
|
SERVICE_FUNCTIONALITY_TEST = "service_functionality_test", // تست عملکرد سرویس
|
||||||
ON_SITE_SUPPORT = "on_site_support", // پشتیبانی در محل
|
ON_SITE_SUPPORT = "on_site_support", // پشتیبانی در محل
|
||||||
ON_SITE_TRAINING = "on_site_training", // آموزش در محل
|
ON_SITE_TRAINING = "on_site_training", // آموزش در محل
|
||||||
TICKET_LIMIT = "ticket_limit", // ظرفیت ارسال تیکت
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ export class SupportPlanRepository extends Repository<SupportPlan> {
|
|||||||
async getSupportPlansListAdmin(queryDto: GetSupportPlanListQueryDto) {
|
async getSupportPlansListAdmin(queryDto: GetSupportPlanListQueryDto) {
|
||||||
const { limit, skip } = PaginationUtils(queryDto);
|
const { limit, skip } = PaginationUtils(queryDto);
|
||||||
const query = this.createQueryBuilder("supportPlan").where("supportPlan.deletedAt IS NULL");
|
const query = this.createQueryBuilder("supportPlan").where("supportPlan.deletedAt IS NULL");
|
||||||
|
query.loadRelationCountAndMap("supportPlan.userCount", "supportPlan.users");
|
||||||
|
|
||||||
if (queryDto.q) {
|
if (queryDto.q) {
|
||||||
query.andWhere("supportPlan.name ILIKE :q OR supportPlan.description ILIKE :q", { q: `%${queryDto.q}%` });
|
query.andWhere("supportPlan.name ILIKE :q OR supportPlan.description ILIKE :q", { q: `%${queryDto.q}%` });
|
||||||
|
|||||||
Reference in New Issue
Block a user