feat: add basic "create order" feature, docs, tests

just the package API docs so far, narrative will come later
This commit is contained in:
Lance Edgar 2025-01-06 17:03:41 -06:00
parent 89265f0240
commit ef07d30a85
86 changed files with 7749 additions and 35 deletions

20
docs/Makefile Normal file
View file

@ -0,0 +1,20 @@
# Minimal makefile for Sphinx documentation
#
# You can set these variables from the command line, and also
# from the environment for the first two.
SPHINXOPTS ?=
SPHINXBUILD ?= sphinx-build
SOURCEDIR = .
BUILDDIR = _build
# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
.PHONY: help Makefile
# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

View file

@ -0,0 +1,6 @@
``sideshow.batch.neworder``
===========================
.. automodule:: sideshow.batch.neworder
:members:

View file

@ -0,0 +1,6 @@
``sideshow.batch``
==================
.. automodule:: sideshow.batch
:members:

View file

@ -0,0 +1,6 @@
``sideshow.cli.base``
=====================
.. automodule:: sideshow.cli.base
:members:

View file

@ -0,0 +1,6 @@
``sideshow.cli.install``
========================
.. automodule:: sideshow.cli.install
:members:

View file

@ -0,0 +1,6 @@
``sideshow.cli``
================
.. automodule:: sideshow.cli
:members:

View file

@ -0,0 +1,6 @@
``sideshow.config``
===================
.. automodule:: sideshow.config
:members:

View file

@ -0,0 +1,6 @@
``sideshow.db.model.batch.neworder``
====================================
.. automodule:: sideshow.db.model.batch.neworder
:members:

View file

@ -0,0 +1,6 @@
``sideshow.db.model.batch``
===========================
.. automodule:: sideshow.db.model.batch
:members:

View file

@ -0,0 +1,6 @@
``sideshow.db.model.customers``
===============================
.. automodule:: sideshow.db.model.customers
:members:

View file

@ -0,0 +1,6 @@
``sideshow.db.model.orders``
============================
.. automodule:: sideshow.db.model.orders
:members:

View file

@ -0,0 +1,6 @@
``sideshow.db.model.products``
==============================
.. automodule:: sideshow.db.model.products
:members:

View file

@ -0,0 +1,6 @@
``sideshow.db.model``
=====================
.. automodule:: sideshow.db.model
:members:

6
docs/api/sideshow.db.rst Normal file
View file

@ -0,0 +1,6 @@
``sideshow.db``
===============
.. automodule:: sideshow.db
:members:

View file

@ -0,0 +1,6 @@
``sideshow.enum``
=================
.. automodule:: sideshow.enum
:members:

6
docs/api/sideshow.rst Normal file
View file

@ -0,0 +1,6 @@
``sideshow``
============
.. automodule:: sideshow
:members:

View file

@ -0,0 +1,6 @@
``sideshow.web.app``
====================
.. automodule:: sideshow.web.app
:members:

View file

@ -0,0 +1,6 @@
``sideshow.web.forms``
======================
.. automodule:: sideshow.web.forms
:members:

View file

@ -0,0 +1,6 @@
``sideshow.web.forms.schema``
=============================
.. automodule:: sideshow.web.forms.schema
:members:

View file

@ -0,0 +1,6 @@
``sideshow.web.menus``
======================
.. automodule:: sideshow.web.menus
:members:

View file

@ -0,0 +1,6 @@
``sideshow.web``
================
.. automodule:: sideshow.web
:members:

View file

@ -0,0 +1,6 @@
``sideshow.web.static``
=======================
.. automodule:: sideshow.web.static
:members:

View file

@ -0,0 +1,6 @@
``sideshow.web.views.batch.neworder``
=====================================
.. automodule:: sideshow.web.views.batch.neworder
:members:

View file

@ -0,0 +1,6 @@
``sideshow.web.views.batch``
============================
.. automodule:: sideshow.web.views.batch
:members:

View file

@ -0,0 +1,6 @@
``sideshow.web.views.customers``
================================
.. automodule:: sideshow.web.views.customers
:members:

View file

@ -0,0 +1,6 @@
``sideshow.web.views.orders``
=============================
.. automodule:: sideshow.web.views.orders
:members:

View file

@ -0,0 +1,6 @@
``sideshow.web.views.products``
===============================
.. automodule:: sideshow.web.views.products
:members:

View file

@ -0,0 +1,6 @@
``sideshow.web.views``
======================
.. automodule:: sideshow.web.views
:members:

42
docs/conf.py Normal file
View file

