mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-08 17:34:30 -04:00
entity history query
This commit is contained in:
parent
be00f173c4
commit
a8c7d49528
@ -53,7 +53,7 @@ class EmailHistoryController extends BaseController
|
|||||||
|
|
||||||
$data = SystemLog::where('company_id', $user->company()->id)
|
$data = SystemLog::where('company_id', $user->company()->id)
|
||||||
->where('category_id', SystemLog::CATEGORY_MAIL)
|
->where('category_id', SystemLog::CATEGORY_MAIL)
|
||||||
->whereJsonContains('log->history->entity', $this->encodePrimaryKey($request->entity))
|
->whereJsonContains('log->history->entity', $request->entity)
|
||||||
->whereJsonContains('log->history->entity_id', $this->encodePrimaryKey($request->entity_id))
|
->whereJsonContains('log->history->entity_id', $this->encodePrimaryKey($request->entity_id))
|
||||||
->orderBy('id', 'DESC')
|
->orderBy('id', 'DESC')
|
||||||
->cursor()
|
->cursor()
|
||||||
|
@ -69,7 +69,7 @@ class InvoiceEmailTest extends TestCase
|
|||||||
$system_log->log = [
|
$system_log->log = [
|
||||||
'history' => [
|
'history' => [
|
||||||
'entity_id' => $this->invoice->hashed_id,
|
'entity_id' => $this->invoice->hashed_id,
|
||||||
'entity_type' => 'invoice',
|
'entity' => 'invoice',
|
||||||
'subject' => 'Invoice #1',
|
'subject' => 'Invoice #1',
|
||||||
'events' => [
|
'events' => [
|
||||||
[
|
[
|
||||||
@ -96,7 +96,7 @@ class InvoiceEmailTest extends TestCase
|
|||||||
|
|
||||||
$arr = $response->json();
|
$arr = $response->json();
|
||||||
|
|
||||||
$this->assertEquals('invoice', $arr[0]['entity_type']);
|
$this->assertEquals('invoice', $arr[0]['entity']);
|
||||||
|
|
||||||
$count = SystemLog::where('client_id', $this->client->id)
|
$count = SystemLog::where('client_id', $this->client->id)
|
||||||
->where('category_id', SystemLog::CATEGORY_MAIL)
|
->where('category_id', SystemLog::CATEGORY_MAIL)
|
||||||
@ -117,7 +117,7 @@ class InvoiceEmailTest extends TestCase
|
|||||||
$system_log->log = [
|
$system_log->log = [
|
||||||
'history' => [
|
'history' => [
|
||||||
'entity_id' => $this->invoice->hashed_id,
|
'entity_id' => $this->invoice->hashed_id,
|
||||||
'entity_type' => 'invoice',
|
'entity' => 'invoice',
|
||||||
'subject' => 'Invoice #1',
|
'subject' => 'Invoice #1',
|
||||||
'events' => [
|
'events' => [
|
||||||
[
|
[
|
||||||
@ -147,8 +147,8 @@ class InvoiceEmailTest extends TestCase
|
|||||||
$response->assertStatus(200);
|
$response->assertStatus(200);
|
||||||
|
|
||||||
$arr = $response->json();
|
$arr = $response->json();
|
||||||
|
nlog($arr);
|
||||||
$this->assertEquals('invoice', $arr[0]['entity_type']);
|
$this->assertEquals('invoice', $arr[0]['entity']);
|
||||||
$this->assertEquals($this->invoice->hashed_id, $arr[0]['entity_id']);
|
$this->assertEquals($this->invoice->hashed_id, $arr[0]['entity_id']);
|
||||||
|
|
||||||
$count = SystemLog::where('company_id', $this->company->id)
|
$count = SystemLog::where('company_id', $this->company->id)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user