PHPackages                             tourze/hotel-card-delivery-bundle - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. tourze/hotel-card-delivery-bundle

ActiveSymfony-bundle

tourze/hotel-card-delivery-bundle
=================================

酒店房卡配送管理组件，提供房卡配送任务管理、配送费用计算、配送状态跟踪等功能

0.0.1(11mo ago)00MITPHPPHP ^8.1CI failing

Since May 24Pushed 4mo agoCompare

[ Source](https://github.com/tourze/hotel-card-delivery-bundle)[ Packagist](https://packagist.org/packages/tourze/hotel-card-delivery-bundle)[ RSS](/packages/tourze-hotel-card-delivery-bundle/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (26)Versions (2)Used By (0)

Hotel Card Delivery Bundle
==========================

[](#hotel-card-delivery-bundle)

[English](README.md) | [中文](README.zh-CN.md)

\[[![Packagist Version](https://camo.githubusercontent.com/5bb7a4894639b81d9e695b8e94b08a99de3f87f8bd2614ab1c4803e4ef21dd3e/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f746f75727a652f686f74656c2d636172642d64656c69766572792d62756e646c65)](https://camo.githubusercontent.com/5bb7a4894639b81d9e695b8e94b08a99de3f87f8bd2614ab1c4803e4ef21dd3e/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f746f75727a652f686f74656c2d636172642d64656c69766572792d62756e646c65)\] () \[[![PHP Version Require](https://camo.githubusercontent.com/be2030ae1b0c19b2903987fbe6ed5489b2bd9df34d28464ce0fc7c157304a945/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f746f75727a652f686f74656c2d636172642d64656c69766572792d62756e646c65)](https://camo.githubusercontent.com/be2030ae1b0c19b2903987fbe6ed5489b2bd9df34d28464ce0fc7c157304a945/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f746f75727a652f686f74656c2d636172642d64656c69766572792d62756e646c65)\] () \[[![License](https://camo.githubusercontent.com/6bcb37cfbb01e348708166345e7c7eba0960175527308c0e1f66544cf0eeaf7a/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f746f75727a652f686f74656c2d636172642d64656c69766572792d62756e646c65)](https://camo.githubusercontent.com/6bcb37cfbb01e348708166345e7c7eba0960175527308c0e1f66544cf0eeaf7a/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f746f75727a652f686f74656c2d636172642d64656c69766572792d62756e646c65)\] () \[[![Build Status](https://github.com/tourze/hotel-card-delivery-bundle/workflows/Tests/badge.svg)](https://github.com/tourze/hotel-card-delivery-bundle/workflows/Tests/badge.svg)\] () \[[![Code Coverage](https://camo.githubusercontent.com/f26acad3528a56f32d74bec0818256952b920d57b8d6f9459391a9b59f842abe/68747470733a2f2f636f6465636f762e696f2f67682f746f75727a652f686f74656c2d636172642d64656c69766572792d62756e646c652f6272616e63682f6d61737465722f67726170682f62616467652e737667)](https://camo.githubusercontent.com/f26acad3528a56f32d74bec0818256952b920d57b8d6f9459391a9b59f842abe/68747470733a2f2f636f6465636f762e696f2f67682f746f75727a652f686f74656c2d636172642d64656c69766572792d62756e646c652f6272616e63682f6d61737465722f67726170682f62616467652e737667)\] ()

A Symfony bundle for managing hotel key card delivery services, including delivery tasks, cost calculation, and status tracking.

Table of Contents
-----------------

[](#table-of-contents)

- [Features](#features)
- [Installation](#installation)
- [Configuration](#configuration)
- [Usage](#usage)
    - [Entity Structure](#entity-structure)
    - [Delivery Status Workflow](#delivery-status-workflow)
    - [Repository Usage](#repository-usage)
    - [Admin Interface](#admin-interface)
    - [Advanced Usage](#advanced-usage)
- [Requirements](#requirements)
- [Testing](#testing)
- [Contributing](#contributing)
- [License](#license)

Features
--------

[](#features)

- 🏨 Hotel key card delivery management
- 📋 Delivery task creation and tracking
- 💰 Cost calculation with multiple factors (base, distance, urgency, extra)
- 🔄 Delivery status workflow management
- 🎛️ EasyAdmin integration for backend management
- 📊 Comprehensive reporting and analytics

Installation
------------

[](#installation)

Install the bundle via Composer:

```
composer require tourze/hotel-card-delivery-bundle
```

Register the bundle in your `config/bundles.php`:

```
return [
    // ...
    Tourze\HotelCardDeliveryBundle\HotelCardDeliveryBundle::class => ['all' => true],
];
```

Configuration
-------------

[](#configuration)

### Database Migration

[](#database-migration)

Create and run database migrations:

```
php bin/console make:migration
php bin/console doctrine:migrations:migrate
```

Usage
-----

[](#usage)

### Entity Structure

[](#entity-structure)

#### KeyCardDelivery Entity

[](#keycarddelivery-entity)

Represents a hotel key card delivery task with the following properties:

- Order reference (hotel booking order)
- Hotel information
- Room count (number of key cards)
- Delivery time
- Status (pending, assigned, in\_progress, completed, cancelled, exception)
- Fee amount
- Receipt photo URL
- Completion time
- Remarks

#### DeliveryCost Entity

[](#deliverycost-entity)

Represents detailed cost breakdown for delivery:

- Base cost
- Distance-based cost
- Urgency cost
- Extra charges
- Distance information
- Settlement status
- Remarks

### Delivery Status Workflow

[](#delivery-status-workflow)

```
graph TD
    A[PENDING] --> B[ASSIGNED]
    B --> C[IN_PROGRESS]
    C --> D[COMPLETED]

    A --> E[CANCELLED]
    B --> E
    C --> E

    A --> F[EXCEPTION]
    B --> F
    C --> F

```

### Repository Usage

[](#repository-usage)

#### KeyCardDelivery Repository

[](#keycarddelivery-repository)

```
use Tourze\HotelCardDeliveryBundle\Repository\KeyCardDeliveryRepository;

// Find deliveries by status
$pendingDeliveries = $repository->findByStatus(DeliveryStatusEnum::PENDING);

// Find today's deliveries
$todayDeliveries = $repository->findTodayDeliveries();

// Get total fee for a period
$totalFee = $repository->getTotalFeeInPeriod($startDate, $endDate);
```

#### DeliveryCost Repository

[](#deliverycost-repository)

```
use Tourze\HotelCardDeliveryBundle\Repository\DeliveryCostRepository;

// Find cost by delivery
$cost = $repository->findByDelivery($delivery);

// Find unsettled costs
$unsettledCosts = $repository->findUnsettled();

// Calculate total cost by period
$totalCost = $repository->calculateTotalCostByPeriod($startDate, $endDate);
```

### Admin Interface

[](#admin-interface)

The bundle provides EasyAdmin controllers for:

- Key card delivery management
- Cost tracking and settlement
- Status updates and workflow management

### Advanced Usage

[](#advanced-usage)

#### Creating Delivery Tasks Programmatically

[](#creating-delivery-tasks-programmatically)

```
use Tourze\HotelCardDeliveryBundle\Entity\KeyCardDelivery;
use Tourze\HotelCardDeliveryBundle\Enum\DeliveryStatusEnum;

$delivery = new KeyCardDelivery();
$delivery->setOrder($order)
    ->setHotel($hotel)
    ->setRoomCount(2)
    ->setDeliveryTime(new \DateTimeImmutable('+2 hours'))
    ->setStatus(DeliveryStatusEnum::PENDING)
    ->calculateFee(100.0); // 100 per room

$entityManager->persist($delivery);
$entityManager->flush();
```

#### Cost Calculation

[](#cost-calculation)

```
use Tourze\HotelCardDeliveryBundle\Entity\DeliveryCost;

$cost = new DeliveryCost();
$cost->setDelivery($delivery)
    ->setBaseCost('50.00')
    ->setDistance(5.2) // 5.2 km
    ->calculateDistanceCost(2.0) // 2.0 per km
    ->setUrgencyCost('20.00');

$entityManager->persist($cost);
$entityManager->flush();
```

Requirements
------------

[](#requirements)

- PHP 8.1+
- Symfony 6.4+
- Doctrine ORM 3.0+
- EasyAdmin Bundle 4+

### Required Dependencies

[](#required-dependencies)

This bundle requires the following packages:

- `tourze/hotel-agent-bundle` - Hotel agent management
- `tourze/hotel-profile-bundle` - Hotel profile management
- `tourze/doctrine-timestamp-bundle` - Timestamp functionality
- `tourze/doctrine-user-bundle` - User management

Testing
-------

[](#testing)

Run the test suite:

```
# Run PHPUnit tests
./vendor/bin/phpunit packages/hotel-card-delivery-bundle/tests

# Run PHPStan analysis
php -d memory_limit=2G ./vendor/bin/phpstan analyse packages/hotel-card-delivery-bundle
```

Contributing
------------

[](#contributing)

1. Fork the repository
2. Create your feature branch (`git checkout -b feature/amazing-feature`)
3. Commit your changes (`git commit -m 'Add amazing feature'`)
4. Push to the branch (`git push origin feature/amazing-feature`)
5. Open a Pull Request

License
-------

[](#license)

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance63

Regular maintenance activity

Popularity0

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity35

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

353d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/e354fdb316da535dfa8ba2e9193a473c403b6bc6fb9170778d1dc50e304c6e9d?d=identicon)[tourze](/maintainers/tourze)

---

Top Contributors

[![tourze](https://avatars.githubusercontent.com/u/13899502?v=4)](https://github.com/tourze "tourze (1 commits)")

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/tourze-hotel-card-delivery-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/tourze-hotel-card-delivery-bundle/health.svg)](https://phpackages.com/packages/tourze-hotel-card-delivery-bundle)
```

###  Alternatives

[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.4k5.6M651](/packages/sylius-sylius)[ec-cube/ec-cube

EC-CUBE EC open platform.

78527.0k1](/packages/ec-cube-ec-cube)[sulu/sulu

Core framework that implements the functionality of the Sulu content management system

1.3k1.3M152](/packages/sulu-sulu)[contao/core-bundle

Contao Open Source CMS

1231.6M2.4k](/packages/contao-core-bundle)[open-dxp/opendxp

Content &amp; Product Management Framework (CMS/PIM)

7310.3k29](/packages/open-dxp-opendxp)[netgen/layouts-core

Netgen Layouts enables you to build and manage complex web pages in a simpler way and with less coding. This is the core of Netgen Layouts, its heart and soul.

3689.4k10](/packages/netgen-layouts-core)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
