Skip to content

Repository files navigation

Pickup Point Importer – Clean architecture module for importing logistics pickup points via XML/API.


📦 Project Purpose

This module provides a clean, modular and testable solution for importing carrier pickup points into a structured database.

It’s not a full application or standalone tool – rather, it’s a reusable import module based on MVC architecture with strict validation and modular structure.

  • XML/JSON imports from 3rd party APIs (e.g. Czech Post / Česká pošta)
  • Value Object–driven validation (e.g. ZIP, coordinates, carrier ID)
  • Entity update/create logic
  • Modular parsing and extensibility per carrier

🧠 Key Concepts

  • 📚 Clear separation of concerns – parsing, validation, import logic
  • 🎯 Strongly-typed Value Objects with strict domain validation
  • 🧱 Doctrine-based Entity & Repository architecture
  • 🧩 Pluggable parser system – each carrier has its own parser and command
  • 💬 Symfony Console commands with support for chunked imports (--offset / --limit)
  • 🚀 Import optimized for performance and reliability (transaction chunking, diff detection)
  • 🐳 Fully dockerized development environment
  • 🧪 Strict testing with PHPStan (max level), EasyCodingStandard, PHPCS + Slevomat, and PHPUnit 10+
  • 📦 Built-in support for Czech Post

🏗️ Architecture Overview

Logistics\PickupPoints\
├── Model\
│   ├── Dto\                   # DTOs for Create, Update, Config, Error, MissingRef
│   ├── Entity\                # Doctrine Entity (PickupPointEntity)
│   ├── Enum\                  # Enums for carrier, type, status, country
│   ├── Exception\             # Validation exceptions (1:1 with each VO)
│   ├── Facade\                # PickupPointImportFacade – handles full import logic
│   ├── Repository\            # Repository interface + Doctrine implementation
│   ├── ValueObject\           # Fully validated objects (ZipCodeVO, NameVO, etc.)
│
├── UI\
│   └── Console\               # Commands like `import-ceska-posta`
│
├── Parser\                    # Parser per carrier (CeskaPostaXmlParser etc.)

🚀 Installation

git clone https://github.com/janmikolas/symfony-example.git
cd symfony-example

# Start docker environment
make dev

# Install dependencies
make php
composer install

# Prepare DB (for development only)
bin/console doctrine:schema:update

📄 Console Commands

php bin/console logistics:pickup-points:import-ceska-posta --offset=0 --limit=100
php bin/console logistics:pickup-points:import-ceska-posta --all

📤 Supported Carriers

  • 🇨🇿 Czech Post – balikovny.xml


🧪 Running Tests

make phpunit           # Run full test suite
make phpunit-coverage  # With HTML coverage report

🔧 Code Quality Tools

make phpstan          # Static analysis
make phpecs           # EasyCodingStandard
make phpecsfix        # Fix styling issues
make phpcs            # PHP_CodeSniffer + Slevomat

👤 Author

Created by Jan Mikoláš

About

A modular pickup-point importer for carrier XML/API feeds, serving as a showcase example of working with Symfony.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages