RprtCli/README.org

2.4 KiB

Report cli

Automate generating invoices.

Usage

Install/Getting started

Get .phar file, run configuration wizzard.

Specs

A simple Console Command that prints out monthly report from youtrack.

Simple configuration:

  • authentication token value
  • project categories
  • hourly wage
  • folder for reports

Components

Motivation

  • practice php
  • automatization of repetitive task

    • is it worth it? according to xkcd table - you should spend 1 day for automating a monthly task that takes 30 minutes. That would be if only I'd be using this app. If it get's picked up, by 5 others - it is worth 5 days of development.
  • remove errors from reports

Plan

  1. Basic structure of the cli-app

    1. App preparation

      • nice specifications
      • composer project
      • autoloading & dependency injection
    2. Report service

      • read a local csv file
    3. Parse report

      • read configuration (project categories, hourly wage)
      • simple table output
  2. First round of enhancements

    1. Tests
    2. youtrack request
    3. create composer package, create executable
  3. Second round of enhancements

    1. Invoice output
    2. configuration wizard

Learning

API calls

Get csv file

curl 'https://drunomics.myjetbrains.com/youtrack/api/reports/83-554/export/csv?&$top=-1' -H 'Accept: application/json, text/plain, */*' -H 'Accept-Language: en-US,en;q=0.5' --compressed -H "Authorization: Bearer $TKN" > ~/Documents/Drunomics/workhours/2021/21-09.csv