1 import { ModuleJoinerConfig } from "@medusajs/framework/types"
2 import { LINKS, Modules } from "@medusajs/framework/utils"
3
4 export const OrderClaimPaymentCollection: ModuleJoinerConfig = {
5 serviceName: LINKS.OrderClaimPaymentCollection,
6 isLink: true,
7 databaseConfig: {
8 tableName: "order_claim_payment_collection",
9 idPrefix: "claimpay",
10 },
11 alias: [
12 {
13 name: [
14 "order_claim_payment_collection",
15 "order_claim_payment_collections",
16 ],
17 entity: "LinkOrderClaimPaymentCollection",
18 },
19 ],
20 primaryKeys: ["id", "claim_id", "payment_collection_id"],
21 relationships: [
22 {
23 serviceName: Modules.ORDER,
24 entity: "OrderClaim",
25 primaryKey: "id",
26 foreignKey: "claim_id",
27 alias: "order",
28 args: {
29 methodSuffix: "OrderClaims",
30 },
31 },
32 {
33 serviceName: Modules.PAYMENT,
34 entity: "PaymentCollection",
35 primaryKey: "id",
36 foreignKey: "payment_collection_id",
37 alias: "payment_collection",
38 args: {
39 methodSuffix: "PaymentCollections",
40 },
41 hasMany: true,
42 },
43 ],
44 extends: [
45 {
46 serviceName: Modules.ORDER,
47 entity: "OrderClaim",
48 fieldAlias: {
49 claim_payment_collections: {
50 path: "claim_payment_collections_link.payment_collection",
51 isList: true,
52 },
53 },
54 relationship: {
55 serviceName: LINKS.OrderClaimPaymentCollection,
56 primaryKey: "claim_id",
57 foreignKey: "id",
58 alias: "claim_payment_collections_link",
59 },
60 },
61 {
62 serviceName: Modules.PAYMENT,
63 entity: "PaymentCollection",
64 fieldAlias: {
65 claim: "order_claim_link.order",
66 },
67 relationship: {
68 serviceName: LINKS.OrderClaimPaymentCollection,
69 primaryKey: "payment_collection_id",
70 foreignKey: "id",
71 alias: "order_claim_link",
72 },
73 },
74 ],
75 }