import type { OpportunityFeedbackRecord } from "@/features/opportunities/permissionRecord";

/** Flat reviewer identity and rating returned by OpportunityFeedbackResource. */
export type Feedback = OpportunityFeedbackRecord;

/**
 * The review being written. Client-only — the form's two fields, before they
 * become the `rating` / `comment_en` or `comment_ar` the endpoint takes.
 */
export interface FeedbackDraft {
  /** Set when editing an existing review; absent when writing a new one. */
  id?: number;
  rating: number;
  comment: string;
}

export const emptyDraft: FeedbackDraft = { rating: 0, comment: "" };

/**
 * Reviews for a learn & serve opportunity. Only attendees who haven't reviewed
 * yet get the "share your review" affordance; everyone can read.
 */
