diff options
| author | Benedikt Peetz <benedikt.peetz@b-peetz.de> | 2025-10-08 12:01:47 +0200 |
|---|---|---|
| committer | Benedikt Peetz <benedikt.peetz@b-peetz.de> | 2025-10-08 12:01:47 +0200 |
| commit | d45cc8fab35501b6c16f68cac084d861539a3f83 (patch) | |
| tree | 3f0aca576652a912afd8c368b92d05a38c41162c /crates/rocie-cli/src/cli.rs | |
| parent | chore(Cargo.{lock,toml}): Update (diff) | |
| download | server-d45cc8fab35501b6c16f68cac084d861539a3f83.zip | |
feat(crates/rocie-cli): Add support for unit-properties
Diffstat (limited to '')
| -rw-r--r-- | crates/rocie-cli/src/cli.rs | 44 |
1 files changed, 43 insertions, 1 deletions
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<String>, + + /// The id of the unit property this unit measures. + #[arg(short, long)] + unit_property: Uuid, }, /// Fetch an unit based on id @@ -64,6 +74,34 @@ pub(crate) enum UnitCommand { } #[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<String>, + }, + + /// 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 { /// Buy an barcode @@ -104,6 +142,10 @@ pub(crate) enum ProductCommand { /// Optional parent of the new product #[arg(short, long)] parent: Option<Uuid>, + + /// The id of the unit property this product is measured in. + #[arg(short, long)] + unit_property: Uuid, }, AssociateBarcode { |
