61 lines
1.7 KiB
Go
61 lines
1.7 KiB
Go
// Package taskdetail provides a read-only audit projection for one task.
|
|
package taskdetail
|
|
|
|
import (
|
|
"context"
|
|
"errors"
|
|
"time"
|
|
)
|
|
|
|
var ErrNotFound = errors.New("task detail not found")
|
|
|
|
type Store interface {
|
|
Get(context.Context, string) (Detail, error)
|
|
}
|
|
|
|
type Detail struct {
|
|
Task Task
|
|
Authorizations []Authorization
|
|
Attempts []Attempt
|
|
Submissions []Submission
|
|
Evidence []Evidence
|
|
}
|
|
|
|
type Task struct {
|
|
ID, Source, Title, GoodsID, SKUColor, SKUSize, MaxTotalPrice, Status string
|
|
Quantity, Version int
|
|
CreatedAt, UpdatedAt time.Time
|
|
}
|
|
|
|
type Authorization struct {
|
|
ID, Status, CreatedBy, TotalPriceCap string
|
|
TaskVersion int
|
|
CreatedAt, ExpiresAt time.Time
|
|
}
|
|
|
|
type Attempt struct {
|
|
ID, AuthorizationID, Status string
|
|
ClaimGeneration int
|
|
Gate1UnitPrice *string
|
|
Gate2UnitPrice *string
|
|
QuantityRead *int
|
|
ConfirmAmount *string
|
|
FailureCode *string
|
|
StartedAt time.Time
|
|
FinishedAt *time.Time
|
|
}
|
|
|
|
type Submission struct {
|
|
ID, AuthorizationID, AttemptID, Status string
|
|
Gate1UnitPrice, Gate2UnitPrice, ConfirmAmount string
|
|
QuantityRead int
|
|
CreatedAt time.Time
|
|
ResolvedAt *time.Time
|
|
}
|
|
|
|
type Evidence struct {
|
|
ID, AttemptID, Kind, PrivacyTier, SHA256, ContentType string
|
|
ByteSize, Width, Height int64
|
|
CapturedAt time.Time
|
|
}
|