@things-factory/marketplace-base 8.0.0-beta.8 → 8.0.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.
Files changed (229) hide show
  1. package/dist-server/tsconfig.tsbuildinfo +1 -1
  2. package/package.json +7 -7
  3. package/server/constants/attachment.ts +3 -0
  4. package/server/constants/index.ts +4 -0
  5. package/server/constants/order.ts +11 -0
  6. package/server/constants/platform.ts +7 -0
  7. package/server/constants/product.ts +5 -0
  8. package/server/constants/reserve-qty-order-statuses.ts +7 -0
  9. package/server/controllers/index.ts +0 -0
  10. package/server/entities/index.ts +45 -0
  11. package/server/entities/marketplace-order-item.ts +137 -0
  12. package/server/entities/marketplace-order-shipping-item.ts +55 -0
  13. package/server/entities/marketplace-order-shipping.ts +168 -0
  14. package/server/entities/marketplace-order.ts +141 -0
  15. package/server/entities/marketplace-product-attribute.ts +83 -0
  16. package/server/entities/marketplace-product-category.ts +53 -0
  17. package/server/entities/marketplace-product-variation-price.ts +63 -0
  18. package/server/entities/marketplace-product-variation.ts +147 -0
  19. package/server/entities/marketplace-product.ts +164 -0
  20. package/server/entities/marketplace-refund-order-item.ts +56 -0
  21. package/server/entities/marketplace-refund-order.ts +51 -0
  22. package/server/entities/marketplace-setting.ts +49 -0
  23. package/server/entities/store-replenishment-item.ts +48 -0
  24. package/server/entities/store-replenishment.ts +79 -0
  25. package/server/graphql/index.ts +9 -0
  26. package/server/graphql/resolvers/index.ts +14 -0
  27. package/server/graphql/resolvers/marketplace-order/auto-initialise-logistics-by-batch.ts +164 -0
  28. package/server/graphql/resolvers/marketplace-order/auto-update-order-ready-to-ship.ts +136 -0
  29. package/server/graphql/resolvers/marketplace-order/cancel-marketplace-order.ts +64 -0
  30. package/server/graphql/resolvers/marketplace-order/create-marketplace-order-note.ts +21 -0
  31. package/server/graphql/resolvers/marketplace-order/dashboard-marketplace-orders.ts +82 -0
  32. package/server/graphql/resolvers/marketplace-order/dashboard-marketplace-sales-average.ts +82 -0
  33. package/server/graphql/resolvers/marketplace-order/dashboard-marketplace-sales.ts +93 -0
  34. package/server/graphql/resolvers/marketplace-order/delete-marketplace-orders.ts +17 -0
  35. package/server/graphql/resolvers/marketplace-order/generate-marketplace-order.ts +180 -0
  36. package/server/graphql/resolvers/marketplace-order/get-address-list.ts +9 -0
  37. package/server/graphql/resolvers/marketplace-order/get-branch-list.ts +9 -0
  38. package/server/graphql/resolvers/marketplace-order/get-etrax-order-document.ts +49 -0
  39. package/server/graphql/resolvers/marketplace-order/get-logistics-param.ts +47 -0
  40. package/server/graphql/resolvers/marketplace-order/get-order-document.ts +149 -0
  41. package/server/graphql/resolvers/marketplace-order/get-store-logistics.ts +9 -0
  42. package/server/graphql/resolvers/marketplace-order/get-time-slot.ts +9 -0
  43. package/server/graphql/resolvers/marketplace-order/index.ts +75 -0
  44. package/server/graphql/resolvers/marketplace-order/initialise-lazada-logistics-by-batch.ts +165 -0
  45. package/server/graphql/resolvers/marketplace-order/initialise-logistics-by-batch.ts +41 -0
  46. package/server/graphql/resolvers/marketplace-order/initialise-logistics.ts +29 -0
  47. package/server/graphql/resolvers/marketplace-order/initialise-shopee-logistics-by-batch.ts +97 -0
  48. package/server/graphql/resolvers/marketplace-order/marketplace-order.ts +12 -0
  49. package/server/graphql/resolvers/marketplace-order/marketplace-orders-for-batch-init.ts +52 -0
  50. package/server/graphql/resolvers/marketplace-order/marketplace-orders-for-export.ts +63 -0
  51. package/server/graphql/resolvers/marketplace-order/marketplace-orders.ts +56 -0
  52. package/server/graphql/resolvers/marketplace-order/set-marketplace-order-delivered.ts +25 -0
  53. package/server/graphql/resolvers/marketplace-order/set-marketplace-order-failed-delivery.ts +25 -0
  54. package/server/graphql/resolvers/marketplace-order/set-own-shipping-provider-by-orders.ts +39 -0
  55. package/server/graphql/resolvers/marketplace-order/split-orders-by-batch.ts +245 -0
  56. package/server/graphql/resolvers/marketplace-order/sync-all-marketplace-order.ts +39 -0
  57. package/server/graphql/resolvers/marketplace-order/sync-marketplace-order.ts +940 -0
  58. package/server/graphql/resolvers/marketplace-order/sync-marketplace-orders-by-platform.ts +31 -0
  59. package/server/graphql/resolvers/marketplace-order/sync-shopee-awb.ts +49 -0
  60. package/server/graphql/resolvers/marketplace-order/update-marketplace-order.ts +35 -0
  61. package/server/graphql/resolvers/marketplace-order/update-order-ready-to-ship.ts +142 -0
  62. package/server/graphql/resolvers/marketplace-order-item/create-marketplace-order-item.ts +14 -0
  63. package/server/graphql/resolvers/marketplace-order-item/delete-marketplace-order-item.ts +10 -0
  64. package/server/graphql/resolvers/marketplace-order-item/delete-marketplace-order-items.ts +17 -0
  65. package/server/graphql/resolvers/marketplace-order-item/index.ts +22 -0
  66. package/server/graphql/resolvers/marketplace-order-item/marketplace-order-item.ts +14 -0
  67. package/server/graphql/resolvers/marketplace-order-item/marketplace-order-items.ts +15 -0
  68. package/server/graphql/resolvers/marketplace-order-item/update-marketplace-order-item.ts +18 -0
  69. package/server/graphql/resolvers/marketplace-order-item/update-multiple-marketplace-order-item.ts +44 -0
  70. package/server/graphql/resolvers/marketplace-order-shipping/create-marketplace-order-shipping.ts +14 -0
  71. package/server/graphql/resolvers/marketplace-order-shipping/delete-marketplace-order-shipping.ts +10 -0
  72. package/server/graphql/resolvers/marketplace-order-shipping/delete-marketplace-order-shippings.ts +17 -0
  73. package/server/graphql/resolvers/marketplace-order-shipping/index.ts +23 -0
  74. package/server/graphql/resolvers/marketplace-order-shipping/marketplace-order-shipping.ts +25 -0
  75. package/server/graphql/resolvers/marketplace-order-shipping/marketplace-order-shippings-for-batch-init.ts +88 -0
  76. package/server/graphql/resolvers/marketplace-order-shipping/marketplace-order-shippings.ts +43 -0
  77. package/server/graphql/resolvers/marketplace-order-shipping/update-marketplace-order-shipping.ts +32 -0
  78. package/server/graphql/resolvers/marketplace-order-shipping/update-multiple-marketplace-order-shipping.ts +44 -0
  79. package/server/graphql/resolvers/marketplace-order-shipping-item/create-marketplace-order-shipping-item.ts +14 -0
  80. package/server/graphql/resolvers/marketplace-order-shipping-item/delete-marketplace-order-shipping-item.ts +10 -0
  81. package/server/graphql/resolvers/marketplace-order-shipping-item/delete-marketplace-order-shipping-items.ts +15 -0
  82. package/server/graphql/resolvers/marketplace-order-shipping-item/index.ts +20 -0
  83. package/server/graphql/resolvers/marketplace-order-shipping-item/marketplace-order-shipping-item.ts +21 -0
  84. package/server/graphql/resolvers/marketplace-order-shipping-item/marketplace-order-shipping-items.ts +14 -0
  85. package/server/graphql/resolvers/marketplace-order-shipping-item/update-marketplace-order-shipping-item.ts +18 -0
  86. package/server/graphql/resolvers/marketplace-order-shipping-item/update-multiple-marketplace-order-shipping-item.ts +44 -0
  87. package/server/graphql/resolvers/marketplace-product/create-marketplace-product.ts +35 -0
  88. package/server/graphql/resolvers/marketplace-product/delete-marketplace-product.ts +10 -0
  89. package/server/graphql/resolvers/marketplace-product/delete-marketplace-products.ts +17 -0
  90. package/server/graphql/resolvers/marketplace-product/index.ts +27 -0
  91. package/server/graphql/resolvers/marketplace-product/marketplace-product.ts +24 -0
  92. package/server/graphql/resolvers/marketplace-product/marketplace-products.ts +23 -0
  93. package/server/graphql/resolvers/marketplace-product/sync-all-marketplace-store-products.ts +225 -0
  94. package/server/graphql/resolvers/marketplace-product/sync-marketplace-store-products.ts +222 -0
  95. package/server/graphql/resolvers/marketplace-product/update-marketplace-product.ts +24 -0
  96. package/server/graphql/resolvers/marketplace-product/upsert-marketplace-product.ts +39 -0
  97. package/server/graphql/resolvers/marketplace-product-attribute/create-marketplace-product-attribute.ts +14 -0
  98. package/server/graphql/resolvers/marketplace-product-attribute/delete-marketplace-product-attribute.ts +10 -0
  99. package/server/graphql/resolvers/marketplace-product-attribute/delete-marketplace-product-attributes.ts +17 -0
  100. package/server/graphql/resolvers/marketplace-product-attribute/index.ts +22 -0
  101. package/server/graphql/resolvers/marketplace-product-attribute/marketplace-product-attribute.ts +14 -0
  102. package/server/graphql/resolvers/marketplace-product-attribute/marketplace-product-attributes.ts +14 -0
  103. package/server/graphql/resolvers/marketplace-product-attribute/update-marketplace-product-attribute.ts +18 -0
  104. package/server/graphql/resolvers/marketplace-product-attribute/update-multiple-marketplace-product-attribute.ts +44 -0
  105. package/server/graphql/resolvers/marketplace-product-category/create-marketplace-product-category.ts +14 -0
  106. package/server/graphql/resolvers/marketplace-product-category/delete-marketplace-product-categories.ts +17 -0
  107. package/server/graphql/resolvers/marketplace-product-category/delete-marketplace-product-category.ts +10 -0
  108. package/server/graphql/resolvers/marketplace-product-category/index.ts +22 -0
  109. package/server/graphql/resolvers/marketplace-product-category/marketplace-product-categories.ts +14 -0
  110. package/server/graphql/resolvers/marketplace-product-category/marketplace-product-category.ts +14 -0
  111. package/server/graphql/resolvers/marketplace-product-category/update-marketplace-product-category.ts +18 -0
  112. package/server/graphql/resolvers/marketplace-product-category/update-multiple-marketplace-product-category.ts +44 -0
  113. package/server/graphql/resolvers/marketplace-product-variation/create-marketplace-product-variation.ts +14 -0
  114. package/server/graphql/resolvers/marketplace-product-variation/delete-marketplace-product-variation.ts +10 -0
  115. package/server/graphql/resolvers/marketplace-product-variation/delete-marketplace-product-variations.ts +17 -0
  116. package/server/graphql/resolvers/marketplace-product-variation/index.ts +30 -0
  117. package/server/graphql/resolvers/marketplace-product-variation/link-warehouse-marketplace-product-variations.ts +59 -0
  118. package/server/graphql/resolvers/marketplace-product-variation/marketplace-product-variation.ts +14 -0
  119. package/server/graphql/resolvers/marketplace-product-variation/marketplace-product-variations.ts +79 -0
  120. package/server/graphql/resolvers/marketplace-product-variation/update-marketplace-product-variation.ts +32 -0
  121. package/server/graphql/resolvers/marketplace-product-variation/update-multiple-marketplace-product-variation-quantity.ts +76 -0
  122. package/server/graphql/resolvers/marketplace-product-variation/update-multiple-marketplace-product-variations.ts +49 -0
  123. package/server/graphql/resolvers/marketplace-product-variation-price/create-marketplace-product-variation-price.ts +16 -0
  124. package/server/graphql/resolvers/marketplace-product-variation-price/delete-marketplace-product-variation-price.ts +13 -0
  125. package/server/graphql/resolvers/marketplace-product-variation-price/delete-marketplace-product-variation-prices.ts +18 -0
  126. package/server/graphql/resolvers/marketplace-product-variation-price/index.ts +19 -0
  127. package/server/graphql/resolvers/marketplace-product-variation-price/marketplace-product-variation-price-query.ts +52 -0
  128. package/server/graphql/resolvers/marketplace-product-variation-price/update-marketplace-product-variation-price.ts +20 -0
  129. package/server/graphql/resolvers/marketplace-product-variation-price/update-multiple-marketplace-product-variation-price.ts +49 -0
  130. package/server/graphql/resolvers/marketplace-refund-order/index.ts +9 -0
  131. package/server/graphql/resolvers/marketplace-refund-order/sync-all-marketplace-refund-orders.ts +122 -0
  132. package/server/graphql/resolvers/marketplace-refund-order/sync-marketplace-refund-orders.ts +106 -0
  133. package/server/graphql/resolvers/marketplace-report/index.ts +7 -0
  134. package/server/graphql/resolvers/marketplace-report/marketplace-sales-report.ts +143 -0
  135. package/server/graphql/resolvers/store-replenishment/create-store-replenishment.ts +16 -0
  136. package/server/graphql/resolvers/store-replenishment/delete-store-replenishment.ts +13 -0
  137. package/server/graphql/resolvers/store-replenishment/delete-store-replenishments.ts +18 -0
  138. package/server/graphql/resolvers/store-replenishment/index.ts +19 -0
  139. package/server/graphql/resolvers/store-replenishment/store-replenishment-query.ts +52 -0
  140. package/server/graphql/resolvers/store-replenishment/update-multiple-store-replenishment.ts +49 -0
  141. package/server/graphql/resolvers/store-replenishment/update-store-replenishment.ts +20 -0
  142. package/server/graphql/resolvers/store-replenishment-item/create-store-replenishment-item.ts +16 -0
  143. package/server/graphql/resolvers/store-replenishment-item/delete-store-replenishment-item.ts +13 -0
  144. package/server/graphql/resolvers/store-replenishment-item/delete-store-replenishment-items.ts +18 -0
  145. package/server/graphql/resolvers/store-replenishment-item/index.ts +19 -0
  146. package/server/graphql/resolvers/store-replenishment-item/store-replenishment-item-query.ts +52 -0
  147. package/server/graphql/resolvers/store-replenishment-item/update-multiple-store-replenishment-item.ts +49 -0
  148. package/server/graphql/resolvers/store-replenishment-item/update-store-replenishment-item.ts +20 -0
  149. package/server/graphql/types/index.ts +13 -0
  150. package/server/graphql/types/marketplace-order/dashboard-order.ts +13 -0
  151. package/server/graphql/types/marketplace-order/full-logistics-detail.ts +10 -0
  152. package/server/graphql/types/marketplace-order/index.ts +69 -0
  153. package/server/graphql/types/marketplace-order/logistics-detail.ts +8 -0
  154. package/server/graphql/types/marketplace-order/logistics-info.ts +27 -0
  155. package/server/graphql/types/marketplace-order/logistics-init.ts +9 -0
  156. package/server/graphql/types/marketplace-order/logistics-time.ts +9 -0
  157. package/server/graphql/types/marketplace-order/logistics.ts +21 -0
  158. package/server/graphql/types/marketplace-order/marketplace-logistics.ts +11 -0
  159. package/server/graphql/types/marketplace-order/marketplace-order-export.ts +19 -0
  160. package/server/graphql/types/marketplace-order/marketplace-order-list.ts +8 -0
  161. package/server/graphql/types/marketplace-order/marketplace-order-patch.ts +14 -0
  162. package/server/graphql/types/marketplace-order/marketplace-order.ts +40 -0
  163. package/server/graphql/types/marketplace-order/new-marketplace-order.ts +22 -0
  164. package/server/graphql/types/marketplace-order/order-address.ts +16 -0
  165. package/server/graphql/types/marketplace-order/order-document.ts +13 -0
  166. package/server/graphql/types/marketplace-order-item/index.ts +21 -0
  167. package/server/graphql/types/marketplace-order-item/marketplace-order-item-list.ts +8 -0
  168. package/server/graphql/types/marketplace-order-item/marketplace-order-item-patch.ts +10 -0
  169. package/server/graphql/types/marketplace-order-item/marketplace-order-item.ts +32 -0
  170. package/server/graphql/types/marketplace-order-item/new-marketplace-order-item.ts +17 -0
  171. package/server/graphql/types/marketplace-order-shipping/index.ts +31 -0
  172. package/server/graphql/types/marketplace-order-shipping/marketplace-order-shipping-list.ts +8 -0
  173. package/server/graphql/types/marketplace-order-shipping/marketplace-order-shipping-patch.ts +45 -0
  174. package/server/graphql/types/marketplace-order-shipping/marketplace-order-shipping.ts +59 -0
  175. package/server/graphql/types/marketplace-order-shipping/new-marketplace-order-shipping.ts +44 -0
  176. package/server/graphql/types/marketplace-order-shipping-item/index.ts +32 -0
  177. package/server/graphql/types/marketplace-order-shipping-item/marketplace-order-shipping-item-list.ts +8 -0
  178. package/server/graphql/types/marketplace-order-shipping-item/marketplace-order-shipping-item-patch.ts +13 -0
  179. package/server/graphql/types/marketplace-order-shipping-item/marketplace-order-shipping-item.ts +16 -0
  180. package/server/graphql/types/marketplace-order-shipping-item/new-marketplace-order-shipping-item.ts +12 -0
  181. package/server/graphql/types/marketplace-product/index.ts +28 -0
  182. package/server/graphql/types/marketplace-product/marketplace-product-list.ts +8 -0
  183. package/server/graphql/types/marketplace-product/marketplace-product-patch.ts +24 -0
  184. package/server/graphql/types/marketplace-product/marketplace-product.ts +30 -0
  185. package/server/graphql/types/marketplace-product/new-marketplace-product.ts +24 -0
  186. package/server/graphql/types/marketplace-product-attribute/index.ts +35 -0
  187. package/server/graphql/types/marketplace-product-attribute/marketplace-product-attribute-list.ts +8 -0
  188. package/server/graphql/types/marketplace-product-attribute/marketplace-product-attribute-patch.ts +10 -0
  189. package/server/graphql/types/marketplace-product-attribute/marketplace-product-attribute.ts +20 -0
  190. package/server/graphql/types/marketplace-product-attribute/new-marketplace-product-attribute.ts +13 -0
  191. package/server/graphql/types/marketplace-product-category/index.ts +28 -0
  192. package/server/graphql/types/marketplace-product-category/marketplace-product-category-list.ts +8 -0
  193. package/server/graphql/types/marketplace-product-category/marketplace-product-category-patch.ts +10 -0
  194. package/server/graphql/types/marketplace-product-category/marketplace-product-category.ts +17 -0
  195. package/server/graphql/types/marketplace-product-category/new-marketplace-product-category.ts +10 -0
  196. package/server/graphql/types/marketplace-product-variation/index.ts +47 -0
  197. package/server/graphql/types/marketplace-product-variation/marketplace-product-variation-list.ts +8 -0
  198. package/server/graphql/types/marketplace-product-variation/marketplace-product-variation-patch.ts +32 -0
  199. package/server/graphql/types/marketplace-product-variation/marketplace-product-variation.ts +35 -0
  200. package/server/graphql/types/marketplace-product-variation/new-marketplace-product-variation.ts +26 -0
  201. package/server/graphql/types/marketplace-product-variation/warehouse-product.ts +9 -0
  202. package/server/graphql/types/marketplace-product-variation-price/index.ts +21 -0
  203. package/server/graphql/types/marketplace-product-variation-price/marketplace-product-variation-price-list.ts +8 -0
  204. package/server/graphql/types/marketplace-product-variation-price/marketplace-product-variation-price-patch.ts +17 -0
  205. package/server/graphql/types/marketplace-product-variation-price/marketplace-product-variation-price.ts +21 -0
  206. package/server/graphql/types/marketplace-product-variation-price/new-marketplace-product-variation-price.ts +14 -0
  207. package/server/graphql/types/marketplace-refund-order/index.ts +16 -0
  208. package/server/graphql/types/marketplace-refund-order/marketplace-refund-order-list.ts +8 -0
  209. package/server/graphql/types/marketplace-refund-order/marketplace-refund-order.ts +17 -0
  210. package/server/graphql/types/marketplace-report/index.ts +10 -0
  211. package/server/graphql/types/marketplace-report/marketplace-sales-report-list.ts +8 -0
  212. package/server/graphql/types/marketplace-report/marketplace-sales-report.ts +67 -0
  213. package/server/graphql/types/store-replenishment/index.ts +21 -0
  214. package/server/graphql/types/store-replenishment/new-store-replenishment.ts +8 -0
  215. package/server/graphql/types/store-replenishment/store-replenishment-list.ts +8 -0
  216. package/server/graphql/types/store-replenishment/store-replenishment-patch.ts +10 -0
  217. package/server/graphql/types/store-replenishment/store-replenishment.ts +24 -0
  218. package/server/graphql/types/store-replenishment-item/index.ts +21 -0
  219. package/server/graphql/types/store-replenishment-item/new-store-replenishment-item.ts +8 -0
  220. package/server/graphql/types/store-replenishment-item/store-replenishment-item-list.ts +8 -0
  221. package/server/graphql/types/store-replenishment-item/store-replenishment-item-patch.ts +10 -0
  222. package/server/graphql/types/store-replenishment-item/store-replenishment-item.ts +15 -0
  223. package/server/index.ts +6 -0
  224. package/server/middlewares/index.ts +3 -0
  225. package/server/migrations/index.ts +9 -0
  226. package/server/routes.ts +26 -0
  227. package/server/utils/index.ts +1 -0
  228. package/server/utils/no-generator.ts +25 -0
  229. package/tsconfig.json +9 -0
