Skip to content

Open-source manufacturing ERP, MES and QMS. Quoting, MRP, inventory, shop floor, quality and lot/serial traceability on one Postgres schema, with a REST API and MCP server. Self-host or use Carbon Cloud.

feat: add logging to post receipt function

Brad Barbin3ecf02fe73b6
diff --git a/packages/database/supabase/functions/post-receipt/index.ts b/packages/database/supabase/functions/post-receipt/index.ts
index 9edebd919e..52dc95c87b 100644
--- a/packages/database/supabase/functions/post-receipt/index.ts
+++ b/packages/database/supabase/functions/post-receipt/index.ts
@@ -30,6 +30,9 @@ serve(async (req: Request) => {
const payload = await req.json();
const today = format(new Date(), "yyyy-MM-dd");
+ console.log(payload);
+ console.log(payloadValidator.safeParse(payload));
+
try {
const { receiptId, userId, companyId } = payloadValidator.parse(payload);
@@ -37,6 +40,7 @@ serve(async (req: Request) => {
function: "post-receipt",
receiptId,
userId,
+ companyId,
});
const client = await getSupabaseServiceRole(