hapi_core/state/case.rs
1use anchor_lang::prelude::*;
2
3#[account]
4pub struct Case {
5 /// Community account, which this case belongs to
6 pub community: Pubkey,
7
8 /// Seed bump for PDA
9 pub bump: u8,
10
11 /// Sequantial case ID
12 pub id: u64,
13
14 /// Case reporter's account
15 pub reporter: Pubkey,
16
17 /// Case status
18 pub status: CaseStatus,
19
20 /// Short case description
21 pub name: [u8; 32],
22}
23
24#[derive(Clone, PartialEq, AnchorDeserialize, AnchorSerialize)]
25pub enum CaseStatus {
26 Closed = 0,
27 Open = 1,
28}
29
30impl Default for CaseStatus {
31 fn default() -> Self {
32 CaseStatus::Open
33 }
34}