-
Notifications
You must be signed in to change notification settings - Fork 0
/
jhipster-jdl.jdl
executable file
·81 lines (66 loc) · 2.42 KB
/
jhipster-jdl.jdl
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
80
81
/** Central table to persist transaction details. All holdings will be derived from it with help of BitcoinJ. */
entity TestWebsocket {
initiatedAt Instant required /** TestWebsocket initiated at */
transactionType TransactionType /** TestWebsocket enum type */
txHash String unique /** TestWebsocket hash */
expectedAmount Long /** Expected BTC amount from the customer */
actualAmount Long /** Actual BTC amount of the transaction */
transactionFee Long /** BTC transaction fee */
serviceFee Long /** Service fee */
btcUsd Double /** BTC price at intiation */
}
enum TransactionType {
INCOMING_UNKNOWN, INCOMING_CUSTOMER, FORWARD_MERCHANT, FORWARD_HOLDINGS
}
/** Store history of a Trasaction confidence */
entity Confidence {
changeAt Instant required
confidenceType ConfidenceType required /** Current state of a transaction */
confirmations Integer min(0) max(6) required /** Amount of confirmations through new blocks */
}
/** Confidence types defined by BitcoinJ */
enum ConfidenceType {
INCOMING, BUILDING, DEAD, UNKNOWN, CONFIRMED
}
/** Merchant informations */
entity Merchant {
name String required unique /** Merchant name */
email String required pattern(/^[^@\s]+@[^@\s]+\.[^@\s]+$/)
}
/** Associated Merchant Fee */
entity Fee {
feeType FeeType required /** Fees can be ZERO, LOW, HIGH */
percent BigDecimal required /** Percentage for a small amount transaction */
percentSecure BigDecimal required /** Percentage for a high amount transaction */
}
enum FeeType {
ZERO, LOW, HIGH
}
entity MerchantUser {}
relationship OneToOne {
/** One Merchant has One Fee associated */
Merchant{fee} to Fee
MerchantUser{user} to User
}
relationship OneToMany {
/** One TestWebsocket has Many Confidence entries */
TestWebsocket to Confidence{transaction},
/** One Merchant has Many Users */
Merchant to MerchantUser{merchant}
}
relationship ManyToOne {
/** Many TestWebsocket can be done by One User */
TestWebsocket{user} to User,
/** Many TestWebsocket can be done by One Merchant */
TestWebsocket{merchant} to Merchant
}
// Set pagination options
// paginate TestWebsocket, Block, Confidence with infinite-scroll
paginate TestWebsocket, Confidence with pagination
// Use Data Transfer Objects (DTO)
dto * with mapstruct
// Set service options
// Fee, Merchant, Confidence will also be serviceImpl
service * with serviceImpl
// Set an angular suffix
// angularSuffix * with mySuffix