refactor: replace custom CRM with Monica fork
Some checks failed
Build & Push Monica Image to Gitea Registry / build-and-push (push) Failing after 9s
Some checks failed
Build & Push Monica Image to Gitea Registry / build-and-push (push) Failing after 9s
This commit is contained in:
50
app/ExportResources/Journal/JournalEntry.php
Normal file
50
app/ExportResources/Journal/JournalEntry.php
Normal file
@@ -0,0 +1,50 @@
|
||||
<?php
|
||||
|
||||
namespace App\ExportResources\Journal;
|
||||
|
||||
use App\ExportResources\ExportResource;
|
||||
|
||||
class JournalEntry extends ExportResource
|
||||
{
|
||||
protected $columns = [
|
||||
'created_at',
|
||||
'updated_at',
|
||||
];
|
||||
|
||||
protected $properties = [
|
||||
'date',
|
||||
];
|
||||
|
||||
public function data(): ?array
|
||||
{
|
||||
$data = $this->getObjectData();
|
||||
if ($data !== null) {
|
||||
switch ($data['type']) {
|
||||
case 'entry':
|
||||
return [
|
||||
'uuid' => $this->journalable->uuid,
|
||||
'properties' => [
|
||||
'type' => $data['type'],
|
||||
'title' => $data['title'],
|
||||
'post' => $data['post'],
|
||||
'date' => $data['date'],
|
||||
],
|
||||
];
|
||||
case 'day':
|
||||
return [
|
||||
'uuid' => $this->journalable->uuid,
|
||||
'properties' => [
|
||||
'type' => $data['type'],
|
||||
'rate' => $data['rate'],
|
||||
'comment' => $data['comment'],
|
||||
'day' => $data['day'],
|
||||
'month' => $data['month'],
|
||||
'year' => $data['year'],
|
||||
],
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user