More merge fixing

This commit is contained in:
Matthew Kilgore
2025-07-27 17:42:58 -04:00
parent 64907bbb3a
commit 77b14f3a55
8 changed files with 528 additions and 13500 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -77,10 +77,10 @@ definitions:
type: object
ent.AttachmentEdges:
properties:
item:
entity:
allOf:
- $ref: '#/definitions/ent.Item'
description: Item holds the value of the item edge.
- $ref: '#/definitions/ent.Entity'
description: Entity holds the value of the entity edge.
thumbnail:
allOf:
- $ref: '#/definitions/ent.Attachment'
@@ -146,100 +146,7 @@ definitions:
- $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:
allOf:
- $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:
invitation_tokens:
description: InvitationTokens holds the value of the invitation_tokens edge.
items:
$ref: '#/definitions/ent.GroupInvitationToken'
type: array
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
notifiers:
description: Notifiers holds the value of the notifiers edge.
items:
$ref: '#/definitions/ent.Notifier'
type: array
users:
description: Users holds the value of the users edge.
items:
$ref: '#/definitions/ent.User'
type: array
type: object
ent.GroupInvitationToken:
properties:
created_at:
description: CreatedAt holds the value of the "created_at" field.
type: string
edges:
allOf:
- $ref: '#/definitions/ent.GroupInvitationTokenEdges'
description: |-
Edges holds the relations/edges for other nodes in the graph.
The values are being populated by the GroupInvitationTokenQuery 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
uses:
description: Uses holds the value of the "uses" field.
type: integer
type: object
ent.GroupInvitationTokenEdges:
properties:
group:
allOf:
- $ref: '#/definitions/ent.Group'
description: Group holds the value of the group edge.
type: object
ent.Item:
ent.Entity:
properties:
archived:
description: Archived holds the value of the "archived" field.
@@ -255,10 +162,10 @@ definitions:
type: string
edges:
allOf:
- $ref: '#/definitions/ent.ItemEdges'
- $ref: '#/definitions/ent.EntityEdges'
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.
The values are being populated by the EntityQuery when eager-loading is set.
id:
description: ID of the ent.
type: string
@@ -310,8 +217,8 @@ definitions:
sold_to:
description: SoldTo holds the value of the "sold_to" field.
type: string
sync_child_items_locations:
description: SyncChildItemsLocations holds the value of the "sync_child_items_locations"
sync_child_entities_locations:
description: SyncChildEntitiesLocations holds the value of the "sync_child_entities_locations"
field.
type: boolean
updated_at:
@@ -324,7 +231,7 @@ definitions:
description: WarrantyExpires holds the value of the "warranty_expires" field.
type: string
type: object
ent.ItemEdges:
ent.EntityEdges:
properties:
attachments:
description: Attachments holds the value of the attachments edge.
@@ -334,12 +241,16 @@ definitions:
children:
description: Children holds the value of the children edge.
items:
$ref: '#/definitions/ent.Item'
$ref: '#/definitions/ent.Entity'
type: array
entity:
allOf:
- $ref: '#/definitions/ent.Entity'
description: Entity holds the value of the entity edge.
fields:
description: Fields holds the value of the fields edge.
items:
$ref: '#/definitions/ent.ItemField'
$ref: '#/definitions/ent.EntityField'
type: array
group:
allOf:
@@ -352,7 +263,7 @@ definitions:
type: array
location:
allOf:
- $ref: '#/definitions/ent.Location'
- $ref: '#/definitions/ent.Entity'
description: Location holds the value of the location edge.
maintenance_entries:
description: MaintenanceEntries holds the value of the maintenance_entries
@@ -362,10 +273,14 @@ definitions:
type: array
parent:
allOf:
- $ref: '#/definitions/ent.Item'
- $ref: '#/definitions/ent.Entity'
description: Parent holds the value of the parent edge.
type:
allOf:
- $ref: '#/definitions/ent.EntityType'
description: Type holds the value of the type edge.
type: object
ent.ItemField:
ent.EntityField:
properties:
boolean_value:
description: BooleanValue holds the value of the "boolean_value" field.
@@ -378,10 +293,10 @@ definitions:
type: string
edges:
allOf:
- $ref: '#/definitions/ent.ItemFieldEdges'
- $ref: '#/definitions/ent.EntityFieldEdges'
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.
The values are being populated by the EntityFieldQuery when eager-loading is set.
id:
description: ID of the ent.
type: string
@@ -399,18 +314,156 @@ definitions:
type: string
type:
allOf:
- $ref: '#/definitions/itemfield.Type'
- $ref: '#/definitions/entityfield.Type'
description: Type holds the value of the "type" field.
updated_at:
description: UpdatedAt holds the value of the "updated_at" field.
type: string
type: object
ent.ItemFieldEdges:
ent.EntityFieldEdges:
properties:
item:
entity:
allOf:
- $ref: '#/definitions/ent.Item'
description: Item holds the value of the item edge.
- $ref: '#/definitions/ent.Entity'
description: Entity holds the value of the entity edge.
type: object
ent.EntityType:
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:
allOf:
- $ref: '#/definitions/ent.EntityTypeEdges'
description: |-
Edges holds the relations/edges for other nodes in the graph.
The values are being populated by the EntityTypeQuery when eager-loading is set.
icon:
description: Icon holds the value of the "icon" field.
type: string
id:
description: ID of the ent.
type: string
is_location:
description: IsLocation holds the value of the "is_location" 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.EntityTypeEdges:
properties:
entities:
description: Entities holds the value of the entities edge.
items:
$ref: '#/definitions/ent.Entity'
type: array
group:
allOf:
- $ref: '#/definitions/ent.Group'
description: Group holds the value of the group 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:
allOf:
- $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:
entities:
description: Entities holds the value of the entities edge.
items:
$ref: '#/definitions/ent.Entity'
type: array
entity_types:
description: EntityTypes holds the value of the entity_types edge.
items:
$ref: '#/definitions/ent.EntityType'
type: array
invitation_tokens:
description: InvitationTokens holds the value of the invitation_tokens edge.
items:
$ref: '#/definitions/ent.GroupInvitationToken'
type: array
labels:
description: Labels holds the value of the labels edge.
items:
$ref: '#/definitions/ent.Label'
type: array
notifiers:
description: Notifiers holds the value of the notifiers edge.
items:
$ref: '#/definitions/ent.Notifier'
type: array
users:
description: Users holds the value of the users edge.
items:
$ref: '#/definitions/ent.User'
type: array
type: object
ent.GroupInvitationToken:
properties:
created_at:
description: CreatedAt holds the value of the "created_at" field.
type: string
edges:
allOf:
- $ref: '#/definitions/ent.GroupInvitationTokenEdges'
description: |-
Edges holds the relations/edges for other nodes in the graph.
The values are being populated by the GroupInvitationTokenQuery 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
uses:
description: Uses holds the value of the "uses" field.
type: integer
type: object
ent.GroupInvitationTokenEdges:
properties:
group:
allOf:
- $ref: '#/definitions/ent.Group'
description: Group holds the value of the group edge.
type: object
ent.Label:
properties:
@@ -441,60 +494,15 @@ definitions:
type: object
ent.LabelEdges:
properties:
group:
allOf:
- $ref: '#/definitions/ent.Group'
description: Group holds the value of the group edge.
items:
description: Items holds the value of the items edge.
entities:
description: Entities holds the value of the entities 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:
allOf:
- $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:
children:
description: Children holds the value of the children edge.
items:
$ref: '#/definitions/ent.Location'
$ref: '#/definitions/ent.Entity'
type: array
group:
allOf:
- $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
parent:
allOf:
- $ref: '#/definitions/ent.Location'
description: Parent holds the value of the parent edge.
type: object
ent.MaintenanceEntry:
properties:
@@ -516,12 +524,12 @@ definitions:
description: |-
Edges holds the relations/edges for other nodes in the graph.
The values are being populated by the MaintenanceEntryQuery when eager-loading is set.
entity_id:
description: EntityID holds the value of the "entity_id" field.
type: string
id:
description: ID of the ent.
type: string
item_id:
description: ItemID holds the value of the "item_id" field.
type: string
name:
description: Name holds the value of the "name" field.
type: string
@@ -534,10 +542,10 @@ definitions:
type: object
ent.MaintenanceEntryEdges:
properties:
item:
entity:
allOf:
- $ref: '#/definitions/ent.Item'
description: Item holds the value of the item edge.
- $ref: '#/definitions/ent.Entity'
description: Entity holds the value of the entity edge.
type: object
ent.Notifier:
properties:
@@ -634,7 +642,7 @@ definitions:
$ref: '#/definitions/ent.Notifier'
type: array
type: object
itemfield.Type:
entityfield.Type:
enum:
- text
- number
@@ -1763,12 +1771,11 @@ paths:
$ref: '#/definitions/repo.ItemSummary'
security:
- Bearer: []
summary: (Deprecated) Create Item
summary: Create Item
tags:
- Items
/v1/items/{id}:
delete:
deprecated: true
parameters:
- description: Item ID
in: path

