@things-factory/operato-hub 4.3.247 → 4.3.249
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist-server/entities/email-attachment.js +4 -0
- package/dist-server/entities/email-attachment.js.map +1 -1
- package/dist-server/graphql/resolvers/email/send-emails.js +7 -5
- package/dist-server/graphql/resolvers/email/send-emails.js.map +1 -1
- package/dist-server/routers/api/restful-apis/unstable/add-release-order.js +156 -133
- package/dist-server/routers/api/restful-apis/unstable/add-release-order.js.map +1 -1
- package/dist-server/routers/api/restful-apis/unstable/get-products.js +2 -2
- package/dist-server/routers/api/restful-apis/v1/company/get-product-list.js +2 -2
- package/dist-server/routers/api/restful-apis/v1/company/get-product-list.js.map +1 -1
- package/dist-server/routers/api/restful-apis/v1/utils/params.js +2 -2
- package/dist-server/routers/api/restful-apis/v1/utils/params.js.map +1 -1
- package/dist-server/routers/api/restful-apis/v1/warehouse/add-release-order.js +146 -123
- package/dist-server/routers/api/restful-apis/v1/warehouse/add-release-order.js.map +1 -1
- package/openapi/unstable/product.yaml +1 -1
- package/openapi/v1/product.yaml +3 -3
- package/openapi/v2/product.yaml +1 -1
- package/package.json +31 -31
- package/server/entities/email-attachment.ts +4 -0
- package/server/graphql/resolvers/email/send-emails.ts +8 -6
- package/server/routers/api/restful-apis/unstable/add-release-order.ts +218 -172
- package/server/routers/api/restful-apis/unstable/get-products.ts +2 -2
- package/server/routers/api/restful-apis/v1/company/get-product-list.ts +2 -2
- package/server/routers/api/restful-apis/v1/utils/params.ts +2 -2
- package/server/routers/api/restful-apis/v1/warehouse/add-release-order.ts +207 -161
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@things-factory/operato-hub",
|
|
3
|
-
"version": "4.3.
|
|
3
|
+
"version": "4.3.249",
|
|
4
4
|
"main": "dist-server/index.js",
|
|
5
5
|
"browser": "client/index.js",
|
|
6
6
|
"things-factory": true,
|
|
@@ -55,60 +55,60 @@
|
|
|
55
55
|
"@operato/scene-tab": "^0.1.8",
|
|
56
56
|
"@operato/scene-table": "^0.1.8",
|
|
57
57
|
"@operato/scene-wheel-sorter": "^0.1.8",
|
|
58
|
-
"@things-factory/api": "^4.3.
|
|
58
|
+
"@things-factory/api": "^4.3.248",
|
|
59
59
|
"@things-factory/apptool-ui": "^4.3.237",
|
|
60
|
-
"@things-factory/attachment-base": "^4.3.
|
|
61
|
-
"@things-factory/auth-base": "^4.3.
|
|
62
|
-
"@things-factory/auth-ui": "^4.3.
|
|
63
|
-
"@things-factory/biz-base": "^4.3.
|
|
64
|
-
"@things-factory/biz-ui": "^4.3.
|
|
65
|
-
"@things-factory/board-service": "^4.3.
|
|
66
|
-
"@things-factory/board-ui": "^4.3.
|
|
67
|
-
"@things-factory/code-ui": "^4.3.
|
|
60
|
+
"@things-factory/attachment-base": "^4.3.248",
|
|
61
|
+
"@things-factory/auth-base": "^4.3.248",
|
|
62
|
+
"@things-factory/auth-ui": "^4.3.248",
|
|
63
|
+
"@things-factory/biz-base": "^4.3.248",
|
|
64
|
+
"@things-factory/biz-ui": "^4.3.248",
|
|
65
|
+
"@things-factory/board-service": "^4.3.248",
|
|
66
|
+
"@things-factory/board-ui": "^4.3.248",
|
|
67
|
+
"@things-factory/code-ui": "^4.3.248",
|
|
68
68
|
"@things-factory/component-ui": "^4.3.227",
|
|
69
69
|
"@things-factory/context-ui": "^4.3.237",
|
|
70
|
-
"@things-factory/document-template-ui": "^4.3.
|
|
70
|
+
"@things-factory/document-template-ui": "^4.3.248",
|
|
71
71
|
"@things-factory/export-ui": "^4.3.237",
|
|
72
72
|
"@things-factory/export-ui-csv": "^4.3.237",
|
|
73
73
|
"@things-factory/export-ui-excel": "^4.3.237",
|
|
74
|
-
"@things-factory/geography": "^4.3.
|
|
74
|
+
"@things-factory/geography": "^4.3.248",
|
|
75
75
|
"@things-factory/grist-ui": "^4.3.237",
|
|
76
76
|
"@things-factory/help": "^4.3.237",
|
|
77
77
|
"@things-factory/i18n-base": "^4.3.237",
|
|
78
78
|
"@things-factory/import-ui": "^4.3.237",
|
|
79
79
|
"@things-factory/import-ui-excel": "^4.3.237",
|
|
80
|
-
"@things-factory/integration-accounting": "^4.3.
|
|
81
|
-
"@things-factory/integration-fulfillment": "^4.3.
|
|
82
|
-
"@things-factory/integration-lmd": "^4.3.
|
|
83
|
-
"@things-factory/integration-marketplace": "^4.3.
|
|
84
|
-
"@things-factory/integration-pos": "^4.3.
|
|
85
|
-
"@things-factory/integration-powrup": "^4.3.
|
|
86
|
-
"@things-factory/integration-sellercraft": "^4.3.
|
|
87
|
-
"@things-factory/integration-sftp": "^4.3.
|
|
88
|
-
"@things-factory/lite-menu": "^4.3.
|
|
89
|
-
"@things-factory/marketplace-base": "^4.3.
|
|
80
|
+
"@things-factory/integration-accounting": "^4.3.248",
|
|
81
|
+
"@things-factory/integration-fulfillment": "^4.3.248",
|
|
82
|
+
"@things-factory/integration-lmd": "^4.3.248",
|
|
83
|
+
"@things-factory/integration-marketplace": "^4.3.248",
|
|
84
|
+
"@things-factory/integration-pos": "^4.3.248",
|
|
85
|
+
"@things-factory/integration-powrup": "^4.3.248",
|
|
86
|
+
"@things-factory/integration-sellercraft": "^4.3.248",
|
|
87
|
+
"@things-factory/integration-sftp": "^4.3.248",
|
|
88
|
+
"@things-factory/lite-menu": "^4.3.248",
|
|
89
|
+
"@things-factory/marketplace-base": "^4.3.248",
|
|
90
90
|
"@things-factory/more-ui": "^4.3.237",
|
|
91
|
-
"@things-factory/notification": "^4.3.
|
|
91
|
+
"@things-factory/notification": "^4.3.248",
|
|
92
92
|
"@things-factory/pdf": "^4.3.227",
|
|
93
|
-
"@things-factory/product-ui": "^4.3.
|
|
94
|
-
"@things-factory/resource-ui": "^4.3.
|
|
95
|
-
"@things-factory/sales-base": "^4.3.
|
|
93
|
+
"@things-factory/product-ui": "^4.3.248",
|
|
94
|
+
"@things-factory/resource-ui": "^4.3.248",
|
|
95
|
+
"@things-factory/sales-base": "^4.3.249",
|
|
96
96
|
"@things-factory/scene-data-transform": "^4.3.237",
|
|
97
97
|
"@things-factory/scene-excel": "^4.3.237",
|
|
98
98
|
"@things-factory/scene-firebase": "^4.3.227",
|
|
99
99
|
"@things-factory/scene-form": "^4.3.237",
|
|
100
100
|
"@things-factory/scene-google-map": "^4.3.237",
|
|
101
101
|
"@things-factory/scene-graphql": "^4.3.237",
|
|
102
|
-
"@things-factory/scene-label": "^4.3.
|
|
102
|
+
"@things-factory/scene-label": "^4.3.248",
|
|
103
103
|
"@things-factory/scene-marker": "^4.3.227",
|
|
104
104
|
"@things-factory/scene-mqtt": "^4.3.227",
|
|
105
105
|
"@things-factory/scene-restful": "^4.3.237",
|
|
106
106
|
"@things-factory/scene-visualizer": "^4.3.237",
|
|
107
|
-
"@things-factory/setting-ui": "^4.3.
|
|
107
|
+
"@things-factory/setting-ui": "^4.3.248",
|
|
108
108
|
"@things-factory/shell": "^4.3.237",
|
|
109
109
|
"@things-factory/system-ui": "^4.3.237",
|
|
110
|
-
"@things-factory/warehouse-base": "^4.3.
|
|
111
|
-
"@things-factory/worksheet-base": "^4.3.
|
|
110
|
+
"@things-factory/warehouse-base": "^4.3.249",
|
|
111
|
+
"@things-factory/worksheet-base": "^4.3.249",
|
|
112
112
|
"cron-parser": "^4.7.0",
|
|
113
113
|
"koa2-swagger-ui": "^5.0.2",
|
|
114
114
|
"swagger-jsdoc": "^5.0.0",
|
|
@@ -120,5 +120,5 @@
|
|
|
120
120
|
"resolutions": {
|
|
121
121
|
"core-js": "^3.16.0"
|
|
122
122
|
},
|
|
123
|
-
"gitHead": "
|
|
123
|
+
"gitHead": "ebd830d0d88c40b83c406c8f7f663c8fa345b2d5"
|
|
124
124
|
}
|
|
@@ -2,6 +2,7 @@ import { Column, CreateDateColumn, Entity, Index, ManyToOne, PrimaryGeneratedCol
|
|
|
2
2
|
|
|
3
3
|
import { User } from '@things-factory/auth-base'
|
|
4
4
|
import { Domain } from '@things-factory/shell'
|
|
5
|
+
|
|
5
6
|
import { Email } from './email'
|
|
6
7
|
|
|
7
8
|
@Entity()
|
|
@@ -25,6 +26,9 @@ export class EmailAttachment {
|
|
|
25
26
|
@Column({ nullable: true })
|
|
26
27
|
variables: string
|
|
27
28
|
|
|
29
|
+
@Column({ nullable: true })
|
|
30
|
+
attachmentVariables: string
|
|
31
|
+
|
|
28
32
|
@Column({ nullable: true })
|
|
29
33
|
mappingFunction: string
|
|
30
34
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as cronParser from 'cron-parser'
|
|
2
2
|
import gql from 'graphql-tag'
|
|
3
|
-
import { getRepository, In
|
|
3
|
+
import { getRepository, In } from 'typeorm'
|
|
4
4
|
|
|
5
5
|
import { Partner, User } from '@things-factory/auth-base'
|
|
6
6
|
import { Bizplace } from '@things-factory/biz-base'
|
|
@@ -75,11 +75,9 @@ async function processEmailCronJob(email, fromDate, toDate) {
|
|
|
75
75
|
let attachments: any = []
|
|
76
76
|
// black list filtration
|
|
77
77
|
// let partnerBlackList = JSON.parse(email.partnerBlackList) || []
|
|
78
|
-
//
|
|
79
78
|
|
|
80
79
|
// partner list
|
|
81
80
|
let partnerList = JSON.parse(email.partnerList) || []
|
|
82
|
-
//
|
|
83
81
|
|
|
84
82
|
const partners: Partner[] = await getRepository(Partner).find({
|
|
85
83
|
where: { domain: email.domain, id: In(partnerList) },
|
|
@@ -89,6 +87,10 @@ async function processEmailCronJob(email, fromDate, toDate) {
|
|
|
89
87
|
// retrieve and process xlsx attachmennts
|
|
90
88
|
for (let attachment of email.emailAttachments) {
|
|
91
89
|
let client = GraphqlLocalClient.client
|
|
90
|
+
let attachmentVariables = JSON.parse(attachment.attachmentVariables)
|
|
91
|
+
let numberOfMonths: number = attachmentVariables?.numberOfMonths || 1
|
|
92
|
+
let numberOfWeeks: number = attachmentVariables?.numberOfWeeks ? attachmentVariables.numberOfWeeks * 7 : 7
|
|
93
|
+
let numberOfDays: number = attachmentVariables?.numberOfDays || 1
|
|
92
94
|
|
|
93
95
|
for (let partner of partners) {
|
|
94
96
|
const bizplace: Bizplace = await getRepository(Bizplace).findOne({
|
|
@@ -111,17 +113,17 @@ async function processEmailCronJob(email, fromDate, toDate) {
|
|
|
111
113
|
let curDateForWeek = new Date(curDate)
|
|
112
114
|
let curDateForDay = new Date(curDate)
|
|
113
115
|
|
|
114
|
-
let prevMonth = curDateForMonth.getMonth() -
|
|
116
|
+
let prevMonth = curDateForMonth.getMonth() - numberOfMonths
|
|
115
117
|
let prevMonthBegin: any = new Date(curDateForMonth.setMonth(prevMonth))
|
|
116
118
|
prevMonthBegin.setHours(0, 0, 0, 0)
|
|
117
119
|
let prevMonthBeginDateTime = new Date(prevMonthBegin - timezoneOffset * 60000).toISOString()
|
|
118
120
|
|
|
119
|
-
let prevWeek = curDateForWeek.getDate() -
|
|
121
|
+
let prevWeek = curDateForWeek.getDate() - numberOfWeeks // subtract 1 week
|
|
120
122
|
let prevWeekBegin: any = new Date(curDateForWeek.setDate(prevWeek))
|
|
121
123
|
prevWeekBegin.setHours(0, 0, 0, 0)
|
|
122
124
|
let prevWeekBeginDateTime = new Date(prevWeekBegin - timezoneOffset * 60000).toISOString()
|
|
123
125
|
|
|
124
|
-
let prevDay = curDateForDay.getDate() -
|
|
126
|
+
let prevDay = curDateForDay.getDate() - numberOfDays // subtract 1 day
|
|
125
127
|
let prevDayBegin: any = new Date(curDateForDay.setDate(prevDay))
|
|
126
128
|
prevDayBegin.setHours(0, 0, 0, 0)
|
|
127
129
|
let prevDayBeginDateTime = new Date(prevDayBegin - timezoneOffset * 60000).toISOString()
|