Skip to content
Closed
Changes from 1 commit
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
240e9d6
Science fiction for expense report example application.
tseaver Aug 28, 2014
6a913d3
Update science-fiction CLI.
tseaver Oct 3, 2014
580fb03
Initial CLI skeleton to support datastore narrative example.
tseaver Oct 3, 2014
01d8f95
PEP8
tseaver Oct 9, 2014
6426aba
Suppress two useless PEP8 errors.
tseaver Oct 9, 2014
943f9df
Progress toward sample implementation.
tseaver Oct 13, 2014
e95392e
Get exp report creation actually working.
tseaver Oct 20, 2014
4f8c242
Use same Oauth envvars as regression tests.
tseaver Oct 22, 2014
d9c3af1
Enforce distinction between creating / updating expense reports.
tseaver Oct 22, 2014
afb287e
Add 'delete' command.
tseaver Oct 22, 2014
e836913
Add checks for valid report status to update / delete commands.
tseaver Oct 22, 2014
ebae693
Record metadata (description, created, updated) for expense reports.
tseaver Oct 22, 2014
666b6a4
Make 'review_expenses list' work with live data.
tseaver Oct 22, 2014
578d40a
Make 'review_expenses show' work with live data.
tseaver Oct 22, 2014
31dd159
Housekeeping.
tseaver Oct 22, 2014
7da8592
Reconcile command output w/ Sphinx.
tseaver Oct 22, 2014
7a58c95
Drop unneeded base exception.
tseaver Oct 22, 2014
b209068
Get 'review_expenses {approve,reject}' working w/ live data.
tseaver Oct 22, 2014
a98b440
Wire in the datastore narrative example.
tseaver Oct 22, 2014
42ecfe8
'csv' is not a known highlight syntax.
tseaver Oct 22, 2014
10e9f9f
Describe top-down flow of creating an expense report from a CSV file.
tseaver Oct 22, 2014
5090a3b
Add narrative for 'update_report'.
tseaver Oct 22, 2014
44812da
Typos, clarifications.
tseaver Oct 23, 2014
911ed7c
Add discussion of 'review_expenses list'.
tseaver Oct 23, 2014
8eadf43
Require 'employee_id' arg for 'review_expenses show'.
tseaver Oct 23, 2014
7f38c3a
Add discussion of 'review_expenses show'.
tseaver Oct 23, 2014
239d86f
Add discussion of 'review_expenses {approve,reject}'.
tseaver Oct 23, 2014
021b797
Cross-ref overview narrative to functional sections.
tseaver Oct 23, 2014
1579110
Add discussion of 'submit_expenses delete'.
tseaver Oct 23, 2014
4879512
Typo.
tseaver Oct 23, 2014
bdc32ab
Revert "Suppress two useless PEP8 errors."
tseaver Oct 23, 2014
bf5e420
PEP8.
tseaver Oct 23, 2014
b7e7f9c
pylint (reduced set, as in tests / demos / regression).
tseaver Oct 23, 2014
64cc17a
Typos.
tseaver Oct 23, 2014
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update science-fiction CLI.
  • Loading branch information
tseaver committed Oct 23, 2014
commit 6a913d3325abe4ccb55cede80561cfaedab5e3c5
27 changes: 14 additions & 13 deletions docs/datastore-narrative_example.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ For our example, let's build an employee expense reporting system. An example
set of interactions might look like the following scenario.

Returning from a trip to the Bay Area, Sally creates a CSV file,
``expenses_20140901.csv``, containing one row for each line item in her
``expenses-20140901.csv``, containing one row for each line item in her
expense report:

.. code-block:: csv
Expand All @@ -28,15 +28,16 @@ Sally then submits her expense report from the command line using our

.. code-block:: bash

$ submit_expenses --employee-id=sally --description="Frotz project kickoff, San Jose" expenses_20140901.csv
$ submit_expenses create --employee-id=sally --description="Frotz project kickoff, San Jose" expenses-20140901.csv
Processed 15 rows.
Expense report ID: sally/expenses-2014-09-01
Created, report ID: sally/expenses-2014-09-01

Sally can list all her submitted expense reports:
Sally can list all her submitted expense reports using our ``review_expenses``
script:

.. code-block:: bash

$ review_expenses --employee-id=sally
$ review_expenses list --employee-id=sally

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.


"Report ID","Description","Status","Memo"
"sally/2013-11-19","Onsite Training, Mountain View","Paid","Check #3715"
Expand All @@ -47,7 +48,7 @@ Sally can review a submitted expense report using the its ID:

.. code-block:: bash

$ review_expenses --report-id=sally/expenses-2014-09-01
$ review_expenses show --report-id=sally/expenses-2014-09-01
Report-ID: sally/expenses-2014-09-01
Report-Status: Pending
Employee-ID: sally
Expand All @@ -62,15 +63,15 @@ While in "Pending" status, Sally can edit the CSV and resubmit it:

.. code-block:: bash

$ submit_expenses --report-id=sally/expenses-2014-09-01 expenses_20140901-amended.csv
$ submit_expenses update --report-id=sally/expenses-2014-09-01 expenses-20140901-amended.csv
Processed 15 rows.
Expense report ID: sally/expenses-2014-09-01
Updated, report ID: sally/expenses-2014-09-01

Sally's boss, Pat, can review all open expense reports:

.. code-block:: bash

$ review_expenses --status=Pending
$ review_expenses list --status=Pending

"Report ID","Description","Status","Memo"
"sally/2014-09-01","Frotz project kickoff, San Jose","Pending",""
Expand All @@ -80,12 +81,12 @@ report:

.. code-block:: bash

$ approve_expenses --report-id=sally/expenses-2014-09-01 --check-number=4093
Report approved, check #4093
$ review_expenses approve --report-id=sally/expenses-2014-09-01 --check-number=4093
Approved, report ID: sally/expenses-2014-09-01, check #4093

or reject it:

.. code-block:: bash

$ reject_expenses --report-id=sally/expenses-2014-09-01 --reason="Travel not authorized by client"
Report rejected, reason: Travel not authorized by client
$ review_expenses reject --report-id=sally/expenses-2014-09-01 --reason="Travel not authorized by client"
Rejected, report ID: sally/expenses-2014-09-01, reason: Travel not authorized by client