import { Router } from "express";
import { generateUniquePin } from "../utils/generateScannerPin.utils.js";
import { apiReturn } from "../utils/returnHelper.utils.js";

const r = Router();

r.get("/new", async (_, res) => {
	const getPin = await generateUniquePin();

	return apiReturn(res, {
		success: getPin.success,
		level: getPin.level,
		module: "mobile",
		subModule: "auth",
		message: getPin.message,
		data: getPin.data,
		status: getPin.success ? 200 : 400,
	});
});

export default r;