@@ -0,0 +1,83 @@
1
+ import { User } from '@things-factory/auth-base'
2
+ import { Domain } from '@things-factory/shell'
3
+ import { Column, CreateDateColumn, Entity, Index, ManyToOne, PrimaryGeneratedColumn, UpdateDateColumn } from 'typeorm'
4
+ import { MarketplaceProduct } from '../entities'
5
+
6
+ @Entity()
7
+ @Index(
8
+ 'ix_marketplace-product-attribute_0',
9
+ (marketplaceProductAttribute: MarketplaceProductAttribute) => [
10
+ marketplaceProductAttribute.domain,
11
+ marketplaceProductAttribute.id
12
+ ],
13
+ { unique: true }
14
+ )
15
+ export class MarketplaceProductAttribute {
16
+ constructor(productAttribute) {
17
+ if (productAttribute) {
18
+ this.id = productAttribute.id
19
+ this.domain = productAttribute.domain
20
+ this.marketplaceProduct = productAttribute.marketplaceProduct
21
+ this.attributeId = productAttribute.attributeId
22
+ this.isMandatory = productAttribute.isMandatory
23
+ this.attributeType = productAttribute.attributeType
24
+ this.option = productAttribute.option
25
+ this.originalValue = productAttribute.originalValue
26
+ this.name = productAttribute.name
27
+ this.description = productAttribute.description
28
+ this.creator = productAttribute.creator
29
+ this.updater = productAttribute.updater
30
+ }
31
+ }
32
+
33
+ @PrimaryGeneratedColumn('uuid')
34
+ id: string
35
+
36
+ @ManyToOne(type => Domain)
37
+ domain: Domain
38
+
39
+ @ManyToOne(type => MarketplaceProduct)
40
+ marketplaceProduct: MarketplaceProduct
41
+
42
+ @Column()
43
+ attributeId: string
44
+
45
+ @Column({ nullable: true })
46
+ name: string
47
+
48
+ @Column({ nullable: true })
49
+ status: string
50
+
51
+ @Column({ nullable: true })
52
+ isMandatory: boolean
53
+
54
+ @Column({ nullable: true })
55
+ attributeType: string
56
+
57
+ @Column({ nullable: true })
58
+ option: string
59
+
60
+ @Column({ nullable: true })
61
+ originalValue: string
62
+
63
+ @Column({
64
+ nullable: true
65
+ })
66
+ description: string
67
+
68
+ @CreateDateColumn()
69
+ createdAt: Date
70
+
71
+ @UpdateDateColumn()
72
+ updatedAt: Date
73
+
74
+ @ManyToOne(type => User, {
75
+ nullable: true
76
+ })
77
+ creator: User
78
+
79
+ @ManyToOne(type => User, {
80
+ nullable: true
81
+ })
82
+ updater: User
83
+ }
@@ -0,0 +1,53 @@
1
+ import { User } from '@things-factory/auth-base'
2
+ import { Domain } from '@things-factory/shell'
3
+ import { Column, CreateDateColumn, Entity, Index, ManyToOne, PrimaryGeneratedColumn, UpdateDateColumn } from 'typeorm'
4
+ import { MarketplaceProduct } from '../entities'
5
+ @Entity()
6
+ @Index(
7
+ 'ix_marketplace-product-category_0',
8
+ (marketplaceProductCategory: MarketplaceProductCategory) => [
9
+ marketplaceProductCategory.domain,
10
+ marketplaceProductCategory.name
11
+ ],
12
+ { unique: true }
13
+ )
14
+ export class MarketplaceProductCategory {
15
+ @PrimaryGeneratedColumn('uuid')
16
+ id: string
17
+
18
+ @ManyToOne(type => Domain)
19
+ domain: Domain
20
+
21
+ @ManyToOne(type => MarketplaceProduct)
22
+ marketplaceProduct: MarketplaceProduct
23
+
24
+ @Column()
25
+ name: string
26
+
27
+ @Column()
28
+ categoryId: string
29
+
30
+ @Column()
31
+ childCategory: Boolean
32
+
33
+ @Column({
34
+ nullable: true
35
+ })
36
+ description: string
37
+
38
+ @CreateDateColumn()
39
+ createdAt: Date
40
+
41
+ @UpdateDateColumn()
42
+ updatedAt: Date
43
+
44
+ @ManyToOne(type => User, {
45
+ nullable: true
46
+ })
47
+ creator: User
48
+
49
+ @ManyToOne(type => User, {
50
+ nullable: true
51
+ })
52
+ updater: User
53
+ }
@@ -0,0 +1,63 @@
1
+ import { CreateDateColumn, UpdateDateColumn, Entity, Index, Column, OneToMany, ManyToOne, PrimaryGeneratedColumn } from 'typeorm'
2
+ import { Domain, roundTransformer } from '@things-factory/shell'
3
+ import { User } from '@things-factory/auth-base'
4
+ import { MarketplaceProductVariation } from '../entities'
5
+
6
+ @Entity()
7
+ @Index(
8
+ 'ix_marketplace_product_variation_price_0',
9
+ (marketplaceProductVariationPrice: MarketplaceProductVariationPrice) => [marketplaceProductVariationPrice.domain, marketplaceProductVariationPrice.name],
10
+ { unique: true }
11
+ )
12
+ export class MarketplaceProductVariationPrice {
13
+ @PrimaryGeneratedColumn('uuid')
14
+ id: string
15
+
16
+ @ManyToOne(type => Domain)
17
+ domain: Domain
18
+
19
+ @Column()
20
+ name: string
21
+
22
+ @Column({
23
+ nullable: true
24
+ })
25
+ description: string
26
+
27
+ @ManyToOne(type => MarketplaceProductVariation, marketplaceProductVariation => marketplaceProductVariation.marketplaceProductVariationPrices)
28
+ marketplaceProductVariation: MarketplaceProductVariation
29
+
30
+ @Column({ nullable: true })
31
+ currency: string
32
+
33
+ @Column('float', { nullable: true, transformer: roundTransformer })
34
+ mrpPrice: number
35
+
36
+ @Column('float', { nullable: true, transformer: roundTransformer })
37
+ costPrice: number
38
+
39
+ @Column('float', { nullable: true, transformer: roundTransformer })
40
+ sellPrice: number
41
+
42
+ @Column('float', { nullable: true, transformer: roundTransformer })
43
+ afterTaxCostPrice: number
44
+
45
+ @Column('float', { nullable: true, transformer: roundTransformer })
46
+ afterTaxSalesPrice: number
47
+
48
+ @CreateDateColumn()
49
+ createdAt: Date
50
+
51
+ @UpdateDateColumn()
52
+ updatedAt: Date
53
+
54
+ @ManyToOne(type => User, {
55
+ nullable: true
56
+ })
57
+ creator: User
58
+
59
+ @ManyToOne(type => User, {
60
+ nullable: true
61
+ })
62
+ updater: User
63
+ }
@@ -0,0 +1,147 @@
1
+ import { Column, CreateDateColumn, Entity, Index, ManyToOne, OneToMany, PrimaryGeneratedColumn, UpdateDateColumn } from 'typeorm'
2
+
3
+ import { User } from '@things-factory/auth-base'
4
+ import { Domain, roundTransformer } from '@things-factory/shell'
5
+
6
+ import { MarketplaceProduct, MarketplaceProductVariationPrice } from '../entities'
7
+ import { NoGenerator } from '../utils'
8
+
9
+ @Entity()
10
+ @Index(
11
+ 'ix_marketplace-product-variation_0',
12
+ (marketplaceProductVariation: MarketplaceProductVariation) => [marketplaceProductVariation.domain, marketplaceProductVariation.id],
13
+ { unique: true }
14
+ )
15
+ export class MarketplaceProductVariation {
16
+ constructor(productVariation) {
17
+ if (productVariation) {
18
+ this.id = productVariation.id
19
+ this.domain = productVariation.domain
20
+ this.marketplaceProduct = productVariation.marketplaceProduct
21
+ this.variationId = productVariation.variationId.toString()
22
+ this.variationSku = productVariation.variationSku ? productVariation.variationSku.toString() : NoGenerator.sku()
23
+ this.channelSku = productVariation.channelSku ? productVariation.channelSku.toString() : NoGenerator.sku()
24
+ this.name = productVariation.name ? productVariation.name.toString() : NoGenerator.id()
25
+ this.description = productVariation.description
26
+ this.qty = productVariation.qty
27
+ this.reserveQty = productVariation.reserveQty
28
+ this.type = productVariation.type
29
+ this.mrpPrice = productVariation.mrpPrice
30
+ this.costPrice = productVariation.costPrice
31
+ this.sellPrice = productVariation.sellPrice
32
+ this.discountId = productVariation.discountId
33
+ this.status = productVariation.status
34
+ this.marketplaceStatus = productVariation.marketplaceStatus
35
+ this.afterTaxCostPrice = productVariation.afterTaxCostPrice
36
+ this.afterTaxSalesPrice = productVariation.afterTaxSalesPrice
37
+ this.inventoryPolicy = productVariation.inventoryPolicy
38
+ this.primaryUnit = productVariation.weight
39
+ this.primaryUnitValue = productVariation.weightUnit
40
+ this.inventoryItemId = productVariation.inventoryItemId
41
+ this.locationId = productVariation.locationId
42
+ this.creator = productVariation.creator
43
+ this.updater = productVariation.updater
44
+ }
45
+ }
46
+
47
+ @PrimaryGeneratedColumn('uuid')
48
+ id: string
49
+
50
+ @ManyToOne(type => Domain)
51
+ domain: Domain
52
+
53
+ /**
54
+ * for mapping to sku column in products in product-base
55
+ */
56
+ @Column({ nullable: true })
57
+ sku: string
58
+
59
+ @ManyToOne(type => MarketplaceProduct, marketplaceProduct => marketplaceProduct.marketplaceProductVariations)
60
+ marketplaceProduct: MarketplaceProduct
61
+
62
+ @OneToMany(type => MarketplaceProductVariationPrice, marketplaceProductVariationPrice => marketplaceProductVariationPrice.marketplaceProductVariation)
63
+ marketplaceProductVariationPrices: MarketplaceProductVariationPrice[]
64
+
65
+ @Column()
66
+ variationId: string
67
+
68
+ @Column({ nullable: true })
69
+ variationSku: string
70
+
71
+ @Column({ nullable: true })
72
+ channelSku: string
73
+
74
+ @Column({ nullable: true })
75
+ name: string
76
+
77
+ @Column({ nullable: true })
78
+ description: string
79
+
80
+ @Column('float', { nullable: true, transformer: roundTransformer })
81
+ qty: number
82
+
83
+ @Column('float', { nullable: true, transformer: roundTransformer })
84
+ reserveQty: number
85
+
86
+ @Column({ nullable: true })
87
+ type: string
88
+
89
+ @Column('float', { nullable: true, transformer: roundTransformer })
90
+ mrpPrice: number
91
+
92
+ @Column('float', { nullable: true, transformer: roundTransformer })
93
+ costPrice: number
94
+
95
+ @Column('float', { nullable: true, transformer: roundTransformer })
96
+ sellPrice: number
97
+
98
+ @Column({ nullable: true })
99
+ discountId: string
100
+
101
+ @Column({ nullable: true })
102
+ status: string
103
+
104
+ @Column({ nullable: true })
105
+ marketplaceStatus: string
106
+
107
+ @Column('float', { nullable: true, transformer: roundTransformer })
108
+ afterTaxCostPrice: number
109
+
110
+ @Column('float', { nullable: true, transformer: roundTransformer })
111
+ afterTaxSalesPrice: number
112
+
113
+ @Column({ nullable: true })
114
+ inventoryPolicy: string
115
+
116
+ @Column({ nullable: true })
117
+ primaryUnit: string
118
+
119
+ @Column('float', { nullable: true, transformer: roundTransformer })
120
+ primaryUnitValue: number
121
+
122
+ @Column({
123
+ nullable: true
124
+ })
125
+ inventoryItemId: string
126
+
127
+ @Column({
128
+ nullable: true
129
+ })
130
+ locationId: string
131
+
132
+ @CreateDateColumn()
133
+ createdAt: Date
134
+
135
+ @UpdateDateColumn()
136
+ updatedAt: Date
137
+
138
+ @ManyToOne(type => User, {
139
+ nullable: true
140
+ })
141
+ creator: User
142
+
143
+ @ManyToOne(type => User, {
144
+ nullable: true
145
+ })
146
+ updater: User
147
+ }
@@ -0,0 +1,164 @@
1
+ import { User } from '@things-factory/auth-base'
2
+ import { MarketplaceStore } from '@things-factory/integration-marketplace'
3
+ import { Domain } from '@things-factory/shell'
4
+ import {
5
+ Column,
6
+ CreateDateColumn,
7
+ Entity,
8
+ Index,
9
+ ManyToOne,
10
+ OneToMany,
11
+ PrimaryGeneratedColumn,
12
+ UpdateDateColumn
13
+ } from 'typeorm'
14
+ import { MarketplaceProductAttribute, MarketplaceProductCategory, MarketplaceProductVariation } from '../entities'
15
+ import { NoGenerator } from '../utils'
16
+
17
+ @Entity()
18
+ @Index(
19
+ 'ix_marketplace-product_0',
20
+ (marketplaceProduct: MarketplaceProduct) => [marketplaceProduct.domain, marketplaceProduct.id],
21
+ { unique: true }
22
+ )
23
+ export class MarketplaceProduct {
24
+ constructor(product) {
25
+ if (product) {
26
+ this.id = product.id
27
+ this.itemId = product.itemId
28
+ this.isku = product.isku ? product.isku : NoGenerator.sku()
29
+ this.marketplaceStore = product.marketplaceStore
30
+ this.marketplaceStatus = product.marketplaceStatus
31
+ this.status = product.status
32
+ this.name = product.name
33
+ this.type = product.type
34
+ this.description = product.description
35
+ this.currency = product.currency
36
+ this.hasVariation = product.hasVariation
37
+ this.categoryId = product.categoryId
38
+ this.condition = product.condition
39
+ this.daysToShip = product.daysToShip
40
+ this.discountId = product.discountId
41
+ this.isPreOrder = product.isPreOrder
42
+ this.domain = product.domain
43
+ this.creator = product.creator
44
+ this.updater = product.updater
45
+ }
46
+ }
47
+
48
+ @PrimaryGeneratedColumn('uuid')
49
+ id: string
50
+
51
+ @ManyToOne(type => Domain)
52
+ domain: Domain
53
+
54
+ @Column({ nullable: true })
55
+ code: string
56
+
57
+ @ManyToOne(type => MarketplaceStore)
58
+ marketplaceStore: MarketplaceStore
59
+
60
+ @OneToMany(
61
+ type => MarketplaceProductVariation,
62
+ marketplaceProductVariation => marketplaceProductVariation.marketplaceProduct,
63
+ {
64
+ nullable: true
65
+ }
66
+ )
67
+ marketplaceProductVariations: MarketplaceProductVariation[]
68
+
69
+ @ManyToOne(type => MarketplaceProductCategory, {
70
+ nullable: true
71
+ })
72
+ marketplaceProductCategory: MarketplaceProductCategory
73
+
74
+ @OneToMany(
75
+ type => MarketplaceProductAttribute,
76
+ marketplaceProductAttribute => marketplaceProductAttribute.marketplaceProduct,
77
+ {
78
+ nullable: true
79
+ }
80
+ )
81
+ marketplaceProductAttributes: MarketplaceProductAttribute[]
82
+
83
+ @Column()
84
+ itemId: string
85
+
86
+ @Column()
87
+ isku: String
88
+
89
+ @Column({
90
+ nullable: true
91
+ })
92
+ marketplaceStatus: string
93
+
94
+ @Column({
95
+ nullable: true
96
+ })
97
+ status: string
98
+
99
+ @Column({
100
+ nullable: true
101
+ })
102
+ name: string
103
+
104
+ @Column({
105
+ nullable: true
106
+ })
107
+ type: string
108
+
109
+ @Column({
110
+ nullable: true
111
+ })
112
+ description: string
113
+
114
+ @Column({
115
+ nullable: true
116
+ })
117
+ currency: string
118
+
119
+ @Column({
120
+ nullable: true
121
+ })
122
+ hasVariation: boolean
123
+
124
+ @Column({
125
+ nullable: true
126
+ })
127
+ categoryId: number
128
+
129
+ @Column({
130
+ nullable: true
131
+ })
132
+ condition: string
133
+
134
+ @Column({
135
+ nullable: true
136
+ })
137
+ daysToShip: number
138
+
139
+ @Column({
140
+ nullable: true
141
+ })
142
+ discountId: string
143
+
144
+ @Column({
145
+ nullable: true
146
+ })
147
+ isPreOrder: boolean
148
+
149
+ @CreateDateColumn()
150
+ createdAt: Date
151
+
152
+ @UpdateDateColumn()
153
+ updatedAt: Date
154
+
155
+ @ManyToOne(type => User, {
156
+ nullable: true
157
+ })
158
+ creator: User
159
+
160
+ @ManyToOne(type => User, {
161
+ nullable: true
162
+ })
163
+ updater: User
164
+ }
@@ -0,0 +1,56 @@
1
+ import { Column, CreateDateColumn, Entity, Index, ManyToOne, PrimaryGeneratedColumn, UpdateDateColumn } from 'typeorm'
2
+
3
+ import { User } from '@things-factory/auth-base'
4
+ import { Domain, roundTransformer } from '@things-factory/shell'
5
+ import { MarketplaceRefundOrder } from '../entities'
6
+ import { MarketplaceProductVariation } from '../entities'
7
+ @Entity()
8
+ @Index(
9
+ 'ix_marketplace-refund-order-item_0',
10
+ (marketplaceRefundOrderItem: MarketplaceRefundOrderItem) => [marketplaceRefundOrderItem.domain, marketplaceRefundOrderItem.name],
11
+ { unique: true }
12
+ )
13
+ export class MarketplaceRefundOrderItem {
14
+ @PrimaryGeneratedColumn('uuid')
15
+ id: string
16
+
17
+ @ManyToOne(type => Domain)
18
+ domain: Domain
19
+
20
+ @ManyToOne(type => MarketplaceRefundOrder)
21
+ marketplaceRefundOrder: MarketplaceRefundOrder
22
+
23
+ @ManyToOne(type => MarketplaceProductVariation)
24
+ marketplaceProductVariation: MarketplaceProductVariation
25
+
26
+ @Column()
27
+ name: string
28
+
29
+ @Column()
30
+ orderItemId: string
31
+
32
+ @Column({ nullable: true })
33
+ status: string
34
+
35
+ @Column({ nullable: true, type: 'float', transformer: roundTransformer })
36
+ price: number
37
+
38
+ @Column({ nullable: true })
39
+ qty: string
40
+
41
+ @CreateDateColumn()
42
+ createdAt: Date
43
+
44
+ @UpdateDateColumn()
45
+ updatedAt: Date
46
+
47
+ @ManyToOne(type => User, {
48
+ nullable: true
49
+ })
50
+ creator: User
51
+
52
+ @ManyToOne(type => User, {
53
+ nullable: true
54
+ })
55
+ updater: User
56
+ }
@@ -0,0 +1,51 @@
1
+ import { Column, CreateDateColumn, Entity, Index, ManyToOne, OneToMany, PrimaryGeneratedColumn, UpdateDateColumn } from 'typeorm'
2
+
3
+ import { User } from '@things-factory/auth-base'
4
+ import { MarketplaceRefundOrderItem, MarketplaceOrder } from '../entities'
5
+ import { Domain, roundTransformer } from '@things-factory/shell'
6
+
7
+ @Entity()
8
+ @Index('ix_marketplace-refund-order_0', (marketplaceRefundOrder: MarketplaceRefundOrder) => [marketplaceRefundOrder.domain, marketplaceRefundOrder.name], {
9
+ unique: true
10
+ })
11
+ export class MarketplaceRefundOrder {
12
+ @PrimaryGeneratedColumn('uuid')
13
+ id: string
14
+
15
+ @ManyToOne(type => Domain)
16
+ domain: Domain
17
+
18
+ @Column()
19
+ name: string
20
+
21
+ @OneToMany(type => MarketplaceRefundOrderItem, marketplaceRefundOrderItem => marketplaceRefundOrderItem.marketplaceRefundOrder)
22
+ marketplaceRefundOrderItems: MarketplaceRefundOrderItem[]
23
+
24
+ @Column()
25
+ originalOrderNo: string
26
+
27
+ @Column()
28
+ orderNo: string
29
+
30
+ @Column({ nullable: true, type: 'float', transformer: roundTransformer })
31
+ amount: number
32
+
33
+ @Column({ nullable: true })
34
+ status: string
35
+
36
+ @CreateDateColumn()
37
+ createdAt: Date
38
+
39
+ @UpdateDateColumn()
40
+ updatedAt: Date
41
+
42
+ @ManyToOne(type => User, {
43
+ nullable: true
44
+ })
45
+ creator: User
46
+
47
+ @ManyToOne(type => User, {
48
+ nullable: true
49
+ })
50
+ updater: User
51
+ }
@@ -0,0 +1,49 @@
1
+ import { User } from '@things-factory/auth-base'
2
+ import { MarketplaceStore } from '@things-factory/integration-marketplace'
3
+ import { Domain } from '@things-factory/shell'
4
+ import { Column, CreateDateColumn, Entity, Index, ManyToOne, PrimaryGeneratedColumn, UpdateDateColumn } from 'typeorm'
5
+
6
+ @Entity()
7
+ @Index(
8
+ 'ix_marketplace_setting_0',
9
+ (marketplaceSetting: MarketplaceSetting) => [
10
+ marketplaceSetting.domain,
11
+ marketplaceSetting.marketplaceStore,
12
+ marketplaceSetting.name
13
+ ],
14
+ { unique: true }
15
+ )
16
+ export class MarketplaceSetting {
17
+ @PrimaryGeneratedColumn('uuid')
18
+ id: string
19
+
20
+ @ManyToOne(type => Domain)
21
+ domain: Domain
22
+
23
+ @Column()
24
+ name: string
25
+
26
+ @Column({ nullable: true })
27
+ description: string
28
+
29
+ @Column({ nullable: true })
30
+ category: string
31
+
32
+ @Column()
33
+ value: string
34
+
35
+ @ManyToOne(type => MarketplaceStore)
36
+ marketplaceStore: MarketplaceStore
37
+
38
+ @CreateDateColumn()
39
+ createdAt: Date
40
+
41
+ @UpdateDateColumn()
42
+ updatedAt: Date
43
+
44
+ @ManyToOne(type => User, { nullable: true })
45
+ creator: User
46
+
47
+ @ManyToOne(type => User, { nullable: true })
48
+ updater: User
49
+ }