fix: Add creator_name field to the proposal model

This commit is contained in:
Mahmoud-Emad
2025-05-21 09:37:45 +03:00
parent 4c0c7be574
commit 5327d1f00c
3 changed files with 152 additions and 68 deletions

View File

@@ -102,7 +102,9 @@ impl Ballot {
#[model] // Has base.Base in V spec
pub struct Proposal {
pub base_data: BaseModelData,
pub creator_id: String, // User ID of the proposal creator
pub creator_id: String, // User ID of the proposal creator
pub creator_name: String, // User name of the proposal creator
pub title: String,
pub description: String,
pub status: ProposalStatus,
@@ -129,6 +131,7 @@ impl Proposal {
pub fn new(
id: Option<u32>,
creator_id: impl ToString,
creator_name: impl ToString,
title: impl ToString,
description: impl ToString,
vote_start_date: DateTime<Utc>,
@@ -142,6 +145,7 @@ impl Proposal {
Self {
base_data,
creator_id: creator_id.to_string(),
creator_name: creator_name.to_string(),
title: title.to_string(),
description: description.to_string(),
status: ProposalStatus::Draft,