Add Czech Post - #240
Open
FoxxoOwO wants to merge 1 commit into
Open
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds support for Czech Post tracking by introducing a new DeliveryService implementation backed by Česká pošta’s B2C ParcelHistory API, and wires it into the app’s service registry and localized UI strings.
Changes:
- Added
CzechPostDeliveryServicewith Retrofit/Moshi models, status mapping, and history parsing. - Registered the new
CZECH_POSTservice in theServiceenum andgetDeliveryService()mapping. - Added English and Czech localized service name strings.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| app/src/main/res/values/strings.xml | Adds the “Czech Post” service display name. |
| app/src/main/res/values-cs/strings.xml | Adds the Czech translation “Česká pošta” for the service. |
| app/src/main/java/dev/itsvic/parceltracker/api/CzechPostDeliveryService.kt | Implements Czech Post API integration, history parsing, and status mapping. |
| app/src/main/java/dev/itsvic/parceltracker/api/Core.kt | Registers CZECH_POST in the service enum and delivery-service lookup. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+73
to
+83
| private fun parseDate(dateStr: String): LocalDateTime { | ||
| return try { | ||
| if (dateStr.length == 10) { | ||
| java.time.LocalDate.parse(dateStr).atStartOfDay() | ||
| } else { | ||
| LocalDateTime.parse(dateStr.replace(" ", "T"), DateTimeFormatter.ISO_DATE_TIME) | ||
| } | ||
| } catch (e: Exception) { | ||
| LocalDateTime.now() | ||
| } | ||
| } |
Comment on lines
+19
to
+22
| override fun acceptsFormat(trackingId: String): Boolean { | ||
| // Example: DR7049601914C, RR123456789CZ | ||
| return emsFormat.accepts(trackingId) || """^[A-Z]{2}\d{9,11}[A-Z0-9]?$""".toRegex().accepts(trackingId) | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Added Czech post (https://www.ceskaposta.cz/en/) using their B2C API (https://b2c.cpost.cz/?urls.primaryName=B2C%20ParcelHistory%20API)