import { Injectable, Logger } from "@nestjs/common";

/**
 * Real Postmark/SES delivery is Phase 4 scope (§3 stack table). This dev
 * implementation logs the link instead of sending mail — every call site
 * depends only on this interface, so swapping in a real provider later
 * touches this one file.
 */
@Injectable()
export class EmailService {
  private readonly logger = new Logger(EmailService.name);

  async sendVerificationEmail(to: string, token: string): Promise<void> {
    this.logger.log(`[dev] verify email for ${to}: /auth/verify-email?token=${token}`);
  }

  async sendPasswordResetEmail(to: string, token: string): Promise<void> {
    this.logger.log(`[dev] password reset for ${to}: /auth/reset-password?token=${token}`);
  }

  async sendMagicLinkEmail(to: string, token: string): Promise<void> {
    this.logger.log(`[dev] magic link for ${to}: /auth/magic-link?token=${token}`);
  }

  async sendInviteEmail(to: string, workspaceName: string, token: string): Promise<void> {
    this.logger.log(`[dev] invite to ${workspaceName} for ${to}: /invite?token=${token}`);
  }
}
