2020-05-23 05:28:24 +02:00
|
|
|
<?php
|
|
|
|
/**
|
2020-09-06 11:38:10 +02:00
|
|
|
* Invoice Ninja (https://invoiceninja.com).
|
2020-05-23 05:28:24 +02:00
|
|
|
*
|
|
|
|
* @link https://github.com/invoiceninja/invoiceninja source repository
|
|
|
|
*
|
2022-04-27 05:20:41 +02:00
|
|
|
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
|
2020-05-23 05:28:24 +02:00
|
|
|
*
|
2021-06-16 08:58:16 +02:00
|
|
|
* @license https://www.elastic.co/licensing/elastic-license
|
2020-05-23 05:28:24 +02:00
|
|
|
*/
|
2020-09-06 11:38:10 +02:00
|
|
|
|
2020-05-23 05:28:24 +02:00
|
|
|
namespace App\Transformers;
|
|
|
|
|
|
|
|
use App\Models\PaymentTerm;
|
|
|
|
use App\Utils\Traits\MakesHash;
|
|
|
|
|
|
|
|
class PaymentTermTransformer extends EntityTransformer
|
|
|
|
{
|
|
|
|
use MakesHash;
|
|
|
|
|
|
|
|
public function transform(PaymentTerm $payment_term)
|
|
|
|
{
|
|
|
|
return [
|
|
|
|
'id' => (string) $this->encodePrimaryKey($payment_term->id),
|
|
|
|
'num_days' => (int) $payment_term->num_days,
|
2020-09-06 11:38:10 +02:00
|
|
|
'name' => (string) ctrans('texts.payment_terms_net').' '.$payment_term->getNumDays(),
|
2020-05-26 10:20:50 +02:00
|
|
|
'is_deleted' => (bool) $payment_term->is_deleted,
|
|
|
|
'created_at' => (int) $payment_term->created_at,
|
|
|
|
'updated_at' => (int) $payment_term->updated_at,
|
|
|
|
'archived_at' => (int) $payment_term->deleted_at,
|
2020-05-23 05:28:24 +02:00
|
|
|
];
|
|
|
|
}
|
|
|
|
}
|