package resource

type ResourceGrantItem struct {
	GrantItemID          int64
	GrantID              string
	ResourceID           int64
	ResourceSnapshotJSON string
	Quantity             int64
	DurationMS           int64
	ResultType           string
	WalletTransactionID  string
	EntitlementID        string
	CreatedAtMS          int64
}

type ResourceGrant struct {
	AppCode          string
	GrantID          string
	CommandID        string
	TargetUserID     int64
	GrantSource      string
	GrantSubjectType string
	GrantSubjectID   string
	Status           string
	Reason           string
	OperatorUserID   int64
	RevokedAtMS      int64
	RevokedByUserID  int64
	RevokeReason     string
	Items            []ResourceGrantItem
	CreatedAtMS      int64
	UpdatedAtMS      int64
}

type GrantResourceCommand struct {
	AppCode        string
	CommandID      string
	TargetUserID   int64
	ResourceID     int64
	Quantity       int64
	DurationMS     int64
	Reason         string
	OperatorUserID int64
	GrantSource    string
}

type GrantResourceGroupCommand struct {
	AppCode        string
	CommandID      string
	TargetUserID   int64
	GroupID        int64
	Reason         string
	OperatorUserID int64
	GrantSource    string
}

type GrantPinnedResourceGroupCommand struct {
	AppCode              string
	CommandID            string
	TargetUserID         int64
	SnapshotID           string
	Reason               string
	OperatorUserID       int64
	GrantSource          string
	ExpectedSnapshotHash string
}

type RevokeResourceGrantCommand struct {
	AppCode        string
	RequestID      string
	GrantID        string
	Reason         string
	OperatorUserID int64
}

type ListResourceGrantsQuery struct {
	AppCode         string
	TargetUserID    int64
	Status          string
	OperatorUserIDs []int64
	GrantSource     string
	Page            int32
	PageSize        int32
}
