@chopkola/common 1.0.168 → 1.0.171
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.
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { RoleIconEnum, RoleRiskLevelEnum } from "./enum/collection";
|
|
2
|
+
import { UUID } from "./global";
|
|
2
3
|
export type ResourceType = "users" | "roles" | "vendors" | "orders" | "products" | "*";
|
|
3
4
|
export type VendorResourceType = "$";
|
|
4
5
|
export type ActionType = "create" | "read" | "update" | "delete";
|
|
@@ -6,7 +7,7 @@ export type AdministratorActionType = ActionType | "*";
|
|
|
6
7
|
export type VendorActionType = ActionType | "$";
|
|
7
8
|
export type PermissionKey = `${ResourceType}:${ActionType}`;
|
|
8
9
|
export interface Permission {
|
|
9
|
-
id:
|
|
10
|
+
id: UUID;
|
|
10
11
|
resource: ResourceType | VendorResourceType;
|
|
11
12
|
action: AdministratorActionType | VendorActionType;
|
|
12
13
|
/**
|
|
@@ -21,7 +22,7 @@ export interface Permission {
|
|
|
21
22
|
updated_at: Date;
|
|
22
23
|
}
|
|
23
24
|
export interface Role {
|
|
24
|
-
id:
|
|
25
|
+
id: UUID;
|
|
25
26
|
name: string;
|
|
26
27
|
slug: string;
|
|
27
28
|
description: string | null;
|
|
@@ -31,8 +32,8 @@ export interface Role {
|
|
|
31
32
|
updated_at: Date;
|
|
32
33
|
}
|
|
33
34
|
export interface RolePermission {
|
|
34
|
-
role_id:
|
|
35
|
-
permission_id:
|
|
35
|
+
role_id: UUID;
|
|
36
|
+
permission_id: UUID;
|
|
36
37
|
}
|
|
37
38
|
export interface RoleWithPermissions extends Role {
|
|
38
39
|
permissions: Permission[];
|
|
@@ -40,13 +41,13 @@ export interface RoleWithPermissions extends Role {
|
|
|
40
41
|
export type CreatePermissionInput = Omit<Permission, "id" | "created_at" | "updated_at">;
|
|
41
42
|
export type UpdatePermissionInput = Partial<Omit<Permission, "id" | "created_at" | "updated_at">>;
|
|
42
43
|
export type CreateRoleInput = Omit<Role, "id" | "created_at" | "updated_at"> & {
|
|
43
|
-
permission_ids?:
|
|
44
|
+
permission_ids?: UUID[];
|
|
44
45
|
};
|
|
45
46
|
export type UpdateRoleInput = Partial<Omit<Role, "id" | "created_at" | "updated_at">> & {
|
|
46
|
-
permission_ids?:
|
|
47
|
+
permission_ids?: UUID[];
|
|
47
48
|
};
|
|
48
49
|
export interface AuthorizationContext {
|
|
49
|
-
user_id:
|
|
50
|
+
user_id: UUID;
|
|
50
51
|
role: RoleWithPermissions;
|
|
51
52
|
}
|
|
52
53
|
export interface PermissionCheck {
|
package/build/types/user.d.ts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { AddressI } from "./address";
|
|
2
2
|
import { UserAccountStatusEnum, UserAccountTypeEnum, UserGenderEnum, VerificationPurposeEnum } from "./enum/collection";
|
|
3
|
+
import { UUID } from "./global";
|
|
3
4
|
import { RoleWithPermissions } from "./role_n_permission";
|
|
4
5
|
import { Vendor } from "./vendor";
|
|
5
6
|
export interface User {
|
|
6
|
-
id:
|
|
7
|
+
id: UUID;
|
|
7
8
|
first_name: string;
|
|
8
9
|
last_name: string;
|
|
9
10
|
email: string;
|
package/build/types/vendor.d.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { AddressI } from "./address";
|
|
2
2
|
import { PromotionTypeEnum, VendorBusinessTypeEnum, VendorStatusEnum } from "./enum/collection";
|
|
3
|
-
import { AddressPayloadType } from "./global";
|
|
3
|
+
import { AddressPayloadType, UUID } from "./global";
|
|
4
4
|
export type CuisineType = "African" | "Asian" | "Continental" | "Mediterranean" | "American";
|
|
5
5
|
export type AmbienceType = "Casual" | "Fine Dining" | "Family Friendly" | "Romantic" | "Outdoor" | "Rooftop";
|
|
6
6
|
export type StoreType = "Supermarket" | "Organic Store" | "Wholesale" | "Convenience Store" | "Mini Mart";
|
|
7
7
|
export type GroceryCategory = "Fresh Produce" | "Frozen Foods" | "Household Items" | "Beverages" | "Snacks" | "Meat & Poultry" | "Dairy";
|
|
8
8
|
export interface Vendor {
|
|
9
|
-
id:
|
|
10
|
-
owner_id:
|
|
9
|
+
id: UUID;
|
|
10
|
+
owner_id: UUID;
|
|
11
11
|
business_name: string;
|
|
12
12
|
slug: string;
|
|
13
13
|
sku_prefix: string;
|
|
@@ -33,8 +33,8 @@ export interface Vendor {
|
|
|
33
33
|
updated_at: Date;
|
|
34
34
|
}
|
|
35
35
|
export interface RestaurantInfo {
|
|
36
|
-
id:
|
|
37
|
-
vendor_id:
|
|
36
|
+
id: UUID;
|
|
37
|
+
vendor_id: UUID;
|
|
38
38
|
seating_capacity: number | null;
|
|
39
39
|
cuisines: CuisineType[];
|
|
40
40
|
ambience: AmbienceType[] | null;
|
|
@@ -57,8 +57,8 @@ export interface RestaurantInfo {
|
|
|
57
57
|
updated_at: Date;
|
|
58
58
|
}
|
|
59
59
|
export interface GroceryInfo {
|
|
60
|
-
id:
|
|
61
|
-
vendor_id:
|
|
60
|
+
id: UUID;
|
|
61
|
+
vendor_id: UUID;
|
|
62
62
|
store_type: StoreType[];
|
|
63
63
|
product_categories: GroceryCategory[];
|
|
64
64
|
tags: string[] | null;
|
|
@@ -90,6 +90,13 @@ export interface GroceryVendorAggregate extends Vendor {
|
|
|
90
90
|
grocery_info: GroceryInfo;
|
|
91
91
|
}
|
|
92
92
|
export type VendorAggregate = RestaurantVendorAggregate | GroceryVendorAggregate;
|
|
93
|
+
export type VendorAggregateForWeb = VendorAggregate & {
|
|
94
|
+
distance?: string;
|
|
95
|
+
time?: string;
|
|
96
|
+
deliveryFee?: number;
|
|
97
|
+
reviews?: number;
|
|
98
|
+
rating?: number;
|
|
99
|
+
};
|
|
93
100
|
export type CreateVendorInput = Omit<Vendor, "id" | "rating" | "review_count" | "business_status" | "approved_by" | "approved_on" | "created_at" | "updated_at"> & {
|
|
94
101
|
address_payload: AddressPayloadType;
|
|
95
102
|
registration_cert: File;
|
|
@@ -100,3 +107,8 @@ export type CreateRestaurantInfoInput = Omit<RestaurantInfo, "id" | "created_at"
|
|
|
100
107
|
export type UpdateRestaurantInfoInput = Partial<Omit<RestaurantInfo, "id" | "vendor_id" | "created_at" | "updated_at">>;
|
|
101
108
|
export type CreateGroceryInfoInput = Omit<GroceryInfo, "id" | "created_at" | "updated_at">;
|
|
102
109
|
export type UpdateGroceryInfoInput = Partial<Omit<GroceryInfo, "id" | "vendor_id" | "created_at" | "updated_at">>;
|
|
110
|
+
export type WebApplicationRestaurantsResourceData = {
|
|
111
|
+
restaurants: VendorAggregateForWeb[];
|
|
112
|
+
cuisines: CuisineType[];
|
|
113
|
+
ambience: AmbienceType[];
|
|
114
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@chopkola/common",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.171",
|
|
4
4
|
"description": "",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"author": "akrosoft technology ltd",
|
|
@@ -26,6 +26,7 @@
|
|
|
26
26
|
"multer": "^2.0.2"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
|
-
"del-cli": "^7.0.0"
|
|
29
|
+
"del-cli": "^7.0.0",
|
|
30
|
+
"typescript": "^5.9.3"
|
|
30
31
|
}
|
|
31
32
|
}
|