@mercurjs/commission 1.3.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/.medusa/server/src/admin/index.js +20 -0
- package/.medusa/server/src/admin/index.mjs +21 -0
- package/.medusa/server/src/api/admin/commission/commission-lines/route.d.ts +75 -0
- package/.medusa/server/src/api/admin/commission/commission-lines/route.js +95 -0
- package/.medusa/server/src/api/admin/commission/default/route.d.ts +53 -0
- package/.medusa/server/src/api/admin/commission/default/route.js +103 -0
- package/.medusa/server/src/api/admin/commission/middlewares.d.ts +2 -0
- package/.medusa/server/src/api/admin/commission/middlewares.js +44 -0
- package/.medusa/server/src/api/admin/commission/query-config.d.ts +21 -0
- package/.medusa/server/src/api/admin/commission/query-config.js +35 -0
- package/.medusa/server/src/api/admin/commission/rules/[id]/route.d.ts +104 -0
- package/.medusa/server/src/api/admin/commission/rules/[id]/route.js +149 -0
- package/.medusa/server/src/api/admin/commission/rules/route.d.ts +78 -0
- package/.medusa/server/src/api/admin/commission/rules/route.js +114 -0
- package/.medusa/server/src/api/admin/commission/search/route.d.ts +2 -0
- package/.medusa/server/src/api/admin/commission/search/route.js +25 -0
- package/.medusa/server/src/api/admin/commission/validators.d.ts +456 -0
- package/.medusa/server/src/api/admin/commission/validators.js +108 -0
- package/.medusa/server/src/api/admin/middlewares.d.ts +2 -0
- package/.medusa/server/src/api/admin/middlewares.js +6 -0
- package/.medusa/server/src/api/middlewares.d.ts +2 -0
- package/.medusa/server/src/api/middlewares.js +9 -0
- package/.medusa/server/src/api/vendor/commission/middlewares.d.ts +2 -0
- package/.medusa/server/src/api/vendor/commission/middlewares.js +16 -0
- package/.medusa/server/src/api/vendor/commission/query-config.d.ts +10 -0
- package/.medusa/server/src/api/vendor/commission/query-config.js +14 -0
- package/.medusa/server/src/api/vendor/commission/route.d.ts +84 -0
- package/.medusa/server/src/api/vendor/commission/route.js +111 -0
- package/.medusa/server/src/api/vendor/commission/validators.d.ts +27 -0
- package/.medusa/server/src/api/vendor/commission/validators.js +13 -0
- package/.medusa/server/src/api/vendor/middlewares.d.ts +2 -0
- package/.medusa/server/src/api/vendor/middlewares.js +10 -0
- package/.medusa/server/src/api/vendor/orders/[id]/commission/route.d.ts +3 -0
- package/.medusa/server/src/api/vendor/orders/[id]/commission/route.js +15 -0
- package/.medusa/server/src/api/vendor/orders/middlewares.d.ts +2 -0
- package/.medusa/server/src/api/vendor/orders/middlewares.js +17 -0
- package/.medusa/server/src/modules/commission/index.d.ts +50 -0
- package/.medusa/server/src/modules/commission/index.js +14 -0
- package/.medusa/server/src/modules/commission/migrations/Migration20250124152358.d.ts +5 -0
- package/.medusa/server/src/modules/commission/migrations/Migration20250124152358.js +25 -0
- package/.medusa/server/src/modules/commission/migrations/Migration20250127073504.d.ts +5 -0
- package/.medusa/server/src/modules/commission/migrations/Migration20250127073504.js +28 -0
- package/.medusa/server/src/modules/commission/models/commission_line.d.ts +7 -0
- package/.medusa/server/src/modules/commission/models/commission_line.js +12 -0
- package/.medusa/server/src/modules/commission/models/commission_rate.d.ts +24 -0
- package/.medusa/server/src/modules/commission/models/commission_rate.js +20 -0
- package/.medusa/server/src/modules/commission/models/commission_rule.d.ts +17 -0
- package/.medusa/server/src/modules/commission/models/commission_rule.js +16 -0
- package/.medusa/server/src/modules/commission/models/index.d.ts +3 -0
- package/.medusa/server/src/modules/commission/models/index.js +20 -0
- package/.medusa/server/src/modules/commission/service.d.ts +61 -0
- package/.medusa/server/src/modules/commission/service.js +45 -0
- package/.medusa/server/src/subscribers/commission-order-set-placed.d.ts +5 -0
- package/.medusa/server/src/subscribers/commission-order-set-placed.js +44 -0
- package/.medusa/server/src/workflows/commission/index.d.ts +2 -0
- package/.medusa/server/src/workflows/commission/index.js +19 -0
- package/.medusa/server/src/workflows/commission/steps/calculate-commission-lines.d.ts +7 -0
- package/.medusa/server/src/workflows/commission/steps/calculate-commission-lines.js +81 -0
- package/.medusa/server/src/workflows/commission/steps/check-for-duplicate.d.ts +2 -0
- package/.medusa/server/src/workflows/commission/steps/check-for-duplicate.js +19 -0
- package/.medusa/server/src/workflows/commission/steps/create-commission-lines.d.ts +22 -0
- package/.medusa/server/src/workflows/commission/steps/create-commission-lines.js +12 -0
- package/.medusa/server/src/workflows/commission/steps/create-commission-rule.d.ts +2 -0
- package/.medusa/server/src/workflows/commission/steps/create-commission-rule.js +40 -0
- package/.medusa/server/src/workflows/commission/steps/delete-commission-rule.d.ts +1 -0
- package/.medusa/server/src/workflows/commission/steps/delete-commission-rule.js +14 -0
- package/.medusa/server/src/workflows/commission/steps/find-commission-references.d.ts +10 -0
- package/.medusa/server/src/workflows/commission/steps/find-commission-references.js +40 -0
- package/.medusa/server/src/workflows/commission/steps/find-commission-rules.d.ts +10 -0
- package/.medusa/server/src/workflows/commission/steps/find-commission-rules.js +81 -0
- package/.medusa/server/src/workflows/commission/steps/index.d.ts +10 -0
- package/.medusa/server/src/workflows/commission/steps/index.js +27 -0
- package/.medusa/server/src/workflows/commission/steps/list-commission-lines.d.ts +27 -0
- package/.medusa/server/src/workflows/commission/steps/list-commission-lines.js +72 -0
- package/.medusa/server/src/workflows/commission/steps/list-order-commission-lines.d.ts +10 -0
- package/.medusa/server/src/workflows/commission/steps/list-order-commission-lines.js +31 -0
- package/.medusa/server/src/workflows/commission/steps/update-commission-rule.d.ts +50 -0
- package/.medusa/server/src/workflows/commission/steps/update-commission-rule.js +17 -0
- package/.medusa/server/src/workflows/commission/workflows/calculate-commission.d.ts +26 -0
- package/.medusa/server/src/workflows/commission/workflows/calculate-commission.js +11 -0
- package/.medusa/server/src/workflows/commission/workflows/create-commission-rule.d.ts +4 -0
- package/.medusa/server/src/workflows/commission/workflows/create-commission-rule.js +16 -0
- package/.medusa/server/src/workflows/commission/workflows/delete-commission-rule.d.ts +3 -0
- package/.medusa/server/src/workflows/commission/workflows/delete-commission-rule.js +15 -0
- package/.medusa/server/src/workflows/commission/workflows/index.d.ts +8 -0
- package/.medusa/server/src/workflows/commission/workflows/index.js +25 -0
- package/.medusa/server/src/workflows/commission/workflows/list-commission-lines.d.ts +27 -0
- package/.medusa/server/src/workflows/commission/workflows/list-commission-lines.js +9 -0
- package/.medusa/server/src/workflows/commission/workflows/list-commission-rules.d.ts +12 -0
- package/.medusa/server/src/workflows/commission/workflows/list-commission-rules.js +47 -0
- package/.medusa/server/src/workflows/commission/workflows/list-order-commission-lines.d.ts +9 -0
- package/.medusa/server/src/workflows/commission/workflows/list-order-commission-lines.js +9 -0
- package/.medusa/server/src/workflows/commission/workflows/update-commission-rule.d.ts +51 -0
- package/.medusa/server/src/workflows/commission/workflows/update-commission-rule.js +9 -0
- package/.medusa/server/src/workflows/commission/workflows/upsert-default-commission-rule.d.ts +2 -0
- package/.medusa/server/src/workflows/commission/workflows/upsert-default-commission-rule.js +21 -0
- package/.medusa/server/src/workflows/index.d.ts +1 -0
- package/.medusa/server/src/workflows/index.js +18 -0
- package/README.md +22 -0
- package/package.json +86 -0
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { AuthenticatedMedusaRequest, MedusaResponse } from "@medusajs/framework";
|
|
2
|
+
/**
|
|
3
|
+
* @oas [get] /vendor/commission
|
|
4
|
+
* operationId: "VendorListCommissionLines"
|
|
5
|
+
* summary: "List Commission Lines"
|
|
6
|
+
* description: "Retrieves a list of commission lines for the authenticated vendor/seller with optional filtering."
|
|
7
|
+
* x-authenticated: true
|
|
8
|
+
* parameters:
|
|
9
|
+
* - name: offset
|
|
10
|
+
* in: query
|
|
11
|
+
* schema:
|
|
12
|
+
* type: number
|
|
13
|
+
* default: 0
|
|
14
|
+
* required: false
|
|
15
|
+
* description: The number of items to skip before starting to collect the result set.
|
|
16
|
+
* - name: limit
|
|
17
|
+
* in: query
|
|
18
|
+
* schema:
|
|
19
|
+
* type: number
|
|
20
|
+
* default: 20
|
|
21
|
+
* required: false
|
|
22
|
+
* description: The number of items to return.
|
|
23
|
+
* - name: start_date
|
|
24
|
+
* in: query
|
|
25
|
+
* schema:
|
|
26
|
+
* type: string
|
|
27
|
+
* format: date-time
|
|
28
|
+
* required: false
|
|
29
|
+
* description: Filter commission lines created on or after this date.
|
|
30
|
+
* - name: end_date
|
|
31
|
+
* in: query
|
|
32
|
+
* schema:
|
|
33
|
+
* type: string
|
|
34
|
+
* format: date-time
|
|
35
|
+
* required: false
|
|
36
|
+
* description: Filter commission lines created on or before this date.
|
|
37
|
+
* responses:
|
|
38
|
+
* "200":
|
|
39
|
+
* description: OK
|
|
40
|
+
* content:
|
|
41
|
+
* application/json:
|
|
42
|
+
* schema:
|
|
43
|
+
* type: object
|
|
44
|
+
* properties:
|
|
45
|
+
* commission_lines:
|
|
46
|
+
* type: array
|
|
47
|
+
* items:
|
|
48
|
+
* $ref: "#/components/schemas/VendorCommissionLine"
|
|
49
|
+
* count:
|
|
50
|
+
* type: integer
|
|
51
|
+
* description: The total number of commission lines available
|
|
52
|
+
* offset:
|
|
53
|
+
* type: integer
|
|
54
|
+
* description: The number of items skipped before these items
|
|
55
|
+
* limit:
|
|
56
|
+
* type: integer
|
|
57
|
+
* description: The number of items per page
|
|
58
|
+
* "401":
|
|
59
|
+
* description: Unauthorized
|
|
60
|
+
* content:
|
|
61
|
+
* application/json:
|
|
62
|
+
* schema:
|
|
63
|
+
* type: object
|
|
64
|
+
* properties:
|
|
65
|
+
* message:
|
|
66
|
+
* type: string
|
|
67
|
+
* example: "Unauthorized"
|
|
68
|
+
* "403":
|
|
69
|
+
* description: Forbidden
|
|
70
|
+
* content:
|
|
71
|
+
* application/json:
|
|
72
|
+
* schema:
|
|
73
|
+
* type: object
|
|
74
|
+
* properties:
|
|
75
|
+
* message:
|
|
76
|
+
* type: string
|
|
77
|
+
* example: "Forbidden"
|
|
78
|
+
* tags:
|
|
79
|
+
* - Vendor Commission
|
|
80
|
+
* security:
|
|
81
|
+
* - api_token: []
|
|
82
|
+
* - cookie_auth: []
|
|
83
|
+
*/
|
|
84
|
+
export declare const GET: (req: AuthenticatedMedusaRequest, res: MedusaResponse) => Promise<void>;
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GET = void 0;
|
|
4
|
+
const framework_1 = require("@mercurjs/framework");
|
|
5
|
+
const workflows_1 = require("../../../workflows/commission/workflows");
|
|
6
|
+
/**
|
|
7
|
+
* @oas [get] /vendor/commission
|
|
8
|
+
* operationId: "VendorListCommissionLines"
|
|
9
|
+
* summary: "List Commission Lines"
|
|
10
|
+
* description: "Retrieves a list of commission lines for the authenticated vendor/seller with optional filtering."
|
|
11
|
+
* x-authenticated: true
|
|
12
|
+
* parameters:
|
|
13
|
+
* - name: offset
|
|
14
|
+
* in: query
|
|
15
|
+
* schema:
|
|
16
|
+
* type: number
|
|
17
|
+
* default: 0
|
|
18
|
+
* required: false
|
|
19
|
+
* description: The number of items to skip before starting to collect the result set.
|
|
20
|
+
* - name: limit
|
|
21
|
+
* in: query
|
|
22
|
+
* schema:
|
|
23
|
+
* type: number
|
|
24
|
+
* default: 20
|
|
25
|
+
* required: false
|
|
26
|
+
* description: The number of items to return.
|
|
27
|
+
* - name: start_date
|
|
28
|
+
* in: query
|
|
29
|
+
* schema:
|
|
30
|
+
* type: string
|
|
31
|
+
* format: date-time
|
|
32
|
+
* required: false
|
|
33
|
+
* description: Filter commission lines created on or after this date.
|
|
34
|
+
* - name: end_date
|
|
35
|
+
* in: query
|
|
36
|
+
* schema:
|
|
37
|
+
* type: string
|
|
38
|
+
* format: date-time
|
|
39
|
+
* required: false
|
|
40
|
+
* description: Filter commission lines created on or before this date.
|
|
41
|
+
* responses:
|
|
42
|
+
* "200":
|
|
43
|
+
* description: OK
|
|
44
|
+
* content:
|
|
45
|
+
* application/json:
|
|
46
|
+
* schema:
|
|
47
|
+
* type: object
|
|
48
|
+
* properties:
|
|
49
|
+
* commission_lines:
|
|
50
|
+
* type: array
|
|
51
|
+
* items:
|
|
52
|
+
* $ref: "#/components/schemas/VendorCommissionLine"
|
|
53
|
+
* count:
|
|
54
|
+
* type: integer
|
|
55
|
+
* description: The total number of commission lines available
|
|
56
|
+
* offset:
|
|
57
|
+
* type: integer
|
|
58
|
+
* description: The number of items skipped before these items
|
|
59
|
+
* limit:
|
|
60
|
+
* type: integer
|
|
61
|
+
* description: The number of items per page
|
|
62
|
+
* "401":
|
|
63
|
+
* description: Unauthorized
|
|
64
|
+
* content:
|
|
65
|
+
* application/json:
|
|
66
|
+
* schema:
|
|
67
|
+
* type: object
|
|
68
|
+
* properties:
|
|
69
|
+
* message:
|
|
70
|
+
* type: string
|
|
71
|
+
* example: "Unauthorized"
|
|
72
|
+
* "403":
|
|
73
|
+
* description: Forbidden
|
|
74
|
+
* content:
|
|
75
|
+
* application/json:
|
|
76
|
+
* schema:
|
|
77
|
+
* type: object
|
|
78
|
+
* properties:
|
|
79
|
+
* message:
|
|
80
|
+
* type: string
|
|
81
|
+
* example: "Forbidden"
|
|
82
|
+
* tags:
|
|
83
|
+
* - Vendor Commission
|
|
84
|
+
* security:
|
|
85
|
+
* - api_token: []
|
|
86
|
+
* - cookie_auth: []
|
|
87
|
+
*/
|
|
88
|
+
const GET = async (req, res) => {
|
|
89
|
+
const seller = await (0, framework_1.fetchSellerByAuthActorId)(req.auth_context.actor_id, req.scope);
|
|
90
|
+
const { result: { lines: commission_lines, count }, } = await (0, workflows_1.listCommissionLinesWorkflow)(req.scope).run({
|
|
91
|
+
input: {
|
|
92
|
+
expand: true,
|
|
93
|
+
pagination: {
|
|
94
|
+
skip: req.queryConfig.pagination.skip,
|
|
95
|
+
take: req.queryConfig.pagination.take || 20,
|
|
96
|
+
},
|
|
97
|
+
filters: {
|
|
98
|
+
...req.filterableFields,
|
|
99
|
+
seller_id: seller.id,
|
|
100
|
+
},
|
|
101
|
+
},
|
|
102
|
+
});
|
|
103
|
+
res.json({
|
|
104
|
+
commission_lines,
|
|
105
|
+
count,
|
|
106
|
+
offset: req.queryConfig.pagination.skip,
|
|
107
|
+
limit: req.queryConfig.pagination.take,
|
|
108
|
+
});
|
|
109
|
+
};
|
|
110
|
+
exports.GET = GET;
|
|
111
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicm91dGUuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi9zcmMvYXBpL3ZlbmRvci9jb21taXNzaW9uL3JvdXRlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztBQUtBLG1EQUErRDtBQUMvRCx1RUFBc0Y7QUFFdEY7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7OztHQWlGRztBQUNJLE1BQU0sR0FBRyxHQUFHLEtBQUssRUFDdEIsR0FBK0IsRUFDL0IsR0FBbUIsRUFDbkIsRUFBRTtJQUNGLE1BQU0sTUFBTSxHQUFHLE1BQU0sSUFBQSxvQ0FBd0IsRUFDM0MsR0FBRyxDQUFDLFlBQVksQ0FBQyxRQUFRLEVBQ3pCLEdBQUcsQ0FBQyxLQUFLLENBQ1YsQ0FBQztJQUVGLE1BQU0sRUFDSixNQUFNLEVBQUUsRUFBRSxLQUFLLEVBQUUsZ0JBQWdCLEVBQUUsS0FBSyxFQUFFLEdBQzNDLEdBQUcsTUFBTSxJQUFBLHVDQUEyQixFQUFDLEdBQUcsQ0FBQyxLQUFLLENBQUMsQ0FBQyxHQUFHLENBQUM7UUFDbkQsS0FBSyxFQUFFO1lBQ0wsTUFBTSxFQUFFLElBQUk7WUFDWixVQUFVLEVBQUU7Z0JBQ1YsSUFBSSxFQUFFLEdBQUcsQ0FBQyxXQUFXLENBQUMsVUFBVSxDQUFDLElBQUk7Z0JBQ3JDLElBQUksRUFBRSxHQUFHLENBQUMsV0FBVyxDQUFDLFVBQVUsQ0FBQyxJQUFJLElBQUksRUFBRTthQUM1QztZQUNELE9BQU8sRUFBRTtnQkFDUCxHQUFHLEdBQUcsQ0FBQyxnQkFBZ0I7Z0JBQ3ZCLFNBQVMsRUFBRSxNQUFNLENBQUMsRUFBRTthQUNyQjtTQUNGO0tBQ0YsQ0FBQyxDQUFDO0lBRUgsR0FBRyxDQUFDLElBQUksQ0FBQztRQUNQLGdCQUFnQjtRQUNoQixLQUFLO1FBQ0wsTUFBTSxFQUFFLEdBQUcsQ0FBQyxXQUFXLENBQUMsVUFBVSxDQUFDLElBQUk7UUFDdkMsS0FBSyxFQUFFLEdBQUcsQ0FBQyxXQUFXLENBQUMsVUFBVSxDQUFDLElBQUk7S0FDdkMsQ0FBQyxDQUFDO0FBQ0wsQ0FBQyxDQUFDO0FBL0JXLFFBQUEsR0FBRyxPQStCZCJ9
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const VendorGetCommissionLinesParams: z.ZodObject<{
|
|
3
|
+
offset: z.ZodEffects<z.ZodDefault<z.ZodOptional<z.ZodNumber>>, number, unknown>;
|
|
4
|
+
limit: z.ZodEffects<z.ZodDefault<z.ZodOptional<z.ZodNumber>>, number, unknown>;
|
|
5
|
+
fields: z.ZodOptional<z.ZodString>;
|
|
6
|
+
order: z.ZodOptional<z.ZodString> | z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
7
|
+
with_deleted: z.ZodEffects<z.ZodOptional<z.ZodBoolean>, boolean | undefined, unknown>;
|
|
8
|
+
start_date: z.ZodOptional<z.ZodDate>;
|
|
9
|
+
end_date: z.ZodOptional<z.ZodDate>;
|
|
10
|
+
}, "strip", z.ZodTypeAny, {
|
|
11
|
+
offset: number;
|
|
12
|
+
limit: number;
|
|
13
|
+
fields?: string | undefined;
|
|
14
|
+
order?: string | undefined;
|
|
15
|
+
with_deleted?: boolean | undefined;
|
|
16
|
+
start_date?: Date | undefined;
|
|
17
|
+
end_date?: Date | undefined;
|
|
18
|
+
}, {
|
|
19
|
+
offset?: unknown;
|
|
20
|
+
limit?: unknown;
|
|
21
|
+
fields?: string | undefined;
|
|
22
|
+
order?: string | undefined;
|
|
23
|
+
with_deleted?: unknown;
|
|
24
|
+
start_date?: Date | undefined;
|
|
25
|
+
end_date?: Date | undefined;
|
|
26
|
+
}>;
|
|
27
|
+
export type VendorGetCommissionLinesParamsType = z.infer<typeof VendorGetCommissionLinesParams>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.VendorGetCommissionLinesParams = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const validators_1 = require("@medusajs/medusa/api/utils/validators");
|
|
6
|
+
exports.VendorGetCommissionLinesParams = (0, validators_1.createFindParams)({
|
|
7
|
+
limit: 15,
|
|
8
|
+
offset: 0
|
|
9
|
+
}).merge(zod_1.z.object({
|
|
10
|
+
start_date: zod_1.z.coerce.date().optional(),
|
|
11
|
+
end_date: zod_1.z.coerce.date().optional()
|
|
12
|
+
}));
|
|
13
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidmFsaWRhdG9ycy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uL3NyYy9hcGkvdmVuZG9yL2NvbW1pc3Npb24vdmFsaWRhdG9ycy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7QUFBQSw2QkFBdUI7QUFFdkIsc0VBQXdFO0FBRTNELFFBQUEsOEJBQThCLEdBQUcsSUFBQSw2QkFBZ0IsRUFBQztJQUM3RCxLQUFLLEVBQUUsRUFBRTtJQUNULE1BQU0sRUFBRSxDQUFDO0NBQ1YsQ0FBQyxDQUFDLEtBQUssQ0FDTixPQUFDLENBQUMsTUFBTSxDQUFDO0lBQ1AsVUFBVSxFQUFFLE9BQUMsQ0FBQyxNQUFNLENBQUMsSUFBSSxFQUFFLENBQUMsUUFBUSxFQUFFO0lBQ3RDLFFBQVEsRUFBRSxPQUFDLENBQUMsTUFBTSxDQUFDLElBQUksRUFBRSxDQUFDLFFBQVEsRUFBRTtDQUNyQyxDQUFDLENBQ0gsQ0FBQSJ9
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.vendorMiddlewares = void 0;
|
|
4
|
+
const middlewares_1 = require("./commission/middlewares");
|
|
5
|
+
const middlewares_2 = require("./orders/middlewares");
|
|
6
|
+
exports.vendorMiddlewares = [
|
|
7
|
+
...middlewares_1.vendorCommissionMiddlewares,
|
|
8
|
+
...middlewares_2.vendorOrderCommissionMiddlewares,
|
|
9
|
+
];
|
|
10
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibWlkZGxld2FyZXMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi9zcmMvYXBpL3ZlbmRvci9taWRkbGV3YXJlcy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7QUFDQSwwREFBdUU7QUFDdkUsc0RBQXdFO0FBRTNELFFBQUEsaUJBQWlCLEdBQXNCO0lBQ2xELEdBQUcseUNBQTJCO0lBQzlCLEdBQUcsOENBQWdDO0NBQ3BDLENBQUMifQ==
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GET = void 0;
|
|
4
|
+
const workflows_1 = require("../../../../../workflows");
|
|
5
|
+
const GET = async (req, res) => {
|
|
6
|
+
const { id } = req.params;
|
|
7
|
+
const { result: commission } = await (0, workflows_1.listOrderCommissionLinesWorkflow)(req.scope).run({
|
|
8
|
+
input: {
|
|
9
|
+
order_id: id,
|
|
10
|
+
},
|
|
11
|
+
});
|
|
12
|
+
res.json({ commission });
|
|
13
|
+
};
|
|
14
|
+
exports.GET = GET;
|
|
15
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicm91dGUuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi8uLi8uLi9zcmMvYXBpL3ZlbmRvci9vcmRlcnMvW2lkXS9jb21taXNzaW9uL3JvdXRlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztBQUVBLHdEQUE0RTtBQUVyRSxNQUFNLEdBQUcsR0FBRyxLQUFLLEVBQ3RCLEdBQStCLEVBQy9CLEdBQW1CLEVBQ25CLEVBQUU7SUFDRixNQUFNLEVBQUUsRUFBRSxFQUFFLEdBQUcsR0FBRyxDQUFDLE1BQU0sQ0FBQztJQUUxQixNQUFNLEVBQUUsTUFBTSxFQUFFLFVBQVUsRUFBRSxHQUFHLE1BQU0sSUFBQSw0Q0FBZ0MsRUFDbkUsR0FBRyxDQUFDLEtBQUssQ0FDVixDQUFDLEdBQUcsQ0FBQztRQUNKLEtBQUssRUFBRTtZQUNMLFFBQVEsRUFBRSxFQUFFO1NBQ2I7S0FDRixDQUFDLENBQUM7SUFFSCxHQUFHLENBQUMsSUFBSSxDQUFDLEVBQUUsVUFBVSxFQUFFLENBQUMsQ0FBQztBQUMzQixDQUFDLENBQUM7QUFmVyxRQUFBLEdBQUcsT0FlZCJ9
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.vendorOrderCommissionMiddlewares = void 0;
|
|
4
|
+
const framework_1 = require("@mercurjs/framework");
|
|
5
|
+
exports.vendorOrderCommissionMiddlewares = [
|
|
6
|
+
{
|
|
7
|
+
method: ["GET"],
|
|
8
|
+
matcher: "/vendor/orders/:id/commission",
|
|
9
|
+
middlewares: [
|
|
10
|
+
(0, framework_1.checkResourceOwnershipByResourceId)({
|
|
11
|
+
entryPoint: framework_1.SELLER_ORDER_LINK,
|
|
12
|
+
filterField: "order_id",
|
|
13
|
+
}),
|
|
14
|
+
],
|
|
15
|
+
},
|
|
16
|
+
];
|
|
17
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibWlkZGxld2FyZXMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi9zcmMvYXBpL3ZlbmRvci9vcmRlcnMvbWlkZGxld2FyZXMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O0FBQ0EsbURBRzZCO0FBRWhCLFFBQUEsZ0NBQWdDLEdBQXNCO0lBQ2pFO1FBQ0UsTUFBTSxFQUFFLENBQUMsS0FBSyxDQUFDO1FBQ2YsT0FBTyxFQUFFLCtCQUErQjtRQUN4QyxXQUFXLEVBQUU7WUFDWCxJQUFBLDhDQUFrQyxFQUFDO2dCQUNqQyxVQUFVLEVBQUUsNkJBQWlCO2dCQUM3QixXQUFXLEVBQUUsVUFBVTthQUN4QixDQUFDO1NBQ0g7S0FDRjtDQUNGLENBQUMifQ==
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import CommissionModuleService from "./service";
|
|
2
|
+
export declare const COMMISSION_MODULE = "commission";
|
|
3
|
+
export { CommissionModuleService };
|
|
4
|
+
declare const _default: import("@medusajs/types").ModuleExports<typeof CommissionModuleService> & {
|
|
5
|
+
linkable: {
|
|
6
|
+
readonly commissionRate: {
|
|
7
|
+
id: {
|
|
8
|
+
serviceName: "commission";
|
|
9
|
+
field: "commissionRate";
|
|
10
|
+
linkable: "commission_rate_id";
|
|
11
|
+
primaryKey: "id";
|
|
12
|
+
};
|
|
13
|
+
toJSON: () => {
|
|
14
|
+
serviceName: "commission";
|
|
15
|
+
field: "commissionRate";
|
|
16
|
+
linkable: "commission_rate_id";
|
|
17
|
+
primaryKey: "id";
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
readonly commissionRule: {
|
|
21
|
+
id: {
|
|
22
|
+
serviceName: "commission";
|
|
23
|
+
field: "commissionRule";
|
|
24
|
+
linkable: "commission_rule_id";
|
|
25
|
+
primaryKey: "id";
|
|
26
|
+
};
|
|
27
|
+
toJSON: () => {
|
|
28
|
+
serviceName: "commission";
|
|
29
|
+
field: "commissionRule";
|
|
30
|
+
linkable: "commission_rule_id";
|
|
31
|
+
primaryKey: "id";
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
readonly commissionLine: {
|
|
35
|
+
id: {
|
|
36
|
+
serviceName: "commission";
|
|
37
|
+
field: "commissionLine";
|
|
38
|
+
linkable: "commission_line_id";
|
|
39
|
+
primaryKey: "id";
|
|
40
|
+
};
|
|
41
|
+
toJSON: () => {
|
|
42
|
+
serviceName: "commission";
|
|
43
|
+
field: "commissionLine";
|
|
44
|
+
linkable: "commission_line_id";
|
|
45
|
+
primaryKey: "id";
|
|
46
|
+
};
|
|
47
|
+
};
|
|
48
|
+
};
|
|
49
|
+
};
|
|
50
|
+
export default _default;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.CommissionModuleService = exports.COMMISSION_MODULE = void 0;
|
|
7
|
+
const utils_1 = require("@medusajs/framework/utils");
|
|
8
|
+
const service_1 = __importDefault(require("./service"));
|
|
9
|
+
exports.CommissionModuleService = service_1.default;
|
|
10
|
+
exports.COMMISSION_MODULE = "commission";
|
|
11
|
+
exports.default = (0, utils_1.Module)(exports.COMMISSION_MODULE, {
|
|
12
|
+
service: service_1.default,
|
|
13
|
+
});
|
|
14
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi9zcmMvbW9kdWxlcy9jb21taXNzaW9uL2luZGV4LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7OztBQUFBLHFEQUFtRDtBQUVuRCx3REFBZ0Q7QUFHdkMsa0NBSEYsaUJBQXVCLENBR0U7QUFEbkIsUUFBQSxpQkFBaUIsR0FBRyxZQUFZLENBQUM7QUFHOUMsa0JBQWUsSUFBQSxjQUFNLEVBQUMseUJBQWlCLEVBQUU7SUFDdkMsT0FBTyxFQUFFLGlCQUF1QjtDQUNqQyxDQUFDLENBQUMifQ==
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Migration20250124152358 = void 0;
|
|
4
|
+
const migrations_1 = require("@mikro-orm/migrations");
|
|
5
|
+
class Migration20250124152358 extends migrations_1.Migration {
|
|
6
|
+
async up() {
|
|
7
|
+
this.addSql('create table if not exists "commission_line" ("id" text not null, "item_line_id" text not null, "rule_id" text not null, "currency_code" text not null, "value" numeric not null, "raw_value" jsonb not null, "created_at" timestamptz not null default now(), "updated_at" timestamptz not null default now(), "deleted_at" timestamptz null, constraint "commission_line_pkey" primary key ("id"));');
|
|
8
|
+
this.addSql('CREATE INDEX IF NOT EXISTS "IDX_commission_line_deleted_at" ON "commission_line" (deleted_at) WHERE deleted_at IS NULL;');
|
|
9
|
+
this.addSql('create table if not exists "commission_rule" ("id" text not null, "name" text not null, "reference" text not null, "reference_id" text not null, "is_active" boolean not null default true, "created_at" timestamptz not null default now(), "updated_at" timestamptz not null default now(), "deleted_at" timestamptz null, constraint "commission_rule_pkey" primary key ("id"));');
|
|
10
|
+
this.addSql('CREATE INDEX IF NOT EXISTS "IDX_commission_rule_deleted_at" ON "commission_rule" (deleted_at) WHERE deleted_at IS NULL;');
|
|
11
|
+
this.addSql('create table if not exists "commission_rate" ("id" text not null, "type" text not null, "percentage_rate" integer not null, "include_tax" boolean not null, "price_set_id" text not null, "max_price_set_id" text not null, "min_price_set_id" text not null, "rule_id" text null, "created_at" timestamptz not null default now(), "updated_at" timestamptz not null default now(), "deleted_at" timestamptz null, constraint "commission_rate_pkey" primary key ("id"));');
|
|
12
|
+
this.addSql('alter table if exists "commission_rate" add constraint "commission_rate_rule_id_unique" unique ("rule_id");');
|
|
13
|
+
this.addSql('CREATE INDEX IF NOT EXISTS "IDX_commission_rate_rule_id" ON "commission_rate" (rule_id) WHERE deleted_at IS NULL;');
|
|
14
|
+
this.addSql('CREATE INDEX IF NOT EXISTS "IDX_commission_rate_deleted_at" ON "commission_rate" (deleted_at) WHERE deleted_at IS NULL;');
|
|
15
|
+
this.addSql('alter table if exists "commission_rate" add constraint "commission_rate_rule_id_foreign" foreign key ("rule_id") references "commission_rule" ("id") on update cascade on delete set null;');
|
|
16
|
+
}
|
|
17
|
+
async down() {
|
|
18
|
+
this.addSql('alter table if exists "commission_rate" drop constraint if exists "commission_rate_rule_id_foreign";');
|
|
19
|
+
this.addSql('drop table if exists "commission_line" cascade;');
|
|
20
|
+
this.addSql('drop table if exists "commission_rule" cascade;');
|
|
21
|
+
this.addSql('drop table if exists "commission_rate" cascade;');
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
exports.Migration20250124152358 = Migration20250124152358;
|
|
25
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiTWlncmF0aW9uMjAyNTAxMjQxNTIzNTguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi9zcmMvbW9kdWxlcy9jb21taXNzaW9uL21pZ3JhdGlvbnMvTWlncmF0aW9uMjAyNTAxMjQxNTIzNTgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O0FBQUEsc0RBQWtEO0FBRWxELE1BQWEsdUJBQXdCLFNBQVEsc0JBQVM7SUFFcEQsS0FBSyxDQUFDLEVBQUU7UUFDTixJQUFJLENBQUMsTUFBTSxDQUFDLHVZQUF1WSxDQUFDLENBQUM7UUFDclosSUFBSSxDQUFDLE1BQU0sQ0FBQyx5SEFBeUgsQ0FBQyxDQUFDO1FBRXZJLElBQUksQ0FBQyxNQUFNLENBQUMscVhBQXFYLENBQUMsQ0FBQztRQUNuWSxJQUFJLENBQUMsTUFBTSxDQUFDLHlIQUF5SCxDQUFDLENBQUM7UUFFdkksSUFBSSxDQUFDLE1BQU0sQ0FBQyw0Y0FBNGMsQ0FBQyxDQUFDO1FBQzFkLElBQUksQ0FBQyxNQUFNLENBQUMsNkdBQTZHLENBQUMsQ0FBQztRQUMzSCxJQUFJLENBQUMsTUFBTSxDQUFDLG1IQUFtSCxDQUFDLENBQUM7UUFDakksSUFBSSxDQUFDLE1BQU0sQ0FBQyx5SEFBeUgsQ0FBQyxDQUFDO1FBRXZJLElBQUksQ0FBQyxNQUFNLENBQUMsNExBQTRMLENBQUMsQ0FBQztJQUM1TSxDQUFDO0lBRUQsS0FBSyxDQUFDLElBQUk7UUFDUixJQUFJLENBQUMsTUFBTSxDQUFDLHNHQUFzRyxDQUFDLENBQUM7UUFFcEgsSUFBSSxDQUFDLE1BQU0sQ0FBQyxpREFBaUQsQ0FBQyxDQUFDO1FBRS9ELElBQUksQ0FBQyxNQUFNLENBQUMsaURBQWlELENBQUMsQ0FBQztRQUUvRCxJQUFJLENBQUMsTUFBTSxDQUFDLGlEQUFpRCxDQUFDLENBQUM7SUFDakUsQ0FBQztDQUVGO0FBM0JELDBEQTJCQyJ9
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Migration20250127073504 = void 0;
|
|
4
|
+
const migrations_1 = require("@mikro-orm/migrations");
|
|
5
|
+
class Migration20250127073504 extends migrations_1.Migration {
|
|
6
|
+
async up() {
|
|
7
|
+
this.addSql('alter table if exists "commission_rate" alter column "percentage_rate" type integer using ("percentage_rate"::integer);');
|
|
8
|
+
this.addSql('alter table if exists "commission_rate" alter column "percentage_rate" drop not null;');
|
|
9
|
+
this.addSql('alter table if exists "commission_rate" alter column "price_set_id" type text using ("price_set_id"::text);');
|
|
10
|
+
this.addSql('alter table if exists "commission_rate" alter column "price_set_id" drop not null;');
|
|
11
|
+
this.addSql('alter table if exists "commission_rate" alter column "max_price_set_id" type text using ("max_price_set_id"::text);');
|
|
12
|
+
this.addSql('alter table if exists "commission_rate" alter column "max_price_set_id" drop not null;');
|
|
13
|
+
this.addSql('alter table if exists "commission_rate" alter column "min_price_set_id" type text using ("min_price_set_id"::text);');
|
|
14
|
+
this.addSql('alter table if exists "commission_rate" alter column "min_price_set_id" drop not null;');
|
|
15
|
+
}
|
|
16
|
+
async down() {
|
|
17
|
+
this.addSql('alter table if exists "commission_rate" alter column "percentage_rate" type integer using ("percentage_rate"::integer);');
|
|
18
|
+
this.addSql('alter table if exists "commission_rate" alter column "percentage_rate" set not null;');
|
|
19
|
+
this.addSql('alter table if exists "commission_rate" alter column "price_set_id" type text using ("price_set_id"::text);');
|
|
20
|
+
this.addSql('alter table if exists "commission_rate" alter column "price_set_id" set not null;');
|
|
21
|
+
this.addSql('alter table if exists "commission_rate" alter column "max_price_set_id" type text using ("max_price_set_id"::text);');
|
|
22
|
+
this.addSql('alter table if exists "commission_rate" alter column "max_price_set_id" set not null;');
|
|
23
|
+
this.addSql('alter table if exists "commission_rate" alter column "min_price_set_id" type text using ("min_price_set_id"::text);');
|
|
24
|
+
this.addSql('alter table if exists "commission_rate" alter column "min_price_set_id" set not null;');
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
exports.Migration20250127073504 = Migration20250127073504;
|
|
28
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiTWlncmF0aW9uMjAyNTAxMjcwNzM1MDQuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi9zcmMvbW9kdWxlcy9jb21taXNzaW9uL21pZ3JhdGlvbnMvTWlncmF0aW9uMjAyNTAxMjcwNzM1MDQudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O0FBQUEsc0RBQWlEO0FBRWpELE1BQWEsdUJBQXdCLFNBQVEsc0JBQVM7SUFDcEQsS0FBSyxDQUFDLEVBQUU7UUFDTixJQUFJLENBQUMsTUFBTSxDQUNULHlIQUF5SCxDQUMxSCxDQUFBO1FBQ0QsSUFBSSxDQUFDLE1BQU0sQ0FDVCx1RkFBdUYsQ0FDeEYsQ0FBQTtRQUNELElBQUksQ0FBQyxNQUFNLENBQ1QsNkdBQTZHLENBQzlHLENBQUE7UUFDRCxJQUFJLENBQUMsTUFBTSxDQUNULG9GQUFvRixDQUNyRixDQUFBO1FBQ0QsSUFBSSxDQUFDLE1BQU0sQ0FDVCxxSEFBcUgsQ0FDdEgsQ0FBQTtRQUNELElBQUksQ0FBQyxNQUFNLENBQ1Qsd0ZBQXdGLENBQ3pGLENBQUE7UUFDRCxJQUFJLENBQUMsTUFBTSxDQUNULHFIQUFxSCxDQUN0SCxDQUFBO1FBQ0QsSUFBSSxDQUFDLE1BQU0sQ0FDVCx3RkFBd0YsQ0FDekYsQ0FBQTtJQUNILENBQUM7SUFFRCxLQUFLLENBQUMsSUFBSTtRQUNSLElBQUksQ0FBQyxNQUFNLENBQ1QseUhBQXlILENBQzFILENBQUE7UUFDRCxJQUFJLENBQUMsTUFBTSxDQUNULHNGQUFzRixDQUN2RixDQUFBO1FBQ0QsSUFBSSxDQUFDLE1BQU0sQ0FDVCw2R0FBNkcsQ0FDOUcsQ0FBQTtRQUNELElBQUksQ0FBQyxNQUFNLENBQ1QsbUZBQW1GLENBQ3BGLENBQUE7UUFDRCxJQUFJLENBQUMsTUFBTSxDQUNULHFIQUFxSCxDQUN0SCxDQUFBO1FBQ0QsSUFBSSxDQUFDLE1BQU0sQ0FDVCx1RkFBdUYsQ0FDeEYsQ0FBQTtRQUNELElBQUksQ0FBQyxNQUFNLENBQ1QscUhBQXFILENBQ3RILENBQUE7UUFDRCxJQUFJLENBQUMsTUFBTSxDQUNULHVGQUF1RixDQUN4RixDQUFBO0lBQ0gsQ0FBQztDQUNGO0FBdERELDBEQXNEQyJ9
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare const CommissionLine: import("@medusajs/framework/utils").DmlEntity<import("@medusajs/framework/utils").DMLEntitySchemaBuilder<{
|
|
2
|
+
id: import("@medusajs/framework/utils").PrimaryKeyModifier<string, import("@medusajs/framework/utils").IdProperty>;
|
|
3
|
+
item_line_id: import("@medusajs/framework/utils").TextProperty;
|
|
4
|
+
rule_id: import("@medusajs/framework/utils").TextProperty;
|
|
5
|
+
currency_code: import("@medusajs/framework/utils").TextProperty;
|
|
6
|
+
value: import("@medusajs/framework/utils").BigNumberProperty;
|
|
7
|
+
}>, "commission_line">;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CommissionLine = void 0;
|
|
4
|
+
const utils_1 = require("@medusajs/framework/utils");
|
|
5
|
+
exports.CommissionLine = utils_1.model.define('commission_line', {
|
|
6
|
+
id: utils_1.model.id({ prefix: 'com_line' }).primaryKey(),
|
|
7
|
+
item_line_id: utils_1.model.text(),
|
|
8
|
+
rule_id: utils_1.model.text(),
|
|
9
|
+
currency_code: utils_1.model.text(),
|
|
10
|
+
value: utils_1.model.bigNumber()
|
|
11
|
+
});
|
|
12
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29tbWlzc2lvbl9saW5lLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vc3JjL21vZHVsZXMvY29tbWlzc2lvbi9tb2RlbHMvY29tbWlzc2lvbl9saW5lLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztBQUFBLHFEQUFpRDtBQUVwQyxRQUFBLGNBQWMsR0FBRyxhQUFLLENBQUMsTUFBTSxDQUFDLGlCQUFpQixFQUFFO0lBQzVELEVBQUUsRUFBRSxhQUFLLENBQUMsRUFBRSxDQUFDLEVBQUUsTUFBTSxFQUFFLFVBQVUsRUFBRSxDQUFDLENBQUMsVUFBVSxFQUFFO0lBQ2pELFlBQVksRUFBRSxhQUFLLENBQUMsSUFBSSxFQUFFO0lBQzFCLE9BQU8sRUFBRSxhQUFLLENBQUMsSUFBSSxFQUFFO0lBQ3JCLGFBQWEsRUFBRSxhQUFLLENBQUMsSUFBSSxFQUFFO0lBQzNCLEtBQUssRUFBRSxhQUFLLENBQUMsU0FBUyxFQUFFO0NBQ3pCLENBQUMsQ0FBQSJ9
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export declare const CommissionRate: import("@medusajs/framework/utils").DmlEntity<import("@medusajs/framework/utils").DMLEntitySchemaBuilder<{
|
|
2
|
+
id: import("@medusajs/framework/utils").PrimaryKeyModifier<string, import("@medusajs/framework/utils").IdProperty>;
|
|
3
|
+
type: import("@medusajs/framework/utils").TextProperty;
|
|
4
|
+
percentage_rate: import("@medusajs/framework/utils").NullableModifier<number, import("@medusajs/framework/utils").NumberProperty>;
|
|
5
|
+
include_tax: import("@medusajs/framework/utils").BooleanProperty;
|
|
6
|
+
price_set_id: import("@medusajs/framework/utils").NullableModifier<string, import("@medusajs/framework/utils").TextProperty>;
|
|
7
|
+
max_price_set_id: import("@medusajs/framework/utils").NullableModifier<string, import("@medusajs/framework/utils").TextProperty>;
|
|
8
|
+
min_price_set_id: import("@medusajs/framework/utils").NullableModifier<string, import("@medusajs/framework/utils").TextProperty>;
|
|
9
|
+
rule: import("@medusajs/framework/utils").RelationNullableModifier<() => import("@medusajs/framework/utils").DmlEntity<import("@medusajs/framework/utils").DMLEntitySchemaBuilder<{
|
|
10
|
+
id: import("@medusajs/framework/utils").PrimaryKeyModifier<string, import("@medusajs/framework/utils").IdProperty>;
|
|
11
|
+
name: import("@medusajs/framework/utils").TextProperty;
|
|
12
|
+
reference: import("@medusajs/framework/utils").TextProperty;
|
|
13
|
+
reference_id: import("@medusajs/framework/utils").TextProperty;
|
|
14
|
+
is_active: import("@medusajs/framework/utils").BooleanProperty;
|
|
15
|
+
rate: import("@medusajs/framework/utils").HasOne<() => import("@medusajs/framework/utils").DmlEntity<import("@medusajs/framework/utils").DMLEntitySchemaBuilder</*elided*/ any>, "commission_rate">>;
|
|
16
|
+
}>, "commission_rule">, import("@medusajs/framework/utils").BelongsTo<() => import("@medusajs/framework/utils").DmlEntity<import("@medusajs/framework/utils").DMLEntitySchemaBuilder<{
|
|
17
|
+
id: import("@medusajs/framework/utils").PrimaryKeyModifier<string, import("@medusajs/framework/utils").IdProperty>;
|
|
18
|
+
name: import("@medusajs/framework/utils").TextProperty;
|
|
19
|
+
reference: import("@medusajs/framework/utils").TextProperty;
|
|
20
|
+
reference_id: import("@medusajs/framework/utils").TextProperty;
|
|
21
|
+
is_active: import("@medusajs/framework/utils").BooleanProperty;
|
|
22
|
+
rate: import("@medusajs/framework/utils").HasOne<() => import("@medusajs/framework/utils").DmlEntity<import("@medusajs/framework/utils").DMLEntitySchemaBuilder</*elided*/ any>, "commission_rate">>;
|
|
23
|
+
}>, "commission_rule">, undefined>, true>;
|
|
24
|
+
}>, "commission_rate">;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CommissionRate = void 0;
|
|
4
|
+
const utils_1 = require("@medusajs/framework/utils");
|
|
5
|
+
const commission_rule_1 = require("./commission_rule");
|
|
6
|
+
exports.CommissionRate = utils_1.model.define('commission_rate', {
|
|
7
|
+
id: utils_1.model.id({ prefix: 'com_rate' }).primaryKey(),
|
|
8
|
+
type: utils_1.model.text(),
|
|
9
|
+
percentage_rate: utils_1.model.number().nullable(),
|
|
10
|
+
include_tax: utils_1.model.boolean(),
|
|
11
|
+
price_set_id: utils_1.model.text().nullable(),
|
|
12
|
+
max_price_set_id: utils_1.model.text().nullable(),
|
|
13
|
+
min_price_set_id: utils_1.model.text().nullable(),
|
|
14
|
+
rule: utils_1.model
|
|
15
|
+
.belongsTo(() => commission_rule_1.CommissionRule, {
|
|
16
|
+
mappedBy: 'rate'
|
|
17
|
+
})
|
|
18
|
+
.nullable()
|
|
19
|
+
});
|
|
20
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29tbWlzc2lvbl9yYXRlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vc3JjL21vZHVsZXMvY29tbWlzc2lvbi9tb2RlbHMvY29tbWlzc2lvbl9yYXRlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztBQUFBLHFEQUFpRDtBQUVqRCx1REFBa0Q7QUFFckMsUUFBQSxjQUFjLEdBQUcsYUFBSyxDQUFDLE1BQU0sQ0FBQyxpQkFBaUIsRUFBRTtJQUM1RCxFQUFFLEVBQUUsYUFBSyxDQUFDLEVBQUUsQ0FBQyxFQUFFLE1BQU0sRUFBRSxVQUFVLEVBQUUsQ0FBQyxDQUFDLFVBQVUsRUFBRTtJQUNqRCxJQUFJLEVBQUUsYUFBSyxDQUFDLElBQUksRUFBRTtJQUNsQixlQUFlLEVBQUUsYUFBSyxDQUFDLE1BQU0sRUFBRSxDQUFDLFFBQVEsRUFBRTtJQUMxQyxXQUFXLEVBQUUsYUFBSyxDQUFDLE9BQU8sRUFBRTtJQUM1QixZQUFZLEVBQUUsYUFBSyxDQUFDLElBQUksRUFBRSxDQUFDLFFBQVEsRUFBRTtJQUNyQyxnQkFBZ0IsRUFBRSxhQUFLLENBQUMsSUFBSSxFQUFFLENBQUMsUUFBUSxFQUFFO0lBQ3pDLGdCQUFnQixFQUFFLGFBQUssQ0FBQyxJQUFJLEVBQUUsQ0FBQyxRQUFRLEVBQUU7SUFDekMsSUFBSSxFQUFFLGFBQUs7U0FDUixTQUFTLENBQUMsR0FBRyxFQUFFLENBQUMsZ0NBQWMsRUFBRTtRQUMvQixRQUFRLEVBQUUsTUFBTTtLQUNqQixDQUFDO1NBQ0QsUUFBUSxFQUFFO0NBQ2QsQ0FBQyxDQUFBIn0=
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export declare const CommissionRule: import("@medusajs/framework/utils").DmlEntity<import("@medusajs/framework/utils").DMLEntitySchemaBuilder<{
|
|
2
|
+
id: import("@medusajs/framework/utils").PrimaryKeyModifier<string, import("@medusajs/framework/utils").IdProperty>;
|
|
3
|
+
name: import("@medusajs/framework/utils").TextProperty;
|
|
4
|
+
reference: import("@medusajs/framework/utils").TextProperty;
|
|
5
|
+
reference_id: import("@medusajs/framework/utils").TextProperty;
|
|
6
|
+
is_active: import("@medusajs/framework/utils").BooleanProperty;
|
|
7
|
+
rate: import("@medusajs/framework/utils").HasOne<() => import("@medusajs/framework/utils").DmlEntity<import("@medusajs/framework/utils").DMLEntitySchemaBuilder<{
|
|
8
|
+
id: import("@medusajs/framework/utils").PrimaryKeyModifier<string, import("@medusajs/framework/utils").IdProperty>;
|
|
9
|
+
type: import("@medusajs/framework/utils").TextProperty;
|
|
10
|
+
percentage_rate: import("@medusajs/framework/utils").NullableModifier<number, import("@medusajs/framework/utils").NumberProperty>;
|
|
11
|
+
include_tax: import("@medusajs/framework/utils").BooleanProperty;
|
|
12
|
+
price_set_id: import("@medusajs/framework/utils").NullableModifier<string, import("@medusajs/framework/utils").TextProperty>;
|
|
13
|
+
max_price_set_id: import("@medusajs/framework/utils").NullableModifier<string, import("@medusajs/framework/utils").TextProperty>;
|
|
14
|
+
min_price_set_id: import("@medusajs/framework/utils").NullableModifier<string, import("@medusajs/framework/utils").TextProperty>;
|
|
15
|
+
rule: import("@medusajs/framework/utils").RelationNullableModifier<() => import("@medusajs/framework/utils").DmlEntity<import("@medusajs/framework/utils").DMLEntitySchemaBuilder</*elided*/ any>, "commission_rule">, import("@medusajs/framework/utils").BelongsTo<() => import("@medusajs/framework/utils").DmlEntity<import("@medusajs/framework/utils").DMLEntitySchemaBuilder</*elided*/ any>, "commission_rule">, undefined>, true>;
|
|
16
|
+
}>, "commission_rate">>;
|
|
17
|
+
}>, "commission_rule">;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CommissionRule = void 0;
|
|
4
|
+
const utils_1 = require("@medusajs/framework/utils");
|
|
5
|
+
const commission_rate_1 = require("./commission_rate");
|
|
6
|
+
exports.CommissionRule = utils_1.model.define('commission_rule', {
|
|
7
|
+
id: utils_1.model.id({ prefix: 'com_rule' }).primaryKey(),
|
|
8
|
+
name: utils_1.model.text().searchable(),
|
|
9
|
+
reference: utils_1.model.text().searchable(),
|
|
10
|
+
reference_id: utils_1.model.text(),
|
|
11
|
+
is_active: utils_1.model.boolean().default(true),
|
|
12
|
+
rate: utils_1.model.hasOne(() => commission_rate_1.CommissionRate, {
|
|
13
|
+
mappedBy: 'rule'
|
|
14
|
+
})
|
|
15
|
+
});
|
|
16
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29tbWlzc2lvbl9ydWxlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vc3JjL21vZHVsZXMvY29tbWlzc2lvbi9tb2RlbHMvY29tbWlzc2lvbl9ydWxlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztBQUFBLHFEQUFpRDtBQUVqRCx1REFBa0Q7QUFFckMsUUFBQSxjQUFjLEdBQUcsYUFBSyxDQUFDLE1BQU0sQ0FBQyxpQkFBaUIsRUFBRTtJQUM1RCxFQUFFLEVBQUUsYUFBSyxDQUFDLEVBQUUsQ0FBQyxFQUFFLE1BQU0sRUFBRSxVQUFVLEVBQUUsQ0FBQyxDQUFDLFVBQVUsRUFBRTtJQUNqRCxJQUFJLEVBQUUsYUFBSyxDQUFDLElBQUksRUFBRSxDQUFDLFVBQVUsRUFBRTtJQUMvQixTQUFTLEVBQUUsYUFBSyxDQUFDLElBQUksRUFBRSxDQUFDLFVBQVUsRUFBRTtJQUNwQyxZQUFZLEVBQUUsYUFBSyxDQUFDLElBQUksRUFBRTtJQUMxQixTQUFTLEVBQUUsYUFBSyxDQUFDLE9BQU8sRUFBRSxDQUFDLE9BQU8sQ0FBQyxJQUFJLENBQUM7SUFDeEMsSUFBSSxFQUFFLGFBQUssQ0FBQyxNQUFNLENBQUMsR0FBRyxFQUFFLENBQUMsZ0NBQWMsRUFBRTtRQUN2QyxRQUFRLEVBQUUsTUFBTTtLQUNqQixDQUFDO0NBQ0gsQ0FBQyxDQUFBIn0=
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./commission_rate"), exports);
|
|
18
|
+
__exportStar(require("./commission_rule"), exports);
|
|
19
|
+
__exportStar(require("./commission_line"), exports);
|
|
20
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi9zcmMvbW9kdWxlcy9jb21taXNzaW9uL21vZGVscy9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7Ozs7Ozs7O0FBQUEsb0RBQWlDO0FBQ2pDLG9EQUFpQztBQUNqQyxvREFBaUMifQ==
|