Skip to content

Commit 07a21c1

Browse files
authored
Merge pull request #256 from robindirksen1/missing-contact-people
Add `contact_people` to contact entity
2 parents 2aaae0d + 3dce379 commit 07a21c1

File tree

2 files changed

+46
-2
lines changed

2 files changed

+46
-2
lines changed

src/Picqer/Financials/Moneybird/Entities/Contact.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
*
1919
* @property string $id
2020
* @property ContactCustomField[] $custom_fields
21+
* @property ContactPeople[] $contact_people
2122
*/
2223
class Contact extends Model
2324
{
@@ -66,6 +67,7 @@ class Contact extends Model
6667
'updated_at',
6768
'notes',
6869
'custom_fields',
70+
'contact_people',
6971
'version',
7072
];
7173

@@ -77,12 +79,12 @@ class Contact extends Model
7779
/**
7880
* @var string
7981
*/
80-
protected $filter_endpoint = 'contacts/filter';
82+
protected $namespace = 'contact';
8183

8284
/**
8385
* @var string
8486
*/
85-
protected $namespace = 'contact';
87+
protected $filter_endpoint = 'contacts/filter';
8688

8789
/**
8890
* @var array
@@ -92,6 +94,10 @@ class Contact extends Model
9294
'entity' => ContactCustomField::class,
9395
'type' => self::NESTING_TYPE_NESTED_OBJECTS,
9496
],
97+
'contact_people' => [
98+
'entity' => ContactPeople::class,
99+
'type' => self::NESTING_TYPE_NESTED_OBJECTS,
100+
],
95101
];
96102

97103
/**
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
<?php
2+
3+
namespace Picqer\Financials\Moneybird\Entities;
4+
5+
use Picqer\Financials\Moneybird\Model;
6+
7+
/**
8+
* Class ContactPeople.
9+
*
10+
* @property string $id
11+
* @property string $administration_id
12+
* @property string $firstname
13+
* @property string lastname
14+
* @property string phone
15+
* @property string email
16+
* @property string department
17+
* @property string created_at
18+
* @property string updated_at
19+
* @property string version
20+
*/
21+
class ContactPeople extends Model
22+
{
23+
/**
24+
* @var array
25+
*/
26+
protected $fillable = [
27+
'id',
28+
'administration_id',
29+
'firstname',
30+
'lastname',
31+
'phone',
32+
'email',
33+
'department',
34+
'created_at',
35+
'updated_at',
36+
'version',
37+
];
38+
}

0 commit comments

Comments
 (0)