From d45cc8fab35501b6c16f68cac084d861539a3f83 Mon Sep 17 00:00:00 2001 From: Benedikt Peetz Date: Wed, 8 Oct 2025 12:01:47 +0200 Subject: feat(crates/rocie-cli): Add support for unit-properties --- crates/rocie-cli/src/cli.rs | 44 +++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 43 insertions(+), 1 deletion(-) (limited to 'crates/rocie-cli/src/cli.rs') diff --git a/crates/rocie-cli/src/cli.rs b/crates/rocie-cli/src/cli.rs index 29c284f..a84ab0e 100644 --- a/crates/rocie-cli/src/cli.rs +++ b/crates/rocie-cli/src/cli.rs @@ -15,12 +15,18 @@ pub(crate) enum Command { command: ProductCommand, }, - /// Deal with products + /// Deal with units Unit { #[command(subcommand)] command: UnitCommand, }, + /// Deal with unit properties + UnitProperty { + #[command(subcommand)] + command: UnitPropertyCommand, + }, + /// Deal with Barcodes Barcode { #[command(subcommand)] @@ -50,6 +56,10 @@ pub(crate) enum UnitCommand { /// Optional description of the new unit #[arg(short, long)] description: Option, + + /// The id of the unit property this unit measures. + #[arg(short, long)] + unit_property: Uuid, }, /// Fetch an unit based on id @@ -63,6 +73,34 @@ pub(crate) enum UnitCommand { List {}, } +#[derive(Subcommand)] +pub(crate) enum UnitPropertyCommand { + /// Register a new unit + Register { + /// The name of the new unit property + /// + /// E.g.: + /// - Mass + /// - Volume + #[arg(short = 'n', long)] + name: String, + + /// Optional description of the new unit property + #[arg(short, long)] + description: Option, + }, + + /// Fetch an unit property based on id + GetById { + /// The id of the unit property + #[arg(short, long)] + id: Uuid, + }, + + /// List all available unit properties + List {}, +} + #[derive(Subcommand)] #[expect(variant_size_differences, reason = "It's just a testing cli")] pub(crate) enum BarcodeCommand { @@ -104,6 +142,10 @@ pub(crate) enum ProductCommand { /// Optional parent of the new product #[arg(short, long)] parent: Option, + + /// The id of the unit property this product is measured in. + #[arg(short, long)] + unit_property: Uuid, }, AssociateBarcode { -- cgit 1.4.1