From 6dda27330754e2e9c67aaad3a53366e850c730c2 Mon Sep 17 00:00:00 2001 From: "CHIEFSOFT\\ameye" Date: Thu, 17 Jul 2025 18:21:45 -0400 Subject: [PATCH] status txt --- app/api/services/products.py | 43 +++++++++++++++++++++++------------- 1 file changed, 28 insertions(+), 15 deletions(-) diff --git a/app/api/services/products.py b/app/api/services/products.py index c169d15..85031e7 100644 --- a/app/api/services/products.py +++ b/app/api/services/products.py @@ -67,6 +67,19 @@ class ProductsService(BaseService): logger.info(f"Product Data ****** *****: {products}") for t in products: + + st_text = "Activate Now" + # match str(t.status): + if t.status == 1: + st_text = "Coming Soon" + + if t.status == 5: + st_text = "Activate Now" + + if t.status == 6: + st_text = "Creating" + + product_data.append({ 'id': t.id, 'uid': t.uid, @@ -79,7 +92,7 @@ class ProductsService(BaseService): 'updated': t.updated.isoformat() if t.updated else None, 'banner': t.banner, 'prov_status': 5, - 'status_text': ProductsService._status_text(t.status) + 'status_text': st_text }) # export @@ -116,20 +129,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 _status_text(self, status): + # st_text = "Activate Now" + # match str(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):