This commit is contained in:
Evert Prants 2023-05-22 21:02:06 +03:00
parent bcbedf5775
commit 506787683b
Signed by: evert
GPG Key ID: 1688DA83D222D0B5
6 changed files with 2919 additions and 3210 deletions

6033
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -21,15 +21,15 @@
"test:e2e": "jest --config ./test/jest-e2e.json" "test:e2e": "jest --config ./test/jest-e2e.json"
}, },
"dependencies": { "dependencies": {
"@nestjs/common": "^9.0.0", "@nestjs/common": "^9.4.1",
"@nestjs/config": "^2.2.0", "@nestjs/config": "^2.3.2",
"@nestjs/core": "^9.0.0", "@nestjs/core": "^9.4.1",
"@nestjs/platform-express": "^9.0.0", "@nestjs/platform-express": "^9.4.1",
"@nestjs/serve-static": "^3.0.0", "@nestjs/serve-static": "^3.0.1",
"@nestjs/swagger": "^6.1.4", "@nestjs/swagger": "^6.3.0",
"@nestjs/typeorm": "^9.0.1", "@nestjs/typeorm": "^9.0.1",
"bcrypt": "^5.1.0", "bcrypt": "^5.1.0",
"canvas": "^2.11.0", "canvas": "^2.11.2",
"class-transformer": "^0.5.1", "class-transformer": "^0.5.1",
"class-validator": "^0.14.0", "class-validator": "^0.14.0",
"jsonwebtoken": "^9.0.0", "jsonwebtoken": "^9.0.0",
@ -39,38 +39,38 @@
"lodash.set": "^4.3.2", "lodash.set": "^4.3.2",
"mysql2": "^2.3.3", "mysql2": "^2.3.3",
"reflect-metadata": "^0.1.13", "reflect-metadata": "^0.1.13",
"rimraf": "^3.0.2", "rimraf": "^5.0.1",
"rxjs": "^7.2.0", "rxjs": "^7.8.1",
"typeorm": "^0.3.11" "typeorm": "^0.3.16"
}, },
"devDependencies": { "devDependencies": {
"@nestjs/cli": "^9.0.0", "@nestjs/cli": "^9.5.0",
"@nestjs/schematics": "^9.0.0", "@nestjs/schematics": "^9.2.0",
"@nestjs/testing": "^9.0.0", "@nestjs/testing": "^9.4.1",
"@types/bcrypt": "^5.0.0", "@types/bcrypt": "^5.0.0",
"@types/express": "^4.17.13", "@types/express": "^4.17.17",
"@types/jest": "28.1.4", "@types/jest": "29.5.1",
"@types/jsonwebtoken": "^9.0.0", "@types/jsonwebtoken": "^9.0.2",
"@types/lodash.get": "^4.4.7", "@types/lodash.get": "^4.4.7",
"@types/lodash.omit": "^4.5.7", "@types/lodash.omit": "^4.5.7",
"@types/lodash.pick": "^4.4.7", "@types/lodash.pick": "^4.4.7",
"@types/lodash.set": "^4.3.7", "@types/lodash.set": "^4.3.7",
"@types/node": "^16.0.0", "@types/node": "^20.2.3",
"@types/supertest": "^2.0.11", "@types/supertest": "^2.0.12",
"@typescript-eslint/eslint-plugin": "^5.0.0", "@typescript-eslint/eslint-plugin": "^5.59.6",
"@typescript-eslint/parser": "^5.0.0", "@typescript-eslint/parser": "^5.59.6",
"eslint": "^8.0.1", "eslint": "^8.41.0",
"eslint-config-prettier": "^8.3.0", "eslint-config-prettier": "^8.8.0",
"eslint-plugin-prettier": "^4.0.0", "eslint-plugin-prettier": "^4.2.1",
"jest": "28.1.2", "jest": "29.5.0",
"prettier": "^2.3.2", "prettier": "^2.8.8",
"source-map-support": "^0.5.20", "source-map-support": "^0.5.21",
"supertest": "^6.1.3", "supertest": "^6.3.3",
"ts-jest": "28.0.5", "ts-jest": "29.1.0",
"ts-loader": "^9.2.3", "ts-loader": "^9.4.2",
"ts-node": "^10.0.0", "ts-node": "^10.9.1",
"tsconfig-paths": "4.0.0", "tsconfig-paths": "4.2.0",
"typescript": "^4.3.5" "typescript": "^5.0.4"
}, },
"jest": { "jest": {
"moduleFileExtensions": [ "moduleFileExtensions": [

View File

@ -31,6 +31,11 @@ export class StorageItemRequestDto {
@IsOptional() @IsOptional()
barcode?: string; barcode?: string;
@ApiPropertyOptional()
@IsString()
@IsOptional()
sku?: string;
@ApiPropertyOptional() @ApiPropertyOptional()
@IsBoolean() @IsBoolean()
@IsOptional() @IsOptional()

View File

@ -18,6 +18,7 @@ export class StorageItemSearchResponseDto extends PickType(Item, [
'displayName', 'displayName',
'type', 'type',
'barcode', 'barcode',
'sku',
'image', 'image',
'createdAt', 'createdAt',
]) {} ]) {}

View File

@ -30,6 +30,10 @@ export class Item {
@Column({ nullable: true }) @Column({ nullable: true })
barcode?: string; barcode?: string;
@ApiPropertyOptional()
@Column({ nullable: true })
sku?: string;
@ApiPropertyOptional() @ApiPropertyOptional()
@Column({ default: false }) @Column({ default: false })
consumable: boolean; consumable: boolean;

View File

@ -244,7 +244,16 @@ export class StorageService {
}, },
], ],
take: 10, take: 10,
select: ['id', 'displayName', 'type', 'barcode', 'image', 'createdAt'], select: [
'id',
'displayName',
'type',
'barcode',
'weight',
'sku',
'image',
'createdAt',
],
}); });
} }
@ -273,7 +282,16 @@ export class StorageService {
}, },
], ],
take: 10, take: 10,
select: ['id', 'displayName', 'type', 'barcode', 'image', 'createdAt'], select: [
'id',
'displayName',
'type',
'barcode',
'weight',
'sku',
'image',
'createdAt',
],
}); });
} }