boolean quantity ledger
This commit is contained in:
@@ -157,6 +157,10 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
|
|||||||
".komp_ac.table_definition.ColumnDefinition",
|
".komp_ac.table_definition.ColumnDefinition",
|
||||||
"#[derive(serde::Serialize, serde::Deserialize)]",
|
"#[derive(serde::Serialize, serde::Deserialize)]",
|
||||||
)
|
)
|
||||||
|
.field_attribute(
|
||||||
|
".komp_ac.table_definition.ColumnDefinition.boolean_ledger_operator",
|
||||||
|
"#[serde(default)]",
|
||||||
|
)
|
||||||
.type_attribute(
|
.type_attribute(
|
||||||
".komp_ac.table_definition.PostTableDefinitionRequest",
|
".komp_ac.table_definition.PostTableDefinitionRequest",
|
||||||
"#[derive(serde::Serialize, serde::Deserialize)]",
|
"#[derive(serde::Serialize, serde::Deserialize)]",
|
||||||
|
|||||||
@@ -291,8 +291,8 @@ message ColumnDefinition {
|
|||||||
// MONEY rounding applied before a value is stored.
|
// MONEY rounding applied before a value is stored.
|
||||||
MoneyRounding rounding = 3;
|
MoneyRounding rounding = 3;
|
||||||
|
|
||||||
// When true, this numeric column is server-owned and projected from the
|
// When true, this numeric or Boolean column is server-owned and projected
|
||||||
// profile quantity ledger.
|
// from ledger contributions.
|
||||||
bool quantity_ledger = 4;
|
bool quantity_ledger = 4;
|
||||||
|
|
||||||
// Canonical uppercase ISO-4217 currency code. Required for MONEY and forbidden
|
// Canonical uppercase ISO-4217 currency code. Required for MONEY and forbidden
|
||||||
@@ -301,6 +301,16 @@ message ColumnDefinition {
|
|||||||
|
|
||||||
// When true, the server rejects omitted or explicitly null values.
|
// When true, the server rejects omitted or explicitly null values.
|
||||||
bool required = 6;
|
bool required = 6;
|
||||||
|
|
||||||
|
// Required for Boolean ledger columns and forbidden otherwise. ANY means
|
||||||
|
// one true contribution wins; ALL means one false contribution wins.
|
||||||
|
BooleanLedgerOperator boolean_ledger_operator = 7;
|
||||||
|
}
|
||||||
|
|
||||||
|
enum BooleanLedgerOperator {
|
||||||
|
BOOLEAN_LEDGER_OPERATOR_UNSPECIFIED = 0;
|
||||||
|
BOOLEAN_LEDGER_OPERATOR_ANY = 1;
|
||||||
|
BOOLEAN_LEDGER_OPERATOR_ALL = 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Response after table creation (success + DDL preview).
|
// Response after table creation (success + DDL preview).
|
||||||
|
|||||||
Binary file not shown.
@@ -255,8 +255,8 @@ pub struct ColumnDefinition {
|
|||||||
/// MONEY rounding applied before a value is stored.
|
/// MONEY rounding applied before a value is stored.
|
||||||
#[prost(enumeration = "MoneyRounding", tag = "3")]
|
#[prost(enumeration = "MoneyRounding", tag = "3")]
|
||||||
pub rounding: i32,
|
pub rounding: i32,
|
||||||
/// When true, this numeric column is server-owned and projected from the
|
/// When true, this numeric or Boolean column is server-owned and projected
|
||||||
/// profile quantity ledger.
|
/// from ledger contributions.
|
||||||
#[prost(bool, tag = "4")]
|
#[prost(bool, tag = "4")]
|
||||||
pub quantity_ledger: bool,
|
pub quantity_ledger: bool,
|
||||||
/// Canonical uppercase ISO-4217 currency code. Required for MONEY and forbidden
|
/// Canonical uppercase ISO-4217 currency code. Required for MONEY and forbidden
|
||||||
@@ -266,6 +266,11 @@ pub struct ColumnDefinition {
|
|||||||
/// When true, the server rejects omitted or explicitly null values.
|
/// When true, the server rejects omitted or explicitly null values.
|
||||||
#[prost(bool, tag = "6")]
|
#[prost(bool, tag = "6")]
|
||||||
pub required: bool,
|
pub required: bool,
|
||||||
|
/// Required for Boolean ledger columns and forbidden otherwise. ANY means
|
||||||
|
/// one true contribution wins; ALL means one false contribution wins.
|
||||||
|
#[prost(enumeration = "BooleanLedgerOperator", tag = "7")]
|
||||||
|
#[serde(default)]
|
||||||
|
pub boolean_ledger_operator: i32,
|
||||||
}
|
}
|
||||||
/// Response after table creation (success + DDL preview).
|
/// Response after table creation (success + DDL preview).
|
||||||
#[derive(serde::Serialize, serde::Deserialize)]
|
#[derive(serde::Serialize, serde::Deserialize)]
|
||||||
@@ -677,6 +682,35 @@ impl MoneyRounding {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
|
||||||
|
#[repr(i32)]
|
||||||
|
pub enum BooleanLedgerOperator {
|
||||||
|
Unspecified = 0,
|
||||||
|
Any = 1,
|
||||||
|
All = 2,
|
||||||
|
}
|
||||||
|
impl BooleanLedgerOperator {
|
||||||
|
/// String value of the enum field names used in the ProtoBuf definition.
|
||||||
|
///
|
||||||
|
/// The values are not transformed in any way and thus are considered stable
|
||||||
|
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
|
||||||
|
pub fn as_str_name(&self) -> &'static str {
|
||||||
|
match self {
|
||||||
|
Self::Unspecified => "BOOLEAN_LEDGER_OPERATOR_UNSPECIFIED",
|
||||||
|
Self::Any => "BOOLEAN_LEDGER_OPERATOR_ANY",
|
||||||
|
Self::All => "BOOLEAN_LEDGER_OPERATOR_ALL",
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/// Creates an enum from field names used in the ProtoBuf definition.
|
||||||
|
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
|
||||||
|
match value {
|
||||||
|
"BOOLEAN_LEDGER_OPERATOR_UNSPECIFIED" => Some(Self::Unspecified),
|
||||||
|
"BOOLEAN_LEDGER_OPERATOR_ANY" => Some(Self::Any),
|
||||||
|
"BOOLEAN_LEDGER_OPERATOR_ALL" => Some(Self::All),
|
||||||
|
_ => None,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
/// How a column type is spelled in ColumnDefinition.field_type.
|
/// How a column type is spelled in ColumnDefinition.field_type.
|
||||||
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
|
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
|
||||||
#[repr(i32)]
|
#[repr(i32)]
|
||||||
|
|||||||
2
server
2
server
Submodule server updated: 3b4f7ee71e...554e98ec11
Reference in New Issue
Block a user