38 lines
938 B
C++
38 lines
938 B
C++
#ifndef REFUNDS_REPOSITORY_H
|
|
#define REFUNDS_REPOSITORY_H
|
|
|
|
#include "base_sql_table_repository.h"
|
|
#include "refunds_repository_interface.h"
|
|
|
|
#include <QSqlDatabase>
|
|
|
|
class RefundsRepository : public RefundsRepositoryInterface,
|
|
public BaseSqlTableRepository {
|
|
public:
|
|
explicit RefundsRepository(QSqlDatabase &database, QObject *parent);
|
|
|
|
// CRUD operations
|
|
// clang-format off
|
|
|
|
RepositoryResult
|
|
createRefund(const CreateRefundRequest &request) override;
|
|
|
|
RepositoryResult
|
|
getRefundById(qint32 refundId, RefundDTO &refund) const override;
|
|
|
|
RepositoryResult
|
|
getAllRefunds(QVector<RefundDTO> &refunds) const override;
|
|
|
|
RepositoryResult
|
|
updateRefund(const UpdateRefundRequest &request) override;
|
|
|
|
RepositoryResult
|
|
deleteRefundById(qint32 refundId) override;
|
|
|
|
// clang-format on
|
|
private:
|
|
RefundDTO mapQueryToDTO(const QSqlQuery &query) const;
|
|
};
|
|
|
|
#endif // REFUNDS_REPOSITORY_H
|