Skip to content
This repository has been archived by the owner on Oct 19, 2024. It is now read-only.

Integrate with Aditude API for payouts #965

Merged
merged 3 commits into from
Sep 12, 2024
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
6 changes: 3 additions & 3 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,9 @@ CLICKHOUSE_DATABASE=staging_ariadne

MAXMIND_LICENSE_KEY=none

PAYOUTS_BUDGET=100

FLAME_ANVIL_URL=none

STRIPE_API_KEY=none
STRIPE_WEBHOOK_SECRET=none
STRIPE_WEBHOOK_SECRET=none

ADITUDE_API_KEY=none

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

This file was deleted.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

This file was deleted.

This file was deleted.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

This file was deleted.

2 changes: 2 additions & 0 deletions migrations/20240911044738_payouts-updates.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
ALTER TABLE payouts_values ADD COLUMN date_available timestamptz NOT NULL DEFAULT now();
ALTER TABLE payouts_values ALTER COLUMN date_available DROP DEFAULT;
3 changes: 2 additions & 1 deletion src/auth/validate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ use crate::routes::internal::session::get_session_metadata;
use actix_web::http::header::{HeaderValue, AUTHORIZATION};
use actix_web::HttpRequest;
use chrono::Utc;
use rust_decimal::Decimal;

pub async fn get_user_from_headers<'a, E>(
req: &HttpRequest,
Expand Down Expand Up @@ -66,7 +67,7 @@ where
paypal_address: db_user.paypal_email,
paypal_country: db_user.paypal_country,
venmo_handle: db_user.venmo_handle,
balance: db_user.balance,
balance: Decimal::ZERO,
}),
stripe_customer_id: db_user.stripe_customer_id,
};
Expand Down
5 changes: 0 additions & 5 deletions src/database/models/user_item.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ use crate::models::ids::base62_impl::{parse_base62, to_base62};
use crate::models::users::Badges;
use chrono::{DateTime, Utc};
use dashmap::DashMap;
use rust_decimal::Decimal;
use serde::{Deserialize, Serialize};
use std::fmt::{Debug, Display};
use std::hash::Hash;
Expand Down Expand Up @@ -45,8 +44,6 @@ pub struct User {
pub created: DateTime<Utc>,
pub role: String,
pub badges: Badges,

pub balance: Decimal,
}

impl User {
Expand Down Expand Up @@ -169,7 +166,6 @@ impl User {
SELECT id, email,
avatar_url, raw_avatar_url, username, bio,
created, role, badges,
balance,
github_id, discord_id, gitlab_id, google_id, steam_id, microsoft_id,
email_verified, password, totp_secret, paypal_id, paypal_country, paypal_email,
venmo_handle, stripe_customer_id
Expand Down Expand Up @@ -198,7 +194,6 @@ impl User {
created: u.created,
role: u.role,
badges: Badges::from_bits(u.badges as u64).unwrap_or_default(),
balance: u.balance,
password: u.password,
paypal_id: u.paypal_id,
paypal_country: u.paypal_country,
Expand Down
Loading
Loading