diff --git a/migrations/009_initreports.down.sql b/migrations/009_initreports.down.sql new file mode 100644 index 0000000..8e3fa8a --- /dev/null +++ b/migrations/009_initreports.down.sql @@ -0,0 +1 @@ +DROP TABLE IF EXISTS reports; diff --git a/migrations/009_initreports.up.sql b/migrations/009_initreports.up.sql new file mode 100644 index 0000000..5e86e78 --- /dev/null +++ b/migrations/009_initreports.up.sql @@ -0,0 +1,8 @@ +CREATE TABLE reports ( + id SERIAL primary key, + uri TEXT NOT NULL, + reason TEXT NOT NULL, + did TEXT, + addr TEXT, + posted_at TIMESTAMPTZ NOT NULL DEFAULT NOW(), +); diff --git a/server/internal/types/report.go b/server/internal/types/report.go new file mode 100644 index 0000000..1468be6 --- /dev/null +++ b/server/internal/types/report.go @@ -0,0 +1,24 @@ +package types + +import ( + "time" +) + +type ReportRequest struct { + URI string `json:"uri"` + Reason string `json:"reason"` +} + +type AnonReport struct { + Addr string `json:"addr"` + URI string `json:"uri"` + Reason string `json:"reason"` + ReportedAt time.Time `json:"reportedAt"` +} + +type AuthReport struct { + DID string `json:"did"` + URI string `json:"uri"` + Reason string `json:"reason"` + ReportedAt time.Time `json:"reportedAt"` +}