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

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




  

  

  
      
service GeoCitys {
  rpc GeoCityActionCreate (GeoCityEntity) returns (GeoCityCreateReply) {}
  rpc GeoCityActionUpdate (GeoCityEntity) returns (GeoCityCreateReply) {}

  rpc GeoCityActionQuery (QueryFilterRequest) returns (GeoCityQueryReply) {}
  rpc GeoCityActionGetOne (QueryFilterRequest) returns (GeoCityReply) {}
  rpc GeoCityActionRemove (QueryFilterRequest) returns (RemoveReply) {}
}

message GeoCityCreateReply {
	GeoCityEntity data  = 1;
	IError error = 2;
}

message GeoCityReply {
	GeoCityEntity data = 1;
	IError error = 2;
}

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



;

;

;





 
message GeoCityEntity {
  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 name = 8; // @tag(  yaml:"name"  )

  /* One 2 one to external entity */
  optional string provinceId  = 10; // @tag(yaml:"provinceId" )
  GeoProvinceEntity province = 11; // @tag(gorm:"foreignKey:ProvinceId;references:UniqueId" json:"province" yaml:"province")

  /* One 2 one to external entity */
  optional string stateId  = 13; // @tag(yaml:"stateId" )
  GeoStateEntity state = 14; // @tag(gorm:"foreignKey:StateId;references:UniqueId" json:"state" yaml:"state")

  /* One 2 one to external entity */
  optional string countryId  = 16; // @tag(yaml:"countryId" )
  GeoCountryEntity country = 17; // @tag(gorm:"foreignKey:CountryId;references:UniqueId" json:"country" yaml:"country")

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

}









/**
* 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 GeoCountrys {
  rpc GeoCountryActionCreate (GeoCountryEntity) returns (GeoCountryCreateReply) {}
  rpc GeoCountryActionUpdate (GeoCountryEntity) returns (GeoCountryCreateReply) {}

  rpc GeoCountryActionQuery (QueryFilterRequest) returns (GeoCountryQueryReply) {}
  rpc GeoCountryActionGetOne (QueryFilterRequest) returns (GeoCountryReply) {}
  rpc GeoCountryActionRemove (QueryFilterRequest) returns (RemoveReply) {}
}

message GeoCountryCreateReply {
	GeoCountryEntity data  = 1;
	IError error = 2;
}

message GeoCountryReply {
	GeoCountryEntity data = 1;
	IError error = 2;
}

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







 
message GeoCountryEntity {
  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 GeoCountryEntityPolyglot translations = 7; // @tag(gorm:"foreignKey:LinkerId;references:UniqueId" json:"translations")
  optional string status = 9; // @tag(  yaml:"status"  )

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

  optional string commonName = 11; // @tag(translate:"true"  yaml:"commonName"  )

  optional string officialName = 12; // @tag(translate:"true"  yaml:"officialName"  )

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

}

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

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

}









/**
* 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 GeoProvinces {
  rpc GeoProvinceActionCreate (GeoProvinceEntity) returns (GeoProvinceCreateReply) {}
  rpc GeoProvinceActionUpdate (GeoProvinceEntity) returns (GeoProvinceCreateReply) {}

  rpc GeoProvinceActionQuery (QueryFilterRequest) returns (GeoProvinceQueryReply) {}
  rpc GeoProvinceActionGetOne (QueryFilterRequest) returns (GeoProvinceReply) {}
  rpc GeoProvinceActionRemove (QueryFilterRequest) returns (RemoveReply) {}
}

message GeoProvinceCreateReply {
	GeoProvinceEntity data  = 1;
	IError error = 2;
}

message GeoProvinceReply {
	GeoProvinceEntity data = 1;
	IError error = 2;
}

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



;





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

  /* One 2 one to external entity */
  optional string countryId  = 11; // @tag(yaml:"countryId" )
  GeoCountryEntity country = 12; // @tag(gorm:"foreignKey:CountryId;references:UniqueId" json:"country" yaml:"country")

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

}

/* Because it has translation field, we need a translation table for this */
message GeoProvinceEntityPolyglot {
  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 GeoStates {
  rpc GeoStateActionCreate (GeoStateEntity) returns (GeoStateCreateReply) {}
  rpc GeoStateActionUpdate (GeoStateEntity) returns (GeoStateCreateReply) {}

  rpc GeoStateActionQuery (QueryFilterRequest) returns (GeoStateQueryReply) {}
  rpc GeoStateActionGetOne (QueryFilterRequest) returns (GeoStateReply) {}
  rpc GeoStateActionRemove (QueryFilterRequest) returns (RemoveReply) {}
}

message GeoStateCreateReply {
	GeoStateEntity data  = 1;
	IError error = 2;
}

message GeoStateReply {
	GeoStateEntity data = 1;
	IError error = 2;
}

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







 
message GeoStateEntity {
  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 GeoStateEntityPolyglot 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 GeoStateEntityPolyglot {
  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 LocationDatas {
  rpc LocationDataActionCreate (LocationDataEntity) returns (LocationDataCreateReply) {}
  rpc LocationDataActionUpdate (LocationDataEntity) returns (LocationDataCreateReply) {}

  rpc LocationDataActionQuery (QueryFilterRequest) returns (LocationDataQueryReply) {}
  rpc LocationDataActionGetOne (QueryFilterRequest) returns (LocationDataReply) {}
  rpc LocationDataActionRemove (QueryFilterRequest) returns (RemoveReply) {}
}

message LocationDataCreateReply {
	LocationDataEntity data  = 1;
	IError error = 2;
}

message LocationDataReply {
	LocationDataEntity data = 1;
	IError error = 2;
}

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







 
message LocationDataEntity {
  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")
  double lat = 8; // @tag(  yaml:"lat"  )

  double lng = 9; // @tag(  yaml:"lng"  )

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

  int64 rank = 11; // @tag(gorm:"type:int;name:rank")
  int64 updated = 12; // @tag(gorm:"autoUpdateTime:nano")
  int64 created = 13; // @tag(gorm:"autoUpdateTime:nano")
  string createdFormatted = 14; // @tag(sql:"-")
  string updatedFormatted = 15; // @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
**/
      


