-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathschema.graphql
79 lines (74 loc) · 1.56 KB
/
schema.graphql
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
type Loan @entity(immutable: true) {
id: ID!
loanId: BigInt
innitialLendAmount: BigInt
currentAvailableLendAmount: BigInt!
amountRepaid: BigInt
borrowerId: BigInt
interestRate: BigInt
loanOutDuration: BigInt
locked: Boolean
isActive: Boolean
lender: User
loanDurationInMonthCount: BigInt
}
type Borrow @entity(immutable: true) {
id: ID!
borrowerId: BigInt
borrower: User
innitialBorrowAmount: BigInt
currentBorrowAmount: BigInt
amountAlreadyRemitted: BigInt
deadline: BigInt
interest: BigInt
lenderId: BigInt
lender: User!
nftCollateralTokenId: BigInt
receiverAddress: User
isApproved: Boolean
isRepaid: Boolean
}
type Asset @entity(immutable: true) {
id: ID!
tokenId: BigInt! # uint256
owner: User
title: String
description: String
tokenId: BigInt
price: BigInt
assetURI: String
revenue: BigInt
expenses: BigInt
traffic: BigInt
productLink: String
isFrozen: Boolean
ownerEmail: String
isCollateral: Boolean
}
type Auction @entity(immutable: true) {
id: ID!
auctionId: BigInt!
tokenId: BigInt!
seller: User
startTime: BigInt
endTime: BigInt
reservePrice: BigInt
started: Boolean
resulted: Boolean
buyer: User
confirmed: Boolean
}
type Bid @entity(immutable: true) {
id: ID!
bid: BigInt
bidder: User
bidTime: BigInt
auctionId: BigInt
}
type User @entity(immutable: true){
id: ID!
loans: [Loan!] @derivedFrom(field: "lender")
borrows: [Borrow!] @derivedFrom(field: "borrower")
assets: [Asset!] @derivedFrom(field: "owner")
bids: [Bid!] @derivedFrom(field: "bidder")
}