Skip to content

Commit c99aa64

Browse files
committed
Add get-invoice command
1 parent eacee80 commit c99aa64

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

src/command/admin.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,3 +63,12 @@ pub struct SyncUnpaidInvoicesArgs {}
6363
pub fn sync_unpaid_invoices(_args: &SyncUnpaidInvoicesArgs) -> Result<()> {
6464
rpc::call("sync_unpaid_invoices", json!({}))?.print()
6565
}
66+
67+
#[derive(Args)]
68+
pub struct GetInvoiceArgs {
69+
pub id: i64,
70+
}
71+
72+
pub fn get_invoice(args: &GetInvoiceArgs) -> Result<()> {
73+
rpc::call("get_invoice", json!({"id": args.id }))?.print()
74+
}

src/main.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ enum Commands {
3838
GenerateInvoice(command::admin::GenerateInvoiceArgs),
3939
/// Sync unpaid invoices
4040
SyncUnpaidInvoices(command::admin::SyncUnpaidInvoicesArgs),
41+
/// Get invoice details, you only need to pass invoice ID (integer)
42+
GetInvoice(command::admin::GetInvoiceArgs),
4143
/// Return all entities matching provided search query. Currently, only areas are returned
4244
Search(command::common::SearchArgs),
4345
/// Fetch element by a numeric or OSM (node:12345) id. You can also use node=12345 format
@@ -131,6 +133,7 @@ fn main() -> Result<()> {
131133
Commands::RemoveAdminAction(args) => command::admin::remove_admin_action(args),
132134
Commands::GenerateInvoice(args) => command::admin::generate_invoice(args),
133135
Commands::SyncUnpaidInvoices(args) => command::admin::sync_unpaid_invoices(args),
136+
Commands::GetInvoice(args) => command::admin::get_invoice(args),
134137
// Common
135138
Commands::Search(args) => command::common::search(args),
136139
// Element

0 commit comments

Comments
 (0)