Initial commit

This commit is contained in:
user
2026-07-12 14:34:52 +04:00
commit 3abf6bd9c2
557 changed files with 68706 additions and 0 deletions
@@ -0,0 +1,34 @@
#ifndef GENRES_REPOSITORY_INTERFACE_H
#define GENRES_REPOSITORY_INTERFACE_H
#include "repository_interface.h"
#include <QVector>
// Forward declarations
struct CreateGenreRequest;
struct GenreDTO;
struct UpdateGenreRequest;
struct RepositoryResult;
// Interface for genres repository
class GenresRepositoryInterface : public RepositoryInterface {
public:
// Create a new genre
virtual RepositoryResult createGenre(const CreateGenreRequest &request) = 0;
// Retrieve a genre by ID
virtual RepositoryResult getGenreById(qint32 genreId,
GenreDTO &genre) const = 0;
// Retrieve all genres
virtual RepositoryResult getAllGenres(QVector<GenreDTO> &genres) const = 0;
// Update an existing genre
virtual RepositoryResult updateGenre(const UpdateGenreRequest &request) = 0;
// Delete a genre by ID
virtual RepositoryResult deleteGenreById(qint32 genreId) = 0;
};
#endif // GENRES_REPOSITORY_INTERFACE_H
@@ -0,0 +1,33 @@
#ifndef HALLS_REPOSITORY_INTERFACE_H
#define HALLS_REPOSITORY_INTERFACE_H
#include "repository_interface.h"
#include <QVector>
// Forward declarations
struct CreateHallRequest;
struct HallDTO;
struct RepositoryResult;
struct UpdateHallRequest;
// Interface for halls repository
class HallsRepositoryInterface : public RepositoryInterface {
public:
// Create a new hall
virtual RepositoryResult createHall(const CreateHallRequest &request) = 0;
// Retrieve a hall by ID
virtual RepositoryResult getHallById(qint32 hallId, HallDTO &hall) const = 0;
// Retrieve all halls
virtual RepositoryResult getAllHalls(QVector<HallDTO> &halls) const = 0;
// Update an existing hall
virtual RepositoryResult updateHall(const UpdateHallRequest &request) = 0;
// Delete a hall by ID
virtual RepositoryResult deleteHallById(qint32 hallId) = 0;
};
#endif // HALLS_REPOSITORY_INTERFACE_H
@@ -0,0 +1,34 @@
#ifndef MOVIES_REPOSITORY_INTERFACE_H
#define MOVIES_REPOSITORY_INTERFACE_H
#include "repository_interface.h"
#include <QVector>
// Forward declarations
struct CreateMovieRequest;
struct MovieDTO;
struct RepositoryResult;
struct UpdateMovieRequest;
// Interface for movies repository
class MoviesRepositoryInterface : public RepositoryInterface {
public:
// Create a new movie
virtual RepositoryResult createMovie(const CreateMovieRequest &request) = 0;
// Retrieve a movie by ID
virtual RepositoryResult getMovieById(qint32 movieId,
MovieDTO &movie) const = 0;
// Retrieve all movies
virtual RepositoryResult getAllMovies(QVector<MovieDTO> &movies) const = 0;
// Update an existing movie
virtual RepositoryResult updateMovie(const UpdateMovieRequest &request) = 0;
// Delete a movie by ID
virtual RepositoryResult deleteMovieById(qint32 movieId) = 0;
};
#endif // MOVIES_REPOSITORY_INTERFACE_H
@@ -0,0 +1,34 @@
#ifndef REFUNDS_REPOSITORY_INTERFACE_H
#define REFUNDS_REPOSITORY_INTERFACE_H
#include "repository_interface.h"
#include <QVector>
// Forward declarations
struct CreateRefundRequest;
struct RefundDTO;
struct RepositoryResult;
struct UpdateRefundRequest;
// Interface for refunds repository
class RefundsRepositoryInterface : public RepositoryInterface {
public:
// Create a new refund
virtual RepositoryResult createRefund(const CreateRefundRequest &request) = 0;
// Retrieve a refund by ID
virtual RepositoryResult getRefundById(qint32 refundId,
RefundDTO &refund) const = 0;
// Retrieve all refunds
virtual RepositoryResult getAllRefunds(QVector<RefundDTO> &refunds) const = 0;
// Update an existing refund
virtual RepositoryResult updateRefund(const UpdateRefundRequest &request) = 0;
// Delete a refund by ID
virtual RepositoryResult deleteRefundById(qint32 refundId) = 0;
};
#endif // REFUNDS_REPOSITORY_INTERFACE_H
+11
View File
@@ -0,0 +1,11 @@
#ifndef REPOSITORY_INTERFACE_H
#define REPOSITORY_INTERFACE_H
#include <QVariant>
class RepositoryInterface {
public:
virtual ~RepositoryInterface() = default;
};
#endif // REPOSITORY_INTERFACE_H
+7
View File
@@ -0,0 +1,7 @@
#include "repository_result.h"
RepositoryResult RepositoryResult::successResult() { return {"", true}; }
RepositoryResult RepositoryResult::failureResult(const QString &error) {
return {error, false};
}
+18
View File
@@ -0,0 +1,18 @@
#ifndef REPOSITORY_RESULT_H
#define REPOSITORY_RESULT_H
#include <QString>
// Represents the result of an operation in a repository
struct RepositoryResult {
QString errorMessage; // Error message if the operation failed
bool success; // Indicates whether the operation was successful
// Creates a successful result
static RepositoryResult successResult();
// Creates a failed result with an error message
static RepositoryResult failureResult(const QString &error);
};
#endif // REPOSITORY_RESULT_H
@@ -0,0 +1,33 @@
#ifndef ROLES_REPOSITORY_INTERFACE_H
#define ROLES_REPOSITORY_INTERFACE_H
#include "create_role_request.h"
#include "repository_interface.h"
#include "update_role_request.h"
#include <QVector>
// Forward declarations
struct RepositoryResult;
struct RoleDTO;
// Interface for sessions repository
class RolesRepositoryInterface : public RepositoryInterface {
public:
// Create a new role
virtual RepositoryResult createRole(const CreateRoleRequest &request) = 0;
// Retrieve a role by ID
virtual RepositoryResult getRoleById(qint32 roleId, RoleDTO &role) const = 0;
// Retrieve all roles
virtual RepositoryResult getAllRoles(QVector<RoleDTO> &roles) const = 0;
// Update an existing role
virtual RepositoryResult updateRole(const UpdateRoleRequest &request) = 0;
// Delete a role by ID
virtual RepositoryResult deleteRoleById(qint32 roleId) = 0;
};
#endif // ROLES_REPOSITORY_INTERFACE_H
@@ -0,0 +1,37 @@
#ifndef SESSIONS_REPOSITORY_INTERFACE_H
#define SESSIONS_REPOSITORY_INTERFACE_H
#include "repository_interface.h"
#include <QVector>
// Forward declarations
struct CreateSessionRequest;
struct RepositoryResult;
struct SessionDTO;
struct UpdateSessionRequest;
// Interface for sessions repository
class SessionsRepositoryInterface : public RepositoryInterface {
public:
// Create a new session
virtual RepositoryResult
createSession(const CreateSessionRequest &request) = 0;
// Retrieve a session by ID
virtual RepositoryResult getSessionById(qint32 sessionId,
SessionDTO &session) const = 0;
// Retrieve all sessions
virtual RepositoryResult
getAllSessions(QVector<SessionDTO> &sessions) const = 0;
// Update an existing session
virtual RepositoryResult
updateSession(const UpdateSessionRequest &request) = 0;
// Delete a session by ID
virtual RepositoryResult deleteSessionById(qint32 sessionId) = 0;
};
#endif // SESSIONS_REPOSITORY_INTERFACE_H
@@ -0,0 +1,38 @@
#ifndef SESSIONS_STATICTICS_REPOSITORY_INTERFACE_H
#define SESSIONS_STATICTICS_REPOSITORY_INTERFACE_H
#include "repository_interface.h"
#include <QDateTime>
#include <QVector>
// Forward declaration
class SessionStatisticsDTO;
class RepositoryResult;
class SessionsStatisticsRepositoryInterface : public RepositoryInterface {
public:
virtual ~SessionsStatisticsRepositoryInterface() = default;
virtual RepositoryResult
getSessionById(qint32 sessionid, SessionStatisticsDTO &sessionInfo) const = 0;
virtual RepositoryResult
getSessionsForGenre(qint32 genreId, std::optional<QDateTime> startDate,
std::optional<QDateTime> endDate,
QVector<SessionStatisticsDTO> &sessions) const = 0;
virtual RepositoryResult
getSessionsForHall(qint32 hallId, std::optional<QDateTime> startDate,
std::optional<QDateTime> endDate,
QVector<SessionStatisticsDTO> &sessions) const = 0;
virtual RepositoryResult
getSessionsForMovie(qint32 movieId, std::optional<QDateTime> startDate,
std::optional<QDateTime> endDate,
QVector<SessionStatisticsDTO> &sessions) const = 0;
virtual RepositoryResult
getAllSessions(QVector<SessionStatisticsDTO> &sessions) const = 0;
};
#endif // SESSIONS_STATICTICS_REPOSITORY_INTERFACE_H
@@ -0,0 +1,34 @@
#ifndef TICKETS_REPOSITORY_INTERFACE_H
#define TICKETS_REPOSITORY_INTERFACE_H
#include "repository_interface.h"
#include <QVector>
// Forward declarations
struct CreateTicketRequest;
struct TicketDTO;
struct RepositoryResult;
struct UpdateTicketRequest;
// Interface for tickets repository
class TicketsRepositoryInterface : public RepositoryInterface {
public:
// Create a new ticket
virtual RepositoryResult createTicket(const CreateTicketRequest &request) = 0;
// Retrieve a ticket by ID
virtual RepositoryResult getTicketById(qint32 ticketId,
TicketDTO &ticket) const = 0;
// Retrieve all tickets
virtual RepositoryResult getAllTickets(QVector<TicketDTO> &tickets) const = 0;
// Update an existing ticket
virtual RepositoryResult updateTicket(const UpdateTicketRequest &request) = 0;
// Delete a ticket by ID
virtual RepositoryResult deleteTicketById(qint32 ticketId) = 0;
};
#endif // TICKETS_REPOSITORY_INTERFACE_H
@@ -0,0 +1,37 @@
#ifndef USERS_REPOSITORY_INTERFACE_H
#define USERS_REPOSITORY_INTERFACE_H
#include "create_user_request.h"
#include "repository_interface.h"
#include "update_user_request.h"
#include <QVector>
// Forward declarations
struct RepositoryResult;
struct UserDTO;
// Interface for sessions repository
class UsersRepositoryInterface : public RepositoryInterface {
public:
// Create a new user
virtual RepositoryResult createUser(const CreateUserRequest &request) = 0;
// Retrieve a user by ID
virtual RepositoryResult getUserById(qint32 userId, UserDTO &user) const = 0;
// Retrieve a user by username
virtual RepositoryResult getUserByUsername(const QString &username,
UserDTO &user) const = 0;
// Retrieve all users
virtual RepositoryResult getAllUsers(QVector<UserDTO> &users) const = 0;
// Update an existing user
virtual RepositoryResult updateUser(const UpdateUserRequest &request) = 0;
// Delete a user by ID
virtual RepositoryResult deleteUserById(qint32 userId) = 0;
};
#endif // USERS_REPOSITORY_INTERFACE_H