-
-
Notifications
You must be signed in to change notification settings - Fork 162
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add enums and data filtering in CRM services
This commit introduces new enums for CRM Activity types and directions. Also, it adds a data filter class to handle field exclusion by prefix, and updates integration tests to use these new enums. These changes improve the code maintainability and readability in the CRM module. Signed-off-by: mesilov <[email protected]>
- Loading branch information
Showing
18 changed files
with
331 additions
and
164 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Bitrix24\SDK\Core\Fields; | ||
|
||
class FieldsFilter | ||
{ | ||
public function filterSystemFields(array $fieldCodes): array | ||
{ | ||
$res = []; | ||
foreach ($fieldCodes as $fieldCode) { | ||
if (strncmp($fieldCode, 'UF_CRM_', 7) !== 0) { | ||
$res[] = $fieldCode; | ||
} | ||
} | ||
|
||
return $res; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Bitrix24\SDK\Services\CRM\Activity; | ||
|
||
/** | ||
* @see https://training.bitrix24.com/rest_help/crm/auxiliary/enum/crm_enum_contenttype.php | ||
*/ | ||
enum ActivityContentType: int | ||
{ | ||
case default = 0; | ||
case plainText = 1; | ||
case bbCode = 2; | ||
case html = 3; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Bitrix24\SDK\Services\CRM\Activity; | ||
|
||
/** | ||
* @see https://training.bitrix24.com/rest_help/crm/auxiliary/enum/crm_enum-activitydirection.php | ||
*/ | ||
enum ActivityDirectionType: int | ||
{ | ||
case default = 0; | ||
case incoming = 1; | ||
case outgoing = 2; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Bitrix24\SDK\Services\CRM\Activity; | ||
|
||
/** | ||
* @see https://training.bitrix24.com/rest_help/crm/auxiliary/enum/crm_enumactivitynotifytype.php | ||
*/ | ||
enum ActivityNotifyType: int | ||
{ | ||
case default = 0; | ||
case minutes = 1; | ||
case hours = 2; | ||
case days = 3; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Bitrix24\SDK\Services\CRM\Activity; | ||
|
||
/** | ||
* @see https://training.bitrix24.com/rest_help/crm/auxiliary/enum/crm_enum_activitypriority.php | ||
*/ | ||
enum ActivityPriority: int | ||
{ | ||
case default = 0; | ||
case low = 1; | ||
case medium = 2; | ||
case high = 3; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Bitrix24\SDK\Services\CRM\Activity; | ||
|
||
/** | ||
* @see https://training.bitrix24.com/rest_help/crm/auxiliary/enum/crm_enum_activitystatus.php | ||
*/ | ||
enum ActivityStatus: int | ||
{ | ||
case default = 0; | ||
case waiting = 1; | ||
case finished = 2; | ||
case finishedAutomatically = 3; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Bitrix24\SDK\Services\CRM\Activity; | ||
|
||
/** | ||
* @see https://training.bitrix24.com/rest_help/crm/auxiliary/enum/crm_enum_activitytype.php | ||
*/ | ||
enum ActivityType: int | ||
{ | ||
case default = 0; | ||
case meeting = 1; | ||
case call = 2; | ||
case task = 3; | ||
case letter = 4; | ||
case action = 5; | ||
case userAction = 6; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.