import { Module } from "@nestjs/common";
import { TypeOrmModule } from "@nestjs/typeorm";

import { ContractRendererService } from "../../contracts/contract-renderer.service";
import { ContractTemplatesController } from "./contract-templates.controller";
import { ContractTemplatesRepository } from "./contract-templates.repository";
import { ContractTemplatesService } from "./contract-templates.service";
import { ContractTemplate } from "./entities/contract-template.entity";

@Module({
  imports: [TypeOrmModule.forFeature([ContractTemplate])],
  controllers: [ContractTemplatesController],
  providers: [
    ContractTemplatesRepository,
    ContractTemplatesService,
    // Stateless Handlebars renderer reused from src/contracts for previews.
    ContractRendererService,
  ],
  exports: [ContractTemplatesService],
})
export class ContractTemplatesModule {}
