import "reflect-metadata";
import { injectable } from "inversify";
import {
  NoopTracer,
  NoopLogger,
  type ITracer,
  type ILogger,
} from "@repo/core-shared/instrumentation";

import type { ISiteSettingsRepository } from "../../application/repositories/site-settings.repository.interface";
import type { SiteSettings } from "../../entities/models/site-settings";

@injectable()
export class MockSiteSettingsRepository implements ISiteSettingsRepository {
  private tracer: ITracer;
  private logger: ILogger;

  constructor(
    tracer: ITracer = new NoopTracer(),
    logger: ILogger = new NoopLogger(),
  ) {
    this.tracer = tracer;
    this.logger = logger;
    void this.logger; // currently unused; reserved for future mock-thrown captures
  }

  async getSiteSettings(): Promise<SiteSettings> {
    return this.tracer.startSpan(
      { name: "site-settings.getSiteSettings", op: "repository", attributes: {} },
      async (span) => {
        span.setAttribute("found", true);
        return {
          siteName: "My App",
          siteDescription: "A vertical-feature monorepo template",
        };
      },
    );
  }
}
