shopoflex-types 1.0.100 → 1.0.103

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/dist/common.d.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  import mongoose from 'mongoose';
2
2
  import { Category, GroupedCategory, ProductType } from 'shopoflex-types';
3
+ import { NameType } from './productCart';
3
4
  export interface Discount {
4
5
  _id?: mongoose.Types.ObjectId;
5
6
  code?: string;
@@ -243,12 +244,17 @@ type PaymentConfig<T extends PaymentMethodType> = {
243
244
  type VendorPayments = {
244
245
  [K in PaymentMethodType]?: PaymentConfig<K>;
245
246
  };
247
+ type LanguageCode = 'en' | 'ar' | 'fr' | 'es' | 'de' | 'zh' | 'ja' | 'ru' | 'hi' | 'th' | 'pt';
248
+ export interface LanguageConfig {
249
+ active: boolean;
250
+ font: string;
251
+ }
246
252
  export interface Vendor {
247
253
  _id?: string;
248
- name: {
249
- en: string;
250
- ar: string;
251
- };
254
+ industry?: string;
255
+ languages: Partial<Record<LanguageCode, LanguageConfig>>;
256
+ defaultLanguage: LanguageCode;
257
+ name: NameType;
252
258
  domains: string[];
253
259
  description: {
254
260
  en: string;
@@ -257,10 +263,6 @@ export interface Vendor {
257
263
  logo: FileType[];
258
264
  cover: FileType[];
259
265
  favicon: FileType[];
260
- font: {
261
- en: any;
262
- ar: any;
263
- };
264
266
  colors: {
265
267
  primaryColor: string;
266
268
  textColor: string;
@@ -479,4 +481,5 @@ export interface successResponse {
479
481
  hasNextPage: boolean;
480
482
  hasPrevPage: boolean;
481
483
  }
484
+ export type Industry = "restaurant" | "grocery" | "retail" | "pharmacy" | "services";
482
485
  export {};
@@ -186,9 +186,18 @@ export interface OrderType {
186
186
  category?: string;
187
187
  discountedAmount?: number;
188
188
  };
189
- processedBy?: mongoose.Types.ObjectId | string;
190
- deliveredBy?: mongoose.Types.ObjectId | string;
189
+ sessionId?: mongoose.Types.ObjectId | string;
191
190
  terminalId?: string;
191
+ createdBy?: mongoose.Types.ObjectId | string;
192
+ timeline?: Array<{
193
+ action: 'created' | 'payment_received' | 'payment_failed' | 'confirmed' | 'preparing' | 'ready' | 'picked_up' | 'out_for_delivery' | 'delivered' | 'completed' | 'cancelled' | 'refunded' | 'modified';
194
+ timestamp: Date;
195
+ userId?: mongoose.Types.ObjectId | string;
196
+ }>;
197
+ currentHandler?: mongoose.Types.ObjectId | string;
192
198
  notes?: string;
199
+ addTimelineEntry?(action: string, userId?: mongoose.Types.ObjectId | string): this;
200
+ getWhoDidAction?(action: string): any;
201
+ getUserTimeline?(userId: mongoose.Types.ObjectId | string): any[];
193
202
  }
194
203
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "shopoflex-types",
3
- "version": "1.0.100",
3
+ "version": "1.0.103",
4
4
  "description": "Shared TypeScript types for Shopoflex applications",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",