diff options
Diffstat (limited to 'crates/rocie-cli/src/cli.rs')
| -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 { |
