This commit is contained in:
dzc committed 2026-10-22 19:08:46 +08:00
1 parent 7c20242ad7
commit 382b8d660f
8 files changed
+802 -21

No files matched your search

@@ -266,6 +266,53 @@ class ServicePrintRecord {
Map<String, dynamic> toJson() => _$ServicePrintRecordToJson(this);
}
/// 下单响应丢失后的最小订单快照;仅用于确认本设备原订单,不触发再次支付。
class ServiceOrderByAndroidCode {
/// 创建一份对账快照;缺失校验字段时由调用方保守地拒绝恢复为成功。
const ServiceOrderByAndroidCode({
required this.orderId,
required this.orderStatus,
required this.payType,
this.userId,
this.totalPrice,
this.extraPrice,
this.payPrice,
});
/// 服务端订单主键,数字及字符串响应统一保留为字符串。
final String orderId;
/// 服务端订单状态编码。
final String orderStatus;
/// 支付方式编码。
final String payType;
/// 订单用户;匿名现金单为 -1。
final String? userId;
/// 商品总额,单位分。
final int? totalPrice;
/// 额外餐费,单位分。
final int? extraPrice;
/// 实付金额,单位分;现金等渠道沿用后端记录为零的规则。
final int? payPrice;
/// 兼容 Long 和金额的既有 JSON 编码,不依赖本地数据库或生成代码。
factory ServiceOrderByAndroidCode.fromJson(Map<String, dynamic> json) =>
ServiceOrderByAndroidCode(
orderId: JsonTool.anyToRequiredString(json['orderId']),
orderStatus: JsonTool.anyToRequiredString(json['orderStatus']),
payType: JsonTool.anyToRequiredString(json['payType']),
userId: JsonTool.anyToString(json['userId']),
totalPrice: JsonTool.anyToNullableInt(json['totalPrice']),
extraPrice: JsonTool.anyToNullableInt(json['extraPrice']),
payPrice: JsonTool.anyToNullableInt(json['payPrice']),
);
}
/// 按终端订单号对账返回的服务端订单和全部证据位置。
@JsonSerializable()
class ServiceOrderEvidenceResolve {