fix(cleanup): TODO-010 — replace hardcoded PRODUCT_ID with import from product-config

This commit is contained in:
saravanakumardb1 2026-04-13 14:56:57 -07:00
parent 8152d508d1
commit d74c80a711
5 changed files with 5 additions and 21 deletions

View File

@ -30,10 +30,7 @@ import {
type HouseholdInvite, type HouseholdInvite,
} from './types.js'; } from './types.js';
// TODO-010: Import PRODUCT_ID from product-config instead of hardcoding import { PRODUCT_ID } from '../../lib/product-config.js';
// Priority: low | Phase: cleanup
// Replace this line with: import { PRODUCT_ID } from '../../lib/product-config.js';
const PRODUCT_ID = 'chronomind';
function isAdmin(household: HouseholdDoc, userId: string): boolean { function isAdmin(household: HouseholdDoc, userId: string): boolean {
return household.members.some(m => m.userId === userId && m.role === 'admin'); return household.members.some(m => m.userId === userId && m.role === 'admin');

View File

@ -24,10 +24,7 @@ import {
type RoutineDoc, type RoutineDoc,
} from './types.js'; } from './types.js';
// TODO-010: Import PRODUCT_ID from product-config instead of hardcoding import { PRODUCT_ID } from '../../lib/product-config.js';
// Priority: low | Phase: cleanup
// Replace this line with: import { PRODUCT_ID } from '../../lib/product-config.js';
const PRODUCT_ID = 'chronomind';
export async function routineRoutes(app: FastifyInstance) { export async function routineRoutes(app: FastifyInstance) {
// Sync — must be before :id param route // Sync — must be before :id param route

View File

@ -25,10 +25,7 @@ import {
type SharedTimerDoc, type SharedTimerDoc,
} from './types.js'; } from './types.js';
// TODO-010: Import PRODUCT_ID from product-config instead of hardcoding import { PRODUCT_ID } from '../../lib/product-config.js';
// Priority: low | Phase: cleanup
// Replace this line with: import { PRODUCT_ID } from '../../lib/product-config.js';
const PRODUCT_ID = 'chronomind';
async function requireMembership(householdId: string, userId: string) { async function requireMembership(householdId: string, userId: string) {
const household = await getHousehold(householdId); const household = await getHousehold(householdId);

View File

@ -28,11 +28,7 @@ import {
type FreeSlot, type FreeSlot,
} from './types.js'; } from './types.js';
// TODO-010: Import PRODUCT_ID from product-config instead of hardcoding import { PRODUCT_ID } from '../../lib/product-config.js';
// Priority: low | Phase: cleanup
// Replace this line with: import { PRODUCT_ID } from '../../lib/product-config.js';
// Same fix needed in: routines/routes.ts, households/routes.ts, webhooks/routes.ts, shared-timers/routes.ts
const PRODUCT_ID = 'chronomind';
export async function timerRoutes(app: FastifyInstance) { export async function timerRoutes(app: FastifyInstance) {
// Sync — must be before :id param route // Sync — must be before :id param route

View File

@ -10,10 +10,7 @@ import { dispatchEvent } from './dispatcher.js';
import { extractAuth } from '../../lib/auth.js'; import { extractAuth } from '../../lib/auth.js';
import { BadRequestError } from '@bytelyst/errors'; import { BadRequestError } from '@bytelyst/errors';
// TODO-010: Import PRODUCT_ID from product-config instead of hardcoding import { PRODUCT_ID } from '../../lib/product-config.js';
// Priority: low | Phase: cleanup
// Replace this line with: import { PRODUCT_ID } from '../../lib/product-config.js';
const PRODUCT_ID = 'chronomind';
export async function webhookRoutes(app: FastifyInstance) { export async function webhookRoutes(app: FastifyInstance) {
// Event types — must be before :id param route // Event types — must be before :id param route