shopoflex-types 1.0.99 → 1.0.100

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.
Files changed (2) hide show
  1. package/dist/common.d.ts +20 -12
  2. package/package.json +1 -1
package/dist/common.d.ts CHANGED
@@ -178,11 +178,6 @@ export interface Customer {
178
178
  isAnonymos?: boolean;
179
179
  files?: FileType[];
180
180
  }
181
- export interface VendorAssociation {
182
- vendorId: string;
183
- role?: string;
184
- permissions?: string[];
185
- }
186
181
  export interface IUser {
187
182
  _id?: any;
188
183
  uid?: string;
@@ -192,14 +187,13 @@ export interface IUser {
192
187
  phone?: string;
193
188
  photoURL?: string;
194
189
  isAdmin?: boolean;
195
- vendors?: VendorAssociation[];
196
190
  createdAt?: Date;
197
191
  updatedAt?: Date;
198
192
  fcmTokens?: string[];
199
193
  files?: FileType[];
200
194
  }
201
195
  export interface CurrentUserType extends IUser {
202
- vendors?: {
196
+ vendors?: Array<{
203
197
  vendorId: string;
204
198
  name: {
205
199
  en: string;
@@ -210,17 +204,31 @@ export interface CurrentUserType extends IUser {
210
204
  en: string;
211
205
  ar: string;
212
206
  };
213
- }[];
207
+ role: IRole;
208
+ }>;
214
209
  hasAccesstoVendor?: boolean;
215
210
  }
216
- export type IRole = {
211
+ export type Permission = 'products.read' | 'products.create' | 'products.update' | 'products.delete' | 'products.cost' | 'products.inventory' | 'orders.read' | 'orders.create' | 'orders.update' | 'orders.delete' | 'orders.refund' | 'orders.status' | 'customers.read' | 'customers.create' | 'customers.update' | 'customers.delete' | 'accounting.read' | 'accounting.create' | 'accounting.update' | 'accounting.delete' | 'analytics.dashboard' | 'analytics.revenue' | 'analytics.customers' | 'analytics.products' | 'analytics.traffic' | 'analytics.financial' | 'analytics.inventory' | 'analytics.export' | 'branches.read' | 'branches.create' | 'branches.update' | 'branches.delete' | 'users.read' | 'users.create' | 'users.update' | 'users.delete' | 'users.invite' | 'users.permissions.view' | 'roles.read' | 'roles.create' | 'roles.update' | 'roles.delete' | 'system.vendor.update' | 'system.discounts.read' | 'system.discounts.create' | 'system.discounts.update' | 'system.discounts.delete' | 'system.wallet.view' | 'traffic.read' | 'traffic.analytics' | 'traffic.network';
212
+ export interface IRole {
217
213
  _id?: string;
218
- name?: {
214
+ name: {
215
+ en: string;
216
+ ar?: string;
217
+ };
218
+ description?: {
219
219
  en?: string;
220
220
  ar?: string;
221
221
  };
222
- permissions?: string[];
223
- };
222
+ permissions: Permission[];
223
+ vendorId?: string;
224
+ isActive?: boolean;
225
+ branchRestrictions?: Array<{
226
+ branchId: string;
227
+ permissions: Permission[];
228
+ }>;
229
+ createdAt?: Date;
230
+ updatedAt?: Date;
231
+ }
224
232
  type PaymentConfig<T extends PaymentMethodType> = {
225
233
  active: boolean;
226
234
  status: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "shopoflex-types",
3
- "version": "1.0.99",
3
+ "version": "1.0.100",
4
4
  "description": "Shared TypeScript types for Shopoflex applications",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",