2018-12-27 09:41:26 -08:00
|
|
|
import { Zat } from 'utils/units';
|
2018-10-04 21:27:02 -07:00
|
|
|
import { PROPOSAL_CATEGORY } from 'api/constants';
|
2019-01-09 13:57:15 -08:00
|
|
|
import { CreateMilestone, Update, User, Comment, ContributionWithUser } from 'types';
|
2018-12-27 09:41:26 -08:00
|
|
|
import { ProposalMilestone } from './milestone';
|
2018-10-04 21:27:02 -07:00
|
|
|
|
2018-11-16 08:16:52 -08:00
|
|
|
export interface TeamInvite {
|
|
|
|
id: number;
|
|
|
|
dateCreated: number;
|
|
|
|
address: string;
|
|
|
|
accepted: boolean | null;
|
|
|
|
}
|
|
|
|
|
2018-10-04 21:27:02 -07:00
|
|
|
export interface Contributor {
|
|
|
|
address: string;
|
2018-12-27 09:41:26 -08:00
|
|
|
contributionAmount: Zat;
|
2018-10-04 21:27:02 -07:00
|
|
|
refundVote: boolean;
|
|
|
|
refunded: boolean;
|
|
|
|
proportionalContribution: string;
|
|
|
|
milestoneNoVotes: boolean[];
|
|
|
|
}
|
|
|
|
|
2018-11-13 08:07:09 -08:00
|
|
|
export interface ProposalDraft {
|
|
|
|
proposalId: number;
|
|
|
|
dateCreated: number;
|
|
|
|
title: string;
|
2018-11-13 14:51:02 -08:00
|
|
|
brief: string;
|
2018-11-14 08:43:00 -08:00
|
|
|
category: PROPOSAL_CATEGORY;
|
2018-11-14 09:59:48 -08:00
|
|
|
content: string;
|
2018-11-13 08:07:09 -08:00
|
|
|
stage: string;
|
2018-11-14 08:43:00 -08:00
|
|
|
target: string;
|
|
|
|
payoutAddress: string;
|
|
|
|
deadlineDuration: number;
|
|
|
|
milestones: CreateMilestone[];
|
2018-11-16 15:05:17 -08:00
|
|
|
team: User[];
|
2018-11-16 08:16:52 -08:00
|
|
|
invites: TeamInvite[];
|
2019-01-09 10:23:08 -08:00
|
|
|
status: STATUS;
|
2018-11-13 08:07:09 -08:00
|
|
|
}
|
|
|
|
|
2018-12-27 09:41:26 -08:00
|
|
|
export interface Proposal extends Omit<ProposalDraft, 'target' | 'invites'> {
|
2018-11-07 09:33:19 -08:00
|
|
|
proposalAddress: string;
|
|
|
|
proposalUrlId: string;
|
2019-01-09 11:07:50 -08:00
|
|
|
target: Zat;
|
|
|
|
funded: Zat;
|
2018-12-27 10:00:04 -08:00
|
|
|
percentFunded: number;
|
2018-10-04 21:27:02 -07:00
|
|
|
milestones: ProposalMilestone[];
|
2019-01-09 10:23:08 -08:00
|
|
|
datePublished: number;
|
2018-10-04 21:27:02 -07:00
|
|
|
}
|
|
|
|
|
2018-11-16 11:17:09 -08:00
|
|
|
export interface TeamInviteWithProposal extends TeamInvite {
|
|
|
|
proposal: Proposal;
|
|
|
|
}
|
|
|
|
|
2018-10-04 21:27:02 -07:00
|
|
|
export interface ProposalComments {
|
2018-12-21 10:47:50 -08:00
|
|
|
proposalId: Proposal['proposalId'];
|
2018-10-04 21:27:02 -07:00
|
|
|
totalComments: number;
|
|
|
|
comments: Comment[];
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface ProposalUpdates {
|
2018-12-21 10:47:50 -08:00
|
|
|
proposalId: Proposal['proposalId'];
|
2018-10-04 21:27:02 -07:00
|
|
|
updates: Update[];
|
|
|
|
}
|
|
|
|
|
2019-01-09 12:48:41 -08:00
|
|
|
export interface ProposalContributions {
|
|
|
|
proposalId: Proposal['proposalId'];
|
|
|
|
top: ContributionWithUser[];
|
|
|
|
latest: ContributionWithUser[];
|
|
|
|
}
|
|
|
|
|
2018-10-04 21:27:02 -07:00
|
|
|
export interface UserProposal {
|
2018-11-07 09:33:19 -08:00
|
|
|
proposalId: number;
|
2019-01-09 10:23:08 -08:00
|
|
|
status: STATUS;
|
2018-10-04 21:27:02 -07:00
|
|
|
title: string;
|
|
|
|
brief: string;
|
2019-01-09 11:07:50 -08:00
|
|
|
funded: Zat;
|
|
|
|
target: Zat;
|
2019-01-09 10:23:08 -08:00
|
|
|
dateCreated: number;
|
|
|
|
dateApproved: number;
|
|
|
|
datePublished: number;
|
|
|
|
team: User[];
|
|
|
|
rejectReason: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
// NOTE: sync with backend/grant/proposal/models.py STATUSES
|
|
|
|
export enum STATUS {
|
|
|
|
DRAFT = 'DRAFT',
|
|
|
|
PENDING = 'PENDING',
|
|
|
|
APPROVED = 'APPROVED',
|
|
|
|
REJECTED = 'REJECTED',
|
|
|
|
LIVE = 'LIVE',
|
|
|
|
DELETED = 'DELETED',
|
2018-10-04 21:27:02 -07:00
|
|
|
}
|