···
// Vote represents a vote in the AppView database
// Votes are indexed from the firehose after being written to user repositories
10
-
ID int64 `json:"id" db:"id"`
10
+
CreatedAt time.Time `json:"createdAt" db:"created_at"`
11
+
IndexedAt time.Time `json:"indexedAt" db:"indexed_at"`
12
+
DeletedAt *time.Time `json:"deletedAt,omitempty" db:"deleted_at"`
URI string `json:"uri" db:"uri"`
CID string `json:"cid" db:"cid"`
RKey string `json:"rkey" db:"rkey"`
VoterDID string `json:"voterDid" db:"voter_did"`
SubjectURI string `json:"subjectUri" db:"subject_uri"`
SubjectCID string `json:"subjectCid" db:"subject_cid"`
17
-
Direction string `json:"direction" db:"direction"` // "up" or "down"
18
-
CreatedAt time.Time `json:"createdAt" db:"created_at"`
19
-
IndexedAt time.Time `json:"indexedAt" db:"indexed_at"`
20
-
DeletedAt *time.Time `json:"deletedAt,omitempty" db:"deleted_at"`
19
+
Direction string `json:"direction" db:"direction"`
20
+
ID int64 `json:"id" db:"id"`
23
-
// CreateVoteRequest represents input for creating a new vote
24
-
// Matches social.coves.interaction.createVote lexicon input schema
25
-
type CreateVoteRequest struct {
26
-
Subject string `json:"subject"` // AT-URI of post/comment
27
-
Direction string `json:"direction"` // "up" or "down"
30
-
// CreateVoteResponse represents the response from creating a vote
31
-
// Matches social.coves.interaction.createVote lexicon output schema
32
-
type CreateVoteResponse struct {
33
-
URI string `json:"uri"` // AT-URI of created vote record
34
-
CID string `json:"cid"` // CID of created vote record
35
-
Existing *string `json:"existing,omitempty"` // AT-URI of existing vote if updating
38
-
// DeleteVoteRequest represents input for deleting a vote
39
-
// Matches social.coves.interaction.deleteVote lexicon input schema
40
-
type DeleteVoteRequest struct {
41
-
Subject string `json:"subject"` // AT-URI of post/comment
44
-
// VoteRecord represents the actual atProto record structure written to PDS
23
+
// VoteRecord represents the atProto record structure indexed from Jetstream
// This is the data structure that gets stored in the user's repository
47
-
Type string `json:"$type"`
48
-
Subject StrongRef `json:"subject"`
49
-
Direction string `json:"direction"` // "up" or "down"
50
-
CreatedAt string `json:"createdAt"`
26
+
Type string `json:"$type"`
27
+
Subject StrongRef `json:"subject"`
28
+
Direction string `json:"direction"` // "up" or "down"
29
+
CreatedAt string `json:"createdAt"`
// StrongRef represents a strong reference to a record (URI + CID)