Files
HIS-GUI/include/models/payment.h
2026-04-06 16:23:17 +08:00

54 lines
1.6 KiB
C++
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#ifndef PAYMENT_H
#define PAYMENT_H
#include <string>
#include <ctime>
class JsonValue;
// 支付方式枚举
enum class PaymentMethod {
Cash, // 现金
CreditCard, // 信用卡
MobilePayment, // 移动支付(微信/支付宝)
HealthInsurance // 医保
};
// 单笔支付记录
class Payment {
public:
std::string PaymentID; // 唯一主键
std::string PatientID; // 患者ID
double Amount; // 支付金额
PaymentMethod Method; // 支付方式
std::string PaymentType; // 支付类型(如"挂号"、"检查"、"用药"等)
std::string OperationID; // 关联的操作ID病例ID、检查ID、用药ID等
time_t PaymentTime; // 支付时间
std::string Status; // 支付状态("Pending", "Completed", "Failed", "Refunded"
std::string Description; // 支付描述
Payment();
Payment(const std::string& paymentID,
const std::string& patientID,
double amount,
PaymentMethod method,
const std::string& paymentType,
const std::string& operationID,
time_t paymentTime,
const std::string& status = "Pending",
const std::string& description = "");
// 获取支付方式的字符串表示
std::string getMethodString() const;
static PaymentMethod parseMethodString(const std::string& s);
// JSON序列化
JsonValue toJson() const;
static Payment fromJson(const JsonValue& v);
// 生成唯一ID
static std::string generateUniqueId();
};
#endif