fix: guard task status updates on invoice lifecycle transitions

Prevent overwriting task status when task has moved to a new revision
cycle after being invoiced. Now uses .eq('status', guardStatus) to only
update tasks still at the expected prior state:
- invoice creation: only update tasks at client_approved → invoiced
- mark sent: only client_approved → invoiced
- mark paid: only invoiced → paid
- reopen: only paid → client_approved

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Krao Hasanee
2026-06-09 22:22:18 -05:00
parent 8b0cb31bc6
commit da0e5d5c39
4 changed files with 8 additions and 4 deletions
+2 -1
View File
@@ -24,7 +24,8 @@
"mcp__plugin_supabase_supabase__execute_sql",
"Bash(sed -n '88,100p' src/pages/Tasks.jsx)",
"Bash(sed -n '570,600p' src/pages/Tasks.jsx)",
"Bash(git commit -q -m 'fix: hide counter on All tab in projects table *)"
"Bash(git commit -q -m 'fix: hide counter on All tab in projects table *)",
"Bash(git commit -q -m 'fix: guard task status updates on invoice lifecycle transitions *)"
]
}
}