@things-factory/integration-sellercraft 4.0.0-y.0 → 4.0.4

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 (65) hide show
  1. package/client/bootstrap.js +1 -28
  2. package/client/pages/sellercraft-store.js +22 -3
  3. package/client/utils/index.js +12 -0
  4. package/dist-server/controllers/index.js +1 -1
  5. package/dist-server/controllers/index.js.map +1 -1
  6. package/dist-server/controllers/sellercraft/apis/add-inbound-order.js +32 -1
  7. package/dist-server/controllers/sellercraft/apis/add-inbound-order.js.map +1 -1
  8. package/dist-server/controllers/sellercraft/apis/fetch-order-document.js +6 -2
  9. package/dist-server/controllers/sellercraft/apis/fetch-order-document.js.map +1 -1
  10. package/dist-server/controllers/sellercraft/apis/initiate-order-document.js +4 -1
  11. package/dist-server/controllers/sellercraft/apis/initiate-order-document.js.map +1 -1
  12. package/dist-server/controllers/sellercraft/apis/initiate-order-shipment.js +11 -2
  13. package/dist-server/controllers/sellercraft/apis/initiate-order-shipment.js.map +1 -1
  14. package/dist-server/controllers/sellercraft/apis/pack-marketplace-order.js +20 -2
  15. package/dist-server/controllers/sellercraft/apis/pack-marketplace-order.js.map +1 -1
  16. package/dist-server/controllers/sellercraft/apis/update-product.js +23 -1
  17. package/dist-server/controllers/sellercraft/apis/update-product.js.map +1 -1
  18. package/dist-server/controllers/sellercraft/index.js +7 -7
  19. package/dist-server/controllers/sellercraft/index.js.map +1 -1
  20. package/dist-server/controllers/sellercraft/platform-action.js +3 -3
  21. package/dist-server/controllers/sellercraft/platform-action.js.map +1 -1
  22. package/dist-server/controllers/sellercraft/sellercraft.js +42 -25
  23. package/dist-server/controllers/sellercraft/sellercraft.js.map +1 -1
  24. package/dist-server/controllers/sellercraft-api/decorators.js +32 -0
  25. package/dist-server/controllers/sellercraft-api/decorators.js.map +1 -0
  26. package/dist-server/controllers/sellercraft-api/index.js +92 -0
  27. package/dist-server/controllers/sellercraft-api/index.js.map +1 -0
  28. package/dist-server/controllers/sellercraft-api/types.js +1 -0
  29. package/dist-server/controllers/sellercraft-api/types.js.map +1 -0
  30. package/dist-server/index.js +2 -1
  31. package/dist-server/index.js.map +1 -1
  32. package/dist-server/service/sellercraft/sellercraft-mutation.js +5 -7
  33. package/dist-server/service/sellercraft/sellercraft-mutation.js.map +1 -1
  34. package/dist-server/service/sellercraft/sellercraft-query.js +2 -5
  35. package/dist-server/service/sellercraft/sellercraft-query.js.map +1 -1
  36. package/dist-server/service/sellercraft/sellercraft-type.js +4 -4
  37. package/dist-server/service/sellercraft/sellercraft-type.js.map +1 -1
  38. package/dist-server/service/sellercraft/sellercraft.js +11 -3
  39. package/dist-server/service/sellercraft/sellercraft.js.map +1 -1
  40. package/package.json +14 -14
  41. package/server/controllers/index.ts +1 -1
  42. package/server/controllers/sellercraft/apis/add-inbound-order.ts +40 -1
  43. package/server/controllers/sellercraft/apis/fetch-order-document.ts +6 -2
  44. package/server/controllers/sellercraft/apis/initiate-order-document.ts +4 -1
  45. package/server/controllers/sellercraft/apis/initiate-order-shipment.ts +17 -2
  46. package/server/controllers/sellercraft/apis/pack-marketplace-order.ts +23 -2
  47. package/server/controllers/sellercraft/apis/update-product.ts +26 -1
  48. package/server/controllers/sellercraft/index.ts +4 -4
  49. package/server/controllers/sellercraft/platform-action.ts +4 -3
  50. package/server/controllers/sellercraft/sellercraft.ts +41 -28
  51. package/server/controllers/{store-api → sellercraft-api}/decorators.ts +0 -0
  52. package/server/controllers/{store-api → sellercraft-api}/index.ts +1 -0
  53. package/server/controllers/{store-api → sellercraft-api}/types.ts +0 -0
  54. package/server/index.ts +3 -2
  55. package/server/service/sellercraft/sellercraft-mutation.ts +7 -7
  56. package/server/service/sellercraft/sellercraft-query.ts +5 -7
  57. package/server/service/sellercraft/sellercraft-type.ts +10 -9
  58. package/server/service/sellercraft/sellercraft.ts +13 -3
  59. package/things-factory.config.js +1 -1
  60. package/translations/en.json +4 -0
  61. package/translations/ko.json +4 -0
  62. package/translations/ms.json +4 -0
  63. package/translations/zh.json +4 -1
  64. package/client/themes/app-theme.css +0 -117
  65. package/client/themes/layout-theme.css +0 -92
