From 05f85653e0dca2be8f16952048161d946e678ce4 Mon Sep 17 00:00:00 2001 From: "saimanohar.veeravajhula" Date: Tue, 3 Dec 2024 02:54:39 +0530 Subject: [PATCH] backend/enh/add-city-Pudukkottai-to-main --- lib/mobility-core/src/Kernel/Types/Beckn/City.hs | 7 +++++++ 1 file changed, 7 insertions(+) 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 = "*"