@things-factory/marketplace-base 8.0.7 → 9.0.0-beta.12

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 +0 -3
  4. package/server/constants/index.ts +0 -4
  5. package/server/constants/order.ts +0 -11
  6. package/server/constants/platform.ts +0 -7
  7. package/server/constants/product.ts +0 -5
  8. package/server/constants/reserve-qty-order-statuses.ts +0 -7
  9. package/server/controllers/index.ts +0 -0
  10. package/server/entities/index.ts +0 -45
  11. package/server/entities/marketplace-order-item.ts +0 -137
  12. package/server/entities/marketplace-order-shipping-item.ts +0 -55
  13. package/server/entities/marketplace-order-shipping.ts +0 -168
  14. package/server/entities/marketplace-order.ts +0 -141
  15. package/server/entities/marketplace-product-attribute.ts +0 -83
  16. package/server/entities/marketplace-product-category.ts +0 -53
  17. package/server/entities/marketplace-product-variation-price.ts +0 -63
  18. package/server/entities/marketplace-product-variation.ts +0 -147
  19. package/server/entities/marketplace-product.ts +0 -164
  20. package/server/entities/marketplace-refund-order-item.ts +0 -56
  21. package/server/entities/marketplace-refund-order.ts +0 -51
  22. package/server/entities/marketplace-setting.ts +0 -49
  23. package/server/entities/store-replenishment-item.ts +0 -48
  24. package/server/entities/store-replenishment.ts +0 -79
  25. package/server/graphql/index.ts +0 -9
  26. package/server/graphql/resolvers/index.ts +0 -14
  27. package/server/graphql/resolvers/marketplace-order/auto-initialise-logistics-by-batch.ts +0 -164
  28. package/server/graphql/resolvers/marketplace-order/auto-update-order-ready-to-ship.ts +0 -136
  29. package/server/graphql/resolvers/marketplace-order/cancel-marketplace-order.ts +0 -64
  30. package/server/graphql/resolvers/marketplace-order/create-marketplace-order-note.ts +0 -21
  31. package/server/graphql/resolvers/marketplace-order/dashboard-marketplace-orders.ts +0 -82
  32. package/server/graphql/resolvers/marketplace-order/dashboard-marketplace-sales-average.ts +0 -82
  33. package/server/graphql/resolvers/marketplace-order/dashboard-marketplace-sales.ts +0 -93
  34. package/server/graphql/resolvers/marketplace-order/delete-marketplace-orders.ts +0 -17
  35. package/server/graphql/resolvers/marketplace-order/generate-marketplace-order.ts +0 -180
  36. package/server/graphql/resolvers/marketplace-order/get-address-list.ts +0 -9
  37. package/server/graphql/resolvers/marketplace-order/get-branch-list.ts +0 -9
  38. package/server/graphql/resolvers/marketplace-order/get-etrax-order-document.ts +0 -49
  39. package/server/graphql/resolvers/marketplace-order/get-logistics-param.ts +0 -47
  40. package/server/graphql/resolvers/marketplace-order/get-order-document.ts +0 -149
  41. package/server/graphql/resolvers/marketplace-order/get-store-logistics.ts +0 -9
  42. package/server/graphql/resolvers/marketplace-order/get-time-slot.ts +0 -9
  43. package/server/graphql/resolvers/marketplace-order/index.ts +0 -75
  44. package/server/graphql/resolvers/marketplace-order/initialise-lazada-logistics-by-batch.ts +0 -165
  45. package/server/graphql/resolvers/marketplace-order/initialise-logistics-by-batch.ts +0 -41
  46. package/server/graphql/resolvers/marketplace-order/initialise-logistics.ts +0 -29
  47. package/server/graphql/resolvers/marketplace-order/initialise-shopee-logistics-by-batch.ts +0 -97
  48. package/server/graphql/resolvers/marketplace-order/marketplace-order.ts +0 -12
  49. package/server/graphql/resolvers/marketplace-order/marketplace-orders-for-batch-init.ts +0 -52
  50. package/server/graphql/resolvers/marketplace-order/marketplace-orders-for-export.ts +0 -63
  51. package/server/graphql/resolvers/marketplace-order/marketplace-orders.ts +0 -56
  52. package/server/graphql/resolvers/marketplace-order/set-marketplace-order-delivered.ts +0 -25
  53. package/server/graphql/resolvers/marketplace-order/set-marketplace-order-failed-delivery.ts +0 -25
  54. package/server/graphql/resolvers/marketplace-order/set-own-shipping-provider-by-orders.ts +0 -39
  55. package/server/graphql/resolvers/marketplace-order/split-orders-by-batch.ts +0 -245
  56. package/server/graphql/resolvers/marketplace-order/sync-all-marketplace-order.ts +0 -39
  57. package/server/graphql/resolvers/marketplace-order/sync-marketplace-order.ts +0 -940
  58. package/server/graphql/resolvers/marketplace-order/sync-marketplace-orders-by-platform.ts +0 -31
  59. package/server/graphql/resolvers/marketplace-order/sync-shopee-awb.ts +0 -49
  60. package/server/graphql/resolvers/marketplace-order/update-marketplace-order.ts +0 -35
  61. package/server/graphql/resolvers/marketplace-order/update-order-ready-to-ship.ts +0 -142
  62. package/server/graphql/resolvers/marketplace-order-item/create-marketplace-order-item.ts +0 -14
  63. package/server/graphql/resolvers/marketplace-order-item/delete-marketplace-order-item.ts +0 -10
  64. package/server/graphql/resolvers/marketplace-order-item/delete-marketplace-order-items.ts +0 -17
  65. package/server/graphql/resolvers/marketplace-order-item/index.ts +0 -22
  66. package/server/graphql/resolvers/marketplace-order-item/marketplace-order-item.ts +0 -14
  67. package/server/graphql/resolvers/marketplace-order-item/marketplace-order-items.ts +0 -15
  68. package/server/graphql/resolvers/marketplace-order-item/update-marketplace-order-item.ts +0 -18
  69. package/server/graphql/resolvers/marketplace-order-item/update-multiple-marketplace-order-item.ts +0 -44
  70. package/server/graphql/resolvers/marketplace-order-shipping/create-marketplace-order-shipping.ts +0 -14
  71. package/server/graphql/resolvers/marketplace-order-shipping/delete-marketplace-order-shipping.ts +0 -10
  72. package/server/graphql/resolvers/marketplace-order-shipping/delete-marketplace-order-shippings.ts +0 -17
  73. package/server/graphql/resolvers/marketplace-order-shipping/index.ts +0 -23
  74. package/server/graphql/resolvers/marketplace-order-shipping/marketplace-order-shipping.ts +0 -25
  75. package/server/graphql/resolvers/marketplace-order-shipping/marketplace-order-shippings-for-batch-init.ts +0 -88
  76. package/server/graphql/resolvers/marketplace-order-shipping/marketplace-order-shippings.ts +0 -43
  77. package/server/graphql/resolvers/marketplace-order-shipping/update-marketplace-order-shipping.ts +0 -32
  78. package/server/graphql/resolvers/marketplace-order-shipping/update-multiple-marketplace-order-shipping.ts +0 -44
  79. package/server/graphql/resolvers/marketplace-order-shipping-item/create-marketplace-order-shipping-item.ts +0 -14
  80. package/server/graphql/resolvers/marketplace-order-shipping-item/delete-marketplace-order-shipping-item.ts +0 -10
  81. package/server/graphql/resolvers/marketplace-order-shipping-item/delete-marketplace-order-shipping-items.ts +0 -15
  82. package/server/graphql/resolvers/marketplace-order-shipping-item/index.ts +0 -20
  83. package/server/graphql/resolvers/marketplace-order-shipping-item/marketplace-order-shipping-item.ts +0 -21
  84. package/server/graphql/resolvers/marketplace-order-shipping-item/marketplace-order-shipping-items.ts +0 -14
  85. package/server/graphql/resolvers/marketplace-order-shipping-item/update-marketplace-order-shipping-item.ts +0 -18
  86. package/server/graphql/resolvers/marketplace-order-shipping-item/update-multiple-marketplace-order-shipping-item.ts +0 -44
  87. package/server/graphql/resolvers/marketplace-product/create-marketplace-product.ts +0 -35
  88. package/server/graphql/resolvers/marketplace-product/delete-marketplace-product.ts +0 -10
  89. package/server/graphql/resolvers/marketplace-product/delete-marketplace-products.ts +0 -17
  90. package/server/graphql/resolvers/marketplace-product/index.ts +0 -27
  91. package/server/graphql/resolvers/marketplace-product/marketplace-product.ts +0 -24
  92. package/server/graphql/resolvers/marketplace-product/marketplace-products.ts +0 -23
  93. package/server/graphql/resolvers/marketplace-product/sync-all-marketplace-store-products.ts +0 -225
  94. package/server/graphql/resolvers/marketplace-product/sync-marketplace-store-products.ts +0 -222
  95. package/server/graphql/resolvers/marketplace-product/update-marketplace-product.ts +0 -24
  96. package/server/graphql/resolvers/marketplace-product/upsert-marketplace-product.ts +0 -39
  97. package/server/graphql/resolvers/marketplace-product-attribute/create-marketplace-product-attribute.ts +0 -14
  98. package/server/graphql/resolvers/marketplace-product-attribute/delete-marketplace-product-attribute.ts +0 -10
  99. package/server/graphql/resolvers/marketplace-product-attribute/delete-marketplace-product-attributes.ts +0 -17
  100. package/server/graphql/resolvers/marketplace-product-attribute/index.ts +0 -22
  101. package/server/graphql/resolvers/marketplace-product-attribute/marketplace-product-attribute.ts +0 -14
  102. package/server/graphql/resolvers/marketplace-product-attribute/marketplace-product-attributes.ts +0 -14
  103. package/server/graphql/resolvers/marketplace-product-attribute/update-marketplace-product-attribute.ts +0 -18
  104. package/server/graphql/resolvers/marketplace-product-attribute/update-multiple-marketplace-product-attribute.ts +0 -44
  105. package/server/graphql/resolvers/marketplace-product-category/create-marketplace-product-category.ts +0 -14
  106. package/server/graphql/resolvers/marketplace-product-category/delete-marketplace-product-categories.ts +0 -17
  107. package/server/graphql/resolvers/marketplace-product-category/delete-marketplace-product-category.ts +0 -10
  108. package/server/graphql/resolvers/marketplace-product-category/index.ts +0 -22
  109. package/server/graphql/resolvers/marketplace-product-category/marketplace-product-categories.ts +0 -14
  110. package/server/graphql/resolvers/marketplace-product-category/marketplace-product-category.ts +0 -14
  111. package/server/graphql/resolvers/marketplace-product-category/update-marketplace-product-category.ts +0 -18
  112. package/server/graphql/resolvers/marketplace-product-category/update-multiple-marketplace-product-category.ts +0 -44
  113. package/server/graphql/resolvers/marketplace-product-variation/create-marketplace-product-variation.ts +0 -14
  114. package/server/graphql/resolvers/marketplace-product-variation/delete-marketplace-product-variation.ts +0 -10
  115. package/server/graphql/resolvers/marketplace-product-variation/delete-marketplace-product-variations.ts +0 -17
  116. package/server/graphql/resolvers/marketplace-product-variation/index.ts +0 -30
  117. package/server/graphql/resolvers/marketplace-product-variation/link-warehouse-marketplace-product-variations.ts +0 -59
  118. package/server/graphql/resolvers/marketplace-product-variation/marketplace-product-variation.ts +0 -14
  119. package/server/graphql/resolvers/marketplace-product-variation/marketplace-product-variations.ts +0 -79
  120. package/server/graphql/resolvers/marketplace-product-variation/update-marketplace-product-variation.ts +0 -32
  121. package/server/graphql/resolvers/marketplace-product-variation/update-multiple-marketplace-product-variation-quantity.ts +0 -76
  122. package/server/graphql/resolvers/marketplace-product-variation/update-multiple-marketplace-product-variations.ts +0 -49
  123. package/server/graphql/resolvers/marketplace-product-variation-price/create-marketplace-product-variation-price.ts +0 -16
  124. package/server/graphql/resolvers/marketplace-product-variation-price/delete-marketplace-product-variation-price.ts +0 -13
  125. package/server/graphql/resolvers/marketplace-product-variation-price/delete-marketplace-product-variation-prices.ts +0 -18
  126. package/server/graphql/resolvers/marketplace-product-variation-price/index.ts +0 -19
  127. package/server/graphql/resolvers/marketplace-product-variation-price/marketplace-product-variation-price-query.ts +0 -52
  128. package/server/graphql/resolvers/marketplace-product-variation-price/update-marketplace-product-variation-price.ts +0 -20
  129. package/server/graphql/resolvers/marketplace-product-variation-price/update-multiple-marketplace-product-variation-price.ts +0 -49
  130. package/server/graphql/resolvers/marketplace-refund-order/index.ts +0 -9
  131. package/server/graphql/resolvers/marketplace-refund-order/sync-all-marketplace-refund-orders.ts +0 -122
  132. package/server/graphql/resolvers/marketplace-refund-order/sync-marketplace-refund-orders.ts +0 -106
  133. package/server/graphql/resolvers/marketplace-report/index.ts +0 -7
  134. package/server/graphql/resolvers/marketplace-report/marketplace-sales-report.ts +0 -143
  135. package/server/graphql/resolvers/store-replenishment/create-store-replenishment.ts +0 -16
  136. package/server/graphql/resolvers/store-replenishment/delete-store-replenishment.ts +0 -13
  137. package/server/graphql/resolvers/store-replenishment/delete-store-replenishments.ts +0 -18
  138. package/server/graphql/resolvers/store-replenishment/index.ts +0 -19
  139. package/server/graphql/resolvers/store-replenishment/store-replenishment-query.ts +0 -52
  140. package/server/graphql/resolvers/store-replenishment/update-multiple-store-replenishment.ts +0 -49
  141. package/server/graphql/resolvers/store-replenishment/update-store-replenishment.ts +0 -20
  142. package/server/graphql/resolvers/store-replenishment-item/create-store-replenishment-item.ts +0 -16
  143. package/server/graphql/resolvers/store-replenishment-item/delete-store-replenishment-item.ts +0 -13
  144. package/server/graphql/resolvers/store-replenishment-item/delete-store-replenishment-items.ts +0 -18
  145. package/server/graphql/resolvers/store-replenishment-item/index.ts +0 -19
  146. package/server/graphql/resolvers/store-replenishment-item/store-replenishment-item-query.ts +0 -52
  147. package/server/graphql/resolvers/store-replenishment-item/update-multiple-store-replenishment-item.ts +0 -49
  148. package/server/graphql/resolvers/store-replenishment-item/update-store-replenishment-item.ts +0 -20
  149. package/server/graphql/types/index.ts +0 -13
  150. package/server/graphql/types/marketplace-order/dashboard-order.ts +0 -13
  151. package/server/graphql/types/marketplace-order/full-logistics-detail.ts +0 -10
  152. package/server/graphql/types/marketplace-order/index.ts +0 -69
  153. package/server/graphql/types/marketplace-order/logistics-detail.ts +0 -8
  154. package/server/graphql/types/marketplace-order/logistics-info.ts +0 -27
  155. package/server/graphql/types/marketplace-order/logistics-init.ts +0 -9
  156. package/server/graphql/types/marketplace-order/logistics-time.ts +0 -9
  157. package/server/graphql/types/marketplace-order/logistics.ts +0 -21
  158. package/server/graphql/types/marketplace-order/marketplace-logistics.ts +0 -11
  159. package/server/graphql/types/marketplace-order/marketplace-order-export.ts +0 -19
  160. package/server/graphql/types/marketplace-order/marketplace-order-list.ts +0 -8
  161. package/server/graphql/types/marketplace-order/marketplace-order-patch.ts +0 -14
  162. package/server/graphql/types/marketplace-order/marketplace-order.ts +0 -40
  163. package/server/graphql/types/marketplace-order/new-marketplace-order.ts +0 -22
  164. package/server/graphql/types/marketplace-order/order-address.ts +0 -16
  165. package/server/graphql/types/marketplace-order/order-document.ts +0 -13
  166. package/server/graphql/types/marketplace-order-item/index.ts +0 -21
  167. package/server/graphql/types/marketplace-order-item/marketplace-order-item-list.ts +0 -8
  168. package/server/graphql/types/marketplace-order-item/marketplace-order-item-patch.ts +0 -10
  169. package/server/graphql/types/marketplace-order-item/marketplace-order-item.ts +0 -32
  170. package/server/graphql/types/marketplace-order-item/new-marketplace-order-item.ts +0 -17
  171. package/server/graphql/types/marketplace-order-shipping/index.ts +0 -31
  172. package/server/graphql/types/marketplace-order-shipping/marketplace-order-shipping-list.ts +0 -8
  173. package/server/graphql/types/marketplace-order-shipping/marketplace-order-shipping-patch.ts +0 -45
  174. package/server/graphql/types/marketplace-order-shipping/marketplace-order-shipping.ts +0 -59
  175. package/server/graphql/types/marketplace-order-shipping/new-marketplace-order-shipping.ts +0 -44
  176. package/server/graphql/types/marketplace-order-shipping-item/index.ts +0 -32
  177. package/server/graphql/types/marketplace-order-shipping-item/marketplace-order-shipping-item-list.ts +0 -8
  178. package/server/graphql/types/marketplace-order-shipping-item/marketplace-order-shipping-item-patch.ts +0 -13
  179. package/server/graphql/types/marketplace-order-shipping-item/marketplace-order-shipping-item.ts +0 -16
  180. package/server/graphql/types/marketplace-order-shipping-item/new-marketplace-order-shipping-item.ts +0 -12
  181. package/server/graphql/types/marketplace-product/index.ts +0 -28
  182. package/server/graphql/types/marketplace-product/marketplace-product-list.ts +0 -8
  183. package/server/graphql/types/marketplace-product/marketplace-product-patch.ts +0 -24
  184. package/server/graphql/types/marketplace-product/marketplace-product.ts +0 -30
  185. package/server/graphql/types/marketplace-product/new-marketplace-product.ts +0 -24
  186. package/server/graphql/types/marketplace-product-attribute/index.ts +0 -35
  187. package/server/graphql/types/marketplace-product-attribute/marketplace-product-attribute-list.ts +0 -8
  188. package/server/graphql/types/marketplace-product-attribute/marketplace-product-attribute-patch.ts +0 -10
  189. package/server/graphql/types/marketplace-product-attribute/marketplace-product-attribute.ts +0 -20
  190. package/server/graphql/types/marketplace-product-attribute/new-marketplace-product-attribute.ts +0 -13
  191. package/server/graphql/types/marketplace-product-category/index.ts +0 -28
  192. package/server/graphql/types/marketplace-product-category/marketplace-product-category-list.ts +0 -8
  193. package/server/graphql/types/marketplace-product-category/marketplace-product-category-patch.ts +0 -10
  194. package/server/graphql/types/marketplace-product-category/marketplace-product-category.ts +0 -17
  195. package/server/graphql/types/marketplace-product-category/new-marketplace-product-category.ts +0 -10
  196. package/server/graphql/types/marketplace-product-variation/index.ts +0 -47
  197. package/server/graphql/types/marketplace-product-variation/marketplace-product-variation-list.ts +0 -8
  198. package/server/graphql/types/marketplace-product-variation/marketplace-product-variation-patch.ts +0 -32
  199. package/server/graphql/types/marketplace-product-variation/marketplace-product-variation.ts +0 -35
  200. package/server/graphql/types/marketplace-product-variation/new-marketplace-product-variation.ts +0 -26
  201. package/server/graphql/types/marketplace-product-variation/warehouse-product.ts +0 -9
  202. package/server/graphql/types/marketplace-product-variation-price/index.ts +0 -21
  203. package/server/graphql/types/marketplace-product-variation-price/marketplace-product-variation-price-list.ts +0 -8
  204. package/server/graphql/types/marketplace-product-variation-price/marketplace-product-variation-price-patch.ts +0 -17
  205. package/server/graphql/types/marketplace-product-variation-price/marketplace-product-variation-price.ts +0 -21
  206. package/server/graphql/types/marketplace-product-variation-price/new-marketplace-product-variation-price.ts +0 -14
  207. package/server/graphql/types/marketplace-refund-order/index.ts +0 -16
  208. package/server/graphql/types/marketplace-refund-order/marketplace-refund-order-list.ts +0 -8
  209. package/server/graphql/types/marketplace-refund-order/marketplace-refund-order.ts +0 -17
  210. package/server/graphql/types/marketplace-report/index.ts +0 -10
  211. package/server/graphql/types/marketplace-report/marketplace-sales-report-list.ts +0 -8
  212. package/server/graphql/types/marketplace-report/marketplace-sales-report.ts +0 -67
  213. package/server/graphql/types/store-replenishment/index.ts +0 -21
  214. package/server/graphql/types/store-replenishment/new-store-replenishment.ts +0 -8
  215. package/server/graphql/types/store-replenishment/store-replenishment-list.ts +0 -8
  216. package/server/graphql/types/store-replenishment/store-replenishment-patch.ts +0 -10
  217. package/server/graphql/types/store-replenishment/store-replenishment.ts +0 -24
  218. package/server/graphql/types/store-replenishment-item/index.ts +0 -21
  219. package/server/graphql/types/store-replenishment-item/new-store-replenishment-item.ts +0 -8
  220. package/server/graphql/types/store-replenishment-item/store-replenishment-item-list.ts +0 -8
  221. package/server/graphql/types/store-replenishment-item/store-replenishment-item-patch.ts +0 -10
  222. package/server/graphql/types/store-replenishment-item/store-replenishment-item.ts +0 -15
  223. package/server/index.ts +0 -6
  224. package/server/middlewares/index.ts +0 -3
  225. package/server/migrations/index.ts +0 -9
  226. package/server/routes.ts +0 -26
  227. package/server/utils/index.ts +0 -1
  228. package/server/utils/no-generator.ts +0 -25
  229. package/tsconfig.json +0 -9
@@ -1,83 +0,0 @@
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
- }
@@ -1,53 +0,0 @@
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
- }
@@ -1,63 +0,0 @@
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
- }
@@ -1,147 +0,0 @@
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
- }
@@ -1,164 +0,0 @@
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
- }
@@ -1,56 +0,0 @@
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
- }
@@ -1,51 +0,0 @@
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
- }
@@ -1,49 +0,0 @@
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
- }