Skip to content

Commit

Permalink
B24: Тесты и перевод блока лидов
Browse files Browse the repository at this point in the history
  • Loading branch information
Bayselonarrend committed Aug 22, 2024
1 parent 3b91e28 commit bfacbd9
Show file tree
Hide file tree
Showing 74 changed files with 7,328 additions and 4,316 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/oint_test_full_ru.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1092,6 +1092,10 @@ jobs:
if: ${{ cancelled() }} == false
run: oscript /home/runner/.local/share/ovm/current/lib/1testrunner/src/main.os -run ./src/ru/OInt/tests/Modules/internal/OPI_Тесты.os "Б24_УправлениеПользователями"

- name: Работа с лидами
if: ${{ cancelled() }} == false
run: oscript /home/runner/.local/share/ovm/current/lib/1testrunner/src/main.os -run ./src/ru/OInt/tests/Modules/internal/OPI_Тесты.os "Б24_РаботаСЛидами"

- name: Записать логи
if: ${{ cancelled() }} == false
uses: actions/cache/save@v3
Expand Down
1 change: 1 addition & 0 deletions docs/en/cli/Bitrix24/CreateLead.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
oint bitrix24 CreateLead --url "b24-ar17wx.bitrix24.by" --fields %fields% --token "ec4dc366006e9f06006b12e400000001000..."
1 change: 1 addition & 0 deletions docs/en/cli/Bitrix24/DeleteLead.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
oint bitrix24 DeleteLead --url "b24-ar17wx.bitrix24.by" --lead %lead% --token "ec4dc366006e9f06006b12e400000001000..."
1 change: 1 addition & 0 deletions docs/en/cli/Bitrix24/GetLead.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
oint bitrix24 GetLead --url "b24-ar17wx.bitrix24.by" --lead %lead% --token "ec4dc366006e9f06006b12e400000001000..."
1 change: 1 addition & 0 deletions docs/en/cli/Bitrix24/GetLeadFilterStructure.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
oint bitrix24 GetLeadFilterStructure --empty %empty%
1 change: 1 addition & 0 deletions docs/en/cli/Bitrix24/GetLeadStructure.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
oint bitrix24 GetLeadStructure --url "b24-ar17wx.bitrix24.by" --token "ec4dc366006e9f06006b12e400000001000..."
1 change: 1 addition & 0 deletions docs/en/cli/Bitrix24/GetLeadsList.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
oint bitrix24 GetLeadsList --url "b24-ar17wx.bitrix24.by" --filter %filter% --offset %offset% --token "ec4dc366006e9f06006b12e400000001000..."
1 change: 1 addition & 0 deletions docs/en/cli/Bitrix24/UpdateLead.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
oint bitrix24 UpdateLead --url "b24-ar17wx.bitrix24.by" --lead %lead% --fields %fields% --token "ec4dc366006e9f06006b12e400000001000..."
4 changes: 4 additions & 0 deletions docs/en/data/Bitrix24/CreateLead.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"URL": "b24-ar17wx.bitrix24.by",
"Token": "ec4dc366006e9f06006b12e400000001000..."
}
5 changes: 5 additions & 0 deletions docs/en/data/Bitrix24/DeleteLead.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"URL": "b24-ar17wx.bitrix24.by",
"LeadID": "",
"Token": "ec4dc366006e9f06006b12e400000001000..."
}
5 changes: 5 additions & 0 deletions docs/en/data/Bitrix24/GetLead.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"URL": "b24-ar17wx.bitrix24.by",
"LeadID": "",
"Token": "ec4dc366006e9f06006b12e400000001000..."
}
4 changes: 4 additions & 0 deletions docs/en/data/Bitrix24/GetLeadStructure.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"URL": "b24-ar17wx.bitrix24.by",
"Token": "ec4dc366006e9f06006b12e400000001000..."
}
4 changes: 4 additions & 0 deletions docs/en/data/Bitrix24/GetLeadsList.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"URL": "b24-ar17wx.bitrix24.by",
"Token": "ec4dc366006e9f06006b12e400000001000..."
}
5 changes: 5 additions & 0 deletions docs/en/data/Bitrix24/UpdateLead.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"URL": "b24-ar17wx.bitrix24.by",
"LeadID": "",
"Token": "ec4dc366006e9f06006b12e400000001000..."
}
27 changes: 27 additions & 0 deletions docs/en/examples/Bitrix24/CreateLead.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
 EmailsArray = New Array;
