Skip to content

Add Czech Post - #240

Open
FoxxoOwO wants to merge 1 commit into
itsvic-dev:masterfrom
FoxxoOwO:master
Open

Add Czech Post#240
FoxxoOwO wants to merge 1 commit into
itsvic-dev:masterfrom
FoxxoOwO:master

Conversation

@FoxxoOwO

Copy link
Copy Markdown

Copilot AI lite review requested due to automatic review settings August 19, 2026 10:18

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 CzechPostDeliveryService with Retrofit/Moshi models, status mapping, and history parsing.
  • Registered the new CZECH_POST service in the Service enum and getDeliveryService() 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)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants