Skip to content

Commit 5b70a3e

Browse files
authored
Merge pull request #791 from PayButton/chore/add-seeds-for-estevao
chore: add seeds for better development related to triggers
2 parents d8bd082 + a2f76bd commit 5b70a3e

6 files changed

Lines changed: 270 additions & 0 deletions

File tree

prisma/seed.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import { paybuttonAddressConnectors } from './seeds/paybuttonAddressConnectors'
66
import { walletUserConnectors } from './seeds/walletUserConnectors'
77
import { addressUserConnectors } from './seeds/addressUserConnectors'
88
import { wallets } from './seeds/wallets'
9+
import { paybuttonTriggers } from './seeds/triggers'
910
import { getPrices } from './seeds/prices'
1011
import { quotes } from './seeds/quotes'
1112
import { createDevUsersRawQueryList, createAdminUserRawQueryList, devUserProfiles, adminUserProfiles } from './seeds/users'
@@ -38,6 +39,10 @@ async function main (): Promise<void> {
3839
await prisma.address.createMany({ data: addresses })
3940
await prisma.addressesOnButtons.createMany({ data: paybuttonAddressConnectors })
4041
}
42+
// create paybuttonTriggers
43+
if (await prisma.paybuttonTrigger.count() === 0) {
44+
await prisma.paybuttonTrigger.createMany({ data: paybuttonTriggers })
45+
}
4146
// create users
4247
for (const q of createDevUsersRawQueryList) {
4348
await prisma.$executeRawUnsafe(q)

prisma/seeds/addressUserConnectors.ts

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,5 +28,90 @@ export const addressUserConnectors = [
2828
addressId: 'f22a0233-ff55-4a96-92dd-cc44f02dac98',
2929
walletId: 'f0d4026f-3fb0-4563-af9a-e6ad53f00d2c',
3030
userId: 'dev-uid'
31+
},
32+
{
33+
walletId: 'f0d4026f-3fb0-4563-af9a-e6ad53f00d2c',
34+
addressId: '68882fe9-b887-11ee-a146-0242c0a88003',
35+
userId: 'dev-uid'
36+
},
37+
{
38+
walletId: 'f0d4026f-3fb0-4563-af9a-e6ad53f00d2c',
39+
addressId: '688838e4-b887-11ee-a146-0242c0a88003',
40+
userId: 'dev-uid'
41+
},
42+
{
43+
walletId: 'f0d4026f-3fb0-4563-af9a-e6ad53f00d2c',
44+
addressId: '688839eb-b887-11ee-a146-0242c0a88003',
45+
userId: 'dev-uid'
46+
},
47+
{
48+
walletId: 'f0d4026f-3fb0-4563-af9a-e6ad53f00d2c',
49+
addressId: '6888601e-b887-11ee-a146-0242c0a88003',
50+
userId: 'dev-uid'
51+
},
52+
{
53+
walletId: 'f0d4026f-3fb0-4563-af9a-e6ad53f00d2c',
54+
addressId: '6888610a-b887-11ee-a146-0242c0a88003',
55+
userId: 'dev-uid'
56+
},
57+
{
58+
walletId: 'f0d4026f-3fb0-4563-af9a-e6ad53f00d2c',
59+
addressId: '68886794-b887-11ee-a146-0242c0a88003',
60+
userId: 'dev-uid'
61+
},
62+
{
63+
walletId: 'f0d4026f-3fb0-4563-af9a-e6ad53f00d2c',
64+
addressId: '68886b53-b887-11ee-a146-0242c0a88003',
65+
userId: 'dev-uid'
66+
},
67+
{
68+
walletId: 'f0d4026f-3fb0-4563-af9a-e6ad53f00d2c',
69+
addressId: 'b15ff5e0-9e49-49d2-82a3-16f98035b4b7',
70+
userId: 'dev-uid'
71+
},
72+
{
73+
walletId: 'f0d4026f-3fb0-4563-af9a-e6ad53f00d2c',
74+
addressId: '30bd89d2-702b-403a-aad8-afb13f7aba9f',
75+
userId: 'dev-uid'
76+
},
77+
{
78+
walletId: 'f0d4026f-3fb0-4563-af9a-e6ad53f00d2c',
79+
addressId: 'd8e77bef-2acd-4fe8-9d9e-01409d3ea2bb',
80+
userId: 'dev-uid'
81+
},
82+
{
83+
walletId: 'f0d4026f-3fb0-4563-af9a-e6ad53f00d2c',
84+
addressId: '543706d7-d312-40ad-8355-3b26c4ff0944',
85+
userId: 'dev-uid'
86+
},
87+
{
88+
walletId: 'f0d4026f-3fb0-4563-af9a-e6ad53f00d2c',
89+
addressId: '8aa35eeb-b0e4-4092-b80d-53fcf3564bae',
90+
userId: 'dev-uid'
91+
},
92+
{
93+
walletId: 'f0d4026f-3fb0-4563-af9a-e6ad53f00d2c',
94+
addressId: '014cb04e-56e7-418f-b273-d603bba09760',
95+
userId: 'dev-uid'
96+
},
97+
{
98+
walletId: 'f0d4026f-3fb0-4563-af9a-e6ad53f00d2c',
99+
addressId: '4c054310-2e9c-4862-b234-6581c2ce30cf',
100+
userId: 'dev-uid'
101+
},
102+
{
103+
walletId: 'f0d4026f-3fb0-4563-af9a-e6ad53f00d2c',
104+
addressId: '09a177b0-3af4-48ae-a6e7-0fa25eeb31a9',
105+
userId: 'dev-uid'
106+
},
107+
{
108+
walletId: 'f0d4026f-3fb0-4563-af9a-e6ad53f00d2c',
109+
addressId: '6555787c-d347-4cec-9ea1-5f26d9b6683e',
110+
userId: 'dev-uid'
111+
},
112+
{
113+
walletId: 'f0d4026f-3fb0-4563-af9a-e6ad53f00d2c',
114+
addressId: 'c385d4e9-3e34-4657-b6cf-8e2221f4e8bd',
115+
userId: 'dev-uid'
31116
}
32117
]

