initial commit
This commit is contained in:
67
internal/domain/purchase/booked_service.go
Normal file
67
internal/domain/purchase/booked_service.go
Normal file
@@ -0,0 +1,67 @@
|
||||
package purchase
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"time"
|
||||
|
||||
"github.com/google/uuid"
|
||||
)
|
||||
|
||||
//go:generate stringer -type=BookingStatus
|
||||
type BookingStatus int
|
||||
|
||||
const (
|
||||
BookingStatusPending BookingStatus = iota
|
||||
BookingStatusConfirmed
|
||||
BookingStatusCancelled
|
||||
BookingStatusCompleted
|
||||
BookingStatusRescheduled
|
||||
)
|
||||
|
||||
type BookedService struct {
|
||||
ID uuid.UUID
|
||||
UserID uuid.UUID
|
||||
Service BookedServiceInfo
|
||||
BookingDate time.Time
|
||||
BookingPrice int // in cents or smallest currency unit
|
||||
BookingCurrency string
|
||||
BookingStatus BookingStatus
|
||||
BookingReceipt string
|
||||
HostUser UserInfo
|
||||
GuestUser UserInfo
|
||||
RescheduleHistory []RescheduleHistory
|
||||
}
|
||||
|
||||
type BookedServiceInfo struct {
|
||||
ID uuid.UUID
|
||||
Name string
|
||||
Description string
|
||||
RestOfFields json.RawMessage
|
||||
}
|
||||
|
||||
type UserInfo struct {
|
||||
ID uuid.UUID
|
||||
Name string
|
||||
Description string
|
||||
RestOfFields json.RawMessage
|
||||
}
|
||||
|
||||
type RescheduleHistory struct {
|
||||
ID uuid.UUID
|
||||
BookedServiceID uuid.UUID
|
||||
RequestedBy UserInfo
|
||||
RequestedTo UserInfo
|
||||
RequestedAt time.Time
|
||||
Status string
|
||||
Reason string
|
||||
Notes string
|
||||
Attachments []RescheduleAttachment
|
||||
}
|
||||
|
||||
type RescheduleAttachment struct {
|
||||
ID uuid.UUID
|
||||
URL string
|
||||
Type string
|
||||
}
|
||||
|
||||
|
||||
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