implement models for payment and id verification
This commit is contained in:
@@ -24,6 +24,8 @@ pub struct Circle {
|
||||
#[index]
|
||||
pub title: String,
|
||||
pub ws_url: String,
|
||||
/// Public key for this circle
|
||||
pub public_key: String,
|
||||
/// Optional description of the circle
|
||||
pub description: Option<String>,
|
||||
/// List of related circles
|
||||
@@ -43,6 +45,7 @@ impl Circle {
|
||||
base_data: BaseModelData::new(),
|
||||
title: String::new(),
|
||||
ws_url: String::new(),
|
||||
public_key: String::new(),
|
||||
description: None,
|
||||
circles: Vec::new(),
|
||||
logo: None,
|
||||
@@ -63,6 +66,12 @@ impl Circle {
|
||||
self
|
||||
}
|
||||
|
||||
/// Sets the public key for the circle
|
||||
pub fn public_key(mut self, public_key: impl ToString) -> Self {
|
||||
self.public_key = public_key.to_string();
|
||||
self
|
||||
}
|
||||
|
||||
/// Sets the description for the circle
|
||||
pub fn description(mut self, description: impl ToString) -> Self {
|
||||
self.description = Some(description.to_string());
|
||||
@@ -98,4 +107,16 @@ impl Circle {
|
||||
}
|
||||
self
|
||||
}
|
||||
|
||||
/// Saves the circle (placeholder for actual save implementation)
|
||||
pub fn save(self) -> Self {
|
||||
// TODO: Implement actual save logic to database
|
||||
println!("Saving circle: {}", self.title);
|
||||
self
|
||||
}
|
||||
}
|
||||
|
||||
/// Creates a new circle builder
|
||||
pub fn new_circle() -> Circle {
|
||||
Circle::new()
|
||||
}
|
49
heromodels/src/models/identity/kyc.rs
Normal file
49
heromodels/src/models/identity/kyc.rs
Normal file
@@ -0,0 +1,49 @@
|
||||
//! KYC (Know Your Customer) identity verification structures
|
||||
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
/// iDenfy webhook event structure
|
||||
#[derive(Debug, Clone, Deserialize, Serialize)]
|
||||
pub struct IdenfyWebhookEvent {
|
||||
#[serde(rename = "clientId")]
|
||||
pub client_id: String,
|
||||
#[serde(rename = "scanRef")]
|
||||
pub scan_ref: String,
|
||||
pub status: String,
|
||||
pub platform: String,
|
||||
#[serde(rename = "startedAt")]
|
||||
pub started_at: String,
|
||||
#[serde(rename = "finishedAt")]
|
||||
pub finished_at: Option<String>,
|
||||
#[serde(rename = "clientIP")]
|
||||
pub client_ip: Option<String>,
|
||||
#[serde(rename = "clientLocation")]
|
||||
pub client_location: Option<String>,
|
||||
pub data: Option<IdenfyVerificationData>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Deserialize, Serialize)]
|
||||
pub struct IdenfyVerificationData {
|
||||
#[serde(rename = "docFirstName")]
|
||||
pub doc_first_name: Option<String>,
|
||||
#[serde(rename = "docLastName")]
|
||||
pub doc_last_name: Option<String>,
|
||||
#[serde(rename = "docNumber")]
|
||||
pub doc_number: Option<String>,
|
||||
#[serde(rename = "docPersonalCode")]
|
||||
pub doc_personal_code: Option<String>,
|
||||
#[serde(rename = "docExpiry")]
|
||||
pub doc_expiry: Option<String>,
|
||||
#[serde(rename = "docDob")]
|
||||
pub doc_dob: Option<String>,
|
||||
#[serde(rename = "docType")]
|
||||
pub doc_type: Option<String>,
|
||||
#[serde(rename = "docSex")]
|
||||
pub doc_sex: Option<String>,
|
||||
#[serde(rename = "docNationality")]
|
||||
pub doc_nationality: Option<String>,
|
||||
#[serde(rename = "docIssuingCountry")]
|
||||
pub doc_issuing_country: Option<String>,
|
||||
#[serde(rename = "manuallyDataChanged")]
|
||||
pub manually_data_changed: Option<bool>,
|
||||
}
|
5
heromodels/src/models/identity/mod.rs
Normal file
5
heromodels/src/models/identity/mod.rs
Normal file
@@ -0,0 +1,5 @@
|
||||
//! Identity-related models and types
|
||||
|
||||
pub mod kyc;
|
||||
|
||||
pub use kyc::*;
|
@@ -14,6 +14,8 @@ pub mod legal;
|
||||
pub mod library;
|
||||
pub mod object;
|
||||
pub mod projects;
|
||||
pub mod payment;
|
||||
pub mod identity;
|
||||
|
||||
// Re-export key types for convenience
|
||||
pub use core::Comment;
|
||||
|
5
heromodels/src/models/payment/mod.rs
Normal file
5
heromodels/src/models/payment/mod.rs
Normal file
@@ -0,0 +1,5 @@
|
||||
//! Payment-related models and types
|
||||
|
||||
pub mod stripe;
|
||||
|
||||
pub use stripe::*;
|
30
heromodels/src/models/payment/stripe.rs
Normal file
30
heromodels/src/models/payment/stripe.rs
Normal file
@@ -0,0 +1,30 @@
|
||||
//! Stripe payment webhook event structures
|
||||
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
/// Stripe webhook event structure
|
||||
#[derive(Debug, Clone, Deserialize, Serialize)]
|
||||
pub struct StripeWebhookEvent {
|
||||
pub id: String,
|
||||
pub object: String,
|
||||
pub api_version: Option<String>,
|
||||
pub created: i64,
|
||||
pub data: StripeEventData,
|
||||
pub livemode: bool,
|
||||
pub pending_webhooks: i32,
|
||||
pub request: Option<StripeEventRequest>,
|
||||
#[serde(rename = "type")]
|
||||
pub event_type: String,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Deserialize, Serialize)]
|
||||
pub struct StripeEventData {
|
||||
pub object: serde_json::Value,
|
||||
pub previous_attributes: Option<serde_json::Value>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Deserialize, Serialize)]
|
||||
pub struct StripeEventRequest {
|
||||
pub id: Option<String>,
|
||||
pub idempotency_key: Option<String>,
|
||||
}
|
Reference in New Issue
Block a user