-
From 43168e5527183769f7117d2e9412fb5ce8b3cc3f Mon Sep 17 00:00:00 2001
From: Rhys Lees <43909932+RhysLees@users.noreply.github.com>
Date: Tue, 30 Apr 2024 21:58:54 +0100
Subject: [PATCH 13/54] WIP
---
README.md | 4 +++-
src/DocuWare.php | 1 -
tests/Feature/DocuWareAuthenticationTest.php | 4 ++--
3 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/README.md b/README.md
index 8479123..b5423db 100644
--- a/README.md
+++ b/README.md
@@ -94,7 +94,9 @@ DOCUWARE_PASSPHRASE="a#bcd>2~C1'abc\\#"
### Getting OAuth Token
- Getting OAuth Token
+ Getting Started with OAuth
+
+> This package automatically handles the generation of OAuth token for you and stores them in cache.
```php
use CodebarAg\DocuWare\Connectors\DocuWareConnector;
diff --git a/src/DocuWare.php b/src/DocuWare.php
index 7790c1d..f277219 100644
--- a/src/DocuWare.php
+++ b/src/DocuWare.php
@@ -25,7 +25,6 @@ public function getNewAuthenticationOAuthToken(
tokenEndpoint: $identityServiceConfigurationResponse->dto()->tokenEndpoint,
username: $username,
password: $password,
- grantType: $grantType,
clientId: $clientId,
))->send();
diff --git a/tests/Feature/DocuWareAuthenticationTest.php b/tests/Feature/DocuWareAuthenticationTest.php
index 1b6c5fb..869f8b2 100644
--- a/tests/Feature/DocuWareAuthenticationTest.php
+++ b/tests/Feature/DocuWareAuthenticationTest.php
@@ -48,7 +48,7 @@
Event::assertDispatched(DocuWareOAuthLog::class);
-})->group('authentication')->only();
+})->group('authentication');
it('can authenticate with DocuWare Token', function () {
Event::fake();
@@ -62,4 +62,4 @@
Event::assertDispatched(DocuWareOAuthLog::class);
-})->group('authentication')->only();
+})->group('authentication');
From 5d6377d8f7eb7cfe5be9760b38113b71830c5361 Mon Sep 17 00:00:00 2001
From: Rhys Lees <43909932+RhysLees@users.noreply.github.com>
Date: Tue, 30 Apr 2024 22:01:39 +0100
Subject: [PATCH 14/54] WIP
---
src/Support/EnsureValidCookie.php | 43 -------------------------------
1 file changed, 43 deletions(-)
delete mode 100644 src/Support/EnsureValidCookie.php
diff --git a/src/Support/EnsureValidCookie.php b/src/Support/EnsureValidCookie.php
deleted file mode 100644
index 9048ca0..0000000
--- a/src/Support/EnsureValidCookie.php
+++ /dev/null
@@ -1,43 +0,0 @@
-config()->add('cookies', $cookieJar);
-
- $response = $request->send();
-
- event(new DocuWareResponseLog($response));
-
- throw_if($response->status() === Response::HTTP_UNAUTHORIZED, UnableToLogin::create());
- throw_if($cookieJar->toArray() === [], UnableToLoginNoCookies::create());
-
- Auth::store($cookieJar);
- }
-}
From 570ac4060bf8b1fc97857950ad9d540a014da8af Mon Sep 17 00:00:00 2001
From: Rhys Lees <43909932+RhysLees@users.noreply.github.com>
Date: Fri, 3 May 2024 15:40:33 +0100
Subject: [PATCH 15/54] WIP
---
README.md | 102 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 102 insertions(+)
diff --git a/README.md b/README.md
index b5423db..e551676 100644
--- a/README.md
+++ b/README.md
@@ -61,6 +61,108 @@ then optimize the processes that power the core of your business.
+
+ Current Support
+
+| Group | Request | Supported |
+|-------------------------------------|-------------------------------------------------------------|-----------|
+| Authentication/OAuth | 1. Get Responsible Identity Service | ✅ |
+| Authentication/OAuth | 2. Get Identity Service Configuration | ✅ |
+| Authentication/OAuth | 3.a Request Token w/ Username & Password | ✅ |
+| Authentication/OAuth | 3.b Request Token w/ a DocuWare Token | ✅ |
+| Authentication/OAuth | 3.c Request Token w/ Username & Password (Trusted User) | ❌ |
+| Authentication/OAuth | 3.d.1 Obtain Windows Authorization (On Premises Only) | ❌ |
+| Authentication/OAuth | 3.d.2 Request Token /w a Windows Account (On Premises Only) | ❌ |
+| General/Organisation | Get Login Token | ✅ |
+| General/Organisation | Get Organization | ✅ |
+| General/Organisation | Get All File Cabinets and Document Trays | ✅ |
+| General/UserManagement | Get Users | ❌ |
+| General/UserManagement | Get Users by ID | ❌ |
+| General/UserManagement | Get Users of a Role | ❌ |
+| General/UserManagement | Get Users of a Group | ❌ |
+| General/UserManagement | Create User | ❌ |
+| General/UserManagement | Update User | ❌ |
+| General/UserManagement | Get Groups | ❌ |
+| General/UserManagement | Get All Groups for a Specific User | ❌ |
+| General/UserManagement | Add User to a Group | ❌ |
+| General/UserManagement | Remove User from a Group | ❌ |
+| General/UserManagement | Get Roles | ❌ |
+| General/UserManagement | Get All Roles for a Specific User | ❌ |
+| General/UserManagement | Add User to a Role | ❌ |
+| General/UserManagement | Remove User from a Role | ❌ |
+| FileCabinets/General | Get File Cabinet Information | ✅ |
+| FileCabinets/General | Get Total Number of Documents | ✅ |
+| FileCabinets/Dialogs | Get All Dialogs | ✅ |
+| FileCabinets/Dialogs | Get a Specific Dialog | ✅ |
+| FileCabinets/Dialogs | Get Dialogs of a Specific Type | ❌ |
+| FileCabinets/Search | Get Documents from a File Cabinet | ❌ |
+| FileCabinets/Search | Get a Specific Document From a File Cabinet | ❌ |
+| FileCabinets/Search | Search for Documents in a Single File Cabinet | ❌ |
+| FileCabinets/Search | Search for Documents in Multiple File Cabinets | ❌ |
+| FileCabinets/CheckInCheckOut | Check-out & Download a Document | ❌ |
+| FileCabinets/CheckInCheckOut | Check-in a Document from the File System | ❌ |
+| FileCabinets/CheckInCheckOut | Undo Check-out | ❌ |
+| FileCabinets/SelectLists | Get Select Lists | ✅ |
+| FileCabinets/SelectLists | Get Filtered Select Lists | ❌ |
+| FileCabinets/Upload | Create Data Record | ✅ |
+| FileCabinets/Upload | Append File(s) to a Data Record | ❌ |
+| FileCabinets/Upload | Upload a Single File for a Data Record | ❌ |
+| FileCabinets/Upload | Create a Data Record & Upload File | ❌ |
+| FileCabinets/Upload | Create Data Record & Upload File Using Store Dialog | ❌ |
+| FileCabinets/Upload | Append a Single PDF to a Document | ❌ |
+| FileCabinets/Upload | Replace a PDF Document Section | ❌ |
+| FileCabinets/BatchIndexFieldsUpdate | Batch Update Index Fields By Id | ❌ |
+| FileCabinets/BatchIndexFieldsUpdate | Batch Update Index Fields By Search | ❌ |
+| FileCabinets/BatchIndexFieldsUpdate | Batch Append/Update Keyword Fields By Id | ❌ |
+| Documents/UpdateIndexValues | Update Index Values | ✅ |
+| Documents/UpdateIndexValues | Update Table Field Values | ❌ |
+| Documents/ModifyDocuments | Transfer Document | ✅ |
+| Documents/ModifyDocuments | Delete Document | ✅ |
+| Documents/ClipUnclip&StapleUnstaple | Clip | ❌ |
+| Documents/ClipUnclip&StapleUnstaple | Unclip | ❌ |
+| Documents/ClipUnclip&StapleUnstaple | Staple | ❌ |
+| Documents/ClipUnclip&StapleUnstaple | Unstaple | ❌ |
+| Documents/AnnotationsStamps | AddStampWithPosition | ❌ |
+| Documents/AnnotationsStamps | AddStampWithBestPosition | ❌ |
+| Documents/AnnotationsStamps | AddTextAnnotation | ❌ |
+| Documents/AnnotationsStamps | AddRectEntryAnnotation | ❌ |
+| Documents/AnnotationsStamps | AddLineEntryAnnotation | ❌ |
+| Documents/AnnotationsStamps | AddPolyLineEntryAnnotation | ❌ |
+| Documents/AnnotationsStamps | DeleteAnnotation | ❌ |
+| Documents/AnnotationsStamps | UpdateTextAnnotation | ❌ |
+| Documents/AnnotationsStamps | Get Stamps | ❌ |
+| Documents/DocumentsTrashBin | Get Documents | ❌ |
+| Documents/DocumentsTrashBin | Delete Documents | ❌ |
+| Documents/DocumentsTrashBin | Restore Documents | ❌ |
+| Documents/ApplicationProperties | Get Application Properties | ❌ |
+| Documents/ApplicationProperties | Add Application Properties | ❌ |
+| Documents/ApplicationProperties | Delete Application Properties | ❌ |
+| Documents/ApplicationProperties | Update Application Properties | ❌ |
+| Documents/Sections | Get All Sections from a Document | ❌ |
+| Documents/Sections | Get a Specific Section | ❌ |
+| Documents/Sections | Delete Section | ❌ |
+| Documents/Download | Download Document | ✅ |
+| Documents/Download | Download Section | ❌ |
+| Documents/Download | Download Thumbnail | ✅ |
+| Workflow | Get Document Workflow History | ❌ |
+| Workflow | Get Document Workflow History Steps | ❌ |
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
## ⚙️ Installation
You can install the package via composer:
From d36c921c4882199b7388d3754044a9fcc48f6cc6 Mon Sep 17 00:00:00 2001
From: Rhys Lees <43909932+RhysLees@users.noreply.github.com>
Date: Fri, 3 May 2024 19:34:46 +0100
Subject: [PATCH 16/54] WIP
---
README.md | 12 ++--
.../UserManagement/GetModifyGroups/Group.php | 24 +++++++
.../UserManagement/GetModifyRoles/Role.php | 26 +++++++
.../UserManagement/GetUsers/OutOfOffice.php | 24 +++++++
.../GetUsers/RegionalSettings.php | 22 ++++++
.../General/UserManagement/GetUsers/User.php | 69 +++++++++++++++++++
.../GetModifyGroups/GetGroups.php | 56 +++++++++++++++
.../GetModifyRoles/GetRoles.php | 57 +++++++++++++++
.../UserManagement/GetUsers/GetUserById.php | 52 ++++++++++++++
.../UserManagement/GetUsers/GetUsers.php | 55 +++++++++++++++
.../GetUsers/GetUsersOfAGroup.php | 53 ++++++++++++++
.../GetUsers/GetUsersOfARole.php | 55 +++++++++++++++
.../GetModifyGroups/GetGroupsResponse.php | 24 +++++++
.../GetModifyRoles/GetRolesResponse.php | 25 +++++++
.../GetUsers/GetUserResponse.php | 22 ++++++
.../GetUsers/GetUsersResponse.php | 24 +++++++
.../GetModifyGroups/GetGroupsTest.php | 24 +++++++
.../GetUsers/GetUserByIdTest.php | 19 +++++
.../GetUsers/GetUsersOfAGroupTest.php | 27 ++++++++
.../GetUsers/GetUsersOfARoleTest.php | 25 +++++++
.../UserManagement/GetUsers/GetUsersTest.php | 22 ++++++
21 files changed, 711 insertions(+), 6 deletions(-)
create mode 100644 src/DTO/General/UserManagement/GetModifyGroups/Group.php
create mode 100644 src/DTO/General/UserManagement/GetModifyRoles/Role.php
create mode 100644 src/DTO/General/UserManagement/GetUsers/OutOfOffice.php
create mode 100644 src/DTO/General/UserManagement/GetUsers/RegionalSettings.php
create mode 100644 src/DTO/General/UserManagement/GetUsers/User.php
create mode 100644 src/Requests/General/UserManagement/GetModifyGroups/GetGroups.php
create mode 100644 src/Requests/General/UserManagement/GetModifyRoles/GetRoles.php
create mode 100644 src/Requests/General/UserManagement/GetUsers/GetUserById.php
create mode 100644 src/Requests/General/UserManagement/GetUsers/GetUsers.php
create mode 100644 src/Requests/General/UserManagement/GetUsers/GetUsersOfAGroup.php
create mode 100644 src/Requests/General/UserManagement/GetUsers/GetUsersOfARole.php
create mode 100644 src/Responses/General/UserManagement/GetModifyGroups/GetGroupsResponse.php
create mode 100644 src/Responses/General/UserManagement/GetModifyRoles/GetRolesResponse.php
create mode 100644 src/Responses/General/UserManagement/GetUsers/GetUserResponse.php
create mode 100644 src/Responses/General/UserManagement/GetUsers/GetUsersResponse.php
create mode 100644 tests/Feature/Requests/General/UserManagement/GetModifyGroups/GetGroupsTest.php
create mode 100644 tests/Feature/Requests/General/UserManagement/GetUsers/GetUserByIdTest.php
create mode 100644 tests/Feature/Requests/General/UserManagement/GetUsers/GetUsersOfAGroupTest.php
create mode 100644 tests/Feature/Requests/General/UserManagement/GetUsers/GetUsersOfARoleTest.php
create mode 100644 tests/Feature/Requests/General/UserManagement/GetUsers/GetUsersTest.php
diff --git a/README.md b/README.md
index e551676..1397c87 100644
--- a/README.md
+++ b/README.md
@@ -76,17 +76,17 @@ then optimize the processes that power the core of your business.
| General/Organisation | Get Login Token | ✅ |
| General/Organisation | Get Organization | ✅ |
| General/Organisation | Get All File Cabinets and Document Trays | ✅ |
-| General/UserManagement | Get Users | ❌ |
-| General/UserManagement | Get Users by ID | ❌ |
-| General/UserManagement | Get Users of a Role | ❌ |
-| General/UserManagement | Get Users of a Group | ❌ |
+| General/UserManagement | Get Users | ✅ |
+| General/UserManagement | Get Users by ID | ✅ |
+| General/UserManagement | Get Users of a Role | ✅ |
+| General/UserManagement | Get Users of a Group | ✅ |
| General/UserManagement | Create User | ❌ |
| General/UserManagement | Update User | ❌ |
-| General/UserManagement | Get Groups | ❌ |
+| General/UserManagement | Get Groups | ✅ |
| General/UserManagement | Get All Groups for a Specific User | ❌ |
| General/UserManagement | Add User to a Group | ❌ |
| General/UserManagement | Remove User from a Group | ❌ |
-| General/UserManagement | Get Roles | ❌ |
+| General/UserManagement | Get Roles | ✅ |
| General/UserManagement | Get All Roles for a Specific User | ❌ |
| General/UserManagement | Add User to a Role | ❌ |
| General/UserManagement | Remove User from a Role | ❌ |
diff --git a/src/DTO/General/UserManagement/GetModifyGroups/Group.php b/src/DTO/General/UserManagement/GetModifyGroups/Group.php
new file mode 100644
index 0000000..b1fab04
--- /dev/null
+++ b/src/DTO/General/UserManagement/GetModifyGroups/Group.php
@@ -0,0 +1,24 @@
+ $this->name,
+ 'Active' => $this->active,
+ ];
+ }
+
+ public function resolveCacheDriver(): LaravelCacheDriver
+ {
+ return new LaravelCacheDriver(Cache::store(config('laravel-docuware.configurations.cache.driver')));
+ }
+
+ public function cacheExpiryInSeconds(): int
+ {
+ return config('laravel-docuware.configurations.cache.lifetime_in_seconds', 3600);
+ }
+
+ public function createDtoFromResponse(Response $response): Enumerable|Collection
+ {
+ return GetGroupsResponse::fromResponse($response);
+ }
+}
diff --git a/src/Requests/General/UserManagement/GetModifyRoles/GetRoles.php b/src/Requests/General/UserManagement/GetModifyRoles/GetRoles.php
new file mode 100644
index 0000000..693a319
--- /dev/null
+++ b/src/Requests/General/UserManagement/GetModifyRoles/GetRoles.php
@@ -0,0 +1,57 @@
+ $this->name,
+ 'Active' => $this->active,
+ 'Type' => $this->type,
+ ];
+ }
+
+ public function resolveCacheDriver(): LaravelCacheDriver
+ {
+ return new LaravelCacheDriver(Cache::store(config('laravel-docuware.configurations.cache.driver')));
+ }
+
+ public function cacheExpiryInSeconds(): int
+ {
+ return config('laravel-docuware.configurations.cache.lifetime_in_seconds', 3600);
+ }
+
+ public function createDtoFromResponse(Response $response): Enumerable|Collection
+ {
+ return GetRolesResponse::fromResponse($response);
+ }
+}
diff --git a/src/Requests/General/UserManagement/GetUsers/GetUserById.php b/src/Requests/General/UserManagement/GetUsers/GetUserById.php
new file mode 100644
index 0000000..9d724c8
--- /dev/null
+++ b/src/Requests/General/UserManagement/GetUsers/GetUserById.php
@@ -0,0 +1,52 @@
+ $this->userId,
+ ];
+ }
+
+ public function resolveCacheDriver(): LaravelCacheDriver
+ {
+ return new LaravelCacheDriver(Cache::store(config('laravel-docuware.configurations.cache.driver')));
+ }
+
+ public function cacheExpiryInSeconds(): int
+ {
+ return config('laravel-docuware.configurations.cache.lifetime_in_seconds', 3600);
+ }
+
+ public function createDtoFromResponse(Response $response): User
+ {
+ return GetUserResponse::fromResponse($response);
+ }
+}
diff --git a/src/Requests/General/UserManagement/GetUsers/GetUsers.php b/src/Requests/General/UserManagement/GetUsers/GetUsers.php
new file mode 100644
index 0000000..0436696
--- /dev/null
+++ b/src/Requests/General/UserManagement/GetUsers/GetUsers.php
@@ -0,0 +1,55 @@
+ $this->name,
+ 'Active' => $this->active,
+ ];
+ }
+
+ public function resolveCacheDriver(): LaravelCacheDriver
+ {
+ return new LaravelCacheDriver(Cache::store(config('laravel-docuware.configurations.cache.driver')));
+ }
+
+ public function cacheExpiryInSeconds(): int
+ {
+ return config('laravel-docuware.configurations.cache.lifetime_in_seconds', 3600);
+ }
+
+ public function createDtoFromResponse(Response $response): Enumerable|Collection
+ {
+ return GetUsersResponse::fromResponse($response);
+ }
+}
diff --git a/src/Requests/General/UserManagement/GetUsers/GetUsersOfAGroup.php b/src/Requests/General/UserManagement/GetUsers/GetUsersOfAGroup.php
new file mode 100644
index 0000000..c863e65
--- /dev/null
+++ b/src/Requests/General/UserManagement/GetUsers/GetUsersOfAGroup.php
@@ -0,0 +1,53 @@
+ $this->groupId,
+ ];
+ }
+
+ public function resolveCacheDriver(): LaravelCacheDriver
+ {
+ return new LaravelCacheDriver(Cache::store(config('laravel-docuware.configurations.cache.driver')));
+ }
+
+ public function cacheExpiryInSeconds(): int
+ {
+ return config('laravel-docuware.configurations.cache.lifetime_in_seconds', 3600);
+ }
+
+ public function createDtoFromResponse(Response $response): Enumerable|Collection
+ {
+ return GetUsersResponse::fromResponse($response);
+ }
+}
diff --git a/src/Requests/General/UserManagement/GetUsers/GetUsersOfARole.php b/src/Requests/General/UserManagement/GetUsers/GetUsersOfARole.php
new file mode 100644
index 0000000..a6020bf
--- /dev/null
+++ b/src/Requests/General/UserManagement/GetUsers/GetUsersOfARole.php
@@ -0,0 +1,55 @@
+ $this->roleId,
+ 'IncludeGroupUsers' => $this->includeGroupUsers,
+ ];
+ }
+
+ public function resolveCacheDriver(): LaravelCacheDriver
+ {
+ return new LaravelCacheDriver(Cache::store(config('laravel-docuware.configurations.cache.driver')));
+ }
+
+ public function cacheExpiryInSeconds(): int
+ {
+ return config('laravel-docuware.configurations.cache.lifetime_in_seconds', 3600);
+ }
+
+ public function createDtoFromResponse(Response $response): Enumerable|Collection
+ {
+ return GetUsersResponse::fromResponse($response);
+ }
+}
diff --git a/src/Responses/General/UserManagement/GetModifyGroups/GetGroupsResponse.php b/src/Responses/General/UserManagement/GetModifyGroups/GetGroupsResponse.php
new file mode 100644
index 0000000..5822826
--- /dev/null
+++ b/src/Responses/General/UserManagement/GetModifyGroups/GetGroupsResponse.php
@@ -0,0 +1,24 @@
+throw()->json('Item');
+
+ return collect($groups)->map(fn (array $group) => Group::fromJson($group));
+ }
+}
diff --git a/src/Responses/General/UserManagement/GetModifyRoles/GetRolesResponse.php b/src/Responses/General/UserManagement/GetModifyRoles/GetRolesResponse.php
new file mode 100644
index 0000000..6417fe8
--- /dev/null
+++ b/src/Responses/General/UserManagement/GetModifyRoles/GetRolesResponse.php
@@ -0,0 +1,25 @@
+throw()->json('Item');
+
+ return collect($roles)->map(fn (array $role) => Role::fromJson($role));
+ }
+}
diff --git a/src/Responses/General/UserManagement/GetUsers/GetUserResponse.php b/src/Responses/General/UserManagement/GetUsers/GetUserResponse.php
new file mode 100644
index 0000000..6961de4
--- /dev/null
+++ b/src/Responses/General/UserManagement/GetUsers/GetUserResponse.php
@@ -0,0 +1,22 @@
+throw()->json();
+
+ return User::fromJson($user);
+ }
+}
diff --git a/src/Responses/General/UserManagement/GetUsers/GetUsersResponse.php b/src/Responses/General/UserManagement/GetUsers/GetUsersResponse.php
new file mode 100644
index 0000000..4010403
--- /dev/null
+++ b/src/Responses/General/UserManagement/GetUsers/GetUsersResponse.php
@@ -0,0 +1,24 @@
+throw()->json('User');
+
+ return collect($users)->map(fn (array $user) => User::fromJson($user));
+ }
+}
diff --git a/tests/Feature/Requests/General/UserManagement/GetModifyGroups/GetGroupsTest.php b/tests/Feature/Requests/General/UserManagement/GetModifyGroups/GetGroupsTest.php
new file mode 100644
index 0000000..abb1614
--- /dev/null
+++ b/tests/Feature/Requests/General/UserManagement/GetModifyGroups/GetGroupsTest.php
@@ -0,0 +1,24 @@
+connector->send(new GetRoles())->dto();
+
+ $this->assertInstanceOf(Collection::class, $groups);
+
+ foreach ($groups as $group) {
+ $this->assertInstanceOf(Group::class, $group);
+ }
+
+ $this->assertNotCount(0, $groups);
+ Event::assertDispatched(DocuWareResponseLog::class);
+});
diff --git a/tests/Feature/Requests/General/UserManagement/GetUsers/GetUserByIdTest.php b/tests/Feature/Requests/General/UserManagement/GetUsers/GetUserByIdTest.php
new file mode 100644
index 0000000..43e7363
--- /dev/null
+++ b/tests/Feature/Requests/General/UserManagement/GetUsers/GetUserByIdTest.php
@@ -0,0 +1,19 @@
+connector->send(new GetUsers())->dto();
+
+ $user = $this->connector->send(new GetUserById($users->get(2)->id))->dto();
+
+ $this->assertInstanceOf(User::class, $user);
+
+ Event::assertDispatched(DocuWareResponseLog::class);
+});
diff --git a/tests/Feature/Requests/General/UserManagement/GetUsers/GetUsersOfAGroupTest.php b/tests/Feature/Requests/General/UserManagement/GetUsers/GetUsersOfAGroupTest.php
new file mode 100644
index 0000000..3670fbc
--- /dev/null
+++ b/tests/Feature/Requests/General/UserManagement/GetUsers/GetUsersOfAGroupTest.php
@@ -0,0 +1,27 @@
+connector->send(new GetGroups())->dto();
+
+ $users = $this->connector->send(new GetUsersOfAGroup($groups->first()->id))->dto();
+
+ $this->assertInstanceOf(Collection::class, $users);
+
+ foreach ($users as $user) {
+ $this->assertInstanceOf(User::class, $user);
+ }
+
+ $this->assertNotCount(0, $users);
+ Event::assertDispatched(DocuWareResponseLog::class);
+});
diff --git a/tests/Feature/Requests/General/UserManagement/GetUsers/GetUsersOfARoleTest.php b/tests/Feature/Requests/General/UserManagement/GetUsers/GetUsersOfARoleTest.php
new file mode 100644
index 0000000..7af21ae
--- /dev/null
+++ b/tests/Feature/Requests/General/UserManagement/GetUsers/GetUsersOfARoleTest.php
@@ -0,0 +1,25 @@
+connector->send(new GetRoles())->dto();
+
+ $users = $this->connector->send(new GetUsersOfARole($roles->first()->id))->dto();
+
+ $this->assertInstanceOf(Collection::class, $users);
+
+ foreach ($users as $user) {
+ $this->assertInstanceOf(User::class, $user);
+ }
+
+ $this->assertNotCount(0, $users);
+ Event::assertDispatched(DocuWareResponseLog::class);
+});
diff --git a/tests/Feature/Requests/General/UserManagement/GetUsers/GetUsersTest.php b/tests/Feature/Requests/General/UserManagement/GetUsers/GetUsersTest.php
new file mode 100644
index 0000000..b6a96a0
--- /dev/null
+++ b/tests/Feature/Requests/General/UserManagement/GetUsers/GetUsersTest.php
@@ -0,0 +1,22 @@
+connector->send(new GetUsers())->dto();
+
+ $this->assertInstanceOf(Collection::class, $users);
+
+ foreach ($users as $user) {
+ $this->assertInstanceOf(User::class, $user);
+ }
+
+ $this->assertNotCount(0, $users);
+ Event::assertDispatched(DocuWareResponseLog::class);
+});
From 4bb990832784cfefbe9c1c33ae880aaad2c94851 Mon Sep 17 00:00:00 2001
From: Rhys Lees <43909932+RhysLees@users.noreply.github.com>
Date: Fri, 3 May 2024 19:38:45 +0100
Subject: [PATCH 17/54] WIP
---
.../GetModifyGroups/GetGroupsTest.php | 8 +++----
.../GetModifyRoles/GetRolesTest.php | 24 +++++++++++++++++++
.../GetUsers/GetUsersOfAGroupTest.php | 2 +-
3 files changed, 28 insertions(+), 6 deletions(-)
create mode 100644 tests/Feature/Requests/General/UserManagement/GetModifyRoles/GetRolesTest.php
diff --git a/tests/Feature/Requests/General/UserManagement/GetModifyGroups/GetGroupsTest.php b/tests/Feature/Requests/General/UserManagement/GetModifyGroups/GetGroupsTest.php
index abb1614..7d04e77 100644
--- a/tests/Feature/Requests/General/UserManagement/GetModifyGroups/GetGroupsTest.php
+++ b/tests/Feature/Requests/General/UserManagement/GetModifyGroups/GetGroupsTest.php
@@ -1,17 +1,15 @@
connector->send(new GetRoles())->dto();
+ $groups = $this->connector->send(new GetGroups())->dto();
$this->assertInstanceOf(Collection::class, $groups);
diff --git a/tests/Feature/Requests/General/UserManagement/GetModifyRoles/GetRolesTest.php b/tests/Feature/Requests/General/UserManagement/GetModifyRoles/GetRolesTest.php
new file mode 100644
index 0000000..43bf1f3
--- /dev/null
+++ b/tests/Feature/Requests/General/UserManagement/GetModifyRoles/GetRolesTest.php
@@ -0,0 +1,24 @@
+connector->send(new GetRoles())->dto();
+
+ $this->assertInstanceOf(Collection::class, $roles);
+
+ foreach ($roles as $role) {
+ $this->assertInstanceOf(Role::class, $role);
+ }
+
+ $this->assertNotCount(0, $roles);
+ Event::assertDispatched(DocuWareResponseLog::class);
+});
diff --git a/tests/Feature/Requests/General/UserManagement/GetUsers/GetUsersOfAGroupTest.php b/tests/Feature/Requests/General/UserManagement/GetUsers/GetUsersOfAGroupTest.php
index 3670fbc..5907c3d 100644
--- a/tests/Feature/Requests/General/UserManagement/GetUsers/GetUsersOfAGroupTest.php
+++ b/tests/Feature/Requests/General/UserManagement/GetUsers/GetUsersOfAGroupTest.php
@@ -9,7 +9,7 @@
use Illuminate\Support\Collection;
use Illuminate\Support\Facades\Event;
-it('can list users of a role', function () {
+it('can list users of a group', function () {
Event::fake();
$groups = $this->connector->send(new GetGroups())->dto();
From 0c4f2edfd2957644daa554a0994c1184ba80c2a8 Mon Sep 17 00:00:00 2001
From: Rhys Lees <43909932+RhysLees@users.noreply.github.com>
Date: Fri, 3 May 2024 23:39:13 +0100
Subject: [PATCH 18/54] =WIP
---
README.md | 4 +-
.../General/UserManagement/GetUsers/User.php | 8 +--
.../GetAllGroupsForASpecificUser.php | 57 ++++++++++++++++++
.../GetModifyGroups/GetGroups.php | 5 +-
.../GetAllRolesForASpecificUser.php | 59 +++++++++++++++++++
.../GetModifyRoles/GetRoles.php | 6 +-
.../UserManagement/GetUsers/GetUsers.php | 4 +-
.../GetUsers/GetUsersOfAGroup.php | 2 +-
.../GetUsers/GetUsersOfARole.php | 4 +-
.../GetModifyRoles/GetRolesResponse.php | 1 -
.../GetAllGroupsForASpecificUserTest.php | 25 ++++++++
.../GetAllRolesForASpecificUserTest.php | 25 ++++++++
.../GetModifyRoles/GetRolesTest.php | 2 -
.../GetUsers/GetUsersOfAGroupTest.php | 2 -
14 files changed, 182 insertions(+), 22 deletions(-)
create mode 100644 src/Requests/General/UserManagement/GetModifyGroups/GetAllGroupsForASpecificUser.php
create mode 100644 src/Requests/General/UserManagement/GetModifyRoles/GetAllRolesForASpecificUser.php
create mode 100644 tests/Feature/Requests/General/UserManagement/GetModifyGroups/GetAllGroupsForASpecificUserTest.php
create mode 100644 tests/Feature/Requests/General/UserManagement/GetModifyRoles/GetAllRolesForASpecificUserTest.php
diff --git a/README.md b/README.md
index 1397c87..0279efd 100644
--- a/README.md
+++ b/README.md
@@ -83,11 +83,11 @@ then optimize the processes that power the core of your business.
| General/UserManagement | Create User | ❌ |
| General/UserManagement | Update User | ❌ |
| General/UserManagement | Get Groups | ✅ |
-| General/UserManagement | Get All Groups for a Specific User | ❌ |
+| General/UserManagement | Get All Groups for a Specific User | ✅ |
| General/UserManagement | Add User to a Group | ❌ |
| General/UserManagement | Remove User from a Group | ❌ |
| General/UserManagement | Get Roles | ✅ |
-| General/UserManagement | Get All Roles for a Specific User | ❌ |
+| General/UserManagement | Get All Roles for a Specific User | ✅ |
| General/UserManagement | Add User to a Role | ❌ |
| General/UserManagement | Remove User from a Role | ❌ |
| FileCabinets/General | Get File Cabinet Information | ✅ |
diff --git a/src/DTO/General/UserManagement/GetUsers/User.php b/src/DTO/General/UserManagement/GetUsers/User.php
index 06206f2..fe8f16a 100644
--- a/src/DTO/General/UserManagement/GetUsers/User.php
+++ b/src/DTO/General/UserManagement/GetUsers/User.php
@@ -27,15 +27,15 @@ public static function fromJson(array $data): self
public function __construct(
public string $id,
public string $name,
- public null|string $firstName,
- public null|string $lastName,
+ public ?string $firstName,
+ public ?string $lastName,
public string $dbName,
public string $email,
public bool $active,
public bool $isHighSecurity,
public string $defaultWebBasket,
- public null|OutOfOffice $outOfOffice,
- public null|RegionalSettings $regionalSettings,
+ public ?OutOfOffice $outOfOffice,
+ public ?RegionalSettings $regionalSettings,
) {
}
diff --git a/src/Requests/General/UserManagement/GetModifyGroups/GetAllGroupsForASpecificUser.php b/src/Requests/General/UserManagement/GetModifyGroups/GetAllGroupsForASpecificUser.php
new file mode 100644
index 0000000..c81f358
--- /dev/null
+++ b/src/Requests/General/UserManagement/GetModifyGroups/GetAllGroupsForASpecificUser.php
@@ -0,0 +1,57 @@
+ $this->userId,
+ 'Name' => $this->name,
+ 'Active' => $this->active,
+ ];
+ }
+
+ public function resolveCacheDriver(): LaravelCacheDriver
+ {
+ return new LaravelCacheDriver(Cache::store(config('laravel-docuware.configurations.cache.driver')));
+ }
+
+ public function cacheExpiryInSeconds(): int
+ {
+ return config('laravel-docuware.configurations.cache.lifetime_in_seconds', 3600);
+ }
+
+ public function createDtoFromResponse(Response $response): Enumerable|Collection
+ {
+ return GetGroupsResponse::fromResponse($response);
+ }
+}
diff --git a/src/Requests/General/UserManagement/GetModifyGroups/GetGroups.php b/src/Requests/General/UserManagement/GetModifyGroups/GetGroups.php
index ae2d483..616669a 100644
--- a/src/Requests/General/UserManagement/GetModifyGroups/GetGroups.php
+++ b/src/Requests/General/UserManagement/GetModifyGroups/GetGroups.php
@@ -3,7 +3,6 @@
namespace CodebarAg\DocuWare\Requests\General\UserManagement\GetModifyGroups;
use CodebarAg\DocuWare\Responses\General\UserManagement\GetModifyGroups\GetGroupsResponse;
-use CodebarAg\DocuWare\Responses\General\UserManagement\GetModifyGroups\GetRolesResponse;
use Illuminate\Support\Collection;
use Illuminate\Support\Enumerable;
use Illuminate\Support\Facades\Cache;
@@ -21,8 +20,8 @@ class GetGroups extends Request implements Cacheable
protected Method $method = Method::GET;
public function __construct(
- public null|string $name = null,
- public null|bool $active = null,
+ public ?string $name = null,
+ public ?bool $active = null,
) {
}
diff --git a/src/Requests/General/UserManagement/GetModifyRoles/GetAllRolesForASpecificUser.php b/src/Requests/General/UserManagement/GetModifyRoles/GetAllRolesForASpecificUser.php
new file mode 100644
index 0000000..6d469c6
--- /dev/null
+++ b/src/Requests/General/UserManagement/GetModifyRoles/GetAllRolesForASpecificUser.php
@@ -0,0 +1,59 @@
+ $this->userId,
+ 'Name' => $this->name,
+ 'Active' => $this->active,
+ 'Type' => $this->type,
+ ];
+ }
+
+ public function resolveCacheDriver(): LaravelCacheDriver
+ {
+ return new LaravelCacheDriver(Cache::store(config('laravel-docuware.configurations.cache.driver')));
+ }
+
+ public function cacheExpiryInSeconds(): int
+ {
+ return config('laravel-docuware.configurations.cache.lifetime_in_seconds', 3600);
+ }
+
+ public function createDtoFromResponse(Response $response): Enumerable|Collection
+ {
+ return GetRolesResponse::fromResponse($response);
+ }
+}
diff --git a/src/Requests/General/UserManagement/GetModifyRoles/GetRoles.php b/src/Requests/General/UserManagement/GetModifyRoles/GetRoles.php
index 693a319..f36cf9e 100644
--- a/src/Requests/General/UserManagement/GetModifyRoles/GetRoles.php
+++ b/src/Requests/General/UserManagement/GetModifyRoles/GetRoles.php
@@ -20,9 +20,9 @@ class GetRoles extends Request implements Cacheable
protected Method $method = Method::GET;
public function __construct(
- public null|string $name = null,
- public null|bool $active = null,
- public null|string $type = null,
+ public ?string $name = null,
+ public ?bool $active = null,
+ public ?string $type = null,
) {
}
diff --git a/src/Requests/General/UserManagement/GetUsers/GetUsers.php b/src/Requests/General/UserManagement/GetUsers/GetUsers.php
index 0436696..c161f85 100644
--- a/src/Requests/General/UserManagement/GetUsers/GetUsers.php
+++ b/src/Requests/General/UserManagement/GetUsers/GetUsers.php
@@ -20,8 +20,8 @@ class GetUsers extends Request implements Cacheable
protected Method $method = Method::GET;
public function __construct(
- public null|string $name = null,
- public null|bool $active = null,
+ public ?string $name = null,
+ public ?bool $active = null,
) {
}
diff --git a/src/Requests/General/UserManagement/GetUsers/GetUsersOfAGroup.php b/src/Requests/General/UserManagement/GetUsers/GetUsersOfAGroup.php
index c863e65..e4054c9 100644
--- a/src/Requests/General/UserManagement/GetUsers/GetUsersOfAGroup.php
+++ b/src/Requests/General/UserManagement/GetUsers/GetUsersOfAGroup.php
@@ -20,7 +20,7 @@ class GetUsersOfAGroup extends Request implements Cacheable
protected Method $method = Method::GET;
public function __construct(
- public null|string $groupId = null,
+ public ?string $groupId = null,
) {
}
diff --git a/src/Requests/General/UserManagement/GetUsers/GetUsersOfARole.php b/src/Requests/General/UserManagement/GetUsers/GetUsersOfARole.php
index a6020bf..3e0a90a 100644
--- a/src/Requests/General/UserManagement/GetUsers/GetUsersOfARole.php
+++ b/src/Requests/General/UserManagement/GetUsers/GetUsersOfARole.php
@@ -20,8 +20,8 @@ class GetUsersOfARole extends Request implements Cacheable
protected Method $method = Method::GET;
public function __construct(
- public null|string $roleId = null,
- public null|bool $includeGroupUsers = null,
+ public ?string $roleId = null,
+ public ?bool $includeGroupUsers = null,
) {
}
diff --git a/src/Responses/General/UserManagement/GetModifyRoles/GetRolesResponse.php b/src/Responses/General/UserManagement/GetModifyRoles/GetRolesResponse.php
index 6417fe8..b07ff81 100644
--- a/src/Responses/General/UserManagement/GetModifyRoles/GetRolesResponse.php
+++ b/src/Responses/General/UserManagement/GetModifyRoles/GetRolesResponse.php
@@ -2,7 +2,6 @@
namespace CodebarAg\DocuWare\Responses\General\UserManagement\GetModifyRoles;
-use CodebarAg\DocuWare\DTO\General\UserManagement\GetModifyGroups\Group;
use CodebarAg\DocuWare\DTO\General\UserManagement\GetModifyRoles\Role;
use CodebarAg\DocuWare\Events\DocuWareResponseLog;
use CodebarAg\DocuWare\Support\EnsureValidResponse;
diff --git a/tests/Feature/Requests/General/UserManagement/GetModifyGroups/GetAllGroupsForASpecificUserTest.php b/tests/Feature/Requests/General/UserManagement/GetModifyGroups/GetAllGroupsForASpecificUserTest.php
new file mode 100644
index 0000000..1010139
--- /dev/null
+++ b/tests/Feature/Requests/General/UserManagement/GetModifyGroups/GetAllGroupsForASpecificUserTest.php
@@ -0,0 +1,25 @@
+connector->send(new GetUsers())->dto();
+
+ $groups = $this->connector->send(new GetAllGroupsForASpecificUser($users->get(2)->id))->dto();
+
+ $this->assertInstanceOf(Collection::class, $groups);
+
+ foreach ($groups as $group) {
+ $this->assertInstanceOf(Group::class, $group);
+ }
+
+ $this->assertNotCount(0, $groups);
+ Event::assertDispatched(DocuWareResponseLog::class);
+});
diff --git a/tests/Feature/Requests/General/UserManagement/GetModifyRoles/GetAllRolesForASpecificUserTest.php b/tests/Feature/Requests/General/UserManagement/GetModifyRoles/GetAllRolesForASpecificUserTest.php
new file mode 100644
index 0000000..1794ad8
--- /dev/null
+++ b/tests/Feature/Requests/General/UserManagement/GetModifyRoles/GetAllRolesForASpecificUserTest.php
@@ -0,0 +1,25 @@
+connector->send(new GetUsers())->dto();
+
+ $roles = $this->connector->send(new GetAllRolesForASpecificUser($users->get(2)->id))->dto();
+
+ $this->assertInstanceOf(Collection::class, $roles);
+
+ foreach ($roles as $role) {
+ $this->assertInstanceOf(Role::class, $role);
+ }
+
+ $this->assertNotCount(0, $roles);
+ Event::assertDispatched(DocuWareResponseLog::class);
+});
diff --git a/tests/Feature/Requests/General/UserManagement/GetModifyRoles/GetRolesTest.php b/tests/Feature/Requests/General/UserManagement/GetModifyRoles/GetRolesTest.php
index 43bf1f3..b881811 100644
--- a/tests/Feature/Requests/General/UserManagement/GetModifyRoles/GetRolesTest.php
+++ b/tests/Feature/Requests/General/UserManagement/GetModifyRoles/GetRolesTest.php
@@ -1,9 +1,7 @@
Date: Wed, 8 May 2024 17:52:05 +0100
Subject: [PATCH 19/54] WIP
---
README.md | 108 +++++++++---------
config/laravel-docuware.php | 5 +-
phpunit.xml.dist | 1 +
src/Connectors/DocuWareConnector.php | 107 ++++++++---------
src/DTO/Config.php | 32 ------
src/DTO/Config/ConfigWithCredentials.php | 53 +++++++++
.../ConfigWithCredentialsTrustedUser.php | 57 +++++++++
src/Enums/DialogType.php | 13 +++
.../OAuth/RequestTokenWithCredentials.php | 5 +-
...equestTokenWithCredentialsTrustedUser.php} | 15 ++-
.../Dialogs/GetDialogsOfASpecificType.php | 53 +++++++++
.../Search/GetDocumentsFromAFileCabinet.php | 2 +
.../SelectLists/GetFilteredSelectLists.php | 54 +++++++++
.../SelectLists/GetSelectLists.php | 16 +--
src/Support/Auth.php | 2 +-
src/Support/EnsureValidCredentials.php | 6 +-
src/Support/EnsureValidPassphrase.php | 2 +-
tests/Feature/DocuWareAuthenticationTest.php | 35 +-----
.../Dialogs/GetASpecificDialogTest.php} | 0
.../Dialogs/GetAllDialogs.php} | 0
.../Dialogs/GetDialogsOfASpecificTypeTest.php | 26 +++++
.../GetFileCabinetInformationTest.php | 0
...ASpecificDocumentFromAFileCabinetTest.php} | 0
.../GetDocumentsFromAFileCabinetTest.php} | 0
tests/Pest.php | 6 +-
25 files changed, 400 insertions(+), 198 deletions(-)
delete mode 100644 src/DTO/Config.php
create mode 100644 src/DTO/Config/ConfigWithCredentials.php
create mode 100644 src/DTO/Config/ConfigWithCredentialsTrustedUser.php
create mode 100644 src/Enums/DialogType.php
rename src/Requests/Authentication/OAuth/{RequestTokenWithToken.php => RequestTokenWithCredentialsTrustedUser.php} (68%)
create mode 100644 src/Requests/FileCabinets/Dialogs/GetDialogsOfASpecificType.php
create mode 100644 src/Requests/FileCabinets/SelectLists/GetFilteredSelectLists.php
rename tests/Feature/Requests/{Dialogs/GetDialogRequestTest.php => FileCabinets/Dialogs/GetASpecificDialogTest.php} (100%)
rename tests/Feature/Requests/{Dialogs/GetDialogsRequestTest.php => FileCabinets/Dialogs/GetAllDialogs.php} (100%)
create mode 100644 tests/Feature/Requests/FileCabinets/Dialogs/GetDialogsOfASpecificTypeTest.php
rename tests/Feature/Requests/FileCabinets/{ => General}/GetFileCabinetInformationTest.php (100%)
rename tests/Feature/Requests/{Document/GetDocumentRequestTest.php => FileCabinets/Search/GetASpecificDocumentFromAFileCabinetTest.php} (100%)
rename tests/Feature/Requests/{Document/GetDocumentsRequestTest.php => FileCabinets/Search/GetDocumentsFromAFileCabinetTest.php} (100%)
diff --git a/README.md b/README.md
index 0279efd..9309fc3 100644
--- a/README.md
+++ b/README.md
@@ -69,7 +69,7 @@ then optimize the processes that power the core of your business.
| Authentication/OAuth | 1. Get Responsible Identity Service | ✅ |
| Authentication/OAuth | 2. Get Identity Service Configuration | ✅ |
| Authentication/OAuth | 3.a Request Token w/ Username & Password | ✅ |
-| Authentication/OAuth | 3.b Request Token w/ a DocuWare Token | ✅ |
+| Authentication/OAuth | 3.b Request Token w/ a DocuWare Token | ❌ |
| Authentication/OAuth | 3.c Request Token w/ Username & Password (Trusted User) | ❌ |
| Authentication/OAuth | 3.d.1 Obtain Windows Authorization (On Premises Only) | ❌ |
| Authentication/OAuth | 3.d.2 Request Token /w a Windows Account (On Premises Only) | ❌ |
@@ -94,9 +94,9 @@ then optimize the processes that power the core of your business.
| FileCabinets/General | Get Total Number of Documents | ✅ |
| FileCabinets/Dialogs | Get All Dialogs | ✅ |
| FileCabinets/Dialogs | Get a Specific Dialog | ✅ |
-| FileCabinets/Dialogs | Get Dialogs of a Specific Type | ❌ |
-| FileCabinets/Search | Get Documents from a File Cabinet | ❌ |
-| FileCabinets/Search | Get a Specific Document From a File Cabinet | ❌ |
+| FileCabinets/Dialogs | Get Dialogs of a Specific Type | ✅ |
+| FileCabinets/Search | Get Documents from a File Cabinet | ✅ |
+| FileCabinets/Search | Get a Specific Document From a File Cabinet | ✅ |
| FileCabinets/Search | Search for Documents in a Single File Cabinet | ❌ |
| FileCabinets/Search | Search for Documents in Multiple File Cabinets | ❌ |
| FileCabinets/CheckInCheckOut | Check-out & Download a Document | ❌ |
@@ -147,19 +147,6 @@ then optimize the processes that power the core of your business.
| Workflow | Get Document Workflow History | ❌ |
| Workflow | Get Document Workflow History Steps | ❌ |
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -194,65 +181,80 @@ DOCUWARE_PASSPHRASE="a#bcd>2~C1'abc\\#"
## 🏗 Usage
-### Getting OAuth Token
+### Getting Started with OAuth
Getting Started with OAuth
> This package automatically handles the generation of OAuth token for you and stores them in cache.
+### Getting a new token via Username & Password:
+
```php
use CodebarAg\DocuWare\Connectors\DocuWareConnector;
-use CodebarAg\DocuWare\DTO\Config;
+use CodebarAg\DocuWare\DTO\Config\ConfigWithCredentials;
-// Use credentials from your .env file
-$connector = new DocuWareConnector();
-
-// Pass credentials manually
$connector = new DocuWareConnector(
- configuration: new Config(
- url: 'https://your-domain.docuware.cloud',
+ configuration: new ConfigWithCredentials(
username: 'username',
password: 'password',
- passphrase: 'passphrase',
- cacheDriver: 'redis',
- cacheLifetimeInSeconds: 60,
- requestTimeoutInSeconds: 60,
)
);
-
```
-Getting a new token via Organization Token:
+### Getting a new token via Username & Password (Trusted User):
+
```php
use CodebarAg\DocuWare\Connectors\DocuWareConnector;
-use CodebarAg\DocuWare\DTO\Config;
-
-//Step 1: Create a new connector with either method above
-$loginTokenConnector = new DocuWareConnector();
-
-//Step 2: Get the Get Login Token
-$loginToken = $loginTokenConnector->send(new GetLoginToken())->dto();
+use CodebarAg\DocuWare\DTO\Config\ConfigWithCredentialsTrustedUser;
-//Step 3.a: Use the login token in a new connector to fresh the cached access token
$connector = new DocuWareConnector(
- token: $loginToken->token
+ configuration: new ConfigWithCredentialsTrustedUser(
+ username: 'username',
+ password: 'password',
+ impersonatedUsername: 'impersonatedUsername',
+ )
);
+```
-//Step 3.b: Optionally pass a configuration to the new connector
-$connector = new DocuWareConnector(
- configuration: new Config(
- url: 'https://your-domain.docuware.cloud',
- username: '',
- password: '',
- passphrase: 'passphrase',
- cacheDriver: 'redis',
- cacheLifetimeInSeconds: 60,
- requestTimeoutInSeconds: 60,
- ),
- token: $loginToken->token
-);
+### Extending the connector
+
+We understand it may be repetitive to pass the configuration every time you create a new connector.
+
+You can extend the connector and set the configuration once.
+
+#### Create a new connector
+
+```php
+
### Available Requests
diff --git a/config/laravel-docuware.php b/config/laravel-docuware.php
index 753bce4..1176d87 100644
--- a/config/laravel-docuware.php
+++ b/config/laravel-docuware.php
@@ -35,8 +35,6 @@
'credentials' => [
'url' => env('DOCUWARE_URL'),
- 'username' => env('DOCUWARE_USERNAME'),
- 'password' => env('DOCUWARE_PASSWORD'),
],
/*
@@ -79,6 +77,9 @@
'request' => [
'timeout_in_seconds' => env('DOCUWARE_CACHE_TIMEOUT_IN_SECONDS', 60),
],
+
+ 'client_id' => env('DOCUWARE_CLIENT_ID', 'docuware.platform.net.client'),
+ 'scope' => env('DOCUWARE_SCOPE', 'docuware.platform'),
],
/*
diff --git a/phpunit.xml.dist b/phpunit.xml.dist
index a7b871f..20d2ff8 100644
--- a/phpunit.xml.dist
+++ b/phpunit.xml.dist
@@ -37,6 +37,7 @@
+
diff --git a/src/Connectors/DocuWareConnector.php b/src/Connectors/DocuWareConnector.php
index 8719c75..f297b5f 100644
--- a/src/Connectors/DocuWareConnector.php
+++ b/src/Connectors/DocuWareConnector.php
@@ -2,41 +2,26 @@
namespace CodebarAg\DocuWare\Connectors;
+use CodebarAg\DocuWare\DTO\Authentication\OAuth\IdentityServiceConfiguration;
use CodebarAg\DocuWare\DTO\Authentication\OAuth\RequestToken as RequestTokenDto;
-use CodebarAg\DocuWare\DTO\Config;
+use CodebarAg\DocuWare\DTO\Config\ConfigWithCredentials;
+use CodebarAg\DocuWare\DTO\Config\ConfigWithCredentialsTrustedUser;
use CodebarAg\DocuWare\Events\DocuWareOAuthLog;
use CodebarAg\DocuWare\Requests\Authentication\OAuth\GetIdentityServiceConfiguration;
use CodebarAg\DocuWare\Requests\Authentication\OAuth\GetResponsibleIdentityService;
use CodebarAg\DocuWare\Requests\Authentication\OAuth\RequestTokenWithCredentials;
-use CodebarAg\DocuWare\Requests\Authentication\OAuth\RequestTokenWithToken;
+use CodebarAg\DocuWare\Requests\Authentication\OAuth\RequestTokenWithCredentialsTrustedUser;
use Illuminate\Support\Facades\Cache;
+use Illuminate\Support\Facades\Crypt;
use Psr\SimpleCache\InvalidArgumentException;
use Saloon\Http\Auth\TokenAuthenticator;
use Saloon\Http\Connector;
class DocuWareConnector extends Connector
{
- public Config $configuration;
-
- public ?string $token = null;
-
- public function __construct(?Config $configuration = null, ?string $token = null)
- {
- if (empty($configuration)) {
- $this->configuration = new Config(
- url: config('laravel-docuware.credentials.url'),
- username: config('laravel-docuware.credentials.username'),
- password: config('laravel-docuware.credentials.password'),
- passphrase: config('laravel-docuware.passphrase'),
- cacheDriver: config('laravel-docuware.configurations.cache.driver'),
- cacheLifetimeInSeconds: config('laravel-docuware.configurations.cache.lifetime_in_seconds'),
- requestTimeoutInSeconds: config('laravel-docuware.configurations.request.timeout_in_seconds'),
- );
- } else {
- $this->configuration = $configuration;
- }
-
- $this->token = $token;
+ public function __construct(
+ public ConfigWithCredentials|ConfigWithCredentialsTrustedUser $configuration
+ ) {
}
/**
@@ -44,7 +29,7 @@ public function __construct(?Config $configuration = null, ?string $token = null
*/
public function resolveBaseUrl(): string
{
- return config('laravel-docuware.credentials.url').'/DocuWare/Platform';
+ return $this->configuration->url.'/DocuWare/Platform';
}
public function defaultHeaders(): array
@@ -72,68 +57,70 @@ protected function defaultAuth(): TokenAuthenticator
protected function getOrCreateNewOAuthToken()
{
$cache = Cache::store($this->configuration->cacheDriver);
- $cacheKey = 'docuware.oauth.token.'.$this->configuration->url.'.'.$this->configuration->username;
- if (filled($this->token)) {
- $token = $this->getNewAuthenticationOAuthTokenWithToken($this->token);
+ // get instance name of $this->configuration as string
+ $instanceName = get_class($this->configuration);
- $cache->put(key: $cacheKey, value: $token, ttl: $token->expiresIn);
+ $cacheKey = 'docuware.oauth.'.$instanceName.'.'.$this->configuration->url.'.'.$this->configuration?->username;
- DocuWareOAuthLog::dispatch($this->configuration->url, $this->configuration->username, 'Token set from token');
- }
+ $token = null;
- if (
- $cache->has(key: $cacheKey)
- ) {
- $token = $cache->get(key: $cacheKey);
+ if ($cache->has(key: $cacheKey)) {
+ $token = Crypt::decrypt($cache->get(key: $cacheKey));
DocuWareOAuthLog::dispatch($this->configuration->url, $this->configuration->username, 'Token retrieved from cache');
} else {
- $token = $this->getNewAuthenticationOAuthTokenWithCredentials($this->configuration->username, $this->configuration->password);
+ if ($this->configuration instanceof ConfigWithCredentials) {
+ $token = $this->getNewOAuthTokenWithCredentials();
+
+ DocuWareOAuthLog::dispatch($this->configuration->url, $this->configuration->username, 'Token retrieved from API');
+ }
- $cache->put(key: $cacheKey, value: $token, ttl: $token->expiresIn);
+ if ($this->configuration instanceof ConfigWithCredentialsTrustedUser) {
+ $token = $this->getNewOAuthTokenWithCredentialsTrustedUser();
- DocuWareOAuthLog::dispatch($this->configuration->url, $this->configuration->username, 'Token retrieved from API');
+ DocuWareOAuthLog::dispatch($this->configuration->url, $this->configuration->username, 'Token retrieved from API');
+ }
+
+ $cache->put(key: $cacheKey, value: Crypt::encrypt($token), ttl: $token->expiresIn);
}
return $token->accessToken;
}
- protected function getNewAuthenticationOAuthTokenWithCredentials(
- ?string $username = '',
- ?string $password = '',
- ?string $clientId = 'docuware.platform.net.client'
- ): RequestTokenDto {
+ protected function getAuthenticationTokenEndpoint(): IdentityServiceConfiguration
+ {
$responsibleIdentityServiceResponse = (new GetResponsibleIdentityService())->send();
$identityServiceConfigurationResponse = (new GetIdentityServiceConfiguration(
identityServiceUrl: $responsibleIdentityServiceResponse->dto()->identityServiceUrl
))->send();
+ return $identityServiceConfigurationResponse->dto();
+ }
+
+ protected function getNewOAuthTokenWithCredentials(): RequestTokenDto
+ {
$requestTokenResponse = (new RequestTokenWithCredentials(
- tokenEndpoint: $identityServiceConfigurationResponse->dto()->tokenEndpoint,
- username: $username,
- password: $password,
- clientId: $clientId,
+ tokenEndpoint: $this->getAuthenticationTokenEndpoint()->tokenEndpoint,
+ clientId: $this->configuration->clientId,
+ scope: $this->configuration->scope,
+ username: $this->configuration->username,
+ password: $this->configuration->password,
))->send();
return $requestTokenResponse->dto();
}
- protected function getNewAuthenticationOAuthTokenWithToken(
- string $token,
- ?string $clientId = 'docuware.platform.net.client'
- ): RequestTokenDto {
- $responsibleIdentityServiceResponse = (new GetResponsibleIdentityService())->send();
-
- $identityServiceConfigurationResponse = (new GetIdentityServiceConfiguration(
- identityServiceUrl: $responsibleIdentityServiceResponse->dto()->identityServiceUrl
- ))->send();
-
- $requestTokenResponse = (new RequestTokenWithToken(
- tokenEndpoint: $identityServiceConfigurationResponse->dto()->tokenEndpoint,
- token: $token,
- clientId: $clientId,
+ protected function getNewOAuthTokenWithCredentialsTrustedUser(): RequestTokenDto
+ {
+ $requestTokenResponse = (new RequestTokenWithCredentialsTrustedUser(
+ tokenEndpoint: $this->getAuthenticationTokenEndpoint()->tokenEndpoint,
+ clientId: $this->configuration->clientId,
+ scope: $this->configuration->scope,
+ username: $this->configuration->username,
+ password: $this->configuration->password,
+ impersonateName: $this->configuration->impersonatedUsername,
))->send();
return $requestTokenResponse->dto();
diff --git a/src/DTO/Config.php b/src/DTO/Config.php
deleted file mode 100644
index dabe46d..0000000
--- a/src/DTO/Config.php
+++ /dev/null
@@ -1,32 +0,0 @@
-username = $username;
+ $this->password = $password;
+
+ $this->url = filled($url) ? $url : config('laravel-docuware.credentials.url');
+
+ $this->passphrase = filled($passphrase) ? $passphrase : config('laravel-docuware.passphrase');
+
+ $this->cacheDriver = filled($cacheDriver) ? $cacheDriver : config('laravel-docuware.configurations.cache.driver');
+
+ $this->cacheLifetimeInSeconds = filled($cacheLifetimeInSeconds) ? $cacheLifetimeInSeconds : config('laravel-docuware.configurations.cache.lifetime_in_seconds');
+
+ $this->requestTimeoutInSeconds = filled($requestTimeoutInSeconds) ? $requestTimeoutInSeconds : config('laravel-docuware.configurations.request.timeout_in_seconds');
+
+ $this->clientId = filled($clientId) ? $clientId : config('laravel-docuware.configurations.client_id');
+
+ $this->scope = filled($scope) ? $scope : config('laravel-docuware.configurations.scope');
+ }
+}
diff --git a/src/DTO/Config/ConfigWithCredentialsTrustedUser.php b/src/DTO/Config/ConfigWithCredentialsTrustedUser.php
new file mode 100644
index 0000000..2ec3fd4
--- /dev/null
+++ b/src/DTO/Config/ConfigWithCredentialsTrustedUser.php
@@ -0,0 +1,57 @@
+username = $username;
+ $this->password = $password;
+ $this->impersonatedUsername = $impersonatedUsername;
+
+ $this->url = filled($url) ? $url : config('laravel-docuware.credentials.url');
+
+ $this->passphrase = filled($passphrase) ? $passphrase : config('laravel-docuware.passphrase');
+
+ $this->cacheDriver = filled($cacheDriver) ? $cacheDriver : config('laravel-docuware.configurations.cache.driver');
+
+ $this->cacheLifetimeInSeconds = filled($cacheLifetimeInSeconds) ? $cacheLifetimeInSeconds : config('laravel-docuware.configurations.cache.lifetime_in_seconds');
+
+ $this->requestTimeoutInSeconds = filled($requestTimeoutInSeconds) ? $requestTimeoutInSeconds : config('laravel-docuware.configurations.request.timeout_in_seconds');
+
+ $this->clientId = filled($clientId) ? $clientId : config('laravel-docuware.configurations.client_id');
+
+ $this->scope = filled($scope) ? $scope : config('laravel-docuware.configurations.scope');
+ }
+}
diff --git a/src/Enums/DialogType.php b/src/Enums/DialogType.php
new file mode 100644
index 0000000..517786f
--- /dev/null
+++ b/src/Enums/DialogType.php
@@ -0,0 +1,13 @@
+ 'docuware.platform',
'grant_type' => 'password',
+ 'scope' => $this->scope,
'client_id' => $this->clientId,
'username' => filled($this->username) ? $this->username : config('laravel-docuware.credentials.username'),
'password' => filled($this->password) ? $this->password : config('laravel-docuware.credentials.password'),
diff --git a/src/Requests/Authentication/OAuth/RequestTokenWithToken.php b/src/Requests/Authentication/OAuth/RequestTokenWithCredentialsTrustedUser.php
similarity index 68%
rename from src/Requests/Authentication/OAuth/RequestTokenWithToken.php
rename to src/Requests/Authentication/OAuth/RequestTokenWithCredentialsTrustedUser.php
index be53bff..8912fee 100644
--- a/src/Requests/Authentication/OAuth/RequestTokenWithToken.php
+++ b/src/Requests/Authentication/OAuth/RequestTokenWithCredentialsTrustedUser.php
@@ -10,7 +10,7 @@
use Saloon\Http\SoloRequest;
use Saloon\Traits\Body\HasFormBody;
-class RequestTokenWithToken extends SoloRequest implements HasBody
+class RequestTokenWithCredentialsTrustedUser extends SoloRequest implements HasBody
{
use HasFormBody;
@@ -18,8 +18,11 @@ class RequestTokenWithToken extends SoloRequest implements HasBody
public function __construct(
public readonly mixed $tokenEndpoint,
- public readonly ?string $token = '',
public readonly string $clientId = 'docuware.platform.net.client',
+ public readonly string $scope = 'docuware.platform',
+ public readonly string $username = '',
+ public readonly string $password = '',
+ public readonly string $impersonateName = '',
) {
}
@@ -38,10 +41,12 @@ public function defaultHeaders(): array
public function defaultBody(): array
{
return [
- 'scope' => 'docuware.platform',
- 'grant_type' => 'dwtoken',
+ 'grant_type' => 'trusted',
+ 'scope' => $this->scope,
'client_id' => $this->clientId,
- 'token' => $this->token,
+ 'username' => $this->username,
+ 'password' => $this->password,
+ 'impersonateName' => $this->impersonateName,
];
}
diff --git a/src/Requests/FileCabinets/Dialogs/GetDialogsOfASpecificType.php b/src/Requests/FileCabinets/Dialogs/GetDialogsOfASpecificType.php
new file mode 100644
index 0000000..e1daddc
--- /dev/null
+++ b/src/Requests/FileCabinets/Dialogs/GetDialogsOfASpecificType.php
@@ -0,0 +1,53 @@
+fileCabinetId.'/Dialogs';
+ }
+
+ public function defaultQuery(): array
+ {
+ return [
+ 'DialogType' => $this->dialogType->value,
+ ];
+ }
+
+ public function resolveCacheDriver(): LaravelCacheDriver
+ {
+ return new LaravelCacheDriver(Cache::store(config('laravel-docuware.configurations.cache.driver')));
+ }
+
+ public function cacheExpiryInSeconds(): int
+ {
+ return config('laravel-docuware.configurations.cache.lifetime_in_seconds', 3600);
+ }
+
+ public function createDtoFromResponse(Response $response): mixed
+ {
+ return GetAllDialogsResponse::fromResponse($response);
+ }
+}
diff --git a/src/Requests/FileCabinets/Search/GetDocumentsFromAFileCabinet.php b/src/Requests/FileCabinets/Search/GetDocumentsFromAFileCabinet.php
index 68df81f..ce4790e 100644
--- a/src/Requests/FileCabinets/Search/GetDocumentsFromAFileCabinet.php
+++ b/src/Requests/FileCabinets/Search/GetDocumentsFromAFileCabinet.php
@@ -20,6 +20,7 @@ class GetDocumentsFromAFileCabinet extends Request implements Cacheable
public function __construct(
protected readonly string $fileCabinetId,
+ protected readonly array $fields = [],
protected readonly int $page = 1,
protected readonly int $perPage = 50,
) {
@@ -28,6 +29,7 @@ public function __construct(
public function defaultQuery(): array
{
return [
+ 'fields' => filled($this->fields) ? implode(',', $this->fields) : null,
'count' => $this->perPage,
'start' => ($this->page - 1) * $this->perPage,
];
diff --git a/src/Requests/FileCabinets/SelectLists/GetFilteredSelectLists.php b/src/Requests/FileCabinets/SelectLists/GetFilteredSelectLists.php
new file mode 100644
index 0000000..62433ac
--- /dev/null
+++ b/src/Requests/FileCabinets/SelectLists/GetFilteredSelectLists.php
@@ -0,0 +1,54 @@
+fileCabinetId.'/Query/SelectListExpression';
+ }
+
+ public function defaultQuery(): array
+ {
+ return [
+ 'DialogId' => $this->dialogId,
+ 'FieldName' => $this->fieldName,
+ ];
+ }
+
+ public function resolveCacheDriver(): LaravelCacheDriver
+ {
+ return new LaravelCacheDriver(Cache::store(config('laravel-docuware.configurations.cache.driver')));
+ }
+
+ public function cacheExpiryInSeconds(): int
+ {
+ return config('laravel-docuware.configurations.cache.lifetime_in_seconds', 3600);
+ }
+
+ public function createDtoFromResponse(Response $response): mixed
+ {
+ return GetSelectListsResponse::fromResponse($response);
+ }
+}
diff --git a/src/Requests/FileCabinets/SelectLists/GetSelectLists.php b/src/Requests/FileCabinets/SelectLists/GetSelectLists.php
index a21eb16..0f48f43 100644
--- a/src/Requests/FileCabinets/SelectLists/GetSelectLists.php
+++ b/src/Requests/FileCabinets/SelectLists/GetSelectLists.php
@@ -29,6 +29,14 @@ public function resolveEndpoint(): string
return '/FileCabinets/'.$this->fileCabinetId.'/Query/SelectListExpression';
}
+ public function defaultQuery(): array
+ {
+ return [
+ 'DialogId' => $this->dialogId,
+ 'FieldName' => $this->fieldName,
+ ];
+ }
+
public function resolveCacheDriver(): LaravelCacheDriver
{
return new LaravelCacheDriver(Cache::store(config('laravel-docuware.configurations.cache.driver')));
@@ -39,14 +47,6 @@ public function cacheExpiryInSeconds(): int
return config('laravel-docuware.configurations.cache.lifetime_in_seconds', 3600);
}
- public function defaultQuery(): array
- {
- return [
- 'dialogId' => $this->dialogId,
- 'fieldName' => $this->fieldName,
- ];
- }
-
public function createDtoFromResponse(Response $response): mixed
{
return GetSelectListsResponse::fromResponse($response);
diff --git a/src/Support/Auth.php b/src/Support/Auth.php
index 76ac725..2b7887a 100644
--- a/src/Support/Auth.php
+++ b/src/Support/Auth.php
@@ -60,7 +60,7 @@ public static function forget(): void
public static function domain(): string
{
throw_if(
- empty(config('laravel-docuware.credentials.url')),
+ blank(config('laravel-docuware.credentials.url')),
UnableToFindUrlCredential::create(),
);
diff --git a/src/Support/EnsureValidCredentials.php b/src/Support/EnsureValidCredentials.php
index 640275d..4173a69 100644
--- a/src/Support/EnsureValidCredentials.php
+++ b/src/Support/EnsureValidCredentials.php
@@ -11,17 +11,17 @@ class EnsureValidCredentials
public static function check(): void
{
throw_if(
- empty(config('laravel-docuware.credentials.url')),
+ blank(config('laravel-docuware.credentials.url')),
UnableToFindUrlCredential::create(),
);
throw_if(
- empty(config('laravel-docuware.credentials.username')),
+ blank(config('laravel-docuware.credentials.username')),
UnableToFindUserCredential::create(),
);
throw_if(
- empty(config('laravel-docuware.credentials.password')),
+ blank(config('laravel-docuware.credentials.password')),
UnableToFindPasswordCredential::create(),
);
diff --git a/src/Support/EnsureValidPassphrase.php b/src/Support/EnsureValidPassphrase.php
index 73a46cb..2651d87 100644
--- a/src/Support/EnsureValidPassphrase.php
+++ b/src/Support/EnsureValidPassphrase.php
@@ -9,7 +9,7 @@ class EnsureValidPassphrase
public static function check(): void
{
throw_if(
- empty(config('laravel-docuware.passphrase')),
+ blank(config('laravel-docuware.passphrase')),
UnableToFindPassphrase::create(),
);
}
diff --git a/tests/Feature/DocuWareAuthenticationTest.php b/tests/Feature/DocuWareAuthenticationTest.php
index 869f8b2..643d648 100644
--- a/tests/Feature/DocuWareAuthenticationTest.php
+++ b/tests/Feature/DocuWareAuthenticationTest.php
@@ -2,12 +2,11 @@
use CodebarAg\DocuWare\Connectors\DocuWareConnector;
use CodebarAg\DocuWare\DTO\Authentication\OAuth\IdentityServiceConfiguration;
-use CodebarAg\DocuWare\DTO\Authentication\OAuth\RequestToken;
use CodebarAg\DocuWare\DTO\Authentication\OAuth\ResponsibleIdentityService;
+use CodebarAg\DocuWare\DTO\Config\ConfigWithCredentials;
use CodebarAg\DocuWare\Events\DocuWareOAuthLog;
use CodebarAg\DocuWare\Requests\Authentication\OAuth\GetIdentityServiceConfiguration;
use CodebarAg\DocuWare\Requests\Authentication\OAuth\GetResponsibleIdentityService;
-use CodebarAg\DocuWare\Requests\General\Organization\GetLoginToken;
use CodebarAg\DocuWare\Requests\General\Organization\GetOrganization;
it('can get oath responsible identity service', function () {
@@ -26,37 +25,13 @@
expect($identityServiceConfigurationResponse->dto())->toBeInstanceOf(IdentityServiceConfiguration::class);
})->group('authentication');
-it('can get oath request token', function () {
- $responsibleIdentityServiceResponse = (new GetResponsibleIdentityService())->send();
-
- $identityServiceConfigurationResponse = (new GetIdentityServiceConfiguration(
- identityServiceUrl: $responsibleIdentityServiceResponse->dto()->identityServiceUrl
- ))->send();
-
- $requestTokenResponse = (new \CodebarAg\DocuWare\Requests\Authentication\OAuth\RequestTokenWithCredentials(
- tokenEndpoint: $identityServiceConfigurationResponse->dto()->tokenEndpoint
- ))->send();
-
- expect($requestTokenResponse->dto())->toBeInstanceOf(RequestToken::class);
-})->group('authentication');
-
it('can authenticate with DocuWare Credentials', function () {
Event::fake();
- $connector = new DocuWareConnector();
- $connector->send(new GetOrganization());
-
- Event::assertDispatched(DocuWareOAuthLog::class);
-
-})->group('authentication');
-
-it('can authenticate with DocuWare Token', function () {
- Event::fake();
-
- $connector = new DocuWareConnector();
- $token = $connector->send(new GetLoginToken())->dto();
-
- $connector = new DocuWareConnector(token: $token);
+ $connector = new DocuWareConnector(new ConfigWithCredentials(
+ username: config('laravel-docuware.credentials.username'),
+ password: config('laravel-docuware.credentials.password'),
+ ));
$connector->send(new GetOrganization());
diff --git a/tests/Feature/Requests/Dialogs/GetDialogRequestTest.php b/tests/Feature/Requests/FileCabinets/Dialogs/GetASpecificDialogTest.php
similarity index 100%
rename from tests/Feature/Requests/Dialogs/GetDialogRequestTest.php
rename to tests/Feature/Requests/FileCabinets/Dialogs/GetASpecificDialogTest.php
diff --git a/tests/Feature/Requests/Dialogs/GetDialogsRequestTest.php b/tests/Feature/Requests/FileCabinets/Dialogs/GetAllDialogs.php
similarity index 100%
rename from tests/Feature/Requests/Dialogs/GetDialogsRequestTest.php
rename to tests/Feature/Requests/FileCabinets/Dialogs/GetAllDialogs.php
diff --git a/tests/Feature/Requests/FileCabinets/Dialogs/GetDialogsOfASpecificTypeTest.php b/tests/Feature/Requests/FileCabinets/Dialogs/GetDialogsOfASpecificTypeTest.php
new file mode 100644
index 0000000..1ce23ba
--- /dev/null
+++ b/tests/Feature/Requests/FileCabinets/Dialogs/GetDialogsOfASpecificTypeTest.php
@@ -0,0 +1,26 @@
+connector->send(new GetDialogsOfASpecificType($fileCabinetId, DialogType::SEARCH))->dto();
+
+ $this->assertInstanceOf(Collection::class, $dialogs);
+
+ $this->assertNotCount(0, $dialogs);
+
+ foreach ($dialogs as $dialog) {
+ $this->assertInstanceOf(Dialog::class, $dialog);
+ }
+
+ Event::assertDispatched(DocuWareResponseLog::class);
+});
diff --git a/tests/Feature/Requests/FileCabinets/GetFileCabinetInformationTest.php b/tests/Feature/Requests/FileCabinets/General/GetFileCabinetInformationTest.php
similarity index 100%
rename from tests/Feature/Requests/FileCabinets/GetFileCabinetInformationTest.php
rename to tests/Feature/Requests/FileCabinets/General/GetFileCabinetInformationTest.php
diff --git a/tests/Feature/Requests/Document/GetDocumentRequestTest.php b/tests/Feature/Requests/FileCabinets/Search/GetASpecificDocumentFromAFileCabinetTest.php
similarity index 100%
rename from tests/Feature/Requests/Document/GetDocumentRequestTest.php
rename to tests/Feature/Requests/FileCabinets/Search/GetASpecificDocumentFromAFileCabinetTest.php
diff --git a/tests/Feature/Requests/Document/GetDocumentsRequestTest.php b/tests/Feature/Requests/FileCabinets/Search/GetDocumentsFromAFileCabinetTest.php
similarity index 100%
rename from tests/Feature/Requests/Document/GetDocumentsRequestTest.php
rename to tests/Feature/Requests/FileCabinets/Search/GetDocumentsFromAFileCabinetTest.php
diff --git a/tests/Pest.php b/tests/Pest.php
index d6ff17a..58d7f84 100644
--- a/tests/Pest.php
+++ b/tests/Pest.php
@@ -1,6 +1,7 @@
Date: Wed, 8 May 2024 17:52:50 +0100
Subject: [PATCH 20/54] WIP
---
config/laravel-docuware.php | 2 ++
1 file changed, 2 insertions(+)
diff --git a/config/laravel-docuware.php b/config/laravel-docuware.php
index 1176d87..3b7d467 100644
--- a/config/laravel-docuware.php
+++ b/config/laravel-docuware.php
@@ -35,6 +35,8 @@
'credentials' => [
'url' => env('DOCUWARE_URL'),
+ 'username' => env('DOCUWARE_USERNAME'),
+ 'password' => env('DOCUWARE_PASSWORD'),
],
/*
From 6c8e4a879c78964fa93878e070a785758fedc617 Mon Sep 17 00:00:00 2001
From: Rhys Lees <43909932+RhysLees@users.noreply.github.com>
Date: Mon, 20 May 2024 11:05:31 +0100
Subject: [PATCH 21/54] WIP
---
phpunit.xml.dist | 8 ++++----
.../GetDocumentCountRequestTest.php | 0
.../GetDocumentDownloadRequestTest.php | 0
.../GetDocumentPreviewRequestTest.php | 0
.../{Document => Documents}/PostDocumentRequestTest.php | 0
.../PutDocumentFieldsRequestTest.php | 0
.../Thumbnail/GetDocumentDownloadThumbnailRequestTest.php | 0
7 files changed, 4 insertions(+), 4 deletions(-)
rename tests/Feature/Requests/{Document => Documents}/GetDocumentCountRequestTest.php (100%)
rename tests/Feature/Requests/{Document => Documents}/GetDocumentDownloadRequestTest.php (100%)
rename tests/Feature/Requests/{Document => Documents}/GetDocumentPreviewRequestTest.php (100%)
rename tests/Feature/Requests/{Document => Documents}/PostDocumentRequestTest.php (100%)
rename tests/Feature/Requests/{Document => Documents}/PutDocumentFieldsRequestTest.php (100%)
rename tests/Feature/Requests/{Document => Documents}/Thumbnail/GetDocumentDownloadThumbnailRequestTest.php (100%)
diff --git a/phpunit.xml.dist b/phpunit.xml.dist
index 20d2ff8..60421c1 100644
--- a/phpunit.xml.dist
+++ b/phpunit.xml.dist
@@ -46,9 +46,9 @@
-
-
-
-
+
+
+
+
diff --git a/tests/Feature/Requests/Document/GetDocumentCountRequestTest.php b/tests/Feature/Requests/Documents/GetDocumentCountRequestTest.php
similarity index 100%
rename from tests/Feature/Requests/Document/GetDocumentCountRequestTest.php
rename to tests/Feature/Requests/Documents/GetDocumentCountRequestTest.php
diff --git a/tests/Feature/Requests/Document/GetDocumentDownloadRequestTest.php b/tests/Feature/Requests/Documents/GetDocumentDownloadRequestTest.php
similarity index 100%
rename from tests/Feature/Requests/Document/GetDocumentDownloadRequestTest.php
rename to tests/Feature/Requests/Documents/GetDocumentDownloadRequestTest.php
diff --git a/tests/Feature/Requests/Document/GetDocumentPreviewRequestTest.php b/tests/Feature/Requests/Documents/GetDocumentPreviewRequestTest.php
similarity index 100%
rename from tests/Feature/Requests/Document/GetDocumentPreviewRequestTest.php
rename to tests/Feature/Requests/Documents/GetDocumentPreviewRequestTest.php
diff --git a/tests/Feature/Requests/Document/PostDocumentRequestTest.php b/tests/Feature/Requests/Documents/PostDocumentRequestTest.php
similarity index 100%
rename from tests/Feature/Requests/Document/PostDocumentRequestTest.php
rename to tests/Feature/Requests/Documents/PostDocumentRequestTest.php
diff --git a/tests/Feature/Requests/Document/PutDocumentFieldsRequestTest.php b/tests/Feature/Requests/Documents/PutDocumentFieldsRequestTest.php
similarity index 100%
rename from tests/Feature/Requests/Document/PutDocumentFieldsRequestTest.php
rename to tests/Feature/Requests/Documents/PutDocumentFieldsRequestTest.php
diff --git a/tests/Feature/Requests/Document/Thumbnail/GetDocumentDownloadThumbnailRequestTest.php b/tests/Feature/Requests/Documents/Thumbnail/GetDocumentDownloadThumbnailRequestTest.php
similarity index 100%
rename from tests/Feature/Requests/Document/Thumbnail/GetDocumentDownloadThumbnailRequestTest.php
rename to tests/Feature/Requests/Documents/Thumbnail/GetDocumentDownloadThumbnailRequestTest.php
From 52c8f0cf2afd57ead0cf4596dafd68257fec971e Mon Sep 17 00:00:00 2001
From: Rhys Lees <43909932+RhysLees@users.noreply.github.com>
Date: Mon, 20 May 2024 14:54:30 +0100
Subject: [PATCH 22/54] WIP
---
phpunit.xml.dist | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/phpunit.xml.dist b/phpunit.xml.dist
index 60421c1..21b8f70 100644
--- a/phpunit.xml.dist
+++ b/phpunit.xml.dist
@@ -37,7 +37,7 @@
-
+
From d013729d6ab367e57cf9565cab514fd18f0d765e Mon Sep 17 00:00:00 2001
From: Rhys Lees <43909932+RhysLees@users.noreply.github.com>
Date: Mon, 20 May 2024 14:54:56 +0100
Subject: [PATCH 23/54] WIP
---
.github/workflows/run-tests.yml | 5 -----
1 file changed, 5 deletions(-)
diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml
index 674e778..fa665e7 100644
--- a/.github/workflows/run-tests.yml
+++ b/.github/workflows/run-tests.yml
@@ -54,8 +54,3 @@ jobs:
DOCUWARE_USERNAME: ${{ secrets.DOCUWARE_USERNAME }}
DOCUWARE_PASSWORD: ${{ secrets.DOCUWARE_PASSWORD }}
DOCUWARE_COOKIES: ${{ secrets.DOCUWARE_COOKIES }}
-
- DOCUWARE_TESTS_FILE_CABINET_ID: ${{ secrets.DOCUWARE_TESTS_FILE_CABINET_ID }}
- DOCUWARE_TESTS_DIALOG_ID: ${{ secrets.DOCUWARE_TESTS_DIALOG_ID }}
- DOCUWARE_TESTS_BASKET_ID: ${{ secrets.DOCUWARE_TESTS_BASKET_ID }}
- DOCUWARE_TESTS_ORGANIZATION_ID: ${{ secrets.DOCUWARE_TESTS_ORGANIZATION_ID }}
From f595ba7e820fa428ea67c29970e875714f6f2ca2 Mon Sep 17 00:00:00 2001
From: Rhys Lees <43909932+RhysLees@users.noreply.github.com>
Date: Mon, 20 May 2024 22:33:53 +0100
Subject: [PATCH 24/54] WIP
---
README.md | 4 +-
.../UserManagement/CreateUpdateUser/User.php | 44 +++++++++++
.../UserManagement/GetUsers/OutOfOffice.php | 16 ++++
.../GetUsers/RegionalSettings.php | 4 +-
.../General/UserManagement/GetUsers/User.php | 2 +
.../CreateUpdateUsers/CreateUser.php | 67 +++++++++++++++++
.../CreateUpdateUsers/UpdateUser.php | 73 +++++++++++++++++++
.../CreateUpdateUserTest.php | 43 +++++++++++
8 files changed, 249 insertions(+), 4 deletions(-)
create mode 100644 src/DTO/General/UserManagement/CreateUpdateUser/User.php
create mode 100644 src/Requests/General/UserManagement/CreateUpdateUsers/CreateUser.php
create mode 100644 src/Requests/General/UserManagement/CreateUpdateUsers/UpdateUser.php
create mode 100644 tests/Feature/Requests/General/UserManagement/CreateUpdateUsers/CreateUpdateUserTest.php
diff --git a/README.md b/README.md
index 9309fc3..5a285a0 100644
--- a/README.md
+++ b/README.md
@@ -80,8 +80,8 @@ then optimize the processes that power the core of your business.
| General/UserManagement | Get Users by ID | ✅ |
| General/UserManagement | Get Users of a Role | ✅ |
| General/UserManagement | Get Users of a Group | ✅ |
-| General/UserManagement | Create User | ❌ |
-| General/UserManagement | Update User | ❌ |
+| General/UserManagement | Create User | ✅ |
+| General/UserManagement | Update User | ✅ |
| General/UserManagement | Get Groups | ✅ |
| General/UserManagement | Get All Groups for a Specific User | ✅ |
| General/UserManagement | Add User to a Group | ❌ |
diff --git a/src/DTO/General/UserManagement/CreateUpdateUser/User.php b/src/DTO/General/UserManagement/CreateUpdateUser/User.php
new file mode 100644
index 0000000..3dad871
--- /dev/null
+++ b/src/DTO/General/UserManagement/CreateUpdateUser/User.php
@@ -0,0 +1,44 @@
+after('(')->before(')');
+ $startDateTime = Carbon::createFromTimestamp($startDateTime);
+ }
+
+ if ($endDateTime = Arr::get($data, 'EndDateTime')) {
+ $endDateTime = Str::of($endDateTime)->after('(')->before(')');
+ $endDateTime = Carbon::createFromTimestamp($endDateTime);
+ }
+
return new self(
isOutOfOffice: Arr::get($data, 'IsOutOfOffice'),
+ startDateTime: $startDateTime,
startDateTimeSpecified: Arr::get($data, 'StartDateTimeSpecified'),
+ endDateTime: $endDateTime,
endDateTimeSpecified: Arr::get($data, 'EndDateTimeSpecified'),
);
}
public function __construct(
public bool $isOutOfOffice,
+ public ?Carbon $startDateTime,
public bool $startDateTimeSpecified,
+ public ?Carbon $endDateTime,
public bool $endDateTimeSpecified,
) {
}
diff --git a/src/DTO/General/UserManagement/GetUsers/RegionalSettings.php b/src/DTO/General/UserManagement/GetUsers/RegionalSettings.php
index 62b2253..d7b5278 100644
--- a/src/DTO/General/UserManagement/GetUsers/RegionalSettings.php
+++ b/src/DTO/General/UserManagement/GetUsers/RegionalSettings.php
@@ -15,8 +15,8 @@ public static function fromJson(array $data): self
}
public function __construct(
- public string $language,
- public string $culture,
+ public ?string $language = null,
+ public ?string $culture = null,
) {
}
}
diff --git a/src/DTO/General/UserManagement/GetUsers/User.php b/src/DTO/General/UserManagement/GetUsers/User.php
index fe8f16a..850257d 100644
--- a/src/DTO/General/UserManagement/GetUsers/User.php
+++ b/src/DTO/General/UserManagement/GetUsers/User.php
@@ -12,6 +12,7 @@ public static function fromJson(array $data): self
return new self(
id: Arr::get($data, 'Id'),
name: Arr::get($data, 'Name'),
+ salutation: Arr::get($data, 'Salutation'),
firstName: Arr::get($data, 'FirstName'),
lastName: Arr::get($data, 'LastName'),
dbName: Arr::get($data, 'DBName'),
@@ -27,6 +28,7 @@ public static function fromJson(array $data): self
public function __construct(
public string $id,
public string $name,
+ public ?string $salutation,
public ?string $firstName,
public ?string $lastName,
public string $dbName,
diff --git a/src/Requests/General/UserManagement/CreateUpdateUsers/CreateUser.php b/src/Requests/General/UserManagement/CreateUpdateUsers/CreateUser.php
new file mode 100644
index 0000000..ff3a5b4
--- /dev/null
+++ b/src/Requests/General/UserManagement/CreateUpdateUsers/CreateUser.php
@@ -0,0 +1,67 @@
+ 'application/vnd.docuware.platform.createorganizationuser+json',
+ ];
+ }
+
+ protected function defaultBody(): array
+ {
+ return [
+ 'Name' => $this->user->name,
+ 'DbName' => $this->user->dbName,
+ 'Email' => $this->user->email,
+ 'NetworkId' => $this->user->networkId,
+ 'Password' => $this->user->password,
+ ];
+ }
+
+ public function resolveCacheDriver(): LaravelCacheDriver
+ {
+ return new LaravelCacheDriver(Cache::store(config('laravel-docuware.configurations.cache.driver')));
+ }
+
+ public function cacheExpiryInSeconds(): int
+ {
+ return config('laravel-docuware.configurations.cache.lifetime_in_seconds', 3600);
+ }
+
+ public function createDtoFromResponse(Response $response): GetUser
+ {
+ return GetUserResponse::fromResponse($response);
+ }
+}
diff --git a/src/Requests/General/UserManagement/CreateUpdateUsers/UpdateUser.php b/src/Requests/General/UserManagement/CreateUpdateUsers/UpdateUser.php
new file mode 100644
index 0000000..8e0c43d
--- /dev/null
+++ b/src/Requests/General/UserManagement/CreateUpdateUsers/UpdateUser.php
@@ -0,0 +1,73 @@
+ 'application/json',
+ ];
+ }
+
+ protected function defaultBody(): array
+ {
+ return [
+ 'Id' => $this->user->id,
+ 'Active' => $this->user->active,
+ 'FirstName' => $this->user->firstName,
+ 'LastName' => $this->user->lastName,
+ 'Salutation' => $this->user->salutation,
+ 'Name' => $this->user->name,
+ 'Email' => $this->user->email,
+ 'OutOfOffice' => [
+ 'IsOutOfOffice' => $this->user->outOfOffice->isOutOfOffice,
+ 'StartDateTime' => $this->user->outOfOffice->startDateTime?->toISOString(),
+ 'EndDateTime' => $this->user->outOfOffice->endDateTime?->toISOString(),
+ ],
+ ];
+ }
+
+ public function resolveCacheDriver(): LaravelCacheDriver
+ {
+ return new LaravelCacheDriver(Cache::store(config('laravel-docuware.configurations.cache.driver')));
+ }
+
+ public function cacheExpiryInSeconds(): int
+ {
+ return config('laravel-docuware.configurations.cache.lifetime_in_seconds', 3600);
+ }
+
+ public function createDtoFromResponse(Response $response): User
+ {
+ return GetUserResponse::fromResponse($response);
+ }
+}
diff --git a/tests/Feature/Requests/General/UserManagement/CreateUpdateUsers/CreateUpdateUserTest.php b/tests/Feature/Requests/General/UserManagement/CreateUpdateUsers/CreateUpdateUserTest.php
new file mode 100644
index 0000000..f61a8f0
--- /dev/null
+++ b/tests/Feature/Requests/General/UserManagement/CreateUpdateUsers/CreateUpdateUserTest.php
@@ -0,0 +1,43 @@
+timestamp, -8);
+
+ $user = $this->connector->send(new CreateUser(new User(
+ name: $timestamp.' - Test User',
+ dbName: $timestamp,
+ email: $timestamp.'-test@example.test',
+ password: 'TESTPASSWORD',
+ )))->dto();
+
+ $this->assertInstanceOf(GetUser::class, $user);
+
+ Event::assertDispatched(DocuWareResponseLog::class);
+
+ return $user;
+});
+
+it('can update users', function ($user) {
+ Event::fake();
+
+ sleep(5);
+
+ $user->name .= ' - Updated';
+ $user->active = false;
+
+ $user = $this->connector->send(new UpdateUser($user))->dto();
+
+ $this->assertInstanceOf(GetUser::class, $user);
+
+ Event::assertDispatched(DocuWareResponseLog::class);
+})->depends('it can create users');
From 863827a1168982fac19ba96bf44765737f2a98ac Mon Sep 17 00:00:00 2001
From: Rhys Lees <43909932+RhysLees@users.noreply.github.com>
Date: Tue, 21 May 2024 00:10:06 +0100
Subject: [PATCH 25/54] WIP
---
README.md | 12 ++---
phpunit.xml.dist | 2 +
.../GetModifyGroups/AddUserToAGroup.php | 53 ++++++++++++++++++
.../GetModifyGroups/RemoveUserFromAGroup.php | 53 ++++++++++++++++++
.../GetModifyRoles/AddUserToARole.php | 53 ++++++++++++++++++
.../GetModifyRoles/RemoveUserFromARole.php | 53 ++++++++++++++++++
.../AddRemoveUserToAGroupTest.php | 54 +++++++++++++++++++
.../AddRemoveUserToARoleTest.php | 54 +++++++++++++++++++
8 files changed, 328 insertions(+), 6 deletions(-)
create mode 100644 src/Requests/General/UserManagement/GetModifyGroups/AddUserToAGroup.php
create mode 100644 src/Requests/General/UserManagement/GetModifyGroups/RemoveUserFromAGroup.php
create mode 100644 src/Requests/General/UserManagement/GetModifyRoles/AddUserToARole.php
create mode 100644 src/Requests/General/UserManagement/GetModifyRoles/RemoveUserFromARole.php
create mode 100644 tests/Feature/Requests/General/UserManagement/GetModifyGroups/AddRemoveUserToAGroupTest.php
create mode 100644 tests/Feature/Requests/General/UserManagement/GetModifyRoles/AddRemoveUserToARoleTest.php
diff --git a/README.md b/README.md
index 5a285a0..8d85388 100644
--- a/README.md
+++ b/README.md
@@ -84,12 +84,12 @@ then optimize the processes that power the core of your business.
| General/UserManagement | Update User | ✅ |
| General/UserManagement | Get Groups | ✅ |
| General/UserManagement | Get All Groups for a Specific User | ✅ |
-| General/UserManagement | Add User to a Group | ❌ |
-| General/UserManagement | Remove User from a Group | ❌ |
+| General/UserManagement | Add User to a Group | ✅ |
+| General/UserManagement | Remove User from a Group | ✅ |
| General/UserManagement | Get Roles | ✅ |
| General/UserManagement | Get All Roles for a Specific User | ✅ |
-| General/UserManagement | Add User to a Role | ❌ |
-| General/UserManagement | Remove User from a Role | ❌ |
+| General/UserManagement | Add User to a Role | ✅ |
+| General/UserManagement | Remove User from a Role | ✅ |
| FileCabinets/General | Get File Cabinet Information | ✅ |
| FileCabinets/General | Get Total Number of Documents | ✅ |
| FileCabinets/Dialogs | Get All Dialogs | ✅ |
@@ -97,8 +97,8 @@ then optimize the processes that power the core of your business.
| FileCabinets/Dialogs | Get Dialogs of a Specific Type | ✅ |
| FileCabinets/Search | Get Documents from a File Cabinet | ✅ |
| FileCabinets/Search | Get a Specific Document From a File Cabinet | ✅ |
-| FileCabinets/Search | Search for Documents in a Single File Cabinet | ❌ |
-| FileCabinets/Search | Search for Documents in Multiple File Cabinets | ❌ |
+| FileCabinets/Search | Search for Documents in a Single File Cabinet | ✅ |
+| FileCabinets/Search | Search for Documents in Multiple File Cabinets | ✅ |
| FileCabinets/CheckInCheckOut | Check-out & Download a Document | ❌ |
| FileCabinets/CheckInCheckOut | Check-in a Document from the File System | ❌ |
| FileCabinets/CheckInCheckOut | Undo Check-out | ❌ |
diff --git a/phpunit.xml.dist b/phpunit.xml.dist
index 21b8f70..cc3e2d8 100644
--- a/phpunit.xml.dist
+++ b/phpunit.xml.dist
@@ -50,5 +50,7 @@
+
+
diff --git a/src/Requests/General/UserManagement/GetModifyGroups/AddUserToAGroup.php b/src/Requests/General/UserManagement/GetModifyGroups/AddUserToAGroup.php
new file mode 100644
index 0000000..94064fb
--- /dev/null
+++ b/src/Requests/General/UserManagement/GetModifyGroups/AddUserToAGroup.php
@@ -0,0 +1,53 @@
+ $this->userId,
+ ];
+ }
+
+ protected function defaultBody(): array
+ {
+ return [
+ 'Ids' => $this->ids,
+ 'OperationType' => 'Add',
+ ];
+ }
+
+ public function createDtoFromResponse(Response $response): Response
+ {
+ event(new DocuWareResponseLog($response));
+
+ EnsureValidResponse::from($response);
+
+ return $response;
+ }
+}
diff --git a/src/Requests/General/UserManagement/GetModifyGroups/RemoveUserFromAGroup.php b/src/Requests/General/UserManagement/GetModifyGroups/RemoveUserFromAGroup.php
new file mode 100644
index 0000000..91786e4
--- /dev/null
+++ b/src/Requests/General/UserManagement/GetModifyGroups/RemoveUserFromAGroup.php
@@ -0,0 +1,53 @@
+ $this->userId,
+ ];
+ }
+
+ protected function defaultBody(): array
+ {
+ return [
+ 'Ids' => $this->ids,
+ 'OperationType' => 'Remove',
+ ];
+ }
+
+ public function createDtoFromResponse(Response $response): Response
+ {
+ event(new DocuWareResponseLog($response));
+
+ EnsureValidResponse::from($response);
+
+ return $response;
+ }
+}
diff --git a/src/Requests/General/UserManagement/GetModifyRoles/AddUserToARole.php b/src/Requests/General/UserManagement/GetModifyRoles/AddUserToARole.php
new file mode 100644
index 0000000..0c9a610
--- /dev/null
+++ b/src/Requests/General/UserManagement/GetModifyRoles/AddUserToARole.php
@@ -0,0 +1,53 @@
+ $this->userId,
+ ];
+ }
+
+ protected function defaultBody(): array
+ {
+ return [
+ 'Ids' => $this->ids,
+ 'OperationType' => 'Add',
+ ];
+ }
+
+ public function createDtoFromResponse(Response $response): Response
+ {
+ event(new DocuWareResponseLog($response));
+
+ EnsureValidResponse::from($response);
+
+ return $response;
+ }
+}
diff --git a/src/Requests/General/UserManagement/GetModifyRoles/RemoveUserFromARole.php b/src/Requests/General/UserManagement/GetModifyRoles/RemoveUserFromARole.php
new file mode 100644
index 0000000..bf53307
--- /dev/null
+++ b/src/Requests/General/UserManagement/GetModifyRoles/RemoveUserFromARole.php
@@ -0,0 +1,53 @@
+ $this->userId,
+ ];
+ }
+
+ protected function defaultBody(): array
+ {
+ return [
+ 'Ids' => $this->ids,
+ 'OperationType' => 'Remove',
+ ];
+ }
+
+ public function createDtoFromResponse(Response $response): Response
+ {
+ event(new DocuWareResponseLog($response));
+
+ EnsureValidResponse::from($response);
+
+ return $response;
+ }
+}
diff --git a/tests/Feature/Requests/General/UserManagement/GetModifyGroups/AddRemoveUserToAGroupTest.php b/tests/Feature/Requests/General/UserManagement/GetModifyGroups/AddRemoveUserToAGroupTest.php
new file mode 100644
index 0000000..22e093e
--- /dev/null
+++ b/tests/Feature/Requests/General/UserManagement/GetModifyGroups/AddRemoveUserToAGroupTest.php
@@ -0,0 +1,54 @@
+timestamp, -8);
+
+ $user = $this->connector->send(new CreateUser(new User(
+ name: $timestamp.' - Test User',
+ dbName: $timestamp,
+ email: $timestamp.'-test@example.test',
+ password: 'TESTPASSWORD',
+ )))->dto();
+
+ sleep(5);
+
+ $response = $this->connector->send(new AddUserToAGroup(
+ userId: $user->id,
+ ids: [
+ env('DOCUWARE_TESTS_GROUP_ID'),
+ ]
+ ))->dto();
+
+ expect($response->status())->toBe(200);
+
+ Event::assertDispatched(DocuWareResponseLog::class);
+
+ return $user;
+});
+
+it('can remove groups to a user', function ($user) {
+ Event::fake();
+
+ sleep(5);
+
+ $response = $this->connector->send(new RemoveUserFromAGroup(
+ userId: $user->id,
+ ids: [
+ env('DOCUWARE_TESTS_GROUP_ID'),
+ ]
+ ))->dto();
+
+ expect($response->status())->toBe(200);
+
+ Event::assertDispatched(DocuWareResponseLog::class);
+})->depends('it can add groups to a user');
diff --git a/tests/Feature/Requests/General/UserManagement/GetModifyRoles/AddRemoveUserToARoleTest.php b/tests/Feature/Requests/General/UserManagement/GetModifyRoles/AddRemoveUserToARoleTest.php
new file mode 100644
index 0000000..4f89916
--- /dev/null
+++ b/tests/Feature/Requests/General/UserManagement/GetModifyRoles/AddRemoveUserToARoleTest.php
@@ -0,0 +1,54 @@
+timestamp, -8);
+
+ $user = $this->connector->send(new CreateUser(new User(
+ name: $timestamp.' - Test User',
+ dbName: $timestamp,
+ email: $timestamp.'-test@example.test',
+ password: 'TESTPASSWORD',
+ )))->dto();
+
+ sleep(5);
+
+ $response = $this->connector->send(new AddUserToARole(
+ userId: $user->id,
+ ids: [
+ env('DOCUWARE_TESTS_ROLE_ID'),
+ ]
+ ))->dto();
+
+ expect($response->status())->toBe(200);
+
+ Event::assertDispatched(DocuWareResponseLog::class);
+
+ return $user;
+});
+
+it('can remove roles to a user', function ($user) {
+ Event::fake();
+
+ sleep(5);
+
+ $response = $this->connector->send(new RemoveUserFromARole(
+ userId: $user->id,
+ ids: [
+ env('DOCUWARE_TESTS_ROLE_ID'),
+ ]
+ ))->dto();
+
+ expect($response->status())->toBe(200);
+
+ Event::assertDispatched(DocuWareResponseLog::class);
+})->depends('it can add roles to a user');
From 32d4f83f4df7ca03f66a401a2816310c055555fb Mon Sep 17 00:00:00 2001
From: Rhys Lees <43909932+RhysLees@users.noreply.github.com>
Date: Tue, 21 May 2024 00:40:51 +0100
Subject: [PATCH 26/54] WIP
---
src/Connectors/DocuWareConnector.php | 2 +-
src/DTO/General/UserManagement/GetUsers/User.php | 2 ++
2 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/Connectors/DocuWareConnector.php b/src/Connectors/DocuWareConnector.php
index f297b5f..627e1ad 100644
--- a/src/Connectors/DocuWareConnector.php
+++ b/src/Connectors/DocuWareConnector.php
@@ -61,7 +61,7 @@ protected function getOrCreateNewOAuthToken()
// get instance name of $this->configuration as string
$instanceName = get_class($this->configuration);
- $cacheKey = 'docuware.oauth.'.$instanceName.'.'.$this->configuration->url.'.'.$this->configuration?->username;
+ $cacheKey = 'docuware.oauth.'.$instanceName.'.'.$this->configuration->url.'.'.($this->configuration->username ?? '');
$token = null;
diff --git a/src/DTO/General/UserManagement/GetUsers/User.php b/src/DTO/General/UserManagement/GetUsers/User.php
index 850257d..6727a07 100644
--- a/src/DTO/General/UserManagement/GetUsers/User.php
+++ b/src/DTO/General/UserManagement/GetUsers/User.php
@@ -44,6 +44,7 @@ public function __construct(
public static function fake(
?string $id = null,
?string $name = null,
+ ?string $salutation = null,
?string $firstName = null,
?string $lastName = null,
?string $dbName = null,
@@ -57,6 +58,7 @@ public static function fake(
return new self(
id: $id ?? (string) Str::uuid(),
name: $name ?? (string) 'Fake File Cabinet',
+ salutation: $salutation ?? (string) 'Fake Salutation',
firstName: $firstName ?? (string) 'Fake First Name',
lastName: $lastName ?? (string) 'Fake Last Name',
dbName: $dbName ?? (string) 'Fake DB Name',
From a52dd2396e27f04cc51cb8e4d12c5e37375bbe53 Mon Sep 17 00:00:00 2001
From: Rhys Lees <43909932+RhysLees@users.noreply.github.com>
Date: Tue, 21 May 2024 20:48:15 +0100
Subject: [PATCH 27/54] WIP
---
README.md | 8 +-
src/DTO/Documents/Document.php | 22 ++-
.../ClipUnclipStapleUnstaple/Clip.php | 44 +++++
.../ClipUnclipStapleUnstaple/Staple.php | 44 +++++
.../ClipUnclipStapleUnstaple/Unclip.php | 48 ++++++
.../ClipUnclipStapleUnstaple/Unstaple.php | 48 ++++++
.../GetDocumentsFromAFileCabinetResponse.php | 2 +-
.../ClipUnclipStapleUnstapleTest.php | 152 ++++++++++++++++++
tests/Fixtures/files/test-1.pdf | Bin 0 -> 8570 bytes
tests/Fixtures/files/test-2.pdf | Bin 0 -> 8639 bytes
tests/Pest.php | 22 +++
11 files changed, 381 insertions(+), 9 deletions(-)
create mode 100644 src/Requests/Documents/ClipUnclipStapleUnstaple/Clip.php
create mode 100644 src/Requests/Documents/ClipUnclipStapleUnstaple/Staple.php
create mode 100644 src/Requests/Documents/ClipUnclipStapleUnstaple/Unclip.php
create mode 100644 src/Requests/Documents/ClipUnclipStapleUnstaple/Unstaple.php
create mode 100644 tests/Feature/Requests/Documents/ClipUnclipStapleUnstaple/ClipUnclipStapleUnstapleTest.php
create mode 100644 tests/Fixtures/files/test-1.pdf
create mode 100644 tests/Fixtures/files/test-2.pdf
diff --git a/README.md b/README.md
index 8d85388..0e9a648 100644
--- a/README.md
+++ b/README.md
@@ -118,10 +118,10 @@ then optimize the processes that power the core of your business.
| Documents/UpdateIndexValues | Update Table Field Values | ❌ |
| Documents/ModifyDocuments | Transfer Document | ✅ |
| Documents/ModifyDocuments | Delete Document | ✅ |
-| Documents/ClipUnclip&StapleUnstaple | Clip | ❌ |
-| Documents/ClipUnclip&StapleUnstaple | Unclip | ❌ |
-| Documents/ClipUnclip&StapleUnstaple | Staple | ❌ |
-| Documents/ClipUnclip&StapleUnstaple | Unstaple | ❌ |
+| Documents/ClipUnclip&StapleUnstaple | Clip | ✅ |
+| Documents/ClipUnclip&StapleUnstaple | Unclip | ✅ |
+| Documents/ClipUnclip&StapleUnstaple | Staple | ✅ |
+| Documents/ClipUnclip&StapleUnstaple | Unstaple | ✅ |
| Documents/AnnotationsStamps | AddStampWithPosition | ❌ |
| Documents/AnnotationsStamps | AddStampWithBestPosition | ❌ |
| Documents/AnnotationsStamps | AddTextAnnotation | ❌ |
diff --git a/src/DTO/Documents/Document.php b/src/DTO/Documents/Document.php
index f3117c4..9063703 100644
--- a/src/DTO/Documents/Document.php
+++ b/src/DTO/Documents/Document.php
@@ -3,6 +3,7 @@
namespace CodebarAg\DocuWare\DTO\Documents;
use Carbon\Carbon;
+use CodebarAg\DocuWare\DTO\Section;
use CodebarAg\DocuWare\DTO\SuggestionField;
use CodebarAg\DocuWare\Support\ParseValue;
use Illuminate\Support\Arr;
@@ -13,14 +14,18 @@ final class Document
{
public static function fromJson(array $data): self
{
- $suggestions = Arr::has($data, 'Suggestions')
- ? self::convertSuggestions(collect(Arr::get($data, 'Suggestions')))
- : null;
-
$fields = Arr::has($data, 'Fields')
? self::convertFields(collect(Arr::get($data, 'Fields')))
: null;
+ $sections = Arr::has($data, 'Sections')
+ ? self::convertSections(collect(Arr::get($data, 'Sections')))
+ : null;
+
+ $suggestions = Arr::has($data, 'Suggestions')
+ ? self::convertSuggestions(collect(Arr::get($data, 'Suggestions')))
+ : null;
+
return new self(
id: Arr::get($data, 'Id'),
file_size: Arr::get($data, 'FileSize'),
@@ -33,6 +38,7 @@ public static function fromJson(array $data): self
created_at: ParseValue::date(Arr::get($data, 'CreatedAt')),
updated_at: ParseValue::date(Arr::get($data, 'LastModified')),
fields: $fields,
+ sections: $sections,
suggestions: $suggestions,
);
}
@@ -51,6 +57,13 @@ protected static function convertSuggestions(Collection $suggestions): ?Collecti
});
}
+ protected static function convertSections(Collection $sections): ?Collection
+ {
+ return $sections->mapWithKeys(function (array $section) {
+ return [$section['Id'] => Section::fromJson($section)];
+ });
+ }
+
public function __construct(
public int $id,
public int $file_size,
@@ -63,6 +76,7 @@ public function __construct(
public Carbon $created_at,
public Carbon $updated_at,
public ?Collection $fields,
+ public ?Collection $sections,
public ?Collection $suggestions,
) {
}
diff --git a/src/Requests/Documents/ClipUnclipStapleUnstaple/Clip.php b/src/Requests/Documents/ClipUnclipStapleUnstaple/Clip.php
new file mode 100644
index 0000000..38c65e2
--- /dev/null
+++ b/src/Requests/Documents/ClipUnclipStapleUnstaple/Clip.php
@@ -0,0 +1,44 @@
+documentTrayId.'/Operations/ContentMerge';
+ }
+
+ public function defaultBody(): array
+ {
+ return [
+ 'Documents' => $this->documents,
+ 'Operation' => 'Clip',
+ 'Force' => $this->force,
+ ];
+ }
+
+ public function createDtoFromResponse(Response $response): Document
+ {
+ return GetASpecificDocumentFromAFileCabinetResponse::fromResponse($response);
+ }
+}
diff --git a/src/Requests/Documents/ClipUnclipStapleUnstaple/Staple.php b/src/Requests/Documents/ClipUnclipStapleUnstaple/Staple.php
new file mode 100644
index 0000000..057abf1
--- /dev/null
+++ b/src/Requests/Documents/ClipUnclipStapleUnstaple/Staple.php
@@ -0,0 +1,44 @@
+documentTrayId.'/Operations/ContentMerge';
+ }
+
+ public function defaultBody(): array
+ {
+ return [
+ 'Documents' => $this->documents,
+ 'Operation' => 'Staple',
+ 'Force' => $this->force,
+ ];
+ }
+
+ public function createDtoFromResponse(Response $response): Document
+ {
+ return GetASpecificDocumentFromAFileCabinetResponse::fromResponse($response);
+ }
+}
diff --git a/src/Requests/Documents/ClipUnclipStapleUnstaple/Unclip.php b/src/Requests/Documents/ClipUnclipStapleUnstaple/Unclip.php
new file mode 100644
index 0000000..2b2cb48
--- /dev/null
+++ b/src/Requests/Documents/ClipUnclipStapleUnstaple/Unclip.php
@@ -0,0 +1,48 @@
+documentTrayId.'/Operations/ContentDivide';
+ }
+
+ public function defaultQuery(): array
+ {
+ return [
+ 'DocId' => $this->documentId,
+ ];
+ }
+
+ public function defaultBody(): array
+ {
+ return [
+ 'Operation' => 'Unclip',
+ ];
+ }
+
+ public function createDtoFromResponse(Response $response): DocumentPaginator
+ {
+ return GetDocumentsFromAFileCabinetResponse::fromResponse($response);
+ }
+}
diff --git a/src/Requests/Documents/ClipUnclipStapleUnstaple/Unstaple.php b/src/Requests/Documents/ClipUnclipStapleUnstaple/Unstaple.php
new file mode 100644
index 0000000..dc3f139
--- /dev/null
+++ b/src/Requests/Documents/ClipUnclipStapleUnstaple/Unstaple.php
@@ -0,0 +1,48 @@
+documentTrayId.'/Operations/ContentDivide';
+ }
+
+ public function defaultQuery(): array
+ {
+ return [
+ 'DocId' => $this->documentId,
+ ];
+ }
+
+ public function defaultBody(): array
+ {
+ return [
+ 'Operation' => 'Unstaple',
+ ];
+ }
+
+ public function createDtoFromResponse(Response $response): DocumentPaginator
+ {
+ return GetDocumentsFromAFileCabinetResponse::fromResponse($response);
+ }
+}
diff --git a/src/Responses/FileCabinets/Search/GetDocumentsFromAFileCabinetResponse.php b/src/Responses/FileCabinets/Search/GetDocumentsFromAFileCabinetResponse.php
index 31306d8..c2786bd 100644
--- a/src/Responses/FileCabinets/Search/GetDocumentsFromAFileCabinetResponse.php
+++ b/src/Responses/FileCabinets/Search/GetDocumentsFromAFileCabinetResponse.php
@@ -10,7 +10,7 @@
final class GetDocumentsFromAFileCabinetResponse
{
- public static function fromResponse(Response $response, $page, $perPage): DocumentPaginator
+ public static function fromResponse(Response $response, $page = 1, $perPage = 50): DocumentPaginator
{
event(new DocuWareResponseLog($response));
diff --git a/tests/Feature/Requests/Documents/ClipUnclipStapleUnstaple/ClipUnclipStapleUnstapleTest.php b/tests/Feature/Requests/Documents/ClipUnclipStapleUnstaple/ClipUnclipStapleUnstapleTest.php
new file mode 100644
index 0000000..f11a86f
--- /dev/null
+++ b/tests/Feature/Requests/Documents/ClipUnclipStapleUnstaple/ClipUnclipStapleUnstapleTest.php
@@ -0,0 +1,152 @@
+send(new GetDocumentsFromAFileCabinet(
+ $fileCabinetId
+ ))->dto();
+
+ foreach ($paginator->documents as $document) {
+ $connector->send(new DeleteDocument(
+ $fileCabinetId,
+ $document->id,
+ ))->dto();
+ }
+}
+
+function uploadFiles($connector, $fileCabinetId, $path): array
+{
+ $document = $connector->send(new CreateDataRecord(
+ $fileCabinetId,
+ file_get_contents($path.'/test-1.pdf'),
+ 'test-1.pdf',
+ ))->dto();
+
+ $document2 = $connector->send(new CreateDataRecord(
+ $fileCabinetId,
+ file_get_contents($path.'/test-2.pdf'),
+ 'test-2.pdf',
+ ))->dto();
+
+ sleep(5); // Wait for the files to be uploaded and processed
+
+ // Have to get document again as returned data is incorrect
+ $document = $connector->send(new GetASpecificDocumentFromAFileCabinet(
+ $fileCabinetId,
+ $document->id
+ ))->dto();
+
+ // Have to get document2 again as returned data is incorrect
+ $document2 = $connector->send(new GetASpecificDocumentFromAFileCabinet(
+ $fileCabinetId,
+ $document2->id
+ ))->dto();
+
+ return [$document, $document2];
+}
+
+it('can clip 2 documents', function () {
+ Event::fake();
+
+ $fileCabinetId = config('laravel-docuware.tests.basket_id');
+ $path = __DIR__.'/../../../../Fixtures/files';
+
+ cleanup($this->connector, $fileCabinetId);
+
+ [$document, $document2] = uploadFiles($this->connector, $fileCabinetId, $path);
+
+ $clip = $this->connector->send(new Clip(
+ $fileCabinetId,
+ [
+ $document->id,
+ $document2->id,
+ ]
+ ))->dto();
+
+ expect($clip->id)->toBe($document->id)
+ ->and($clip->total_pages)->toBe($document->total_pages + $document2->total_pages)
+ ->and($clip->sections->count())->toBe(2);
+
+ Event::assertDispatched(DocuWareResponseLog::class);
+
+ return [$clip, $document, $document2];
+});
+
+it('can unclip 2 documents', function ($test) {
+ Event::fake();
+
+ [$clip, $document, $document2] = $test;
+
+ $fileCabinetId = config('laravel-docuware.tests.basket_id');
+
+ sleep(5);
+
+ $unclip = $this->connector->send(new Unclip(
+ $fileCabinetId,
+ $clip->id
+ ))->dto();
+
+ expect($unclip->documents->count())->toBe(2)
+ ->and($unclip->documents->first()->title)->toBe($document->title)
+ ->and($unclip->documents->first()->file_size)->toBe($document->file_size)
+ ->and($unclip->documents->last()->title)->toBe($document2->title)
+ ->and($unclip->documents->last()->file_size)->toBe($document2->file_size);
+
+ Event::assertDispatched(DocuWareResponseLog::class);
+})->depends('it can clip 2 documents');
+
+it('can staple 2 documents', function () {
+ Event::fake();
+
+ $fileCabinetId = config('laravel-docuware.tests.basket_id');
+ $path = __DIR__.'/../../../../Fixtures/files';
+
+ cleanup($this->connector, $fileCabinetId);
+
+ [$document, $document2] = uploadFiles($this->connector, $fileCabinetId, $path);
+
+ $staple = $this->connector->send(new Staple(
+ $fileCabinetId,
+ [
+ $document->id,
+ $document2->id,
+ ]
+ ))->dto();
+
+ expect($staple->title)->toBe($document->title)
+ ->and($staple->total_pages)->toBe($document->total_pages + $document2->total_pages);
+
+ Event::assertDispatched(DocuWareResponseLog::class);
+
+ return $staple;
+
+});
+
+it('can unstaple 2 documents', function ($staple) {
+ Event::fake();
+
+ $fileCabinetId = config('laravel-docuware.tests.basket_id');
+
+ sleep(5);
+
+ $unclip = $this->connector->send(new Unstaple(
+ $fileCabinetId,
+ $staple->id
+ ))->dto();
+
+ expect($unclip->documents->count())->toBe($staple->total_pages);
+
+ Event::assertDispatched(DocuWareResponseLog::class);
+})->depends('it can staple 2 documents');
diff --git a/tests/Fixtures/files/test-1.pdf b/tests/Fixtures/files/test-1.pdf
new file mode 100644
index 0000000000000000000000000000000000000000..505f6f4836d7040892ab809ac3fcc3022a48f634
GIT binary patch
literal 8570
zcmcJV1yqz>w}1f&8IVv)KpByco*F#m{hK3=AmQtEQKxsupN>Y?=kq!xIkWQtf
z8}6W=|L^zt-*xZ0Yu$IvnwhiTePYMF>pc4mvzoLl7nmCgU~XF2T3E^6e%0I50)PTR
zKqTA-AS?{zk+rr%A)GOvb}$q|8exVsM*w-05Du0oDIufkl4fj6;Ybx^W(<_PHDZ7U5liCi2^f^2uskaBCoG?
z2^eik3sA^%Z-lFDc_EqxYlA0a(n5u2Gssj|sB;?#z}yBA@wbCyijMB0|9xa3i3TO=EkwV%boi!a{W(eSg
zlcik1K)xSyh>BudjhXg`SW6266u1y$M!#_MUlR!aHh~IeZ9EbeA#%XP2goChaI-c;
zXvj(aD@YK2Fyudn@%PZB#Jg*0j#7p6)C$!0US$L_@6dV?0zcooPl>A@ChxC?6CB9m
zCXFXcLC&UQuJr+1E`-rchJxtvBls}k7MWU0gSxcL!UWouaHD{4doua7Rex%9seE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^%k51)Pb9_eDTlZl`
z`7F(o!dTq-X}MgMTP&Xf57%eE^tP@O>juj8+X?NMic)Bu>8
zIOedWqqDUYK-Sf_mLE^Hc7*yZb;oDDe0+HOnV9FyH^a)Vz0x!BrKOGYcWGs10b``6
z3{%JXOL{)W-u>N|EY>?BJ6oL_4KTb=oE_?2F5P%hv2*r)x>_@Rqpr{CTmTt8Zhbarg~Eejk4x#Ylv-|ewfCb>
z2?|mQYX1Xf^8Z#yz!Xi)UCl5@+IQ?>W~!P%9fY%sHPQhH=H=!C8r_j}wYD<{LZGq&
zLPl&rbyt`($_t1&yZuqG@j$U*I1zK&jl%Sh#vHf;?nvK-fH17j2LXcxFh{K*0}zN6
z^TOyUBh4>Vfd9S9zbhRc&Ik(t2nZGcfc|x1Fq99<2ebhGl0l%D(#pjJboeEM@?**o
z|B!(|5KN`z?|L98rX2AP85GQmDboBy57Ydo3@X6;=XkuBqyK;Og+hfeb&$W02L%iM
zDdPiSVE7+;{6c@s!3%->VH;HFqFna(zP!8`T>pnm;BR^;XBdXcoqznFLDSj`f$=lu
zv>%B?0Wn3aAJsT{2MZ(+e32%YN}Rkjrq&}22l1Ml!C_zooEL^!iU0%(5#WbI1ThEx
j<}fo}uqfbvR{2@~azSB|=tqPFK>`o}Gqa4UEa1NYiwW&8
literal 0
HcmV?d00001
diff --git a/tests/Fixtures/files/test-2.pdf b/tests/Fixtures/files/test-2.pdf
new file mode 100644
index 0000000000000000000000000000000000000000..2a9a4169147d6000974e17f80fa17fbbeea89980
GIT binary patch
literal 8639
zcmcJV1yodP_wWG;8Bjow5@bL?dWH!?N?Jflx*1^Tk`74$ML@bsT0lxtkZwUrLRz}J
zr2m6n-|M};-}-;+TkAV()|`3v*-z}fpE+y)_Bjj+ViN3}98ds5%fjx$TF%~^zLqus
z6bJ^|7?=b2`GFt_GfM}g9qMd}a6pP74Q-5&K+t2PwTXi%kQ2%c6chy5JJ=x+Rsa|D
z=+DA{CNLpZpNIU8V^&Z$G%{1Ff|L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yMvrA_W2eyUNcZn!N*R6a9!V4=0Qh
Lz`!6bF9G-;!A~>;
literal 0
HcmV?d00001
diff --git a/tests/Pest.php b/tests/Pest.php
index 58d7f84..3feb7b3 100644
--- a/tests/Pest.php
+++ b/tests/Pest.php
@@ -4,6 +4,8 @@
use CodebarAg\DocuWare\DTO\Config\ConfigWithCredentials;
use CodebarAg\DocuWare\Requests\Documents\ModifyDocuments\DeleteDocument;
use CodebarAg\DocuWare\Requests\FileCabinets\Search\GetDocumentsFromAFileCabinet;
+use CodebarAg\DocuWare\Requests\General\UserManagement\CreateUpdateUsers\UpdateUser;
+use CodebarAg\DocuWare\Requests\General\UserManagement\GetUsers\GetUsers;
use CodebarAg\DocuWare\Tests\TestCase;
uses(TestCase::class)
@@ -15,6 +17,9 @@
clearFiles();
})
+ ->afterEach(function () {
+ setUsersInactive();
+ })
->in('Feature');
function clearFiles(): void
@@ -33,6 +38,23 @@ function clearFiles(): void
}
}
+function setUsersInactive(): void
+{
+ $connector = getConnector();
+
+ $response = $connector->send(new GetUsers());
+
+ $users = $response->dto()->filter(function ($user) {
+ return Str::contains($user->email, 'test@example.test') && $user->active === true;
+ });
+
+ foreach ($users as $user) {
+ $user->active = false;
+
+ $connector->send(new UpdateUser($user));
+ }
+}
+
/**
* @throws Throwable
*/
From 482bbd95772fabbb226f4c38b79d9b9be7bd2fc0 Mon Sep 17 00:00:00 2001
From: Rhys Lees <43909932+RhysLees@users.noreply.github.com>
Date: Tue, 21 May 2024 20:49:24 +0100
Subject: [PATCH 28/54] WIP
---
.../ClipUnclipStapleUnstaple/ClipUnclipStapleUnstapleTest.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tests/Feature/Requests/Documents/ClipUnclipStapleUnstaple/ClipUnclipStapleUnstapleTest.php b/tests/Feature/Requests/Documents/ClipUnclipStapleUnstaple/ClipUnclipStapleUnstapleTest.php
index f11a86f..b5ed98e 100644
--- a/tests/Feature/Requests/Documents/ClipUnclipStapleUnstaple/ClipUnclipStapleUnstapleTest.php
+++ b/tests/Feature/Requests/Documents/ClipUnclipStapleUnstaple/ClipUnclipStapleUnstapleTest.php
@@ -134,7 +134,7 @@ function uploadFiles($connector, $fileCabinetId, $path): array
});
-it('can unstaple 2 documents', function ($staple) {
+it('can unstaple a document', function ($staple) {
Event::fake();
$fileCabinetId = config('laravel-docuware.tests.basket_id');
From 1b072838237bfb7d2020cd1e7eccdb1c09208771 Mon Sep 17 00:00:00 2001
From: Rhys Lees <43909932+RhysLees@users.noreply.github.com>
Date: Tue, 21 May 2024 20:55:31 +0100
Subject: [PATCH 29/54] WIP
---
src/DTO/Documents/Document.php | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/DTO/Documents/Document.php b/src/DTO/Documents/Document.php
index 9063703..04439ef 100644
--- a/src/DTO/Documents/Document.php
+++ b/src/DTO/Documents/Document.php
@@ -131,6 +131,7 @@ public static function fake(
?Carbon $created_at = null,
?Carbon $updated_at = null,
?Collection $fields = null,
+ ?Collection $sections = null,
?Collection $suggestions = null,
): self {
return new self(
@@ -148,6 +149,7 @@ public static function fake(
DocumentField::fake(),
DocumentField::fake(),
]),
+ sections: $sections ?? null,
suggestions: $suggestions ?? null
);
}
From 0cd63bba1ebc28f1b3ced074715c167dd0fcf940 Mon Sep 17 00:00:00 2001
From: Rhys Lees <43909932+RhysLees@users.noreply.github.com>
Date: Tue, 21 May 2024 21:48:31 +0100
Subject: [PATCH 30/54] WIP
---
.../ClipUnclipStapleUnstapleTest.php | 13 ++++++++++---
1 file changed, 10 insertions(+), 3 deletions(-)
diff --git a/tests/Feature/Requests/Documents/ClipUnclipStapleUnstaple/ClipUnclipStapleUnstapleTest.php b/tests/Feature/Requests/Documents/ClipUnclipStapleUnstaple/ClipUnclipStapleUnstapleTest.php
index b5ed98e..58c87a4 100644
--- a/tests/Feature/Requests/Documents/ClipUnclipStapleUnstaple/ClipUnclipStapleUnstapleTest.php
+++ b/tests/Feature/Requests/Documents/ClipUnclipStapleUnstaple/ClipUnclipStapleUnstapleTest.php
@@ -125,12 +125,19 @@ function uploadFiles($connector, $fileCabinetId, $path): array
]
))->dto();
- expect($staple->title)->toBe($document->title)
- ->and($staple->total_pages)->toBe($document->total_pages + $document2->total_pages);
+ sleep(5); // Wait for the files to be uploaded and processed
+
+ $stapledDocument = $this->connector->send(new GetASpecificDocumentFromAFileCabinet(
+ $fileCabinetId,
+ $staple->id
+ ))->dto();
+
+ expect($stapledDocument->title)->toBe($document->title)
+ ->and($stapledDocument->total_pages)->toBe($document->total_pages + $document2->total_pages);
Event::assertDispatched(DocuWareResponseLog::class);
- return $staple;
+ return $stapledDocument;
});
From 6bd3785c0ec44d22e7d3e38c0b9ea37ae34e1634 Mon Sep 17 00:00:00 2001
From: Rhys Lees <43909932+RhysLees@users.noreply.github.com>
Date: Tue, 28 May 2024 22:27:44 +0100
Subject: [PATCH 31/54] WIP
---
src/DocuWareSearchRequestBuilder.php | 23 +-
.../DocumentsTrashBin/GetDocuments.php | 73 ++++++
.../ClipUnclipStapleUnstaple/ClipTest.php | 30 +++
.../ClipUnclipStapleUnstapleTest.php | 159 ------------
.../ClipUnclipStapleUnstaple/StapleTest.php | 37 +++
.../ClipUnclipStapleUnstaple/UnclipTest.php | 40 +++
.../ClipUnclipStapleUnstaple/UnstapleTest.php | 36 +++
.../GetDocumentsFromTrashBin.php | 228 ++++++++++++++++++
tests/Pest.php | 47 ++++
9 files changed, 513 insertions(+), 160 deletions(-)
create mode 100644 src/Requests/Documents/DocumentsTrashBin/GetDocuments.php
create mode 100644 tests/Feature/Requests/Documents/ClipUnclipStapleUnstaple/ClipTest.php
delete mode 100644 tests/Feature/Requests/Documents/ClipUnclipStapleUnstaple/ClipUnclipStapleUnstapleTest.php
create mode 100644 tests/Feature/Requests/Documents/ClipUnclipStapleUnstaple/StapleTest.php
create mode 100644 tests/Feature/Requests/Documents/ClipUnclipStapleUnstaple/UnclipTest.php
create mode 100644 tests/Feature/Requests/Documents/ClipUnclipStapleUnstaple/UnstapleTest.php
create mode 100644 tests/Feature/Requests/Documents/DocumentsTrashBin/GetDocumentsFromTrashBin.php
diff --git a/src/DocuWareSearchRequestBuilder.php b/src/DocuWareSearchRequestBuilder.php
index a347c1c..b799ea8 100644
--- a/src/DocuWareSearchRequestBuilder.php
+++ b/src/DocuWareSearchRequestBuilder.php
@@ -4,6 +4,7 @@
use Carbon\Carbon;
use CodebarAg\DocuWare\Exceptions\UnableToSearch;
+use CodebarAg\DocuWare\Requests\Documents\DocumentsTrashBin\GetDocuments;
use CodebarAg\DocuWare\Requests\Search\GetSearchRequest;
use Illuminate\Support\Str;
use Saloon\Exceptions\InvalidResponseClassException;
@@ -31,6 +32,15 @@ class DocuWareSearchRequestBuilder
protected array $usedDateOperators = [];
+ protected bool $trashBin = false;
+
+ public function trashBin(): self
+ {
+ $this->trashBin = true;
+
+ return $this;
+ }
+
public function fileCabinet(string $fileCabinetId): self
{
$this->fileCabinetId = $fileCabinetId;
@@ -144,7 +154,7 @@ public function filterIn(string $name, mixed $values): self
* @throws InvalidResponseClassException
* @throws PendingRequestException
*/
- public function get(): GetSearchRequest
+ public function get(): GetSearchRequest|GetDocuments
{
$this->checkDateFilterRangeDivergence();
$this->restructureMonoDateFilterRange();
@@ -170,6 +180,17 @@ public function get(): GetSearchRequest
];
}
+ if ($this->trashBin) {
+ return new GetDocuments(
+ page: $this->page,
+ perPage: $this->perPage,
+ searchTerm: $this->searchTerm,
+ orderField: $this->orderField,
+ orderDirection: $this->orderDirection,
+ condition: $condition,
+ );
+ }
+
return new GetSearchRequest(
fileCabinetId: $this->fileCabinetId,
dialogId: $this->dialogId,
diff --git a/src/Requests/Documents/DocumentsTrashBin/GetDocuments.php b/src/Requests/Documents/DocumentsTrashBin/GetDocuments.php
new file mode 100644
index 0000000..391a074
--- /dev/null
+++ b/src/Requests/Documents/DocumentsTrashBin/GetDocuments.php
@@ -0,0 +1,73 @@
+ $this->perPage,
+ 'Start' => ($this->page - 1) * $this->perPage,
+ 'Condition' => $this->condition,
+ 'SortOrder' => [
+ [
+ 'Field' => $this->orderField,
+ 'Direction' => $this->orderDirection,
+ ],
+ ],
+ 'Operation' => config('laravel-docuware.configurations.search.operation', 'And'),
+ 'ForceRefresh' => config('laravel-docuware.configurations.search.force_refresh', true),
+ 'IncludeSuggestions' => config('laravel-docuware.configurations.search.include_suggestions', false),
+ 'AdditionalResultFields' => config('laravel-docuware.configurations.search.additional_result_fields', []),
+ ];
+ }
+
+ public function createDtoFromResponse(Response $response): DocumentPaginator
+ {
+ return GetSearchResponse::fromResponse($response, $this->page, $this->perPage);
+ }
+}
diff --git a/tests/Feature/Requests/Documents/ClipUnclipStapleUnstaple/ClipTest.php b/tests/Feature/Requests/Documents/ClipUnclipStapleUnstaple/ClipTest.php
new file mode 100644
index 0000000..910c982
--- /dev/null
+++ b/tests/Feature/Requests/Documents/ClipUnclipStapleUnstaple/ClipTest.php
@@ -0,0 +1,30 @@
+connector, $fileCabinetId);
+
+ [$document, $document2] = uploadFiles($this->connector, $fileCabinetId, $path);
+
+ $clip = $this->connector->send(new Clip(
+ $fileCabinetId,
+ [
+ $document->id,
+ $document2->id,
+ ]
+ ))->dto();
+
+ expect($clip->id)->toBe($document->id)
+ ->and($clip->total_pages)->toBe($document->total_pages + $document2->total_pages)
+ ->and($clip->sections->count())->toBe(2);
+
+ Event::assertDispatched(DocuWareResponseLog::class);
+})->group('clip');
diff --git a/tests/Feature/Requests/Documents/ClipUnclipStapleUnstaple/ClipUnclipStapleUnstapleTest.php b/tests/Feature/Requests/Documents/ClipUnclipStapleUnstaple/ClipUnclipStapleUnstapleTest.php
deleted file mode 100644
index 58c87a4..0000000
--- a/tests/Feature/Requests/Documents/ClipUnclipStapleUnstaple/ClipUnclipStapleUnstapleTest.php
+++ /dev/null
@@ -1,159 +0,0 @@
-send(new GetDocumentsFromAFileCabinet(
- $fileCabinetId
- ))->dto();
-
- foreach ($paginator->documents as $document) {
- $connector->send(new DeleteDocument(
- $fileCabinetId,
- $document->id,
- ))->dto();
- }
-}
-
-function uploadFiles($connector, $fileCabinetId, $path): array
-{
- $document = $connector->send(new CreateDataRecord(
- $fileCabinetId,
- file_get_contents($path.'/test-1.pdf'),
- 'test-1.pdf',
- ))->dto();
-
- $document2 = $connector->send(new CreateDataRecord(
- $fileCabinetId,
- file_get_contents($path.'/test-2.pdf'),
- 'test-2.pdf',
- ))->dto();
-
- sleep(5); // Wait for the files to be uploaded and processed
-
- // Have to get document again as returned data is incorrect
- $document = $connector->send(new GetASpecificDocumentFromAFileCabinet(
- $fileCabinetId,
- $document->id
- ))->dto();
-
- // Have to get document2 again as returned data is incorrect
- $document2 = $connector->send(new GetASpecificDocumentFromAFileCabinet(
- $fileCabinetId,
- $document2->id
- ))->dto();
-
- return [$document, $document2];
-}
-
-it('can clip 2 documents', function () {
- Event::fake();
-
- $fileCabinetId = config('laravel-docuware.tests.basket_id');
- $path = __DIR__.'/../../../../Fixtures/files';
-
- cleanup($this->connector, $fileCabinetId);
-
- [$document, $document2] = uploadFiles($this->connector, $fileCabinetId, $path);
-
- $clip = $this->connector->send(new Clip(
- $fileCabinetId,
- [
- $document->id,
- $document2->id,
- ]
- ))->dto();
-
- expect($clip->id)->toBe($document->id)
- ->and($clip->total_pages)->toBe($document->total_pages + $document2->total_pages)
- ->and($clip->sections->count())->toBe(2);
-
- Event::assertDispatched(DocuWareResponseLog::class);
-
- return [$clip, $document, $document2];
-});
-
-it('can unclip 2 documents', function ($test) {
- Event::fake();
-
- [$clip, $document, $document2] = $test;
-
- $fileCabinetId = config('laravel-docuware.tests.basket_id');
-
- sleep(5);
-
- $unclip = $this->connector->send(new Unclip(
- $fileCabinetId,
- $clip->id
- ))->dto();
-
- expect($unclip->documents->count())->toBe(2)
- ->and($unclip->documents->first()->title)->toBe($document->title)
- ->and($unclip->documents->first()->file_size)->toBe($document->file_size)
- ->and($unclip->documents->last()->title)->toBe($document2->title)
- ->and($unclip->documents->last()->file_size)->toBe($document2->file_size);
-
- Event::assertDispatched(DocuWareResponseLog::class);
-})->depends('it can clip 2 documents');
-
-it('can staple 2 documents', function () {
- Event::fake();
-
- $fileCabinetId = config('laravel-docuware.tests.basket_id');
- $path = __DIR__.'/../../../../Fixtures/files';
-
- cleanup($this->connector, $fileCabinetId);
-
- [$document, $document2] = uploadFiles($this->connector, $fileCabinetId, $path);
-
- $staple = $this->connector->send(new Staple(
- $fileCabinetId,
- [
- $document->id,
- $document2->id,
- ]
- ))->dto();
-
- sleep(5); // Wait for the files to be uploaded and processed
-
- $stapledDocument = $this->connector->send(new GetASpecificDocumentFromAFileCabinet(
- $fileCabinetId,
- $staple->id
- ))->dto();
-
- expect($stapledDocument->title)->toBe($document->title)
- ->and($stapledDocument->total_pages)->toBe($document->total_pages + $document2->total_pages);
-
- Event::assertDispatched(DocuWareResponseLog::class);
-
- return $stapledDocument;
-
-});
-
-it('can unstaple a document', function ($staple) {
- Event::fake();
-
- $fileCabinetId = config('laravel-docuware.tests.basket_id');
-
- sleep(5);
-
- $unclip = $this->connector->send(new Unstaple(
- $fileCabinetId,
- $staple->id
- ))->dto();
-
- expect($unclip->documents->count())->toBe($staple->total_pages);
-
- Event::assertDispatched(DocuWareResponseLog::class);
-})->depends('it can staple 2 documents');
diff --git a/tests/Feature/Requests/Documents/ClipUnclipStapleUnstaple/StapleTest.php b/tests/Feature/Requests/Documents/ClipUnclipStapleUnstaple/StapleTest.php
new file mode 100644
index 0000000..f994a5e
--- /dev/null
+++ b/tests/Feature/Requests/Documents/ClipUnclipStapleUnstaple/StapleTest.php
@@ -0,0 +1,37 @@
+connector, $fileCabinetId);
+
+ [$document, $document2] = uploadFiles($this->connector, $fileCabinetId, $path);
+
+ $staple = $this->connector->send(new Staple(
+ $fileCabinetId,
+ [
+ $document->id,
+ $document2->id,
+ ]
+ ))->dto();
+
+ sleep(5); // Wait for the files to be uploaded and processed
+
+ $stapledDocument = $this->connector->send(new GetASpecificDocumentFromAFileCabinet(
+ $fileCabinetId,
+ $staple->id
+ ))->dto();
+
+ expect($stapledDocument->title)->toBe($document->title)
+ ->and($stapledDocument->total_pages)->toBe($document->total_pages + $document2->total_pages);
+
+ Event::assertDispatched(DocuWareResponseLog::class);
+})->group('staple');
diff --git a/tests/Feature/Requests/Documents/ClipUnclipStapleUnstaple/UnclipTest.php b/tests/Feature/Requests/Documents/ClipUnclipStapleUnstaple/UnclipTest.php
new file mode 100644
index 0000000..f6cbcdc
--- /dev/null
+++ b/tests/Feature/Requests/Documents/ClipUnclipStapleUnstaple/UnclipTest.php
@@ -0,0 +1,40 @@
+connector, $fileCabinetId);
+
+ [$document, $document2] = uploadFiles($this->connector, $fileCabinetId, $path);
+
+ $clip = $this->connector->send(new Clip(
+ $fileCabinetId,
+ [
+ $document->id,
+ $document2->id,
+ ]
+ ))->dto();
+
+ sleep(5);
+
+ $unclip = $this->connector->send(new Unclip(
+ $fileCabinetId,
+ $clip->id
+ ))->dto();
+
+ expect($unclip->documents->count())->toBe(2)
+ ->and($unclip->documents->first()->title)->toBe($document->title)
+ ->and($unclip->documents->first()->file_size)->toBe($document->file_size)
+ ->and($unclip->documents->last()->title)->toBe($document2->title)
+ ->and($unclip->documents->last()->file_size)->toBe($document2->file_size);
+
+ Event::assertDispatched(DocuWareResponseLog::class);
+})->group('unclip');
diff --git a/tests/Feature/Requests/Documents/ClipUnclipStapleUnstaple/UnstapleTest.php b/tests/Feature/Requests/Documents/ClipUnclipStapleUnstaple/UnstapleTest.php
new file mode 100644
index 0000000..1bd30b6
--- /dev/null
+++ b/tests/Feature/Requests/Documents/ClipUnclipStapleUnstaple/UnstapleTest.php
@@ -0,0 +1,36 @@
+connector, $fileCabinetId);
+
+ [$document, $document2] = uploadFiles($this->connector, $fileCabinetId, $path);
+
+ $staple = $this->connector->send(new Staple(
+ $fileCabinetId,
+ [
+ $document->id,
+ $document2->id,
+ ]
+ ))->dto();
+
+ sleep(5);
+
+ $unclip = $this->connector->send(new Unstaple(
+ $fileCabinetId,
+ $staple->id
+ ))->dto();
+
+ expect($unclip->documents->count())->toBe($staple->total_pages);
+
+ Event::assertDispatched(DocuWareResponseLog::class);
+})->group('unstaple');
diff --git a/tests/Feature/Requests/Documents/DocumentsTrashBin/GetDocumentsFromTrashBin.php b/tests/Feature/Requests/Documents/DocumentsTrashBin/GetDocumentsFromTrashBin.php
new file mode 100644
index 0000000..b475cb0
--- /dev/null
+++ b/tests/Feature/Requests/Documents/DocumentsTrashBin/GetDocumentsFromTrashBin.php
@@ -0,0 +1,228 @@
+searchRequestBuilder()
+ ->trashBin()
+ ->page(1)
+ ->perPage(5)
+ ->fulltext('test')
+ ->filterDate('DWSTOREDATETIME', '>=', Carbon::create(2021))
+ ->filterDate('DWSTOREDATETIME', '<', now())
+ ->filter('DOCUMENT_TYPE', 'Abrechnung')
+ ->orderBy('DWSTOREDATETIME', 'desc')
+ ->get();
+
+ $paginator = $this->connector->send($paginatorRequest)->dto();
+
+ $this->assertInstanceOf(DocumentPaginator::class, $paginator);
+ Event::assertDispatched(DocuWareResponseLog::class);
+})->group('search', 'trash');
+
+it('can\'t search documents by more than two dates in trash', function () {
+ Event::fake();
+
+ $this->expectException(UnableToSearch::class);
+
+ $request = (new DocuWare())
+ ->searchRequestBuilder()
+ ->trashBin()
+ ->page(1)
+ ->perPage(5)
+ ->fulltext('test')
+ ->filterDate('DWSTOREDATETIME', '>=', Carbon::create(2020))
+ ->filterDate('DWSTOREDATETIME', '>=', Carbon::create(2021))
+ ->filterDate('DWSTOREDATETIME', '<', now())
+ ->filter('DOCUMENT_TYPE', 'Abrechnung')
+ ->orderBy('DWSTOREDATETIME', 'desc')
+ ->get();
+
+ $this->connector->send($request)->dto();
+})->group('search', 'trash');
+
+it('can override search documents dates filter by using same operator in trash', function () {
+ Event::fake();
+
+ $paginatorRequest = (new DocuWare())
+ ->searchRequestBuilder()
+ ->trashBin()
+ ->page(1)
+ ->perPage(5)
+ ->fulltext('test')
+ ->filterDate('DWSTOREDATETIME', '<=', Carbon::create(2022))
+ ->filterDate('DWSTOREDATETIME', '>=', Carbon::create(2020))
+ ->filterDate('DWSTOREDATETIME', '>=', Carbon::create(2021))
+ ->filter('DOCUMENT_TYPE', 'Abrechnung')
+ ->orderBy('DWSTOREDATETIME', 'desc')
+ ->get();
+
+ $paginator = $this->connector->send($paginatorRequest)->dto();
+
+ $this->assertInstanceOf(DocumentPaginator::class, $paginator);
+ Event::assertDispatched(DocuWareResponseLog::class);
+})->group('search', 'trash');
+
+it('can override search documents dates filter by using equal operator in trash', function () {
+ Event::fake();
+
+ $paginatorRequest = (new DocuWare())
+ ->searchRequestBuilder()
+ ->trashBin()
+ ->page(1)
+ ->perPage(5)
+ ->fulltext('test')
+ ->filterDate('DWSTOREDATETIME', '>=', Carbon::create(2020))
+ ->filterDate('DWSTOREDATETIME', '=', Carbon::create(2021))
+ ->filter('DOCUMENT_TYPE', 'Abrechnung')
+ ->orderBy('DWSTOREDATETIME', 'desc')
+ ->get();
+
+ $paginator = $this->connector->send($paginatorRequest)->dto();
+
+ $this->assertInstanceOf(DocumentPaginator::class, $paginator);
+ Event::assertDispatched(DocuWareResponseLog::class);
+})->group('search', 'trash');
+
+it('can\'t search documents by diverged date range', function () {
+ Event::fake();
+
+ $this->expectException(UnableToSearch::class);
+
+ $request = (new DocuWare())
+ ->searchRequestBuilder()
+ ->trashBin()
+ ->page(1)
+ ->perPage(5)
+ ->fulltext('test')
+ ->filterDate('DWSTOREDATETIME', '<=', Carbon::create(2020))
+ ->filterDate('DWSTOREDATETIME', '>=', Carbon::create(2021))
+ ->filter('DOCUMENT_TYPE', 'Abrechnung')
+ ->orderBy('DWSTOREDATETIME', 'desc')
+ ->get();
+
+ $this->connector->send($request)->dto();
+})->group('search', 'trash');
+
+it('can search documents dates filter in future in trash', function () {
+ Event::fake();
+
+ $paginatorRequest = (new DocuWare())
+ ->searchRequestBuilder()
+ ->trashBin()
+ ->page(1)
+ ->perPage(5)
+ ->fulltext('test')
+ ->filterDate('DWSTOREDATETIME', '>', Carbon::create(2018))
+ ->filter('DOCUMENT_TYPE', 'Abrechnung')
+ ->orderBy('DWSTOREDATETIME', 'desc')
+ ->get();
+
+ $paginator = $this->connector->send($paginatorRequest)->dto();
+
+ $this->assertInstanceOf(DocumentPaginator::class, $paginator);
+ Event::assertDispatched(DocuWareResponseLog::class);
+})->group('search', 'trash');
+
+it('can search documents dates filter in past in trash', function () {
+ Event::fake();
+
+ $paginatorRequest = (new DocuWare())
+ ->searchRequestBuilder()
+ ->trashBin()
+ ->page(1)
+ ->perPage(5)
+ ->fulltext('test')
+ ->filterDate('DWSTOREDATETIME', '<=', Carbon::create(2020))
+ ->filter('DOCUMENT_TYPE', 'Abrechnung')
+ ->orderBy('DWSTOREDATETIME', 'desc')
+ ->get();
+
+ $paginator = $this->connector->send($paginatorRequest)->dto();
+
+ $this->assertInstanceOf(DocumentPaginator::class, $paginator);
+ Event::assertDispatched(DocuWareResponseLog::class);
+})->group('search', 'trash');
+
+it('can search documents with null values in trash', function () {
+ Event::fake();
+
+ $paginatorRequest = (new DocuWare())
+ ->searchRequestBuilder()
+ ->trashBin()
+ ->page(null)
+ ->perPage(null)
+ ->fulltext(null)
+ ->filter('DOCUMENT_TYPE', null)
+ ->orderBy('DWSTOREDATETIME', null)
+ ->get();
+
+ $paginator = $this->connector->send($paginatorRequest)->dto();
+
+ $this->assertInstanceOf(DocumentPaginator::class, $paginator);
+ Event::assertDispatched(DocuWareResponseLog::class);
+})->group('search', 'trash');
+
+it('can search documents with multiple values in trash', function () {
+ Event::fake();
+
+ $fileCabinetId = config('laravel-docuware.tests.file_cabinet_id');
+ $fileContent = '::fake-file-content::';
+ $fileName = 'example.txt';
+
+ $documentOne = $this->connector->send(new CreateDataRecord(
+ $fileCabinetId,
+ $fileContent,
+ $fileName,
+ collect([
+ IndexTextDTO::make('DOCUMENT_LABEL', '::text::'),
+ IndexTextDTO::make('DOCUMENT_TYPE', 'Abrechnung'),
+ ]),
+ ))->dto();
+
+ $documentTwo = $this->connector->send(new CreateDataRecord(
+ $fileCabinetId,
+ $fileContent,
+ $fileName,
+ collect([
+ IndexTextDTO::make('DOCUMENT_LABEL', '::text::'),
+ IndexTextDTO::make('DOCUMENT_TYPE', 'Rechnung'),
+ ]),
+ ))->dto();
+
+ $documentThree = $this->connector->send(new CreateDataRecord(
+ $fileCabinetId,
+ $fileContent,
+ $fileName,
+ collect([
+ IndexTextDTO::make('DOCUMENT_LABEL', '::text::'),
+ IndexTextDTO::make('DOCUMENT_TYPE', 'EtwasAnderes'),
+ ]),
+ ))->dto();
+
+ // Should filter down to documentOne and documentTwo. documentThree should be filtered out.
+ $paginatorRequestBothDocuments = (new DocuWare())
+ ->searchRequestBuilder()
+ ->trashBin()
+ ->page(null)
+ ->perPage(null)
+ ->fulltext(null)
+ ->filterIn('DOCUMENT_TYPE', ['Abrechnung', 'Rechnung'])
+ ->get();
+
+ $paginator = $this->connector->send($paginatorRequestBothDocuments)->dto();
+
+ $this->assertInstanceOf(DocumentPaginator::class, $paginator);
+ $this->assertCount(2, $paginator->documents);
+ Event::assertDispatched(DocuWareResponseLog::class);
+})->group('search', 'trash');
diff --git a/tests/Pest.php b/tests/Pest.php
index 3feb7b3..a0917b4 100644
--- a/tests/Pest.php
+++ b/tests/Pest.php
@@ -3,7 +3,9 @@
use CodebarAg\DocuWare\Connectors\DocuWareConnector;
use CodebarAg\DocuWare\DTO\Config\ConfigWithCredentials;
use CodebarAg\DocuWare\Requests\Documents\ModifyDocuments\DeleteDocument;
+use CodebarAg\DocuWare\Requests\FileCabinets\Search\GetASpecificDocumentFromAFileCabinet;
use CodebarAg\DocuWare\Requests\FileCabinets\Search\GetDocumentsFromAFileCabinet;
+use CodebarAg\DocuWare\Requests\FileCabinets\Upload\CreateDataRecord;
use CodebarAg\DocuWare\Requests\General\UserManagement\CreateUpdateUsers\UpdateUser;
use CodebarAg\DocuWare\Requests\General\UserManagement\GetUsers\GetUsers;
use CodebarAg\DocuWare\Tests\TestCase;
@@ -65,3 +67,48 @@ function getConnector(): object
password: config('laravel-docuware.credentials.password'),
));
}
+
+function cleanup($connector, $fileCabinetId): void
+{
+ $paginator = $connector->send(new GetDocumentsFromAFileCabinet(
+ $fileCabinetId
+ ))->dto();
+
+ foreach ($paginator->documents as $document) {
+ $connector->send(new DeleteDocument(
+ $fileCabinetId,
+ $document->id,
+ ))->dto();
+ }
+}
+
+function uploadFiles($connector, $fileCabinetId, $path): array
+{
+ $document = $connector->send(new CreateDataRecord(
+ $fileCabinetId,
+ file_get_contents($path.'/test-1.pdf'),
+ 'test-1.pdf',
+ ))->dto();
+
+ $document2 = $connector->send(new CreateDataRecord(
+ $fileCabinetId,
+ file_get_contents($path.'/test-2.pdf'),
+ 'test-2.pdf',
+ ))->dto();
+
+ sleep(5); // Wait for the files to be uploaded and processed
+
+ // Have to get document again as returned data is incorrect
+ $document = $connector->send(new GetASpecificDocumentFromAFileCabinet(
+ $fileCabinetId,
+ $document->id
+ ))->dto();
+
+ // Have to get document2 again as returned data is incorrect
+ $document2 = $connector->send(new GetASpecificDocumentFromAFileCabinet(
+ $fileCabinetId,
+ $document2->id
+ ))->dto();
+
+ return [$document, $document2];
+}
From b618ac5ae4c7650c2fa80cdb9111b5d439bdd20e Mon Sep 17 00:00:00 2001
From: Rhys Lees <43909932+RhysLees@users.noreply.github.com>
Date: Wed, 29 May 2024 16:53:46 +0100
Subject: [PATCH 32/54] WIP
---
.github/workflows/run-tests.yml | 7 +++++++
tests/Feature/SleepTest.php | 12 ++++++++++++
2 files changed, 19 insertions(+)
create mode 100644 tests/Feature/SleepTest.php
diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml
index fa665e7..6af9740 100644
--- a/.github/workflows/run-tests.yml
+++ b/.github/workflows/run-tests.yml
@@ -54,3 +54,10 @@ jobs:
DOCUWARE_USERNAME: ${{ secrets.DOCUWARE_USERNAME }}
DOCUWARE_PASSWORD: ${{ secrets.DOCUWARE_PASSWORD }}
DOCUWARE_COOKIES: ${{ secrets.DOCUWARE_COOKIES }}
+
+ - name: Store Log Artifacts
+ if: failure()
+ uses: actions/upload-artifact@v4
+ with:
+ name: Store report artifacts
+ path: ./vendor/orchestra/testbench-core/storage/logs
diff --git a/tests/Feature/SleepTest.php b/tests/Feature/SleepTest.php
new file mode 100644
index 0000000..bc8121c
--- /dev/null
+++ b/tests/Feature/SleepTest.php
@@ -0,0 +1,12 @@
+toDateTimeString());
+ Sleep::for(5)->seconds();
+ Log::info(now()->toDateTimeString());
+
+})->expectNotToPerformAssertions();
From 4e9940e3e98b103711a542345cdb6dc1ad99f555 Mon Sep 17 00:00:00 2001
From: RhysLees
Date: Wed, 29 May 2024 15:54:15 +0000
Subject: [PATCH 33/54] Fix styling
---
tests/Feature/SleepTest.php | 1 -
1 file changed, 1 deletion(-)
diff --git a/tests/Feature/SleepTest.php b/tests/Feature/SleepTest.php
index bc8121c..ff22466 100644
--- a/tests/Feature/SleepTest.php
+++ b/tests/Feature/SleepTest.php
@@ -1,6 +1,5 @@
Date: Wed, 29 May 2024 17:27:03 +0100
Subject: [PATCH 34/54] WIP
---
.github/workflows/run-tests.yml | 2 +-
tests/Feature/SleepTest.php | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml
index 6af9740..53e6252 100644
--- a/.github/workflows/run-tests.yml
+++ b/.github/workflows/run-tests.yml
@@ -60,4 +60,4 @@ jobs:
uses: actions/upload-artifact@v4
with:
name: Store report artifacts
- path: ./vendor/orchestra/testbench-core/storage/logs
+ path: ./vendor/orchestra/testbench-core/laravel/storage/logs
diff --git a/tests/Feature/SleepTest.php b/tests/Feature/SleepTest.php
index ff22466..badb67f 100644
--- a/tests/Feature/SleepTest.php
+++ b/tests/Feature/SleepTest.php
@@ -8,4 +8,4 @@
Sleep::for(5)->seconds();
Log::info(now()->toDateTimeString());
-})->expectNotToPerformAssertions();
+})->expectNotToPerformAssertions()->only();
From a2a4bb8115207b36998cf40430ca4cc4966add2b Mon Sep 17 00:00:00 2001
From: Rhys Lees <43909932+RhysLees@users.noreply.github.com>
Date: Wed, 29 May 2024 17:50:45 +0100
Subject: [PATCH 35/54] WIP
---
tests/Feature/SleepTest.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tests/Feature/SleepTest.php b/tests/Feature/SleepTest.php
index badb67f..ff22466 100644
--- a/tests/Feature/SleepTest.php
+++ b/tests/Feature/SleepTest.php
@@ -8,4 +8,4 @@
Sleep::for(5)->seconds();
Log::info(now()->toDateTimeString());
-})->expectNotToPerformAssertions()->only();
+})->expectNotToPerformAssertions();
From a7475da3a42d7b173996df6cb38c5cbd8d5cb5ef Mon Sep 17 00:00:00 2001
From: Rhys Lees <43909932+RhysLees@users.noreply.github.com>
Date: Wed, 29 May 2024 18:06:43 +0100
Subject: [PATCH 36/54] WIP
---
.../Documents/ClipUnclipStapleUnstaple/StapleTest.php | 3 ++-
.../Documents/ClipUnclipStapleUnstaple/UnclipTest.php | 3 ++-
.../Documents/ClipUnclipStapleUnstaple/UnstapleTest.php | 3 ++-
.../UserManagement/CreateUpdateUsers/CreateUpdateUserTest.php | 2 +-
.../GetModifyGroups/AddRemoveUserToAGroupTest.php | 4 ++--
.../GetModifyRoles/AddRemoveUserToARoleTest.php | 4 ++--
tests/Pest.php | 3 ++-
7 files changed, 13 insertions(+), 9 deletions(-)
diff --git a/tests/Feature/Requests/Documents/ClipUnclipStapleUnstaple/StapleTest.php b/tests/Feature/Requests/Documents/ClipUnclipStapleUnstaple/StapleTest.php
index f994a5e..9fbbbdc 100644
--- a/tests/Feature/Requests/Documents/ClipUnclipStapleUnstaple/StapleTest.php
+++ b/tests/Feature/Requests/Documents/ClipUnclipStapleUnstaple/StapleTest.php
@@ -4,6 +4,7 @@
use CodebarAg\DocuWare\Requests\Documents\ClipUnclipStapleUnstaple\Staple;
use CodebarAg\DocuWare\Requests\FileCabinets\Search\GetASpecificDocumentFromAFileCabinet;
use Illuminate\Support\Facades\Event;
+use Illuminate\Support\Sleep;
it('can staple 2 documents', function () {
Event::fake();
@@ -23,7 +24,7 @@
]
))->dto();
- sleep(5); // Wait for the files to be uploaded and processed
+ Sleep::for(5)->seconds(); // Wait for the files to be uploaded and processed
$stapledDocument = $this->connector->send(new GetASpecificDocumentFromAFileCabinet(
$fileCabinetId,
diff --git a/tests/Feature/Requests/Documents/ClipUnclipStapleUnstaple/UnclipTest.php b/tests/Feature/Requests/Documents/ClipUnclipStapleUnstaple/UnclipTest.php
index f6cbcdc..21c5c18 100644
--- a/tests/Feature/Requests/Documents/ClipUnclipStapleUnstaple/UnclipTest.php
+++ b/tests/Feature/Requests/Documents/ClipUnclipStapleUnstaple/UnclipTest.php
@@ -4,6 +4,7 @@
use CodebarAg\DocuWare\Requests\Documents\ClipUnclipStapleUnstaple\Clip;
use CodebarAg\DocuWare\Requests\Documents\ClipUnclipStapleUnstaple\Unclip;
use Illuminate\Support\Facades\Event;
+use Illuminate\Support\Sleep;
it('can unclip 2 documents', function () {
Event::fake();
@@ -23,7 +24,7 @@
]
))->dto();
- sleep(5);
+ Sleep::for(5)->seconds();
$unclip = $this->connector->send(new Unclip(
$fileCabinetId,
diff --git a/tests/Feature/Requests/Documents/ClipUnclipStapleUnstaple/UnstapleTest.php b/tests/Feature/Requests/Documents/ClipUnclipStapleUnstaple/UnstapleTest.php
index 1bd30b6..8d53a3c 100644
--- a/tests/Feature/Requests/Documents/ClipUnclipStapleUnstaple/UnstapleTest.php
+++ b/tests/Feature/Requests/Documents/ClipUnclipStapleUnstaple/UnstapleTest.php
@@ -4,6 +4,7 @@
use CodebarAg\DocuWare\Requests\Documents\ClipUnclipStapleUnstaple\Staple;
use CodebarAg\DocuWare\Requests\Documents\ClipUnclipStapleUnstaple\Unstaple;
use Illuminate\Support\Facades\Event;
+use Illuminate\Support\Sleep;
it('can unstaple a document', function () {
Event::fake();
@@ -23,7 +24,7 @@
]
))->dto();
- sleep(5);
+ Sleep::for(5)->seconds();
$unclip = $this->connector->send(new Unstaple(
$fileCabinetId,
diff --git a/tests/Feature/Requests/General/UserManagement/CreateUpdateUsers/CreateUpdateUserTest.php b/tests/Feature/Requests/General/UserManagement/CreateUpdateUsers/CreateUpdateUserTest.php
index f61a8f0..e35f5fe 100644
--- a/tests/Feature/Requests/General/UserManagement/CreateUpdateUsers/CreateUpdateUserTest.php
+++ b/tests/Feature/Requests/General/UserManagement/CreateUpdateUsers/CreateUpdateUserTest.php
@@ -30,7 +30,7 @@
it('can update users', function ($user) {
Event::fake();
- sleep(5);
+ Sleep::for(5)->seconds();
$user->name .= ' - Updated';
$user->active = false;
diff --git a/tests/Feature/Requests/General/UserManagement/GetModifyGroups/AddRemoveUserToAGroupTest.php b/tests/Feature/Requests/General/UserManagement/GetModifyGroups/AddRemoveUserToAGroupTest.php
index 22e093e..8826df2 100644
--- a/tests/Feature/Requests/General/UserManagement/GetModifyGroups/AddRemoveUserToAGroupTest.php
+++ b/tests/Feature/Requests/General/UserManagement/GetModifyGroups/AddRemoveUserToAGroupTest.php
@@ -20,7 +20,7 @@
password: 'TESTPASSWORD',
)))->dto();
- sleep(5);
+ Sleep::for(5)->seconds();
$response = $this->connector->send(new AddUserToAGroup(
userId: $user->id,
@@ -39,7 +39,7 @@
it('can remove groups to a user', function ($user) {
Event::fake();
- sleep(5);
+ Sleep::for(5)->seconds();
$response = $this->connector->send(new RemoveUserFromAGroup(
userId: $user->id,
diff --git a/tests/Feature/Requests/General/UserManagement/GetModifyRoles/AddRemoveUserToARoleTest.php b/tests/Feature/Requests/General/UserManagement/GetModifyRoles/AddRemoveUserToARoleTest.php
index 4f89916..bcd6c6b 100644
--- a/tests/Feature/Requests/General/UserManagement/GetModifyRoles/AddRemoveUserToARoleTest.php
+++ b/tests/Feature/Requests/General/UserManagement/GetModifyRoles/AddRemoveUserToARoleTest.php
@@ -20,7 +20,7 @@
password: 'TESTPASSWORD',
)))->dto();
- sleep(5);
+ Sleep::for(5)->seconds();
$response = $this->connector->send(new AddUserToARole(
userId: $user->id,
@@ -39,7 +39,7 @@
it('can remove roles to a user', function ($user) {
Event::fake();
- sleep(5);
+ Sleep::for(5)->seconds();
$response = $this->connector->send(new RemoveUserFromARole(
userId: $user->id,
diff --git a/tests/Pest.php b/tests/Pest.php
index a0917b4..9b18f40 100644
--- a/tests/Pest.php
+++ b/tests/Pest.php
@@ -9,6 +9,7 @@
use CodebarAg\DocuWare\Requests\General\UserManagement\CreateUpdateUsers\UpdateUser;
use CodebarAg\DocuWare\Requests\General\UserManagement\GetUsers\GetUsers;
use CodebarAg\DocuWare\Tests\TestCase;
+use Illuminate\Support\Sleep;
uses(TestCase::class)
->in(__DIR__);
@@ -96,7 +97,7 @@ function uploadFiles($connector, $fileCabinetId, $path): array
'test-2.pdf',
))->dto();
- sleep(5); // Wait for the files to be uploaded and processed
+ Sleep::for(5)->seconds(); // Wait for the files to be uploaded and processed
// Have to get document again as returned data is incorrect
$document = $connector->send(new GetASpecificDocumentFromAFileCabinet(
From b27f11f43d7fc26f81d32ecc3684d863a51008de Mon Sep 17 00:00:00 2001
From: Rhys Lees <43909932+RhysLees@users.noreply.github.com>
Date: Wed, 29 May 2024 18:12:33 +0100
Subject: [PATCH 37/54] WIP
---
.../UserManagement/CreateUpdateUsers/CreateUpdateUserTest.php | 1 +
.../UserManagement/GetModifyGroups/AddRemoveUserToAGroupTest.php | 1 +
.../UserManagement/GetModifyRoles/AddRemoveUserToARoleTest.php | 1 +
3 files changed, 3 insertions(+)
diff --git a/tests/Feature/Requests/General/UserManagement/CreateUpdateUsers/CreateUpdateUserTest.php b/tests/Feature/Requests/General/UserManagement/CreateUpdateUsers/CreateUpdateUserTest.php
index e35f5fe..707a89a 100644
--- a/tests/Feature/Requests/General/UserManagement/CreateUpdateUsers/CreateUpdateUserTest.php
+++ b/tests/Feature/Requests/General/UserManagement/CreateUpdateUsers/CreateUpdateUserTest.php
@@ -7,6 +7,7 @@
use CodebarAg\DocuWare\Requests\General\UserManagement\CreateUpdateUsers\UpdateUser;
use Illuminate\Support\Carbon;
use Illuminate\Support\Facades\Event;
+use Illuminate\Support\Sleep;
it('can create users', function () {
Event::fake();
diff --git a/tests/Feature/Requests/General/UserManagement/GetModifyGroups/AddRemoveUserToAGroupTest.php b/tests/Feature/Requests/General/UserManagement/GetModifyGroups/AddRemoveUserToAGroupTest.php
index 8826df2..a201c1b 100644
--- a/tests/Feature/Requests/General/UserManagement/GetModifyGroups/AddRemoveUserToAGroupTest.php
+++ b/tests/Feature/Requests/General/UserManagement/GetModifyGroups/AddRemoveUserToAGroupTest.php
@@ -7,6 +7,7 @@
use CodebarAg\DocuWare\Requests\General\UserManagement\GetModifyGroups\RemoveUserFromAGroup;
use Illuminate\Support\Carbon;
use Illuminate\Support\Facades\Event;
+use Illuminate\Support\Sleep;
it('can add groups to a user', function () {
Event::fake();
diff --git a/tests/Feature/Requests/General/UserManagement/GetModifyRoles/AddRemoveUserToARoleTest.php b/tests/Feature/Requests/General/UserManagement/GetModifyRoles/AddRemoveUserToARoleTest.php
index bcd6c6b..1f9cc6c 100644
--- a/tests/Feature/Requests/General/UserManagement/GetModifyRoles/AddRemoveUserToARoleTest.php
+++ b/tests/Feature/Requests/General/UserManagement/GetModifyRoles/AddRemoveUserToARoleTest.php
@@ -7,6 +7,7 @@
use CodebarAg\DocuWare\Requests\General\UserManagement\GetModifyRoles\RemoveUserFromARole;
use Illuminate\Support\Carbon;
use Illuminate\Support\Facades\Event;
+use Illuminate\Support\Sleep;
it('can add roles to a user', function () {
Event::fake();
From 607e1890daffd0f6ffcb6b0a457df7d4325f007c Mon Sep 17 00:00:00 2001
From: Rhys Lees <43909932+RhysLees@users.noreply.github.com>
Date: Wed, 29 May 2024 19:13:35 +0100
Subject: [PATCH 38/54] WIP
---
src/Connectors/DocuWareConnector.php | 4 +++-
.../OAuth/GetIdentityServiceConfiguration.php | 18 +++++++++++++++++-
.../OAuth/GetResponsibleIdentityService.php | 18 +++++++++++++++++-
tests/TestCase.php | 17 +++++++++++++++++
4 files changed, 54 insertions(+), 3 deletions(-)
diff --git a/src/Connectors/DocuWareConnector.php b/src/Connectors/DocuWareConnector.php
index 627e1ad..3d2c9c5 100644
--- a/src/Connectors/DocuWareConnector.php
+++ b/src/Connectors/DocuWareConnector.php
@@ -82,7 +82,7 @@ protected function getOrCreateNewOAuthToken()
DocuWareOAuthLog::dispatch($this->configuration->url, $this->configuration->username, 'Token retrieved from API');
}
- $cache->put(key: $cacheKey, value: Crypt::encrypt($token), ttl: $token->expiresIn);
+ $cache->put(key: $cacheKey, value: Crypt::encrypt($token), ttl: $token->expiresIn - 60);
}
return $token->accessToken;
@@ -91,10 +91,12 @@ protected function getOrCreateNewOAuthToken()
protected function getAuthenticationTokenEndpoint(): IdentityServiceConfiguration
{
$responsibleIdentityServiceResponse = (new GetResponsibleIdentityService())->send();
+ ray($responsibleIdentityServiceResponse->isCached())->purple();
$identityServiceConfigurationResponse = (new GetIdentityServiceConfiguration(
identityServiceUrl: $responsibleIdentityServiceResponse->dto()->identityServiceUrl
))->send();
+ ray($identityServiceConfigurationResponse->isCached())->purple();
return $identityServiceConfigurationResponse->dto();
}
diff --git a/src/Requests/Authentication/OAuth/GetIdentityServiceConfiguration.php b/src/Requests/Authentication/OAuth/GetIdentityServiceConfiguration.php
index dfe465a..df59e97 100644
--- a/src/Requests/Authentication/OAuth/GetIdentityServiceConfiguration.php
+++ b/src/Requests/Authentication/OAuth/GetIdentityServiceConfiguration.php
@@ -5,12 +5,18 @@
use CodebarAg\DocuWare\DTO\Authentication\OAuth\IdentityServiceConfiguration;
use CodebarAg\DocuWare\Events\DocuWareResponseLog;
use CodebarAg\DocuWare\Support\EnsureValidResponse;
+use Illuminate\Support\Facades\Cache;
+use Saloon\CachePlugin\Contracts\Cacheable;
+use Saloon\CachePlugin\Drivers\LaravelCacheDriver;
+use Saloon\CachePlugin\Traits\HasCaching;
use Saloon\Enums\Method;
use Saloon\Http\Response;
use Saloon\Http\SoloRequest;
-class GetIdentityServiceConfiguration extends SoloRequest
+class GetIdentityServiceConfiguration extends SoloRequest implements Cacheable
{
+ use HasCaching;
+
protected Method $method = Method::GET;
public function __construct(
@@ -30,6 +36,16 @@ public function defaultHeaders(): array
];
}
+ public function resolveCacheDriver(): LaravelCacheDriver
+ {
+ return new LaravelCacheDriver(Cache::store(config('laravel-docuware.configurations.cache.driver')));
+ }
+
+ public function cacheExpiryInSeconds(): int
+ {
+ return config('laravel-docuware.configurations.cache.lifetime_in_seconds', 3600);
+ }
+
public function createDtoFromResponse(Response $response): IdentityServiceConfiguration
{
event(new DocuWareResponseLog($response));
diff --git a/src/Requests/Authentication/OAuth/GetResponsibleIdentityService.php b/src/Requests/Authentication/OAuth/GetResponsibleIdentityService.php
index 35f4c73..08aad97 100644
--- a/src/Requests/Authentication/OAuth/GetResponsibleIdentityService.php
+++ b/src/Requests/Authentication/OAuth/GetResponsibleIdentityService.php
@@ -4,12 +4,18 @@
use CodebarAg\DocuWare\DTO\Authentication\OAuth\ResponsibleIdentityService;
use CodebarAg\DocuWare\Responses\Authentication\OAuth\GetResponsibleIdentityServiceResponse;
+use Illuminate\Support\Facades\Cache;
+use Saloon\CachePlugin\Contracts\Cacheable;
+use Saloon\CachePlugin\Drivers\LaravelCacheDriver;
+use Saloon\CachePlugin\Traits\HasCaching;
use Saloon\Enums\Method;
use Saloon\Http\Response;
use Saloon\Http\SoloRequest;
-class GetResponsibleIdentityService extends SoloRequest
+class GetResponsibleIdentityService extends SoloRequest implements Cacheable
{
+ use HasCaching;
+
protected Method $method = Method::GET;
public function resolveEndpoint(): string
@@ -26,6 +32,16 @@ public function defaultHeaders(): array
];
}
+ public function resolveCacheDriver(): LaravelCacheDriver
+ {
+ return new LaravelCacheDriver(Cache::store(config('laravel-docuware.configurations.cache.driver')));
+ }
+
+ public function cacheExpiryInSeconds(): int
+ {
+ return config('laravel-docuware.configurations.cache.lifetime_in_seconds', 3600);
+ }
+
public function createDtoFromResponse(Response $response): ResponsibleIdentityService
{
return GetResponsibleIdentityServiceResponse::fromResponse($response);
diff --git a/tests/TestCase.php b/tests/TestCase.php
index 746ffaf..cbf78ff 100644
--- a/tests/TestCase.php
+++ b/tests/TestCase.php
@@ -3,7 +3,11 @@
namespace CodebarAg\DocuWare\Tests;
use CodebarAg\DocuWare\DocuWareServiceProvider;
+use CodebarAg\DocuWare\Events\DocuWareOAuthLog;
+use CodebarAg\DocuWare\Events\DocuWareResponseLog;
use Illuminate\Database\Eloquent\Factories\Factory;
+use Illuminate\Support\Facades\Event;
+use Illuminate\Support\Facades\Log;
use Orchestra\Testbench\TestCase as Orchestra;
class TestCase extends Orchestra
@@ -15,6 +19,19 @@ protected function setUp(): void
Factory::guessFactoryNamesUsing(
fn (string $modelName) => 'codebar\\DocuWare\\Database\\Factories\\'.class_basename($modelName).'Factory',
);
+
+ Event::listen(DocuWareResponseLog::class, function (DocuWareResponseLog $event) {
+ Log::info('Docuware response', [
+ $event->response->getPendingRequest()->getUrl(),
+ ]);
+ });
+
+ Event::listen(DocuWareOAuthLog::class, function (DocuWareOAuthLog $event) {
+ Log::info($event->message, [
+ 'url' => $event->url,
+ 'username' => $event->username,
+ ]);
+ });
}
protected function getPackageProviders($app): array
From e8f817cd0058d1134f8732a32cbdf1013dde542e Mon Sep 17 00:00:00 2001
From: Rhys Lees <43909932+RhysLees@users.noreply.github.com>
Date: Wed, 29 May 2024 19:28:10 +0100
Subject: [PATCH 39/54] WIP
---
src/Connectors/DocuWareConnector.php | 2 --
1 file changed, 2 deletions(-)
diff --git a/src/Connectors/DocuWareConnector.php b/src/Connectors/DocuWareConnector.php
index 3d2c9c5..0ca9b4e 100644
--- a/src/Connectors/DocuWareConnector.php
+++ b/src/Connectors/DocuWareConnector.php
@@ -91,12 +91,10 @@ protected function getOrCreateNewOAuthToken()
protected function getAuthenticationTokenEndpoint(): IdentityServiceConfiguration
{
$responsibleIdentityServiceResponse = (new GetResponsibleIdentityService())->send();
- ray($responsibleIdentityServiceResponse->isCached())->purple();
$identityServiceConfigurationResponse = (new GetIdentityServiceConfiguration(
identityServiceUrl: $responsibleIdentityServiceResponse->dto()->identityServiceUrl
))->send();
- ray($identityServiceConfigurationResponse->isCached())->purple();
return $identityServiceConfigurationResponse->dto();
}
From 9076c3440469c1b0d24d47ecff4b93cdc05a4a87 Mon Sep 17 00:00:00 2001
From: Rhys Lees <43909932+RhysLees@users.noreply.github.com>
Date: Thu, 30 May 2024 19:34:04 +0100
Subject: [PATCH 40/54] WIP
---
.gitignore | 1 +
README.md | 4 +-
.../DocumentsTrashBin/DeleteDocuments.php | 25 ++++
src/DTO/Documents/TrashDocumentPaginator.php | 127 ++++++++++++++++++
src/DocuWareSearchRequestBuilder.php | 2 +-
.../DocumentsTrashBin/DeleteDocuments.php | 41 ++++++
.../DocumentsTrashBin/GetDocuments.php | 14 +-
.../DeleteDocumentsResponse.php | 20 +++
.../Search/GetTrashSearchResponse.php | 31 +++++
.../DeleteDocumentsFromTrashBinTest.php | 33 +++++
...n.php => GetDocumentsFromTrashBinTest.php} | 114 ++++------------
tests/Pest.php | 14 ++
tests/TestCase.php | 24 ++--
13 files changed, 343 insertions(+), 107 deletions(-)
create mode 100644 src/DTO/Documents/DocumentsTrashBin/DeleteDocuments.php
create mode 100644 src/DTO/Documents/TrashDocumentPaginator.php
create mode 100644 src/Requests/Documents/DocumentsTrashBin/DeleteDocuments.php
create mode 100644 src/Responses/Documents/DocumentsTrashBin/DeleteDocumentsResponse.php
create mode 100644 src/Responses/Search/GetTrashSearchResponse.php
create mode 100644 tests/Feature/Requests/Documents/DocumentsTrashBin/DeleteDocumentsFromTrashBinTest.php
rename tests/Feature/Requests/Documents/DocumentsTrashBin/{GetDocumentsFromTrashBin.php => GetDocumentsFromTrashBinTest.php} (51%)
diff --git a/.gitignore b/.gitignore
index 8054c8d..e8de7f7 100644
--- a/.gitignore
+++ b/.gitignore
@@ -10,3 +10,4 @@ phpstan.neon
testbench.yaml
vendor
node_modules
+.phpactor.json
diff --git a/README.md b/README.md
index 0e9a648..5cda690 100644
--- a/README.md
+++ b/README.md
@@ -131,8 +131,8 @@ then optimize the processes that power the core of your business.
| Documents/AnnotationsStamps | DeleteAnnotation | ❌ |
| Documents/AnnotationsStamps | UpdateTextAnnotation | ❌ |
| Documents/AnnotationsStamps | Get Stamps | ❌ |
-| Documents/DocumentsTrashBin | Get Documents | ❌ |
-| Documents/DocumentsTrashBin | Delete Documents | ❌ |
+| Documents/DocumentsTrashBin | Get Documents | ✅ |
+| Documents/DocumentsTrashBin | Delete Documents | ✅ |
| Documents/DocumentsTrashBin | Restore Documents | ❌ |
| Documents/ApplicationProperties | Get Application Properties | ❌ |
| Documents/ApplicationProperties | Add Application Properties | ❌ |
diff --git a/src/DTO/Documents/DocumentsTrashBin/DeleteDocuments.php b/src/DTO/Documents/DocumentsTrashBin/DeleteDocuments.php
new file mode 100644
index 0000000..0eed7bd
--- /dev/null
+++ b/src/DTO/Documents/DocumentsTrashBin/DeleteDocuments.php
@@ -0,0 +1,25 @@
+current_page > 1;
+ }
+
+ public function showNext(): bool
+ {
+ return $this->current_page < $this->last_page;
+ }
+
+ public function successful(): bool
+ {
+ return is_null($this->error);
+ }
+
+ public function failed(): bool
+ {
+ return ! $this->successful();
+ }
+
+ public static function fromJson(
+ array $data,
+ int $page,
+ int $perPage,
+ ): self {
+ $total = Arr::get($data, 'Count.Value');
+
+ $lastPage = (int) ceil($total / $perPage);
+
+ $from = $page === 1 ? 1 : (($page - 1) * $perPage) + 1;
+
+ $to = $page === $lastPage ? $total : $page * $perPage;
+
+ $headers = collect(Arr::get($data, 'Headers'));
+ $documents = collect(Arr::get($data, 'Rows'));
+
+ $mappedDocuments = $documents->map(function (array $document) use ($headers) {
+ $document = collect($document);
+
+ return $document->mapWithKeys(function ($value, $key) use ($headers) {
+ $header = collect($headers->get($key));
+
+ return $header->has('FieldName') ? [$header->get('FieldName') => $value] : [];
+ })->filter();
+ });
+
+ return new self(
+ total: $total,
+ per_page: $perPage,
+ current_page: $page,
+ last_page: $lastPage,
+ from: $from,
+ to: $to,
+ headers: $headers,
+ documents: $documents,
+ mappedDocuments: $mappedDocuments,
+ );
+ }
+
+ public static function fromFailed(Exception $e): self
+ {
+ return new self(
+ total: 0,
+ per_page: 0,
+ current_page: 0,
+ last_page: 0,
+ from: 0,
+ to: 0,
+ headers: collect(),
+ documents: collect(),
+ mappedDocuments: collect(),
+ error: ErrorBag::make($e),
+ );
+ }
+
+ public static function fake(
+ ?int $total = null,
+ ?int $per_page = null,
+ ?int $current_page = null,
+ ?int $last_page = null,
+ ?int $from = null,
+ ?int $to = null,
+ ?Collection $headers = null,
+ ?Collection $documents = null,
+ ?Collection $mappedDocuments = null,
+ ): self {
+ return new self(
+ total: $total ?? random_int(10, 100),
+ per_page: $per_page ?? 10,
+ current_page: $current_page ?? random_int(1, 10),
+ last_page: $last_page ?? random_int(10, 20),
+ from: $from ?? 1,
+ to: $to ?? 10,
+ headers: $headers,
+ documents: $documents,
+ mappedDocuments: $mappedDocuments,
+ );
+ }
+}
diff --git a/src/DocuWareSearchRequestBuilder.php b/src/DocuWareSearchRequestBuilder.php
index b799ea8..0e70ee7 100644
--- a/src/DocuWareSearchRequestBuilder.php
+++ b/src/DocuWareSearchRequestBuilder.php
@@ -207,7 +207,7 @@ public function get(): GetSearchRequest|GetDocuments
protected function guard(): void
{
throw_if(
- is_null($this->fileCabinetId),
+ is_null($this->fileCabinetId) && $this->trashBin === false,
UnableToSearch::cabinetNotSet(),
);
diff --git a/src/Requests/Documents/DocumentsTrashBin/DeleteDocuments.php b/src/Requests/Documents/DocumentsTrashBin/DeleteDocuments.php
new file mode 100644
index 0000000..d9ab420
--- /dev/null
+++ b/src/Requests/Documents/DocumentsTrashBin/DeleteDocuments.php
@@ -0,0 +1,41 @@
+ $this->ids instanceof Collection ? $this->ids->toArray() : $this->ids,
+ ];
+ }
+
+ public function createDtoFromResponse(Response $response): DeleteDocumentsDto
+ {
+ return DeleteDocumentsResponse::fromResponse($response);
+ }
+}
diff --git a/src/Requests/Documents/DocumentsTrashBin/GetDocuments.php b/src/Requests/Documents/DocumentsTrashBin/GetDocuments.php
index 391a074..a710a4b 100644
--- a/src/Requests/Documents/DocumentsTrashBin/GetDocuments.php
+++ b/src/Requests/Documents/DocumentsTrashBin/GetDocuments.php
@@ -2,8 +2,8 @@
namespace CodebarAg\DocuWare\Requests\Documents\DocumentsTrashBin;
-use CodebarAg\DocuWare\DTO\Documents\DocumentPaginator;
-use CodebarAg\DocuWare\Responses\Search\GetSearchResponse;
+use CodebarAg\DocuWare\DTO\Documents\TrashDocumentPaginator;
+use CodebarAg\DocuWare\Responses\Search\GetTrashSearchResponse;
use Illuminate\Support\Facades\Cache;
use Saloon\CachePlugin\Contracts\Cacheable;
use Saloon\CachePlugin\Drivers\LaravelCacheDriver;
@@ -25,7 +25,7 @@ public function __construct(
protected readonly int $page = 1,
protected readonly int $perPage = 50,
protected readonly ?string $searchTerm = null,
- protected readonly string $orderField = 'DELETEDATETIME',
+ protected readonly ?string $orderField = null,
protected readonly string $orderDirection = 'desc',
protected readonly array $condition = [],
protected readonly ?bool $forceRefresh = true,
@@ -53,12 +53,12 @@ public function defaultBody(): array
'Count' => $this->perPage,
'Start' => ($this->page - 1) * $this->perPage,
'Condition' => $this->condition,
- 'SortOrder' => [
+ 'SortOrder' => $this->orderField ? [
[
'Field' => $this->orderField,
'Direction' => $this->orderDirection,
],
- ],
+ ] : null,
'Operation' => config('laravel-docuware.configurations.search.operation', 'And'),
'ForceRefresh' => config('laravel-docuware.configurations.search.force_refresh', true),
'IncludeSuggestions' => config('laravel-docuware.configurations.search.include_suggestions', false),
@@ -66,8 +66,8 @@ public function defaultBody(): array
];
}
- public function createDtoFromResponse(Response $response): DocumentPaginator
+ public function createDtoFromResponse(Response $response): TrashDocumentPaginator
{
- return GetSearchResponse::fromResponse($response, $this->page, $this->perPage);
+ return GetTrashSearchResponse::fromResponse($response, $this->page, $this->perPage);
}
}
diff --git a/src/Responses/Documents/DocumentsTrashBin/DeleteDocumentsResponse.php b/src/Responses/Documents/DocumentsTrashBin/DeleteDocumentsResponse.php
new file mode 100644
index 0000000..083babd
--- /dev/null
+++ b/src/Responses/Documents/DocumentsTrashBin/DeleteDocumentsResponse.php
@@ -0,0 +1,20 @@
+throw()->json());
+ }
+}
diff --git a/src/Responses/Search/GetTrashSearchResponse.php b/src/Responses/Search/GetTrashSearchResponse.php
new file mode 100644
index 0000000..6cc028a
--- /dev/null
+++ b/src/Responses/Search/GetTrashSearchResponse.php
@@ -0,0 +1,31 @@
+throw()->json();
+ } catch (Exception $e) {
+ return TrashDocumentPaginator::fromFailed($e);
+ }
+
+ return TrashDocumentPaginator::fromJson(
+ $data,
+ $page,
+ $perPage,
+ );
+ }
+}
diff --git a/tests/Feature/Requests/Documents/DocumentsTrashBin/DeleteDocumentsFromTrashBinTest.php b/tests/Feature/Requests/Documents/DocumentsTrashBin/DeleteDocumentsFromTrashBinTest.php
new file mode 100644
index 0000000..cc8b712
--- /dev/null
+++ b/tests/Feature/Requests/Documents/DocumentsTrashBin/DeleteDocumentsFromTrashBinTest.php
@@ -0,0 +1,33 @@
+connector->send(new CreateDataRecord(
+ config('laravel-docuware.tests.file_cabinet_id'),
+ file_get_contents(__DIR__.'/../../../../Fixtures/files/test-1.pdf'),
+ 'test-1.pdf',
+ ))->dto();
+
+ $this->connector->send(new DeleteDocument(
+ config('laravel-docuware.tests.file_cabinet_id'),
+ $document->id,
+ ))->dto();
+
+ $paginatorRequest = (new DocuWare())
+ ->searchRequestBuilder()
+ ->trashBin()
+ ->get();
+
+ $paginator = $this->connector->send($paginatorRequest)->dto();
+
+ $delete = $this->connector->send(new DeleteDocuments($paginator->mappedDocuments->pluck('ID')->all()))->dto();
+
+ expect($delete->successCount)->toBe($paginator->total);
+})->group('delete', 'trash');
diff --git a/tests/Feature/Requests/Documents/DocumentsTrashBin/GetDocumentsFromTrashBin.php b/tests/Feature/Requests/Documents/DocumentsTrashBin/GetDocumentsFromTrashBinTest.php
similarity index 51%
rename from tests/Feature/Requests/Documents/DocumentsTrashBin/GetDocumentsFromTrashBin.php
rename to tests/Feature/Requests/Documents/DocumentsTrashBin/GetDocumentsFromTrashBinTest.php
index b475cb0..e5d5fee 100644
--- a/tests/Feature/Requests/Documents/DocumentsTrashBin/GetDocumentsFromTrashBin.php
+++ b/tests/Feature/Requests/Documents/DocumentsTrashBin/GetDocumentsFromTrashBinTest.php
@@ -2,11 +2,9 @@
use Carbon\Carbon;
use CodebarAg\DocuWare\DocuWare;
-use CodebarAg\DocuWare\DTO\Documents\DocumentIndex\IndexTextDTO;
-use CodebarAg\DocuWare\DTO\Documents\DocumentPaginator;
+use CodebarAg\DocuWare\DTO\Documents\TrashDocumentPaginator;
use CodebarAg\DocuWare\Events\DocuWareResponseLog;
use CodebarAg\DocuWare\Exceptions\UnableToSearch;
-use CodebarAg\DocuWare\Requests\FileCabinets\Upload\CreateDataRecord;
use Illuminate\Support\Facades\Event;
it('can search documents in trash', function () {
@@ -18,15 +16,15 @@
->page(1)
->perPage(5)
->fulltext('test')
- ->filterDate('DWSTOREDATETIME', '>=', Carbon::create(2021))
- ->filterDate('DWSTOREDATETIME', '<', now())
+ ->filterDate('DELETEDATETIME', '>=', Carbon::create(2021))
+ ->filterDate('DELETEDATETIME', '<', now())
->filter('DOCUMENT_TYPE', 'Abrechnung')
- ->orderBy('DWSTOREDATETIME', 'desc')
+ ->orderBy('DELETEDATETIME', 'desc')
->get();
$paginator = $this->connector->send($paginatorRequest)->dto();
- $this->assertInstanceOf(DocumentPaginator::class, $paginator);
+ $this->assertInstanceOf(TrashDocumentPaginator::class, $paginator);
Event::assertDispatched(DocuWareResponseLog::class);
})->group('search', 'trash');
@@ -41,11 +39,11 @@
->page(1)
->perPage(5)
->fulltext('test')
- ->filterDate('DWSTOREDATETIME', '>=', Carbon::create(2020))
- ->filterDate('DWSTOREDATETIME', '>=', Carbon::create(2021))
- ->filterDate('DWSTOREDATETIME', '<', now())
+ ->filterDate('DELETEDATETIME', '>=', Carbon::create(2020))
+ ->filterDate('DELETEDATETIME', '>=', Carbon::create(2021))
+ ->filterDate('DELETEDATETIME', '<', now())
->filter('DOCUMENT_TYPE', 'Abrechnung')
- ->orderBy('DWSTOREDATETIME', 'desc')
+ ->orderBy('DELETEDATETIME', 'desc')
->get();
$this->connector->send($request)->dto();
@@ -60,16 +58,16 @@
->page(1)
->perPage(5)
->fulltext('test')
- ->filterDate('DWSTOREDATETIME', '<=', Carbon::create(2022))
- ->filterDate('DWSTOREDATETIME', '>=', Carbon::create(2020))
- ->filterDate('DWSTOREDATETIME', '>=', Carbon::create(2021))
+ ->filterDate('DELETEDATETIME', '<=', Carbon::create(2022))
+ ->filterDate('DELETEDATETIME', '>=', Carbon::create(2020))
+ ->filterDate('DELETEDATETIME', '>=', Carbon::create(2021))
->filter('DOCUMENT_TYPE', 'Abrechnung')
- ->orderBy('DWSTOREDATETIME', 'desc')
+ ->orderBy('DELETEDATETIME', 'desc')
->get();
$paginator = $this->connector->send($paginatorRequest)->dto();
- $this->assertInstanceOf(DocumentPaginator::class, $paginator);
+ $this->assertInstanceOf(TrashDocumentPaginator::class, $paginator);
Event::assertDispatched(DocuWareResponseLog::class);
})->group('search', 'trash');
@@ -82,15 +80,15 @@
->page(1)
->perPage(5)
->fulltext('test')
- ->filterDate('DWSTOREDATETIME', '>=', Carbon::create(2020))
- ->filterDate('DWSTOREDATETIME', '=', Carbon::create(2021))
+ ->filterDate('DELETEDATETIME', '>=', Carbon::create(2020))
+ ->filterDate('DELETEDATETIME', '=', Carbon::create(2021))
->filter('DOCUMENT_TYPE', 'Abrechnung')
- ->orderBy('DWSTOREDATETIME', 'desc')
+ ->orderBy('DELETEDATETIME', 'desc')
->get();
$paginator = $this->connector->send($paginatorRequest)->dto();
- $this->assertInstanceOf(DocumentPaginator::class, $paginator);
+ $this->assertInstanceOf(TrashDocumentPaginator::class, $paginator);
Event::assertDispatched(DocuWareResponseLog::class);
})->group('search', 'trash');
@@ -105,10 +103,10 @@
->page(1)
->perPage(5)
->fulltext('test')
- ->filterDate('DWSTOREDATETIME', '<=', Carbon::create(2020))
- ->filterDate('DWSTOREDATETIME', '>=', Carbon::create(2021))
+ ->filterDate('DELETEDATETIME', '<=', Carbon::create(2020))
+ ->filterDate('DELETEDATETIME', '>=', Carbon::create(2021))
->filter('DOCUMENT_TYPE', 'Abrechnung')
- ->orderBy('DWSTOREDATETIME', 'desc')
+ ->orderBy('DELETEDATETIME', 'desc')
->get();
$this->connector->send($request)->dto();
@@ -123,14 +121,14 @@
->page(1)
->perPage(5)
->fulltext('test')
- ->filterDate('DWSTOREDATETIME', '>', Carbon::create(2018))
+ ->filterDate('DELETEDATETIME', '>', Carbon::create(2018))
->filter('DOCUMENT_TYPE', 'Abrechnung')
- ->orderBy('DWSTOREDATETIME', 'desc')
+ ->orderBy('DELETEDATETIME', 'desc')
->get();
$paginator = $this->connector->send($paginatorRequest)->dto();
- $this->assertInstanceOf(DocumentPaginator::class, $paginator);
+ $this->assertInstanceOf(TrashDocumentPaginator::class, $paginator);
Event::assertDispatched(DocuWareResponseLog::class);
})->group('search', 'trash');
@@ -143,14 +141,14 @@
->page(1)
->perPage(5)
->fulltext('test')
- ->filterDate('DWSTOREDATETIME', '<=', Carbon::create(2020))
+ ->filterDate('DELETEDATETIME', '<=', Carbon::create(2020))
->filter('DOCUMENT_TYPE', 'Abrechnung')
- ->orderBy('DWSTOREDATETIME', 'desc')
+ ->orderBy('DELETEDATETIME', 'desc')
->get();
$paginator = $this->connector->send($paginatorRequest)->dto();
- $this->assertInstanceOf(DocumentPaginator::class, $paginator);
+ $this->assertInstanceOf(TrashDocumentPaginator::class, $paginator);
Event::assertDispatched(DocuWareResponseLog::class);
})->group('search', 'trash');
@@ -164,65 +162,11 @@
->perPage(null)
->fulltext(null)
->filter('DOCUMENT_TYPE', null)
- ->orderBy('DWSTOREDATETIME', null)
+ ->orderBy('DELETEDATETIME', null)
->get();
$paginator = $this->connector->send($paginatorRequest)->dto();
- $this->assertInstanceOf(DocumentPaginator::class, $paginator);
- Event::assertDispatched(DocuWareResponseLog::class);
-})->group('search', 'trash');
-
-it('can search documents with multiple values in trash', function () {
- Event::fake();
-
- $fileCabinetId = config('laravel-docuware.tests.file_cabinet_id');
- $fileContent = '::fake-file-content::';
- $fileName = 'example.txt';
-
- $documentOne = $this->connector->send(new CreateDataRecord(
- $fileCabinetId,
- $fileContent,
- $fileName,
- collect([
- IndexTextDTO::make('DOCUMENT_LABEL', '::text::'),
- IndexTextDTO::make('DOCUMENT_TYPE', 'Abrechnung'),
- ]),
- ))->dto();
-
- $documentTwo = $this->connector->send(new CreateDataRecord(
- $fileCabinetId,
- $fileContent,
- $fileName,
- collect([
- IndexTextDTO::make('DOCUMENT_LABEL', '::text::'),
- IndexTextDTO::make('DOCUMENT_TYPE', 'Rechnung'),
- ]),
- ))->dto();
-
- $documentThree = $this->connector->send(new CreateDataRecord(
- $fileCabinetId,
- $fileContent,
- $fileName,
- collect([
- IndexTextDTO::make('DOCUMENT_LABEL', '::text::'),
- IndexTextDTO::make('DOCUMENT_TYPE', 'EtwasAnderes'),
- ]),
- ))->dto();
-
- // Should filter down to documentOne and documentTwo. documentThree should be filtered out.
- $paginatorRequestBothDocuments = (new DocuWare())
- ->searchRequestBuilder()
- ->trashBin()
- ->page(null)
- ->perPage(null)
- ->fulltext(null)
- ->filterIn('DOCUMENT_TYPE', ['Abrechnung', 'Rechnung'])
- ->get();
-
- $paginator = $this->connector->send($paginatorRequestBothDocuments)->dto();
-
- $this->assertInstanceOf(DocumentPaginator::class, $paginator);
- $this->assertCount(2, $paginator->documents);
+ $this->assertInstanceOf(TrashDocumentPaginator::class, $paginator);
Event::assertDispatched(DocuWareResponseLog::class);
})->group('search', 'trash');
diff --git a/tests/Pest.php b/tests/Pest.php
index 9b18f40..1905e7b 100644
--- a/tests/Pest.php
+++ b/tests/Pest.php
@@ -1,7 +1,9 @@
id,
))->dto();
}
+
+ // $paginatorRequest = (new DocuWare())
+ // ->searchRequestBuilder()
+ // ->trashBin()
+ // ->perPage(1000)
+ // ->get();
+ //
+ // $paginator = $connector->send($paginatorRequest)->dto();
+ //
+ // if ($paginator->total > 0) {
+ // $connector->send(new DeleteDocuments($paginator->mappedDocuments->pluck('ID')->all()))->dto();
+ // }
}
function setUsersInactive(): void
diff --git a/tests/TestCase.php b/tests/TestCase.php
index cbf78ff..fd588b7 100644
--- a/tests/TestCase.php
+++ b/tests/TestCase.php
@@ -20,18 +20,18 @@ protected function setUp(): void
fn (string $modelName) => 'codebar\\DocuWare\\Database\\Factories\\'.class_basename($modelName).'Factory',
);
- Event::listen(DocuWareResponseLog::class, function (DocuWareResponseLog $event) {
- Log::info('Docuware response', [
- $event->response->getPendingRequest()->getUrl(),
- ]);
- });
-
- Event::listen(DocuWareOAuthLog::class, function (DocuWareOAuthLog $event) {
- Log::info($event->message, [
- 'url' => $event->url,
- 'username' => $event->username,
- ]);
- });
+ // Event::listen(DocuWareResponseLog::class, function (DocuWareResponseLog $event) {
+ // Log::info('Docuware response', [
+ // $event->response->getPendingRequest()->getUrl(),
+ // ]);
+ // });
+ //
+ // Event::listen(DocuWareOAuthLog::class, function (DocuWareOAuthLog $event) {
+ // Log::info($event->message, [
+ // 'url' => $event->url,
+ // 'username' => $event->username,
+ // ]);
+ // });
}
protected function getPackageProviders($app): array
From 72945bef21b35fda04cb355b0697de5dcfb8e328 Mon Sep 17 00:00:00 2001
From: Rhys Lees <43909932+RhysLees@users.noreply.github.com>
Date: Thu, 30 May 2024 19:44:35 +0100
Subject: [PATCH 41/54] WIP
---
README.md | 2 +-
.../DocumentsTrashBin/RestoreDocuments.php | 25 +++++++++++
.../DocumentsTrashBin/RestoreDocuments.php | 41 +++++++++++++++++++
.../RestoreDocumentsResponse.php | 20 +++++++++
.../DeleteDocumentsFromTrashBinTest.php | 2 +-
.../RestoreDocumentsFromTrashBinTest.php | 33 +++++++++++++++
tests/Feature/SleepTest.php | 3 +-
tests/Pest.php | 22 +++++-----
8 files changed, 134 insertions(+), 14 deletions(-)
create mode 100644 src/DTO/Documents/DocumentsTrashBin/RestoreDocuments.php
create mode 100644 src/Requests/Documents/DocumentsTrashBin/RestoreDocuments.php
create mode 100644 src/Responses/Documents/DocumentsTrashBin/RestoreDocumentsResponse.php
create mode 100644 tests/Feature/Requests/Documents/DocumentsTrashBin/RestoreDocumentsFromTrashBinTest.php
diff --git a/README.md b/README.md
index 5cda690..93225e1 100644
--- a/README.md
+++ b/README.md
@@ -133,7 +133,7 @@ then optimize the processes that power the core of your business.
| Documents/AnnotationsStamps | Get Stamps | ❌ |
| Documents/DocumentsTrashBin | Get Documents | ✅ |
| Documents/DocumentsTrashBin | Delete Documents | ✅ |
-| Documents/DocumentsTrashBin | Restore Documents | ❌ |
+| Documents/DocumentsTrashBin | Restore Documents | ✅ |
| Documents/ApplicationProperties | Get Application Properties | ❌ |
| Documents/ApplicationProperties | Add Application Properties | ❌ |
| Documents/ApplicationProperties | Delete Application Properties | ❌ |
diff --git a/src/DTO/Documents/DocumentsTrashBin/RestoreDocuments.php b/src/DTO/Documents/DocumentsTrashBin/RestoreDocuments.php
new file mode 100644
index 0000000..476996e
--- /dev/null
+++ b/src/DTO/Documents/DocumentsTrashBin/RestoreDocuments.php
@@ -0,0 +1,25 @@
+ $this->ids instanceof Collection ? $this->ids->toArray() : $this->ids,
+ ];
+ }
+
+ public function createDtoFromResponse(Response $response): RestoreDocumentsDto
+ {
+ return RestoreDocumentsResponse::fromResponse($response);
+ }
+}
diff --git a/src/Responses/Documents/DocumentsTrashBin/RestoreDocumentsResponse.php b/src/Responses/Documents/DocumentsTrashBin/RestoreDocumentsResponse.php
new file mode 100644
index 0000000..bce1134
--- /dev/null
+++ b/src/Responses/Documents/DocumentsTrashBin/RestoreDocumentsResponse.php
@@ -0,0 +1,20 @@
+throw()->json());
+ }
+}
diff --git a/tests/Feature/Requests/Documents/DocumentsTrashBin/DeleteDocumentsFromTrashBinTest.php b/tests/Feature/Requests/Documents/DocumentsTrashBin/DeleteDocumentsFromTrashBinTest.php
index cc8b712..86ddd56 100644
--- a/tests/Feature/Requests/Documents/DocumentsTrashBin/DeleteDocumentsFromTrashBinTest.php
+++ b/tests/Feature/Requests/Documents/DocumentsTrashBin/DeleteDocumentsFromTrashBinTest.php
@@ -6,7 +6,7 @@
use CodebarAg\DocuWare\Requests\FileCabinets\Upload\CreateDataRecord;
use Illuminate\Support\Facades\Event;
-it('can search documents in trash', function () {
+it('can delete documents in trash', function () {
Event::fake();
$document = $this->connector->send(new CreateDataRecord(
diff --git a/tests/Feature/Requests/Documents/DocumentsTrashBin/RestoreDocumentsFromTrashBinTest.php b/tests/Feature/Requests/Documents/DocumentsTrashBin/RestoreDocumentsFromTrashBinTest.php
new file mode 100644
index 0000000..0b39b03
--- /dev/null
+++ b/tests/Feature/Requests/Documents/DocumentsTrashBin/RestoreDocumentsFromTrashBinTest.php
@@ -0,0 +1,33 @@
+connector->send(new CreateDataRecord(
+ config('laravel-docuware.tests.file_cabinet_id'),
+ file_get_contents(__DIR__.'/../../../../Fixtures/files/test-1.pdf'),
+ 'test-1.pdf',
+ ))->dto();
+
+ $this->connector->send(new DeleteDocument(
+ config('laravel-docuware.tests.file_cabinet_id'),
+ $document->id,
+ ))->dto();
+
+ $paginatorRequest = (new DocuWare())
+ ->searchRequestBuilder()
+ ->trashBin()
+ ->get();
+
+ $paginator = $this->connector->send($paginatorRequest)->dto();
+
+ $delete = $this->connector->send(new RestoreDocuments($paginator->mappedDocuments->pluck('ID')->all()))->dto();
+
+ expect($delete->successCount)->toBe($paginator->total);
+})->group('restore', 'trash');
diff --git a/tests/Feature/SleepTest.php b/tests/Feature/SleepTest.php
index ff22466..fba0ba4 100644
--- a/tests/Feature/SleepTest.php
+++ b/tests/Feature/SleepTest.php
@@ -8,4 +8,5 @@
Sleep::for(5)->seconds();
Log::info(now()->toDateTimeString());
-})->expectNotToPerformAssertions();
+})->expectNotToPerformAssertions()
+ ->skip('Testing sleep function.');
diff --git a/tests/Pest.php b/tests/Pest.php
index 1905e7b..3662772 100644
--- a/tests/Pest.php
+++ b/tests/Pest.php
@@ -42,17 +42,17 @@ function clearFiles(): void
))->dto();
}
- // $paginatorRequest = (new DocuWare())
- // ->searchRequestBuilder()
- // ->trashBin()
- // ->perPage(1000)
- // ->get();
- //
- // $paginator = $connector->send($paginatorRequest)->dto();
- //
- // if ($paginator->total > 0) {
- // $connector->send(new DeleteDocuments($paginator->mappedDocuments->pluck('ID')->all()))->dto();
- // }
+ $paginatorRequest = (new DocuWare())
+ ->searchRequestBuilder()
+ ->trashBin()
+ ->perPage(1000)
+ ->get();
+
+ $paginator = $connector->send($paginatorRequest)->dto();
+
+ if ($paginator->total > 0) {
+ $connector->send(new DeleteDocuments($paginator->mappedDocuments->pluck('ID')->all()))->dto();
+ }
}
function setUsersInactive(): void
From d1243f4dcd1a2986cb5ae83b0ce7683e51f5810a Mon Sep 17 00:00:00 2001
From: Rhys Lees <43909932+RhysLees@users.noreply.github.com>
Date: Sat, 1 Jun 2024 00:50:09 +0100
Subject: [PATCH 42/54] WIP
---
README.md | 162 +++++++++---------
src/DTO/Section.php | 11 +-
src/DTO/Workflow/HistoryStep.php | 38 ++++
src/DTO/Workflow/InstanceHistory.php | 46 +++++
.../Documents/Download/DownloadDocument.php | 4 +-
.../Documents/Download/DownloadSection.php | 45 +++++
.../Documents/Download/DownloadThumbnail.php | 4 +-
.../Documents/Sections/DeleteSection.php | 45 +++++
.../Sections/GetASpecificSection.php | 46 +++++
.../Sections/GetAllSectionsFromADocument.php} | 10 +-
.../Workflow/GetDocumentWorkflowHistory.php | 46 +++++
.../GetDocumentWorkflowHistorySteps.php | 46 +++++
.../Download/DownloadDocumentResponse.php | 2 +-
.../Download/DownloadSectionResponse.php | 19 ++
.../Sections/DeleteSectionResponse.php | 16 ++
.../Sections/GetASecificSectionResponse.php | 20 +++
.../GetAllSectionsFromADocumentResponse.php} | 14 +-
.../GetDocumentWorkflowHistoryResponse.php | 23 +++
...etDocumentWorkflowHistoryStepsResponse.php | 20 +++
.../DownloadDocumentTest.php} | 2 +-
.../Download/DownloadSectionTest.php | 33 ++++
.../Download/DownloadThumbnailTest.php | 34 ++++
.../Documents/Sections/DeleteSectionTest.php | 35 ++++
.../Sections/GetASpecificSectionTest.php | 35 ++++
.../GetAllSectionsFromADocumentTest.php | 33 ++++
...etDocumentDownloadThumbnailRequestTest.php | 4 +-
.../GetDocumentWorkflowHistoryStepsTest.php | 45 +++++
.../GetDocumentWorkflowHistoryTest.php | 38 ++++
28 files changed, 768 insertions(+), 108 deletions(-)
create mode 100644 src/DTO/Workflow/HistoryStep.php
create mode 100644 src/DTO/Workflow/InstanceHistory.php
create mode 100644 src/Requests/Documents/Download/DownloadSection.php
create mode 100644 src/Requests/Documents/Sections/DeleteSection.php
create mode 100644 src/Requests/Documents/Sections/GetASpecificSection.php
rename src/Requests/{Sections/GetSectionsRequest.php => Documents/Sections/GetAllSectionsFromADocument.php} (77%)
create mode 100644 src/Requests/Workflow/GetDocumentWorkflowHistory.php
create mode 100644 src/Requests/Workflow/GetDocumentWorkflowHistorySteps.php
create mode 100644 src/Responses/Documents/Download/DownloadSectionResponse.php
create mode 100644 src/Responses/Documents/Sections/DeleteSectionResponse.php
create mode 100644 src/Responses/Documents/Sections/GetASecificSectionResponse.php
rename src/Responses/{Sections/GetSectionsResponse.php => Documents/Sections/GetAllSectionsFromADocumentResponse.php} (59%)
create mode 100644 src/Responses/Workflow/GetDocumentWorkflowHistoryResponse.php
create mode 100644 src/Responses/Workflow/GetDocumentWorkflowHistoryStepsResponse.php
rename tests/Feature/Requests/Documents/{GetDocumentDownloadRequestTest.php => Download/DownloadDocumentTest.php} (97%)
create mode 100644 tests/Feature/Requests/Documents/Download/DownloadSectionTest.php
create mode 100644 tests/Feature/Requests/Documents/Download/DownloadThumbnailTest.php
create mode 100644 tests/Feature/Requests/Documents/Sections/DeleteSectionTest.php
create mode 100644 tests/Feature/Requests/Documents/Sections/GetASpecificSectionTest.php
create mode 100644 tests/Feature/Requests/Documents/Sections/GetAllSectionsFromADocumentTest.php
create mode 100644 tests/Feature/Requests/Workflow/GetDocumentWorkflowHistoryStepsTest.php
create mode 100644 tests/Feature/Requests/Workflow/GetDocumentWorkflowHistoryTest.php
diff --git a/README.md b/README.md
index 93225e1..9c675b8 100644
--- a/README.md
+++ b/README.md
@@ -64,88 +64,86 @@ then optimize the processes that power the core of your business.
Current Support
-| Group | Request | Supported |
-|-------------------------------------|-------------------------------------------------------------|-----------|
-| Authentication/OAuth | 1. Get Responsible Identity Service | ✅ |
-| Authentication/OAuth | 2. Get Identity Service Configuration | ✅ |
-| Authentication/OAuth | 3.a Request Token w/ Username & Password | ✅ |
-| Authentication/OAuth | 3.b Request Token w/ a DocuWare Token | ❌ |
-| Authentication/OAuth | 3.c Request Token w/ Username & Password (Trusted User) | ❌ |
-| Authentication/OAuth | 3.d.1 Obtain Windows Authorization (On Premises Only) | ❌ |
-| Authentication/OAuth | 3.d.2 Request Token /w a Windows Account (On Premises Only) | ❌ |
-| General/Organisation | Get Login Token | ✅ |
-| General/Organisation | Get Organization | ✅ |
-| General/Organisation | Get All File Cabinets and Document Trays | ✅ |
-| General/UserManagement | Get Users | ✅ |
-| General/UserManagement | Get Users by ID | ✅ |
-| General/UserManagement | Get Users of a Role | ✅ |
-| General/UserManagement | Get Users of a Group | ✅ |
-| General/UserManagement | Create User | ✅ |
-| General/UserManagement | Update User | ✅ |
-| General/UserManagement | Get Groups | ✅ |
-| General/UserManagement | Get All Groups for a Specific User | ✅ |
-| General/UserManagement | Add User to a Group | ✅ |
-| General/UserManagement | Remove User from a Group | ✅ |
-| General/UserManagement | Get Roles | ✅ |
-| General/UserManagement | Get All Roles for a Specific User | ✅ |
-| General/UserManagement | Add User to a Role | ✅ |
-| General/UserManagement | Remove User from a Role | ✅ |
-| FileCabinets/General | Get File Cabinet Information | ✅ |
-| FileCabinets/General | Get Total Number of Documents | ✅ |
-| FileCabinets/Dialogs | Get All Dialogs | ✅ |
-| FileCabinets/Dialogs | Get a Specific Dialog | ✅ |
-| FileCabinets/Dialogs | Get Dialogs of a Specific Type | ✅ |
-| FileCabinets/Search | Get Documents from a File Cabinet | ✅ |
-| FileCabinets/Search | Get a Specific Document From a File Cabinet | ✅ |
-| FileCabinets/Search | Search for Documents in a Single File Cabinet | ✅ |
-| FileCabinets/Search | Search for Documents in Multiple File Cabinets | ✅ |
-| FileCabinets/CheckInCheckOut | Check-out & Download a Document | ❌ |
-| FileCabinets/CheckInCheckOut | Check-in a Document from the File System | ❌ |
-| FileCabinets/CheckInCheckOut | Undo Check-out | ❌ |
-| FileCabinets/SelectLists | Get Select Lists | ✅ |
-| FileCabinets/SelectLists | Get Filtered Select Lists | ❌ |
-| FileCabinets/Upload | Create Data Record | ✅ |
-| FileCabinets/Upload | Append File(s) to a Data Record | ❌ |
-| FileCabinets/Upload | Upload a Single File for a Data Record | ❌ |
-| FileCabinets/Upload | Create a Data Record & Upload File | ❌ |
-| FileCabinets/Upload | Create Data Record & Upload File Using Store Dialog | ❌ |
-| FileCabinets/Upload | Append a Single PDF to a Document | ❌ |
-| FileCabinets/Upload | Replace a PDF Document Section | ❌ |
-| FileCabinets/BatchIndexFieldsUpdate | Batch Update Index Fields By Id | ❌ |
-| FileCabinets/BatchIndexFieldsUpdate | Batch Update Index Fields By Search | ❌ |
-| FileCabinets/BatchIndexFieldsUpdate | Batch Append/Update Keyword Fields By Id | ❌ |
-| Documents/UpdateIndexValues | Update Index Values | ✅ |
-| Documents/UpdateIndexValues | Update Table Field Values | ❌ |
-| Documents/ModifyDocuments | Transfer Document | ✅ |
-| Documents/ModifyDocuments | Delete Document | ✅ |
-| Documents/ClipUnclip&StapleUnstaple | Clip | ✅ |
-| Documents/ClipUnclip&StapleUnstaple | Unclip | ✅ |
-| Documents/ClipUnclip&StapleUnstaple | Staple | ✅ |
-| Documents/ClipUnclip&StapleUnstaple | Unstaple | ✅ |
-| Documents/AnnotationsStamps | AddStampWithPosition | ❌ |
-| Documents/AnnotationsStamps | AddStampWithBestPosition | ❌ |
-| Documents/AnnotationsStamps | AddTextAnnotation | ❌ |
-| Documents/AnnotationsStamps | AddRectEntryAnnotation | ❌ |
-| Documents/AnnotationsStamps | AddLineEntryAnnotation | ❌ |
-| Documents/AnnotationsStamps | AddPolyLineEntryAnnotation | ❌ |
-| Documents/AnnotationsStamps | DeleteAnnotation | ❌ |
-| Documents/AnnotationsStamps | UpdateTextAnnotation | ❌ |
-| Documents/AnnotationsStamps | Get Stamps | ❌ |
-| Documents/DocumentsTrashBin | Get Documents | ✅ |
-| Documents/DocumentsTrashBin | Delete Documents | ✅ |
-| Documents/DocumentsTrashBin | Restore Documents | ✅ |
-| Documents/ApplicationProperties | Get Application Properties | ❌ |
-| Documents/ApplicationProperties | Add Application Properties | ❌ |
-| Documents/ApplicationProperties | Delete Application Properties | ❌ |
-| Documents/ApplicationProperties | Update Application Properties | ❌ |
-| Documents/Sections | Get All Sections from a Document | ❌ |
-| Documents/Sections | Get a Specific Section | ❌ |
-| Documents/Sections | Delete Section | ❌ |
-| Documents/Download | Download Document | ✅ |
-| Documents/Download | Download Section | ❌ |
-| Documents/Download | Download Thumbnail | ✅ |
-| Workflow | Get Document Workflow History | ❌ |
-| Workflow | Get Document Workflow History Steps | ❌ |
+| Group | Request | Supported | TODO |
+|-------------------------------------|-------------------------------------------------------------|-----------|------|
+| Authentication/OAuth | 1. Get Responsible Identity Service | ✅ | |
+| Authentication/OAuth | 2. Get Identity Service Configuration | ✅ | |
+| Authentication/OAuth | 3.a Request Token w/ Username & Password | ✅ | |
+| Authentication/OAuth | 3.b Request Token w/ a DocuWare Token | 🕣 | |
+| Authentication/OAuth | 3.c Request Token w/ Username & Password (Trusted User) | 🕣 | |
+| Authentication/OAuth | 3.d.1 Obtain Windows Authorization (On Premises Only) | 🕣 | |
+| Authentication/OAuth | 3.d.2 Request Token /w a Windows Account (On Premises Only) | 🕣 | |
+| General/Organisation | Get Login Token | ✅ | |
+| General/Organisation | Get Organization | ✅ | |
+| General/Organisation | Get All File Cabinets and Document Trays | ✅ | |
+| General/UserManagement | Get Users by ID | ✅ | |
+| General/UserManagement | Get Users of a Role | ✅ | |
+| General/UserManagement | Get Users of a Group | ✅ | |
+| General/UserManagement | Create User | ✅ | |
+| General/UserManagement | Update User | ✅ | |
+| General/UserManagement | Get Groups | ✅ | |
+| General/UserManagement | Get All Groups for a Specific User | ✅ | |
+| General/UserManagement | Add User to a Group | ✅ | |
+| General/UserManagement | Remove User from a Group | ✅ | |
+| General/UserManagement | Get Roles | ✅ | |
+| General/UserManagement | Get All Roles for a Specific User | ✅ | |
+| General/UserManagement | Add User to a Role | ✅ | |
+| General/UserManagement | Remove User from a Role | ✅ | |
+| FileCabinets/General | Get File Cabinet Information | ✅ | |
+| FileCabinets/General | Get Total Number of Documents | ✅ | |
+| FileCabinets/Dialogs | Get All Dialogs | ✅ | |
+| FileCabinets/Dialogs | Get a Specific Dialog | ✅ | |
+| FileCabinets/Dialogs | Get Dialogs of a Specific Type | ✅ | |
+| FileCabinets/Search | Get Documents from a File Cabinet | ✅ | |
+| FileCabinets/Search | Get a Specific Document From a File Cabinet | ✅ | |
+| FileCabinets/Search | Search for Documents in a Single File Cabinet | ✅ | |
+| FileCabinets/Search | Search for Documents in Multiple File Cabinets | ✅ | |
+| FileCabinets/CheckInCheckOut | Check-out & Download a Document | 🕣 | |
+| FileCabinets/CheckInCheckOut | Check-in a Document from the File System | 🕣 | |
+| FileCabinets/CheckInCheckOut | Undo Check-out | 🕣 | |
+| FileCabinets/SelectLists | Get Select Lists & Get Filtered Select Lists | ✅ | |
+| FileCabinets/Upload | Create Data Record | ✅ | |
+| FileCabinets/Upload | Append File(s) to a Data Record | ❌ | - |
+| FileCabinets/Upload | Upload a Single File for a Data Record | ❌ | - |
+| FileCabinets/Upload | Create a Data Record & Upload File | ❌ | - |
+| FileCabinets/Upload | Create Data Record & Upload File Using Store Dialog | ❌ | - |
+| FileCabinets/Upload | Append a Single PDF to a Document | ❌ | - |
+| FileCabinets/Upload | Replace a PDF Document Section | ❌ | - |
+| FileCabinets/BatchIndexFieldsUpdate | Batch Update Index Fields By Id | ❌ | - |
+| FileCabinets/BatchIndexFieldsUpdate | Batch Update Index Fields By Search | ❌ | - |
+| FileCabinets/BatchIndexFieldsUpdate | Batch Append/Update Keyword Fields By Id | ❌ | - |
+| Documents/UpdateIndexValues | Update Index Values | ✅ | |
+| Documents/UpdateIndexValues | Update Table Field Values | ❌ | - ? |
+| Documents/ModifyDocuments | Transfer Document | ✅ | - |
+| Documents/ModifyDocuments | Delete Document | ✅ | |
+| Documents/ClipUnclip&StapleUnstaple | Clip | ✅ | |
+| Documents/ClipUnclip&StapleUnstaple | Unclip | ✅ | |
+| Documents/ClipUnclip&StapleUnstaple | Staple | ✅ | |
+| Documents/ClipUnclip&StapleUnstaple | Unstaple | ✅ | |
+| Documents/AnnotationsStamps | AddStampWithPosition | ❌ | - |
+| Documents/AnnotationsStamps | AddStampWithBestPosition | ❌ | - |
+| Documents/AnnotationsStamps | AddTextAnnotation | ❌ | - |
+| Documents/AnnotationsStamps | AddRectEntryAnnotation | ❌ | - |
+| Documents/AnnotationsStamps | AddLineEntryAnnotation | ❌ | - |
+| Documents/AnnotationsStamps | AddPolyLineEntryAnnotation | ❌ | - |
+| Documents/AnnotationsStamps | DeleteAnnotation | ❌ | - |
+| Documents/AnnotationsStamps | UpdateTextAnnotation | ❌ | - |
+| Documents/AnnotationsStamps | Get Stamps | ❌ | - |
+| Documents/DocumentsTrashBin | Get Documents | ✅ | |
+| Documents/DocumentsTrashBin | Delete Documents | ✅ | |
+| Documents/DocumentsTrashBin | Restore Documents | ✅ | |
+| Documents/ApplicationProperties | Get Application Properties | ❌ | - |
+| Documents/ApplicationProperties | Add Application Properties | ❌ | - |
+| Documents/ApplicationProperties | Delete Application Properties | ❌ | - |
+| Documents/ApplicationProperties | Update Application Properties | ❌ | - |
+| Documents/Sections | Get All Sections from a Document | ✅ | - |
+| Documents/Sections | Get a Specific Section | ✅ | - |
+| Documents/Sections | Delete Section | ✅ | - |
+| Documents/Download | Download Document | ✅ | |
+| Documents/Download | Download Section | ✅ | - |
+| Documents/Download | Download Thumbnail | ✅ | |
+| Workflow | Get Document Workflow History | ✅ | - |
+| Workflow | Get Document Workflow History Steps | ✅ | - |
diff --git a/src/DTO/Section.php b/src/DTO/Section.php
index 7ce0a2d..6d0901b 100644
--- a/src/DTO/Section.php
+++ b/src/DTO/Section.php
@@ -3,11 +3,18 @@
namespace CodebarAg\DocuWare\DTO;
use Illuminate\Support\Arr;
+use Illuminate\Support\Carbon;
+use Illuminate\Support\Str;
final class Section
{
public static function fromJson(array $data): self
{
+ if ($contentModifiedDateTime = Arr::get($data, 'ContentModified')) {
+ $contentModifiedDateTime = Str::of($contentModifiedDateTime)->after('(')->before(')');
+ $contentModifiedDateTime = Carbon::createFromTimestamp($contentModifiedDateTime);
+ }
+
return new self(
id: Arr::get($data, 'Id'),
contentType: Arr::get($data, 'ContentType'),
@@ -15,7 +22,7 @@ public static function fromJson(array $data): self
pageCount: Arr::get($data, 'PageCount'),
fileSize: Arr::get($data, 'FileSize'),
originalFileName: Arr::get($data, 'OriginalFileName'),
- contentModified: Arr::get($data, 'ContentModified'),
+ contentModified: $contentModifiedDateTime,
annotationsPreview: Arr::get($data, 'AnnotationsPreview'),
hasTextAnnotations: Arr::get($data, 'HasTextAnnotations'),
);
@@ -28,7 +35,7 @@ public function __construct(
public int $pageCount,
public int $fileSize,
public string $originalFileName,
- public string $contentModified,
+ public ?Carbon $contentModified,
public bool $annotationsPreview,
public ?bool $hasTextAnnotations = null,
) {
diff --git a/src/DTO/Workflow/HistoryStep.php b/src/DTO/Workflow/HistoryStep.php
new file mode 100644
index 0000000..c184276
--- /dev/null
+++ b/src/DTO/Workflow/HistoryStep.php
@@ -0,0 +1,38 @@
+after('(')->before(')');
+ $stepDateTime = Carbon::createFromTimestamp($stepDateTime);
+ }
+
+ return new self(
+ infoItem: collect(Arr::get($data, 'Info.Item')),
+ stepNumber: Arr::get($data, 'StepNumber'),
+ stepDate: $stepDateTime,
+ activityName: Arr::get($data, 'ActivityName'),
+ activityType: Arr::get($data, 'ActivityType'),
+ stepType: Arr::get($data, 'StepType'),
+ );
+ }
+
+ public function __construct(
+ public Collection $infoItem,
+ public int $stepNumber,
+ public Carbon $stepDate,
+ public string $activityName,
+ public string $activityType,
+ public string $stepType,
+ ) {
+ }
+}
diff --git a/src/DTO/Workflow/InstanceHistory.php b/src/DTO/Workflow/InstanceHistory.php
new file mode 100644
index 0000000..7e5436b
--- /dev/null
+++ b/src/DTO/Workflow/InstanceHistory.php
@@ -0,0 +1,46 @@
+after('(')->before(')');
+ $startDateTime = Carbon::createFromTimestamp($startDateTime);
+ }
+
+ if ($historySteps = Arr::get($data, 'HistorySteps')) {
+ $historySteps = collect($historySteps)->map(fn (array $historyStep) => HistoryStep::fromJson($historyStep));
+ }
+
+ return new self(
+ id: Arr::get($data, 'Id'),
+ workflowId: Arr::get($data, 'WorkflowId'),
+ name: Arr::get($data, 'Name'),
+ version: Arr::get($data, 'Version'),
+ workflowRequest: Arr::get($data, 'WorkflowRequest'),
+ startedAt: $startDateTime,
+ docId: Arr::get($data, 'DocId'),
+ historySteps: $historySteps,
+ );
+ }
+
+ public function __construct(
+ public string $id,
+ public string $workflowId,
+ public string $name,
+ public int $version,
+ public bool $workflowRequest,
+ public Carbon $startedAt,
+ public string $docId,
+ public ?Collection $historySteps = null,
+ ) {
+ }
+}
diff --git a/src/Requests/Documents/Download/DownloadDocument.php b/src/Requests/Documents/Download/DownloadDocument.php
index 27b48aa..83fee92 100644
--- a/src/Requests/Documents/Download/DownloadDocument.php
+++ b/src/Requests/Documents/Download/DownloadDocument.php
@@ -19,7 +19,7 @@ class DownloadDocument extends Request implements Cacheable
public function __construct(
protected readonly string $fileCabinetId,
- protected readonly int $documentId,
+ protected readonly string $documentId,
) {
}
@@ -46,7 +46,7 @@ public function defaultQuery(): array
];
}
- public function createDtoFromResponse(Response $response): string
+ public function createDtoFromResponse(Response $response): mixed
{
return DownloadDocumentResponse::fromResponse($response);
}
diff --git a/src/Requests/Documents/Download/DownloadSection.php b/src/Requests/Documents/Download/DownloadSection.php
new file mode 100644
index 0000000..2afbf38
--- /dev/null
+++ b/src/Requests/Documents/Download/DownloadSection.php
@@ -0,0 +1,45 @@
+fileCabinetId.'/Sections/'.$this->sectionId.'/Data';
+ }
+
+ public function resolveCacheDriver(): LaravelCacheDriver
+ {
+ return new LaravelCacheDriver(Cache::store(config('laravel-docuware.configurations.cache.driver')));
+ }
+
+ public function cacheExpiryInSeconds(): int
+ {
+ return config('laravel-docuware.configurations.cache.lifetime_in_seconds', 3600);
+ }
+
+ public function createDtoFromResponse(Response $response): mixed
+ {
+ return DownloadSectionResponse::fromResponse($response);
+ }
+}
diff --git a/src/Requests/Documents/Download/DownloadThumbnail.php b/src/Requests/Documents/Download/DownloadThumbnail.php
index fc052ed..213aa94 100644
--- a/src/Requests/Documents/Download/DownloadThumbnail.php
+++ b/src/Requests/Documents/Download/DownloadThumbnail.php
@@ -19,14 +19,14 @@ class DownloadThumbnail extends Request implements Cacheable
public function __construct(
protected readonly string $fileCabinetId,
- protected readonly string $thumbnailId,
+ protected readonly string $sectionId,
protected readonly int $page = 0,
) {
}
public function resolveEndpoint(): string
{
- return '/FileCabinets/'.$this->fileCabinetId.'/Rendering/'.$this->thumbnailId.'/Thumbnail';
+ return '/FileCabinets/'.$this->fileCabinetId.'/Rendering/'.$this->sectionId.'/Thumbnail';
}
public function resolveCacheDriver(): LaravelCacheDriver
diff --git a/src/Requests/Documents/Sections/DeleteSection.php b/src/Requests/Documents/Sections/DeleteSection.php
new file mode 100644
index 0000000..e4a4cc2
--- /dev/null
+++ b/src/Requests/Documents/Sections/DeleteSection.php
@@ -0,0 +1,45 @@
+fileCabinetId.'/Sections/'.$this->sectionId;
+ }
+
+ public function resolveCacheDriver(): LaravelCacheDriver
+ {
+ return new LaravelCacheDriver(Cache::store(config('laravel-docuware.configurations.cache.driver')));
+ }
+
+ public function cacheExpiryInSeconds(): int
+ {
+ return config('laravel-docuware.configurations.cache.lifetime_in_seconds', 3600);
+ }
+
+ public function createDtoFromResponse(Response $response): bool
+ {
+ return DeleteSectionResponse::fromResponse($response);
+ }
+}
diff --git a/src/Requests/Documents/Sections/GetASpecificSection.php b/src/Requests/Documents/Sections/GetASpecificSection.php
new file mode 100644
index 0000000..c7ab4b9
--- /dev/null
+++ b/src/Requests/Documents/Sections/GetASpecificSection.php
@@ -0,0 +1,46 @@
+fileCabinetId.'/Sections/'.$this->sectionId;
+ }
+
+ public function resolveCacheDriver(): LaravelCacheDriver
+ {
+ return new LaravelCacheDriver(Cache::store(config('laravel-docuware.configurations.cache.driver')));
+ }
+
+ public function cacheExpiryInSeconds(): int
+ {
+ return config('laravel-docuware.configurations.cache.lifetime_in_seconds', 3600);
+ }
+
+ public function createDtoFromResponse(Response $response): Section
+ {
+ return GetASecificSectionResponse::fromResponse($response);
+ }
+}
diff --git a/src/Requests/Sections/GetSectionsRequest.php b/src/Requests/Documents/Sections/GetAllSectionsFromADocument.php
similarity index 77%
rename from src/Requests/Sections/GetSectionsRequest.php
rename to src/Requests/Documents/Sections/GetAllSectionsFromADocument.php
index 7609933..45b87f2 100644
--- a/src/Requests/Sections/GetSectionsRequest.php
+++ b/src/Requests/Documents/Sections/GetAllSectionsFromADocument.php
@@ -1,8 +1,8 @@
fileCabinetId.'/Documents/'.$this->documentId.'/WorkflowHistory';
+ }
+
+ public function resolveCacheDriver(): LaravelCacheDriver
+ {
+ return new LaravelCacheDriver(Cache::store(config('laravel-docuware.configurations.cache.driver')));
+ }
+
+ public function cacheExpiryInSeconds(): int
+ {
+ return config('laravel-docuware.configurations.cache.lifetime_in_seconds', 3600);
+ }
+
+ public function createDtoFromResponse(Response $response): Collection
+ {
+ return GetDocumentWorkflowHistoryResponse::fromResponse($response);
+ }
+}
diff --git a/src/Requests/Workflow/GetDocumentWorkflowHistorySteps.php b/src/Requests/Workflow/GetDocumentWorkflowHistorySteps.php
new file mode 100644
index 0000000..d596486
--- /dev/null
+++ b/src/Requests/Workflow/GetDocumentWorkflowHistorySteps.php
@@ -0,0 +1,46 @@
+workflowId.'/Instances/'.$this->workflowInstanceId.'/History';
+ }
+
+ public function resolveCacheDriver(): LaravelCacheDriver
+ {
+ return new LaravelCacheDriver(Cache::store(config('laravel-docuware.configurations.cache.driver')));
+ }
+
+ public function cacheExpiryInSeconds(): int
+ {
+ return config('laravel-docuware.configurations.cache.lifetime_in_seconds', 3600);
+ }
+
+ public function createDtoFromResponse(Response $response): InstanceHistory
+ {
+ return GetDocumentWorkflowHistoryStepsResponse::fromResponse($response);
+ }
+}
diff --git a/src/Responses/Documents/Download/DownloadDocumentResponse.php b/src/Responses/Documents/Download/DownloadDocumentResponse.php
index 7b2cdc2..a29dd49 100644
--- a/src/Responses/Documents/Download/DownloadDocumentResponse.php
+++ b/src/Responses/Documents/Download/DownloadDocumentResponse.php
@@ -8,7 +8,7 @@
final class DownloadDocumentResponse
{
- public static function fromResponse(Response $response): string
+ public static function fromResponse(Response $response): mixed
{
event(new DocuWareResponseLog($response));
diff --git a/src/Responses/Documents/Download/DownloadSectionResponse.php b/src/Responses/Documents/Download/DownloadSectionResponse.php
new file mode 100644
index 0000000..e03d600
--- /dev/null
+++ b/src/Responses/Documents/Download/DownloadSectionResponse.php
@@ -0,0 +1,19 @@
+throw()->body();
+ }
+}
diff --git a/src/Responses/Documents/Sections/DeleteSectionResponse.php b/src/Responses/Documents/Sections/DeleteSectionResponse.php
new file mode 100644
index 0000000..0a8efd7
--- /dev/null
+++ b/src/Responses/Documents/Sections/DeleteSectionResponse.php
@@ -0,0 +1,16 @@
+status() === 200;
+ }
+}
diff --git a/src/Responses/Documents/Sections/GetASecificSectionResponse.php b/src/Responses/Documents/Sections/GetASecificSectionResponse.php
new file mode 100644
index 0000000..b8ea336
--- /dev/null
+++ b/src/Responses/Documents/Sections/GetASecificSectionResponse.php
@@ -0,0 +1,20 @@
+throw()->json());
+ }
+}
diff --git a/src/Responses/Sections/GetSectionsResponse.php b/src/Responses/Documents/Sections/GetAllSectionsFromADocumentResponse.php
similarity index 59%
rename from src/Responses/Sections/GetSectionsResponse.php
rename to src/Responses/Documents/Sections/GetAllSectionsFromADocumentResponse.php
index 192f113..8388ffb 100644
--- a/src/Responses/Sections/GetSectionsResponse.php
+++ b/src/Responses/Documents/Sections/GetAllSectionsFromADocumentResponse.php
@@ -1,6 +1,6 @@
throw()->json();
-
- $sections = collect();
-
- foreach ($res['Section'] as $section) {
- $sections->push(Section::fromJson($section));
- }
-
- return $sections;
+ return collect($response->throw()->json('Section'))->map(fn ($section) => Section::fromJson($section));
}
}
diff --git a/src/Responses/Workflow/GetDocumentWorkflowHistoryResponse.php b/src/Responses/Workflow/GetDocumentWorkflowHistoryResponse.php
new file mode 100644
index 0000000..0396d9b
--- /dev/null
+++ b/src/Responses/Workflow/GetDocumentWorkflowHistoryResponse.php
@@ -0,0 +1,23 @@
+throw()->json('InstanceHistory');
+
+ return collect($instanceHistories)->map(fn (array $instanceHistory) => InstanceHistory::fromJson($instanceHistory));
+ }
+}
diff --git a/src/Responses/Workflow/GetDocumentWorkflowHistoryStepsResponse.php b/src/Responses/Workflow/GetDocumentWorkflowHistoryStepsResponse.php
new file mode 100644
index 0000000..0fbd954
--- /dev/null
+++ b/src/Responses/Workflow/GetDocumentWorkflowHistoryStepsResponse.php
@@ -0,0 +1,20 @@
+throw()->json());
+ }
+}
diff --git a/tests/Feature/Requests/Documents/GetDocumentDownloadRequestTest.php b/tests/Feature/Requests/Documents/Download/DownloadDocumentTest.php
similarity index 97%
rename from tests/Feature/Requests/Documents/GetDocumentDownloadRequestTest.php
rename to tests/Feature/Requests/Documents/Download/DownloadDocumentTest.php
index d901fdc..ab915f4 100644
--- a/tests/Feature/Requests/Documents/GetDocumentDownloadRequestTest.php
+++ b/tests/Feature/Requests/Documents/Download/DownloadDocumentTest.php
@@ -24,4 +24,4 @@
$this->assertSame(strlen('::fake-file-content::'), strlen($contents));
Event::assertDispatched(DocuWareResponseLog::class);
-});
+})->group('download');
diff --git a/tests/Feature/Requests/Documents/Download/DownloadSectionTest.php b/tests/Feature/Requests/Documents/Download/DownloadSectionTest.php
new file mode 100644
index 0000000..29a73f1
--- /dev/null
+++ b/tests/Feature/Requests/Documents/Download/DownloadSectionTest.php
@@ -0,0 +1,33 @@
+connector->send(new CreateDataRecord(
+ $fileCabinetId,
+ '::fake-file-content::',
+ 'example.txt'
+ ))->dto();
+
+ $sections = $this->connector->send(new GetAllSectionsFromADocument(
+ $fileCabinetId,
+ $document->id
+ ))->dto();
+
+ $contents = $this->connector->send(new DownloadSection(
+ $fileCabinetId,
+ $sections->first()->id
+ ))->dto();
+
+ $this->assertSame(strlen('::fake-file-content::'), strlen($contents));
+ Event::assertDispatched(DocuWareResponseLog::class);
+
+})->group('download');
diff --git a/tests/Feature/Requests/Documents/Download/DownloadThumbnailTest.php b/tests/Feature/Requests/Documents/Download/DownloadThumbnailTest.php
new file mode 100644
index 0000000..e9c117b
--- /dev/null
+++ b/tests/Feature/Requests/Documents/Download/DownloadThumbnailTest.php
@@ -0,0 +1,34 @@
+connector->send(new CreateDataRecord(
+ $fileCabinetId,
+ '::fake-file-content::',
+ 'example.txt'
+ ))->dto();
+
+ $sections = $this->connector->send(new GetAllSectionsFromADocument(
+ $fileCabinetId,
+ $document->id
+ ))->dto();
+
+ $contents = $this->connector->send(new DownloadThumbnail(
+ $fileCabinetId,
+ $sections->first()->id
+ ))->dto();
+
+ expect($contents)->toBeInstanceOf(DocumentThumbnail::class);
+ Event::assertDispatched(DocuWareResponseLog::class);
+
+})->group('download');
diff --git a/tests/Feature/Requests/Documents/Sections/DeleteSectionTest.php b/tests/Feature/Requests/Documents/Sections/DeleteSectionTest.php
new file mode 100644
index 0000000..9c56884
--- /dev/null
+++ b/tests/Feature/Requests/Documents/Sections/DeleteSectionTest.php
@@ -0,0 +1,35 @@
+connector->send(new CreateDataRecord(
+ $fileCabinetId,
+ '::fake-file-content::',
+ 'example.txt'
+ ))->dto();
+
+ $sections = $this->connector->send(new GetAllSectionsFromADocument(
+ $fileCabinetId,
+ $document->id
+ ))->dto();
+
+ $deleted = $this->connector->send(new DeleteSection(
+ $fileCabinetId,
+ $sections->first()->id
+ ))->dto();
+
+ expect($deleted)->toBeTrue();
+
+ Event::assertDispatched(DocuWareResponseLog::class);
+
+})->group('requests', 'sections');
diff --git a/tests/Feature/Requests/Documents/Sections/GetASpecificSectionTest.php b/tests/Feature/Requests/Documents/Sections/GetASpecificSectionTest.php
new file mode 100644
index 0000000..7da557a
--- /dev/null
+++ b/tests/Feature/Requests/Documents/Sections/GetASpecificSectionTest.php
@@ -0,0 +1,35 @@
+connector->send(new CreateDataRecord(
+ $fileCabinetId,
+ '::fake-file-content::',
+ 'example.txt'
+ ))->dto();
+
+ $sections = $this->connector->send(new GetAllSectionsFromADocument(
+ $fileCabinetId,
+ $document->id
+ ))->dto();
+
+ $section = $this->connector->send(new GetASpecificSection(
+ $fileCabinetId,
+ $sections->first()->id
+ ))->dto();
+
+ expect($section->id)->toBe($sections->first()->id);
+
+ Event::assertDispatched(DocuWareResponseLog::class);
+
+})->group('requests', 'sections');
diff --git a/tests/Feature/Requests/Documents/Sections/GetAllSectionsFromADocumentTest.php b/tests/Feature/Requests/Documents/Sections/GetAllSectionsFromADocumentTest.php
new file mode 100644
index 0000000..70a78c8
--- /dev/null
+++ b/tests/Feature/Requests/Documents/Sections/GetAllSectionsFromADocumentTest.php
@@ -0,0 +1,33 @@
+connector->send(new CreateDataRecord(
+ $fileCabinetId,
+ '::fake-file-content::',
+ 'example.txt'
+ ))->dto();
+
+ $sections = $this->connector->send(new GetAllSectionsFromADocument(
+ $fileCabinetId,
+ $document->id
+ ))->dto();
+
+ expect($sections)->toBeInstanceOf(Collection::class)
+ ->and($sections->count())->toBeGreaterThan(0)
+ ->and($sections->first())->toBeInstanceOf(Section::class);
+
+ Event::assertDispatched(DocuWareResponseLog::class);
+
+})->group('requests', 'sections');
diff --git a/tests/Feature/Requests/Documents/Thumbnail/GetDocumentDownloadThumbnailRequestTest.php b/tests/Feature/Requests/Documents/Thumbnail/GetDocumentDownloadThumbnailRequestTest.php
index 29c8757..9297ae4 100644
--- a/tests/Feature/Requests/Documents/Thumbnail/GetDocumentDownloadThumbnailRequestTest.php
+++ b/tests/Feature/Requests/Documents/Thumbnail/GetDocumentDownloadThumbnailRequestTest.php
@@ -3,8 +3,8 @@
use CodebarAg\DocuWare\DTO\Documents\DocumentThumbnail;
use CodebarAg\DocuWare\Events\DocuWareResponseLog;
use CodebarAg\DocuWare\Requests\Documents\Download\DownloadThumbnail;
+use CodebarAg\DocuWare\Requests\Documents\Sections\GetAllSectionsFromADocument;
use CodebarAg\DocuWare\Requests\FileCabinets\Upload\CreateDataRecord;
-use CodebarAg\DocuWare\Requests\Sections\GetSectionsRequest;
use Illuminate\Support\Facades\Event;
it('can download a document thumbnail', function () {
@@ -18,7 +18,7 @@
'example.txt'
))->dto();
- $sections = $this->connector->send(new GetSectionsRequest(
+ $sections = $this->connector->send(new GetAllSectionsFromADocument(
$fileCabinetId,
$document->id,
))->dto();
diff --git a/tests/Feature/Requests/Workflow/GetDocumentWorkflowHistoryStepsTest.php b/tests/Feature/Requests/Workflow/GetDocumentWorkflowHistoryStepsTest.php
new file mode 100644
index 0000000..79c17e8
--- /dev/null
+++ b/tests/Feature/Requests/Workflow/GetDocumentWorkflowHistoryStepsTest.php
@@ -0,0 +1,45 @@
+connector->send(new CreateDataRecord(
+ config('laravel-docuware.tests.file_cabinet_id'),
+ '::fake-file-content::',
+ 'example.txt'
+ ))->dto();
+
+ Sleep::for(5)->seconds();
+
+ $history = $this->connector->send(new GetDocumentWorkflowHistory(
+ config('laravel-docuware.tests.file_cabinet_id'),
+ $document->id
+ ))->dto();
+
+ $historySteps = $this->connector->send(new GetDocumentWorkflowHistorySteps(
+ $history->first()->workflowId,
+ $history->first()->id,
+ ))->dto();
+
+ expect($historySteps)->toHaveKeys([
+ 'id',
+ 'workflowId',
+ 'name',
+ 'version',
+ 'workflowRequest',
+ 'startedAt',
+ 'docId',
+ 'historySteps',
+ ])
+ ->and($historySteps->historySteps)->toBeInstanceOf(Collection::class);
+
+ Event::assertDispatched(DocuWareResponseLog::class);
+})->group('workflow');
diff --git a/tests/Feature/Requests/Workflow/GetDocumentWorkflowHistoryTest.php b/tests/Feature/Requests/Workflow/GetDocumentWorkflowHistoryTest.php
new file mode 100644
index 0000000..7a0074c
--- /dev/null
+++ b/tests/Feature/Requests/Workflow/GetDocumentWorkflowHistoryTest.php
@@ -0,0 +1,38 @@
+connector->send(new CreateDataRecord(
+ config('laravel-docuware.tests.file_cabinet_id'),
+ '::fake-file-content::',
+ 'example.txt'
+ ))->dto();
+
+ Sleep::for(5)->seconds();
+
+ $history = $this->connector->send(new GetDocumentWorkflowHistory(
+ config('laravel-docuware.tests.file_cabinet_id'),
+ $document->id
+ ))->dto();
+
+ expect($history)->toBeInstanceOf(Collection::class)
+ ->and($history->first())->toHaveKeys([
+ 'id',
+ 'workflowId',
+ 'name',
+ 'version',
+ 'workflowRequest',
+ 'startedAt',
+ 'docId',
+ ]);
+
+ Event::assertDispatched(DocuWareResponseLog::class);
+})->group('workflow');
From 370375244d66638bd82ac8ef7ddd68855a5538f4 Mon Sep 17 00:00:00 2001
From: Rhys Lees <43909932+RhysLees@users.noreply.github.com>
Date: Sat, 1 Jun 2024 01:01:43 +0100
Subject: [PATCH 43/54] WIP
---
README.md | 2 +-
.../GetApplicationProperties.php | 45 +++++++++++++++++++
.../GetApplicationPropertiesResponse.php | 19 ++++++++
.../GetApplicationPropertiesTest.php | 26 +++++++++++
4 files changed, 91 insertions(+), 1 deletion(-)
create mode 100644 src/Requests/Documents/ApplicationProperties/GetApplicationProperties.php
create mode 100644 src/Responses/Documents/ApplicationProperties/GetApplicationPropertiesResponse.php
create mode 100644 tests/Feature/Requests/Documents/ApplicationProperties/GetApplicationPropertiesTest.php
diff --git a/README.md b/README.md
index 9c675b8..6a28f06 100644
--- a/README.md
+++ b/README.md
@@ -132,7 +132,7 @@ then optimize the processes that power the core of your business.
| Documents/DocumentsTrashBin | Get Documents | ✅ | |
| Documents/DocumentsTrashBin | Delete Documents | ✅ | |
| Documents/DocumentsTrashBin | Restore Documents | ✅ | |
-| Documents/ApplicationProperties | Get Application Properties | ❌ | - |
+| Documents/ApplicationProperties | Get Application Properties | ❓ | - |
| Documents/ApplicationProperties | Add Application Properties | ❌ | - |
| Documents/ApplicationProperties | Delete Application Properties | ❌ | - |
| Documents/ApplicationProperties | Update Application Properties | ❌ | - |
diff --git a/src/Requests/Documents/ApplicationProperties/GetApplicationProperties.php b/src/Requests/Documents/ApplicationProperties/GetApplicationProperties.php
new file mode 100644
index 0000000..1acfa06
--- /dev/null
+++ b/src/Requests/Documents/ApplicationProperties/GetApplicationProperties.php
@@ -0,0 +1,45 @@
+fileCabinetId.'/Documents/'.$this->documentId.'/DocumentApplicationProperties';
+ }
+
+ public function resolveCacheDriver(): LaravelCacheDriver
+ {
+ return new LaravelCacheDriver(Cache::store(config('laravel-docuware.configurations.cache.driver')));
+ }
+
+ public function cacheExpiryInSeconds(): int
+ {
+ return config('laravel-docuware.configurations.cache.lifetime_in_seconds', 3600);
+ }
+
+ public function createDtoFromResponse(Response $response): mixed
+ {
+ return GetApplicationPropertiesResponse::fromResponse($response);
+ }
+}
diff --git a/src/Responses/Documents/ApplicationProperties/GetApplicationPropertiesResponse.php b/src/Responses/Documents/ApplicationProperties/GetApplicationPropertiesResponse.php
new file mode 100644
index 0000000..de30c79
--- /dev/null
+++ b/src/Responses/Documents/ApplicationProperties/GetApplicationPropertiesResponse.php
@@ -0,0 +1,19 @@
+throw()->json();
+ }
+}
diff --git a/tests/Feature/Requests/Documents/ApplicationProperties/GetApplicationPropertiesTest.php b/tests/Feature/Requests/Documents/ApplicationProperties/GetApplicationPropertiesTest.php
new file mode 100644
index 0000000..0192d88
--- /dev/null
+++ b/tests/Feature/Requests/Documents/ApplicationProperties/GetApplicationPropertiesTest.php
@@ -0,0 +1,26 @@
+connector->send(new CreateDataRecord(
+ $fileCabinetId,
+ '::fake-file-content::',
+ 'example.txt'
+ ))->dto();
+
+ $properties = $this->connector->send(new GetApplicationProperties(
+ $fileCabinetId,
+ $document->id,
+ ))->dto();
+
+ Event::assertDispatched(DocuWareResponseLog::class);
+
+});
From 413ecd6bc6062a1b28c4907fd54ef3bbb761bc47 Mon Sep 17 00:00:00 2001
From: Rhys Lees <43909932+RhysLees@users.noreply.github.com>
Date: Wed, 5 Jun 2024 18:16:09 +0200
Subject: [PATCH 44/54] WIP
---
README.md | 8 +-
.../AddApplicationProperties.php | 56 ++++++++++++
.../DeleteApplicationProperties.php | 63 ++++++++++++++
.../UpdateApplicationProperties.php | 56 ++++++++++++
.../GetApplicationPropertiesResponse.php | 2 +-
.../ApplicationPropertiesTest.php | 87 +++++++++++++++++++
.../GetApplicationPropertiesTest.php | 26 ------
7 files changed, 267 insertions(+), 31 deletions(-)
create mode 100644 src/Requests/Documents/ApplicationProperties/AddApplicationProperties.php
create mode 100644 src/Requests/Documents/ApplicationProperties/DeleteApplicationProperties.php
create mode 100644 src/Requests/Documents/ApplicationProperties/UpdateApplicationProperties.php
create mode 100644 tests/Feature/Requests/Documents/ApplicationProperties/ApplicationPropertiesTest.php
delete mode 100644 tests/Feature/Requests/Documents/ApplicationProperties/GetApplicationPropertiesTest.php
diff --git a/README.md b/README.md
index 6a28f06..492e811 100644
--- a/README.md
+++ b/README.md
@@ -132,10 +132,10 @@ then optimize the processes that power the core of your business.
| Documents/DocumentsTrashBin | Get Documents | ✅ | |
| Documents/DocumentsTrashBin | Delete Documents | ✅ | |
| Documents/DocumentsTrashBin | Restore Documents | ✅ | |
-| Documents/ApplicationProperties | Get Application Properties | ❓ | - |
-| Documents/ApplicationProperties | Add Application Properties | ❌ | - |
-| Documents/ApplicationProperties | Delete Application Properties | ❌ | - |
-| Documents/ApplicationProperties | Update Application Properties | ❌ | - |
+| Documents/ApplicationProperties | Get Application Properties | ✅ | - |
+| Documents/ApplicationProperties | Add Application Properties | ✅ | - |
+| Documents/ApplicationProperties | Delete Application Properties | ✅ | - |
+| Documents/ApplicationProperties | Update Application Properties | ✅ | - |
| Documents/Sections | Get All Sections from a Document | ✅ | - |
| Documents/Sections | Get a Specific Section | ✅ | - |
| Documents/Sections | Delete Section | ✅ | - |
diff --git a/src/Requests/Documents/ApplicationProperties/AddApplicationProperties.php b/src/Requests/Documents/ApplicationProperties/AddApplicationProperties.php
new file mode 100644
index 0000000..2d05564
--- /dev/null
+++ b/src/Requests/Documents/ApplicationProperties/AddApplicationProperties.php
@@ -0,0 +1,56 @@
+fileCabinetId.'/Documents/'.$this->documentId.'/DocumentApplicationProperties';
+ }
+
+ public function defaultBody()
+ {
+ return [
+ 'DocumentApplicationProperty' => $this->properties,
+ ];
+ }
+
+ public function resolveCacheDriver(): LaravelCacheDriver
+ {
+ return new LaravelCacheDriver(Cache::store(config('laravel-docuware.configurations.cache.driver')));
+ }
+
+ public function cacheExpiryInSeconds(): int
+ {
+ return config('laravel-docuware.configurations.cache.lifetime_in_seconds', 3600);
+ }
+
+ public function createDtoFromResponse(Response $response): mixed
+ {
+ return GetApplicationPropertiesResponse::fromResponse($response);
+ }
+}
diff --git a/src/Requests/Documents/ApplicationProperties/DeleteApplicationProperties.php b/src/Requests/Documents/ApplicationProperties/DeleteApplicationProperties.php
new file mode 100644
index 0000000..8225369
--- /dev/null
+++ b/src/Requests/Documents/ApplicationProperties/DeleteApplicationProperties.php
@@ -0,0 +1,63 @@
+fileCabinetId.'/Documents/'.$this->documentId.'/DocumentApplicationProperties';
+ }
+
+ public function defaultBody()
+ {
+ $props = collect($this->propertyNames)->map(function ($name) {
+ return [
+ 'Name' => $name,
+ 'Value' => null,
+ ];
+ });
+
+ return [
+ 'DocumentApplicationProperty' => $props,
+ ];
+ }
+
+ public function resolveCacheDriver(): LaravelCacheDriver
+ {
+ return new LaravelCacheDriver(Cache::store(config('laravel-docuware.configurations.cache.driver')));
+ }
+
+ public function cacheExpiryInSeconds(): int
+ {
+ return config('laravel-docuware.configurations.cache.lifetime_in_seconds', 3600);
+ }
+
+ public function createDtoFromResponse(Response $response): mixed
+ {
+ return GetApplicationPropertiesResponse::fromResponse($response);
+ }
+}
diff --git a/src/Requests/Documents/ApplicationProperties/UpdateApplicationProperties.php b/src/Requests/Documents/ApplicationProperties/UpdateApplicationProperties.php
new file mode 100644
index 0000000..fc33e59
--- /dev/null
+++ b/src/Requests/Documents/ApplicationProperties/UpdateApplicationProperties.php
@@ -0,0 +1,56 @@
+fileCabinetId.'/Documents/'.$this->documentId.'/DocumentApplicationProperties';
+ }
+
+ public function defaultBody()
+ {
+ return [
+ 'DocumentApplicationProperty' => $this->properties,
+ ];
+ }
+
+ public function resolveCacheDriver(): LaravelCacheDriver
+ {
+ return new LaravelCacheDriver(Cache::store(config('laravel-docuware.configurations.cache.driver')));
+ }
+
+ public function cacheExpiryInSeconds(): int
+ {
+ return config('laravel-docuware.configurations.cache.lifetime_in_seconds', 3600);
+ }
+
+ public function createDtoFromResponse(Response $response): mixed
+ {
+ return GetApplicationPropertiesResponse::fromResponse($response);
+ }
+}
diff --git a/src/Responses/Documents/ApplicationProperties/GetApplicationPropertiesResponse.php b/src/Responses/Documents/ApplicationProperties/GetApplicationPropertiesResponse.php
index de30c79..35d9184 100644
--- a/src/Responses/Documents/ApplicationProperties/GetApplicationPropertiesResponse.php
+++ b/src/Responses/Documents/ApplicationProperties/GetApplicationPropertiesResponse.php
@@ -14,6 +14,6 @@ public static function fromResponse(Response $response): mixed
EnsureValidResponse::from($response);
- return $response->throw()->json();
+ return collect($response->throw()->json('DocumentApplicationProperty'));
}
}
diff --git a/tests/Feature/Requests/Documents/ApplicationProperties/ApplicationPropertiesTest.php b/tests/Feature/Requests/Documents/ApplicationProperties/ApplicationPropertiesTest.php
new file mode 100644
index 0000000..3bfc5cd
--- /dev/null
+++ b/tests/Feature/Requests/Documents/ApplicationProperties/ApplicationPropertiesTest.php
@@ -0,0 +1,87 @@
+connector->send(new CreateDataRecord(
+ $fileCabinetId,
+ '::fake-file-content::',
+ 'example.txt'
+ ))->dto();
+
+ $addProperties = $this->connector->send(new AddApplicationProperties(
+ $fileCabinetId,
+ $document->id,
+ [
+ [
+ 'Name' => 'Key1',
+ 'Value' => 'Key1 Value',
+ ],
+ [
+ 'Name' => 'Key2',
+ 'Value' => 'Key2 Value',
+ ],
+ ],
+ ))->dto();
+
+ expect($addProperties)->toBeInstanceOf(Collection::class)
+ ->and($addProperties->count())->toBe(2)
+ ->and($addProperties->first()['Name'])->toBe('Key1')
+ ->and($addProperties->first()['Value'])->toBe('Key1 Value')
+ ->and($addProperties->last()['Name'])->toBe('Key2')
+ ->and($addProperties->last()['Value'])->toBe('Key2 Value');
+
+ $updateProperties = $this->connector->send(new UpdateApplicationProperties(
+ $fileCabinetId,
+ $document->id,
+ [
+ [
+ 'Name' => 'Key1',
+ 'Value' => 'Key1 Value Updated',
+ ],
+ ],
+ ))->dto()->sortBy('Name');
+
+ expect($updateProperties)->toBeInstanceOf(Collection::class)
+ ->and($updateProperties->count())->toBe(2)
+ ->and($updateProperties->first()['Name'])->toBe('Key1')
+ ->and($updateProperties->first()['Value'])->toBe('Key1 Value Updated')
+ ->and($updateProperties->last()['Name'])->toBe('Key2')
+ ->and($updateProperties->last()['Value'])->toBe('Key2 Value');
+
+ $deleteProperties = $this->connector->send(new DeleteApplicationProperties(
+ $fileCabinetId,
+ $document->id,
+ [
+ 'Key1',
+ ],
+ ))->dto();
+
+ expect($deleteProperties)->toBeInstanceOf(Collection::class)
+ ->and($deleteProperties->count())->toBe(1)
+ ->and($deleteProperties->first()['Name'])->toBe('Key2')
+ ->and($deleteProperties->first()['Value'])->toBe('Key2 Value');
+
+ $properties = $this->connector->send(new GetApplicationProperties(
+ $fileCabinetId,
+ $document->id,
+ ))->dto();
+
+ expect($properties)->toBeInstanceOf(Collection::class)
+ ->and($properties->count())->toBe(1)
+ ->and($properties->first()['Name'])->toBe('Key2')
+ ->and($properties->first()['Value'])->toBe('Key2 Value');
+
+ Event::assertDispatched(DocuWareResponseLog::class);
+})->only();
diff --git a/tests/Feature/Requests/Documents/ApplicationProperties/GetApplicationPropertiesTest.php b/tests/Feature/Requests/Documents/ApplicationProperties/GetApplicationPropertiesTest.php
deleted file mode 100644
index 0192d88..0000000
--- a/tests/Feature/Requests/Documents/ApplicationProperties/GetApplicationPropertiesTest.php
+++ /dev/null
@@ -1,26 +0,0 @@
-connector->send(new CreateDataRecord(
- $fileCabinetId,
- '::fake-file-content::',
- 'example.txt'
- ))->dto();
-
- $properties = $this->connector->send(new GetApplicationProperties(
- $fileCabinetId,
- $document->id,
- ))->dto();
-
- Event::assertDispatched(DocuWareResponseLog::class);
-
-});
From b8cdad0ce441973b28486bdc2d7cb699abc59d6c Mon Sep 17 00:00:00 2001
From: Rhys Lees <43909932+RhysLees@users.noreply.github.com>
Date: Sat, 29 Jun 2024 04:10:07 +0100
Subject: [PATCH 45/54] WIP
---
README.md | 160 +++++++++---------
.../AnnotationsStamps/Annotation.php | 31 ++++
.../AnnotationsStamps/AnnotationItem.php | 118 +++++++++++++
.../AnnotationItemCreated.php | 30 ++++
.../AnnotationsStamps/AnnotationItemField.php | 36 ++++
.../AnnotationItemFieldTypedValue.php | 30 ++++
.../AnnotationsStamps/AnnotationItemFont.php | 45 +++++
.../AnnotationsStamps/AnnotationItemLayer.php | 31 ++++
.../AnnotationItemLayerItem.php | 104 ++++++++++++
.../AnnotationItemLocation.php | 39 +++++
.../AnnotationsStamps/AnnotationPlacement.php | 29 ++++
.../AnnotationsStamps/Annotations.php | 47 +++++
.../AddLineEntryAnnotation.php | 7 +
.../AddRectEntryAnnotation.php | 7 +
.../AddStampWithBestPosition.php | 7 +
.../AddStampWithPosition.php | 48 ++++++
.../AnnotationsStamps/AddTextAnnotation.php | 7 +
.../UpdateTextAnnotation.php | 7 +
.../AddStampWithPositionResponse.php | 24 +++
.../AddLineEntryAnnotationTest.php | 69 ++++++++
.../AddRectEntryAnnotationTest.php | 68 ++++++++
.../AddStampWithBestPositionTest.php | 58 +++++++
.../AddStampWithPositionTest.php | 63 +++++++
.../AddTextAnnotationTest.php | 77 +++++++++
.../UpdateTextAnnotationTest.php | 78 +++++++++
.../ApplicationPropertiesTest.php | 2 +-
26 files changed, 1141 insertions(+), 81 deletions(-)
create mode 100644 src/DTO/Documents/AnnotationsStamps/Annotation.php
create mode 100644 src/DTO/Documents/AnnotationsStamps/AnnotationItem.php
create mode 100644 src/DTO/Documents/AnnotationsStamps/AnnotationItemCreated.php
create mode 100644 src/DTO/Documents/AnnotationsStamps/AnnotationItemField.php
create mode 100644 src/DTO/Documents/AnnotationsStamps/AnnotationItemFieldTypedValue.php
create mode 100644 src/DTO/Documents/AnnotationsStamps/AnnotationItemFont.php
create mode 100644 src/DTO/Documents/AnnotationsStamps/AnnotationItemLayer.php
create mode 100644 src/DTO/Documents/AnnotationsStamps/AnnotationItemLayerItem.php
create mode 100644 src/DTO/Documents/AnnotationsStamps/AnnotationItemLocation.php
create mode 100644 src/DTO/Documents/AnnotationsStamps/AnnotationPlacement.php
create mode 100644 src/DTO/Documents/AnnotationsStamps/Annotations.php
create mode 100644 src/Requests/Documents/AnnotationsStamps/AddLineEntryAnnotation.php
create mode 100644 src/Requests/Documents/AnnotationsStamps/AddRectEntryAnnotation.php
create mode 100644 src/Requests/Documents/AnnotationsStamps/AddStampWithBestPosition.php
create mode 100644 src/Requests/Documents/AnnotationsStamps/AddStampWithPosition.php
create mode 100644 src/Requests/Documents/AnnotationsStamps/AddTextAnnotation.php
create mode 100644 src/Requests/Documents/AnnotationsStamps/UpdateTextAnnotation.php
create mode 100644 src/Responses/Documents/AnnotationsStamps/AddStampWithPositionResponse.php
create mode 100644 tests/Feature/Requests/Documents/AnnotationsStaps/AddLineEntryAnnotationTest.php
create mode 100644 tests/Feature/Requests/Documents/AnnotationsStaps/AddRectEntryAnnotationTest.php
create mode 100644 tests/Feature/Requests/Documents/AnnotationsStaps/AddStampWithBestPositionTest.php
create mode 100644 tests/Feature/Requests/Documents/AnnotationsStaps/AddStampWithPositionTest.php
create mode 100644 tests/Feature/Requests/Documents/AnnotationsStaps/AddTextAnnotationTest.php
create mode 100644 tests/Feature/Requests/Documents/AnnotationsStaps/UpdateTextAnnotationTest.php
diff --git a/README.md b/README.md
index 492e811..28d501e 100644
--- a/README.md
+++ b/README.md
@@ -64,86 +64,86 @@ then optimize the processes that power the core of your business.
Current Support
-| Group | Request | Supported | TODO |
-|-------------------------------------|-------------------------------------------------------------|-----------|------|
-| Authentication/OAuth | 1. Get Responsible Identity Service | ✅ | |
-| Authentication/OAuth | 2. Get Identity Service Configuration | ✅ | |
-| Authentication/OAuth | 3.a Request Token w/ Username & Password | ✅ | |
-| Authentication/OAuth | 3.b Request Token w/ a DocuWare Token | 🕣 | |
-| Authentication/OAuth | 3.c Request Token w/ Username & Password (Trusted User) | 🕣 | |
-| Authentication/OAuth | 3.d.1 Obtain Windows Authorization (On Premises Only) | 🕣 | |
-| Authentication/OAuth | 3.d.2 Request Token /w a Windows Account (On Premises Only) | 🕣 | |
-| General/Organisation | Get Login Token | ✅ | |
-| General/Organisation | Get Organization | ✅ | |
-| General/Organisation | Get All File Cabinets and Document Trays | ✅ | |
-| General/UserManagement | Get Users by ID | ✅ | |
-| General/UserManagement | Get Users of a Role | ✅ | |
-| General/UserManagement | Get Users of a Group | ✅ | |
-| General/UserManagement | Create User | ✅ | |
-| General/UserManagement | Update User | ✅ | |
-| General/UserManagement | Get Groups | ✅ | |
-| General/UserManagement | Get All Groups for a Specific User | ✅ | |
-| General/UserManagement | Add User to a Group | ✅ | |
-| General/UserManagement | Remove User from a Group | ✅ | |
-| General/UserManagement | Get Roles | ✅ | |
-| General/UserManagement | Get All Roles for a Specific User | ✅ | |
-| General/UserManagement | Add User to a Role | ✅ | |
-| General/UserManagement | Remove User from a Role | ✅ | |
-| FileCabinets/General | Get File Cabinet Information | ✅ | |
-| FileCabinets/General | Get Total Number of Documents | ✅ | |
-| FileCabinets/Dialogs | Get All Dialogs | ✅ | |
-| FileCabinets/Dialogs | Get a Specific Dialog | ✅ | |
-| FileCabinets/Dialogs | Get Dialogs of a Specific Type | ✅ | |
-| FileCabinets/Search | Get Documents from a File Cabinet | ✅ | |
-| FileCabinets/Search | Get a Specific Document From a File Cabinet | ✅ | |
-| FileCabinets/Search | Search for Documents in a Single File Cabinet | ✅ | |
-| FileCabinets/Search | Search for Documents in Multiple File Cabinets | ✅ | |
-| FileCabinets/CheckInCheckOut | Check-out & Download a Document | 🕣 | |
-| FileCabinets/CheckInCheckOut | Check-in a Document from the File System | 🕣 | |
-| FileCabinets/CheckInCheckOut | Undo Check-out | 🕣 | |
-| FileCabinets/SelectLists | Get Select Lists & Get Filtered Select Lists | ✅ | |
-| FileCabinets/Upload | Create Data Record | ✅ | |
-| FileCabinets/Upload | Append File(s) to a Data Record | ❌ | - |
-| FileCabinets/Upload | Upload a Single File for a Data Record | ❌ | - |
-| FileCabinets/Upload | Create a Data Record & Upload File | ❌ | - |
-| FileCabinets/Upload | Create Data Record & Upload File Using Store Dialog | ❌ | - |
-| FileCabinets/Upload | Append a Single PDF to a Document | ❌ | - |
-| FileCabinets/Upload | Replace a PDF Document Section | ❌ | - |
-| FileCabinets/BatchIndexFieldsUpdate | Batch Update Index Fields By Id | ❌ | - |
-| FileCabinets/BatchIndexFieldsUpdate | Batch Update Index Fields By Search | ❌ | - |
-| FileCabinets/BatchIndexFieldsUpdate | Batch Append/Update Keyword Fields By Id | ❌ | - |
-| Documents/UpdateIndexValues | Update Index Values | ✅ | |
-| Documents/UpdateIndexValues | Update Table Field Values | ❌ | - ? |
-| Documents/ModifyDocuments | Transfer Document | ✅ | - |
-| Documents/ModifyDocuments | Delete Document | ✅ | |
-| Documents/ClipUnclip&StapleUnstaple | Clip | ✅ | |
-| Documents/ClipUnclip&StapleUnstaple | Unclip | ✅ | |
-| Documents/ClipUnclip&StapleUnstaple | Staple | ✅ | |
-| Documents/ClipUnclip&StapleUnstaple | Unstaple | ✅ | |
-| Documents/AnnotationsStamps | AddStampWithPosition | ❌ | - |
-| Documents/AnnotationsStamps | AddStampWithBestPosition | ❌ | - |
-| Documents/AnnotationsStamps | AddTextAnnotation | ❌ | - |
-| Documents/AnnotationsStamps | AddRectEntryAnnotation | ❌ | - |
-| Documents/AnnotationsStamps | AddLineEntryAnnotation | ❌ | - |
-| Documents/AnnotationsStamps | AddPolyLineEntryAnnotation | ❌ | - |
-| Documents/AnnotationsStamps | DeleteAnnotation | ❌ | - |
-| Documents/AnnotationsStamps | UpdateTextAnnotation | ❌ | - |
-| Documents/AnnotationsStamps | Get Stamps | ❌ | - |
-| Documents/DocumentsTrashBin | Get Documents | ✅ | |
-| Documents/DocumentsTrashBin | Delete Documents | ✅ | |
-| Documents/DocumentsTrashBin | Restore Documents | ✅ | |
-| Documents/ApplicationProperties | Get Application Properties | ✅ | - |
-| Documents/ApplicationProperties | Add Application Properties | ✅ | - |
-| Documents/ApplicationProperties | Delete Application Properties | ✅ | - |
-| Documents/ApplicationProperties | Update Application Properties | ✅ | - |
-| Documents/Sections | Get All Sections from a Document | ✅ | - |
-| Documents/Sections | Get a Specific Section | ✅ | - |
-| Documents/Sections | Delete Section | ✅ | - |
-| Documents/Download | Download Document | ✅ | |
-| Documents/Download | Download Section | ✅ | - |
-| Documents/Download | Download Thumbnail | ✅ | |
-| Workflow | Get Document Workflow History | ✅ | - |
-| Workflow | Get Document Workflow History Steps | ✅ | - |
+| Group | Request | Supported | TODO |
+|-------------------------------------|-------------------------------------------------------------|-----------|----------------|
+| Authentication/OAuth | 1. Get Responsible Identity Service | ✅ | |
+| Authentication/OAuth | 2. Get Identity Service Configuration | ✅ | |
+| Authentication/OAuth | 3.a Request Token w/ Username & Password | ✅ | |
+| Authentication/OAuth | 3.b Request Token w/ a DocuWare Token | 🕣 | |
+| Authentication/OAuth | 3.c Request Token w/ Username & Password (Trusted User) | 🕣 | |
+| Authentication/OAuth | 3.d.1 Obtain Windows Authorization (On Premises Only) | 🕣 | |
+| Authentication/OAuth | 3.d.2 Request Token /w a Windows Account (On Premises Only) | 🕣 | |
+| General/Organisation | Get Login Token | ✅ | |
+| General/Organisation | Get Organization | ✅ | |
+| General/Organisation | Get All File Cabinets and Document Trays | ✅ | |
+| General/UserManagement | Get Users by ID | ✅ | |
+| General/UserManagement | Get Users of a Role | ✅ | |
+| General/UserManagement | Get Users of a Group | ✅ | |
+| General/UserManagement | Create User | ✅ | |
+| General/UserManagement | Update User | ✅ | |
+| General/UserManagement | Get Groups | ✅ | |
+| General/UserManagement | Get All Groups for a Specific User | ✅ | |
+| General/UserManagement | Add User to a Group | ✅ | |
+| General/UserManagement | Remove User from a Group | ✅ | |
+| General/UserManagement | Get Roles | ✅ | |
+| General/UserManagement | Get All Roles for a Specific User | ✅ | |
+| General/UserManagement | Add User to a Role | ✅ | |
+| General/UserManagement | Remove User from a Role | ✅ | |
+| FileCabinets/General | Get File Cabinet Information | ✅ | |
+| FileCabinets/General | Get Total Number of Documents | ✅ | |
+| FileCabinets/Dialogs | Get All Dialogs | ✅ | |
+| FileCabinets/Dialogs | Get a Specific Dialog | ✅ | |
+| FileCabinets/Dialogs | Get Dialogs of a Specific Type | ✅ | |
+| FileCabinets/Search | Get Documents from a File Cabinet | ✅ | |
+| FileCabinets/Search | Get a Specific Document From a File Cabinet | ✅ | |
+| FileCabinets/Search | Search for Documents in a Single File Cabinet | ✅ | |
+| FileCabinets/Search | Search for Documents in Multiple File Cabinets | ✅ | |
+| FileCabinets/CheckInCheckOut | Check-out & Download a Document | 🕣 | |
+| FileCabinets/CheckInCheckOut | Check-in a Document from the File System | 🕣 | |
+| FileCabinets/CheckInCheckOut | Undo Check-out | 🕣 | |
+| FileCabinets/SelectLists | Get Select Lists & Get Filtered Select Lists | ✅ | |
+| FileCabinets/Upload | Create Data Record | ✅ | |
+| FileCabinets/Upload | Append File(s) to a Data Record | ❌ | - |
+| FileCabinets/Upload | Upload a Single File for a Data Record | ❌ | - |
+| FileCabinets/Upload | Create a Data Record & Upload File | ❌ | - |
+| FileCabinets/Upload | Create Data Record & Upload File Using Store Dialog | ❌ | - |
+| FileCabinets/Upload | Append a Single PDF to a Document | ❌ | - |
+| FileCabinets/Upload | Replace a PDF Document Section | ❌ | - |
+| FileCabinets/BatchIndexFieldsUpdate | Batch Update Index Fields By Id | ❌ | - |
+| FileCabinets/BatchIndexFieldsUpdate | Batch Update Index Fields By Search | ❌ | - |
+| FileCabinets/BatchIndexFieldsUpdate | Batch Append/Update Keyword Fields By Id | ❌ | - |
+| Documents/UpdateIndexValues | Update Index Values | ✅ | |
+| Documents/UpdateIndexValues | Update Table Field Values | ❌ | - ? |
+| Documents/ModifyDocuments | Transfer Document | ✅ | - |
+| Documents/ModifyDocuments | Delete Document | ✅ | |
+| Documents/ClipUnclip&StapleUnstaple | Clip | ✅ | |
+| Documents/ClipUnclip&StapleUnstaple | Unclip | ✅ | |
+| Documents/ClipUnclip&StapleUnstaple | Staple | ✅ | |
+| Documents/ClipUnclip&StapleUnstaple | Unstaple | ✅ | |
+| Documents/AnnotationsStamps | AddStampWithPosition | ❌ | - Better Tests |
+| Documents/AnnotationsStamps | AddStampWithBestPosition | ❌ | - Better Tests |
+| Documents/AnnotationsStamps | AddTextAnnotation | ❌ | - Better Tests |
+| Documents/AnnotationsStamps | AddRectEntryAnnotation | ❌ | - Better Tests |
+| Documents/AnnotationsStamps | AddLineEntryAnnotation | ❌ | - Better Tests |
+| Documents/AnnotationsStamps | AddPolyLineEntryAnnotation | ❌ | - |
+| Documents/AnnotationsStamps | DeleteAnnotation | ❌ | - |
+| Documents/AnnotationsStamps | UpdateTextAnnotation | ❌ | - Better Tests |
+| Documents/AnnotationsStamps | Get Stamps | ❌ | - |
+| Documents/DocumentsTrashBin | Get Documents | ✅ | |
+| Documents/DocumentsTrashBin | Delete Documents | ✅ | |
+| Documents/DocumentsTrashBin | Restore Documents | ✅ | |
+| Documents/ApplicationProperties | Get Application Properties | ✅ | - |
+| Documents/ApplicationProperties | Add Application Properties | ✅ | - |
+| Documents/ApplicationProperties | Delete Application Properties | ✅ | - |
+| Documents/ApplicationProperties | Update Application Properties | ✅ | - |
+| Documents/Sections | Get All Sections from a Document | ✅ | - |
+| Documents/Sections | Get a Specific Section | ✅ | - |
+| Documents/Sections | Delete Section | ✅ | - |
+| Documents/Download | Download Document | ✅ | |
+| Documents/Download | Download Section | ✅ | - |
+| Documents/Download | Download Thumbnail | ✅ | |
+| Workflow | Get Document Workflow History | ✅ | - |
+| Workflow | Get Document Workflow History Steps | ✅ | - |
diff --git a/src/DTO/Documents/AnnotationsStamps/Annotation.php b/src/DTO/Documents/AnnotationsStamps/Annotation.php
new file mode 100644
index 0000000..94d33db
--- /dev/null
+++ b/src/DTO/Documents/AnnotationsStamps/Annotation.php
@@ -0,0 +1,31 @@
+map(fn (array $item) => AnnotationItem::fromData($item)) : null,
+ id: Arr::get($data, 'Id'),
+ );
+ }
+
+ public function __construct(
+ public ?Collection $items,
+ public int $id,
+ ) {
+ }
+
+ public function values(): array
+ {
+ return [
+ 'Items' => $this->items->values(),
+ 'Id' => $this->id,
+ ];
+ }
+}
diff --git a/src/DTO/Documents/AnnotationsStamps/AnnotationItem.php b/src/DTO/Documents/AnnotationsStamps/AnnotationItem.php
new file mode 100644
index 0000000..fa329ab
--- /dev/null
+++ b/src/DTO/Documents/AnnotationsStamps/AnnotationItem.php
@@ -0,0 +1,118 @@
+map(fn (array $layer) => AnnotationItemLayer::fromData($layer));
+ } else {
+ $layer = Arr::get($data, 'Layer');
+ }
+ }
+
+ return new self(
+ type: Arr::get($data, '$type'),
+ layer: $layer ?? null,
+ field: collect(Arr::get($data, 'Field'))
+ ->map(fn (array $field) => AnnotationItemField::fromData($field)),
+ password: Arr::get($data, 'Password'),
+ font: Arr::has($data, 'Font') ? AnnotationItemFont::fromData(Arr::get($data, 'Font')) : null,
+ location: Arr::has($data, 'Location') ? AnnotationItemLocation::fromData(Arr::get($data, 'Location')) : null,
+ headFont: Arr::has($data, 'HeadFont') ? AnnotationItemFont::fromData(Arr::get($data, 'HeadFont')) : null,
+ signature: Arr::get($data, 'Signature'),
+ userName: Arr::get($data, 'UserName'),
+ visible: Arr::get($data, 'Visible'),
+ frame: Arr::get($data, 'Frame'),
+ showUser: Arr::get($data, 'ShowUser'),
+ showDate: Arr::get($data, 'ShowDate'),
+ showTime: Arr::get($data, 'ShowTime'),
+ created: Arr::has($data, 'Created') ? AnnotationItemCreated::fromData(Arr::get($data, 'Created')) : null,
+ color: Arr::get($data, 'Color'),
+ rotation: Arr::get($data, 'Rotation'),
+ transparent: Arr::get($data, 'Transparent'),
+ strokeWidth: Arr::get($data, 'StrokeWidth'),
+ stampId: Arr::get($data, 'StampId') ?? Arr::get($data, 'Id'),
+ );
+ }
+
+ public function __construct(
+ public string $type,
+ public null|Collection|int $layer = null,
+ public ?Collection $field = null,
+ public ?string $password = null,
+ public ?AnnotationItemFont $font = null,
+ public ?AnnotationItemLocation $location = null,
+ public ?AnnotationItemFont $headFont = null,
+ public ?string $signature = null,
+ public ?string $userName = null,
+ public ?bool $visible = null,
+ public ?bool $frame = null,
+ public ?bool $showUser = null,
+ public ?bool $showDate = null,
+ public ?bool $showTime = null,
+ public ?AnnotationItemCreated $created = null,
+ public ?string $color = null,
+ public ?int $rotation = null,
+ public ?bool $transparent = null,
+ public ?int $strokeWidth = null,
+ public ?string $stampId = null,
+ ) {
+ }
+
+ public function values(): array
+ {
+ if ($this->layer instanceof Collection) {
+ $layer = $this->layer->map(fn (AnnotationItemLayer $layer) => $layer->values())->toArray();
+ } else {
+ $layer = $this->layer;
+ }
+
+ $values = [
+ '$type' => $this->type,
+ 'Layer' => $layer,
+ 'Field' => $this->field?->map(fn (AnnotationItemField $field) => $field->values())->toArray(),
+ 'Password' => $this->password,
+ 'Font' => $this->font,
+ 'Location' => $this->location?->values(),
+ 'HeadFont' => $this->headFont,
+ 'StampId' => $this->stampId,
+ ];
+
+ if (is_null($values['Field'])) {
+ unset($values['Field']);
+ }
+
+ if (is_null($values['Password'])) {
+ unset($values['Password']);
+ }
+
+ if (is_null($values['Font'])) {
+ unset($values['Font']);
+ }
+
+ if (is_null($values['Location'])) {
+ unset($values['Location']);
+ }
+
+ if (is_null($values['HeadFont'])) {
+ unset($values['HeadFont']);
+ }
+
+ if (is_null($values['StampId'])) {
+ unset($values['StampId']);
+ }
+
+ if (is_null($values['Layer'])) {
+ unset($values['Layer']);
+ }
+
+ return $values;
+ }
+}
diff --git a/src/DTO/Documents/AnnotationsStamps/AnnotationItemCreated.php b/src/DTO/Documents/AnnotationsStamps/AnnotationItemCreated.php
new file mode 100644
index 0000000..5e4e7dd
--- /dev/null
+++ b/src/DTO/Documents/AnnotationsStamps/AnnotationItemCreated.php
@@ -0,0 +1,30 @@
+ $this->user,
+ 'Time' => $this->time,
+ ];
+ }
+}
diff --git a/src/DTO/Documents/AnnotationsStamps/AnnotationItemField.php b/src/DTO/Documents/AnnotationsStamps/AnnotationItemField.php
new file mode 100644
index 0000000..2d7c180
--- /dev/null
+++ b/src/DTO/Documents/AnnotationsStamps/AnnotationItemField.php
@@ -0,0 +1,36 @@
+ $this->name,
+ 'TypedValue' => $this->typedValue->values(),
+ 'Value' => $this->value,
+ 'TextAsString' => $this->textAsString,
+ ];
+ }
+}
diff --git a/src/DTO/Documents/AnnotationsStamps/AnnotationItemFieldTypedValue.php b/src/DTO/Documents/AnnotationsStamps/AnnotationItemFieldTypedValue.php
new file mode 100644
index 0000000..e2a4360
--- /dev/null
+++ b/src/DTO/Documents/AnnotationsStamps/AnnotationItemFieldTypedValue.php
@@ -0,0 +1,30 @@
+ $this->item,
+ 'ItemElementName' => $this->itemElementName,
+ ];
+ }
+}
diff --git a/src/DTO/Documents/AnnotationsStamps/AnnotationItemFont.php b/src/DTO/Documents/AnnotationsStamps/AnnotationItemFont.php
new file mode 100644
index 0000000..c385607
--- /dev/null
+++ b/src/DTO/Documents/AnnotationsStamps/AnnotationItemFont.php
@@ -0,0 +1,45 @@
+ $this->fontName,
+ 'Bold' => $this->bold,
+ 'Italic' => $this->italic,
+ 'Underlined' => $this->underlined,
+ 'StrikeThrough' => $this->strikeThrough,
+ 'FontSize' => $this->fontSize,
+ 'Spacing' => $this->spacing,
+ ];
+ }
+}
diff --git a/src/DTO/Documents/AnnotationsStamps/AnnotationItemLayer.php b/src/DTO/Documents/AnnotationsStamps/AnnotationItemLayer.php
new file mode 100644
index 0000000..f1cc1e0
--- /dev/null
+++ b/src/DTO/Documents/AnnotationsStamps/AnnotationItemLayer.php
@@ -0,0 +1,31 @@
+map(fn (array $layer) => AnnotationItemLayerItem::fromData($layer)),
+ );
+ }
+
+ public function __construct(
+ public string $id,
+ public Collection $items,
+ ) {
+ }
+
+ public function values(): array
+ {
+ return [
+ 'Id' => $this->id,
+ 'Items' => $this->items->map(fn (AnnotationItemLayerItem $item) => $item->values())->toArray(),
+ ];
+ }
+}
diff --git a/src/DTO/Documents/AnnotationsStamps/AnnotationItemLayerItem.php b/src/DTO/Documents/AnnotationsStamps/AnnotationItemLayerItem.php
new file mode 100644
index 0000000..e64eb4c
--- /dev/null
+++ b/src/DTO/Documents/AnnotationsStamps/AnnotationItemLayerItem.php
@@ -0,0 +1,104 @@
+ $this->type,
+ 'Font' => $this->font?->values(),
+ 'Value' => $this->value,
+ 'Location' => $this->location?->values(),
+ 'Color' => $this->color,
+ 'Rotation' => $this->rotation,
+ 'Transparent' => $this->transparent,
+ 'StrokeWidth' => $this->strokeWidth,
+ 'Filled' => $this->filled,
+ 'Ellipse' => $this->ellipse,
+ 'From' => $this->from?->values(),
+ 'To' => $this->to?->values(),
+ 'Arrow' => $this->arrow,
+ 'Id' => $this->id,
+ ];
+
+ if (is_null($values['Location'])) {
+ unset($values['Location']);
+ }
+
+ if (is_null($values['Font'])) {
+ unset($values['Font']);
+ }
+
+ if (is_null($values['Value'])) {
+ unset($values['Value']);
+ }
+
+ if (is_null($values['Filled'])) {
+ unset($values['Filled']);
+ }
+
+ if (is_null($values['Ellipse'])) {
+ unset($values['Ellipse']);
+ }
+
+ if (is_null($values['From'])) {
+ unset($values['From']);
+ }
+
+ if (is_null($values['To'])) {
+ unset($values['To']);
+ }
+
+ if (is_null($values['Arrow'])) {
+ unset($values['Arrow']);
+ }
+
+ if (is_null($values['Id'])) {
+ unset($values['Id']);
+ }
+
+ return $values;
+ }
+}
diff --git a/src/DTO/Documents/AnnotationsStamps/AnnotationItemLocation.php b/src/DTO/Documents/AnnotationsStamps/AnnotationItemLocation.php
new file mode 100644
index 0000000..d22589c
--- /dev/null
+++ b/src/DTO/Documents/AnnotationsStamps/AnnotationItemLocation.php
@@ -0,0 +1,39 @@
+ $this->x,
+ 'Y' => $this->y,
+ 'Left' => $this->left,
+ 'Top' => $this->top,
+ 'Width' => $this->width,
+ 'Height' => $this->height,
+ ];
+ }
+}
diff --git a/src/DTO/Documents/AnnotationsStamps/AnnotationPlacement.php b/src/DTO/Documents/AnnotationsStamps/AnnotationPlacement.php
new file mode 100644
index 0000000..738840a
--- /dev/null
+++ b/src/DTO/Documents/AnnotationsStamps/AnnotationPlacement.php
@@ -0,0 +1,29 @@
+map(fn (array $item) => AnnotationItem::fromData($item)),
+ );
+ }
+
+ public function __construct(
+ public Collection $items,
+ ) {
+ }
+
+ public function values(): array
+ {
+ return [
+ 'Items' => $this->items->map(fn (AnnotationItem|AnnotationItemLayerItem $item) => $item->values())->toArray(),
+ ];
+ }
+}
diff --git a/src/DTO/Documents/AnnotationsStamps/Annotations.php b/src/DTO/Documents/AnnotationsStamps/Annotations.php
new file mode 100644
index 0000000..dfd5ecd
--- /dev/null
+++ b/src/DTO/Documents/AnnotationsStamps/Annotations.php
@@ -0,0 +1,47 @@
+map(fn ($item) => Annotation::fromData($item)) : null,
+ );
+ }
+
+ public function __construct(
+ public ?int $pageNumber,
+ public ?int $sectionNumber,
+ public ?AnnotationPlacement $annotationsPlacement = null,
+ public ?Collection $annotation = null,
+ ) {
+ }
+
+ public function values(): array
+ {
+ $values = [
+ 'PageNumber' => $this->pageNumber,
+ 'SectionNumber' => $this->sectionNumber,
+ 'AnnotationsPlacement' => $this->annotationsPlacement?->values(),
+ 'Annotation' => $this->annotation?->map(fn (Annotation $item) => $item->values())->toArray(),
+ ];
+
+ if (is_null($values['AnnotationsPlacement'])) {
+ unset($values['AnnotationsPlacement']);
+ }
+
+ if (is_null($values['Annotation'])) {
+ unset($values['Annotation']);
+ }
+
+ return $values;
+ }
+}
diff --git a/src/Requests/Documents/AnnotationsStamps/AddLineEntryAnnotation.php b/src/Requests/Documents/AnnotationsStamps/AddLineEntryAnnotation.php
new file mode 100644
index 0000000..9be3680
--- /dev/null
+++ b/src/Requests/Documents/AnnotationsStamps/AddLineEntryAnnotation.php
@@ -0,0 +1,7 @@
+fileCabinetId.'/Documents/'.$this->documentId.'/Annotation';
+ }
+
+ public function defaultBody(): array
+ {
+ ray($this->annotations->values());
+
+ return [
+ 'Annotations' => [
+ $this->annotations->values(),
+ ],
+ ];
+ }
+
+ public function createDtoFromResponse(Response $response): Collection|Enumerable
+ {
+ return AddStampWithPositionResponse::fromResponse($response);
+ }
+}
diff --git a/src/Requests/Documents/AnnotationsStamps/AddTextAnnotation.php b/src/Requests/Documents/AnnotationsStamps/AddTextAnnotation.php
new file mode 100644
index 0000000..83dd4dc
--- /dev/null
+++ b/src/Requests/Documents/AnnotationsStamps/AddTextAnnotation.php
@@ -0,0 +1,7 @@
+throw()->json('Annotations');
+
+ return collect($data)->map(fn (array $item) => Annotations::fromData($item));
+ }
+}
diff --git a/tests/Feature/Requests/Documents/AnnotationsStaps/AddLineEntryAnnotationTest.php b/tests/Feature/Requests/Documents/AnnotationsStaps/AddLineEntryAnnotationTest.php
new file mode 100644
index 0000000..9511034
--- /dev/null
+++ b/tests/Feature/Requests/Documents/AnnotationsStaps/AddLineEntryAnnotationTest.php
@@ -0,0 +1,69 @@
+connector, $fileCabinetId);
+
+ [$document, $document2] = uploadFiles($this->connector, $fileCabinetId, $path);
+
+ $annotations = new Annotations(
+ pageNumber: 0,
+ sectionNumber: 0,
+ annotationsPlacement: new AnnotationPlacement(
+ items: collect([
+ new AnnotationItem(
+ type: 'Annotation',
+ layer: collect([
+ new AnnotationItemLayer(
+ id: 1,
+ items: collect([
+ new AnnotationItemLayerItem(
+ type: 'LineEntry',
+ color: 'Cyan',
+ rotation: 0,
+ transparent: false,
+ strokeWidth: 50,
+ arrow: false,
+ from: new AnnotationItemLocation(
+ x: 100,
+ y: 100,
+ ),
+ to: new AnnotationItemLocation(
+ x: 200,
+ y: 200,
+ ),
+ ),
+ ]),
+ ),
+ ]),
+ ),
+ ]),
+ ),
+ );
+
+ $stamp = $this->connector->send(new AddLineEntryAnnotation(
+ $fileCabinetId,
+ $document->id,
+ $annotations,
+ ))->dto();
+
+ expect($stamp)->toBeInstanceOf(Collection::class)
+ ->and($stamp->first())->toBeInstanceOf(Annotations::class);
+
+ Event::assertDispatched(DocuWareResponseLog::class);
+})->group('annotation')->only();
diff --git a/tests/Feature/Requests/Documents/AnnotationsStaps/AddRectEntryAnnotationTest.php b/tests/Feature/Requests/Documents/AnnotationsStaps/AddRectEntryAnnotationTest.php
new file mode 100644
index 0000000..486adbd
--- /dev/null
+++ b/tests/Feature/Requests/Documents/AnnotationsStaps/AddRectEntryAnnotationTest.php
@@ -0,0 +1,68 @@
+connector, $fileCabinetId);
+
+ [$document, $document2] = uploadFiles($this->connector, $fileCabinetId, $path);
+
+ $annotations = new Annotations(
+ pageNumber: 0,
+ sectionNumber: 0,
+ annotationsPlacement: new AnnotationPlacement(
+ items: collect([
+ new AnnotationItem(
+ type: 'Annotation',
+ layer: collect([
+ new AnnotationItemLayer(
+ id: 1,
+ items: collect([
+ new AnnotationItemLayerItem(
+ type: 'RectEntry',
+ color: 'Bisque',
+ rotation: 0,
+ transparent: false,
+ strokeWidth: 50,
+ filled: true,
+ ellipse: false,
+ location: new AnnotationItemLocation(
+ left: 100,
+ top: 100,
+ width: 1500,
+ height: 100,
+ ),
+ ),
+ ]),
+ ),
+ ]),
+ ),
+ ]),
+ ),
+ );
+
+ $stamp = $this->connector->send(new AddRectEntryAnnotation(
+ $fileCabinetId,
+ $document->id,
+ $annotations,
+ ))->dto();
+
+ expect($stamp)->toBeInstanceOf(Collection::class)
+ ->and($stamp->first())->toBeInstanceOf(Annotations::class);
+
+ Event::assertDispatched(DocuWareResponseLog::class);
+})->group('annotation')->only();
diff --git a/tests/Feature/Requests/Documents/AnnotationsStaps/AddStampWithBestPositionTest.php b/tests/Feature/Requests/Documents/AnnotationsStaps/AddStampWithBestPositionTest.php
new file mode 100644
index 0000000..3e615f3
--- /dev/null
+++ b/tests/Feature/Requests/Documents/AnnotationsStaps/AddStampWithBestPositionTest.php
@@ -0,0 +1,58 @@
+connector, $fileCabinetId);
+
+ [$document, $document2] = uploadFiles($this->connector, $fileCabinetId, $path);
+
+ $annotations = new Annotations(
+ pageNumber: 0,
+ sectionNumber: 0,
+ annotationsPlacement: new AnnotationPlacement(
+ items: collect([
+ new AnnotationItem(
+ type: 'StampPlacement',
+ field: collect([
+ new AnnotationItemField(
+ name: '<#1>',
+ typedValue: new AnnotationItemFieldTypedValue(
+ item: 'Text',
+ itemElementName: 'String',
+ ),
+ value: 'Test',
+ textAsString: 'Test',
+ ),
+ ]),
+ layer: 1,
+ stampId: 'e1b3f6cc-ed69-4af2-afa5-6d990c0144c5',
+ ),
+ ]),
+ ),
+ );
+
+ $stamp = $this->connector->send(new AddStampWithBestPosition(
+ $fileCabinetId,
+ $document->id,
+ $annotations,
+ ))->dto();
+
+ expect($stamp)->toBeInstanceOf(Collection::class)
+ ->and($stamp->first())->toBeInstanceOf(Annotations::class);
+
+ Event::assertDispatched(DocuWareResponseLog::class);
+})->group('stamp');
diff --git a/tests/Feature/Requests/Documents/AnnotationsStaps/AddStampWithPositionTest.php b/tests/Feature/Requests/Documents/AnnotationsStaps/AddStampWithPositionTest.php
new file mode 100644
index 0000000..dfbf8e7
--- /dev/null
+++ b/tests/Feature/Requests/Documents/AnnotationsStaps/AddStampWithPositionTest.php
@@ -0,0 +1,63 @@
+connector, $fileCabinetId);
+
+ [$document, $document2] = uploadFiles($this->connector, $fileCabinetId, $path);
+
+ $annotations = new Annotations(
+ pageNumber: 0,
+ sectionNumber: 0,
+ annotationsPlacement: new AnnotationPlacement(
+ items: collect([
+ new AnnotationItem(
+ type: 'StampPlacement',
+ field: collect([
+ new AnnotationItemField(
+ name: '<#1>',
+ typedValue: new AnnotationItemFieldTypedValue(
+ item: 'Text',
+ itemElementName: 'String',
+ ),
+ value: 'Test',
+ textAsString: 'Test',
+ ),
+ ]),
+ layer: 1,
+ location: new AnnotationItemLocation(
+ x: 0.5,
+ y: 0.5,
+ ),
+ stampId: 'e1b3f6cc-ed69-4af2-afa5-6d990c0144c5',
+ ),
+ ]),
+ ),
+ );
+
+ $stamp = $this->connector->send(new AddStampWithPosition(
+ $fileCabinetId,
+ $document->id,
+ $annotations,
+ ))->dto();
+
+ expect($stamp)->toBeInstanceOf(Collection::class)
+ ->and($stamp->first())->toBeInstanceOf(Annotations::class);
+
+ Event::assertDispatched(DocuWareResponseLog::class);
+})->group('stamp');
diff --git a/tests/Feature/Requests/Documents/AnnotationsStaps/AddTextAnnotationTest.php b/tests/Feature/Requests/Documents/AnnotationsStaps/AddTextAnnotationTest.php
new file mode 100644
index 0000000..ef25220
--- /dev/null
+++ b/tests/Feature/Requests/Documents/AnnotationsStaps/AddTextAnnotationTest.php
@@ -0,0 +1,77 @@
+connector, $fileCabinetId);
+
+ [$document, $document2] = uploadFiles($this->connector, $fileCabinetId, $path);
+
+ $annotations = new Annotations(
+ pageNumber: 0,
+ sectionNumber: 0,
+ annotationsPlacement: new AnnotationPlacement(
+ items: collect([
+ new AnnotationItem(
+ type: 'Annotation',
+ layer: collect([
+ new AnnotationItemLayer(
+ id: 1,
+ items: collect([
+ new AnnotationItemLayerItem(
+ type: 'TextEntry',
+ color: 'Black',
+ rotation: 0,
+ transparent: false,
+ strokeWidth: 50,
+ value: 'Test',
+ font: new AnnotationItemFont(
+ fontName: 'Arial',
+ bold: false,
+ italic: false,
+ underlined: false,
+ strikeThrough: false,
+ fontSize: 12,
+ spacing: 0,
+ ),
+ location: new AnnotationItemLocation(
+ left: 100,
+ top: 100,
+ width: 1500,
+ height: 100,
+ ),
+ ),
+ ]),
+ ),
+ ]),
+ ),
+ ]),
+ ),
+ );
+
+ $stamp = $this->connector->send(new AddTextAnnotation(
+ $fileCabinetId,
+ $document->id,
+ $annotations,
+ ))->dto();
+
+ expect($stamp)->toBeInstanceOf(Collection::class)
+ ->and($stamp->first())->toBeInstanceOf(Annotations::class);
+
+ Event::assertDispatched(DocuWareResponseLog::class);
+})->group('annotation')->only();
diff --git a/tests/Feature/Requests/Documents/AnnotationsStaps/UpdateTextAnnotationTest.php b/tests/Feature/Requests/Documents/AnnotationsStaps/UpdateTextAnnotationTest.php
new file mode 100644
index 0000000..8393ae7
--- /dev/null
+++ b/tests/Feature/Requests/Documents/AnnotationsStaps/UpdateTextAnnotationTest.php
@@ -0,0 +1,78 @@
+connector, $fileCabinetId);
+
+ [$document, $document2] = uploadFiles($this->connector, $fileCabinetId, $path);
+
+ $annotations = new Annotations(
+ pageNumber: 0,
+ sectionNumber: 0,
+ annotationsPlacement: new AnnotationPlacement(
+ items: collect([
+ new AnnotationItem(
+ type: 'Annotation',
+ layer: collect([
+ new AnnotationItemLayer(
+ id: 1,
+ items: collect([
+ new AnnotationItemLayerItem(
+ type: 'TextEntry',
+ color: 'Black',
+ rotation: 0,
+ transparent: false,
+ strokeWidth: 50,
+ value: 'Test',
+ font: new AnnotationItemFont(
+ fontName: 'Arial',
+ bold: false,
+ italic: false,
+ underlined: false,
+ strikeThrough: false,
+ fontSize: 12,
+ spacing: 0,
+ ),
+ location: new AnnotationItemLocation(
+ left: 100,
+ top: 100,
+ width: 1500,
+ height: 100,
+ ),
+ id: 1,
+ ),
+ ]),
+ ),
+ ]),
+ ),
+ ]),
+ ),
+ );
+
+ $stamp = $this->connector->send(new AddTextAnnotation(
+ $fileCabinetId,
+ $document->id,
+ $annotations,
+ ))->dto();
+
+ expect($stamp)->toBeInstanceOf(Collection::class)
+ ->and($stamp->first())->toBeInstanceOf(Annotations::class);
+
+ Event::assertDispatched(DocuWareResponseLog::class);
+})->group('annotation')->only();
diff --git a/tests/Feature/Requests/Documents/ApplicationProperties/ApplicationPropertiesTest.php b/tests/Feature/Requests/Documents/ApplicationProperties/ApplicationPropertiesTest.php
index 3bfc5cd..3eb84b9 100644
--- a/tests/Feature/Requests/Documents/ApplicationProperties/ApplicationPropertiesTest.php
+++ b/tests/Feature/Requests/Documents/ApplicationProperties/ApplicationPropertiesTest.php
@@ -84,4 +84,4 @@
->and($properties->first()['Value'])->toBe('Key2 Value');
Event::assertDispatched(DocuWareResponseLog::class);
-})->only();
+})->group('application-properties');
From 4ead305b3f23b3d14585f03065c76ce4f8ebd7c4 Mon Sep 17 00:00:00 2001
From: RhysLees
Date: Sat, 29 Jun 2024 03:10:47 +0000
Subject: [PATCH 46/54] Fix styling
---
src/Connectors/DocuWareConnector.php | 3 +--
src/DTO/Authentication/OAuth/IdentityServiceConfiguration.php | 3 +--
src/DTO/Authentication/OAuth/RequestToken.php | 3 +--
src/DTO/Authentication/OAuth/ResponsibleIdentityService.php | 3 +--
src/DTO/Documents/AnnotationsStamps/Annotation.php | 3 +--
src/DTO/Documents/AnnotationsStamps/AnnotationItem.php | 3 +--
src/DTO/Documents/AnnotationsStamps/AnnotationItemCreated.php | 3 +--
src/DTO/Documents/AnnotationsStamps/AnnotationItemField.php | 3 +--
.../AnnotationsStamps/AnnotationItemFieldTypedValue.php | 3 +--
src/DTO/Documents/AnnotationsStamps/AnnotationItemFont.php | 3 +--
src/DTO/Documents/AnnotationsStamps/AnnotationItemLayer.php | 3 +--
.../Documents/AnnotationsStamps/AnnotationItemLayerItem.php | 3 +--
.../Documents/AnnotationsStamps/AnnotationItemLocation.php | 3 +--
src/DTO/Documents/AnnotationsStamps/AnnotationPlacement.php | 3 +--
src/DTO/Documents/AnnotationsStamps/Annotations.php | 3 +--
src/DTO/Documents/Document.php | 3 +--
src/DTO/Documents/DocumentField.php | 3 +--
src/DTO/Documents/DocumentIndex/IndexDateDTO.php | 4 +---
src/DTO/Documents/DocumentIndex/IndexDateTimeDTO.php | 4 +---
src/DTO/Documents/DocumentIndex/IndexDecimalDTO.php | 4 +---
src/DTO/Documents/DocumentIndex/IndexNumericDTO.php | 4 +---
src/DTO/Documents/DocumentIndex/IndexTableDTO.php | 4 +---
src/DTO/Documents/DocumentIndex/IndexTextDTO.php | 4 +---
src/DTO/Documents/DocumentPaginator.php | 3 +--
src/DTO/Documents/DocumentThumbnail.php | 3 +--
src/DTO/Documents/DocumentsTrashBin/DeleteDocuments.php | 3 +--
src/DTO/Documents/DocumentsTrashBin/RestoreDocuments.php | 3 +--
src/DTO/Documents/Field.php | 3 +--
src/DTO/Documents/TableRow.php | 3 +--
src/DTO/Documents/TrashDocumentPaginator.php | 3 +--
src/DTO/ErrorBag.php | 3 +--
src/DTO/FileCabinets/Dialog.php | 3 +--
src/DTO/FileCabinets/General/FileCabinetInformation.php | 3 +--
src/DTO/General/Organization/FileCabinet.php | 3 +--
src/DTO/General/Organization/Organization.php | 3 +--
src/DTO/General/Organization/OrganizationIndex.php | 3 +--
src/DTO/General/UserManagement/CreateUpdateUser/User.php | 3 +--
src/DTO/General/UserManagement/GetModifyGroups/Group.php | 3 +--
src/DTO/General/UserManagement/GetModifyRoles/Role.php | 3 +--
src/DTO/General/UserManagement/GetUsers/OutOfOffice.php | 3 +--
src/DTO/General/UserManagement/GetUsers/RegionalSettings.php | 3 +--
src/DTO/General/UserManagement/GetUsers/User.php | 3 +--
src/DTO/Section.php | 3 +--
src/DTO/SuggestionField.php | 3 +--
src/DTO/Workflow/HistoryStep.php | 3 +--
src/DTO/Workflow/InstanceHistory.php | 3 +--
src/Events/DocuWareOAuthLog.php | 3 +--
src/Events/DocuWareResponseLog.php | 3 +--
.../Authentication/OAuth/GetIdentityServiceConfiguration.php | 3 +--
.../Authentication/OAuth/RequestTokenWithCredentials.php | 3 +--
.../OAuth/RequestTokenWithCredentialsTrustedUser.php | 3 +--
.../Documents/AnnotationsStamps/AddLineEntryAnnotation.php | 4 +---
.../Documents/AnnotationsStamps/AddRectEntryAnnotation.php | 4 +---
.../Documents/AnnotationsStamps/AddStampWithBestPosition.php | 4 +---
.../Documents/AnnotationsStamps/AddStampWithPosition.php | 3 +--
.../Documents/AnnotationsStamps/AddTextAnnotation.php | 4 +---
.../Documents/AnnotationsStamps/UpdateTextAnnotation.php | 4 +---
.../ApplicationProperties/AddApplicationProperties.php | 3 +--
.../ApplicationProperties/DeleteApplicationProperties.php | 3 +--
.../ApplicationProperties/GetApplicationProperties.php | 3 +--
.../ApplicationProperties/UpdateApplicationProperties.php | 3 +--
src/Requests/Documents/ClipUnclipStapleUnstaple/Clip.php | 3 +--
src/Requests/Documents/ClipUnclipStapleUnstaple/Staple.php | 3 +--
src/Requests/Documents/ClipUnclipStapleUnstaple/Unclip.php | 3 +--
src/Requests/Documents/ClipUnclipStapleUnstaple/Unstaple.php | 3 +--
src/Requests/Documents/DocumentsTrashBin/DeleteDocuments.php | 3 +--
src/Requests/Documents/DocumentsTrashBin/GetDocuments.php | 3 +--
src/Requests/Documents/DocumentsTrashBin/RestoreDocuments.php | 3 +--
src/Requests/Documents/Download/DownloadDocument.php | 3 +--
src/Requests/Documents/Download/DownloadSection.php | 3 +--
src/Requests/Documents/Download/DownloadThumbnail.php | 3 +--
src/Requests/Documents/GetDocumentPreviewRequest.php | 3 +--
src/Requests/Documents/ModifyDocuments/DeleteDocument.php | 3 +--
src/Requests/Documents/ModifyDocuments/TransferDocument.php | 3 +--
src/Requests/Documents/Sections/DeleteSection.php | 3 +--
src/Requests/Documents/Sections/GetASpecificSection.php | 3 +--
.../Documents/Sections/GetAllSectionsFromADocument.php | 3 +--
.../Documents/UpdateIndexValues/UpdateIndexValues.php | 3 +--
src/Requests/Fields/GetFieldsRequest.php | 3 +--
src/Requests/FileCabinets/Dialogs/GetASpecificDialog.php | 3 +--
src/Requests/FileCabinets/Dialogs/GetAllDialogs.php | 3 +--
.../FileCabinets/Dialogs/GetDialogsOfASpecificType.php | 3 +--
.../FileCabinets/General/GetFileCabinetInformation.php | 3 +--
.../FileCabinets/General/GetTotalNumberOfDocuments.php | 3 +--
.../Search/GetASpecificDocumentFromAFileCabinet.php | 3 +--
.../FileCabinets/Search/GetDocumentsFromAFileCabinet.php | 3 +--
.../FileCabinets/SelectLists/GetFilteredSelectLists.php | 3 +--
src/Requests/FileCabinets/SelectLists/GetSelectLists.php | 3 +--
src/Requests/FileCabinets/Upload/CreateDataRecord.php | 3 +--
.../Organization/GetAllFileCabinetsAndDocumentTrays.php | 3 +--
src/Requests/General/Organization/GetLoginToken.php | 3 +--
.../General/UserManagement/CreateUpdateUsers/CreateUser.php | 3 +--
.../General/UserManagement/CreateUpdateUsers/UpdateUser.php | 3 +--
.../UserManagement/GetModifyGroups/AddUserToAGroup.php | 3 +--
.../GetModifyGroups/GetAllGroupsForASpecificUser.php | 3 +--
.../General/UserManagement/GetModifyGroups/GetGroups.php | 3 +--
.../UserManagement/GetModifyGroups/RemoveUserFromAGroup.php | 3 +--
.../General/UserManagement/GetModifyRoles/AddUserToARole.php | 3 +--
.../GetModifyRoles/GetAllRolesForASpecificUser.php | 3 +--
.../General/UserManagement/GetModifyRoles/GetRoles.php | 3 +--
.../UserManagement/GetModifyRoles/RemoveUserFromARole.php | 3 +--
src/Requests/General/UserManagement/GetUsers/GetUserById.php | 3 +--
src/Requests/General/UserManagement/GetUsers/GetUsers.php | 3 +--
.../General/UserManagement/GetUsers/GetUsersOfAGroup.php | 3 +--
.../General/UserManagement/GetUsers/GetUsersOfARole.php | 3 +--
src/Requests/Search/GetSearchRequest.php | 3 +--
src/Requests/Workflow/GetDocumentWorkflowHistory.php | 3 +--
src/Requests/Workflow/GetDocumentWorkflowHistorySteps.php | 3 +--
108 files changed, 108 insertions(+), 227 deletions(-)
diff --git a/src/Connectors/DocuWareConnector.php b/src/Connectors/DocuWareConnector.php
index 0ca9b4e..f64acb3 100644
--- a/src/Connectors/DocuWareConnector.php
+++ b/src/Connectors/DocuWareConnector.php
@@ -21,8 +21,7 @@ class DocuWareConnector extends Connector
{
public function __construct(
public ConfigWithCredentials|ConfigWithCredentialsTrustedUser $configuration
- ) {
- }
+ ) {}
/**
* @throws \Exception
diff --git a/src/DTO/Authentication/OAuth/IdentityServiceConfiguration.php b/src/DTO/Authentication/OAuth/IdentityServiceConfiguration.php
index 6c219a8..503bd7f 100644
--- a/src/DTO/Authentication/OAuth/IdentityServiceConfiguration.php
+++ b/src/DTO/Authentication/OAuth/IdentityServiceConfiguration.php
@@ -81,6 +81,5 @@ public function __construct(
public bool $backchannelUserCodeParameterSupported,
public array $dpopSigningAlgValuesSupported,
public string $windowsAuthEndpoint,
- ) {
- }
+ ) {}
}
diff --git a/src/DTO/Authentication/OAuth/RequestToken.php b/src/DTO/Authentication/OAuth/RequestToken.php
index 1225e0d..1c8d84c 100644
--- a/src/DTO/Authentication/OAuth/RequestToken.php
+++ b/src/DTO/Authentication/OAuth/RequestToken.php
@@ -24,6 +24,5 @@ public function __construct(
public string $scope,
public int $expiresIn,
public Carbon $expiresAt,
- ) {
- }
+ ) {}
}
diff --git a/src/DTO/Authentication/OAuth/ResponsibleIdentityService.php b/src/DTO/Authentication/OAuth/ResponsibleIdentityService.php
index dc52ce7..8099d02 100644
--- a/src/DTO/Authentication/OAuth/ResponsibleIdentityService.php
+++ b/src/DTO/Authentication/OAuth/ResponsibleIdentityService.php
@@ -17,6 +17,5 @@ public static function make(array $data): self
public function __construct(
public string $identityServiceUrl,
public bool $refreshTokenSupported,
- ) {
- }
+ ) {}
}
diff --git a/src/DTO/Documents/AnnotationsStamps/Annotation.php b/src/DTO/Documents/AnnotationsStamps/Annotation.php
index 94d33db..01991d4 100644
--- a/src/DTO/Documents/AnnotationsStamps/Annotation.php
+++ b/src/DTO/Documents/AnnotationsStamps/Annotation.php
@@ -18,8 +18,7 @@ public static function fromData(array $data): self
public function __construct(
public ?Collection $items,
public int $id,
- ) {
- }
+ ) {}
public function values(): array
{
diff --git a/src/DTO/Documents/AnnotationsStamps/AnnotationItem.php b/src/DTO/Documents/AnnotationsStamps/AnnotationItem.php
index fa329ab..4c60ea5 100644
--- a/src/DTO/Documents/AnnotationsStamps/AnnotationItem.php
+++ b/src/DTO/Documents/AnnotationsStamps/AnnotationItem.php
@@ -63,8 +63,7 @@ public function __construct(
public ?bool $transparent = null,
public ?int $strokeWidth = null,
public ?string $stampId = null,
- ) {
- }
+ ) {}
public function values(): array
{
diff --git a/src/DTO/Documents/AnnotationsStamps/AnnotationItemCreated.php b/src/DTO/Documents/AnnotationsStamps/AnnotationItemCreated.php
index 5e4e7dd..cc43ce1 100644
--- a/src/DTO/Documents/AnnotationsStamps/AnnotationItemCreated.php
+++ b/src/DTO/Documents/AnnotationsStamps/AnnotationItemCreated.php
@@ -17,8 +17,7 @@ public static function fromData(array $data): self
public function __construct(
public string $user,
public string $time,
- ) {
- }
+ ) {}
public function values(): array
{
diff --git a/src/DTO/Documents/AnnotationsStamps/AnnotationItemField.php b/src/DTO/Documents/AnnotationsStamps/AnnotationItemField.php
index 2d7c180..918a205 100644
--- a/src/DTO/Documents/AnnotationsStamps/AnnotationItemField.php
+++ b/src/DTO/Documents/AnnotationsStamps/AnnotationItemField.php
@@ -21,8 +21,7 @@ public function __construct(
public AnnotationItemFieldTypedValue $typedValue,
public string $value,
public string $textAsString,
- ) {
- }
+ ) {}
public function values(): array
{
diff --git a/src/DTO/Documents/AnnotationsStamps/AnnotationItemFieldTypedValue.php b/src/DTO/Documents/AnnotationsStamps/AnnotationItemFieldTypedValue.php
index e2a4360..41f356b 100644
--- a/src/DTO/Documents/AnnotationsStamps/AnnotationItemFieldTypedValue.php
+++ b/src/DTO/Documents/AnnotationsStamps/AnnotationItemFieldTypedValue.php
@@ -17,8 +17,7 @@ public static function fromData(array $data): self
public function __construct(
public string $item,
public string $itemElementName,
- ) {
- }
+ ) {}
public function values(): array
{
diff --git a/src/DTO/Documents/AnnotationsStamps/AnnotationItemFont.php b/src/DTO/Documents/AnnotationsStamps/AnnotationItemFont.php
index c385607..4e578ee 100644
--- a/src/DTO/Documents/AnnotationsStamps/AnnotationItemFont.php
+++ b/src/DTO/Documents/AnnotationsStamps/AnnotationItemFont.php
@@ -27,8 +27,7 @@ public function __construct(
public bool $strikeThrough,
public int $fontSize,
public int $spacing
- ) {
- }
+ ) {}
public function values(): array
{
diff --git a/src/DTO/Documents/AnnotationsStamps/AnnotationItemLayer.php b/src/DTO/Documents/AnnotationsStamps/AnnotationItemLayer.php
index f1cc1e0..828c67f 100644
--- a/src/DTO/Documents/AnnotationsStamps/AnnotationItemLayer.php
+++ b/src/DTO/Documents/AnnotationsStamps/AnnotationItemLayer.php
@@ -18,8 +18,7 @@ public static function fromData(array $data): self
public function __construct(
public string $id,
public Collection $items,
- ) {
- }
+ ) {}
public function values(): array
{
diff --git a/src/DTO/Documents/AnnotationsStamps/AnnotationItemLayerItem.php b/src/DTO/Documents/AnnotationsStamps/AnnotationItemLayerItem.php
index e64eb4c..58ec1e6 100644
--- a/src/DTO/Documents/AnnotationsStamps/AnnotationItemLayerItem.php
+++ b/src/DTO/Documents/AnnotationsStamps/AnnotationItemLayerItem.php
@@ -41,8 +41,7 @@ public function __construct(
public ?AnnotationItemLocation $from = null,
public ?AnnotationItemLocation $to = null,
public ?int $id = null,
- ) {
- }
+ ) {}
public function values(): array
{
diff --git a/src/DTO/Documents/AnnotationsStamps/AnnotationItemLocation.php b/src/DTO/Documents/AnnotationsStamps/AnnotationItemLocation.php
index d22589c..6ea0c30 100644
--- a/src/DTO/Documents/AnnotationsStamps/AnnotationItemLocation.php
+++ b/src/DTO/Documents/AnnotationsStamps/AnnotationItemLocation.php
@@ -22,8 +22,7 @@ public function __construct(
public ?string $top = null,
public ?string $width = null,
public ?string $height = null,
- ) {
- }
+ ) {}
public function values(): array
{
diff --git a/src/DTO/Documents/AnnotationsStamps/AnnotationPlacement.php b/src/DTO/Documents/AnnotationsStamps/AnnotationPlacement.php
index 738840a..0474867 100644
--- a/src/DTO/Documents/AnnotationsStamps/AnnotationPlacement.php
+++ b/src/DTO/Documents/AnnotationsStamps/AnnotationPlacement.php
@@ -17,8 +17,7 @@ public static function fromData(array $data): self
public function __construct(
public Collection $items,
- ) {
- }
+ ) {}
public function values(): array
{
diff --git a/src/DTO/Documents/AnnotationsStamps/Annotations.php b/src/DTO/Documents/AnnotationsStamps/Annotations.php
index dfd5ecd..a18d84d 100644
--- a/src/DTO/Documents/AnnotationsStamps/Annotations.php
+++ b/src/DTO/Documents/AnnotationsStamps/Annotations.php
@@ -22,8 +22,7 @@ public function __construct(
public ?int $sectionNumber,
public ?AnnotationPlacement $annotationsPlacement = null,
public ?Collection $annotation = null,
- ) {
- }
+ ) {}
public function values(): array
{
diff --git a/src/DTO/Documents/Document.php b/src/DTO/Documents/Document.php
index 04439ef..5a9f1ea 100644
--- a/src/DTO/Documents/Document.php
+++ b/src/DTO/Documents/Document.php
@@ -78,8 +78,7 @@ public function __construct(
public ?Collection $fields,
public ?Collection $sections,
public ?Collection $suggestions,
- ) {
- }
+ ) {}
public function isPdf(): bool
{
diff --git a/src/DTO/Documents/DocumentField.php b/src/DTO/Documents/DocumentField.php
index 70ad9e7..d7fe0c1 100644
--- a/src/DTO/Documents/DocumentField.php
+++ b/src/DTO/Documents/DocumentField.php
@@ -28,8 +28,7 @@ public function __construct(
public bool $isNull,
public null|int|float|Carbon|string|Collection $value,
public string $type,
- ) {
- }
+ ) {}
public static function fake(
?bool $systemField = false,
diff --git a/src/DTO/Documents/DocumentIndex/IndexDateDTO.php b/src/DTO/Documents/DocumentIndex/IndexDateDTO.php
index f30f7a3..bc3a37c 100644
--- a/src/DTO/Documents/DocumentIndex/IndexDateDTO.php
+++ b/src/DTO/Documents/DocumentIndex/IndexDateDTO.php
@@ -9,9 +9,7 @@ class IndexDateDTO
public function __construct(
public string $name,
public null|Carbon|\Carbon\Carbon $value,
- ) {
-
- }
+ ) {}
public static function make(string $name, null|Carbon|\Carbon\Carbon $value): self
{
diff --git a/src/DTO/Documents/DocumentIndex/IndexDateTimeDTO.php b/src/DTO/Documents/DocumentIndex/IndexDateTimeDTO.php
index c7e8c19..4467642 100644
--- a/src/DTO/Documents/DocumentIndex/IndexDateTimeDTO.php
+++ b/src/DTO/Documents/DocumentIndex/IndexDateTimeDTO.php
@@ -9,9 +9,7 @@ class IndexDateTimeDTO
public function __construct(
public string $name,
public null|Carbon|\Carbon\Carbon $value,
- ) {
-
- }
+ ) {}
public static function make(string $name, null|Carbon|\Carbon\Carbon $value): self
{
diff --git a/src/DTO/Documents/DocumentIndex/IndexDecimalDTO.php b/src/DTO/Documents/DocumentIndex/IndexDecimalDTO.php
index 1f37b04..e1de153 100644
--- a/src/DTO/Documents/DocumentIndex/IndexDecimalDTO.php
+++ b/src/DTO/Documents/DocumentIndex/IndexDecimalDTO.php
@@ -7,9 +7,7 @@ class IndexDecimalDTO
public function __construct(
public string $name,
public null|int|float $value,
- ) {
-
- }
+ ) {}
public static function make(string $name, null|int|float $value): self
{
diff --git a/src/DTO/Documents/DocumentIndex/IndexNumericDTO.php b/src/DTO/Documents/DocumentIndex/IndexNumericDTO.php
index cddbf3b..abd2b87 100644
--- a/src/DTO/Documents/DocumentIndex/IndexNumericDTO.php
+++ b/src/DTO/Documents/DocumentIndex/IndexNumericDTO.php
@@ -9,9 +9,7 @@ class IndexNumericDTO
public function __construct(
public string $name,
public ?int $value,
- ) {
-
- }
+ ) {}
public static function make(string $name, ?int $value): self
{
diff --git a/src/DTO/Documents/DocumentIndex/IndexTableDTO.php b/src/DTO/Documents/DocumentIndex/IndexTableDTO.php
index 5c6fe9c..3bda7d9 100644
--- a/src/DTO/Documents/DocumentIndex/IndexTableDTO.php
+++ b/src/DTO/Documents/DocumentIndex/IndexTableDTO.php
@@ -10,9 +10,7 @@ class IndexTableDTO
public function __construct(
public string $name,
public null|Collection|array $rows,
- ) {
-
- }
+ ) {}
public static function make(string $name, null|Collection|array $rows): self
{
diff --git a/src/DTO/Documents/DocumentIndex/IndexTextDTO.php b/src/DTO/Documents/DocumentIndex/IndexTextDTO.php
index 1f5c237..8917b1a 100644
--- a/src/DTO/Documents/DocumentIndex/IndexTextDTO.php
+++ b/src/DTO/Documents/DocumentIndex/IndexTextDTO.php
@@ -7,9 +7,7 @@ class IndexTextDTO
public function __construct(
public string $name,
public ?string $value,
- ) {
-
- }
+ ) {}
public static function make(string $name, ?string $value): self
{
diff --git a/src/DTO/Documents/DocumentPaginator.php b/src/DTO/Documents/DocumentPaginator.php
index 55ec562..422e786 100644
--- a/src/DTO/Documents/DocumentPaginator.php
+++ b/src/DTO/Documents/DocumentPaginator.php
@@ -21,8 +21,7 @@ public function __construct(
public int $to,
public Collection $documents,
public ?ErrorBag $error = null,
- ) {
- }
+ ) {}
public function showPrev(): bool
{
diff --git a/src/DTO/Documents/DocumentThumbnail.php b/src/DTO/Documents/DocumentThumbnail.php
index bff296d..0a32d52 100644
--- a/src/DTO/Documents/DocumentThumbnail.php
+++ b/src/DTO/Documents/DocumentThumbnail.php
@@ -22,6 +22,5 @@ public function __construct(
public string $mime,
public string $data,
public string $base64,
- ) {
- }
+ ) {}
}
diff --git a/src/DTO/Documents/DocumentsTrashBin/DeleteDocuments.php b/src/DTO/Documents/DocumentsTrashBin/DeleteDocuments.php
index 0eed7bd..9eebdc0 100644
--- a/src/DTO/Documents/DocumentsTrashBin/DeleteDocuments.php
+++ b/src/DTO/Documents/DocumentsTrashBin/DeleteDocuments.php
@@ -20,6 +20,5 @@ public static function fromData(array $data): self
public function __construct(
public array $failedItems = [],
public int $successCount = 0,
- ) {
- }
+ ) {}
}
diff --git a/src/DTO/Documents/DocumentsTrashBin/RestoreDocuments.php b/src/DTO/Documents/DocumentsTrashBin/RestoreDocuments.php
index 476996e..d87bf87 100644
--- a/src/DTO/Documents/DocumentsTrashBin/RestoreDocuments.php
+++ b/src/DTO/Documents/DocumentsTrashBin/RestoreDocuments.php
@@ -20,6 +20,5 @@ public static function fromData(array $data): self
public function __construct(
public array $failedItems = [],
public int $successCount = 0,
- ) {
- }
+ ) {}
}
diff --git a/src/DTO/Documents/Field.php b/src/DTO/Documents/Field.php
index a26cc64..0c8fc4e 100644
--- a/src/DTO/Documents/Field.php
+++ b/src/DTO/Documents/Field.php
@@ -21,8 +21,7 @@ public function __construct(
public string $label,
public string $type,
public string $scope,
- ) {
- }
+ ) {}
public function isSystem(): bool
{
diff --git a/src/DTO/Documents/TableRow.php b/src/DTO/Documents/TableRow.php
index 6cb003e..9612b62 100644
--- a/src/DTO/Documents/TableRow.php
+++ b/src/DTO/Documents/TableRow.php
@@ -24,8 +24,7 @@ protected static function convertFields(Collection $fields): Collection
public function __construct(
public Collection $fields,
- ) {
- }
+ ) {}
public static function fake(
?Collection $fields = null,
diff --git a/src/DTO/Documents/TrashDocumentPaginator.php b/src/DTO/Documents/TrashDocumentPaginator.php
index 5927d98..c67dcd4 100644
--- a/src/DTO/Documents/TrashDocumentPaginator.php
+++ b/src/DTO/Documents/TrashDocumentPaginator.php
@@ -23,8 +23,7 @@ public function __construct(
public Collection $documents,
public Collection $mappedDocuments,
public ?ErrorBag $error = null,
- ) {
- }
+ ) {}
public function showPrev(): bool
{
diff --git a/src/DTO/ErrorBag.php b/src/DTO/ErrorBag.php
index b83a186..814f4cd 100644
--- a/src/DTO/ErrorBag.php
+++ b/src/DTO/ErrorBag.php
@@ -9,8 +9,7 @@ class ErrorBag
public function __construct(
public int $code,
public string $message,
- ) {
- }
+ ) {}
public static function make(Exception $e): self
{
diff --git a/src/DTO/FileCabinets/Dialog.php b/src/DTO/FileCabinets/Dialog.php
index bfcacd2..9e4c3c6 100644
--- a/src/DTO/FileCabinets/Dialog.php
+++ b/src/DTO/FileCabinets/Dialog.php
@@ -26,8 +26,7 @@ public function __construct(
public bool $isDefault,
public string $fileCabinetId,
public ?array $fields = null,
- ) {
- }
+ ) {}
public function isSearch(): bool
{
diff --git a/src/DTO/FileCabinets/General/FileCabinetInformation.php b/src/DTO/FileCabinets/General/FileCabinetInformation.php
index fdbe350..242d2b2 100644
--- a/src/DTO/FileCabinets/General/FileCabinetInformation.php
+++ b/src/DTO/FileCabinets/General/FileCabinetInformation.php
@@ -38,8 +38,7 @@ public function __construct(
public bool $addIndexEntriesInUpperCase,
public bool $documentAuditingEnabled,
public bool $hasFullTextSupport,
- ) {
- }
+ ) {}
public static function fake(
?string $color = null,
diff --git a/src/DTO/General/Organization/FileCabinet.php b/src/DTO/General/Organization/FileCabinet.php
index a48abfc..0e6b973 100644
--- a/src/DTO/General/Organization/FileCabinet.php
+++ b/src/DTO/General/Organization/FileCabinet.php
@@ -38,8 +38,7 @@ public function __construct(
public bool $addIndexEntriesInUpperCase,
public bool $documentAuditingEnabled,
public bool $hasFullTextSupport,
- ) {
- }
+ ) {}
public static function fake(
?string $color = null,
diff --git a/src/DTO/General/Organization/Organization.php b/src/DTO/General/Organization/Organization.php
index 68953a5..26643bc 100644
--- a/src/DTO/General/Organization/Organization.php
+++ b/src/DTO/General/Organization/Organization.php
@@ -24,8 +24,7 @@ public function __construct(
public ?string $guid = null,
public array $additionalInfo = [],
public array $configurationRights = [],
- ) {
- }
+ ) {}
public static function fake(
?string $id = null,
diff --git a/src/DTO/General/Organization/OrganizationIndex.php b/src/DTO/General/Organization/OrganizationIndex.php
index f4b8c20..71a58db 100644
--- a/src/DTO/General/Organization/OrganizationIndex.php
+++ b/src/DTO/General/Organization/OrganizationIndex.php
@@ -20,8 +20,7 @@ public function __construct(
public string $id,
public string $name,
public ?string $guid = null,
- ) {
- }
+ ) {}
public static function fake(
?string $id = null,
diff --git a/src/DTO/General/UserManagement/CreateUpdateUser/User.php b/src/DTO/General/UserManagement/CreateUpdateUser/User.php
index 3dad871..dd0e1ad 100644
--- a/src/DTO/General/UserManagement/CreateUpdateUser/User.php
+++ b/src/DTO/General/UserManagement/CreateUpdateUser/User.php
@@ -23,8 +23,7 @@ public function __construct(
public string $email,
public string $password,
public ?string $networkId = null,
- ) {
- }
+ ) {}
public static function fake(
?string $name = null,
diff --git a/src/DTO/General/UserManagement/GetModifyGroups/Group.php b/src/DTO/General/UserManagement/GetModifyGroups/Group.php
index b1fab04..f37e092 100644
--- a/src/DTO/General/UserManagement/GetModifyGroups/Group.php
+++ b/src/DTO/General/UserManagement/GetModifyGroups/Group.php
@@ -19,6 +19,5 @@ public function __construct(
public string $id,
public string $name,
public bool $active,
- ) {
- }
+ ) {}
}
diff --git a/src/DTO/General/UserManagement/GetModifyRoles/Role.php b/src/DTO/General/UserManagement/GetModifyRoles/Role.php
index 578e63c..6eac160 100644
--- a/src/DTO/General/UserManagement/GetModifyRoles/Role.php
+++ b/src/DTO/General/UserManagement/GetModifyRoles/Role.php
@@ -21,6 +21,5 @@ public function __construct(
public string $name,
public bool $active,
public string $type,
- ) {
- }
+ ) {}
}
diff --git a/src/DTO/General/UserManagement/GetUsers/OutOfOffice.php b/src/DTO/General/UserManagement/GetUsers/OutOfOffice.php
index 195d0e4..802e4cf 100644
--- a/src/DTO/General/UserManagement/GetUsers/OutOfOffice.php
+++ b/src/DTO/General/UserManagement/GetUsers/OutOfOffice.php
@@ -35,6 +35,5 @@ public function __construct(
public bool $startDateTimeSpecified,
public ?Carbon $endDateTime,
public bool $endDateTimeSpecified,
- ) {
- }
+ ) {}
}
diff --git a/src/DTO/General/UserManagement/GetUsers/RegionalSettings.php b/src/DTO/General/UserManagement/GetUsers/RegionalSettings.php
index d7b5278..c926ee8 100644
--- a/src/DTO/General/UserManagement/GetUsers/RegionalSettings.php
+++ b/src/DTO/General/UserManagement/GetUsers/RegionalSettings.php
@@ -17,6 +17,5 @@ public static function fromJson(array $data): self
public function __construct(
public ?string $language = null,
public ?string $culture = null,
- ) {
- }
+ ) {}
}
diff --git a/src/DTO/General/UserManagement/GetUsers/User.php b/src/DTO/General/UserManagement/GetUsers/User.php
index 6727a07..f2d3e65 100644
--- a/src/DTO/General/UserManagement/GetUsers/User.php
+++ b/src/DTO/General/UserManagement/GetUsers/User.php
@@ -38,8 +38,7 @@ public function __construct(
public string $defaultWebBasket,
public ?OutOfOffice $outOfOffice,
public ?RegionalSettings $regionalSettings,
- ) {
- }
+ ) {}
public static function fake(
?string $id = null,
diff --git a/src/DTO/Section.php b/src/DTO/Section.php
index 6d0901b..49c554b 100644
--- a/src/DTO/Section.php
+++ b/src/DTO/Section.php
@@ -38,6 +38,5 @@ public function __construct(
public ?Carbon $contentModified,
public bool $annotationsPreview,
public ?bool $hasTextAnnotations = null,
- ) {
- }
+ ) {}
}
diff --git a/src/DTO/SuggestionField.php b/src/DTO/SuggestionField.php
index a5d933e..6e0a11e 100644
--- a/src/DTO/SuggestionField.php
+++ b/src/DTO/SuggestionField.php
@@ -21,8 +21,7 @@ public function __construct(
public ?string $name,
public ?string $db_name,
public ?string $confidence,
- ) {
- }
+ ) {}
public static function fake(
array $value = [],
diff --git a/src/DTO/Workflow/HistoryStep.php b/src/DTO/Workflow/HistoryStep.php
index c184276..20a832a 100644
--- a/src/DTO/Workflow/HistoryStep.php
+++ b/src/DTO/Workflow/HistoryStep.php
@@ -33,6 +33,5 @@ public function __construct(
public string $activityName,
public string $activityType,
public string $stepType,
- ) {
- }
+ ) {}
}
diff --git a/src/DTO/Workflow/InstanceHistory.php b/src/DTO/Workflow/InstanceHistory.php
index 7e5436b..3ae14e0 100644
--- a/src/DTO/Workflow/InstanceHistory.php
+++ b/src/DTO/Workflow/InstanceHistory.php
@@ -41,6 +41,5 @@ public function __construct(
public Carbon $startedAt,
public string $docId,
public ?Collection $historySteps = null,
- ) {
- }
+ ) {}
}
diff --git a/src/Events/DocuWareOAuthLog.php b/src/Events/DocuWareOAuthLog.php
index 41f8cbb..e6f847f 100644
--- a/src/Events/DocuWareOAuthLog.php
+++ b/src/Events/DocuWareOAuthLog.php
@@ -16,6 +16,5 @@ public function __construct(
public string $url,
public string $username,
public string $message
- ) {
- }
+ ) {}
}
diff --git a/src/Events/DocuWareResponseLog.php b/src/Events/DocuWareResponseLog.php
index 662bb76..23250df 100644
--- a/src/Events/DocuWareResponseLog.php
+++ b/src/Events/DocuWareResponseLog.php
@@ -16,6 +16,5 @@ class DocuWareResponseLog
public function __construct(
public Response|SaloonResponse $response
- ) {
- }
+ ) {}
}
diff --git a/src/Requests/Authentication/OAuth/GetIdentityServiceConfiguration.php b/src/Requests/Authentication/OAuth/GetIdentityServiceConfiguration.php
index df59e97..b07a542 100644
--- a/src/Requests/Authentication/OAuth/GetIdentityServiceConfiguration.php
+++ b/src/Requests/Authentication/OAuth/GetIdentityServiceConfiguration.php
@@ -21,8 +21,7 @@ class GetIdentityServiceConfiguration extends SoloRequest implements Cacheable
public function __construct(
public string $identityServiceUrl,
- ) {
- }
+ ) {}
public function resolveEndpoint(): string
{
diff --git a/src/Requests/Authentication/OAuth/RequestTokenWithCredentials.php b/src/Requests/Authentication/OAuth/RequestTokenWithCredentials.php
index 55e72bb..01bd572 100644
--- a/src/Requests/Authentication/OAuth/RequestTokenWithCredentials.php
+++ b/src/Requests/Authentication/OAuth/RequestTokenWithCredentials.php
@@ -22,8 +22,7 @@ public function __construct(
public readonly ?string $scope = 'docuware.platform',
public readonly ?string $username = '',
public readonly ?string $password = '',
- ) {
- }
+ ) {}
public function resolveEndpoint(): string
{
diff --git a/src/Requests/Authentication/OAuth/RequestTokenWithCredentialsTrustedUser.php b/src/Requests/Authentication/OAuth/RequestTokenWithCredentialsTrustedUser.php
index 8912fee..ef4d65f 100644
--- a/src/Requests/Authentication/OAuth/RequestTokenWithCredentialsTrustedUser.php
+++ b/src/Requests/Authentication/OAuth/RequestTokenWithCredentialsTrustedUser.php
@@ -23,8 +23,7 @@ public function __construct(
public readonly string $username = '',
public readonly string $password = '',
public readonly string $impersonateName = '',
- ) {
- }
+ ) {}
public function resolveEndpoint(): string
{
diff --git a/src/Requests/Documents/AnnotationsStamps/AddLineEntryAnnotation.php b/src/Requests/Documents/AnnotationsStamps/AddLineEntryAnnotation.php
index 9be3680..b6f4fcb 100644
--- a/src/Requests/Documents/AnnotationsStamps/AddLineEntryAnnotation.php
+++ b/src/Requests/Documents/AnnotationsStamps/AddLineEntryAnnotation.php
@@ -2,6 +2,4 @@
namespace CodebarAg\DocuWare\Requests\Documents\AnnotationsStamps;
-class AddLineEntryAnnotation extends AddStampWithPosition
-{
-}
+class AddLineEntryAnnotation extends AddStampWithPosition {}
diff --git a/src/Requests/Documents/AnnotationsStamps/AddRectEntryAnnotation.php b/src/Requests/Documents/AnnotationsStamps/AddRectEntryAnnotation.php
index 7c149b2..033be7e 100644
--- a/src/Requests/Documents/AnnotationsStamps/AddRectEntryAnnotation.php
+++ b/src/Requests/Documents/AnnotationsStamps/AddRectEntryAnnotation.php
@@ -2,6 +2,4 @@
namespace CodebarAg\DocuWare\Requests\Documents\AnnotationsStamps;
-class AddRectEntryAnnotation extends AddStampWithPosition
-{
-}
+class AddRectEntryAnnotation extends AddStampWithPosition {}
diff --git a/src/Requests/Documents/AnnotationsStamps/AddStampWithBestPosition.php b/src/Requests/Documents/AnnotationsStamps/AddStampWithBestPosition.php
index d08e850..a0f6410 100644
--- a/src/Requests/Documents/AnnotationsStamps/AddStampWithBestPosition.php
+++ b/src/Requests/Documents/AnnotationsStamps/AddStampWithBestPosition.php
@@ -2,6 +2,4 @@
namespace CodebarAg\DocuWare\Requests\Documents\AnnotationsStamps;
-class AddStampWithBestPosition extends AddStampWithPosition
-{
-}
+class AddStampWithBestPosition extends AddStampWithPosition {}
diff --git a/src/Requests/Documents/AnnotationsStamps/AddStampWithPosition.php b/src/Requests/Documents/AnnotationsStamps/AddStampWithPosition.php
index 6cee215..caeddd8 100644
--- a/src/Requests/Documents/AnnotationsStamps/AddStampWithPosition.php
+++ b/src/Requests/Documents/AnnotationsStamps/AddStampWithPosition.php
@@ -22,8 +22,7 @@ public function __construct(
protected readonly string $fileCabinetId,
protected readonly string $documentId,
protected readonly Annotations $annotations,
- ) {
- }
+ ) {}
public function resolveEndpoint(): string
{
diff --git a/src/Requests/Documents/AnnotationsStamps/AddTextAnnotation.php b/src/Requests/Documents/AnnotationsStamps/AddTextAnnotation.php
index 83dd4dc..b1c409f 100644
--- a/src/Requests/Documents/AnnotationsStamps/AddTextAnnotation.php
+++ b/src/Requests/Documents/AnnotationsStamps/AddTextAnnotation.php
@@ -2,6 +2,4 @@
namespace CodebarAg\DocuWare\Requests\Documents\AnnotationsStamps;
-class AddTextAnnotation extends AddStampWithPosition
-{
-}
+class AddTextAnnotation extends AddStampWithPosition {}
diff --git a/src/Requests/Documents/AnnotationsStamps/UpdateTextAnnotation.php b/src/Requests/Documents/AnnotationsStamps/UpdateTextAnnotation.php
index 77e0630..8b54dea 100644
--- a/src/Requests/Documents/AnnotationsStamps/UpdateTextAnnotation.php
+++ b/src/Requests/Documents/AnnotationsStamps/UpdateTextAnnotation.php
@@ -2,6 +2,4 @@
namespace CodebarAg\DocuWare\Requests\Documents\AnnotationsStamps;
-class UpdateTextAnnotation extends AddStampWithPosition
-{
-}
+class UpdateTextAnnotation extends AddStampWithPosition {}
diff --git a/src/Requests/Documents/ApplicationProperties/AddApplicationProperties.php b/src/Requests/Documents/ApplicationProperties/AddApplicationProperties.php
index 2d05564..40fd9b7 100644
--- a/src/Requests/Documents/ApplicationProperties/AddApplicationProperties.php
+++ b/src/Requests/Documents/ApplicationProperties/AddApplicationProperties.php
@@ -24,8 +24,7 @@ public function __construct(
protected readonly string $fileCabinetId,
protected readonly string $documentId,
protected readonly array $properties,
- ) {
- }
+ ) {}
public function resolveEndpoint(): string
{
diff --git a/src/Requests/Documents/ApplicationProperties/DeleteApplicationProperties.php b/src/Requests/Documents/ApplicationProperties/DeleteApplicationProperties.php
index 8225369..67d1c4f 100644
--- a/src/Requests/Documents/ApplicationProperties/DeleteApplicationProperties.php
+++ b/src/Requests/Documents/ApplicationProperties/DeleteApplicationProperties.php
@@ -24,8 +24,7 @@ public function __construct(
protected readonly string $fileCabinetId,
protected readonly string $documentId,
protected readonly array $propertyNames,
- ) {
- }
+ ) {}
public function resolveEndpoint(): string
{
diff --git a/src/Requests/Documents/ApplicationProperties/GetApplicationProperties.php b/src/Requests/Documents/ApplicationProperties/GetApplicationProperties.php
index 1acfa06..03330ba 100644
--- a/src/Requests/Documents/ApplicationProperties/GetApplicationProperties.php
+++ b/src/Requests/Documents/ApplicationProperties/GetApplicationProperties.php
@@ -20,8 +20,7 @@ class GetApplicationProperties extends Request implements Cacheable
public function __construct(
protected readonly string $fileCabinetId,
protected readonly string $documentId,
- ) {
- }
+ ) {}
public function resolveEndpoint(): string
{
diff --git a/src/Requests/Documents/ApplicationProperties/UpdateApplicationProperties.php b/src/Requests/Documents/ApplicationProperties/UpdateApplicationProperties.php
index fc33e59..44ac803 100644
--- a/src/Requests/Documents/ApplicationProperties/UpdateApplicationProperties.php
+++ b/src/Requests/Documents/ApplicationProperties/UpdateApplicationProperties.php
@@ -24,8 +24,7 @@ public function __construct(
protected readonly string $fileCabinetId,
protected readonly string $documentId,
protected readonly array $properties,
- ) {
- }
+ ) {}
public function resolveEndpoint(): string
{
diff --git a/src/Requests/Documents/ClipUnclipStapleUnstaple/Clip.php b/src/Requests/Documents/ClipUnclipStapleUnstaple/Clip.php
index 38c65e2..52cd9f5 100644
--- a/src/Requests/Documents/ClipUnclipStapleUnstaple/Clip.php
+++ b/src/Requests/Documents/ClipUnclipStapleUnstaple/Clip.php
@@ -20,8 +20,7 @@ public function __construct(
protected readonly string $documentTrayId,
protected readonly array $documents,
protected readonly bool $force = false
- ) {
- }
+ ) {}
public function resolveEndpoint(): string
{
diff --git a/src/Requests/Documents/ClipUnclipStapleUnstaple/Staple.php b/src/Requests/Documents/ClipUnclipStapleUnstaple/Staple.php
index 057abf1..f3f8665 100644
--- a/src/Requests/Documents/ClipUnclipStapleUnstaple/Staple.php
+++ b/src/Requests/Documents/ClipUnclipStapleUnstaple/Staple.php
@@ -20,8 +20,7 @@ public function __construct(
protected readonly string $documentTrayId,
protected readonly array $documents,
protected readonly bool $force = false
- ) {
- }
+ ) {}
public function resolveEndpoint(): string
{
diff --git a/src/Requests/Documents/ClipUnclipStapleUnstaple/Unclip.php b/src/Requests/Documents/ClipUnclipStapleUnstaple/Unclip.php
index 2b2cb48..352df77 100644
--- a/src/Requests/Documents/ClipUnclipStapleUnstaple/Unclip.php
+++ b/src/Requests/Documents/ClipUnclipStapleUnstaple/Unclip.php
@@ -19,8 +19,7 @@ class Unclip extends Request implements HasBody
public function __construct(
protected readonly string $documentTrayId,
protected readonly string $documentId,
- ) {
- }
+ ) {}
public function resolveEndpoint(): string
{
diff --git a/src/Requests/Documents/ClipUnclipStapleUnstaple/Unstaple.php b/src/Requests/Documents/ClipUnclipStapleUnstaple/Unstaple.php
index dc3f139..7d4f861 100644
--- a/src/Requests/Documents/ClipUnclipStapleUnstaple/Unstaple.php
+++ b/src/Requests/Documents/ClipUnclipStapleUnstaple/Unstaple.php
@@ -19,8 +19,7 @@ class Unstaple extends Request implements HasBody
public function __construct(
protected readonly string $documentTrayId,
protected readonly string $documentId,
- ) {
- }
+ ) {}
public function resolveEndpoint(): string
{
diff --git a/src/Requests/Documents/DocumentsTrashBin/DeleteDocuments.php b/src/Requests/Documents/DocumentsTrashBin/DeleteDocuments.php
index d9ab420..e935c1e 100644
--- a/src/Requests/Documents/DocumentsTrashBin/DeleteDocuments.php
+++ b/src/Requests/Documents/DocumentsTrashBin/DeleteDocuments.php
@@ -19,8 +19,7 @@ class DeleteDocuments extends Request implements HasBody
public function __construct(
protected readonly array|Collection $ids = [],
- ) {
- }
+ ) {}
public function resolveEndpoint(): string
{
diff --git a/src/Requests/Documents/DocumentsTrashBin/GetDocuments.php b/src/Requests/Documents/DocumentsTrashBin/GetDocuments.php
index a710a4b..7146614 100644
--- a/src/Requests/Documents/DocumentsTrashBin/GetDocuments.php
+++ b/src/Requests/Documents/DocumentsTrashBin/GetDocuments.php
@@ -29,8 +29,7 @@ public function __construct(
protected readonly string $orderDirection = 'desc',
protected readonly array $condition = [],
protected readonly ?bool $forceRefresh = true,
- ) {
- }
+ ) {}
public function resolveEndpoint(): string
{
diff --git a/src/Requests/Documents/DocumentsTrashBin/RestoreDocuments.php b/src/Requests/Documents/DocumentsTrashBin/RestoreDocuments.php
index aebce4b..33b29ad 100644
--- a/src/Requests/Documents/DocumentsTrashBin/RestoreDocuments.php
+++ b/src/Requests/Documents/DocumentsTrashBin/RestoreDocuments.php
@@ -19,8 +19,7 @@ class RestoreDocuments extends Request implements HasBody
public function __construct(
protected readonly array|Collection $ids = [],
- ) {
- }
+ ) {}
public function resolveEndpoint(): string
{
diff --git a/src/Requests/Documents/Download/DownloadDocument.php b/src/Requests/Documents/Download/DownloadDocument.php
index 83fee92..662b0ad 100644
--- a/src/Requests/Documents/Download/DownloadDocument.php
+++ b/src/Requests/Documents/Download/DownloadDocument.php
@@ -20,8 +20,7 @@ class DownloadDocument extends Request implements Cacheable
public function __construct(
protected readonly string $fileCabinetId,
protected readonly string $documentId,
- ) {
- }
+ ) {}
public function resolveEndpoint(): string
{
diff --git a/src/Requests/Documents/Download/DownloadSection.php b/src/Requests/Documents/Download/DownloadSection.php
index 2afbf38..f40dea0 100644
--- a/src/Requests/Documents/Download/DownloadSection.php
+++ b/src/Requests/Documents/Download/DownloadSection.php
@@ -20,8 +20,7 @@ class DownloadSection extends Request implements Cacheable
public function __construct(
protected readonly string $fileCabinetId,
protected readonly string $sectionId,
- ) {
- }
+ ) {}
public function resolveEndpoint(): string
{
diff --git a/src/Requests/Documents/Download/DownloadThumbnail.php b/src/Requests/Documents/Download/DownloadThumbnail.php
index 213aa94..5dc5afe 100644
--- a/src/Requests/Documents/Download/DownloadThumbnail.php
+++ b/src/Requests/Documents/Download/DownloadThumbnail.php
@@ -21,8 +21,7 @@ public function __construct(
protected readonly string $fileCabinetId,
protected readonly string $sectionId,
protected readonly int $page = 0,
- ) {
- }
+ ) {}
public function resolveEndpoint(): string
{
diff --git a/src/Requests/Documents/GetDocumentPreviewRequest.php b/src/Requests/Documents/GetDocumentPreviewRequest.php
index 128773c..e099ea3 100644
--- a/src/Requests/Documents/GetDocumentPreviewRequest.php
+++ b/src/Requests/Documents/GetDocumentPreviewRequest.php
@@ -20,8 +20,7 @@ class GetDocumentPreviewRequest extends Request implements Cacheable
public function __construct(
protected readonly string $fileCabinetId,
protected readonly string $documentId,
- ) {
- }
+ ) {}
public function resolveEndpoint(): string
{
diff --git a/src/Requests/Documents/ModifyDocuments/DeleteDocument.php b/src/Requests/Documents/ModifyDocuments/DeleteDocument.php
index ad448b0..d33ff5c 100644
--- a/src/Requests/Documents/ModifyDocuments/DeleteDocument.php
+++ b/src/Requests/Documents/ModifyDocuments/DeleteDocument.php
@@ -14,8 +14,7 @@ class DeleteDocument extends Request
public function __construct(
protected readonly string $fileCabinetId,
protected readonly string $documentId,
- ) {
- }
+ ) {}
public function resolveEndpoint(): string
{
diff --git a/src/Requests/Documents/ModifyDocuments/TransferDocument.php b/src/Requests/Documents/ModifyDocuments/TransferDocument.php
index 5b7b3eb..3431ec5 100644
--- a/src/Requests/Documents/ModifyDocuments/TransferDocument.php
+++ b/src/Requests/Documents/ModifyDocuments/TransferDocument.php
@@ -21,8 +21,7 @@ public function __construct(
protected readonly string $storeDialogId,
protected readonly string $documentId,
protected readonly array $fields = [],
- ) {
- }
+ ) {}
public function resolveEndpoint(): string
{
diff --git a/src/Requests/Documents/Sections/DeleteSection.php b/src/Requests/Documents/Sections/DeleteSection.php
index e4a4cc2..681e9b8 100644
--- a/src/Requests/Documents/Sections/DeleteSection.php
+++ b/src/Requests/Documents/Sections/DeleteSection.php
@@ -20,8 +20,7 @@ class DeleteSection extends Request implements Cacheable
public function __construct(
protected readonly string $fileCabinetId,
protected readonly string $sectionId,
- ) {
- }
+ ) {}
public function resolveEndpoint(): string
{
diff --git a/src/Requests/Documents/Sections/GetASpecificSection.php b/src/Requests/Documents/Sections/GetASpecificSection.php
index c7ab4b9..840c1d2 100644
--- a/src/Requests/Documents/Sections/GetASpecificSection.php
+++ b/src/Requests/Documents/Sections/GetASpecificSection.php
@@ -21,8 +21,7 @@ class GetASpecificSection extends Request implements Cacheable
public function __construct(
protected readonly string $fileCabinetId,
protected readonly string $sectionId,
- ) {
- }
+ ) {}
public function resolveEndpoint(): string
{
diff --git a/src/Requests/Documents/Sections/GetAllSectionsFromADocument.php b/src/Requests/Documents/Sections/GetAllSectionsFromADocument.php
index 45b87f2..eb106e3 100644
--- a/src/Requests/Documents/Sections/GetAllSectionsFromADocument.php
+++ b/src/Requests/Documents/Sections/GetAllSectionsFromADocument.php
@@ -22,8 +22,7 @@ class GetAllSectionsFromADocument extends Request implements Cacheable
public function __construct(
protected readonly string $fileCabinetId,
protected readonly string $documentId
- ) {
- }
+ ) {}
public function resolveEndpoint(): string
{
diff --git a/src/Requests/Documents/UpdateIndexValues/UpdateIndexValues.php b/src/Requests/Documents/UpdateIndexValues/UpdateIndexValues.php
index 62e4784..f6ace23 100644
--- a/src/Requests/Documents/UpdateIndexValues/UpdateIndexValues.php
+++ b/src/Requests/Documents/UpdateIndexValues/UpdateIndexValues.php
@@ -26,8 +26,7 @@ public function __construct(
protected readonly string $documentId,
protected readonly ?Collection $indexes = null,
protected readonly bool $forceUpdate = false,
- ) {
- }
+ ) {}
public function resolveEndpoint(): string
{
diff --git a/src/Requests/Fields/GetFieldsRequest.php b/src/Requests/Fields/GetFieldsRequest.php
index 3361f53..614b9e1 100644
--- a/src/Requests/Fields/GetFieldsRequest.php
+++ b/src/Requests/Fields/GetFieldsRequest.php
@@ -21,8 +21,7 @@ class GetFieldsRequest extends Request implements Cacheable
public function __construct(
protected readonly string $fileCabinetId
- ) {
- }
+ ) {}
public function resolveEndpoint(): string
{
diff --git a/src/Requests/FileCabinets/Dialogs/GetASpecificDialog.php b/src/Requests/FileCabinets/Dialogs/GetASpecificDialog.php
index 2bcd243..f82ef14 100644
--- a/src/Requests/FileCabinets/Dialogs/GetASpecificDialog.php
+++ b/src/Requests/FileCabinets/Dialogs/GetASpecificDialog.php
@@ -20,8 +20,7 @@ class GetASpecificDialog extends Request implements Cacheable
public function __construct(
protected readonly string $fileCabinetId,
protected readonly string $dialogId
- ) {
- }
+ ) {}
public function resolveEndpoint(): string
{
diff --git a/src/Requests/FileCabinets/Dialogs/GetAllDialogs.php b/src/Requests/FileCabinets/Dialogs/GetAllDialogs.php
index 945fc79..0d7a62a 100644
--- a/src/Requests/FileCabinets/Dialogs/GetAllDialogs.php
+++ b/src/Requests/FileCabinets/Dialogs/GetAllDialogs.php
@@ -19,8 +19,7 @@ class GetAllDialogs extends Request implements Cacheable
public function __construct(
protected readonly string $fileCabinetId
- ) {
- }
+ ) {}
public function resolveEndpoint(): string
{
diff --git a/src/Requests/FileCabinets/Dialogs/GetDialogsOfASpecificType.php b/src/Requests/FileCabinets/Dialogs/GetDialogsOfASpecificType.php
index e1daddc..60991eb 100644
--- a/src/Requests/FileCabinets/Dialogs/GetDialogsOfASpecificType.php
+++ b/src/Requests/FileCabinets/Dialogs/GetDialogsOfASpecificType.php
@@ -21,8 +21,7 @@ class GetDialogsOfASpecificType extends Request implements Cacheable
public function __construct(
protected readonly string $fileCabinetId,
protected readonly DialogType $dialogType,
- ) {
- }
+ ) {}
public function resolveEndpoint(): string
{
diff --git a/src/Requests/FileCabinets/General/GetFileCabinetInformation.php b/src/Requests/FileCabinets/General/GetFileCabinetInformation.php
index baf42a0..9ab5021 100644
--- a/src/Requests/FileCabinets/General/GetFileCabinetInformation.php
+++ b/src/Requests/FileCabinets/General/GetFileCabinetInformation.php
@@ -20,8 +20,7 @@ class GetFileCabinetInformation extends Request implements Cacheable
public function __construct(
public readonly string $fileCabinetId,
- ) {
- }
+ ) {}
public function resolveEndpoint(): string
{
diff --git a/src/Requests/FileCabinets/General/GetTotalNumberOfDocuments.php b/src/Requests/FileCabinets/General/GetTotalNumberOfDocuments.php
index 5ec2f1d..a1fcfb2 100644
--- a/src/Requests/FileCabinets/General/GetTotalNumberOfDocuments.php
+++ b/src/Requests/FileCabinets/General/GetTotalNumberOfDocuments.php
@@ -20,8 +20,7 @@ class GetTotalNumberOfDocuments extends Request implements Cacheable
public function __construct(
protected readonly string $fileCabinetId,
protected readonly string $searchDialogId,
- ) {
- }
+ ) {}
public function resolveEndpoint(): string
{
diff --git a/src/Requests/FileCabinets/Search/GetASpecificDocumentFromAFileCabinet.php b/src/Requests/FileCabinets/Search/GetASpecificDocumentFromAFileCabinet.php
index fb9a0ac..85ef4c4 100644
--- a/src/Requests/FileCabinets/Search/GetASpecificDocumentFromAFileCabinet.php
+++ b/src/Requests/FileCabinets/Search/GetASpecificDocumentFromAFileCabinet.php
@@ -21,8 +21,7 @@ class GetASpecificDocumentFromAFileCabinet extends Request implements Cacheable
public function __construct(
protected readonly string $fileCabinetId,
protected readonly string $documentId,
- ) {
- }
+ ) {}
public function resolveEndpoint(): string
{
diff --git a/src/Requests/FileCabinets/Search/GetDocumentsFromAFileCabinet.php b/src/Requests/FileCabinets/Search/GetDocumentsFromAFileCabinet.php
index ce4790e..537611d 100644
--- a/src/Requests/FileCabinets/Search/GetDocumentsFromAFileCabinet.php
+++ b/src/Requests/FileCabinets/Search/GetDocumentsFromAFileCabinet.php
@@ -23,8 +23,7 @@ public function __construct(
protected readonly array $fields = [],
protected readonly int $page = 1,
protected readonly int $perPage = 50,
- ) {
- }
+ ) {}
public function defaultQuery(): array
{
diff --git a/src/Requests/FileCabinets/SelectLists/GetFilteredSelectLists.php b/src/Requests/FileCabinets/SelectLists/GetFilteredSelectLists.php
index 62433ac..df675a8 100644
--- a/src/Requests/FileCabinets/SelectLists/GetFilteredSelectLists.php
+++ b/src/Requests/FileCabinets/SelectLists/GetFilteredSelectLists.php
@@ -21,8 +21,7 @@ public function __construct(
protected readonly string $fileCabinetId,
protected readonly string $dialogId,
protected readonly string $fieldName,
- ) {
- }
+ ) {}
public function resolveEndpoint(): string
{
diff --git a/src/Requests/FileCabinets/SelectLists/GetSelectLists.php b/src/Requests/FileCabinets/SelectLists/GetSelectLists.php
index 0f48f43..7b70a4c 100644
--- a/src/Requests/FileCabinets/SelectLists/GetSelectLists.php
+++ b/src/Requests/FileCabinets/SelectLists/GetSelectLists.php
@@ -21,8 +21,7 @@ public function __construct(
protected readonly string $fileCabinetId,
protected readonly string $dialogId,
protected readonly string $fieldName,
- ) {
- }
+ ) {}
public function resolveEndpoint(): string
{
diff --git a/src/Requests/FileCabinets/Upload/CreateDataRecord.php b/src/Requests/FileCabinets/Upload/CreateDataRecord.php
index d090cdd..fb44e8a 100644
--- a/src/Requests/FileCabinets/Upload/CreateDataRecord.php
+++ b/src/Requests/FileCabinets/Upload/CreateDataRecord.php
@@ -24,8 +24,7 @@ public function __construct(
protected readonly ?string $fileContent,
protected readonly ?string $fileName,
protected readonly ?Collection $indexes = null,
- ) {
- }
+ ) {}
public function resolveEndpoint(): string
{
diff --git a/src/Requests/General/Organization/GetAllFileCabinetsAndDocumentTrays.php b/src/Requests/General/Organization/GetAllFileCabinetsAndDocumentTrays.php
index 3aecc61..06a31e4 100644
--- a/src/Requests/General/Organization/GetAllFileCabinetsAndDocumentTrays.php
+++ b/src/Requests/General/Organization/GetAllFileCabinetsAndDocumentTrays.php
@@ -24,8 +24,7 @@ class GetAllFileCabinetsAndDocumentTrays extends Request implements Cacheable
*/
public function __construct(
public ?string $organizationId = null,
- ) {
- }
+ ) {}
public function resolveEndpoint(): string
{
diff --git a/src/Requests/General/Organization/GetLoginToken.php b/src/Requests/General/Organization/GetLoginToken.php
index 5ece850..12f65fb 100644
--- a/src/Requests/General/Organization/GetLoginToken.php
+++ b/src/Requests/General/Organization/GetLoginToken.php
@@ -24,8 +24,7 @@ public function __construct(
public array $targetProducts = ['PlatformService'],
public string $usage = 'Multi',
public string $lifetime = '1.00:00:00',
- ) {
- }
+ ) {}
public function resolveEndpoint(): string
{
diff --git a/src/Requests/General/UserManagement/CreateUpdateUsers/CreateUser.php b/src/Requests/General/UserManagement/CreateUpdateUsers/CreateUser.php
index ff3a5b4..ec6cb16 100644
--- a/src/Requests/General/UserManagement/CreateUpdateUsers/CreateUser.php
+++ b/src/Requests/General/UserManagement/CreateUpdateUsers/CreateUser.php
@@ -24,8 +24,7 @@ class CreateUser extends Request implements Cacheable, HasBody
public function __construct(
protected readonly User $user,
- ) {
- }
+ ) {}
public function resolveEndpoint(): string
{
diff --git a/src/Requests/General/UserManagement/CreateUpdateUsers/UpdateUser.php b/src/Requests/General/UserManagement/CreateUpdateUsers/UpdateUser.php
index 8e0c43d..2d06e91 100644
--- a/src/Requests/General/UserManagement/CreateUpdateUsers/UpdateUser.php
+++ b/src/Requests/General/UserManagement/CreateUpdateUsers/UpdateUser.php
@@ -23,8 +23,7 @@ class UpdateUser extends Request implements Cacheable, HasBody
public function __construct(
protected readonly User $user,
- ) {
- }
+ ) {}
public function resolveEndpoint(): string
{
diff --git a/src/Requests/General/UserManagement/GetModifyGroups/AddUserToAGroup.php b/src/Requests/General/UserManagement/GetModifyGroups/AddUserToAGroup.php
index 94064fb..00db60d 100644
--- a/src/Requests/General/UserManagement/GetModifyGroups/AddUserToAGroup.php
+++ b/src/Requests/General/UserManagement/GetModifyGroups/AddUserToAGroup.php
@@ -19,8 +19,7 @@ class AddUserToAGroup extends Request implements HasBody
public function __construct(
public string $userId,
public array $ids
- ) {
- }
+ ) {}
public function resolveEndpoint(): string
{
diff --git a/src/Requests/General/UserManagement/GetModifyGroups/GetAllGroupsForASpecificUser.php b/src/Requests/General/UserManagement/GetModifyGroups/GetAllGroupsForASpecificUser.php
index c81f358..7d3812b 100644
--- a/src/Requests/General/UserManagement/GetModifyGroups/GetAllGroupsForASpecificUser.php
+++ b/src/Requests/General/UserManagement/GetModifyGroups/GetAllGroupsForASpecificUser.php
@@ -23,8 +23,7 @@ public function __construct(
public string $userId,
public ?string $name = null,
public ?bool $active = null,
- ) {
- }
+ ) {}
public function resolveEndpoint(): string
{
diff --git a/src/Requests/General/UserManagement/GetModifyGroups/GetGroups.php b/src/Requests/General/UserManagement/GetModifyGroups/GetGroups.php
index 616669a..bfcb872 100644
--- a/src/Requests/General/UserManagement/GetModifyGroups/GetGroups.php
+++ b/src/Requests/General/UserManagement/GetModifyGroups/GetGroups.php
@@ -22,8 +22,7 @@ class GetGroups extends Request implements Cacheable
public function __construct(
public ?string $name = null,
public ?bool $active = null,
- ) {
- }
+ ) {}
public function resolveEndpoint(): string
{
diff --git a/src/Requests/General/UserManagement/GetModifyGroups/RemoveUserFromAGroup.php b/src/Requests/General/UserManagement/GetModifyGroups/RemoveUserFromAGroup.php
index 91786e4..a1a04cf 100644
--- a/src/Requests/General/UserManagement/GetModifyGroups/RemoveUserFromAGroup.php
+++ b/src/Requests/General/UserManagement/GetModifyGroups/RemoveUserFromAGroup.php
@@ -19,8 +19,7 @@ class RemoveUserFromAGroup extends Request implements HasBody
public function __construct(
public string $userId,
public array $ids
- ) {
- }
+ ) {}
public function resolveEndpoint(): string
{
diff --git a/src/Requests/General/UserManagement/GetModifyRoles/AddUserToARole.php b/src/Requests/General/UserManagement/GetModifyRoles/AddUserToARole.php
index 0c9a610..f61095b 100644
--- a/src/Requests/General/UserManagement/GetModifyRoles/AddUserToARole.php
+++ b/src/Requests/General/UserManagement/GetModifyRoles/AddUserToARole.php
@@ -19,8 +19,7 @@ class AddUserToARole extends Request implements HasBody
public function __construct(
public string $userId,
public array $ids
- ) {
- }
+ ) {}
public function resolveEndpoint(): string
{
diff --git a/src/Requests/General/UserManagement/GetModifyRoles/GetAllRolesForASpecificUser.php b/src/Requests/General/UserManagement/GetModifyRoles/GetAllRolesForASpecificUser.php
index 6d469c6..5d2b70b 100644
--- a/src/Requests/General/UserManagement/GetModifyRoles/GetAllRolesForASpecificUser.php
+++ b/src/Requests/General/UserManagement/GetModifyRoles/GetAllRolesForASpecificUser.php
@@ -24,8 +24,7 @@ public function __construct(
public ?string $name = null,
public ?bool $active = null,
public ?string $type = null,
- ) {
- }
+ ) {}
public function resolveEndpoint(): string
{
diff --git a/src/Requests/General/UserManagement/GetModifyRoles/GetRoles.php b/src/Requests/General/UserManagement/GetModifyRoles/GetRoles.php
index f36cf9e..961b251 100644
--- a/src/Requests/General/UserManagement/GetModifyRoles/GetRoles.php
+++ b/src/Requests/General/UserManagement/GetModifyRoles/GetRoles.php
@@ -23,8 +23,7 @@ public function __construct(
public ?string $name = null,
public ?bool $active = null,
public ?string $type = null,
- ) {
- }
+ ) {}
public function resolveEndpoint(): string
{
diff --git a/src/Requests/General/UserManagement/GetModifyRoles/RemoveUserFromARole.php b/src/Requests/General/UserManagement/GetModifyRoles/RemoveUserFromARole.php
index bf53307..abc7cf7 100644
--- a/src/Requests/General/UserManagement/GetModifyRoles/RemoveUserFromARole.php
+++ b/src/Requests/General/UserManagement/GetModifyRoles/RemoveUserFromARole.php
@@ -19,8 +19,7 @@ class RemoveUserFromARole extends Request implements HasBody
public function __construct(
public string $userId,
public array $ids
- ) {
- }
+ ) {}
public function resolveEndpoint(): string
{
diff --git a/src/Requests/General/UserManagement/GetUsers/GetUserById.php b/src/Requests/General/UserManagement/GetUsers/GetUserById.php
index 9d724c8..c48fd1a 100644
--- a/src/Requests/General/UserManagement/GetUsers/GetUserById.php
+++ b/src/Requests/General/UserManagement/GetUsers/GetUserById.php
@@ -20,8 +20,7 @@ class GetUserById extends Request implements Cacheable
public function __construct(
public string $userId,
- ) {
- }
+ ) {}
public function resolveEndpoint(): string
{
diff --git a/src/Requests/General/UserManagement/GetUsers/GetUsers.php b/src/Requests/General/UserManagement/GetUsers/GetUsers.php
index c161f85..5645dc0 100644
--- a/src/Requests/General/UserManagement/GetUsers/GetUsers.php
+++ b/src/Requests/General/UserManagement/GetUsers/GetUsers.php
@@ -22,8 +22,7 @@ class GetUsers extends Request implements Cacheable
public function __construct(
public ?string $name = null,
public ?bool $active = null,
- ) {
- }
+ ) {}
public function resolveEndpoint(): string
{
diff --git a/src/Requests/General/UserManagement/GetUsers/GetUsersOfAGroup.php b/src/Requests/General/UserManagement/GetUsers/GetUsersOfAGroup.php
index e4054c9..753ae7b 100644
--- a/src/Requests/General/UserManagement/GetUsers/GetUsersOfAGroup.php
+++ b/src/Requests/General/UserManagement/GetUsers/GetUsersOfAGroup.php
@@ -21,8 +21,7 @@ class GetUsersOfAGroup extends Request implements Cacheable
public function __construct(
public ?string $groupId = null,
- ) {
- }
+ ) {}
public function resolveEndpoint(): string
{
diff --git a/src/Requests/General/UserManagement/GetUsers/GetUsersOfARole.php b/src/Requests/General/UserManagement/GetUsers/GetUsersOfARole.php
index 3e0a90a..217cfd2 100644
--- a/src/Requests/General/UserManagement/GetUsers/GetUsersOfARole.php
+++ b/src/Requests/General/UserManagement/GetUsers/GetUsersOfARole.php
@@ -22,8 +22,7 @@ class GetUsersOfARole extends Request implements Cacheable
public function __construct(
public ?string $roleId = null,
public ?bool $includeGroupUsers = null,
- ) {
- }
+ ) {}
public function resolveEndpoint(): string
{
diff --git a/src/Requests/Search/GetSearchRequest.php b/src/Requests/Search/GetSearchRequest.php
index 0b49f54..2438c00 100644
--- a/src/Requests/Search/GetSearchRequest.php
+++ b/src/Requests/Search/GetSearchRequest.php
@@ -31,8 +31,7 @@ public function __construct(
protected readonly string $orderField = 'DWSTOREDATETIME',
protected readonly string $orderDirection = 'asc',
protected readonly array $condition = [],
- ) {
- }
+ ) {}
public function resolveEndpoint(): string
{
diff --git a/src/Requests/Workflow/GetDocumentWorkflowHistory.php b/src/Requests/Workflow/GetDocumentWorkflowHistory.php
index a792088..e3fd08e 100644
--- a/src/Requests/Workflow/GetDocumentWorkflowHistory.php
+++ b/src/Requests/Workflow/GetDocumentWorkflowHistory.php
@@ -21,8 +21,7 @@ class GetDocumentWorkflowHistory extends Request implements Cacheable
public function __construct(
protected readonly string $fileCabinetId,
protected readonly string $documentId,
- ) {
- }
+ ) {}
public function resolveEndpoint(): string
{
diff --git a/src/Requests/Workflow/GetDocumentWorkflowHistorySteps.php b/src/Requests/Workflow/GetDocumentWorkflowHistorySteps.php
index d596486..4799212 100644
--- a/src/Requests/Workflow/GetDocumentWorkflowHistorySteps.php
+++ b/src/Requests/Workflow/GetDocumentWorkflowHistorySteps.php
@@ -21,8 +21,7 @@ class GetDocumentWorkflowHistorySteps extends Request implements Cacheable
public function __construct(
protected readonly string $workflowId,
protected readonly string $workflowInstanceId,
- ) {
- }
+ ) {}
public function resolveEndpoint(): string
{
From 5d4e74e1ea4de1ea4b28e43547b11e6f66eb93a7 Mon Sep 17 00:00:00 2001
From: Rhys Lees <43909932+RhysLees@users.noreply.github.com>
Date: Thu, 4 Jul 2024 22:07:02 +0200
Subject: [PATCH 47/54] WIP
---
.../Documents/AnnotationsStaps/AddStampWithBestPositionTest.php | 2 +-
.../Documents/AnnotationsStaps/AddStampWithPositionTest.php | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/tests/Feature/Requests/Documents/AnnotationsStaps/AddStampWithBestPositionTest.php b/tests/Feature/Requests/Documents/AnnotationsStaps/AddStampWithBestPositionTest.php
index 3e615f3..db803c9 100644
--- a/tests/Feature/Requests/Documents/AnnotationsStaps/AddStampWithBestPositionTest.php
+++ b/tests/Feature/Requests/Documents/AnnotationsStaps/AddStampWithBestPositionTest.php
@@ -27,6 +27,7 @@
items: collect([
new AnnotationItem(
type: 'StampPlacement',
+ layer: 1,
field: collect([
new AnnotationItemField(
name: '<#1>',
@@ -38,7 +39,6 @@
textAsString: 'Test',
),
]),
- layer: 1,
stampId: 'e1b3f6cc-ed69-4af2-afa5-6d990c0144c5',
),
]),
diff --git a/tests/Feature/Requests/Documents/AnnotationsStaps/AddStampWithPositionTest.php b/tests/Feature/Requests/Documents/AnnotationsStaps/AddStampWithPositionTest.php
index dfbf8e7..cbe6e6b 100644
--- a/tests/Feature/Requests/Documents/AnnotationsStaps/AddStampWithPositionTest.php
+++ b/tests/Feature/Requests/Documents/AnnotationsStaps/AddStampWithPositionTest.php
@@ -28,6 +28,7 @@
items: collect([
new AnnotationItem(
type: 'StampPlacement',
+ layer: 1,
field: collect([
new AnnotationItemField(
name: '<#1>',
@@ -39,7 +40,6 @@
textAsString: 'Test',
),
]),
- layer: 1,
location: new AnnotationItemLocation(
x: 0.5,
y: 0.5,
From 9de52701c001de04add24a8e525710d7b7bc9db8 Mon Sep 17 00:00:00 2001
From: Rhys Lees <43909932+RhysLees@users.noreply.github.com>
Date: Thu, 4 Jul 2024 22:13:54 +0200
Subject: [PATCH 48/54] WIP
---
.../AddLineEntryAnnotationTest.php | 0
.../AddRectEntryAnnotationTest.php | 0
.../AddStampWithBestPositionTest.php | 0
.../AddStampWithPositionTest.php | 0
.../AddTextAnnotationTest.php | 0
.../UpdateTextAnnotationTest.php | 0
6 files changed, 0 insertions(+), 0 deletions(-)
rename tests/Feature/Requests/Documents/{AnnotationsStaps => AnnotationsStamps}/AddLineEntryAnnotationTest.php (100%)
rename tests/Feature/Requests/Documents/{AnnotationsStaps => AnnotationsStamps}/AddRectEntryAnnotationTest.php (100%)
rename tests/Feature/Requests/Documents/{AnnotationsStaps => AnnotationsStamps}/AddStampWithBestPositionTest.php (100%)
rename tests/Feature/Requests/Documents/{AnnotationsStaps => AnnotationsStamps}/AddStampWithPositionTest.php (100%)
rename tests/Feature/Requests/Documents/{AnnotationsStaps => AnnotationsStamps}/AddTextAnnotationTest.php (100%)
rename tests/Feature/Requests/Documents/{AnnotationsStaps => AnnotationsStamps}/UpdateTextAnnotationTest.php (100%)
diff --git a/tests/Feature/Requests/Documents/AnnotationsStaps/AddLineEntryAnnotationTest.php b/tests/Feature/Requests/Documents/AnnotationsStamps/AddLineEntryAnnotationTest.php
similarity index 100%
rename from tests/Feature/Requests/Documents/AnnotationsStaps/AddLineEntryAnnotationTest.php
rename to tests/Feature/Requests/Documents/AnnotationsStamps/AddLineEntryAnnotationTest.php
diff --git a/tests/Feature/Requests/Documents/AnnotationsStaps/AddRectEntryAnnotationTest.php b/tests/Feature/Requests/Documents/AnnotationsStamps/AddRectEntryAnnotationTest.php
similarity index 100%
rename from tests/Feature/Requests/Documents/AnnotationsStaps/AddRectEntryAnnotationTest.php
rename to tests/Feature/Requests/Documents/AnnotationsStamps/AddRectEntryAnnotationTest.php
diff --git a/tests/Feature/Requests/Documents/AnnotationsStaps/AddStampWithBestPositionTest.php b/tests/Feature/Requests/Documents/AnnotationsStamps/AddStampWithBestPositionTest.php
similarity index 100%
rename from tests/Feature/Requests/Documents/AnnotationsStaps/AddStampWithBestPositionTest.php
rename to tests/Feature/Requests/Documents/AnnotationsStamps/AddStampWithBestPositionTest.php
diff --git a/tests/Feature/Requests/Documents/AnnotationsStaps/AddStampWithPositionTest.php b/tests/Feature/Requests/Documents/AnnotationsStamps/AddStampWithPositionTest.php
similarity index 100%
rename from tests/Feature/Requests/Documents/AnnotationsStaps/AddStampWithPositionTest.php
rename to tests/Feature/Requests/Documents/AnnotationsStamps/AddStampWithPositionTest.php
diff --git a/tests/Feature/Requests/Documents/AnnotationsStaps/AddTextAnnotationTest.php b/tests/Feature/Requests/Documents/AnnotationsStamps/AddTextAnnotationTest.php
similarity index 100%
rename from tests/Feature/Requests/Documents/AnnotationsStaps/AddTextAnnotationTest.php
rename to tests/Feature/Requests/Documents/AnnotationsStamps/AddTextAnnotationTest.php
diff --git a/tests/Feature/Requests/Documents/AnnotationsStaps/UpdateTextAnnotationTest.php b/tests/Feature/Requests/Documents/AnnotationsStamps/UpdateTextAnnotationTest.php
similarity index 100%
rename from tests/Feature/Requests/Documents/AnnotationsStaps/UpdateTextAnnotationTest.php
rename to tests/Feature/Requests/Documents/AnnotationsStamps/UpdateTextAnnotationTest.php
From 66497d3d63cdeba53c591c2bba46d86a9aa24fd7 Mon Sep 17 00:00:00 2001
From: Rhys Lees <43909932+RhysLees@users.noreply.github.com>
Date: Thu, 4 Jul 2024 22:31:26 +0200
Subject: [PATCH 49/54] Remove AnnotationsStamps
---
.gitignore | 9 ++
.../AnnotationsStamps/Annotation.php | 30 -----
.../AnnotationsStamps/AnnotationItem.php | 117 ------------------
.../AnnotationItemCreated.php | 29 -----
.../AnnotationsStamps/AnnotationItemField.php | 35 ------
.../AnnotationItemFieldTypedValue.php | 29 -----
.../AnnotationsStamps/AnnotationItemFont.php | 44 -------
.../AnnotationsStamps/AnnotationItemLayer.php | 30 -----
.../AnnotationItemLayerItem.php | 103 ---------------
.../AnnotationItemLocation.php | 38 ------
.../AnnotationsStamps/AnnotationPlacement.php | 28 -----
.../AnnotationsStamps/Annotations.php | 46 -------
.../AddLineEntryAnnotation.php | 5 -
.../AddRectEntryAnnotation.php | 5 -
.../AddStampWithBestPosition.php | 5 -
.../AddStampWithPosition.php | 47 -------
.../AnnotationsStamps/AddTextAnnotation.php | 5 -
.../UpdateTextAnnotation.php | 5 -
.../AddStampWithPositionResponse.php | 24 ----
.../AddLineEntryAnnotationTest.php | 69 -----------
.../AddRectEntryAnnotationTest.php | 68 ----------
.../AddStampWithBestPositionTest.php | 58 ---------
.../AddStampWithPositionTest.php | 63 ----------
.../AddTextAnnotationTest.php | 77 ------------
.../UpdateTextAnnotationTest.php | 78 ------------
25 files changed, 9 insertions(+), 1038 deletions(-)
delete mode 100644 src/DTO/Documents/AnnotationsStamps/Annotation.php
delete mode 100644 src/DTO/Documents/AnnotationsStamps/AnnotationItem.php
delete mode 100644 src/DTO/Documents/AnnotationsStamps/AnnotationItemCreated.php
delete mode 100644 src/DTO/Documents/AnnotationsStamps/AnnotationItemField.php
delete mode 100644 src/DTO/Documents/AnnotationsStamps/AnnotationItemFieldTypedValue.php
delete mode 100644 src/DTO/Documents/AnnotationsStamps/AnnotationItemFont.php
delete mode 100644 src/DTO/Documents/AnnotationsStamps/AnnotationItemLayer.php
delete mode 100644 src/DTO/Documents/AnnotationsStamps/AnnotationItemLayerItem.php
delete mode 100644 src/DTO/Documents/AnnotationsStamps/AnnotationItemLocation.php
delete mode 100644 src/DTO/Documents/AnnotationsStamps/AnnotationPlacement.php
delete mode 100644 src/DTO/Documents/AnnotationsStamps/Annotations.php
delete mode 100644 src/Requests/Documents/AnnotationsStamps/AddLineEntryAnnotation.php
delete mode 100644 src/Requests/Documents/AnnotationsStamps/AddRectEntryAnnotation.php
delete mode 100644 src/Requests/Documents/AnnotationsStamps/AddStampWithBestPosition.php
delete mode 100644 src/Requests/Documents/AnnotationsStamps/AddStampWithPosition.php
delete mode 100644 src/Requests/Documents/AnnotationsStamps/AddTextAnnotation.php
delete mode 100644 src/Requests/Documents/AnnotationsStamps/UpdateTextAnnotation.php
delete mode 100644 src/Responses/Documents/AnnotationsStamps/AddStampWithPositionResponse.php
delete mode 100644 tests/Feature/Requests/Documents/AnnotationsStamps/AddLineEntryAnnotationTest.php
delete mode 100644 tests/Feature/Requests/Documents/AnnotationsStamps/AddRectEntryAnnotationTest.php
delete mode 100644 tests/Feature/Requests/Documents/AnnotationsStamps/AddStampWithBestPositionTest.php
delete mode 100644 tests/Feature/Requests/Documents/AnnotationsStamps/AddStampWithPositionTest.php
delete mode 100644 tests/Feature/Requests/Documents/AnnotationsStamps/AddTextAnnotationTest.php
delete mode 100644 tests/Feature/Requests/Documents/AnnotationsStamps/UpdateTextAnnotationTest.php
diff --git a/.gitignore b/.gitignore
index e8de7f7..2a6a14c 100644
--- a/.gitignore
+++ b/.gitignore
@@ -11,3 +11,12 @@ testbench.yaml
vendor
node_modules
.phpactor.json
+
+
+
+## Annotations
+
+src/DTO/Documents/AnnotationsStamps/*
+src/Requests/Documents/AnnotationsStamps/*
+src/Responses/Documents/AnnotationsStamps/*
+tests/Feature/Requests/Documents/AnnotationsStamps/*
diff --git a/src/DTO/Documents/AnnotationsStamps/Annotation.php b/src/DTO/Documents/AnnotationsStamps/Annotation.php
deleted file mode 100644
index 01991d4..0000000
--- a/src/DTO/Documents/AnnotationsStamps/Annotation.php
+++ /dev/null
@@ -1,30 +0,0 @@
-map(fn (array $item) => AnnotationItem::fromData($item)) : null,
- id: Arr::get($data, 'Id'),
- );
- }
-
- public function __construct(
- public ?Collection $items,
- public int $id,
- ) {}
-
- public function values(): array
- {
- return [
- 'Items' => $this->items->values(),
- 'Id' => $this->id,
- ];
- }
-}
diff --git a/src/DTO/Documents/AnnotationsStamps/AnnotationItem.php b/src/DTO/Documents/AnnotationsStamps/AnnotationItem.php
deleted file mode 100644
index 4c60ea5..0000000
--- a/src/DTO/Documents/AnnotationsStamps/AnnotationItem.php
+++ /dev/null
@@ -1,117 +0,0 @@
-map(fn (array $layer) => AnnotationItemLayer::fromData($layer));
- } else {
- $layer = Arr::get($data, 'Layer');
- }
- }
-
- return new self(
- type: Arr::get($data, '$type'),
- layer: $layer ?? null,
- field: collect(Arr::get($data, 'Field'))
- ->map(fn (array $field) => AnnotationItemField::fromData($field)),
- password: Arr::get($data, 'Password'),
- font: Arr::has($data, 'Font') ? AnnotationItemFont::fromData(Arr::get($data, 'Font')) : null,
- location: Arr::has($data, 'Location') ? AnnotationItemLocation::fromData(Arr::get($data, 'Location')) : null,
- headFont: Arr::has($data, 'HeadFont') ? AnnotationItemFont::fromData(Arr::get($data, 'HeadFont')) : null,
- signature: Arr::get($data, 'Signature'),
- userName: Arr::get($data, 'UserName'),
- visible: Arr::get($data, 'Visible'),
- frame: Arr::get($data, 'Frame'),
- showUser: Arr::get($data, 'ShowUser'),
- showDate: Arr::get($data, 'ShowDate'),
- showTime: Arr::get($data, 'ShowTime'),
- created: Arr::has($data, 'Created') ? AnnotationItemCreated::fromData(Arr::get($data, 'Created')) : null,
- color: Arr::get($data, 'Color'),
- rotation: Arr::get($data, 'Rotation'),
- transparent: Arr::get($data, 'Transparent'),
- strokeWidth: Arr::get($data, 'StrokeWidth'),
- stampId: Arr::get($data, 'StampId') ?? Arr::get($data, 'Id'),
- );
- }
-
- public function __construct(
- public string $type,
- public null|Collection|int $layer = null,
- public ?Collection $field = null,
- public ?string $password = null,
- public ?AnnotationItemFont $font = null,
- public ?AnnotationItemLocation $location = null,
- public ?AnnotationItemFont $headFont = null,
- public ?string $signature = null,
- public ?string $userName = null,
- public ?bool $visible = null,
- public ?bool $frame = null,
- public ?bool $showUser = null,
- public ?bool $showDate = null,
- public ?bool $showTime = null,
- public ?AnnotationItemCreated $created = null,
- public ?string $color = null,
- public ?int $rotation = null,
- public ?bool $transparent = null,
- public ?int $strokeWidth = null,
- public ?string $stampId = null,
- ) {}
-
- public function values(): array
- {
- if ($this->layer instanceof Collection) {
- $layer = $this->layer->map(fn (AnnotationItemLayer $layer) => $layer->values())->toArray();
- } else {
- $layer = $this->layer;
- }
-
- $values = [
- '$type' => $this->type,
- 'Layer' => $layer,
- 'Field' => $this->field?->map(fn (AnnotationItemField $field) => $field->values())->toArray(),
- 'Password' => $this->password,
- 'Font' => $this->font,
- 'Location' => $this->location?->values(),
- 'HeadFont' => $this->headFont,
- 'StampId' => $this->stampId,
- ];
-
- if (is_null($values['Field'])) {
- unset($values['Field']);
- }
-
- if (is_null($values['Password'])) {
- unset($values['Password']);
- }
-
- if (is_null($values['Font'])) {
- unset($values['Font']);
- }
-
- if (is_null($values['Location'])) {
- unset($values['Location']);
- }
-
- if (is_null($values['HeadFont'])) {
- unset($values['HeadFont']);
- }
-
- if (is_null($values['StampId'])) {
- unset($values['StampId']);
- }
-
- if (is_null($values['Layer'])) {
- unset($values['Layer']);
- }
-
- return $values;
- }
-}
diff --git a/src/DTO/Documents/AnnotationsStamps/AnnotationItemCreated.php b/src/DTO/Documents/AnnotationsStamps/AnnotationItemCreated.php
deleted file mode 100644
index cc43ce1..0000000
--- a/src/DTO/Documents/AnnotationsStamps/AnnotationItemCreated.php
+++ /dev/null
@@ -1,29 +0,0 @@
- $this->user,
- 'Time' => $this->time,
- ];
- }
-}
diff --git a/src/DTO/Documents/AnnotationsStamps/AnnotationItemField.php b/src/DTO/Documents/AnnotationsStamps/AnnotationItemField.php
deleted file mode 100644
index 918a205..0000000
--- a/src/DTO/Documents/AnnotationsStamps/AnnotationItemField.php
+++ /dev/null
@@ -1,35 +0,0 @@
- $this->name,
- 'TypedValue' => $this->typedValue->values(),
- 'Value' => $this->value,
- 'TextAsString' => $this->textAsString,
- ];
- }
-}
diff --git a/src/DTO/Documents/AnnotationsStamps/AnnotationItemFieldTypedValue.php b/src/DTO/Documents/AnnotationsStamps/AnnotationItemFieldTypedValue.php
deleted file mode 100644
index 41f356b..0000000
--- a/src/DTO/Documents/AnnotationsStamps/AnnotationItemFieldTypedValue.php
+++ /dev/null
@@ -1,29 +0,0 @@
- $this->item,
- 'ItemElementName' => $this->itemElementName,
- ];
- }
-}
diff --git a/src/DTO/Documents/AnnotationsStamps/AnnotationItemFont.php b/src/DTO/Documents/AnnotationsStamps/AnnotationItemFont.php
deleted file mode 100644
index 4e578ee..0000000
--- a/src/DTO/Documents/AnnotationsStamps/AnnotationItemFont.php
+++ /dev/null
@@ -1,44 +0,0 @@
- $this->fontName,
- 'Bold' => $this->bold,
- 'Italic' => $this->italic,
- 'Underlined' => $this->underlined,
- 'StrikeThrough' => $this->strikeThrough,
- 'FontSize' => $this->fontSize,
- 'Spacing' => $this->spacing,
- ];
- }
-}
diff --git a/src/DTO/Documents/AnnotationsStamps/AnnotationItemLayer.php b/src/DTO/Documents/AnnotationsStamps/AnnotationItemLayer.php
deleted file mode 100644
index 828c67f..0000000
--- a/src/DTO/Documents/AnnotationsStamps/AnnotationItemLayer.php
+++ /dev/null
@@ -1,30 +0,0 @@
-map(fn (array $layer) => AnnotationItemLayerItem::fromData($layer)),
- );
- }
-
- public function __construct(
- public string $id,
- public Collection $items,
- ) {}
-
- public function values(): array
- {
- return [
- 'Id' => $this->id,
- 'Items' => $this->items->map(fn (AnnotationItemLayerItem $item) => $item->values())->toArray(),
- ];
- }
-}
diff --git a/src/DTO/Documents/AnnotationsStamps/AnnotationItemLayerItem.php b/src/DTO/Documents/AnnotationsStamps/AnnotationItemLayerItem.php
deleted file mode 100644
index 58ec1e6..0000000
--- a/src/DTO/Documents/AnnotationsStamps/AnnotationItemLayerItem.php
+++ /dev/null
@@ -1,103 +0,0 @@
- $this->type,
- 'Font' => $this->font?->values(),
- 'Value' => $this->value,
- 'Location' => $this->location?->values(),
- 'Color' => $this->color,
- 'Rotation' => $this->rotation,
- 'Transparent' => $this->transparent,
- 'StrokeWidth' => $this->strokeWidth,
- 'Filled' => $this->filled,
- 'Ellipse' => $this->ellipse,
- 'From' => $this->from?->values(),
- 'To' => $this->to?->values(),
- 'Arrow' => $this->arrow,
- 'Id' => $this->id,
- ];
-
- if (is_null($values['Location'])) {
- unset($values['Location']);
- }
-
- if (is_null($values['Font'])) {
- unset($values['Font']);
- }
-
- if (is_null($values['Value'])) {
- unset($values['Value']);
- }
-
- if (is_null($values['Filled'])) {
- unset($values['Filled']);
- }
-
- if (is_null($values['Ellipse'])) {
- unset($values['Ellipse']);
- }
-
- if (is_null($values['From'])) {
- unset($values['From']);
- }
-
- if (is_null($values['To'])) {
- unset($values['To']);
- }
-
- if (is_null($values['Arrow'])) {
- unset($values['Arrow']);
- }
-
- if (is_null($values['Id'])) {
- unset($values['Id']);
- }
-
- return $values;
- }
-}
diff --git a/src/DTO/Documents/AnnotationsStamps/AnnotationItemLocation.php b/src/DTO/Documents/AnnotationsStamps/AnnotationItemLocation.php
deleted file mode 100644
index 6ea0c30..0000000
--- a/src/DTO/Documents/AnnotationsStamps/AnnotationItemLocation.php
+++ /dev/null
@@ -1,38 +0,0 @@
- $this->x,
- 'Y' => $this->y,
- 'Left' => $this->left,
- 'Top' => $this->top,
- 'Width' => $this->width,
- 'Height' => $this->height,
- ];
- }
-}
diff --git a/src/DTO/Documents/AnnotationsStamps/AnnotationPlacement.php b/src/DTO/Documents/AnnotationsStamps/AnnotationPlacement.php
deleted file mode 100644
index 0474867..0000000
--- a/src/DTO/Documents/AnnotationsStamps/AnnotationPlacement.php
+++ /dev/null
@@ -1,28 +0,0 @@
-map(fn (array $item) => AnnotationItem::fromData($item)),
- );
- }
-
- public function __construct(
- public Collection $items,
- ) {}
-
- public function values(): array
- {
- return [
- 'Items' => $this->items->map(fn (AnnotationItem|AnnotationItemLayerItem $item) => $item->values())->toArray(),
- ];
- }
-}
diff --git a/src/DTO/Documents/AnnotationsStamps/Annotations.php b/src/DTO/Documents/AnnotationsStamps/Annotations.php
deleted file mode 100644
index a18d84d..0000000
--- a/src/DTO/Documents/AnnotationsStamps/Annotations.php
+++ /dev/null
@@ -1,46 +0,0 @@
-map(fn ($item) => Annotation::fromData($item)) : null,
- );
- }
-
- public function __construct(
- public ?int $pageNumber,
- public ?int $sectionNumber,
- public ?AnnotationPlacement $annotationsPlacement = null,
- public ?Collection $annotation = null,
- ) {}
-
- public function values(): array
- {
- $values = [
- 'PageNumber' => $this->pageNumber,
- 'SectionNumber' => $this->sectionNumber,
- 'AnnotationsPlacement' => $this->annotationsPlacement?->values(),
- 'Annotation' => $this->annotation?->map(fn (Annotation $item) => $item->values())->toArray(),
- ];
-
- if (is_null($values['AnnotationsPlacement'])) {
- unset($values['AnnotationsPlacement']);
- }
-
- if (is_null($values['Annotation'])) {
- unset($values['Annotation']);
- }
-
- return $values;
- }
-}
diff --git a/src/Requests/Documents/AnnotationsStamps/AddLineEntryAnnotation.php b/src/Requests/Documents/AnnotationsStamps/AddLineEntryAnnotation.php
deleted file mode 100644
index b6f4fcb..0000000
--- a/src/Requests/Documents/AnnotationsStamps/AddLineEntryAnnotation.php
+++ /dev/null
@@ -1,5 +0,0 @@
-fileCabinetId.'/Documents/'.$this->documentId.'/Annotation';
- }
-
- public function defaultBody(): array
- {
- ray($this->annotations->values());
-
- return [
- 'Annotations' => [
- $this->annotations->values(),
- ],
- ];
- }
-
- public function createDtoFromResponse(Response $response): Collection|Enumerable
- {
- return AddStampWithPositionResponse::fromResponse($response);
- }
-}
diff --git a/src/Requests/Documents/AnnotationsStamps/AddTextAnnotation.php b/src/Requests/Documents/AnnotationsStamps/AddTextAnnotation.php
deleted file mode 100644
index b1c409f..0000000
--- a/src/Requests/Documents/AnnotationsStamps/AddTextAnnotation.php
+++ /dev/null
@@ -1,5 +0,0 @@
-throw()->json('Annotations');
-
- return collect($data)->map(fn (array $item) => Annotations::fromData($item));
- }
-}
diff --git a/tests/Feature/Requests/Documents/AnnotationsStamps/AddLineEntryAnnotationTest.php b/tests/Feature/Requests/Documents/AnnotationsStamps/AddLineEntryAnnotationTest.php
deleted file mode 100644
index 9511034..0000000
--- a/tests/Feature/Requests/Documents/AnnotationsStamps/AddLineEntryAnnotationTest.php
+++ /dev/null
@@ -1,69 +0,0 @@
-connector, $fileCabinetId);
-
- [$document, $document2] = uploadFiles($this->connector, $fileCabinetId, $path);
-
- $annotations = new Annotations(
- pageNumber: 0,
- sectionNumber: 0,
- annotationsPlacement: new AnnotationPlacement(
- items: collect([
- new AnnotationItem(
- type: 'Annotation',
- layer: collect([
- new AnnotationItemLayer(
- id: 1,
- items: collect([
- new AnnotationItemLayerItem(
- type: 'LineEntry',
- color: 'Cyan',
- rotation: 0,
- transparent: false,
- strokeWidth: 50,
- arrow: false,
- from: new AnnotationItemLocation(
- x: 100,
- y: 100,
- ),
- to: new AnnotationItemLocation(
- x: 200,
- y: 200,
- ),
- ),
- ]),
- ),
- ]),
- ),
- ]),
- ),
- );
-
- $stamp = $this->connector->send(new AddLineEntryAnnotation(
- $fileCabinetId,
- $document->id,
- $annotations,
- ))->dto();
-
- expect($stamp)->toBeInstanceOf(Collection::class)
- ->and($stamp->first())->toBeInstanceOf(Annotations::class);
-
- Event::assertDispatched(DocuWareResponseLog::class);
-})->group('annotation')->only();
diff --git a/tests/Feature/Requests/Documents/AnnotationsStamps/AddRectEntryAnnotationTest.php b/tests/Feature/Requests/Documents/AnnotationsStamps/AddRectEntryAnnotationTest.php
deleted file mode 100644
index 486adbd..0000000
--- a/tests/Feature/Requests/Documents/AnnotationsStamps/AddRectEntryAnnotationTest.php
+++ /dev/null
@@ -1,68 +0,0 @@
-connector, $fileCabinetId);
-
- [$document, $document2] = uploadFiles($this->connector, $fileCabinetId, $path);
-
- $annotations = new Annotations(
- pageNumber: 0,
- sectionNumber: 0,
- annotationsPlacement: new AnnotationPlacement(
- items: collect([
- new AnnotationItem(
- type: 'Annotation',
- layer: collect([
- new AnnotationItemLayer(
- id: 1,
- items: collect([
- new AnnotationItemLayerItem(
- type: 'RectEntry',
- color: 'Bisque',
- rotation: 0,
- transparent: false,
- strokeWidth: 50,
- filled: true,
- ellipse: false,
- location: new AnnotationItemLocation(
- left: 100,
- top: 100,
- width: 1500,
- height: 100,
- ),
- ),
- ]),
- ),
- ]),
- ),
- ]),
- ),
- );
-
- $stamp = $this->connector->send(new AddRectEntryAnnotation(
- $fileCabinetId,
- $document->id,
- $annotations,
- ))->dto();
-
- expect($stamp)->toBeInstanceOf(Collection::class)
- ->and($stamp->first())->toBeInstanceOf(Annotations::class);
-
- Event::assertDispatched(DocuWareResponseLog::class);
-})->group('annotation')->only();
diff --git a/tests/Feature/Requests/Documents/AnnotationsStamps/AddStampWithBestPositionTest.php b/tests/Feature/Requests/Documents/AnnotationsStamps/AddStampWithBestPositionTest.php
deleted file mode 100644
index db803c9..0000000
--- a/tests/Feature/Requests/Documents/AnnotationsStamps/AddStampWithBestPositionTest.php
+++ /dev/null
@@ -1,58 +0,0 @@
-connector, $fileCabinetId);
-
- [$document, $document2] = uploadFiles($this->connector, $fileCabinetId, $path);
-
- $annotations = new Annotations(
- pageNumber: 0,
- sectionNumber: 0,
- annotationsPlacement: new AnnotationPlacement(
- items: collect([
- new AnnotationItem(
- type: 'StampPlacement',
- layer: 1,
- field: collect([
- new AnnotationItemField(
- name: '<#1>',
- typedValue: new AnnotationItemFieldTypedValue(
- item: 'Text',
- itemElementName: 'String',
- ),
- value: 'Test',
- textAsString: 'Test',
- ),
- ]),
- stampId: 'e1b3f6cc-ed69-4af2-afa5-6d990c0144c5',
- ),
- ]),
- ),
- );
-
- $stamp = $this->connector->send(new AddStampWithBestPosition(
- $fileCabinetId,
- $document->id,
- $annotations,
- ))->dto();
-
- expect($stamp)->toBeInstanceOf(Collection::class)
- ->and($stamp->first())->toBeInstanceOf(Annotations::class);
-
- Event::assertDispatched(DocuWareResponseLog::class);
-})->group('stamp');
diff --git a/tests/Feature/Requests/Documents/AnnotationsStamps/AddStampWithPositionTest.php b/tests/Feature/Requests/Documents/AnnotationsStamps/AddStampWithPositionTest.php
deleted file mode 100644
index cbe6e6b..0000000
--- a/tests/Feature/Requests/Documents/AnnotationsStamps/AddStampWithPositionTest.php
+++ /dev/null
@@ -1,63 +0,0 @@
-connector, $fileCabinetId);
-
- [$document, $document2] = uploadFiles($this->connector, $fileCabinetId, $path);
-
- $annotations = new Annotations(
- pageNumber: 0,
- sectionNumber: 0,
- annotationsPlacement: new AnnotationPlacement(
- items: collect([
- new AnnotationItem(
- type: 'StampPlacement',
- layer: 1,
- field: collect([
- new AnnotationItemField(
- name: '<#1>',
- typedValue: new AnnotationItemFieldTypedValue(
- item: 'Text',
- itemElementName: 'String',
- ),
- value: 'Test',
- textAsString: 'Test',
- ),
- ]),
- location: new AnnotationItemLocation(
- x: 0.5,
- y: 0.5,
- ),
- stampId: 'e1b3f6cc-ed69-4af2-afa5-6d990c0144c5',
- ),
- ]),
- ),
- );
-
- $stamp = $this->connector->send(new AddStampWithPosition(
- $fileCabinetId,
- $document->id,
- $annotations,
- ))->dto();
-
- expect($stamp)->toBeInstanceOf(Collection::class)
- ->and($stamp->first())->toBeInstanceOf(Annotations::class);
-
- Event::assertDispatched(DocuWareResponseLog::class);
-})->group('stamp');
diff --git a/tests/Feature/Requests/Documents/AnnotationsStamps/AddTextAnnotationTest.php b/tests/Feature/Requests/Documents/AnnotationsStamps/AddTextAnnotationTest.php
deleted file mode 100644
index ef25220..0000000
--- a/tests/Feature/Requests/Documents/AnnotationsStamps/AddTextAnnotationTest.php
+++ /dev/null
@@ -1,77 +0,0 @@
-connector, $fileCabinetId);
-
- [$document, $document2] = uploadFiles($this->connector, $fileCabinetId, $path);
-
- $annotations = new Annotations(
- pageNumber: 0,
- sectionNumber: 0,
- annotationsPlacement: new AnnotationPlacement(
- items: collect([
- new AnnotationItem(
- type: 'Annotation',
- layer: collect([
- new AnnotationItemLayer(
- id: 1,
- items: collect([
- new AnnotationItemLayerItem(
- type: 'TextEntry',
- color: 'Black',
- rotation: 0,
- transparent: false,
- strokeWidth: 50,
- value: 'Test',
- font: new AnnotationItemFont(
- fontName: 'Arial',
- bold: false,
- italic: false,
- underlined: false,
- strikeThrough: false,
- fontSize: 12,
- spacing: 0,
- ),
- location: new AnnotationItemLocation(
- left: 100,
- top: 100,
- width: 1500,
- height: 100,
- ),
- ),
- ]),
- ),
- ]),
- ),
- ]),
- ),
- );
-
- $stamp = $this->connector->send(new AddTextAnnotation(
- $fileCabinetId,
- $document->id,
- $annotations,
- ))->dto();
-
- expect($stamp)->toBeInstanceOf(Collection::class)
- ->and($stamp->first())->toBeInstanceOf(Annotations::class);
-
- Event::assertDispatched(DocuWareResponseLog::class);
-})->group('annotation')->only();
diff --git a/tests/Feature/Requests/Documents/AnnotationsStamps/UpdateTextAnnotationTest.php b/tests/Feature/Requests/Documents/AnnotationsStamps/UpdateTextAnnotationTest.php
deleted file mode 100644
index 8393ae7..0000000
--- a/tests/Feature/Requests/Documents/AnnotationsStamps/UpdateTextAnnotationTest.php
+++ /dev/null
@@ -1,78 +0,0 @@
-connector, $fileCabinetId);
-
- [$document, $document2] = uploadFiles($this->connector, $fileCabinetId, $path);
-
- $annotations = new Annotations(
- pageNumber: 0,
- sectionNumber: 0,
- annotationsPlacement: new AnnotationPlacement(
- items: collect([
- new AnnotationItem(
- type: 'Annotation',
- layer: collect([
- new AnnotationItemLayer(
- id: 1,
- items: collect([
- new AnnotationItemLayerItem(
- type: 'TextEntry',
- color: 'Black',
- rotation: 0,
- transparent: false,
- strokeWidth: 50,
- value: 'Test',
- font: new AnnotationItemFont(
- fontName: 'Arial',
- bold: false,
- italic: false,
- underlined: false,
- strikeThrough: false,
- fontSize: 12,
- spacing: 0,
- ),
- location: new AnnotationItemLocation(
- left: 100,
- top: 100,
- width: 1500,
- height: 100,
- ),
- id: 1,
- ),
- ]),
- ),
- ]),
- ),
- ]),
- ),
- );
-
- $stamp = $this->connector->send(new AddTextAnnotation(
- $fileCabinetId,
- $document->id,
- $annotations,
- ))->dto();
-
- expect($stamp)->toBeInstanceOf(Collection::class)
- ->and($stamp->first())->toBeInstanceOf(Annotations::class);
-
- Event::assertDispatched(DocuWareResponseLog::class);
-})->group('annotation')->only();
From d08432e53bec22b4599a4f7d236c5a09a0f0badf Mon Sep 17 00:00:00 2001
From: Rhys Lees <43909932+RhysLees@users.noreply.github.com>
Date: Mon, 8 Jul 2024 23:53:14 +0200
Subject: [PATCH 50/54] WIP
---
README.md | 2 +-
.../Upload/AppendFilesToADataRecord.php | 43 +++++++++
.../Upload/AppendFilesToADataRecordTest.php | 84 ++++++++++++++++++
tests/Fixtures/files/test-3.pdf | Bin 0 -> 8683 bytes
4 files changed, 128 insertions(+), 1 deletion(-)
create mode 100644 src/Requests/FileCabinets/Upload/AppendFilesToADataRecord.php
create mode 100644 tests/Feature/Requests/FileCabinets/Upload/AppendFilesToADataRecordTest.php
create mode 100644 tests/Fixtures/files/test-3.pdf
diff --git a/README.md b/README.md
index 28d501e..8a65ebe 100644
--- a/README.md
+++ b/README.md
@@ -103,7 +103,7 @@ then optimize the processes that power the core of your business.
| FileCabinets/CheckInCheckOut | Undo Check-out | 🕣 | |
| FileCabinets/SelectLists | Get Select Lists & Get Filtered Select Lists | ✅ | |
| FileCabinets/Upload | Create Data Record | ✅ | |
-| FileCabinets/Upload | Append File(s) to a Data Record | ❌ | - |
+| FileCabinets/Upload | Append File(s) to a Data Record | ✅ | - |
| FileCabinets/Upload | Upload a Single File for a Data Record | ❌ | - |
| FileCabinets/Upload | Create a Data Record & Upload File | ❌ | - |
| FileCabinets/Upload | Create Data Record & Upload File Using Store Dialog | ❌ | - |
diff --git a/src/Requests/FileCabinets/Upload/AppendFilesToADataRecord.php b/src/Requests/FileCabinets/Upload/AppendFilesToADataRecord.php
new file mode 100644
index 0000000..26a0f09
--- /dev/null
+++ b/src/Requests/FileCabinets/Upload/AppendFilesToADataRecord.php
@@ -0,0 +1,43 @@
+fileCabinetId.'/Documents/'.$this->dataRecordId;
+ }
+
+ protected function defaultBody(): array
+ {
+ return $this->files->toArray();
+ }
+
+ public function createDtoFromResponse(Response $response): Document
+ {
+ return CreateDataRecordResponse::fromResponse($response);
+ }
+}
diff --git a/tests/Feature/Requests/FileCabinets/Upload/AppendFilesToADataRecordTest.php b/tests/Feature/Requests/FileCabinets/Upload/AppendFilesToADataRecordTest.php
new file mode 100644
index 0000000..5dcafee
--- /dev/null
+++ b/tests/Feature/Requests/FileCabinets/Upload/AppendFilesToADataRecordTest.php
@@ -0,0 +1,84 @@
+connector->send(new CreateDataRecord(
+ fileCabinetId: $fileCabinetId,
+ fileContent: file_get_contents(__DIR__.'/../../../../Fixtures/files/test-1.pdf'),
+ fileName: 'test-1.pdf',
+ indexes: null
+ ))->dto();
+
+ $response = $this->connector->send(
+ new AppendFilesToADataRecord(
+ fileCabinetId: $fileCabinetId,
+ dataRecordId: $document->id,
+ files: collect([
+ new MultipartValue(
+ name: 'File[]',
+ value: file_get_contents(__DIR__.'/../../../../Fixtures/files/test-2.pdf'),
+ filename: 'test-2.pdf',
+ ),
+ ])
+ )
+ )->dto();
+
+ expect($response)->toBeInstanceOf(Document::class)
+ ->and($response->sections->count())->toBe(2)
+ ->and($response->sections->first()->originalFileName)->toBe('test-1.pdf')
+ ->and($response->sections->last()->originalFileName)->toBe('test-2.pdf');
+
+ Event::assertDispatched(DocuWareResponseLog::class);
+});
+
+it('can attach files to a data record', function () {
+ Event::fake();
+
+ $fileCabinetId = env('DOCUWARE_TESTS_FILE_CABINET_ID');
+
+ $document = $this->connector->send(new CreateDataRecord(
+ fileCabinetId: $fileCabinetId,
+ fileContent: file_get_contents(__DIR__.'/../../../../Fixtures/files/test-1.pdf'),
+ fileName: 'test-1.pdf',
+ indexes: null
+ ))->dto();
+
+ $response = $this->connector->send(
+ new AppendFilesToADataRecord(
+ fileCabinetId: $fileCabinetId,
+ dataRecordId: $document->id,
+ files: collect([
+ new MultipartValue(
+ name: 'File[]',
+ value: file_get_contents(__DIR__.'/../../../../Fixtures/files/test-2.pdf'),
+ filename: 'test-2.pdf',
+ ),
+ new MultipartValue(
+ name: 'File[]',
+ value: file_get_contents(__DIR__.'/../../../../Fixtures/files/test-3.pdf'),
+ filename: 'test-3.pdf',
+ ),
+ ])
+ )
+ )->dto();
+
+ ray($response->sections);
+
+ expect($response)->toBeInstanceOf(Document::class)
+ ->and($response->sections->count())->toBe(3)
+ ->and($response->sections->first()->originalFileName)->toBe('test-1.pdf')
+ ->and($response->sections->originalFileName)->toBe('test-2.pdf')
+ ->and($response->sections->last()->originalFileName)->toBe('test-2.pdf');
+
+ Event::assertDispatched(DocuWareResponseLog::class);
+})->only();
diff --git a/tests/Fixtures/files/test-3.pdf b/tests/Fixtures/files/test-3.pdf
new file mode 100644
index 0000000000000000000000000000000000000000..1142803e1a6f4cb3194e467e555d8a2d5878dcbd
GIT binary patch
literal 8683
zcmcJVby!qg*YE+!k#3L}kj@E)?gmj(=@?+>l5PYEY3UXL=@J1cL1_@B8)@m1kQ8_a
zy~F3epYQwLf4+0gHD}J+YoE2(UTe;^e`_CRHCcIXFb@>K+_7@7vQ>EaaLj@=1}OV!%W`ieY0e*$W2$xsLzb)tKYYKfkF8Ft)G9@6W_i~e8uDRx(*F20R{z_<
z>!n#<14!PXxB$)k>G7=q)Bz<}69D00{>NaDzivDL|K^F7mlJa6YH-V+-_8gJS0Du0
ztO4ZJK)5)%Ih!F|fPB9MGL8+fe
zApki6e;B*z{O7c(IXjwZB3yy`NQ<)aKwd3`rz_A9$SdP$=jg2I1UEwfZ)R7<1q_7!
zv>`5zoMWWfpJFX72vFcgjJ*5J4F6$3@HYbwkYnSOx`~YgGB7}1S%kZ_8A3xr`mg9f
z_`#6>9>3pXmX++Gr8z|&Hqb24JV?w4WIm$y#sLnCD3YP8hbui%LkkUNahJuACnaKk
zWUloARUwSgOpf&S(;(9coC89&u2ywfxs}-{Tb#Xe*x_9IWw-A9)LPxdl;xh^L?epY
zk0A6mR~^(Rd^tL#yIZXW#3X$kCuo#}sQ5al9~Lbv&=pQ)(MEqXi>0L%DRxyK@A5n`
zZ<^tHug2msejO0UC?Laxi2{%t;}`X3p;$pn)U58Lf?T72JW67Rgn}XDIXJmxjLRLB
zcE^RQoK3x{DJ)-esCE0P-toPNYEqj^XI{*ULeDWsWnQq%^Tk3mYbm9ptemiojGShw
zpnyozj6bch<-wlGe9-@kpeALL%_45*ZXBw^C48a8LHr
zCtUoL0rSff!t3P^Le`&q+qp8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(HP`yG7cj@y1GOY#opN$-+W#DH{EWnTdMl
zSY{r-&JxaSDUQ*f%TQFlN0NoRPP%;9mGLe57(L3AO;pca!a8>#A7(%CsFqvuPO;mg
zvGAo7n>;Sft_^O-4a0_n$EpFK4NkWQ!e*!9D$mMaP1fC7Xk;mw9*!sIB_{WL<|0Fo
z(UG8il{%EaprB29{a{h6mH3oiwKY$f%Pe90?y>EU^#G7TU|5d7+C;VY_{ZsCeRtTV
z{)^i%tWy5W5q#G?Cbz5NuzA|l7kXUE^T
zY3b84uUka~u7D|Ca39d9WGLm}_Hge%;{*FlU|T#rejUBXO6P
zPk&^(22h=*3|e^hjMPSN+0+GpGsFAd8iHLK*sx>aW6v=*{wT%9asJTP-3KyNKLP)S1KkDzh)P3=r{EIwi@!jq*|iI
z_58eU@5h`Et^H>9_0{rHg^Za*tfgs4b&Oc;OWDVsXGAI~X5c!Af
zXRm+ApaOhIQ2yESmt7Da@?C>}$e>UmWO?X6^`KyZf6HJXWHs_1di+BFvcU&|{98}x
zrabYVefjwK|K*1u2=bert1}!~0dW5L0)?ivHv&1&$hQm}9bJLQlG)GNpOS-xBM^L(
zCdj&}bAy7en0Shw=K|Tu@atmL;)EvfdDg=kX!~y?rm0#617guBw
S{fw|6SP%waW|mWx2mB8?<}XnI
literal 0
HcmV?d00001
From e938d4d1324cb6a897395b094d8b7d74f1d28adc Mon Sep 17 00:00:00 2001
From: RhysLees
Date: Mon, 8 Jul 2024 21:53:40 +0000
Subject: [PATCH 51/54] Fix styling
---
src/Requests/FileCabinets/Upload/AppendFilesToADataRecord.php | 3 ---
1 file changed, 3 deletions(-)
diff --git a/src/Requests/FileCabinets/Upload/AppendFilesToADataRecord.php b/src/Requests/FileCabinets/Upload/AppendFilesToADataRecord.php
index 26a0f09..6fb25a8 100644
--- a/src/Requests/FileCabinets/Upload/AppendFilesToADataRecord.php
+++ b/src/Requests/FileCabinets/Upload/AppendFilesToADataRecord.php
@@ -3,15 +3,12 @@
namespace CodebarAg\DocuWare\Requests\FileCabinets\Upload;
use CodebarAg\DocuWare\DTO\Documents\Document;
-use CodebarAg\DocuWare\DTO\Documents\DocumentIndex\PrepareDTO;
use CodebarAg\DocuWare\Responses\FileCabinets\Upload\CreateDataRecordResponse;
use Illuminate\Support\Collection;
use Saloon\Contracts\Body\HasBody;
-use Saloon\Data\MultipartValue;
use Saloon\Enums\Method;
use Saloon\Http\Request;
use Saloon\Http\Response;
-use Saloon\Traits\Body\HasFormBody;
use Saloon\Traits\Body\HasMultipartBody;
class AppendFilesToADataRecord extends Request implements HasBody
From 336db6f6232f4b6984e16eba57937cad43baa139 Mon Sep 17 00:00:00 2001
From: Rhys Lees <43909932+RhysLees@users.noreply.github.com>
Date: Thu, 11 Jul 2024 18:55:53 +0200
Subject: [PATCH 52/54] WIP
---
.phpunit.cache/test-results | 2 +-
.../Upload/AppendFilesToADataRecordTest.php | 14 ++++++++------
tests/Fixtures/files/test-3.pdf | Bin 8683 -> 8575 bytes
3 files changed, 9 insertions(+), 7 deletions(-)
diff --git a/.phpunit.cache/test-results b/.phpunit.cache/test-results
index 726f8fd..64b648f 100644
--- a/.phpunit.cache/test-results
+++ b/.phpunit.cache/test-results
@@ -1 +1 @@
-{"version":"pest_2.34.7","defects":[],"times":{"P\\Tests\\Local\\UpdateNichtHandelsrechnungenTest::__pest_evaluable_it_can_update_a_document_value":7.343}}
\ No newline at end of file
+{"version":"pest_2.34.9","defects":[],"times":{"P\\Tests\\Feature\\Requests\\FileCabinets\\Upload\\AppendFilesToADataRecordTest::__pest_evaluable_it_can_attach_files_to_a_data_record":0.563,"P\\Tests\\Feature\\Requests\\Documents\\ClipUnclipStapleUnstaple\\ClipTest::__pest_evaluable_it_can_clip_2_documents":7.226,"P\\Tests\\Feature\\Requests\\FileCabinets\\Dialogs\\GetDialogsOfASpecificTypeTest::__pest_evaluable_it_can_list_dialogs_for_a_file_cabinet":0.709,"P\\Tests\\Feature\\Requests\\FileCabinets\\Upload\\AppendFilesToADataRecordTest::__pest_evaluable_it_can_attach_a_file_to_a_data_record":1.051,"P\\Tests\\Unit\\DTO\\DocumentIndex\\IndexDateTimeDTOTest::__pest_evaluable_it_create_index_date_time_dto":0.001,"P\\Tests\\Unit\\DTO\\DocumentIndex\\IndexTextDTOTest::__pest_evaluable_it_create_prepare_index_text_dto":0,"P\\Tests\\Feature\\Requests\\General\\UserManagement\\GetUsers\\GetUsersOfAGroupTest::__pest_evaluable_it_can_list_users_of_a_group":0.873,"P\\Tests\\Feature\\Requests\\Documents\\Sections\\GetASpecificSectionTest::__pest_evaluable_it_can_get_a_specific_section":1.001,"P\\Tests\\Core\\ArchTest::__pest_evaluable_it_will_not_use_any_debug_function":0.202,"P\\Tests\\Feature\\Requests\\FileCabinets\\Search\\GetDocumentsFromAFileCabinetTest::__pest_evaluable_it_can_get_all_documents":1.128,"P\\Tests\\Feature\\Requests\\Documents\\ApplicationProperties\\ApplicationPropertiesTest::__pest_evaluable_it_can_add_get_update_delete_application_properties_to_a_document":1.321,"P\\Tests\\Feature\\Requests\\General\\UserManagement\\GetModifyRoles\\AddRemoveUserToARoleTest::__pest_evaluable_it_can_add_roles_to_a_user":7.208,"P\\Tests\\Feature\\Requests\\General\\UserManagement\\GetModifyRoles\\AddRemoveUserToARoleTest::__pest_evaluable_it_can_remove_roles_to_a_user":5.942,"P\\Tests\\Feature\\Requests\\Documents\\PutDocumentFieldsRequestTest::__pest_evaluable_it_can_update_multiple_document_values":0.897,"P\\Tests\\Feature\\Requests\\Documents\\PutDocumentFieldsRequestTest::__pest_evaluable_it_can_update_a_document_value":0.917,"P\\Tests\\Feature\\Requests\\Documents\\Download\\DownloadSectionTest::__pest_evaluable_it_can_download_a_section":0.958,"P\\Tests\\Feature\\Requests\\Documents\\ClipUnclipStapleUnstaple\\StapleTest::__pest_evaluable_it_can_staple_2_documents":12.678,"P\\Tests\\Feature\\Requests\\Documents\\ClipUnclipStapleUnstaple\\UnclipTest::__pest_evaluable_it_can_unclip_2_documents":12.252,"P\\Tests\\Feature\\DocuWareAuthenticationTest::__pest_evaluable_it_can_get_oath_responsible_identity_service":0.681,"P\\Tests\\Feature\\DocuWareAuthenticationTest::__pest_evaluable_it_can_authenticate_with_DocuWare_Credentials":0.657,"P\\Tests\\Feature\\DocuWareAuthenticationTest::__pest_evaluable_it_can_get_oath_identity_service_configuration":1.107,"P\\Tests\\Feature\\Requests\\FileCabinets\\Search\\GetASpecificDocumentFromAFileCabinetTest::__pest_evaluable_it_can_show_a_document":0.986,"P\\Tests\\Feature\\Requests\\General\\UserManagement\\GetModifyGroups\\GetGroupsTest::__pest_evaluable_it_can_list_groups":0.725,"P\\Tests\\Feature\\Requests\\Documents\\Thumbnail\\GetDocumentDownloadThumbnailRequestTest::__pest_evaluable_it_can_download_a_document_thumbnail":1.22,"P\\Tests\\Feature\\Requests\\Documents\\Download\\DownloadDocumentTest::__pest_evaluable_it_can_download_a_document":0.874,"P\\Tests\\Feature\\Requests\\Organization\\GetOrganizationsRequestTest::__pest_evaluable_it_can_list_organizations":0.689,"P\\Tests\\Feature\\Requests\\General\\UserManagement\\GetModifyGroups\\GetAllGroupsForASpecificUserTest::__pest_evaluable_it_can_list_groups_for_a_specific_user":0.92,"P\\Tests\\Feature\\Requests\\Fields\\GetFieldsRequestTest::__pest_evaluable_it_can_list_fields_for_a_file_cabinet":0.752,"P\\Tests\\Feature\\Requests\\General\\UserManagement\\GetUsers\\GetUserByIdTest::__pest_evaluable_it_can_get_user_by_id":1.005,"P\\Tests\\Feature\\Requests\\Documents\\Download\\DownloadThumbnailTest::__pest_evaluable_it_can_download_a_thumbnail":0.996,"P\\Tests\\Feature\\SleepTest::__pest_evaluable_sleep":0.544,"P\\Tests\\Feature\\Requests\\General\\UserManagement\\GetUsers\\GetUsersTest::__pest_evaluable_it_can_list_users":0.812,"P\\Tests\\Unit\\DTO\\DocumentIndex\\IndexDecimalDTOTest::__pest_evaluable_it_create_index_numeric_dto":0.001,"P\\Tests\\Feature\\Requests\\Documents\\PostDocumentRequestTest::__pest_evaluable_it_can_upload_document_with_index_values_and_delete_it":0.836,"P\\Tests\\Feature\\Requests\\Documents\\PostDocumentRequestTest::__pest_evaluable_it_can_upload_document_without_file_name_and_file_content_and_delete_it":0.76,"P\\Tests\\Feature\\Requests\\Search\\GetSearchRequestTest::__pest_evaluable_it_can_override_search_documents_dates_filter_by_using_equal_operator":0.72,"P\\Tests\\Feature\\Requests\\Search\\GetSearchRequestTest::__pest_evaluable_it_can_search_documents_with_null_values":0.714,"P\\Tests\\Feature\\Requests\\Search\\GetSearchRequestTest::__pest_evaluable_it_can_override_search_documents_dates_filter_by_using_same_operator":0.781,"P\\Tests\\Feature\\Requests\\Search\\GetSearchRequestTest::__pest_evaluable_it_can_t_search_documents_by_more_than_two_dates":0.544,"P\\Tests\\Feature\\Requests\\Search\\GetSearchRequestTest::__pest_evaluable_it_can_t_search_documents_by_diverged_date_range":0.555,"P\\Tests\\Feature\\Requests\\Search\\GetSearchRequestTest::__pest_evaluable_it_can_search_documents_dates_filter_in_future":0.763,"P\\Tests\\Feature\\Requests\\Search\\GetSearchRequestTest::__pest_evaluable_it_can_search_documents_dates_filter_in_past":0.816,"P\\Tests\\Feature\\Requests\\Search\\GetSearchRequestTest::__pest_evaluable_it_can_search_documents":0.779,"P\\Tests\\Feature\\Requests\\Search\\GetSearchRequestTest::__pest_evaluable_it_can_search_documents_with_multiple_values":1.354,"P\\Tests\\Feature\\Requests\\General\\UserManagement\\GetModifyGroups\\AddRemoveUserToAGroupTest::__pest_evaluable_it_can_add_groups_to_a_user":7.049,"P\\Tests\\Feature\\Requests\\General\\UserManagement\\GetModifyGroups\\AddRemoveUserToAGroupTest::__pest_evaluable_it_can_remove_groups_to_a_user":6.021,"P\\Tests\\Feature\\Requests\\Documents\\Sections\\DeleteSectionTest::__pest_evaluable_it_can_delete_a_specific_section":1.031,"P\\Tests\\Feature\\Requests\\FileCabinets\\Dialogs\\GetASpecificDialogTest::__pest_evaluable_it_can_get_a_dialog":0.767,"P\\Tests\\Feature\\Requests\\Workflow\\GetDocumentWorkflowHistoryTest::__pest_evaluable_it_can_get_document_workflow_history":5.948,"P\\Tests\\Feature\\Requests\\Documents\\GetDocumentPreviewRequestTest::__pest_evaluable_it_can_preview_a_document_image":1.154,"P\\Tests\\Unit\\DTO\\DocumentIndex\\IndexDateDTOTest::__pest_evaluable_it_create_index_date_dto":0.003,"P\\Tests\\Feature\\Requests\\Documents\\DocumentsTrashBin\\DeleteDocumentsFromTrashBinTest::__pest_evaluable_it_can_delete_documents_in_trash":1.141,"P\\Tests\\Unit\\DTO\\DocumentIndex\\PrepareTableDTOTest::__pest_evaluable_it_create_prepare_index_table_dto":0.002,"P\\Tests\\Feature\\Requests\\General\\UserManagement\\GetModifyRoles\\GetAllRolesForASpecificUserTest::__pest_evaluable_it_can_list_groups":1.082,"P\\Tests\\Feature\\Requests\\Documents\\Sections\\GetAllSectionsFromADocumentTest::__pest_evaluable_it_can_get_all_sections_from_a_document":0.904,"P\\Tests\\Feature\\Requests\\General\\UserManagement\\GetUsers\\GetUsersOfARoleTest::__pest_evaluable_it_can_list_users_of_a_role":0.767,"P\\Tests\\Feature\\Requests\\Documents\\DocumentsTrashBin\\RestoreDocumentsFromTrashBinTest::__pest_evaluable_it_can_restore_documents_in_trash":1.114,"P\\Tests\\Feature\\DTOTest::__pest_evaluable_it_create_a_fake_document_paginator":0.54,"P\\Tests\\Feature\\DTOTest::__pest_evaluable_it_create_a_fake_dialog":0.544,"P\\Tests\\Feature\\DTOTest::__pest_evaluable_it_create_a_fake_field":0.561,"P\\Tests\\Feature\\DTOTest::__pest_evaluable_it_create_a_fake_organization":0.549,"P\\Tests\\Feature\\DTOTest::__pest_evaluable_it_create_a_fake_table_row":0.562,"P\\Tests\\Feature\\DTOTest::__pest_evaluable_it_create_a_fake_document":0.554,"P\\Tests\\Feature\\DTOTest::__pest_evaluable_it_create_a_fake_organization_index":0.568,"P\\Tests\\Feature\\DTOTest::__pest_evaluable_it_create_a_fake_suggestion_field":0.535,"P\\Tests\\Feature\\DTOTest::__pest_evaluable_it_create_a_fake_file_cabinet":0.548,"P\\Tests\\Feature\\DTOTest::__pest_evaluable_it_create_a_fake_document_field":0.551,"P\\Tests\\Unit\\DTO\\DocumentIndex\\PrepareDTOTest::__pest_evaluable_it_create_prepare_makeContent_dto":0.001,"P\\Tests\\Unit\\DTO\\DocumentIndex\\PrepareDTOTest::__pest_evaluable_it_create_prepare_index_dto":0.002,"P\\Tests\\Feature\\Requests\\FileCabinets\\General\\GetFileCabinetInformationTest::__pest_evaluable_it_can_get_file_cabinet_information":0.83,"P\\Tests\\Feature\\Requests\\General\\UserManagement\\CreateUpdateUsers\\CreateUpdateUserTest::__pest_evaluable_it_can_create_users":1.484,"P\\Tests\\Feature\\Requests\\General\\UserManagement\\CreateUpdateUsers\\CreateUpdateUserTest::__pest_evaluable_it_can_update_users":6.052,"P\\Tests\\Unit\\DTO\\DocumentIndex\\IndexNumericDTOTest::__pest_evaluable_it_create_index_numeric_dto":0.001,"P\\Tests\\Feature\\DocuWareTest::__pest_evaluable_it_can_create_encrypted_url_for_a_document_in_a_basket":0.59,"P\\Tests\\Feature\\DocuWareTest::__pest_evaluable_it_can_create_encrypted_url_for_a_document_in_a_file_cabinet":0.541,"P\\Tests\\Unit\\DTO\\DocumentIndex\\IndexTableDTOTest::__pest_evaluable_it_create_prepare_index_text_dto":0.001,"P\\Tests\\Feature\\Requests\\Documents\\DocumentsTrashBin\\GetDocumentsFromTrashBinTest::__pest_evaluable_it_can_search_documents_with_null_values_in_trash":0.783,"P\\Tests\\Feature\\Requests\\Documents\\DocumentsTrashBin\\GetDocumentsFromTrashBinTest::__pest_evaluable_it_can_t_search_documents_by_diverged_date_range":0.546,"P\\Tests\\Feature\\Requests\\Documents\\DocumentsTrashBin\\GetDocumentsFromTrashBinTest::__pest_evaluable_it_can_override_search_documents_dates_filter_by_using_same_operator_in_trash":0.679,"P\\Tests\\Feature\\Requests\\Documents\\DocumentsTrashBin\\GetDocumentsFromTrashBinTest::__pest_evaluable_it_can_search_documents_dates_filter_in_future_in_trash":0.66,"P\\Tests\\Feature\\Requests\\Documents\\DocumentsTrashBin\\GetDocumentsFromTrashBinTest::__pest_evaluable_it_can_search_documents_dates_filter_in_past_in_trash":0.68,"P\\Tests\\Feature\\Requests\\Documents\\DocumentsTrashBin\\GetDocumentsFromTrashBinTest::__pest_evaluable_it_can_search_documents_in_trash":0.69,"P\\Tests\\Feature\\Requests\\Documents\\DocumentsTrashBin\\GetDocumentsFromTrashBinTest::__pest_evaluable_it_can_override_search_documents_dates_filter_by_using_equal_operator_in_trash":0.678,"P\\Tests\\Feature\\Requests\\Documents\\DocumentsTrashBin\\GetDocumentsFromTrashBinTest::__pest_evaluable_it_can_t_search_documents_by_more_than_two_dates_in_trash":0.534,"P\\Tests\\Feature\\Requests\\Workflow\\GetDocumentWorkflowHistoryStepsTest::__pest_evaluable_it_can_get_document_workflow_history":6.748,"P\\Tests\\Feature\\Requests\\Documents\\ClipUnclipStapleUnstaple\\UnstapleTest::__pest_evaluable_it_can_unstaple_a_document":13.846,"P\\Tests\\Feature\\Requests\\General\\UserManagement\\GetModifyRoles\\GetRolesTest::__pest_evaluable_it_can_list_groups":0.688,"P\\Tests\\Feature\\Requests\\Documents\\GetDocumentCountRequestTest::__pest_evaluable_it_can_get_a_total_count_of_documents":0.938}}
\ No newline at end of file
diff --git a/tests/Feature/Requests/FileCabinets/Upload/AppendFilesToADataRecordTest.php b/tests/Feature/Requests/FileCabinets/Upload/AppendFilesToADataRecordTest.php
index 5dcafee..8f06685 100644
--- a/tests/Feature/Requests/FileCabinets/Upload/AppendFilesToADataRecordTest.php
+++ b/tests/Feature/Requests/FileCabinets/Upload/AppendFilesToADataRecordTest.php
@@ -72,13 +72,15 @@
)
)->dto();
- ray($response->sections);
+ $sections = $response->sections->values();
+
+ ray($sections->toArray());
expect($response)->toBeInstanceOf(Document::class)
- ->and($response->sections->count())->toBe(3)
- ->and($response->sections->first()->originalFileName)->toBe('test-1.pdf')
- ->and($response->sections->originalFileName)->toBe('test-2.pdf')
- ->and($response->sections->last()->originalFileName)->toBe('test-2.pdf');
+ ->and($sections->count())->toBe(3)
+ ->and($sections[0]->originalFileName)->toBe('test-1.pdf')
+ ->and($sections[1]->originalFileName)->toBe('test-2.pdf')
+ ->and($sections[2]->originalFileName)->toBe('test-3.pdf');
Event::assertDispatched(DocuWareResponseLog::class);
-})->only();
+})->skip();
diff --git a/tests/Fixtures/files/test-3.pdf b/tests/Fixtures/files/test-3.pdf
index 1142803e1a6f4cb3194e467e555d8a2d5878dcbd..5cf3fc47436d832ae75f32e322520e746673d780 100644
GIT binary patch
literal 8575
zcmc&ZWmuHk)}+XgA_@w~fOHHq!vqLYLrAyMFu(vq%n(D#kyb$IQbJHlM7kxEl9W`s
zOF&9MLPhxo&+*=KKJRz`e(y8S^Uhv-?Y;K9Vz1)WQB)R%fM5XLg~k4N00a;W#9KQ8
zq@@93T0n7tn7lIqJFd@8*l&9r
zj{D74fk=47WI3JYmZ7-MvR@iq0r*VUIO
zekhfMk@8sJFZodpt<9Yzz=T7@NJs$8J4^`v2fPc?=bn8y3vD|vKBvE^-$t9=_LhZL
zz}gqW4=NwD&s6ea5|@hVxL78!LhE(e^zC)-nK;pUsjphC=*8kkAg1$StoPl74ahskzw&EAQRe0mw7N>+D8
zJrjp>>UrYl=B_767UTv@NNQQCSSwz`UecJkOmcDi*ciGnF{Gqaji{-rMpT0#Cs{ft
zo_lz;sY#{Vmp;F=XDr%gn6&(oJ4)L0==`wVA!qdwfaF>=DKKE0A#H?`BYG->;-itioyU)q$YH@|1-xIhp
zGm@HZ-B#NJt}FzwAC3C5QhG2+{6VkHd=8Wf1&Qgt$6ZMip3B=?HJb@=T#%*xmT+;!
zgh%Z=zg!fYRFB*s@OX+!hnZW>n*P4mli6<{!WgK6vfv6X?rvMMG+z((=dE|HK1e%~
z?1M`r_A%{NupG8!^2(8u#ZnkNAu$Nz8z66QA{!&|o1>TtVmM3k6bL9J6N#l5BH>&L
z+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qvuPO;mg
zvGAo7n>;Sft_^O-4a0_n$EpFK4NkWQ!e*!9D$mMaP1fC7Xk;mw9*!sIB_{WL<|0Fo
z(UG8il{%EaprB29{a{h6mH3oiwKY$f%Pe90?y>EU^#G7TU|5d7+C;VY_{ZsCeRtTV
z{)^i%tWy5W5q#G?Cbz5NuzA|l7kXUE^T
zY3b84uUka~u7D|Ca39d9WGLm}_Hge%;{*FlU|T#rejUBXO6P
zPk&^(22h=*3|e^hjMPSN+0+GpGsFAd8iHLK*sx>aW6v=*{wT%9asJTP-3KyNKLP)S1KkDzh)P3=r{EIwi@!jq*|iI
z_58eU@5h`Et^H>9_0{rHg^Za*tfgs4b&Oc;OWDVsXGAI~X5c!Af
zXRm+ApaOhIQ2yESmt7Da@?C>}$e>UmWO?X6^`KyZf6HJXWHs_1di+BFvcU&|{98}x
zrabYVefjwK|K*1u2=bert1}!~0dW5L0)?ivHv&1&$hQm}9bJLQlG)GNpOS-xBM^L(
zCdj&}bAy7en0Shw=K|Tu@atmL;)EvfdDg=kX!~y?rm0#617guBw
S{fw|6SP%waW|mWx2mB8?<}XnI
From 03e64669e2918cad366422e1a1aee508e572661d Mon Sep 17 00:00:00 2001
From: Rhys Lees <43909932+RhysLees@users.noreply.github.com>
Date: Mon, 29 Jul 2024 17:10:00 +0100
Subject: [PATCH 53/54] WIP
---
.phpunit.cache/test-results | 2 +-
README.md | 969 ++++++++++++++----
...etDocumentDownloadThumbnailRequestTest.php | 37 -
3 files changed, 773 insertions(+), 235 deletions(-)
delete mode 100644 tests/Feature/Requests/Documents/Thumbnail/GetDocumentDownloadThumbnailRequestTest.php
diff --git a/.phpunit.cache/test-results b/.phpunit.cache/test-results
index 64b648f..cb9bd62 100644
--- a/.phpunit.cache/test-results
+++ b/.phpunit.cache/test-results
@@ -1 +1 @@
-{"version":"pest_2.34.9","defects":[],"times":{"P\\Tests\\Feature\\Requests\\FileCabinets\\Upload\\AppendFilesToADataRecordTest::__pest_evaluable_it_can_attach_files_to_a_data_record":0.563,"P\\Tests\\Feature\\Requests\\Documents\\ClipUnclipStapleUnstaple\\ClipTest::__pest_evaluable_it_can_clip_2_documents":7.226,"P\\Tests\\Feature\\Requests\\FileCabinets\\Dialogs\\GetDialogsOfASpecificTypeTest::__pest_evaluable_it_can_list_dialogs_for_a_file_cabinet":0.709,"P\\Tests\\Feature\\Requests\\FileCabinets\\Upload\\AppendFilesToADataRecordTest::__pest_evaluable_it_can_attach_a_file_to_a_data_record":1.051,"P\\Tests\\Unit\\DTO\\DocumentIndex\\IndexDateTimeDTOTest::__pest_evaluable_it_create_index_date_time_dto":0.001,"P\\Tests\\Unit\\DTO\\DocumentIndex\\IndexTextDTOTest::__pest_evaluable_it_create_prepare_index_text_dto":0,"P\\Tests\\Feature\\Requests\\General\\UserManagement\\GetUsers\\GetUsersOfAGroupTest::__pest_evaluable_it_can_list_users_of_a_group":0.873,"P\\Tests\\Feature\\Requests\\Documents\\Sections\\GetASpecificSectionTest::__pest_evaluable_it_can_get_a_specific_section":1.001,"P\\Tests\\Core\\ArchTest::__pest_evaluable_it_will_not_use_any_debug_function":0.202,"P\\Tests\\Feature\\Requests\\FileCabinets\\Search\\GetDocumentsFromAFileCabinetTest::__pest_evaluable_it_can_get_all_documents":1.128,"P\\Tests\\Feature\\Requests\\Documents\\ApplicationProperties\\ApplicationPropertiesTest::__pest_evaluable_it_can_add_get_update_delete_application_properties_to_a_document":1.321,"P\\Tests\\Feature\\Requests\\General\\UserManagement\\GetModifyRoles\\AddRemoveUserToARoleTest::__pest_evaluable_it_can_add_roles_to_a_user":7.208,"P\\Tests\\Feature\\Requests\\General\\UserManagement\\GetModifyRoles\\AddRemoveUserToARoleTest::__pest_evaluable_it_can_remove_roles_to_a_user":5.942,"P\\Tests\\Feature\\Requests\\Documents\\PutDocumentFieldsRequestTest::__pest_evaluable_it_can_update_multiple_document_values":0.897,"P\\Tests\\Feature\\Requests\\Documents\\PutDocumentFieldsRequestTest::__pest_evaluable_it_can_update_a_document_value":0.917,"P\\Tests\\Feature\\Requests\\Documents\\Download\\DownloadSectionTest::__pest_evaluable_it_can_download_a_section":0.958,"P\\Tests\\Feature\\Requests\\Documents\\ClipUnclipStapleUnstaple\\StapleTest::__pest_evaluable_it_can_staple_2_documents":12.678,"P\\Tests\\Feature\\Requests\\Documents\\ClipUnclipStapleUnstaple\\UnclipTest::__pest_evaluable_it_can_unclip_2_documents":12.252,"P\\Tests\\Feature\\DocuWareAuthenticationTest::__pest_evaluable_it_can_get_oath_responsible_identity_service":0.681,"P\\Tests\\Feature\\DocuWareAuthenticationTest::__pest_evaluable_it_can_authenticate_with_DocuWare_Credentials":0.657,"P\\Tests\\Feature\\DocuWareAuthenticationTest::__pest_evaluable_it_can_get_oath_identity_service_configuration":1.107,"P\\Tests\\Feature\\Requests\\FileCabinets\\Search\\GetASpecificDocumentFromAFileCabinetTest::__pest_evaluable_it_can_show_a_document":0.986,"P\\Tests\\Feature\\Requests\\General\\UserManagement\\GetModifyGroups\\GetGroupsTest::__pest_evaluable_it_can_list_groups":0.725,"P\\Tests\\Feature\\Requests\\Documents\\Thumbnail\\GetDocumentDownloadThumbnailRequestTest::__pest_evaluable_it_can_download_a_document_thumbnail":1.22,"P\\Tests\\Feature\\Requests\\Documents\\Download\\DownloadDocumentTest::__pest_evaluable_it_can_download_a_document":0.874,"P\\Tests\\Feature\\Requests\\Organization\\GetOrganizationsRequestTest::__pest_evaluable_it_can_list_organizations":0.689,"P\\Tests\\Feature\\Requests\\General\\UserManagement\\GetModifyGroups\\GetAllGroupsForASpecificUserTest::__pest_evaluable_it_can_list_groups_for_a_specific_user":0.92,"P\\Tests\\Feature\\Requests\\Fields\\GetFieldsRequestTest::__pest_evaluable_it_can_list_fields_for_a_file_cabinet":0.752,"P\\Tests\\Feature\\Requests\\General\\UserManagement\\GetUsers\\GetUserByIdTest::__pest_evaluable_it_can_get_user_by_id":1.005,"P\\Tests\\Feature\\Requests\\Documents\\Download\\DownloadThumbnailTest::__pest_evaluable_it_can_download_a_thumbnail":0.996,"P\\Tests\\Feature\\SleepTest::__pest_evaluable_sleep":0.544,"P\\Tests\\Feature\\Requests\\General\\UserManagement\\GetUsers\\GetUsersTest::__pest_evaluable_it_can_list_users":0.812,"P\\Tests\\Unit\\DTO\\DocumentIndex\\IndexDecimalDTOTest::__pest_evaluable_it_create_index_numeric_dto":0.001,"P\\Tests\\Feature\\Requests\\Documents\\PostDocumentRequestTest::__pest_evaluable_it_can_upload_document_with_index_values_and_delete_it":0.836,"P\\Tests\\Feature\\Requests\\Documents\\PostDocumentRequestTest::__pest_evaluable_it_can_upload_document_without_file_name_and_file_content_and_delete_it":0.76,"P\\Tests\\Feature\\Requests\\Search\\GetSearchRequestTest::__pest_evaluable_it_can_override_search_documents_dates_filter_by_using_equal_operator":0.72,"P\\Tests\\Feature\\Requests\\Search\\GetSearchRequestTest::__pest_evaluable_it_can_search_documents_with_null_values":0.714,"P\\Tests\\Feature\\Requests\\Search\\GetSearchRequestTest::__pest_evaluable_it_can_override_search_documents_dates_filter_by_using_same_operator":0.781,"P\\Tests\\Feature\\Requests\\Search\\GetSearchRequestTest::__pest_evaluable_it_can_t_search_documents_by_more_than_two_dates":0.544,"P\\Tests\\Feature\\Requests\\Search\\GetSearchRequestTest::__pest_evaluable_it_can_t_search_documents_by_diverged_date_range":0.555,"P\\Tests\\Feature\\Requests\\Search\\GetSearchRequestTest::__pest_evaluable_it_can_search_documents_dates_filter_in_future":0.763,"P\\Tests\\Feature\\Requests\\Search\\GetSearchRequestTest::__pest_evaluable_it_can_search_documents_dates_filter_in_past":0.816,"P\\Tests\\Feature\\Requests\\Search\\GetSearchRequestTest::__pest_evaluable_it_can_search_documents":0.779,"P\\Tests\\Feature\\Requests\\Search\\GetSearchRequestTest::__pest_evaluable_it_can_search_documents_with_multiple_values":1.354,"P\\Tests\\Feature\\Requests\\General\\UserManagement\\GetModifyGroups\\AddRemoveUserToAGroupTest::__pest_evaluable_it_can_add_groups_to_a_user":7.049,"P\\Tests\\Feature\\Requests\\General\\UserManagement\\GetModifyGroups\\AddRemoveUserToAGroupTest::__pest_evaluable_it_can_remove_groups_to_a_user":6.021,"P\\Tests\\Feature\\Requests\\Documents\\Sections\\DeleteSectionTest::__pest_evaluable_it_can_delete_a_specific_section":1.031,"P\\Tests\\Feature\\Requests\\FileCabinets\\Dialogs\\GetASpecificDialogTest::__pest_evaluable_it_can_get_a_dialog":0.767,"P\\Tests\\Feature\\Requests\\Workflow\\GetDocumentWorkflowHistoryTest::__pest_evaluable_it_can_get_document_workflow_history":5.948,"P\\Tests\\Feature\\Requests\\Documents\\GetDocumentPreviewRequestTest::__pest_evaluable_it_can_preview_a_document_image":1.154,"P\\Tests\\Unit\\DTO\\DocumentIndex\\IndexDateDTOTest::__pest_evaluable_it_create_index_date_dto":0.003,"P\\Tests\\Feature\\Requests\\Documents\\DocumentsTrashBin\\DeleteDocumentsFromTrashBinTest::__pest_evaluable_it_can_delete_documents_in_trash":1.141,"P\\Tests\\Unit\\DTO\\DocumentIndex\\PrepareTableDTOTest::__pest_evaluable_it_create_prepare_index_table_dto":0.002,"P\\Tests\\Feature\\Requests\\General\\UserManagement\\GetModifyRoles\\GetAllRolesForASpecificUserTest::__pest_evaluable_it_can_list_groups":1.082,"P\\Tests\\Feature\\Requests\\Documents\\Sections\\GetAllSectionsFromADocumentTest::__pest_evaluable_it_can_get_all_sections_from_a_document":0.904,"P\\Tests\\Feature\\Requests\\General\\UserManagement\\GetUsers\\GetUsersOfARoleTest::__pest_evaluable_it_can_list_users_of_a_role":0.767,"P\\Tests\\Feature\\Requests\\Documents\\DocumentsTrashBin\\RestoreDocumentsFromTrashBinTest::__pest_evaluable_it_can_restore_documents_in_trash":1.114,"P\\Tests\\Feature\\DTOTest::__pest_evaluable_it_create_a_fake_document_paginator":0.54,"P\\Tests\\Feature\\DTOTest::__pest_evaluable_it_create_a_fake_dialog":0.544,"P\\Tests\\Feature\\DTOTest::__pest_evaluable_it_create_a_fake_field":0.561,"P\\Tests\\Feature\\DTOTest::__pest_evaluable_it_create_a_fake_organization":0.549,"P\\Tests\\Feature\\DTOTest::__pest_evaluable_it_create_a_fake_table_row":0.562,"P\\Tests\\Feature\\DTOTest::__pest_evaluable_it_create_a_fake_document":0.554,"P\\Tests\\Feature\\DTOTest::__pest_evaluable_it_create_a_fake_organization_index":0.568,"P\\Tests\\Feature\\DTOTest::__pest_evaluable_it_create_a_fake_suggestion_field":0.535,"P\\Tests\\Feature\\DTOTest::__pest_evaluable_it_create_a_fake_file_cabinet":0.548,"P\\Tests\\Feature\\DTOTest::__pest_evaluable_it_create_a_fake_document_field":0.551,"P\\Tests\\Unit\\DTO\\DocumentIndex\\PrepareDTOTest::__pest_evaluable_it_create_prepare_makeContent_dto":0.001,"P\\Tests\\Unit\\DTO\\DocumentIndex\\PrepareDTOTest::__pest_evaluable_it_create_prepare_index_dto":0.002,"P\\Tests\\Feature\\Requests\\FileCabinets\\General\\GetFileCabinetInformationTest::__pest_evaluable_it_can_get_file_cabinet_information":0.83,"P\\Tests\\Feature\\Requests\\General\\UserManagement\\CreateUpdateUsers\\CreateUpdateUserTest::__pest_evaluable_it_can_create_users":1.484,"P\\Tests\\Feature\\Requests\\General\\UserManagement\\CreateUpdateUsers\\CreateUpdateUserTest::__pest_evaluable_it_can_update_users":6.052,"P\\Tests\\Unit\\DTO\\DocumentIndex\\IndexNumericDTOTest::__pest_evaluable_it_create_index_numeric_dto":0.001,"P\\Tests\\Feature\\DocuWareTest::__pest_evaluable_it_can_create_encrypted_url_for_a_document_in_a_basket":0.59,"P\\Tests\\Feature\\DocuWareTest::__pest_evaluable_it_can_create_encrypted_url_for_a_document_in_a_file_cabinet":0.541,"P\\Tests\\Unit\\DTO\\DocumentIndex\\IndexTableDTOTest::__pest_evaluable_it_create_prepare_index_text_dto":0.001,"P\\Tests\\Feature\\Requests\\Documents\\DocumentsTrashBin\\GetDocumentsFromTrashBinTest::__pest_evaluable_it_can_search_documents_with_null_values_in_trash":0.783,"P\\Tests\\Feature\\Requests\\Documents\\DocumentsTrashBin\\GetDocumentsFromTrashBinTest::__pest_evaluable_it_can_t_search_documents_by_diverged_date_range":0.546,"P\\Tests\\Feature\\Requests\\Documents\\DocumentsTrashBin\\GetDocumentsFromTrashBinTest::__pest_evaluable_it_can_override_search_documents_dates_filter_by_using_same_operator_in_trash":0.679,"P\\Tests\\Feature\\Requests\\Documents\\DocumentsTrashBin\\GetDocumentsFromTrashBinTest::__pest_evaluable_it_can_search_documents_dates_filter_in_future_in_trash":0.66,"P\\Tests\\Feature\\Requests\\Documents\\DocumentsTrashBin\\GetDocumentsFromTrashBinTest::__pest_evaluable_it_can_search_documents_dates_filter_in_past_in_trash":0.68,"P\\Tests\\Feature\\Requests\\Documents\\DocumentsTrashBin\\GetDocumentsFromTrashBinTest::__pest_evaluable_it_can_search_documents_in_trash":0.69,"P\\Tests\\Feature\\Requests\\Documents\\DocumentsTrashBin\\GetDocumentsFromTrashBinTest::__pest_evaluable_it_can_override_search_documents_dates_filter_by_using_equal_operator_in_trash":0.678,"P\\Tests\\Feature\\Requests\\Documents\\DocumentsTrashBin\\GetDocumentsFromTrashBinTest::__pest_evaluable_it_can_t_search_documents_by_more_than_two_dates_in_trash":0.534,"P\\Tests\\Feature\\Requests\\Workflow\\GetDocumentWorkflowHistoryStepsTest::__pest_evaluable_it_can_get_document_workflow_history":6.748,"P\\Tests\\Feature\\Requests\\Documents\\ClipUnclipStapleUnstaple\\UnstapleTest::__pest_evaluable_it_can_unstaple_a_document":13.846,"P\\Tests\\Feature\\Requests\\General\\UserManagement\\GetModifyRoles\\GetRolesTest::__pest_evaluable_it_can_list_groups":0.688,"P\\Tests\\Feature\\Requests\\Documents\\GetDocumentCountRequestTest::__pest_evaluable_it_can_get_a_total_count_of_documents":0.938}}
\ No newline at end of file
+{"version":"pest_2.34.9","defects":{"P\\Tests\\Feature\\Requests\\AnnotationsStamps\\AddRectEntryAnnotationTest::__pest_evaluable_it_can_clip_2_documents":8,"P\\Tests\\Feature\\Requests\\AnnotationsStamps\\AddTextAnnotationTest::__pest_evaluable_it_can_clip_2_documents":8,"P\\Tests\\Feature\\Requests\\AnnotationsStamps\\UpdateTextAnnotationTest::__pest_evaluable_it_can_clip_2_documents":8,"P\\Tests\\Feature\\Requests\\AnnotationsStamps\\AddLineEntryAnnotationTest::__pest_evaluable_it_can_clip_2_documents":8},"times":{"P\\Tests\\Feature\\Requests\\FileCabinets\\Upload\\AppendFilesToADataRecordTest::__pest_evaluable_it_can_attach_files_to_a_data_record":0.435,"P\\Tests\\Feature\\Requests\\Documents\\ClipUnclipStapleUnstaple\\ClipTest::__pest_evaluable_it_can_clip_2_documents":6.938,"P\\Tests\\Feature\\Requests\\FileCabinets\\Dialogs\\GetDialogsOfASpecificTypeTest::__pest_evaluable_it_can_list_dialogs_for_a_file_cabinet":0.592,"P\\Tests\\Feature\\Requests\\FileCabinets\\Upload\\AppendFilesToADataRecordTest::__pest_evaluable_it_can_attach_a_file_to_a_data_record":0.933,"P\\Tests\\Unit\\DTO\\DocumentIndex\\IndexDateTimeDTOTest::__pest_evaluable_it_create_index_date_time_dto":0.001,"P\\Tests\\Unit\\DTO\\DocumentIndex\\IndexTextDTOTest::__pest_evaluable_it_create_prepare_index_text_dto":0,"P\\Tests\\Feature\\Requests\\General\\UserManagement\\GetUsers\\GetUsersOfAGroupTest::__pest_evaluable_it_can_list_users_of_a_group":0.678,"P\\Tests\\Feature\\Requests\\Documents\\Sections\\GetASpecificSectionTest::__pest_evaluable_it_can_get_a_specific_section":1.014,"P\\Tests\\Core\\ArchTest::__pest_evaluable_it_will_not_use_any_debug_function":0.218,"P\\Tests\\Feature\\Requests\\FileCabinets\\Search\\GetDocumentsFromAFileCabinetTest::__pest_evaluable_it_can_get_all_documents":1.037,"P\\Tests\\Feature\\Requests\\Documents\\ApplicationProperties\\ApplicationPropertiesTest::__pest_evaluable_it_can_add_get_update_delete_application_properties_to_a_document":1.028,"P\\Tests\\Feature\\Requests\\General\\UserManagement\\GetModifyRoles\\AddRemoveUserToARoleTest::__pest_evaluable_it_can_add_roles_to_a_user":7.329,"P\\Tests\\Feature\\Requests\\General\\UserManagement\\GetModifyRoles\\AddRemoveUserToARoleTest::__pest_evaluable_it_can_remove_roles_to_a_user":5.854,"P\\Tests\\Feature\\Requests\\Documents\\PutDocumentFieldsRequestTest::__pest_evaluable_it_can_update_multiple_document_values":0.788,"P\\Tests\\Feature\\Requests\\Documents\\PutDocumentFieldsRequestTest::__pest_evaluable_it_can_update_a_document_value":0.974,"P\\Tests\\Feature\\Requests\\Documents\\Download\\DownloadSectionTest::__pest_evaluable_it_can_download_a_section":0.786,"P\\Tests\\Feature\\Requests\\Documents\\ClipUnclipStapleUnstaple\\StapleTest::__pest_evaluable_it_can_staple_2_documents":12.88,"P\\Tests\\Feature\\Requests\\Documents\\ClipUnclipStapleUnstaple\\UnclipTest::__pest_evaluable_it_can_unclip_2_documents":12.684,"P\\Tests\\Feature\\DocuWareAuthenticationTest::__pest_evaluable_it_can_get_oath_responsible_identity_service":0.602,"P\\Tests\\Feature\\DocuWareAuthenticationTest::__pest_evaluable_it_can_authenticate_with_DocuWare_Credentials":0.525,"P\\Tests\\Feature\\DocuWareAuthenticationTest::__pest_evaluable_it_can_get_oath_identity_service_configuration":0.839,"P\\Tests\\Feature\\Requests\\FileCabinets\\Search\\GetASpecificDocumentFromAFileCabinetTest::__pest_evaluable_it_can_show_a_document":0.731,"P\\Tests\\Feature\\Requests\\General\\UserManagement\\GetModifyGroups\\GetGroupsTest::__pest_evaluable_it_can_list_groups":0.592,"P\\Tests\\Feature\\Requests\\Documents\\Thumbnail\\GetDocumentDownloadThumbnailRequestTest::__pest_evaluable_it_can_download_a_document_thumbnail":0.921,"P\\Tests\\Feature\\Requests\\Documents\\Download\\DownloadDocumentTest::__pest_evaluable_it_can_download_a_document":0.847,"P\\Tests\\Feature\\Requests\\Organization\\GetOrganizationsRequestTest::__pest_evaluable_it_can_list_organizations":0.531,"P\\Tests\\Feature\\Requests\\General\\UserManagement\\GetModifyGroups\\GetAllGroupsForASpecificUserTest::__pest_evaluable_it_can_list_groups_for_a_specific_user":0.659,"P\\Tests\\Feature\\Requests\\Fields\\GetFieldsRequestTest::__pest_evaluable_it_can_list_fields_for_a_file_cabinet":0.558,"P\\Tests\\Feature\\Requests\\General\\UserManagement\\GetUsers\\GetUserByIdTest::__pest_evaluable_it_can_get_user_by_id":0.7,"P\\Tests\\Feature\\Requests\\Documents\\Download\\DownloadThumbnailTest::__pest_evaluable_it_can_download_a_thumbnail":0.865,"P\\Tests\\Feature\\SleepTest::__pest_evaluable_sleep":0.451,"P\\Tests\\Feature\\Requests\\General\\UserManagement\\GetUsers\\GetUsersTest::__pest_evaluable_it_can_list_users":0.595,"P\\Tests\\Unit\\DTO\\DocumentIndex\\IndexDecimalDTOTest::__pest_evaluable_it_create_index_numeric_dto":0.001,"P\\Tests\\Feature\\Requests\\Documents\\PostDocumentRequestTest::__pest_evaluable_it_can_upload_document_with_index_values_and_delete_it":0.675,"P\\Tests\\Feature\\Requests\\Documents\\PostDocumentRequestTest::__pest_evaluable_it_can_upload_document_without_file_name_and_file_content_and_delete_it":0.594,"P\\Tests\\Feature\\Requests\\Search\\GetSearchRequestTest::__pest_evaluable_it_can_override_search_documents_dates_filter_by_using_equal_operator":0.58,"P\\Tests\\Feature\\Requests\\Search\\GetSearchRequestTest::__pest_evaluable_it_can_search_documents_with_null_values":0.534,"P\\Tests\\Feature\\Requests\\Search\\GetSearchRequestTest::__pest_evaluable_it_can_override_search_documents_dates_filter_by_using_same_operator":0.622,"P\\Tests\\Feature\\Requests\\Search\\GetSearchRequestTest::__pest_evaluable_it_can_t_search_documents_by_more_than_two_dates":0.431,"P\\Tests\\Feature\\Requests\\Search\\GetSearchRequestTest::__pest_evaluable_it_can_t_search_documents_by_diverged_date_range":0.473,"P\\Tests\\Feature\\Requests\\Search\\GetSearchRequestTest::__pest_evaluable_it_can_search_documents_dates_filter_in_future":0.638,"P\\Tests\\Feature\\Requests\\Search\\GetSearchRequestTest::__pest_evaluable_it_can_search_documents_dates_filter_in_past":0.579,"P\\Tests\\Feature\\Requests\\Search\\GetSearchRequestTest::__pest_evaluable_it_can_search_documents":0.555,"P\\Tests\\Feature\\Requests\\Search\\GetSearchRequestTest::__pest_evaluable_it_can_search_documents_with_multiple_values":1.181,"P\\Tests\\Feature\\Requests\\General\\UserManagement\\GetModifyGroups\\AddRemoveUserToAGroupTest::__pest_evaluable_it_can_add_groups_to_a_user":7.132,"P\\Tests\\Feature\\Requests\\General\\UserManagement\\GetModifyGroups\\AddRemoveUserToAGroupTest::__pest_evaluable_it_can_remove_groups_to_a_user":6.057,"P\\Tests\\Feature\\Requests\\Documents\\Sections\\DeleteSectionTest::__pest_evaluable_it_can_delete_a_specific_section":0.846,"P\\Tests\\Feature\\Requests\\FileCabinets\\Dialogs\\GetASpecificDialogTest::__pest_evaluable_it_can_get_a_dialog":0.565,"P\\Tests\\Feature\\Requests\\Workflow\\GetDocumentWorkflowHistoryTest::__pest_evaluable_it_can_get_document_workflow_history":6.08,"P\\Tests\\Feature\\Requests\\Documents\\GetDocumentPreviewRequestTest::__pest_evaluable_it_can_preview_a_document_image":2.364,"P\\Tests\\Unit\\DTO\\DocumentIndex\\IndexDateDTOTest::__pest_evaluable_it_create_index_date_dto":0.001,"P\\Tests\\Feature\\Requests\\Documents\\DocumentsTrashBin\\DeleteDocumentsFromTrashBinTest::__pest_evaluable_it_can_delete_documents_in_trash":1.428,"P\\Tests\\Unit\\DTO\\DocumentIndex\\PrepareTableDTOTest::__pest_evaluable_it_create_prepare_index_table_dto":0,"P\\Tests\\Feature\\Requests\\General\\UserManagement\\GetModifyRoles\\GetAllRolesForASpecificUserTest::__pest_evaluable_it_can_list_groups":0.728,"P\\Tests\\Feature\\Requests\\Documents\\Sections\\GetAllSectionsFromADocumentTest::__pest_evaluable_it_can_get_all_sections_from_a_document":0.684,"P\\Tests\\Feature\\Requests\\General\\UserManagement\\GetUsers\\GetUsersOfARoleTest::__pest_evaluable_it_can_list_users_of_a_role":0.668,"P\\Tests\\Feature\\Requests\\Documents\\DocumentsTrashBin\\RestoreDocumentsFromTrashBinTest::__pest_evaluable_it_can_restore_documents_in_trash":1.007,"P\\Tests\\Feature\\DTOTest::__pest_evaluable_it_create_a_fake_document_paginator":0.482,"P\\Tests\\Feature\\DTOTest::__pest_evaluable_it_create_a_fake_dialog":0.463,"P\\Tests\\Feature\\DTOTest::__pest_evaluable_it_create_a_fake_field":0.428,"P\\Tests\\Feature\\DTOTest::__pest_evaluable_it_create_a_fake_organization":0.447,"P\\Tests\\Feature\\DTOTest::__pest_evaluable_it_create_a_fake_table_row":0.442,"P\\Tests\\Feature\\DTOTest::__pest_evaluable_it_create_a_fake_document":0.488,"P\\Tests\\Feature\\DTOTest::__pest_evaluable_it_create_a_fake_organization_index":0.418,"P\\Tests\\Feature\\DTOTest::__pest_evaluable_it_create_a_fake_suggestion_field":0.462,"P\\Tests\\Feature\\DTOTest::__pest_evaluable_it_create_a_fake_file_cabinet":0.43,"P\\Tests\\Feature\\DTOTest::__pest_evaluable_it_create_a_fake_document_field":0.412,"P\\Tests\\Unit\\DTO\\DocumentIndex\\PrepareDTOTest::__pest_evaluable_it_create_prepare_makeContent_dto":0.004,"P\\Tests\\Unit\\DTO\\DocumentIndex\\PrepareDTOTest::__pest_evaluable_it_create_prepare_index_dto":0.001,"P\\Tests\\Feature\\Requests\\FileCabinets\\General\\GetFileCabinetInformationTest::__pest_evaluable_it_can_get_file_cabinet_information":0.526,"P\\Tests\\Feature\\Requests\\General\\UserManagement\\CreateUpdateUsers\\CreateUpdateUserTest::__pest_evaluable_it_can_create_users":1.303,"P\\Tests\\Feature\\Requests\\General\\UserManagement\\CreateUpdateUsers\\CreateUpdateUserTest::__pest_evaluable_it_can_update_users":5.859,"P\\Tests\\Unit\\DTO\\DocumentIndex\\IndexNumericDTOTest::__pest_evaluable_it_create_index_numeric_dto":0.001,"P\\Tests\\Feature\\DocuWareTest::__pest_evaluable_it_can_create_encrypted_url_for_a_document_in_a_basket":0.407,"P\\Tests\\Feature\\DocuWareTest::__pest_evaluable_it_can_create_encrypted_url_for_a_document_in_a_file_cabinet":0.426,"P\\Tests\\Unit\\DTO\\DocumentIndex\\IndexTableDTOTest::__pest_evaluable_it_create_prepare_index_text_dto":0.002,"P\\Tests\\Feature\\Requests\\Documents\\DocumentsTrashBin\\GetDocumentsFromTrashBinTest::__pest_evaluable_it_can_search_documents_with_null_values_in_trash":0.554,"P\\Tests\\Feature\\Requests\\Documents\\DocumentsTrashBin\\GetDocumentsFromTrashBinTest::__pest_evaluable_it_can_t_search_documents_by_diverged_date_range":0.399,"P\\Tests\\Feature\\Requests\\Documents\\DocumentsTrashBin\\GetDocumentsFromTrashBinTest::__pest_evaluable_it_can_override_search_documents_dates_filter_by_using_same_operator_in_trash":0.571,"P\\Tests\\Feature\\Requests\\Documents\\DocumentsTrashBin\\GetDocumentsFromTrashBinTest::__pest_evaluable_it_can_search_documents_dates_filter_in_future_in_trash":0.525,"P\\Tests\\Feature\\Requests\\Documents\\DocumentsTrashBin\\GetDocumentsFromTrashBinTest::__pest_evaluable_it_can_search_documents_dates_filter_in_past_in_trash":0.518,"P\\Tests\\Feature\\Requests\\Documents\\DocumentsTrashBin\\GetDocumentsFromTrashBinTest::__pest_evaluable_it_can_search_documents_in_trash":0.539,"P\\Tests\\Feature\\Requests\\Documents\\DocumentsTrashBin\\GetDocumentsFromTrashBinTest::__pest_evaluable_it_can_override_search_documents_dates_filter_by_using_equal_operator_in_trash":0.532,"P\\Tests\\Feature\\Requests\\Documents\\DocumentsTrashBin\\GetDocumentsFromTrashBinTest::__pest_evaluable_it_can_t_search_documents_by_more_than_two_dates_in_trash":0.419,"P\\Tests\\Feature\\Requests\\Workflow\\GetDocumentWorkflowHistoryStepsTest::__pest_evaluable_it_can_get_document_workflow_history":6.101,"P\\Tests\\Feature\\Requests\\Documents\\ClipUnclipStapleUnstaple\\UnstapleTest::__pest_evaluable_it_can_unstaple_a_document":13.551,"P\\Tests\\Feature\\Requests\\General\\UserManagement\\GetModifyRoles\\GetRolesTest::__pest_evaluable_it_can_list_groups":0.545,"P\\Tests\\Feature\\Requests\\Documents\\GetDocumentCountRequestTest::__pest_evaluable_it_can_get_a_total_count_of_documents":0.811,"P\\Tests\\Feature\\Requests\\AnnotationsStamps\\AddRectEntryAnnotationTest::__pest_evaluable_it_can_clip_2_documents":0.916,"P\\Tests\\Feature\\Requests\\AnnotationsStamps\\AddTextAnnotationTest::__pest_evaluable_it_can_clip_2_documents":0.871,"P\\Tests\\Feature\\Requests\\AnnotationsStamps\\UpdateTextAnnotationTest::__pest_evaluable_it_can_clip_2_documents":0.567,"P\\Tests\\Feature\\Requests\\AnnotationsStamps\\AddLineEntryAnnotationTest::__pest_evaluable_it_can_clip_2_documents":0.77,"P\\Tests\\Feature\\Requests\\Documents\\AnnotationsStamps\\AddRectEntryAnnotationTest::__pest_evaluable_it_can_clip_2_documents":6.177,"P\\Tests\\Feature\\Requests\\Documents\\AnnotationsStamps\\UpdateTextAnnotationTest::__pest_evaluable_it_can_clip_2_documents":6.635,"P\\Tests\\Feature\\Requests\\Documents\\AnnotationsStamps\\AddLineEntryAnnotationTest::__pest_evaluable_it_can_clip_2_documents":6.192,"P\\Tests\\Feature\\Requests\\Documents\\AnnotationsStamps\\AddTextAnnotationTest::__pest_evaluable_it_can_clip_2_documents":6.237,"P\\Tests\\Feature\\Requests\\Documents\\AnnotationsStamps\\AddStampWithBestPositionTest::__pest_evaluable_it_can_clip_2_documents":6.458,"P\\Tests\\Feature\\Requests\\Documents\\AnnotationsStamps\\AddStampWithPositionTest::__pest_evaluable_it_can_clip_2_documents":6.371,"P\\Tests\\Feature\\Requests\\Documents\\AnnotationsStamps\\UpdateTextAnnotationTest::__pest_evaluable_it_can_annotate":6.507}}
\ No newline at end of file
diff --git a/README.md b/README.md
index 8a65ebe..8e30f62 100644
--- a/README.md
+++ b/README.md
@@ -64,86 +64,86 @@ then optimize the processes that power the core of your business.
Current Support
-| Group | Request | Supported | TODO |
-|-------------------------------------|-------------------------------------------------------------|-----------|----------------|
-| Authentication/OAuth | 1. Get Responsible Identity Service | ✅ | |
-| Authentication/OAuth | 2. Get Identity Service Configuration | ✅ | |
-| Authentication/OAuth | 3.a Request Token w/ Username & Password | ✅ | |
-| Authentication/OAuth | 3.b Request Token w/ a DocuWare Token | 🕣 | |
-| Authentication/OAuth | 3.c Request Token w/ Username & Password (Trusted User) | 🕣 | |
-| Authentication/OAuth | 3.d.1 Obtain Windows Authorization (On Premises Only) | 🕣 | |
-| Authentication/OAuth | 3.d.2 Request Token /w a Windows Account (On Premises Only) | 🕣 | |
-| General/Organisation | Get Login Token | ✅ | |
-| General/Organisation | Get Organization | ✅ | |
-| General/Organisation | Get All File Cabinets and Document Trays | ✅ | |
-| General/UserManagement | Get Users by ID | ✅ | |
-| General/UserManagement | Get Users of a Role | ✅ | |
-| General/UserManagement | Get Users of a Group | ✅ | |
-| General/UserManagement | Create User | ✅ | |
-| General/UserManagement | Update User | ✅ | |
-| General/UserManagement | Get Groups | ✅ | |
-| General/UserManagement | Get All Groups for a Specific User | ✅ | |
-| General/UserManagement | Add User to a Group | ✅ | |
-| General/UserManagement | Remove User from a Group | ✅ | |
-| General/UserManagement | Get Roles | ✅ | |
-| General/UserManagement | Get All Roles for a Specific User | ✅ | |
-| General/UserManagement | Add User to a Role | ✅ | |
-| General/UserManagement | Remove User from a Role | ✅ | |
-| FileCabinets/General | Get File Cabinet Information | ✅ | |
-| FileCabinets/General | Get Total Number of Documents | ✅ | |
-| FileCabinets/Dialogs | Get All Dialogs | ✅ | |
-| FileCabinets/Dialogs | Get a Specific Dialog | ✅ | |
-| FileCabinets/Dialogs | Get Dialogs of a Specific Type | ✅ | |
-| FileCabinets/Search | Get Documents from a File Cabinet | ✅ | |
-| FileCabinets/Search | Get a Specific Document From a File Cabinet | ✅ | |
-| FileCabinets/Search | Search for Documents in a Single File Cabinet | ✅ | |
-| FileCabinets/Search | Search for Documents in Multiple File Cabinets | ✅ | |
-| FileCabinets/CheckInCheckOut | Check-out & Download a Document | 🕣 | |
-| FileCabinets/CheckInCheckOut | Check-in a Document from the File System | 🕣 | |
-| FileCabinets/CheckInCheckOut | Undo Check-out | 🕣 | |
-| FileCabinets/SelectLists | Get Select Lists & Get Filtered Select Lists | ✅ | |
-| FileCabinets/Upload | Create Data Record | ✅ | |
-| FileCabinets/Upload | Append File(s) to a Data Record | ✅ | - |
-| FileCabinets/Upload | Upload a Single File for a Data Record | ❌ | - |
-| FileCabinets/Upload | Create a Data Record & Upload File | ❌ | - |
-| FileCabinets/Upload | Create Data Record & Upload File Using Store Dialog | ❌ | - |
-| FileCabinets/Upload | Append a Single PDF to a Document | ❌ | - |
-| FileCabinets/Upload | Replace a PDF Document Section | ❌ | - |
-| FileCabinets/BatchIndexFieldsUpdate | Batch Update Index Fields By Id | ❌ | - |
-| FileCabinets/BatchIndexFieldsUpdate | Batch Update Index Fields By Search | ❌ | - |
-| FileCabinets/BatchIndexFieldsUpdate | Batch Append/Update Keyword Fields By Id | ❌ | - |
-| Documents/UpdateIndexValues | Update Index Values | ✅ | |
-| Documents/UpdateIndexValues | Update Table Field Values | ❌ | - ? |
-| Documents/ModifyDocuments | Transfer Document | ✅ | - |
-| Documents/ModifyDocuments | Delete Document | ✅ | |
-| Documents/ClipUnclip&StapleUnstaple | Clip | ✅ | |
-| Documents/ClipUnclip&StapleUnstaple | Unclip | ✅ | |
-| Documents/ClipUnclip&StapleUnstaple | Staple | ✅ | |
-| Documents/ClipUnclip&StapleUnstaple | Unstaple | ✅ | |
-| Documents/AnnotationsStamps | AddStampWithPosition | ❌ | - Better Tests |
-| Documents/AnnotationsStamps | AddStampWithBestPosition | ❌ | - Better Tests |
-| Documents/AnnotationsStamps | AddTextAnnotation | ❌ | - Better Tests |
-| Documents/AnnotationsStamps | AddRectEntryAnnotation | ❌ | - Better Tests |
-| Documents/AnnotationsStamps | AddLineEntryAnnotation | ❌ | - Better Tests |
-| Documents/AnnotationsStamps | AddPolyLineEntryAnnotation | ❌ | - |
-| Documents/AnnotationsStamps | DeleteAnnotation | ❌ | - |
-| Documents/AnnotationsStamps | UpdateTextAnnotation | ❌ | - Better Tests |
-| Documents/AnnotationsStamps | Get Stamps | ❌ | - |
-| Documents/DocumentsTrashBin | Get Documents | ✅ | |
-| Documents/DocumentsTrashBin | Delete Documents | ✅ | |
-| Documents/DocumentsTrashBin | Restore Documents | ✅ | |
-| Documents/ApplicationProperties | Get Application Properties | ✅ | - |
-| Documents/ApplicationProperties | Add Application Properties | ✅ | - |
-| Documents/ApplicationProperties | Delete Application Properties | ✅ | - |
-| Documents/ApplicationProperties | Update Application Properties | ✅ | - |
-| Documents/Sections | Get All Sections from a Document | ✅ | - |
-| Documents/Sections | Get a Specific Section | ✅ | - |
-| Documents/Sections | Delete Section | ✅ | - |
-| Documents/Download | Download Document | ✅ | |
-| Documents/Download | Download Section | ✅ | - |
-| Documents/Download | Download Thumbnail | ✅ | |
-| Workflow | Get Document Workflow History | ✅ | - |
-| Workflow | Get Document Workflow History Steps | ✅ | - |
+| Group | Request | Supported | TODO |
+|-------------------------------------|-------------------------------------------------------------|-----------|------|
+| Authentication/OAuth | 1. Get Responsible Identity Service | ✅ | |
+| Authentication/OAuth | 2. Get Identity Service Configuration | ✅ | |
+| Authentication/OAuth | 3.a Request Token w/ Username & Password | ✅ | |
+| Authentication/OAuth | 3.b Request Token w/ a DocuWare Token | 🕣 | |
+| Authentication/OAuth | 3.c Request Token w/ Username & Password (Trusted User) | 🕣 | |
+| Authentication/OAuth | 3.d.1 Obtain Windows Authorization (On Premises Only) | 🕣 | |
+| Authentication/OAuth | 3.d.2 Request Token /w a Windows Account (On Premises Only) | 🕣 | |
+| General/Organisation | Get Login Token | ✅ | |
+| General/Organisation | Get Organization | ✅ | |
+| General/Organisation | Get All File Cabinets and Document Trays | ✅ | |
+| General/UserManagement | Get Users by ID | ✅ | |
+| General/UserManagement | Get Users of a Role | ✅ | |
+| General/UserManagement | Get Users of a Group | ✅ | |
+| General/UserManagement | Create User | ✅ | |
+| General/UserManagement | Update User | ✅ | |
+| General/UserManagement | Get Groups | ✅ | |
+| General/UserManagement | Get All Groups for a Specific User | ✅ | |
+| General/UserManagement | Add User to a Group | ✅ | |
+| General/UserManagement | Remove User from a Group | ✅ | |
+| General/UserManagement | Get Roles | ✅ | |
+| General/UserManagement | Get All Roles for a Specific User | ✅ | |
+| General/UserManagement | Add User to a Role | ✅ | |
+| General/UserManagement | Remove User from a Role | ✅ | |
+| FileCabinets/General | Get File Cabinet Information | ✅ | |
+| FileCabinets/General | Get Total Number of Documents | ✅ | |
+| FileCabinets/Dialogs | Get All Dialogs | ✅ | |
+| FileCabinets/Dialogs | Get a Specific Dialog | ✅ | |
+| FileCabinets/Dialogs | Get Dialogs of a Specific Type | ✅ | |
+| FileCabinets/Search | Get Documents from a File Cabinet | ✅ | |
+| FileCabinets/Search | Get a Specific Document From a File Cabinet | ✅ | |
+| FileCabinets/Search | Search for Documents in a Single File Cabinet | ✅ | |
+| FileCabinets/Search | Search for Documents in Multiple File Cabinets | ✅ | |
+| FileCabinets/CheckInCheckOut | Check-out & Download a Document | 🕣 | |
+| FileCabinets/CheckInCheckOut | Check-in a Document from the File System | 🕣 | |
+| FileCabinets/CheckInCheckOut | Undo Check-out | 🕣 | |
+| FileCabinets/SelectLists | Get Select Lists & Get Filtered Select Lists | ✅ | |
+| FileCabinets/Upload | Create Data Record | ✅ | |
+| FileCabinets/Upload | Append File(s) to a Data Record | ✅ | |
+| FileCabinets/Upload | Upload a Single File for a Data Record | ❌ | - |
+| FileCabinets/Upload | Create a Data Record & Upload File | ❌ | - |
+| FileCabinets/Upload | Create Data Record & Upload File Using Store Dialog | ❌ | - |
+| FileCabinets/Upload | Append a Single PDF to a Document | ❌ | - |
+| FileCabinets/Upload | Replace a PDF Document Section | ❌ | - |
+| FileCabinets/BatchIndexFieldsUpdate | Batch Update Index Fields By Id | ❌ | - |
+| FileCabinets/BatchIndexFieldsUpdate | Batch Update Index Fields By Search | ❌ | - |
+| FileCabinets/BatchIndexFieldsUpdate | Batch Append/Update Keyword Fields By Id | ❌ | - |
+| Documents/UpdateIndexValues | Update Index Values | ✅ | |
+| Documents/UpdateIndexValues | Update Table Field Values | ❌ | - ? |
+| Documents/ModifyDocuments | Transfer Document | ✅ | |
+| Documents/ModifyDocuments | Delete Document | ✅ | |
+| Documents/ClipUnclip&StapleUnstaple | Clip | ✅ | |
+| Documents/ClipUnclip&StapleUnstaple | Unclip | ✅ | |
+| Documents/ClipUnclip&StapleUnstaple | Staple | ✅ | |
+| Documents/ClipUnclip&StapleUnstaple | Unstaple | ✅ | |
+| Documents/AnnotationsStamps | AddStampWithPosition | ✅ | |
+| Documents/AnnotationsStamps | AddStampWithBestPosition | ✅ | |
+| Documents/AnnotationsStamps | AddTextAnnotation | ✅ | |
+| Documents/AnnotationsStamps | AddRectEntryAnnotation | ✅ | |
+| Documents/AnnotationsStamps | AddLineEntryAnnotation | ✅ | |
+| Documents/AnnotationsStamps | AddPolyLineEntryAnnotation | ❌ | - |
+| Documents/AnnotationsStamps | DeleteAnnotation | ❌ | - |
+| Documents/AnnotationsStamps | UpdateTextAnnotation | ✅ | |
+| Documents/AnnotationsStamps | Get Stamps | ❌ | - |
+| Documents/DocumentsTrashBin | Get Documents | ✅ | |
+| Documents/DocumentsTrashBin | Delete Documents | ✅ | |
+| Documents/DocumentsTrashBin | Restore Documents | ✅ | |
+| Documents/ApplicationProperties | Get Application Properties | ✅ | |
+| Documents/ApplicationProperties | Add Application Properties | ✅ | |
+| Documents/ApplicationProperties | Delete Application Properties | ✅ | |
+| Documents/ApplicationProperties | Update Application Properties | ✅ | |
+| Documents/Sections | Get All Sections from a Document | ✅ | |
+| Documents/Sections | Get a Specific Section | ✅ | |
+| Documents/Sections | Delete Section | ✅ | |
+| Documents/Download | Download Document | ✅ | |
+| Documents/Download | Download Section | ✅ | |
+| Documents/Download | Download Thumbnail | ✅ | |
+| Workflow | Get Document Workflow History | ✅ | |
+| Workflow | Get Document Workflow History Steps | ✅ | |
@@ -258,183 +258,744 @@ $connector = new CustomDocuWareConnector();
### Available Requests
- Available Requests
+ Documents
+#### Add Line Entry Annotation
```php
-/**
- * Return an organization.
- */
-
-$organization = $connector->send(new GetOrganization($id))->dto();
+use CodebarAg\DocuWare\DTO\Documents\AnnotationsStamps\AnnotationItem;
+use CodebarAg\DocuWare\DTO\Documents\AnnotationsStamps\AnnotationItemLayer;
+use CodebarAg\DocuWare\DTO\Documents\AnnotationsStamps\AnnotationItemLayerItem;
+use CodebarAg\DocuWare\DTO\Documents\AnnotationsStamps\AnnotationItemLocation;
+use CodebarAg\DocuWare\DTO\Documents\AnnotationsStamps\AnnotationPlacement;
+use CodebarAg\DocuWare\DTO\Documents\AnnotationsStamps\Annotations;
+use CodebarAg\DocuWare\Requests\Documents\AnnotationsStamps\AddLineEntryAnnotation;
+
+$annotations = new Annotations(
+ pageNumber: 0,
+ sectionNumber: 0,
+ annotationsPlacement: new AnnotationPlacement(
+ items: collect([
+ new AnnotationItem(
+ type: 'Annotation',
+ layer: collect([
+ new AnnotationItemLayer(
+ id: 1,
+ items: collect([
+ new AnnotationItemLayerItem(
+ type: 'LineEntry',
+ color: 'Cyan',
+ rotation: 0,
+ transparent: false,
+ strokeWidth: 50,
+ arrow: false,
+ from: new AnnotationItemLocation(
+ x: 100,
+ y: 100,
+ ),
+ to: new AnnotationItemLocation(
+ x: 200,
+ y: 200,
+ ),
+ ),
+ ]),
+ ),
+ ]),
+ ),
+ ]),
+ ),
+);
+
+$stamp = $connector->send(new AddLineEntryAnnotation(
+ $fileCabinetId,
+ $documentId,
+ $annotations,
+))->dto();
```
+#### Add Rect Entry Annotation
```php
-/**
- * Return all file cabinets.
- */
-
-$fileCabinets = $connector->send(new GetAllFileCabinetsAndDocumentTrays())->dto();
+use CodebarAg\DocuWare\DTO\Documents\AnnotationsStamps\AnnotationItem;
+use CodebarAg\DocuWare\DTO\Documents\AnnotationsStamps\AnnotationItemLayer;
+use CodebarAg\DocuWare\DTO\Documents\AnnotationsStamps\AnnotationItemLayerItem;
+use CodebarAg\DocuWare\DTO\Documents\AnnotationsStamps\AnnotationItemLocation;
+use CodebarAg\DocuWare\DTO\Documents\AnnotationsStamps\AnnotationPlacement;
+use CodebarAg\DocuWare\DTO\Documents\AnnotationsStamps\Annotations;
+use CodebarAg\DocuWare\Requests\Documents\AnnotationsStamps\AddRectEntryAnnotation;
+
+$annotations = new Annotations(
+ pageNumber: 0,
+ sectionNumber: 0,
+ annotationsPlacement: new AnnotationPlacement(
+ items: collect([
+ new AnnotationItem(
+ type: 'Annotation',
+ layer: collect([
+ new AnnotationItemLayer(
+ id: 1,
+ items: collect([
+ new AnnotationItemLayerItem(
+ type: 'RectEntry',
+ color: 'Bisque',
+ rotation: 0,
+ transparent: false,
+ strokeWidth: 50,
+ filled: true,
+ ellipse: false,
+ location: new AnnotationItemLocation(
+ left: 100,
+ top: 100,
+ width: 1500,
+ height: 100,
+ ),
+ ),
+ ]),
+ ),
+ ]),
+ ),
+ ]),
+ ),
+);
+
+$stamp = $connector->send(new AddRectEntryAnnotation(
+ $fileCabinetId,
+ $documentId,
+ $annotations,
+))->dto();
```
+
+#### Add Stamp With Best Position
```php
-/**
- * Return all fields of a file cabinet.
- */
-
+use CodebarAg\DocuWare\DTO\Documents\AnnotationsStamps\AnnotationItem;
+use CodebarAg\DocuWare\DTO\Documents\AnnotationsStamps\AnnotationItemField;
+use CodebarAg\DocuWare\DTO\Documents\AnnotationsStamps\AnnotationItemFieldTypedValue;
+use CodebarAg\DocuWare\DTO\Documents\AnnotationsStamps\AnnotationPlacement;
+use CodebarAg\DocuWare\DTO\Documents\AnnotationsStamps\Annotations;
+use CodebarAg\DocuWare\Requests\Documents\AnnotationsStamps\AddStampWithBestPosition;
+
+$annotations = new Annotations(
+ pageNumber: 0,
+ sectionNumber: 0,
+ annotationsPlacement: new AnnotationPlacement(
+ items: collect([
+ new AnnotationItem(
+ type: 'StampPlacement',
+ layer: 1,
+ field: collect([
+ new AnnotationItemField(
+ name: '<#1>',
+ typedValue: new AnnotationItemFieldTypedValue(
+ item: 'Text',
+ itemElementName: 'String',
+ ),
+ value: 'Test',
+ textAsString: 'Test',
+ ),
+ ]),
+ stampId: 'e1b3f6cc-ed69-4af2-afa5-6d990c0144c5',
+ ),
+ ]),
+ ),
+);
+
+$stamp = $connector->send(new AddStampWithBestPosition(
+ $fileCabinetId,
+ $documentId,
+ $annotations,
+))->dto();
+```
+
+
+#### Add Stamp With Position
+```php
+use CodebarAg\DocuWare\DTO\Documents\AnnotationsStamps\AnnotationItem;
+use CodebarAg\DocuWare\DTO\Documents\AnnotationsStamps\AnnotationItemField;
+use CodebarAg\DocuWare\DTO\Documents\AnnotationsStamps\AnnotationItemFieldTypedValue;
+use CodebarAg\DocuWare\DTO\Documents\AnnotationsStamps\AnnotationItemLocation;
+use CodebarAg\DocuWare\DTO\Documents\AnnotationsStamps\AnnotationPlacement;
+use CodebarAg\DocuWare\DTO\Documents\AnnotationsStamps\Annotations;
+use CodebarAg\DocuWare\Requests\Documents\AnnotationsStamps\AddStampWithPosition;
+
+$annotations = new Annotations(
+ pageNumber: 0,
+ sectionNumber: 0,
+ annotationsPlacement: new AnnotationPlacement(
+ items: collect([
+ new AnnotationItem(
+ type: 'StampPlacement',
+ layer: 1,
+ field: collect([
+ new AnnotationItemField(
+ name: '<#1>',
+ typedValue: new AnnotationItemFieldTypedValue(
+ item: 'Text',
+ itemElementName: 'String',
+ ),
+ value: 'Test',
+ textAsString: 'Test',
+ ),
+ ]),
+ location: new AnnotationItemLocation(
+ x: 0.5,
+ y: 0.5,
+ ),
+ stampId: 'e1b3f6cc-ed69-4af2-afa5-6d990c0144c5',
+ ),
+ ]),
+ ),
+);
+
+$stamp = $connector->send(new AddStampWithPosition(
+ $fileCabinetId,
+ $documentId,
+ $annotations,
+))->dto();
+```
+
+#### Add Text Annotation
+```php
+use CodebarAg\DocuWare\DTO\Documents\AnnotationsStamps\AnnotationItem;
+use CodebarAg\DocuWare\DTO\Documents\AnnotationsStamps\AnnotationItemFont;
+use CodebarAg\DocuWare\DTO\Documents\AnnotationsStamps\AnnotationItemLayer;
+use CodebarAg\DocuWare\DTO\Documents\AnnotationsStamps\AnnotationItemLayerItem;
+use CodebarAg\DocuWare\DTO\Documents\AnnotationsStamps\AnnotationItemLocation;
+use CodebarAg\DocuWare\DTO\Documents\AnnotationsStamps\AnnotationPlacement;
+use CodebarAg\DocuWare\DTO\Documents\AnnotationsStamps\Annotations;
+use CodebarAg\DocuWare\Requests\Documents\AnnotationsStamps\AddTextAnnotation;
+
+$annotations = new Annotations(
+ pageNumber: 0,
+ sectionNumber: 0,
+ annotationsPlacement: new AnnotationPlacement(
+ items: collect([
+ new AnnotationItem(
+ type: 'Annotation',
+ layer: collect([
+ new AnnotationItemLayer(
+ id: 1,
+ items: collect([
+ new AnnotationItemLayerItem(
+ type: 'TextEntry',
+ color: 'Black',
+ rotation: 0,
+ transparent: false,
+ strokeWidth: 50,
+ value: 'Test',
+ font: new AnnotationItemFont(
+ fontName: 'Arial',
+ bold: false,
+ italic: false,
+ underlined: false,
+ strikeThrough: false,
+ fontSize: 12,
+ spacing: 0,
+ ),
+ location: new AnnotationItemLocation(
+ left: 100,
+ top: 100,
+ width: 1500,
+ height: 100,
+ ),
+ ),
+ ]),
+ ),
+ ]),
+ ),
+ ]),
+ ),
+);
+
+$stamp = $connector->send(new AddTextAnnotation(
+ $fileCabinetId,
+ $documentId,
+ $annotations,
+))->dto();
+```
+
+#### Add Application Properties
+```php
+use CodebarAg\DocuWare\Requests\Documents\ApplicationProperties\AddApplicationProperties;
+
+$addProperties = $connector->send(new AddApplicationProperties(
+ $fileCabinetId,
+ $documentId,
+ [
+ [
+ 'Name' => 'Key1',
+ 'Value' => 'Key1 Value',
+ ],
+ [
+ 'Name' => 'Key2',
+ 'Value' => 'Key2 Value',
+ ],
+ ],
+))->dto();
+```
+
+#### Update Application Properties
+```php
+use CodebarAg\DocuWare\Requests\Documents\ApplicationProperties\UpdateApplicationProperties;
+
+$updateProperties = $connector->send(new UpdateApplicationProperties(
+ $fileCabinetId,
+ $documentId,
+ [
+ [
+ 'Name' => 'Key1',
+ 'Value' => 'Key1 Value Updated',
+ ],
+ ],
+))->dto()->sortBy('Name');
+```
+
+#### Delete Application Properties
+```php
+use CodebarAg\DocuWare\Requests\Documents\ApplicationProperties\DeleteApplicationProperties;
+
+$deleteProperties = $connector->send(new DeleteApplicationProperties(
+ $fileCabinetId,
+ $document->id,
+ [
+ 'Key1',
+ ],
+))->dto();
+```
+
+#### Get Application Properties
+```php
+use CodebarAg\DocuWare\Requests\Documents\ApplicationProperties\GetApplicationProperties;
+
+$properties = $connector->send(new GetApplicationProperties(
+ $fileCabinetId,
+ $document->id,
+))->dto();
+```
+
+
+#### Clip
+```php
+use CodebarAg\DocuWare\Requests\Documents\ClipUnclipStapleUnstaple\Clip;
+
+$clip = $connector->send(new Clip(
+ $fileCabinetId,
+ [
+ $documentId,
+ $document2Id,
+ ]
+))->dto();
+```
+
+#### Unclip
+```php
+use CodebarAg\DocuWare\Requests\Documents\ClipUnclipStapleUnstaple\Unclip;
+
+$unclip = $connector->send(new Unclip(
+ $fileCabinetId,
+ $clipId
+))->dto();
+```
+
+#### Staple
+```php
+use CodebarAg\DocuWare\Requests\Documents\ClipUnclipStapleUnstaple\Staple;
+
+$staple = $connector->send(new Staple(
+ $fileCabinetId,
+ [
+ $documentId,
+ $document2Id,
+ ]
+))->dto();
+```
+
+#### Unstaple
+```php
+use CodebarAg\DocuWare\Requests\Documents\ClipUnclipStapleUnstaple\Unstaple;
+
+$unclip = $connector->send(new Unstaple(
+ $fileCabinetId,
+ $stapleId
+))->dto();
+```
+
+#### Delete Documents
+```php
+use CodebarAg\DocuWare\Requests\Documents\DocumentsTrashBin\DeleteDocuments;
+
+$delete = $connector->send(new DeleteDocuments([$documentID, $document2ID]))->dto();
+```
+
+#### Restore Documents
+```php
+use CodebarAg\DocuWare\Requests\Documents\DocumentsTrashBin\RestoreDocuments;
+
+$delete = $connector->send(new RestoreDocuments([$documentID, $document2ID]))->dto();
+```
+
+#### Download Document
+```php
+use CodebarAg\DocuWare\Requests\Documents\Download\DownloadDocument;
+
+$contents = $connector->send(new DownloadDocument(
+ $fileCabinetId,
+ $documentId
+))->dto();
+```
+
+#### Download Section
+```php
+use CodebarAg\DocuWare\Requests\Documents\Download\DownloadSection;
+
+$contents = $connector->send(new DownloadSection(
+ $fileCabinetId,
+ $sectionId
+))->dto();
+```
+
+#### Download Thumbnail
+```php
+use CodebarAg\DocuWare\Requests\Documents\Download\DownloadThumbnail;
+
+$contents = $connector->send(new DownloadThumbnail(
+ $fileCabinetId,
+ $sectionId
+))->dto();
+```
+
+#### Delete Section
+```php
+use CodebarAg\DocuWare\Requests\Documents\Sections\DeleteSection;
+
+$deleted = $connector->send(new DeleteSection(
+ $fileCabinetId,
+ $sectionId
+))->dto();
+```
+
+#### Get All Section
+```php
+use CodebarAg\DocuWare\Requests\Documents\Sections\GetAllSectionsFromADocument;
+
+$sections = $connector->send(new GetAllSectionsFromADocument(
+ $fileCabinetId,
+ $documentId
+))->dto();
+```
+
+#### Get Specific Section
+```php
+use CodebarAg\DocuWare\Requests\Documents\Sections\GetASpecificSection;
+
+$section = $connector->send(new GetASpecificSection(
+ $fileCabinetId,
+ $sectionsId
+))->dto();
+```
+
+
+#### Get Total Number Of Documents
+```php
+use CodebarAg\DocuWare\Requests\FileCabinets\General\GetTotalNumberOfDocuments;
+
+$count = $connector->send(new GetTotalNumberOfDocuments(
+ $fileCabinetId,
+ $dialogId
+))->dto();
+```
+
+#### Get Document Preview
+```php
+use CodebarAg\DocuWare\Requests\Documents\GetDocumentPreviewRequest;
+
+$image = $connector->send(new GetDocumentPreviewRequest($fileCabinetId, $documentId))->dto();
+```
+
+#### Create Data Record
+```php
+use CodebarAg\DocuWare\Requests\FileCabinets\Upload\CreateDataRecord;
+
+$document = $connector->send(new CreateDataRecord(
+ $fileCabinetId,
+ null,
+ null,
+ collect([
+ IndexTextDTO::make('DOCUMENT_LABEL', '::data-entry::'),
+ ]),
+))->dto();
+```
+
+#### Update Index Values
+```php
+use CodebarAg\DocuWare\Requests\Documents\UpdateIndexValues\UpdateIndexValues;
+
+$response = $connector->send(new UpdateIndexValues(
+ $fileCabinetId,
+ $documentId,
+ collect([
+ IndexTextDTO::make('DOCUMENT_LABEL', '::new-data-entry::'),
+ ])
+))->dto();
+```
+
+
+
+
+ Fields
+
+#### Get Fields
+```php
+use CodebarAg\DocuWare\Requests\Fields\GetFieldsRequest;
+
$fields = $connector->send(new GetFieldsRequest($fileCabinetId))->dto();
```
+
+
+
+ File Cabinets
+
+#### Get All Dialogs
```php
-/**
- * Return all dialogs of a file cabinet.
- */
-
+use CodebarAg\DocuWare\Requests\FileCabinets\Dialogs\GetAllDialogs;
+
$dialogs = $connector->send(new GetAllDialogs($fileCabinetId))->dto();
```
+#### Get Dialogs of a Specific Type
```php
-/**
- * Return all used values for a specific field.
- */
-
-$values = $connector->send(new GetSelectList($fileCabinetId, $dialogId, $fieldName))->dto();
+use CodebarAg\DocuWare\Requests\FileCabinets\Dialogs\GetASpecificDialog;
+
+$dialog = $connector->send(new GetASpecificDialog($fileCabinetId, $dialogId))->dto();
```
+#### Get Dialogs Of A Specific Type
```php
-/**
- * Return a document.
- */
-
+use CodebarAg\DocuWare\Enums\DialogType;
+use CodebarAg\DocuWare\Requests\FileCabinets\Dialogs\GetDialogsOfASpecificType;
+
+$dialogs = $connector->send(new GetDialogsOfASpecificType($fileCabinetId, DialogType::SEARCH))->dto();
+```
+
+#### Get File Cabinet Information
+```php
+use CodebarAg\DocuWare\Requests\FileCabinets\General\GetFileCabinetInformation;
+
+$fileCabinet = $connector->send(new GetFileCabinetInformation($fileCabinetId))->dto();
+```
+
+#### Get A Specific Document From A File Cabinet
+```php
+use CodebarAg\DocuWare\Requests\FileCabinets\Search\GetASpecificDocumentFromAFileCabinet;
+
$document = $connector->send(new GetASpecificDocumentFromAFileCabinet($fileCabinetId, $documentId))->dto();
```
+#### Get Documents From A File Cabinet
```php
-/**
- * Return all documents for a file cabinet.
- */
-
-$documents = $connector->send(new GetDocumentsFromAFileCabinet($fileCabinetId))->dto();
+use CodebarAg\DocuWare\Requests\FileCabinets\Search\GetDocumentsFromAFileCabinet;
+
+$documents = $connector->send(new GetDocumentsFromAFileCabinet(
+ config('laravel-docuware.tests.file_cabinet_id')
+))->dto();
```
+#### Append Files To A Data Record
```php
-/**
- * Return image preview of a document.
- */
-
-$content = $connector->send(new GetDocumentPreviewRequest($fileCabinetId, $documentId))->dto();
+use CodebarAg\DocuWare\Requests\FileCabinets\Upload\AppendFilesToADataRecord;
+
+$response = $connector->send(
+ new AppendFilesToADataRecord(
+ fileCabinetId: $fileCabinetId,
+ dataRecordId: $document->id,
+ files: collect([
+ new MultipartValue(
+ name: 'File[]',
+ value: file_get_contents(__DIR__.'/../../../../Fixtures/files/test-2.pdf'),
+ filename: 'test-2.pdf',
+ ),
+ new MultipartValue(
+ name: 'File[]',
+ value: file_get_contents(__DIR__.'/../../../../Fixtures/files/test-3.pdf'),
+ filename: 'test-3.pdf',
+ ),
+ ])
+ )
+)->dto();
```
+
+
+ General
+
+#### Create User
```php
-/**
- * Download single document.
- */
-
-$content = $connector->send(new DownloadDocument($fileCabinetId, $documentId))->dto();
+use CodebarAg\DocuWare\Requests\General\UserManagement\CreateUpdateUsers\CreateUser;
+
+$user = $connector->send(new CreateUser(new User(
+ name: $timestamp.' - Test User',
+ dbName: $timestamp,
+ email: $timestamp.'-test@example.test',
+ password: 'TESTPASSWORD',
+)))->dto();
```
+#### Update User
```php
-/**
- * Get sections of a document.
- */
-
-$section = $connector->send(new GetSectionsRequest($fileCabinetId, $documentId))->dto();
+use CodebarAg\DocuWare\Requests\General\UserManagement\CreateUpdateUsers\UpdateUser;
+
+$user->name .= ' - Updated';
+$user->active = false;
+
+$user = $connector->send(new UpdateUser($user))->dto();
```
+#### Add User To A Group
```php
-/**
- * Download a document thumbnail.
- *
- * You will use $section->id from above as $thumbnailId.
- */
-
-$thumbnail = $connector->send(new DownloadThumbnail($fileCabinetId, $thumbnailId, $page = 0))->dto();
+use CodebarAg\DocuWare\Requests\General\UserManagement\GetModifyGroups\AddUserToAGroup;
+
+$response = $connector->send(new AddUserToAGroup(
+ userId: $userId,
+ ids: [$groupId],
+))->dto();
```
+#### Remove User From A Group
```php
-/**
- * Update value of a indexed field.
- */
-
-$value = $connector->send(new UpdateIndexValues($fileCabinetId, $documentId, [$fieldName => $newValue]))->dto();
+use CodebarAg\DocuWare\Requests\General\UserManagement\GetModifyGroups\RemoveUserFromAGroup;
+
+$response = $connector->send(new RemoveUserFromAGroup(
+ userId: $userId,
+ ids: [$groupId],
+))->dto();
```
+#### Get All Groups For A Specific User
```php
-/**
- * Update multiple values of indexed fields.
- */
-
-$values = $connector->send(new UpdateIndexValues($fileCabinetId, $documentId, [
- $fieldName => $newValue,
- $field2Name => $new2Value,
-]))->dto();
+use CodebarAg\DocuWare\Requests\General\UserManagement\GetModifyGroups\GetAllGroupsForASpecificUser;
+
+$groups = $connector->send(new GetAllGroupsForASpecificUser($userId))->dto();
```
+#### Get Groups
```php
-/**
- * Upload new document.
- */
-
-$document = $connector->send(new CreateDataRecord($fileCabinetId, $fileContent, $fileName))->dto();
+use CodebarAg\DocuWare\Requests\General\UserManagement\GetModifyGroups\GetGroups;
+
+$groups = $connector->send(new GetGroups())->dto();
```
+#### Add User To A Role
```php
-/**
- * Get total document count.
- */
-
-$content = $connector->send(new GetTotalNumberOfDocuments($fileCabinetId, $dialogId))->dto();
+use CodebarAg\DocuWare\Requests\General\UserManagement\GetModifyRoles\AddUserToARole;
+
+$response = $connector->send(new AddUserToARole(
+ userId: $userId,
+ ids: [$roleId],
+))->dto();
```
+#### Remove User From A Role
```php
-/**
- * Upload new document with index values.
- */
-
-use CodebarAg\DocuWare\DTO\Documents\DocumentIndex\PrepareDTO;
-
-$indexes = collect([
- PrepareDTO::make('FIELD_TEXT', 'Indexed Text'),
- PrepareDTO::make('FIELD_NUMERIC', 1),
- PrepareDTO::make('FIELD_DECIMAL', 1.00),
- PrepareDTO::make('FIELD_DATE', now()),
-]);
-
-$document = $connector->send(new PostDocumentRequest(
+use CodebarAg\DocuWare\Requests\General\UserManagement\GetModifyRoles\RemoveUserFromARole;
+
+$response = $connector->send(new RemoveUserFromARole(
+ userId: $userId,
+ ids: [$roleId],
+))->dto();
+```
+
+#### Get All Roles For A Specific User
+```php
+use CodebarAg\DocuWare\Requests\General\UserManagement\GetModifyRoles\GetAllRolesForASpecificUser;
+
+$roles = $connector->send(new GetAllRolesForASpecificUser($userId))->dto();
+```
+
+#### Get Roles
+```php
+use CodebarAg\DocuWare\Requests\General\UserManagement\GetModifyRoles\GetRoles;
+
+$roles = $this->connector->send(new GetRoles())->dto();
+```
+
+#### Get User By Id
+```php
+use CodebarAg\DocuWare\Requests\General\UserManagement\GetUsers\GetUserById;
+
+$user = $this->connector->send(new GetUserById($userId))->dto();
+```
+
+#### Get Users Of A Group
+```php
+use CodebarAg\DocuWare\Requests\General\UserManagement\GetUsers\GetUsersOfAGroup;
+
+$users = $this->connector->send(new GetUsersOfAGroup($groupId))->dto();
+```
+
+#### Get Users Of A Role
+```php
+use CodebarAg\DocuWare\Requests\General\UserManagement\GetUsers\GetUsersOfARole;
+
+$users = $this->connector->send(new GetUsersOfARole($roleId))->dto();
+```
+
+### Get Users
+```php
+use CodebarAg\DocuWare\Requests\General\UserManagement\GetUsers\GetUsers;
+
+$users = $this->connector->send(new GetUsers())->dto();
+```
+
+
+
+
+ Organization
+
+#### Get Organization
+```php
+use CodebarAg\DocuWare\Requests\General\Organization\GetOrganization;
+
+$organizations = $this->connector->send(new GetOrganization())->dto();
+```
+
+
+
+
+ Select List
+
+#### Get Select Lists
+```php
+use CodebarAg\DocuWare\Requests\FileCabinets\SelectLists\GetSelectLists;
+
+$types = $this->connector->send(new GetSelectLists(
$fileCabinetId,
- $fileContent,
- $fileName,
- $indexes,
+ $dialogId,
+ $fieldName,
))->dto();
```
+
+
+
+ Workflow
+
+#### Get Document Workflow History
```php
-/**
- * Upload new data entry with index values.
- */
-
-use CodebarAg\DocuWare\DTO\Documents\DocumentIndex\PrepareDTO;
-
-$indexes = collect([
- PrepareDTO::make('FIELD_TEXT', 'Indexed Text'),
- PrepareDTO::make('FIELD_NUMERIC', 1),
- PrepareDTO::make('FIELD_DECIMAL', 1.00),
- PrepareDTO::make('FIELD_DATE', now()),
-]);
-
-$document = $connector->send(new PostDocumentRequest(
+use CodebarAg\DocuWare\Requests\Workflow\GetDocumentWorkflowHistory;
+
+$history = $this->connector->send(new GetDocumentWorkflowHistory(
$fileCabinetId,
- null,
- null,
- $indexes,
+ $documentId
))->dto();
```
+#### Get Document Workflow History Steps
```php
-/**
- * Delete document.
- */
-
-$connector->send(new DeleteDocumentRequest($fileCabinetId, $document->id))->dto();
+use CodebarAg\DocuWare\Requests\Workflow\GetDocumentWorkflowHistorySteps;
+
+$historySteps = $this->connector->send(new GetDocumentWorkflowHistorySteps(
+ $workflowId,
+ $historyId,
+))->dto();
```
@@ -629,6 +1190,20 @@ $paginator = $connector->send($paginatorRequest)->dto();
```
+## 🔍 Search usage TrashBin
+
+ Search Usage
+
+> You can use the same methods as in the search usage. The only difference is that you have to use the `trashBin` method after the `searchRequestBuilder` method.
+
+```php
+use CodebarAg\DocuWare\DocuWare;
+
+$paginatorRequest = (new DocuWare())
+ ->searchRequestBuilder()
+ ->trashBin()
+```
+
## 🖼 Make encrypted URL
diff --git a/tests/Feature/Requests/Documents/Thumbnail/GetDocumentDownloadThumbnailRequestTest.php b/tests/Feature/Requests/Documents/Thumbnail/GetDocumentDownloadThumbnailRequestTest.php
deleted file mode 100644
index 9297ae4..0000000
--- a/tests/Feature/Requests/Documents/Thumbnail/GetDocumentDownloadThumbnailRequestTest.php
+++ /dev/null
@@ -1,37 +0,0 @@
-connector->send(new CreateDataRecord(
- $fileCabinetId,
- '::fake-file-content::',
- 'example.txt'
- ))->dto();
-
- $sections = $this->connector->send(new GetAllSectionsFromADocument(
- $fileCabinetId,
- $document->id,
- ))->dto();
-
- $contents = $this->connector->send(new DownloadThumbnail(
- $fileCabinetId,
- $sections->first()->id,
- ))->dto();
-
- $this->assertSame('image/png', $contents->mime);
- $this->assertSame(282, strlen($contents->data));
-
- $this->assertInstanceOf(DocumentThumbnail::class, $contents);
-
- Event::assertDispatched(DocuWareResponseLog::class);
-});
From 10610b89066b8127b543382fe2eff0c5b8a50a4f Mon Sep 17 00:00:00 2001
From: RhysLees
Date: Mon, 29 Jul 2024 16:10:26 +0000
Subject: [PATCH 54/54] Fix styling
---
src/Connectors/DocuWareConnector.php | 2 +-
src/DocuWare.php | 6 +++---
tests/Feature/DocuWareAuthenticationTest.php | 6 +++---
tests/Feature/DocuWareTest.php | 4 ++--
.../DeleteDocumentsFromTrashBinTest.php | 2 +-
.../GetDocumentsFromTrashBinTest.php | 16 ++++++++--------
.../RestoreDocumentsFromTrashBinTest.php | 2 +-
.../GetAllGroupsForASpecificUserTest.php | 2 +-
.../GetModifyGroups/GetGroupsTest.php | 2 +-
.../GetAllRolesForASpecificUserTest.php | 2 +-
.../GetModifyRoles/GetRolesTest.php | 2 +-
.../GetUsers/GetUserByIdTest.php | 2 +-
.../GetUsers/GetUsersOfAGroupTest.php | 2 +-
.../GetUsers/GetUsersOfARoleTest.php | 2 +-
.../UserManagement/GetUsers/GetUsersTest.php | 2 +-
.../GetOrganizationsRequestTest.php | 2 +-
.../Requests/Search/GetSearchRequestTest.php | 18 +++++++++---------
tests/Pest.php | 4 ++--
18 files changed, 39 insertions(+), 39 deletions(-)
diff --git a/src/Connectors/DocuWareConnector.php b/src/Connectors/DocuWareConnector.php
index f64acb3..ddc2e4a 100644
--- a/src/Connectors/DocuWareConnector.php
+++ b/src/Connectors/DocuWareConnector.php
@@ -89,7 +89,7 @@ protected function getOrCreateNewOAuthToken()
protected function getAuthenticationTokenEndpoint(): IdentityServiceConfiguration
{
- $responsibleIdentityServiceResponse = (new GetResponsibleIdentityService())->send();
+ $responsibleIdentityServiceResponse = (new GetResponsibleIdentityService)->send();
$identityServiceConfigurationResponse = (new GetIdentityServiceConfiguration(
identityServiceUrl: $responsibleIdentityServiceResponse->dto()->identityServiceUrl
diff --git a/src/DocuWare.php b/src/DocuWare.php
index f277219..59914ec 100644
--- a/src/DocuWare.php
+++ b/src/DocuWare.php
@@ -15,7 +15,7 @@ public function getNewAuthenticationOAuthToken(
?string $grantType = 'password',
?string $clientId = 'docuware.platform.net.client'
): RequestTokenDto {
- $responsibleIdentityServiceResponse = (new GetResponsibleIdentityService())->send();
+ $responsibleIdentityServiceResponse = (new GetResponsibleIdentityService)->send();
$identityServiceConfigurationResponse = (new GetIdentityServiceConfiguration(
identityServiceUrl: $responsibleIdentityServiceResponse->dto()->identityServiceUrl
@@ -33,11 +33,11 @@ public function getNewAuthenticationOAuthToken(
public function searchRequestBuilder(): DocuWareSearchRequestBuilder
{
- return new DocuWareSearchRequestBuilder();
+ return new DocuWareSearchRequestBuilder;
}
public function url(): DocuWareUrl
{
- return new DocuWareUrl();
+ return new DocuWareUrl;
}
}
diff --git a/tests/Feature/DocuWareAuthenticationTest.php b/tests/Feature/DocuWareAuthenticationTest.php
index 643d648..aa96b0b 100644
--- a/tests/Feature/DocuWareAuthenticationTest.php
+++ b/tests/Feature/DocuWareAuthenticationTest.php
@@ -10,13 +10,13 @@
use CodebarAg\DocuWare\Requests\General\Organization\GetOrganization;
it('can get oath responsible identity service', function () {
- $responsibleIdentityServiceResponse = (new GetResponsibleIdentityService())->send();
+ $responsibleIdentityServiceResponse = (new GetResponsibleIdentityService)->send();
expect($responsibleIdentityServiceResponse->dto())->toBeInstanceOf(ResponsibleIdentityService::class);
})->group('authentication');
it('can get oath identity service configuration', function () {
- $responsibleIdentityServiceResponse = (new GetResponsibleIdentityService())->send();
+ $responsibleIdentityServiceResponse = (new GetResponsibleIdentityService)->send();
$identityServiceConfigurationResponse = (new GetIdentityServiceConfiguration(
identityServiceUrl: $responsibleIdentityServiceResponse->dto()->identityServiceUrl
@@ -33,7 +33,7 @@
password: config('laravel-docuware.credentials.password'),
));
- $connector->send(new GetOrganization());
+ $connector->send(new GetOrganization);
Event::assertDispatched(DocuWareOAuthLog::class);
diff --git a/tests/Feature/DocuWareTest.php b/tests/Feature/DocuWareTest.php
index 6860e22..34c9be4 100644
--- a/tests/Feature/DocuWareTest.php
+++ b/tests/Feature/DocuWareTest.php
@@ -11,7 +11,7 @@
$fileCabinetId = config('laravel-docuware.tests.file_cabinet_id');
$documentId = config('laravel-docuware.tests.document_id');
- $url = (new DocuWare())
+ $url = (new DocuWare)
->url()
->fileCabinet($fileCabinetId)
->document($documentId)
@@ -35,7 +35,7 @@
$basketId = config('laravel-docuware.tests.basket_id');
$documentId = config('laravel-docuware.tests.document_id');
- $url = (new DocuWare())
+ $url = (new DocuWare)
->url()
->basket($basketId)
->document($documentId)
diff --git a/tests/Feature/Requests/Documents/DocumentsTrashBin/DeleteDocumentsFromTrashBinTest.php b/tests/Feature/Requests/Documents/DocumentsTrashBin/DeleteDocumentsFromTrashBinTest.php
index 86ddd56..19bbb91 100644
--- a/tests/Feature/Requests/Documents/DocumentsTrashBin/DeleteDocumentsFromTrashBinTest.php
+++ b/tests/Feature/Requests/Documents/DocumentsTrashBin/DeleteDocumentsFromTrashBinTest.php
@@ -20,7 +20,7 @@
$document->id,
))->dto();
- $paginatorRequest = (new DocuWare())
+ $paginatorRequest = (new DocuWare)
->searchRequestBuilder()
->trashBin()
->get();
diff --git a/tests/Feature/Requests/Documents/DocumentsTrashBin/GetDocumentsFromTrashBinTest.php b/tests/Feature/Requests/Documents/DocumentsTrashBin/GetDocumentsFromTrashBinTest.php
index e5d5fee..fa1b09c 100644
--- a/tests/Feature/Requests/Documents/DocumentsTrashBin/GetDocumentsFromTrashBinTest.php
+++ b/tests/Feature/Requests/Documents/DocumentsTrashBin/GetDocumentsFromTrashBinTest.php
@@ -10,7 +10,7 @@
it('can search documents in trash', function () {
Event::fake();
- $paginatorRequest = (new DocuWare())
+ $paginatorRequest = (new DocuWare)
->searchRequestBuilder()
->trashBin()
->page(1)
@@ -33,7 +33,7 @@
$this->expectException(UnableToSearch::class);
- $request = (new DocuWare())
+ $request = (new DocuWare)
->searchRequestBuilder()
->trashBin()
->page(1)
@@ -52,7 +52,7 @@
it('can override search documents dates filter by using same operator in trash', function () {
Event::fake();
- $paginatorRequest = (new DocuWare())
+ $paginatorRequest = (new DocuWare)
->searchRequestBuilder()
->trashBin()
->page(1)
@@ -74,7 +74,7 @@
it('can override search documents dates filter by using equal operator in trash', function () {
Event::fake();
- $paginatorRequest = (new DocuWare())
+ $paginatorRequest = (new DocuWare)
->searchRequestBuilder()
->trashBin()
->page(1)
@@ -97,7 +97,7 @@
$this->expectException(UnableToSearch::class);
- $request = (new DocuWare())
+ $request = (new DocuWare)
->searchRequestBuilder()
->trashBin()
->page(1)
@@ -115,7 +115,7 @@
it('can search documents dates filter in future in trash', function () {
Event::fake();
- $paginatorRequest = (new DocuWare())
+ $paginatorRequest = (new DocuWare)
->searchRequestBuilder()
->trashBin()
->page(1)
@@ -135,7 +135,7 @@
it('can search documents dates filter in past in trash', function () {
Event::fake();
- $paginatorRequest = (new DocuWare())
+ $paginatorRequest = (new DocuWare)
->searchRequestBuilder()
->trashBin()
->page(1)
@@ -155,7 +155,7 @@
it('can search documents with null values in trash', function () {
Event::fake();
- $paginatorRequest = (new DocuWare())
+ $paginatorRequest = (new DocuWare)
->searchRequestBuilder()
->trashBin()
->page(null)
diff --git a/tests/Feature/Requests/Documents/DocumentsTrashBin/RestoreDocumentsFromTrashBinTest.php b/tests/Feature/Requests/Documents/DocumentsTrashBin/RestoreDocumentsFromTrashBinTest.php
index 0b39b03..7a9330d 100644
--- a/tests/Feature/Requests/Documents/DocumentsTrashBin/RestoreDocumentsFromTrashBinTest.php
+++ b/tests/Feature/Requests/Documents/DocumentsTrashBin/RestoreDocumentsFromTrashBinTest.php
@@ -20,7 +20,7 @@
$document->id,
))->dto();
- $paginatorRequest = (new DocuWare())
+ $paginatorRequest = (new DocuWare)
->searchRequestBuilder()
->trashBin()
->get();
diff --git a/tests/Feature/Requests/General/UserManagement/GetModifyGroups/GetAllGroupsForASpecificUserTest.php b/tests/Feature/Requests/General/UserManagement/GetModifyGroups/GetAllGroupsForASpecificUserTest.php
index 1010139..37c8ba9 100644
--- a/tests/Feature/Requests/General/UserManagement/GetModifyGroups/GetAllGroupsForASpecificUserTest.php
+++ b/tests/Feature/Requests/General/UserManagement/GetModifyGroups/GetAllGroupsForASpecificUserTest.php
@@ -10,7 +10,7 @@
it('can list groups for a specific user', function () {
Event::fake();
- $users = $this->connector->send(new GetUsers())->dto();
+ $users = $this->connector->send(new GetUsers)->dto();
$groups = $this->connector->send(new GetAllGroupsForASpecificUser($users->get(2)->id))->dto();
diff --git a/tests/Feature/Requests/General/UserManagement/GetModifyGroups/GetGroupsTest.php b/tests/Feature/Requests/General/UserManagement/GetModifyGroups/GetGroupsTest.php
index 7d04e77..c984961 100644
--- a/tests/Feature/Requests/General/UserManagement/GetModifyGroups/GetGroupsTest.php
+++ b/tests/Feature/Requests/General/UserManagement/GetModifyGroups/GetGroupsTest.php
@@ -9,7 +9,7 @@
it('can list groups', function () {
Event::fake();
- $groups = $this->connector->send(new GetGroups())->dto();
+ $groups = $this->connector->send(new GetGroups)->dto();
$this->assertInstanceOf(Collection::class, $groups);
diff --git a/tests/Feature/Requests/General/UserManagement/GetModifyRoles/GetAllRolesForASpecificUserTest.php b/tests/Feature/Requests/General/UserManagement/GetModifyRoles/GetAllRolesForASpecificUserTest.php
index 1794ad8..45ab728 100644
--- a/tests/Feature/Requests/General/UserManagement/GetModifyRoles/GetAllRolesForASpecificUserTest.php
+++ b/tests/Feature/Requests/General/UserManagement/GetModifyRoles/GetAllRolesForASpecificUserTest.php
@@ -10,7 +10,7 @@
it('can list groups', function () {
Event::fake();
- $users = $this->connector->send(new GetUsers())->dto();
+ $users = $this->connector->send(new GetUsers)->dto();
$roles = $this->connector->send(new GetAllRolesForASpecificUser($users->get(2)->id))->dto();
diff --git a/tests/Feature/Requests/General/UserManagement/GetModifyRoles/GetRolesTest.php b/tests/Feature/Requests/General/UserManagement/GetModifyRoles/GetRolesTest.php
index b881811..cafd5d3 100644
--- a/tests/Feature/Requests/General/UserManagement/GetModifyRoles/GetRolesTest.php
+++ b/tests/Feature/Requests/General/UserManagement/GetModifyRoles/GetRolesTest.php
@@ -9,7 +9,7 @@
it('can list groups', function () {
Event::fake();
- $roles = $this->connector->send(new GetRoles())->dto();
+ $roles = $this->connector->send(new GetRoles)->dto();
$this->assertInstanceOf(Collection::class, $roles);
diff --git a/tests/Feature/Requests/General/UserManagement/GetUsers/GetUserByIdTest.php b/tests/Feature/Requests/General/UserManagement/GetUsers/GetUserByIdTest.php
index 43e7363..db417ab 100644
--- a/tests/Feature/Requests/General/UserManagement/GetUsers/GetUserByIdTest.php
+++ b/tests/Feature/Requests/General/UserManagement/GetUsers/GetUserByIdTest.php
@@ -9,7 +9,7 @@
it('can get user by id', function () {
Event::fake();
- $users = $this->connector->send(new GetUsers())->dto();
+ $users = $this->connector->send(new GetUsers)->dto();
$user = $this->connector->send(new GetUserById($users->get(2)->id))->dto();
diff --git a/tests/Feature/Requests/General/UserManagement/GetUsers/GetUsersOfAGroupTest.php b/tests/Feature/Requests/General/UserManagement/GetUsers/GetUsersOfAGroupTest.php
index 61164cd..5be8470 100644
--- a/tests/Feature/Requests/General/UserManagement/GetUsers/GetUsersOfAGroupTest.php
+++ b/tests/Feature/Requests/General/UserManagement/GetUsers/GetUsersOfAGroupTest.php
@@ -10,7 +10,7 @@
it('can list users of a group', function () {
Event::fake();
- $groups = $this->connector->send(new GetGroups())->dto();
+ $groups = $this->connector->send(new GetGroups)->dto();
$users = $this->connector->send(new GetUsersOfAGroup($groups->first()->id))->dto();
diff --git a/tests/Feature/Requests/General/UserManagement/GetUsers/GetUsersOfARoleTest.php b/tests/Feature/Requests/General/UserManagement/GetUsers/GetUsersOfARoleTest.php
index 7af21ae..f9de422 100644
--- a/tests/Feature/Requests/General/UserManagement/GetUsers/GetUsersOfARoleTest.php
+++ b/tests/Feature/Requests/General/UserManagement/GetUsers/GetUsersOfARoleTest.php
@@ -10,7 +10,7 @@
it('can list users of a role', function () {
Event::fake();
- $roles = $this->connector->send(new GetRoles())->dto();
+ $roles = $this->connector->send(new GetRoles)->dto();
$users = $this->connector->send(new GetUsersOfARole($roles->first()->id))->dto();
diff --git a/tests/Feature/Requests/General/UserManagement/GetUsers/GetUsersTest.php b/tests/Feature/Requests/General/UserManagement/GetUsers/GetUsersTest.php
index b6a96a0..6b8696a 100644
--- a/tests/Feature/Requests/General/UserManagement/GetUsers/GetUsersTest.php
+++ b/tests/Feature/Requests/General/UserManagement/GetUsers/GetUsersTest.php
@@ -9,7 +9,7 @@
it('can list users', function () {
Event::fake();
- $users = $this->connector->send(new GetUsers())->dto();
+ $users = $this->connector->send(new GetUsers)->dto();
$this->assertInstanceOf(Collection::class, $users);
diff --git a/tests/Feature/Requests/Organization/GetOrganizationsRequestTest.php b/tests/Feature/Requests/Organization/GetOrganizationsRequestTest.php
index 59e8e74..145529c 100644
--- a/tests/Feature/Requests/Organization/GetOrganizationsRequestTest.php
+++ b/tests/Feature/Requests/Organization/GetOrganizationsRequestTest.php
@@ -9,7 +9,7 @@
it('can list organizations', function () {
Event::fake();
- $organizations = $this->connector->send(new GetOrganization())->dto();
+ $organizations = $this->connector->send(new GetOrganization)->dto();
$this->assertInstanceOf(Collection::class, $organizations);
diff --git a/tests/Feature/Requests/Search/GetSearchRequestTest.php b/tests/Feature/Requests/Search/GetSearchRequestTest.php
index b429abf..6d66889 100644
--- a/tests/Feature/Requests/Search/GetSearchRequestTest.php
+++ b/tests/Feature/Requests/Search/GetSearchRequestTest.php
@@ -15,7 +15,7 @@
$fileCabinetId = config('laravel-docuware.tests.file_cabinet_id');
$dialogId = config('laravel-docuware.tests.dialog_id');
- $paginatorRequest = (new DocuWare())
+ $paginatorRequest = (new DocuWare)
->searchRequestBuilder()
->fileCabinet($fileCabinetId)
->dialog($dialogId)
@@ -42,7 +42,7 @@
$this->expectException(UnableToSearch::class);
- $request = (new DocuWare())
+ $request = (new DocuWare)
->searchRequestBuilder()
->fileCabinet($fileCabinetId)
->dialog($dialogId)
@@ -65,7 +65,7 @@
$fileCabinetId = config('laravel-docuware.tests.file_cabinet_id');
$dialogId = config('laravel-docuware.tests.dialog_id');
- $paginatorRequest = (new DocuWare())
+ $paginatorRequest = (new DocuWare)
->searchRequestBuilder()
->fileCabinet($fileCabinetId)
->dialog($dialogId)
@@ -91,7 +91,7 @@
$fileCabinetId = config('laravel-docuware.tests.file_cabinet_id');
$dialogId = config('laravel-docuware.tests.dialog_id');
- $paginatorRequest = (new DocuWare())
+ $paginatorRequest = (new DocuWare)
->searchRequestBuilder()
->fileCabinet($fileCabinetId)
->dialog($dialogId)
@@ -118,7 +118,7 @@
$this->expectException(UnableToSearch::class);
- $request = (new DocuWare())
+ $request = (new DocuWare)
->searchRequestBuilder()
->fileCabinet($fileCabinetId)
->dialog($dialogId)
@@ -140,7 +140,7 @@
$fileCabinetId = config('laravel-docuware.tests.file_cabinet_id');
$dialogId = config('laravel-docuware.tests.dialog_id');
- $paginatorRequest = (new DocuWare())
+ $paginatorRequest = (new DocuWare)
->searchRequestBuilder()
->fileCabinet($fileCabinetId)
->dialog($dialogId)
@@ -164,7 +164,7 @@
$fileCabinetId = config('laravel-docuware.tests.file_cabinet_id');
$dialogId = config('laravel-docuware.tests.dialog_id');
- $paginatorRequest = (new DocuWare())
+ $paginatorRequest = (new DocuWare)
->searchRequestBuilder()
->fileCabinet($fileCabinetId)
->dialog($dialogId)
@@ -189,7 +189,7 @@
config('laravel-docuware.tests.file_cabinet_id'),
];
- $paginatorRequest = (new DocuWare())
+ $paginatorRequest = (new DocuWare)
->searchRequestBuilder()
->fileCabinets($fileCabinetIds)
->page(null)
@@ -243,7 +243,7 @@
))->dto();
// Should filter down to documentOne and documentTwo. documentThree should be filtered out.
- $paginatorRequestBothDocuments = (new DocuWare())
+ $paginatorRequestBothDocuments = (new DocuWare)
->searchRequestBuilder()
->fileCabinets([$fileCabinetId])
->page(null)
diff --git a/tests/Pest.php b/tests/Pest.php
index 3662772..126d33a 100644
--- a/tests/Pest.php
+++ b/tests/Pest.php
@@ -42,7 +42,7 @@ function clearFiles(): void
))->dto();
}
- $paginatorRequest = (new DocuWare())
+ $paginatorRequest = (new DocuWare)
->searchRequestBuilder()
->trashBin()
->perPage(1000)
@@ -59,7 +59,7 @@ function setUsersInactive(): void
{
$connector = getConnector();
- $response = $connector->send(new GetUsers());
+ $response = $connector->send(new GetUsers);
$users = $response->dto()->filter(function ($user) {
return Str::contains($user->email, 'test@example.test') && $user->active === true;