EmailsArray.Add(New Structure("VALUE,VALUE_TYPE", "[email protected]", "HOME"));
EmailsArray.Add(New Structure("VALUE,VALUE_TYPE", "[email protected]", "WORK"));

PhonesArray = New Array;
PhonesArray.Add(New Structure("VALUE,VALUE_TYPE", "88005553535", "WORK"));

FieldsStructure = New Structure;
FieldsStructure.Insert("ADDRESS" , "Pushkin st., b. 10");
FieldsStructure.Insert("ADDRESS_COUNTRY", "Russia");
FieldsStructure.Insert("EMAIL" , EmailsArray);
FieldsStructure.Insert("NAME" , "John");
FieldsStructure.Insert("LAST_NAME" , "Doe");
FieldsStructure.Insert("PHONE" , PhonesArray);
FieldsStructure.Insert("TITLE" , "MegaClient");

URL = "https://b24-ar17wx.bitrix24.by/rest/1/1o2...";

Result = OPI_Bitrix24.CreateLead(URL, FieldsStructure);

FieldsStructure.Insert("NAME" , "Ivan");
FieldsStructure.Insert("LAST_NAME" , "Ivanov");

URL = "b24-ar17wx.bitrix24.by";
Token = "ec4dc366006e9f06006b12e400000001000...";

Result = OPI_Bitrix24.CreateLead(URL, FieldsStructure, Token);
10 changes: 10 additions & 0 deletions docs/en/examples/Bitrix24/DeleteLead.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
 URL = "https://b24-ar17wx.bitrix24.by/rest/1/1o2...";
LeadID = "";

Result = OPI_Bitrix24.DeleteLead(URL, LeadID);

URL = "b24-ar17wx.bitrix24.by";
Token = "ec4dc366006e9f06006b12e400000001000...";
LeadID = "";

Result = OPI_Bitrix24.DeleteLead(URL, LeadID, Token);
10 changes: 10 additions & 0 deletions docs/en/examples/Bitrix24/GetLead.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
 URL = "https://b24-ar17wx.bitrix24.by/rest/1/1o2...";
LeadID = "";

Result = OPI_Bitrix24.GetLead(URL, LeadID);

URL = "b24-ar17wx.bitrix24.by";
Token = "ec4dc366006e9f06006b12e400000001000...";
LeadID = "";

Result = OPI_Bitrix24.GetLead(URL, LeadID, Token);
1 change: 1 addition & 0 deletions docs/en/examples/Bitrix24/GetLeadFilterStructure.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
 Result = OPI_Bitrix24.GetLeadFilterStructure();
8 changes: 8 additions & 0 deletions docs/en/examples/Bitrix24/GetLeadStructure.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
 URL = "https://b24-ar17wx.bitrix24.by/rest/1/1o2...";

Result = OPI_Bitrix24.GetLeadStructure(URL);

URL = "b24-ar17wx.bitrix24.by";
Token = "ec4dc366006e9f06006b12e400000001000...";

Result = OPI_Bitrix24.GetLeadStructure(URL, Token);
12 changes: 12 additions & 0 deletions docs/en/examples/Bitrix24/GetLeadsList.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
 URL = "https://b24-ar17wx.bitrix24.by/rest/1/1o2...";

Result = OPI_Bitrix24.GetLeadsList(URL);

URL = "b24-ar17wx.bitrix24.by";
Token = "ec4dc366006e9f06006b12e400000001000...";

