create-fullstack-scaffold 0.4.9 → 0.4.10
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/cli/index.js +499 -100
- package/dist/cli/index.js.map +1 -1
- package/package.json +2 -2
- package/template/CLAUDE.md +18 -6
- package/template/drizzle/0004_add_merchants_products.sql +30 -0
- package/template/drizzle/meta/_journal.json +7 -0
- package/template/eslint-rules/module-boundary.js +6 -2
- package/template/eslint-rules/no-cross-module-service-import.js +105 -0
- package/template/eslint-rules/no-disable-type-safe-client.js +5 -0
- package/template/eslint.config.js +9 -0
- package/template/lint-scripts/config/project.config.ts +21 -0
- package/template/lint-scripts/validate-all.ts +48 -12
- package/template/lint-scripts/validators/index.ts +29 -0
- package/template/lint-scripts/validators/module-public-api.validator.ts +103 -0
- package/template/lint-scripts/validators/schema-uniqueness.validator.ts +147 -0
- package/template/modules.config.ts +2 -0
- package/template/package.json +2 -0
- package/template/playwright.config.ts +14 -0
- package/template/src/admin/App.tsx +40 -3
- package/template/src/admin/components/LanguageSwitcher.tsx +22 -0
- package/template/src/admin/components/NotificationDrawer.tsx +108 -38
- package/template/src/admin/components/StatsCard.tsx +3 -1
- package/template/src/admin/components/ThemeToggle.tsx +28 -0
- package/template/src/admin/hooks/useRoles.ts +2 -2
- package/template/src/admin/i18n/index.ts +18 -0
- package/template/src/admin/i18n/locales/en-US.json +381 -0
- package/template/src/admin/i18n/locales/zh-CN.json +381 -0
- package/template/src/admin/i18n/useLanguage.ts +21 -0
- package/template/src/admin/layouts/Header.tsx +37 -16
- package/template/src/admin/layouts/Layout.tsx +7 -3
- package/template/src/admin/layouts/Sidebar.tsx +70 -68
- package/template/src/admin/main.tsx +1 -0
- package/template/src/admin/pages/ContentPage.tsx +68 -56
- package/template/src/admin/pages/DashboardPage.tsx +82 -76
- package/template/src/admin/pages/DisputesPage.tsx +61 -53
- package/template/src/admin/pages/LoginPage.tsx +41 -33
- package/template/src/admin/pages/OrdersPage.tsx +69 -64
- package/template/src/admin/pages/PermissionsPage.tsx +10 -8
- package/template/src/admin/pages/PluginDashboardPage.tsx +3 -1
- package/template/src/admin/pages/PluginManagementPage.tsx +3 -1
- package/template/src/admin/pages/RegisterPage.tsx +18 -16
- package/template/src/admin/pages/RolesPage.tsx +51 -49
- package/template/src/admin/pages/SettingsPage.tsx +22 -22
- package/template/src/admin/pages/SystemLogsPage.tsx +32 -30
- package/template/src/admin/pages/TicketsPage.tsx +67 -59
- package/template/src/admin/pages/UsersPage.tsx +63 -53
- package/template/src/admin/pages/__tests__/RolesPage.test.tsx +2 -2
- package/template/src/admin/stores/themeStore.ts +32 -0
- package/template/src/client/index.css +73 -0
- package/template/src/merchant/App.tsx +2 -0
- package/template/src/merchant/components/MerchantGuard.tsx +2 -6
- package/template/src/merchant/components/__tests__/MerchantGuard.test.tsx +117 -0
- package/template/src/merchant/layouts/Header.tsx +2 -2
- package/template/src/merchant/pages/DashboardPage.tsx +2 -2
- package/template/src/merchant/pages/DisputesPage.tsx +14 -10
- package/template/src/merchant/pages/LoginPage.tsx +49 -0
- package/template/src/merchant/pages/OrdersPage.tsx +17 -10
- package/template/src/merchant/pages/ProductsPage.tsx +31 -8
- package/template/src/merchant/pages/SettingsPage.tsx +3 -7
- package/template/src/merchant/stores/__tests__/merchantStore.test.ts +317 -0
- package/template/src/merchant/stores/merchantStore.ts +24 -27
- package/template/src/server/db/schema/index.ts +2 -0
- package/template/src/server/db/schema/merchants.ts +26 -0
- package/template/src/server/db/schema/products.ts +25 -0
- package/template/src/server/db/test-setup.ts +237 -0
- package/template/src/server/middleware/__tests__/audit-log.test.ts +144 -0
- package/template/src/server/middleware/__tests__/cors.test.ts +84 -0
- package/template/src/server/middleware/__tests__/logger.test.ts +117 -0
- package/template/src/server/middleware/__tests__/rate-limit.test.ts +73 -0
- package/template/src/server/middleware/__tests__/realtime-env.test.ts +56 -0
- package/template/src/server/middleware/__tests__/tenant-isolation.test.ts +150 -0
- package/template/src/server/module-admin/__tests__/admin-routes.test.ts +1 -1
- package/template/src/server/module-admin/module.ts +4 -0
- package/template/src/server/module-admin/routes/admin-notification-routes.ts +3 -3
- package/template/src/server/module-admin/routes/user-management-routes.ts +2 -2
- package/template/src/server/module-auth/__tests__/auth-routes.test.ts +315 -0
- package/template/src/server/module-auth/__tests__/profile-routes.test.ts +83 -0
- package/template/src/server/module-auth/module.ts +2 -0
- package/template/src/server/module-content/module.ts +1 -0
- package/template/src/server/module-content/routes/content-routes.ts +2 -2
- package/template/src/server/module-dispute/module.ts +1 -0
- package/template/src/server/module-dispute/routes/dispute-routes.ts +2 -2
- package/template/src/server/module-merchant/__tests__/merchant-routes.test.ts +218 -0
- package/template/src/server/module-merchant/__tests__/merchant-service.test.ts +183 -0
- package/template/src/server/module-merchant/index.ts +10 -0
- package/template/src/server/module-merchant/module.ts +33 -0
- package/template/src/server/module-merchant/routes/merchant-routes.ts +138 -0
- package/template/src/server/module-merchant/services/merchant-service.ts +292 -0
- package/template/src/server/module-notifications/index.ts +18 -0
- package/template/src/server/module-notifications/module.ts +2 -0
- package/template/src/server/module-order/module.ts +1 -0
- package/template/src/server/module-order/routes/order-routes.ts +2 -2
- package/template/src/server/module-permission/routes/role-routes.ts +3 -3
- package/template/src/server/module-plugin/__tests__/admin-category-service.test.ts +181 -0
- package/template/src/server/module-plugin/__tests__/admin-plugin-service.test.ts +277 -0
- package/template/src/server/module-plugin/__tests__/admin-stats-service.test.ts +170 -0
- package/template/src/server/module-plugin/__tests__/plugin-review-service.test.ts +260 -0
- package/template/src/server/module-plugin/__tests__/plugin-seed-service.test.ts +170 -0
- package/template/src/server/module-plugin/module.ts +3 -0
- package/template/src/server/module-tenant/__tests__/tenant-routes.test.ts +142 -0
- package/template/src/server/module-tenant/__tests__/tenant-service.test.ts +152 -0
- package/template/src/server/module-tenant/module.ts +1 -0
- package/template/src/server/module-tenant/services/tenant-service.ts +1 -37
- package/template/src/server/module-ticket/module.ts +1 -0
- package/template/src/server/module-ticket/routes/ticket-routes.ts +2 -2
- package/template/src/server/module-todos/module.ts +3 -0
- package/template/src/server/route-registry.ts +4 -0
- package/template/src/server/utils/__tests__/date.test.ts +130 -0
- package/template/src/server/utils/__tests__/env.test.ts +25 -0
- package/template/src/server/utils/__tests__/generate.test.ts +82 -0
- package/template/src/server/utils/__tests__/id-helpers.test.ts +29 -0
- package/template/src/server/utils/__tests__/json.test.ts +49 -0
- package/template/src/server/utils/__tests__/permission-utils.test.ts +26 -0
- package/template/src/server/utils/__tests__/uuid.test.ts +25 -0
- package/template/src/shared/core/module-manifest.ts +15 -0
- package/template/src/shared/modules/admin/schemas.ts +1 -1
- package/template/src/shared/modules/content/schemas.ts +2 -2
- package/template/src/shared/modules/dispute/schemas.ts +2 -2
- package/template/src/shared/modules/index.ts +181 -1
- package/template/src/shared/modules/merchant/index.ts +12 -0
- package/template/src/shared/modules/merchant/schemas.ts +63 -0
- package/template/src/shared/modules/order/schemas.ts +2 -2
- package/template/src/shared/modules/permission/index.ts +1 -1
- package/template/src/shared/modules/permission/schemas.ts +1 -1
- package/template/src/shared/modules/role/schemas.ts +2 -2
- package/template/src/shared/modules/ticket/schemas.ts +2 -2
- package/template/src/shared/schemas/index.ts +74 -2
|
@@ -41,7 +41,7 @@ export const UpdateContentSchema = z.object({
|
|
|
41
41
|
|
|
42
42
|
export const ContentListSchema = z.array(ContentSchema)
|
|
43
43
|
|
|
44
|
-
export const
|
|
44
|
+
export const ContentDeleteResultSchema = z.object({
|
|
45
45
|
message: z.string(),
|
|
46
46
|
})
|
|
47
47
|
|
|
@@ -50,4 +50,4 @@ export type ContentStatus = z.infer<typeof ContentStatusSchema>
|
|
|
50
50
|
export type Content = z.infer<typeof ContentSchema>
|
|
51
51
|
export type CreateContentInput = z.infer<typeof CreateContentSchema>
|
|
52
52
|
export type UpdateContentInput = z.infer<typeof UpdateContentSchema>
|
|
53
|
-
export type
|
|
53
|
+
export type ContentDeleteResult = z.infer<typeof ContentDeleteResultSchema>
|
|
@@ -49,7 +49,7 @@ export const ResolveDisputeSchema = z.object({
|
|
|
49
49
|
|
|
50
50
|
export const DisputeListSchema = z.array(DisputeSchema)
|
|
51
51
|
|
|
52
|
-
export const
|
|
52
|
+
export const DisputeDeleteResultSchema = z.object({
|
|
53
53
|
message: z.string(),
|
|
54
54
|
})
|
|
55
55
|
|
|
@@ -59,4 +59,4 @@ export type Dispute = z.infer<typeof DisputeSchema>
|
|
|
59
59
|
export type CreateDisputeInput = z.infer<typeof CreateDisputeSchema>
|
|
60
60
|
export type UpdateDisputeInput = z.infer<typeof UpdateDisputeSchema>
|
|
61
61
|
export type ResolveDisputeInput = z.infer<typeof ResolveDisputeSchema>
|
|
62
|
-
export type
|
|
62
|
+
export type DisputeDeleteResult = z.infer<typeof DisputeDeleteResultSchema>
|
|
@@ -63,7 +63,7 @@ export {
|
|
|
63
63
|
hasPermission,
|
|
64
64
|
hasAnyPermission,
|
|
65
65
|
hasAllPermissions,
|
|
66
|
-
type
|
|
66
|
+
type PermissionRoleType,
|
|
67
67
|
type RoleInfo,
|
|
68
68
|
type PermissionInfo,
|
|
69
69
|
type UserPermissions,
|
|
@@ -109,3 +109,183 @@ export {
|
|
|
109
109
|
type AdminDashboardStats,
|
|
110
110
|
type PluginListQuery,
|
|
111
111
|
} from './plugins'
|
|
112
|
+
export {
|
|
113
|
+
TenantSchema,
|
|
114
|
+
TenantStatusSchema,
|
|
115
|
+
TenantPlanSchema,
|
|
116
|
+
TenantSettingsSchema,
|
|
117
|
+
CreateTenantSchema,
|
|
118
|
+
UpdateTenantSchema,
|
|
119
|
+
TenantIdSchema,
|
|
120
|
+
TenantSlugSchema,
|
|
121
|
+
TenantListResponseSchema,
|
|
122
|
+
TenantQuerySchema,
|
|
123
|
+
TenantIdResponseSchema,
|
|
124
|
+
type Tenant,
|
|
125
|
+
type TenantStatus,
|
|
126
|
+
type TenantPlan,
|
|
127
|
+
type TenantSettings,
|
|
128
|
+
type CreateTenantInput,
|
|
129
|
+
type UpdateTenantInput,
|
|
130
|
+
type TenantId,
|
|
131
|
+
type TenantSlug,
|
|
132
|
+
type TenantListResponse,
|
|
133
|
+
type TenantQuery,
|
|
134
|
+
type TenantIdResponse,
|
|
135
|
+
} from './tenant'
|
|
136
|
+
export {
|
|
137
|
+
OrderStatusSchema,
|
|
138
|
+
OrderSchema,
|
|
139
|
+
CreateOrderSchema,
|
|
140
|
+
UpdateOrderSchema,
|
|
141
|
+
OrderListSchema,
|
|
142
|
+
OrderQuerySchema,
|
|
143
|
+
OrderDeleteResultSchema,
|
|
144
|
+
ProcessOrderSchema,
|
|
145
|
+
CancelOrderSchema,
|
|
146
|
+
RemoveCartItemResponseSchema,
|
|
147
|
+
ECommerceProductSchema,
|
|
148
|
+
ECommerceOrderStatusSchema,
|
|
149
|
+
ECommerceOrderSchema,
|
|
150
|
+
ECommerceOrderListSchema,
|
|
151
|
+
type OrderStatus,
|
|
152
|
+
type Order,
|
|
153
|
+
type CreateOrderInput,
|
|
154
|
+
type UpdateOrderInput,
|
|
155
|
+
type OrderDeleteResult,
|
|
156
|
+
type ProcessOrderInput,
|
|
157
|
+
type CancelOrderInput,
|
|
158
|
+
type OrderQueryInput,
|
|
159
|
+
type RemoveCartItemResponse,
|
|
160
|
+
type ECommerceProduct,
|
|
161
|
+
type ECommerceOrderStatus,
|
|
162
|
+
type ECommerceOrder,
|
|
163
|
+
} from './order'
|
|
164
|
+
export {
|
|
165
|
+
TicketStatusSchema,
|
|
166
|
+
TicketPrioritySchema,
|
|
167
|
+
TicketCategorySchema,
|
|
168
|
+
TicketReplySchema,
|
|
169
|
+
TicketSchema,
|
|
170
|
+
CreateTicketSchema,
|
|
171
|
+
UpdateTicketSchema,
|
|
172
|
+
ReplyTicketSchema,
|
|
173
|
+
TicketListSchema,
|
|
174
|
+
TicketDeleteResultSchema,
|
|
175
|
+
type TicketStatus,
|
|
176
|
+
type TicketPriority,
|
|
177
|
+
type TicketCategory,
|
|
178
|
+
type TicketReply,
|
|
179
|
+
type Ticket,
|
|
180
|
+
type CreateTicketInput,
|
|
181
|
+
type UpdateTicketInput,
|
|
182
|
+
type ReplyTicketInput,
|
|
183
|
+
type TicketDeleteResult,
|
|
184
|
+
} from './ticket'
|
|
185
|
+
export {
|
|
186
|
+
DisputeTypeSchema,
|
|
187
|
+
DisputeStatusSchema,
|
|
188
|
+
DisputeSchema,
|
|
189
|
+
CreateDisputeSchema,
|
|
190
|
+
UpdateDisputeSchema,
|
|
191
|
+
ResolveDisputeSchema,
|
|
192
|
+
DisputeListSchema,
|
|
193
|
+
DisputeDeleteResultSchema,
|
|
194
|
+
type DisputeType,
|
|
195
|
+
type DisputeStatus,
|
|
196
|
+
type Dispute,
|
|
197
|
+
type CreateDisputeInput,
|
|
198
|
+
type UpdateDisputeInput,
|
|
199
|
+
type ResolveDisputeInput,
|
|
200
|
+
type DisputeDeleteResult,
|
|
201
|
+
} from './dispute'
|
|
202
|
+
export {
|
|
203
|
+
ContentCategorySchema,
|
|
204
|
+
ContentStatusSchema,
|
|
205
|
+
ContentSchema,
|
|
206
|
+
CreateContentSchema,
|
|
207
|
+
UpdateContentSchema,
|
|
208
|
+
ContentListSchema,
|
|
209
|
+
ContentDeleteResultSchema,
|
|
210
|
+
type ContentCategory,
|
|
211
|
+
type ContentStatus,
|
|
212
|
+
type Content,
|
|
213
|
+
type CreateContentInput,
|
|
214
|
+
type UpdateContentInput,
|
|
215
|
+
type ContentDeleteResult,
|
|
216
|
+
} from './content'
|
|
217
|
+
export {
|
|
218
|
+
CaptchaResponseSchema,
|
|
219
|
+
VerifyCaptchaRequestSchema,
|
|
220
|
+
CaptchaVerifyResponseSchema,
|
|
221
|
+
type CaptchaResponse,
|
|
222
|
+
type VerifyCaptchaRequest,
|
|
223
|
+
type CaptchaVerifyResponse,
|
|
224
|
+
} from './captcha'
|
|
225
|
+
export {
|
|
226
|
+
DashboardStatSchema,
|
|
227
|
+
RevenueDataSchema,
|
|
228
|
+
ActivityStatusSchema,
|
|
229
|
+
ActivitySchema,
|
|
230
|
+
DashboardResponseSchema,
|
|
231
|
+
type DashboardStat,
|
|
232
|
+
type RevenueData,
|
|
233
|
+
type ActivityStatus,
|
|
234
|
+
type Activity,
|
|
235
|
+
type DashboardResponse,
|
|
236
|
+
} from './dashboard'
|
|
237
|
+
export {
|
|
238
|
+
CartItemSchema,
|
|
239
|
+
CartSummarySchema,
|
|
240
|
+
CartResponseSchema,
|
|
241
|
+
AddCartItemSchema,
|
|
242
|
+
CartItemIdSchema,
|
|
243
|
+
type CartItem,
|
|
244
|
+
type CartSummary,
|
|
245
|
+
type CartResponse,
|
|
246
|
+
type AddCartItemInput,
|
|
247
|
+
} from './cart'
|
|
248
|
+
export {
|
|
249
|
+
TopicStatusSchema,
|
|
250
|
+
TopicTagSchema,
|
|
251
|
+
TopicAuthorSchema,
|
|
252
|
+
TopicSchema,
|
|
253
|
+
TopicsResponseSchema,
|
|
254
|
+
ProfileStatsSchema,
|
|
255
|
+
ActivityTypeSchema,
|
|
256
|
+
ProfileActivitySchema,
|
|
257
|
+
ProfileResponseSchema,
|
|
258
|
+
type TopicStatus,
|
|
259
|
+
type TopicTag,
|
|
260
|
+
type TopicAuthor,
|
|
261
|
+
type Topic,
|
|
262
|
+
type ProfileStats,
|
|
263
|
+
type ActivityType,
|
|
264
|
+
type ProfileActivity,
|
|
265
|
+
type ProfileResponse,
|
|
266
|
+
} from './community'
|
|
267
|
+
export {
|
|
268
|
+
ResourceTypeSchema,
|
|
269
|
+
ActionTypeSchema,
|
|
270
|
+
AuditLogSchema,
|
|
271
|
+
type AuditLogType,
|
|
272
|
+
} from './audit'
|
|
273
|
+
export {
|
|
274
|
+
RoleSchema,
|
|
275
|
+
CreateRoleSchema,
|
|
276
|
+
UpdateRoleSchema,
|
|
277
|
+
UpdateRolePermissionsSchema,
|
|
278
|
+
RoleSuccessSchema,
|
|
279
|
+
type RoleDataType,
|
|
280
|
+
type CreateRoleType,
|
|
281
|
+
type UpdateRoleType,
|
|
282
|
+
} from './role'
|
|
283
|
+
export {
|
|
284
|
+
ProductSchema,
|
|
285
|
+
CreateProductSchema,
|
|
286
|
+
UpdateProductSchema,
|
|
287
|
+
ProductListSchema,
|
|
288
|
+
type Product,
|
|
289
|
+
type CreateProductInput,
|
|
290
|
+
type UpdateProductInput,
|
|
291
|
+
} from './merchant'
|
|
@@ -1,9 +1,21 @@
|
|
|
1
1
|
export {
|
|
2
|
+
MerchantSchema,
|
|
3
|
+
MerchantLoginSchema,
|
|
4
|
+
MerchantStatsSchema,
|
|
5
|
+
MerchantLoginResponseSchema,
|
|
2
6
|
ProductSchema,
|
|
3
7
|
CreateProductSchema,
|
|
4
8
|
UpdateProductSchema,
|
|
5
9
|
ProductListSchema,
|
|
10
|
+
ProductQuerySchema,
|
|
11
|
+
ProductListResponseSchema,
|
|
12
|
+
type Merchant,
|
|
13
|
+
type MerchantLoginInput,
|
|
14
|
+
type MerchantStats,
|
|
15
|
+
type MerchantLoginResponse,
|
|
6
16
|
type Product,
|
|
7
17
|
type CreateProductInput,
|
|
8
18
|
type UpdateProductInput,
|
|
19
|
+
type ProductQuery,
|
|
20
|
+
type ProductListResponse,
|
|
9
21
|
} from './schemas'
|
|
@@ -1,5 +1,49 @@
|
|
|
1
1
|
import { z } from '@hono/zod-openapi'
|
|
2
2
|
|
|
3
|
+
// ==================== Merchant Schemas ====================
|
|
4
|
+
|
|
5
|
+
export const MerchantSchema = z.object({
|
|
6
|
+
id: z.number().int().positive(),
|
|
7
|
+
userId: z.string(),
|
|
8
|
+
tenantId: z.number().int().positive(),
|
|
9
|
+
businessName: z.string().min(1).max(200),
|
|
10
|
+
businessType: z.enum(['retail', 'wholesale', 'service', 'restaurant']),
|
|
11
|
+
status: z.enum(['active', 'inactive', 'suspended']),
|
|
12
|
+
description: z.string().max(1000).nullable(),
|
|
13
|
+
phone: z.string().nullable(),
|
|
14
|
+
email: z.string().email().nullable(),
|
|
15
|
+
address: z.string().max(500).nullable(),
|
|
16
|
+
createdAt: z.string().datetime(),
|
|
17
|
+
updatedAt: z.string().datetime(),
|
|
18
|
+
})
|
|
19
|
+
|
|
20
|
+
export const MerchantLoginSchema = z.object({
|
|
21
|
+
username: z.string().min(1),
|
|
22
|
+
password: z.string().min(6),
|
|
23
|
+
})
|
|
24
|
+
|
|
25
|
+
export const MerchantStatsSchema = z.object({
|
|
26
|
+
totalOrders: z.number().int().min(0),
|
|
27
|
+
totalRevenue: z.number().min(0),
|
|
28
|
+
totalProducts: z.number().int().min(0),
|
|
29
|
+
activeProducts: z.number().int().min(0),
|
|
30
|
+
pendingOrders: z.number().int().min(0),
|
|
31
|
+
thisMonthRevenue: z.number().min(0),
|
|
32
|
+
})
|
|
33
|
+
|
|
34
|
+
export type Merchant = z.infer<typeof MerchantSchema>
|
|
35
|
+
export type MerchantLoginInput = z.infer<typeof MerchantLoginSchema>
|
|
36
|
+
export type MerchantStats = z.infer<typeof MerchantStatsSchema>
|
|
37
|
+
|
|
38
|
+
export const MerchantLoginResponseSchema = z.object({
|
|
39
|
+
token: z.string(),
|
|
40
|
+
merchant: MerchantSchema,
|
|
41
|
+
})
|
|
42
|
+
|
|
43
|
+
export type MerchantLoginResponse = z.infer<typeof MerchantLoginResponseSchema>
|
|
44
|
+
|
|
45
|
+
// ==================== Product Schemas ====================
|
|
46
|
+
|
|
3
47
|
export const ProductSchema = z.object({
|
|
4
48
|
id: z.string(),
|
|
5
49
|
name: z.string().min(1).max(200),
|
|
@@ -35,3 +79,22 @@ export const ProductListSchema = z.array(ProductSchema)
|
|
|
35
79
|
export type Product = z.infer<typeof ProductSchema>
|
|
36
80
|
export type CreateProductInput = z.infer<typeof CreateProductSchema>
|
|
37
81
|
export type UpdateProductInput = z.infer<typeof UpdateProductSchema>
|
|
82
|
+
|
|
83
|
+
// ==================== Product Query Schemas ====================
|
|
84
|
+
|
|
85
|
+
export const ProductQuerySchema = z.object({
|
|
86
|
+
status: z.enum(['active', 'inactive', 'out_of_stock']).nullish(),
|
|
87
|
+
page: z.coerce.number().int().positive().default(1),
|
|
88
|
+
pageSize: z.coerce.number().int().positive().max(100).default(20),
|
|
89
|
+
})
|
|
90
|
+
|
|
91
|
+
export type ProductQuery = z.infer<typeof ProductQuerySchema>
|
|
92
|
+
|
|
93
|
+
export const ProductListResponseSchema = z.object({
|
|
94
|
+
items: ProductListSchema,
|
|
95
|
+
total: z.number(),
|
|
96
|
+
page: z.number(),
|
|
97
|
+
pageSize: z.number(),
|
|
98
|
+
})
|
|
99
|
+
|
|
100
|
+
export type ProductListResponse = z.infer<typeof ProductListResponseSchema>
|
|
@@ -40,7 +40,7 @@ export const OrderQuerySchema = z.object({
|
|
|
40
40
|
offset: z.coerce.number().int().min(0).default(0),
|
|
41
41
|
})
|
|
42
42
|
|
|
43
|
-
export const
|
|
43
|
+
export const OrderDeleteResultSchema = z.object({
|
|
44
44
|
message: z.string(),
|
|
45
45
|
})
|
|
46
46
|
|
|
@@ -57,7 +57,7 @@ export type OrderStatus = z.infer<typeof OrderStatusSchema>
|
|
|
57
57
|
export type Order = z.infer<typeof OrderSchema>
|
|
58
58
|
export type CreateOrderInput = z.infer<typeof CreateOrderSchema>
|
|
59
59
|
export type UpdateOrderInput = z.infer<typeof UpdateOrderSchema>
|
|
60
|
-
export type
|
|
60
|
+
export type OrderDeleteResult = z.infer<typeof OrderDeleteResultSchema>
|
|
61
61
|
export type ProcessOrderInput = z.infer<typeof ProcessOrderSchema>
|
|
62
62
|
export type CancelOrderInput = z.infer<typeof CancelOrderSchema>
|
|
63
63
|
export type OrderQueryInput = z.infer<typeof OrderQuerySchema>
|
|
@@ -80,7 +80,7 @@ export const PermissionInitSchema = z.object({
|
|
|
80
80
|
role: RoleEnum,
|
|
81
81
|
})
|
|
82
82
|
|
|
83
|
-
export type
|
|
83
|
+
export type PermissionRoleType = z.infer<typeof RoleEnum>
|
|
84
84
|
export type PermissionType = z.infer<typeof PermissionEnum>
|
|
85
85
|
export type RoleInfo = z.infer<typeof RoleInfoSchema>
|
|
86
86
|
export type PermissionInfo = z.infer<typeof PermissionInfoSchema>
|
|
@@ -39,8 +39,8 @@ export const UpdateRolePermissionsSchema = z.object({
|
|
|
39
39
|
permissionIds: z.array(z.string()),
|
|
40
40
|
})
|
|
41
41
|
|
|
42
|
-
export const
|
|
42
|
+
export const RoleSuccessSchema = z.object({})
|
|
43
43
|
|
|
44
|
-
export type
|
|
44
|
+
export type RoleDataType = z.infer<typeof RoleSchema>
|
|
45
45
|
export type CreateRoleType = z.infer<typeof CreateRoleSchema>
|
|
46
46
|
export type UpdateRoleType = z.infer<typeof UpdateRoleSchema>
|
|
@@ -62,7 +62,7 @@ export const ReplyTicketSchema = z.object({
|
|
|
62
62
|
|
|
63
63
|
export const TicketListSchema = z.array(TicketSchema)
|
|
64
64
|
|
|
65
|
-
export const
|
|
65
|
+
export const TicketDeleteResultSchema = z.object({
|
|
66
66
|
message: z.string(),
|
|
67
67
|
})
|
|
68
68
|
|
|
@@ -74,4 +74,4 @@ export type Ticket = z.infer<typeof TicketSchema>
|
|
|
74
74
|
export type CreateTicketInput = z.infer<typeof CreateTicketSchema>
|
|
75
75
|
export type UpdateTicketInput = z.infer<typeof UpdateTicketSchema>
|
|
76
76
|
export type ReplyTicketInput = z.infer<typeof ReplyTicketSchema>
|
|
77
|
-
export type
|
|
77
|
+
export type TicketDeleteResult = z.infer<typeof TicketDeleteResultSchema>
|
|
@@ -172,7 +172,7 @@ export {
|
|
|
172
172
|
UpdateOrderSchema,
|
|
173
173
|
OrderListSchema,
|
|
174
174
|
OrderQuerySchema,
|
|
175
|
-
|
|
175
|
+
OrderDeleteResultSchema,
|
|
176
176
|
ProcessOrderSchema,
|
|
177
177
|
CancelOrderSchema,
|
|
178
178
|
type RemoveCartItemResponse,
|
|
@@ -183,7 +183,7 @@ export {
|
|
|
183
183
|
type Order,
|
|
184
184
|
type CreateOrderInput,
|
|
185
185
|
type UpdateOrderInput,
|
|
186
|
-
type
|
|
186
|
+
type OrderDeleteResult,
|
|
187
187
|
type ProcessOrderInput,
|
|
188
188
|
type CancelOrderInput,
|
|
189
189
|
type OrderQueryInput,
|
|
@@ -251,8 +251,80 @@ export {
|
|
|
251
251
|
CreateProductSchema,
|
|
252
252
|
UpdateProductSchema,
|
|
253
253
|
ProductListSchema,
|
|
254
|
+
MerchantSchema,
|
|
255
|
+
MerchantLoginSchema,
|
|
256
|
+
MerchantStatsSchema,
|
|
257
|
+
MerchantLoginResponseSchema,
|
|
258
|
+
ProductQuerySchema,
|
|
259
|
+
ProductListResponseSchema,
|
|
254
260
|
type Product,
|
|
255
261
|
type CreateProductInput,
|
|
256
262
|
type UpdateProductInput,
|
|
263
|
+
type Merchant,
|
|
264
|
+
type MerchantLoginInput,
|
|
265
|
+
type MerchantStats,
|
|
266
|
+
type MerchantLoginResponse,
|
|
267
|
+
type ProductQuery,
|
|
268
|
+
type ProductListResponse,
|
|
257
269
|
} from '../modules/merchant'
|
|
270
|
+
export {
|
|
271
|
+
TicketStatusSchema,
|
|
272
|
+
TicketPrioritySchema,
|
|
273
|
+
TicketCategorySchema,
|
|
274
|
+
TicketReplySchema,
|
|
275
|
+
TicketSchema,
|
|
276
|
+
CreateTicketSchema,
|
|
277
|
+
UpdateTicketSchema,
|
|
278
|
+
ReplyTicketSchema,
|
|
279
|
+
TicketListSchema,
|
|
280
|
+
TicketDeleteResultSchema,
|
|
281
|
+
type TicketStatus,
|
|
282
|
+
type TicketPriority,
|
|
283
|
+
type TicketCategory,
|
|
284
|
+
type TicketReply,
|
|
285
|
+
type Ticket,
|
|
286
|
+
type CreateTicketInput,
|
|
287
|
+
type UpdateTicketInput,
|
|
288
|
+
type ReplyTicketInput,
|
|
289
|
+
type TicketDeleteResult,
|
|
290
|
+
} from '../modules/ticket'
|
|
291
|
+
export {
|
|
292
|
+
ContentCategorySchema,
|
|
293
|
+
ContentStatusSchema,
|
|
294
|
+
ContentSchema,
|
|
295
|
+
CreateContentSchema,
|
|
296
|
+
UpdateContentSchema,
|
|
297
|
+
ContentListSchema,
|
|
298
|
+
ContentDeleteResultSchema,
|
|
299
|
+
type ContentCategory,
|
|
300
|
+
type ContentStatus,
|
|
301
|
+
type Content,
|
|
302
|
+
type CreateContentInput,
|
|
303
|
+
type UpdateContentInput,
|
|
304
|
+
type ContentDeleteResult,
|
|
305
|
+
} from '../modules/content'
|
|
306
|
+
export {
|
|
307
|
+
CaptchaResponseSchema,
|
|
308
|
+
VerifyCaptchaRequestSchema,
|
|
309
|
+
CaptchaVerifyResponseSchema,
|
|
310
|
+
type CaptchaResponse,
|
|
311
|
+
type VerifyCaptchaRequest,
|
|
312
|
+
type CaptchaVerifyResponse,
|
|
313
|
+
} from '../modules/captcha'
|
|
314
|
+
export {
|
|
315
|
+
ResourceTypeSchema,
|
|
316
|
+
ActionTypeSchema,
|
|
317
|
+
AuditLogSchema,
|
|
318
|
+
type AuditLogType,
|
|
319
|
+
} from '../modules/audit'
|
|
320
|
+
export {
|
|
321
|
+
RoleSchema,
|
|
322
|
+
CreateRoleSchema,
|
|
323
|
+
UpdateRoleSchema,
|
|
324
|
+
UpdateRolePermissionsSchema,
|
|
325
|
+
RoleSuccessSchema,
|
|
326
|
+
type RoleDataType,
|
|
327
|
+
type CreateRoleType,
|
|
328
|
+
type UpdateRoleType,
|
|
329
|
+
} from '../modules/role'
|
|
258
330
|
export type { DeveloperProfile as User } from '../modules/auth'
|