diff --git a/AGENTS.md b/AGENTS.md new file mode 100644 index 00000000..03ca2431 --- /dev/null +++ b/AGENTS.md @@ -0,0 +1,4 @@ +# Repository agent rules + +- Never run `cargo fmt`, `rustfmt`, or any other automatic code-formatting command in this repository, including commands scoped to individual files or packages. +- Preserve existing formatting. Make only the smallest hand-edited changes required for the task. diff --git a/README.md b/README.md index 5522e43c..6e1f5d06 100644 --- a/README.md +++ b/README.md @@ -3,10 +3,6 @@ TUI accounting system. Client/server application with two extracted open-source libraries. -Column designers default to unconstrained exact decimals. The legacy-compatible -fixed-scale form is an explicit advanced option; see -[`docs/fixed-scale-decimal.md`](docs/fixed-scale-decimal.md). - ## Crates | Crate | What | Published | diff --git a/client b/client index 1e0b6f9e..fbf3ff93 160000 --- a/client +++ b/client @@ -1 +1 @@ -Subproject commit 1e0b6f9edea67aaafc99acdbec0cd55dcadb8f05 +Subproject commit fbf3ff93bd5486a893203d03ca422474201c0649 diff --git a/client-server-drift.md b/client-server-drift.md index 0ce2d7b9..9ff94b9a 100644 --- a/client-server-drift.md +++ b/client-server-drift.md @@ -36,8 +36,8 @@ So legal columns are blocked at creation, hidden in forms, or misrendered as lin **7. Link detection is by name, not by type.** Links are now a declarable `LINK(table)` column type with arbitrary names and multiple links to the same target allowed (751bfd9, 0d78556). The client decides `is_link` purely from the `_id` suffix: a LINK column named `customer` renders as a plain BIGINT text field with no picker, and a non-link column named e.g. `invoice_id` is hidden or misdetected as a link. (Child-reference resolution does use the new `Dependency.column_name` — `ui_service.rs:204–222` — that part is synced.) -**8. The add-table form cannot create LINK or parameterized DECIMAL columns.** -The Relations pane lists available tables but selection is display-only (`add_table/data.rs:376`, `ui.rs:311`) — nothing is added to the request. The column-type input only accepts bare spellings (`supports_column_type` requires `ColumnTypeSpelling::Bare`), and a test asserts `decimal(10,2)` is rejected (`add_table/state.rs:589`). The server's `ListColumnTypes` advertises the Decimal and Link spellings. The two argument-taking types the server supports are uncreatable from the client. +**8. The add-table form cannot create LINK columns.** +The Relations pane lists available tables but selection is display-only (`add_table/data.rs:376`, `ui.rs:311`) — nothing is added to the request. The server advertises the Link spelling, but the client cannot create it. **9. `required` flag is not exposed in the add-table UI.** Commit 29ccd8d added `ColumnDefinition.required` end-to-end (definition → validation → insert/update enforcement: `post_table_definition.rs:372`, `table_validation/runtime.rs:75`). The client always sends `required: false` (`add_table/logic.rs:33`) with no UI to mark a column required. The data-entry form does honor `required` returned by `GetTableValidation` — that path is synced. diff --git a/common/proto/table_definition.proto b/common/proto/table_definition.proto index 73247c71..a53446e7 100644 --- a/common/proto/table_definition.proto +++ b/common/proto/table_definition.proto @@ -275,15 +275,12 @@ message ColumnDefinition { // DATE // DURATION // PERIOD - // DECIMAL(p,s) → NUMERIC(p,s) // LINK(table) → BIGINT referencing that table in the same profile, indexed // automatically. A table may hold several links to the same // target as long as the columns are named differently. // FROM(link.source) → stored, read-only copy of an atomic column reached // through another column in this definition whose type is // LINK(...). SQL type and money metadata are inferred. - // DECIMAL args must be integers (no sign, no dot, no leading zeros); - // s ≤ p and p ≥ 1. string field_type = 2; // MONEY rounding applied before a value is stored. @@ -530,10 +527,7 @@ enum ColumnTypeSpelling { // The name is the whole spelling: "text", "money", "gtin_13". COLUMN_TYPE_SPELLING_BARE = 0; - // The name takes a precision and a scale: "decimal(12,3)". Precision must be - // at least 1 and scale no greater than precision; neither may carry a sign, - // a decimal point, or leading zeros. - COLUMN_TYPE_SPELLING_DECIMAL = 1; + reserved 1; // The name takes the name of another table in the same profile: // "link(adresar)". The column holds that table's id, and the server creates @@ -558,8 +552,7 @@ message ListColumnTypesResponse { string name = 1; // Underlying PostgreSQL type the logical type maps to (e.g. "NUMERIC"). - // Empty when `compound` is true. For COLUMN_TYPE_SPELLING_DECIMAL this is - // the unparameterised type; the declared precision and scale are appended. + // Empty when `compound` is true. string sql_type = 2; // False for types the server generates on its own and rejects when a client diff --git a/common/src/decimal.rs b/common/src/decimal.rs index 00d1ac0e..cc1f817e 100644 --- a/common/src/decimal.rs +++ b/common/src/decimal.rs @@ -37,17 +37,12 @@ pub fn parse_decimal_exact(value: &str) -> Result { Decimal::from_str_exact(value).map_err(|error| error.to_string()) } -/// True for the `data_type` spellings `GetTableStructure` reports for a decimal -/// column: `NUMERIC` (from `numeric` and `money`), `NUMERIC(p)` and -/// `NUMERIC(p,s)` (from `decimal(p,s)`). +/// True for the `NUMERIC` data type reported by `GetTableStructure`. pub fn is_decimal_data_type(data_type: &str) -> bool { - data_type - .trim() - .to_ascii_uppercase() - .starts_with(DECIMAL_DATA_TYPE_PREFIX) + data_type.trim().eq_ignore_ascii_case(DECIMAL_DATA_TYPE) } -const DECIMAL_DATA_TYPE_PREFIX: &str = "NUMERIC"; +const DECIMAL_DATA_TYPE: &str = "NUMERIC"; #[cfg(test)] mod tests { @@ -101,11 +96,10 @@ mod tests { } #[test] - fn decimal_data_type_covers_every_numeric_spelling() { - for data_type in ["NUMERIC", "NUMERIC(12)", "NUMERIC(12,3)", "numeric(12,3)"] { - assert!(is_decimal_data_type(data_type), "missed {data_type}"); - } - for data_type in ["TEXT", "INT8", "TIMESTAMPTZ", "VARCHAR(255)", ""] { + fn decimal_data_type_matches_only_unconstrained_numeric() { + assert!(is_decimal_data_type("NUMERIC")); + assert!(is_decimal_data_type("numeric")); + for data_type in ["NUMERIC(12)", "NUMERIC(12,3)", "TEXT", "INT8", ""] { assert!(!is_decimal_data_type(data_type), "matched {data_type}"); } } diff --git a/common/src/proto/descriptor.bin b/common/src/proto/descriptor.bin index 3f754625..5e874278 100644 Binary files a/common/src/proto/descriptor.bin and b/common/src/proto/descriptor.bin differ diff --git a/common/src/proto/komp_ac.table_definition.rs b/common/src/proto/komp_ac.table_definition.rs index e8163110..e47565e4 100644 --- a/common/src/proto/komp_ac.table_definition.rs +++ b/common/src/proto/komp_ac.table_definition.rs @@ -239,15 +239,12 @@ pub struct ColumnDefinition { /// DATE /// DURATION /// PERIOD - /// DECIMAL(p,s) → NUMERIC(p,s) /// LINK(table) → BIGINT referencing that table in the same profile, indexed /// automatically. A table may hold several links to the same /// target as long as the columns are named differently. /// FROM(link.source) → stored, read-only copy of an atomic column reached /// through another column in this definition whose type is /// LINK(...). SQL type and money metadata are inferred. - /// DECIMAL args must be integers (no sign, no dot, no leading zeros); - /// s ≤ p and p ≥ 1. #[prost(string, tag = "2")] pub field_type: ::prost::alloc::string::String, /// MONEY rounding applied before a value is stored. @@ -584,8 +581,7 @@ pub mod list_column_types_response { #[prost(string, tag = "1")] pub name: ::prost::alloc::string::String, /// Underlying PostgreSQL type the logical type maps to (e.g. "NUMERIC"). - /// Empty when `compound` is true. For COLUMN_TYPE_SPELLING_DECIMAL this is - /// the unparameterised type; the declared precision and scale are appended. + /// Empty when `compound` is true. #[prost(string, tag = "2")] pub sql_type: ::prost::alloc::string::String, /// False for types the server generates on its own and rejects when a client @@ -682,10 +678,6 @@ impl MoneyRounding { pub enum ColumnTypeSpelling { /// The name is the whole spelling: "text", "money", "gtin_13". Bare = 0, - /// The name takes a precision and a scale: "decimal(12,3)". Precision must be - /// at least 1 and scale no greater than precision; neither may carry a sign, - /// a decimal point, or leading zeros. - Decimal = 1, /// The name takes the name of another table in the same profile: /// "link(adresar)". The column holds that table's id, and the server creates /// the foreign key and its index. A picker offers the profile's other tables @@ -700,7 +692,6 @@ impl ColumnTypeSpelling { pub fn as_str_name(&self) -> &'static str { match self { Self::Bare => "COLUMN_TYPE_SPELLING_BARE", - Self::Decimal => "COLUMN_TYPE_SPELLING_DECIMAL", Self::Link => "COLUMN_TYPE_SPELLING_LINK", } } @@ -708,7 +699,6 @@ impl ColumnTypeSpelling { pub fn from_str_name(value: &str) -> ::core::option::Option { match value { "COLUMN_TYPE_SPELLING_BARE" => Some(Self::Bare), - "COLUMN_TYPE_SPELLING_DECIMAL" => Some(Self::Decimal), "COLUMN_TYPE_SPELLING_LINK" => Some(Self::Link), _ => None, } diff --git a/common/src/search.rs b/common/src/search.rs index 8c7f0309..358d358c 100644 --- a/common/src/search.rs +++ b/common/src/search.rs @@ -93,9 +93,7 @@ pub fn normalize_exact(input: &str) -> String { /// names, so this deliberately matches the catalog vocabulary. pub fn canonical_exact_search_value(input: &str, field_type: &str) -> Result { let normalized_type = field_type.trim().to_ascii_lowercase(); - if matches!(normalized_type.as_str(), "numeric" | "money") - || normalized_type.starts_with("decimal(") - { + if matches!(normalized_type.as_str(), "numeric" | "money") { return input .parse::() .map(|value| value.normalize().to_string()) @@ -288,10 +286,6 @@ mod tests { assert_eq!(canonical_exact_search_value("001", "link(adresar)").unwrap(), "1"); assert_eq!(canonical_exact_search_value("10.50", "numeric").unwrap(), "10.5"); assert_eq!(canonical_exact_search_value("10.50", "money").unwrap(), "10.5"); - assert_eq!( - canonical_exact_search_value("10.50", "decimal(12, 2)").unwrap(), - "10.5" - ); } } diff --git a/common/src/search_light.rs b/common/src/search_light.rs index 743765c0..7242de63 100644 --- a/common/src/search_light.rs +++ b/common/src/search_light.rs @@ -41,9 +41,7 @@ pub fn parse_archived_search_row_key(row_key: &str) -> Option<(i64, i64, i64)> { pub fn canonical_exact_search_value(input: &str, field_type: &str) -> Result { let normalized_type = field_type.trim().to_ascii_lowercase(); - if matches!(normalized_type.as_str(), "numeric" | "money") - || normalized_type.starts_with("decimal(") - { + if matches!(normalized_type.as_str(), "numeric" | "money") { return input .parse::() .map(|value| value.normalize().to_string()) @@ -100,9 +98,5 @@ mod tests { canonical_exact_search_value("10.50", "money").unwrap(), "10.5" ); - assert_eq!( - canonical_exact_search_value("10.50", "decimal(12, 2)").unwrap(), - "10.5" - ); } } diff --git a/docs/fixed-scale-decimal.md b/docs/fixed-scale-decimal.md deleted file mode 100644 index ecf03c87..00000000 --- a/docs/fixed-scale-decimal.md +++ /dev/null @@ -1,26 +0,0 @@ -# Decimal column policy - -Use the bare `numeric` column type for ordinary exact base-10 values. It stores -the value without a schema-defined decimal-place limit and is the recommended -choice for quantities, percentages, rates, ratios and measurements. Use -`money` for currency amounts; its currency and rounding policy are separate -from this document. - -`decimal(p,s)` is an advanced, opt-in compatibility type for strict external -data contracts. `p` limits the total digits and `s` limits the fractional -digits. It is hidden from the normal table-designer type list until fixed-scale -decimal is enabled for that editing session. - -Fixed scale is intentionally strict: - -- API input outside the declared precision or scale is rejected, never - silently rounded by PostgreSQL. -- A table script targeting a fixed-scale column must round explicitly before - returning its value. -- A fixed-scale type cannot be changed through the table editor after the - table contains data. -- Display precision, allowed increments, minimums and maximums are business - validation concerns; `decimal(p,s)` is not a substitute for them. - -Existing fixed-scale columns remain supported. The opt-in changes discovery, -not storage compatibility. diff --git a/invoice-print-setup.md b/invoice-print-setup.md index 373ae277..35871cbf 100644 --- a/invoice-print-setup.md +++ b/invoice-print-setup.md @@ -178,10 +178,10 @@ grpcurl -plaintext -H "$AUTH_HEADER" \ "links":[{"linked_table_name":"faktura","required":true}], "columns":[ {"name":"nazov","field_type":"TEXT"}, - {"name":"mnozstvo","field_type":"DECIMAL(12,3)"}, + {"name":"mnozstvo","field_type":"numeric"}, {"name":"mj","field_type":"TEXT"}, {"name":"cena","field_type":"MONEY","currency":"EUR","rounding":"MONEY_ROUNDING_HALF_UP"}, - {"name":"dph","field_type":"DECIMAL(5,2)"}, + {"name":"dph","field_type":"numeric"}, {"name":"bez","field_type":"MONEY","currency":"EUR","rounding":"MONEY_ROUNDING_HALF_UP","recompute_on_dependency_change":true}, {"name":"dph_suma","field_type":"MONEY","currency":"EUR","rounding":"MONEY_ROUNDING_HALF_UP","recompute_on_dependency_change":true}, {"name":"spolu","field_type":"MONEY","currency":"EUR","rounding":"MONEY_ROUNDING_HALF_UP","recompute_on_dependency_change":true} diff --git a/server b/server index cf752c7e..4ea5a4e8 160000 --- a/server +++ b/server @@ -1 +1 @@ -Subproject commit cf752c7ee96c3019573e7c2f5f54571e5c4f93fc +Subproject commit 4ea5a4e80dbbee9bd3e80777ca757d4d09765ed7 diff --git a/test_luna/README.md b/test_luna/README.md index 344c9230..6e4f860a 100644 --- a/test_luna/README.md +++ b/test_luna/README.md @@ -125,11 +125,11 @@ Create profile table `products`: | `unit` | link(units) | required, auto-indexed | | `sale_price` | money | EUR, exact rounding | | `purchase_price` | money | USD, half-up rounding | -| `vat_rate` | decimal(5,2) | required | +| `vat_rate` | numeric | required | | `package_count` | int | optional | | `legacy_id` | bigint | indexed | | `measured_weight` | numeric | optional | -| `stock` | decimal(18,3) | quantity ledger enabled | +| `stock` | numeric | quantity ledger enabled | | `active` | boolean | required | Confirm `stock` is displayed as quantity-ledger/read-only and starts at zero. @@ -143,7 +143,7 @@ Create `stock_receipts` with: - `product`: required link(products); - `warehouse`: required link(warehouses); - `supplier`: required link(partners); -- `quantity`: required decimal(18,3); +- `quantity`: required numeric; - `received_on`: required date; - `processed`: int. @@ -176,9 +176,9 @@ Create `sales_order_lines`: - `sales_order`: required link(sales_orders); - `product`: required link(products); -- `quantity`: required decimal(18,3); +- `quantity`: required numeric; - `unit_price`: required EUR money, exact rounding; -- `discount_rate`: decimal(5,2); +- `discount_rate`: numeric; - `line_position`: required int. This supplies a parent → child → product link chain and composite business @@ -346,8 +346,8 @@ The live tables deliberately cover text, boolean, int, bigint, numeric, decimal, EUR/USD money with both rounding modes, date/time/instant, duration, period, phone, IBAN, email, credit card, GTIN-8/12/13/14, account, FK links, accounting, accounting transfer, generated companions, and a -`products.stock` `decimal(12,3)` quantity ledger. The stock transaction tables -have `stock_effect decimal(12,3)` computed targets, because a script cannot +`products.stock` `numeric` quantity ledger. The stock transaction tables +have `stock_effect numeric` computed targets, because a script cannot target its own source `quantity` column. The saved Steel scripts are: diff --git a/web/locales/cs/main.ftl b/web/locales/cs/main.ftl index 3c037f1d..76753864 100644 --- a/web/locales/cs/main.ftl +++ b/web/locales/cs/main.ftl @@ -43,8 +43,6 @@ label-validation-set-name = název validační sady label-minimum = Minimum label-maximum = Maximum label-warning-threshold = Hranice upozornění -label-precision = Přesnost -label-scale = Desetinná místa label-column-name = Název sloupce label-table-name = Název tabulky label-linked-table = Odkazovaná tabulka @@ -208,19 +206,6 @@ td-temporal-type = Časový typ td-choose-temporal-type = Vyberte časový typ td-gtin-type = Typ GTIN td-choose-gtin-length = Vyberte délku GTIN -td-precision = Přesnost -td-precision-hint = Celkový počet uložených číslic, alespoň 1. -td-scale = Desetinná místa -td-scale-hint = Číslice za desetinnou čárkou, nejvýše tolik jako přesnost. -td-fixed-decimal-access = Pokročilé číselné typy -td-fixed-decimal-disabled = Pouze doporučené typy -td-fixed-decimal-enabled = Povolit desetinné číslo s pevným měřítkem -td-fixed-decimal-access-hint = Doporučuje se přesný typ NUMERIC. Tuto možnost povolte pouze pro přísný externí datový kontrakt. -td-fixed-decimal-warning-title = Pokročilé desetinné číslo s pevným měřítkem -td-fixed-decimal-warning = Tento typ omezuje celkový počet číslic i desetinná místa. Hodnoty mimo měřítko se odmítnou, výpočty musí zaokrouhlovat explicitně a typ po vložení dat nelze změnit. -td-fixed-decimal-enable-first = Před použitím tohoto typu povolte pokročilé desetinné číslo s pevným měřítkem. -td-exact-decimal = Desetinné číslo — přesné (doporučeno) -td-fixed-decimal-type = Desetinné číslo s pevným měřítkem — pokročilé td-referenced-table = Odkazovaná tabulka td-choose-table = Vyberte tabulku td-group-global = Globální @@ -844,9 +829,7 @@ schema-err-generated-exists = `{ $type }` generuje sloupec s názvem `{ $generat schema-err-ql-types = Sloupce kvantitativní evidence musí používat { $types } schema-err-column-ql-types = Sloupec `{ $name }`: sloupce kvantitativní evidence musí používat { $types } schema-err-column-prefix = Sloupec `{ $name }`: { $error } -schema-err-decimal-not-valid = `decimal` není platný typ sloupce. schema-err-link-not-valid = `link` není platný typ sloupce. -schema-err-decimal-args-needed = `{ $type }` vyžaduje přesnost i desetinná místa. schema-err-link-target-needed = `link` vyžaduje odkazovanou tabulku. schema-err-generated-type = `{ $type }` je typ sloupce, který generuje backend. schema-err-invalid-type = `{ $type }` není platný typ sloupce. @@ -871,12 +854,6 @@ error-identifier-number = { $label } nesmí začínat číslicí. error-identifier-too-long = { $label } nesmí být delší než { $limit } znaků. error-identifier-charset = { $label } může obsahovat jen malá písmena, číslice a podtržítko. error-identifier-reserved = { $label } používá vyhrazený název. -error-decimal-required = { $label } je povinné pro desetinný sloupec. -error-decimal-sign = { $label } nesmí obsahovat znaménko. -error-decimal-whole = { $label } musí být celé číslo. -error-decimal-leading-zeros = { $label } nesmí mít úvodní nuly. -error-precision-min = Přesnost musí být alespoň 1. -error-scale-gt-precision = Desetinná místa nemohou být více než přesnost. # --- Přidat validaci ---------------------------------------------------------------- validation-eyebrow = Validace diff --git a/web/locales/en/main.ftl b/web/locales/en/main.ftl index 4781bb54..a6a402a9 100644 --- a/web/locales/en/main.ftl +++ b/web/locales/en/main.ftl @@ -48,8 +48,6 @@ label-validation-set-name = validation set name label-minimum = Minimum label-maximum = Maximum label-warning-threshold = Warning threshold -label-precision = Precision -label-scale = Scale label-column-name = Column name label-table-name = Table name label-linked-table = Linked table @@ -212,19 +210,6 @@ td-temporal-type = Temporal type td-choose-temporal-type = Choose a temporal type td-gtin-type = GTIN type td-choose-gtin-length = Choose a GTIN length -td-precision = Precision -td-precision-hint = Total digits stored, at least 1. -td-scale = Scale -td-scale-hint = Digits after the point, no more than the precision. -td-fixed-decimal-access = Advanced number types -td-fixed-decimal-disabled = Recommended types only -td-fixed-decimal-enabled = Enable fixed-scale decimal -td-fixed-decimal-access-hint = Exact NUMERIC is recommended. Enable this only for a strict external data contract. -td-fixed-decimal-warning-title = Advanced fixed-scale decimal -td-fixed-decimal-warning = This type limits total and fractional digits. Values outside the declared scale are refused, calculations must round explicitly, and the type cannot be changed after the table contains data. -td-fixed-decimal-enable-first = Enable advanced fixed-scale decimal before using this type. -td-exact-decimal = Decimal — exact (recommended) -td-fixed-decimal-type = Fixed-scale decimal — advanced td-referenced-table = Referenced table td-choose-table = Choose a table td-group-global = Global @@ -829,9 +814,7 @@ schema-err-generated-exists = `{ $type }` generates a column named `{ $generated schema-err-ql-types = Quantity-ledger columns must use { $types } schema-err-column-ql-types = Column `{ $name }`: quantity-ledger columns must use { $types } schema-err-column-prefix = Column `{ $name }`: { $error } -schema-err-decimal-not-valid = `decimal` is not a valid field type. schema-err-link-not-valid = `link` is not a valid field type. -schema-err-decimal-args-needed = `{ $type }` needs both a precision and a scale. schema-err-link-target-needed = `link` needs a referenced table. schema-err-generated-type = `{ $type }` is a column type the backend generates itself. schema-err-invalid-type = `{ $type }` is not a valid field type. @@ -856,12 +839,6 @@ error-identifier-number = { $label } cannot start with a number. error-identifier-too-long = { $label } cannot be longer than { $limit } characters. error-identifier-charset = { $label } may only use lowercase letters, digits and underscores. error-identifier-reserved = { $label } uses a reserved name. -error-decimal-required = { $label } is required for a decimal column. -error-decimal-sign = { $label } cannot carry a sign. -error-decimal-whole = { $label } must be a whole number. -error-decimal-leading-zeros = { $label } cannot have leading zeros. -error-precision-min = Precision must be at least 1. -error-scale-gt-precision = Scale cannot be greater than precision. # --- Add validation -------------------------------------------------------- validation-eyebrow = Validation diff --git a/web/locales/sk/main.ftl b/web/locales/sk/main.ftl index fed69c74..28ea08c2 100644 --- a/web/locales/sk/main.ftl +++ b/web/locales/sk/main.ftl @@ -43,8 +43,6 @@ label-validation-set-name = názov validačnej sady label-minimum = Minimum label-maximum = Maximum label-warning-threshold = Hranica upozornenia -label-precision = Presnosť -label-scale = Desatinné miesta label-column-name = Názov stĺpca label-table-name = Názov tabuľky label-linked-table = Odkazovaná tabuľka @@ -208,19 +206,6 @@ td-temporal-type = Časový typ td-choose-temporal-type = Vyberte časový typ td-gtin-type = Typ GTIN td-choose-gtin-length = Vyberte dĺžku GTIN -td-precision = Presnosť -td-precision-hint = Celkový počet uložených číslic, aspoň 1. -td-scale = Desatinné miesta -td-scale-hint = Číslice za desatinnou čiarkou, najviac toľko ako presnosť. -td-fixed-decimal-access = Pokročilé číselné typy -td-fixed-decimal-disabled = Iba odporúčané typy -td-fixed-decimal-enabled = Povoliť desatinné číslo s pevnou mierkou -td-fixed-decimal-access-hint = Odporúča sa presný typ NUMERIC. Túto možnosť povoľte iba pre prísnu externú dátovú zmluvu. -td-fixed-decimal-warning-title = Pokročilé desatinné číslo s pevnou mierkou -td-fixed-decimal-warning = Tento typ obmedzuje celkový počet číslic aj desatinné miesta. Hodnoty mimo mierky sa odmietnu, výpočty musia zaokrúhľovať explicitne a typ sa po vložení údajov nedá zmeniť. -td-fixed-decimal-enable-first = Pred použitím tohto typu povoľte pokročilé desatinné číslo s pevnou mierkou. -td-exact-decimal = Desatinné číslo — presné (odporúčané) -td-fixed-decimal-type = Desatinné číslo s pevnou mierkou — pokročilé td-referenced-table = Odkazovaná tabuľka td-choose-table = Vyberte tabuľku td-group-global = Globálne @@ -842,9 +827,7 @@ schema-err-generated-exists = `{ $type }` generuje stĺpec s názvom `{ $generat schema-err-ql-types = Stĺpce kvantitatívnej evidencie musia používať { $types } schema-err-column-ql-types = Stĺpec `{ $name }`: stĺpce kvantitatívnej evidencie musia používať { $types } schema-err-column-prefix = Stĺpec `{ $name }`: { $error } -schema-err-decimal-not-valid = `decimal` nie je platný typ stĺpca. schema-err-link-not-valid = `link` nie je platný typ stĺpca. -schema-err-decimal-args-needed = `{ $type }` vyžaduje presnosť aj desatinné miesta. schema-err-link-target-needed = `link` vyžaduje odkazovanú tabuľku. schema-err-generated-type = `{ $type }` je typ stĺpca, ktorý generuje backend. schema-err-invalid-type = `{ $type }` nie je platný typ stĺpca. @@ -869,12 +852,6 @@ error-identifier-number = { $label } nesmie začínať číslom. error-identifier-too-long = { $label } nesmie byť dlhšie ako { $limit } znakov. error-identifier-charset = { $label } môže obsahovať len malé písmená, číslice a podčiarkovník. error-identifier-reserved = { $label } používa vyhradený názov. -error-decimal-required = { $label } je povinné pre desatinný stĺpec. -error-decimal-sign = { $label } nesmie obsahovať znamienko. -error-decimal-whole = { $label } musí byť celé číslo. -error-decimal-leading-zeros = { $label } nesmie mať vedúce nuly. -error-precision-min = Presnosť musí byť aspoň 1. -error-scale-gt-precision = Desatinné miesta nemôžu byť viac ako presnosť. # --- Pridať validáciu ---------------------------------------------------------- validation-eyebrow = Validácia diff --git a/web/src/pages/add_table/state.rs b/web/src/pages/add_table/state.rs index 69dbde55..c8cdc0c6 100644 --- a/web/src/pages/add_table/state.rs +++ b/web/src/pages/add_table/state.rs @@ -57,12 +57,6 @@ pub(crate) struct BuilderForm { #[serde(default)] pub link_table_input: String, #[serde(default)] - pub decimal_precision_input: String, - #[serde(default)] - pub decimal_scale_input: String, - #[serde(default)] - pub fixed_decimal_input: String, - #[serde(default)] pub column_indexing_input: String, #[serde(default)] pub column_quantity_ledger_input: String, @@ -128,9 +122,6 @@ impl BuilderForm { temporal_type_input: self.temporal_type_input.clone(), gtin_type_input: self.gtin_type_input.clone(), link_table_input: self.link_table_input.clone(), - decimal_precision_input: self.decimal_precision_input.clone(), - decimal_scale_input: self.decimal_scale_input.clone(), - fixed_decimal_input: self.fixed_decimal_input.clone(), indexing_input: self.column_indexing_input.clone(), quantity_ledger_input: self.column_quantity_ledger_input.clone(), required_input: self.column_required_input.clone(), diff --git a/web/src/pages/add_table/ui.rs b/web/src/pages/add_table/ui.rs index 459766fb..69f6916c 100644 --- a/web/src/pages/add_table/ui.rs +++ b/web/src/pages/add_table/ui.rs @@ -245,20 +245,13 @@ mod tests { assert!(html.contains("Every profile can use this shared table.")); } - /// Fixed-scale decimal is the one intentionally gated type; enabling the - /// advanced control makes it reachable without removing server support. + /// Every type the server accepts has to be reachable from the picker, or + /// the web UI silently offers less than the backend does. #[test] - fn the_type_picker_offers_the_parameterised_and_interval_types() { - let mut state = page(); - let html = render_builder(&state); + fn the_type_picker_offers_interval_and_accounting_types() { + let html = render_builder(&page()); - assert!(!html.contains(r#"