koprogo_api/application/dto/
board_member_dto.rs1use serde::{Deserialize, Serialize};
2use validator::Validate;
3
4#[derive(Debug, Serialize, Deserialize, Validate, Clone)]
7pub struct CreateBoardMemberDto {
8 pub owner_id: String, pub building_id: String, #[validate(length(min = 1, message = "Position cannot be empty"))]
13 pub position: String, pub mandate_start: String, pub mandate_end: String, pub elected_by_meeting_id: String, }
21
22#[derive(Debug, Serialize, Deserialize, Validate, Clone)]
24pub struct RenewMandateDto {
25 pub new_elected_by_meeting_id: String, }
27
28#[derive(Debug, Serialize, Deserialize, Clone)]
30pub struct BoardMemberResponseDto {
31 pub id: String,
32 pub owner_id: String, pub building_id: String,
34 pub position: String,
35 pub mandate_start: String,
36 pub mandate_end: String,
37 pub elected_by_meeting_id: String,
38 pub is_active: bool, pub days_remaining: i64, pub expires_soon: bool, pub created_at: String,
42 pub updated_at: String,
43}
44
45#[derive(Debug, Serialize, Deserialize, Clone)]
47pub struct BoardStatsDto {
48 pub building_id: String,
49 pub total_members: i64,
50 pub active_members: i64,
51 pub expiring_soon: i64, pub has_president: bool,
53 pub has_treasurer: bool,
54}