ORE import and export prototype

Table of Contents

Item Where
Prototype the prototype
Gemini review none
Group Trades prototypes

1. Summary

Import a portfolio from ORE and Export a portfolio to ORE are workflows: each has several steps and a write that a person must understand before it happens. The prototype draws both. ?mode=export switches to the export. Each is listed once, in the Workflows menu of the trade list, so neither page carries a menu. A reader is told what the screen needs and offered a request for each role that gives it. ?fail=import and ?fail=export show a failed call, which names its operation, status and request id.

2. Detail

2.1. Import

Five steps: directory, choices, preview, confirm, result. The first step finds every portfolio file in the directory and below it, lists them, and lets the person choose which to bring in. Folders named in the skip list are not searched, and the step says how many files that skipped. Files are found by content, not by name. A file is a portfolio when its root element is Portfolio, so swaps_book.xml is listed and a file called portfolio_notes.xml with another root element is not. A file the name would not reveal carries a chip, found by content, and a fold-out lists the XML files that are not portfolios, with the reason. The browser cannot do this itself and should not guess from names, so the list is the result of a server scan: the scanner exists, and no operation returns its result. Each file shows the book it becomes, because the import builds portfolios and books from the folders and the person no longer picks one book.

The real import has no choice of files. It brings in every file the scan finds, and takes only the folders to skip, the parent portfolio, the re-import mode and the trade defaults. The file list is the change this prototype argues for. The journey lists it as missing, with the missing operation that lists the files.

The preview is the plan. It lists every trade of the chosen files, says which counterparty names match no alias and which trade types have no instrument table, and offers a default counterparty as the way out. The preview and the export check are paged. The confirm step asks for a reason and commentary. The step is in the address, so Back returns to the earlier step. The result says what was refused and why, and offers the rollback, which asks for a reason in a dialog. A rollback removes the trades the import created, and the prototype keeps them in the browser so that they appear on the trade list.

2.2. Export

The person chooses a book or the trades chosen in the list, and chooses a file or storage for a run. The check names the trades the file cannot hold (a draft, a cancelled trade, a trade type with no instrument table) before it is made. The result shows the beginning of the file.

2.3. What is fake

The file never leaves the browser. The upload path of a browser is not defined: the journey names it as missing.

2.4. Where the code lives

doc/prototypes/trades/ore-portfolio/.

3. See also

Emacs 29.3 (Org mode 9.6.15)