Filter = New Structure;
Filter.Insert("TITLE" , "MegaClient");
Filter.Insert("HAS_EMAIL", "Y");

Result = OPI_Bitrix24.GetLeadsList(URL, Filter, ,Token);
2 changes: 1 addition & 1 deletion docs/en/examples/Bitrix24/GetTasksList.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
 // Full filter structer you can find at GetTasksFilterStructure method
 // Full filter structure you can find at GetTasksFilterStructure method
Filter = New Structure;
Filter.Insert("CREATED_BY" , 1);
Filter.Insert("RESPONSIBLE_ID", 10);
Expand Down
18 changes: 18 additions & 0 deletions docs/en/examples/Bitrix24/UpdateLead.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
 FieldsStructure = New Structure;
FieldsStructure.Insert("ADDRESS" , "Lermontov st., b. 20");
FieldsStructure.Insert("ADDRESS_COUNTRY", "Belarus");
FieldsStructure.Insert("TITLE" , "SuperClient");

URL = "https://b24-ar17wx.bitrix24.by/rest/1/1o2...";
LeadID = "";

Result = OPI_Bitrix24.UpdateLead(URL, LeadID, FieldsStructure);

FieldsStructure.Insert("NAME" , "Evgeniy");
FieldsStructure.Insert("LAST_NAME" , "Evgeniev");

URL = "b24-ar17wx.bitrix24.by";
Token = "ec4dc366006e9f06006b12e400000001000...";
LeadID = "";

Result = OPI_Bitrix24.UpdateLead(URL, LeadID, FieldsStructure, Token);
69 changes: 69 additions & 0 deletions docs/en/md/Bitrix24/Leads-managment/Create-lead.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
---
sidebar_position: 1
---

# Create lead
Creates a new lead by fields structure (see GetLeadStructure)



`Function CreateLead(Val URL, Val FieldsStructure, Val Token = "") Export`

| Parameter | CLI option | Type | Description |
|-|-|-|-|
| URL | --url | String | URL of webhook or a Bitrix24 domain, when token used |
| FieldsStructure | --fields | Structure of KeyAndValue | Lead fields structure (see GetLeadStructure) |
| Token | --token | String | Access token, when app auth method used |


Returns: Map Of KeyAndValue - serialized JSON of answer from Bitrix24 API

<br/>

