A continuation of HomeBox the inventory and organization system built for the Home User
fix: API should expect actual floats now
Matt Kilgore908bfb530ebd
diff --git a/backend/app/api/static/docs/docs.go b/backend/app/api/static/docs/docs.goindex b5fa2dcb..79d62ccc 100644--- a/backend/app/api/static/docs/docs.go+++ b/backend/app/api/static/docs/docs.go@@ -2347,6 +2347,9 @@ const docTemplate = `{},"repo.ItemUpdate": {"type": "object",+ "required": [+ "name"+ ],"properties": {"archived": {"type": "boolean"@@ -2355,7 +2358,8 @@ const docTemplate = `{"type": "string"},"description": {- "type": "string"+ "type": "string",+ "maxLength": 1000},"fields": {"type": "array",@@ -2390,7 +2394,9 @@ const docTemplate = `{"type": "string"},"name": {- "type": "string"+ "type": "string",+ "maxLength": 255,+ "minLength": 1},"notes": {"description": "Extras",@@ -2402,11 +2408,11 @@ const docTemplate = `{"x-omitempty": true},"purchaseFrom": {- "type": "string"+ "type": "string",+ "maxLength": 255},"purchasePrice": {- "type": "string",- "example": "0"+ "type": "number"},"purchaseTime": {"description": "Purchase",@@ -2423,15 +2429,15 @@ const docTemplate = `{"type": "string"},"soldPrice": {- "type": "string",- "example": "0"+ "type": "number"},"soldTime": {"description": "Sold","type": "string"},"soldTo": {- "type": "string"+ "type": "string",+ "maxLength": 255},"warrantyDetails": {"type": "string"@@ -2763,7 +2769,6 @@ const docTemplate = `{"type": "string"},"url": {- "description": "URL field is not exposed to the client","type": "string"},"userId": {diff --git a/backend/app/api/static/docs/swagger.json b/backend/app/api/static/docs/swagger.jsonindex 12e556ce..addf7280 100644--- a/backend/app/api/static/docs/swagger.json+++ b/backend/app/api/static/docs/swagger.json@@ -2340,6 +2340,9 @@},"repo.ItemUpdate": {"type": "object",+ "required": [+ "name"+ ],"properties": {"archived": {"type": "boolean"@@ -2348,7 +2351,8 @@"type": "string"},"description": {- "type": "string"+ "type": "string",+ "maxLength": 1000},"fields": {"type": "array",@@ -2383,7 +2387,9 @@"type": "string"},"name": {- "type": "string"+ "type": "string",+ "maxLength": 255,+ "minLength": 1},"notes": {"description": "Extras",@@ -2395,11 +2401,11 @@"x-omitempty": true},"purchaseFrom": {- "type": "string"+ "type": "string",+ "maxLength": 255},"purchasePrice": {- "type": "string",- "example": "0"+ "type": "number"},"purchaseTime": {"description": "Purchase",@@ -2416,15 +2422,15 @@"type": "string"},"soldPrice": {- "type": "string",- "example": "0"+ "type": "number"},"soldTime": {"description": "Sold","type": "string"},"soldTo": {- "type": "string"+ "type": "string",+ "maxLength": 255},"warrantyDetails": {"type": "string"@@ -2756,7 +2762,6 @@"type": "string"},"url": {- "description": "URL field is not exposed to the client","type": "string"},"userId": {diff --git a/backend/app/api/static/docs/swagger.yaml b/backend/app/api/static/docs/swagger.yamlindex e663b6a6..a7211acb 100644--- a/backend/app/api/static/docs/swagger.yaml+++ b/backend/app/api/static/docs/swagger.yaml@@ -264,6 +264,7 @@ definitions:assetId:type: stringdescription:+ maxLength: 1000type: stringfields:items:@@ -288,6 +289,8 @@ definitions:modelNumber:type: stringname:+ maxLength: 255+ minLength: 1type: stringnotes:description: Extras@@ -297,10 +300,10 @@ definitions:x-nullable: truex-omitempty: truepurchaseFrom:+ maxLength: 255type: stringpurchasePrice:- example: "0"- type: string+ type: numberpurchaseTime:description: Purchasetype: string@@ -312,17 +315,19 @@ definitions:soldNotes:type: stringsoldPrice:- example: "0"- type: string+ type: numbersoldTime:description: Soldtype: stringsoldTo:+ maxLength: 255type: stringwarrantyDetails:type: stringwarrantyExpires:type: string+ required:+ - nametype: objectrepo.LabelCreate:properties:@@ -540,7 +545,6 @@ definitions:updatedAt:type: stringurl:- description: URL field is not exposed to the clienttype: stringuserId:type: stringdiff --git a/backend/internal/data/repo/repo_items.go b/backend/internal/data/repo/repo_items.goindex 73d72a89..d67a60a3 100644--- a/backend/internal/data/repo/repo_items.go+++ b/backend/internal/data/repo/repo_items.go@@ -93,12 +93,12 @@ type (// PurchasePurchaseTime types.Date `json:"purchaseTime"`PurchaseFrom string `json:"purchaseFrom" validate:"max=255"`- PurchasePrice float64 `json:"purchasePrice,string"`+ PurchasePrice float64 `json:"purchasePrice"`// SoldSoldTime types.Date `json:"soldTime"`SoldTo string `json:"soldTo" validate:"max=255"`- SoldPrice float64 `json:"soldPrice,string"`+ SoldPrice float64 `json:"soldPrice"`SoldNotes string `json:"soldNotes"`// Extrasdiff --git a/frontend/lib/api/types/data-contracts.ts b/frontend/lib/api/types/data-contracts.tsindex f56ffae1..952e4f1e 100644--- a/frontend/lib/api/types/data-contracts.ts+++ b/frontend/lib/api/types/data-contracts.ts@@ -159,6 +159,7 @@ export enum ItemType {export interface ItemUpdate {archived: boolean;assetId: string;+ /** @maxLength 1000 */description: string;fields: ItemField[];id: string;@@ -170,23 +171,27 @@ export interface ItemUpdate {locationId: string;manufacturer: string;modelNumber: string;+ /**+ * @minLength 1+ * @maxLength 255+ */name: string;/** Extras */notes: string;parentId?: string | null;+ /** @maxLength 255 */purchaseFrom: string;- /** @example "0" */- purchasePrice: string;+ purchasePrice: number;/** Purchase */purchaseTime: Date | string;quantity: number;/** Identifications */serialNumber: string;soldNotes: string;- /** @example "0" */- soldPrice: string;+ soldPrice: number;/** Sold */soldTime: Date | string;+ /** @maxLength 255 */soldTo: string;warrantyDetails: string;warrantyExpires: Date | string;@@ -323,7 +328,6 @@ export interface NotifierOut {isActive: boolean;name: string;updatedAt: Date | string;- /** URL field is not exposed to the client */url: string;userId: string;}