Skip to content

Commit cbcf04f

Browse files
authored
Leads import/upgrade (#2087)
Signed-off-by: Andrey Sobolev <[email protected]>
1 parent 9412e78 commit cbcf04f

File tree

8 files changed

+569
-33
lines changed

8 files changed

+569
-33
lines changed

.vscode/launch.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
"name": "Debug tool",
5656
"type": "node",
5757
"request": "launch",
58-
"args": ["src/index.ts", "backup-workspace", "ws1", "../../../dump/test/ws1"],
58+
"args": ["src/index.ts", "import-lead-csv", "ws1", "../../../suho/COMPANIES_Agency_of_AlexeyS.csv"],
5959
"env": {
6060
"MINIO_ACCESS_KEY": "minioadmin",
6161
"MINIO_SECRET_KEY": "minioadmin",
@@ -67,8 +67,7 @@
6767
},
6868
"runtimeArgs": ["--nolazy", "-r", "ts-node/register"],
6969
"sourceMaps": true,
70-
"cwd": "${workspaceRoot}/dev/tool",
71-
"protocol": "inspector"
70+
"cwd": "${workspaceRoot}/dev/tool"
7271
}
7372
]
7473
}

common/config/rush/pnpm-lock.yaml

Lines changed: 34 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

common/scripts/build_docker.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#!/bin/bash
22

3-
roots='./server/server ./server/front ./pods/account ./pods/backup ./products/tracker'
3+
roots='./server/server ./server/front ./pods/account ./pods/backup'
4+
# ./products/tracker is temporary disabled
45

56
for r in $roots
67
do

dev/docker-compose.yaml

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -76,26 +76,26 @@ services:
7676
- MINIO_ENDPOINT=minio
7777
- MINIO_ACCESS_KEY=minioadmin
7878
- MINIO_SECRET_KEY=minioadmin
79-
tracker-front:
80-
image: hardcoreeng/tracker-front
81-
links:
82-
- mongodb
83-
- minio
84-
- elastic
85-
- transactor
86-
ports:
87-
- 8084:8080
88-
environment:
89-
- SERVER_PORT=8080
90-
- SERVER_SECRET=secret
91-
- ACCOUNTS_URL=http://localhost:3000
92-
- FRONT_URL=http://localhost:8084
93-
- UPLOAD_URL=/files
94-
- TRANSACTOR_URL=ws://localhost:3333
95-
- ELASTIC_URL=http://elastic:9200
96-
- MINIO_ENDPOINT=minio
97-
- MINIO_ACCESS_KEY=minioadmin
98-
- MINIO_SECRET_KEY=minioadmin
79+
# tracker-front:
80+
# image: hardcoreeng/tracker-front
81+
# links:
82+
# - mongodb
83+
# - minio
84+
# - elastic
85+
# - transactor
86+
# ports:
87+
# - 8084:8080
88+
# environment:
89+
# - SERVER_PORT=8080
90+
# - SERVER_SECRET=secret
91+
# - ACCOUNTS_URL=http://localhost:3000
92+
# - FRONT_URL=http://localhost:8084
93+
# - UPLOAD_URL=/files
94+
# - TRANSACTOR_URL=ws://localhost:3333
95+
# - ELASTIC_URL=http://elastic:9200
96+
# - MINIO_ENDPOINT=minio
97+
# - MINIO_ACCESS_KEY=minioadmin
98+
# - MINIO_SECRET_KEY=minioadmin
9999
transactor:
100100
image: hardcoreeng/transactor
101101
links:

dev/tool/package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,8 @@
104104
"@anticrm/rekoni": "~0.6.0",
105105
"got": "^11.8.3",
106106
"@anticrm/tags": "~0.6.2",
107-
"@anticrm/server-backup": "~0.6.0"
107+
"@anticrm/server-backup": "~0.6.0",
108+
"csv-parse": "~5.1.0",
109+
"@anticrm/lead": "~0.6.0"
108110
}
109111
}

dev/tool/src/index.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ import { Db, MongoClient } from 'mongodb'
3636
import { exit } from 'process'
3737
import { rebuildElastic } from './elastic'
3838
import { importXml } from './importer'
39+
import { importLead } from './lead-importer'
3940
import { updateCandidates } from './recruit'
4041
import { clearTelegramHistory } from './telegram'
4142
import { diffWorkspace, dumpWorkspace, restoreWorkspace } from './workspace'
@@ -302,11 +303,18 @@ program
302303

303304
program
304305
.command('import-xml <workspace> <fileName>')
305-
.description('dump workspace transactions and minio resources')
306+
.description('Import Talants.')
306307
.action(async (workspace, fileName, cmd) => {
307308
return await importXml(transactorUrl, workspace, minio, fileName, mongodbUri, elasticUrl)
308309
})
309310

311+
program
312+
.command('import-lead-csv <workspace> <fileName>')
313+
.description('Import LEAD csv customer organizations')
314+
.action(async (workspace, fileName, cmd) => {
315+
return await importLead(transactorUrl, workspace, fileName)
316+
})
317+
310318
program
311319
.command('generate-token <name> <workspace>')
312320
.description('generate token')

0 commit comments

Comments
 (0)