Download the PHP package tourze/order-core-bundle without Composer
On this page you can find all versions of the php package tourze/order-core-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download tourze/order-core-bundle
More information about tourze/order-core-bundle
Files in tourze/order-core-bundle
Package order-core-bundle
Short Description 综合订单管理核心模块 - 提供购物车、订单创建、支付处理、发货追踪等完整电商订单功能
License MIT
Informations about the package order-core-bundle
Order Core Bundle
中文
A comprehensive order management core module for Symfony applications that provides complete e-commerce order functionality including shopping cart, order creation, payment processing, and delivery tracking.
Features
🛒 Complete Order Lifecycle Management
- Order Creation: Full shopping cart to order conversion workflow
- Payment Processing: Multi-payment method support with status tracking
- Order States: Comprehensive state management (Created, Paid, Shipped, Received, Canceled, etc.)
- Automated Processing: Scheduled tasks for order expiration and cancellation
📦 Order Components
- Contract: Main order entity with comprehensive metadata
- OrderProduct: Product line items with quantity and pricing
- OrderPrice: Price breakdown and cost calculation
- OrderContact: Customer contact and shipping information
- PayOrder: Payment transaction records
- OrderLog: Complete order history and audit trail
🔄 Event-Driven Architecture
- Order Events: Comprehensive event system for order lifecycle changes
- Payment Events: Payment status and refund event handling
- Stock Events: Automatic stock management integration
- Credit Events: User credit/points integration
🛡️ Enterprise Features
- Optimistic Locking: Prevents concurrent modification conflicts
- Audit Trail: Complete change tracking with user attribution
- IP Tracking: Network address logging for security
- Snowflake IDs: Distributed unique identifier generation
Requirements
- PHP 8.1+
- Symfony 7.3+
- Doctrine ORM 3.0+
- MySQL/PostgreSQL database
Installation
Configuration
Register the bundle in config/bundles.php:
Console Commands
order:cancel-expired
Automatically cancels expired unpaid orders and releases stock.
Class: OrderCoreBundle\Command\CancelExpiredOrdersCommand
Usage:
Features:
- Runs every minute via cron job
- Batch processing for memory efficiency
- Comprehensive logging and error handling
- Stock release through event system
- Progress tracking with configurable limits
order:expire-no-received
Processes orders that have been shipped but not received within the timeout period.
Class: OrderCoreBundle\Command\ExpireNoReceivedOrderCommand
Usage:
Features:
- Runs every 15 minutes via cron job
- Automatic order state transition to EXPIRED
- Event dispatch for customer notifications
- System user attribution for automated operations
order:sync-sku-sales-real-total
Synchronizes actual sales totals for all SKU products.
Class: OrderCoreBundle\Command\SyncSkuSalesRealTotalCommand
Usage:
Features:
- Calculates real sales from completed orders
- Updates SKU sales metrics
- Efficient batch processing
- Only updates when sales have increased
Order States
The bundle supports comprehensive order state management:
| State | Code | Description |
|---|---|---|
| Created | init |
Order has been created, awaiting payment |
| Paying | paying |
Payment is being processed |
| Paid | paid |
Payment completed, awaiting shipment |
| Partially Shipped | part-shipped |
Some items have been shipped |
| Shipped | shipped |
All items have been shipped |
| Received | received |
Order has been completed |
| Canceled | canceled |
Order has been cancelled |
| Expired | expired |
Order has expired (timeout) |
| After Sales Processing | aftersales-ing |
Return/refund in progress |
| After Sales Success | aftersales-success |
Return/refund completed |
| After Sales Failed | aftersales-failed |
Return/refund failed |
| Auditing | auditing |
Order is under review |
| Accepted | accept |
Order has been accepted |
| Rejected | reject |
Order has been rejected |
| Exception | exception |
Order processing failed |
Events
The bundle provides a rich event system for integration:
Order Lifecycle Events
BeforeOrderCreatedEvent: Fired before order creationAfterOrderCreatedEvent: Fired after order creationOrderPaidEvent: Fired when order is paidOrderReceivedEvent: Fired when order is receivedAfterOrderCancelEvent: Fired after order cancellation
Payment Events
BeforePriceRefundEvent: Fired before price refundAfterPriceRefundEvent: Fired after price refund
Supplier Events
SupplierOrderReceivedEvent: Supplier order receivedSupplierExpireAcceptOrderEvent: Supplier acceptance timeout
Special Events
AutoExpireOrderStateEvent: Automatic order expirationOrderCheckoutEvent: Order checkout processViewOrderEvent: Order viewing (for permissions/logging)
Entities
Contract (Main Order)
Order Product
Order Price
Services
Core Services
OrderService: Main order management operationsPriceService: Price calculation and managementContractService: Contract/order lifecycle managementCollectionService: Order collection and reporting
Price Services
PriceCalculationHelper: Complex price calculationsPriceFormatter: Price formatting and displayPriceAggregator: Price aggregation for reportingProductPriceValidator: Price validation logic
Administration
AdminMenu: EasyAdmin integration for order managementAttributeControllerLoader: Dynamic controller loading
Integration Examples
Creating an Order
Processing Payment
Event Listener for Stock Management
EasyAdmin Integration
The bundle provides EasyAdmin controllers for order management:
OrderOrderCrudController: Main order managementOrderOrderPriceCrudController: Price managementOrderOrderProductCrudController: Product line itemsOrderOrderContactCrudController: Contact informationOrderOrderLogCrudController: Order historyOrderPayOrderCrudController: Payment records
JsonRPC Procedures
The bundle exposes JsonRPC procedures for remote integration:
ReceiveUserOrder: Order receiving operationsCancelUserOrder: Order cancellationCancelUserProduct: Product-level cancellationUserCheckoutOrder: Checkout processGetOrderTrackLogs: Order tracking information
Testing
The bundle includes comprehensive test fixtures:
Available fixtures:
OrderProductFixtures: Product dataOrderLogFixtures: Order historyPayOrderFixtures: Payment recordsOrderContactFixtures: Contact informationOrderPriceFixtures: Price data
Statistics
The bundle provides metrics for order statistics:
OrderCountMetricProvider: Order count metricsRevenueMetricProvider: Revenue calculation metrics
Cron Job Configuration
Add to your crontab:
Performance Considerations
- Batch Processing: All commands use configurable batch sizes
- Memory Management: Entity manager clearing in long-running processes
- Database Indexing: Strategic indexes on frequently queried fields
- Caching: Integrates with Symfony cache contracts
- Background Processing: Async event handling for non-blocking operations
Security
- User Attribution: All operations track the performing user
- IP Logging: Network address logging for security audit
- Optimistic Locking: Prevents concurrent modifications
- Input Validation: Comprehensive validation using Symfony constraints
- Rate Limiting: Compatible with Symfony rate limiting components
Contributing
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests for new functionality
- Submit a pull request
License
This bundle is released under the MIT License. See the LICENSE file for details.
Support
For questions and support, please open an issue in the repository.
All versions of order-core-bundle with dependencies
ext-mbstring Version *
doctrine/collections Version ^2.3
doctrine/dbal Version ^4.0
doctrine/doctrine-bundle Version ^2.13
doctrine/orm Version ^3.0
doctrine/persistence Version ^4.1
easycorp/easyadmin-bundle Version ^4
finecho/logistics Version ^3.1
knplabs/knp-menu Version ^3.7
knplabs/knp-paginator-bundle Version ^6.5
monolog/monolog Version ^3.1
nesbot/carbon Version ^2.72 || ^3
psr/log Version ^3|^2|^1
symfony/cache-contracts Version ^3
symfony/config Version ^7.3
symfony/console Version ^7.3
symfony/dependency-injection Version ^7.3
symfony/doctrine-bridge Version ^7.3
symfony/event-dispatcher Version ^7.3
symfony/event-dispatcher-contracts Version ^3
symfony/form Version ^7.3
symfony/framework-bundle Version ^7.3
symfony/http-client-contracts Version ^3.6
symfony/http-foundation Version ^7.3
symfony/http-kernel Version ^7.3
symfony/lock Version ^7.3
symfony/messenger Version ^7.3
symfony/password-hasher Version ^7.3
symfony/property-access Version ^7.3
symfony/routing Version ^7.3
symfony/security-bundle Version ^7.3
symfony/security-core Version ^7.3
symfony/security-http Version ^7.3
symfony/serializer Version ^7.3
symfony/service-contracts Version ^3.6
symfony/twig-bundle Version ^7.3
symfony/yaml Version ^7.3
tourze/arrayable Version 1.*
tourze/async-contracts Version 1.0.*
tourze/backtrace-helper Version 1.*
tourze/benefit-bundle Version 1.0.*
tourze/bundle-dependency Version 1.*
tourze/counter-bundle Version 1.0.*
tourze/credit-bundle Version 1.0.*
tourze/currency-manage-bundle Version 1.0.*
tourze/doctrine-async-insert-bundle Version 1.0.*
tourze/doctrine-entity-lock-bundle Version 1.0.*
tourze/doctrine-indexed-bundle Version 1.0.*
tourze/doctrine-ip-bundle Version 1.1.*
tourze/doctrine-precision-bundle Version 1.1.*
tourze/doctrine-resolve-target-entity-bundle Version 1.*
tourze/doctrine-snowflake-bundle Version 1.1.*
tourze/doctrine-timestamp-bundle Version 1.1.*
tourze/doctrine-track-bundle Version 1.1.*
tourze/doctrine-user-bundle Version 1.0.*
tourze/easy-admin-attribute Version 0.1.*
tourze/easy-admin-extra-bundle Version 1.0.*
tourze/easy-admin-menu-bundle Version 1.0.*
tourze/enum-extra Version 1.0.*
tourze/gb-t-2261 Version 1.0.*
tourze/http-client-bundle Version 1.1.*
tourze/json-rpc-core Version 1.0.*
tourze/json-rpc-lock-bundle Version 1.0.*
tourze/json-rpc-log-bundle Version 1.0.*
tourze/json-rpc-paginator-bundle Version 1.0.*
tourze/json-rpc-security-bundle Version 1.0.*
tourze/lock-service-bundle Version 1.0.*
tourze/order-contracts Version 1.0.*
tourze/payment-contracts Version 1.0.*
tourze/product-core-bundle Version 1.0.*
tourze/rbac-core Version 1.0.*
tourze/resource-manage-bundle Version 1.0.*
tourze/statistics-bundle Version 1.0.*
tourze/stock-manage-bundle Version 1.0.*
tourze/symfony-aop-async-bundle Version 1.0.*
tourze/symfony-aop-bundle Version 1.0.*
tourze/symfony-aop-doctrine-bundle Version 1.0.*
tourze/symfony-cron-job-bundle Version 1.1.*
tourze/symfony-dependency-service-loader Version 1.0.*
tourze/symfony-routing-auto-loader-bundle Version 1.0.*
tourze/symfony-snowflake-bundle Version 1.0.*
tourze/symfony-temp-file-bundle Version 1.0.*
tourze/text-manage-bundle Version 1.0.*
tourze/user-event-bundle Version 1.0.*
tourze/user-id-bundle Version 1.0.*
tourze/weui-bundle Version 1.0.*
tourze/yield-breakable-caller Version 0.0.*
yiisoft/arrays Version ^3
yiisoft/json Version ^1.0