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: 0 additions & 2 deletions apps/labrinth/src/routes/v3/payouts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 =
Expand Down
9 changes: 6 additions & 3 deletions apps/labrinth/src/util/avalara1099.rs
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -33,12 +33,15 @@ pub struct FormResponse {
pub company_name: String,
pub company_email: String,
pub reference_id: String,
pub signed_at: Option<NaiveDateTime>,
/// 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<String>,
}

#[derive(Serialize, Deserialize)]
pub struct W9FormsResponse {
pub e_delivery_consented_at: Option<NaiveDateTime>,
pub e_delivery_consented_at: Option<String>,
pub tin_match_status: Option<String>,
pub entry_status: String,
}
Expand Down