syntax = "proto3";

message RoleInfo {
  int64 ID = 1;
  string status = 2;
  string created_at = 3;
  string updated_at = 4;
  string code = 5;
  string name = 6;
  string description = 7;

  repeated UserInfo users = 10;
}

message RoleReq {
  int64 ID = 1;
  string name = 2;
  string code = 3;

  bool with_user = 4;

  optional Pagination page = 10;
}

message RoleListResp {
  optional Pagination page = 1;
  repeated RoleInfo data = 2;
}

service Core {
  // Role management
  // group: role
  rpc createRole (RoleInfo) returns (BaseIDResp);
  // group: role
  rpc updateRole (RoleInfo) returns (BaseResp);
  // group: role
  rpc getRoleList (RoleReq) returns (RoleListResp);
  // group: role
  rpc getRole (RoleReq) returns (RoleInfo);
  // group: role
  rpc deleteRole (IDsReq) returns (BaseResp);
}