vantuz 3.1.1 → 3.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/cli.js CHANGED
@@ -360,7 +360,10 @@ async function handleCommand(input, engine, env) {
360
360
 
361
361
  console.log(c('cyan', `\n Son ${Math.min(limit, orders.length)} sipariş:`));
362
362
  orders.slice(0, limit).forEach((o, i) => {
363
- console.log(` ${i + 1}. ${o._icon} #${o.orderNumber || o.id} - ${o.totalPrice || 'N/A'} TL`);
363
+ const date = new Date(o.orderDate || o.createdDate).toLocaleDateString('tr-TR');
364
+ const status = o.status;
365
+ const statusColor = status === 'Delivered' ? 'green' : status === 'Cancelled' ? 'red' : 'yellow';
366
+ console.log(` ${i + 1}. ${o._icon} #${o.orderNumber} - ${c(statusColor, status)} - ${o.totalPrice} TL (${date})`);
364
367
  });
365
368
  } catch (e) {
366
369
  console.log(c('red', ` ❌ Hata: ${e.message}`));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vantuz",
3
- "version": "3.1.1",
3
+ "version": "3.1.2",
4
4
  "description": "Yapay Zeka Destekli E-Ticaret Yönetim Platformu - 7 Pazaryeri + WhatsApp/Telegram",
5
5
  "type": "module",
6
6
  "main": "cli.js",
@@ -122,16 +122,16 @@ export class TrendyolAPI {
122
122
 
123
123
  async getOrders(params = {}) {
124
124
  const {
125
- status, // Created, Picking, Invoiced, Shipped, Cancelled, Delivered
126
- startDate,
127
- endDate,
125
+ status,
126
+ startDate = new Date(Date.now() - 30 * 24 * 60 * 60 * 1000).getTime(), // Son 30 gün
127
+ endDate = Date.now(),
128
128
  page = 0,
129
129
  size = 50,
130
130
  orderNumber
131
131
  } = params;
132
132
 
133
133
  return await this._request('GET', `/suppliers/${this.supplierId}/orders`, null, {
134
- status, startDate, endDate, page, size, orderNumber
134
+ status, startDate, endDate, page, size, orderNumber, orderByDirection: 'DESC', orderByField: 'PackageLastModifiedDate'
135
135
  });
136
136
  }
137
137