@@ -1,9 +1,10 @@
1
1
  import { Arg, Ctx, Directive, Mutation, Resolver } from 'type-graphql'
2
2
  import { In } from 'typeorm'
3
- import { Sellercraft, SellercraftStatus } from './sellercraft'
4
- import { NewSellercraft, SellercraftPatch } from './sellercraft-type'
5
3
  import uuid from 'uuid/v4'
6
4
 
5
+ import { Sellercraft, SellercraftPlatform, SellercraftStatus } from './sellercraft'
6
+ import { NewSellercraft, SellercraftPatch } from './sellercraft-type'
7
+
7
8
  @Resolver(Sellercraft)
8
9
  export class SellercraftMutation {
9
10
  @Directive('@transaction')
@@ -13,6 +14,7 @@ export class SellercraftMutation {
13
14
 
14
15
  return await tx.getRepository(Sellercraft).save({
15
16
  ...sellercraft,
17
+ name: uuid(),
16
18
  domain,
17
19
  creator: user,
18
20
  updater: user
@@ -26,12 +28,10 @@ export class SellercraftMutation {
26
28
  @Arg('patch') patch: SellercraftPatch,
27
29
  @Ctx() context: any
28
30
  ): Promise<Sellercraft> {
29
- const { domain, user, tx } = context.state
31
+ const { user, tx } = context.state
30
32
 
31
33
  const repository = tx.getRepository(Sellercraft)
32
- const sellercraft = await repository.findOne({
33
- where: { domain, id }
34
- })
34
+ const sellercraft = await repository.findOne(id)
35
35
 
36
36
  return await repository.save({
37
37
  ...sellercraft,
@@ -62,7 +62,7 @@ export class SellercraftMutation {
62
62
  domain,
63
63
  name: uuid(),
64
64
  status: SellercraftStatus.ACTIVE,
65
- platform: 'sellercraft',
65
+ platform: SellercraftPlatform.SELLERCRAFT,
66
66
  creator: user,
67
67
  updater: user
68
68
  })
@@ -1,7 +1,9 @@
1
- import { Resolver, Query, FieldResolver, Root, Args, Arg, Ctx, Directive } from 'type-graphql'
1
+ import { Arg, Args, Ctx, FieldResolver, Query, Resolver, Root } from 'type-graphql'
2
2
  import { getRepository } from 'typeorm'
3
- import { Domain, ListParam, convertListParams } from '@things-factory/shell'
3
+
4
4
  import { User } from '@things-factory/auth-base'
5
+ import { convertListParams, Domain, ListParam } from '@things-factory/shell'
6
+
5
7
  import { Sellercraft } from './sellercraft'
6
8
  import { SellercraftList } from './sellercraft-type'
7
9
 
@@ -9,11 +11,7 @@ import { SellercraftList } from './sellercraft-type'
9
11
  export class SellercraftQuery {
10
12
  @Query(returns => Sellercraft, { description: 'To fetch a Sellercraft' })
11
13
  async sellercraft(@Arg('id') id: string, @Ctx() context: any): Promise<Sellercraft> {
12
- const { domain } = context.state
13
-
14
- return await getRepository(Sellercraft).findOne({
15
- where: { domain, id }
16
- })
14
+ return await getRepository(Sellercraft).findOne(id)
17
15
  }
18
16
 
19
17
  @Query(returns => SellercraftList, { description: 'To fetch multiple Sellercrafts' })
@@ -1,5 +1,6 @@
1
1
  import { Field, ID, InputType, Int, ObjectType } from 'type-graphql'
2
- import { Sellercraft, SellercraftStatus } from './sellercraft'
2
+
3
+ import { Sellercraft, SellercraftPlatform, SellercraftStatus } from './sellercraft'
3
4
 
4
5
  @InputType()
5
6
  export class NewSellercraft {
@@ -9,8 +10,8 @@ export class NewSellercraft {
9
10
  @Field({ nullable: true })
10
11
  description?: string
11
12
 
12
- @Field()
13
- platform: string
13
+ @Field(type => SellercraftPlatform, { nullable: true })
14
+ platform: SellercraftPlatform
14
15
 
15
16
  @Field()
16
17
  accountId: string
@@ -27,11 +28,11 @@ export class SellercraftPatch {
27
28
  @Field({ nullable: true })
28
29
  name?: string
29
30
 
30
- @Field({ nullable: true })
31
- platform?: string
31
+ @Field(type => SellercraftPlatform, { nullable: true })
32
+ platform?: SellercraftPlatform
32
33
 
33
- @Field()
34
- accountId: string
34
+ @Field({ nullable: true })
35
+ accountId?: string
35
36
 
36
37
  @Field({ nullable: true })
37
38
  description?: string
@@ -39,8 +40,8 @@ export class SellercraftPatch {
39
40
  @Field(type => SellercraftStatus, { nullable: true })
40
41
  status?: SellercraftStatus
41
42
 
42
- @Field()
43
- cuFlag: string
43
+ @Field({ nullable: true })
44
+ cuFlag?: string
44
45
  }
45
46
 
46
47
  @ObjectType()
@@ -1,5 +1,3 @@
1
- import { User } from '@things-factory/auth-base'
2
- import { Domain } from '@things-factory/shell'
3
1
  import { Field, ID, ObjectType, registerEnumType } from 'type-graphql'
4
2
  import {
5
3
  Column,
@@ -12,6 +10,9 @@ import {
12
10
  UpdateDateColumn
13
11
  } from 'typeorm'
14
12
 
13
+ import { User } from '@things-factory/auth-base'
14
+ import { Domain } from '@things-factory/shell'
15
+
15
16
  export enum SellercraftStatus {
16
17
  ACTIVE = 'ACTIVE',
17
18
  INACTIVE = 'INACTIVE',
@@ -23,6 +24,15 @@ registerEnumType(SellercraftStatus, {
23
24
  description: 'state enumeration of a sellercraft'
24
25
  })
25
26
 
27
+ export enum SellercraftPlatform {
28
+ SELLERCRAFT = 'sellercraft'
29
+ }
30
+
31
+ registerEnumType(SellercraftPlatform, {
32
+ name: 'SellercraftPlatform',
33
+ description: 'platform enumeration of a sellercraft'
34
+ })
35
+
26
36
  @Entity()
27
37
  @Index('ix_sellercraft_0', (sellercraft: Sellercraft) => [sellercraft.domain, sellercraft.name], { unique: true })
28
38
  @ObjectType({ description: 'Entity for Sellercraft' })
@@ -52,7 +62,7 @@ export class Sellercraft {
52
62
 
53
63
  @Column()
54
64
  @Field()
55
- platform: string
65
+ platform: SellercraftPlatform
56
66
 
57
67
  @Column({ nullable: true })
58
68
  @Field({ nullable: true })
@@ -1,5 +1,5 @@
1
- import route from './client/route'
2
1
  import bootstrap from './client/bootstrap'
2
+ import route from './client/route'
3
3
 
4
4
  export default {
5
5
  route,
@@ -1,4 +1,8 @@
1
1
  {
2
+ "button.synchronise_stock": "synchronise stock",
2
3
  "field.account_id": "account id",
4
+ "text.account_id": "account id",
5
+ "title.sellercraft": "sellercraft",
6
+ "title.sellercraft_connection": "sellercraft connection",
3
7
  "title.sellercraft_integration": "sellercraft integration"
4
8
  }
@@ -1,4 +1,8 @@
1
1
  {
2
+ "button.synchronise_stock": "[ko] synchronise stock",
2
3
  "field.account_id": "[ko] account id",
4
+ "text.account_id": "[ko] account id",
5
+ "title.sellercraft": "[ko] sellercraft",
6
+ "title.sellercraft_connection": "[ko] sellercraft connection",
3
7
  "title.sellercraft_integration": "[ko] sellercraft integration"
4
8
  }
@@ -1,4 +1,8 @@
1
1
  {
2
+ "button.synchronise_stock": "[ms] synchronise stock",
2
3
  "field.account_id": "[ms] account id",
4
+ "text.account_id": "[ms] account id",
5
+ "title.sellercraft": "[ms] sellercraft",
6
+ "title.sellercraft_connection": "[ms] sellercraft connection",
3
7
  "title.sellercraft_integration": "[ms] sellercraft integration"
4
8
  }
@@ -1,5 +1,8 @@
1
1
  {
2
+ "button.synchronise_stock": "[zh] synchronise stock",
2
3
  "field.account_id": "[zh] account id",
3
-
4
+ "text.account_id": "[zh] account id",
5
+ "title.sellercraft": "[zh] sellercraft",
6
+ "title.sellercraft_connection": "[zh] sellercraft connection",
4
7
  "title.sellercraft_integration": "[zh] sellercraft integration"
5
8
  }
@@ -1,117 +0,0 @@
1
- body {
2
- /* theme color */
3
- --primary-color-rgb: 34, 166, 167;
4
- --primary-color: rgb(var(--primary-color-rgb));
5
- --secondary-color: #394e64;
6
- --focus-color: var(--theme-white-color);
7
- --primary-background-color: var(--secondary-color);
8
- --secondary-background-color: #283644;
9
- --main-section-background-color: #f4f7fb;
10
- --theme-white-color: #fff;
11
- --theme-black-color: rgba(0, 0, 0, 0.9);
12
-
13
- --focus-background-color: var(--primary-color);
14
- --primary-text-color: var(--theme-black-color);
15
- --secondary-text-color: #017e7f;
16
-
17
- --opacity-dark-color: rgba(0, 0, 0, 0.4);
18
- --opacity-light-color: rgba(255, 255, 255, 0.8);
19
-
20
- /* status color */
21
- --status-success-color: #35a24a;
22
- --status-warning-color: #ee8d03;
23
- --status-danger-color: #d14946;
24
- --status-info-color: #398ace;
25
-
26
- /* common style */
27
- --border-radius: 3px;
28
- --border-dark-color: 1px solid rgba(0, 0, 0, 0.15);
29
- --border-light-color: 1px solid rgba(255, 255, 255, 0.3);
30
-
31
- --box-shadow: 2px 2px 3px 0px rgba(0, 0, 0, 0.1);
32
-
33
- --theme-font: 'Noto', Helvetica;
34
-
35
- --margin-default: 9px;
36
- --margin-narrow: 4px;
37
- --margin-wide: 15px;
38
- --padding-default: var(--margin-default);
39
- --padding-narrow: var(--margin-narrow);
40
- --padding-wide: var(--margin-wide);
41
-
42
- --scrollbar-thumb-color: rgba(57, 78, 100, 0.5);
43
- --scrollbar-thumb-hover-color: var(--primary-color);
44
-
45
- --fontsize-default: 14px;
46
- --fontsize-small: 13px;
47
- --fontsize-large: 16px;
48
-
49
- /* app layout style */
50
- --app-grid-template-area: 'header header header' 'nav main aside' 'nav footer aside';
51
-
52
- /* title & description style */
53
- --title-margin: var(--margin-narrow) 0;
54
- --title-font: bold 24px var(--theme-font);
55
- --title-text-color: var(--secondary-color);
56
-
57
- --page-description-margin: var(--margin-narrow) 0 var(--margin-wide) 0;
58
- --page-description-font: normal var(--fontsize-default) / 1.2rem var(--theme-font);
59
- --page-description-color: var(--secondary-text-color);
60
-
61
- --subtitle-padding: 12px 5px 3px 5px;
62
- --subtitle-font: bold 18px var(--theme-font);
63
- --subtitle-text-color: var(--primary-color);
64
- --subtitle-border-bottom: 1px solid var(--primary-color);
65
-
66
- /* icon style */
67
- --icon-tiny-size: 24px;
68
- --icon-default-size: 36px;
69
- --icon-big-size: 48px;
70
- --icon-default-color: #fff;
71
-
72
- /* material design component themes */
73
- --mdc-theme-on-primary: white;
74
- --mdc-theme-primary: var(--primary-color);
75
- --mdc-theme-on-secondary: white;
76
- --mdc-theme-secondary: var(--primary-color);
77
-
78
- /* button style */
79
- --button-background-color: #fafbfc;
80
- --button-border: var(--border-dark-color);
81
- --button-border-radius: var(--border-radius);
82
- --button-margin: var(--margin-default) var(--margin-default) var(--margin-default) 0;
83
- --button-padding: var(--margin-default);
84
- --button-color: var(--secondary-color);
85
- --button-font: normal 15px var(--theme-font);
86
- --button-text-transform: capitalize;
87
- --button-active-box-shadow: 1px 1px 1px 0px rgba(0, 0, 0, 0.2);
88
- --button-activ-border: 1px solid var(--primary-color);
89
-
90
- --button-primary-background-color: var(--primary-color);
91
- --button-primary-active-background-color: var(--status-success-color);
92
- --button-primary-padding: var(--margin-default) var(--margin-wide);
93
- --button-primary-color: var(--theme-white-color);
94
- --button-primary-font: bold 16px var(--theme-font);
95
-
96
- /* table style */
97
- --th-padding: var(--padding-narrow);
98
- --th-text-transform: capitalize;
99
- --th-font: bold 15px var(--theme-font);
100
-
101
- --td-padding: var(--padding-default);
102
- --td-font: normal 13px var(--theme-font);
103
-
104
- /* form style */
105
- --label-font: normal var(--fontsize-default) var(--theme-font);
106
- --label-color: var(--secondary-color);
107
- --label-text-transform: capitalize;
108
- --input-margin: var(--margin-narrow) 0;
109
- --input-padding: var(--padding-default);
110
- --input-font: normal var(--fontsize-default) var(--theme-font);
111
- --input-hint-font: normal var(--fontsize-small) var(--theme-font);
112
- --input-hint-color: #666;
113
- --fieldset-margin: var(--padding-wide) 0;
114
- --fieldset-padding: 0 var(--padding-wide) var(--padding-wide) var(--padding-wide);
115
- --legend-padding: var(--padding-default) 0;
116
- --legend-color: var(--secondary-text-color);
117
- }
@@ -1,92 +0,0 @@
1
- body {
2
- --header-bar-background-color: var(--primary-color);
3
- --header-bar-icon-size: var(--icon-default-size);
4
- --header-bar-title: bold 16px var(--theme-font);
5
- --header-bar-color: #fff;
6
- --header-bar-height: 45px;
7
- --header-bar-item-padding: 0px 5px 0 0;
8
-
9
- --nav-bar-background-color: #fff;
10
-
11
- --group-bar-background-color: var(--primary-color);
12
- --group-bar-textbutton: 16px/32px var(--theme-font);
13
- --group-bar-textbutton-active: bold var(--group-bar-textbutton);
14
- --group-bar-active-line-color: var(--focus-color);
15
- --group-bar-line: solid 3px rgba(0, 0, 0, 0.2);
16
-
17
- --aside-background-color: var(--secondary-background-color);
18
- --aside-list-textbtton: 18px var(--theme-font);
19
- --aside-list-icon: var(--icon-default-size);
20
- --aside-list-bottom-line: var(--border-dark-color);
21
- --aside-list-detail-background-color: #fff;
22
- --aside-list-detail-text: 14px var(--primary-background-color);
23
-
24
- --footer-bar-border-top: 1px solid rgba(0, 0, 0, 0.2);
25
-
26
- --button-container-margin: inintial;
27
- --button-container-padding: 0 0 12px 0;
28
- --button-container-background: transparent;
29
- --button-container-height: initial;
30
- --button-container-align: center;
31
- --button-container-button-background-color: var(--secondary-color);
32
- --button-container-button-border-radius: var(--button-border-radius);
33
- --button-container-button-margin: var(--button-margin);
34
- --button-container-button-font: var(--button-font);
35
- --button-container-button-height: initial;
36
- --button-container-button-border: var(--button-border);
37
-
38
- --popup-content-background-color: var(--main-section-background-color);
39
- --popup-content-padding: 10px 20px;
40
-
41
- /* components - floating overlay style */
42
- --overlay-center-small-width: 30%;
43
- --overlay-center-small-height: 30%;
44
- --overlay-center-normal-width: 50%;
45
- --overlay-center-normal-height: 50%;
46
- --overlay-center-large-width: 75%;
47
- --overlay-center-large-height: 75%;
48
- --overlay-header-height: var(--header-bar-height);
49
- --overlay-header-background-color: var(--header-bar-background-color);
50
- --overlay-header-color: #fff;
51
- --overlay-header-font: var(--header-bar-title);
52
- --overlay-background-color: rgba(0, 0, 0, 0.5);
53
- --overlay-margin-bottom: 0px;
54
-
55
- /* components - resize splitter style */
56
- --splitter-background-color: rgba(0, 0, 0, 0.1);
57
- --splitter-hover-background-color: var(--primary-color);
58
- }
59
-
60
- @media only screen and (max-width: 460px) {
61
- body {
62
- --button-container-margin: 0 -15px;
63
- --button-container-padding: 0 0 0 0;
64
- --button-container-background: #586272;
65
- --button-container-height: 50px;
66
- --button-container-align: right;
67
- --button-container-button-background-color: transparent;
68
- --button-container-button-border-radius: 0;
69
- --button-container-button-margin: 0;
70
- --button-container-button-font: normal 17px var(--theme-font);
71
- --button-container-button-height: 50px;
72
- --button-container-button-border: 1px solid rgba(0, 0, 0, 0.1);
73
-
74
- --overlay-center-small-width: 100%;
75
- --overlay-center-small-height: 100%;
76
- --overlay-center-normal-width: 100%;
77
- --overlay-center-normal-height: 100%;
78
- --overlay-center-large-width: 100%;
79
- --overlay-center-large-height: 100%;
80
- }
81
- }
82
-
83
- @media (min-width: 461px) and (max-width: 1024px) {
84
- body {
85
- --overlay-center-small-width: 40%;
86
- --overlay-center-small-height: 40%;
87
- --overlay-center-normal-width: 60%;
88
- --overlay-center-normal-height: 60%;
89
- --overlay-center-large-width: 80%;
90
- --overlay-center-large-height: 80%;
91
- }
92
- }