@ -0,0 +1,42 @@
# Configuration file for the Sphinx documentation builder.
#
# For the full list of built-in configuration values, see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
# -- Project information -----------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information
from importlib.metadata import version as get_version
project = 'Sideshow'
copyright = '2025, Lance Edgar'
author = 'Lance Edgar'
release = get_version('Sideshow')
# -- General configuration ---------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.intersphinx',
'sphinx.ext.viewcode',
'sphinx.ext.todo',
'sphinxcontrib.programoutput',
'enum_tools.autoenum',
]
templates_path = ['_templates']
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
intersphinx_mapping = {
'pyramid': ('https://docs.pylonsproject.org/projects/pyramid/en/latest/', None),
'wuttjamaican': ('https://rattailproject.org/docs/wuttjamaican/', None),
'wuttaweb': ('https://rattailproject.org/docs/wuttaweb/', None),
}
# -- Options for HTML output -------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output
html_theme = 'furo'
html_static_path = ['_static']

36
docs/glossary.rst Normal file
View file

@ -0,0 +1,36 @@
Glossary
========
.. glossary::
:sorted:
order
This is the central focus of the app; it refers to a customer
case/special order which is tracked over time, from placement to
fulfillment. Each order may have one or more :term:`order items
<order item>`.
order item
This is effectively a "line item" within an :term:`order`. It
represents a particular product, with quantity and pricing
specific to the order.
Each order item is tracked independently of its parent order and
sibling items.
pending customer
Generally refers to a "new / unknown" customer, e.g. for whom a
new order is being created. This allows the order lifecycle to
get going before the customer has a proper account in the system.
See :class:`~sideshow.db.model.customers.PendingCustomer` for the
data model.
pending product
Generally refers to a "new / unknown" product, e.g. for which a
new order is being created. This allows the order lifecycle to
get going before the product has a true record in the system.
See :class:`~sideshow.db.model.products.PendingProduct` for the
data model.

53
docs/index.rst Normal file
View file

@ -0,0 +1,53 @@
Sideshow
========
This is a web app which provides retailers a way to track case/special
orders.
Good documentation and 100% `test coverage`_ are priorities for this
project.
.. _test coverage: https://buildbot.rattailproject.org/coverage/sideshow/
However as you can see..the API should be fairly well documented but
the narrative docs are pretty scant. That will eventually change.
.. toctree::
:maxdepth: 2
:caption: Documentation:
glossary
narr/cli/index
.. toctree::
:maxdepth: 1
:caption: Package API:
api/sideshow
api/sideshow.batch
api/sideshow.batch.neworder
api/sideshow.cli
api/sideshow.cli.base
api/sideshow.cli.install
api/sideshow.config
api/sideshow.db
api/sideshow.db.model
api/sideshow.db.model.batch
api/sideshow.db.model.batch.neworder
api/sideshow.db.model.customers
api/sideshow.db.model.orders
api/sideshow.db.model.products
api/sideshow.enum
api/sideshow.web
api/sideshow.web.app
api/sideshow.web.forms
api/sideshow.web.forms.schema
api/sideshow.web.menus
api/sideshow.web.static
api/sideshow.web.views
api/sideshow.web.views.batch
api/sideshow.web.views.batch.neworder
api/sideshow.web.views.customers
api/sideshow.web.views.orders
api/sideshow.web.views.products

35
docs/make.bat Normal file
View file

@ -0,0 +1,35 @@
@ECHO OFF
pushd %~dp0
REM Command file for Sphinx documentation
if "%SPHINXBUILD%" == "" (
set SPHINXBUILD=sphinx-build
)
set SOURCEDIR=.
set BUILDDIR=_build
%SPHINXBUILD% >NUL 2>NUL
if errorlevel 9009 (
echo.
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
echo.installed, then set the SPHINXBUILD environment variable to point
echo.to the full path of the 'sphinx-build' executable. Alternatively you
echo.may add the Sphinx directory to PATH.
echo.
echo.If you don't have Sphinx installed, grab it from
echo.https://www.sphinx-doc.org/
exit /b 1
)
if "%1" == "" goto help
%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
goto end
:help
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
:end
popd

43
docs/narr/cli/builtin.rst Normal file
View file

@ -0,0 +1,43 @@
===================
Built-in Commands
===================
Sideshow comes with one top-level :term:`command`, and some
:term:`subcommands<subcommand>`.
It uses `Typer`_ for the underlying CLI framework.
.. _Typer: https://typer.tiangolo.com/
``sideshow``
------------
This is the top-level command. Its purpose is to expose subcommands
pertaining to Sideshow.
It is installed to the virtual environment in the ``bin`` folder (or
``Scripts`` on Windows):
.. code-block:: sh
cd /path/to/venv
bin/sideshow --help
Defined in: :mod:`sideshow.cli`
.. program-output:: sideshow --help
.. _sideshow-install:
``sideshow install``
--------------------
Install the web app, generating config files based on interactive
prompting.
Defined in: :mod:`sideshow.cli.install`
.. program-output:: sideshow install --help

14
docs/narr/cli/index.rst Normal file
View file

@ -0,0 +1,14 @@
==============
Command Line
==============
There isn't much to the command line for Sideshow, but here it is.
For more general info about CLI see
:doc:`wuttjamaican:narr/cli/index`.
.. toctree::
:maxdepth: 2
builtin