model spec
This commit is contained in:
		
							
								
								
									
										36
									
								
								specs/models/circle/domainnames.v
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										36
									
								
								specs/models/circle/domainnames.v
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,36 @@
 | 
			
		||||
module circle
 | 
			
		||||
 | 
			
		||||
import base
 | 
			
		||||
 | 
			
		||||
// Define the RecordType enum
 | 
			
		||||
pub enum RecordType {
 | 
			
		||||
	a
 | 
			
		||||
	aaa
 | 
			
		||||
	cname
 | 
			
		||||
	mx
 | 
			
		||||
	ns
 | 
			
		||||
	ptr
 | 
			
		||||
	soa
 | 
			
		||||
	srv
 | 
			
		||||
	txt
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// Define the DomainNamespace struct, represents a full domain with all its records
 | 
			
		||||
pub struct DomainNameSpace {
 | 
			
		||||
	base.Base
 | 
			
		||||
pub mut:
 | 
			
		||||
	id          u32
 | 
			
		||||
	domain      string
 | 
			
		||||
	description string
 | 
			
		||||
	records     []Record
 | 
			
		||||
	admins      []u32 // IDs of the admins they need to exist as user in the circle
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// Define the Record struct
 | 
			
		||||
pub struct Record {
 | 
			
		||||
pub mut:
 | 
			
		||||
	name     string
 | 
			
		||||
	text     string
 | 
			
		||||
	category RecordType
 | 
			
		||||
	addr     []string
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										12
									
								
								specs/models/circle/group.v
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										12
									
								
								specs/models/circle/group.v
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,12 @@
 | 
			
		||||
module circle
 | 
			
		||||
 | 
			
		||||
import base
 | 
			
		||||
 | 
			
		||||
// there is one group called "everyone" which is the default group for all members and their roles
 | 
			
		||||
pub struct Group {
 | 
			
		||||
	base.Base
 | 
			
		||||
pub mut:
 | 
			
		||||
	name        string // name of the group in a circle, the one "everyone" is the default group
 | 
			
		||||
	description string // optional description
 | 
			
		||||
	members     []u32  // pointers to the members of this group
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										27
									
								
								specs/models/circle/user.v
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										27
									
								
								specs/models/circle/user.v
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,27 @@
 | 
			
		||||
module circle
 | 
			
		||||
 | 
			
		||||
// import freeflowuniverse.herolib.data.ourtime
 | 
			
		||||
import base
 | 
			
		||||
 | 
			
		||||
// Role represents the role of a member in a circle
 | 
			
		||||
pub enum Role {
 | 
			
		||||
	admin
 | 
			
		||||
	stakeholder
 | 
			
		||||
	member
 | 
			
		||||
	contributor
 | 
			
		||||
	guest
 | 
			
		||||
	external // means no right in this circle appart from we register this user
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// Member represents a member of a circle
 | 
			
		||||
pub struct User {
 | 
			
		||||
	base.Base
 | 
			
		||||
pub mut:
 | 
			
		||||
	name        string // name of the member as used in this circle
 | 
			
		||||
	description string // optional description which is relevant to this circle
 | 
			
		||||
	role        Role   // role of the member in the circle
 | 
			
		||||
	contact_ids []u32  // IDs of contacts linked to this member
 | 
			
		||||
	wallet_ids  []u32  // IDs of wallets owned by this member which are relevant to this circle
 | 
			
		||||
	pubkey      string // public key of the member as used in this circle
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user