Skip to content

Commit d517479

Browse files
committed
basic wip schema additions
1 parent 9df5a52 commit d517479

File tree

1 file changed

+99
-0
lines changed

1 file changed

+99
-0
lines changed

prisma/schema.prisma

Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,7 @@ model User {
149149
DirectPaymentReceived DirectPayment[] @relation("DirectPaymentReceived")
150150
DirectPaymentSent DirectPayment[] @relation("DirectPaymentSent")
151151
UserSubTrust UserSubTrust[]
152+
PayIn PayIn[]
152153
153154
@@index([photoId])
154155
@@index([createdAt], map: "users.created_at_index")
@@ -1293,3 +1294,101 @@ enum LogLevel {
12931294
ERROR
12941295
SUCCESS
12951296
}
1297+
1298+
enum PayInType {
1299+
BUY_CREDITS
1300+
ITEM_CREATE
1301+
ITEM_UPDATE
1302+
ZAP
1303+
DOWN_ZAP
1304+
BOOST
1305+
DONATE
1306+
POLL_VOTE
1307+
INVITE_GIFT
1308+
TERRITORY_CREATE
1309+
TERRITORY_UPDATE
1310+
TERRITORY_BILLING
1311+
TERRITORY_UNARCHIVE
1312+
PROXY_PAYMENT
1313+
REWARDS
1314+
}
1315+
1316+
enum PayInState {
1317+
PENDING
1318+
PENDING_HELD
1319+
HELD
1320+
PAID
1321+
FAILED
1322+
FORWARDING
1323+
FORWARDED
1324+
FAILED_FORWARD
1325+
CANCELING
1326+
}
1327+
1328+
model PayIn {
1329+
id Int @id @default(autoincrement())
1330+
createdAt DateTime @default(now()) @map("created_at")
1331+
updatedAt DateTime @default(now()) @updatedAt @map("updated_at")
1332+
cost Int
1333+
1334+
payInType PayInType
1335+
payInState PayInState
1336+
userId Int
1337+
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
1338+
1339+
mcreditsAfter BigInt
1340+
msatsAfter BigInt
1341+
1342+
PayMethod PayMethod[]
1343+
PessimisticEnv PessimisticEnv[]
1344+
PayOut PayOut[]
1345+
1346+
@@index([userId])
1347+
@@index([payInType])
1348+
}
1349+
1350+
enum PayInMethodType {
1351+
COWBOY_CREDITS
1352+
REWARD_SATS
1353+
}
1354+
1355+
model PayMethod {
1356+
id Int @id @default(autoincrement())
1357+
payId Int
1358+
payIn PayIn @relation(fields: [payId], references: [id], onDelete: Cascade)
1359+
msats BigInt
1360+
payMethodType PayInMethodType
1361+
}
1362+
1363+
model PessimisticEnv {
1364+
id Int @id @default(autoincrement())
1365+
payInId Int
1366+
payIn PayIn @relation(fields: [payInId], references: [id], onDelete: Cascade)
1367+
1368+
args Json? @db.JsonB
1369+
result Json? @db.JsonB
1370+
error String?
1371+
}
1372+
1373+
enum PayOutType {
1374+
TERRITORY_REVENUE
1375+
REWARDS_POOL
1376+
PROXY_PAYMENT_RECEIVE
1377+
ZAP_RECEIVE
1378+
REWARDS_RECEIVE
1379+
INVITE_GIFT_RECEIVE
1380+
}
1381+
1382+
model PayOut {
1383+
id Int @id @default(autoincrement())
1384+
createdAt DateTime @default(now()) @map("created_at")
1385+
updatedAt DateTime @default(now()) @updatedAt @map("updated_at")
1386+
userId Int
1387+
payInId Int
1388+
payIn PayIn @relation(fields: [payInId], references: [id], onDelete: Cascade)
1389+
msats BigInt
1390+
payOutType PayOutType
1391+
1392+
msatsAfter BigInt
1393+
mcreditsAfter BigInt
1394+
}

0 commit comments

Comments
 (0)