diff --git a/app/Audit/ConcreteFormatters/AssignedSelectionPlanExtraQuestionTypeAuditLogFormatter.php b/app/Audit/ConcreteFormatters/AssignedSelectionPlanExtraQuestionTypeAuditLogFormatter.php new file mode 100644 index 000000000..10d093106 --- /dev/null +++ b/app/Audit/ConcreteFormatters/AssignedSelectionPlanExtraQuestionTypeAuditLogFormatter.php @@ -0,0 +1,80 @@ +getId() ?? 'unknown'; + + switch ($this->event_type) { + case IAuditStrategy::EVENT_ENTITY_CREATION: + $question_type = $subject->getQuestionType(); + $question_label = $question_type ? ($question_type->getLabel() ?? 'Unknown Question') : 'Unknown Question'; + $selection_plan = $subject->getSelectionPlan(); + $selection_plan_id = $selection_plan ? ($selection_plan->getId() ?? 'unknown') : 'unknown'; + $selection_plan_name = $selection_plan ? ($selection_plan->getName() ?? 'Unknown') : 'Unknown'; + $is_editable = $subject->isEditable() ? 'editable' : 'not editable'; + return sprintf( + "Assigned Selection Plan Extra Question (%s) '%s' created for selection plan %s '%s' as %s by user %s", + $id, + $question_label, + $selection_plan_id, + $selection_plan_name, + $is_editable, + $this->getUserInfo() + ); + + case IAuditStrategy::EVENT_ENTITY_UPDATE: + $question_type = $subject->getQuestionType(); + $question_label = $question_type ? ($question_type->getLabel() ?? 'Unknown Question') : 'Unknown Question'; + $change_details = $this->buildChangeDetails($change_set); + return sprintf( + "Assigned Selection Plan Extra Question (%s) '%s' updated: %s by user %s", + $id, + $question_label, + $change_details, + $this->getUserInfo() + ); + + case IAuditStrategy::EVENT_ENTITY_DELETION: + $question_type = $subject->getQuestionType(); + $question_label = $question_type ? ($question_type->getLabel() ?? 'Unknown Question') : 'Unknown Question'; + return sprintf( + "Assigned Selection Plan Extra Question (%s) '%s' was deleted by user %s", + $id, + $question_label, + $this->getUserInfo() + ); + } + } catch (\Exception $ex) { + Log::warning("AssignedSelectionPlanExtraQuestionTypeAuditLogFormatter error: " . $ex->getMessage()); + } + + return null; + } +} diff --git a/app/Audit/ConcreteFormatters/SelectionPlanAllowedEditablePresentationQuestionAuditLogFormatter.php b/app/Audit/ConcreteFormatters/SelectionPlanAllowedEditablePresentationQuestionAuditLogFormatter.php new file mode 100644 index 000000000..306b8d595 --- /dev/null +++ b/app/Audit/ConcreteFormatters/SelectionPlanAllowedEditablePresentationQuestionAuditLogFormatter.php @@ -0,0 +1,73 @@ +getId() ?? 'unknown'; + $type = $subject->getType() ?? 'Unknown Question Type'; + + switch ($this->event_type) { + case IAuditStrategy::EVENT_ENTITY_CREATION: + $selection_plan = $subject->getSelectionPlan(); + $selection_plan_id = $selection_plan ? ($selection_plan->getId() ?? 'unknown') : 'unknown'; + $selection_plan_name = $selection_plan ? ($selection_plan->getName() ?? 'Unknown') : 'Unknown'; + return sprintf( + "Selection Plan Allowed Editable Presentation Question (%s) type '%s' created for selection plan %s '%s' by user %s", + $id, + $type, + $selection_plan_id, + $selection_plan_name, + $this->getUserInfo() + ); + + case IAuditStrategy::EVENT_ENTITY_UPDATE: + $change_details = $this->buildChangeDetails($change_set); + return sprintf( + "Selection Plan Allowed Editable Presentation Question (%s) type '%s' updated: %s by user %s", + $id, + $type, + $change_details, + $this->getUserInfo() + ); + + case IAuditStrategy::EVENT_ENTITY_DELETION: + return sprintf( + "Selection Plan Allowed Editable Presentation Question (%s) type '%s' was deleted by user %s", + $id, + $type, + $this->getUserInfo() + ); + } + } catch (\Exception $ex) { + Log::warning("SelectionPlanAllowedEditablePresentationQuestionAuditLogFormatter error: " . $ex->getMessage()); + } + + return null; + } +} diff --git a/app/Audit/ConcreteFormatters/SelectionPlanAllowedPresentationQuestionAuditLogFormatter.php b/app/Audit/ConcreteFormatters/SelectionPlanAllowedPresentationQuestionAuditLogFormatter.php new file mode 100644 index 000000000..79256eb34 --- /dev/null +++ b/app/Audit/ConcreteFormatters/SelectionPlanAllowedPresentationQuestionAuditLogFormatter.php @@ -0,0 +1,73 @@ +getId() ?? 'unknown'; + $type = $subject->getType() ?? 'Unknown Question Type'; + + switch ($this->event_type) { + case IAuditStrategy::EVENT_ENTITY_CREATION: + $selection_plan = $subject->getSelectionPlan(); + $selection_plan_id = $selection_plan ? ($selection_plan->getId() ?? 'unknown') : 'unknown'; + $selection_plan_name = $selection_plan ? ($selection_plan->getName() ?? 'Unknown') : 'Unknown'; + return sprintf( + "Selection Plan Allowed Presentation Question (%s) type '%s' created for selection plan %s '%s' by user %s", + $id, + $type, + $selection_plan_id, + $selection_plan_name, + $this->getUserInfo() + ); + + case IAuditStrategy::EVENT_ENTITY_UPDATE: + $change_details = $this->buildChangeDetails($change_set); + return sprintf( + "Selection Plan Allowed Presentation Question (%s) type '%s' updated: %s by user %s", + $id, + $type, + $change_details, + $this->getUserInfo() + ); + + case IAuditStrategy::EVENT_ENTITY_DELETION: + return sprintf( + "Selection Plan Allowed Presentation Question (%s) type '%s' was deleted by user %s", + $id, + $type, + $this->getUserInfo() + ); + } + } catch (\Exception $ex) { + Log::warning("SelectionPlanAllowedPresentationQuestionAuditLogFormatter error: " . $ex->getMessage()); + } + + return null; + } +} diff --git a/app/Audit/ConcreteFormatters/SummitBookableVenueRoomAttributeTypeAuditLogFormatter.php b/app/Audit/ConcreteFormatters/SummitBookableVenueRoomAttributeTypeAuditLogFormatter.php new file mode 100644 index 000000000..2596e30c2 --- /dev/null +++ b/app/Audit/ConcreteFormatters/SummitBookableVenueRoomAttributeTypeAuditLogFormatter.php @@ -0,0 +1,70 @@ +getId() ?? 'unknown'; + $type = $subject->getType() ?? 'Unknown Type'; + + switch ($this->event_type) { + case IAuditStrategy::EVENT_ENTITY_CREATION: + $summit_id = $subject->getSummitId() ?? 'unknown'; + return sprintf( + "Summit Bookable Venue Room Attribute Type (%s) '%s' created for summit %s by user %s", + $id, + $type, + $summit_id, + $this->getUserInfo() + ); + + case IAuditStrategy::EVENT_ENTITY_UPDATE: + $change_details = $this->buildChangeDetails($change_set); + return sprintf( + "Summit Bookable Venue Room Attribute Type (%s) '%s' updated: %s by user %s", + $id, + $type, + $change_details, + $this->getUserInfo() + ); + + case IAuditStrategy::EVENT_ENTITY_DELETION: + return sprintf( + "Summit Bookable Venue Room Attribute Type (%s) '%s' was deleted by user %s", + $id, + $type, + $this->getUserInfo() + ); + } + } catch (\Exception $ex) { + Log::warning("SummitBookableVenueRoomAttributeTypeAuditLogFormatter error: " . $ex->getMessage()); + } + + return null; + } +} diff --git a/app/Audit/ConcreteFormatters/SummitRegistrationFeedMetadataAuditLogFormatter.php b/app/Audit/ConcreteFormatters/SummitRegistrationFeedMetadataAuditLogFormatter.php new file mode 100644 index 000000000..325c91320 --- /dev/null +++ b/app/Audit/ConcreteFormatters/SummitRegistrationFeedMetadataAuditLogFormatter.php @@ -0,0 +1,74 @@ +getId() ?? 'unknown'; + + switch ($this->event_type) { + case IAuditStrategy::EVENT_ENTITY_CREATION: + $key = $subject->getKey() ?? 'Unknown Key'; + $value = $subject->getValue() ?? 'Unknown Value'; + $summit_id = $subject->getSummitId() ?? 'unknown'; + return sprintf( + "Summit Registration Feed Metadata (%s) key '%s' value '%s' created for summit %s by user %s", + $id, + $key, + $value, + $summit_id, + $this->getUserInfo() + ); + + case IAuditStrategy::EVENT_ENTITY_UPDATE: + $key = $subject->getKey() ?? 'Unknown Key'; + $change_details = $this->buildChangeDetails($change_set); + return sprintf( + "Summit Registration Feed Metadata (%s) key '%s' updated: %s by user %s", + $id, + $key, + $change_details, + $this->getUserInfo() + ); + + case IAuditStrategy::EVENT_ENTITY_DELETION: + $key = $subject->getKey() ?? 'Unknown Key'; + return sprintf( + "Summit Registration Feed Metadata (%s) key '%s' was deleted by user %s", + $id, + $key, + $this->getUserInfo() + ); + } + } catch (\Exception $ex) { + Log::warning("SummitRegistrationFeedMetadataAuditLogFormatter error: " . $ex->getMessage()); + } + + return null; + } +} diff --git a/config/audit_log.php b/config/audit_log.php index 8923ec688..4488990f9 100644 --- a/config/audit_log.php +++ b/config/audit_log.php @@ -152,5 +152,25 @@ 'enabled' => true, 'strategy' => \App\Audit\ConcreteFormatters\SummitSelectedPresentationListAuditLogFormatter::class, ], + App\Models\Foundation\Summit\ExtraQuestions\AssignedSelectionPlanExtraQuestionType::class => [ + 'enabled' => true, + 'strategy' => \App\Audit\ConcreteFormatters\AssignedSelectionPlanExtraQuestionTypeAuditLogFormatter::class, + ], + App\Models\Foundation\Summit\SelectionPlanAllowedEditablePresentationQuestion::class => [ + 'enabled' => true, + 'strategy' => \App\Audit\ConcreteFormatters\SelectionPlanAllowedEditablePresentationQuestionAuditLogFormatter::class, + ], + App\Models\Foundation\Summit\SelectionPlanAllowedPresentationQuestion::class => [ + 'enabled' => true, + 'strategy' => \App\Audit\ConcreteFormatters\SelectionPlanAllowedPresentationQuestionAuditLogFormatter::class, + ], + \models\summit\SummitBookableVenueRoomAttributeType::class => [ + 'enabled' => true, + 'strategy' => \App\Audit\ConcreteFormatters\SummitBookableVenueRoomAttributeTypeAuditLogFormatter::class, + ], + App\Models\Foundation\Summit\Registration\SummitRegistrationFeedMetadata::class => [ + 'enabled' => true, + 'strategy' => \App\Audit\ConcreteFormatters\SummitRegistrationFeedMetadataAuditLogFormatter::class, + ], ] ];