Skip to content

Commit 4536e8d

Browse files
authored
Merge branch 'dev' into feature/158-deal-details-configuration
2 parents 8954185 + bd9110d commit 4536e8d

File tree

79 files changed

+5864
-677
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

79 files changed

+5864
-677
lines changed

.php-cs-fixer.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@
66

77
$finder = Finder::create()
88
->in(__DIR__ . '/src/Infrastructure/Console/Commands/')
9+
->in(__DIR__ . '/src/Services/CRM/Lead/Service')
10+
->in(__DIR__ . '/src/Services/CRM/Contact/')
11+
->in(__DIR__ . '/src/Services/CRM/Quote/')
12+
->in(__DIR__ . '/src/Services/CRM/Lead/')
913
->in(__DIR__ . '/src/Services/CRM/Currency/')
1014
->name('*.php')
1115
->exclude(['vendor', 'storage', 'docker', 'docs']) // Exclude directories

CHANGELOG.md

Lines changed: 79 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,59 @@
1313
- `setPersonal` method set card configuration
1414
- `setGeneral` method set card configuration for all users
1515
- `setForceCommonConfigForAll` method set common detail form for All Users
16+
- Added service `CRM\Lead\Service\LeadDetailsConfiguration` with support methods,
17+
see [add crm.lead.details.* methods](https://github.com/bitrix24/b24phpsdk/issues/172):
18+
- `getPersonal` method retrieves the settings of lead cards for personal user
19+
- `getGeneral` method retrieves the settings of lead cards for all users
20+
- `resetPersonal` method reset for item user settings
21+
- `resetGeneral` method reset all card settings for all users
22+
- `setPersonal` method set card configuration
23+
- `setGeneral` method set card configuration for all users
24+
- `setForceCommonConfigForAll` method set common detail form for All Users
25+
- Added service `Services\CRM\Lead\Service\LeadProductRows` with support methods,
26+
see [add crm.lead.productrows* methods](https://github.com/bitrix24/b24phpsdk/issues/175):
27+
- `set` Adds products to a lead
28+
- `get` Returns the products of a lead
29+
- Added service `Services\CRM\Quote\Service\Quote` with support methods,
30+
see [crm.quote.* methods](https://github.com/bitrix24/b24phpsdk/issues/179):
31+
- `fields` returns a list of fields for the quote
32+
- `get` returns the settings of the quote by Id
33+
- `list` returns a list of quote
34+
- `add` creates a new quote
35+
- `delete` deletes a quote
36+
- `update` modifies the quote
37+
- `countByFilter` count quotes by filter
38+
- Added support for events:
39+
- `OnCrmQuoteAdd`
40+
- `OnCrmQuoteDelete`
41+
- `OnCrmQuoteUpdate`
42+
- `OnCrmQuoteUserFieldAdd`
43+
- `OnCrmQuoteUserFieldDelete`
44+
- `OnCrmQuoteUserFieldSetEnumValues`
45+
- `OnCrmQuoteUserFieldUpdate`
46+
- Added service `Services\CRM\Quote\Service\QuoteUserfield` with support methods:
47+
- `add` add userfield to a quote
48+
- `get` get userfield to a quote
49+
- `list` list userfields
50+
- `delete` delete userfield
51+
- `update` update userfield
52+
- Added service `Services\CRM\Quote\Service\QuoteProductRows` with support methods:
53+
- `set` Adds products to a quote
54+
- `get` Returns the products of a quote
55+
- Added service `Services\CRM\Quote\Service\QuoteContact` with support methods,
56+
- `fields` get fiels for quote contact connection
57+
- `setItems` set contacts related with quote
58+
- `get` get contacts related to quote
59+
- `deleteItems` delete all relations for quote
60+
- `add` add contact relation with quote
61+
- `delete` delete contact relation with quote
62+
- Added service `CRM\Lead\Service\LeadUserfield` with support methods,
63+
see [add crm.lead.userfield.* methods](https://github.com/bitrix24/b24phpsdk/issues/177):
64+
- `add` add userfield to lead
65+
- `get` get userfield to lead
66+
- `list` list userfields
67+
- `delete` delete userfield
68+
- `update` update userfield
1669
- Added service `Services\CRM\Deal\Service\DealRecurring` with support methods,
1770
see [crm.deal.recurring.* methods](https://github.com/bitrix24/b24phpsdk/issues/160):
1871
- `fields` returns a list of fields for the recurring deal template
@@ -42,13 +95,16 @@
4295
- `get` get localizations
4396
- `fields` get localization fields
4497
- `delete` delete currency, with batch calls support
98+
- Developer experience: added make command `lint-all` for run all code linters step by step, [see details](https://github.com/bitrix24/b24phpsdk/issues/183)
4599

46100
### Fixed
47101

48102
- Fixed error in arguments in service for method `placement.bind`, [see details](https://github.com/bitrix24/b24phpsdk/issues/151)
49-
- Fixed errors in `task.elapseditem.*` call in ApiClient [see details](https://github.com/bitrix24/b24phpsdk/issues/180)
103+
- Fixed errors in `task.elapseditem.*` call in ApiClient [see details](https://github.com/bitrix24/b24phpsdk/issues/180)
104+
50105
### Changed
51106

107+
- Changed B24-PHP-SDK useragent: added prefix `vendor`, [see details](https://github.com/bitrix24/b24phpsdk/issues/183)
52108
-**️️BC** Changed contract `Bitrix24\SDK\Application\Contracts\Bitrix24Accounts\Entity\Bitrix24AccountInterface`, this change needs to process corner cases
53109
when [installed application with UI or without UI](https://github.com/bitrix24/b24phpsdk/issues/150):
54110
- changed method `public function applicationInstalled(?string $applicationToken): void` application token now is nullable
@@ -62,6 +118,18 @@
62118
- added method `isApplicationTokenValid`
63119
- changed method `public function applicationInstalled(?string $applicationToken): void` application token now is nullable
64120
- changed method `public function applicationUninstalled(?string $applicationToken): void` application token now is nullable
121+
- added method `linkContactPerson(Uuid $uuid)`, see [change signatures](https://github.com/bitrix24/b24phpsdk/issues/166).
122+
- added method `linkBitrix24Partner()`, see [change signatures](https://github.com/bitrix24/b24phpsdk/issues/166).
123+
- added method `unlinkBitrix24Partner()`, see [change signatures](https://github.com/bitrix24/b24phpsdk/issues/166).
124+
- added method `unlinkContactPerson()`, see [change signatures](https://github.com/bitrix24/b24phpsdk/issues/166).
125+
- added method `linkBitrix24PartnerContactPerson()`, see [change signatures](https://github.com/bitrix24/b24phpsdk/issues/166).
126+
- added method `unlinkBitrix24PartnerContactPerson()`, see [change signatures](https://github.com/bitrix24/b24phpsdk/issues/166).
127+
- remove method `changeContactPerson(?Uuid $uuid)`, see [change signatures](https://github.com/bitrix24/b24phpsdk/issues/166).
128+
- remove method `changeBitrix24Partner(?Uuid $uuid)`, see [change signatures](https://github.com/bitrix24/b24phpsdk/issues/166).
129+
- remove method `changeBitrix24PartnerContactPerson(?Uuid $uuid)`, see [change signatures](https://github.com/bitrix24/b24phpsdk/issues/166).
130+
-**️️BC** Changed contract `Bitrix24\SDK\Application\Contracts\ApplicationInstallations\Repository\ApplicationInstallationRepositoryInterface`,
131+
see [change signatures](https://github.com/bitrix24/b24phpsdk/issues/167):
132+
- change return type `findByBitrix24AccountId` from an array to `?ApplicationInstallationInterface`
65133

66134
### Statistics
67135

@@ -71,6 +139,15 @@ work in progress
71139

72140
### Added
73141

142+
- Added service `CRM\Contact\Service\ContactDetailsConfiguration` with support methods,
143+
see [add crm.contact.details.* methods](https://github.com/bitrix24/b24phpsdk/issues/153):
144+
- `getPersonal` method retrieves the settings of contact cards for personal user
145+
- `getGeneral` method retrieves the settings of contact cards for all users
146+
- `resetPersonal` method reset for item user settings
147+
- `resetGeneral` method reset all card settings for all users
148+
- `setPersonal` method set card configuration
149+
- `setGeneral` method set card configuration for all users
150+
- `setForceCommonConfigForAll` method set common detail form for All Users
74151
- Added **PHP 8.4** [support](https://github.com/bitrix24/b24phpsdk/issues/120) 🚀
75152
- Added method `Bitrix24\SDK\Services\Main\Service::guardValidateCurrentAuthToken` for validate current auth token with
76153
api-call `app.info` on vendor OAUTH server.
@@ -450,4 +527,4 @@ Supported in bitrix24-php-sdk methods with batch wrapper count: 22
450527

451528
## 1.0
452529

453-
* Initial release
530+
* Initial release

Makefile

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ help:
4141
@echo "ngrok-up - start ngrok"
4242
@echo "ngrok-down - stop ngrok"
4343
@echo ""
44+
@echo "lint-all - lint codebase with all linters step by step"
4445
@echo "lint-allowed-licenses - lint dependencies for valid licenses"
4546
@echo "lint-cs-fixer - lint source code with php-cs-fixer"
4647
@echo "lint-cs-fixer-fix - fix source code with php-cs-fixer"
@@ -133,6 +134,9 @@ lint-rector:
133134
lint-rector-fix:
134135
docker-compose run --rm php-cli vendor/bin/rector process
135136

137+
.PHONY: lint-all
138+
lint-all: lint-allowed-licenses lint-cs-fixer lint-phpstan lint-rector
139+
136140
# unit tests
137141
.PHONY: test-unit
138142
test-unit:
@@ -182,6 +186,18 @@ test-integration-scope-ai-admin:
182186
.PHONY: integration_tests_scope_crm_deal_details
183187
integration_tests_scope_crm_deal_details:
184188
docker-compose run --rm php-cli vendor/bin/phpunit --testsuite integration_tests_scope_crm_deal_details
189+
190+
.PHONY: integration_tests_scope_crm_contact_details
191+
integration_tests_scope_crm_contact_details:
192+
docker-compose run --rm php-cli vendor/bin/phpunit --testsuite integration_tests_scope_crm_contact_details
193+
194+
.PHONY: integration_tests_lead_userfield
195+
integration_tests_lead_userfield:
196+
docker-compose run --rm php-cli vendor/bin/phpunit --testsuite integration_tests_lead_userfield
197+
198+
.PHONY: integration_tests_lead_userfield_use_case
199+
integration_tests_lead_userfield_use_case:
200+
docker-compose run --rm php-cli vendor/bin/phpunit --testsuite integration_tests_lead_userfield_use_case
185201

186202
.PHONY: integration_tests_scope_crm_currency
187203
integration_tests_scope_crm_currency:
@@ -191,9 +207,21 @@ integration_tests_scope_crm_currency:
191207
integration_tests_deal_recurring:
192208
docker-compose run --rm php-cli vendor/bin/phpunit --testsuite integration_tests_deal_recurring
193209

210+
.PHONY: integration_tests_lead_details
211+
integration_tests_lead_details:
212+
docker-compose run --rm php-cli vendor/bin/phpunit --testsuite integration_tests_lead_details
213+
194214
.PHONY: integration_tests_scope_automation
195215
integration_tests_scope_automation:
196216
docker-compose run --rm php-cli vendor/bin/phpunit --testsuite integration_tests_scope_automation
217+
218+
.PHONY: integration_tests_lead_productrows
219+
integration_tests_lead_productrows:
220+
docker-compose run --rm php-cli vendor/bin/phpunit --testsuite integration_tests_lead_productrows
221+
222+
.PHONY: integration_tests_crm_quote
223+
integration_tests_crm_quote:
224+
docker-compose run --rm php-cli vendor/bin/phpunit --testsuite integration_tests_crm_quote
197225

198226
# work dev environment
199227
.PHONY: php-dev-server-up

phpstan.neon.dist

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,15 @@ parameters:
1212
- tests/Integration/Services/Main
1313
- tests/Integration/Services/Placement
1414
- tests/Integration/Services/CRM/Deal/Service/DealDetailsConfigurationTest.php
15+
- tests/Integration/Services/CRM/Lead/Service/LeadDetailsConfigurationTest.php
16+
- tests/Integration/Services/CRM/Contact/Service/ContactDetailsConfigurationTest.php
17+
- tests/Integration/Services/CRM/Lead/Service/LeadProductRowsTest.php
18+
- tests/Integration/Services/CRM/Quote/Service/QuoteTest.php
19+
- tests/Integration/Services/CRM/Quote/Service/BatchTest.php
20+
- tests/Integration/Services/CRM/Quote/Service/QuoteContactTest.php
21+
- tests/Integration/Services/CRM/Quote/Service/QuoteUserfieldTest.php
22+
- tests/Integration/Services/CRM/Quote/Service/QuoteProductRowsTest.php
23+
- tests/Integration/Services/CRM/Lead/Service/LeadUserfieldTest.php
1524
- tests/Integration/Services/CRM/Currency
1625
bootstrapFiles:
1726
- tests/bootstrap.php

phpunit.xml.dist

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,14 +46,29 @@
4646
<testsuite name="integration_tests_scope_crm_deal_details">
4747
<file>./tests/Integration/Services/CRM/Deal/Service/DealDetailsConfigurationTest.php</file>
4848
</testsuite>
49+
<testsuite name="integration_tests_scope_crm_contact_details">
50+
<file>./tests/Integration/Services/CRM/Contact/Service/ContactDetailsConfigurationTest.php</file>
51+
</testsuite>
52+
<testsuite name="integration_tests_lead_productrows">
53+
<file>./tests/Integration/Services/CRM/Lead/Service/LeadProductRowsTest.php</file>
54+
</testsuite>
55+
<testsuite name="integration_tests_lead_userfield">
56+
<file>./tests/Integration/Services/CRM/Lead/Service/LeadUserfieldTest.php</file>
57+
</testsuite>
58+
<testsuite name="integration_tests_lead_userfield_use_case">
59+
<file>./tests/Integration/Services/CRM/Lead/Service/LeadUserfieldUseCaseTest.php</file>
60+
</testsuite>
4961
<testsuite name="integration_tests_scope_crm_currency">
5062
<directory>./tests/Integration/Services/CRM/Currency/</directory>
5163
</testsuite>
5264
<testsuite name="integration_tests_deal_recurring">
5365
<file>./tests/Integration/Services/CRM/Deal/Service/DealRecurringTest.php</file>
5466
</testsuite>
55-
<testsuite name="integration_tests_scope_automation">
56-
<directory>./tests/Integration/Services/CRM/Automation/</directory>
67+
<testsuite name="integration_tests_lead_details">
68+
<file>./tests/Integration/Services/CRM/Lead/Service/LeadDetailsConfigurationTest.php</file>
69+
</testsuite>
70+
<testsuite name="integration_tests_crm_quote">
71+
<directory>./tests/Integration/Services/CRM/Quote/</directory>
5772
</testsuite>
5873
</testsuites>
5974
<source>

rector.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,12 @@
3838
__DIR__ . '/tests/Integration/Services/Placement',
3939
__DIR__ . '/src/Services/CRM/Deal/Service/DealDetailsConfiguration.php',
4040
__DIR__ . '/tests/Integration/Services/CRM/Deal/Service/DealDetailsConfigurationTest.php',
41+
__DIR__ . '/src/Services/CRM/Contact/Service/ContactDetailsConfiguration.php',
42+
__DIR__ . '/tests/Integration/Services/CRM/Contact/Service/ContactDetailsConfigurationTest.php',
43+
__DIR__ . '/src/Services/CRM/Lead',
44+
__DIR__ . '/tests/Integration/Services/CRM/Lead/Service',
45+
__DIR__ . '/src/Services/CRM/Quote',
46+
__DIR__ . '/tests/Integration/Services/CRM/Quote/Service',
4147
__DIR__ . '/src/Services/CRM/Currency',
4248
__DIR__ . '/tests/Integration/Services/CRM/Currency',
4349
__DIR__ . '/tests/Unit/',

src/Application/Contracts/ApplicationInstallations/Docs/ApplicationInstallations.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,14 @@ Optional can store links to:
1414
| `getUpdatedAt()` | `CarbonImmutable` | Returns date and time of last application installation change | |
1515
| `getBitrix24AccountId()` | `Uuid` | Returns Bitrix24 Account id related to this installation | |
1616
| `getContactPersonId()` | `?Uuid` | Returns contact person id who installed the application on portal (optional) | |
17-
| `changeContactPerson()` | `void` | Changes client contact person | |
17+
| `linkContactPerson()` | `void` | Link client contact person | |
18+
| `unlinkContactPerson()` | `void` | Unlink client contact person | |
1819
| `getBitrix24PartnerContactPersonId()` | `?Uuid` | Returns Bitrix24 partner contact person id (optional) | |
19-
| `changeBitrix24PartnerContactPerson()` | `void` | Changes Bitrix24 partner contact person | |
20+
| `linkBitrix24PartnerContactPerson()` | `void` | Link Bitrix24 partner contact person | |
21+
| `unlinkBitrix24PartnerContactPerson()` | `void` | Unlink Bitrix24 partner contact person | |
2022
| `getBitrix24PartnerId()` | `?Uuid` | Returns Bitrix24 Partner id related to this installation (optional) | |
21-
| `changeBitrix24Partner()` | `void` | Changes Bitrix24 partner | |
23+
| `linkBitrix24Partner()` | `void` | Link Bitrix24 partner | |
24+
| `unlinkBitrix24Partner()` | `void` | Unlink Bitrix24 partner | |
2225
| `getExternalId()` | `?string` | Returns external id for application installation | |
2326
| `setExternalId()` | `void` | Sets external id for application installation | `InvalidArgumentException` |
2427
| `getStatus()` | `ApplicationInstallationStatus` | Returns application installation status | |

src/Application/Contracts/ApplicationInstallations/Entity/ApplicationInstallationInterface.php

Lines changed: 30 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,18 @@ public function getBitrix24AccountId(): Uuid;
5757
public function getContactPersonId(): ?Uuid;
5858

5959
/**
60-
* Change contact person
60+
* Link contact person
6161
*
62-
* Change client contact person if client say he has new responsible for the application
62+
* Link client contact person if a client says they have new responsible for the application
6363
*/
64-
public function changeContactPerson(?Uuid $uuid): void;
64+
public function linkContactPerson(Uuid $uuid): void;
65+
66+
/**
67+
* Unlink contact person
68+
*
69+
* Unlink a client contact person if the client says the contact person has changed
70+
*/
71+
public function unlinkContactPerson(): void;
6572

6673
/**
6774
* Get Bitrix24 Partner contact person id, optional
@@ -71,23 +78,37 @@ public function changeContactPerson(?Uuid $uuid): void;
7178
public function getBitrix24PartnerContactPersonId(): ?Uuid;
7279

7380
/**
74-
* Change bitrix24 partner contact person
81+
* Link Bitrix24 partner contact person
82+
*
83+
* Link Bitrix24 partner contact person if partner say he has new responsible for the application
84+
*/
85+
public function linkBitrix24PartnerContactPerson(Uuid $uuid): void;
86+
87+
/**
88+
* Unlink Bitrix24 partner contact person
7589
*
76-
* Change bitrix24 partner contact person if partner say he has new responsible for the application
90+
* Unlink Bitrix24 partner contacts the person if the partner says they remove this employee
7791
*/
78-
public function changeBitrix24PartnerContactPerson(?Uuid $uuid): void;
92+
public function unlinkBitrix24PartnerContactPerson(): void;
7993

8094
/**
8195
* @return Uuid|null get Bitrix24 Partner id related with this installation, optional
8296
*/
8397
public function getBitrix24PartnerId(): ?Uuid;
8498

8599
/**
86-
* Change bitrix24 partner
100+
* Link Bitrix24 partner
101+
*
102+
* Link Bitrix24 partner who supports this portal
103+
*/
104+
public function linkBitrix24Partner(Uuid $uuid): void;
105+
106+
/**
107+
* Unlink Bitrix24 partner
87108
*
88-
* Change bitrix24 partner if other partner starts support client portal
109+
* Unlink Bitrix24 partner who stops supporting this portal
89110
*/
90-
public function changeBitrix24Partner(?Uuid $uuid): void;
111+
public function unlinkBitrix24Partner(): void;
91112

92113
/**
93114
* Get external id for application installation

0 commit comments

Comments
 (0)