update user purchase list

This commit is contained in:
NW 2025-01-09 13:25:35 +00:00
parent 18647091cf
commit f9356c6bbe
3 changed files with 9 additions and 1 deletions

View File

@ -1,3 +1,6 @@
// userPurchaseHandler.js
import config from "../../config/config.js";
import db from '../../config/database.js';
import PurchaseService from "../../services/purchaseService.js";
@ -43,7 +46,8 @@ export default class UserPurchaseHandler {
const keyboard = {
inline_keyboard: [
...purchases.map(item => [{
text: `${item.product_name} [${new Date(item.purchase_date).toLocaleString()}]`,
// Добавляем иконку статуса покупки
text: `${item.status === 'received' ? '✅' : '❌'} ${item.product_name} [${new Date(item.purchase_date).toLocaleString()}]`,
callback_data: `view_purchase_${item.id}`
}]),
[

View File

@ -1,3 +1,5 @@
// productService.js
import db from "../config/database.js";
class ProductService {

View File

@ -1,3 +1,5 @@
// purchaseService.js
import db from "../config/database.js";
import CryptoJS from "crypto-js"; // Импортируем библиотеку crypto-js
class PurchaseService {