-
Notifications
You must be signed in to change notification settings - Fork 0
/
transaction.go
55 lines (50 loc) · 1.53 KB
/
transaction.go
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
package model
import (
"time"
)
type (
HistoryRequest struct {
AccountID string
}
CreateTransactionRequest struct {
ID string
AccountID string
Type string
ReferenceID string `form:"reference_id" validate:"required,uuid" example:"49437636-fa79-40fb-b5cf-5f066235fddb"`
Amount float64 `form:"amount" validate:"required,gte=10000,lte=1000000000" example:"10000.00"`
Status string
}
WithdrawalResult struct {
Withdrawal WithdrawalResultWithdrawal `json:"withdrawal"`
}
WithdrawalResultWithdrawal struct {
ID string `json:"id"`
WithdrawnBy string `json:"withdrawn_by"`
Status string `json:"status"`
WithdrawnAt time.Time `json:"withdrawn_at"`
Amount float64 `json:"amount"`
ReferenceID string `json:"reference_id"`
}
DepositResult struct {
Deposit DepositResultDeposit `json:"deposit"`
}
DepositResultDeposit struct {
ID string `json:"id"`
DepositedBy string `json:"deposited_by"`
Status string `json:"status"`
DepositedAt time.Time `json:"deposited_at"`
Amount float64 `json:"amount"`
ReferenceID string `json:"reference_id"`
}
HistoryResult struct {
Transactions []*HistoryResultTransaction `json:"transactions"`
}
HistoryResultTransaction struct {
ID string `json:"id"`
ReferenceID string `json:"reference_id"`
Status string `json:"status"`
TransactedAt time.Time `json:"transacted_at"`
Type string `json:"type"`
Amount float64 `json:"amount"`
}
)