@axova/shared 1.0.0
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/CONFIGURATION_GUIDE.md +1 -0
- package/README.md +384 -0
- package/SCHEMA_ORGANIZATION.md +209 -0
- package/dist/configs/index.d.ts +85 -0
- package/dist/configs/index.js +555 -0
- package/dist/events/kafka.d.ts +40 -0
- package/dist/events/kafka.js +311 -0
- package/dist/index.d.ts +13 -0
- package/dist/index.js +41 -0
- package/dist/interfaces/customer-events.d.ts +85 -0
- package/dist/interfaces/customer-events.js +2 -0
- package/dist/interfaces/inventory-events.d.ts +453 -0
- package/dist/interfaces/inventory-events.js +3 -0
- package/dist/interfaces/inventory-types.d.ts +894 -0
- package/dist/interfaces/inventory-types.js +3 -0
- package/dist/interfaces/order-events.d.ts +320 -0
- package/dist/interfaces/order-events.js +3 -0
- package/dist/lib/auditLogger.d.ts +162 -0
- package/dist/lib/auditLogger.js +626 -0
- package/dist/lib/authOrganization.d.ts +24 -0
- package/dist/lib/authOrganization.js +110 -0
- package/dist/lib/db.d.ts +6 -0
- package/dist/lib/db.js +88 -0
- package/dist/middleware/serviceAuth.d.ts +60 -0
- package/dist/middleware/serviceAuth.js +272 -0
- package/dist/middleware/storeOwnership.d.ts +15 -0
- package/dist/middleware/storeOwnership.js +156 -0
- package/dist/middleware/storeValidationMiddleware.d.ts +44 -0
- package/dist/middleware/storeValidationMiddleware.js +180 -0
- package/dist/middleware/userAuth.d.ts +27 -0
- package/dist/middleware/userAuth.js +218 -0
- package/dist/schemas/admin/admin-schema.d.ts +741 -0
- package/dist/schemas/admin/admin-schema.js +111 -0
- package/dist/schemas/ai-moderation/ai-moderation-schema.d.ts +648 -0
- package/dist/schemas/ai-moderation/ai-moderation-schema.js +88 -0
- package/dist/schemas/common/common-schemas.d.ts +436 -0
- package/dist/schemas/common/common-schemas.js +94 -0
- package/dist/schemas/compliance/compliance-schema.d.ts +3388 -0
- package/dist/schemas/compliance/compliance-schema.js +472 -0
- package/dist/schemas/compliance/kyc-schema.d.ts +2642 -0
- package/dist/schemas/compliance/kyc-schema.js +361 -0
- package/dist/schemas/customer/customer-schema.d.ts +2727 -0
- package/dist/schemas/customer/customer-schema.js +399 -0
- package/dist/schemas/index.d.ts +27 -0
- package/dist/schemas/index.js +138 -0
- package/dist/schemas/inventory/inventory-tables.d.ts +9476 -0
- package/dist/schemas/inventory/inventory-tables.js +1470 -0
- package/dist/schemas/inventory/lot-tables.d.ts +3281 -0
- package/dist/schemas/inventory/lot-tables.js +608 -0
- package/dist/schemas/order/order-schema.d.ts +5825 -0
- package/dist/schemas/order/order-schema.js +954 -0
- package/dist/schemas/product/discount-relations.d.ts +15 -0
- package/dist/schemas/product/discount-relations.js +34 -0
- package/dist/schemas/product/discount-schema.d.ts +1975 -0
- package/dist/schemas/product/discount-schema.js +297 -0
- package/dist/schemas/product/product-relations.d.ts +41 -0
- package/dist/schemas/product/product-relations.js +133 -0
- package/dist/schemas/product/product-schema.d.ts +4544 -0
- package/dist/schemas/product/product-schema.js +671 -0
- package/dist/schemas/store/store-audit-schema.d.ts +4135 -0
- package/dist/schemas/store/store-audit-schema.js +556 -0
- package/dist/schemas/store/store-schema.d.ts +3100 -0
- package/dist/schemas/store/store-schema.js +381 -0
- package/dist/schemas/store/store-settings-schema.d.ts +665 -0
- package/dist/schemas/store/store-settings-schema.js +141 -0
- package/dist/schemas/types.d.ts +50 -0
- package/dist/schemas/types.js +3 -0
- package/dist/types/events.d.ts +2396 -0
- package/dist/types/events.js +505 -0
- package/dist/utils/errorHandler.d.ts +12 -0
- package/dist/utils/errorHandler.js +36 -0
- package/dist/utils/subdomain.d.ts +6 -0
- package/dist/utils/subdomain.js +20 -0
- package/nul +8 -0
- package/package.json +43 -0
- package/src/configs/index.ts +654 -0
- package/src/events/kafka.ts +429 -0
- package/src/index.ts +26 -0
- package/src/interfaces/customer-events.ts +106 -0
- package/src/interfaces/inventory-events.ts +545 -0
- package/src/interfaces/inventory-types.ts +1004 -0
- package/src/interfaces/order-events.ts +381 -0
- package/src/lib/auditLogger.ts +1117 -0
- package/src/lib/authOrganization.ts +153 -0
- package/src/lib/db.ts +64 -0
- package/src/middleware/serviceAuth.ts +328 -0
- package/src/middleware/storeOwnership.ts +199 -0
- package/src/middleware/storeValidationMiddleware.ts +247 -0
- package/src/middleware/userAuth.ts +248 -0
- package/src/schemas/admin/admin-schema.ts +208 -0
- package/src/schemas/ai-moderation/ai-moderation-schema.ts +180 -0
- package/src/schemas/common/common-schemas.ts +108 -0
- package/src/schemas/compliance/compliance-schema.ts +927 -0
- package/src/schemas/compliance/kyc-schema.ts +649 -0
- package/src/schemas/customer/customer-schema.ts +576 -0
- package/src/schemas/index.ts +189 -0
- package/src/schemas/inventory/inventory-tables.ts +1927 -0
- package/src/schemas/inventory/lot-tables.ts +799 -0
- package/src/schemas/order/order-schema.ts +1400 -0
- package/src/schemas/product/discount-relations.ts +44 -0
- package/src/schemas/product/discount-schema.ts +464 -0
- package/src/schemas/product/product-relations.ts +187 -0
- package/src/schemas/product/product-schema.ts +955 -0
- package/src/schemas/store/ethiopian_business_api.md.resolved +212 -0
- package/src/schemas/store/store-audit-schema.ts +1257 -0
- package/src/schemas/store/store-schema.ts +661 -0
- package/src/schemas/store/store-settings-schema.ts +231 -0
- package/src/schemas/types.ts +67 -0
- package/src/types/events.ts +646 -0
- package/src/utils/errorHandler.ts +44 -0
- package/src/utils/subdomain.ts +19 -0
- package/tsconfig.json +21 -0
|
@@ -0,0 +1,399 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.customerPreferences = exports.customerNotes = exports.customerInteractionHistory = exports.customerVisitHistory = exports.customerReviews = exports.customerSupportTickets = exports.customerAddresses = exports.customers = void 0;
|
|
4
|
+
const cuid2_1 = require("@paralleldrive/cuid2");
|
|
5
|
+
const pg_core_1 = require("drizzle-orm/pg-core");
|
|
6
|
+
// Customers Table - Core customer information
|
|
7
|
+
exports.customers = (0, pg_core_1.pgTable)("customers", {
|
|
8
|
+
id: (0, pg_core_1.text)("id")
|
|
9
|
+
.primaryKey()
|
|
10
|
+
.$defaultFn(() => (0, cuid2_1.createId)()),
|
|
11
|
+
// Basic Info
|
|
12
|
+
userId: (0, pg_core_1.text)("user_id").notNull().unique(), // Links to auth system
|
|
13
|
+
email: (0, pg_core_1.varchar)("email", { length: 255 }).notNull().unique(),
|
|
14
|
+
firstName: (0, pg_core_1.varchar)("first_name", { length: 100 }).notNull(),
|
|
15
|
+
lastName: (0, pg_core_1.varchar)("last_name", { length: 100 }).notNull(),
|
|
16
|
+
phoneNumber: (0, pg_core_1.varchar)("phone_number", { length: 20 }),
|
|
17
|
+
dateOfBirth: (0, pg_core_1.timestamp)("date_of_birth", { withTimezone: true }),
|
|
18
|
+
// Customer Status
|
|
19
|
+
status: (0, pg_core_1.varchar)("status", { length: 20 })
|
|
20
|
+
.notNull()
|
|
21
|
+
.default("ACTIVE")
|
|
22
|
+
.$type(),
|
|
23
|
+
customerType: (0, pg_core_1.varchar)("customer_type", { length: 30 })
|
|
24
|
+
.notNull()
|
|
25
|
+
.default("RETAIL")
|
|
26
|
+
.$type(),
|
|
27
|
+
// Customer Source and Registration
|
|
28
|
+
registrationSource: (0, pg_core_1.varchar)("registration_source", { length: 30 })
|
|
29
|
+
.notNull()
|
|
30
|
+
.default("ONLINE")
|
|
31
|
+
.$type(),
|
|
32
|
+
storeLocationId: (0, pg_core_1.text)("store_location_id"), // For walk-in customers
|
|
33
|
+
// Profile Information
|
|
34
|
+
gender: (0, pg_core_1.varchar)("gender", { length: 20 }).$type(),
|
|
35
|
+
profilePicture: (0, pg_core_1.text)("profile_picture"),
|
|
36
|
+
bio: (0, pg_core_1.text)("bio"),
|
|
37
|
+
// Preferences
|
|
38
|
+
preferredLanguage: (0, pg_core_1.varchar)("preferred_language", { length: 10 })
|
|
39
|
+
.notNull()
|
|
40
|
+
.default("en"),
|
|
41
|
+
preferredCurrency: (0, pg_core_1.varchar)("preferred_currency", { length: 3 })
|
|
42
|
+
.notNull()
|
|
43
|
+
.default("USD"),
|
|
44
|
+
timezone: (0, pg_core_1.varchar)("timezone", { length: 50 }).notNull().default("UTC"),
|
|
45
|
+
// Communication Preferences
|
|
46
|
+
marketingConsent: (0, pg_core_1.boolean)("marketing_consent").notNull().default(false),
|
|
47
|
+
emailNotifications: (0, pg_core_1.boolean)("email_notifications").notNull().default(true),
|
|
48
|
+
smsNotifications: (0, pg_core_1.boolean)("sms_notifications").notNull().default(false),
|
|
49
|
+
pushNotifications: (0, pg_core_1.boolean)("push_notifications").notNull().default(true),
|
|
50
|
+
// Purchase Metrics
|
|
51
|
+
totalOrders: (0, pg_core_1.integer)("total_orders").notNull().default(0),
|
|
52
|
+
totalSpent: (0, pg_core_1.decimal)("total_spent", { precision: 12, scale: 2 })
|
|
53
|
+
.notNull()
|
|
54
|
+
.default("0.00"),
|
|
55
|
+
averageOrderValue: (0, pg_core_1.decimal)("average_order_value", {
|
|
56
|
+
precision: 12,
|
|
57
|
+
scale: 2,
|
|
58
|
+
})
|
|
59
|
+
.notNull()
|
|
60
|
+
.default("0.00"),
|
|
61
|
+
// Interaction Metrics
|
|
62
|
+
totalVisits: (0, pg_core_1.integer)("total_visits").notNull().default(0),
|
|
63
|
+
totalInteractions: (0, pg_core_1.integer)("total_interactions").notNull().default(0),
|
|
64
|
+
// Tracking
|
|
65
|
+
lastActiveAt: (0, pg_core_1.timestamp)("last_active_at", { withTimezone: true }),
|
|
66
|
+
lastOrderAt: (0, pg_core_1.timestamp)("last_order_at", { withTimezone: true }),
|
|
67
|
+
firstOrderAt: (0, pg_core_1.timestamp)("first_order_at", { withTimezone: true }),
|
|
68
|
+
// Timestamps
|
|
69
|
+
createdAt: (0, pg_core_1.timestamp)("created_at", { withTimezone: true })
|
|
70
|
+
.defaultNow()
|
|
71
|
+
.notNull(),
|
|
72
|
+
updatedAt: (0, pg_core_1.timestamp)("updated_at", { withTimezone: true })
|
|
73
|
+
.defaultNow()
|
|
74
|
+
.notNull(),
|
|
75
|
+
}, (table) => ({
|
|
76
|
+
userIdIndex: (0, pg_core_1.index)("idx_customers_user_id").on(table.userId),
|
|
77
|
+
emailIndex: (0, pg_core_1.index)("idx_customers_email").on(table.email),
|
|
78
|
+
statusIndex: (0, pg_core_1.index)("idx_customers_status").on(table.status),
|
|
79
|
+
typeIndex: (0, pg_core_1.index)("idx_customers_type").on(table.customerType),
|
|
80
|
+
registrationSourceIndex: (0, pg_core_1.index)("idx_customers_registration_source").on(table.registrationSource),
|
|
81
|
+
storeLocationIndex: (0, pg_core_1.index)("idx_customers_store_location").on(table.storeLocationId),
|
|
82
|
+
lastActiveIndex: (0, pg_core_1.index)("idx_customers_last_active").on(table.lastActiveAt),
|
|
83
|
+
}));
|
|
84
|
+
// Customer Addresses Table
|
|
85
|
+
exports.customerAddresses = (0, pg_core_1.pgTable)("customer_addresses", {
|
|
86
|
+
id: (0, pg_core_1.text)("id")
|
|
87
|
+
.primaryKey()
|
|
88
|
+
.$defaultFn(() => (0, cuid2_1.createId)()),
|
|
89
|
+
customerId: (0, pg_core_1.text)("customer_id")
|
|
90
|
+
.notNull()
|
|
91
|
+
.references(() => exports.customers.id, { onDelete: "cascade" }),
|
|
92
|
+
// Address Type
|
|
93
|
+
type: (0, pg_core_1.varchar)("type", { length: 20 })
|
|
94
|
+
.notNull()
|
|
95
|
+
.$type(),
|
|
96
|
+
// Address Details
|
|
97
|
+
label: (0, pg_core_1.varchar)("label", { length: 50 }), // e.g., "Home", "Work", "Office"
|
|
98
|
+
firstName: (0, pg_core_1.varchar)("first_name", { length: 100 }).notNull(),
|
|
99
|
+
lastName: (0, pg_core_1.varchar)("last_name", { length: 100 }).notNull(),
|
|
100
|
+
company: (0, pg_core_1.varchar)("company", { length: 100 }),
|
|
101
|
+
addressLine1: (0, pg_core_1.text)("address_line_1").notNull(),
|
|
102
|
+
addressLine2: (0, pg_core_1.text)("address_line_2"),
|
|
103
|
+
city: (0, pg_core_1.varchar)("city", { length: 100 }).notNull(),
|
|
104
|
+
state: (0, pg_core_1.varchar)("state", { length: 100 }).notNull(),
|
|
105
|
+
postalCode: (0, pg_core_1.varchar)("postal_code", { length: 20 }).notNull(),
|
|
106
|
+
country: (0, pg_core_1.varchar)("country", { length: 2 }).notNull(), // ISO country code
|
|
107
|
+
phoneNumber: (0, pg_core_1.varchar)("phone_number", { length: 20 }),
|
|
108
|
+
// Status
|
|
109
|
+
isDefault: (0, pg_core_1.boolean)("is_default").notNull().default(false),
|
|
110
|
+
isActive: (0, pg_core_1.boolean)("is_active").notNull().default(true),
|
|
111
|
+
// Verification
|
|
112
|
+
isVerified: (0, pg_core_1.boolean)("is_verified").notNull().default(false),
|
|
113
|
+
verifiedAt: (0, pg_core_1.timestamp)("verified_at", { withTimezone: true }),
|
|
114
|
+
// Timestamps
|
|
115
|
+
createdAt: (0, pg_core_1.timestamp)("created_at", { withTimezone: true })
|
|
116
|
+
.defaultNow()
|
|
117
|
+
.notNull(),
|
|
118
|
+
updatedAt: (0, pg_core_1.timestamp)("updated_at", { withTimezone: true })
|
|
119
|
+
.defaultNow()
|
|
120
|
+
.notNull(),
|
|
121
|
+
}, (table) => ({
|
|
122
|
+
customerIdIndex: (0, pg_core_1.index)("idx_addresses_customer_id").on(table.customerId),
|
|
123
|
+
typeIndex: (0, pg_core_1.index)("idx_addresses_type").on(table.type),
|
|
124
|
+
defaultIndex: (0, pg_core_1.index)("idx_addresses_default").on(table.isDefault),
|
|
125
|
+
countryIndex: (0, pg_core_1.index)("idx_addresses_country").on(table.country),
|
|
126
|
+
}));
|
|
127
|
+
// Customer Support Tickets Table
|
|
128
|
+
exports.customerSupportTickets = (0, pg_core_1.pgTable)("customer_support_tickets", {
|
|
129
|
+
id: (0, pg_core_1.text)("id")
|
|
130
|
+
.primaryKey()
|
|
131
|
+
.$defaultFn(() => (0, cuid2_1.createId)()),
|
|
132
|
+
customerId: (0, pg_core_1.text)("customer_id")
|
|
133
|
+
.notNull()
|
|
134
|
+
.references(() => exports.customers.id, { onDelete: "cascade" }),
|
|
135
|
+
// Ticket Details
|
|
136
|
+
ticketNumber: (0, pg_core_1.varchar)("ticket_number", { length: 20 }).notNull().unique(),
|
|
137
|
+
subject: (0, pg_core_1.varchar)("subject", { length: 255 }).notNull(),
|
|
138
|
+
description: (0, pg_core_1.text)("description").notNull(),
|
|
139
|
+
category: (0, pg_core_1.varchar)("category", { length: 50 })
|
|
140
|
+
.notNull()
|
|
141
|
+
.$type(),
|
|
142
|
+
// Priority and Status
|
|
143
|
+
priority: (0, pg_core_1.varchar)("priority", { length: 20 })
|
|
144
|
+
.notNull()
|
|
145
|
+
.default("MEDIUM")
|
|
146
|
+
.$type(),
|
|
147
|
+
status: (0, pg_core_1.varchar)("status", { length: 20 })
|
|
148
|
+
.notNull()
|
|
149
|
+
.default("OPEN")
|
|
150
|
+
.$type(),
|
|
151
|
+
// Assignment
|
|
152
|
+
assignedTo: (0, pg_core_1.text)("assigned_to"), // Admin/Support user ID
|
|
153
|
+
assignedAt: (0, pg_core_1.timestamp)("assigned_at", { withTimezone: true }),
|
|
154
|
+
// Resolution
|
|
155
|
+
resolution: (0, pg_core_1.text)("resolution"),
|
|
156
|
+
resolvedAt: (0, pg_core_1.timestamp)("resolved_at", { withTimezone: true }),
|
|
157
|
+
closedAt: (0, pg_core_1.timestamp)("closed_at", { withTimezone: true }),
|
|
158
|
+
// Customer Satisfaction
|
|
159
|
+
satisfactionRating: (0, pg_core_1.integer)("satisfaction_rating"), // 1-5
|
|
160
|
+
satisfactionFeedback: (0, pg_core_1.text)("satisfaction_feedback"),
|
|
161
|
+
// Metadata
|
|
162
|
+
tags: (0, pg_core_1.jsonb)("tags").$type().default([]),
|
|
163
|
+
metadata: (0, pg_core_1.jsonb)("metadata").$type().default({}),
|
|
164
|
+
// Timestamps
|
|
165
|
+
createdAt: (0, pg_core_1.timestamp)("created_at", { withTimezone: true })
|
|
166
|
+
.defaultNow()
|
|
167
|
+
.notNull(),
|
|
168
|
+
updatedAt: (0, pg_core_1.timestamp)("updated_at", { withTimezone: true })
|
|
169
|
+
.defaultNow()
|
|
170
|
+
.notNull(),
|
|
171
|
+
}, (table) => ({
|
|
172
|
+
customerIdIndex: (0, pg_core_1.index)("idx_tickets_customer_id").on(table.customerId),
|
|
173
|
+
ticketNumberIndex: (0, pg_core_1.index)("idx_tickets_number").on(table.ticketNumber),
|
|
174
|
+
statusIndex: (0, pg_core_1.index)("idx_tickets_status").on(table.status),
|
|
175
|
+
priorityIndex: (0, pg_core_1.index)("idx_tickets_priority").on(table.priority),
|
|
176
|
+
categoryIndex: (0, pg_core_1.index)("idx_tickets_category").on(table.category),
|
|
177
|
+
assignedIndex: (0, pg_core_1.index)("idx_tickets_assigned").on(table.assignedTo),
|
|
178
|
+
createdAtIndex: (0, pg_core_1.index)("idx_tickets_created_at").on(table.createdAt),
|
|
179
|
+
}));
|
|
180
|
+
// Customer Reviews Table
|
|
181
|
+
exports.customerReviews = (0, pg_core_1.pgTable)("customer_reviews", {
|
|
182
|
+
id: (0, pg_core_1.text)("id")
|
|
183
|
+
.primaryKey()
|
|
184
|
+
.$defaultFn(() => (0, cuid2_1.createId)()),
|
|
185
|
+
customerId: (0, pg_core_1.text)("customer_id")
|
|
186
|
+
.notNull()
|
|
187
|
+
.references(() => exports.customers.id, { onDelete: "cascade" }),
|
|
188
|
+
// Review Target
|
|
189
|
+
targetType: (0, pg_core_1.varchar)("target_type", { length: 30 })
|
|
190
|
+
.notNull()
|
|
191
|
+
.$type(),
|
|
192
|
+
targetId: (0, pg_core_1.text)("target_id").notNull(),
|
|
193
|
+
// Review Content
|
|
194
|
+
rating: (0, pg_core_1.integer)("rating").notNull(), // 1-5
|
|
195
|
+
title: (0, pg_core_1.varchar)("title", { length: 255 }),
|
|
196
|
+
reviewText: (0, pg_core_1.text)("review_text"),
|
|
197
|
+
images: (0, pg_core_1.jsonb)("images").$type().default([]),
|
|
198
|
+
// Review Status
|
|
199
|
+
status: (0, pg_core_1.varchar)("status", { length: 20 })
|
|
200
|
+
.notNull()
|
|
201
|
+
.default("PENDING")
|
|
202
|
+
.$type(),
|
|
203
|
+
isVerifiedPurchase: (0, pg_core_1.boolean)("is_verified_purchase")
|
|
204
|
+
.notNull()
|
|
205
|
+
.default(false),
|
|
206
|
+
// Moderation
|
|
207
|
+
moderatedBy: (0, pg_core_1.text)("moderated_by"),
|
|
208
|
+
moderatedAt: (0, pg_core_1.timestamp)("moderated_at", { withTimezone: true }),
|
|
209
|
+
moderationNotes: (0, pg_core_1.text)("moderation_notes"),
|
|
210
|
+
// Helpfulness
|
|
211
|
+
helpfulVotes: (0, pg_core_1.integer)("helpful_votes").notNull().default(0),
|
|
212
|
+
unhelpfulVotes: (0, pg_core_1.integer)("unhelpful_votes").notNull().default(0),
|
|
213
|
+
// Timestamps
|
|
214
|
+
createdAt: (0, pg_core_1.timestamp)("created_at", { withTimezone: true })
|
|
215
|
+
.defaultNow()
|
|
216
|
+
.notNull(),
|
|
217
|
+
updatedAt: (0, pg_core_1.timestamp)("updated_at", { withTimezone: true })
|
|
218
|
+
.defaultNow()
|
|
219
|
+
.notNull(),
|
|
220
|
+
}, (table) => ({
|
|
221
|
+
customerIdIndex: (0, pg_core_1.index)("idx_reviews_customer_id").on(table.customerId),
|
|
222
|
+
targetIndex: (0, pg_core_1.index)("idx_reviews_target").on(table.targetType, table.targetId),
|
|
223
|
+
ratingIndex: (0, pg_core_1.index)("idx_reviews_rating").on(table.rating),
|
|
224
|
+
statusIndex: (0, pg_core_1.index)("idx_reviews_status").on(table.status),
|
|
225
|
+
verifiedIndex: (0, pg_core_1.index)("idx_reviews_verified").on(table.isVerifiedPurchase),
|
|
226
|
+
createdAtIndex: (0, pg_core_1.index)("idx_reviews_created_at").on(table.createdAt),
|
|
227
|
+
}));
|
|
228
|
+
// Customer Visit History Table
|
|
229
|
+
exports.customerVisitHistory = (0, pg_core_1.pgTable)("customer_visit_history", {
|
|
230
|
+
id: (0, pg_core_1.text)("id")
|
|
231
|
+
.primaryKey()
|
|
232
|
+
.$defaultFn(() => (0, cuid2_1.createId)()),
|
|
233
|
+
customerId: (0, pg_core_1.text)("customer_id")
|
|
234
|
+
.notNull()
|
|
235
|
+
.references(() => exports.customers.id, { onDelete: "cascade" }),
|
|
236
|
+
// Visit Details
|
|
237
|
+
visitType: (0, pg_core_1.varchar)("visit_type", { length: 30 })
|
|
238
|
+
.notNull()
|
|
239
|
+
.$type(),
|
|
240
|
+
storeLocationId: (0, pg_core_1.text)("store_location_id"), // For physical visits
|
|
241
|
+
sessionId: (0, pg_core_1.text)("session_id"), // For online visits
|
|
242
|
+
// Visit Data
|
|
243
|
+
duration: (0, pg_core_1.integer)("duration"), // in minutes
|
|
244
|
+
pagesViewed: (0, pg_core_1.integer)("pages_viewed"), // for online visits
|
|
245
|
+
productsViewed: (0, pg_core_1.jsonb)("products_viewed").$type().default([]),
|
|
246
|
+
// Interaction Details
|
|
247
|
+
interactionCount: (0, pg_core_1.integer)("interaction_count").notNull().default(0),
|
|
248
|
+
hasInteraction: (0, pg_core_1.boolean)("has_interaction").notNull().default(false),
|
|
249
|
+
// Visit Outcome
|
|
250
|
+
outcome: (0, pg_core_1.varchar)("outcome", { length: 30 }).$type(),
|
|
251
|
+
// Notes and Context
|
|
252
|
+
notes: (0, pg_core_1.text)("notes"),
|
|
253
|
+
metadata: (0, pg_core_1.jsonb)("metadata").$type().default({}),
|
|
254
|
+
// Timestamps
|
|
255
|
+
visitStartAt: (0, pg_core_1.timestamp)("visit_start_at", { withTimezone: true }).notNull(),
|
|
256
|
+
visitEndAt: (0, pg_core_1.timestamp)("visit_end_at", { withTimezone: true }),
|
|
257
|
+
createdAt: (0, pg_core_1.timestamp)("created_at", { withTimezone: true })
|
|
258
|
+
.defaultNow()
|
|
259
|
+
.notNull(),
|
|
260
|
+
}, (table) => ({
|
|
261
|
+
customerIdIndex: (0, pg_core_1.index)("idx_visits_customer_id").on(table.customerId),
|
|
262
|
+
visitTypeIndex: (0, pg_core_1.index)("idx_visits_type").on(table.visitType),
|
|
263
|
+
storeLocationIndex: (0, pg_core_1.index)("idx_visits_store_location").on(table.storeLocationId),
|
|
264
|
+
visitDateIndex: (0, pg_core_1.index)("idx_visits_date").on(table.visitStartAt),
|
|
265
|
+
outcomeIndex: (0, pg_core_1.index)("idx_visits_outcome").on(table.outcome),
|
|
266
|
+
}));
|
|
267
|
+
// Customer Interaction History Table
|
|
268
|
+
exports.customerInteractionHistory = (0, pg_core_1.pgTable)("customer_interaction_history", {
|
|
269
|
+
id: (0, pg_core_1.text)("id")
|
|
270
|
+
.primaryKey()
|
|
271
|
+
.$defaultFn(() => (0, cuid2_1.createId)()),
|
|
272
|
+
customerId: (0, pg_core_1.text)("customer_id")
|
|
273
|
+
.notNull()
|
|
274
|
+
.references(() => exports.customers.id, { onDelete: "cascade" }),
|
|
275
|
+
visitId: (0, pg_core_1.text)("visit_id").references(() => exports.customerVisitHistory.id, {
|
|
276
|
+
onDelete: "cascade",
|
|
277
|
+
}),
|
|
278
|
+
// Interaction Details
|
|
279
|
+
interactionType: (0, pg_core_1.varchar)("interaction_type", { length: 30 })
|
|
280
|
+
.notNull()
|
|
281
|
+
.$type(),
|
|
282
|
+
// Target Information
|
|
283
|
+
targetType: (0, pg_core_1.varchar)("target_type", { length: 30 }).$type(),
|
|
284
|
+
targetId: (0, pg_core_1.text)("target_id"),
|
|
285
|
+
// Interaction Data
|
|
286
|
+
interactionData: (0, pg_core_1.jsonb)("interaction_data")
|
|
287
|
+
.$type()
|
|
288
|
+
.default({}),
|
|
289
|
+
// Staff/Agent Information (for in-store or assisted interactions)
|
|
290
|
+
staffId: (0, pg_core_1.text)("staff_id"),
|
|
291
|
+
staffName: (0, pg_core_1.varchar)("staff_name", { length: 100 }),
|
|
292
|
+
// Context
|
|
293
|
+
description: (0, pg_core_1.text)("description"),
|
|
294
|
+
outcome: (0, pg_core_1.varchar)("outcome", { length: 30 }).$type(),
|
|
295
|
+
// Timestamps
|
|
296
|
+
createdAt: (0, pg_core_1.timestamp)("created_at", { withTimezone: true })
|
|
297
|
+
.defaultNow()
|
|
298
|
+
.notNull(),
|
|
299
|
+
}, (table) => ({
|
|
300
|
+
customerIdIndex: (0, pg_core_1.index)("idx_interactions_customer_id").on(table.customerId),
|
|
301
|
+
visitIdIndex: (0, pg_core_1.index)("idx_interactions_visit_id").on(table.visitId),
|
|
302
|
+
interactionTypeIndex: (0, pg_core_1.index)("idx_interactions_type").on(table.interactionType),
|
|
303
|
+
targetIndex: (0, pg_core_1.index)("idx_interactions_target").on(table.targetType, table.targetId),
|
|
304
|
+
staffIndex: (0, pg_core_1.index)("idx_interactions_staff").on(table.staffId),
|
|
305
|
+
createdAtIndex: (0, pg_core_1.index)("idx_interactions_created_at").on(table.createdAt),
|
|
306
|
+
}));
|
|
307
|
+
// Customer Notes Table
|
|
308
|
+
exports.customerNotes = (0, pg_core_1.pgTable)("customer_notes", {
|
|
309
|
+
id: (0, pg_core_1.text)("id")
|
|
310
|
+
.primaryKey()
|
|
311
|
+
.$defaultFn(() => (0, cuid2_1.createId)()),
|
|
312
|
+
customerId: (0, pg_core_1.text)("customer_id")
|
|
313
|
+
.notNull()
|
|
314
|
+
.references(() => exports.customers.id, { onDelete: "cascade" }),
|
|
315
|
+
// Note Details
|
|
316
|
+
noteType: (0, pg_core_1.varchar)("note_type", { length: 30 })
|
|
317
|
+
.notNull()
|
|
318
|
+
.$type(),
|
|
319
|
+
title: (0, pg_core_1.varchar)("title", { length: 255 }),
|
|
320
|
+
content: (0, pg_core_1.text)("content").notNull(),
|
|
321
|
+
// Priority and Visibility
|
|
322
|
+
priority: (0, pg_core_1.varchar)("priority", { length: 20 })
|
|
323
|
+
.notNull()
|
|
324
|
+
.default("NORMAL")
|
|
325
|
+
.$type(),
|
|
326
|
+
isVisible: (0, pg_core_1.boolean)("is_visible").notNull().default(true),
|
|
327
|
+
isAlert: (0, pg_core_1.boolean)("is_alert").notNull().default(false),
|
|
328
|
+
// Staff Information
|
|
329
|
+
createdBy: (0, pg_core_1.text)("created_by").notNull(), // Staff/user ID
|
|
330
|
+
createdByName: (0, pg_core_1.varchar)("created_by_name", { length: 100 }).notNull(),
|
|
331
|
+
// Context
|
|
332
|
+
relatedOrderId: (0, pg_core_1.text)("related_order_id"),
|
|
333
|
+
relatedTicketId: (0, pg_core_1.text)("related_ticket_id"),
|
|
334
|
+
// Follow-up
|
|
335
|
+
followUpRequired: (0, pg_core_1.boolean)("follow_up_required").notNull().default(false),
|
|
336
|
+
followUpDate: (0, pg_core_1.timestamp)("follow_up_date", { withTimezone: true }),
|
|
337
|
+
followUpCompleted: (0, pg_core_1.boolean)("follow_up_completed").notNull().default(false),
|
|
338
|
+
// Timestamps
|
|
339
|
+
createdAt: (0, pg_core_1.timestamp)("created_at", { withTimezone: true })
|
|
340
|
+
.defaultNow()
|
|
341
|
+
.notNull(),
|
|
342
|
+
updatedAt: (0, pg_core_1.timestamp)("updated_at", { withTimezone: true })
|
|
343
|
+
.defaultNow()
|
|
344
|
+
.notNull(),
|
|
345
|
+
}, (table) => ({
|
|
346
|
+
customerIdIndex: (0, pg_core_1.index)("idx_notes_customer_id").on(table.customerId),
|
|
347
|
+
noteTypeIndex: (0, pg_core_1.index)("idx_notes_type").on(table.noteType),
|
|
348
|
+
priorityIndex: (0, pg_core_1.index)("idx_notes_priority").on(table.priority),
|
|
349
|
+
alertIndex: (0, pg_core_1.index)("idx_notes_alert").on(table.isAlert),
|
|
350
|
+
followUpIndex: (0, pg_core_1.index)("idx_notes_follow_up").on(table.followUpRequired, table.followUpDate),
|
|
351
|
+
createdByIndex: (0, pg_core_1.index)("idx_notes_created_by").on(table.createdBy),
|
|
352
|
+
}));
|
|
353
|
+
// Customer Preferences Table
|
|
354
|
+
exports.customerPreferences = (0, pg_core_1.pgTable)("customer_preferences", {
|
|
355
|
+
id: (0, pg_core_1.text)("id")
|
|
356
|
+
.primaryKey()
|
|
357
|
+
.$defaultFn(() => (0, cuid2_1.createId)()),
|
|
358
|
+
customerId: (0, pg_core_1.text)("customer_id")
|
|
359
|
+
.notNull()
|
|
360
|
+
.references(() => exports.customers.id, { onDelete: "cascade" })
|
|
361
|
+
.unique(),
|
|
362
|
+
// Shopping Preferences
|
|
363
|
+
preferredCategories: (0, pg_core_1.jsonb)("preferred_categories")
|
|
364
|
+
.$type()
|
|
365
|
+
.default([]),
|
|
366
|
+
preferredBrands: (0, pg_core_1.jsonb)("preferred_brands").$type().default([]),
|
|
367
|
+
priceRange: (0, pg_core_1.jsonb)("price_range")
|
|
368
|
+
.$type()
|
|
369
|
+
.default({}),
|
|
370
|
+
// Notification Preferences
|
|
371
|
+
emailMarketing: (0, pg_core_1.boolean)("email_marketing").notNull().default(false),
|
|
372
|
+
smsMarketing: (0, pg_core_1.boolean)("sms_marketing").notNull().default(false),
|
|
373
|
+
pushMarketing: (0, pg_core_1.boolean)("push_marketing").notNull().default(false),
|
|
374
|
+
orderUpdates: (0, pg_core_1.boolean)("order_updates").notNull().default(true),
|
|
375
|
+
productRecommendations: (0, pg_core_1.boolean)("product_recommendations")
|
|
376
|
+
.notNull()
|
|
377
|
+
.default(true),
|
|
378
|
+
priceDropAlerts: (0, pg_core_1.boolean)("price_drop_alerts").notNull().default(false),
|
|
379
|
+
backInStockAlerts: (0, pg_core_1.boolean)("back_in_stock_alerts").notNull().default(false),
|
|
380
|
+
// Privacy Preferences
|
|
381
|
+
dataSharing: (0, pg_core_1.boolean)("data_sharing").notNull().default(false),
|
|
382
|
+
analyticsTracking: (0, pg_core_1.boolean)("analytics_tracking").notNull().default(true),
|
|
383
|
+
personalizedExperience: (0, pg_core_1.boolean)("personalized_experience")
|
|
384
|
+
.notNull()
|
|
385
|
+
.default(true),
|
|
386
|
+
// Custom Preferences
|
|
387
|
+
customPreferences: (0, pg_core_1.jsonb)("custom_preferences")
|
|
388
|
+
.$type()
|
|
389
|
+
.default({}),
|
|
390
|
+
// Timestamps
|
|
391
|
+
createdAt: (0, pg_core_1.timestamp)("created_at", { withTimezone: true })
|
|
392
|
+
.defaultNow()
|
|
393
|
+
.notNull(),
|
|
394
|
+
updatedAt: (0, pg_core_1.timestamp)("updated_at", { withTimezone: true })
|
|
395
|
+
.defaultNow()
|
|
396
|
+
.notNull(),
|
|
397
|
+
}, (table) => ({
|
|
398
|
+
customerIdIndex: (0, pg_core_1.index)("idx_preferences_customer_id").on(table.customerId),
|
|
399
|
+
}));
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export { type AxovaKafkaConfig, createKafkaInstance, getKafkaConfigFromEnv, getKafkaInstance, } from "../events/kafka";
|
|
2
|
+
export { CustomerServiceConfig, CustomerServiceEvents, } from "../interfaces/customer-events";
|
|
3
|
+
export { ServiceConfig, ServiceEvents } from "../interfaces/inventory-events";
|
|
4
|
+
export type { ABCClassification, AIRecommendation, AutomationRule, AutomationRuleFilter, BatchFilter, BatchInfo, CountItemRequest, CreateAutomationRuleRequest, CreateBatchRequest, CreateCycleCountRequest, CreateInventoryItemRequest, CreatePOSLocationRequest, CreateWarehouseRequest, CycleCount, CycleCountFilter, CycleCountItem, DashboardMetrics, ExpiryReport, ForecastData, InventoryFilter, InventoryInsight, InventoryItem, InventoryOverview, InventorySnapshot, LowStockAlert, OperationResult, PaginatedResult, POSLocation, QuantityUpdate, ReorderRecommendation, StockMovementReport, StockValuation, TenantContext, TransferFilter, TransferItem, TransferRequest, UpdateInventoryItemRequest, UserContext, VelocityAnalysis, Warehouse, } from "../interfaces/inventory-types";
|
|
5
|
+
export * from "../types/events";
|
|
6
|
+
export * from "./admin/admin-schema";
|
|
7
|
+
export * from "./ai-moderation/ai-moderation-schema";
|
|
8
|
+
export * from "./common/common-schemas";
|
|
9
|
+
export * from "./compliance/compliance-schema";
|
|
10
|
+
export * from "./compliance/kyc-schema";
|
|
11
|
+
export { storeKyc, kycVerificationHistory, kycDocuments, kycAnalytics, kycWebhooksLog, } from "./compliance/kyc-schema";
|
|
12
|
+
export * from "./customer/customer-schema";
|
|
13
|
+
export { customerAddresses, customerInteractionHistory, customerNotes, customerPreferences, customerReviews, customerSupportTickets, customers, customerVisitHistory, } from "./customer/customer-schema";
|
|
14
|
+
export * from "./inventory/inventory-tables";
|
|
15
|
+
export { inventory, inventoryMovements, inventoryTransferItems, inventoryTransfers, posLocations, productSuppliers, purchaseOrderItems, purchaseOrders, qualityControls, qualityTemplates, supplierQualityRatings, suppliers, warehouses, } from "./inventory/inventory-tables";
|
|
16
|
+
export { alertSeverityEnum, alertStatusEnum, alertTypeEnum, inventoryLotAlerts, inventoryLotMerges, inventoryLotMovements, inventoryLots, inventoryLotSplits, lotMovementTypeEnum, lotStatusEnum, LotSchema, InitializeProductInventorySchema, CreateLotSchema, ReserveLotQuantitySchema, ReleaseLotReservationSchema, AdjustLotQuantitySchema, TransferLotSchema, MergeLotsSchema, SplitLotSchema, GetLotsQuerySchema, GetAvailableLotsSchema, LotAnalyticsSchema, } from "./inventory/lot-tables";
|
|
17
|
+
export { addressTypeEnum, discountTypeEnum, fulfillmentStatusEnum, orderAddresses, orderAddressesRelations, orderDiscounts, orderDiscountsRelations, orderFulfillments, orderFulfillmentsRelations, orderHistory, orderHistoryRelations, orderItems, orderItemsRelations, orderNotes, orderNotesRelations, orderPayments, orderPaymentsRelations, orderPriorityEnum, orderStatusEnum, orders, ordersRelations, orderTypeEnum, paymentMethodEnum, paymentStatusEnum, refundReasonEnum, } from "./order/order-schema";
|
|
18
|
+
export * from "./product/product-relations";
|
|
19
|
+
export * from "./product/product-schema";
|
|
20
|
+
export * from "./product/product-relations";
|
|
21
|
+
export * from "./product/discount-schema";
|
|
22
|
+
export * from "./product/discount-relations";
|
|
23
|
+
export * from "./store/store-schema";
|
|
24
|
+
export * from "./store/store-settings-schema";
|
|
25
|
+
export * from "./store/store-audit-schema";
|
|
26
|
+
export { storeSettings, marketRegions, storeSettingsRelations, marketRegionsRelations, } from "./store/store-settings-schema";
|
|
27
|
+
export * from "./types";
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Export the ACTUAL Drizzle table objects for database operations
|
|
3
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4
|
+
if (k2 === undefined) k2 = k;
|
|
5
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
7
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
8
|
+
}
|
|
9
|
+
Object.defineProperty(o, k2, desc);
|
|
10
|
+
}) : (function(o, m, k, k2) {
|
|
11
|
+
if (k2 === undefined) k2 = k;
|
|
12
|
+
o[k2] = m[k];
|
|
13
|
+
}));
|
|
14
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
15
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
16
|
+
};
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
exports.GetAvailableLotsSchema = exports.GetLotsQuerySchema = exports.SplitLotSchema = exports.MergeLotsSchema = exports.TransferLotSchema = exports.AdjustLotQuantitySchema = exports.ReleaseLotReservationSchema = exports.ReserveLotQuantitySchema = exports.CreateLotSchema = exports.InitializeProductInventorySchema = exports.LotSchema = exports.lotStatusEnum = exports.lotMovementTypeEnum = exports.inventoryLotSplits = exports.inventoryLots = exports.inventoryLotMovements = exports.inventoryLotMerges = exports.inventoryLotAlerts = exports.alertTypeEnum = exports.alertStatusEnum = exports.alertSeverityEnum = exports.warehouses = exports.suppliers = exports.supplierQualityRatings = exports.qualityTemplates = exports.qualityControls = exports.purchaseOrders = exports.purchaseOrderItems = exports.productSuppliers = exports.posLocations = exports.inventoryTransfers = exports.inventoryTransferItems = exports.inventoryMovements = exports.inventory = exports.customerVisitHistory = exports.customers = exports.customerSupportTickets = exports.customerReviews = exports.customerPreferences = exports.customerNotes = exports.customerInteractionHistory = exports.customerAddresses = exports.kycWebhooksLog = exports.kycAnalytics = exports.kycDocuments = exports.kycVerificationHistory = exports.storeKyc = exports.getKafkaInstance = exports.getKafkaConfigFromEnv = exports.createKafkaInstance = void 0;
|
|
19
|
+
exports.marketRegionsRelations = exports.storeSettingsRelations = exports.marketRegions = exports.storeSettings = exports.refundReasonEnum = exports.paymentStatusEnum = exports.paymentMethodEnum = exports.orderTypeEnum = exports.ordersRelations = exports.orders = exports.orderStatusEnum = exports.orderPriorityEnum = exports.orderPaymentsRelations = exports.orderPayments = exports.orderNotesRelations = exports.orderNotes = exports.orderItemsRelations = exports.orderItems = exports.orderHistoryRelations = exports.orderHistory = exports.orderFulfillmentsRelations = exports.orderFulfillments = exports.orderDiscountsRelations = exports.orderDiscounts = exports.orderAddressesRelations = exports.orderAddresses = exports.fulfillmentStatusEnum = exports.discountTypeEnum = exports.addressTypeEnum = exports.LotAnalyticsSchema = void 0;
|
|
20
|
+
// Export event and Kafka functionality
|
|
21
|
+
var kafka_1 = require("../events/kafka");
|
|
22
|
+
Object.defineProperty(exports, "createKafkaInstance", { enumerable: true, get: function () { return kafka_1.createKafkaInstance; } });
|
|
23
|
+
Object.defineProperty(exports, "getKafkaConfigFromEnv", { enumerable: true, get: function () { return kafka_1.getKafkaConfigFromEnv; } });
|
|
24
|
+
Object.defineProperty(exports, "getKafkaInstance", { enumerable: true, get: function () { return kafka_1.getKafkaInstance; } });
|
|
25
|
+
__exportStar(require("../types/events"), exports);
|
|
26
|
+
// Admin Management
|
|
27
|
+
__exportStar(require("./admin/admin-schema"), exports);
|
|
28
|
+
// AI Moderation
|
|
29
|
+
__exportStar(require("./ai-moderation/ai-moderation-schema"), exports);
|
|
30
|
+
// Common Schemas
|
|
31
|
+
__exportStar(require("./common/common-schemas"), exports);
|
|
32
|
+
// Compliance Schemas
|
|
33
|
+
__exportStar(require("./compliance/compliance-schema"), exports);
|
|
34
|
+
__exportStar(require("./compliance/kyc-schema"), exports);
|
|
35
|
+
var kyc_schema_1 = require("./compliance/kyc-schema");
|
|
36
|
+
Object.defineProperty(exports, "storeKyc", { enumerable: true, get: function () { return kyc_schema_1.storeKyc; } });
|
|
37
|
+
Object.defineProperty(exports, "kycVerificationHistory", { enumerable: true, get: function () { return kyc_schema_1.kycVerificationHistory; } });
|
|
38
|
+
Object.defineProperty(exports, "kycDocuments", { enumerable: true, get: function () { return kyc_schema_1.kycDocuments; } });
|
|
39
|
+
Object.defineProperty(exports, "kycAnalytics", { enumerable: true, get: function () { return kyc_schema_1.kycAnalytics; } });
|
|
40
|
+
Object.defineProperty(exports, "kycWebhooksLog", { enumerable: true, get: function () { return kyc_schema_1.kycWebhooksLog; } });
|
|
41
|
+
// Customer Management Schemas
|
|
42
|
+
__exportStar(require("./customer/customer-schema"), exports);
|
|
43
|
+
// Customer Schema Exports
|
|
44
|
+
var customer_schema_1 = require("./customer/customer-schema");
|
|
45
|
+
Object.defineProperty(exports, "customerAddresses", { enumerable: true, get: function () { return customer_schema_1.customerAddresses; } });
|
|
46
|
+
Object.defineProperty(exports, "customerInteractionHistory", { enumerable: true, get: function () { return customer_schema_1.customerInteractionHistory; } });
|
|
47
|
+
Object.defineProperty(exports, "customerNotes", { enumerable: true, get: function () { return customer_schema_1.customerNotes; } });
|
|
48
|
+
Object.defineProperty(exports, "customerPreferences", { enumerable: true, get: function () { return customer_schema_1.customerPreferences; } });
|
|
49
|
+
Object.defineProperty(exports, "customerReviews", { enumerable: true, get: function () { return customer_schema_1.customerReviews; } });
|
|
50
|
+
Object.defineProperty(exports, "customerSupportTickets", { enumerable: true, get: function () { return customer_schema_1.customerSupportTickets; } });
|
|
51
|
+
Object.defineProperty(exports, "customers", { enumerable: true, get: function () { return customer_schema_1.customers; } });
|
|
52
|
+
Object.defineProperty(exports, "customerVisitHistory", { enumerable: true, get: function () { return customer_schema_1.customerVisitHistory; } });
|
|
53
|
+
// Core Inventory tables and co-located schemas
|
|
54
|
+
__exportStar(require("./inventory/inventory-tables"), exports);
|
|
55
|
+
var inventory_tables_1 = require("./inventory/inventory-tables");
|
|
56
|
+
Object.defineProperty(exports, "inventory", { enumerable: true, get: function () { return inventory_tables_1.inventory; } });
|
|
57
|
+
Object.defineProperty(exports, "inventoryMovements", { enumerable: true, get: function () { return inventory_tables_1.inventoryMovements; } });
|
|
58
|
+
Object.defineProperty(exports, "inventoryTransferItems", { enumerable: true, get: function () { return inventory_tables_1.inventoryTransferItems; } });
|
|
59
|
+
Object.defineProperty(exports, "inventoryTransfers", { enumerable: true, get: function () { return inventory_tables_1.inventoryTransfers; } });
|
|
60
|
+
Object.defineProperty(exports, "posLocations", { enumerable: true, get: function () { return inventory_tables_1.posLocations; } });
|
|
61
|
+
Object.defineProperty(exports, "productSuppliers", { enumerable: true, get: function () { return inventory_tables_1.productSuppliers; } });
|
|
62
|
+
Object.defineProperty(exports, "purchaseOrderItems", { enumerable: true, get: function () { return inventory_tables_1.purchaseOrderItems; } });
|
|
63
|
+
Object.defineProperty(exports, "purchaseOrders", { enumerable: true, get: function () { return inventory_tables_1.purchaseOrders; } });
|
|
64
|
+
Object.defineProperty(exports, "qualityControls", { enumerable: true, get: function () { return inventory_tables_1.qualityControls; } });
|
|
65
|
+
Object.defineProperty(exports, "qualityTemplates", { enumerable: true, get: function () { return inventory_tables_1.qualityTemplates; } });
|
|
66
|
+
Object.defineProperty(exports, "supplierQualityRatings", { enumerable: true, get: function () { return inventory_tables_1.supplierQualityRatings; } });
|
|
67
|
+
Object.defineProperty(exports, "suppliers", { enumerable: true, get: function () { return inventory_tables_1.suppliers; } });
|
|
68
|
+
Object.defineProperty(exports, "warehouses", { enumerable: true, get: function () { return inventory_tables_1.warehouses; } });
|
|
69
|
+
// Lot & Batch Management schemas
|
|
70
|
+
var lot_tables_1 = require("./inventory/lot-tables");
|
|
71
|
+
Object.defineProperty(exports, "alertSeverityEnum", { enumerable: true, get: function () { return lot_tables_1.alertSeverityEnum; } });
|
|
72
|
+
Object.defineProperty(exports, "alertStatusEnum", { enumerable: true, get: function () { return lot_tables_1.alertStatusEnum; } });
|
|
73
|
+
Object.defineProperty(exports, "alertTypeEnum", { enumerable: true, get: function () { return lot_tables_1.alertTypeEnum; } });
|
|
74
|
+
Object.defineProperty(exports, "inventoryLotAlerts", { enumerable: true, get: function () { return lot_tables_1.inventoryLotAlerts; } });
|
|
75
|
+
Object.defineProperty(exports, "inventoryLotMerges", { enumerable: true, get: function () { return lot_tables_1.inventoryLotMerges; } });
|
|
76
|
+
Object.defineProperty(exports, "inventoryLotMovements", { enumerable: true, get: function () { return lot_tables_1.inventoryLotMovements; } });
|
|
77
|
+
Object.defineProperty(exports, "inventoryLots", { enumerable: true, get: function () { return lot_tables_1.inventoryLots; } });
|
|
78
|
+
Object.defineProperty(exports, "inventoryLotSplits", { enumerable: true, get: function () { return lot_tables_1.inventoryLotSplits; } });
|
|
79
|
+
Object.defineProperty(exports, "lotMovementTypeEnum", { enumerable: true, get: function () { return lot_tables_1.lotMovementTypeEnum; } });
|
|
80
|
+
Object.defineProperty(exports, "lotStatusEnum", { enumerable: true, get: function () { return lot_tables_1.lotStatusEnum; } });
|
|
81
|
+
// Zod Schemas for Lot Operations
|
|
82
|
+
Object.defineProperty(exports, "LotSchema", { enumerable: true, get: function () { return lot_tables_1.LotSchema; } });
|
|
83
|
+
Object.defineProperty(exports, "InitializeProductInventorySchema", { enumerable: true, get: function () { return lot_tables_1.InitializeProductInventorySchema; } });
|
|
84
|
+
Object.defineProperty(exports, "CreateLotSchema", { enumerable: true, get: function () { return lot_tables_1.CreateLotSchema; } });
|
|
85
|
+
Object.defineProperty(exports, "ReserveLotQuantitySchema", { enumerable: true, get: function () { return lot_tables_1.ReserveLotQuantitySchema; } });
|
|
86
|
+
Object.defineProperty(exports, "ReleaseLotReservationSchema", { enumerable: true, get: function () { return lot_tables_1.ReleaseLotReservationSchema; } });
|
|
87
|
+
Object.defineProperty(exports, "AdjustLotQuantitySchema", { enumerable: true, get: function () { return lot_tables_1.AdjustLotQuantitySchema; } });
|
|
88
|
+
Object.defineProperty(exports, "TransferLotSchema", { enumerable: true, get: function () { return lot_tables_1.TransferLotSchema; } });
|
|
89
|
+
Object.defineProperty(exports, "MergeLotsSchema", { enumerable: true, get: function () { return lot_tables_1.MergeLotsSchema; } });
|
|
90
|
+
Object.defineProperty(exports, "SplitLotSchema", { enumerable: true, get: function () { return lot_tables_1.SplitLotSchema; } });
|
|
91
|
+
Object.defineProperty(exports, "GetLotsQuerySchema", { enumerable: true, get: function () { return lot_tables_1.GetLotsQuerySchema; } });
|
|
92
|
+
Object.defineProperty(exports, "GetAvailableLotsSchema", { enumerable: true, get: function () { return lot_tables_1.GetAvailableLotsSchema; } });
|
|
93
|
+
Object.defineProperty(exports, "LotAnalyticsSchema", { enumerable: true, get: function () { return lot_tables_1.LotAnalyticsSchema; } });
|
|
94
|
+
// Order schemas
|
|
95
|
+
var order_schema_1 = require("./order/order-schema");
|
|
96
|
+
Object.defineProperty(exports, "addressTypeEnum", { enumerable: true, get: function () { return order_schema_1.addressTypeEnum; } });
|
|
97
|
+
Object.defineProperty(exports, "discountTypeEnum", { enumerable: true, get: function () { return order_schema_1.discountTypeEnum; } });
|
|
98
|
+
Object.defineProperty(exports, "fulfillmentStatusEnum", { enumerable: true, get: function () { return order_schema_1.fulfillmentStatusEnum; } });
|
|
99
|
+
Object.defineProperty(exports, "orderAddresses", { enumerable: true, get: function () { return order_schema_1.orderAddresses; } });
|
|
100
|
+
Object.defineProperty(exports, "orderAddressesRelations", { enumerable: true, get: function () { return order_schema_1.orderAddressesRelations; } });
|
|
101
|
+
Object.defineProperty(exports, "orderDiscounts", { enumerable: true, get: function () { return order_schema_1.orderDiscounts; } });
|
|
102
|
+
Object.defineProperty(exports, "orderDiscountsRelations", { enumerable: true, get: function () { return order_schema_1.orderDiscountsRelations; } });
|
|
103
|
+
Object.defineProperty(exports, "orderFulfillments", { enumerable: true, get: function () { return order_schema_1.orderFulfillments; } });
|
|
104
|
+
Object.defineProperty(exports, "orderFulfillmentsRelations", { enumerable: true, get: function () { return order_schema_1.orderFulfillmentsRelations; } });
|
|
105
|
+
Object.defineProperty(exports, "orderHistory", { enumerable: true, get: function () { return order_schema_1.orderHistory; } });
|
|
106
|
+
Object.defineProperty(exports, "orderHistoryRelations", { enumerable: true, get: function () { return order_schema_1.orderHistoryRelations; } });
|
|
107
|
+
Object.defineProperty(exports, "orderItems", { enumerable: true, get: function () { return order_schema_1.orderItems; } });
|
|
108
|
+
Object.defineProperty(exports, "orderItemsRelations", { enumerable: true, get: function () { return order_schema_1.orderItemsRelations; } });
|
|
109
|
+
Object.defineProperty(exports, "orderNotes", { enumerable: true, get: function () { return order_schema_1.orderNotes; } });
|
|
110
|
+
Object.defineProperty(exports, "orderNotesRelations", { enumerable: true, get: function () { return order_schema_1.orderNotesRelations; } });
|
|
111
|
+
Object.defineProperty(exports, "orderPayments", { enumerable: true, get: function () { return order_schema_1.orderPayments; } });
|
|
112
|
+
Object.defineProperty(exports, "orderPaymentsRelations", { enumerable: true, get: function () { return order_schema_1.orderPaymentsRelations; } });
|
|
113
|
+
Object.defineProperty(exports, "orderPriorityEnum", { enumerable: true, get: function () { return order_schema_1.orderPriorityEnum; } });
|
|
114
|
+
Object.defineProperty(exports, "orderStatusEnum", { enumerable: true, get: function () { return order_schema_1.orderStatusEnum; } });
|
|
115
|
+
Object.defineProperty(exports, "orders", { enumerable: true, get: function () { return order_schema_1.orders; } });
|
|
116
|
+
Object.defineProperty(exports, "ordersRelations", { enumerable: true, get: function () { return order_schema_1.ordersRelations; } });
|
|
117
|
+
// Enums
|
|
118
|
+
Object.defineProperty(exports, "orderTypeEnum", { enumerable: true, get: function () { return order_schema_1.orderTypeEnum; } });
|
|
119
|
+
Object.defineProperty(exports, "paymentMethodEnum", { enumerable: true, get: function () { return order_schema_1.paymentMethodEnum; } });
|
|
120
|
+
Object.defineProperty(exports, "paymentStatusEnum", { enumerable: true, get: function () { return order_schema_1.paymentStatusEnum; } });
|
|
121
|
+
Object.defineProperty(exports, "refundReasonEnum", { enumerable: true, get: function () { return order_schema_1.refundReasonEnum; } });
|
|
122
|
+
__exportStar(require("./product/product-relations"), exports);
|
|
123
|
+
// Product Management Schemas
|
|
124
|
+
__exportStar(require("./product/product-schema"), exports);
|
|
125
|
+
__exportStar(require("./product/product-relations"), exports);
|
|
126
|
+
__exportStar(require("./product/discount-schema"), exports);
|
|
127
|
+
__exportStar(require("./product/discount-relations"), exports);
|
|
128
|
+
// Store Management
|
|
129
|
+
__exportStar(require("./store/store-schema"), exports);
|
|
130
|
+
__exportStar(require("./store/store-settings-schema"), exports);
|
|
131
|
+
__exportStar(require("./store/store-audit-schema"), exports);
|
|
132
|
+
var store_settings_schema_1 = require("./store/store-settings-schema");
|
|
133
|
+
Object.defineProperty(exports, "storeSettings", { enumerable: true, get: function () { return store_settings_schema_1.storeSettings; } });
|
|
134
|
+
Object.defineProperty(exports, "marketRegions", { enumerable: true, get: function () { return store_settings_schema_1.marketRegions; } });
|
|
135
|
+
Object.defineProperty(exports, "storeSettingsRelations", { enumerable: true, get: function () { return store_settings_schema_1.storeSettingsRelations; } });
|
|
136
|
+
Object.defineProperty(exports, "marketRegionsRelations", { enumerable: true, get: function () { return store_settings_schema_1.marketRegionsRelations; } });
|
|
137
|
+
// Types
|
|
138
|
+
__exportStar(require("./types"), exports);
|