@devx-retailos/cms 0.0.1
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/.medusa/server/src/admin/index.js +23 -0
- package/.medusa/server/src/admin/index.mjs +24 -0
- package/.medusa/server/src/api/admin/retailos/cms/accumulation/[storeId]/route.js +34 -0
- package/.medusa/server/src/api/admin/retailos/cms/export/route.js +52 -0
- package/.medusa/server/src/api/admin/retailos/cms/handovers/[id]/route.js +35 -0
- package/.medusa/server/src/api/admin/retailos/cms/handovers/route.js +78 -0
- package/.medusa/server/src/api/admin/retailos/cms/operation/route.js +124 -0
- package/.medusa/server/src/api/admin/retailos/cms/petty-cash/route.js +31 -0
- package/.medusa/server/src/api/admin/retailos/cms/shift-logs/route.js +36 -0
- package/.medusa/server/src/links/employee-to-cms-handover.js +13 -0
- package/.medusa/server/src/links/store-to-cms-handover.js +13 -0
- package/.medusa/server/src/modules/cms/constants.js +5 -0
- package/.medusa/server/src/modules/cms/index.js +53 -0
- package/.medusa/server/src/modules/cms/migrations/Migration20260622000000.js +30 -0
- package/.medusa/server/src/modules/cms/migrations/Migration20260622000001.js +16 -0
- package/.medusa/server/src/modules/cms/models/cms-accumulation.js +11 -0
- package/.medusa/server/src/modules/cms/models/cms-handover.js +17 -0
- package/.medusa/server/src/modules/cms/models/index.js +15 -0
- package/.medusa/server/src/modules/cms/models/petty-cash-transaction.js +24 -0
- package/.medusa/server/src/modules/cms/models/petty-cash.js +11 -0
- package/.medusa/server/src/modules/cms/permissions.js +36 -0
- package/.medusa/server/src/modules/cms/services/cms-module-service.js +210 -0
- package/.medusa/server/src/modules/cms/services/index.js +9 -0
- package/README.md +155 -0
- package/package.json +60 -0
- package/src/admin/.gitkeep +0 -0
- package/src/api/admin/retailos/cms/accumulation/[storeId]/__tests__/route.test.ts +68 -0
- package/src/api/admin/retailos/cms/accumulation/[storeId]/route.ts +35 -0
- package/src/api/admin/retailos/cms/export/__tests__/route.test.ts +126 -0
- package/src/api/admin/retailos/cms/export/route.ts +58 -0
- package/src/api/admin/retailos/cms/handovers/[id]/__tests__/route.test.ts +68 -0
- package/src/api/admin/retailos/cms/handovers/[id]/route.ts +36 -0
- package/src/api/admin/retailos/cms/handovers/__tests__/route.test.ts +104 -0
- package/src/api/admin/retailos/cms/handovers/route.ts +79 -0
- package/src/api/admin/retailos/cms/operation/__tests__/route.test.ts +169 -0
- package/src/api/admin/retailos/cms/operation/route.ts +130 -0
- package/src/api/admin/retailos/cms/petty-cash/__tests__/route.test.ts +73 -0
- package/src/api/admin/retailos/cms/petty-cash/route.ts +35 -0
- package/src/api/admin/retailos/cms/shift-logs/__tests__/route.test.ts +77 -0
- package/src/api/admin/retailos/cms/shift-logs/route.ts +38 -0
- package/src/links/employee-to-cms-handover.ts +11 -0
- package/src/links/store-to-cms-handover.ts +11 -0
- package/src/modules/cms/__tests__/cms-module-service.test.ts +333 -0
- package/src/modules/cms/__tests__/permissions.test.ts +36 -0
- package/src/modules/cms/constants.ts +1 -0
- package/src/modules/cms/index.ts +24 -0
- package/src/modules/cms/migrations/Migration20260622000000.ts +58 -0
- package/src/modules/cms/migrations/Migration20260622000001.ts +17 -0
- package/src/modules/cms/models/cms-accumulation.ts +10 -0
- package/src/modules/cms/models/cms-handover.ts +16 -0
- package/src/modules/cms/models/index.ts +4 -0
- package/src/modules/cms/models/petty-cash-transaction.ts +23 -0
- package/src/modules/cms/models/petty-cash.ts +10 -0
- package/src/modules/cms/permissions.ts +34 -0
- package/src/modules/cms/services/cms-module-service.ts +284 -0
- package/src/modules/cms/services/index.ts +13 -0
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
AuthenticatedMedusaRequest,
|
|
3
|
+
MedusaResponse,
|
|
4
|
+
} from "@medusajs/framework"
|
|
5
|
+
import { z } from "zod"
|
|
6
|
+
import { CMS_MODULE } from "../../../../../modules/cms/constants"
|
|
7
|
+
import type CmsModuleService from "../../../../../modules/cms/services/cms-module-service"
|
|
8
|
+
|
|
9
|
+
const OPERATIONS = ["day_start", "day_end", "handover", "add_petty_cash", "add_expense"] as const
|
|
10
|
+
type Operation = typeof OPERATIONS[number]
|
|
11
|
+
|
|
12
|
+
const operationSchema = z.object({
|
|
13
|
+
operation: z.enum(OPERATIONS),
|
|
14
|
+
store_id: z.string().min(1),
|
|
15
|
+
employee_id: z.string().min(1),
|
|
16
|
+
opening_amount: z.number().nonnegative().optional(),
|
|
17
|
+
closing_amount: z.number().nonnegative().optional(),
|
|
18
|
+
handover_id: z.string().nullable().optional(),
|
|
19
|
+
handover_amount: z.number().nonnegative().optional(),
|
|
20
|
+
total_cash: z.number().nullable().optional(),
|
|
21
|
+
type: z.enum(["DB", "CR"]).nullable().optional(),
|
|
22
|
+
image_url: z.string().nullable().optional(),
|
|
23
|
+
remark: z.string().nullable().optional(),
|
|
24
|
+
amount: z.number().positive().optional(),
|
|
25
|
+
source: z.enum(["self", "from_petty_cash"]).nullable().optional(),
|
|
26
|
+
category: z.string().nullable().optional(),
|
|
27
|
+
sub_category: z.string().nullable().optional(),
|
|
28
|
+
reason: z.string().nullable().optional(),
|
|
29
|
+
metadata: z.record(z.string(), z.unknown()).nullable().optional(),
|
|
30
|
+
})
|
|
31
|
+
|
|
32
|
+
function getService(req: AuthenticatedMedusaRequest): CmsModuleService {
|
|
33
|
+
return (req as any).scope.resolve(CMS_MODULE)
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
function getLogger(req: AuthenticatedMedusaRequest) {
|
|
37
|
+
try {
|
|
38
|
+
return (req as any).scope.resolve("logger")
|
|
39
|
+
} catch {
|
|
40
|
+
return { info: () => {}, warn: () => {}, error: () => {}, debug: () => {} }
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export const POST = async (req: AuthenticatedMedusaRequest, res: MedusaResponse) => {
|
|
45
|
+
const parsed = operationSchema.safeParse(req.body)
|
|
46
|
+
if (!parsed.success) {
|
|
47
|
+
return res.status(400).json({
|
|
48
|
+
code: "BAD_REQUEST",
|
|
49
|
+
message: "Invalid operation input",
|
|
50
|
+
details: parsed.error.flatten(),
|
|
51
|
+
})
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
const data = parsed.data
|
|
55
|
+
const service = getService(req)
|
|
56
|
+
const logger = getLogger(req)
|
|
57
|
+
|
|
58
|
+
try {
|
|
59
|
+
switch (data.operation as Operation) {
|
|
60
|
+
case "day_start": {
|
|
61
|
+
if (data.opening_amount == null) {
|
|
62
|
+
return res.status(400).json({ code: "BAD_REQUEST", message: "opening_amount is required for day_start" })
|
|
63
|
+
}
|
|
64
|
+
await service.dayStart({ store_id: data.store_id, employee_id: data.employee_id, opening_amount: data.opening_amount })
|
|
65
|
+
return res.status(200).json({ operation: "day_start", store_id: data.store_id })
|
|
66
|
+
}
|
|
67
|
+
case "day_end": {
|
|
68
|
+
if (data.closing_amount == null) {
|
|
69
|
+
return res.status(400).json({ code: "BAD_REQUEST", message: "closing_amount is required for day_end" })
|
|
70
|
+
}
|
|
71
|
+
await service.dayEnd({ store_id: data.store_id, employee_id: data.employee_id, closing_amount: data.closing_amount })
|
|
72
|
+
return res.status(200).json({ operation: "day_end", store_id: data.store_id })
|
|
73
|
+
}
|
|
74
|
+
case "handover": {
|
|
75
|
+
if (data.handover_amount == null) {
|
|
76
|
+
return res.status(400).json({ code: "BAD_REQUEST", message: "handover_amount is required for handover" })
|
|
77
|
+
}
|
|
78
|
+
const handover = await service.handover({
|
|
79
|
+
store_id: data.store_id,
|
|
80
|
+
employee_id: data.employee_id,
|
|
81
|
+
handover_id: data.handover_id ?? null,
|
|
82
|
+
handover_amount: data.handover_amount,
|
|
83
|
+
total_cash: data.total_cash ?? null,
|
|
84
|
+
type: data.type ?? null,
|
|
85
|
+
image_url: data.image_url ?? null,
|
|
86
|
+
remark: data.remark ?? null,
|
|
87
|
+
metadata: data.metadata ?? null,
|
|
88
|
+
})
|
|
89
|
+
return res.status(201).json({ operation: "handover", handover })
|
|
90
|
+
}
|
|
91
|
+
case "add_petty_cash": {
|
|
92
|
+
if (data.amount == null) {
|
|
93
|
+
return res.status(400).json({ code: "BAD_REQUEST", message: "amount is required for add_petty_cash" })
|
|
94
|
+
}
|
|
95
|
+
const tx = await service.addPettyCash({
|
|
96
|
+
store_id: data.store_id,
|
|
97
|
+
employee_id: data.employee_id,
|
|
98
|
+
amount: data.amount,
|
|
99
|
+
source: data.source ?? null,
|
|
100
|
+
})
|
|
101
|
+
return res.status(201).json({ operation: "add_petty_cash", transaction: tx })
|
|
102
|
+
}
|
|
103
|
+
case "add_expense": {
|
|
104
|
+
if (data.amount == null) {
|
|
105
|
+
return res.status(400).json({ code: "BAD_REQUEST", message: "amount is required for add_expense" })
|
|
106
|
+
}
|
|
107
|
+
const tx = await service.addExpense({
|
|
108
|
+
store_id: data.store_id,
|
|
109
|
+
employee_id: data.employee_id,
|
|
110
|
+
amount: data.amount,
|
|
111
|
+
category: data.category ?? null,
|
|
112
|
+
sub_category: data.sub_category ?? null,
|
|
113
|
+
reason: data.reason ?? null,
|
|
114
|
+
image_url: data.image_url ?? null,
|
|
115
|
+
metadata: data.metadata ?? null,
|
|
116
|
+
})
|
|
117
|
+
return res.status(201).json({ operation: "add_expense", transaction: tx })
|
|
118
|
+
}
|
|
119
|
+
default:
|
|
120
|
+
return res.status(400).json({ code: "BAD_REQUEST", message: "Unknown operation" })
|
|
121
|
+
}
|
|
122
|
+
} catch (err) {
|
|
123
|
+
logger.error("[retailos/cms] operation failed", {
|
|
124
|
+
operation: data.operation,
|
|
125
|
+
store_id: data.store_id,
|
|
126
|
+
error: err instanceof Error ? err.message : String(err),
|
|
127
|
+
})
|
|
128
|
+
return res.status(500).json({ code: "INTERNAL_ERROR", message: (err as Error).message })
|
|
129
|
+
}
|
|
130
|
+
}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { describe, it, expect, vi } from "vitest"
|
|
2
|
+
import { GET } from "../route"
|
|
3
|
+
|
|
4
|
+
function makeService() {
|
|
5
|
+
return {
|
|
6
|
+
listAndCountPettyCashTransactions: vi.fn().mockResolvedValue([[], 0]),
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
function makeReq(filterableFields: Record<string, unknown> = {}, service = makeService()) {
|
|
11
|
+
return {
|
|
12
|
+
filterableFields,
|
|
13
|
+
scope: {
|
|
14
|
+
resolve: vi.fn().mockImplementation((key: string) => {
|
|
15
|
+
if (key === "cms") return service
|
|
16
|
+
throw new Error("not found")
|
|
17
|
+
}),
|
|
18
|
+
},
|
|
19
|
+
_service: service,
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
function makeRes() {
|
|
24
|
+
return {
|
|
25
|
+
status: vi.fn().mockReturnThis(),
|
|
26
|
+
json: vi.fn().mockReturnThis(),
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
describe("GET /petty-cash", () => {
|
|
31
|
+
it("returns transactions and count", async () => {
|
|
32
|
+
const service = makeService()
|
|
33
|
+
const transactions = [{ id: "pct_1" }, { id: "pct_2" }]
|
|
34
|
+
service.listAndCountPettyCashTransactions.mockResolvedValue([transactions, 2])
|
|
35
|
+
const req = makeReq({}, service)
|
|
36
|
+
const res = makeRes()
|
|
37
|
+
|
|
38
|
+
await GET(req as any, res as any)
|
|
39
|
+
|
|
40
|
+
expect(service.listAndCountPettyCashTransactions).toHaveBeenCalledWith(
|
|
41
|
+
expect.objectContaining({ transaction_type: ["open", "close", "petty_cash"] }),
|
|
42
|
+
expect.objectContaining({ take: 100 })
|
|
43
|
+
)
|
|
44
|
+
expect(res.status).toHaveBeenCalledWith(200)
|
|
45
|
+
expect(res.json).toHaveBeenCalledWith({ transactions, count: 2 })
|
|
46
|
+
})
|
|
47
|
+
|
|
48
|
+
it("merges filterableFields with transaction_type filter", async () => {
|
|
49
|
+
const service = makeService()
|
|
50
|
+
service.listAndCountPettyCashTransactions.mockResolvedValue([[], 0])
|
|
51
|
+
const req = makeReq({ store_id: ["s1"] }, service)
|
|
52
|
+
const res = makeRes()
|
|
53
|
+
|
|
54
|
+
await GET(req as any, res as any)
|
|
55
|
+
|
|
56
|
+
expect(service.listAndCountPettyCashTransactions).toHaveBeenCalledWith(
|
|
57
|
+
expect.objectContaining({ store_id: ["s1"], transaction_type: ["open", "close", "petty_cash"] }),
|
|
58
|
+
expect.any(Object)
|
|
59
|
+
)
|
|
60
|
+
})
|
|
61
|
+
|
|
62
|
+
it("returns 500 when service throws", async () => {
|
|
63
|
+
const service = makeService()
|
|
64
|
+
service.listAndCountPettyCashTransactions.mockRejectedValue(new Error("db error"))
|
|
65
|
+
const req = makeReq({}, service)
|
|
66
|
+
const res = makeRes()
|
|
67
|
+
|
|
68
|
+
await GET(req as any, res as any)
|
|
69
|
+
|
|
70
|
+
expect(res.status).toHaveBeenCalledWith(500)
|
|
71
|
+
expect(res.json).toHaveBeenCalledWith(expect.objectContaining({ code: "INTERNAL_ERROR" }))
|
|
72
|
+
})
|
|
73
|
+
})
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
AuthenticatedMedusaRequest,
|
|
3
|
+
MedusaResponse,
|
|
4
|
+
} from "@medusajs/framework"
|
|
5
|
+
import { CMS_MODULE } from "../../../../../modules/cms/constants"
|
|
6
|
+
import type CmsModuleService from "../../../../../modules/cms/services/cms-module-service"
|
|
7
|
+
|
|
8
|
+
function getService(req: AuthenticatedMedusaRequest): CmsModuleService {
|
|
9
|
+
return (req as any).scope.resolve(CMS_MODULE)
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
function getLogger(req: AuthenticatedMedusaRequest) {
|
|
13
|
+
try {
|
|
14
|
+
return (req as any).scope.resolve("logger")
|
|
15
|
+
} catch {
|
|
16
|
+
return { info: () => {}, warn: () => {}, error: () => {}, debug: () => {} }
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export const GET = async (req: AuthenticatedMedusaRequest, res: MedusaResponse) => {
|
|
21
|
+
try {
|
|
22
|
+
const service = getService(req)
|
|
23
|
+
const filters = (req.filterableFields ?? {}) as Record<string, unknown>
|
|
24
|
+
const [transactions, count] = await service.listAndCountPettyCashTransactions(
|
|
25
|
+
{ ...filters, transaction_type: ["open", "close", "petty_cash"] },
|
|
26
|
+
{ take: 100, order: { created_at: "DESC" } }
|
|
27
|
+
)
|
|
28
|
+
return res.status(200).json({ transactions, count })
|
|
29
|
+
} catch (err) {
|
|
30
|
+
getLogger(req).error("[retailos/cms] list petty cash failed", {
|
|
31
|
+
error: err instanceof Error ? err.message : String(err),
|
|
32
|
+
})
|
|
33
|
+
return res.status(500).json({ code: "INTERNAL_ERROR", message: (err as Error).message })
|
|
34
|
+
}
|
|
35
|
+
}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { describe, it, expect, vi } from "vitest"
|
|
2
|
+
import { GET } from "../route"
|
|
3
|
+
|
|
4
|
+
function makeService() {
|
|
5
|
+
return {
|
|
6
|
+
getShiftLogs: vi.fn().mockResolvedValue([]),
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
function makeReq(query: Record<string, string> = {}, service = makeService()) {
|
|
11
|
+
return {
|
|
12
|
+
query,
|
|
13
|
+
scope: {
|
|
14
|
+
resolve: vi.fn().mockImplementation((key: string) => {
|
|
15
|
+
if (key === "cms") return service
|
|
16
|
+
throw new Error("not found")
|
|
17
|
+
}),
|
|
18
|
+
},
|
|
19
|
+
_service: service,
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
function makeRes() {
|
|
24
|
+
return {
|
|
25
|
+
status: vi.fn().mockReturnThis(),
|
|
26
|
+
json: vi.fn().mockReturnThis(),
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
describe("GET /shift-logs", () => {
|
|
31
|
+
it("returns shift logs with count", async () => {
|
|
32
|
+
const service = makeService()
|
|
33
|
+
const logs = [{ id: "pct_1", transaction_type: "open" }, { id: "pct_2", transaction_type: "close" }]
|
|
34
|
+
service.getShiftLogs.mockResolvedValue(logs)
|
|
35
|
+
const req = makeReq({}, service)
|
|
36
|
+
const res = makeRes()
|
|
37
|
+
|
|
38
|
+
await GET(req as any, res as any)
|
|
39
|
+
|
|
40
|
+
expect(res.status).toHaveBeenCalledWith(200)
|
|
41
|
+
expect(res.json).toHaveBeenCalledWith({ shift_logs: logs, count: 2 })
|
|
42
|
+
})
|
|
43
|
+
|
|
44
|
+
it("passes store_id and limit to service", async () => {
|
|
45
|
+
const service = makeService()
|
|
46
|
+
service.getShiftLogs.mockResolvedValue([])
|
|
47
|
+
const req = makeReq({ store_id: "s1", limit: "20" }, service)
|
|
48
|
+
const res = makeRes()
|
|
49
|
+
|
|
50
|
+
await GET(req as any, res as any)
|
|
51
|
+
|
|
52
|
+
expect(service.getShiftLogs).toHaveBeenCalledWith({ store_id: "s1", limit: 20 })
|
|
53
|
+
})
|
|
54
|
+
|
|
55
|
+
it("defaults limit to 50 when not provided", async () => {
|
|
56
|
+
const service = makeService()
|
|
57
|
+
service.getShiftLogs.mockResolvedValue([])
|
|
58
|
+
const req = makeReq({}, service)
|
|
59
|
+
const res = makeRes()
|
|
60
|
+
|
|
61
|
+
await GET(req as any, res as any)
|
|
62
|
+
|
|
63
|
+
expect(service.getShiftLogs).toHaveBeenCalledWith({ store_id: undefined, limit: 50 })
|
|
64
|
+
})
|
|
65
|
+
|
|
66
|
+
it("returns 500 when service throws", async () => {
|
|
67
|
+
const service = makeService()
|
|
68
|
+
service.getShiftLogs.mockRejectedValue(new Error("db error"))
|
|
69
|
+
const req = makeReq({}, service)
|
|
70
|
+
const res = makeRes()
|
|
71
|
+
|
|
72
|
+
await GET(req as any, res as any)
|
|
73
|
+
|
|
74
|
+
expect(res.status).toHaveBeenCalledWith(500)
|
|
75
|
+
expect(res.json).toHaveBeenCalledWith(expect.objectContaining({ code: "INTERNAL_ERROR" }))
|
|
76
|
+
})
|
|
77
|
+
})
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
AuthenticatedMedusaRequest,
|
|
3
|
+
MedusaResponse,
|
|
4
|
+
} from "@medusajs/framework"
|
|
5
|
+
import { CMS_MODULE } from "../../../../../modules/cms/constants"
|
|
6
|
+
import type CmsModuleService from "../../../../../modules/cms/services/cms-module-service"
|
|
7
|
+
|
|
8
|
+
function getService(req: AuthenticatedMedusaRequest): CmsModuleService {
|
|
9
|
+
return (req as any).scope.resolve(CMS_MODULE)
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
function getLogger(req: AuthenticatedMedusaRequest) {
|
|
13
|
+
try {
|
|
14
|
+
return (req as any).scope.resolve("logger")
|
|
15
|
+
} catch {
|
|
16
|
+
return { info: () => {}, warn: () => {}, error: () => {}, debug: () => {} }
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export const GET = async (req: AuthenticatedMedusaRequest, res: MedusaResponse) => {
|
|
21
|
+
const query = req.query as Record<string, string>
|
|
22
|
+
const store_id = query.store_id
|
|
23
|
+
const limit = query.limit ? Number(query.limit) : 50
|
|
24
|
+
|
|
25
|
+
try {
|
|
26
|
+
const service = getService(req)
|
|
27
|
+
const logs = await service.getShiftLogs({
|
|
28
|
+
store_id: store_id || undefined,
|
|
29
|
+
limit,
|
|
30
|
+
})
|
|
31
|
+
return res.status(200).json({ shift_logs: logs, count: logs.length })
|
|
32
|
+
} catch (err) {
|
|
33
|
+
getLogger(req).error("[retailos/cms] list shift logs failed", {
|
|
34
|
+
error: err instanceof Error ? err.message : String(err),
|
|
35
|
+
})
|
|
36
|
+
return res.status(500).json({ code: "INTERNAL_ERROR", message: (err as Error).message })
|
|
37
|
+
}
|
|
38
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { defineLink } from "@medusajs/framework/utils"
|
|
2
|
+
import EmployeeModule from "@devx-retailos/employee"
|
|
3
|
+
import CmsModule from "../modules/cms"
|
|
4
|
+
|
|
5
|
+
export default defineLink(
|
|
6
|
+
(EmployeeModule as any).linkable.retailosEmployee,
|
|
7
|
+
{
|
|
8
|
+
linkable: (CmsModule as any).linkable.retailosCmsHandover,
|
|
9
|
+
isList: true,
|
|
10
|
+
}
|
|
11
|
+
)
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { defineLink } from "@medusajs/framework/utils"
|
|
2
|
+
import RbacModule from "@devx-retailos/rbac"
|
|
3
|
+
import CmsModule from "../modules/cms"
|
|
4
|
+
|
|
5
|
+
export default defineLink(
|
|
6
|
+
(RbacModule as any).linkable.retailosStore,
|
|
7
|
+
{
|
|
8
|
+
linkable: (CmsModule as any).linkable.retailosCmsHandover,
|
|
9
|
+
isList: true,
|
|
10
|
+
}
|
|
11
|
+
)
|