feat: add receiptName field to InventoryItem model and update related DTOs and service
This commit is contained in:
@@ -36,6 +36,10 @@ export class CreateInventoryDto {
|
||||
@IsString()
|
||||
brand?: string;
|
||||
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
receiptName?: string;
|
||||
|
||||
@IsOptional()
|
||||
@IsBoolean()
|
||||
opened?: boolean;
|
||||
|
||||
@@ -39,6 +39,10 @@ export class UpdateInventoryDto {
|
||||
@IsString()
|
||||
brand?: string;
|
||||
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
receiptName?: string;
|
||||
|
||||
@IsOptional()
|
||||
@IsBoolean()
|
||||
opened?: boolean;
|
||||
|
||||
@@ -143,6 +143,7 @@ export class InventoryService {
|
||||
quantity: new Prisma.Decimal(data.quantity),
|
||||
location: data.location?.trim() || undefined,
|
||||
brand: data.brand?.trim() || undefined,
|
||||
receiptName: data.receiptName?.trim() || undefined,
|
||||
suitableFor: data.suitableFor?.trim() || undefined,
|
||||
comment: data.comment?.trim() || undefined,
|
||||
purchaseDate: data.purchaseDate
|
||||
@@ -200,6 +201,10 @@ export class InventoryService {
|
||||
if (typeof data.brand === 'string') {
|
||||
updateData.brand = data.brand.trim();
|
||||
}
|
||||
|
||||
if (typeof data.receiptName === 'string') {
|
||||
updateData.receiptName = data.receiptName.trim();
|
||||
}
|
||||
|
||||
if (typeof data.priority === 'number') {
|
||||
updateData.priority = data.priority;
|
||||
|
||||
Reference in New Issue
Block a user