Skip to content

feat: add bills command group (list, download) - #2

Open
datenwurm wants to merge 1 commit into
maxboettinger:mainfrom
datenwurm:feat/bills
Open

feat: add bills command group (list, download)#2
datenwurm wants to merge 1 commit into
maxboettinger:mainfrom
datenwurm:feat/bills

Conversation

@datenwurm

Copy link
Copy Markdown

Description:
Add the /bills resource of the Cantamen casirest/v3 API: bills list shows bill summaries newest first with the accumulated total per currency and a --year filter; bills download fetches a bill's itemized PDF via the expanded billDocument (inline base64 or reference URL). Bill line items only exist inside the PDF, so list totals are bill-level by design.

Example:

$ teilauto bills
                                                                                                                                           
 Usage: teilauto bills [OPTIONS] COMMAND [ARGS]...                                                                                         
                                                                                                                                           
 List your bills and download their PDFs (login required).                                                                                 
                                                                                                                                           
╭─ Options ────────────────────────────────────────────────────────────╮
│ --help  -h  Show this message and exit.                              │
╰──────────────────────────────────────────────────────────────────────╯
╭─ Commands ───────────────────────────────────────────────────────────╮
│ download  Download the itemized PDF for BILL_ID.                     │
│ list      Show your bills, newest first, with the accumulated total. │
╰──────────────────────────────────────────────────────────────────────╯

$ teilauto bills list --help
                                                                        
 Usage: teilauto bills list [OPTIONS]                                   
                                                                        
 Show your bills, newest first, with the accumulated total.             
                                                                        
╭─ Options ────────────────────────────────────────────────────────────╮
│ --year      YYYY  Only bills from this year.                         │
│ --json            Output machine-readable JSON.                      │
│ --help  -h        Show this message and exit.                        │
╰──────────────────────────────────────────────────────────────────────╯

$ teilauto bills list
                   Bills                    
┏━━━━━━━━━━┳━━━━━━━━━┳━━━━━━━━━━━━┳━━━━━━━━━━━━┓
┃ ID       ┃ Number  ┃ Date       ┃ Amount     ┃
┡━━━━━━━━━━╇━━━━━━━━━╇━━━━━━━━━━━━╇━━━━━━━━━━━━┩
│ 12345678 │ abcdefg │ 2026-07-01 │  56.64 EUR │
└──────────┴─────────┴────────────┴────────────┘
        1 bill(s) · total 56.64 €     

$ teilauto bills download 12345678
✓ Saved bill-12345678.pdf (111192 bytes)

Notes:
The endpoint was mapped statically from the official Android app (same backend, same casirest/v3 base) rather than the booking website.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant