feat: items-editor (#5)

* format readme

* update logo

* format html

* add logo to docs

* repository for document and document tokens

* add attachments type and repository

* autogenerate types via scripts

* use autogenerated types

* attachment type updates

* add insured and quantity fields for items

* implement HasID interface for entities

* implement label updates for items

* implement service update method

* WIP item update client side actions

* check err on attachment

* finish types for basic items editor

* remove unused var

* house keeping
This commit is contained in:
Hayden 2022-09-12 14:47:27 -08:00 committed by GitHub
parent fbc364dcd2
commit 95ab14b866
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
125 changed files with 15626 additions and 1791 deletions

View file

@ -49,7 +49,7 @@ const docTemplate = `{
"items": {
"type": "array",
"items": {
"$ref": "#/definitions/types.ItemOut"
"$ref": "#/definitions/types.ItemSummary"
}
}
}
@ -175,6 +175,15 @@ const docTemplate = `{
"name": "id",
"in": "path",
"required": true
},
{
"description": "Item Data",
"name": "payload",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/types.ItemUpdate"
}
}
],
"responses": {
@ -691,7 +700,7 @@ const docTemplate = `{
"type": "object",
"properties": {
"item": {
"$ref": "#/definitions/ent.User"
"$ref": "#/definitions/types.UserOut"
}
}
}
@ -788,422 +797,6 @@ const docTemplate = `{
}
},
"definitions": {
"ent.AuthTokens": {
"type": "object",
"properties": {
"created_at": {
"description": "CreatedAt holds the value of the \"created_at\" field.",
"type": "string"
},
"edges": {
"description": "Edges holds the relations/edges for other nodes in the graph.\nThe values are being populated by the AuthTokensQuery when eager-loading is set.",
"$ref": "#/definitions/ent.AuthTokensEdges"
},
"expires_at": {
"description": "ExpiresAt holds the value of the \"expires_at\" field.",
"type": "string"
},
"id": {
"description": "ID of the ent.",
"type": "string"
},
"token": {
"description": "Token holds the value of the \"token\" field.",
"type": "array",
"items": {
"type": "integer"
}
},
"updated_at": {
"description": "UpdatedAt holds the value of the \"updated_at\" field.",
"type": "string"
}
}
},
"ent.AuthTokensEdges": {
"type": "object",
"properties": {
"user": {
"description": "User holds the value of the user edge.",
"$ref": "#/definitions/ent.User"
}
}
},
"ent.Group": {
"type": "object",
"properties": {
"created_at": {
"description": "CreatedAt holds the value of the \"created_at\" field.",
"type": "string"
},
"currency": {
"description": "Currency holds the value of the \"currency\" field.",
"type": "string"
},
"edges": {
"description": "Edges holds the relations/edges for other nodes in the graph.\nThe values are being populated by the GroupQuery when eager-loading is set.",
"$ref": "#/definitions/ent.GroupEdges"
},
"id": {
"description": "ID of the ent.",
"type": "string"
},
"name": {
"description": "Name holds the value of the \"name\" field.",
"type": "string"
},
"updated_at": {
"description": "UpdatedAt holds the value of the \"updated_at\" field.",
"type": "string"
}
}
},
"ent.GroupEdges": {
"type": "object",
"properties": {
"items": {
"description": "Items holds the value of the items edge.",
"type": "array",
"items": {
"$ref": "#/definitions/ent.Item"
}
},
"labels": {
"description": "Labels holds the value of the labels edge.",
"type": "array",
"items": {
"$ref": "#/definitions/ent.Label"
}
},
"locations": {
"description": "Locations holds the value of the locations edge.",
"type": "array",
"items": {
"$ref": "#/definitions/ent.Location"
}
},
"users": {
"description": "Users holds the value of the users edge.",
"type": "array",
"items": {
"$ref": "#/definitions/ent.User"
}
}
}
},
"ent.Item": {
"type": "object",
"properties": {
"created_at": {
"description": "CreatedAt holds the value of the \"created_at\" field.",
"type": "string"
},
"description": {
"description": "Description holds the value of the \"description\" field.",
"type": "string"
},
"edges": {
"description": "Edges holds the relations/edges for other nodes in the graph.\nThe values are being populated by the ItemQuery when eager-loading is set.",
"$ref": "#/definitions/ent.ItemEdges"
},
"id": {
"description": "ID of the ent.",
"type": "string"
},
"lifetime_warranty": {
"description": "LifetimeWarranty holds the value of the \"lifetime_warranty\" field.",
"type": "boolean"
},
"manufacturer": {
"description": "Manufacturer holds the value of the \"manufacturer\" field.",
"type": "string"
},
"model_number": {
"description": "ModelNumber holds the value of the \"model_number\" field.",
"type": "string"
},
"name": {
"description": "Name holds the value of the \"name\" field.",
"type": "string"
},
"notes": {
"description": "Notes holds the value of the \"notes\" field.",
"type": "string"
},
"purchase_from": {
"description": "PurchaseFrom holds the value of the \"purchase_from\" field.",
"type": "string"
},
"purchase_price": {
"description": "PurchasePrice holds the value of the \"purchase_price\" field.",
"type": "number"
},
"purchase_time": {
"description": "PurchaseTime holds the value of the \"purchase_time\" field.",
"type": "string"
},
"serial_number": {
"description": "SerialNumber holds the value of the \"serial_number\" field.",
"type": "string"
},
"sold_notes": {
"description": "SoldNotes holds the value of the \"sold_notes\" field.",
"type": "string"
},
"sold_price": {
"description": "SoldPrice holds the value of the \"sold_price\" field.",
"type": "number"
},
"sold_time": {
"description": "SoldTime holds the value of the \"sold_time\" field.",
"type": "string"
},
"sold_to": {
"description": "SoldTo holds the value of the \"sold_to\" field.",
"type": "string"
},
"updated_at": {
"description": "UpdatedAt holds the value of the \"updated_at\" field.",
"type": "string"
},
"warranty_details": {
"description": "WarrantyDetails holds the value of the \"warranty_details\" field.",
"type": "string"
},
"warranty_expires": {
"description": "WarrantyExpires holds the value of the \"warranty_expires\" field.",
"type": "string"
}
}
},
"ent.ItemEdges": {
"type": "object",
"properties": {
"fields": {
"description": "Fields holds the value of the fields edge.",
"type": "array",
"items": {
"$ref": "#/definitions/ent.ItemField"
}
},
"group": {
"description": "Group holds the value of the group edge.",
"$ref": "#/definitions/ent.Group"
},
"label": {
"description": "Label holds the value of the label edge.",
"type": "array",
"items": {
"$ref": "#/definitions/ent.Label"
}
},
"location": {
"description": "Location holds the value of the location edge.",
"$ref": "#/definitions/ent.Location"
}
}
},
"ent.ItemField": {
"type": "object",
"properties": {
"boolean_value": {
"description": "BooleanValue holds the value of the \"boolean_value\" field.",
"type": "boolean"
},
"created_at": {
"description": "CreatedAt holds the value of the \"created_at\" field.",
"type": "string"
},
"description": {
"description": "Description holds the value of the \"description\" field.",
"type": "string"
},
"edges": {
"description": "Edges holds the relations/edges for other nodes in the graph.\nThe values are being populated by the ItemFieldQuery when eager-loading is set.",
"$ref": "#/definitions/ent.ItemFieldEdges"
},
"id": {
"description": "ID of the ent.",
"type": "string"
},
"name": {
"description": "Name holds the value of the \"name\" field.",
"type": "string"
},
"number_value": {
"description": "NumberValue holds the value of the \"number_value\" field.",
"type": "integer"
},
"text_value": {
"description": "TextValue holds the value of the \"text_value\" field.",
"type": "string"
},
"time_value": {
"description": "TimeValue holds the value of the \"time_value\" field.",
"type": "string"
},
"type": {
"description": "Type holds the value of the \"type\" field.",
"type": "string"
},
"updated_at": {
"description": "UpdatedAt holds the value of the \"updated_at\" field.",
"type": "string"
}
}
},
"ent.ItemFieldEdges": {
"type": "object",
"properties": {
"item": {
"description": "Item holds the value of the item edge.",
"$ref": "#/definitions/ent.Item"
}
}
},
"ent.Label": {
"type": "object",
"properties": {
"color": {
"description": "Color holds the value of the \"color\" field.",
"type": "string"
},
"created_at": {
"description": "CreatedAt holds the value of the \"created_at\" field.",
"type": "string"
},
"description": {
"description": "Description holds the value of the \"description\" field.",
"type": "string"
},
"edges": {
"description": "Edges holds the relations/edges for other nodes in the graph.\nThe values are being populated by the LabelQuery when eager-loading is set.",
"$ref": "#/definitions/ent.LabelEdges"
},
"id": {
"description": "ID of the ent.",
"type": "string"
},
"name": {
"description": "Name holds the value of the \"name\" field.",
"type": "string"
},
"updated_at": {
"description": "UpdatedAt holds the value of the \"updated_at\" field.",
"type": "string"
}
}
},
"ent.LabelEdges": {
"type": "object",
"properties": {
"group": {
"description": "Group holds the value of the group edge.",
"$ref": "#/definitions/ent.Group"
},
"items": {
"description": "Items holds the value of the items edge.",
"type": "array",
"items": {
"$ref": "#/definitions/ent.Item"
}
}
}
},
"ent.Location": {
"type": "object",
"properties": {
"created_at": {
"description": "CreatedAt holds the value of the \"created_at\" field.",
"type": "string"
},
"description": {
"description": "Description holds the value of the \"description\" field.",
"type": "string"
},
"edges": {
"description": "Edges holds the relations/edges for other nodes in the graph.\nThe values are being populated by the LocationQuery when eager-loading is set.",
"$ref": "#/definitions/ent.LocationEdges"
},
"id": {
"description": "ID of the ent.",
"type": "string"
},
"name": {
"description": "Name holds the value of the \"name\" field.",
"type": "string"
},
"updated_at": {
"description": "UpdatedAt holds the value of the \"updated_at\" field.",
"type": "string"
}
}
},
"ent.LocationEdges": {
"type": "object",
"properties": {
"group": {
"description": "Group holds the value of the group edge.",
"$ref": "#/definitions/ent.Group"
},
"items": {
"description": "Items holds the value of the items edge.",
"type": "array",
"items": {
"$ref": "#/definitions/ent.Item"
}
}
}
},
"ent.User": {
"type": "object",
"properties": {
"created_at": {
"description": "CreatedAt holds the value of the \"created_at\" field.",
"type": "string"
},
"edges": {
"description": "Edges holds the relations/edges for other nodes in the graph.\nThe values are being populated by the UserQuery when eager-loading is set.",
"$ref": "#/definitions/ent.UserEdges"
},
"email": {
"description": "Email holds the value of the \"email\" field.",
"type": "string"
},
"id": {
"description": "ID of the ent.",
"type": "string"
},
"is_superuser": {
"description": "IsSuperuser holds the value of the \"is_superuser\" field.",
"type": "boolean"
},
"name": {
"description": "Name holds the value of the \"name\" field.",
"type": "string"
},
"updated_at": {
"description": "UpdatedAt holds the value of the \"updated_at\" field.",
"type": "string"
}
}
},
"ent.UserEdges": {
"type": "object",
"properties": {
"auth_tokens": {
"description": "AuthTokens holds the value of the auth_tokens edge.",
"type": "array",
"items": {
"$ref": "#/definitions/ent.AuthTokens"
}
},
"group": {
"description": "Group holds the value of the group edge.",
"$ref": "#/definitions/ent.Group"
}
}
},
"server.Result": {
"type": "object",
"properties": {
@ -1245,6 +838,37 @@ const docTemplate = `{
}
}
},
"types.DocumentOut": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"path": {
"type": "string"
},
"title": {
"type": "string"
}
}
},
"types.ItemAttachment": {
"type": "object",
"properties": {
"createdAt": {
"type": "string"
},
"document": {
"$ref": "#/definitions/types.DocumentOut"
},
"id": {
"type": "string"
},
"updatedAt": {
"type": "string"
}
}
},
"types.ItemCreate": {
"type": "object",
"properties": {
@ -1269,6 +893,12 @@ const docTemplate = `{
"types.ItemOut": {
"type": "object",
"properties": {
"attachments": {
"type": "array",
"items": {
"$ref": "#/definitions/types.ItemAttachment"
}
},
"createdAt": {
"type": "string"
},
@ -1278,6 +908,9 @@ const docTemplate = `{
"id": {
"type": "string"
},
"insured": {
"type": "boolean"
},
"labels": {
"type": "array",
"items": {
@ -1309,12 +942,16 @@ const docTemplate = `{
"type": "string"
},
"purchasePrice": {
"type": "number"
"type": "string",
"example": "0"
},
"purchaseTime": {
"description": "Purchase",
"type": "string"
},
"quantity": {
"type": "integer"
},
"serialNumber": {
"description": "Identifications",
"type": "string"
@ -1323,7 +960,8 @@ const docTemplate = `{
"type": "string"
},
"soldPrice": {
"type": "number"
"type": "string",
"example": "0"
},
"soldTime": {
"description": "Sold",
@ -1355,6 +993,9 @@ const docTemplate = `{
"id": {
"type": "string"
},
"insured": {
"type": "boolean"
},
"labels": {
"type": "array",
"items": {
@ -1386,12 +1027,16 @@ const docTemplate = `{
"type": "string"
},
"purchasePrice": {
"type": "number"
"type": "string",
"example": "0"
},
"purchaseTime": {
"description": "Purchase",
"type": "string"
},
"quantity": {
"type": "integer"
},
"serialNumber": {
"description": "Identifications",
"type": "string"
@ -1400,7 +1045,8 @@ const docTemplate = `{
"type": "string"
},
"soldPrice": {
"type": "number"
"type": "string",
"example": "0"
},
"soldTime": {
"description": "Sold",
@ -1420,6 +1066,85 @@ const docTemplate = `{
}
}
},
"types.ItemUpdate": {
"type": "object",
"properties": {
"description": {
"type": "string"
},
"id": {
"type": "string"
},
"insured": {
"type": "boolean"
},
"labelIds": {
"type": "array",
"items": {
"type": "string"
}
},
"lifetimeWarranty": {
"description": "Warranty",
"type": "boolean"
},
"locationId": {
"description": "Edges",
"type": "string"
},
"manufacturer": {
"type": "string"
},
"modelNumber": {
"type": "string"
},
"name": {
"type": "string"
},
"notes": {
"description": "Extras",
"type": "string"
},
"purchaseFrom": {
"type": "string"
},
"purchasePrice": {
"type": "string",
"example": "0"
},
"purchaseTime": {
"description": "Purchase",
"type": "string"
},
"quantity": {
"type": "integer"
},
"serialNumber": {
"description": "Identifications",
"type": "string"
},
"soldNotes": {
"type": "string"
},
"soldPrice": {
"type": "string",
"example": "0"
},
"soldTime": {
"description": "Sold",
"type": "string"
},
"soldTo": {
"type": "string"
},
"warrantyDetails": {
"type": "string"
},
"warrantyExpires": {
"type": "string"
}
}
},
"types.LabelCreate": {
"type": "object",
"properties": {
@ -1591,6 +1316,29 @@ const docTemplate = `{
}
}
},
"types.UserOut": {
"type": "object",
"properties": {
"email": {
"type": "string"
},
"groupId": {
"type": "string"
},
"groupName": {
"type": "string"
},
"id": {
"type": "string"
},
"isSuperuser": {
"type": "boolean"
},
"name": {
"type": "string"
}
}
},
"types.UserRegistration": {
"type": "object",
"properties": {

View file

@ -41,7 +41,7 @@
"items": {
"type": "array",
"items": {
"$ref": "#/definitions/types.ItemOut"
"$ref": "#/definitions/types.ItemSummary"
}
}
}
@ -167,6 +167,15 @@
"name": "id",
"in": "path",
"required": true
},
{
"description": "Item Data",
"name": "payload",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/types.ItemUpdate"
}
}
],
"responses": {
@ -683,7 +692,7 @@
"type": "object",
"properties": {
"item": {
"$ref": "#/definitions/ent.User"
"$ref": "#/definitions/types.UserOut"
}
}
}
@ -780,422 +789,6 @@
}
},
"definitions": {
"ent.AuthTokens": {
"type": "object",
"properties": {
"created_at": {
"description": "CreatedAt holds the value of the \"created_at\" field.",
"type": "string"
},
"edges": {
"description": "Edges holds the relations/edges for other nodes in the graph.\nThe values are being populated by the AuthTokensQuery when eager-loading is set.",
"$ref": "#/definitions/ent.AuthTokensEdges"
},
"expires_at": {
"description": "ExpiresAt holds the value of the \"expires_at\" field.",
"type": "string"
},
"id": {
"description": "ID of the ent.",
"type": "string"
},
"token": {
"description": "Token holds the value of the \"token\" field.",
"type": "array",
"items": {
"type": "integer"
}
},
"updated_at": {
"description": "UpdatedAt holds the value of the \"updated_at\" field.",
"type": "string"
}
}
},
"ent.AuthTokensEdges": {
"type": "object",
"properties": {
"user": {
"description": "User holds the value of the user edge.",
"$ref": "#/definitions/ent.User"
}
}
},
"ent.Group": {
"type": "object",
"properties": {
"created_at": {
"description": "CreatedAt holds the value of the \"created_at\" field.",
"type": "string"
},
"currency": {
"description": "Currency holds the value of the \"currency\" field.",
"type": "string"
},
"edges": {
"description": "Edges holds the relations/edges for other nodes in the graph.\nThe values are being populated by the GroupQuery when eager-loading is set.",
"$ref": "#/definitions/ent.GroupEdges"
},
"id": {
"description": "ID of the ent.",
"type": "string"
},
"name": {
"description": "Name holds the value of the \"name\" field.",
"type": "string"
},
"updated_at": {
"description": "UpdatedAt holds the value of the \"updated_at\" field.",
"type": "string"
}
}
},
"ent.GroupEdges": {
"type": "object",
"properties": {
"items": {
"description": "Items holds the value of the items edge.",
"type": "array",
"items": {
"$ref": "#/definitions/ent.Item"
}
},
"labels": {
"description": "Labels holds the value of the labels edge.",
"type": "array",
"items": {
"$ref": "#/definitions/ent.Label"
}
},
"locations": {
"description": "Locations holds the value of the locations edge.",
"type": "array",
"items": {
"$ref": "#/definitions/ent.Location"
}
},
"users": {
"description": "Users holds the value of the users edge.",
"type": "array",
"items": {
"$ref": "#/definitions/ent.User"
}
}
}
},
"ent.Item": {
"type": "object",
"properties": {
"created_at": {
"description": "CreatedAt holds the value of the \"created_at\" field.",
"type": "string"
},
"description": {
"description": "Description holds the value of the \"description\" field.",
"type": "string"
},
"edges": {
"description": "Edges holds the relations/edges for other nodes in the graph.\nThe values are being populated by the ItemQuery when eager-loading is set.",
"$ref": "#/definitions/ent.ItemEdges"
},
"id": {
"description": "ID of the ent.",
"type": "string"
},
"lifetime_warranty": {
"description": "LifetimeWarranty holds the value of the \"lifetime_warranty\" field.",
"type": "boolean"
},
"manufacturer": {
"description": "Manufacturer holds the value of the \"manufacturer\" field.",
"type": "string"
},
"model_number": {
"description": "ModelNumber holds the value of the \"model_number\" field.",
"type": "string"
},
"name": {
"description": "Name holds the value of the \"name\" field.",
"type": "string"
},
"notes": {
"description": "Notes holds the value of the \"notes\" field.",
"type": "string"
},
"purchase_from": {
"description": "PurchaseFrom holds the value of the \"purchase_from\" field.",
"type": "string"
},
"purchase_price": {
"description": "PurchasePrice holds the value of the \"purchase_price\" field.",
"type": "number"
},
"purchase_time": {
"description": "PurchaseTime holds the value of the \"purchase_time\" field.",
"type": "string"
},
"serial_number": {
"description": "SerialNumber holds the value of the \"serial_number\" field.",
"type": "string"
},
"sold_notes": {
"description": "SoldNotes holds the value of the \"sold_notes\" field.",
"type": "string"
},
"sold_price": {
"description": "SoldPrice holds the value of the \"sold_price\" field.",
"type": "number"
},
"sold_time": {
"description": "SoldTime holds the value of the \"sold_time\" field.",
"type": "string"
},
"sold_to": {
"description": "SoldTo holds the value of the \"sold_to\" field.",
"type": "string"
},
"updated_at": {
"description": "UpdatedAt holds the value of the \"updated_at\" field.",
"type": "string"
},
"warranty_details": {
"description": "WarrantyDetails holds the value of the \"warranty_details\" field.",
"type": "string"
},
"warranty_expires": {
"description": "WarrantyExpires holds the value of the \"warranty_expires\" field.",
"type": "string"
}
}
},
"ent.ItemEdges": {
"type": "object",
"properties": {
"fields": {
"description": "Fields holds the value of the fields edge.",
"type": "array",
"items": {
"$ref": "#/definitions/ent.ItemField"
}
},
"group": {
"description": "Group holds the value of the group edge.",
"$ref": "#/definitions/ent.Group"
},
"label": {
"description": "Label holds the value of the label edge.",
"type": "array",
"items": {
"$ref": "#/definitions/ent.Label"
}
},
"location": {
"description": "Location holds the value of the location edge.",
"$ref": "#/definitions/ent.Location"
}
}
},
"ent.ItemField": {
"type": "object",
"properties": {
"boolean_value": {
"description": "BooleanValue holds the value of the \"boolean_value\" field.",
"type": "boolean"
},
"created_at": {
"description": "CreatedAt holds the value of the \"created_at\" field.",
"type": "string"
},
"description": {
"description": "Description holds the value of the \"description\" field.",
"type": "string"
},
"edges": {
"description": "Edges holds the relations/edges for other nodes in the graph.\nThe values are being populated by the ItemFieldQuery when eager-loading is set.",
"$ref": "#/definitions/ent.ItemFieldEdges"
},
"id": {
"description": "ID of the ent.",
"type": "string"
},
"name": {
"description": "Name holds the value of the \"name\" field.",
"type": "string"
},
"number_value": {
"description": "NumberValue holds the value of the \"number_value\" field.",
"type": "integer"
},
"text_value": {
"description": "TextValue holds the value of the \"text_value\" field.",
"type": "string"
},
"time_value": {
"description": "TimeValue holds the value of the \"time_value\" field.",
"type": "string"
},
"type": {
"description": "Type holds the value of the \"type\" field.",
"type": "string"
},
"updated_at": {
"description": "UpdatedAt holds the value of the \"updated_at\" field.",
"type": "string"
}
}
},
"ent.ItemFieldEdges": {
"type": "object",
"properties": {
"item": {
"description": "Item holds the value of the item edge.",
"$ref": "#/definitions/ent.Item"
}
}
},
"ent.Label": {
"type": "object",
"properties": {
"color": {
"description": "Color holds the value of the \"color\" field.",
"type": "string"
},
"created_at": {
"description": "CreatedAt holds the value of the \"created_at\" field.",
"type": "string"
},
"description": {
"description": "Description holds the value of the \"description\" field.",
"type": "string"
},
"edges": {
"description": "Edges holds the relations/edges for other nodes in the graph.\nThe values are being populated by the LabelQuery when eager-loading is set.",
"$ref": "#/definitions/ent.LabelEdges"
},
"id": {
"description": "ID of the ent.",
"type": "string"
},
"name": {
"description": "Name holds the value of the \"name\" field.",
"type": "string"
},
"updated_at": {
"description": "UpdatedAt holds the value of the \"updated_at\" field.",
"type": "string"
}
}
},
"ent.LabelEdges": {
"type": "object",
"properties": {
"group": {
"description": "Group holds the value of the group edge.",
"$ref": "#/definitions/ent.Group"
},
"items": {
"description": "Items holds the value of the items edge.",
"type": "array",
"items": {
"$ref": "#/definitions/ent.Item"
}
}
}
},
"ent.Location": {
"type": "object",
"properties": {
"created_at": {
"description": "CreatedAt holds the value of the \"created_at\" field.",
"type": "string"
},
"description": {
"description": "Description holds the value of the \"description\" field.",
"type": "string"
},
"edges": {
"description": "Edges holds the relations/edges for other nodes in the graph.\nThe values are being populated by the LocationQuery when eager-loading is set.",
"$ref": "#/definitions/ent.LocationEdges"
},
"id": {
"description": "ID of the ent.",
"type": "string"
},
"name": {
"description": "Name holds the value of the \"name\" field.",
"type": "string"
},
"updated_at": {
"description": "UpdatedAt holds the value of the \"updated_at\" field.",
"type": "string"
}
}
},
"ent.LocationEdges": {
"type": "object",
"properties": {
"group": {
"description": "Group holds the value of the group edge.",
"$ref": "#/definitions/ent.Group"
},
"items": {
"description": "Items holds the value of the items edge.",
"type": "array",
"items": {
"$ref": "#/definitions/ent.Item"
}
}
}
},
"ent.User": {
"type": "object",
"properties": {
"created_at": {
"description": "CreatedAt holds the value of the \"created_at\" field.",
"type": "string"
},
"edges": {
"description": "Edges holds the relations/edges for other nodes in the graph.\nThe values are being populated by the UserQuery when eager-loading is set.",
"$ref": "#/definitions/ent.UserEdges"
},
"email": {
"description": "Email holds the value of the \"email\" field.",
"type": "string"
},
"id": {
"description": "ID of the ent.",
"type": "string"
},
"is_superuser": {
"description": "IsSuperuser holds the value of the \"is_superuser\" field.",
"type": "boolean"
},
"name": {
"description": "Name holds the value of the \"name\" field.",
"type": "string"
},
"updated_at": {
"description": "UpdatedAt holds the value of the \"updated_at\" field.",
"type": "string"
}
}
},
"ent.UserEdges": {
"type": "object",
"properties": {
"auth_tokens": {
"description": "AuthTokens holds the value of the auth_tokens edge.",
"type": "array",
"items": {
"$ref": "#/definitions/ent.AuthTokens"
}
},
"group": {
"description": "Group holds the value of the group edge.",
"$ref": "#/definitions/ent.Group"
}
}
},
"server.Result": {
"type": "object",
"properties": {
@ -1237,6 +830,37 @@
}
}
},
"types.DocumentOut": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"path": {
"type": "string"
},
"title": {
"type": "string"
}
}
},
"types.ItemAttachment": {
"type": "object",
"properties": {
"createdAt": {
"type": "string"
},
"document": {
"$ref": "#/definitions/types.DocumentOut"
},
"id": {
"type": "string"
},
"updatedAt": {
"type": "string"
}
}
},
"types.ItemCreate": {
"type": "object",
"properties": {
@ -1261,6 +885,12 @@
"types.ItemOut": {
"type": "object",
"properties": {
"attachments": {
"type": "array",
"items": {
"$ref": "#/definitions/types.ItemAttachment"
}
},
"createdAt": {
"type": "string"
},
@ -1270,6 +900,9 @@
"id": {
"type": "string"
},
"insured": {
"type": "boolean"
},
"labels": {
"type": "array",
"items": {
@ -1301,12 +934,16 @@
"type": "string"
},
"purchasePrice": {
"type": "number"
"type": "string",
"example": "0"
},
"purchaseTime": {
"description": "Purchase",
"type": "string"
},
"quantity": {
"type": "integer"
},
"serialNumber": {
"description": "Identifications",
"type": "string"
@ -1315,7 +952,8 @@
"type": "string"
},
"soldPrice": {
"type": "number"
"type": "string",
"example": "0"
},
"soldTime": {
"description": "Sold",
@ -1347,6 +985,9 @@
"id": {
"type": "string"
},
"insured": {
"type": "boolean"
},
"labels": {
"type": "array",
"items": {
@ -1378,12 +1019,16 @@
"type": "string"
},
"purchasePrice": {
"type": "number"
"type": "string",
"example": "0"
},
"purchaseTime": {
"description": "Purchase",
"type": "string"
},
"quantity": {
"type": "integer"
},
"serialNumber": {
"description": "Identifications",
"type": "string"
@ -1392,7 +1037,8 @@
"type": "string"
},
"soldPrice": {
"type": "number"
"type": "string",
"example": "0"
},
"soldTime": {
"description": "Sold",
@ -1412,6 +1058,85 @@
}
}
},
"types.ItemUpdate": {
"type": "object",
"properties": {
"description": {
"type": "string"
},
"id": {
"type": "string"
},
"insured": {
"type": "boolean"
},
"labelIds": {
"type": "array",
"items": {
"type": "string"
}
},
"lifetimeWarranty": {
"description": "Warranty",
"type": "boolean"
},
"locationId": {
"description": "Edges",
"type": "string"
},
"manufacturer": {
"type": "string"
},
"modelNumber": {
"type": "string"
},
"name": {
"type": "string"
},
"notes": {
"description": "Extras",
"type": "string"
},
"purchaseFrom": {
"type": "string"
},
"purchasePrice": {
"type": "string",
"example": "0"
},
"purchaseTime": {
"description": "Purchase",
"type": "string"
},
"quantity": {
"type": "integer"
},
"serialNumber": {
"description": "Identifications",
"type": "string"
},
"soldNotes": {
"type": "string"
},
"soldPrice": {
"type": "string",
"example": "0"
},
"soldTime": {
"description": "Sold",
"type": "string"
},
"soldTo": {
"type": "string"
},
"warrantyDetails": {
"type": "string"
},
"warrantyExpires": {
"type": "string"
}
}
},
"types.LabelCreate": {
"type": "object",
"properties": {
@ -1583,6 +1308,29 @@
}
}
},
"types.UserOut": {
"type": "object",
"properties": {
"email": {
"type": "string"
},
"groupId": {
"type": "string"
},
"groupName": {
"type": "string"
},
"id": {
"type": "string"
},
"isSuperuser": {
"type": "boolean"
},
"name": {
"type": "string"
}
}
},
"types.UserRegistration": {
"type": "object",
"properties": {

View file

@ -1,318 +1,5 @@
basePath: /api
definitions:
ent.AuthTokens:
properties:
created_at:
description: CreatedAt holds the value of the "created_at" field.
type: string
edges:
$ref: '#/definitions/ent.AuthTokensEdges'
description: |-
Edges holds the relations/edges for other nodes in the graph.
The values are being populated by the AuthTokensQuery when eager-loading is set.
expires_at:
description: ExpiresAt holds the value of the "expires_at" field.
type: string
id:
description: ID of the ent.
type: string
token:
description: Token holds the value of the "token" field.
items:
type: integer
type: array
updated_at:
description: UpdatedAt holds the value of the "updated_at" field.
type: string
type: object
ent.AuthTokensEdges:
properties:
user:
$ref: '#/definitions/ent.User'
description: User holds the value of the user edge.
type: object
ent.Group:
properties:
created_at:
description: CreatedAt holds the value of the "created_at" field.
type: string
currency:
description: Currency holds the value of the "currency" field.
type: string
edges:
$ref: '#/definitions/ent.GroupEdges'
description: |-
Edges holds the relations/edges for other nodes in the graph.
The values are being populated by the GroupQuery when eager-loading is set.
id:
description: ID of the ent.
type: string
name:
description: Name holds the value of the "name" field.
type: string
updated_at:
description: UpdatedAt holds the value of the "updated_at" field.
type: string
type: object
ent.GroupEdges:
properties:
items:
description: Items holds the value of the items edge.
items:
$ref: '#/definitions/ent.Item'
type: array
labels:
description: Labels holds the value of the labels edge.
items:
$ref: '#/definitions/ent.Label'
type: array
locations:
description: Locations holds the value of the locations edge.
items:
$ref: '#/definitions/ent.Location'
type: array
users:
description: Users holds the value of the users edge.
items:
$ref: '#/definitions/ent.User'
type: array
type: object
ent.Item:
properties:
created_at:
description: CreatedAt holds the value of the "created_at" field.
type: string
description:
description: Description holds the value of the "description" field.
type: string
edges:
$ref: '#/definitions/ent.ItemEdges'
description: |-
Edges holds the relations/edges for other nodes in the graph.
The values are being populated by the ItemQuery when eager-loading is set.
id:
description: ID of the ent.
type: string
lifetime_warranty:
description: LifetimeWarranty holds the value of the "lifetime_warranty" field.
type: boolean
manufacturer:
description: Manufacturer holds the value of the "manufacturer" field.
type: string
model_number:
description: ModelNumber holds the value of the "model_number" field.
type: string
name:
description: Name holds the value of the "name" field.
type: string
notes:
description: Notes holds the value of the "notes" field.
type: string
purchase_from:
description: PurchaseFrom holds the value of the "purchase_from" field.
type: string
purchase_price:
description: PurchasePrice holds the value of the "purchase_price" field.
type: number
purchase_time:
description: PurchaseTime holds the value of the "purchase_time" field.
type: string
serial_number:
description: SerialNumber holds the value of the "serial_number" field.
type: string
sold_notes:
description: SoldNotes holds the value of the "sold_notes" field.
type: string
sold_price:
description: SoldPrice holds the value of the "sold_price" field.
type: number
sold_time:
description: SoldTime holds the value of the "sold_time" field.
type: string
sold_to:
description: SoldTo holds the value of the "sold_to" field.
type: string
updated_at:
description: UpdatedAt holds the value of the "updated_at" field.
type: string
warranty_details:
description: WarrantyDetails holds the value of the "warranty_details" field.
type: string
warranty_expires:
description: WarrantyExpires holds the value of the "warranty_expires" field.
type: string
type: object
ent.ItemEdges:
properties:
fields:
description: Fields holds the value of the fields edge.
items:
$ref: '#/definitions/ent.ItemField'
type: array
group:
$ref: '#/definitions/ent.Group'
description: Group holds the value of the group edge.
label:
description: Label holds the value of the label edge.
items:
$ref: '#/definitions/ent.Label'
type: array
location:
$ref: '#/definitions/ent.Location'
description: Location holds the value of the location edge.
type: object
ent.ItemField:
properties:
boolean_value:
description: BooleanValue holds the value of the "boolean_value" field.
type: boolean
created_at:
description: CreatedAt holds the value of the "created_at" field.
type: string
description:
description: Description holds the value of the "description" field.
type: string
edges:
$ref: '#/definitions/ent.ItemFieldEdges'
description: |-
Edges holds the relations/edges for other nodes in the graph.
The values are being populated by the ItemFieldQuery when eager-loading is set.
id:
description: ID of the ent.
type: string
name:
description: Name holds the value of the "name" field.
type: string
number_value:
description: NumberValue holds the value of the "number_value" field.
type: integer
text_value:
description: TextValue holds the value of the "text_value" field.
type: string
time_value:
description: TimeValue holds the value of the "time_value" field.
type: string
type:
description: Type holds the value of the "type" field.
type: string
updated_at:
description: UpdatedAt holds the value of the "updated_at" field.
type: string
type: object
ent.ItemFieldEdges:
properties:
item:
$ref: '#/definitions/ent.Item'
description: Item holds the value of the item edge.
type: object
ent.Label:
properties:
color:
description: Color holds the value of the "color" field.
type: string
created_at:
description: CreatedAt holds the value of the "created_at" field.
type: string
description:
description: Description holds the value of the "description" field.
type: string
edges:
$ref: '#/definitions/ent.LabelEdges'
description: |-
Edges holds the relations/edges for other nodes in the graph.
The values are being populated by the LabelQuery when eager-loading is set.
id:
description: ID of the ent.
type: string
name:
description: Name holds the value of the "name" field.
type: string
updated_at:
description: UpdatedAt holds the value of the "updated_at" field.
type: string
type: object
ent.LabelEdges:
properties:
group:
$ref: '#/definitions/ent.Group'
description: Group holds the value of the group edge.
items:
description: Items holds the value of the items edge.
items:
$ref: '#/definitions/ent.Item'
type: array
type: object
ent.Location:
properties:
created_at:
description: CreatedAt holds the value of the "created_at" field.
type: string
description:
description: Description holds the value of the "description" field.
type: string
edges:
$ref: '#/definitions/ent.LocationEdges'
description: |-
Edges holds the relations/edges for other nodes in the graph.
The values are being populated by the LocationQuery when eager-loading is set.
id:
description: ID of the ent.
type: string
name:
description: Name holds the value of the "name" field.
type: string
updated_at:
description: UpdatedAt holds the value of the "updated_at" field.
type: string
type: object
ent.LocationEdges:
properties:
group:
$ref: '#/definitions/ent.Group'
description: Group holds the value of the group edge.
items:
description: Items holds the value of the items edge.
items:
$ref: '#/definitions/ent.Item'
type: array
type: object
ent.User:
properties:
created_at:
description: CreatedAt holds the value of the "created_at" field.
type: string
edges:
$ref: '#/definitions/ent.UserEdges'
description: |-
Edges holds the relations/edges for other nodes in the graph.
The values are being populated by the UserQuery when eager-loading is set.
email:
description: Email holds the value of the "email" field.
type: string
id:
description: ID of the ent.
type: string
is_superuser:
description: IsSuperuser holds the value of the "is_superuser" field.
type: boolean
name:
description: Name holds the value of the "name" field.
type: string
updated_at:
description: UpdatedAt holds the value of the "updated_at" field.
type: string
type: object
ent.UserEdges:
properties:
auth_tokens:
description: AuthTokens holds the value of the auth_tokens edge.
items:
$ref: '#/definitions/ent.AuthTokens'
type: array
group:
$ref: '#/definitions/ent.Group'
description: Group holds the value of the group edge.
type: object
server.Result:
properties:
details: {}
@ -340,6 +27,26 @@ definitions:
type: string
type: array
type: object
types.DocumentOut:
properties:
id:
type: string
path:
type: string
title:
type: string
type: object
types.ItemAttachment:
properties:
createdAt:
type: string
document:
$ref: '#/definitions/types.DocumentOut'
id:
type: string
updatedAt:
type: string
type: object
types.ItemCreate:
properties:
description:
@ -356,12 +63,18 @@ definitions:
type: object
types.ItemOut:
properties:
attachments:
items:
$ref: '#/definitions/types.ItemAttachment'
type: array
createdAt:
type: string
description:
type: string
id:
type: string
insured:
type: boolean
labels:
items:
$ref: '#/definitions/types.LabelSummary'
@ -384,17 +97,21 @@ definitions:
purchaseFrom:
type: string
purchasePrice:
type: number
example: "0"
type: string
purchaseTime:
description: Purchase
type: string
quantity:
type: integer
serialNumber:
description: Identifications
type: string
soldNotes:
type: string
soldPrice:
type: number
example: "0"
type: string
soldTime:
description: Sold
type: string
@ -415,6 +132,8 @@ definitions:
type: string
id:
type: string
insured:
type: boolean
labels:
items:
$ref: '#/definitions/types.LabelSummary'
@ -437,17 +156,21 @@ definitions:
purchaseFrom:
type: string
purchasePrice:
type: number
example: "0"
type: string
purchaseTime:
description: Purchase
type: string
quantity:
type: integer
serialNumber:
description: Identifications
type: string
soldNotes:
type: string
soldPrice:
type: number
example: "0"
type: string
soldTime:
description: Sold
type: string
@ -460,6 +183,61 @@ definitions:
warrantyExpires:
type: string
type: object
types.ItemUpdate:
properties:
description:
type: string
id:
type: string
insured:
type: boolean
labelIds:
items:
type: string
type: array
lifetimeWarranty:
description: Warranty
type: boolean
locationId:
description: Edges
type: string
manufacturer:
type: string
modelNumber:
type: string
name:
type: string
notes:
description: Extras
type: string
purchaseFrom:
type: string
purchasePrice:
example: "0"
type: string
purchaseTime:
description: Purchase
type: string
quantity:
type: integer
serialNumber:
description: Identifications
type: string
soldNotes:
type: string
soldPrice:
example: "0"
type: string
soldTime:
description: Sold
type: string
soldTo:
type: string
warrantyDetails:
type: string
warrantyExpires:
type: string
type: object
types.LabelCreate:
properties:
color:
@ -571,6 +349,21 @@ definitions:
password:
type: string
type: object
types.UserOut:
properties:
email:
type: string
groupId:
type: string
groupName:
type: string
id:
type: string
isSuperuser:
type: boolean
name:
type: string
type: object
types.UserRegistration:
properties:
groupName:
@ -609,7 +402,7 @@ paths:
- properties:
items:
items:
$ref: '#/definitions/types.ItemOut'
$ref: '#/definitions/types.ItemSummary'
type: array
type: object
security:
@ -681,6 +474,12 @@ paths:
name: id
required: true
type: string
- description: Item Data
in: body
name: payload
required: true
schema:
$ref: '#/definitions/types.ItemUpdate'
produces:
- application/json
responses:
@ -1006,7 +805,7 @@ paths:
- $ref: '#/definitions/server.Result'
- properties:
item:
$ref: '#/definitions/ent.User'
$ref: '#/definitions/types.UserOut'
type: object
security:
- Bearer: []