:::tip
Method at API documentation: [crm.lead.add](https://dev.1c-bitrix.ru/rest_help/crm/leads/crm_lead_add.php)
:::
<br/>


```bsl title="Code example"
EmailsArray = New Array;
EmailsArray.Add(New Structure("VALUE,VALUE_TYPE", "[email protected]", "HOME"));
EmailsArray.Add(New Structure("VALUE,VALUE_TYPE", "[email protected]", "WORK"));
PhonesArray = New Array;
PhonesArray.Add(New Structure("VALUE,VALUE_TYPE", "88005553535", "WORK"));
FieldsStructure = New Structure;
FieldsStructure.Insert("ADDRESS" , "Pushkin st., b. 10");
FieldsStructure.Insert("ADDRESS_COUNTRY", "Russia");
FieldsStructure.Insert("EMAIL" , EmailsArray);
FieldsStructure.Insert("NAME" , "John");
FieldsStructure.Insert("LAST_NAME" , "Doe");
FieldsStructure.Insert("PHONE" , PhonesArray);
FieldsStructure.Insert("TITLE" , "MegaClient");
URL = "https://b24-ar17wx.bitrix24.by/rest/1/1o2...";
Result = OPI_Bitrix24.CreateLead(URL, FieldsStructure);
FieldsStructure.Insert("NAME" , "Ivan");
FieldsStructure.Insert("LAST_NAME" , "Ivanov");
URL = "b24-ar17wx.bitrix24.by";
Token = "ec4dc366006e9f06006b12e400000001000...";
Result = OPI_Bitrix24.CreateLead(URL, FieldsStructure, Token);
```



```sh title="CLI command example"

oint bitrix24 CreateLead --url "b24-ar17wx.bitrix24.by" --fields %fields% --token "ec4dc366006e9f06006b12e400000001000..."

```

```json title="Result"

```
52 changes: 52 additions & 0 deletions docs/en/md/Bitrix24/Leads-managment/Delete-lead.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
---
sidebar_position: 2
---

# Delete lead
Deletes a lead by ID



`Function DeleteLead(Val URL, Val LeadID, Val Token = "") Export`

| Parameter | CLI option | Type | Description |
|-|-|-|-|
| URL | --url | String | URL of webhook or a Bitrix24 domain, when token used |
| LeadID | --lead | Number, String | Task ID |
| Token | --token | String | Access token, when app auth method used |


Returns: Map Of KeyAndValue - serialized JSON of answer from Bitrix24 API

<br/>

:::tip
Method at API documentation: [crm.lead.delete](https://dev.1c-bitrix.ru/rest_help/crm/leads/crm_lead_delete.php)
:::
<br/>


```bsl title="Code example"
URL = "https://b24-ar17wx.bitrix24.by/rest/1/1o2...";
LeadID = "";
Result = OPI_Bitrix24.DeleteLead(URL, LeadID);
URL = "b24-ar17wx.bitrix24.by";
Token = "ec4dc366006e9f06006b12e400000001000...";
LeadID = "";
Result = OPI_Bitrix24.DeleteLead(URL, LeadID, Token);
```



```sh title="CLI command example"

oint bitrix24 DeleteLead --url "b24-ar17wx.bitrix24.by" --lead %lead% --token "ec4dc366006e9f06006b12e400000001000..."

```

```json title="Result"

```
38 changes: 38 additions & 0 deletions docs/en/md/Bitrix24/Leads-managment/Get-lead-filter-structure.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
---
sidebar_position: 7
---

# Get lead filter structure
Returns the field structure for filtering leads in the GetLeadsList method



`Function GetLeadFilterStructure(Val Clear = False) Export`

| Parameter | CLI option | Type | Description |
|-|-|-|-|
| Clear | --empty | Boolean | True > structure with empty valuse, False > field descriptions at values |


Returns: Structure of KeyAndValue - Fields structure

<br/>




```bsl title="Code example"
Result = OPI_Bitrix24.GetLeadFilterStructure();
```



```sh title="CLI command example"

oint bitrix24 GetLeadFilterStructure --empty %empty%

```

```json title="Result"

```
49 changes: 49 additions & 0 deletions docs/en/md/Bitrix24/Leads-managment/Get-lead-structure.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
---
sidebar_position: 6
---

# Get lead structure
Gets a structure with field descriptions for creating a lead



`Function GetLeadStructure(Val URL, Val Token = "") Export`

| Parameter | CLI option | Type | Description |
|-|-|-|-|
| URL | --url | String | URL of webhook or a Bitrix24 domain, when token used |
| Token | --token | String | Access token, when app auth method used |


Returns: Map Of KeyAndValue - serialized JSON of answer from Bitrix24 API

<br/>

:::tip
Method at API documentation: [crm.lead.fields](https://dev.1c-bitrix.ru/rest_help/crm/leads/crm_lead_fields.php)
:::
<br/>


```bsl title="Code example"
URL = "https://b24-ar17wx.bitrix24.by/rest/1/1o2...";
Result = OPI_Bitrix24.GetLeadStructure(URL);
URL = "b24-ar17wx.bitrix24.by";
Token = "ec4dc366006e9f06006b12e400000001000...";
Result = OPI_Bitrix24.GetLeadStructure(URL, Token);
```



```sh title="CLI command example"

oint bitrix24 GetLeadStructure --url "b24-ar17wx.bitrix24.by" --token "ec4dc366006e9f06006b12e400000001000..."

```

```json title="Result"

```
Loading

0 comments on commit bfacbd9

Please sign in to comment.