From 48697569574b9e012e60cb5224d8530fafc939e0 Mon Sep 17 00:00:00 2001 From: blaisadmin Date: Wed, 7 Oct 2026 19:33:49 -0400 Subject: [PATCH] Removed memorialized note --- backend/src/app.ts | 6 +----- backend/src/db/schema.ts | 2 -- backend/src/docs/responses.ts | 2 +- backend/src/repositories/birdRepository.ts | 18 +++++++----------- backend/src/schemas.ts | 1 - backend/src/types.ts | 1 - frontend/src/App.tsx | 11 ----------- 7 files changed, 9 insertions(+), 32 deletions(-) diff --git a/backend/src/app.ts b/backend/src/app.ts index f542d76..5d62e8d 100644 --- a/backend/src/app.ts +++ b/backend/src/app.ts @@ -711,7 +711,6 @@ const normalizeBird = (row: BirdRow) => ({ publicProfileEnabled: row.public_profile_enabled ?? false, memorializedAt: row.memorialized_at, memorializedOn: row.memorialized_on, - memorialNote: row.memorial_note, notifyOnMemorialDay: row.notify_on_memorial_day, createdAt: row.created_at, latestWeightGrams: row.latest_weight_grams ? Number(row.latest_weight_grams) : null, @@ -1766,9 +1765,7 @@ const buildBirdMilestoneReminderCopy = (reminder: BirdMilestoneReminderCandidate yearCount > 0 ? `From our flock to yours, holding ${reminder.name}'s memory close on this ${formatOrdinal(yearCount)} memorial day.` : `From our flock to yours, holding ${reminder.name}'s memory close today.`, - body: reminder.memorial_note - ? reminder.memorial_note - : 'A quiet moment for the feathers, songs, routines, and happy memories that still stay with you.', + body: 'A quiet moment for the feathers, songs, routines, and happy memories that still stay with you.', milestoneLabel: yearCount > 0 ? `${formatOrdinal(yearCount)} Memorial Day` : 'Memorial Day on file', }; } @@ -4194,7 +4191,6 @@ app.post('/api/birds/:birdId/memorialize', requireAuth, requireWriteAccess, requ birdId: req.params.birdId, workspaceId: req.auth!.workspace.id, memorializedOn: parsed.data.memorializedOn, - memorialNote: emptyToNull(parsed.data.memorialNote), notifyOnMemorialDay: parsed.data.notifyOnMemorialDay ?? false, }); diff --git a/backend/src/db/schema.ts b/backend/src/db/schema.ts index ea182e8..51d8a84 100644 --- a/backend/src/db/schema.ts +++ b/backend/src/db/schema.ts @@ -269,7 +269,6 @@ export const ensureSchema = async (database: DatabaseClient = db) => { public_profile_enabled BOOLEAN NOT NULL DEFAULT FALSE, memorialized_at TIMESTAMPTZ, memorialized_on DATE, - memorial_note VARCHAR(1000), notify_on_memorial_day BOOLEAN NOT NULL DEFAULT FALSE, created_at TIMESTAMPTZ NOT NULL DEFAULT CURRENT_TIMESTAMP ); @@ -299,7 +298,6 @@ export const ensureSchema = async (database: DatabaseClient = db) => { ADD COLUMN IF NOT EXISTS public_profile_enabled BOOLEAN NOT NULL DEFAULT FALSE, ADD COLUMN IF NOT EXISTS memorialized_at TIMESTAMPTZ, ADD COLUMN IF NOT EXISTS memorialized_on DATE, - ADD COLUMN IF NOT EXISTS memorial_note VARCHAR(1000), ADD COLUMN IF NOT EXISTS notify_on_memorial_day BOOLEAN NOT NULL DEFAULT FALSE; ALTER TABLE birds diff --git a/backend/src/docs/responses.ts b/backend/src/docs/responses.ts index 7ac5d33..ef5a765 100644 --- a/backend/src/docs/responses.ts +++ b/backend/src/docs/responses.ts @@ -32,7 +32,7 @@ export const birdResponse = z.object({ photoDataUrl: text.describe('Photo URL or legacy data URL. Storage-backed URLs expire; refresh the bird list to obtain a new URL.'), photoObjectKey: text, photoContentType: text, photoUpdatedAt: timestamp.nullable(), notifyOnDob: z.boolean(), notifyOnGotchaDay: z.boolean(), publicProfileCode: text, publicProfileEnabled: z.boolean(), - memorializedAt: timestamp.nullable(), memorializedOn: date.nullable(), memorialNote: text, + memorializedAt: timestamp.nullable(), memorializedOn: date.nullable(), notifyOnMemorialDay: z.boolean(), createdAt: timestamp, latestWeightGrams: z.number().nullable(), latestRecordedOn: date.nullable(), }); diff --git a/backend/src/repositories/birdRepository.ts b/backend/src/repositories/birdRepository.ts index 5536c5c..77730d6 100644 --- a/backend/src/repositories/birdRepository.ts +++ b/backend/src/repositories/birdRepository.ts @@ -48,7 +48,6 @@ const birdSelectFields = ` birds.public_profile_enabled, birds.memorialized_at, birds.memorialized_on::text, - birds.memorial_note, birds.notify_on_memorial_day, birds.created_at, latest.weight_grams AS latest_weight_grams, @@ -544,7 +543,7 @@ export const createBird = async ({ const result = await db.query( `INSERT INTO birds (id, workspace_id, name, tag_id, species, motivators, demotivators, favorite_snack, location_label, location_details, vet_clinic_name, vet_clinic_address, vet_account_number, vet_doctor_name, gender, date_of_birth, gotcha_day, chart_color, photo_data_url, photo_object_key, photo_content_type, photo_updated_at, notify_on_dob, notify_on_gotcha_day, public_profile_code, public_profile_enabled) VALUES (COALESCE($1::uuid, gen_random_uuid()), $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15, $16, $17, $18, $19, $20, $21, $22, $23, $24, $25, $26) - RETURNING id, workspace_id, name, tag_id, species, motivators, demotivators, favorite_snack, location_label, location_details, vet_clinic_name, vet_clinic_address, vet_account_number, vet_doctor_name, gender, date_of_birth::text, gotcha_day::text, chart_color, photo_data_url, photo_object_key, photo_content_type, photo_updated_at, notify_on_dob, notify_on_gotcha_day, public_profile_code, public_profile_enabled, memorialized_at, memorialized_on::text, memorial_note, notify_on_memorial_day, created_at, NULL::text AS latest_weight_grams, NULL::text AS latest_recorded_on`, + RETURNING id, workspace_id, name, tag_id, species, motivators, demotivators, favorite_snack, location_label, location_details, vet_clinic_name, vet_clinic_address, vet_account_number, vet_doctor_name, gender, date_of_birth::text, gotcha_day::text, chart_color, photo_data_url, photo_object_key, photo_content_type, photo_updated_at, notify_on_dob, notify_on_gotcha_day, public_profile_code, public_profile_enabled, memorialized_at, memorialized_on::text, notify_on_memorial_day, created_at, NULL::text AS latest_weight_grams, NULL::text AS latest_recorded_on`, [ birdId ?? null, workspaceId, @@ -662,7 +661,7 @@ export const updateBird = async ({ WHERE id = $1 AND workspace_id = $26 AND memorialized_at IS NULL - RETURNING id, workspace_id, name, tag_id, species, motivators, demotivators, favorite_snack, location_label, location_details, vet_clinic_name, vet_clinic_address, vet_account_number, vet_doctor_name, gender, date_of_birth::text, gotcha_day::text, chart_color, photo_data_url, photo_object_key, photo_content_type, photo_updated_at, notify_on_dob, notify_on_gotcha_day, public_profile_code, public_profile_enabled, memorialized_at, memorialized_on::text, memorial_note, notify_on_memorial_day, created_at, + RETURNING id, workspace_id, name, tag_id, species, motivators, demotivators, favorite_snack, location_label, location_details, vet_clinic_name, vet_clinic_address, vet_account_number, vet_doctor_name, gender, date_of_birth::text, gotcha_day::text, chart_color, photo_data_url, photo_object_key, photo_content_type, photo_updated_at, notify_on_dob, notify_on_gotcha_day, public_profile_code, public_profile_enabled, memorialized_at, memorialized_on::text, notify_on_memorial_day, created_at, ( SELECT weight_grams::text FROM weight_records @@ -714,25 +713,22 @@ export const memorializeBird = async ({ birdId, workspaceId, memorializedOn, - memorialNote, notifyOnMemorialDay, }: { birdId: string; workspaceId: number; memorializedOn: string; - memorialNote: string | null; notifyOnMemorialDay: boolean; }) => { const result = await db.query( `UPDATE birds SET memorialized_at = CURRENT_TIMESTAMP, memorialized_on = $3, - memorial_note = $4, - notify_on_memorial_day = $5 + notify_on_memorial_day = $4 WHERE id = $1 AND workspace_id = $2 AND memorialized_at IS NULL - RETURNING id, workspace_id, name, tag_id, species, motivators, demotivators, favorite_snack, location_label, location_details, vet_clinic_name, vet_clinic_address, vet_account_number, vet_doctor_name, gender, date_of_birth::text, gotcha_day::text, chart_color, photo_data_url, photo_object_key, photo_content_type, photo_updated_at, notify_on_dob, notify_on_gotcha_day, public_profile_code, public_profile_enabled, memorialized_at, memorialized_on::text, memorial_note, notify_on_memorial_day, created_at, + RETURNING id, workspace_id, name, tag_id, species, motivators, demotivators, favorite_snack, location_label, location_details, vet_clinic_name, vet_clinic_address, vet_account_number, vet_doctor_name, gender, date_of_birth::text, gotcha_day::text, chart_color, photo_data_url, photo_object_key, photo_content_type, photo_updated_at, notify_on_dob, notify_on_gotcha_day, public_profile_code, public_profile_enabled, memorialized_at, memorialized_on::text, notify_on_memorial_day, created_at, ( SELECT weight_grams::text FROM weight_records @@ -747,7 +743,7 @@ export const memorializeBird = async ({ ORDER BY recorded_on DESC LIMIT 1 ) AS latest_recorded_on`, - [birdId, workspaceId, memorializedOn, memorialNote, notifyOnMemorialDay], + [birdId, workspaceId, memorializedOn, notifyOnMemorialDay], ); return result.rows[0] ?? null; @@ -768,7 +764,7 @@ export const updateMemorialReminderPreference = async ({ WHERE id = $1 AND workspace_id = $2 AND memorialized_at IS NOT NULL - RETURNING id, workspace_id, name, tag_id, species, motivators, demotivators, favorite_snack, location_label, location_details, vet_clinic_name, vet_clinic_address, vet_account_number, vet_doctor_name, gender, date_of_birth::text, gotcha_day::text, chart_color, photo_data_url, photo_object_key, photo_content_type, photo_updated_at, notify_on_dob, notify_on_gotcha_day, public_profile_code, public_profile_enabled, memorialized_at, memorialized_on::text, memorial_note, notify_on_memorial_day, created_at, + RETURNING id, workspace_id, name, tag_id, species, motivators, demotivators, favorite_snack, location_label, location_details, vet_clinic_name, vet_clinic_address, vet_account_number, vet_doctor_name, gender, date_of_birth::text, gotcha_day::text, chart_color, photo_data_url, photo_object_key, photo_content_type, photo_updated_at, notify_on_dob, notify_on_gotcha_day, public_profile_code, public_profile_enabled, memorialized_at, memorialized_on::text, notify_on_memorial_day, created_at, ( SELECT weight_grams::text FROM weight_records @@ -796,7 +792,7 @@ export const transferBirdToWorkspace = async (birdId: string, sourceWorkspaceId: WHERE id = $1 AND workspace_id = $2 AND memorialized_at IS NULL - RETURNING id, workspace_id, name, tag_id, species, motivators, demotivators, favorite_snack, location_label, location_details, vet_clinic_name, vet_clinic_address, vet_account_number, vet_doctor_name, gender, date_of_birth::text, gotcha_day::text, chart_color, photo_data_url, photo_object_key, photo_content_type, photo_updated_at, notify_on_dob, notify_on_gotcha_day, public_profile_code, public_profile_enabled, memorialized_at, memorialized_on::text, memorial_note, notify_on_memorial_day, created_at, + RETURNING id, workspace_id, name, tag_id, species, motivators, demotivators, favorite_snack, location_label, location_details, vet_clinic_name, vet_clinic_address, vet_account_number, vet_doctor_name, gender, date_of_birth::text, gotcha_day::text, chart_color, photo_data_url, photo_object_key, photo_content_type, photo_updated_at, notify_on_dob, notify_on_gotcha_day, public_profile_code, public_profile_enabled, memorialized_at, memorialized_on::text, notify_on_memorial_day, created_at, ( SELECT weight_grams::text FROM weight_records diff --git a/backend/src/schemas.ts b/backend/src/schemas.ts index dcfa7b2..106c610 100644 --- a/backend/src/schemas.ts +++ b/backend/src/schemas.ts @@ -129,7 +129,6 @@ export const birdSchema = z.object({ export const memorializeBirdSchema = z.object({ memorializedOn: dateStringSchema, - memorialNote: z.string().trim().max(1000).optional().or(z.literal('')), notifyOnMemorialDay: z.boolean().optional(), }); diff --git a/backend/src/types.ts b/backend/src/types.ts index 384b2f9..58da7b5 100644 --- a/backend/src/types.ts +++ b/backend/src/types.ts @@ -150,7 +150,6 @@ export type BirdRow = { public_profile_enabled: boolean; memorialized_at: string | null; memorialized_on: string | null; - memorial_note: string | null; notify_on_memorial_day: boolean; created_at: string; latest_weight_grams: string | null; diff --git a/frontend/src/App.tsx b/frontend/src/App.tsx index 9e1629b..1ce2ac1 100644 --- a/frontend/src/App.tsx +++ b/frontend/src/App.tsx @@ -65,7 +65,6 @@ type Bird = { publicProfileEnabled: boolean; memorializedAt: string | null; memorializedOn: string | null; - memorialNote: string | null; notifyOnMemorialDay: boolean; createdAt: string; latestWeightGrams: number | null; @@ -352,7 +351,6 @@ type PublicBirdProfile = { type MemorializeBirdFormState = { memorializedOn: string; - memorialNote: string; notifyOnMemorialDay: boolean; }; @@ -885,7 +883,6 @@ const emptyVeterinaryInfoForm: VeterinaryInfoFormState = { const emptyMemorializeBirdForm = (): MemorializeBirdFormState => ({ memorializedOn: new Date().toISOString().slice(0, 10), - memorialNote: '', notifyOnMemorialDay: false, }); @@ -7540,14 +7537,6 @@ function App() { required /> -