chore: bootstrap module from working instance and add install guide

This commit is contained in:
Kelin Rescue Hub
2026-04-09 14:18:10 -04:00
parent 97ad7da6f4
commit 6cda47760e
35 changed files with 6267 additions and 4 deletions

View File

@@ -0,0 +1,43 @@
<?php
namespace humhub\modules\donations\models;
use humhub\components\ActiveRecord;
class DonationWebhookEvent extends ActiveRecord
{
public static function tableName()
{
return 'rescue_donation_webhook_event';
}
public function rules()
{
return [
[['provider', 'provider_event_id'], 'required'],
[['is_processed'], 'integer'],
[['payload_json'], 'string'],
[['provider'], 'string', 'max' => 32],
[['provider_event_id'], 'string', 'max' => 190],
[['event_type'], 'string', 'max' => 120],
[['provider', 'provider_event_id'], 'unique', 'targetAttribute' => ['provider', 'provider_event_id']],
];
}
public function beforeSave($insert)
{
if (!parent::beforeSave($insert)) {
return false;
}
if ($insert && empty($this->created_at)) {
$this->created_at = date('Y-m-d H:i:s');
}
if ($this->is_processed === null) {
$this->is_processed = 0;
}
return true;
}
}