"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.generateAuthorizationService = generateAuthorizationService;
const generator_1 = require("@postxl/generator");
function generateAuthorizationService({ actions, database, types }) {
    const imports = generator_1.ImportGenerator.from(actions.authorization.service.location)
        .add(database.service)
        .addType(actions.summary.action)
        .addType(types.user)
        .addType(actions.execution.interface);
    return /* ts */ `
import { Injectable, Logger } from '@nestjs/common'

${imports.generate()}

type AuthorizationContext = {
  action: Action
  user: User
  execution: IActionExecution
}

@Injectable()
export class ${actions.authorization.service.name} {
  private readonly _logger = new Logger(${actions.authorization.service.name}.name)

  constructor(private readonly databaseService: DatabaseService) {}

  public async authorizeAction({ action: _action, user: _user, execution: _execution }: AuthorizationContext): Promise<boolean> {
    return Promise.resolve(true) // NOSONAR
  }

}
`;
}
//# sourceMappingURL=authorization-service.generator.js.map