From 61a924afeb80145de624b7fdf3c9a7b2218d8823 Mon Sep 17 00:00:00 2001 From: "saimanohar.veeravajhula" Date: Mon, 2 Dec 2024 20:22:04 +0530 Subject: [PATCH] backend/add-city-Pudukkottai --- .github/workflows/nix.yml | 4 ++-- lib/mobility-core/src/Kernel/Types/Beckn/City.hs | 7 +++++++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/.github/workflows/nix.yml b/.github/workflows/nix.yml index 55ca1fdd2..b7720f662 100644 --- a/.github/workflows/nix.yml +++ b/.github/workflows/nix.yml @@ -3,9 +3,9 @@ name: CI on: # Triggers the workflow on push or pull request events but only for the "main" branch push: - branches: ["main"] + branches: ["main", "prodHotPush-Common"] pull_request: - branches: ["main"] + branches: ["main", "prodHotPush-Common"] # Allows you to run this workflow manually from the Actions tab workflow_dispatch: diff --git a/lib/mobility-core/src/Kernel/Types/Beckn/City.hs b/lib/mobility-core/src/Kernel/Types/Beckn/City.hs index f638f367e..1d6fe74f4 100644 --- a/lib/mobility-core/src/Kernel/Types/Beckn/City.hs +++ b/lib/mobility-core/src/Kernel/Types/Beckn/City.hs @@ -88,6 +88,7 @@ data City | Cuttack | Puri | Warangal + | Pudukkottai | AnyCity deriving (Eq, Generic, Show, Read, ToSchema, Ord, ToParamSchema) deriving (PrettyShow) via Showable City @@ -210,6 +211,8 @@ instance FromJSON City where parseJSON (String "Puri") = pure Puri parseJSON (String "std:0870") = pure Warangal parseJSON (String "Warangal") = pure Warangal + parseJSON (String "std:04322") = pure Pudukkottai + parseJSON (String "Pudukkottai") = pure Pudukkottai parseJSON (String _) = pure AnyCity parseJSON e = typeMismatch "String" e @@ -271,6 +274,7 @@ instance ToJSON City where toJSON Cuttack = String "std:0671" toJSON Puri = String "std:06752" toJSON Warangal = String "std:0870" + toJSON Pudukkottai = String "std:04322" toJSON AnyCity = String "*" instance FromHttpApiData City where @@ -393,6 +397,8 @@ instance FromHttpApiData City where parseLowerCaseCity "puri" = Right Puri parseLowerCaseCity "std:0870" = Right Warangal parseLowerCaseCity "warangal" = Right Warangal + parseLowerCaseCity "std:04322" = Right Pudukkottai + parseLowerCaseCity "pudukkottai" = Right Pudukkottai parseLowerCaseCity "*" = Right AnyCity parseLowerCaseCity city = Left . T.pack $ ("ParseFail: Unable to parse city: " <> city) @@ -454,4 +460,5 @@ instance ToHttpApiData City where toUrlPiece Cuttack = "std:0671" toUrlPiece Puri = "std:06752" toUrlPiece Warangal = "std:0870" + toUrlPiece Pudukkottai = "std:04322" toUrlPiece AnyCity = "*"