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

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




  

  

  
      
service Currencys {
  rpc CurrencyActionCreate (CurrencyEntity) returns (CurrencyCreateReply) {}
  rpc CurrencyActionUpdate (CurrencyEntity) returns (CurrencyCreateReply) {}

  rpc CurrencyActionQuery (QueryFilterRequest) returns (CurrencyQueryReply) {}
  rpc CurrencyActionGetOne (QueryFilterRequest) returns (CurrencyReply) {}
  rpc CurrencyActionRemove (QueryFilterRequest) returns (RemoveReply) {}
}

message CurrencyCreateReply {
	CurrencyEntity data  = 1;
	IError error = 2;
}

message CurrencyReply {
	CurrencyEntity data = 1;
	IError error = 2;
}

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







 
message CurrencyEntity {
  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")
  optional string symbol = 8; // @tag(  yaml:"symbol"  )

  optional string name = 9; // @tag(  yaml:"name"  )

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

  int64 decimalDigits = 11; // @tag(  yaml:"decimalDigits"  )

  int64 rounding = 12; // @tag(  yaml:"rounding"  )

  optional string code = 13; // @tag(  yaml:"code"  )

  optional string namePlural = 14; // @tag(  yaml:"namePlural"  )

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

}









/**
* 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 PriceTags {
  rpc PriceTagActionCreate (PriceTagEntity) returns (PriceTagCreateReply) {}
  rpc PriceTagActionUpdate (PriceTagEntity) returns (PriceTagCreateReply) {}

  rpc PriceTagActionQuery (QueryFilterRequest) returns (PriceTagQueryReply) {}
  rpc PriceTagActionGetOne (QueryFilterRequest) returns (PriceTagReply) {}
  rpc PriceTagActionRemove (QueryFilterRequest) returns (RemoveReply) {}
}

message PriceTagCreateReply {
	PriceTagEntity data  = 1;
	IError error = 2;
}

message PriceTagReply {
	PriceTagEntity data = 1;
	IError error = 2;
}

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



;





 
message PriceTagEntity {
  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")
  /* This is an object, another entity needs to be created for */
  /*repeated PriceTagVariationEntity variations = 8; // @tag(gorm:"foreignKey:LinkerId;references:UniqueId" yaml:"variations")*/
  repeated PriceTagVariationEntity variations = 8; // @tag(gorm:"foreignKey:LinkerId;references:UniqueId" yaml:"variations")

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

}









 
message PriceTagVariationEntity {
  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")
  /* One 2 one to external entity */
  optional string currencyId  = 9; // @tag(yaml:"currencyId" )
  CurrencyEntity currency = 10; // @tag(gorm:"foreignKey:CurrencyId;references:UniqueId" json:"currency" yaml:"currency")

  double amount = 11; // @tag(  yaml:"amount"  )

  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:"-")

}









/**
* 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
**/
      


