add display of offers on project page

This commit is contained in:
2023-11-19 19:44:11 -07:00
parent 0a618cc4ff
commit 607666a2f9
2 changed files with 79 additions and 6 deletions

View File

@@ -59,12 +59,22 @@ export interface GiveServerRecord {
unit: string;
}
export interface OfferServerRecord {
amount: number;
amountGiven: number;
offeredByDid: string;
recipientDid: string;
requirementsMet: boolean;
unit: string;
validThrough: string;
}
export interface GiveVerifiableCredential {
"@context"?: string; // optional when embedded, eg. in an Agree
"@type": "GiveAction";
agent?: { identifier: string };
description?: string;
fulfills?: { "@type": string; identifier: string };
fulfills?: { "@type": string; identifier?: string; lastClaimId?: string };
identifier?: string;
object?: { amountOfThisGood: number; unitCode: string };
recipient?: { identifier: string };
@@ -77,7 +87,7 @@ export interface OfferVerifiableCredential {
includesObject?: { amountOfThisGood: number; unitCode: string };
itemOffered?: {
description?: string;
isPartOf?: { handleId?: string; lastClaimId?: string; "@type"?: string };
isPartOf?: { identifier?: string; lastClaimId?: string; "@type"?: string };
};
offeredBy?: { identifier: string };
validThrough?: string;
@@ -242,7 +252,7 @@ export async function createAndSubmitOffer(
vcClaim.itemOffered = vcClaim.itemOffered || {};
vcClaim.itemOffered.isPartOf = {
"@type": "PlanAction",
handleId: fulfillsProjectHandleId,
identifier: fulfillsProjectHandleId,
};
}
return createAndSubmitClaim(