custom ecb is dynamic table and not system table from now on2
This commit is contained in:
@@ -14,6 +14,10 @@ service TableDefinition {
|
||||
// Also inserts metadata and default validation rules. Entirely transactional.
|
||||
rpc PostTableDefinition(PostTableDefinitionRequest) returns (TableDefinitionResponse);
|
||||
|
||||
// Explicitly creates the optional administrator-managed exchange-rate table
|
||||
// in an existing profile. The server owns its core shape and constraints.
|
||||
rpc CreateCustomExchangeRatesTable(CreateCustomExchangeRatesTableRequest) returns (CreateCustomExchangeRatesTableResponse);
|
||||
|
||||
// Creates a regular user-table bundle from the restricted komp_ac_fields
|
||||
// contract embedded in a Typst invoice template. This is invoked explicitly
|
||||
// by the user; templates do not provision tables merely by existing.
|
||||
@@ -53,14 +57,23 @@ service TableDefinition {
|
||||
rpc DeleteTable(DeleteTableRequest) returns (DeleteTableResponse);
|
||||
}
|
||||
|
||||
message CreateCustomExchangeRatesTableRequest {
|
||||
string profile_name = 1;
|
||||
}
|
||||
|
||||
message CreateCustomExchangeRatesTableResponse {
|
||||
int64 table_definition_id = 1;
|
||||
bool created = 2;
|
||||
}
|
||||
|
||||
// Defines the input for creating a new table definition.
|
||||
message PostTableDefinitionRequest {
|
||||
// Table name to create inside the target profile.
|
||||
// Must be lowercase, alphanumeric with underscores,
|
||||
// start with a letter, and be <= 63 chars.
|
||||
// Forbidden names: "id", "deleted", "created_at", "row_revision" -- the
|
||||
// system columns, which share one namespace with table names wherever the
|
||||
// two are named side by side. The "_id" suffix is allowed.
|
||||
// Forbidden names include the system columns and tables owned by dedicated
|
||||
// server operations, such as "custom_exchange_rates". The "_id" suffix is
|
||||
// allowed.
|
||||
string table_name = 1;
|
||||
|
||||
// The table's columns, including its links and stored linked projections.
|
||||
|
||||
Binary file not shown.
@@ -1,4 +1,16 @@
|
||||
// This file is @generated by prost-build.
|
||||
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
|
||||
pub struct CreateCustomExchangeRatesTableRequest {
|
||||
#[prost(string, tag = "1")]
|
||||
pub profile_name: ::prost::alloc::string::String,
|
||||
}
|
||||
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
|
||||
pub struct CreateCustomExchangeRatesTableResponse {
|
||||
#[prost(int64, tag = "1")]
|
||||
pub table_definition_id: i64,
|
||||
#[prost(bool, tag = "2")]
|
||||
pub created: bool,
|
||||
}
|
||||
/// Defines the input for creating a new table definition.
|
||||
#[derive(serde::Serialize, serde::Deserialize)]
|
||||
#[derive(Clone, PartialEq, ::prost::Message)]
|
||||
@@ -6,9 +18,9 @@ pub struct PostTableDefinitionRequest {
|
||||
/// Table name to create inside the target profile.
|
||||
/// Must be lowercase, alphanumeric with underscores,
|
||||
/// start with a letter, and be \<= 63 chars.
|
||||
/// Forbidden names: "id", "deleted", "created_at", "row_revision" -- the
|
||||
/// system columns, which share one namespace with table names wherever the
|
||||
/// two are named side by side. The "\_id" suffix is allowed.
|
||||
/// Forbidden names include the system columns and tables owned by dedicated
|
||||
/// server operations, such as "custom_exchange_rates". The "\_id" suffix is
|
||||
/// allowed.
|
||||
#[prost(string, tag = "1")]
|
||||
pub table_name: ::prost::alloc::string::String,
|
||||
/// The table's columns, including its links and stored linked projections.
|
||||
@@ -778,6 +790,39 @@ pub mod table_definition_client {
|
||||
);
|
||||
self.inner.unary(req, path, codec).await
|
||||
}
|
||||
/// Explicitly creates the optional administrator-managed exchange-rate table
|
||||
/// in an existing profile. The server owns its core shape and constraints.
|
||||
pub async fn create_custom_exchange_rates_table(
|
||||
&mut self,
|
||||
request: impl tonic::IntoRequest<
|
||||
super::CreateCustomExchangeRatesTableRequest,
|
||||
>,
|
||||
) -> std::result::Result<
|
||||
tonic::Response<super::CreateCustomExchangeRatesTableResponse>,
|
||||
tonic::Status,
|
||||
> {
|
||||
self.inner
|
||||
.ready()
|
||||
.await
|
||||
.map_err(|e| {
|
||||
tonic::Status::unknown(
|
||||
format!("Service was not ready: {}", e.into()),
|
||||
)
|
||||
})?;
|
||||
let codec = tonic_prost::ProstCodec::default();
|
||||
let path = http::uri::PathAndQuery::from_static(
|
||||
"/komp_ac.table_definition.TableDefinition/CreateCustomExchangeRatesTable",
|
||||
);
|
||||
let mut req = request.into_request();
|
||||
req.extensions_mut()
|
||||
.insert(
|
||||
GrpcMethod::new(
|
||||
"komp_ac.table_definition.TableDefinition",
|
||||
"CreateCustomExchangeRatesTable",
|
||||
),
|
||||
);
|
||||
self.inner.unary(req, path, codec).await
|
||||
}
|
||||
/// Creates a regular user-table bundle from the restricted komp_ac_fields
|
||||
/// contract embedded in a Typst invoice template. This is invoked explicitly
|
||||
/// by the user; templates do not provision tables merely by existing.
|
||||
@@ -1111,6 +1156,15 @@ pub mod table_definition_server {
|
||||
tonic::Response<super::TableDefinitionResponse>,
|
||||
tonic::Status,
|
||||
>;
|
||||
/// Explicitly creates the optional administrator-managed exchange-rate table
|
||||
/// in an existing profile. The server owns its core shape and constraints.
|
||||
async fn create_custom_exchange_rates_table(
|
||||
&self,
|
||||
request: tonic::Request<super::CreateCustomExchangeRatesTableRequest>,
|
||||
) -> std::result::Result<
|
||||
tonic::Response<super::CreateCustomExchangeRatesTableResponse>,
|
||||
tonic::Status,
|
||||
>;
|
||||
/// Creates a regular user-table bundle from the restricted komp_ac_fields
|
||||
/// contract embedded in a Typst invoice template. This is invoked explicitly
|
||||
/// by the user; templates do not provision tables merely by existing.
|
||||
@@ -1329,6 +1383,60 @@ pub mod table_definition_server {
|
||||
};
|
||||
Box::pin(fut)
|
||||
}
|
||||
"/komp_ac.table_definition.TableDefinition/CreateCustomExchangeRatesTable" => {
|
||||
#[allow(non_camel_case_types)]
|
||||
struct CreateCustomExchangeRatesTableSvc<T: TableDefinition>(
|
||||
pub Arc<T>,
|
||||
);
|
||||
impl<
|
||||
T: TableDefinition,
|
||||
> tonic::server::UnaryService<
|
||||
super::CreateCustomExchangeRatesTableRequest,
|
||||
> for CreateCustomExchangeRatesTableSvc<T> {
|
||||
type Response = super::CreateCustomExchangeRatesTableResponse;
|
||||
type Future = BoxFuture<
|
||||
tonic::Response<Self::Response>,
|
||||
tonic::Status,
|
||||
>;
|
||||
fn call(
|
||||
&mut self,
|
||||
request: tonic::Request<
|
||||
super::CreateCustomExchangeRatesTableRequest,
|
||||
>,
|
||||
) -> Self::Future {
|
||||
let inner = Arc::clone(&self.0);
|
||||
let fut = async move {
|
||||
<T as TableDefinition>::create_custom_exchange_rates_table(
|
||||
&inner,
|
||||
request,
|
||||
)
|
||||
.await
|
||||
};
|
||||
Box::pin(fut)
|
||||
}
|
||||
}
|
||||
let accept_compression_encodings = self.accept_compression_encodings;
|
||||
let send_compression_encodings = self.send_compression_encodings;
|
||||
let max_decoding_message_size = self.max_decoding_message_size;
|
||||
let max_encoding_message_size = self.max_encoding_message_size;
|
||||
let inner = self.inner.clone();
|
||||
let fut = async move {
|
||||
let method = CreateCustomExchangeRatesTableSvc(inner);
|
||||
let codec = tonic_prost::ProstCodec::default();
|
||||
let mut grpc = tonic::server::Grpc::new(codec)
|
||||
.apply_compression_config(
|
||||
accept_compression_encodings,
|
||||
send_compression_encodings,
|
||||
)
|
||||
.apply_max_message_size_config(
|
||||
max_decoding_message_size,
|
||||
max_encoding_message_size,
|
||||
);
|
||||
let res = grpc.unary(method, req).await;
|
||||
Ok(res)
|
||||
};
|
||||
Box::pin(fut)
|
||||
}
|
||||
"/komp_ac.table_definition.TableDefinition/CreateInvoiceTemplateTable" => {
|
||||
#[allow(non_camel_case_types)]
|
||||
struct CreateInvoiceTemplateTableSvc<T: TableDefinition>(pub Arc<T>);
|
||||
|
||||
Reference in New Issue
Block a user