Skip to content

Commit

Permalink
Merge branch '306-beta-1' into 338-fix-return-type-for-crm-multifields
Browse files Browse the repository at this point in the history
# Conflicts:
#	CHANGELOG.md
#	src/Core/Batch.php
#	src/Services/CRM/Common/Result/AbstractCrmItem.php
  • Loading branch information
mesilov committed Jan 3, 2024
2 parents e3ffe75 + bfc35a9 commit c7d4d47
Show file tree
Hide file tree
Showing 41 changed files with 1,688 additions and 295 deletions.
5 changes: 2 additions & 3 deletions .github/workflows/phpstan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@ jobs:
fail-fast: false
matrix:
php-version:
- "8.1"
- "8.2"
- "8.3"
dependencies: [ highest ]

steps:
Expand All @@ -26,7 +25,7 @@ jobs:
with:
coverage: "none"
php-version: "${{ matrix.php-version }}"
extensions: mbstring
extensions: json, bcmath, curl, intl, mbstring
tools: composer:v2

- name: "Install lowest dependencies"
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/phpunit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,16 @@ jobs:
tests:
name: "PHPUnit tests"

runs-on: ubuntu-latest
runs-on: ${{ matrix.operating-system }}

strategy:
matrix:
php-version:
- "8.1"
- "8.2"
- "8.3"
dependencies: [ highest ]
operating-system: [ ubuntu-latest, windows-latest ]

steps:
- name: "Checkout"
Expand All @@ -29,6 +31,7 @@ jobs:
with:
coverage: "none"
php-version: "${{ matrix.php-version }}"
extensions: json, bcmath, curl, intl, mbstring

