Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Email Sending & Application Lockouts #530

Draft
wants to merge 22 commits into
base: CHAOS-224-KHAOS-rewrite
Choose a base branch
from
Draft
Changes from 1 commit
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
5db09ad
email sending
KavikaPalletenne Dec 2, 2024
5a163d3
fix "recipient" spelling
KavikaPalletenne Dec 2, 2024
07680cc
cargo fmt
KavikaPalletenne Dec 2, 2024
7c3d624
fix errors with `template_subject` introduction
KavikaPalletenne Dec 2, 2024
5aeeb2f
cargo clippy fixes
KavikaPalletenne Dec 2, 2024
706f814
application role preferences and updating applied roles
KavikaPalletenne Dec 2, 2024
299ee9b
lock out user from application changes after submission
KavikaPalletenne Dec 2, 2024
43e47cd
lock application after submission and campaign close date
KavikaPalletenne Dec 2, 2024
80c1abe
fix uses of `LEFT JOIN` when `JOIN` was needed
KavikaPalletenne Dec 2, 2024
efe6c00
make unsubmitted application viewable after campaign end
KavikaPalletenne Dec 2, 2024
02b705b
only submitted applications are viewable by reviewers
KavikaPalletenne Dec 2, 2024
6fcb06a
added `Answer`-related schemas to api.yaml
KavikaPalletenne Dec 2, 2024
c08e4b4
register new `ApplicationHandler` endpoints in app
KavikaPalletenne Dec 3, 2024
d2d402a
completed up to /organisation/slug_check
KavikaPalletenne Dec 3, 2024
b2b7426
`NewCampaign` model for campaign create request body
KavikaPalletenne Dec 3, 2024
0e17bdb
block applications for ended campaigns
KavikaPalletenne Dec 3, 2024
36fd5c1
`NewEmailTemplate` model for template request body
KavikaPalletenne Dec 3, 2024
43eee89
fix `assert_campaign_is_open()` naming
KavikaPalletenne Dec 3, 2024
266fbff
api.yaml up to `/organisation/{id}/logo`
KavikaPalletenne Dec 3, 2024
049a393
update `api.json` up to `/organisation/{id}/logo`
KavikaPalletenne Dec 3, 2024
af16cac
Move some `Rating` handler fn to `ApplicationHandler`
KavikaPalletenne Dec 31, 2024
6b18074
update `api.json` up to `/rating/{id}`
KavikaPalletenne Dec 31, 2024
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
Prev Previous commit
Next Next commit
NewCampaign model for campaign create request body
  • Loading branch information
KavikaPalletenne committed Dec 3, 2024
commit b2b742644892ebe2f87b90ec5ce60fefefd600f4
4 changes: 2 additions & 2 deletions backend/server/src/handler/organisation.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use crate::models::app::AppState;
use crate::models::auth::SuperUser;
use crate::models::auth::{AuthUser, OrganisationAdmin};
use crate::models::campaign::Campaign;
use crate::models::campaign::{Campaign, NewCampaign};
use crate::models::email_template::EmailTemplate;
use crate::models::error::ChaosError;
use crate::models::organisation::{
@@ -166,7 +166,7 @@ impl OrganisationHandler {
Path(id): Path<i64>,
State(state): State<AppState>,
_admin: OrganisationAdmin,
Json(request_body): Json<Campaign>,
Json(request_body): Json<NewCampaign>,
) -> Result<impl IntoResponse, ChaosError> {
Organisation::create_campaign(
id,
10 changes: 10 additions & 0 deletions backend/server/src/models/campaign.rs
Original file line number Diff line number Diff line change
@@ -36,6 +36,7 @@ pub struct CampaignDetails {
pub starts_at: DateTime<Utc>,
pub ends_at: DateTime<Utc>,
}

#[derive(Deserialize, Serialize, Clone, FromRow, Debug)]
pub struct OrganisationCampaign {
pub id: i64,
@@ -47,6 +48,15 @@ pub struct OrganisationCampaign {
pub ends_at: DateTime<Utc>,
}

#[derive(Deserialize)]
pub struct NewCampaign {
pub slug: String,
pub name: String,
pub description: Option<String>,
pub starts_at: DateTime<Utc>,
pub ends_at: DateTime<Utc>
}

#[derive(Deserialize, Serialize, Clone, FromRow, Debug)]
pub struct CampaignUpdate {
pub slug: String,