add contract for order parse
This commit is contained in:
@@ -16,15 +16,26 @@ use InvalidArgumentException;
|
||||
abstract class AbstractOrderParse extends EntityParse implements OrderContract
|
||||
{
|
||||
/**
|
||||
* 解析订单子项数据(抽象方法,由子类实现)
|
||||
*
|
||||
* 从原始数据格式化订单子项(抽象方法,由子类实现)
|
||||
*
|
||||
* 每个平台有自己的订单子项数据结构,需要各自实现具体的解析逻辑
|
||||
*
|
||||
* @param array $orderItems 原始订单子项数组
|
||||
* @param string $platformOrderId 平台订单 ID
|
||||
* @return array 解析后的订单子项数据数组
|
||||
*
|
||||
* @var $platform_orders_id_to_local_db_order_id_map
|
||||
* - 为 平台订单 id 与 本地父级订单 id 的映射数组
|
||||
* - 用来维护父订单和值订单的关系
|
||||
*
|
||||
*/
|
||||
abstract public function parseOrderItems(array $orderItems, string $platformOrderId): array;
|
||||
abstract public function formatOrderItemsFromRaw(array $raw_data, array $platform_orders_id_to_local_db_order_id_map): array;
|
||||
|
||||
/**
|
||||
* 获取本地订单状态 ID(抽象方法,由子类实现)
|
||||
*/
|
||||
abstract public function getOrderStatusId(string $platform_order_status): int;
|
||||
|
||||
/**
|
||||
* 获取支付方式 ID(抽象方法,由子类实现)
|
||||
*/
|
||||
abstract public function getPaymentMethodId(): int;
|
||||
|
||||
/**
|
||||
* 通用辅助方法:验证订单必需字段
|
||||
|
||||
Reference in New Issue
Block a user