Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backend/enh/add city pudukkottai #700

Merged
merged 1 commit into from
Dec 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/nix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
7 changes: 7 additions & 0 deletions lib/mobility-core/src/Kernel/Types/Beckn/City.hs
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ data City
| Cuttack
| Puri
| Warangal
| Pudukkottai
| AnyCity
deriving (Eq, Generic, Show, Read, ToSchema, Ord, ToParamSchema)
deriving (PrettyShow) via Showable City
Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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)

Expand Down Expand Up @@ -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 = "*"