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):