Skip to content

Commit a1f7e73

Browse files
authored
Merge branch 'dev' into feature/168-add-item-details
2 parents 2a82e56 + 277304c commit a1f7e73

File tree

81 files changed

+6246
-676
lines changed

Some content is hidden

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

81 files changed

+6246
-676
lines changed

.php-cs-fixer.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,10 @@
66

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

CHANGELOG.md

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

46109
### Fixed
47110

48111
- 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)
112+
- Fixed errors in `task.elapseditem.*` call in ApiClient [see details](https://github.com/bitrix24/b24phpsdk/issues/180)
113+
50114
### Changed
51115

116+
- Changed B24-PHP-SDK useragent: added prefix `vendor`, [see details](https://github.com/bitrix24/b24phpsdk/issues/183)
52117
-**️️BC** Changed contract `Bitrix24\SDK\Application\Contracts\Bitrix24Accounts\Entity\Bitrix24AccountInterface`, this change needs to process corner cases
53118
when [installed application with UI or without UI](https://github.com/bitrix24/b24phpsdk/issues/150):
54119
- changed method `public function applicationInstalled(?string $applicationToken): void` application token now is nullable
@@ -62,6 +127,18 @@
62127
- added method `isApplicationTokenValid`
63128
- changed method `public function applicationInstalled(?string $applicationToken): void` application token now is nullable
64129
- changed method `public function applicationUninstalled(?string $applicationToken): void` application token now is nullable
130+
- added method `linkContactPerson(Uuid $uuid)`, see [change signatures](https://github.com/bitrix24/b24phpsdk/issues/166).
131+
- added method `linkBitrix24Partner()`, see [change signatures](https://github.com/bitrix24/b24phpsdk/issues/166).
132+
- added method `unlinkBitrix24Partner()`, see [change signatures](https://github.com/bitrix24/b24phpsdk/issues/166).
133+
- added method `unlinkContactPerson()`, see [change signatures](https://github.com/bitrix24/b24phpsdk/issues/166).
134+
- added method `linkBitrix24PartnerContactPerson()`, see [change signatures](https://github.com/bitrix24/b24phpsdk/issues/166).
135+
- added method `unlinkBitrix24PartnerContactPerson()`, see [change signatures](https://github.com/bitrix24/b24phpsdk/issues/166).
136+
- remove method `changeContactPerson(?Uuid $uuid)`, see [change signatures](https://github.com/bitrix24/b24phpsdk/issues/166).
137+
- remove method `changeBitrix24Partner(?Uuid $uuid)`, see [change signatures](https://github.com/bitrix24/b24phpsdk/issues/166).
138+
- remove method `changeBitrix24PartnerContactPerson(?Uuid $uuid)`, see [change signatures](https://github.com/bitrix24/b24phpsdk/issues/166).
139+
-**️️BC** Changed contract `Bitrix24\SDK\Application\Contracts\ApplicationInstallations\Repository\ApplicationInstallationRepositoryInterface`,
140+
see [change signatures](https://github.com/bitrix24/b24phpsdk/issues/167):
141+
- change return type `findByBitrix24AccountId` from an array to `?ApplicationInstallationInterface`
65142

66143
### Statistics
67144

@@ -71,6 +148,15 @@ work in progress
71148

72149
### Added
73150

151+
- Added service `CRM\Contact\Service\ContactDetailsConfiguration` with support methods,
152+
see [add crm.contact.details.* methods](https://github.com/bitrix24/b24phpsdk/issues/153):
153+
- `getPersonal` method retrieves the settings of contact cards for personal user
154+
- `getGeneral` method retrieves the settings of contact cards for all users
155+
- `resetPersonal` method reset for item user settings
156+
- `resetGeneral` method reset all card settings for all users
157+
- `setPersonal` method set card configuration
158+
- `setGeneral` method set card configuration for all users
159+
- `setForceCommonConfigForAll` method set common detail form for All Users
74160
- Added **PHP 8.4** [support](https://github.com/bitrix24/b24phpsdk/issues/120) 🚀
75161
- Added method `Bitrix24\SDK\Services\Main\Service::guardValidateCurrentAuthToken` for validate current auth token with
76162
api-call `app.info` on vendor OAUTH server.
@@ -450,4 +536,4 @@ Supported in bitrix24-php-sdk methods with batch wrapper count: 22
450536

451537
## 1.0
452538

453-
* Initial release
539+
* Initial release

Makefile

Lines changed: 32 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:
@@ -179,6 +183,22 @@ test-integration-scope-entity:
179183
test-integration-scope-ai-admin:
180184
docker-compose run --rm php-cli vendor/bin/phpunit --testsuite integration_tests_scope_ai_admin
181185

186+
.PHONY: integration_tests_scope_crm_deal_details
187+
integration_tests_scope_crm_deal_details:
188+
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
201+
182202
.PHONY: integration_tests_scope_crm_currency
183203
integration_tests_scope_crm_currency:
184204
docker-compose run --rm php-cli vendor/bin/phpunit --testsuite integration_tests_scope_crm_currency
@@ -187,6 +207,10 @@ integration_tests_scope_crm_currency:
187207
integration_tests_deal_recurring:
188208
docker-compose run --rm php-cli vendor/bin/phpunit --testsuite integration_tests_deal_recurring
189209

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+
190214
.PHONY: integration_tests_scope_automation
191215
integration_tests_scope_automation:
192216
docker-compose run --rm php-cli vendor/bin/phpunit --testsuite integration_tests_scope_automation
@@ -195,6 +219,14 @@ integration_tests_scope_automation:
195219
integration_tests_item_details:
196220
docker-compose run --rm php-cli vendor/bin/phpunit --testsuite integration_tests_item_details
197221

222+
.PHONY: integration_tests_lead_productrows
223+
integration_tests_lead_productrows:
224+
docker-compose run --rm php-cli vendor/bin/phpunit --testsuite integration_tests_lead_productrows
225+
226+
.PHONY: integration_tests_crm_quote
227+
integration_tests_crm_quote:
228+
docker-compose run --rm php-cli vendor/bin/phpunit --testsuite integration_tests_crm_quote
229+
198230
# work dev environment
199231
.PHONY: php-dev-server-up
200232
php-dev-server-up:

phpstan.neon.dist

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

phpunit.xml.dist

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,21 @@
4343
<testsuite name="integration_tests_scope_ai_admin">
4444
<directory>./tests/Integration/Services/AI/</directory>
4545
</testsuite>
46+
<testsuite name="integration_tests_scope_crm_deal_details">
47+
<file>./tests/Integration/Services/CRM/Deal/Service/DealDetailsConfigurationTest.php</file>
48+
</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>
4661
<testsuite name="integration_tests_scope_crm_currency">
4762
<directory>./tests/Integration/Services/CRM/Currency/</directory>
4863
</testsuite>
@@ -55,6 +70,12 @@
5570
<testsuite name="integration_tests_scope_automation">
5671
<directory>./tests/Integration/Services/CRM/Automation/</directory>
5772
</testsuite>
73+
<testsuite name="integration_tests_lead_details">
74+
<file>./tests/Integration/Services/CRM/Lead/Service/LeadDetailsConfigurationTest.php</file>
75+
</testsuite>
76+
<testsuite name="integration_tests_crm_quote">
77+
<directory>./tests/Integration/Services/CRM/Quote/</directory>
78+
</testsuite>
5879
</testsuites>
5980
<source>
6081
<include>

rector.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,14 @@
4040
__DIR__ . '/tests/Integration/Services/CRM/Deal/Service',
4141
__DIR__ . '/src/Services/CRM/Item/Service',
4242
__DIR__ . '/tests/Integration/Services/CRM/Item/Service',
43+
__DIR__ . '/src/Services/CRM/Deal/Service/DealDetailsConfiguration.php',
44+
__DIR__ . '/tests/Integration/Services/CRM/Deal/Service/DealDetailsConfigurationTest.php',
45+
__DIR__ . '/src/Services/CRM/Contact/Service/ContactDetailsConfiguration.php',
46+
__DIR__ . '/tests/Integration/Services/CRM/Contact/Service/ContactDetailsConfigurationTest.php',
47+
__DIR__ . '/src/Services/CRM/Lead',
48+
__DIR__ . '/tests/Integration/Services/CRM/Lead/Service',
49+
__DIR__ . '/src/Services/CRM/Quote',
50+
__DIR__ . '/tests/Integration/Services/CRM/Quote/Service',
4351
__DIR__ . '/src/Services/CRM/Currency',
4452
__DIR__ . '/tests/Integration/Services/CRM/Currency',
4553
__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 | |

0 commit comments

Comments
 (0)