import { GiveActionClaim, OfferClaim } from "./claims";

// a summary record; the VC is found the fullClaim field
export interface GiveSummaryRecord {
  [x: string]: PropertyKey | undefined | GiveActionClaim;
  type?: string;
  agentDid: string;
  amount: number;
  amountConfirmed: number;
  description: string;
  fullClaim: GiveActionClaim;
  fulfillsHandleId: string;
  fulfillsPlanHandleId?: string;
  fulfillsType?: string;
  handleId: string;
  issuedAt: string;
  issuerDid: string;
  jwtId: string;
  providerPlanHandleId?: string;
  recipientDid: string;
  unit: string;
}

// a summary record; the VC is found the fullClaim field
export interface OfferSummaryRecord {
  amount: number;
  amountGiven: number;
  amountGivenConfirmed: number;
  fullClaim: OfferClaim;
  fulfillsPlanHandleId: string;
  handleId: string;
  issuerDid: string;
  jwtId: string;
  nonAmountGivenConfirmed: number;
  objectDescription: string;
  offeredByDid: string;
  recipientDid: string;
  requirementsMet: boolean;
  unit: string;
  validThrough: string;
}

export interface OfferToPlanSummaryRecord extends OfferSummaryRecord {
  planName: string;
}

// a summary record; the VC is not currently part of this record
export interface PlanSummaryRecord {
  agentDid?: string;
  description: string;
  endTime?: string;
  fulfillsPlanHandleId: string;
  handleId: string;
  image?: string;
  issuerDid: string;
  locLat?: number;
  locLon?: number;
  name?: string;
  startTime?: string;
  url?: string;
  jwtId?: string;
}

/**
 * Represents data about a project
 *
 * @deprecated
 * (Maybe we should use PlanSummaryRecord instead, either by adding rowId or by iterating with jwtId.)
 **/
export interface PlanData {
  /**
   * Description of the project
   **/
  description: string;
  /**
   * URL referencing information about the project
   **/
  handleId: string;
  image?: string;
  /**
   * The DID of the issuer
   */
  issuerDid: string;
  /**
   * Name of the project
   **/
  name: string;
  /**
   * The identifier of the project record -- different from jwtId
   * (Maybe we should use the jwtId to iterate through the records instead.)
   **/
  rowId?: string;
}
