Skip to content

Commit 721b09c

Browse files
authored
Merge branch 'dev' into feature/172-add-lead-detailes
2 parents 95fa657 + 78e24b5 commit 721b09c

File tree

63 files changed

+4184
-61
lines changed

Some content is hidden

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

63 files changed

+4184
-61
lines changed

.php-cs-fixer.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@
77
$finder = Finder::create()
88
->in(__DIR__ . '/src/Infrastructure/Console/Commands/')
99
->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/')
1013
->in(__DIR__ . '/src/Services/CRM/Currency/')
1114
->name('*.php')
1215
->exclude(['vendor', 'storage', 'docker', 'docs']) // Exclude directories

CHANGELOG.md

Lines changed: 54 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,50 @@
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 `Services\CRM\Lead\Service\LeadProductRows` with support methods,
17+
see [add crm.lead.productrows* methods](https://github.com/bitrix24/b24phpsdk/issues/175):
18+
- `set` Adds products to a lead
19+
- `get` Returns the products of a lead
20+
- Added service `Services\CRM\Quote\Service\Quote` with support methods,
21+
see [crm.quote.* methods](https://github.com/bitrix24/b24phpsdk/issues/179):
22+
- `fields` returns a list of fields for the quote
23+
- `get` returns the settings of the quote by Id
24+
- `list` returns a list of quote
25+
- `add` creates a new quote
26+
- `delete` deletes a quote
27+
- `update` modifies the quote
28+
- `countByFilter` count quotes by filter
29+
- Added support for events:
30+
- `OnCrmQuoteAdd`
31+
- `OnCrmQuoteDelete`
32+
- `OnCrmQuoteUpdate`
33+
- `OnCrmQuoteUserFieldAdd`
34+
- `OnCrmQuoteUserFieldDelete`
35+
- `OnCrmQuoteUserFieldSetEnumValues`
36+
- `OnCrmQuoteUserFieldUpdate`
37+
- Added service `Services\CRM\Quote\Service\QuoteUserfield` with support methods:
38+
- `add` add userfield to a quote
39+
- `get` get userfield to a quote
40+
- `list` list userfields
41+
- `delete` delete userfield
42+
- `update` update userfield
43+
- Added service `Services\CRM\Quote\Service\QuoteProductRows` with support methods:
44+
- `set` Adds products to a quote
45+
- `get` Returns the products of a quote
46+
- Added service `Services\CRM\Quote\Service\QuoteContact` with support methods,
47+
- `fields` get fiels for quote contact connection
48+
- `setItems` set contacts related with quote
49+
- `get` get contacts related to quote
50+
- `deleteItems` delete all relations for quote
51+
- `add` add contact relation with quote
52+
- `delete` delete contact relation with quote
53+
- Added service `CRM\Lead\Service\LeadUserfield` with support methods,
54+
see [add crm.lead.userfield.* methods](https://github.com/bitrix24/b24phpsdk/issues/177):
55+
- `add` add userfield to lead
56+
- `get` get userfield to lead
57+
- `list` list userfields
58+
- `delete` delete userfield
59+
- `update` update userfield
1660
- Added service `Services\CRM\Deal\Service\DealRecurring` with support methods,
1761
see [crm.deal.recurring.* methods](https://github.com/bitrix24/b24phpsdk/issues/160):
1862
- `fields` returns a list of fields for the recurring deal template
@@ -71,6 +115,15 @@ work in progress
71115

72116
### Added
73117

118+
- Added service `CRM\Contact\Service\ContactDetailsConfiguration` with support methods,
119+
see [add crm.contact.details.* methods](https://github.com/bitrix24/b24phpsdk/issues/153):
120+
- `getPersonal` method retrieves the settings of contact cards for personal user
121+
- `getGeneral` method retrieves the settings of contact cards for all users
122+
- `resetPersonal` method reset for item user settings
123+
- `resetGeneral` method reset all card settings for all users
124+
- `setPersonal` method set card configuration
125+
- `setGeneral` method set card configuration for all users
126+
- `setForceCommonConfigForAll` method set common detail form for All Users
74127
- Added **PHP 8.4** [support](https://github.com/bitrix24/b24phpsdk/issues/120) 🚀
75128
- Added method `Bitrix24\SDK\Services\Main\Service::guardValidateCurrentAuthToken` for validate current auth token with
76129
api-call `app.info` on vendor OAUTH server.
@@ -450,4 +503,4 @@ Supported in bitrix24-php-sdk methods with batch wrapper count: 22
450503

451504
## 1.0
452505

453-
* Initial release
506+
* Initial release

Makefile

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,18 @@ test-integration-scope-entity:
179179
test-integration-scope-ai-admin:
180180
docker-compose run --rm php-cli vendor/bin/phpunit --testsuite integration_tests_scope_ai_admin
181181

182+
.PHONY: integration_tests_scope_crm_contact_details
183+
integration_tests_scope_crm_contact_details:
184+
docker-compose run --rm php-cli vendor/bin/phpunit --testsuite integration_tests_scope_crm_contact_details
185+
186+
.PHONY: integration_tests_lead_userfield
187+
integration_tests_lead_userfield:
188+
docker-compose run --rm php-cli vendor/bin/phpunit --testsuite integration_tests_lead_userfield
189+
190+
.PHONY: integration_tests_lead_userfield_use_case
191+
integration_tests_lead_userfield_use_case:
192+
docker-compose run --rm php-cli vendor/bin/phpunit --testsuite integration_tests_lead_userfield_use_case
193+
182194
.PHONY: integration_tests_scope_crm_currency
183195
integration_tests_scope_crm_currency:
184196
docker-compose run --rm php-cli vendor/bin/phpunit --testsuite integration_tests_scope_crm_currency
@@ -191,6 +203,18 @@ integration_tests_deal_recurring:
191203
integration_tests_lead_details:
192204
docker-compose run --rm php-cli vendor/bin/phpunit --testsuite integration_tests_lead_details
193205

206+
.PHONY: integration_tests_scope_automation
207+
integration_tests_scope_automation:
208+
docker-compose run --rm php-cli vendor/bin/phpunit --testsuite integration_tests_scope_automation
209+
210+
.PHONY: integration_tests_lead_productrows
211+
integration_tests_lead_productrows:
212+
docker-compose run --rm php-cli vendor/bin/phpunit --testsuite integration_tests_lead_productrows
213+
214+
.PHONY: integration_tests_crm_quote
215+
integration_tests_crm_quote:
216+
docker-compose run --rm php-cli vendor/bin/phpunit --testsuite integration_tests_crm_quote
217+
194218
# work dev environment
195219
.PHONY: php-dev-server-up
196220
php-dev-server-up:

phpstan.neon.dist

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

phpunit.xml.dist

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,18 @@
4343
<testsuite name="integration_tests_scope_ai_admin">
4444
<directory>./tests/Integration/Services/AI/</directory>
4545
</testsuite>
46+
<testsuite name="integration_tests_scope_crm_contact_details">
47+
<file>./tests/Integration/Services/CRM/Contact/Service/ContactDetailsConfigurationTest.php</file>
48+
</testsuite>
49+
<testsuite name="integration_tests_lead_productrows">
50+
<file>./tests/Integration/Services/CRM/Lead/Service/LeadProductRowsTest.php</file>
51+
</testsuite>
52+
<testsuite name="integration_tests_lead_userfield">
53+
<file>./tests/Integration/Services/CRM/Lead/Service/LeadUserfieldTest.php</file>
54+
</testsuite>
55+
<testsuite name="integration_tests_lead_userfield_use_case">
56+
<file>./tests/Integration/Services/CRM/Lead/Service/LeadUserfieldUseCaseTest.php</file>
57+
</testsuite>
4658
<testsuite name="integration_tests_scope_crm_currency">
4759
<directory>./tests/Integration/Services/CRM/Currency/</directory>
4860
</testsuite>
@@ -52,6 +64,9 @@
5264
<testsuite name="integration_tests_lead_details">
5365
<file>./tests/Integration/Services/CRM/Lead/Service/LeadDetailsConfigurationTest.php</file>
5466
</testsuite>
67+
<testsuite name="integration_tests_crm_quote">
68+
<directory>./tests/Integration/Services/CRM/Quote/</directory>
69+
</testsuite>
5570
</testsuites>
5671
<source>
5772
<include>

rector.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,12 @@
3636
__DIR__ . '/tests/Integration/Services/Main',
3737
__DIR__ . '/src/Services/Placement',
3838
__DIR__ . '/tests/Integration/Services/Placement',
39+
__DIR__ . '/src/Services/CRM/Contact/Service/ContactDetailsConfiguration.php',
40+
__DIR__ . '/tests/Integration/Services/CRM/Contact/Service/ContactDetailsConfigurationTest.php',
41+
__DIR__ . '/src/Services/CRM/Lead',
42+
__DIR__ . '/tests/Integration/Services/CRM/Lead/Service',
43+
__DIR__ . '/src/Services/CRM/Quote',
44+
__DIR__ . '/tests/Integration/Services/CRM/Quote/Service',
3945
__DIR__ . '/src/Services/CRM/Currency',
4046
__DIR__ . '/tests/Integration/Services/CRM/Currency',
4147
__DIR__ . '/tests/Unit/',

src/Services/CRM/CRMServiceBuilder.php

Lines changed: 88 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,18 @@ public function leadDetailsConfiguration(): Lead\Service\LeadDetailsConfiguratio
8484
return $this->serviceCache[__METHOD__];
8585
}
8686

87+
public function contactDetailsConfiguration(): Contact\Service\ContactDetailsConfiguration
88+
{
89+
if (!isset($this->serviceCache[__METHOD__])) {
90+
$this->serviceCache[__METHOD__] = new Contact\Service\ContactDetailsConfiguration(
91+
$this->core,
92+
$this->log
93+
);
94+
}
95+
96+
return $this->serviceCache[__METHOD__];
97+
}
98+
8799
public function vat(): VatRates\Service\Vat
88100
{
89101
if (!isset($this->serviceCache[__METHOD__])) {
@@ -323,6 +335,81 @@ public function lead(): Lead\Service\Lead
323335

324336
return $this->serviceCache[__METHOD__];
325337
}
338+
339+
/**
340+
* @return Lead\Service\LeadProductRows
341+
*/
342+
public function leadProductRows(): Lead\Service\LeadProductRows
343+
{
344+
if (!isset($this->serviceCache[__METHOD__])) {
345+
$this->serviceCache[__METHOD__] = new Lead\Service\LeadProductRows($this->core, $this->log);
346+
}
347+
348+
return $this->serviceCache[__METHOD__];
349+
}
350+
351+
public function leadUserfield(): Lead\Service\LeadUserfield
352+
{
353+
if (!isset($this->serviceCache[__METHOD__])) {
354+
$this->serviceCache[__METHOD__] = new Lead\Service\LeadUserfield(
355+
new UserfieldConstraints(),
356+
$this->core,
357+
$this->log
358+
);
359+
}
360+
361+
return $this->serviceCache[__METHOD__];
362+
}
363+
364+
public function quote(): Quote\Service\Quote
365+
{
366+
if (!isset($this->serviceCache[__METHOD__])) {
367+
$this->serviceCache[__METHOD__] = new Quote\Service\Quote(
368+
new Quote\Service\Batch($this->batch, $this->log),
369+
$this->core,
370+
$this->log
371+
);
372+
}
373+
374+
return $this->serviceCache[__METHOD__];
375+
}
376+
377+
public function quoteContact(): Quote\Service\QuoteContact
378+
{
379+
if (!isset($this->serviceCache[__METHOD__])) {
380+
$this->serviceCache[__METHOD__] = new Quote\Service\QuoteContact(
381+
$this->core,
382+
$this->log
383+
);
384+
}
385+
386+
return $this->serviceCache[__METHOD__];
387+
}
388+
389+
/**
390+
* @return Quote\Service\QuoteProductRows
391+
*/
392+
public function quoteProductRows(): Quote\Service\QuoteProductRows
393+
{
394+
if (!isset($this->serviceCache[__METHOD__])) {
395+
$this->serviceCache[__METHOD__] = new Quote\Service\QuoteProductRows($this->core, $this->log);
396+
}
397+
398+
return $this->serviceCache[__METHOD__];
399+
}
400+
401+
public function quoteUserfield(): Quote\Service\QuoteUserfield
402+
{
403+
if (!isset($this->serviceCache[__METHOD__])) {
404+
$this->serviceCache[__METHOD__] = new Quote\Service\QuoteUserfield(
405+
new UserfieldConstraints(),
406+
$this->core,
407+
$this->log
408+
);
409+
}
410+
411+
return $this->serviceCache[__METHOD__];
412+
}
326413

327414
public function activity(): Activity\Service\Activity
328415
{
@@ -392,4 +479,4 @@ public function duplicate(): Duplicates\Service\Duplicate
392479

393480
return $this->serviceCache[__METHOD__];
394481
}
395-
}
482+
}

0 commit comments

Comments
 (0)