prisma/seeds/addresses.ts

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,91 @@ export const addresses = [
2828
id: 'f22a0233-ff55-4a96-92dd-cc44f02dac98',
2929
address: 'ecash:qpun29ufvq56sksyxztwe7ntn0h60rah856a972rx6',
3030
networkId: 1
31+
},
32+
{
33+
id: '68882fe9-b887-11ee-a146-0242c0a88003',
34+
address: 'ecash:qq7p63sdtcy5sw3e4xf436g8rxn27c93mude333j9d',
35+
networkId: 1
36+
},
37+
{
38+
id: '688838e4-b887-11ee-a146-0242c0a88003',
39+
address: 'ecash:qpxqkww4xu0xntchadw4zhetxhavx9l7lqxv9wzu3z',
40+
networkId: 1
41+
},
42+
{
43+
id: '688839eb-b887-11ee-a146-0242c0a88003',
44+
address: 'ecash:qp5h4eetqcj407nfl82dpyvz22w6x69tdyxpprn8zg',
45+
networkId: 1
46+
},
47+
{
48+
id: '6888601e-b887-11ee-a146-0242c0a88003',
49+
address: 'ecash:qzkm7gc8seg55vtq60xgr2lha65xj9ak5u25jgrtrs',
50+
networkId: 1
51+
},
52+
{
53+
id: '6888610a-b887-11ee-a146-0242c0a88003',
54+
address: 'ecash:qz802yfcxf79peh49tr2vtdz33lvf76zkvfpcn0q7n',
55+
networkId: 1
56+
},
57+
{
58+
id: '68886794-b887-11ee-a146-0242c0a88003',
59+
address: 'ecash:qqphqrt5zpsfztwjlhhudjc6dlnlcnfuxuufm4sjlq',
60+
networkId: 1
61+
},
62+
{
63+
id: '68886b53-b887-11ee-a146-0242c0a88003',
64+
address: 'ecash:qqz2ndeqfwynwe0wlvvq5jrcgt5fq3y65ged73tnu5',
65+
networkId: 1
66+
},
67+
{
68+
id: 'b15ff5e0-9e49-49d2-82a3-16f98035b4b7',
69+
address: 'ecash:qp2v7kemclu7mv5y3h9qprwp0mrevkqt9gprvmm7yl',
70+
networkId: 1
71+
},
72+
{
73+
id: '30bd89d2-702b-403a-aad8-afb13f7aba9f',
74+
address: 'ecash:qz0rgej87x70gcj7g06x7zzccqshv87rxysxnfrap5',
75+
networkId: 1
76+
},
77+
{
78+
id: 'd8e77bef-2acd-4fe8-9d9e-01409d3ea2bb',
79+
address: 'ecash:qrlzdvlm8uqn029u8a6pkalgztrr9xg3wqjm85rc6v',
80+
networkId: 1
81+
},
82+
{
83+
id: '543706d7-d312-40ad-8355-3b26c4ff0944',
84+
address: 'ecash:qprxt3hy34ettmm0wfxhzgtm4sv9xm2gxvgpkm93ca',
85+
networkId: 1
86+
},
87+
{
88+
id: '8aa35eeb-b0e4-4092-b80d-53fcf3564bae',
89+
address: 'ecash:qrf4zh4vgrdal8d8gu905d90w5u2y60djcd2d5h6un',
90+
networkId: 1
91+
},
92+
{
93+
id: '014cb04e-56e7-418f-b273-d603bba09760',
94+
address: 'ecash:qzex50mafylu6vvwvxjnzv7gallmmx7l358rhfegas',
95+
networkId: 1
96+
},
97+
{
98+
id: '4c054310-2e9c-4862-b234-6581c2ce30cf',
99+
address: 'ecash:qrv5f5pfx9k5zrdgqrpcwrq95m8lh8n52q2pghg4qw',
100+
networkId: 1
101+
},
102+
{
103+
id: '09a177b0-3af4-48ae-a6e7-0fa25eeb31a9',
104+
address: 'ecash:qq4yvfrujv4eswe8jmeennltpe8q89anmqkvwvperl',
105+
networkId: 1
106+
},
107+
{
108+
id: '6555787c-d347-4cec-9ea1-5f26d9b6683e',
109+
address: 'ecash:qrdq99s8akyx7nmyp84y46wdq7zld939cuck2lrlt0',
110+
networkId: 1
111+
},
112+
{
113+
id: 'c385d4e9-3e34-4657-b6cf-8e2221f4e8bd',
114+
address: 'ecash:qpcngtkqvdns6at2wq09fjytunlljvczxuchefwhln',
115+
networkId: 1
31116
}
32117
]
33118

