@things-factory/warehouse-base 4.3.425 → 4.3.430

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@things-factory/warehouse-base",
3
- "version": "4.3.425",
3
+ "version": "4.3.430",
4
4
  "main": "dist-server/index.js",
5
5
  "browser": "client/index.js",
6
6
  "things-factory": true,
@@ -32,5 +32,5 @@
32
32
  "@things-factory/product-base": "^4.3.425",
33
33
  "@things-factory/setting-base": "^4.3.425"
34
34
  },
35
- "gitHead": "43a4d63f2d8411e2f7446c3627dbf8acafbd3c44"
35
+ "gitHead": "b62b950285aa5cb36af746fa9fe77b7476e4538c"
36
36
  }
@@ -1,42 +1,14 @@
1
- import {
2
- Arg,
3
- Ctx,
4
- Directive,
5
- Mutation,
6
- Resolver
7
- } from 'type-graphql'
8
- import {
9
- EntityManager,
10
- In,
11
- MoreThan,
12
- Not,
13
- SelectQueryBuilder
14
- } from 'typeorm'
1
+ import { Arg, Ctx, Directive, Mutation, Resolver } from 'type-graphql'
2
+ import { EntityManager, In, MoreThan, Not, SelectQueryBuilder } from 'typeorm'
15
3
 
16
- import {
17
- Application,
18
- ApplicationType,
19
- User
20
- } from '@things-factory/auth-base'
21
- import {
22
- Bizplace,
23
- getCompanyBizplace
24
- } from '@things-factory/biz-base'
4
+ import { Application, ApplicationType, User } from '@things-factory/auth-base'
5
+ import { Bizplace, getCompanyBizplace } from '@things-factory/biz-base'
25
6
  import { generateId } from '@things-factory/id-rule-base'
26
7
  import { Account } from '@things-factory/integration-accounting'
27
8
  import { MarketplaceStore } from '@things-factory/integration-marketplace'
28
- import {
29
- Sellercraft,
30
- SellercraftStatus
31
- } from '@things-factory/integration-sellercraft'
32
- import {
33
- Product,
34
- ProductDetail
35
- } from '@things-factory/product-base'
36
- import {
37
- PartnerSetting,
38
- Setting
39
- } from '@things-factory/setting-base'
9
+ import { Sellercraft, SellercraftStatus } from '@things-factory/integration-sellercraft'
10
+ import { Product, ProductDetail } from '@things-factory/product-base'
11
+ import { PartnerSetting, Setting } from '@things-factory/setting-base'
40
12
  import { Domain } from '@things-factory/shell'
41
13
 
42
14
  import {
@@ -46,12 +18,7 @@ import {
46
18
  LOCATION_STATUS,
47
19
  LOCATION_TYPE
48
20
  } from '../../constants'
49
- import {
50
- EcommerceController,
51
- PosController,
52
- PowrupController,
53
- SellercraftController
54
- } from '../../controllers'
21
+ import { EcommerceController, PosController, PowrupController, SellercraftController } from '../../controllers'
55
22
  import { InventoryNoGenerator } from '../../utils'
56
23
  import { InventoryHistory } from '../inventory-history/inventory-history'
57
24
  import { InventoryItemChange } from '../inventory-item-change/inventory-item-change'
@@ -61,11 +28,7 @@ import { Inventory } from '../inventory/inventory'
61
28
  import { InventoryPatch } from '../inventory/inventory-types'
62
29
  import { Location } from '../location/location'
63
30
  import { InventoryChange } from './inventory-change'
64
- import {
65
- InventoryChangeList,
66
- InventoryChangePatch,
67
- NewInventoryChange
68
- } from './inventory-change-types'
31
+ import { InventoryChangeList, InventoryChangePatch, NewInventoryChange } from './inventory-change-types'
69
32
 
70
33
  @Resolver(InventoryChange)
71
34
  export class InventoryChangeMutation {
@@ -1129,7 +1092,8 @@ export async function approveInventoryChanges(patches: any, context: any) {
1129
1092
  let date: Date = new Date()
1130
1093
  expirationDate = new Date(expirationDate)
1131
1094
 
1132
- const releaseBefore: Date = new Date(expirationDate.setDate(expirationDate.getDate() - minOutboundShelfLife))
1095
+ const releaseBefore: Date = new Date(expirationDate)
1096
+ releaseBefore.setDate(expirationDate.getDate() - minOutboundShelfLife)
1133
1097
 
1134
1098
  if (date > releaseBefore) {
1135
1099
  inventory.obsolete = true
@@ -1334,7 +1298,8 @@ export async function approveInventoryChanges(patches: any, context: any) {
1334
1298
  let date: Date = new Date()
1335
1299
  expirationDate = new Date(expirationDate)
1336
1300
 
1337
- const releaseBefore: Date = new Date(expirationDate.setDate(expirationDate.getDate() - minOutboundShelfLife))
1301
+ const releaseBefore: Date = new Date(expirationDate)
1302
+ releaseBefore.setDate(expirationDate.getDate() - minOutboundShelfLife)
1338
1303
 
1339
1304
  if (date > releaseBefore) {
1340
1305
  newRecord.obsolete = true