...
This commit is contained in:
		
							
								
								
									
										31
									
								
								specs/models_threefold/main/secretbox.v
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										31
									
								
								specs/models_threefold/main/secretbox.v
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,31 @@
 | 
			
		||||
module main
 | 
			
		||||
 | 
			
		||||
pub struct SecretBox {
 | 
			
		||||
pub mut:
 | 
			
		||||
	notary_id   u32 // person who is allowed to decrypt this info
 | 
			
		||||
	value	string //the actual incrypted value
 | 
			
		||||
	version u16 //version of the schema used to encrypt this value
 | 
			
		||||
	timestamp      u64
 | 
			
		||||
	cat SecretBoxCategory //category of the secret box, e.g. profile
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
pub enum SecretBoxCategory {
 | 
			
		||||
	profile
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
pub struct Notary {
 | 
			
		||||
	core.Base
 | 
			
		||||
pub mut:
 | 
			
		||||
	userid 	u32 // Reference to the user entity @[index]
 | 
			
		||||
	status        NotaryStatus // Current user status
 | 
			
		||||
	myceliumaddress string // Mycelium address of the notary
 | 
			
		||||
	pubkey string // Public key for cryptographic operations @[index]
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
pub enum NotaryStatus {
 | 
			
		||||
	active
 | 
			
		||||
	inactive
 | 
			
		||||
	suspended
 | 
			
		||||
	archived
 | 
			
		||||
	error
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										32
									
								
								specs/models_threefold/main/signature.v
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										32
									
								
								specs/models_threefold/main/signature.v
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,32 @@
 | 
			
		||||
module circle
 | 
			
		||||
 | 
			
		||||
import freeflowuniverse.herolib.hero.models.core
 | 
			
		||||
 | 
			
		||||
// Wallet represents a wallet associated with a circle for financial operations
 | 
			
		||||
pub struct Signature {
 | 
			
		||||
	core.Base
 | 
			
		||||
pub mut:
 | 
			
		||||
	signature_id   u32 // Reference to the user who created the signature @[index]
 | 
			
		||||
	user_id		u32 // Reference to the user who created the signature @[index]
 | 
			
		||||
	value		  string // The actual signature value
 | 
			
		||||
	objectid       u32 // Reference to the user who created the signature @[index]
 | 
			
		||||
	objecttype     ObjectType // Type of object being signed (e.g.,
 | 
			
		||||
	status         SignatureStatus
 | 
			
		||||
	timestamp      u64
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
pub enum SignatureStatus {
 | 
			
		||||
	active
 | 
			
		||||
	inactive
 | 
			
		||||
	pending
 | 
			
		||||
	revoked
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
pub enum ObjectType {
 | 
			
		||||
	account
 | 
			
		||||
	dnsrecord
 | 
			
		||||
	membership
 | 
			
		||||
	user
 | 
			
		||||
	transaction
 | 
			
		||||
	kyc
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										29
									
								
								specs/models_threefold/main/user.v
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										29
									
								
								specs/models_threefold/main/user.v
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,29 @@
 | 
			
		||||
module circle
 | 
			
		||||
 | 
			
		||||
import freeflowuniverse.herolib.hero.models.core
 | 
			
		||||
 | 
			
		||||
//is a user in the system, most of info is in models_heroledger
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
pub struct User {
 | 
			
		||||
	core.Base
 | 
			
		||||
pub mut:
 | 
			
		||||
	username     string       // Unique username for the user @[index]
 | 
			
		||||
	pubkey 	 string       // Public key for cryptographic operations @[index]
 | 
			
		||||
	status        UserStatus // Current user status
 | 
			
		||||
	kyc 	KYCStatus // Know Your Customer status
 | 
			
		||||
 }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
pub enum UserStatus {
 | 
			
		||||
	active
 | 
			
		||||
	inactive
 | 
			
		||||
	suspended
 | 
			
		||||
	archived
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
pub enum KYCStatus {
 | 
			
		||||
	pending
 | 
			
		||||
	approved
 | 
			
		||||
	rejected
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										22
									
								
								specs/models_threefold/main/user_kvs.v
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										22
									
								
								specs/models_threefold/main/user_kvs.v
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,22 @@
 | 
			
		||||
module circle
 | 
			
		||||
 | 
			
		||||
import freeflowuniverse.herolib.hero.models.core
 | 
			
		||||
 | 
			
		||||
//a per user db
 | 
			
		||||
pub struct UserKVS {
 | 
			
		||||
	core.Base
 | 
			
		||||
pub mut:
 | 
			
		||||
	userid	 u32          // Reference to the user entity @[index]
 | 
			
		||||
	name string	   // Name of the key-value store
 | 
			
		||||
 }
 | 
			
		||||
 | 
			
		||||
pub struct UserKVSItem {
 | 
			
		||||
	core.Base
 | 
			
		||||
pub mut:
 | 
			
		||||
	userkvs_id	 u32          // Reference to the user entity @[index]
 | 
			
		||||
	key string
 | 
			
		||||
	value string       // Value associated with the key
 | 
			
		||||
	secretbox []SecretBox // Optional secret boxes for sensitive data
 | 
			
		||||
	timestamp      u64 // Timestamp when the item was created or last updated
 | 
			
		||||
 }
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user