Commit eadd0553 authored by Fares's avatar Fares

fix(transfers): archive child/spouse from parent after separation

When a child separation completes, the child record now gets is_archived=1
so it no longer appears in the parent's family tree. Previously only status
was changed to 'separated' but the record remained visible.
Co-Authored-By: 's avatarClaude Opus 4.6 <noreply@anthropic.com>
parent b9933f68
...@@ -194,16 +194,20 @@ final class TransferProcessor ...@@ -194,16 +194,20 @@ final class TransferProcessor
null null
); );
// 6. Update source dependents // 6. Update source dependents — archive them from parent
if ($request['child_id']) { if ($request['child_id']) {
$db->update('children', [ $db->update('children', [
'status' => 'separated', 'status' => 'separated',
'classification'=> 'separated', 'classification'=> 'separated',
'is_archived' => 1,
'archived_at' => date('Y-m-d H:i:s'),
'updated_at' => date('Y-m-d H:i:s'), 'updated_at' => date('Y-m-d H:i:s'),
], '`id` = ?', [(int) $request['child_id']]); ], '`id` = ?', [(int) $request['child_id']]);
} elseif ($request['spouse_id']) { } elseif ($request['spouse_id']) {
$db->update('spouses', [ $db->update('spouses', [
'status' => 'separated', 'status' => 'separated',
'is_archived' => 1,
'archived_at' => date('Y-m-d H:i:s'),
'updated_at' => date('Y-m-d H:i:s'), 'updated_at' => date('Y-m-d H:i:s'),
], '`id` = ?', [(int) $request['spouse_id']]); ], '`id` = ?', [(int) $request['spouse_id']]);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment