feat(MemberOrders): implement member orders feature

- Added new models and routes for managing member orders and order history.
- Updated server.js to include member order routes and sync functionality.
- Enhanced frontend with new components and dialogs for viewing and managing orders.
- Integrated internationalization support for order-related texts across multiple languages.
- Updated navigation and views to include access to the new orders feature, improving user experience.
This commit is contained in:
Torsten Schulz (local)
2026-03-24 17:01:57 +01:00
parent e55ee0f88a
commit 02f1bed452
32 changed files with 1743 additions and 0 deletions

View File

@@ -0,0 +1,36 @@
CREATE TABLE IF NOT EXISTS member_orders (
id INT NOT NULL AUTO_INCREMENT,
member_id INT NOT NULL,
club_id INT NOT NULL,
item VARCHAR(255) NOT NULL,
status ENUM('requested', 'ordered', 'arrived', 'handed_over') NOT NULL DEFAULT 'requested',
order_date DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
status_date DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
cost DECIMAL(10,2) NOT NULL DEFAULT 0.00,
paid_amount DECIMAL(10,2) NOT NULL DEFAULT 0.00,
created_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
updated_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (id),
KEY idx_member_orders_member_id (member_id),
KEY idx_member_orders_club_id (club_id),
KEY idx_member_orders_status (status)
);
CREATE TABLE IF NOT EXISTS member_order_history (
id INT NOT NULL AUTO_INCREMENT,
member_order_id INT NOT NULL,
member_id INT NOT NULL,
club_id INT NOT NULL,
item VARCHAR(255) NOT NULL,
status ENUM('requested', 'ordered', 'arrived', 'handed_over') NOT NULL,
changed_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
cost DECIMAL(10,2) NOT NULL DEFAULT 0.00,
paid_amount DECIMAL(10,2) NOT NULL DEFAULT 0.00,
created_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
updated_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (id),
KEY idx_member_order_history_order_id (member_order_id),
KEY idx_member_order_history_member_id (member_id),
KEY idx_member_order_history_club_id (club_id),
KEY idx_member_order_history_changed_at (changed_at)
);