-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdevRules.js
More file actions
46 lines (44 loc) · 945 Bytes
/
Copy pathdevRules.js
File metadata and controls
46 lines (44 loc) · 945 Bytes
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
import * as db from "./src/db/dbAdapter.js";
export const devRules = {
name: "Larger than 10p",
filters: [
{
type: "amount",
test: "gt",
value: 10,
},
{
type: "direction",
direction: "in",
},
],
macros: [
{
name: "Macro1",
tasks: [
{
type: "balance",
pot: "current",
variable: "currentBalance",
},
{
type: "math",
operation: "subtract",
operands: ["currentBalance", "transactionAmount"],
variable: "toDeposit",
},
{
type: "notify",
title: "Test notification",
body: "Test body",
},
],
},
],
};
export const addDevRules = async () => {
const userId = await db.getUserIdByEmail("gabrielrubinstein1@googlemail.com");
console.log("Adding test rules");
devRules.UserId = userId;
await db.addRule(devRules);
};