feat: add archived application text field to EinundzwanzigPleb model

This commit introduces a new field `archived_application_text` to the EinundzwanzigPleb model. The application text of a Pleb is now archived before the association status is updated and the application text is set to null. A migration file is also added to update the database schema.
This commit is contained in:
fsociety
2024-09-30 19:16:06 +02:00
parent f91313b6f5
commit 265ed40839
2 changed files with 29 additions and 0 deletions

View File

@@ -140,8 +140,10 @@ final class EinundzwanzigPlebTable extends PowerGridComponent
{
$pleb = EinundzwanzigPleb::query()->findOrFail($rowId);
$for = $pleb->application_for;
$text = $pleb->application_text;
$pleb->association_status = AssociationStatus::from($for);
$pleb->application_for = null;
$pleb->archived_application_text = $text;
$pleb->application_text = null;
$pleb->save();