Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/step_cli_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,4 +56,4 @@ jobs:
uses: actions/upload-artifact@v4
with:
name: step-cli-binary
path: packages/step-cli/rust-local-target/x86_64-unknown-linux-musl/release/seq
path: packages/step-cli/rust-local-target/x86_64-unknown-linux-musl/release/step-cli
8 changes: 8 additions & 0 deletions packages/sequent-core/src/util/external_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,14 @@ pub struct GenerateVoters {
pub overseas_reference: String,
pub min_age: i64,
pub max_age: i64,
#[serde(default)]
pub authorized_elections_count: i64,
#[serde(default = "default_email_verified")]
pub email_verified: bool,
}

fn default_email_verified() -> bool {
true
}

#[derive(Debug, Serialize, Deserialize)]
Expand Down
2 changes: 1 addition & 1 deletion packages/step-cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -42,5 +42,5 @@ colored = "3.0"
url = "2"

[[bin]]
name = "cli"
name = "step-cli"
path = "src/main.rs"
Binary file modified packages/step-cli/rust-local-target/release/step-cli
Binary file not shown.
1 change: 1 addition & 0 deletions packages/step-cli/src/commands/create_contest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ fn create_contest(
)]));

let variables = insert_contest::Variables {
name: name.to_string(),
description: Some(description.to_string()),
election_event_id: election_event_id.to_string(),
election_id: election_id.to_string(),
Expand Down
46 changes: 1 addition & 45 deletions packages/step-cli/src/types/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,10 @@
//
// SPDX-License-Identifier: AGPL-3.0-only

use serde::{Deserialize, Serialize};

pub use sequent_core::util::external_config::{
DuplicateVotes, ExternalConfigData, GenerateApplications, GenerateVoters,
};
use serde::{Deserialize, Serialize};

#[derive(Serialize, Deserialize)]
pub struct ConfigData {
Expand All @@ -19,46 +18,3 @@ pub struct ConfigData {
pub client_secret: String,
pub username: String,
}

#[derive(Debug, Serialize, Deserialize)]
pub struct ExternalConfigData {
pub election_event_json_file: String,
pub realm_name: String,
pub tenant_id: String,
pub election_event_id: String,
pub area_id: String,
pub election_id: String,
pub generate_voters: GenerateVoters,
pub duplicate_votes: DuplicateVotes,
pub generate_applications: GenerateApplications,
}

#[derive(Debug, Serialize, Deserialize)]
pub struct GenerateVoters {
pub csv_file_name: String,
pub fields: Vec<String>,
pub excluded_columns: Vec<String>,
pub email_prefix: String,
pub domain: String,
pub sequence_email_number: bool,
pub sequence_start_number: i64,
pub voter_password: String,
pub password_salt: String,
pub hashed_password: String,
pub overseas_reference: String,
pub min_age: i64,
pub max_age: i64,
pub authorized_elections_count: i64,
pub email_verified: bool,
}

#[derive(Debug, Serialize, Deserialize)]
pub struct DuplicateVotes {
pub row_id_to_clone: String,
}

#[derive(Debug, Serialize, Deserialize)]
pub struct GenerateApplications {
pub applicant_data: HashMap<String, Value>,
pub annotations: HashMap<String, Value>,
}
Loading