refactor: simplify account standing and verification levels (#3130)

This commit is contained in:
Hampus
2026-10-02 18:17:41 +02:00
committed by GitHub
parent 1abde06824
commit 1ec8f31253
488 changed files with 10390 additions and 47117 deletions
+2 -12
View File
@@ -43,7 +43,7 @@ const FULL_USER_COLUMNS: &str = "\
premium_will_cancel, premium_onboarding_dismissed_at, \
has_ever_purchased, stripe_subscription_id, stripe_customer_id, \
gift_inventory_server_seq, gift_inventory_client_seq, \
suspicious_activity_flags, terms_agreed_at, privacy_agreed_at, \
terms_agreed_at, privacy_agreed_at, \
last_active_at, last_active_ip, \
temp_banned_until, pending_deletion_at, \
pending_bulk_message_deletion_at, \
@@ -51,7 +51,7 @@ const FULL_USER_COLUMNS: &str = "\
pending_bulk_message_deletion_message_count, \
password_last_changed_at, acls, \
deletion_reason_code, deletion_public_reason, deletion_audit_log_reason, \
first_refund_at, version, has_verified_phone, \
first_refund_at, version, \
premium_grace_ends_at, mention_flags, \
last_voice_activity_sharing_change_at, \
timezone, timezone_privacy_flags";
@@ -146,7 +146,6 @@ struct FullUserDbRow {
stripe_customer_id: Option<String>,
gift_inventory_server_seq: Option<i32>,
gift_inventory_client_seq: Option<i32>,
suspicious_activity_flags: Option<i32>,
terms_agreed_at: OptionalTimestamp,
privacy_agreed_at: OptionalTimestamp,
last_active_at: OptionalTimestamp,
@@ -163,7 +162,6 @@ struct FullUserDbRow {
deletion_audit_log_reason: Option<String>,
first_refund_at: OptionalTimestamp,
version: Option<i32>,
has_verified_phone: Option<bool>,
premium_grace_ends_at: OptionalTimestamp,
mention_flags: Option<i32>,
last_voice_activity_sharing_change_at: OptionalTimestamp,
@@ -226,7 +224,6 @@ struct FullUserKvRow {
stripe_customer_id: Option<String>,
gift_inventory_server_seq: Option<i32>,
gift_inventory_client_seq: Option<i32>,
suspicious_activity_flags: Option<i32>,
terms_agreed_at: Option<i64>,
privacy_agreed_at: Option<i64>,
last_active_at: Option<i64>,
@@ -243,7 +240,6 @@ struct FullUserKvRow {
deletion_audit_log_reason: Option<String>,
first_refund_at: Option<i64>,
version: Option<i32>,
has_verified_phone: Option<bool>,
premium_grace_ends_at: Option<i64>,
mention_flags: Option<i32>,
last_voice_activity_sharing_change_at: Option<i64>,
@@ -658,7 +654,6 @@ fn fluxer_system_user() -> User {
stripe_customer_id: None,
gift_inventory_server_seq: None,
gift_inventory_client_seq: None,
suspicious_activity_flags: None,
terms_agreed_at: None,
privacy_agreed_at: None,
last_active_at: None,
@@ -675,7 +670,6 @@ fn fluxer_system_user() -> User {
deletion_audit_log_reason: None,
first_refund_at: None,
version: 1,
has_verified_phone: None,
premium_grace_ends_at: None,
mention_flags: None,
last_voice_activity_sharing_change_at: None,
@@ -832,7 +826,6 @@ impl From<FullUserDbRow> for User {
stripe_customer_id: row.stripe_customer_id,
gift_inventory_server_seq: row.gift_inventory_server_seq,
gift_inventory_client_seq: row.gift_inventory_client_seq,
suspicious_activity_flags: row.suspicious_activity_flags,
terms_agreed_at: optional_timestamp_millis(row.terms_agreed_at),
privacy_agreed_at: optional_timestamp_millis(row.privacy_agreed_at),
last_active_at: optional_timestamp_millis(row.last_active_at),
@@ -856,7 +849,6 @@ impl From<FullUserDbRow> for User {
deletion_audit_log_reason: row.deletion_audit_log_reason,
first_refund_at: optional_timestamp_millis(row.first_refund_at),
version: row.version.unwrap_or_default(),
has_verified_phone: row.has_verified_phone,
premium_grace_ends_at: optional_timestamp_millis(row.premium_grace_ends_at),
mention_flags: row.mention_flags,
last_voice_activity_sharing_change_at: optional_timestamp_millis(
@@ -906,7 +898,6 @@ impl From<FullUserKvRow> for User {
stripe_customer_id: row.stripe_customer_id,
gift_inventory_server_seq: row.gift_inventory_server_seq,
gift_inventory_client_seq: row.gift_inventory_client_seq,
suspicious_activity_flags: row.suspicious_activity_flags,
terms_agreed_at: row.terms_agreed_at,
privacy_agreed_at: row.privacy_agreed_at,
last_active_at: row.last_active_at,
@@ -925,7 +916,6 @@ impl From<FullUserKvRow> for User {
deletion_audit_log_reason: row.deletion_audit_log_reason,
first_refund_at: row.first_refund_at,
version: row.version.unwrap_or_default(),
has_verified_phone: row.has_verified_phone,
premium_grace_ends_at: row.premium_grace_ends_at,
mention_flags: row.mention_flags,
last_voice_activity_sharing_change_at: row.last_voice_activity_sharing_change_at,
-4
View File
@@ -78,7 +78,6 @@ pub struct User {
pub stripe_customer_id: Option<String>,
pub gift_inventory_server_seq: Option<i32>,
pub gift_inventory_client_seq: Option<i32>,
pub suspicious_activity_flags: Option<i32>,
pub terms_agreed_at: Option<i64>,
pub privacy_agreed_at: Option<i64>,
pub last_active_at: Option<i64>,
@@ -95,7 +94,6 @@ pub struct User {
pub deletion_audit_log_reason: Option<String>,
pub first_refund_at: Option<i64>,
pub version: i32,
pub has_verified_phone: Option<bool>,
pub premium_grace_ends_at: Option<i64>,
pub mention_flags: Option<i32>,
pub last_voice_activity_sharing_change_at: Option<i64>,
@@ -275,7 +273,6 @@ mod tests {
stripe_customer_id: Some("cus_123".to_owned()),
gift_inventory_server_seq: Some(3),
gift_inventory_client_seq: Some(3),
suspicious_activity_flags: Some(0),
terms_agreed_at: Some(1_781_526_896_789),
privacy_agreed_at: Some(1_781_526_896_789),
last_active_at: Some(1_781_526_896_789),
@@ -292,7 +289,6 @@ mod tests {
deletion_audit_log_reason: None,
first_refund_at: None,
version: 3,
has_verified_phone: Some(true),
premium_grace_ends_at: None,
mention_flags: Some(2),
last_voice_activity_sharing_change_at: None,