@goplusvn/core 0.1.47 → 0.1.49
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/package.json +1 -1
- package/src/crud/__tests__/filter-tree.test.ts +124 -0
- package/src/crud/lib/filter-tree.ts +150 -0
- package/src/crud/server-service.ts +14 -0
- package/src/crud/server.ts +1 -0
- package/src/rbac/pages/action-list-page.tsx +181 -256
- package/src/rbac/pages/index.ts +5 -0
- package/src/rbac/pages/lib/action-api.ts +38 -0
- package/src/rbac/pages/lib/group-taxonomy.ts +110 -0
- package/src/rbac/pages/lib/rbac-page-shell.tsx +148 -0
- package/src/rbac/pages/resource-list-page.tsx +350 -499
- package/src/schemas/branch.schema.ts +35 -0
- package/src/schemas/user.schema.ts +2 -0
- package/src/schemas/warehouse.schema.ts +2 -0
- package/src/types/index.ts +2 -0
- package/src/user/components/unified-profile-dialog.tsx +81 -81
- package/src/user/components/users-card-view.tsx +12 -12
|
@@ -44,6 +44,41 @@ export const branchSchema = z.object({
|
|
|
44
44
|
.nullable()
|
|
45
45
|
.or(z.literal("")),
|
|
46
46
|
|
|
47
|
+
position: z
|
|
48
|
+
.string()
|
|
49
|
+
.max(255, "Chức vụ tối đa 255 ký tự")
|
|
50
|
+
.trim()
|
|
51
|
+
.optional()
|
|
52
|
+
.nullable(),
|
|
53
|
+
|
|
54
|
+
representativePhone: z
|
|
55
|
+
.string()
|
|
56
|
+
.max(20, "Số điện thoại tối đa 20 ký tự")
|
|
57
|
+
.trim()
|
|
58
|
+
.optional()
|
|
59
|
+
.nullable(),
|
|
60
|
+
|
|
61
|
+
citizenId: z
|
|
62
|
+
.string()
|
|
63
|
+
.max(50, "Số CCCD tối đa 50 ký tự")
|
|
64
|
+
.trim()
|
|
65
|
+
.optional()
|
|
66
|
+
.nullable(),
|
|
67
|
+
|
|
68
|
+
taxCode: z
|
|
69
|
+
.string()
|
|
70
|
+
.max(50, "Mã số thuế tối đa 50 ký tự")
|
|
71
|
+
.trim()
|
|
72
|
+
.optional()
|
|
73
|
+
.nullable(),
|
|
74
|
+
|
|
75
|
+
bankAccount: z
|
|
76
|
+
.string()
|
|
77
|
+
.max(255, "Số tài khoản tối đa 255 ký tự")
|
|
78
|
+
.trim()
|
|
79
|
+
.optional()
|
|
80
|
+
.nullable(),
|
|
81
|
+
|
|
47
82
|
status: z.enum(["active", "inactive"]).default("active"),
|
|
48
83
|
});
|
|
49
84
|
|
|
@@ -3,6 +3,8 @@ import { z } from "zod";
|
|
|
3
3
|
export const userSchema = z.object({
|
|
4
4
|
name: z.string().min(1, "Tên hiển thị là bắt buộc"),
|
|
5
5
|
email: z.string().email("Email không hợp lệ"),
|
|
6
|
+
phoneNumber: z.string().optional(),
|
|
7
|
+
address: z.string().optional(),
|
|
6
8
|
// Support both boolean and status string, normalize to boolean
|
|
7
9
|
isActive: z.preprocess((val) => {
|
|
8
10
|
if (typeof val === "boolean") return val;
|
|
@@ -32,6 +32,8 @@ export const warehouseSchema = z.object({
|
|
|
32
32
|
.or(z.literal(""))
|
|
33
33
|
.transform((val) => val || ""),
|
|
34
34
|
|
|
35
|
+
branchId: z.string().optional(),
|
|
36
|
+
|
|
35
37
|
status: z.preprocess((val) => {
|
|
36
38
|
// Hỗ trợ boolean từ switch field (true -> active, false -> inactive)
|
|
37
39
|
if (typeof val === "boolean") {
|
package/src/types/index.ts
CHANGED
|
@@ -621,6 +621,8 @@ export interface CrudQueryParams {
|
|
|
621
621
|
search?: string;
|
|
622
622
|
sort?: SortingState;
|
|
623
623
|
filters?: ActiveFilter[];
|
|
624
|
+
/** Bộ lọc nâng cao dạng cây $and/$or — xem crud/lib/filter-tree. */
|
|
625
|
+
filterTree?: import("../crud/lib/filter-tree").FilterTreeNode;
|
|
624
626
|
}
|
|
625
627
|
|
|
626
628
|
export interface CrudResponse<T = unknown> {
|