import { EmailAddress, UniqueID } from "@repo/rdx-ddd";
import { NextFunction, Response } from "express";
import { RequestWithAuth } from "./auth-types";

export function mockUser(req: RequestWithAuth, res: Response, next: NextFunction) {
  if (process.env.NODE_ENV === "development") {
    req.user = {
      userId: UniqueID.create("9e4dc5b3-96b9-4968-9490-14bd032fec5f").data,
      email: EmailAddress.create("dev@example.com").data,
      companyId: UniqueID.create("5e4dc5b3-96b9-4968-9490-14bd032fec5f").data,
      roles: ["admin"],
    };
  }
  next();
}
