devhub_shared/rfp/
timeline.rs

1use near_sdk::near;
2
3#[near(serializers=[borsh, json])]
4#[derive(Clone)]
5#[serde(tag = "status", rename_all = "SCREAMING_SNAKE_CASE")]
6pub enum TimelineStatus {
7    AcceptingSubmissions,
8    Evaluation,
9    ProposalSelected,
10    Cancelled,
11}
12
13impl TimelineStatus {
14    pub fn is_accepting_submissions(&self) -> bool {
15        matches!(self, TimelineStatus::AcceptingSubmissions)
16    }
17
18    pub fn is_cancelled(&self) -> bool {
19        matches!(self, TimelineStatus::Cancelled)
20    }
21
22    pub fn is_proposal_selected(&self) -> bool {
23        matches!(self, TimelineStatus::ProposalSelected)
24    }
25}