mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Create data mapper for cached data / billing context
This commit is contained in:
parent
6e714747bd
commit
d5ad6088f6
47
app/DataMapper/Billing/BillingContextMapper.php
Normal file
47
app/DataMapper/Billing/BillingContextMapper.php
Normal file
@ -0,0 +1,47 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Invoice Ninja (https://invoiceninja.com).
|
||||||
|
*
|
||||||
|
* @link https://github.com/invoiceninja/invoiceninja source repository
|
||||||
|
*
|
||||||
|
* @copyright Copyright (c) 2021. Invoice Ninja LLC (https://invoiceninja.com)
|
||||||
|
*
|
||||||
|
* @license https://opensource.org/licenses/AAL
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace App\DataMapper\Billing;
|
||||||
|
|
||||||
|
|
||||||
|
class BillingContextMapper
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* @var int
|
||||||
|
*/
|
||||||
|
public $billing_subscription_id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
|
public $email;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var int
|
||||||
|
*/
|
||||||
|
public $client_id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var int
|
||||||
|
*/
|
||||||
|
public $invoice_id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var string[]
|
||||||
|
*/
|
||||||
|
public $casts = [
|
||||||
|
'billing_subscription_id' => 'integer',
|
||||||
|
'email' => 'string',
|
||||||
|
'client_id' => 'integer',
|
||||||
|
'invoice_id' => 'integer',
|
||||||
|
];
|
||||||
|
}
|
@ -284,8 +284,7 @@ class BillingPortalPurchase extends Component
|
|||||||
'billing_subscription_id' => $this->billing_subscription->id,
|
'billing_subscription_id' => $this->billing_subscription->id,
|
||||||
'email' => $this->email ?? $this->contact->email,
|
'email' => $this->email ?? $this->contact->email,
|
||||||
'client_id' => $this->contact->client->id,
|
'client_id' => $this->contact->client->id,
|
||||||
'invoice_id' => $this->invoice->id,
|
'invoice_id' => $this->invoice->id],
|
||||||
'subscription_id' => $this->billing_subscription->id],
|
|
||||||
now()->addMinutes(60)
|
now()->addMinutes(60)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user