prisma/seeds/paybuttonAddressConnectors.ts

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,5 +30,73 @@ export const paybuttonAddressConnectors = [
3030
{
3131
addressId: 'f22a0233-ff55-4a96-92dd-cc44f02dac98',
3232
paybuttonId: 'f03981ab-8ded-4aab-93e8-b1d38f9b219b'
33+
},
34+
{
35+
addressId: '68882fe9-b887-11ee-a146-0242c0a88003',
36+
paybuttonId: '688e9bfa-b887-11ee-a146-0242c0a88003'
37+
},
38+
{
39+
addressId: '688838e4-b887-11ee-a146-0242c0a88003',
40+
paybuttonId: '688e9bfa-b887-11ee-a146-0242c0a88003'
41+
},
42+
{
43+
addressId: '688839eb-b887-11ee-a146-0242c0a88003',
44+
paybuttonId: '688e9bfa-b887-11ee-a146-0242c0a88003'
45+
},
46+
{
47+
addressId: '6888601e-b887-11ee-a146-0242c0a88003',
48+
paybuttonId: '688e9bfa-b887-11ee-a146-0242c0a88003'
49+
},
50+
{
51+
addressId: '6888610a-b887-11ee-a146-0242c0a88003',
52+
paybuttonId: '688e9bfa-b887-11ee-a146-0242c0a88003'
53+
},
54+
{
55+
addressId: '68886794-b887-11ee-a146-0242c0a88003',
56+
paybuttonId: '688e9bfa-b887-11ee-a146-0242c0a88003'
57+
},
58+
{
59+
addressId: '68886b53-b887-11ee-a146-0242c0a88003',
60+
paybuttonId: '688e9bfa-b887-11ee-a146-0242c0a88003'
61+
},
62+
{
63+
addressId: 'b15ff5e0-9e49-49d2-82a3-16f98035b4b7',
64+
paybuttonId: 'f03981ab-8ded-4aab-93e8-b1d38f9b219b'
65+
},
66+
{
67+
addressId: '30bd89d2-702b-403a-aad8-afb13f7aba9f',
68+
paybuttonId: 'f03981ab-8ded-4aab-93e8-b1d38f9b219b'
69+
},
70+
{
71+
addressId: 'd8e77bef-2acd-4fe8-9d9e-01409d3ea2bb',
72+
paybuttonId: 'f03981ab-8ded-4aab-93e8-b1d38f9b219b'
73+
},
74+
{
75+
addressId: '543706d7-d312-40ad-8355-3b26c4ff0944',
76+
paybuttonId: 'f03981ab-8ded-4aab-93e8-b1d38f9b219b'
77+
},
78+
{
79+
addressId: '8aa35eeb-b0e4-4092-b80d-53fcf3564bae',
80+
paybuttonId: 'f03981ab-8ded-4aab-93e8-b1d38f9b219b'
81+
},
82+
{
83+
addressId: '014cb04e-56e7-418f-b273-d603bba09760',
84+
paybuttonId: 'f03981ab-8ded-4aab-93e8-b1d38f9b219b'
85+
},
86+
{
87+
addressId: '4c054310-2e9c-4862-b234-6581c2ce30cf',
88+
paybuttonId: 'f03981ab-8ded-4aab-93e8-b1d38f9b219b'
89+
},
90+
{
91+
addressId: '09a177b0-3af4-48ae-a6e7-0fa25eeb31a9',
92+
paybuttonId: 'f03981ab-8ded-4aab-93e8-b1d38f9b219b'
93+
},
94+
{
95+
addressId: '6555787c-d347-4cec-9ea1-5f26d9b6683e',
96+
paybuttonId: 'f03981ab-8ded-4aab-93e8-b1d38f9b219b'
97+
},
98+
{
99+
addressId: 'c385d4e9-3e34-4657-b6cf-8e2221f4e8bd',
100+
paybuttonId: 'f03981ab-8ded-4aab-93e8-b1d38f9b219b'
33101
}
34102
]

