diff --git a/specs/models_marketplace/core/base.v b/specs/models_marketplace/core/base.v new file mode 100644 index 0000000..b7f04d7 --- /dev/null +++ b/specs/models_marketplace/core/base.v @@ -0,0 +1,11 @@ +module core + +// BaseData provides common fields for all models +pub struct Base { +pub mut: + id u32 + created u64 // Unix timestamp of creation + updated u64 // Unix timestamp of last update + deleted bool + version u32 +} diff --git a/specs/models_marketplace/core/mod.v b/specs/models_marketplace/core/mod.v new file mode 100644 index 0000000..1566dd2 --- /dev/null +++ b/specs/models_marketplace/core/mod.v @@ -0,0 +1 @@ +module core diff --git a/specs/models_marketplace/main/config.v b/specs/models_marketplace/main/config.v new file mode 100644 index 0000000..361fa90 --- /dev/null +++ b/specs/models_marketplace/main/config.v @@ -0,0 +1,23 @@ +module main + +import freeflowuniverse.herolib.hero.models.marketplace.core + + +pub struct MarketplaceCurrencyConfig { +pub mut: + base_currency string + supported_currencies []string + default_display_currency string + auto_update_rates bool + update_interval_minutes u32 + fallback_rates map[string]f64 // Using f64 for Decimal +} + + +// User currency preferences +pub struct UserCurrencyPreference { +pub mut: + user_id string + preferred_currency string + updated_at u64 // Unix timestamp +} diff --git a/specs/models_marketplace/main/currency.v b/specs/models_marketplace/main/currency.v new file mode 100644 index 0000000..1c54e89 --- /dev/null +++ b/specs/models_marketplace/main/currency.v @@ -0,0 +1,64 @@ +module main + +import freeflowuniverse.herolib.hero.models.marketplace.core + +// Configurable currency support for any currency type +pub struct Currency { + core.Base +pub mut: + code string // USD, EUR, BTC, ETH, etc. + name string + symbol string + currency_type CurrencyType + exchange_rate_to_base f64 // Using f64 for Decimal + is_base_currency bool + decimal_places u8 + is_active bool +} + +pub enum CurrencyType { + fiat + cryptocurrency + token + points + custom +} + +pub struct Price { +pub mut: + base_amount f64 // Using f64 for Decimal + base_currency string + display_currency string + display_amount f64 // Using f64 for Decimal + formatted_display string + conversion_rate f64 // Using f64 for Decimal + conversion_timestamp u64 // Unix timestamp +} + +pub struct MarketplaceCurrencyConfig { +pub mut: + base_currency string + supported_currencies []string + default_display_currency string + auto_update_rates bool + update_interval_minutes u32 + fallback_rates map[string]f64 // Using f64 for Decimal +} + +// Exchange rate history for tracking changes over time +pub struct ExchangeRateHistory { +pub mut: + from_currency string + to_currency string + rate f64 // Using f64 for Decimal + timestamp u64 // Unix timestamp + provider string +} + +// User currency preferences +pub struct UserCurrencyPreference { +pub mut: + user_id string + preferred_currency string + updated_at u64 // Unix timestamp +} diff --git a/specs/models_marketplace/main/order.v b/specs/models_marketplace/main/order.v new file mode 100644 index 0000000..2bb42af --- /dev/null +++ b/specs/models_marketplace/main/order.v @@ -0,0 +1,115 @@ +module main + +import freeflowuniverse.herolib.hero.models.marketplace.core + +pub struct Order { + core.Base +pub mut: + id string + user_id string + items []OrderItem + subtotal_base f64 // Using f64 for Decimal + total_base f64 // Using f64 for Decimal + base_currency string + currency_used string + currency_total f64 // Using f64 for Decimal + conversion_rate f64 // Using f64 for Decimal + status OrderStatus + payment_method string + payment_details PaymentDetails + billing_address Address + shipping_address Address + notes string + purchase_type PurchaseType + created_at u64 // Unix timestamp + updated_at u64 // Unix timestamp +} + +pub struct OrderItem { +pub mut: + product_id string + product_name string + product_category string + quantity u32 + unit_price_base f64 // Using f64 for Decimal + total_price_base f64 // Using f64 for Decimal + specifications map[string]string // Using map[string]string for HashMap + provider_id string + provider_name string +} + +pub enum OrderStatus { + pending + confirmed + processing + deployed + completed + cancelled + refunded + failed +} + +// Purchase type to distinguish between cart-based and instant purchases +pub enum PurchaseType { + cart + instant +} + +pub struct PaymentDetails { +pub mut: + payment_id string + payment_method PaymentMethod + transaction_id string + payment_status PaymentStatus + payment_timestamp u64 // Unix timestamp + failure_reason string +} + +pub enum PaymentMethod { + credit_card // CreditCard { last_four: String, card_type: String } + bank_transfer // BankTransfer { bank_name: String, account_last_four: String } + cryptocurrency // Cryptocurrency { currency: String, wallet_address: String } + token // Token { token_type: String, wallet_address: String } + mock // Mock { method_name: String } +} + +pub struct Address { +pub mut: + street string + city string + state string + postal_code string + country string + company string +} + +// Shopping Cart Models +pub struct CartItem { +pub mut: + product_id string + quantity u32 + selected_specifications map[string]string // Using map[string]string for HashMap + added_at u64 // Unix timestamp + updated_at u64 // Unix timestamp +} + +pub struct Cart { +pub mut: + user_id string + items []CartItem + session_id string + created_at u64 // Unix timestamp + updated_at u64 // Unix timestamp +} + +// Order summary for display purposes +pub struct OrderSummary { +pub mut: + subtotal f64 // Using f64 for Decimal + tax f64 // Using f64 for Decimal + shipping f64 // Using f64 for Decimal + discount f64 // Using f64 for Decimal + total f64 // Using f64 for Decimal + currency string + item_count u32 +} diff --git a/specs/models_marketplace/main/pool.v b/specs/models_marketplace/main/pool.v new file mode 100644 index 0000000..c43159f --- /dev/null +++ b/specs/models_marketplace/main/pool.v @@ -0,0 +1,93 @@ +module main + +import freeflowuniverse.herolib.hero.models.marketplace.core + +pub struct LiquidityPool { + core.Base +pub mut: + id string + name string + token_a string + token_b string + reserve_a f64 // Using f64 for Decimal + reserve_b f64 // Using f64 for Decimal + exchange_rate f64 // Using f64 for Decimal + liquidity f64 // Using f64 for Decimal + volume_24h f64 // Using f64 for Decimal + fee_percentage f64 // Using f64 for Decimal + status PoolStatus +} + +pub enum PoolStatus { + active + paused + maintenance +} + +pub struct ExchangeRequest { +pub mut: + pool_id string + from_token string + to_token string + amount f64 // Using f64 for Decimal + min_receive f64 // Using f64 for Decimal + slippage_tolerance f64 // Using f64 for Decimal +} + +pub struct ExchangeResponse { +pub mut: + success bool + message string + transaction_id string + from_amount f64 // Using f64 for Decimal + to_amount f64 // Using f64 for Decimal + exchange_rate f64 // Using f64 for Decimal + fee f64 // Using f64 for Decimal +} + +pub struct StakeRequest { +pub mut: + amount f64 // Using f64 for Decimal + duration_months u32 +} + +pub struct StakePosition { + core.Base +pub mut: + id string + user_id string + amount f64 // Using f64 for Decimal + start_date u64 // Unix timestamp + end_date u64 // Unix timestamp + discount_percentage f64 // Using f64 for Decimal + reputation_bonus int + status StakeStatus +} + +pub enum StakeStatus { + active + completed + withdrawn +} + +// Pool analytics data +pub struct PoolAnalytics { +pub mut: + price_history []PricePoint + volume_history []VolumePoint + liquidity_distribution map[string]f64 // Using f64 for Decimal + staking_distribution map[string]int +} + +pub struct PricePoint { +pub mut: + timestamp u64 // Unix timestamp + price f64 // Using f64 for Decimal + volume f64 // Using f64 for Decimal +} + +pub struct VolumePoint { +pub mut: + date string + volume f64 // Using f64 for Decimal +} diff --git a/specs/models_marketplace/main/product.v b/specs/models_marketplace/main/product.v new file mode 100644 index 0000000..cbebdb2 --- /dev/null +++ b/specs/models_marketplace/main/product.v @@ -0,0 +1,177 @@ +module main + +import freeflowuniverse.herolib.hero.models.marketplace.core + +// Generic product structure that can represent any marketplace item +pub struct Product { + core.Base +pub mut: + id string + name string + category_id string // References ProductCategory config + description string + base_price f64 // Using f64 for Decimal + base_currency string + attributes map[string]ProductAttribute // Generic attributes + provider_id string + provider_name string + availability ProductAvailability + metadata ProductMetadata // Extensible metadata + created_at u64 // Unix timestamp + updated_at u64 // Unix timestamp +} + +// Configurable product categories +pub struct ProductCategory { +pub mut: + id string + name string + display_name string + description string + attribute_schema []AttributeDefinition // Defines allowed attributes + parent_category string + is_active bool +} + +// Generic attribute system for any product type +pub struct ProductAttribute { +pub mut: + key string + value string // Using string for serde_json::Value, consider map[string]string or specific types + attribute_type AttributeType + is_searchable bool + is_filterable bool + display_order u32 +} + +pub enum AttributeType { + text + number + slice_configuration + boolean + select // Select(Vec) + multi_select // MultiSelect(Vec) + range // Range { min: f64, max: f64 } + custom +} + +pub struct AttributeDefinition { +pub mut: + key string + name string + attribute_type AttributeType + is_required bool + is_searchable bool + is_filterable bool + validation_rules []ValidationRule +} + +pub enum ValidationRule { + min_length // MinLength(usize) + max_length // MaxLength(usize) + min_value // MinValue(f64) + max_value // MaxValue(f64) + pattern // Pattern(String) + custom +} + +pub enum ProductAvailability { + available + limited + unavailable + pre_order + custom +} + +pub struct ProductMetadata { +pub mut: + tags []string + location string + rating f32 + review_count u32 + featured bool + custom_fields map[string]string // Using map[string]string for HashMap +} + +// Support for different pricing models +pub enum PricingModel { + one_time + recurring // Recurring { interval: String } + usage_based // UsageBased { unit: String } + tiered // Tiered(Vec) + custom +} + +pub struct PriceTier { +pub mut: + min_quantity u32 + max_quantity u32 + price_per_unit f64 // Using f64 for Decimal + discount_percentage f32 +} + +// Slice configuration data structure for product attributes +pub struct SliceConfiguration { +pub mut: + cpu_cores int + memory_gb int + storage_gb int + bandwidth_mbps int + min_uptime_sla f32 + public_ips int + node_id string + slice_type SliceType + pricing SlicePricing +} + +// Enhanced pricing structure for slices with multiple time periods +pub struct SlicePricing { +pub mut: + hourly f64 // Using f64 for Decimal + daily f64 // Using f64 for Decimal + monthly f64 // Using f64 for Decimal + yearly f64 // Using f64 for Decimal +} + +pub enum SliceType { + basic + standard + premium + custom +} + +// Placeholder for SliceAllocation and SliceCombination +// These are not directly from product.rs but are referenced in user.rs +pub struct SliceAllocation { +pub mut: + slice_id string + node_id string + user_id string + allocated_cpu_cores int + allocated_memory_gb int + allocated_storage_gb int + allocated_bandwidth_mbps int + start_time u64 + end_time u64 +} + +pub struct SliceCombination { +pub mut: + cpu_cores int + memory_gb int + storage_gb int + bandwidth_mbps int + price_per_hour f64 +} + +// Placeholder for DefaultSliceFormat +// This is not directly from product.rs but is referenced in user.rs +pub struct DefaultSliceFormat { +pub mut: + name string + cpu_cores int + memory_gb int + storage_gb int + bandwidth_mbps int + price_per_hour f64 +} diff --git a/specs/models_marketplace/main/user.v b/specs/models_marketplace/main/user.v new file mode 100644 index 0000000..3126dc3 --- /dev/null +++ b/specs/models_marketplace/main/user.v @@ -0,0 +1,730 @@ +module main + +import freeflowuniverse.herolib.hero.models.marketplace.core + +// Represents a user in the system +pub struct User { + core.Base +pub mut: + id u32 // Unique identifier for the user, using u32 for consistency with VLang + name string // User's full name + email string // User's email address + role UserRole // User's role in the system + country string // User's country + timezone string // User's timezone + created_at u64 // Unix timestamp of creation + updated_at u64 // Unix timestamp of last update + mock_data MockUserData // Mock data for dashboard +} + +// Represents the possible roles a user can have +pub enum UserRole { + user + admin +} + +// Represents user login credentials +pub struct LoginCredentials { +pub mut: + email string + password string +} + +// Represents user registration data +pub struct RegistrationData { +pub mut: + name string + email string + password string + password_confirmation string +} + +// Mock user data for testing +pub struct MockUserData { +pub mut: + active_deployments int + active_slices int + current_cost int + balance int + wallet_balance_usd f64 // Using f64 for Decimal, consider string for high precision + owned_product_ids []string + active_rentals []string + transaction_history []Transaction + resource_utilization ResourceUtilization + usd_usage_trend []int + user_activity UserActivityStats + recent_activities []RecentActivity + deployment_distribution DeploymentDistribution + farmer_data FarmerData // Farmer-specific data + app_provider_data AppProviderData // App Provider-specific data + service_provider_data ServiceProviderData // Service Provider-specific data + customer_service_data CustomerServiceData // Customer Service-specific data +} + +pub struct ResourceUtilization { +pub mut: + cpu int + memory int + storage int + network int +} + +pub struct UserActivityStats { +pub mut: + deployments []int + resource_reservations []int +} + +pub struct RecentActivity { +pub mut: + date string + action string + status string + details string +} + +pub struct DeploymentDistribution { +pub mut: + regions []RegionDeployments +} + +pub struct RegionDeployments { +pub mut: + region string + nodes int + slices int + apps int + gateways int +} + +// Farmer-specific data +pub struct FarmerData { +pub mut: + total_nodes int + online_nodes int + total_capacity NodeCapacity + used_capacity NodeCapacity + monthly_earnings_usd int + total_earnings_usd int + uptime_percentage f32 + nodes []FarmNode + earnings_history []EarningsRecord + slice_templates []Product + active_slices int +} + +pub struct NodeCapacity { +pub mut: + cpu_cores int + memory_gb int + storage_gb int + bandwidth_mbps int + ssd_storage_gb int + hdd_storage_gb int +} + +// Enhanced Node structure for farmer dashboard with modern types +pub struct FarmNode { +pub mut: + id string + name string + location string + status NodeStatus + capacity NodeCapacity + used_capacity NodeCapacity + uptime_percentage f32 + earnings_today_usd f64 // Using f64 for Decimal + last_seen u64 // Unix timestamp + health_score f32 + region string + node_type string + slice_formats []string + rental_options NodeRentalOptions + availability_status NodeAvailabilityStatus + grid_node_id u32 + grid_data GridNodeData + node_group_id string + group_assignment_date u64 // Unix timestamp + group_slice_format string + group_slice_price f64 // Using f64 for Decimal + staking_options NodeStakingOptions + marketplace_sla MarketplaceSLA + total_base_slices u32 + allocated_base_slices u32 + slice_allocations []SliceAllocation // Assuming SliceAllocation is defined elsewhere or will be translated + available_combinations []SliceCombination // Assuming SliceCombination is defined elsewhere or will be translated + slice_pricing SlicePricing // Assuming SlicePricing is defined elsewhere or will be translated + slice_last_calculated u64 // Unix timestamp +} + +pub struct EarningsRecord { +pub mut: + date string + amount int + source string +} + +pub enum NodeStatus { + online + offline + maintenance + error + standby +} + +pub struct FarmerSettings { +pub mut: + auto_accept_deployments bool + maintenance_window string + notification_preferences NotificationSettings + minimum_deployment_duration int + preferred_regions []string + default_slice_customizations map[string]DefaultSliceFormat // Assuming DefaultSliceFormat is defined elsewhere or will be translated +} + +pub struct NotificationSettings { +pub mut: + email_enabled bool + sms_enabled bool + push bool + node_offline_alerts bool + earnings_reports bool + maintenance_reminders bool +} + +// Marketplace SLA configuration - what the farmer promises to customers +pub struct MarketplaceSLA { +pub mut: + uptime_guarantee_percentage f32 + bandwidth_guarantee_mbps int + base_slice_price f64 // Using f64 for Decimal + last_updated u64 // Unix timestamp +} + +// Node rental options that farmers can configure +pub struct NodeRentalOptions { +pub mut: + slice_rental_enabled bool + full_node_rental_enabled bool + full_node_pricing FullNodePricing + minimum_rental_days u32 + maximum_rental_days u32 + auto_renewal_enabled bool +} + +// Node staking options that farmers can configure +pub struct NodeStakingOptions { +pub mut: + staking_enabled bool + staked_amount f64 // Using f64 for Decimal + staking_start_date u64 // Unix timestamp + staking_period_months u32 + early_withdrawal_allowed bool + early_withdrawal_penalty_percent f32 +} + +// Full node rental pricing configuration with auto-calculation support +pub struct FullNodePricing { +pub mut: + hourly f64 // Using f64 for Decimal + daily f64 // Using f64 for Decimal + monthly f64 // Using f64 for Decimal + yearly f64 // Using f64 for Decimal + auto_calculate bool + daily_discount_percent f32 + monthly_discount_percent f32 + yearly_discount_percent f32 +} + +// Node availability status for rental management +pub enum NodeAvailabilityStatus { + available + partially_rented + fully_rented + unavailable + reserved +} + +// Individual node rental record +pub struct NodeRental { +pub mut: + id string + node_id string + renter_email string + rental_type NodeRentalType + monthly_cost f64 // Using f64 for Decimal + start_date u64 // Unix timestamp + end_date u64 // Unix timestamp + status NodeRentalStatus + auto_renewal bool + payment_method string + metadata map[string]string // Using map[string]string for HashMap +} + +// Type of node rental +pub enum NodeRentalType { + slice // Slice { slice_ids: Vec, total_cpu_cores: u32, total_memory_gb: u32, total_storage_gb: u32 } + full_node +} + +// Status of a node rental +pub enum NodeRentalStatus { + active + pending + expired + cancelled + suspended +} + +// Farmer earnings from node rentals +pub struct FarmerRentalEarning { +pub mut: + id string + node_id string + rental_id string + renter_email string + amount f64 // Using f64 for Decimal + currency string + earning_date u64 // Unix timestamp + rental_type NodeRentalType + payment_status PaymentStatus +} + +pub enum PaymentStatus { + pending + completed + failed + refunded +} + +// User Activity Tracking +pub struct UserActivity { +pub mut: + id string + activity_type ActivityType + description string + timestamp u64 // Unix timestamp + metadata map[string]string // Using map[string]string for HashMap + category string + importance ActivityImportance +} + +pub enum ActivityType { + login + purchase + deployment + service_created + app_published + node_added + node_updated + wallet_transaction + profile_update + settings_change + marketplace_view + slice_created + slice_allocated + slice_released + slice_rental_started + slice_rental_stopped + slice_rental_restarted + slice_rental_cancelled +} + +pub enum ActivityImportance { + low + medium + high + critical +} + +// Enhanced User Statistics +pub struct UsageStatistics { +pub mut: + total_deployments int + active_services int + total_spent f64 // Using f64 for Decimal + favorite_categories []string + usage_trends []UsageTrend + login_frequency f32 + preferred_regions []string + account_age_days int + last_activity u64 // Unix timestamp +} + +pub struct UsageTrend { +pub mut: + period string + metric string + value f32 + change_percentage f32 +} + +pub struct UserPreferences { +pub mut: + preferred_currency string + preferred_language string + timezone string + dashboard_layout string + notification_settings NotificationSettings + privacy_settings PrivacySettings + theme string + last_payment_method string +} + +pub struct PrivacySettings { +pub mut: + profile_visibility string + activity_tracking bool + marketing_emails bool + data_sharing bool +} + +// ThreeFold Grid Node Data fetched from gridproxy/graphql +pub struct GridNodeData { +pub mut: + grid_node_id u32 + city string + country string + farm_name string + farm_id u32 + public_ips u32 + total_resources NodeCapacity + used_resources NodeCapacity + certification_type string + farming_policy_id u32 + last_updated u64 // Unix timestamp +} + +// Node Group for managing multiple nodes together +pub struct NodeGroup { + core.Base +pub mut: + id string + name string + description string + group_type NodeGroupType + node_ids []string + group_config NodeGroupConfig + created_at u64 // Unix timestamp + updated_at u64 // Unix timestamp +} + +// Type of node group - default or custom +pub enum NodeGroupType { + default_compute + default_storage + default_ai_gpu + custom +} + +// Configuration for node groups +pub struct NodeGroupConfig { +pub mut: + preferred_slice_formats []string + default_pricing map[string]f64 // Using f64 for Decimal + resource_optimization ResourceOptimization + auto_scaling bool +} + +// Resource optimization settings for groups +pub enum ResourceOptimization { + balanced + performance + efficiency + custom +} + +// Statistics for a node group +pub struct GroupStatistics { +pub mut: + group_id string + total_nodes int + online_nodes int + total_capacity NodeCapacity + average_uptime f32 + group_type NodeGroupType +} + +// Enhanced User Dashboard Data +pub struct UserDashboardData { +pub mut: + user_info UserInfo + recent_activities []UserActivity + usage_statistics UsageStatistics + active_services []Service // Assuming Service is defined elsewhere or will be translated + active_deployments int + wallet_summary WalletSummary + recommendations []Recommendation + quick_actions []QuickAction +} + +pub struct UserInfo { +pub mut: + name string + email string + member_since string + account_type string + verification_status string +} + +pub struct WalletSummary { +pub mut: + balance f64 // Using f64 for Decimal + currency string + recent_transactions int + pending_transactions int +} + +pub struct Recommendation { +pub mut: + id string + title string + description string + action_url string + priority string + category string +} + +pub struct QuickAction { +pub mut: + id string + title string + description string + action_url string + icon string + enabled bool +} + +// App Provider-specific data +pub struct AppProviderData { +pub mut: + published_apps int + total_deployments int + active_deployments int + monthly_revenue_usd int + total_revenue_usd int + apps []PublishedApp + deployment_stats []DeploymentStat + revenue_history []RevenueRecord +} + +pub struct PublishedApp { +pub mut: + id string + name string + category string + version string + status string + deployments int + rating f32 + monthly_revenue_usd int + last_updated string + auto_healing bool +} + +pub struct DeploymentStat { +pub mut: + app_name string + region string + instances int + status string + resource_usage ResourceUtilization + customer_name string + deployed_date string + deployment_id string + auto_healing bool +} + +pub struct RevenueRecord { +pub mut: + date string + amount int + app_name string +} + +// Service Provider-specific data +pub struct ServiceProviderData { +pub mut: + active_services int + total_clients int + monthly_revenue_usd int + total_revenue_usd int + service_rating f32 + services []Service + client_requests []ServiceRequest + revenue_history []RevenueRecord +} + +pub struct Service { +pub mut: + id string + name string + category string + description string + price_per_hour_usd int + status string + clients int + rating f32 + total_hours int +} + +pub struct ServiceRequest { +pub mut: + id string + client_name string + service_name string + status string + requested_date string + estimated_hours int + budget int + priority string + progress int + completed_date string + client_email string + client_phone string + description string + created_date string +} + +// Service booking record for customers who purchase services +pub struct ServiceBooking { +pub mut: + id string + service_id string + service_name string + provider_email string + customer_email string + budget int + estimated_hours int + status string + requested_date string + priority string + description string + booking_date string + client_phone string + progress int + completed_date string +} + +// Customer Service-specific data (for users who book services) +pub struct CustomerServiceData { +pub mut: + active_bookings int + completed_bookings int + total_spent int + monthly_spending int + average_rating_given f32 + service_bookings []ServiceBooking + favorite_providers []string + spending_history []SpendingRecord +} + +pub struct SpendingRecord { +pub mut: + date string + amount int + service_name string + provider_name string +} + +// Transaction record for wallet operations +pub struct Transaction { +pub mut: + id string + user_id string + transaction_type TransactionType + amount f64 // Using f64 for Decimal + timestamp u64 // Unix timestamp + status TransactionStatus +} + +// Types of transactions +pub enum TransactionType { + purchase + rental + transfer + earning + instant_purchase + exchange + stake + unstake + auto_top_up + credits_purchase + credits_sale + credits_transfer +} + +// Transaction status +pub enum TransactionStatus { + pending + completed + failed + cancelled +} + +// Rental record +pub struct Rental { +pub mut: + id string + user_id string + product_id string + start_date u64 // Unix timestamp + end_date u64 // Unix timestamp + status RentalStatus + monthly_cost f64 // Using f64 for Decimal +} + +// Rental status +pub enum RentalStatus { + active + expired + cancelled + pending +} + +// User deployment information for dashboard +pub struct UserDeployment { +pub mut: + id string + app_name string + status DeploymentStatus + cost_per_month f64 // Using f64 for Decimal + deployed_at u64 // Unix timestamp + provider string + region string + resource_usage ResourceUtilization +} + +// Deployment status enum +pub enum DeploymentStatus { + active + pending + stopped + error + maintenance +} + +// Comprehensive user metrics for dashboard +pub struct UserMetrics { +pub mut: + total_spent_this_month f64 // Using f64 for Decimal + active_deployments_count int + resource_utilization ResourceUtilization + cost_trend []int + wallet_balance f64 // Using f64 for Decimal + total_transactions int +} + +// User compute resource for dashboard display +pub struct UserComputeResource { +pub mut: + id string + resource_type string + specs string + location string + status string + sla string + monthly_cost f64 // Using f64 for Decimal + provider string + resource_usage ResourceUtilization +} diff --git a/specs/models_marketplace/mod.v b/specs/models_marketplace/mod.v new file mode 100644 index 0000000..a2cb557 --- /dev/null +++ b/specs/models_marketplace/mod.v @@ -0,0 +1,4 @@ +module models_marketplace + +import models_marketplace.core +import models_marketplace.main