From 3c4d17cf2840c643b8cd111ef775750cc5ae83b3 Mon Sep 17 00:00:00 2001 From: rtkay123 Date: Sun, 27 Jul 2025 18:16:41 +0200 Subject: refactor: profile -> users --- lib/sellershut-core/proto/profile/profile.proto | 57 ------------------ lib/sellershut-core/proto/users/users.proto | 79 +++++++++++++++++++++++++ 2 files changed, 79 insertions(+), 57 deletions(-) delete mode 100644 lib/sellershut-core/proto/profile/profile.proto create mode 100644 lib/sellershut-core/proto/users/users.proto (limited to 'lib/sellershut-core/proto') diff --git a/lib/sellershut-core/proto/profile/profile.proto b/lib/sellershut-core/proto/profile/profile.proto deleted file mode 100644 index 61181b3..0000000 --- a/lib/sellershut-core/proto/profile/profile.proto +++ /dev/null @@ -1,57 +0,0 @@ -syntax = "proto3"; - -package profile; - -import "google/protobuf/timestamp.proto"; - -// A message representing a user profile -message User { - // Unique identifier for the user - string id = 1; - // Email address of the user - string email = 2; - // Unique username chosen by the user - string username = 3; - // URL to the user's avatar image - optional string avatar = 4; - // Timestamp when the user was created - google.protobuf.Timestamp created_at = 5; - // Timestamp when the user was last updated - google.protobuf.Timestamp updated_at = 6; - // User-provided description or bio - optional string description = 7; -} - -// Request message for creating a new user profile -message CreateUserRequest { - // Email address of the new user - string email = 1; - // Avatar for the new user - optional string avatar = 2; -} - -// Response message for CreateUser RPC -message CreateUserResponse { - // Temporary assigned id - string temp_id = 1; -} - -// Message to finalise profile creation -message CompleteUserRequest { - // ID of the user to finalise - string id = 1; - // Required: username to finalise the profile - string username = 2; - // Optional: user-provided description - optional string description = 3; - // Optional: update avatar - optional string avatar = 4; -} - -// Profile gRPC service -service Profile { - // Create a new user profile - rpc CreateUser (CreateUserRequest) returns (CreateUserResponse); - // Complete Profile - rpc CompleteProfile (CompleteUserRequest) returns (User); -} diff --git a/lib/sellershut-core/proto/users/users.proto b/lib/sellershut-core/proto/users/users.proto new file mode 100644 index 0000000..d1cf692 --- /dev/null +++ b/lib/sellershut-core/proto/users/users.proto @@ -0,0 +1,79 @@ +syntax = "proto3"; + +package users; + +import "google/protobuf/timestamp.proto"; + +enum UserType { + PERSON = 0; + APPLICATION = 1; + GROUP = 2; + ORGANIZATION = 3; + SERVICE = 4; +} + +// A message representing a user user +message User { + // Unique identifier for the user + string id = 1; + // Email address of the user + string email = 2; + // Unique username chosen by the user + string username = 3; + // URL to the user's avatar image + optional string avatar = 4; + // Timestamp when the user was created + google.protobuf.Timestamp created_at = 5; + // Timestamp when the user was last updated + google.protobuf.Timestamp updated_at = 6; + // User-provided description or bio + optional string description = 7; + // User type + UserType user_type = 8; + // Public key + string public_key = 9; +} + +// Request message for creating a new user +message CreateUserRequest { + // Email address of the new user + string email = 1; + // Avatar for the new user + optional string avatar = 2; +} + +// Response message for CreateUser RPC +message CreateUserResponse { + // Temporary assigned id + string temp_id = 1; +} + +// Message to finalise user creation +message CompleteUserRequest { + // ID of the user to finalise + string id = 1; + // Required: username to finalise the user + string username = 2; + // Optional: user-provided description + optional string description = 3; + // Optional: update avatar + optional string avatar = 4; + // Inbox URL for this user + string inbox = 5; + // Outbox URL for this user + string outbox = 6; + // Is this user local or remote + bool local = 7; + // Public key for this user + string public_key = 8; + // User type + UserType user_type = 9; +} + +// Users gRPC service +service UsersService { + // Create a new user + rpc CreateUser (CreateUserRequest) returns (CreateUserResponse); + // Complete user + rpc CompleteUser (CompleteUserRequest) returns (User); +} -- cgit v1.2.3