forked from Yara724/api
YARA-898
This commit is contained in:
37
src/media-policy/media-policy.module.ts
Normal file
37
src/media-policy/media-policy.module.ts
Normal file
@@ -0,0 +1,37 @@
|
||||
import { Module } from "@nestjs/common";
|
||||
import { MongooseModule } from "@nestjs/mongoose";
|
||||
|
||||
import { ClientModule } from "src/client/client.module";
|
||||
import {
|
||||
ClaimCase,
|
||||
ClaimCaseSchema,
|
||||
} from "src/claim-request-management/entites/schema/claim-cases.schema";
|
||||
import {
|
||||
BlameRequest,
|
||||
BlameRequestSchema,
|
||||
} from "src/request-management/entities/schema/blame-cases.schema";
|
||||
|
||||
import { MediaPolicyService } from "./media-policy.service";
|
||||
|
||||
/**
|
||||
* Stand-alone module so we can inject `MediaPolicyService` into both the
|
||||
* blame and claim V2 controllers without dragging the entire
|
||||
* `RequestManagementModule` / `ClaimRequestManagementModule` graph along
|
||||
* (which would risk a circular dependency).
|
||||
*
|
||||
* The schemas are registered directly via `MongooseModule.forFeature` —
|
||||
* Mongoose deduplicates models behind the scenes so a second registration
|
||||
* does not create a separate model.
|
||||
*/
|
||||
@Module({
|
||||
imports: [
|
||||
ClientModule,
|
||||
MongooseModule.forFeature([
|
||||
{ name: BlameRequest.name, schema: BlameRequestSchema },
|
||||
{ name: ClaimCase.name, schema: ClaimCaseSchema },
|
||||
]),
|
||||
],
|
||||
providers: [MediaPolicyService],
|
||||
exports: [MediaPolicyService],
|
||||
})
|
||||
export class MediaPolicyModule {}
|
||||
Reference in New Issue
Block a user