AOSSIE-Org / AOSSIE-Org/Ell-ena

BUG: User team can be changed even when referenced tickets exist

Offen
#237 1 Kommentar 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
Dart
Sterne
54
Forks
110
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

### Is there an existing issue for this?

- [x] I have searched the existing issues

### What happened?

## Problem
There is no database-level enforcement preventing a user's
team from being changed when tickets reference them as
created_by or assigned_to.

## Impact
Changing a user's team while they have tickets causes data
integrity issues — tickets end up referencing a user in a
different team than the ticket's team.

## Steps to Reproduce
1. Create a user in team A
2. Create a ticket with that user as created_by
3. Change the user's team to team B
4. Ticket now has created_by from a different team — no error thrown

## Expected Behavior
Database should raise an error and block the team change.

## Fix
Add prevent_user_team_change_if_tickets_exist() trigger
on users table.

### Record

- [x] I agree to follow this project's Code of Conduct
- [x] I want to work on this issue

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.