From 3fe3f2edf2d65fbca75a38f0a884c934361e4539 Mon Sep 17 00:00:00 2001 From: Jimmy Puckett Date: Sat, 9 Dec 2023 19:22:59 -0500 Subject: [PATCH 1/5] Add Sla Model --- src/Sla.php | 59 +++++++++++++++++++++++++++++++++++++++++ src/Support/Builder.php | 4 +++ 2 files changed, 63 insertions(+) create mode 100644 src/Sla.php diff --git a/src/Sla.php b/src/Sla.php new file mode 100644 index 0000000..1ea57c7 --- /dev/null +++ b/src/Sla.php @@ -0,0 +1,59 @@ + 'int', + 'autoreleaselimit' => 'int', + 'autoreleaseoption' => 'bool', + 'dontsendholdreminders' => 'bool', + 'hoursaretechslocaltime' => 'bool', + 'id' => 'int', + 'response_reset_approval' => 'bool', + 'responsereset' => 'bool', + 'slstatusafterfirstwarning' => 'int', + 'slstatusaftersecondwarning' => 'int', + 'statusafterautorelease' => 'int', + 'trackslafixbytime' => 'bool', + 'trackslaresponsetime' => 'bool', + 'workday_id' => 'int', + ]; + + /** + * Path to API endpoint. + */ + protected string $path = '/sla'; +} diff --git a/src/Support/Builder.php b/src/Support/Builder.php index 101cba4..fa24c54 100644 --- a/src/Support/Builder.php +++ b/src/Support/Builder.php @@ -32,6 +32,7 @@ use Spinen\Halo\Quote; use Spinen\Halo\Report; use Spinen\Halo\Site; +use Spinen\Halo\Sla; use Spinen\Halo\Status; use Spinen\Halo\Supplier; use Spinen\Halo\Team; @@ -63,6 +64,7 @@ * @property Collection $quotes * @property Collection $reports * @property Collection $sites + * @property Collection $slas * @property Collection $statuses * @property Collection $suppliers * @property Collection $teams @@ -93,6 +95,7 @@ * @method self reports() * @method self search($for) * @method self sites() + * @method self slas() * @method self statuses() * @method self suppliers() * @method self teams() @@ -152,6 +155,7 @@ class Builder 'quotes' => Quote::class, 'reports' => Report::class, 'sites' => Site::class, + 'slas' => Sla::class, 'statuses' => Status::class, 'suppliers' => Supplier::class, 'teams' => Team::class, From 3297a43a85869bce824c8d8e91401292f7206cc0 Mon Sep 17 00:00:00 2001 From: Jimmy Puckett Date: Sat, 9 Dec 2023 19:23:56 -0500 Subject: [PATCH 2/5] Add Workday model --- src/Support/Builder.php | 4 ++ src/Workday.php | 85 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 89 insertions(+) create mode 100644 src/Workday.php diff --git a/src/Support/Builder.php b/src/Support/Builder.php index fa24c54..fc25259 100644 --- a/src/Support/Builder.php +++ b/src/Support/Builder.php @@ -41,6 +41,7 @@ use Spinen\Halo\User; use Spinen\Halo\Webhook; use Spinen\Halo\WebhookEvent; +use Spinen\Halo\Workday; /** * Class Builder @@ -73,6 +74,7 @@ * @property Collection $users * @property Collection $webhook_events * @property Collection $webhooks + * @property Collection $workdays * @property User $user * * @method self actions() @@ -104,6 +106,7 @@ * @method self users() * @method self webhook_events() * @method self webhooks() + * @method self workdays() */ class Builder { @@ -164,6 +167,7 @@ class Builder 'users' => User::class, 'webhook_events' => WebhookEvent::class, 'webhooks' => Webhook::class, + 'workdays' => Workday::class, ]; /** diff --git a/src/Workday.php b/src/Workday.php new file mode 100644 index 0000000..29b4d91 --- /dev/null +++ b/src/Workday.php @@ -0,0 +1,85 @@ + 'int', + 'alldayssame' => 'bool', + 'end' => 'datetime', + 'endfriday' => 'datetime', + 'endmonday' => 'datetime', + 'endsaturday' => 'datetime', + 'endsunday' => 'datetime', + 'endthursday' => 'datetime', + 'endtuesday' => 'datetime', + 'endwednesday' => 'datetime', + 'id' => 'int', + 'incfriday' => 'bool', + 'incmonday' => 'bool', + 'incsaturday' => 'bool', + 'incsunday' => 'bool', + 'incthursday' => 'bool', + 'inctuesday' => 'bool', + 'incwednesday' => 'bool', + 'start' => 'datetime', + 'startfriday' => 'datetime', + 'startmonday' => 'datetime', + 'startsaturday' => 'datetime', + 'startsunday' => 'datetime', + 'startthursday' => 'datetime', + 'starttuesday' => 'datetime', + 'startwednesday' => 'datetime', + ]; + + /** + * Path to API endpoint. + */ + protected string $path = '/workday'; +} From 9dda4f81901c8849e61769c3bd4a458281be147f Mon Sep 17 00:00:00 2001 From: Jimmy Puckett Date: Sat, 9 Dec 2023 19:24:07 -0500 Subject: [PATCH 3/5] Add Holiday model --- src/Holiday.php | 51 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 src/Holiday.php diff --git a/src/Holiday.php b/src/Holiday.php new file mode 100644 index 0000000..98a4de0 --- /dev/null +++ b/src/Holiday.php @@ -0,0 +1,51 @@ + 'int', + 'agent_name' => 'string', + 'allday' => 'bool', + 'date' => 'datetime', + 'duration' => 'float', + 'end_date' => 'datetime', + 'entity' => 'int', + 'holid' => 'int', + 'holiday_type' => 'int', + 'id' => 'string', + 'isrecurring' => 'bool', + 'workday_id' => 'int', + ]; + + /** + * Is the model readonly? + */ + protected bool $readonlyModel = true; +} From c4fc2f50abf899933da32ffeeedaba63eec1b77d Mon Sep 17 00:00:00 2001 From: Jimmy Puckett Date: Sat, 9 Dec 2023 19:24:24 -0500 Subject: [PATCH 4/5] Link up the client/me endpoint --- src/Support/Builder.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Support/Builder.php b/src/Support/Builder.php index fc25259..d4c885f 100644 --- a/src/Support/Builder.php +++ b/src/Support/Builder.php @@ -76,6 +76,7 @@ * @property Collection $webhooks * @property Collection $workdays * @property User $user + * @property Client $client * * @method self actions() * @method self agents() @@ -211,6 +212,9 @@ public function __get(string $name): Collection|Model|null $name === 'agent' => $this->newInstanceForModel(Agent::class) ->get(extra: 'me') ->first(), + $name === 'client' => $this->newInstanceForModel(Client::class) + ->get(extra: 'me') + ->first(), $name === 'user' => $this->newInstanceForModel(User::class) ->get(extra: 'me') ->first(), From 148747d689aeed2adba2644d9c8199640c3173c5 Mon Sep 17 00:00:00 2001 From: Jimmy Puckett Date: Sat, 9 Dec 2023 19:25:07 -0500 Subject: [PATCH 5/5] Bumping version --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 267577d..8f0916f 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.4.1 +0.5.0