import { makeCrudRoute } from "@open-mercato/shared/lib/crud/factory";
import { SalesOrder } from "../../data/entities.js";
import { E } from "../../../../generated/entities.ids.generated.js";
import { buildDocumentCrudOptions, buildDocumentOpenApi } from "../documents/factory.js";
const crud = makeCrudRoute(
  buildDocumentCrudOptions({
    kind: "order",
    entity: SalesOrder,
    entityId: E.sales.sales_order,
    numberField: "orderNumber",
    createCommandId: "sales.orders.create",
    updateCommandId: "sales.orders.update",
    deleteCommandId: "sales.orders.delete",
    manageFeature: "sales.orders.manage",
    viewFeature: "sales.orders.view"
  })
);
const metadata = crud.metadata;
const GET = crud.GET;
const POST = crud.POST;
const PUT = crud.PUT;
const DELETE = crud.DELETE;
const openApi = buildDocumentOpenApi({
  kind: "order",
  entity: SalesOrder,
  entityId: E.sales.sales_order,
  numberField: "orderNumber",
  createCommandId: "sales.orders.create",
  updateCommandId: "sales.orders.update",
  deleteCommandId: "sales.orders.delete",
  manageFeature: "sales.orders.manage",
  viewFeature: "sales.orders.view"
});
export {
  DELETE,
  GET,
  POST,
  PUT,
  metadata,
  openApi
};
//# sourceMappingURL=route.js.map
