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

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




  

  

  
      
service WidgetAreas {
  rpc WidgetAreaActionCreate (WidgetAreaEntity) returns (WidgetAreaCreateReply) {}
  rpc WidgetAreaActionUpdate (WidgetAreaEntity) returns (WidgetAreaCreateReply) {}

  rpc WidgetAreaActionQuery (QueryFilterRequest) returns (WidgetAreaQueryReply) {}
  rpc WidgetAreaActionGetOne (QueryFilterRequest) returns (WidgetAreaReply) {}
  rpc WidgetAreaActionRemove (QueryFilterRequest) returns (RemoveReply) {}
}

message WidgetAreaCreateReply {
	WidgetAreaEntity data  = 1;
	IError error = 2;
}

message WidgetAreaReply {
	WidgetAreaEntity data = 1;
	IError error = 2;
}

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



;





 
message WidgetAreaEntity {
  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 WidgetAreaEntityPolyglot translations = 7; // @tag(gorm:"foreignKey:LinkerId;references:UniqueId" json:"translations")
  optional string name = 9; // @tag(translate:"true"  yaml:"name"  )

  optional string layouts = 10; // @tag(  yaml:"layouts"  )

  /* This is an object, another entity needs to be created for */
  /*repeated WidgetAreaWidgetsEntity widgets = 11; // @tag(gorm:"foreignKey:LinkerId;references:UniqueId" yaml:"widgets")*/
  repeated WidgetAreaWidgetsEntity widgets = 11; // @tag(gorm:"foreignKey:LinkerId;references:UniqueId" yaml:"widgets")

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

}

/* Because it has translation field, we need a translation table for this */
message WidgetAreaEntityPolyglot {
  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");

}









 
message WidgetAreaWidgetsEntity {
  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 WidgetAreaWidgetsEntityPolyglot translations = 7; // @tag(gorm:"foreignKey:LinkerId;references:UniqueId" json:"translations")
  optional string title = 9; // @tag(translate:"true"  yaml:"title"  )

  /* One 2 one to external entity */
  optional string widgetId  = 11; // @tag(yaml:"widgetId" )
  WidgetEntity widget = 12; // @tag(gorm:"foreignKey:WidgetId;references:UniqueId" json:"widget" yaml:"widget")

  int64 x = 13; // @tag(  yaml:"x"  )

  int64 y = 14; // @tag(  yaml:"y"  )

  int64 w = 15; // @tag(  yaml:"w"  )

  int64 h = 16; // @tag(  yaml:"h"  )

  optional string data = 17; // @tag(  yaml:"data"  )

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

}

/* Because it has translation field, we need a translation table for this */
message WidgetAreaWidgetsEntityPolyglot {
  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 title = 3; // @tag(yaml:"title" json:"title");

}









/**
* 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 Widgets {
  rpc WidgetActionCreate (WidgetEntity) returns (WidgetCreateReply) {}
  rpc WidgetActionUpdate (WidgetEntity) returns (WidgetCreateReply) {}

  rpc WidgetActionQuery (QueryFilterRequest) returns (WidgetQueryReply) {}
  rpc WidgetActionGetOne (QueryFilterRequest) returns (WidgetReply) {}
  rpc WidgetActionRemove (QueryFilterRequest) returns (RemoveReply) {}
}

message WidgetCreateReply {
	WidgetEntity data  = 1;
	IError error = 2;
}

message WidgetReply {
	WidgetEntity data = 1;
	IError error = 2;
}

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







 
message WidgetEntity {
  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 WidgetEntityPolyglot translations = 7; // @tag(gorm:"foreignKey:LinkerId;references:UniqueId" json:"translations")
  optional string name = 9; // @tag(translate:"true"  yaml:"name"  )

  optional string family = 10; // @tag(  yaml:"family"  )

  optional string providerKey = 11; // @tag(  yaml:"providerKey"  )

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

}

/* Because it has translation field, we need a translation table for this */
message WidgetEntityPolyglot {
  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
**/
      


