first commit
This commit is contained in:
@@ -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
|
||||
Reference in New Issue
Block a user