You've already forked AstralRinth
forked from didirus/AstralRinth
Payouts code (#765)
* push to rebase * finish most * finish most * Finish impl * Finish paypal * run prep * Fix comp err
This commit is contained in:
@@ -184,6 +184,14 @@ generate_ids!(
|
||||
OAuthAccessTokenId
|
||||
);
|
||||
|
||||
generate_ids!(
|
||||
pub generate_payout_id,
|
||||
PayoutId,
|
||||
8,
|
||||
"SELECT EXISTS(SELECT 1 FROM oauth_access_tokens WHERE id=$1)",
|
||||
PayoutId
|
||||
);
|
||||
|
||||
#[derive(Copy, Clone, Debug, PartialEq, Eq, Type, Hash, Serialize, Deserialize)]
|
||||
#[sqlx(transparent)]
|
||||
pub struct UserId(pub i64);
|
||||
@@ -298,6 +306,10 @@ pub struct OAuthRedirectUriId(pub i64);
|
||||
#[sqlx(transparent)]
|
||||
pub struct OAuthAccessTokenId(pub i64);
|
||||
|
||||
#[derive(Copy, Clone, Debug, Type, Serialize, Deserialize, Eq, PartialEq, Hash)]
|
||||
#[sqlx(transparent)]
|
||||
pub struct PayoutId(pub i64);
|
||||
|
||||
use crate::models::ids;
|
||||
|
||||
impl From<ids::ProjectId> for ProjectId {
|
||||
@@ -440,3 +452,14 @@ impl From<OAuthClientAuthorizationId> for ids::OAuthClientAuthorizationId {
|
||||
ids::OAuthClientAuthorizationId(id.0 as u64)
|
||||
}
|
||||
}
|
||||
|
||||
impl From<ids::PayoutId> for PayoutId {
|
||||
fn from(id: ids::PayoutId) -> Self {
|
||||
PayoutId(id.0 as i64)
|
||||
}
|
||||
}
|
||||
impl From<PayoutId> for ids::PayoutId {
|
||||
fn from(id: PayoutId) -> Self {
|
||||
ids::PayoutId(id.0 as u64)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user