feat(t207): audit local procurement results
This commit is contained in:
@@ -0,0 +1,58 @@
|
||||
package usecase
|
||||
|
||||
import (
|
||||
"context"
|
||||
"time"
|
||||
|
||||
"cmroubao/backend-api/internal/domain"
|
||||
)
|
||||
|
||||
type ExecutionResultAuthorization struct {
|
||||
UserID string
|
||||
DeviceID string
|
||||
TaskID string
|
||||
ExecutionID string
|
||||
ClaimGeneration int64
|
||||
ClaimTokenHash string
|
||||
}
|
||||
|
||||
type ExecutionResultWrite struct {
|
||||
ExecutionResultAuthorization
|
||||
Operation string
|
||||
IdempotencyKey string
|
||||
RequestHash string
|
||||
Now time.Time
|
||||
}
|
||||
|
||||
type ExecutionResultRepository interface {
|
||||
AppendExecutionEvents(
|
||||
context.Context,
|
||||
ExecutionResultWrite,
|
||||
[]domain.ExecutionEvent,
|
||||
) (bool, error)
|
||||
CreateExecutionEvidence(
|
||||
context.Context,
|
||||
ExecutionResultWrite,
|
||||
domain.ExecutionEvidenceAsset,
|
||||
) (domain.ExecutionEvidenceAsset, bool, error)
|
||||
StoreExecutionCandidates(
|
||||
context.Context,
|
||||
ExecutionResultWrite,
|
||||
domain.ExecutionCandidateBatch,
|
||||
) (bool, error)
|
||||
CompleteExecution(
|
||||
context.Context,
|
||||
ExecutionResultWrite,
|
||||
domain.ExecutionOutcome,
|
||||
) (domain.PurchaseTask, bool, error)
|
||||
FailExecution(
|
||||
context.Context,
|
||||
ExecutionResultWrite,
|
||||
domain.ExecutionOutcome,
|
||||
) (domain.PurchaseTask, bool, error)
|
||||
GetExecutionEvidence(
|
||||
context.Context,
|
||||
string,
|
||||
string,
|
||||
) (domain.ExecutionEvidenceAsset, error)
|
||||
}
|
||||
Reference in New Issue
Block a user