- name: "Install dependencies"
run: |
Expand Down
26 changes: 26 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@
* `Bitrix24\SDK\Services\User\Service\User::update` - update user
* `Bitrix24\SDK\Services\User\Service\User::search` - search users
* add method `\Bitrix24\SDK\Services\CRM\Contact\Service\Batch::update()` for batch update contacts
* add [crm item support](https://github.com/mesilov/bitrix24-php-sdk/issues/330)
* add enum `DealStageSemanticId`
* add Duplicate search support for `Bitrix24\SDK\Services\CRM\Duplicates\Service\Duplicate`
* add `x-request-id` [header support](https://github.com/mesilov/bitrix24-php-sdk/issues/354)

### Changed

Expand All @@ -35,6 +39,26 @@
to `Bitrix24\SDK\Services\Telephony\Requests\Events\OnExternalCallStart\OnExternalCallStart`
* from `Bitrix24\SDK\Services\Telephony\Requests\Events\OnVoximplantCallEnd`
to `Bitrix24\SDK\Services\Telephony\Requests\Events\OnVoximplantCallEnd\OnVoximplantCallEnd`
* ❗Changes in `Bitrix24\SDK\Application\Contracts\Bitrix24Account\Bitrix24AccountInterface`:
* method `getContactPerson` renamed to `getContactPersonId`
* added method `getApplicationVersion`
* added method `updateApplicationVersion`
* added method `getApplicationScope`
* added method `applicationInstalled`
* added method `applicationUninstalled`
* added method `markAsDeactivated`
* added method `getBitrix24UserId`
* removed method `markAccountAsDeleted`
* changed method `markAsActive`
* ❗Changes in `Bitrix24\SDK\Application\Contracts\Bitrix24Account\Bitrix24AccountRepositoryInterface`:
* method `saveAccount` renamed to `save`
* method `deleteAccount` renamed to `delete`
* method `findAccountByMemberId` renamed to `findByMemberId`
* method `getAccountByMemberId` renamed to `getByMemberId`
* method `findAccountByContactPersonId` renamed to `findByContactPersonId`
* method `findAccountByDomainUrl` renamed to `findByDomainUrl`
* add method `findAllActive`
* add method `findAllDeactivated`

### Bugfix

Expand All @@ -44,6 +68,8 @@
* fix [add helper metods isError for registerCallResult fortelephony](https://github.com/mesilov/bitrix24-php-sdk/issues/335)
* fix [add return type for crm multifields phone, email, im](https://github.com/mesilov/bitrix24-php-sdk/issues/338)
* fix errors in `ShowFieldsDescriptionCommand` metadata reader CLI command
* fix errors for `ApplicationProfile` with empty scope
* fix errors in `Core` with auth attempt to non-exists portal

### etc

Expand Down
2 changes: 2 additions & 0 deletions bin/console
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/usr/bin/env php
<?php

use Bitrix24\SDK\Tools\Commands\CopyPropertyValues;
use Bitrix24\SDK\Tools\Commands\GenerateContactsCommand;
use Bitrix24\SDK\Tools\Commands\PerformanceBenchmarks\ListCommand;
use Bitrix24\SDK\Tools\Commands\ShowFieldsDescriptionCommand;
Expand Down Expand Up @@ -53,4 +54,5 @@ $application = new Application();
$application->add(new GenerateContactsCommand($log));
$application->add(new ListCommand($log));
$application->add(new ShowFieldsDescriptionCommand($log));
$application->add(new CopyPropertyValues($log));
$application->run($input);
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
}
],
"require": {
"php": "8.1.* || 8.2.*",
"php": "8.1.* || 8.2.* || 8.3.*",
"ext-json": "*",
"ext-bcmath": "*",
"ext-curl": "*",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,69 +4,111 @@

namespace Bitrix24\SDK\Application\Contracts\Bitrix24Account;

use Bitrix24\SDK\Core\Credentials\Scope;
use Symfony\Component\Uid\Uuid;
use Bitrix24\SDK\Core\Response\DTO\RenewedAccessToken;

interface Bitrix24AccountInterface
{
/**
* @return \Symfony\Component\Uid\Uuid
* @return Uuid
*/
public function getId(): Uuid;

/**
* @return \Symfony\Component\Uid\Uuid
* @return Uuid
*/
public function getContactPerson(): Uuid;
public function getContactPersonId(): Uuid;

/**
* @return string
*/
public function getMemberId(): string;

/**
* @return string
*/
public function getDomainUrl(): string;

/**
* @return Bitrix24AccountStatus
*/
public function getStatus(): Bitrix24AccountStatus;

/**
* @return string
*/
public function getAccessToken(): string;

/**
* @return string
*/
public function getRefreshToken(): string;

/**
* @return int
*/
public function getExpires(): int;

/**
* @param \Bitrix24\SDK\Core\Response\DTO\RenewedAccessToken $renewedAccessToken
* Get application version
*
* @return void
* @return int
*/
public function renewAccessToken(RenewedAccessToken $renewedAccessToken): void;
public function getApplicationVersion(): int;

/**
* @param string $newDomainUrl
* Update application version if application was updated in marketplace
*
* @param int $version
* @param Scope|null $newScope
* @return void
*/
public function changeDomainUrl(string $newDomainUrl): void;
public function updateApplicationVersion(int $version, ?Scope $newScope): void;

/**
* Switch account to Active status - installation is finalized
* Get application scope (permissions)
*
* @param string $applicationToken
* @return Scope
*/
public function getApplicationScope(): Scope;

/**
* @param RenewedAccessToken $renewedAccessToken
*
* @return void
*/
public function markAccountAsActive(string $applicationToken): void;
public function renewAccessToken(RenewedAccessToken $renewedAccessToken): void;

/**
* Change account status to Deleted
*
* @param string $applicationToken
* @param string $newDomainUrl
*
* @return void
*/
public function markAccountAsDeleted(string $applicationToken): void;
public function changeDomainUrl(string $newDomainUrl): void;

/**
* Application installed on portal and finish installation flow
*/
public function applicationInstalled(string $applicationToken): void;

/**
* Application uninstalled from portal
*/
public function applicationUninstalled(string $applicationToken): void;

/**
* Switch account to Active status
*/
public function markAsActive(): void;

/**
* Change account status to Deactivated
*/
public function markAsDeactivated(): void;

/**
* Get Bitrix24 user id who installed application and own this account
*/
public function getBitrix24UserId(): int;
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,64 +10,46 @@ interface Bitrix24AccountRepositoryInterface
{
/**
* Save account
*
* @param Bitrix24AccountInterface $entity
* @param bool $flush
*
* @return void
*/
public function saveAccount(Bitrix24AccountInterface $entity, bool $flush = false): void;
public function save(Bitrix24AccountInterface $entity, bool $flush = false): void;

/**
* Get by account id
*
* @param \Symfony\Component\Uid\Uuid $id
*
* @return Bitrix24AccountInterface
*/
public function getById(Uuid $id): Bitrix24AccountInterface;

/**
* Delete account
*
* @param Bitrix24AccountInterface $entity
* @param bool $flush
*
* @return void
*/
public function deleteAccount(Bitrix24AccountInterface $entity, bool $flush = false): void;
public function delete(Bitrix24AccountInterface $entity, bool $flush = false): void;

/**
* Find account by member_id
*
* @return ?Bitrix24AccountInterface Returns an array of Bitrix24Account objects
*/
public function findAccountByMemberId(string $memberId): ?Bitrix24AccountInterface;
public function findByMemberId(string $memberId): ?Bitrix24AccountInterface;

/**
* Get account by member_id
*
* @param string $memberId
*
* @return Bitrix24AccountInterface
*/
public function getAccountByMemberId(string $memberId): Bitrix24AccountInterface;
public function getByMemberId(string $memberId): Bitrix24AccountInterface;

/**
* Find account by contact person id - person, who installed application
*
* @param \Symfony\Component\Uid\Uuid $contactPersonId
*
* @return Bitrix24AccountInterface|null
*/
public function findAccountByContactPersonId(Uuid $contactPersonId): ?Bitrix24AccountInterface;
public function findByContactPersonId(Uuid $contactPersonId): ?Bitrix24AccountInterface;

/**
* Find account by domain url
*
* @param string $domainUrl
*
* @return Bitrix24AccountInterface|null
*/
public function findAccountByDomainUrl(string $domainUrl): ?Bitrix24AccountInterface;
public function findByDomainUrl(string $domainUrl): ?Bitrix24AccountInterface;

/**
* @return array<Bitrix24AccountInterface>
*/
public function findAllActive(): array;

/**
* @return array<Bitrix24AccountInterface>
*/
public function findAllDeactivated(): array;
}
Loading

0 comments on commit c7d4d47

Please sign in to comment.