prisma/seeds/paybuttons.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,5 +54,13 @@ export const paybuttons = [
5454
description: 'Paybutton for dev @chedieck',
5555
name: 'Estevão',
5656
buttonData: '{}'
57+
},
58+
{
59+
id: '688e9bfa-b887-11ee-a146-0242c0a88003',
60+
providerUserId: 'dev-uid',
61+
name: "Estevão's triggered Button",
62+
url: '',
63+
description: 'Paybutton with triggers for dev Estevão.',
64+
buttonData: '{}'
5765
}
5866
]

prisma/seeds/triggers.ts

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
export const paybuttonTriggers = [
2+
{
3+
id: '78f98695-b887-11ee-a146-0242c0a88003',
4+
paybuttonId: '688e9bfa-b887-11ee-a146-0242c0a88003',
5+
sendEmail: false,
6+
postData: `{
7+
"env": "dev",
8+
"OP_RETURN": <opReturn>,
9+
"name": <buttonName>,
10+
"address": <address>,
11+
"amount": <amount>,
12+
"timestamp": <timestamp>,
13+
"currency": <currency>,
14+
"secret": "06d1b75746d5be25f9ebb345a887c08698ebe0fe605b51c22c0c04fe57150f24"
15+
}`,
16+
postURL: 'http://192.168.128.1:3003/paymentReceived'
17+
}
18+
]
19+
// "secret" is to be used by staking; of course this value shouldn't be used in prod

0 commit comments

Comments
 (0)