initial commit
This commit is contained in:
38
internal/domain/purchase/purchased_asset.go
Normal file
38
internal/domain/purchase/purchased_asset.go
Normal file
@@ -0,0 +1,38 @@
|
||||
package purchase
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"time"
|
||||
|
||||
"github.com/google/uuid"
|
||||
)
|
||||
|
||||
//go:generate stringer -type=PurchaseStatus
|
||||
type PurchaseStatus int
|
||||
|
||||
const (
|
||||
PurchaseStatusPending PurchaseStatus = iota
|
||||
PurchaseStatusCompleted
|
||||
PurchaseStatusFailed
|
||||
PurchaseStatusRefunded
|
||||
)
|
||||
|
||||
type PurchasedAsset struct {
|
||||
ID uuid.UUID
|
||||
UserID uuid.UUID
|
||||
Asset PurchasedAssetInfo
|
||||
PurchaseDate time.Time
|
||||
PurchasePrice int // in cents or smallest currency unit
|
||||
PurchaseCurrency string
|
||||
PurchaseStatus PurchaseStatus
|
||||
PurchaseReceipt string
|
||||
}
|
||||
|
||||
type PurchasedAssetInfo struct {
|
||||
ID uuid.UUID
|
||||
Name string
|
||||
Description string
|
||||
RestOfFields json.RawMessage
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user