Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions features/bounties/api/participant-dashboard-client.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/**
* Builder "my bounties" dashboard reads (boundless-nestjs #332).
*
* These endpoints aren't in the generated OpenAPI schema yet, so they go through
* the legacy axios `api` (cookie auth, `{ success, data }` envelope) rather than
* the typed openapi-fetch client. Swap to the typed client + generated types once
* #332 lands and `npm run codegen` runs. Until the backend ships, calls 404 and
* the hooks degrade to empty.
* The row/page shapes are now generated from the OpenAPI schema (see
* `MyBountyApplicationRow` / `MyBountySubmissionRow` in ../types). Transport
* still goes through the legacy axios `api` (cookie auth, `{ success, data }`
* envelope) because these routes return the enveloped payload; the hooks degrade
* to empty if the backend is unreachable.
*/
import { api } from '@/lib/api/api';

Expand Down
3 changes: 1 addition & 2 deletions features/bounties/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,7 @@ export type {

// ── Builder / participant data layer (#621) ──────────────────────────────────

// Participant types (aliased from the generated schema; MyBountyApplication is
// hand-typed until boundless-nestjs #331 lands and codegen runs).
// Participant types (all aliased from the generated schema).
export type {
BountyPublic,
BountyPublicList,
Expand Down
85 changes: 15 additions & 70 deletions features/bounties/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,80 +95,25 @@ export type CreateBountyApplicationRequest =
export type EditBountyApplicationRequest = Schemas['EditBountyApplicationDto'];
export type JoinCompetitionRequest = Schemas['JoinCompetitionDto'];

/**
* The caller's own application for a bounty (GET …/v2/applications/me).
*
* The backend `BountyApplicationResponseDto` (boundless-nestjs #331) is not yet
* in the generated schema, so this is hand-typed to its shape. Replace with
* `Schemas['BountyApplicationResponseDto']` after that lands and codegen runs.
*/
export type BountyApplicationStatus =
| 'SUBMITTED'
| 'SHORTLISTED'
| 'SELECTED'
| 'DECLINED'
| 'WITHDRAWN';

export interface MyBountyApplication {
id: string;
bountyId: string;
applicantAddress: string;
status: string;
applicationStatus: BountyApplicationStatus | null;
proposalShort: string | null;
proposalFull: string | null;
portfolioLinks: string[];
estimatedDays: number | null;
qualifications: string | null;
videoIntroUrl: string | null;
declineReason: string | null;
shortlistedAt: string | null;
selectedAt: string | null;
declinedAt: string | null;
withdrawnAt: string | null;
createdAt: string;
updatedAt: string;
}
/** The caller's own application for a bounty (GET …/v2/applications/me). */
export type MyBountyApplication = Schemas['BountyApplicationResponseDto'];

/**
* Cross-bounty "my activity" dashboard rows (boundless-nestjs #332). These
* endpoints (`/bounties/me/applications`, `/bounties/me/submissions`) are not
* yet in the generated schema, so the rows are hand-typed to the backend DTOs.
* Swap to `Schemas[...]` once #332 lands and codegen runs.
*/
export interface BountyActivitySummary {
id: string;
title: string;
status: string;
entryType: BountyEntryType | null;
claimType: BountyClaimType | null;
rewardCurrency: string;
deadline: string | null;
}
/** Application lifecycle status (derived from the generated DTO enum). */
export type BountyApplicationStatus = NonNullable<
MyBountyApplication['applicationStatus']
>;

export interface MyBountyApplicationRow {
id: string;
applicationStatus: BountyApplicationStatus | null;
status: string;
createdAt: string;
updatedAt: string;
bounty: BountyActivitySummary;
}
// ── Cross-bounty "my activity" dashboard ──────────────────────────────────────
// GET /bounties/me/applications and /bounties/me/submissions.

export interface MyBountySubmissionRow {
id: string;
status: string;
escrowAnchorStatus: string | null;
githubPullRequestUrl: string | null;
tierPosition: number | null;
tierAmount: string | null;
rewardTransactionHash: string | null;
paidAt: string | null;
createdAt: string;
updatedAt: string;
bounty: BountyActivitySummary;
}
/** Compact bounty summary embedded in each activity row. */
export type BountyActivitySummary = Schemas['BountySummaryDto'];
/** A row in the "my applications" activity list. */
export type MyBountyApplicationRow = Schemas['MyBountyApplicationRowDto'];
/** A row in the "my submissions" activity list. */
export type MyBountySubmissionRow = Schemas['MyBountySubmissionRowDto'];

/** Generic paginated activity envelope (items + page meta). */
export interface BountyActivityPage<T> {
items: T[];
total: number;
Expand Down
Loading