-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
executable file
·50 lines (41 loc) · 1.64 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
const app = require('./modules/express')
const cacheList = require("./modules/cacheList");
const vtex = new(require('./components/vtex'))()
const bossa = new(require('./components/bossa'))()
const database = new(require('./components/database'))().getDatabase('subscriptions')
cacheList.list();
app.listen(3301, async() => {
console.log("ready")
// console.log(database.find({customerEmail: 'alessandrapqueiroz@yahoo.com.br'}).value())
await (await vtex.subscriptions()).save();
// database.push({customerEmail: "alessandrapqueiroz2@yahoo.com.br"}).write()
// if(!database.find({customerEmail: "alessandrapqueiroz2@yahoo.com.br"}).value()){
// console.log("ntem")
// database.add({
// customerEmail: 1,
// crmList: 2,
// orderId: 3,
// parentOriginCode: 4,
// assinaturas: 5
// })
// }
// let data = {
// "parentOriginCode": 34991,
// "name": "SUporte TI",
// "email": "testedothiagodasimples@teste.com",
// "phone": "(11) 99999-7777",
// "cpf": "043.530.740-16",
// "idGroups": 39
// };
// let testAdd = await (await bossa.api()).add(data)
// console.log(testAdd)
// let dataPlan = {
// "parentOriginCode": 110,
// "email": "suportedeTI4@yopmail.com",
// "idGroups": 39
// };
// let user = await (await bossa.api()).find("testedasimplesth02@yopmail.com", 34991)
// console.log(user)
// if(!user) return await (await bossa.api()).add(data)
// await (await bossa.api()).changePlan(dataPlan)
})