A community based topic aggregation platform built on atproto
1package votes
2
3import (
4 "time"
5)
6
7// Vote represents a vote in the AppView database
8// Votes are indexed from the firehose after being written to user repositories
9type Vote struct {
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"`
13 URI string `json:"uri" db:"uri"`
14 CID string `json:"cid" db:"cid"`
15 RKey string `json:"rkey" db:"rkey"`
16 VoterDID string `json:"voterDid" db:"voter_did"`
17 SubjectURI string `json:"subjectUri" db:"subject_uri"`
18 SubjectCID string `json:"subjectCid" db:"subject_cid"`
19 Direction string `json:"direction" db:"direction"`
20 ID int64 `json:"id" db:"id"`
21}
22
23// VoteRecord represents the atProto record structure indexed from Jetstream
24// This is the data structure that gets stored in the user's repository
25type VoteRecord struct {
26 Type string `json:"$type"`
27 Subject StrongRef `json:"subject"`
28 Direction string `json:"direction"` // "up" or "down"
29 CreatedAt string `json:"createdAt"`
30}
31
32// StrongRef represents a strong reference to a record (URI + CID)
33// Matches the strongRef definition in the vote lexicon
34type StrongRef struct {
35 URI string `json:"uri"`
36 CID string `json:"cid"`
37}