syntax = "proto3";
    option go_package = "./artifacts/academy-server/release-tsjs/modules/skillset";

import "artifacts/academy-server/release-tsjs/core/common.proto";
import "artifacts/academy-server/release-tsjs/modules/drive/index.proto";




  

  

  
      
service SkillsetCategorys {
  rpc SkillsetCategoryActionCreate (SkillsetCategoryEntity) returns (SkillsetCategoryCreateReply) {}
  rpc SkillsetCategoryActionUpdate (SkillsetCategoryEntity) returns (SkillsetCategoryCreateReply) {}

  rpc SkillsetCategoryActionQuery (QueryFilterRequest) returns (SkillsetCategoryQueryReply) {}
  rpc SkillsetCategoryActionGetOne (QueryFilterRequest) returns (SkillsetCategoryReply) {}
  rpc SkillsetCategoryActionRemove (QueryFilterRequest) returns (RemoveReply) {}
}

message SkillsetCategoryCreateReply {
	SkillsetCategoryEntity data  = 1;
	IError error = 2;
}

message SkillsetCategoryReply {
	SkillsetCategoryEntity data = 1;
	IError error = 2;
}

message SkillsetCategoryQueryReply {
	repeated SkillsetCategoryEntity items = 1;
	int64 totalItems = 2;
	int64 itemsPerPage = 3;
	int64 startIndex = 4;
	IError error = 5;
}







 
message SkillsetCategoryEntity {
  optional string visibility = 1; // @tag(yaml:"visibility")
  optional string workspaceId = 2; // @tag(yaml:"workspaceId")
  optional string linkerId = 3; // @tag(yaml:"linkerId")
  optional string parentId = 4; // @tag(yaml:"parentId")
  string uniqueId = 5; // @tag(gorm:"primarykey;uniqueId;unique;not null;size:100;" yaml:"uniqueId")
  optional string userId = 6; // @tag(yaml:"userId")
  repeated SkillsetCategoryEntityPolyglot translations = 7; // @tag(gorm:"foreignKey:LinkerId;references:UniqueId" json:"translations")
  optional string name = 9; // @tag(translate:"true"  yaml:"name"  )

  int64 rank = 10; // @tag(gorm:"type:int;name:rank")
  int64 updated = 11; // @tag(gorm:"autoUpdateTime:nano")
  int64 created = 12; // @tag(gorm:"autoUpdateTime:nano")
  string createdFormatted = 13; // @tag(sql:"-")
  string updatedFormatted = 14; // @tag(sql:"-")

}

/* Because it has translation field, we need a translation table for this */
message SkillsetCategoryEntityPolyglot {
  string linkerId = 1; // @tag(gorm:"uniqueId;not null;size:100;" json:"linkerId" yaml:"linkerId")
  string languageId = 2; // @tag(gorm:"uniqueId;not null;size:100;" json:"languageId" yaml:"languageId")

  string name = 3; // @tag(yaml:"name" json:"name");

}









/**
* Add your custom services, and messages here.
* It can be your dto for example. 
* - Use Module.yml for entities, otherwise it won't be managed
* - Don't use this file for entities might be queried by web
**/
      




  

  

  
      
service Skillsets {
  rpc SkillsetActionCreate (SkillsetEntity) returns (SkillsetCreateReply) {}
  rpc SkillsetActionUpdate (SkillsetEntity) returns (SkillsetCreateReply) {}

  rpc SkillsetActionQuery (QueryFilterRequest) returns (SkillsetQueryReply) {}
  rpc SkillsetActionGetOne (QueryFilterRequest) returns (SkillsetReply) {}
  rpc SkillsetActionRemove (QueryFilterRequest) returns (RemoveReply) {}
}

message SkillsetCreateReply {
	SkillsetEntity data  = 1;
	IError error = 2;
}

message SkillsetReply {
	SkillsetEntity data = 1;
	IError error = 2;
}

message SkillsetQueryReply {
	repeated SkillsetEntity items = 1;
	int64 totalItems = 2;
	int64 itemsPerPage = 3;
	int64 startIndex = 4;
	IError error = 5;
}




;

;





 
message SkillsetEntity {
  optional string visibility = 1; // @tag(yaml:"visibility")
  optional string workspaceId = 2; // @tag(yaml:"workspaceId")
  optional string linkerId = 3; // @tag(yaml:"linkerId")
  optional string parentId = 4; // @tag(yaml:"parentId")
  string uniqueId = 5; // @tag(gorm:"primarykey;uniqueId;unique;not null;size:100;" yaml:"uniqueId")
  optional string userId = 6; // @tag(yaml:"userId")
  repeated SkillsetEntityPolyglot translations = 7; // @tag(gorm:"foreignKey:LinkerId;references:UniqueId" json:"translations")
  optional string name = 9; // @tag(translate:"true"  yaml:"name"  )

  optional string description = 10; // @tag(translate:"true"  yaml:"description"  )

  /* Many 2 many entities */
  repeated string attachmentsListId  = 12; // @tag(gorm:"-" sql:"-" yaml:"attachmentsListId")
  repeated FileEntity attachments = 13; // @tag(gorm:"many2many:skillset_attachments;foreignKey:UniqueId;references:UniqueId" yaml:"attachments")

  /* One 2 one to external entity */
  optional string categoryId  = 15; // @tag(yaml:"categoryId" )
  SkillsetCategoryEntity category = 16; // @tag(gorm:"foreignKey:CategoryId;references:UniqueId" json:"category" yaml:"category")

  int64 rank = 17; // @tag(gorm:"type:int;name:rank")
  int64 updated = 18; // @tag(gorm:"autoUpdateTime:nano")
  int64 created = 19; // @tag(gorm:"autoUpdateTime:nano")
  string createdFormatted = 20; // @tag(sql:"-")
  string updatedFormatted = 21; // @tag(sql:"-")

}

/* Because it has translation field, we need a translation table for this */
message SkillsetEntityPolyglot {
  string linkerId = 1; // @tag(gorm:"uniqueId;not null;size:100;" json:"linkerId" yaml:"linkerId")
  string languageId = 2; // @tag(gorm:"uniqueId;not null;size:100;" json:"languageId" yaml:"languageId")

  string name = 3; // @tag(yaml:"name" json:"name");

  string description = 4; // @tag(yaml:"description" json:"description");

}









/**
* Add your custom services, and messages here.
* It can be your dto for example. 
* - Use Module.yml for entities, otherwise it won't be managed
* - Don't use this file for entities might be queried by web
**/
      


