2020-09-17 23:49:22 +02:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* Invoice Ninja (https://invoiceninja.com).
|
|
|
|
*
|
|
|
|
* @link https://github.com/invoiceninja/invoiceninja source repository
|
|
|
|
*
|
|
|
|
* @copyright Copyright (c) 2020. Invoice Ninja LLC (https://invoiceninja.com)
|
|
|
|
*
|
|
|
|
* @license https://opensource.org/licenses/AAL
|
|
|
|
*/
|
|
|
|
|
|
|
|
namespace App\Transformers;
|
|
|
|
|
|
|
|
use App\Models\RecurringInvoiceInvitation;
|
|
|
|
use App\Utils\Traits\MakesHash;
|
|
|
|
|
|
|
|
class RecurringInvoiceInvitationTransformer extends EntityTransformer
|
|
|
|
{
|
|
|
|
use MakesHash;
|
|
|
|
|
|
|
|
public function transform(RecurringInvoiceInvitation $invitation)
|
|
|
|
{
|
|
|
|
return [
|
2020-10-05 23:46:47 +02:00
|
|
|
'id' => $this->encodePrimaryKey($invitation->id),
|
2020-09-17 23:49:22 +02:00
|
|
|
'client_contact_id' => $this->encodePrimaryKey($invitation->client_contact_id),
|
2020-10-05 23:46:47 +02:00
|
|
|
'key' => $invitation->key,
|
|
|
|
'link' => $invitation->getLink() ?: '',
|
|
|
|
'sent_date' => $invitation->sent_date ?: '',
|
|
|
|
'viewed_date' => $invitation->viewed_date ?: '',
|
|
|
|
'opened_date' => $invitation->opened_date ?: '',
|
2020-09-17 23:49:22 +02:00
|
|
|
'updated_at' => (int) $invitation->updated_at,
|
|
|
|
'archived_at' => (int) $invitation->deleted_at,
|
2020-10-05 23:46:47 +02:00
|
|
|
'created_at' => (int) $invitation->created_at,
|
2020-09-17 23:49:22 +02:00
|
|
|
];
|
|
|
|
}
|
|
|
|
}
|