[Draft] Implement Early deletion by Submitter #37 #38

Merged
ben merged 15 commits from ben/Jobboerse:main into main 2023-01-28 18:00:00 +01:00
4 changed files with 7 additions and 7 deletions
Showing only changes of commit d8b45c9d0f - Show all commits

apply workaround to fix migration problem

Bennet Bleßmann 2023-01-28 13:47:58 +01:00 committed by Bennet Bleßmann
Signed by: ben
GPG key ID: 3BE1A1A3CBC3CF99

View file

@ -20,8 +20,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- startup errors are more descriptive
- the confirmation link now works after confirmation so that submissions can be deleted early by the submitter
- this changes the on-disk format slightly as the token now has a different scope and was moved accordingly
- automatic migration of the on-disk format currently does not work, this appears to be due to a serde bug,
as an effect all tokens of job offers in the old format will be forgotten
### Removed

View file

@ -110,7 +110,9 @@ pub(crate) struct Link {
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, Hash)]
#[serde(tag = "type", deny_unknown_fields)]
pub enum ConfirmationStatus {
AwaitingConfirmation,
AwaitingConfirmation {
// work around for https://github.com/serde-rs/serde/issues/2294
},
Confirmed,
}
@ -148,7 +150,7 @@ impl From<V1JobOfferStatus> for JobOfferStatus {
) -> Self {
let (confirmation_status, token) = match confirmation_status {
V1ConfirmationStatus::AwaitingConfirmation { token } => {
(ConfirmationStatus::AwaitingConfirmation, Some(token))
(ConfirmationStatus::AwaitingConfirmation {}, Some(token))
}
V1ConfirmationStatus::Confirmed => (ConfirmationStatus::Confirmed, None),
};
@ -604,7 +606,7 @@ impl JobOffer<PathBuf> {
status: JobOfferStatus {
submitter_token: Some("Token".to_string()),
review_status: ReviewStatus::AwaitingReview,
confirmation_status: ConfirmationStatus::AwaitingConfirmation,
confirmation_status: ConfirmationStatus::AwaitingConfirmation {},
},
attachments: vec![Attachment {
title: "Attachment".to_string(),

View file

@ -82,7 +82,7 @@ impl JobOfferActions {
let confirmation_url = match &offer.status {
JobOfferStatus {
confirmation_status: ConfirmationStatus::AwaitingConfirmation,
confirmation_status: ConfirmationStatus::AwaitingConfirmation {},
submitter_token: Some(token),
review_status: _,
} => Some(req.url_for(JOBOFFER_CONFIRM_ROUTE, [id, token])?),

View file

@ -228,7 +228,7 @@ pub(crate) async fn create_job_offer<'data, 'config>(
let confirmation_status = if skip_confirmation {
ConfirmationStatus::Confirmed
} else {
ConfirmationStatus::AwaitingConfirmation
ConfirmationStatus::AwaitingConfirmation {}
};
let job_offer = JobOffer {