diff --git a/plugin/deps.go b/plugin/deps.go index 29d7643..20d8719 100644 --- a/plugin/deps.go +++ b/plugin/deps.go @@ -48,6 +48,7 @@ type ServiceDeps struct { // Core RPC services — pre-built bindings for CMS-provided services CoreServiceBindings CoreServiceBindings + ReviewSubmitter ReviewSubmitter // Extension points — typed as narrow interfaces where possible JobRunner JobRunner diff --git a/plugin/reviews.go b/plugin/reviews.go new file mode 100644 index 0000000..4592f3e --- /dev/null +++ b/plugin/reviews.go @@ -0,0 +1,23 @@ +package plugin + +import ( + "context" + + "github.com/google/uuid" +) + +// ReviewSubmitter allows plugins to submit community reviews programmatically +// without importing CMS proto types. +type ReviewSubmitter interface { + SubmitReview(ctx context.Context, params SubmitReviewParams) (reviewID string, err error) +} + +// SubmitReviewParams contains the fields needed to submit a community review. +type SubmitReviewParams struct { + TableID uuid.UUID + RowID uuid.UUID + OverallRating int32 + ReviewText string + Ratings map[string]any + Photos []string +}