Backend (Convex)
API — beauty
Generated catalog of Convex functions in convex/beauty/. Regenerated by `bun run docs:api`.
Auto-generated from source. Do not edit by hand — run
bun run docs:api.
query (12)
| Function | Description | Args |
|---|---|---|
dashboardGetBeautyProfileStats | Get beauty profile statistics for dashboard | {} |
dashboardSearchBeautyProfiles | Search beauty profiles by criteria | { skinType: v.optional(v.string()), hasConcern: v.optional(v.string()), limit: v.optional(v.number()), offset: v.optional(v.number()), } |
getAmRoutineSteps | Get AM routine steps in order | {} |
getBeautyTags | Get all product beauty tags Dashboard view with filtering options | { activeOnly: v.optional(v.boolean()), routineStep: v.optional(v.string()), limit: v.optional(v.number()), offset: v.optional(v.number()), } |
getPmRoutineSteps | Get PM routine steps in order | {} |
getProductBeautyTag | Get a single product beauty tag by ID | { tagId: v.id("productBeautyTags"), } |
getProductBeautyTags | Get beauty tags for a specific product | { productId: v.optional(v.id("shopifyProducts")), shopifyProductId: v.optional(v.string()), } |
getRoutineStepConfig | Get a specific routine step config by step name | { stepName: v.string(), } |
getRoutineStepConfigs | Get all routine step configurations Used by dashboard to manage step settings | { activeOnly: v.optional(v.boolean()), } |
mobileGetBeautyProfile | Get current user's beauty profile Returns null if user has no beauty profile | {} |
mobileGetProductRecommendations | Get personalized product recommendations based on beauty profile Returns routine-based recommendations organized by AM/PM steps. Uses concern mapping for fuzzy matching when exact concerns don't match. Response structure: { amRoutine: [{ step, displayName, description, recommendations: [...] }], pmRoutine: [{ step, displayName, description, recommendations: [...] }] } | { limit: v.optional(v.number()), // Max products per step } |
mobileIsBeautyProfileComplete | Check if user has completed their beauty profile A profile is considered complete if skinType is set | {} |
mutation (18)
| Function | Description | Args |
|---|---|---|
bulkUpdateRoutineStepDisplayOrder | Bulk update display order for routine steps Used for drag-and-drop reordering in dashboard | { updates: v.array( v.object({ id: v.id("routineStepConfigs"), amDisplayOrder: v.optional(v.number()), pmDisplayOrder: v.optional(v.number()), }) ), } |
createProductBeautyTag | Create a new product beauty tag | { productId: v.id("shopifyProducts"), shopifyProductId: v.string(), routineStep: routineStepValidator, skinTypes: v.array(productSkinTypeValidator), skinConc… |
createRoutineStepConfig | Create a new routine step configuration | { stepName: routineStepValidator, displayName: v.string(), description: v.optional(v.string()), iconUrl: v.optional(v.string()), isRequired: v.boolean(), isA… |
dashboardDeleteUserBeautyProfile | Delete a user's beauty profile (admin action) | { userId: v.string(), } |
deleteProductBeautyTag | Delete a product beauty tag | { id: v.id("productBeautyTags"), } |
deleteRoutineStepConfig | Delete a routine step configuration | { id: v.id("routineStepConfigs"), } |
mobileDeleteBeautyProfile | Delete user's beauty profile Clears all beauty-related data for the user | {} |
mobileUpdateCurrentRoutine | Update current routine steps Convenience mutation for onboarding flow | { currentRoutineSteps: v.array(v.string()), } |
mobileUpdateIngredientPreferences | Update ingredient preferences Sets preferred and avoided ingredients | { preferredIngredients: v.optional(v.array(v.string())), avoidedIngredients: v.optional(v.array(v.string())), } |
mobileUpdatePregnancyStatus | Update pregnancy status Convenience mutation for onboarding flow | { pregnancyStatus: v.optional(v.string()), } |
mobileUpdateSkinConcerns | Update only skin concerns (max 3) Convenience mutation for onboarding flow | { skinConcerns: v.array(v.string()), } |
mobileUpdateSkinType | Update only skin type Convenience mutation for onboarding flow Also auto-sets beautyProfileCompleted on userProfiles | { skinType: v.union( // New values v.literal("dry_normal"), v.literal("combination_dry"), v.literal("combination_oily"), v.literal("oily"), // Legacy values … |
mobileUpsertBeautyProfile | Create or update user's beauty profile This is the primary mutation for updating beauty profile. Validates: - Max 3 skin concerns - Valid skin type enum value | { skinType: skinTypeValidator, skinConcerns: v.optional(v.array(v.string())), skinTone: v.optional(v.string()), preferredIngredients: v.optional(v.array(v.st… |
toggleProductBeautyTagActive | Toggle active status for a product beauty tag | { id: v.id("productBeautyTags"), } |
toggleRoutineStepActive | Toggle active status for a routine step | { id: v.id("routineStepConfigs"), } |
updateProductBeautyTag | Update an existing product beauty tag | { id: v.id("productBeautyTags"), routineStep: v.optional(routineStepValidator), skinTypes: v.optional(v.array(productSkinTypeValidator)), skinConcerns: v.opt… |
updateProductBeautyTags | Bulk update product beauty tags for a product Replaces all tags for a product with new set | { productId: v.id("shopifyProducts"), shopifyProductId: v.string(), tags: v.array( v.object({ routineStep: routineStepValidator, skinTypes: v.array(productSk… |
updateRoutineStepConfig | Update an existing routine step configuration | { id: v.id("routineStepConfigs"), displayName: v.optional(v.string()), description: v.optional(v.string()), iconUrl: v.optional(v.string()), isRequired: v.op… |