chore: add new structure for the ticket assinge to admins
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
import { Injectable } from "@nestjs/common";
|
||||
|
||||
import { IReferralStrategy } from "../interfaces/referral-strategy";
|
||||
import { GroupStrategy } from "../strategies/group.strategy";
|
||||
import { RoundRobinStrategy } from "../strategies/round-robin.strategy";
|
||||
|
||||
export enum ReferralStrategyType {
|
||||
GROUP = "GROUP",
|
||||
ROUND_ROBIN = "ROUND_ROBIN",
|
||||
}
|
||||
|
||||
@Injectable()
|
||||
export class ReferralStrategyFactory {
|
||||
constructor(
|
||||
private readonly groupStrategy: GroupStrategy,
|
||||
private readonly roundRobinStrategy: RoundRobinStrategy,
|
||||
) {}
|
||||
|
||||
getStrategy(type: ReferralStrategyType): IReferralStrategy {
|
||||
switch (type) {
|
||||
case ReferralStrategyType.GROUP:
|
||||
return this.groupStrategy;
|
||||
case ReferralStrategyType.ROUND_ROBIN:
|
||||
return this.roundRobinStrategy;
|
||||
default:
|
||||
return this.groupStrategy; // Default to group strategy
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user