From 17d01ac03a2f4b754f39357f1a73bb0df64b2ae6 Mon Sep 17 00:00:00 2001 From: "CHIEFSOFT\\ameye" Date: Thu, 17 Jul 2025 18:06:29 -0400 Subject: [PATCH] product status --- app/api/services/products.py | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/app/api/services/products.py b/app/api/services/products.py index 8d1d70c..c169d15 100644 --- a/app/api/services/products.py +++ b/app/api/services/products.py @@ -79,7 +79,7 @@ class ProductsService(BaseService): 'updated': t.updated.isoformat() if t.updated else None, 'banner': t.banner, 'prov_status': 5, - 'status_text': 'Activate Now' + 'status_text': ProductsService._status_text(t.status) }) # export @@ -116,6 +116,20 @@ class ProductsService(BaseService): db.session.rollback() return ResponseHelper.internal_server_error() + @staticmethod + def _status_text(status): + st_text = "Activate Now" + match status: + case 1: + st_text = "Coming Soon" + case 5: + st_text = "Activate Now" + case 6: + st_text = "Creating" + case _: + st_text = "Activate Now" + + return st_text @staticmethod def product_url_request(data):