From 2dc74d621399be454abbbff892fb46204ddc6e7b Mon Sep 17 00:00:00 2001 From: Benedikt Peetz Date: Tue, 23 Sep 2025 08:33:06 +0200 Subject: feat(treewide): Add tests and barcode buying/consuming --- crates/rocie-cli/src/cli.rs | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) (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 3f2662b..29c284f 100644 --- a/crates/rocie-cli/src/cli.rs +++ b/crates/rocie-cli/src/cli.rs @@ -20,6 +20,12 @@ pub(crate) enum Command { #[command(subcommand)] command: UnitCommand, }, + + /// Deal with Barcodes + Barcode { + #[command(subcommand)] + command: BarcodeCommand, + }, } #[derive(Subcommand)] @@ -57,6 +63,32 @@ pub(crate) enum UnitCommand { List {}, } +#[derive(Subcommand)] +#[expect(variant_size_differences, reason = "It's just a testing cli")] +pub(crate) enum BarcodeCommand { + /// Buy an barcode + Buy { + /// The numeric value of the barcode + #[arg(short, long)] + id: u32, + }, + + /// Consume an barcode + Consume { + /// The numeric value of the barcode + #[arg(short, long)] + id: u32, + + /// The amount to consume + #[arg(short, long)] + amount: u32, + + /// The unit of the consumed amount + #[arg(short, long)] + unit_id: Uuid, + }, +} + #[derive(Subcommand)] pub(crate) enum ProductCommand { /// Register a new product -- cgit 1.4.1