first commit

This commit is contained in:
lidg
2026-08-18 09:40:43 +08:00
commit 0c4fd6844c
70 changed files with 8721 additions and 0 deletions
+33
View File
@@ -0,0 +1,33 @@
#ifndef ORDERSERVICE_H
#define ORDERSERVICE_H
#include "../models/order.h"
#include <QList>
class OrderService
{
public:
static OrderService &instance();
QList<Order> listOrders(QString *error = nullptr, int limit = 100);
bool findOrder(int id, Order *order, QString *error = nullptr);
bool createOrder(Order *order, QString *error = nullptr);
bool generateWorkpiecesAndAssign(int orderId, QString *error = nullptr);
bool startOrder(int id, QString *error = nullptr);
bool pauseOrder(int id, QString *error = nullptr);
bool resumeOrder(int id, QString *error = nullptr);
bool completeOrder(int id, QString *error = nullptr);
bool cancelOrder(int id, QString *error = nullptr);
bool deleteOrder(int id, QString *error = nullptr);
private:
OrderService() = default;
OrderService(const OrderService &) = delete;
OrderService &operator=(const OrderService &) = delete;
bool transition(int id, const QStringList &allowedStates, const QString &targetState,
const QString &action, QString *error);
};
#endif // ORDERSERVICE_H