Skip to content

FE: features/bounties data layer (types, keys, draft + escrow clients/hooks) #596

Description

@0xdevcollins

Context

Part of the Bounty Configure (Host a Bounty) milestone. Adds the features/bounties/ data layer for the v1 app, mirroring features/hackathons/. The app is REST-only (openapi-fetch + axios; no GraphQL).

Note: the bounty escrow paths/DTOs are already in lib/api/generated/schema.d.ts, so the escrow client can be built now. The bounty draft paths arrive after the backend draft controller lands and codegen is re-run.

Blueprint to mirror

  • features/hackathons/types.ts, api/keys.ts, api/draft-client.ts, api/use-draft.ts, api/escrow-client.ts, api/use-escrow.ts

Tasks

  • features/bounties/types.ts: alias the generated schema (BountyDraft, UpdateBountyDraftBody, section types, PublishBountyEscrowRequest, BountyEscrowOpResponse, FundingMode, terminal-status helpers).
  • features/bounties/api/keys.ts: bountyKeys factory.
  • features/bounties/api/draft-client.ts + use-draft.ts: useDraft / useDraftList / useCreateDraft / useUpdateDraft / useDeleteDraft against /api/organizations/{organizationId}/bounties/draft[/{id}] and /drafts.
  • features/bounties/api/escrow-client.ts + use-escrow.ts: wrap the bounty escrow paths and reuse the hackathon useEscrowOpRunner / useEscrowOp machinery (only the scope shape and the usePublishBountyEscrow wrapper differ).
  • features/bounties/index.ts: public surface.

Acceptance criteria

  • Hooks typecheck against the generated schema.
  • Escrow client compiles against the existing bounty escrow paths.

Depends on

  • Backend draft controller + codegen (for the draft types). Escrow portion is unblocked.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions