From 2688776f52d1cc79d617775172ba90a85b94d172 Mon Sep 17 00:00:00 2001 From: Priec Date: Tue, 7 Jul 2026 23:50:44 +0200 Subject: [PATCH] user can adjust data with versioning from now on --- client | 2 +- common/proto/document_data.proto | 17 ++++ common/src/proto/descriptor.bin | Bin 82029 -> 83457 bytes common/src/proto/komp_ac.document_data.rs | 116 ++++++++++++++++++++++ 4 files changed, 134 insertions(+), 1 deletion(-) diff --git a/client b/client index 3bce44d..25c132a 160000 --- a/client +++ b/client @@ -1 +1 @@ -Subproject commit 3bce44d1459072af1c3bdda0b727bd3ae0756c96 +Subproject commit 25c132a2b1914f782904db021cbb011fff7aae99 diff --git a/common/proto/document_data.proto b/common/proto/document_data.proto index 463941e..6416010 100644 --- a/common/proto/document_data.proto +++ b/common/proto/document_data.proto @@ -3,6 +3,7 @@ package komp_ac.document_data; service DocumentDataService { rpc SaveGeneratedPrintJson(SaveGeneratedPrintJsonRequest) returns (SaveGeneratedPrintJsonResponse); + rpc SaveUserAdjustedPrintJson(SaveUserAdjustedPrintJsonRequest) returns (SaveUserAdjustedPrintJsonResponse); } message SourceRecord { @@ -26,3 +27,19 @@ message SaveGeneratedPrintJsonResponse { int64 snapshot_id = 2; int32 version_number = 3; } + +message SaveUserAdjustedPrintJsonRequest { + int64 document_run_id = 1; + optional int64 schema_id = 2; + repeated SourceRecord source_records = 3; + optional string template_name = 4; + optional string template_kind = 5; + optional string template_path = 6; + string data_json = 7; +} + +message SaveUserAdjustedPrintJsonResponse { + int64 document_run_id = 1; + int64 snapshot_id = 2; + int32 version_number = 3; +} diff --git a/common/src/proto/descriptor.bin b/common/src/proto/descriptor.bin index f6e89ba97c0a15a9f381b993f937bc814040b5fb..5a54d423d74a1eeb8c277dd4efa72da137394e3a 100644 GIT binary patch delta 1748 zcmai!KW`IR6vgM=_r{rwosIo$C!R4I{|^~E9R+kiu?e1!2&?Uvi_C&*{mJ$L5L6I9#H(Y@#Q?tAxW&Yt?uUilxEioQmFoT$$< z8NSnD|K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Z5u=)0~{&!i+*Y9uQi!avz diff --git a/common/src/proto/komp_ac.document_data.rs b/common/src/proto/komp_ac.document_data.rs index e443d79..39fad72 100644 --- a/common/src/proto/komp_ac.document_data.rs +++ b/common/src/proto/komp_ac.document_data.rs @@ -34,6 +34,32 @@ pub struct SaveGeneratedPrintJsonResponse { #[prost(int32, tag = "3")] pub version_number: i32, } +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct SaveUserAdjustedPrintJsonRequest { + #[prost(int64, tag = "1")] + pub document_run_id: i64, + #[prost(int64, optional, tag = "2")] + pub schema_id: ::core::option::Option, + #[prost(message, repeated, tag = "3")] + pub source_records: ::prost::alloc::vec::Vec, + #[prost(string, optional, tag = "4")] + pub template_name: ::core::option::Option<::prost::alloc::string::String>, + #[prost(string, optional, tag = "5")] + pub template_kind: ::core::option::Option<::prost::alloc::string::String>, + #[prost(string, optional, tag = "6")] + pub template_path: ::core::option::Option<::prost::alloc::string::String>, + #[prost(string, tag = "7")] + pub data_json: ::prost::alloc::string::String, +} +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] +pub struct SaveUserAdjustedPrintJsonResponse { + #[prost(int64, tag = "1")] + pub document_run_id: i64, + #[prost(int64, tag = "2")] + pub snapshot_id: i64, + #[prost(int32, tag = "3")] + pub version_number: i32, +} /// Generated client implementations. pub mod document_data_service_client { #![allow( @@ -154,6 +180,35 @@ pub mod document_data_service_client { ); self.inner.unary(req, path, codec).await } + pub async fn save_user_adjusted_print_json( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + 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.document_data.DocumentDataService/SaveUserAdjustedPrintJson", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new( + "komp_ac.document_data.DocumentDataService", + "SaveUserAdjustedPrintJson", + ), + ); + self.inner.unary(req, path, codec).await + } } } /// Generated server implementations. @@ -176,6 +231,13 @@ pub mod document_data_service_server { tonic::Response, tonic::Status, >; + async fn save_user_adjusted_print_json( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; } #[derive(Debug)] pub struct DocumentDataServiceServer { @@ -302,6 +364,60 @@ pub mod document_data_service_server { }; Box::pin(fut) } + "/komp_ac.document_data.DocumentDataService/SaveUserAdjustedPrintJson" => { + #[allow(non_camel_case_types)] + struct SaveUserAdjustedPrintJsonSvc( + pub Arc, + ); + impl< + T: DocumentDataService, + > tonic::server::UnaryService< + super::SaveUserAdjustedPrintJsonRequest, + > for SaveUserAdjustedPrintJsonSvc { + type Response = super::SaveUserAdjustedPrintJsonResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request< + super::SaveUserAdjustedPrintJsonRequest, + >, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::save_user_adjusted_print_json( + &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 = SaveUserAdjustedPrintJsonSvc(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) + } _ => { Box::pin(async move { let mut response = http::Response::new(