msupply-foundation / open-msupply

Open mSupply represents our most recent advancement in the Logistics Management Information System (LMIS), expanding on more than two decades of development inherited from the well-established legacy of the original mSupply.
https://msupply.foundation/open-msupply/
Other
20 stars 12 forks source link

Reports-versioning: move one standard report into oms repo with #4790

Open fergie-nz opened 3 days ago

fergie-nz commented 3 days ago

Is your feature request related to a problem? Please describe πŸ‘€

Manifest file updated to:

Include parameters previously used in report builder Add versioning Add report identifiers

{
    "//": "optional",
    "//": "default - false",
    "//": "Is it a custom report, custom reports will override non custom reports when report is selected",
    "isCustom": false,
    "//": "Major and minor should follow omSupply versions, only the latest version will be bundled with omSupply, but previous or future versions may exist in database",
    "//": "omSupply will match the version best suited to current omSup version",
    "version": "2.1.1",
    "//": "Report identifier, will be unique between reports but the same for different report versions",
    "code": "item_usage",
    "//": "Report context, see server/repository/src/db_diesel/report_row.rs",
    "context": "Report",
        "//": "Report name as it appears in omSupply UI",
    "name": "Report",
    "//": "optional",
    "//": "Sub context for reports, applicable to Dispensary and Report context, see client/packages/reports/src/ListView/ListView.tsx",
    "subContext": "StockAndItems",
    "//": "All location/paths relative to manifest.json",
    "//": "Location of template file",
    "template": "template.html",
    "queries": {
        "//": "optional",
        "//": "Location of gql query file file",
        "gql": "query.gql",
        "//": "optional",
        "//": "Location of sql queries, without extension",
        "//": "Each query will consist of one .sql file or two files .sqlite.sql and .postgres.sql",
        "//": "In below example 'one' query works for both sqlite and postgres and 'two' has db specific syntax",
        "//": "thus three sql files would exist in manifest.json folder 'one.sql', 'two.sqlite.sql' and 'two.postgres.sql'",
        "sql": [
            "one",
            "two"
        ]
    },
    "//": "optional",
    "arguments": {
        "//": "Location of arguments json schema",
        "schema": "arguments.json",
        "//": "Location of Arguments json forms",
        "ui": "arguments_ui.json",
    },
    "//": "optional",
    "//": "Location of header",
    "header": "header.html",
    "//": "optional",
    "//": "Location of footer",
    "footer": "footer.html",
    "test": {
        "//": "optional",
        "//": "Location of test arguments",
        "arguments": "test_arguments.json",
        "//": "Location of test reference data",
        "referenceData": "data/reference1",
        "//": "optional",
        "//": "For report that have dataId, for example requisition or outbound shipment reports",
        "dataId": "c92b740c-f271-4af0-be37-fa3068bdb0b2",
    }
}

New folder structure


reports
  item_usage
    shared
        one.sql
        arguments.json
        test_arguments.json
        arguments_ui.json
    2_3_1
        manifest.json
        two.postgres.sql
        two.sqlite.sql
        query.gql
        template.html
    2_4_3
        manifest.json
        two.postgres.sql
        two.sqlite.sql
        query.gql
        template.html

Existing reports (prior to translations) will begin at 1.0

New reports with translations (including transaction_report invoice lines) will 2.3.1

Also proposing getting rid of shared file structure and put all files in the report version structure. This would avoid issues where we might want to update arguments.json file. @andreievg maybe you had thoughts on this?

Describe the solution you'd like 🎁

Describe alternatives you've considered πŸ’­

Additional context πŸ’Œ

Moneyworks Jobcode 🧰

jmbrunskill commented 3 days ago

We should start with a single report, so we can iterate on the formats/design.

jmbrunskill commented 3 days ago

Then can move other reports over later