View File

@@ -2,16 +2,16 @@ package ent
import (
"entgo.io/ent/dialect/sql"
"github.com/sysadminsmedia/homebox/backend/internal/data/ent/item"
"github.com/sysadminsmedia/homebox/backend/internal/data/ent/entity"
"github.com/sysadminsmedia/homebox/backend/internal/data/ent/predicate"
"github.com/sysadminsmedia/homebox/backend/pkgs/textutils"
)
// AccentInsensitiveContains creates a predicate that performs accent-insensitive text search.
// It normalizes both the database field value and the search value for comparison.
func AccentInsensitiveContains(field string, searchValue string) predicate.Item {
func AccentInsensitiveContains(field string, searchValue string) predicate.Entity {
if searchValue == "" {
return predicate.Item(func(s *sql.Selector) {
return predicate.Entity(func(s *sql.Selector) {
// Return a predicate that never matches if search is empty
s.Where(sql.False())
})
@@ -20,9 +20,9 @@ func AccentInsensitiveContains(field string, searchValue string) predicate.Item
// Normalize the search value
normalizedSearch := textutils.NormalizeSearchQuery(searchValue)
return predicate.Item(func(s *sql.Selector) {
return predicate.Entity(func(s *sql.Selector) {
dialect := s.Dialect()
switch dialect {
case "sqlite3":
// For SQLite, we'll create a custom normalization function using REPLACE
@@ -71,7 +71,7 @@ func buildGenericNormalizeExpression(fieldExpr string) string {
// Focused on the most frequently used accents in Spanish, French, and Portuguese
// Ordered by frequency of use for better performance
normalized := fieldExpr
// Most common accented characters ordered by frequency
commonAccents := []struct {
from, to string
@@ -88,40 +88,40 @@ func buildGenericNormalizeExpression(fieldExpr string) string {
{"ä", "a"}, {"ö", "o"}, {"ü", "u"}, {"ã", "a"}, {"õ", "o"},
{"Ä", "A"}, {"Ö", "O"}, {"Ü", "U"}, {"Ã", "A"}, {"Õ", "O"},
}
for _, accent := range commonAccents {
normalized = "REPLACE(" + normalized + ", '" + accent.from + "', '" + accent.to + "')"
}
return normalized
}
// ItemNameAccentInsensitiveContains creates an accent-insensitive search predicate for the item name field.
func ItemNameAccentInsensitiveContains(value string) predicate.Item {
return AccentInsensitiveContains(item.FieldName, value)
func ItemNameAccentInsensitiveContains(value string) predicate.Entity {
return AccentInsensitiveContains(entity.FieldName, value)
}
// ItemDescriptionAccentInsensitiveContains creates an accent-insensitive search predicate for the item description field.
func ItemDescriptionAccentInsensitiveContains(value string) predicate.Item {
return AccentInsensitiveContains(item.FieldDescription, value)
func ItemDescriptionAccentInsensitiveContains(value string) predicate.Entity {
return AccentInsensitiveContains(entity.FieldDescription, value)
}
// ItemSerialNumberAccentInsensitiveContains creates an accent-insensitive search predicate for the item serial number field.
func ItemSerialNumberAccentInsensitiveContains(value string) predicate.Item {
return AccentInsensitiveContains(item.FieldSerialNumber, value)
func ItemSerialNumberAccentInsensitiveContains(value string) predicate.Entity {
return AccentInsensitiveContains(entity.FieldSerialNumber, value)
}
// ItemModelNumberAccentInsensitiveContains creates an accent-insensitive search predicate for the item model number field.
func ItemModelNumberAccentInsensitiveContains(value string) predicate.Item {
return AccentInsensitiveContains(item.FieldModelNumber, value)
func ItemModelNumberAccentInsensitiveContains(value string) predicate.Entity {
return AccentInsensitiveContains(entity.FieldModelNumber, value)
}
// ItemManufacturerAccentInsensitiveContains creates an accent-insensitive search predicate for the item manufacturer field.
func ItemManufacturerAccentInsensitiveContains(value string) predicate.Item {
return AccentInsensitiveContains(item.FieldManufacturer, value)
func ItemManufacturerAccentInsensitiveContains(value string) predicate.Entity {
return AccentInsensitiveContains(entity.FieldManufacturer, value)
}
// ItemNotesAccentInsensitiveContains creates an accent-insensitive search predicate for the item notes field.
func ItemNotesAccentInsensitiveContains(value string) predicate.Item {
return AccentInsensitiveContains(item.FieldNotes, value)
func ItemNotesAccentInsensitiveContains(value string) predicate.Entity {
return AccentInsensitiveContains(entity.FieldNotes, value)
}

View File

@@ -27,19 +27,19 @@ func TestBuildGenericNormalizeExpression(t *testing.T) {
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
result := buildGenericNormalizeExpression(tt.field)
// Should contain the original field
assert.Contains(t, result, tt.field)
// Should contain REPLACE functions for accent normalization
assert.Contains(t, result, "REPLACE(")
// Should handle common accented characters
assert.Contains(t, result, "'á'", "Should handle Spanish á")
assert.Contains(t, result, "'é'", "Should handle Spanish é")
assert.Contains(t, result, "'ñ'", "Should handle Spanish ñ")
assert.Contains(t, result, "'ü'", "Should handle German ü")
// Should handle uppercase accents too
assert.Contains(t, result, "'Á'", "Should handle uppercase Spanish Á")
assert.Contains(t, result, "'É'", "Should handle uppercase Spanish É")
@@ -49,7 +49,7 @@ func TestBuildGenericNormalizeExpression(t *testing.T) {
func TestSQLiteNormalizeExpression(t *testing.T) {
result := buildSQLiteNormalizeExpression("test_field")
// Should contain the field name and REPLACE functions
assert.Contains(t, result, "test_field")
assert.Contains(t, result, "REPLACE(")
@@ -60,7 +60,7 @@ func TestSQLiteNormalizeExpression(t *testing.T) {
func TestPostgreSQLNormalizeExpression(t *testing.T) {
result := buildPostgreSQLNormalizeExpression("test_field")
// Should contain unaccent function and CASE WHEN logic
assert.Contains(t, result, "unaccent(")
assert.Contains(t, result, "CASE WHEN EXISTS")
@@ -104,46 +104,46 @@ func TestAccentInsensitivePredicateCreation(t *testing.T) {
func TestSpecificItemPredicates(t *testing.T) {
tests := []struct {
name string
name string
predicateFunc func(string) interface{}
searchValue string
description string
searchValue string
description string
}{
{
name: "ItemNameAccentInsensitiveContains",
name: "ItemNameAccentInsensitiveContains",
predicateFunc: func(val string) interface{} { return ItemNameAccentInsensitiveContains(val) },
searchValue: "electronica",
description: "Should create accent-insensitive name search predicate",
searchValue: "electronica",
description: "Should create accent-insensitive name search predicate",
},
{
name: "ItemDescriptionAccentInsensitiveContains",
name: "ItemDescriptionAccentInsensitiveContains",
predicateFunc: func(val string) interface{} { return ItemDescriptionAccentInsensitiveContains(val) },
searchValue: "descripcion",
description: "Should create accent-insensitive description search predicate",
searchValue: "descripcion",
description: "Should create accent-insensitive description search predicate",
},
{
name: "ItemManufacturerAccentInsensitiveContains",
name: "ItemManufacturerAccentInsensitiveContains",
predicateFunc: func(val string) interface{} { return ItemManufacturerAccentInsensitiveContains(val) },
searchValue: "compañia",
description: "Should create accent-insensitive manufacturer search predicate",
searchValue: "compañia",
description: "Should create accent-insensitive manufacturer search predicate",
},
{
name: "ItemSerialNumberAccentInsensitiveContains",
name: "ItemSerialNumberAccentInsensitiveContains",
predicateFunc: func(val string) interface{} { return ItemSerialNumberAccentInsensitiveContains(val) },
searchValue: "sn123",
description: "Should create accent-insensitive serial number search predicate",
searchValue: "sn123",
description: "Should create accent-insensitive serial number search predicate",
},
{
name: "ItemModelNumberAccentInsensitiveContains",
name: "ItemModelNumberAccentInsensitiveContains",
predicateFunc: func(val string) interface{} { return ItemModelNumberAccentInsensitiveContains(val) },
searchValue: "model456",
description: "Should create accent-insensitive model number search predicate",
searchValue: "model456",
description: "Should create accent-insensitive model number search predicate",
},
{
name: "ItemNotesAccentInsensitiveContains",
name: "ItemNotesAccentInsensitiveContains",
predicateFunc: func(val string) interface{} { return ItemNotesAccentInsensitiveContains(val) },
searchValue: "notas importantes",
description: "Should create accent-insensitive notes search predicate",
searchValue: "notas importantes",
description: "Should create accent-insensitive notes search predicate",
},
}

File diff suppressed because one or more lines are too long

View File

@@ -77,10 +77,10 @@ definitions:
type: object
ent.AttachmentEdges:
properties:
item:
entity:
allOf:
- $ref: '#/definitions/ent.Item'
description: Item holds the value of the item edge.
- $ref: '#/definitions/ent.Entity'
description: Entity holds the value of the entity edge.
thumbnail:
allOf:
- $ref: '#/definitions/ent.Attachment'
@@ -146,100 +146,7 @@ definitions:
- $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:
allOf:
- $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:
invitation_tokens:
description: InvitationTokens holds the value of the invitation_tokens edge.
items:
$ref: '#/definitions/ent.GroupInvitationToken'
type: array
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
notifiers:
description: Notifiers holds the value of the notifiers edge.
items:
$ref: '#/definitions/ent.Notifier'
type: array
users:
description: Users holds the value of the users edge.
items:
$ref: '#/definitions/ent.User'
type: array
type: object
ent.GroupInvitationToken:
properties:
created_at:
description: CreatedAt holds the value of the "created_at" field.
type: string
edges:
allOf:
- $ref: '#/definitions/ent.GroupInvitationTokenEdges'
description: |-
Edges holds the relations/edges for other nodes in the graph.
The values are being populated by the GroupInvitationTokenQuery 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
uses:
description: Uses holds the value of the "uses" field.
type: integer
type: object
ent.GroupInvitationTokenEdges:
properties:
group:
allOf:
- $ref: '#/definitions/ent.Group'
description: Group holds the value of the group edge.
type: object
ent.Item:
ent.Entity:
properties:
archived:
description: Archived holds the value of the "archived" field.
@@ -255,10 +162,10 @@ definitions:
type: string
edges:
allOf:
- $ref: '#/definitions/ent.ItemEdges'
- $ref: '#/definitions/ent.EntityEdges'
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.
The values are being populated by the EntityQuery when eager-loading is set.
id:
description: ID of the ent.
type: string
@@ -310,8 +217,8 @@ definitions:
sold_to:
description: SoldTo holds the value of the "sold_to" field.
type: string
sync_child_items_locations:
description: SyncChildItemsLocations holds the value of the "sync_child_items_locations"
sync_child_entities_locations:
description: SyncChildEntitiesLocations holds the value of the "sync_child_entities_locations"
field.
type: boolean
updated_at:
@@ -324,7 +231,7 @@ definitions:
description: WarrantyExpires holds the value of the "warranty_expires" field.
type: string
type: object
ent.ItemEdges:
ent.EntityEdges:
properties:
attachments:
description: Attachments holds the value of the attachments edge.
@@ -334,12 +241,16 @@ definitions:
children:
description: Children holds the value of the children edge.
items:
$ref: '#/definitions/ent.Item'
$ref: '#/definitions/ent.Entity'
type: array
entity:
allOf:
- $ref: '#/definitions/ent.Entity'
description: Entity holds the value of the entity edge.
fields:
description: Fields holds the value of the fields edge.
items:
$ref: '#/definitions/ent.ItemField'
$ref: '#/definitions/ent.EntityField'
type: array
group:
allOf:
@@ -352,7 +263,7 @@ definitions:
type: array
location:
allOf:
- $ref: '#/definitions/ent.Location'
- $ref: '#/definitions/ent.Entity'
description: Location holds the value of the location edge.
maintenance_entries:
description: MaintenanceEntries holds the value of the maintenance_entries
@@ -362,10 +273,14 @@ definitions:
type: array
parent:
allOf:
- $ref: '#/definitions/ent.Item'
- $ref: '#/definitions/ent.Entity'
description: Parent holds the value of the parent edge.
type:
allOf:
- $ref: '#/definitions/ent.EntityType'
description: Type holds the value of the type edge.
type: object
ent.ItemField:
ent.EntityField:
properties:
boolean_value:
description: BooleanValue holds the value of the "boolean_value" field.
@@ -378,10 +293,10 @@ definitions:
type: string
edges:
allOf:
- $ref: '#/definitions/ent.ItemFieldEdges'
- $ref: '#/definitions/ent.EntityFieldEdges'
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.
The values are being populated by the EntityFieldQuery when eager-loading is set.
id:
description: ID of the ent.
type: string
@@ -399,18 +314,156 @@ definitions:
type: string
type:
allOf:
- $ref: '#/definitions/itemfield.Type'
- $ref: '#/definitions/entityfield.Type'
description: Type holds the value of the "type" field.
updated_at:
description: UpdatedAt holds the value of the "updated_at" field.
type: string
type: object
ent.ItemFieldEdges:
ent.EntityFieldEdges:
properties:
item:
entity:
allOf:
- $ref: '#/definitions/ent.Item'
description: Item holds the value of the item edge.
- $ref: '#/definitions/ent.Entity'
description: Entity holds the value of the entity edge.
type: object
ent.EntityType:
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:
allOf:
- $ref: '#/definitions/ent.EntityTypeEdges'
description: |-
Edges holds the relations/edges for other nodes in the graph.
The values are being populated by the EntityTypeQuery when eager-loading is set.
icon:
description: Icon holds the value of the "icon" field.
type: string
id:
description: ID of the ent.
type: string
is_location:
description: IsLocation holds the value of the "is_location" 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.EntityTypeEdges:
properties:
entities:
description: Entities holds the value of the entities edge.
items:
$ref: '#/definitions/ent.Entity'
type: array
group:
allOf:
- $ref: '#/definitions/ent.Group'
description: Group holds the value of the group 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:
allOf:
- $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:
entities:
description: Entities holds the value of the entities edge.
items:
$ref: '#/definitions/ent.Entity'
type: array
entity_types:
description: EntityTypes holds the value of the entity_types edge.
items:
$ref: '#/definitions/ent.EntityType'
type: array
invitation_tokens:
description: InvitationTokens holds the value of the invitation_tokens edge.
items:
$ref: '#/definitions/ent.GroupInvitationToken'
type: array
labels:
description: Labels holds the value of the labels edge.
items:
$ref: '#/definitions/ent.Label'
type: array
notifiers:
description: Notifiers holds the value of the notifiers edge.
items:
$ref: '#/definitions/ent.Notifier'
type: array
users:
description: Users holds the value of the users edge.
items:
$ref: '#/definitions/ent.User'
type: array
type: object
ent.GroupInvitationToken:
properties:
created_at:
description: CreatedAt holds the value of the "created_at" field.
type: string
edges:
allOf:
- $ref: '#/definitions/ent.GroupInvitationTokenEdges'
description: |-
Edges holds the relations/edges for other nodes in the graph.
The values are being populated by the GroupInvitationTokenQuery 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
uses:
description: Uses holds the value of the "uses" field.
type: integer
type: object
ent.GroupInvitationTokenEdges:
properties:
group:
allOf:
- $ref: '#/definitions/ent.Group'
description: Group holds the value of the group edge.
type: object
ent.Label:
properties:
@@ -441,60 +494,15 @@ definitions:
type: object
ent.LabelEdges:
properties:
group:
allOf:
- $ref: '#/definitions/ent.Group'
description: Group holds the value of the group edge.
items:
description: Items holds the value of the items edge.
entities:
description: Entities holds the value of the entities 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:
allOf:
- $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:
children:
description: Children holds the value of the children edge.
items:
$ref: '#/definitions/ent.Location'
$ref: '#/definitions/ent.Entity'
type: array
group:
allOf:
- $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
parent:
allOf:
- $ref: '#/definitions/ent.Location'
description: Parent holds the value of the parent edge.
type: object
ent.MaintenanceEntry:
properties:
@@ -516,12 +524,12 @@ definitions:
description: |-
Edges holds the relations/edges for other nodes in the graph.
The values are being populated by the MaintenanceEntryQuery when eager-loading is set.
entity_id:
description: EntityID holds the value of the "entity_id" field.
type: string
id:
description: ID of the ent.
type: string
item_id:
description: ItemID holds the value of the "item_id" field.
type: string
name:
description: Name holds the value of the "name" field.
type: string
@@ -534,10 +542,10 @@ definitions:
type: object
ent.MaintenanceEntryEdges:
properties:
item:
entity:
allOf:
- $ref: '#/definitions/ent.Item'
description: Item holds the value of the item edge.
- $ref: '#/definitions/ent.Entity'
description: Entity holds the value of the entity edge.
type: object
ent.Notifier:
properties:
@@ -634,7 +642,7 @@ definitions:
$ref: '#/definitions/ent.Notifier'
type: array
type: object
itemfield.Type:
entityfield.Type:
enum:
- text
- number
@@ -1763,12 +1771,11 @@ paths:
$ref: '#/definitions/repo.ItemSummary'
security:
- Bearer: []
summary: (Deprecated) Create Item
summary: Create Item
tags:
- Items
/v1/items/{id}:
delete:
deprecated: true
parameters:
- description: Item ID
in: path

View File

@@ -28,7 +28,7 @@ export enum ItemType {
ItemTypeItem = "item",
}
export enum ItemfieldType {
export enum EntityfieldType {
TypeText = "text",
TypeNumber = "number",
TypeBoolean = "boolean",
@@ -84,8 +84,8 @@ export interface EntAttachment {
}
export interface EntAttachmentEdges {
/** Item holds the value of the item edge. */
item: EntItem;
/** Entity holds the value of the entity edge. */
entity: EntEntity;
/** Thumbnail holds the value of the thumbnail edge. */
thumbnail: EntAttachment;
}
@@ -132,65 +132,7 @@ export interface EntAuthTokensEdges {
user: EntUser;
}
export interface EntGroup {
/** CreatedAt holds the value of the "created_at" field. */
created_at: string;
/** Currency holds the value of the "currency" field. */
currency: string;
/**
* Edges holds the relations/edges for other nodes in the graph.
* The values are being populated by the GroupQuery when eager-loading is set.
*/
edges: EntGroupEdges;
/** ID of the ent. */
id: string;
/** Name holds the value of the "name" field. */
name: string;
/** UpdatedAt holds the value of the "updated_at" field. */
updated_at: string;
}
export interface EntGroupEdges {
/** InvitationTokens holds the value of the invitation_tokens edge. */
invitation_tokens: EntGroupInvitationToken[];
/** Items holds the value of the items edge. */
items: EntItem[];
/** Labels holds the value of the labels edge. */
labels: EntLabel[];
/** Locations holds the value of the locations edge. */
locations: EntLocation[];
/** Notifiers holds the value of the notifiers edge. */
notifiers: EntNotifier[];
/** Users holds the value of the users edge. */
users: EntUser[];
}
export interface EntGroupInvitationToken {
/** CreatedAt holds the value of the "created_at" field. */
created_at: string;
/**
* Edges holds the relations/edges for other nodes in the graph.
* The values are being populated by the GroupInvitationTokenQuery when eager-loading is set.
*/
edges: EntGroupInvitationTokenEdges;
/** ExpiresAt holds the value of the "expires_at" field. */
expires_at: string;
/** ID of the ent. */
id: string;
/** Token holds the value of the "token" field. */
token: number[];
/** UpdatedAt holds the value of the "updated_at" field. */
updated_at: string;
/** Uses holds the value of the "uses" field. */
uses: number;
}
export interface EntGroupInvitationTokenEdges {
/** Group holds the value of the group edge. */
group: EntGroup;
}
export interface EntItem {
export interface EntEntity {
/** Archived holds the value of the "archived" field. */
archived: boolean;
/** AssetID holds the value of the "asset_id" field. */
@@ -201,9 +143,9 @@ export interface EntItem {
description: string;
/**
* Edges holds the relations/edges for other nodes in the graph.
* The values are being populated by the ItemQuery when eager-loading is set.
* The values are being populated by the EntityQuery when eager-loading is set.
*/
edges: EntItemEdges;
edges: EntEntityEdges;
/** ID of the ent. */
id: string;
/** ImportRef holds the value of the "import_ref" field. */
@@ -238,8 +180,8 @@ export interface EntItem {
sold_time: string;
/** SoldTo holds the value of the "sold_to" field. */
sold_to: string;
/** SyncChildItemsLocations holds the value of the "sync_child_items_locations" field. */
sync_child_items_locations: boolean;
/** SyncChildEntitiesLocations holds the value of the "sync_child_entities_locations" field. */
sync_child_entities_locations: boolean;
/** UpdatedAt holds the value of the "updated_at" field. */
updated_at: string;
/** WarrantyDetails holds the value of the "warranty_details" field. */
@@ -248,26 +190,30 @@ export interface EntItem {
warranty_expires: string;
}
export interface EntItemEdges {
export interface EntEntityEdges {
/** Attachments holds the value of the attachments edge. */
attachments: EntAttachment[];
/** Children holds the value of the children edge. */
children: EntItem[];
children: EntEntity[];
/** Entity holds the value of the entity edge. */
entity: EntEntity;
/** Fields holds the value of the fields edge. */
fields: EntItemField[];
fields: EntEntityField[];
/** Group holds the value of the group edge. */
group: EntGroup;
/** Label holds the value of the label edge. */
label: EntLabel[];
/** Location holds the value of the location edge. */
location: EntLocation;
location: EntEntity;
/** MaintenanceEntries holds the value of the maintenance_entries edge. */
maintenance_entries: EntMaintenanceEntry[];
/** Parent holds the value of the parent edge. */
parent: EntItem;
parent: EntEntity;
/** Type holds the value of the type edge. */
type: EntEntityType;
}
export interface EntItemField {
export interface EntEntityField {
/** BooleanValue holds the value of the "boolean_value" field. */
boolean_value: boolean;
/** CreatedAt holds the value of the "created_at" field. */
@@ -276,9 +222,9 @@ export interface EntItemField {
description: string;
/**
* Edges holds the relations/edges for other nodes in the graph.
* The values are being populated by the ItemFieldQuery when eager-loading is set.
* The values are being populated by the EntityFieldQuery when eager-loading is set.
*/
edges: EntItemFieldEdges;
edges: EntEntityFieldEdges;
/** ID of the ent. */
id: string;
/** Name holds the value of the "name" field. */
@@ -290,14 +236,103 @@ export interface EntItemField {
/** TimeValue holds the value of the "time_value" field. */
time_value: string;
/** Type holds the value of the "type" field. */
type: ItemfieldType;
type: EntityfieldType;
/** UpdatedAt holds the value of the "updated_at" field. */
updated_at: string;
}
export interface EntItemFieldEdges {
/** Item holds the value of the item edge. */
item: EntItem;
export interface EntEntityFieldEdges {
/** Entity holds the value of the entity edge. */
entity: EntEntity;
}
export interface EntEntityType {
/** Color holds the value of the "color" field. */
color: string;
/** CreatedAt holds the value of the "created_at" field. */
created_at: string;
/** Description holds the value of the "description" field. */
description: string;
/**
* Edges holds the relations/edges for other nodes in the graph.
* The values are being populated by the EntityTypeQuery when eager-loading is set.
*/
edges: EntEntityTypeEdges;
/** Icon holds the value of the "icon" field. */
icon: string;
/** ID of the ent. */
id: string;
/** IsLocation holds the value of the "is_location" field. */
is_location: boolean;
/** Name holds the value of the "name" field. */
name: string;
/** UpdatedAt holds the value of the "updated_at" field. */
updated_at: string;
}
export interface EntEntityTypeEdges {
/** Entities holds the value of the entities edge. */
entities: EntEntity[];
/** Group holds the value of the group edge. */
group: EntGroup;
}
export interface EntGroup {
/** CreatedAt holds the value of the "created_at" field. */
created_at: string;
/** Currency holds the value of the "currency" field. */
currency: string;
/**
* Edges holds the relations/edges for other nodes in the graph.
* The values are being populated by the GroupQuery when eager-loading is set.
*/
edges: EntGroupEdges;
/** ID of the ent. */
id: string;
/** Name holds the value of the "name" field. */
name: string;
/** UpdatedAt holds the value of the "updated_at" field. */
updated_at: string;
}
export interface EntGroupEdges {
/** Entities holds the value of the entities edge. */
entities: EntEntity[];
/** EntityTypes holds the value of the entity_types edge. */
entity_types: EntEntityType[];
/** InvitationTokens holds the value of the invitation_tokens edge. */
invitation_tokens: EntGroupInvitationToken[];
/** Labels holds the value of the labels edge. */
labels: EntLabel[];
/** Notifiers holds the value of the notifiers edge. */
notifiers: EntNotifier[];
/** Users holds the value of the users edge. */
users: EntUser[];
}
export interface EntGroupInvitationToken {
/** CreatedAt holds the value of the "created_at" field. */
created_at: string;
/**
* Edges holds the relations/edges for other nodes in the graph.
* The values are being populated by the GroupInvitationTokenQuery when eager-loading is set.
*/
edges: EntGroupInvitationTokenEdges;
/** ExpiresAt holds the value of the "expires_at" field. */
expires_at: string;
/** ID of the ent. */
id: string;
/** Token holds the value of the "token" field. */
token: number[];
/** UpdatedAt holds the value of the "updated_at" field. */
updated_at: string;
/** Uses holds the value of the "uses" field. */
uses: number;
}
export interface EntGroupInvitationTokenEdges {
/** Group holds the value of the group edge. */
group: EntGroup;
}
export interface EntLabel {
@@ -321,39 +356,10 @@ export interface EntLabel {
}
export interface EntLabelEdges {
/** Entities holds the value of the entities edge. */
entities: EntEntity[];
/** Group holds the value of the group edge. */
group: EntGroup;
/** Items holds the value of the items edge. */
items: EntItem[];
}
export interface EntLocation {
/** CreatedAt holds the value of the "created_at" field. */
created_at: string;
/** Description holds the value of the "description" field. */
description: string;
/**
* Edges holds the relations/edges for other nodes in the graph.
* The values are being populated by the LocationQuery when eager-loading is set.
*/
edges: EntLocationEdges;
/** ID of the ent. */
id: string;
/** Name holds the value of the "name" field. */
name: string;
/** UpdatedAt holds the value of the "updated_at" field. */
updated_at: string;
}
export interface EntLocationEdges {
/** Children holds the value of the children edge. */
children: EntLocation[];
/** Group holds the value of the group edge. */
group: EntGroup;
/** Items holds the value of the items edge. */
items: EntItem[];
/** Parent holds the value of the parent edge. */
parent: EntLocation;
}
export interface EntMaintenanceEntry {
@@ -370,10 +376,10 @@ export interface EntMaintenanceEntry {
* The values are being populated by the MaintenanceEntryQuery when eager-loading is set.
*/
edges: EntMaintenanceEntryEdges;
/** EntityID holds the value of the "entity_id" field. */
entity_id: string;
/** ID of the ent. */
id: string;
/** ItemID holds the value of the "item_id" field. */
item_id: string;
/** Name holds the value of the "name" field. */
name: string;
/** ScheduledDate holds the value of the "scheduled_date" field. */
@@ -383,8 +389,8 @@ export interface EntMaintenanceEntry {
}
export interface EntMaintenanceEntryEdges {
/** Item holds the value of the item edge. */
item: EntItem;
/** Entity holds the value of the entity edge. */
entity: EntEntity;
}
export interface EntNotifier {
@@ -454,10 +460,6 @@ export interface EntUserEdges {
export interface BarcodeProduct {
barcode: string;
imageBase64: string;
/**
* TODO: add image attachement
* TODO: add asin?
*/
imageURL: string;
item: ItemCreate;
manufacturer: string;