.
This commit is contained in:
parent
58affda516
commit
d1b7731b90
@ -2,10 +2,10 @@ import { ILogger, ModuleParams, validateRequest } from "@erp/core/api";
|
||||
import { Application, NextFunction, Request, Response, Router } from "express";
|
||||
import { Sequelize } from "sequelize";
|
||||
import {
|
||||
CreateCustomerInvoiceCommandSchema,
|
||||
CreateCustomerInvoiceRequestSchema,
|
||||
CustomerInvoiceListRequestSchema,
|
||||
DeleteCustomerInvoiceByIdQuerySchema,
|
||||
DeleteCustomerInvoiceByIdQuerySchema as GetCustomerInvoiceByIdQuerySchema,
|
||||
DeleteCustomerInvoiceByIdRequestSchema,
|
||||
GetCustomerInvoiceByIdRequestSchema,
|
||||
} from "../../../common/dto";
|
||||
import {
|
||||
buildCreateCustomerInvoicesController,
|
||||
@ -38,7 +38,7 @@ export const customerInvoicesRouter = (params: ModuleParams) => {
|
||||
"/:id",
|
||||
//checkTabContext,
|
||||
//checkUser,
|
||||
validateRequest(GetCustomerInvoiceByIdQuerySchema, "params"),
|
||||
validateRequest(GetCustomerInvoiceByIdRequestSchema, "params"),
|
||||
(req: Request, res: Response, next: NextFunction) => {
|
||||
buildGetCustomerInvoiceController(database).execute(req, res, next);
|
||||
}
|
||||
@ -48,7 +48,7 @@ export const customerInvoicesRouter = (params: ModuleParams) => {
|
||||
"/",
|
||||
//checkTabContext,
|
||||
//checkUser,
|
||||
validateRequest(CreateCustomerInvoiceCommandSchema),
|
||||
validateRequest(CreateCustomerInvoiceRequestSchema),
|
||||
(req: Request, res: Response, next: NextFunction) => {
|
||||
buildCreateCustomerInvoicesController(database).execute(req, res, next);
|
||||
}
|
||||
@ -68,7 +68,7 @@ export const customerInvoicesRouter = (params: ModuleParams) => {
|
||||
"/:id",
|
||||
//checkTabContext,
|
||||
//checkUser,
|
||||
validateRequest(DeleteCustomerInvoiceByIdQuerySchema, "params"),
|
||||
validateRequest(DeleteCustomerInvoiceByIdRequestSchema, "params"),
|
||||
(req: Request, res: Response, next: NextFunction) => {
|
||||
buildDeleteCustomerInvoiceController(database).execute(req, res, next);
|
||||
}
|
||||
|
||||
@ -6,8 +6,10 @@ import * as z from "zod/v4";
|
||||
*
|
||||
*/
|
||||
|
||||
export const DeleteCustomerByIdRequestSchema = z.object({
|
||||
export const DeleteCustomerInvoiceByIdRequestSchema = z.object({
|
||||
id: z.string(),
|
||||
});
|
||||
|
||||
export type DeleteCustomerByIdRequestDTO = z.infer<typeof DeleteCustomerByIdRequestSchema>;
|
||||
export type DeleteCustomerInvoiceByIdRequestDTO = z.infer<
|
||||
typeof DeleteCustomerInvoiceByIdRequestSchema
|
||||
>;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user