From a0fe6f7dd72ab0c0f4e5183abab11c16caf861be Mon Sep 17 00:00:00 2001 From: Goldlabel Apps Ltd Date: Sun, 22 Mar 2026 11:06:00 +0000 Subject: [PATCH 1/2] Bump version to 1.0.8 and add test CSV Update package version from 1.0.7 to 1.0.8 in app/__init__.py. Add tests/csv/small.csv containing a header and several sample product rows (params, item, descriptions, pricing, EANs) for CSV-related tests. --- app/__init__.py | 2 +- tests/csv/small.csv | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 tests/csv/small.csv diff --git a/app/__init__.py b/app/__init__.py index 55fefd7..c28c7bc 100644 --- a/app/__init__.py +++ b/app/__init__.py @@ -1,4 +1,4 @@ """NX AI - FastAPI/Python/Postgres/tsvector""" # Current Version -__version__ = "1.0.7" +__version__ = "1.0.8" diff --git a/tests/csv/small.csv b/tests/csv/small.csv new file mode 100644 index 0000000..faa91f6 --- /dev/null +++ b/tests/csv/small.csv @@ -0,0 +1,9 @@ +Params,item,desc,UOS,Pack_Description,Hierarchy1,Hierarchy2,Hierarchy3,UOP,sSell1,sSell2,sSell3,sSell4,sSell5,pack1,pack2,pack3,pack4,pack5,EAN +"Branch: 1, Display Cost: Y,From Hierarchy1: 19,To Hierarchy1: 19,From Hierarchy2: ,To Hierarchy2: ZZZZZZZZZZ,From Hierarchy3: ,To Hierarchy3: ZZZZZZZZZZ",14217,HEETS AMBER LABEL,10,20'S,19 ECIG/VAPE,,,1,55.99,0,0,0,0,1,0,0,0,0,5.06059E+12 + +"Branch: 1, Display Cost: Y,From Hierarchy1: 19,To Hierarchy1: 19,From Hierarchy2: ,To Hierarchy2: ZZZZZZZZZZ,From Hierarchy3: ,To Hierarchy3: ZZZZZZZZZZ",19098,INSTA FLOW 5000 FRESH MINT MOJITO,1,6,19 ECIG/VAPE,,,1,28.99,0,0,0,0,1,0,0,0,0, +"Branch: 1, Display Cost: Y,From Hierarchy1: 19,To Hierarchy1: 19,From Hierarchy2: ,To Hierarchy2: ZZZZZZZZZZ,From Hierarchy3: ,To Hierarchy3: ZZZZZZZZZZ",19099,INSTA FLOW 5000 KIWI PASSION FRUIT GUAVA,1,6,19 ECIG/VAPE,,,1,28.99,0,0,0,0,1,0,0,0,0,5.06102E+12 +"Branch: 1, Display Cost: Y,From Hierarchy1: 19,To Hierarchy1: 19,From Hierarchy2: ,To Hierarchy2: ZZZZZZZZZZ,From Hierarchy3: ,To Hierarchy3: ZZZZZZZZZZ",19100,INSTA FLOW 5000 LEMON LIME,1,6,19 ECIG/VAPE,,,1,28.99,0,0,0,0,1,0,0,0,0, +"Branch: 1, Display Cost: Y,From Hierarchy1: 19,To Hierarchy1: 19,From Hierarchy2: ,To Hierarchy2: ZZZZZZZZZZ,From Hierarchy3: ,To Hierarchy3: ZZZZZZZZZZ",19101,INSTA FLOW 5000 PINEAPPLE ICE,1,6,19 ECIG/VAPE,,,1,28.99,0,0,0,0,1,0,0,0,0, +"Branch: 1, Display Cost: Y,From Hierarchy1: 19,To Hierarchy1: 19,From Hierarchy2: ,To Hierarchy2: ZZZZZZZZZZ,From Hierarchy3: ,To Hierarchy3: ZZZZZZZZZZ",19102,INSTA FLOW 5000 POLAR MINT,1,6,19 ECIG/VAPE,,,1,28.99,0,0,0,0,1,0,0,0,0, +"Branch: 1, Display Cost: Y,From Hierarchy1: 19,To Hierarchy1: 19,From Hierarchy2: ,To Hierarchy2: ZZZZZZZZZZ,From Hierarchy3: ,To Hierarchy3: ZZZZZZZZZZ",19103,INSTA FLOW 5000 RASPBERRY LEMONADE,1,6,19 ECIG/VAPE,,,1,28.99,0,0,0,0,1,0,0,0,0, From 940d2bf90b21957c7a9695a8c463e11867ad7180 Mon Sep 17 00:00:00 2001 From: Goldlabel Apps Ltd Date: Mon, 23 Mar 2026 11:48:54 +0000 Subject: [PATCH 2/2] Move products to package; fix root endpoint key Refactor products module into a package (app/api/products/products.py) and add app/api/products/__init__.py to re-export the router. Update app/api/routes.py to import the router from the new location. Also fix a typo in app/api/root.py: use the consistent "name" key for the docs endpoint in the root endpoints list. --- app/api/products/__init__.py | 1 + app/api/{ => products}/products.py | 0 app/api/root.py | 2 +- app/api/routes.py | 2 +- 4 files changed, 3 insertions(+), 2 deletions(-) create mode 100644 app/api/products/__init__.py rename app/api/{ => products}/products.py (100%) diff --git a/app/api/products/__init__.py b/app/api/products/__init__.py new file mode 100644 index 0000000..6acfc93 --- /dev/null +++ b/app/api/products/__init__.py @@ -0,0 +1 @@ +from .products import router diff --git a/app/api/products.py b/app/api/products/products.py similarity index 100% rename from app/api/products.py rename to app/api/products/products.py diff --git a/app/api/root.py b/app/api/root.py index ce376e7..e00c4b3 100644 --- a/app/api/root.py +++ b/app/api/root.py @@ -22,7 +22,7 @@ def root() -> dict: "message": "Welcome to NX AI!" } endpoints = [ - {"docs": "docs", "url": f"{base_url}/docs"}, + {"name": "docs", "url": f"{base_url}/docs"}, {"name": "health", "url": f"{base_url}/health"}, {"name": "products", "url": f"{base_url}/products"} ] diff --git a/app/api/routes.py b/app/api/routes.py index ecff493..359f853 100644 --- a/app/api/routes.py +++ b/app/api/routes.py @@ -14,7 +14,7 @@ from app.api.health import router as health_router from app.api.echo import router as echo_router from app.api.import_csv import router as import_csv_router -from app.api.products import router as products_router +from app.api.products.products import router as products_router router.include_router(root_router) router.include_router(health_router)