Generacion de docs

This commit is contained in:
2026-03-10 15:44:48 +01:00
parent 863fed0350
commit fb4563b44a
5 changed files with 236 additions and 2 deletions

View File

@@ -2,7 +2,6 @@ import type { ServerContext } from "domain/ServerContext.js";
import type { NfcUsecases } from "./Nfc.usecases.js";
import type { Request, Response } from "express"
import { baseValidator } from "./validators.js";
import { error } from "node:console";
export class NfcController {
private ctx: ServerContext;
@@ -17,7 +16,7 @@ export class NfcController {
}
public generateActivationTag() {
return (req: Request, res: Response) => {
return async (req: Request, res: Response) => {
const body = req.body
const validate = baseValidator.validate(body)
@@ -28,6 +27,17 @@ export class NfcController {
return 1;
}
const { card_id, override } = body.card_id
const pormUsecase = this.nfcUsecases.generateActivationLabel()
const useCaseRes = await pormUsecase({ card_id, override })
if (useCaseRes.error != undefined) {
res.status(500).json({
error: useCaseRes.error
})
return 1;
}
return 0;