feat(convex): add implementation rules and configuration for backend functions
- Introduced a comprehensive markdown document outlining implementation rules for Convex functions, including syntax, registration, HTTP endpoints, and TypeScript usage. - Created a new configuration file for the Convex app, integrating the Resend service. - Added a new HTTP route for handling Shippo webhooks to ensure proper response handling. - Implemented integration tests for order timeline events, covering various scenarios including order fulfillment and status changes. - Enhanced existing functions with type safety improvements and additional validation logic. This commit establishes clear guidelines for backend development and improves the overall structure and reliability of the Convex application.
This commit is contained in:
@@ -2,7 +2,7 @@ import { query, mutation } from "./_generated/server";
|
||||
import { v } from "convex/values";
|
||||
import * as Users from "./model/users";
|
||||
import { enrichProducts } from "./model/products";
|
||||
import type { Id } from "./_generated/dataModel";
|
||||
import type { Id, Doc } from "./_generated/dataModel";
|
||||
|
||||
export const list = query({
|
||||
args: {},
|
||||
@@ -18,7 +18,7 @@ export const list = query({
|
||||
const productIds = [...new Set(rows.map((r) => r.productId))];
|
||||
const products = (
|
||||
await Promise.all(productIds.map((id) => ctx.db.get(id)))
|
||||
).filter(Boolean) as Awaited<ReturnType<typeof ctx.db.get>>[];
|
||||
).filter((p): p is Doc<"products"> => p != null);
|
||||
|
||||
const enriched = await enrichProducts(ctx, products);
|
||||
const productMap = new Map(
|
||||
|
||||
Reference in New Issue
Block a user