From 6f3f072a04144789198bf786757b8df2dddae39b Mon Sep 17 00:00:00 2001 From: Hayden <64056131+hay-kot@users.noreply.github.com> Date: Fri, 27 Jan 2023 14:19:02 -0900 Subject: [PATCH] codegen --- backend/app/api/static/docs/docs.go | 4 ++ backend/app/api/static/docs/swagger.json | 4 ++ backend/app/api/static/docs/swagger.yaml | 3 ++ frontend/lib/api/types/data-contracts.ts | 65 ++++++++++++------------ 4 files changed, 44 insertions(+), 32 deletions(-) diff --git a/backend/app/api/static/docs/docs.go b/backend/app/api/static/docs/docs.go index b2b798d..5cfe772 100644 --- a/backend/app/api/static/docs/docs.go +++ b/backend/app/api/static/docs/docs.go @@ -1945,6 +1945,10 @@ const docTemplate = `{ }, "name": { "type": "string" + }, + "parentId": { + "type": "string", + "x-nullable": true } } }, diff --git a/backend/app/api/static/docs/swagger.json b/backend/app/api/static/docs/swagger.json index 30a25ee..4f04b24 100644 --- a/backend/app/api/static/docs/swagger.json +++ b/backend/app/api/static/docs/swagger.json @@ -1937,6 +1937,10 @@ }, "name": { "type": "string" + }, + "parentId": { + "type": "string", + "x-nullable": true } } }, diff --git a/backend/app/api/static/docs/swagger.yaml b/backend/app/api/static/docs/swagger.yaml index f3a730f..a94f1f5 100644 --- a/backend/app/api/static/docs/swagger.yaml +++ b/backend/app/api/static/docs/swagger.yaml @@ -322,6 +322,9 @@ definitions: type: string name: type: string + parentId: + type: string + x-nullable: true type: object repo.LocationOut: properties: diff --git a/frontend/lib/api/types/data-contracts.ts b/frontend/lib/api/types/data-contracts.ts index 7b0882c..ab91907 100644 --- a/frontend/lib/api/types/data-contracts.ts +++ b/frontend/lib/api/types/data-contracts.ts @@ -17,11 +17,11 @@ export interface DocumentOut { } export interface Group { - createdAt: string; + createdAt: Date; currency: string; id: string; name: string; - updatedAt: string; + updatedAt: Date; } export interface GroupStatistics { @@ -39,11 +39,11 @@ export interface GroupUpdate { } export interface ItemAttachment { - createdAt: string; + createdAt: Date; document: DocumentOut; id: string; type: string; - updatedAt: string; + updatedAt: Date; } export interface ItemAttachmentUpdate { @@ -76,7 +76,7 @@ export interface ItemOut { assetId: string; attachments: ItemAttachment[]; children: ItemSummary[]; - createdAt: string; + createdAt: Date; description: string; fields: ItemField[]; id: string; @@ -96,23 +96,23 @@ export interface ItemOut { /** @example "0" */ purchasePrice: string; /** Purchase */ - purchaseTime: string; + purchaseTime: Date; quantity: number; serialNumber: string; soldNotes: string; /** @example "0" */ soldPrice: string; /** Sold */ - soldTime: string; + soldTime: Date; soldTo: string; - updatedAt: string; + updatedAt: Date; warrantyDetails: string; - warrantyExpires: string; + warrantyExpires: Date; } export interface ItemSummary { archived: boolean; - createdAt: string; + createdAt: Date; description: string; id: string; insured: boolean; @@ -123,7 +123,7 @@ export interface ItemSummary { /** @example "0" */ purchasePrice: string; quantity: number; - updatedAt: string; + updatedAt: Date; } export interface ItemUpdate { @@ -148,7 +148,7 @@ export interface ItemUpdate { /** @example "0" */ purchasePrice: string; /** Purchase */ - purchaseTime: string; + purchaseTime: Date; quantity: number; /** Identifications */ serialNumber: string; @@ -156,10 +156,10 @@ export interface ItemUpdate { /** @example "0" */ soldPrice: string; /** Sold */ - soldTime: string; + soldTime: Date; soldTo: string; warrantyDetails: string; - warrantyExpires: string; + warrantyExpires: Date; } export interface LabelCreate { @@ -169,53 +169,54 @@ export interface LabelCreate { } export interface LabelOut { - createdAt: string; + createdAt: Date; description: string; id: string; items: ItemSummary[]; name: string; - updatedAt: string; + updatedAt: Date; } export interface LabelSummary { - createdAt: string; + createdAt: Date; description: string; id: string; name: string; - updatedAt: string; + updatedAt: Date; } export interface LocationCreate { description: string; name: string; + parentId: string | null; } export interface LocationOut { children: LocationSummary[]; - createdAt: string; + createdAt: Date; description: string; id: string; items: ItemSummary[]; name: string; parent: LocationSummary; - updatedAt: string; + updatedAt: Date; } export interface LocationOutCount { - createdAt: string; + createdAt: Date; description: string; id: string; itemCount: number; name: string; - updatedAt: string; + updatedAt: Date; } export interface LocationSummary { - createdAt: string; + createdAt: Date; description: string; id: string; name: string; - updatedAt: string; + updatedAt: Date; } export interface LocationUpdate { @@ -228,7 +229,7 @@ export interface LocationUpdate { export interface MaintenanceEntry { /** @example "0" */ cost: string; - date: string; + date: Date; description: string; id: string; name: string; @@ -237,7 +238,7 @@ export interface MaintenanceEntry { export interface MaintenanceEntryCreate { /** @example "0" */ cost: string; - date: string; + date: Date; description: string; name: string; } @@ -245,7 +246,7 @@ export interface MaintenanceEntryCreate { export interface MaintenanceEntryUpdate { /** @example "0" */ cost: string; - date: string; + date: Date; description: string; name: string; } @@ -257,7 +258,7 @@ export interface MaintenanceLog { itemId: string; } -export interface PaginationResultRepoItemSummary { +export interface PaginationResultItemSummary { items: ItemSummary[]; page: number; pageSize: number; @@ -300,7 +301,7 @@ export interface ValueOverTime { } export interface ValueOverTimeEntry { - date: string; + date: Date; name: string; value: number; } @@ -353,13 +354,13 @@ export interface EnsureAssetIDResult { } export interface GroupInvitation { - expiresAt: string; + expiresAt: Date; token: string; uses: number; } export interface GroupInvitationCreate { - expiresAt: string; + expiresAt: Date; uses: number; } @@ -369,6 +370,6 @@ export interface ItemAttachmentToken { export interface TokenResponse { attachmentToken: string; - expiresAt: string; + expiresAt: Date; token: string; }