68 lines
1.3 KiB
Go
68 lines
1.3 KiB
Go
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
|
|
}
|
|
|
|
|