2019-12-20 12:23:09 +01:00
|
|
|
<?php
|
|
|
|
/**
|
2020-09-06 11:38:10 +02:00
|
|
|
* Invoice Ninja (https://invoiceninja.com).
|
2019-12-20 12:23:09 +01:00
|
|
|
*
|
|
|
|
* @link https://github.com/invoiceninja/invoiceninja source repository
|
|
|
|
*
|
2021-01-03 22:54:54 +01:00
|
|
|
* @copyright Copyright (c) 2021. Invoice Ninja LLC (https://invoiceninja.com)
|
2019-12-20 12:23:09 +01:00
|
|
|
*
|
|
|
|
* @license https://opensource.org/licenses/AAL
|
|
|
|
*/
|
|
|
|
|
|
|
|
namespace App\Transformers;
|
|
|
|
|
|
|
|
use App\Models\QuoteInvitation;
|
|
|
|
use App\Utils\Traits\MakesHash;
|
|
|
|
|
|
|
|
class QuoteInvitationTransformer extends EntityTransformer
|
|
|
|
{
|
|
|
|
use MakesHash;
|
|
|
|
|
|
|
|
public function transform(QuoteInvitation $invitation)
|
|
|
|
{
|
|
|
|
return [
|
|
|
|
'id' => $this->encodePrimaryKey($invitation->id),
|
|
|
|
'client_contact_id' => $this->encodePrimaryKey($invitation->client_contact_id),
|
|
|
|
'key' => $invitation->key,
|
|
|
|
'link' => $invitation->getLink() ?: '',
|
|
|
|
'sent_date' => $invitation->sent_date ?: '',
|
|
|
|
'viewed_date' => $invitation->viewed_date ?: '',
|
|
|
|
'opened_date' => $invitation->opened_date ?: '',
|
2020-02-26 07:37:38 +01:00
|
|
|
'updated_at' => (int) $invitation->updated_at,
|
|
|
|
'archived_at' => (int) $invitation->deleted_at,
|
2020-02-27 00:32:44 +01:00
|
|
|
'created_at' => (int) $invitation->created_at,
|
2021-02-25 22:06:43 +01:00
|
|
|
'email_status' => $invitation->email_status,
|
|
|
|
'email_error' => (string)$invitation->email_error,
|
2019-12-20 12:23:09 +01:00
|
|
|
];
|
|
|
|
}
|
|
|
|
}
|