84 lines
		
	
	
		
			2.3 KiB
		
	
	
	
		
			Protocol Buffer
		
	
	
	
	
	
			
		
		
	
	
			84 lines
		
	
	
		
			2.3 KiB
		
	
	
	
		
			Protocol Buffer
		
	
	
	
	
	
| syntax = "proto3";
 | |
| 
 | |
| package proto;
 | |
| 
 | |
| option csharp_namespace = "DysonNetwork.Shared.Proto";
 | |
| 
 | |
| import "google/protobuf/timestamp.proto";
 | |
| import "google/protobuf/empty.proto";
 | |
| import "google/protobuf/field_mask.proto";
 | |
| 
 | |
| // ====================================
 | |
| // Message Definitions
 | |
| // ====================================
 | |
| 
 | |
| // SocialCreditRecord represents a record of social credit changes for an account
 | |
| message SocialCreditRecord {
 | |
|   string id = 1; // UUID string
 | |
|   string reason_type = 2;
 | |
|   string reason = 3;
 | |
|   double delta = 4;
 | |
|   string account_id = 5; // UUID string
 | |
|   google.protobuf.Timestamp created_at = 6;
 | |
|   google.protobuf.Timestamp updated_at = 7;
 | |
| }
 | |
| 
 | |
| // ExperienceRecord represents a record of experience points gained by an account
 | |
| message ExperienceRecord {
 | |
|   string id = 1; // UUID string
 | |
|   string reason_type = 2;
 | |
|   string reason = 3;
 | |
|   int64 delta = 4;
 | |
|   double bonus_multiplier = 5;
 | |
|   string account_id = 6; // UUID string
 | |
|   google.protobuf.Timestamp created_at = 7;
 | |
|   google.protobuf.Timestamp updated_at = 8;
 | |
| }
 | |
| 
 | |
| // ====================================
 | |
| // Request/Response Messages
 | |
| // ====================================
 | |
| 
 | |
| // Social Credit Requests/Responses
 | |
| message AddSocialCreditRecordRequest {
 | |
|   string reason_type = 1;
 | |
|   string reason = 2;
 | |
|   double delta = 3;
 | |
|   string account_id = 4; // UUID string
 | |
| }
 | |
| 
 | |
| message GetSocialCreditRequest {
 | |
|   string account_id = 1; // UUID string
 | |
| }
 | |
| 
 | |
| message SocialCreditResponse {
 | |
|   double amount = 1;
 | |
| }
 | |
| 
 | |
| // Experience Requests/Responses
 | |
| message AddExperienceRecordRequest {
 | |
|   string reason_type = 1;
 | |
|   string reason = 2;
 | |
|   int64 delta = 3;
 | |
|   string account_id = 4; // UUID string
 | |
| }
 | |
| 
 | |
| // ====================================
 | |
| // Service Definitions
 | |
| // ====================================
 | |
| 
 | |
| // SocialCreditService provides operations for managing social credit scores
 | |
| service SocialCreditService {
 | |
|   // Adds a new social credit record for an account
 | |
|   rpc AddRecord(AddSocialCreditRecordRequest) returns (SocialCreditRecord);
 | |
|   
 | |
|   // Gets the current social credit score for an account
 | |
|   rpc GetSocialCredit(GetSocialCreditRequest) returns (SocialCreditResponse);
 | |
| }
 | |
| 
 | |
| // ExperienceService provides operations for managing experience points
 | |
| service ExperienceService {
 | |
|   // Adds a new experience record for an account
 | |
|   rpc AddRecord(AddExperienceRecordRequest) returns (ExperienceRecord);
 | |
| }
 |