diff --git a/apps/labrinth/src/routes/v3/payouts.rs b/apps/labrinth/src/routes/v3/payouts.rs index 7535fcd1..2d6348be 100644 --- a/apps/labrinth/src/routes/v3/payouts.rs +++ b/apps/labrinth/src/routes/v3/payouts.rs @@ -1082,8 +1082,6 @@ async fn update_compliance_status( Ok(Some(avalara1099::DataWrapper { data: avalara1099::Data { attributes, .. }, })) => { - // It's unclear what timezone the DateTime is in (as it returns a naive RFC-3339 timestamp) - // so we can just say it was signed now compliance.signed = (&attributes.entry_status == "signed").then(Utc::now); compliance.e_delivery_consented = diff --git a/apps/labrinth/src/util/avalara1099.rs b/apps/labrinth/src/util/avalara1099.rs index 08c4a96e..12c9224d 100644 --- a/apps/labrinth/src/util/avalara1099.rs +++ b/apps/labrinth/src/util/avalara1099.rs @@ -1,7 +1,7 @@ use crate::database::models::{DBUserId, users_compliance::FormType}; use crate::routes::ApiError; use ariadne::ids::base62_impl::to_base62; -use chrono::{Datelike, NaiveDateTime}; +use chrono::Datelike; use serde::{Deserialize, Serialize}; use std::collections::HashMap; use std::fmt; @@ -33,12 +33,15 @@ pub struct FormResponse { pub company_name: String, pub company_email: String, pub reference_id: String, - pub signed_at: Option, + /// This is a DateTime, but it's not consistent wether it has a + /// timezone or not, so we just parse it as a string and use [`Utc::now()`](fn@chrono::Utc::now) + /// rather than using the provided DateTime. + pub signed_at: Option, } #[derive(Serialize, Deserialize)] pub struct W9FormsResponse { - pub e_delivery_consented_at: Option, + pub e_delivery_consented_at: Option, pub tin_match_status: Option, pub entry_status: String, }