A continuation of HomeBox the inventory and organization system built for the Home User
Convert labels to tags (#1192)
Ellcff7f8dc132d
diff --git a/.github/instructions/backend-internal-data.instructions.md b/.github/instructions/backend-internal-data.instructions.mdindex f70bf0d3..225cd088 100644--- a/.github/instructions/backend-internal-data.instructions.md+++ b/.github/instructions/backend-internal-data.instructions.md@@ -18,7 +18,7 @@ backend/internal/data/│ │ ├── item.go # Item entity schema│ │ ├── user.go # User entity schema│ │ ├── location.go # Location entity schema-│ │ ├── label.go # Label entity schema+│ │ ├── tag.go # Tag entity schema│ │ └── mixins/ # Reusable schema mixins│ ├── *.go # Generated entity code│ └── migrate/ # Generated migrations@@ -57,7 +57,7 @@ func (Item) Fields() []ent.Field {func (Item) Edges() []ent.Edge {return []ent.Edge{edge.From("location", Location.Type).Ref("items").Unique(),- edge.From("labels", Label.Type).Ref("items"),+ edge.From("tags", Tag.Type).Ref("items"),}}@@ -143,7 +143,7 @@ Repositories typically implement:```goitems, err := r.db.Item.Query().WithLocation(). // Load location edge- WithLabels(). // Load labels edge+ WithTags(). // Load tags edgeWithChildren(). // Load child itemsWhere(item.GroupIDEQ(gid)).All(ctx)diff --git a/.github/instructions/frontend.instructions.md b/.github/instructions/frontend.instructions.mdindex cd688a0b..94583615 100644--- a/.github/instructions/frontend.instructions.md+++ b/.github/instructions/frontend.instructions.md@@ -16,7 +16,7 @@ frontend/├── components/ # Vue components (auto-imported)│ ├── Item/ # Item-related components│ ├── Location/ # Location components-│ ├── Label/ # Label components+│ ├── Tag/ # Tag components│ ├── Form/ # Form components│ └── ui/ # Shadcn-vue UI components├── pages/ # File-based routes (auto-routing)diff --git a/.github/scripts/upgrade-test/README.md b/.github/scripts/upgrade-test/README.mdindex bb4519c8..a36af6bb 100644--- a/.github/scripts/upgrade-test/README.md+++ b/.github/scripts/upgrade-test/README.md@@ -7,7 +7,7 @@ This document describes the automated upgrade testing workflow for HomeBox.The upgrade test workflow is designed to ensure data integrity and functionality when upgrading HomeBox from one version to another. It automatically:1. Deploys a stable version of HomeBox-2. Creates test data (users, items, locations, labels, notifiers, attachments)+2. Creates test data (users, items, locations, tags, notifiers, attachments)3. Upgrades to the latest version from the main branch4. Verifies all data and functionality remain intact@@ -42,7 +42,7 @@ The workflow creates comprehensive test data using the `create-test-data.sh` scr- **Group 1**: Living Room, Garage- **Group 2**: Home Office-#### Labels+#### Tags- **Group 1**: Electronics, Important- **Group 2**: Work Equipment@@ -68,7 +68,7 @@ The workflow creates comprehensive test data using the `create-test-data.sh` scrThe Playwright test suite (`upgrade-verification.spec.ts`) verifies:- ✅ **User Authentication**: All 7 users can log in with their credentials-- ✅ **Data Persistence**: All items, locations, and labels are present+- ✅ **Data Persistence**: All items, locations, and tags are present- ✅ **Attachments**: File attachments are correctly associated with items- ✅ **Notifiers**: The "TESTING" notifier is still configured- ✅ **UI Functionality**: Version display, theme switching work correctly@@ -93,7 +93,7 @@ The setup script generates a JSON file at `/tmp/test-users.json` containing:"group1": ["location-id-1", "location-id-2"],"group2": ["location-id-3"]},- "labels": {...},+ "tags": {...},"items": {...},"notifiers": {...}}diff --git a/.github/scripts/upgrade-test/create-test-data.sh b/.github/scripts/upgrade-test/create-test-data.shindex 07bc7a8e..e04a4276 100755--- a/.github/scripts/upgrade-test/create-test-data.sh+++ b/.github/scripts/upgrade-test/create-test-data.sh@@ -1,7 +1,7 @@#!/bin/bash# Script to create test data in HomeBox for upgrade testing-# This script creates users, items, attachments, notifiers, locations, and labels+# This script creates users, items, attachments, notifiers, locations, and tagsset -e@@ -128,19 +128,19 @@ create_location() {echo "$response"}-# Function to create a label-create_label() {+# Function to create a tag+create_tag() {local token=$1local name=$2local description=$3- echo "Creating label: $name" >&2+ echo "Creating tag: $name" >&2local response=$(curl -s -X POST \-H "Authorization: Bearer $token" \-H "Content-Type: application/json" \-d "{\"name\":\"$name\",\"description\":\"$description\"}" \- "$API_URL/labels")+ "$API_URL/tags")echo "$response"}@@ -297,27 +297,27 @@ jq --arg loc1 "$location1_id" \'.locations = {"group1":[$loc1,$loc2],"group2":[$loc3]}' \"$TEST_DATA_FILE" > "$TEST_DATA_FILE.tmp" && mv "$TEST_DATA_FILE.tmp" "$TEST_DATA_FILE"-echo "=== Step 4: Create labels for each group ==="+echo "=== Step 4: Create tags for each group ==="-# Create labels for group 1-label1=$(create_label "$user1_token" "Electronics" "Electronic devices")-label1_id=$(echo "$label1" | jq -r '.id // empty')-echo "Created label: Electronics (ID: $label1_id)"+# Create tags for group 1+tag1=$(create_tag "$user1_token" "Electronics" "Electronic devices")+tag1_id=$(echo "$tag1" | jq -r '.id // empty')+echo "Created tag: Electronics (ID: $tag1_id)"-label2=$(create_label "$user1_token" "Important" "High priority items")-label2_id=$(echo "$label2" | jq -r '.id // empty')-echo "Created label: Important (ID: $label2_id)"+tag2=$(create_tag "$user1_token" "Important" "High priority items")+tag2_id=$(echo "$tag2" | jq -r '.id // empty')+echo "Created tag: Important (ID: $tag2_id)"-# Create label for group 2-label3=$(create_label "$user6_token" "Work Equipment" "Items for work")-label3_id=$(echo "$label3" | jq -r '.id // empty')-echo "Created label: Work Equipment (ID: $label3_id)"+# Create tag for group 2+tag3=$(create_tag "$user6_token" "Work Equipment" "Items for work")+tag3_id=$(echo "$tag3" | jq -r '.id // empty')+echo "Created tag: Work Equipment (ID: $tag3_id)"-# Store labels-jq --arg lab1 "$label1_id" \- --arg lab2 "$label2_id" \- --arg lab3 "$label3_id" \- '.labels = {"group1":[$lab1,$lab2],"group2":[$lab3]}' \+# Store tags+jq --arg tag1 "$tag1_id" \+ --arg tag2 "$tag2_id" \+ --arg tag3 "$tag3_id" \+ '.tags = {"group1":[$tag1,$tag2],"group2":[$tag3]}' \"$TEST_DATA_FILE" > "$TEST_DATA_FILE.tmp" && mv "$TEST_DATA_FILE.tmp" "$TEST_DATA_FILE"echo "=== Step 5: Create test notifier ==="@@ -400,7 +400,7 @@ echo "Test data file saved to: $TEST_DATA_FILE"echo "Summary:"echo " - Users created: 7 (5 in group 1, 2 in group 2)"echo " - Locations created: 3"-echo " - Labels created: 3"+echo " - Tags created: 3"echo " - Notifiers created: 1"echo " - Items created: 7"echo " - Attachments created: 7"diff --git a/backend/app/api/demo.go b/backend/app/api/demo.goindex 98617a74..8aab114a 100644--- a/backend/app/api/demo.go+++ b/backend/app/api/demo.go@@ -12,7 +12,7 @@ import ()func (a *app) SetupDemo() error {- csvText := `HB.import_ref,HB.location,HB.labels,HB.quantity,HB.name,HB.description,HB.insured,HB.serial_number,HB.model_number,HB.manufacturer,HB.notes,HB.purchase_from,HB.purchase_price,HB.purchase_time,HB.lifetime_warranty,HB.warranty_expires,HB.warranty_details,HB.sold_to,HB.sold_price,HB.sold_time,HB.sold_notes+ csvText := `HB.import_ref,HB.location,HB.tags,HB.quantity,HB.name,HB.description,HB.insured,HB.serial_number,HB.model_number,HB.manufacturer,HB.notes,HB.purchase_from,HB.purchase_price,HB.purchase_time,HB.lifetime_warranty,HB.warranty_expires,HB.warranty_details,HB.sold_to,HB.sold_price,HB.sold_time,HB.sold_notes,Garage,IOT;Home Assistant; Z-Wave,1,Zooz Universal Relay ZEN17,"Zooz 700 Series Z-Wave Universal Relay ZEN17 for Awnings, Garage Doors, Sprinklers, and More | 2 NO-C-NC Relays (20A, 10A) | Signal Repeater | Hub Required (Compatible with SmartThings and Hubitat)",,,ZEN17,Zooz,,Amazon,39.95,10/13/2021,,,,,,,,Living Room,IOT;Home Assistant; Z-Wave,1,Zooz Motion Sensor,"Zooz Z-Wave Plus S2 Motion Sensor ZSE18 with Magnetic Mount, Works with Vera and SmartThings",,,ZSE18,Zooz,,Amazon,29.95,10/15/2021,,,,,,,,Office,IOT; Home Assistant; Z-Wave,1,Zooz 110v Power Switch,"Zooz Z-Wave Plus Power Switch ZEN15 for 110V AC Units, Sump Pumps, Humidifiers, and More",,,ZEN15,Zooz,,Amazon,39.95,10/13/2021,,,,,,,diff --git a/backend/app/api/handlers/v1/controller.go b/backend/app/api/handlers/v1/controller.goindex 844ed8e4..5b154d24 100644--- a/backend/app/api/handlers/v1/controller.go+++ b/backend/app/api/handlers/v1/controller.go@@ -222,7 +222,7 @@ func (ctrl *V1Controller) HandleCacheWS() errchain.HandlerFunc {}}- ctrl.bus.Subscribe(eventbus.EventLabelMutation, factory("label.mutation"))+ ctrl.bus.Subscribe(eventbus.EventTagMutation, factory("tag.mutation"))ctrl.bus.Subscribe(eventbus.EventLocationMutation, factory("location.mutation"))ctrl.bus.Subscribe(eventbus.EventItemMutation, factory("item.mutation"))diff --git a/backend/app/api/handlers/v1/v1_ctrl_actions.go b/backend/app/api/handlers/v1/v1_ctrl_actions.goindex 66d0c4d4..9098637c 100644--- a/backend/app/api/handlers/v1/v1_ctrl_actions.go+++ b/backend/app/api/handlers/v1/v1_ctrl_actions.go@@ -99,7 +99,7 @@ func (ctrl *V1Controller) HandleCreateMissingThumbnails() errchain.HandlerFunc {// WipeInventoryOptions represents the options for wiping inventorytype WipeInventoryOptions struct {- WipeLabels bool `json:"wipeLabels"`+ WipeTags bool `json:"wipeTags"`WipeLocations bool `json:"wipeLocations"`WipeMaintenance bool `json:"wipeMaintenance"`}@@ -132,13 +132,13 @@ func (ctrl *V1Controller) HandleWipeInventory() errchain.HandlerFunc {if err := server.Decode(r, &options); err != nil {// If no body provided, use default (false for all)options = WipeInventoryOptions{- WipeLabels: false,+ WipeTags: false,WipeLocations: false,WipeMaintenance: false,}}- totalCompleted, err := ctrl.repo.Items.WipeInventory(ctx, ctx.GID, options.WipeLabels, options.WipeLocations, options.WipeMaintenance)+ totalCompleted, err := ctrl.repo.Items.WipeInventory(ctx, ctx.GID, options.WipeTags, options.WipeLocations, options.WipeMaintenance)if err != nil {log.Err(err).Str("action_ref", "wipe inventory").Msg("failed to run action")return validate.NewRequestError(err, http.StatusInternalServerError)@@ -146,8 +146,8 @@ func (ctrl *V1Controller) HandleWipeInventory() errchain.HandlerFunc {// Publish mutation events for wiped resourcesif ctrl.bus != nil {- if options.WipeLabels {- ctrl.bus.Publish(eventbus.EventLabelMutation, eventbus.GroupMutationEvent{GID: ctx.GID})+ if options.WipeTags {+ ctrl.bus.Publish(eventbus.EventTagMutation, eventbus.GroupMutationEvent{GID: ctx.GID})}if options.WipeLocations {ctrl.bus.Publish(eventbus.EventLocationMutation, eventbus.GroupMutationEvent{GID: ctx.GID})diff --git a/backend/app/api/handlers/v1/v1_ctrl_item_templates.go b/backend/app/api/handlers/v1/v1_ctrl_item_templates.goindex deb4c261..562063e3 100644--- a/backend/app/api/handlers/v1/v1_ctrl_item_templates.go+++ b/backend/app/api/handlers/v1/v1_ctrl_item_templates.go@@ -106,7 +106,7 @@ type ItemTemplateCreateItemRequest struct {Name string `json:"name" validate:"required,min=1,max=255"`Description string `json:"description" validate:"max=1000"`LocationID uuid.UUID `json:"locationId" validate:"required"`- LabelIDs []uuid.UUID `json:"labelIds"`+ TagIDs []uuid.UUID `json:"tagIds"`Quantity *int `json:"quantity"`}@@ -150,7 +150,7 @@ func (ctrl *V1Controller) HandleItemTemplatesCreateItem() errchain.HandlerFunc {Description: body.Description,Quantity: quantity,LocationID: body.LocationID,- LabelIDs: body.LabelIDs,+ TagIDs: body.TagIDs,Insured: template.DefaultInsured,Manufacturer: template.DefaultManufacturer,ModelNumber: template.DefaultModelNumber,diff --git a/backend/app/api/handlers/v1/v1_ctrl_items.go b/backend/app/api/handlers/v1/v1_ctrl_items.goindex 44a3bc8e..f71fcfad 100644--- a/backend/app/api/handlers/v1/v1_ctrl_items.go+++ b/backend/app/api/handlers/v1/v1_ctrl_items.go@@ -28,7 +28,7 @@ import (// @Param q query string false "search string"// @Param page query int false "page number"// @Param pageSize query int false "items per page"-// @Param labels query []string false "label Ids" collectionFormat(multi)+// @Param tags query []string false "tags Ids" collectionFormat(multi)// @Param locations query []string false "location Ids" collectionFormat(multi)// @Param parentIds query []string false "parent Ids" collectionFormat(multi)// @Success 200 {object} repo.PaginationResult[repo.ItemSummary]{}@@ -59,8 +59,8 @@ func (ctrl *V1Controller) HandleItemsGetAll() errchain.HandlerFunc {PageSize: queryIntOrNegativeOne(params.Get("pageSize")),Search: params.Get("q"),LocationIDs: queryUUIDList(params, "locations"),- LabelIDs: queryUUIDList(params, "labels"),- NegateLabels: queryBool(params.Get("negateLabels")),+ TagIDs: queryUUIDList(params, "tags"),+ NegateTags: queryBool(params.Get("negateTags")),OnlyWithoutPhoto: queryBool(params.Get("onlyWithoutPhoto")),OnlyWithPhoto: queryBool(params.Get("onlyWithPhoto")),ParentItemIDs: queryUUIDList(params, "parentIds"),diff --git a/backend/app/api/handlers/v1/v1_ctrl_labels.go b/backend/app/api/handlers/v1/v1_ctrl_labels.godeleted file mode 100644index 1c23adbe..00000000--- a/backend/app/api/handlers/v1/v1_ctrl_labels.go+++ /dev/null@@ -1,102 +0,0 @@-package v1--import (- "net/http"-- "github.com/google/uuid"- "github.com/hay-kot/httpkit/errchain"- "github.com/sysadminsmedia/homebox/backend/internal/core/services"- "github.com/sysadminsmedia/homebox/backend/internal/data/repo"- "github.com/sysadminsmedia/homebox/backend/internal/web/adapters"-)--// HandleLabelsGetAll godoc-//-// @Summary Get All Labels-// @Tags Labels-// @Produce json-// @Success 200 {object} []repo.LabelOut-// @Router /v1/labels [GET]-// @Security Bearer-func (ctrl *V1Controller) HandleLabelsGetAll() errchain.HandlerFunc {- fn := func(r *http.Request) ([]repo.LabelSummary, error) {- auth := services.NewContext(r.Context())- return ctrl.repo.Labels.GetAll(auth, auth.GID)- }-- return adapters.Command(fn, http.StatusOK)-}--// HandleLabelsCreate godoc-//-// @Summary Create Label-// @Tags Labels-// @Produce json-// @Param payload body repo.LabelCreate true "Label Data"-// @Success 200 {object} repo.LabelSummary-// @Router /v1/labels [POST]-// @Security Bearer-func (ctrl *V1Controller) HandleLabelsCreate() errchain.HandlerFunc {- fn := func(r *http.Request, data repo.LabelCreate) (repo.LabelOut, error) {- auth := services.NewContext(r.Context())- return ctrl.repo.Labels.Create(auth, auth.GID, data)- }-- return adapters.Action(fn, http.StatusCreated)-}--// HandleLabelDelete godocs-//-// @Summary Delete Label-// @Tags Labels-// @Produce json-// @Param id path string true "Label ID"-// @Success 204-// @Router /v1/labels/{id} [DELETE]-// @Security Bearer-func (ctrl *V1Controller) HandleLabelDelete() errchain.HandlerFunc {- fn := func(r *http.Request, ID uuid.UUID) (any, error) {- auth := services.NewContext(r.Context())- err := ctrl.repo.Labels.DeleteByGroup(auth, auth.GID, ID)- return nil, err- }-- return adapters.CommandID("id", fn, http.StatusNoContent)-}--// HandleLabelGet godocs-//-// @Summary Get Label-// @Tags Labels-// @Produce json-// @Param id path string true "Label ID"-// @Success 200 {object} repo.LabelOut-// @Router /v1/labels/{id} [GET]-// @Security Bearer-func (ctrl *V1Controller) HandleLabelGet() errchain.HandlerFunc {- fn := func(r *http.Request, ID uuid.UUID) (repo.LabelOut, error) {- auth := services.NewContext(r.Context())- return ctrl.repo.Labels.GetOneByGroup(auth, auth.GID, ID)- }-- return adapters.CommandID("id", fn, http.StatusOK)-}--// HandleLabelUpdate godocs-//-// @Summary Update Label-// @Tags Labels-// @Produce json-// @Param id path string true "Label ID"-// @Success 200 {object} repo.LabelOut-// @Router /v1/labels/{id} [PUT]-// @Security Bearer-func (ctrl *V1Controller) HandleLabelUpdate() errchain.HandlerFunc {- fn := func(r *http.Request, ID uuid.UUID, data repo.LabelUpdate) (repo.LabelOut, error) {- auth := services.NewContext(r.Context())- data.ID = ID- return ctrl.repo.Labels.UpdateByGroup(auth, auth.GID, data)- }-- return adapters.ActionID("id", fn, http.StatusOK)-}diff --git a/backend/app/api/handlers/v1/v1_ctrl_statistics.go b/backend/app/api/handlers/v1/v1_ctrl_statistics.goindex 980f44b0..bb406ca6 100644--- a/backend/app/api/handlers/v1/v1_ctrl_statistics.go+++ b/backend/app/api/handlers/v1/v1_ctrl_statistics.go@@ -29,18 +29,18 @@ func (ctrl *V1Controller) HandleGroupStatisticsLocations() errchain.HandlerFuncreturn adapters.Command(fn, http.StatusOK)}-// HandleGroupStatisticsLabels godoc+// HandleGroupStatisticsTags godoc//-// @Summary Get Label Statistics+// @Summary Get Tags Statistics// @Tags Statistics// @Produce json// @Success 200 {object} []repo.TotalsByOrganizer-// @Router /v1/groups/statistics/labels [GET]+// @Router /v1/groups/statistics/tags [GET]// @Security Bearer-func (ctrl *V1Controller) HandleGroupStatisticsLabels() errchain.HandlerFunc {+func (ctrl *V1Controller) HandleGroupStatisticsTags() errchain.HandlerFunc {fn := func(r *http.Request) ([]repo.TotalsByOrganizer, error) {auth := services.NewContext(r.Context())- return ctrl.repo.Groups.StatsLabelsByPurchasePrice(auth, auth.GID)+ return ctrl.repo.Groups.StatsTagsByPurchasePrice(auth, auth.GID)}return adapters.Command(fn, http.StatusOK)diff --git a/backend/app/api/handlers/v1/v1_ctrl_tags.go b/backend/app/api/handlers/v1/v1_ctrl_tags.gonew file mode 100644index 00000000..b8d46b83--- /dev/null+++ b/backend/app/api/handlers/v1/v1_ctrl_tags.go@@ -0,0 +1,102 @@+package v1++import (+ "net/http"++ "github.com/google/uuid"+ "github.com/hay-kot/httpkit/errchain"+ "github.com/sysadminsmedia/homebox/backend/internal/core/services"+ "github.com/sysadminsmedia/homebox/backend/internal/data/repo"+ "github.com/sysadminsmedia/homebox/backend/internal/web/adapters"+)++// HandleTagsGetAll godoc+//+// @Summary Get All Tags+// @Tags Tags+// @Produce json+// @Success 200 {object} []repo.TagOut+// @Router /v1/tags [GET]+// @Security Bearer+func (ctrl *V1Controller) HandleTagsGetAll() errchain.HandlerFunc {+ fn := func(r *http.Request) ([]repo.TagSummary, error) {+ auth := services.NewContext(r.Context())+ return ctrl.repo.Tags.GetAll(auth, auth.GID)+ }++ return adapters.Command(fn, http.StatusOK)+}++// HandleTagsCreate godoc+//+// @Summary Create Tag+// @Tags Tags+// @Produce json+// @Param payload body repo.TagCreate true "Tag Data"+// @Success 200 {object} repo.TagSummary+// @Router /v1/tags [POST]+// @Security Bearer+func (ctrl *V1Controller) HandleTagsCreate() errchain.HandlerFunc {+ fn := func(r *http.Request, data repo.TagCreate) (repo.TagOut, error) {+ auth := services.NewContext(r.Context())+ return ctrl.repo.Tags.Create(auth, auth.GID, data)+ }++ return adapters.Action(fn, http.StatusCreated)+}++// HandleTagDelete godocs+//+// @Summary Delete Tag+// @Tags Tags+// @Produce json+// @Param id path string true "Tag ID"+// @Success 204+// @Router /v1/tags/{id} [DELETE]+// @Security Bearer+func (ctrl *V1Controller) HandleTagDelete() errchain.HandlerFunc {+ fn := func(r *http.Request, ID uuid.UUID) (any, error) {+ auth := services.NewContext(r.Context())+ err := ctrl.repo.Tags.DeleteByGroup(auth, auth.GID, ID)+ return nil, err+ }++ return adapters.CommandID("id", fn, http.StatusNoContent)+}++// HandleTagGet godocs+//+// @Summary Get Tag+// @Tags Tags+// @Produce json+// @Param id path string true "Tag ID"+// @Success 200 {object} repo.TagOut+// @Router /v1/tags/{id} [GET]+// @Security Bearer+func (ctrl *V1Controller) HandleTagGet() errchain.HandlerFunc {+ fn := func(r *http.Request, ID uuid.UUID) (repo.TagOut, error) {+ auth := services.NewContext(r.Context())+ return ctrl.repo.Tags.GetOneByGroup(auth, auth.GID, ID)+ }++ return adapters.CommandID("id", fn, http.StatusOK)+}++// HandleTagUpdate godocs+//+// @Summary Update Tag+// @Tags Tags+// @Produce json+// @Param id path string true "Tag ID"+// @Success 200 {object} repo.TagOut+// @Router /v1/tags/{id} [PUT]+// @Security Bearer+func (ctrl *V1Controller) HandleTagUpdate() errchain.HandlerFunc {+ fn := func(r *http.Request, ID uuid.UUID, data repo.TagUpdate) (repo.TagOut, error) {+ auth := services.NewContext(r.Context())+ data.ID = ID+ return ctrl.repo.Tags.UpdateByGroup(auth, auth.GID, data)+ }++ return adapters.ActionID("id", fn, http.StatusOK)+}diff --git a/backend/app/api/routes.go b/backend/app/api/routes.goindex 010daaa8..848188eb 100644--- a/backend/app/api/routes.go+++ b/backend/app/api/routes.go@@ -109,12 +109,10 @@ func (a *app) mountRoutes(r *chi.Mux, chain *errchain.ErrChain, repos *repo.AllRr.Get("/groups/invitations", chain.ToHandlerFunc(v1Ctrl.HandleGroupInvitationsGetAll(), userMW...))r.Post("/groups/invitations", chain.ToHandlerFunc(v1Ctrl.HandleGroupInvitationsCreate(), userMW...))- r.Post("/groups/invitations/{id}", chain.ToHandlerFunc(v1Ctrl.HandleGroupInvitationsAccept(), userMW...))- r.Delete("/groups/invitations/{id}", chain.ToHandlerFunc(v1Ctrl.HandleGroupInvitationsDelete(), userMW...))r.Get("/groups/statistics", chain.ToHandlerFunc(v1Ctrl.HandleGroupStatistics(), userMW...))r.Get("/groups/statistics/purchase-price", chain.ToHandlerFunc(v1Ctrl.HandleGroupStatisticsPriceOverTime(), userMW...))r.Get("/groups/statistics/locations", chain.ToHandlerFunc(v1Ctrl.HandleGroupStatisticsLocations(), userMW...))- r.Get("/groups/statistics/labels", chain.ToHandlerFunc(v1Ctrl.HandleGroupStatisticsLabels(), userMW...))+ r.Get("/groups/statistics/tags", chain.ToHandlerFunc(v1Ctrl.HandleGroupStatisticsTags(), userMW...))// Action endpointsr.Post("/actions/ensure-asset-ids", chain.ToHandlerFunc(v1Ctrl.HandleEnsureAssetID(), userMW...))@@ -132,12 +130,12 @@ func (a *app) mountRoutes(r *chi.Mux, chain *errchain.ErrChain, repos *repo.AllRr.Put("/locations/{id}", chain.ToHandlerFunc(v1Ctrl.HandleLocationUpdate(), userMW...))r.Delete("/locations/{id}", chain.ToHandlerFunc(v1Ctrl.HandleLocationDelete(), userMW...))- // Labels (tags) endpoints- r.Get("/labels", chain.ToHandlerFunc(v1Ctrl.HandleLabelsGetAll(), userMW...))- r.Post("/labels", chain.ToHandlerFunc(v1Ctrl.HandleLabelsCreate(), userMW...))- r.Get("/labels/{id}", chain.ToHandlerFunc(v1Ctrl.HandleLabelGet(), userMW...))- r.Put("/labels/{id}", chain.ToHandlerFunc(v1Ctrl.HandleLabelUpdate(), userMW...))- r.Delete("/labels/{id}", chain.ToHandlerFunc(v1Ctrl.HandleLabelDelete(), userMW...))+ // Tags endpoints+ r.Get("/tags", chain.ToHandlerFunc(v1Ctrl.HandleTagsGetAll(), userMW...))+ r.Post("/tags", chain.ToHandlerFunc(v1Ctrl.HandleTagsCreate(), userMW...))+ r.Get("/tags/{id}", chain.ToHandlerFunc(v1Ctrl.HandleTagGet(), userMW...))+ r.Put("/tags/{id}", chain.ToHandlerFunc(v1Ctrl.HandleTagUpdate(), userMW...))+ r.Delete("/tags/{id}", chain.ToHandlerFunc(v1Ctrl.HandleTagDelete(), userMW...))// Item endpointsr.Get("/items", chain.ToHandlerFunc(v1Ctrl.HandleItemsGetAll(), userMW...))diff --git a/backend/app/api/static/docs/docs.go b/backend/app/api/static/docs/docs.goindex c2ce3d4b..a62ff381 100644--- a/backend/app/api/static/docs/docs.go+++ b/backend/app/api/static/docs/docs.go@@ -598,7 +598,7 @@ const docTemplate = `{}}},- "/v1/groups/statistics/labels": {+ "/v1/groups/statistics/locations": {"get": {"security": [{@@ -611,7 +611,7 @@ const docTemplate = `{"tags": ["Statistics"],- "summary": "Get Label Statistics",+ "summary": "Get Location Statistics","responses": {"200": {"description": "OK",@@ -625,7 +625,7 @@ const docTemplate = `{}}},- "/v1/groups/statistics/locations": {+ "/v1/groups/statistics/purchase-price": {"get": {"security": [{@@ -638,21 +638,32 @@ const docTemplate = `{"tags": ["Statistics"],- "summary": "Get Location Statistics",+ "summary": "Get Purchase Price Statistics",+ "parameters": [+ {+ "type": "string",+ "description": "start date",+ "name": "start",+ "in": "query"+ },+ {+ "type": "string",+ "description": "end date",+ "name": "end",+ "in": "query"+ }+ ],"responses": {"200": {"description": "OK","schema": {- "type": "array",- "items": {- "$ref": "#/definitions/repo.TotalsByOrganizer"- }+ "$ref": "#/definitions/repo.ValueOverTime"}}}}},- "/v1/groups/statistics/purchase-price": {+ "/v1/groups/statistics/tags": {"get": {"security": [{@@ -665,26 +676,15 @@ const docTemplate = `{"tags": ["Statistics"],- "summary": "Get Purchase Price Statistics",- "parameters": [- {- "type": "string",- "description": "start date",- "name": "start",- "in": "query"- },- {- "type": "string",- "description": "end date",- "name": "end",- "in": "query"- }- ],+ "summary": "Get Tags Statistics","responses": {"200": {"description": "OK","schema": {- "$ref": "#/definitions/repo.ValueOverTime"+ "type": "array",+ "items": {+ "$ref": "#/definitions/repo.TotalsByOrganizer"+ }}}}@@ -729,8 +729,8 @@ const docTemplate = `{"type": "string"},"collectionFormat": "multi",- "description": "label Ids",- "name": "labels",+ "description": "tags Ids",+ "name": "tags","in": "query"},{@@ -1516,158 +1516,6 @@ const docTemplate = `{}}},- "/v1/labels": {- "get": {- "security": [- {- "Bearer": []- }- ],- "produces": [- "application/json"- ],- "tags": [- "Labels"- ],- "summary": "Get All Labels",- "responses": {- "200": {- "description": "OK",- "schema": {- "type": "array",- "items": {- "$ref": "#/definitions/repo.LabelOut"- }- }- }- }- },- "post": {- "security": [- {- "Bearer": []- }- ],- "produces": [- "application/json"- ],- "tags": [- "Labels"- ],- "summary": "Create Label",- "parameters": [- {- "description": "Label Data",- "name": "payload",- "in": "body",- "required": true,- "schema": {- "$ref": "#/definitions/repo.LabelCreate"- }- }- ],- "responses": {- "200": {- "description": "OK",- "schema": {- "$ref": "#/definitions/repo.LabelSummary"- }- }- }- }- },- "/v1/labels/{id}": {- "get": {- "security": [- {- "Bearer": []- }- ],- "produces": [- "application/json"- ],- "tags": [- "Labels"- ],- "summary": "Get Label",- "parameters": [- {- "type": "string",- "description": "Label ID",- "name": "id",- "in": "path",- "required": true- }- ],- "responses": {- "200": {- "description": "OK",- "schema": {- "$ref": "#/definitions/repo.LabelOut"- }- }- }- },- "put": {- "security": [- {- "Bearer": []- }- ],- "produces": [- "application/json"- ],- "tags": [- "Labels"- ],- "summary": "Update Label",- "parameters": [- {- "type": "string",- "description": "Label ID",- "name": "id",- "in": "path",- "required": true- }- ],- "responses": {- "200": {- "description": "OK",- "schema": {- "$ref": "#/definitions/repo.LabelOut"- }- }- }- },- "delete": {- "security": [- {- "Bearer": []- }- ],- "produces": [- "application/json"- ],- "tags": [- "Labels"- ],- "summary": "Delete Label",- "parameters": [- {- "type": "string",- "description": "Label ID",- "name": "id",- "in": "path",- "required": true- }- ],- "responses": {- "204": {- "description": "No Content"- }- }- }- },"/v1/locations": {"get": {"security": [@@ -2250,6 +2098,158 @@ const docTemplate = `{}}},+ "/v1/tags": {+ "get": {+ "security": [+ {+ "Bearer": []+ }+ ],+ "produces": [+ "application/json"+ ],+ "tags": [+ "Tags"+ ],+ "summary": "Get All Tags",+ "responses": {+ "200": {+ "description": "OK",+ "schema": {+ "type": "array",+ "items": {+ "$ref": "#/definitions/repo.TagOut"+ }+ }+ }+ }+ },+ "post": {+ "security": [+ {+ "Bearer": []+ }+ ],+ "produces": [+ "application/json"+ ],+ "tags": [+ "Tags"+ ],+ "summary": "Create Tag",+ "parameters": [+ {+ "description": "Tag Data",+ "name": "payload",+ "in": "body",+ "required": true,+ "schema": {+ "$ref": "#/definitions/repo.TagCreate"+ }+ }+ ],+ "responses": {+ "200": {+ "description": "OK",+ "schema": {+ "$ref": "#/definitions/repo.TagSummary"+ }+ }+ }+ }+ },+ "/v1/tags/{id}": {+ "get": {+ "security": [+ {+ "Bearer": []+ }+ ],+ "produces": [+ "application/json"+ ],+ "tags": [+ "Tags"+ ],+ "summary": "Get Tag",+ "parameters": [+ {+ "type": "string",+ "description": "Tag ID",+ "name": "id",+ "in": "path",+ "required": true+ }+ ],+ "responses": {+ "200": {+ "description": "OK",+ "schema": {+ "$ref": "#/definitions/repo.TagOut"+ }+ }+ }+ },+ "put": {+ "security": [+ {+ "Bearer": []+ }+ ],+ "produces": [+ "application/json"+ ],+ "tags": [+ "Tags"+ ],+ "summary": "Update Tag",+ "parameters": [+ {+ "type": "string",+ "description": "Tag ID",+ "name": "id",+ "in": "path",+ "required": true+ }+ ],+ "responses": {+ "200": {+ "description": "OK",+ "schema": {+ "$ref": "#/definitions/repo.TagOut"+ }+ }+ }+ },+ "delete": {+ "security": [+ {+ "Bearer": []+ }+ ],+ "produces": [+ "application/json"+ ],+ "tags": [+ "Tags"+ ],+ "summary": "Delete Tag",+ "parameters": [+ {+ "type": "string",+ "description": "Tag ID",+ "name": "id",+ "in": "path",+ "required": true+ }+ ],+ "responses": {+ "204": {+ "description": "No Content"+ }+ }+ }+ },"/v1/templates": {"get": {"security": [@@ -3017,13 +3017,6 @@ const docTemplate = `{"$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",@@ -3038,6 +3031,13 @@ const docTemplate = `{"$ref": "#/definitions/ent.Notifier"}},+ "tags": {+ "description": "Tags holds the value of the tags edge.",+ "type": "array",+ "items": {+ "$ref": "#/definitions/ent.Tag"+ }+ },"users": {"description": "Users holds the value of the users edge.","type": "array",@@ -3245,13 +3245,6 @@ const docTemplate = `{}]},- "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.","allOf": [@@ -3274,6 +3267,13 @@ const docTemplate = `{"$ref": "#/definitions/ent.Item"}]+ },+ "tag": {+ "description": "Tag holds the value of the tag edge.",+ "type": "array",+ "items": {+ "$ref": "#/definitions/ent.Tag"+ }}}},@@ -3362,13 +3362,6 @@ const docTemplate = `{"description": "DefaultInsured holds the value of the \"default_insured\" field.","type": "boolean"},- "default_label_ids": {- "description": "Default label IDs for items created from this template",- "type": "array",- "items": {- "type": "string"- }- },"default_lifetime_warranty": {"description": "DefaultLifetimeWarranty holds the value of the \"default_lifetime_warranty\" field.","type": "boolean"@@ -3389,6 +3382,13 @@ const docTemplate = `{"description": "DefaultQuantity holds the value of the \"default_quantity\" field.","type": "integer"},+ "default_tag_ids": {+ "description": "Default tag IDs for items created from this template",+ "type": "array",+ "items": {+ "type": "string"+ }+ },"default_warranty_details": {"description": "DefaultWarrantyDetails holds the value of the \"default_warranty_details\" field.","type": "string"@@ -3463,63 +3463,6 @@ const docTemplate = `{}}},- "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.",- "allOf": [- {- "$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.",- "allOf": [- {- "$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": {@@ -3658,25 +3601,87 @@ const docTemplate = `{"type": "string"},"edges": {- "description": "Edges holds the relations/edges for other nodes in the graph.\nThe values are being populated by the NotifierQuery when eager-loading is set.",+ "description": "Edges holds the relations/edges for other nodes in the graph.\nThe values are being populated by the NotifierQuery when eager-loading is set.",+ "allOf": [+ {+ "$ref": "#/definitions/ent.NotifierEdges"+ }+ ]+ },+ "group_id": {+ "description": "GroupID holds the value of the \"group_id\" field.",+ "type": "string"+ },+ "id": {+ "description": "ID of the ent.",+ "type": "string"+ },+ "is_active": {+ "description": "IsActive holds the value of the \"is_active\" 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"+ },+ "user_id": {+ "description": "UserID holds the value of the \"user_id\" field.",+ "type": "string"+ }+ }+ },+ "ent.NotifierEdges": {+ "type": "object",+ "properties": {+ "group": {+ "description": "Group holds the value of the group edge.",+ "allOf": [+ {+ "$ref": "#/definitions/ent.Group"+ }+ ]+ },+ "user": {+ "description": "User holds the value of the user edge.",+ "allOf": [+ {+ "$ref": "#/definitions/ent.User"+ }+ ]+ }+ }+ },+ "ent.Tag": {+ "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 TagQuery when eager-loading is set.","allOf": [{- "$ref": "#/definitions/ent.NotifierEdges"+ "$ref": "#/definitions/ent.TagEdges"}]},- "group_id": {- "description": "GroupID holds the value of the \"group_id\" field.",- "type": "string"- },"id": {"description": "ID of the ent.","type": "string"},- "is_active": {- "description": "IsActive holds the value of the \"is_active\" field.",- "type": "boolean"- },"name": {"description": "Name holds the value of the \"name\" field.","type": "string"@@ -3684,14 +3689,10 @@ const docTemplate = `{"updated_at": {"description": "UpdatedAt holds the value of the \"updated_at\" field.","type": "string"- },- "user_id": {- "description": "UserID holds the value of the \"user_id\" field.",- "type": "string"}}},- "ent.NotifierEdges": {+ "ent.TagEdges": {"type": "object","properties": {"group": {@@ -3702,13 +3703,12 @@ const docTemplate = `{}]},- "user": {- "description": "User holds the value of the user edge.",- "allOf": [- {- "$ref": "#/definitions/ent.User"- }- ]+ "items": {+ "description": "Items holds the value of the items edge.",+ "type": "array",+ "items": {+ "$ref": "#/definitions/ent.Item"+ }}}},@@ -3970,10 +3970,10 @@ const docTemplate = `{"totalItems": {"type": "integer"},- "totalLabels": {+ "totalLocations": {"type": "integer"},- "totalLocations": {+ "totalTags": {"type": "integer"},"totalUsers": {@@ -4051,12 +4051,6 @@ const docTemplate = `{"type": "string","maxLength": 1000},- "labelIds": {- "type": "array",- "items": {- "type": "string"- }- },"locationId": {"description": "Edges","type": "string"@@ -4072,6 +4066,12 @@ const docTemplate = `{},"quantity": {"type": "integer"+ },+ "tagIds": {+ "type": "array",+ "items": {+ "type": "string"+ }}}},@@ -4137,12 +4137,6 @@ const docTemplate = `{"insured": {"type": "boolean"},- "labels": {- "type": "array",- "items": {- "$ref": "#/definitions/repo.LabelSummary"- }- },"lifetimeWarranty": {"description": "Warranty","type": "boolean"@@ -4211,6 +4205,12 @@ const docTemplate = `{"syncChildItemsLocations": {"type": "boolean"},+ "tags": {+ "type": "array",+ "items": {+ "$ref": "#/definitions/repo.TagSummary"+ }+ },"thumbnailId": {"type": "string","x-nullable": true,@@ -4233,14 +4233,6 @@ const docTemplate = `{"id": {"type": "string"},- "labelIds": {- "type": "array",- "items": {- "type": "string"- },- "x-nullable": true,- "x-omitempty": true- },"locationId": {"type": "string","x-nullable": true,@@ -4250,6 +4242,14 @@ const docTemplate = `{"type": "integer","x-nullable": true,"x-omitempty": true+ },+ "tagIds": {+ "type": "array",+ "items": {+ "type": "string"+ },+ "x-nullable": true,+ "x-omitempty": true}}},@@ -4294,12 +4294,6 @@ const docTemplate = `{"insured": {"type": "boolean"},- "labels": {- "type": "array",- "items": {- "$ref": "#/definitions/repo.LabelSummary"- }- },"location": {"description": "Edges","allOf": [@@ -4323,6 +4317,12 @@ const docTemplate = `{"description": "Sale details","type": "string"},+ "tags": {+ "type": "array",+ "items": {+ "$ref": "#/definitions/repo.TagSummary"+ }+ },"thumbnailId": {"type": "string","x-nullable": true,@@ -4347,18 +4347,11 @@ const docTemplate = `{"defaultInsured": {"type": "boolean"},- "defaultLabelIds": {- "type": "array",- "items": {- "type": "string"- },- "x-nullable": true- },"defaultLifetimeWarranty": {"type": "boolean"},"defaultLocationId": {- "description": "Default location and labels",+ "description": "Default location and tags","type": "string","x-nullable": true},@@ -4382,6 +4375,13 @@ const docTemplate = `{"type": "integer","x-nullable": true},+ "defaultTagIds": {+ "type": "array",+ "items": {+ "type": "string"+ },+ "x-nullable": true+ },"defaultWarrantyDetails": {"type": "string","maxLength": 1000,@@ -4431,17 +4431,11 @@ const docTemplate = `{"defaultInsured": {"type": "boolean"},- "defaultLabels": {- "type": "array",- "items": {- "$ref": "#/definitions/repo.TemplateLabelSummary"- }- },"defaultLifetimeWarranty": {"type": "boolean"},"defaultLocation": {- "description": "Default location and labels",+ "description": "Default location and tags","allOf": [{"$ref": "#/definitions/repo.TemplateLocationSummary"@@ -4461,6 +4455,12 @@ const docTemplate = `{"description": "Default values for items","type": "integer"},+ "defaultTags": {+ "type": "array",+ "items": {+ "$ref": "#/definitions/repo.TemplateTagSummary"+ }+ },"defaultWarrantyDetails": {"type": "string"},@@ -4532,18 +4532,11 @@ const docTemplate = `{"defaultInsured": {"type": "boolean"},- "defaultLabelIds": {- "type": "array",- "items": {- "type": "string"- },- "x-nullable": true- },"defaultLifetimeWarranty": {"type": "boolean"},"defaultLocationId": {- "description": "Default location and labels",+ "description": "Default location and tags","type": "string","x-nullable": true},@@ -4567,6 +4560,13 @@ const docTemplate = `{"type": "integer","x-nullable": true},+ "defaultTagIds": {+ "type": "array",+ "items": {+ "type": "string"+ },+ "x-nullable": true+ },"defaultWarrantyDetails": {"type": "string","maxLength": 1000,@@ -4646,12 +4646,6 @@ const docTemplate = `{"insured": {"type": "boolean"},- "labelIds": {- "type": "array",- "items": {- "type": "string"- }- },"lifetimeWarranty": {"description": "Warranty","type": "boolean"@@ -4719,6 +4713,12 @@ const docTemplate = `{"syncChildItemsLocations": {"type": "boolean"},+ "tagIds": {+ "type": "array",+ "items": {+ "type": "string"+ }+ },"warrantyDetails": {"type": "string"},@@ -4727,72 +4727,6 @@ const docTemplate = `{}}},- "repo.LabelCreate": {- "type": "object",- "required": [- "name"- ],- "properties": {- "color": {- "type": "string"- },- "description": {- "type": "string",- "maxLength": 1000- },- "name": {- "type": "string",- "maxLength": 255,- "minLength": 1- }- }- },- "repo.LabelOut": {- "type": "object",- "properties": {- "color": {- "type": "string"- },- "createdAt": {- "type": "string"- },- "description": {- "type": "string"- },- "id": {- "type": "string"- },- "name": {- "type": "string"- },- "updatedAt": {- "type": "string"- }- }- },- "repo.LabelSummary": {- "type": "object",- "properties": {- "color": {- "type": "string"- },- "createdAt": {- "type": "string"- },- "description": {- "type": "string"- },- "id": {- "type": "string"- },- "name": {- "type": "string"- },- "updatedAt": {- "type": "string"- }- }- },"repo.LocationCreate": {"type": "object","properties": {@@ -5102,6 +5036,72 @@ const docTemplate = `{}}},+ "repo.TagCreate": {+ "type": "object",+ "required": [+ "name"+ ],+ "properties": {+ "color": {+ "type": "string"+ },+ "description": {+ "type": "string",+ "maxLength": 1000+ },+ "name": {+ "type": "string",+ "maxLength": 255,+ "minLength": 1+ }+ }+ },+ "repo.TagOut": {+ "type": "object",+ "properties": {+ "color": {+ "type": "string"+ },+ "createdAt": {+ "type": "string"+ },+ "description": {+ "type": "string"+ },+ "id": {+ "type": "string"+ },+ "name": {+ "type": "string"+ },+ "updatedAt": {+ "type": "string"+ }+ }+ },+ "repo.TagSummary": {+ "type": "object",+ "properties": {+ "color": {+ "type": "string"+ },+ "createdAt": {+ "type": "string"+ },+ "description": {+ "type": "string"+ },+ "id": {+ "type": "string"+ },+ "name": {+ "type": "string"+ },+ "updatedAt": {+ "type": "string"+ }+ }+ },"repo.TemplateField": {"type": "object","properties": {@@ -5119,7 +5119,7 @@ const docTemplate = `{}}},- "repo.TemplateLabelSummary": {+ "repo.TemplateLocationSummary": {"type": "object","properties": {"id": {@@ -5130,7 +5130,7 @@ const docTemplate = `{}}},- "repo.TemplateLocationSummary": {+ "repo.TemplateTagSummary": {"type": "object","properties": {"id": {@@ -5478,12 +5478,6 @@ const docTemplate = `{"type": "string","maxLength": 1000},- "labelIds": {- "type": "array",- "items": {- "type": "string"- }- },"locationId": {"type": "string"},@@ -5494,6 +5488,12 @@ const docTemplate = `{},"quantity": {"type": "integer"+ },+ "tagIds": {+ "type": "array",+ "items": {+ "type": "string"+ }}}},@@ -5547,14 +5547,14 @@ const docTemplate = `{"v1.WipeInventoryOptions": {"type": "object","properties": {- "wipeLabels": {- "type": "boolean"- },"wipeLocations": {"type": "boolean"},"wipeMaintenance": {"type": "boolean"+ },+ "wipeTags": {+ "type": "boolean"}}},diff --git a/backend/app/api/static/docs/openapi-3.json b/backend/app/api/static/docs/openapi-3.jsonindex 58eb9a09..afb7ef32 100644--- a/backend/app/api/static/docs/openapi-3.json+++ b/backend/app/api/static/docs/openapi-3.json@@ -603,34 +603,6 @@}}},- "/v1/groups/statistics/labels": {- "get": {- "security": [- {- "Bearer": []- }- ],- "tags": [- "Statistics"- ],- "summary": "Get Label Statistics",- "responses": {- "200": {- "description": "OK",- "content": {- "application/json": {- "schema": {- "type": "array",- "items": {- "$ref": "#/components/schemas/repo.TotalsByOrganizer"- }- }- }- }- }- }- }- },"/v1/groups/statistics/locations": {"get": {"security": [@@ -702,6 +674,34 @@}}},+ "/v1/groups/statistics/tags": {+ "get": {+ "security": [+ {+ "Bearer": []+ }+ ],+ "tags": [+ "Statistics"+ ],+ "summary": "Get Tags Statistics",+ "responses": {+ "200": {+ "description": "OK",+ "content": {+ "application/json": {+ "schema": {+ "type": "array",+ "items": {+ "$ref": "#/components/schemas/repo.TotalsByOrganizer"+ }+ }+ }+ }+ }+ }+ }+ },"/v1/items": {"get": {"security": [@@ -739,8 +739,8 @@}},{- "description": "label Ids",- "name": "labels",+ "description": "tags Ids",+ "name": "tags","in": "query","explode": true,"schema": {@@ -1628,165 +1628,6 @@}}},- "/v1/labels": {- "get": {- "security": [- {- "Bearer": []- }- ],- "tags": [- "Labels"- ],- "summary": "Get All Labels",- "responses": {- "200": {- "description": "OK",- "content": {- "application/json": {- "schema": {- "type": "array",- "items": {- "$ref": "#/components/schemas/repo.LabelOut"- }- }- }- }- }- }- },- "post": {- "security": [- {- "Bearer": []- }- ],- "tags": [- "Labels"- ],- "summary": "Create Label",- "requestBody": {- "content": {- "application/json": {- "schema": {- "$ref": "#/components/schemas/repo.LabelCreate"- }- }- },- "description": "Label Data",- "required": true- },- "responses": {- "200": {- "description": "OK",- "content": {- "application/json": {- "schema": {- "$ref": "#/components/schemas/repo.LabelSummary"- }- }- }- }- }- }- },- "/v1/labels/{id}": {- "get": {- "security": [- {- "Bearer": []- }- ],- "tags": [- "Labels"- ],- "summary": "Get Label",- "parameters": [- {- "description": "Label ID",- "name": "id",- "in": "path",- "required": true,- "schema": {- "type": "string"- }- }- ],- "responses": {- "200": {- "description": "OK",- "content": {- "application/json": {- "schema": {- "$ref": "#/components/schemas/repo.LabelOut"- }- }- }- }- }- },- "put": {- "security": [- {- "Bearer": []- }- ],- "tags": [- "Labels"- ],- "summary": "Update Label",- "parameters": [- {- "description": "Label ID",- "name": "id",- "in": "path",- "required": true,- "schema": {- "type": "string"- }- }- ],- "responses": {- "200": {- "description": "OK",- "content": {- "application/json": {- "schema": {- "$ref": "#/components/schemas/repo.LabelOut"- }- }- }- }- }- },- "delete": {- "security": [- {- "Bearer": []- }- ],- "tags": [- "Labels"- ],- "summary": "Delete Label",- "parameters": [- {- "description": "Label ID",- "name": "id",- "in": "path",- "required": true,- "schema": {- "type": "string"- }- }- ],- "responses": {- "204": {- "description": "No Content"- }- }- }- },"/v1/locations": {"get": {"security": [@@ -2409,7 +2250,7 @@}}},- "/v1/templates": {+ "/v1/tags": {"get": {"security": [{@@ -2417,9 +2258,9 @@}],"tags": [- "Item Templates"+ "Tags"],- "summary": "Get All Item Templates",+ "summary": "Get All Tags","responses": {"200": {"description": "OK",@@ -2428,7 +2269,7 @@"schema": {"type": "array","items": {- "$ref": "#/components/schemas/repo.ItemTemplateSummary"+ "$ref": "#/components/schemas/repo.TagOut"}}}@@ -2443,27 +2284,27 @@}],"tags": [- "Item Templates"+ "Tags"],- "summary": "Create Item Template",+ "summary": "Create Tag","requestBody": {"content": {"application/json": {"schema": {- "$ref": "#/components/schemas/repo.ItemTemplateCreate"+ "$ref": "#/components/schemas/repo.TagCreate"}}},- "description": "Template Data",+ "description": "Tag Data","required": true},"responses": {- "201": {- "description": "Created",+ "200": {+ "description": "OK","content": {"application/json": {"schema": {- "$ref": "#/components/schemas/repo.ItemTemplateOut"+ "$ref": "#/components/schemas/repo.TagSummary"}}}@@ -2471,7 +2312,7 @@}}},- "/v1/templates/{id}": {+ "/v1/tags/{id}": {"get": {"security": [{@@ -2479,12 +2320,12 @@}],"tags": [- "Item Templates"+ "Tags"],- "summary": "Get Item Template",+ "summary": "Get Tag","parameters": [{- "description": "Template ID",+ "description": "Tag ID","name": "id","in": "path","required": true,@@ -2499,7 +2340,7 @@"content": {"application/json": {"schema": {- "$ref": "#/components/schemas/repo.ItemTemplateOut"+ "$ref": "#/components/schemas/repo.TagOut"}}}@@ -2513,12 +2354,12 @@}],"tags": [- "Item Templates"+ "Tags"],- "summary": "Update Item Template",+ "summary": "Update Tag","parameters": [{- "description": "Template ID",+ "description": "Tag ID","name": "id","in": "path","required": true,@@ -2527,24 +2368,13 @@}}],- "requestBody": {- "content": {- "application/json": {- "schema": {- "$ref": "#/components/schemas/repo.ItemTemplateUpdate"- }- }- },- "description": "Template Data",- "required": true- },"responses": {"200": {"description": "OK","content": {"application/json": {"schema": {- "$ref": "#/components/schemas/repo.ItemTemplateOut"+ "$ref": "#/components/schemas/repo.TagOut"}}}@@ -2558,12 +2388,12 @@}],"tags": [- "Item Templates"+ "Tags"],- "summary": "Delete Item Template",+ "summary": "Delete Tag","parameters": [{- "description": "Template ID",+ "description": "Tag ID","name": "id","in": "path","required": true,@@ -2579,8 +2409,8 @@}}},- "/v1/templates/{id}/create-item": {- "post": {+ "/v1/templates": {+ "get": {"security": [{"Bearer": []@@ -2589,21 +2419,191 @@"tags": ["Item Templates"],- "summary": "Create Item from Template",- "parameters": [- {- "description": "Template ID",- "name": "id",- "in": "path",- "required": true,- "schema": {- "type": "string"+ "summary": "Get All Item Templates",+ "responses": {+ "200": {+ "description": "OK",+ "content": {+ "application/json": {+ "schema": {+ "type": "array",+ "items": {+ "$ref": "#/components/schemas/repo.ItemTemplateSummary"+ }+ }+ }}}- ],- "requestBody": {- "content": {- "application/json": {+ }+ },+ "post": {+ "security": [+ {+ "Bearer": []+ }+ ],+ "tags": [+ "Item Templates"+ ],+ "summary": "Create Item Template",+ "requestBody": {+ "content": {+ "application/json": {+ "schema": {+ "$ref": "#/components/schemas/repo.ItemTemplateCreate"+ }+ }+ },+ "description": "Template Data",+ "required": true+ },+ "responses": {+ "201": {+ "description": "Created",+ "content": {+ "application/json": {+ "schema": {+ "$ref": "#/components/schemas/repo.ItemTemplateOut"+ }+ }+ }+ }+ }+ }+ },+ "/v1/templates/{id}": {+ "get": {+ "security": [+ {+ "Bearer": []+ }+ ],+ "tags": [+ "Item Templates"+ ],+ "summary": "Get Item Template",+ "parameters": [+ {+ "description": "Template ID",+ "name": "id",+ "in": "path",+ "required": true,+ "schema": {+ "type": "string"+ }+ }+ ],+ "responses": {+ "200": {+ "description": "OK",+ "content": {+ "application/json": {+ "schema": {+ "$ref": "#/components/schemas/repo.ItemTemplateOut"+ }+ }+ }+ }+ }+ },+ "put": {+ "security": [+ {+ "Bearer": []+ }+ ],+ "tags": [+ "Item Templates"+ ],+ "summary": "Update Item Template",+ "parameters": [+ {+ "description": "Template ID",+ "name": "id",+ "in": "path",+ "required": true,+ "schema": {+ "type": "string"+ }+ }+ ],+ "requestBody": {+ "content": {+ "application/json": {+ "schema": {+ "$ref": "#/components/schemas/repo.ItemTemplateUpdate"+ }+ }+ },+ "description": "Template Data",+ "required": true+ },+ "responses": {+ "200": {+ "description": "OK",+ "content": {+ "application/json": {+ "schema": {+ "$ref": "#/components/schemas/repo.ItemTemplateOut"+ }+ }+ }+ }+ }+ },+ "delete": {+ "security": [+ {+ "Bearer": []+ }+ ],+ "tags": [+ "Item Templates"+ ],+ "summary": "Delete Item Template",+ "parameters": [+ {+ "description": "Template ID",+ "name": "id",+ "in": "path",+ "required": true,+ "schema": {+ "type": "string"+ }+ }+ ],+ "responses": {+ "204": {+ "description": "No Content"+ }+ }+ }+ },+ "/v1/templates/{id}/create-item": {+ "post": {+ "security": [+ {+ "Bearer": []+ }+ ],+ "tags": [+ "Item Templates"+ ],+ "summary": "Create Item from Template",+ "parameters": [+ {+ "description": "Template ID",+ "name": "id",+ "in": "path",+ "required": true,+ "schema": {+ "type": "string"+ }+ }+ ],+ "requestBody": {+ "content": {+ "application/json": {"schema": {"$ref": "#/components/schemas/v1.ItemTemplateCreateItemRequest"}@@ -3214,13 +3214,6 @@"$ref": "#/components/schemas/ent.Item"}},- "labels": {- "description": "Labels holds the value of the labels edge.",- "type": "array",- "items": {- "$ref": "#/components/schemas/ent.Label"- }- },"locations": {"description": "Locations holds the value of the locations edge.","type": "array",@@ -3235,6 +3228,13 @@"$ref": "#/components/schemas/ent.Notifier"}},+ "tags": {+ "description": "Tags holds the value of the tags edge.",+ "type": "array",+ "items": {+ "$ref": "#/components/schemas/ent.Tag"+ }+ },"users": {"description": "Users holds the value of the users edge.","type": "array",@@ -3442,13 +3442,6 @@}]},- "label": {- "description": "Label holds the value of the label edge.",- "type": "array",- "items": {- "$ref": "#/components/schemas/ent.Label"- }- },"location": {"description": "Location holds the value of the location edge.","allOf": [@@ -3471,6 +3464,13 @@"$ref": "#/components/schemas/ent.Item"}]+ },+ "tag": {+ "description": "Tag holds the value of the tag edge.",+ "type": "array",+ "items": {+ "$ref": "#/components/schemas/ent.Tag"+ }}}},@@ -3559,13 +3559,6 @@"description": "DefaultInsured holds the value of the \"default_insured\" field.","type": "boolean"},- "default_label_ids": {- "description": "Default label IDs for items created from this template",- "type": "array",- "items": {- "type": "string"- }- },"default_lifetime_warranty": {"description": "DefaultLifetimeWarranty holds the value of the \"default_lifetime_warranty\" field.","type": "boolean"@@ -3586,6 +3579,13 @@"description": "DefaultQuantity holds the value of the \"default_quantity\" field.","type": "integer"},+ "default_tag_ids": {+ "description": "Default tag IDs for items created from this template",+ "type": "array",+ "items": {+ "type": "string"+ }+ },"default_warranty_details": {"description": "DefaultWarrantyDetails holds the value of the \"default_warranty_details\" field.","type": "string"@@ -3660,63 +3660,6 @@}}},- "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.",- "allOf": [- {- "$ref": "#/components/schemas/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.",- "allOf": [- {- "$ref": "#/components/schemas/ent.Group"- }- ]- },- "items": {- "description": "Items holds the value of the items edge.",- "type": "array",- "items": {- "$ref": "#/components/schemas/ent.Item"- }- }- }- },"ent.Location": {"type": "object","properties": {@@ -3855,25 +3798,87 @@"type": "string"},"edges": {- "description": "Edges holds the relations/edges for other nodes in the graph.\nThe values are being populated by the NotifierQuery when eager-loading is set.",+ "description": "Edges holds the relations/edges for other nodes in the graph.\nThe values are being populated by the NotifierQuery when eager-loading is set.",+ "allOf": [+ {+ "$ref": "#/components/schemas/ent.NotifierEdges"+ }+ ]+ },+ "group_id": {+ "description": "GroupID holds the value of the \"group_id\" field.",+ "type": "string"+ },+ "id": {+ "description": "ID of the ent.",+ "type": "string"+ },+ "is_active": {+ "description": "IsActive holds the value of the \"is_active\" 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"+ },+ "user_id": {+ "description": "UserID holds the value of the \"user_id\" field.",+ "type": "string"+ }+ }+ },+ "ent.NotifierEdges": {+ "type": "object",+ "properties": {+ "group": {+ "description": "Group holds the value of the group edge.",+ "allOf": [+ {+ "$ref": "#/components/schemas/ent.Group"+ }+ ]+ },+ "user": {+ "description": "User holds the value of the user edge.",+ "allOf": [+ {+ "$ref": "#/components/schemas/ent.User"+ }+ ]+ }+ }+ },+ "ent.Tag": {+ "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 TagQuery when eager-loading is set.","allOf": [{- "$ref": "#/components/schemas/ent.NotifierEdges"+ "$ref": "#/components/schemas/ent.TagEdges"}]},- "group_id": {- "description": "GroupID holds the value of the \"group_id\" field.",- "type": "string"- },"id": {"description": "ID of the ent.","type": "string"},- "is_active": {- "description": "IsActive holds the value of the \"is_active\" field.",- "type": "boolean"- },"name": {"description": "Name holds the value of the \"name\" field.","type": "string"@@ -3881,14 +3886,10 @@"updated_at": {"description": "UpdatedAt holds the value of the \"updated_at\" field.","type": "string"- },- "user_id": {- "description": "UserID holds the value of the \"user_id\" field.",- "type": "string"}}},- "ent.NotifierEdges": {+ "ent.TagEdges": {"type": "object","properties": {"group": {@@ -3899,13 +3900,12 @@}]},- "user": {- "description": "User holds the value of the user edge.",- "allOf": [- {- "$ref": "#/components/schemas/ent.User"- }- ]+ "items": {+ "description": "Items holds the value of the items edge.",+ "type": "array",+ "items": {+ "$ref": "#/components/schemas/ent.Item"+ }}}},@@ -4167,10 +4167,10 @@"totalItems": {"type": "integer"},- "totalLabels": {+ "totalLocations": {"type": "integer"},- "totalLocations": {+ "totalTags": {"type": "integer"},"totalUsers": {@@ -4248,12 +4248,6 @@"type": "string","maxLength": 1000},- "labelIds": {- "type": "array",- "items": {- "type": "string"- }- },"locationId": {"description": "Edges","type": "string"@@ -4269,6 +4263,12 @@},"quantity": {"type": "integer"+ },+ "tagIds": {+ "type": "array",+ "items": {+ "type": "string"+ }}}},@@ -4334,12 +4334,6 @@"insured": {"type": "boolean"},- "labels": {- "type": "array",- "items": {- "$ref": "#/components/schemas/repo.LabelSummary"- }- },"lifetimeWarranty": {"description": "Warranty","type": "boolean"@@ -4408,6 +4402,12 @@"syncChildItemsLocations": {"type": "boolean"},+ "tags": {+ "type": "array",+ "items": {+ "$ref": "#/components/schemas/repo.TagSummary"+ }+ },"thumbnailId": {"type": "string","x-omitempty": true,@@ -4430,14 +4430,6 @@"id": {"type": "string"},- "labelIds": {- "type": "array",- "items": {- "type": "string"- },- "x-omitempty": true,- "nullable": true- },"locationId": {"type": "string","x-omitempty": true,@@ -4447,6 +4439,14 @@"type": "integer","x-omitempty": true,"nullable": true+ },+ "tagIds": {+ "type": "array",+ "items": {+ "type": "string"+ },+ "x-omitempty": true,+ "nullable": true}}},@@ -4491,12 +4491,6 @@"insured": {"type": "boolean"},- "labels": {- "type": "array",- "items": {- "$ref": "#/components/schemas/repo.LabelSummary"- }- },"location": {"description": "Edges","allOf": [@@ -4520,6 +4514,12 @@"description": "Sale details","type": "string"},+ "tags": {+ "type": "array",+ "items": {+ "$ref": "#/components/schemas/repo.TagSummary"+ }+ },"thumbnailId": {"type": "string","x-omitempty": true,@@ -4544,18 +4544,11 @@"defaultInsured": {"type": "boolean"},- "defaultLabelIds": {- "type": "array",- "items": {- "type": "string"- },- "nullable": true- },"defaultLifetimeWarranty": {"type": "boolean"},"defaultLocationId": {- "description": "Default location and labels",+ "description": "Default location and tags","type": "string","nullable": true},@@ -4579,6 +4572,13 @@"type": "integer","nullable": true},+ "defaultTagIds": {+ "type": "array",+ "items": {+ "type": "string"+ },+ "nullable": true+ },"defaultWarrantyDetails": {"type": "string","maxLength": 1000,@@ -4628,17 +4628,11 @@"defaultInsured": {"type": "boolean"},- "defaultLabels": {- "type": "array",- "items": {- "$ref": "#/components/schemas/repo.TemplateLabelSummary"- }- },"defaultLifetimeWarranty": {"type": "boolean"},"defaultLocation": {- "description": "Default location and labels",+ "description": "Default location and tags","allOf": [{"$ref": "#/components/schemas/repo.TemplateLocationSummary"@@ -4658,6 +4652,12 @@"description": "Default values for items","type": "integer"},+ "defaultTags": {+ "type": "array",+ "items": {+ "$ref": "#/components/schemas/repo.TemplateTagSummary"+ }+ },"defaultWarrantyDetails": {"type": "string"},@@ -4729,18 +4729,11 @@"defaultInsured": {"type": "boolean"},- "defaultLabelIds": {- "type": "array",- "items": {- "type": "string"- },- "nullable": true- },"defaultLifetimeWarranty": {"type": "boolean"},"defaultLocationId": {- "description": "Default location and labels",+ "description": "Default location and tags","type": "string","nullable": true},@@ -4764,6 +4757,13 @@"type": "integer","nullable": true},+ "defaultTagIds": {+ "type": "array",+ "items": {+ "type": "string"+ },+ "nullable": true+ },"defaultWarrantyDetails": {"type": "string","maxLength": 1000,@@ -4843,12 +4843,6 @@"insured": {"type": "boolean"},- "labelIds": {- "type": "array",- "items": {- "type": "string"- }- },"lifetimeWarranty": {"description": "Warranty","type": "boolean"@@ -4916,6 +4910,12 @@"syncChildItemsLocations": {"type": "boolean"},+ "tagIds": {+ "type": "array",+ "items": {+ "type": "string"+ }+ },"warrantyDetails": {"type": "string"},@@ -4924,72 +4924,6 @@}}},- "repo.LabelCreate": {- "type": "object",- "required": [- "name"- ],- "properties": {- "color": {- "type": "string"- },- "description": {- "type": "string",- "maxLength": 1000- },- "name": {- "type": "string",- "maxLength": 255,- "minLength": 1- }- }- },- "repo.LabelOut": {- "type": "object",- "properties": {- "color": {- "type": "string"- },- "createdAt": {- "type": "string"- },- "description": {- "type": "string"- },- "id": {- "type": "string"- },- "name": {- "type": "string"- },- "updatedAt": {- "type": "string"- }- }- },- "repo.LabelSummary": {- "type": "object",- "properties": {- "color": {- "type": "string"- },- "createdAt": {- "type": "string"- },- "description": {- "type": "string"- },- "id": {- "type": "string"- },- "name": {- "type": "string"- },- "updatedAt": {- "type": "string"- }- }- },"repo.LocationCreate": {"type": "object","properties": {@@ -5299,6 +5233,72 @@}}},+ "repo.TagCreate": {+ "type": "object",+ "required": [+ "name"+ ],+ "properties": {+ "color": {+ "type": "string"+ },+ "description": {+ "type": "string",+ "maxLength": 1000+ },+ "name": {+ "type": "string",+ "maxLength": 255,+ "minLength": 1+ }+ }+ },+ "repo.TagOut": {+ "type": "object",+ "properties": {+ "color": {+ "type": "string"+ },+ "createdAt": {+ "type": "string"+ },+ "description": {+ "type": "string"+ },+ "id": {+ "type": "string"+ },+ "name": {+ "type": "string"+ },+ "updatedAt": {+ "type": "string"+ }+ }+ },+ "repo.TagSummary": {+ "type": "object",+ "properties": {+ "color": {+ "type": "string"+ },+ "createdAt": {+ "type": "string"+ },+ "description": {+ "type": "string"+ },+ "id": {+ "type": "string"+ },+ "name": {+ "type": "string"+ },+ "updatedAt": {+ "type": "string"+ }+ }+ },"repo.TemplateField": {"type": "object","properties": {@@ -5316,7 +5316,7 @@}}},- "repo.TemplateLabelSummary": {+ "repo.TemplateLocationSummary": {"type": "object","properties": {"id": {@@ -5327,7 +5327,7 @@}}},- "repo.TemplateLocationSummary": {+ "repo.TemplateTagSummary": {"type": "object","properties": {"id": {@@ -5675,12 +5675,6 @@"type": "string","maxLength": 1000},- "labelIds": {- "type": "array",- "items": {- "type": "string"- }- },"locationId": {"type": "string"},@@ -5691,6 +5685,12 @@},"quantity": {"type": "integer"+ },+ "tagIds": {+ "type": "array",+ "items": {+ "type": "string"+ }}}},@@ -5744,14 +5744,14 @@"v1.WipeInventoryOptions": {"type": "object","properties": {- "wipeLabels": {- "type": "boolean"- },"wipeLocations": {"type": "boolean"},"wipeMaintenance": {"type": "boolean"+ },+ "wipeTags": {+ "type": "boolean"}}},diff --git a/backend/app/api/static/docs/openapi-3.yaml b/backend/app/api/static/docs/openapi-3.yamlindex da6563b2..50be7f5a 100644--- a/backend/app/api/static/docs/openapi-3.yaml+++ b/backend/app/api/static/docs/openapi-3.yaml@@ -351,22 +351,6 @@ paths:application/json:schema:$ref: "#/components/schemas/repo.GroupStatistics"- /v1/groups/statistics/labels:- get:- security:- - Bearer: []- tags:- - Statistics- summary: Get Label Statistics- responses:- "200":- description: OK- content:- application/json:- schema:- type: array- items:- $ref: "#/components/schemas/repo.TotalsByOrganizer"/v1/groups/statistics/locations:get:security:@@ -408,6 +392,22 @@ paths:application/json:schema:$ref: "#/components/schemas/repo.ValueOverTime"+ /v1/groups/statistics/tags:+ get:+ security:+ - Bearer: []+ tags:+ - Statistics+ summary: Get Tags Statistics+ responses:+ "200":+ description: OK+ content:+ application/json:+ schema:+ type: array+ items:+ $ref: "#/components/schemas/repo.TotalsByOrganizer"/v1/items:get:security:@@ -431,8 +431,8 @@ paths:in: queryschema:type: integer- - description: label Ids- name: labels+ - description: tags Ids+ name: tagsin: queryexplode: trueschema:@@ -965,99 +965,6 @@ paths:application/json:schema:type: string- /v1/labels:- get:- security:- - Bearer: []- tags:- - Labels- summary: Get All Labels- responses:- "200":- description: OK- content:- application/json:- schema:- type: array- items:- $ref: "#/components/schemas/repo.LabelOut"- post:- security:- - Bearer: []- tags:- - Labels- summary: Create Label- requestBody:- content:- application/json:- schema:- $ref: "#/components/schemas/repo.LabelCreate"- description: Label Data- required: true- responses:- "200":- description: OK- content:- application/json:- schema:- $ref: "#/components/schemas/repo.LabelSummary"- "/v1/labels/{id}":- get:- security:- - Bearer: []- tags:- - Labels- summary: Get Label- parameters:- - description: Label ID- name: id- in: path- required: true- schema:- type: string- responses:- "200":- description: OK- content:- application/json:- schema:- $ref: "#/components/schemas/repo.LabelOut"- put:- security:- - Bearer: []- tags:- - Labels- summary: Update Label- parameters:- - description: Label ID- name: id- in: path- required: true- schema:- type: string- responses:- "200":- description: OK- content:- application/json:- schema:- $ref: "#/components/schemas/repo.LabelOut"- delete:- security:- - Bearer: []- tags:- - Labels- summary: Delete Label- parameters:- - description: Label ID- name: id- in: path- required: true- schema:- type: string- responses:- "204":- description: No Content/v1/locations:get:security:@@ -1424,6 +1331,99 @@ paths:application/json:schema:$ref: "#/components/schemas/v1.APISummary"+ /v1/tags:+ get:+ security:+ - Bearer: []+ tags:+ - Tags+ summary: Get All Tags+ responses:+ "200":+ description: OK+ content:+ application/json:+ schema:+ type: array+ items:+ $ref: "#/components/schemas/repo.TagOut"+ post:+ security:+ - Bearer: []+ tags:+ - Tags+ summary: Create Tag+ requestBody:+ content:+ application/json:+ schema:+ $ref: "#/components/schemas/repo.TagCreate"+ description: Tag Data+ required: true+ responses:+ "200":+ description: OK+ content:+ application/json:+ schema:+ $ref: "#/components/schemas/repo.TagSummary"+ "/v1/tags/{id}":+ get:+ security:+ - Bearer: []+ tags:+ - Tags+ summary: Get Tag+ parameters:+ - description: Tag ID+ name: id+ in: path+ required: true+ schema:+ type: string+ responses:+ "200":+ description: OK+ content:+ application/json:+ schema:+ $ref: "#/components/schemas/repo.TagOut"+ put:+ security:+ - Bearer: []+ tags:+ - Tags+ summary: Update Tag+ parameters:+ - description: Tag ID+ name: id+ in: path+ required: true+ schema:+ type: string+ responses:+ "200":+ description: OK+ content:+ application/json:+ schema:+ $ref: "#/components/schemas/repo.TagOut"+ delete:+ security:+ - Bearer: []+ tags:+ - Tags+ summary: Delete Tag+ parameters:+ - description: Tag ID+ name: id+ in: path+ required: true+ schema:+ type: string+ responses:+ "204":+ description: No Content/v1/templates:get:security:@@ -1930,11 +1930,6 @@ components:type: arrayitems:$ref: "#/components/schemas/ent.Item"- labels:- description: Labels holds the value of the labels edge.- type: array- items:- $ref: "#/components/schemas/ent.Label"locations:description: Locations holds the value of the locations edge.type: array@@ -1945,6 +1940,11 @@ components:type: arrayitems:$ref: "#/components/schemas/ent.Notifier"+ tags:+ description: Tags holds the value of the tags edge.+ type: array+ items:+ $ref: "#/components/schemas/ent.Tag"users:description: Users holds the value of the users edge.type: array@@ -2095,11 +2095,6 @@ components:description: Group holds the value of the group edge.allOf:- $ref: "#/components/schemas/ent.Group"- label:- description: Label holds the value of the label edge.- type: array- items:- $ref: "#/components/schemas/ent.Label"location:description: Location holds the value of the location edge.allOf:@@ -2113,6 +2108,11 @@ components:description: Parent holds the value of the parent edge.allOf:- $ref: "#/components/schemas/ent.Item"+ tag:+ description: Tag holds the value of the tag edge.+ type: array+ items:+ $ref: "#/components/schemas/ent.Tag"ent.ItemField:type: objectproperties:@@ -2173,11 +2173,6 @@ components:default_insured:description: DefaultInsured holds the value of the "default_insured" field.type: boolean- default_label_ids:- description: Default label IDs for items created from this template- type: array- items:- type: stringdefault_lifetime_warranty:description: DefaultLifetimeWarranty holds the value of the"default_lifetime_warranty" field.@@ -2195,6 +2190,11 @@ components:default_quantity:description: DefaultQuantity holds the value of the "default_quantity" field.type: integer+ default_tag_ids:+ description: Default tag IDs for items created from this template+ type: array+ items:+ type: stringdefault_warranty_details:description: DefaultWarrantyDetails holds the value of the"default_warranty_details" field.@@ -2248,46 +2248,6 @@ components:description: Location holds the value of the location edge.allOf:- $ref: "#/components/schemas/ent.Location"- 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.-- The values are being populated by the LabelQuery when eager-loading is set.- allOf:- - $ref: "#/components/schemas/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.- allOf:- - $ref: "#/components/schemas/ent.Group"- items:- description: Items holds the value of the items edge.- type: array- items:- $ref: "#/components/schemas/ent.Item"ent.Location:type: objectproperties:@@ -2420,6 +2380,46 @@ components:description: User holds the value of the user edge.allOf:- $ref: "#/components/schemas/ent.User"+ ent.Tag:+ 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.++ The values are being populated by the TagQuery when eager-loading is set.+ allOf:+ - $ref: "#/components/schemas/ent.TagEdges"+ 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.TagEdges:+ type: object+ properties:+ group:+ description: Group holds the value of the group edge.+ allOf:+ - $ref: "#/components/schemas/ent.Group"+ items:+ description: Items holds the value of the items edge.+ type: array+ items:+ $ref: "#/components/schemas/ent.Item"ent.TemplateField:type: objectproperties:@@ -2599,10 +2599,10 @@ components:type: numbertotalItems:type: integer- totalLabels:- type: integertotalLocations:type: integer+ totalTags:+ type: integertotalUsers:type: integertotalWithWarranty:@@ -2652,10 +2652,6 @@ components:description:type: stringmaxLength: 1000- labelIds:- type: array- items:- type: stringlocationId:description: Edgestype: string@@ -2668,6 +2664,10 @@ components:nullable: truequantity:type: integer+ tagIds:+ type: array+ items:+ type: stringrepo.ItemField:type: objectproperties:@@ -2711,10 +2711,6 @@ components:nullable: trueinsured:type: boolean- labels:- type: array- items:- $ref: "#/components/schemas/repo.LabelSummary"lifetimeWarranty:description: Warrantytype: boolean@@ -2760,6 +2756,10 @@ components:type: stringsyncChildItemsLocations:type: boolean+ tags:+ type: array+ items:+ $ref: "#/components/schemas/repo.TagSummary"thumbnailId:type: stringx-omitempty: true@@ -2775,12 +2775,6 @@ components:properties:id:type: string- labelIds:- type: array- items:- type: string- x-omitempty: true- nullable: truelocationId:type: stringx-omitempty: true@@ -2789,6 +2783,12 @@ components:type: integerx-omitempty: truenullable: true+ tagIds:+ type: array+ items:+ type: string+ x-omitempty: true+ nullable: truerepo.ItemPath:type: objectproperties:@@ -2818,10 +2818,6 @@ components:nullable: trueinsured:type: boolean- labels:- type: array- items:- $ref: "#/components/schemas/repo.LabelSummary"location:description: EdgesallOf:@@ -2837,6 +2833,10 @@ components:soldTime:description: Sale detailstype: string+ tags:+ type: array+ items:+ $ref: "#/components/schemas/repo.TagSummary"thumbnailId:type: stringx-omitempty: true@@ -2854,15 +2854,10 @@ components:nullable: truedefaultInsured:type: boolean- defaultLabelIds:- type: array- items:- type: string- nullable: truedefaultLifetimeWarranty:type: booleandefaultLocationId:- description: Default location and labels+ description: Default location and tagstype: stringnullable: truedefaultManufacturer:@@ -2881,6 +2876,11 @@ components:description: Default values for itemstype: integernullable: true+ defaultTagIds:+ type: array+ items:+ type: string+ nullable: truedefaultWarrantyDetails:type: stringmaxLength: 1000@@ -2916,14 +2916,10 @@ components:type: stringdefaultInsured:type: boolean- defaultLabels:- type: array- items:- $ref: "#/components/schemas/repo.TemplateLabelSummary"defaultLifetimeWarranty:type: booleandefaultLocation:- description: Default location and labels+ description: Default location and tagsallOf:- $ref: "#/components/schemas/repo.TemplateLocationSummary"defaultManufacturer:@@ -2935,6 +2931,10 @@ components:defaultQuantity:description: Default values for itemstype: integer+ defaultTags:+ type: array+ items:+ $ref: "#/components/schemas/repo.TemplateTagSummary"defaultWarrantyDetails:type: stringdescription:@@ -2983,15 +2983,10 @@ components:nullable: truedefaultInsured:type: boolean- defaultLabelIds:- type: array- items:- type: string- nullable: truedefaultLifetimeWarranty:type: booleandefaultLocationId:- description: Default location and labels+ description: Default location and tagstype: stringnullable: truedefaultManufacturer:@@ -3010,6 +3005,11 @@ components:description: Default values for itemstype: integernullable: true+ defaultTagIds:+ type: array+ items:+ type: string+ nullable: truedefaultWarrantyDetails:type: stringmaxLength: 1000@@ -3066,10 +3066,6 @@ components:type: stringinsured:type: boolean- labelIds:- type: array- items:- type: stringlifetimeWarranty:description: Warrantytype: boolean@@ -3120,54 +3116,14 @@ components:maxLength: 255syncChildItemsLocations:type: boolean+ tagIds:+ type: array+ items:+ type: stringwarrantyDetails:type: stringwarrantyExpires:type: string- repo.LabelCreate:- type: object- required:- - name- properties:- color:- type: string- description:- type: string- maxLength: 1000- name:- type: string- maxLength: 255- minLength: 1- repo.LabelOut:- type: object- properties:- color:- type: string- createdAt:- type: string- description:- type: string- id:- type: string- name:- type: string- updatedAt:- type: string- repo.LabelSummary:- type: object- properties:- color:- type: string- createdAt:- type: string- description:- type: string- id:- type: string- name:- type: string- updatedAt:- type: stringrepo.LocationCreate:type: objectproperties:@@ -3375,6 +3331,50 @@ components:type: integertotal:type: integer+ repo.TagCreate:+ type: object+ required:+ - name+ properties:+ color:+ type: string+ description:+ type: string+ maxLength: 1000+ name:+ type: string+ maxLength: 255+ minLength: 1+ repo.TagOut:+ type: object+ properties:+ color:+ type: string+ createdAt:+ type: string+ description:+ type: string+ id:+ type: string+ name:+ type: string+ updatedAt:+ type: string+ repo.TagSummary:+ type: object+ properties:+ color:+ type: string+ createdAt:+ type: string+ description:+ type: string+ id:+ type: string+ name:+ type: string+ updatedAt:+ type: stringrepo.TemplateField:type: objectproperties:@@ -3386,14 +3386,14 @@ components:type: stringtype:type: string- repo.TemplateLabelSummary:+ repo.TemplateLocationSummary:type: objectproperties:id:type: stringname:type: string- repo.TemplateLocationSummary:+ repo.TemplateTagSummary:type: objectproperties:id:@@ -3622,10 +3622,6 @@ components:description:type: stringmaxLength: 1000- labelIds:- type: array- items:- type: stringlocationId:type: stringname:@@ -3634,6 +3630,10 @@ components:minLength: 1quantity:type: integer+ tagIds:+ type: array+ items:+ type: stringv1.LoginForm:type: objectproperties:@@ -3668,12 +3668,12 @@ components:v1.WipeInventoryOptions:type: objectproperties:- wipeLabels:- type: booleanwipeLocations:type: booleanwipeMaintenance:type: boolean+ wipeTags:+ type: booleanv1.Wrapped:type: objectproperties:diff --git a/backend/app/api/static/docs/swagger.json b/backend/app/api/static/docs/swagger.jsonindex b2edcda4..edc7c452 100644--- a/backend/app/api/static/docs/swagger.json+++ b/backend/app/api/static/docs/swagger.json@@ -596,7 +596,7 @@}}},- "/v1/groups/statistics/labels": {+ "/v1/groups/statistics/locations": {"get": {"security": [{@@ -609,7 +609,7 @@"tags": ["Statistics"],- "summary": "Get Label Statistics",+ "summary": "Get Location Statistics","responses": {"200": {"description": "OK",@@ -623,7 +623,7 @@}}},- "/v1/groups/statistics/locations": {+ "/v1/groups/statistics/purchase-price": {"get": {"security": [{@@ -636,21 +636,32 @@"tags": ["Statistics"],- "summary": "Get Location Statistics",+ "summary": "Get Purchase Price Statistics",+ "parameters": [+ {+ "type": "string",+ "description": "start date",+ "name": "start",+ "in": "query"+ },+ {+ "type": "string",+ "description": "end date",+ "name": "end",+ "in": "query"+ }+ ],"responses": {"200": {"description": "OK","schema": {- "type": "array",- "items": {- "$ref": "#/definitions/repo.TotalsByOrganizer"- }+ "$ref": "#/definitions/repo.ValueOverTime"}}}}},- "/v1/groups/statistics/purchase-price": {+ "/v1/groups/statistics/tags": {"get": {"security": [{@@ -663,26 +674,15 @@"tags": ["Statistics"],- "summary": "Get Purchase Price Statistics",- "parameters": [- {- "type": "string",- "description": "start date",- "name": "start",- "in": "query"- },- {- "type": "string",- "description": "end date",- "name": "end",- "in": "query"- }- ],+ "summary": "Get Tags Statistics","responses": {"200": {"description": "OK","schema": {- "$ref": "#/definitions/repo.ValueOverTime"+ "type": "array",+ "items": {+ "$ref": "#/definitions/repo.TotalsByOrganizer"+ }}}}@@ -727,8 +727,8 @@"type": "string"},"collectionFormat": "multi",- "description": "label Ids",- "name": "labels",+ "description": "tags Ids",+ "name": "tags","in": "query"},{@@ -1514,158 +1514,6 @@}}},- "/v1/labels": {- "get": {- "security": [- {- "Bearer": []- }- ],- "produces": [- "application/json"- ],- "tags": [- "Labels"- ],- "summary": "Get All Labels",- "responses": {- "200": {- "description": "OK",- "schema": {- "type": "array",- "items": {- "$ref": "#/definitions/repo.LabelOut"- }- }- }- }- },- "post": {- "security": [- {- "Bearer": []- }- ],- "produces": [- "application/json"- ],- "tags": [- "Labels"- ],- "summary": "Create Label",- "parameters": [- {- "description": "Label Data",- "name": "payload",- "in": "body",- "required": true,- "schema": {- "$ref": "#/definitions/repo.LabelCreate"- }- }- ],- "responses": {- "200": {- "description": "OK",- "schema": {- "$ref": "#/definitions/repo.LabelSummary"- }- }- }- }- },- "/v1/labels/{id}": {- "get": {- "security": [- {- "Bearer": []- }- ],- "produces": [- "application/json"- ],- "tags": [- "Labels"- ],- "summary": "Get Label",- "parameters": [- {- "type": "string",- "description": "Label ID",- "name": "id",- "in": "path",- "required": true- }- ],- "responses": {- "200": {- "description": "OK",- "schema": {- "$ref": "#/definitions/repo.LabelOut"- }- }- }- },- "put": {- "security": [- {- "Bearer": []- }- ],- "produces": [- "application/json"- ],- "tags": [- "Labels"- ],- "summary": "Update Label",- "parameters": [- {- "type": "string",- "description": "Label ID",- "name": "id",- "in": "path",- "required": true- }- ],- "responses": {- "200": {- "description": "OK",- "schema": {- "$ref": "#/definitions/repo.LabelOut"- }- }- }- },- "delete": {- "security": [- {- "Bearer": []- }- ],- "produces": [- "application/json"- ],- "tags": [- "Labels"- ],- "summary": "Delete Label",- "parameters": [- {- "type": "string",- "description": "Label ID",- "name": "id",- "in": "path",- "required": true- }- ],- "responses": {- "204": {- "description": "No Content"- }- }- }- },"/v1/locations": {"get": {"security": [@@ -2248,6 +2096,158 @@}}},+ "/v1/tags": {+ "get": {+ "security": [+ {+ "Bearer": []+ }+ ],+ "produces": [+ "application/json"+ ],+ "tags": [+ "Tags"+ ],+ "summary": "Get All Tags",+ "responses": {+ "200": {+ "description": "OK",+ "schema": {+ "type": "array",+ "items": {+ "$ref": "#/definitions/repo.TagOut"+ }+ }+ }+ }+ },+ "post": {+ "security": [+ {+ "Bearer": []+ }+ ],+ "produces": [+ "application/json"+ ],+ "tags": [+ "Tags"+ ],+ "summary": "Create Tag",+ "parameters": [+ {+ "description": "Tag Data",+ "name": "payload",+ "in": "body",+ "required": true,+ "schema": {+ "$ref": "#/definitions/repo.TagCreate"+ }+ }+ ],+ "responses": {+ "200": {+ "description": "OK",+ "schema": {+ "$ref": "#/definitions/repo.TagSummary"+ }+ }+ }+ }+ },+ "/v1/tags/{id}": {+ "get": {+ "security": [+ {+ "Bearer": []+ }+ ],+ "produces": [+ "application/json"+ ],+ "tags": [+ "Tags"+ ],+ "summary": "Get Tag",+ "parameters": [+ {+ "type": "string",+ "description": "Tag ID",+ "name": "id",+ "in": "path",+ "required": true+ }+ ],+ "responses": {+ "200": {+ "description": "OK",+ "schema": {+ "$ref": "#/definitions/repo.TagOut"+ }+ }+ }+ },+ "put": {+ "security": [+ {+ "Bearer": []+ }+ ],+ "produces": [+ "application/json"+ ],+ "tags": [+ "Tags"+ ],+ "summary": "Update Tag",+ "parameters": [+ {+ "type": "string",+ "description": "Tag ID",+ "name": "id",+ "in": "path",+ "required": true+ }+ ],+ "responses": {+ "200": {+ "description": "OK",+ "schema": {+ "$ref": "#/definitions/repo.TagOut"+ }+ }+ }+ },+ "delete": {+ "security": [+ {+ "Bearer": []+ }+ ],+ "produces": [+ "application/json"+ ],+ "tags": [+ "Tags"+ ],+ "summary": "Delete Tag",+ "parameters": [+ {+ "type": "string",+ "description": "Tag ID",+ "name": "id",+ "in": "path",+ "required": true+ }+ ],+ "responses": {+ "204": {+ "description": "No Content"+ }+ }+ }+ },"/v1/templates": {"get": {"security": [@@ -3015,13 +3015,6 @@"$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",@@ -3036,6 +3029,13 @@"$ref": "#/definitions/ent.Notifier"}},+ "tags": {+ "description": "Tags holds the value of the tags edge.",+ "type": "array",+ "items": {+ "$ref": "#/definitions/ent.Tag"+ }+ },"users": {"description": "Users holds the value of the users edge.","type": "array",@@ -3243,13 +3243,6 @@}]},- "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.","allOf": [@@ -3272,6 +3265,13 @@"$ref": "#/definitions/ent.Item"}]+ },+ "tag": {+ "description": "Tag holds the value of the tag edge.",+ "type": "array",+ "items": {+ "$ref": "#/definitions/ent.Tag"+ }}}},@@ -3360,13 +3360,6 @@"description": "DefaultInsured holds the value of the \"default_insured\" field.","type": "boolean"},- "default_label_ids": {- "description": "Default label IDs for items created from this template",- "type": "array",- "items": {- "type": "string"- }- },"default_lifetime_warranty": {"description": "DefaultLifetimeWarranty holds the value of the \"default_lifetime_warranty\" field.","type": "boolean"@@ -3387,6 +3380,13 @@"description": "DefaultQuantity holds the value of the \"default_quantity\" field.","type": "integer"},+ "default_tag_ids": {+ "description": "Default tag IDs for items created from this template",+ "type": "array",+ "items": {+ "type": "string"+ }+ },"default_warranty_details": {"description": "DefaultWarrantyDetails holds the value of the \"default_warranty_details\" field.","type": "string"@@ -3461,63 +3461,6 @@}}},- "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.",- "allOf": [- {- "$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.",- "allOf": [- {- "$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": {@@ -3656,25 +3599,87 @@"type": "string"},"edges": {- "description": "Edges holds the relations/edges for other nodes in the graph.\nThe values are being populated by the NotifierQuery when eager-loading is set.",+ "description": "Edges holds the relations/edges for other nodes in the graph.\nThe values are being populated by the NotifierQuery when eager-loading is set.",+ "allOf": [+ {+ "$ref": "#/definitions/ent.NotifierEdges"+ }+ ]+ },+ "group_id": {+ "description": "GroupID holds the value of the \"group_id\" field.",+ "type": "string"+ },+ "id": {+ "description": "ID of the ent.",+ "type": "string"+ },+ "is_active": {+ "description": "IsActive holds the value of the \"is_active\" 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"+ },+ "user_id": {+ "description": "UserID holds the value of the \"user_id\" field.",+ "type": "string"+ }+ }+ },+ "ent.NotifierEdges": {+ "type": "object",+ "properties": {+ "group": {+ "description": "Group holds the value of the group edge.",+ "allOf": [+ {+ "$ref": "#/definitions/ent.Group"+ }+ ]+ },+ "user": {+ "description": "User holds the value of the user edge.",+ "allOf": [+ {+ "$ref": "#/definitions/ent.User"+ }+ ]+ }+ }+ },+ "ent.Tag": {+ "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 TagQuery when eager-loading is set.","allOf": [{- "$ref": "#/definitions/ent.NotifierEdges"+ "$ref": "#/definitions/ent.TagEdges"}]},- "group_id": {- "description": "GroupID holds the value of the \"group_id\" field.",- "type": "string"- },"id": {"description": "ID of the ent.","type": "string"},- "is_active": {- "description": "IsActive holds the value of the \"is_active\" field.",- "type": "boolean"- },"name": {"description": "Name holds the value of the \"name\" field.","type": "string"@@ -3682,14 +3687,10 @@"updated_at": {"description": "UpdatedAt holds the value of the \"updated_at\" field.","type": "string"- },- "user_id": {- "description": "UserID holds the value of the \"user_id\" field.",- "type": "string"}}},- "ent.NotifierEdges": {+ "ent.TagEdges": {"type": "object","properties": {"group": {@@ -3700,13 +3701,12 @@}]},- "user": {- "description": "User holds the value of the user edge.",- "allOf": [- {- "$ref": "#/definitions/ent.User"- }- ]+ "items": {+ "description": "Items holds the value of the items edge.",+ "type": "array",+ "items": {+ "$ref": "#/definitions/ent.Item"+ }}}},@@ -3968,10 +3968,10 @@"totalItems": {"type": "integer"},- "totalLabels": {+ "totalLocations": {"type": "integer"},- "totalLocations": {+ "totalTags": {"type": "integer"},"totalUsers": {@@ -4049,12 +4049,6 @@"type": "string","maxLength": 1000},- "labelIds": {- "type": "array",- "items": {- "type": "string"- }- },"locationId": {"description": "Edges","type": "string"@@ -4070,6 +4064,12 @@},"quantity": {"type": "integer"+ },+ "tagIds": {+ "type": "array",+ "items": {+ "type": "string"+ }}}},@@ -4135,12 +4135,6 @@"insured": {"type": "boolean"},- "labels": {- "type": "array",- "items": {- "$ref": "#/definitions/repo.LabelSummary"- }- },"lifetimeWarranty": {"description": "Warranty","type": "boolean"@@ -4209,6 +4203,12 @@"syncChildItemsLocations": {"type": "boolean"},+ "tags": {+ "type": "array",+ "items": {+ "$ref": "#/definitions/repo.TagSummary"+ }+ },"thumbnailId": {"type": "string","x-nullable": true,@@ -4231,14 +4231,6 @@"id": {"type": "string"},- "labelIds": {- "type": "array",- "items": {- "type": "string"- },- "x-nullable": true,- "x-omitempty": true- },"locationId": {"type": "string","x-nullable": true,@@ -4248,6 +4240,14 @@"type": "integer","x-nullable": true,"x-omitempty": true+ },+ "tagIds": {+ "type": "array",+ "items": {+ "type": "string"+ },+ "x-nullable": true,+ "x-omitempty": true}}},@@ -4292,12 +4292,6 @@"insured": {"type": "boolean"},- "labels": {- "type": "array",- "items": {- "$ref": "#/definitions/repo.LabelSummary"- }- },"location": {"description": "Edges","allOf": [@@ -4321,6 +4315,12 @@"description": "Sale details","type": "string"},+ "tags": {+ "type": "array",+ "items": {+ "$ref": "#/definitions/repo.TagSummary"+ }+ },"thumbnailId": {"type": "string","x-nullable": true,@@ -4345,18 +4345,11 @@"defaultInsured": {"type": "boolean"},- "defaultLabelIds": {- "type": "array",- "items": {- "type": "string"- },- "x-nullable": true- },"defaultLifetimeWarranty": {"type": "boolean"},"defaultLocationId": {- "description": "Default location and labels",+ "description": "Default location and tags","type": "string","x-nullable": true},@@ -4380,6 +4373,13 @@"type": "integer","x-nullable": true},+ "defaultTagIds": {+ "type": "array",+ "items": {+ "type": "string"+ },+ "x-nullable": true+ },"defaultWarrantyDetails": {"type": "string","maxLength": 1000,@@ -4429,17 +4429,11 @@"defaultInsured": {"type": "boolean"},- "defaultLabels": {- "type": "array",- "items": {- "$ref": "#/definitions/repo.TemplateLabelSummary"- }- },"defaultLifetimeWarranty": {"type": "boolean"},"defaultLocation": {- "description": "Default location and labels",+ "description": "Default location and tags","allOf": [{"$ref": "#/definitions/repo.TemplateLocationSummary"@@ -4459,6 +4453,12 @@"description": "Default values for items","type": "integer"},+ "defaultTags": {+ "type": "array",+ "items": {+ "$ref": "#/definitions/repo.TemplateTagSummary"+ }+ },"defaultWarrantyDetails": {"type": "string"},@@ -4530,18 +4530,11 @@"defaultInsured": {"type": "boolean"},- "defaultLabelIds": {- "type": "array",- "items": {- "type": "string"- },- "x-nullable": true- },"defaultLifetimeWarranty": {"type": "boolean"},"defaultLocationId": {- "description": "Default location and labels",+ "description": "Default location and tags","type": "string","x-nullable": true},@@ -4565,6 +4558,13 @@"type": "integer","x-nullable": true},+ "defaultTagIds": {+ "type": "array",+ "items": {+ "type": "string"+ },+ "x-nullable": true+ },"defaultWarrantyDetails": {"type": "string","maxLength": 1000,@@ -4644,12 +4644,6 @@"insured": {"type": "boolean"},- "labelIds": {- "type": "array",- "items": {- "type": "string"- }- },"lifetimeWarranty": {"description": "Warranty","type": "boolean"@@ -4717,6 +4711,12 @@"syncChildItemsLocations": {"type": "boolean"},+ "tagIds": {+ "type": "array",+ "items": {+ "type": "string"+ }+ },"warrantyDetails": {"type": "string"},@@ -4725,72 +4725,6 @@}}},- "repo.LabelCreate": {- "type": "object",- "required": [- "name"- ],- "properties": {- "color": {- "type": "string"- },- "description": {- "type": "string",- "maxLength": 1000- },- "name": {- "type": "string",- "maxLength": 255,- "minLength": 1- }- }- },- "repo.LabelOut": {- "type": "object",- "properties": {- "color": {- "type": "string"- },- "createdAt": {- "type": "string"- },- "description": {- "type": "string"- },- "id": {- "type": "string"- },- "name": {- "type": "string"- },- "updatedAt": {- "type": "string"- }- }- },- "repo.LabelSummary": {- "type": "object",- "properties": {- "color": {- "type": "string"- },- "createdAt": {- "type": "string"- },- "description": {- "type": "string"- },- "id": {- "type": "string"- },- "name": {- "type": "string"- },- "updatedAt": {- "type": "string"- }- }- },"repo.LocationCreate": {"type": "object","properties": {@@ -5100,6 +5034,72 @@}}},+ "repo.TagCreate": {+ "type": "object",+ "required": [+ "name"+ ],+ "properties": {+ "color": {+ "type": "string"+ },+ "description": {+ "type": "string",+ "maxLength": 1000+ },+ "name": {+ "type": "string",+ "maxLength": 255,+ "minLength": 1+ }+ }+ },+ "repo.TagOut": {+ "type": "object",+ "properties": {+ "color": {+ "type": "string"+ },+ "createdAt": {+ "type": "string"+ },+ "description": {+ "type": "string"+ },+ "id": {+ "type": "string"+ },+ "name": {+ "type": "string"+ },+ "updatedAt": {+ "type": "string"+ }+ }+ },+ "repo.TagSummary": {+ "type": "object",+ "properties": {+ "color": {+ "type": "string"+ },+ "createdAt": {+ "type": "string"+ },+ "description": {+ "type": "string"+ },+ "id": {+ "type": "string"+ },+ "name": {+ "type": "string"+ },+ "updatedAt": {+ "type": "string"+ }+ }+ },"repo.TemplateField": {"type": "object","properties": {@@ -5117,7 +5117,7 @@}}},- "repo.TemplateLabelSummary": {+ "repo.TemplateLocationSummary": {"type": "object","properties": {"id": {@@ -5128,7 +5128,7 @@}}},- "repo.TemplateLocationSummary": {+ "repo.TemplateTagSummary": {"type": "object","properties": {"id": {@@ -5476,12 +5476,6 @@"type": "string","maxLength": 1000},- "labelIds": {- "type": "array",- "items": {- "type": "string"- }- },"locationId": {"type": "string"},@@ -5492,6 +5486,12 @@},"quantity": {"type": "integer"+ },+ "tagIds": {+ "type": "array",+ "items": {+ "type": "string"+ }}}},@@ -5545,14 +5545,14 @@"v1.WipeInventoryOptions": {"type": "object","properties": {- "wipeLabels": {- "type": "boolean"- },"wipeLocations": {"type": "boolean"},"wipeMaintenance": {"type": "boolean"+ },+ "wipeTags": {+ "type": "boolean"}}},diff --git a/backend/app/api/static/docs/swagger.yaml b/backend/app/api/static/docs/swagger.yamlindex 96c17e8c..f42a9d9e 100644--- a/backend/app/api/static/docs/swagger.yaml+++ b/backend/app/api/static/docs/swagger.yaml@@ -189,11 +189,6 @@ definitions:items:$ref: '#/definitions/ent.Item'type: array- labels:- description: Labels holds the value of the labels edge.- items:- $ref: '#/definitions/ent.Label'- type: arraylocations:description: Locations holds the value of the locations edge.items:@@ -204,6 +199,11 @@ definitions:items:$ref: '#/definitions/ent.Notifier'type: array+ tags:+ description: Tags holds the value of the tags edge.+ items:+ $ref: '#/definitions/ent.Tag'+ type: arrayusers:description: Users holds the value of the users edge.items:@@ -352,11 +352,6 @@ definitions:allOf:- $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: arraylocation:allOf:- $ref: '#/definitions/ent.Location'@@ -371,6 +366,11 @@ definitions:allOf:- $ref: '#/definitions/ent.Item'description: Parent holds the value of the parent edge.+ tag:+ description: Tag holds the value of the tag edge.+ items:+ $ref: '#/definitions/ent.Tag'+ type: arraytype: objectent.ItemField:properties:@@ -430,11 +430,6 @@ definitions:default_insured:description: DefaultInsured holds the value of the "default_insured" field.type: boolean- default_label_ids:- description: Default label IDs for items created from this template- items:- type: string- type: arraydefault_lifetime_warranty:description: DefaultLifetimeWarranty holds the value of the "default_lifetime_warranty"field.@@ -452,6 +447,11 @@ definitions:default_quantity:description: DefaultQuantity holds the value of the "default_quantity" field.type: integer+ default_tag_ids:+ description: Default tag IDs for items created from this template+ items:+ type: string+ type: arraydefault_warranty_details:description: DefaultWarrantyDetails holds the value of the "default_warranty_details"field.@@ -505,45 +505,6 @@ definitions:- $ref: '#/definitions/ent.Location'description: Location holds the value of the location 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:- allOf:- - $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:- 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- type: objectent.Location:properties:created_at:@@ -673,6 +634,45 @@ definitions:- $ref: '#/definitions/ent.User'description: User holds the value of the user edge.type: object+ ent.Tag:+ 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.TagEdges'+ description: |-+ Edges holds the relations/edges for other nodes in the graph.+ The values are being populated by the TagQuery 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.TagEdges:+ 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.+ items:+ $ref: '#/definitions/ent.Item'+ type: array+ type: objectent.TemplateField:properties:created_at:@@ -849,10 +849,10 @@ definitions:type: numbertotalItems:type: integer- totalLabels:- type: integertotalLocations:type: integer+ totalTags:+ type: integertotalUsers:type: integertotalWithWarranty:@@ -900,10 +900,6 @@ definitions:description:maxLength: 1000type: string- labelIds:- items:- type: string- type: arraylocationId:description: Edgestype: string@@ -916,6 +912,10 @@ definitions:x-nullable: truequantity:type: integer+ tagIds:+ items:+ type: string+ type: arrayrequired:- nametype: object@@ -961,10 +961,6 @@ definitions:x-omitempty: trueinsured:type: boolean- labels:- items:- $ref: '#/definitions/repo.LabelSummary'- type: arraylifetimeWarranty:description: Warrantytype: boolean@@ -1010,6 +1006,10 @@ definitions:type: stringsyncChildItemsLocations:type: boolean+ tags:+ items:+ $ref: '#/definitions/repo.TagSummary'+ type: arraythumbnailId:type: stringx-nullable: true@@ -1025,12 +1025,6 @@ definitions:properties:id:type: string- labelIds:- items:- type: string- type: array- x-nullable: true- x-omitempty: truelocationId:type: stringx-nullable: true@@ -1039,6 +1033,12 @@ definitions:type: integerx-nullable: truex-omitempty: true+ tagIds:+ items:+ type: string+ type: array+ x-nullable: true+ x-omitempty: truetype: objectrepo.ItemPath:properties:@@ -1068,10 +1068,6 @@ definitions:x-omitempty: trueinsured:type: boolean- labels:- items:- $ref: '#/definitions/repo.LabelSummary'- type: arraylocation:allOf:- $ref: '#/definitions/repo.LocationSummary'@@ -1087,6 +1083,10 @@ definitions:soldTime:description: Sale detailstype: string+ tags:+ items:+ $ref: '#/definitions/repo.TagSummary'+ type: arraythumbnailId:type: stringx-nullable: true@@ -1102,15 +1102,10 @@ definitions:x-nullable: truedefaultInsured:type: boolean- defaultLabelIds:- items:- type: string- type: array- x-nullable: truedefaultLifetimeWarranty:type: booleandefaultLocationId:- description: Default location and labels+ description: Default location and tagstype: stringx-nullable: truedefaultManufacturer:@@ -1129,6 +1124,11 @@ definitions:description: Default values for itemstype: integerx-nullable: true+ defaultTagIds:+ items:+ type: string+ type: array+ x-nullable: truedefaultWarrantyDetails:maxLength: 1000type: string@@ -1166,16 +1166,12 @@ definitions:type: stringdefaultInsured:type: boolean- defaultLabels:- items:- $ref: '#/definitions/repo.TemplateLabelSummary'- type: arraydefaultLifetimeWarranty:type: booleandefaultLocation:allOf:- $ref: '#/definitions/repo.TemplateLocationSummary'- description: Default location and labels+ description: Default location and tagsdefaultManufacturer:type: stringdefaultModelNumber:@@ -1185,6 +1181,10 @@ definitions:defaultQuantity:description: Default values for itemstype: integer+ defaultTags:+ items:+ $ref: '#/definitions/repo.TemplateTagSummary'+ type: arraydefaultWarrantyDetails:type: stringdescription:@@ -1231,15 +1231,10 @@ definitions:x-nullable: truedefaultInsured:type: boolean- defaultLabelIds:- items:- type: string- type: array- x-nullable: truedefaultLifetimeWarranty:type: booleandefaultLocationId:- description: Default location and labels+ description: Default location and tagstype: stringx-nullable: truedefaultManufacturer:@@ -1258,6 +1253,11 @@ definitions:description: Default values for itemstype: integerx-nullable: true+ defaultTagIds:+ items:+ type: string+ type: array+ x-nullable: truedefaultWarrantyDetails:maxLength: 1000type: string@@ -1314,10 +1314,6 @@ definitions:type: stringinsured:type: boolean- labelIds:- items:- type: string- type: arraylifetimeWarranty:description: Warrantytype: boolean@@ -1368,6 +1364,10 @@ definitions:type: stringsyncChildItemsLocations:type: boolean+ tagIds:+ items:+ type: string+ type: arraywarrantyDetails:type: stringwarrantyExpires:@@ -1375,50 +1375,6 @@ definitions:required:- nametype: object- repo.LabelCreate:- properties:- color:- type: string- description:- maxLength: 1000- type: string- name:- maxLength: 255- minLength: 1- type: string- required:- - name- type: object- repo.LabelOut:- properties:- color:- type: string- createdAt:- type: string- description:- type: string- id:- type: string- name:- type: string- updatedAt:- type: string- type: object- repo.LabelSummary:- properties:- color:- type: string- createdAt:- type: string- description:- type: string- id:- type: string- name:- type: string- updatedAt:- type: string- type: objectrepo.LocationCreate:properties:description:@@ -1626,6 +1582,50 @@ definitions:total:type: integertype: object+ repo.TagCreate:+ properties:+ color:+ type: string+ description:+ maxLength: 1000+ type: string+ name:+ maxLength: 255+ minLength: 1+ type: string+ required:+ - name+ type: object+ repo.TagOut:+ properties:+ color:+ type: string+ createdAt:+ type: string+ description:+ type: string+ id:+ type: string+ name:+ type: string+ updatedAt:+ type: string+ type: object+ repo.TagSummary:+ properties:+ color:+ type: string+ createdAt:+ type: string+ description:+ type: string+ id:+ type: string+ name:+ type: string+ updatedAt:+ type: string+ type: objectrepo.TemplateField:properties:id:@@ -1637,14 +1637,14 @@ definitions:type:type: stringtype: object- repo.TemplateLabelSummary:+ repo.TemplateLocationSummary:properties:id:type: stringname:type: stringtype: object- repo.TemplateLocationSummary:+ repo.TemplateTagSummary:properties:id:type: string@@ -1869,10 +1869,6 @@ definitions:description:maxLength: 1000type: string- labelIds:- items:- type: string- type: arraylocationId:type: stringname:@@ -1881,6 +1877,10 @@ definitions:type: stringquantity:type: integer+ tagIds:+ items:+ type: string+ type: arrayrequired:- locationId- name@@ -1918,12 +1918,12 @@ definitions:type: objectv1.WipeInventoryOptions:properties:- wipeLabels:- type: booleanwipeLocations:type: booleanwipeMaintenance:type: boolean+ wipeTags:+ type: booleantype: objectv1.Wrapped:properties:@@ -2293,22 +2293,6 @@ paths:summary: Get Group Statisticstags:- Statistics- /v1/groups/statistics/labels:- get:- produces:- - application/json- responses:- "200":- description: OK- schema:- items:- $ref: '#/definitions/repo.TotalsByOrganizer'- type: array- security:- - Bearer: []- summary: Get Label Statistics- tags:- - Statistics/v1/groups/statistics/locations:get:produces:@@ -2348,6 +2332,22 @@ paths:summary: Get Purchase Price Statisticstags:- Statistics+ /v1/groups/statistics/tags:+ get:+ produces:+ - application/json+ responses:+ "200":+ description: OK+ schema:+ items:+ $ref: '#/definitions/repo.TotalsByOrganizer'+ type: array+ security:+ - Bearer: []+ summary: Get Tags Statistics+ tags:+ - Statistics/v1/items:get:parameters:@@ -2364,11 +2364,11 @@ paths:name: pageSizetype: integer- collectionFormat: multi- description: label Ids+ description: tags Idsin: queryitems:type: string- name: labels+ name: tagstype: array- collectionFormat: multidescription: location Ids@@ -2862,98 +2862,6 @@ paths:summary: Get Location labeltags:- Locations- /v1/labels:- get:- produces:- - application/json- responses:- "200":- description: OK- schema:- items:- $ref: '#/definitions/repo.LabelOut'- type: array- security:- - Bearer: []- summary: Get All Labels- tags:- - Labels- post:- parameters:- - description: Label Data- in: body- name: payload- required: true- schema:- $ref: '#/definitions/repo.LabelCreate'- produces:- - application/json- responses:- "200":- description: OK- schema:- $ref: '#/definitions/repo.LabelSummary'- security:- - Bearer: []- summary: Create Label- tags:- - Labels- /v1/labels/{id}:- delete:- parameters:- - description: Label ID- in: path- name: id- required: true- type: string- produces:- - application/json- responses:- "204":- description: No Content- security:- - Bearer: []- summary: Delete Label- tags:- - Labels- get:- parameters:- - description: Label ID- in: path- name: id- required: true- type: string- produces:- - application/json- responses:- "200":- description: OK- schema:- $ref: '#/definitions/repo.LabelOut'- security:- - Bearer: []- summary: Get Label- tags:- - Labels- put:- parameters:- - description: Label ID- in: path- name: id- required: true- type: string- produces:- - application/json- responses:- "200":- description: OK- schema:- $ref: '#/definitions/repo.LabelOut'- security:- - Bearer: []- summary: Update Label- tags:- - Labels/v1/locations:get:parameters:@@ -3308,6 +3216,98 @@ paths:summary: Application Infotags:- Base+ /v1/tags:+ get:+ produces:+ - application/json+ responses:+ "200":+ description: OK+ schema:+ items:+ $ref: '#/definitions/repo.TagOut'+ type: array+ security:+ - Bearer: []+ summary: Get All Tags+ tags:+ - Tags+ post:+ parameters:+ - description: Tag Data+ in: body+ name: payload+ required: true+ schema:+ $ref: '#/definitions/repo.TagCreate'+ produces:+ - application/json+ responses:+ "200":+ description: OK+ schema:+ $ref: '#/definitions/repo.TagSummary'+ security:+ - Bearer: []+ summary: Create Tag+ tags:+ - Tags+ /v1/tags/{id}:+ delete:+ parameters:+ - description: Tag ID+ in: path+ name: id+ required: true+ type: string+ produces:+ - application/json+ responses:+ "204":+ description: No Content+ security:+ - Bearer: []+ summary: Delete Tag+ tags:+ - Tags+ get:+ parameters:+ - description: Tag ID+ in: path+ name: id+ required: true+ type: string+ produces:+ - application/json+ responses:+ "200":+ description: OK+ schema:+ $ref: '#/definitions/repo.TagOut'+ security:+ - Bearer: []+ summary: Get Tag+ tags:+ - Tags+ put:+ parameters:+ - description: Tag ID+ in: path+ name: id+ required: true+ type: string+ produces:+ - application/json+ responses:+ "200":+ description: OK+ schema:+ $ref: '#/definitions/repo.TagOut'+ security:+ - Bearer: []+ summary: Update Tag+ tags:+ - Tags/v1/templates:get:produces:diff --git a/backend/go.sum b/backend/go.sumindex 0d766402..6f11d8f1 100644--- a/backend/go.sum+++ b/backend/go.sum@@ -325,8 +325,6 @@ github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/github.com/mattn/go-isatty v0.0.19/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY=github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=-github.com/mattn/go-runewidth v0.0.9 h1:Lm995f3rfxdpd6TSmuVCHVb/QhupuXlYr8sCI/QdE+0=-github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI=github.com/mattn/go-sqlite3 v1.14.32 h1:JD12Ag3oLy1zQA+BNn74xRgaBbdhbNIDYvQUEuuErjs=github.com/mattn/go-sqlite3 v1.14.32/go.mod h1:Uh1q+B4BYcTPb+yiD3kU8Ct7aC0hY9fxUwlHK0RXw+Y=github.com/mfridman/interpolate v0.0.2 h1:pnuTK7MQIxxFz1Gr+rjSIx9u7qVjf5VOoM/u6BbAxPY=@@ -349,8 +347,6 @@ github.com/ncruces/go-strftime v1.0.0 h1:HMFp8mLCTPp341M/ZnA4qaf7ZlsbTc+miZjCLOFgithub.com/ncruces/go-strftime v1.0.0/go.mod h1:Fwc5htZGVVkseilnfgOVb9mKy6w1naJmn9CehxcKcls=github.com/olahol/melody v1.4.0 h1:Pa5SdeZL/zXPi1tJuMAPDbl4n3gQOThSL6G1p4qZ4SI=github.com/olahol/melody v1.4.0/go.mod h1:GgkTl6Y7yWj/HtfD48Q5vLKPVoZOH+Qqgfa7CvJgJM4=-github.com/olekukonko/tablewriter v0.0.5 h1:P2Ga83D34wi1o9J6Wh1mRuqd4mF/x/lgBS7N7AbDhec=-github.com/olekukonko/tablewriter v0.0.5/go.mod h1:hPp6KlRPjbx+hW8ykQs1w3UBbZlj6HuIJcUGPhkA7kY=github.com/onsi/ginkgo/v2 v2.9.2 h1:BA2GMJOtfGAfagzYtrAlufIP0lq6QERkFmHLMLPwFSU=github.com/onsi/ginkgo/v2 v2.9.2/go.mod h1:WHcJJG2dIlcCqVfBAwUCrJxSPFb6v4azBwgxeMeDuts=github.com/onsi/gomega v1.27.6 h1:ENqfyGeS5AX/rlXDd/ETokDz93u0YufY1Pgxuy/PvWE=@@ -393,10 +389,6 @@ github.com/shirou/gopsutil/v4 v4.25.11 h1:X53gB7muL9Gnwwo2evPSE+SfOrltMoR6V3xJAXgithub.com/shirou/gopsutil/v4 v4.25.11/go.mod h1:EivAfP5x2EhLp2ovdpKSozecVXn1TmuG7SMzs/Wh4PU=github.com/skip2/go-qrcode v0.0.0-20200617195104-da1b6568686e h1:MRM5ITcdelLK2j1vwZ3Je0FKVCfqOLp5zO6trqMLYs0=github.com/skip2/go-qrcode v0.0.0-20200617195104-da1b6568686e/go.mod h1:XV66xRDqSt+GTGFMVlhk3ULuV0y9ZmzeVGR4mloJI3M=-github.com/spf13/cobra v1.7.0 h1:hyqWnYt1ZQShIddO5kBpj3vu05/++x6tJ6dg8EC572I=-github.com/spf13/cobra v1.7.0/go.mod h1:uLxZILRyS/50WlhOIKD7W6V5bgeIt+4sICxh6uRMrb0=-github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=-github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=github.com/spiffe/go-spiffe/v2 v2.6.0 h1:l+DolpxNWYgruGQVV0xsfeya3CsC7m8iBzDnMpsbLuo=github.com/spiffe/go-spiffe/v2 v2.6.0/go.mod h1:gm2SeUoMZEtpnzPNs2Csc0D/gX33k1xIx7lEzqblHEs=github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=diff --git a/backend/internal/core/services/reporting/.testdata/import/types.csv b/backend/internal/core/services/reporting/.testdata/import/types.csvindex 96ff236c..0bc104f5 100644--- a/backend/internal/core/services/reporting/.testdata/import/types.csv+++ b/backend/internal/core/services/reporting/.testdata/import/types.csv@@ -1,4 +1,4 @@-HB.name,HB.asset_id,HB.location,HB.labels+HB.name,HB.asset_id,HB.location,HB.tagsItem 1,1,Path / To / Location 1,L1 ; L2 ; L3Item 2,000-002,Path /To/ Location 2,L1;L2;L3Item 3,1000-003,Path / To /Location 3 , L1;L2; L3\ No newline at end of filediff --git a/backend/internal/core/services/reporting/eventbus/eventbus.go b/backend/internal/core/services/reporting/eventbus/eventbus.goindex 581bc38b..7fc4bfac 100644--- a/backend/internal/core/services/reporting/eventbus/eventbus.go+++ b/backend/internal/core/services/reporting/eventbus/eventbus.go@@ -11,7 +11,7 @@ import (type Event stringconst (- EventLabelMutation Event = "label.mutation"+ EventTagMutation Event = "tags.mutation"EventLocationMutation Event = "location.mutation"EventItemMutation Event = "item.mutation")@@ -37,7 +37,7 @@ func New() *EventBus {return &EventBus{ch: make(chan eventData, 100),subscribers: map[Event][]func(any){- EventLabelMutation: {},+ EventTagMutation: {},EventLocationMutation: {},EventItemMutation: {},},diff --git a/backend/internal/core/services/reporting/io_row.go b/backend/internal/core/services/reporting/io_row.goindex 1e3415b4..51897a04 100644--- a/backend/internal/core/services/reporting/io_row.go+++ b/backend/internal/core/services/reporting/io_row.go@@ -15,7 +15,7 @@ type ExportItemFields struct {type ExportCSVRow struct {ImportRef string `csv:"HB.import_ref"`Location LocationString `csv:"HB.location"`- LabelStr LabelString `csv:"HB.labels"`+ TagStr TagString `csv:"HB.tags|HB.labels"`AssetID repo.AssetID `csv:"HB.asset_id"`Archived bool `csv:"HB.archived"`URL string `csv:"HB.url"`@@ -48,20 +48,20 @@ type ExportCSVRow struct {// ============================================================================-// LabelString is a string slice that is used to represent a list of labels.+// TagString is a string slice that is used to represent a list of tags.//-// For example, a list of labels "Important; Work" would be represented as a-// LabelString with the following values:+// For example, a list of tags "Important; Work" would be represented as a+// TagString with the following values://-// LabelString{"Important", "Work"}-type LabelString []string+// TagString{"Important", "Work"}+type TagString []string-func parseLabelString(s string) LabelString {+func parseTagString(s string) TagString {v, _ := parseSeparatedString(s, ";")return v}-func (ls LabelString) String() string {+func (ls TagString) String() string {return strings.Join(ls, "; ")}diff --git a/backend/internal/core/services/reporting/io_sheet.go b/backend/internal/core/services/reporting/io_sheet.goindex 1db37bc6..0f364278 100644--- a/backend/internal/core/services/reporting/io_sheet.go+++ b/backend/internal/core/services/reporting/io_sheet.go@@ -41,6 +41,54 @@ func (s *IOSheet) indexHeaders() {}}+// primaryCSVTag returns the primary header name from a csv struct tag which+// may contain alternatives separated by '|'. For example: "HB.tags|HB.labels"+// will return "HB.tags".+func primaryCSVTag(tag string) string {+ if tag == "" {+ return ""+ }+ if i := strings.Index(tag, "|"); i >= 0 {+ return strings.TrimSpace(tag[:i])+ }+ return tag+}++// csvTagAlternatives splits a tag with alternatives separated by '|'.+func csvTagAlternatives(tag string) []string {+ if tag == "" {+ return nil+ }+ parts := strings.Split(tag, "|")+ for i := range parts {+ parts[i] = strings.TrimSpace(parts[i])+ }+ return parts+}++// findColumnForTag tries to find a column index for a csv tag. The tag may+// contain multiple alternatives separated by '|'. It will return the first+// matching column index it finds.+func (s *IOSheet) findColumnForTag(tag string) (int, bool) {+ if s.index == nil {+ s.indexHeaders()+ }++ // Try primary tag first and then alternatives.+ alts := csvTagAlternatives(tag)+ if len(alts) == 0 {+ return s.GetColumn(tag)+ }++ for _, t := range alts {+ if col, ok := s.GetColumn(t); ok {+ return col, true+ }+ }++ return 0, false+}+func (s *IOSheet) GetColumn(str string) (col int, ok bool) {if s.index == nil {s.indexHeaders()@@ -88,7 +136,7 @@ func (s *IOSheet) Read(data io.Reader) error {continue}- col, ok := s.GetColumn(tag)+ col, ok := s.findColumnForTag(tag)if !ok {continue}@@ -114,8 +162,8 @@ func (s *IOSheet) Read(data io.Reader) error {v, _ = repo.ParseAssetID(val)case reflect.TypeOf(LocationString{}):v = parseLocationString(val)- case reflect.TypeOf(LabelString{}):- v = parseLabelString(val)+ case reflect.TypeOf(TagString{}):+ v = parseTagString(val)}log.Debug().@@ -172,10 +220,10 @@ func (s *IOSheet) ReadItems(ctx context.Context, items []repo.ItemOut, gid uuid.locString := fromPathSlice(locPaths)- labelString := make([]string, len(item.Labels))+ tagString := make([]string, len(item.Tags))- for i, l := range item.Labels {- labelString[i] = l.Name+ for i, l := range item.Tags {+ tagString[i] = l.Name}url := generateItemURL(item, hbURL)@@ -194,7 +242,7 @@ func (s *IOSheet) ReadItems(ctx context.Context, items []repo.ItemOut, gid uuid.s.Rows[i] = ExportCSVRow{// fill structLocation: locString,- LabelStr: labelString,+ TagStr: tagString,ImportRef: item.ImportRef,AssetID: item.AssetID,@@ -238,7 +286,7 @@ func (s *IOSheet) ReadItems(ctx context.Context, items []repo.ItemOut, gid uuid.st := reflect.TypeOf(ExportCSVRow{})- // Write headers+ // Write headers (use the primary tag when alternatives are provided)for i := 0; i < st.NumField(); i++ {field := st.Field(i)tag := field.Tag.Get("csv")@@ -246,7 +294,7 @@ func (s *IOSheet) ReadItems(ctx context.Context, items []repo.ItemOut, gid uuid.continue}- s.headers = append(s.headers, tag)+ s.headers = append(s.headers, primaryCSVTag(tag))}for _, h := range customHeaders {@@ -285,7 +333,7 @@ func (s *IOSheet) CSV() ([][]string, error) {continue}- col, ok := s.GetColumn(tag)+ col, ok := s.findColumnForTag(tag)if !ok {continue}@@ -311,8 +359,8 @@ func (s *IOSheet) CSV() ([][]string, error) {v = val.Interface().(repo.AssetID).String()case reflect.TypeOf(LocationString{}):v = val.Interface().(LocationString).String()- case reflect.TypeOf(LabelString{}):- v = val.Interface().(LabelString).String()+ case reflect.TypeOf(TagString{}):+ v = val.Interface().(TagString).String()default:log.Debug().Str("type", field.Type.String()).Msg("unknown type")}diff --git a/backend/internal/core/services/reporting/io_sheet_test.go b/backend/internal/core/services/reporting/io_sheet_test.goindex a489d2f8..cd614a84 100644--- a/backend/internal/core/services/reporting/io_sheet_test.go+++ b/backend/internal/core/services/reporting/io_sheet_test.go@@ -77,19 +77,19 @@ func TestSheet_Read(t *testing.T) {Name: "Item 1",AssetID: repo.AssetID(1),Location: LocationString{"Path", "To", "Location 1"},- LabelStr: LabelString{"L1", "L2", "L3"},+ TagStr: TagString{"L1", "L2", "L3"},},{Name: "Item 2",AssetID: repo.AssetID(2),Location: LocationString{"Path", "To", "Location 2"},- LabelStr: LabelString{"L1", "L2", "L3"},+ TagStr: TagString{"L1", "L2", "L3"},},{Name: "Item 3",AssetID: repo.AssetID(1000003),Location: LocationString{"Path", "To", "Location 3"},- LabelStr: LabelString{"L1", "L2", "L3"},+ TagStr: TagString{"L1", "L2", "L3"},},},},diff --git a/backend/internal/core/services/service_items.go b/backend/internal/core/services/service_items.goindex 95bb0fb7..251a0e59 100644--- a/backend/internal/core/services/service_items.go+++ b/backend/internal/core/services/service_items.go@@ -99,7 +99,7 @@ func serializeLocation[T ~[]string](location T) string {//// 1. If the item does not exist, it is created.// 2. If the item has a ImportRef and it exists it is skipped-// 3. Locations and Labels are created if they do not exist.+// 3. Locations and Tags are created if they do not exist.func (svc *ItemService) CsvImport(ctx context.Context, gid uuid.UUID, data io.Reader) (int, error) {sheet := reporting.IOSheet{}@@ -109,17 +109,17 @@ func (svc *ItemService) CsvImport(ctx context.Context, gid uuid.UUID, data io.Re}// ========================================- // Labels+ // Tags- labelMap := make(map[string]uuid.UUID)+ tagMap := make(map[string]uuid.UUID){- labels, err := svc.repo.Labels.GetAll(ctx, gid)+ tags, err := svc.repo.Tags.GetAll(ctx, gid)if err != nil {return 0, err}- for _, label := range labels {- labelMap[label.Name] = label.ID+ for _, tag := range tags {+ tagMap[tag.Name] = tag.ID}}@@ -184,23 +184,23 @@ func (svc *ItemService) CsvImport(ctx context.Context, gid uuid.UUID, data io.Re}// ========================================- // Pre-Create Labels as necessary- labelIds := make([]uuid.UUID, len(row.LabelStr))+ // Pre-Create tags as necessary+ tagIds := make([]uuid.UUID, len(row.TagStr))- for j := range row.LabelStr {- label := row.LabelStr[j]+ for j := range row.TagStr {+ tag := row.TagStr[j]- id, ok := labelMap[label]+ id, ok := tagMap[tag]if !ok {- newLabel, err := svc.repo.Labels.Create(ctx, gid, repo.LabelCreate{Name: label})+ newTag, err := svc.repo.Tags.Create(ctx, gid, repo.TagCreate{Name: tag})if err != nil {return 0, err}- id = newLabel.ID+ id = newTag.ID}- labelIds[j] = id- labelMap[label] = id+ tagIds[j] = id+ tagMap[tag] = id}// ========================================@@ -262,7 +262,7 @@ func (svc *ItemService) CsvImport(ctx context.Context, gid uuid.UUID, data io.ReDescription: row.Description,AssetID: effAID,LocationID: locationID,- LabelIDs: labelIds,+ TagIDs: tagIds,}item, err = svc.repo.Items.Create(ctx, gid, newItem)@@ -291,7 +291,7 @@ func (svc *ItemService) CsvImport(ctx context.Context, gid uuid.UUID, data io.ReupdateItem := repo.ItemUpdate{ID: item.ID,- LabelIDs: labelIds,+ TagIDs: tagIds,LocationID: locationID,Name: row.Name,diff --git a/backend/internal/core/services/service_user.go b/backend/internal/core/services/service_user.goindex e63adb90..8d37d6c3 100644--- a/backend/internal/core/services/service_user.go+++ b/backend/internal/core/services/service_user.go@@ -44,7 +44,7 @@ type ()// RegisterUser creates a new user and group in the data with the provided data. It also bootstraps the user's group-// with default Labels and Locations.+// with default Tags and Locations.func (svc *UserService) RegisterUser(ctx context.Context, data UserRegistration) (repo.UserOut, error) {log.Debug().Str("name", data.Name).@@ -108,11 +108,11 @@ func (svc *UserService) RegisterUser(ctx context.Context, data UserRegistration)}log.Debug().Msg("user created")- // Create the default labels and locations for the group.+ // Create the default tags and locations for the group.if creatingGroup {- log.Debug().Msg("creating default labels")- for _, label := range defaultLabels() {- _, err := svc.repos.Labels.Create(ctx, usr.DefaultGroupID, label)+ log.Debug().Msg("creating default tags")+ for _, tag := range defaultTags() {+ _, err := svc.repos.Tags.Create(ctx, usr.DefaultGroupID, tag)if err != nil {return repo.UserOut{}, err}@@ -313,11 +313,11 @@ func (svc *UserService) registerOIDCUser(ctx context.Context, issuer, subject, ereturn repo.UserOut{}, err}- log.Debug().Str("issuer", issuer).Str("subject", subject).Msg("creating default labels for OIDC user")- for _, label := range defaultLabels() {- _, err := svc.repos.Labels.Create(ctx, group.ID, label)+ log.Debug().Str("issuer", issuer).Str("subject", subject).Msg("creating default tags for OIDC user")+ for _, tag := range defaultTags() {+ _, err := svc.repos.Tags.Create(ctx, group.ID, tag)if err != nil {- log.Err(err).Msg("Failed to create default label")+ log.Err(err).Msg("Failed to create default tag")}}diff --git a/backend/internal/core/services/service_user_defaults.go b/backend/internal/core/services/service_user_defaults.goindex 62a429dc..e3ca2026 100644--- a/backend/internal/core/services/service_user_defaults.go+++ b/backend/internal/core/services/service_user_defaults.go@@ -33,8 +33,8 @@ func defaultLocations() []repo.LocationCreate {}}-func defaultLabels() []repo.LabelCreate {- return []repo.LabelCreate{+func defaultTags() []repo.TagCreate {+ return []repo.TagCreate{{Name: "Appliances",},diff --git a/backend/internal/data/ent/client.go b/backend/internal/data/ent/client.goindex 5ecd1927..8774b2a0 100644--- a/backend/internal/data/ent/client.go+++ b/backend/internal/data/ent/client.go@@ -24,10 +24,10 @@ import ("github.com/sysadminsmedia/homebox/backend/internal/data/ent/item""github.com/sysadminsmedia/homebox/backend/internal/data/ent/itemfield""github.com/sysadminsmedia/homebox/backend/internal/data/ent/itemtemplate"- "github.com/sysadminsmedia/homebox/backend/internal/data/ent/label""github.com/sysadminsmedia/homebox/backend/internal/data/ent/location""github.com/sysadminsmedia/homebox/backend/internal/data/ent/maintenanceentry""github.com/sysadminsmedia/homebox/backend/internal/data/ent/notifier"+ "github.com/sysadminsmedia/homebox/backend/internal/data/ent/tag""github.com/sysadminsmedia/homebox/backend/internal/data/ent/templatefield""github.com/sysadminsmedia/homebox/backend/internal/data/ent/user")@@ -53,14 +53,14 @@ type Client struct {ItemField *ItemFieldClient// ItemTemplate is the client for interacting with the ItemTemplate builders.ItemTemplate *ItemTemplateClient- // Label is the client for interacting with the Label builders.- Label *LabelClient// Location is the client for interacting with the Location builders.Location *LocationClient// MaintenanceEntry is the client for interacting with the MaintenanceEntry builders.MaintenanceEntry *MaintenanceEntryClient// Notifier is the client for interacting with the Notifier builders.Notifier *NotifierClient+ // Tag is the client for interacting with the Tag builders.+ Tag *TagClient// TemplateField is the client for interacting with the TemplateField builders.TemplateField *TemplateFieldClient// User is the client for interacting with the User builders.@@ -84,10 +84,10 @@ func (c *Client) init() {c.Item = NewItemClient(c.config)c.ItemField = NewItemFieldClient(c.config)c.ItemTemplate = NewItemTemplateClient(c.config)- c.Label = NewLabelClient(c.config)c.Location = NewLocationClient(c.config)c.MaintenanceEntry = NewMaintenanceEntryClient(c.config)c.Notifier = NewNotifierClient(c.config)+ c.Tag = NewTagClient(c.config)c.TemplateField = NewTemplateFieldClient(c.config)c.User = NewUserClient(c.config)}@@ -190,10 +190,10 @@ func (c *Client) Tx(ctx context.Context) (*Tx, error) {Item: NewItemClient(cfg),ItemField: NewItemFieldClient(cfg),ItemTemplate: NewItemTemplateClient(cfg),- Label: NewLabelClient(cfg),Location: NewLocationClient(cfg),MaintenanceEntry: NewMaintenanceEntryClient(cfg),Notifier: NewNotifierClient(cfg),+ Tag: NewTagClient(cfg),TemplateField: NewTemplateFieldClient(cfg),User: NewUserClient(cfg),}, nil@@ -223,10 +223,10 @@ func (c *Client) BeginTx(ctx context.Context, opts *sql.TxOptions) (*Tx, error)Item: NewItemClient(cfg),ItemField: NewItemFieldClient(cfg),ItemTemplate: NewItemTemplateClient(cfg),- Label: NewLabelClient(cfg),Location: NewLocationClient(cfg),MaintenanceEntry: NewMaintenanceEntryClient(cfg),Notifier: NewNotifierClient(cfg),+ Tag: NewTagClient(cfg),TemplateField: NewTemplateFieldClient(cfg),User: NewUserClient(cfg),}, nil@@ -259,8 +259,8 @@ func (c *Client) Close() error {func (c *Client) Use(hooks ...Hook) {for _, n := range []interface{ Use(...Hook) }{c.Attachment, c.AuthRoles, c.AuthTokens, c.Group, c.GroupInvitationToken,- c.Item, c.ItemField, c.ItemTemplate, c.Label, c.Location, c.MaintenanceEntry,- c.Notifier, c.TemplateField, c.User,+ c.Item, c.ItemField, c.ItemTemplate, c.Location, c.MaintenanceEntry,+ c.Notifier, c.Tag, c.TemplateField, c.User,} {n.Use(hooks...)}@@ -271,8 +271,8 @@ func (c *Client) Use(hooks ...Hook) {func (c *Client) Intercept(interceptors ...Interceptor) {for _, n := range []interface{ Intercept(...Interceptor) }{c.Attachment, c.AuthRoles, c.AuthTokens, c.Group, c.GroupInvitationToken,- c.Item, c.ItemField, c.ItemTemplate, c.Label, c.Location, c.MaintenanceEntry,- c.Notifier, c.TemplateField, c.User,+ c.Item, c.ItemField, c.ItemTemplate, c.Location, c.MaintenanceEntry,+ c.Notifier, c.Tag, c.TemplateField, c.User,} {n.Intercept(interceptors...)}@@ -297,14 +297,14 @@ func (c *Client) Mutate(ctx context.Context, m Mutation) (Value, error) {return c.ItemField.mutate(ctx, m)case *ItemTemplateMutation:return c.ItemTemplate.mutate(ctx, m)- case *LabelMutation:- return c.Label.mutate(ctx, m)case *LocationMutation:return c.Location.mutate(ctx, m)case *MaintenanceEntryMutation:return c.MaintenanceEntry.mutate(ctx, m)case *NotifierMutation:return c.Notifier.mutate(ctx, m)+ case *TagMutation:+ return c.Tag.mutate(ctx, m)case *TemplateFieldMutation:return c.TemplateField.mutate(ctx, m)case *UserMutation:@@ -949,15 +949,15 @@ func (c *GroupClient) QueryItems(_m *Group) *ItemQuery {return query}-// QueryLabels queries the labels edge of a Group.-func (c *GroupClient) QueryLabels(_m *Group) *LabelQuery {- query := (&LabelClient{config: c.config}).Query()+// QueryTags queries the tags edge of a Group.+func (c *GroupClient) QueryTags(_m *Group) *TagQuery {+ query := (&TagClient{config: c.config}).Query()query.path = func(context.Context) (fromV *sql.Selector, _ error) {id := _m.IDstep := sqlgraph.NewStep(sqlgraph.From(group.Table, group.FieldID, id),- sqlgraph.To(label.Table, label.FieldID),- sqlgraph.Edge(sqlgraph.O2M, false, group.LabelsTable, group.LabelsColumn),+ sqlgraph.To(tag.Table, tag.FieldID),+ sqlgraph.Edge(sqlgraph.O2M, false, group.TagsTable, group.TagsColumn),)fromV = sqlgraph.Neighbors(_m.driver.Dialect(), step)return fromV, nil@@ -1343,15 +1343,15 @@ func (c *ItemClient) QueryChildren(_m *Item) *ItemQuery {return query}-// QueryLabel queries the label edge of a Item.-func (c *ItemClient) QueryLabel(_m *Item) *LabelQuery {- query := (&LabelClient{config: c.config}).Query()+// QueryTag queries the tag edge of a Item.+func (c *ItemClient) QueryTag(_m *Item) *TagQuery {+ query := (&TagClient{config: c.config}).Query()query.path = func(context.Context) (fromV *sql.Selector, _ error) {id := _m.IDstep := sqlgraph.NewStep(sqlgraph.From(item.Table, item.FieldID, id),- sqlgraph.To(label.Table, label.FieldID),- sqlgraph.Edge(sqlgraph.M2M, true, item.LabelTable, item.LabelPrimaryKey...),+ sqlgraph.To(tag.Table, tag.FieldID),+ sqlgraph.Edge(sqlgraph.M2M, true, item.TagTable, item.TagPrimaryKey...),)fromV = sqlgraph.Neighbors(_m.driver.Dialect(), step)return fromV, nil@@ -1778,171 +1778,6 @@ func (c *ItemTemplateClient) mutate(ctx context.Context, m *ItemTemplateMutation}}-// LabelClient is a client for the Label schema.-type LabelClient struct {- config-}--// NewLabelClient returns a client for the Label from the given config.-func NewLabelClient(c config) *LabelClient {- return &LabelClient{config: c}-}--// Use adds a list of mutation hooks to the hooks stack.-// A call to `Use(f, g, h)` equals to `label.Hooks(f(g(h())))`.-func (c *LabelClient) Use(hooks ...Hook) {- c.hooks.Label = append(c.hooks.Label, hooks...)-}--// Intercept adds a list of query interceptors to the interceptors stack.-// A call to `Intercept(f, g, h)` equals to `label.Intercept(f(g(h())))`.-func (c *LabelClient) Intercept(interceptors ...Interceptor) {- c.inters.Label = append(c.inters.Label, interceptors...)-}--// Create returns a builder for creating a Label entity.-func (c *LabelClient) Create() *LabelCreate {- mutation := newLabelMutation(c.config, OpCreate)- return &LabelCreate{config: c.config, hooks: c.Hooks(), mutation: mutation}-}--// CreateBulk returns a builder for creating a bulk of Label entities.-func (c *LabelClient) CreateBulk(builders ...*LabelCreate) *LabelCreateBulk {- return &LabelCreateBulk{config: c.config, builders: builders}-}--// MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates-// a builder and applies setFunc on it.-func (c *LabelClient) MapCreateBulk(slice any, setFunc func(*LabelCreate, int)) *LabelCreateBulk {- rv := reflect.ValueOf(slice)- if rv.Kind() != reflect.Slice {- return &LabelCreateBulk{err: fmt.Errorf("calling to LabelClient.MapCreateBulk with wrong type %T, need slice", slice)}- }- builders := make([]*LabelCreate, rv.Len())- for i := 0; i < rv.Len(); i++ {- builders[i] = c.Create()- setFunc(builders[i], i)- }- return &LabelCreateBulk{config: c.config, builders: builders}-}--// Update returns an update builder for Label.-func (c *LabelClient) Update() *LabelUpdate {- mutation := newLabelMutation(c.config, OpUpdate)- return &LabelUpdate{config: c.config, hooks: c.Hooks(), mutation: mutation}-}--// UpdateOne returns an update builder for the given entity.-func (c *LabelClient) UpdateOne(_m *Label) *LabelUpdateOne {- mutation := newLabelMutation(c.config, OpUpdateOne, withLabel(_m))- return &LabelUpdateOne{config: c.config, hooks: c.Hooks(), mutation: mutation}-}--// UpdateOneID returns an update builder for the given id.-func (c *LabelClient) UpdateOneID(id uuid.UUID) *LabelUpdateOne {- mutation := newLabelMutation(c.config, OpUpdateOne, withLabelID(id))- return &LabelUpdateOne{config: c.config, hooks: c.Hooks(), mutation: mutation}-}--// Delete returns a delete builder for Label.-func (c *LabelClient) Delete() *LabelDelete {- mutation := newLabelMutation(c.config, OpDelete)- return &LabelDelete{config: c.config, hooks: c.Hooks(), mutation: mutation}-}--// DeleteOne returns a builder for deleting the given entity.-func (c *LabelClient) DeleteOne(_m *Label) *LabelDeleteOne {- return c.DeleteOneID(_m.ID)-}--// DeleteOneID returns a builder for deleting the given entity by its id.-func (c *LabelClient) DeleteOneID(id uuid.UUID) *LabelDeleteOne {- builder := c.Delete().Where(label.ID(id))- builder.mutation.id = &id- builder.mutation.op = OpDeleteOne- return &LabelDeleteOne{builder}-}--// Query returns a query builder for Label.-func (c *LabelClient) Query() *LabelQuery {- return &LabelQuery{- config: c.config,- ctx: &QueryContext{Type: TypeLabel},- inters: c.Interceptors(),- }-}--// Get returns a Label entity by its id.-func (c *LabelClient) Get(ctx context.Context, id uuid.UUID) (*Label, error) {- return c.Query().Where(label.ID(id)).Only(ctx)-}--// GetX is like Get, but panics if an error occurs.-func (c *LabelClient) GetX(ctx context.Context, id uuid.UUID) *Label {- obj, err := c.Get(ctx, id)- if err != nil {- panic(err)- }- return obj-}--// QueryGroup queries the group edge of a Label.-func (c *LabelClient) QueryGroup(_m *Label) *GroupQuery {- query := (&GroupClient{config: c.config}).Query()- query.path = func(context.Context) (fromV *sql.Selector, _ error) {- id := _m.ID- step := sqlgraph.NewStep(- sqlgraph.From(label.Table, label.FieldID, id),- sqlgraph.To(group.Table, group.FieldID),- sqlgraph.Edge(sqlgraph.M2O, true, label.GroupTable, label.GroupColumn),- )- fromV = sqlgraph.Neighbors(_m.driver.Dialect(), step)- return fromV, nil- }- return query-}--// QueryItems queries the items edge of a Label.-func (c *LabelClient) QueryItems(_m *Label) *ItemQuery {- query := (&ItemClient{config: c.config}).Query()- query.path = func(context.Context) (fromV *sql.Selector, _ error) {- id := _m.ID- step := sqlgraph.NewStep(- sqlgraph.From(label.Table, label.FieldID, id),- sqlgraph.To(item.Table, item.FieldID),- sqlgraph.Edge(sqlgraph.M2M, false, label.ItemsTable, label.ItemsPrimaryKey...),- )- fromV = sqlgraph.Neighbors(_m.driver.Dialect(), step)- return fromV, nil- }- return query-}--// Hooks returns the client hooks.-func (c *LabelClient) Hooks() []Hook {- return c.hooks.Label-}--// Interceptors returns the client interceptors.-func (c *LabelClient) Interceptors() []Interceptor {- return c.inters.Label-}--func (c *LabelClient) mutate(ctx context.Context, m *LabelMutation) (Value, error) {- switch m.Op() {- case OpCreate:- return (&LabelCreate{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx)- case OpUpdate:- return (&LabelUpdate{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx)- case OpUpdateOne:- return (&LabelUpdateOne{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx)- case OpDelete, OpDeleteOne:- return (&LabelDelete{config: c.config, hooks: c.Hooks(), mutation: m}).Exec(ctx)- default:- return nil, fmt.Errorf("ent: unknown Label mutation op: %q", m.Op())- }-}-// LocationClient is a client for the Location schema.type LocationClient struct {config@@ -2454,6 +2289,171 @@ func (c *NotifierClient) mutate(ctx context.Context, m *NotifierMutation) (Value}}+// TagClient is a client for the Tag schema.+type TagClient struct {+ config+}++// NewTagClient returns a client for the Tag from the given config.+func NewTagClient(c config) *TagClient {+ return &TagClient{config: c}+}++// Use adds a list of mutation hooks to the hooks stack.+// A call to `Use(f, g, h)` equals to `tag.Hooks(f(g(h())))`.+func (c *TagClient) Use(hooks ...Hook) {+ c.hooks.Tag = append(c.hooks.Tag, hooks...)+}++// Intercept adds a list of query interceptors to the interceptors stack.+// A call to `Intercept(f, g, h)` equals to `tag.Intercept(f(g(h())))`.+func (c *TagClient) Intercept(interceptors ...Interceptor) {+ c.inters.Tag = append(c.inters.Tag, interceptors...)+}++// Create returns a builder for creating a Tag entity.+func (c *TagClient) Create() *TagCreate {+ mutation := newTagMutation(c.config, OpCreate)+ return &TagCreate{config: c.config, hooks: c.Hooks(), mutation: mutation}+}++// CreateBulk returns a builder for creating a bulk of Tag entities.+func (c *TagClient) CreateBulk(builders ...*TagCreate) *TagCreateBulk {+ return &TagCreateBulk{config: c.config, builders: builders}+}++// MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates+// a builder and applies setFunc on it.+func (c *TagClient) MapCreateBulk(slice any, setFunc func(*TagCreate, int)) *TagCreateBulk {+ rv := reflect.ValueOf(slice)+ if rv.Kind() != reflect.Slice {+ return &TagCreateBulk{err: fmt.Errorf("calling to TagClient.MapCreateBulk with wrong type %T, need slice", slice)}+ }+ builders := make([]*TagCreate, rv.Len())+ for i := 0; i < rv.Len(); i++ {+ builders[i] = c.Create()+ setFunc(builders[i], i)+ }+ return &TagCreateBulk{config: c.config, builders: builders}+}++// Update returns an update builder for Tag.+func (c *TagClient) Update() *TagUpdate {+ mutation := newTagMutation(c.config, OpUpdate)+ return &TagUpdate{config: c.config, hooks: c.Hooks(), mutation: mutation}+}++// UpdateOne returns an update builder for the given entity.+func (c *TagClient) UpdateOne(_m *Tag) *TagUpdateOne {+ mutation := newTagMutation(c.config, OpUpdateOne, withTag(_m))+ return &TagUpdateOne{config: c.config, hooks: c.Hooks(), mutation: mutation}+}++// UpdateOneID returns an update builder for the given id.+func (c *TagClient) UpdateOneID(id uuid.UUID) *TagUpdateOne {+ mutation := newTagMutation(c.config, OpUpdateOne, withTagID(id))+ return &TagUpdateOne{config: c.config, hooks: c.Hooks(), mutation: mutation}+}++// Delete returns a delete builder for Tag.+func (c *TagClient) Delete() *TagDelete {+ mutation := newTagMutation(c.config, OpDelete)+ return &TagDelete{config: c.config, hooks: c.Hooks(), mutation: mutation}+}++// DeleteOne returns a builder for deleting the given entity.+func (c *TagClient) DeleteOne(_m *Tag) *TagDeleteOne {+ return c.DeleteOneID(_m.ID)+}++// DeleteOneID returns a builder for deleting the given entity by its id.+func (c *TagClient) DeleteOneID(id uuid.UUID) *TagDeleteOne {+ builder := c.Delete().Where(tag.ID(id))+ builder.mutation.id = &id+ builder.mutation.op = OpDeleteOne+ return &TagDeleteOne{builder}+}++// Query returns a query builder for Tag.+func (c *TagClient) Query() *TagQuery {+ return &TagQuery{+ config: c.config,+ ctx: &QueryContext{Type: TypeTag},+ inters: c.Interceptors(),+ }+}++// Get returns a Tag entity by its id.+func (c *TagClient) Get(ctx context.Context, id uuid.UUID) (*Tag, error) {+ return c.Query().Where(tag.ID(id)).Only(ctx)+}++// GetX is like Get, but panics if an error occurs.+func (c *TagClient) GetX(ctx context.Context, id uuid.UUID) *Tag {+ obj, err := c.Get(ctx, id)+ if err != nil {+ panic(err)+ }+ return obj+}++// QueryGroup queries the group edge of a Tag.+func (c *TagClient) QueryGroup(_m *Tag) *GroupQuery {+ query := (&GroupClient{config: c.config}).Query()+ query.path = func(context.Context) (fromV *sql.Selector, _ error) {+ id := _m.ID+ step := sqlgraph.NewStep(+ sqlgraph.From(tag.Table, tag.FieldID, id),+ sqlgraph.To(group.Table, group.FieldID),+ sqlgraph.Edge(sqlgraph.M2O, true, tag.GroupTable, tag.GroupColumn),+ )+ fromV = sqlgraph.Neighbors(_m.driver.Dialect(), step)+ return fromV, nil+ }+ return query+}++// QueryItems queries the items edge of a Tag.+func (c *TagClient) QueryItems(_m *Tag) *ItemQuery {+ query := (&ItemClient{config: c.config}).Query()+ query.path = func(context.Context) (fromV *sql.Selector, _ error) {+ id := _m.ID+ step := sqlgraph.NewStep(+ sqlgraph.From(tag.Table, tag.FieldID, id),+ sqlgraph.To(item.Table, item.FieldID),+ sqlgraph.Edge(sqlgraph.M2M, false, tag.ItemsTable, tag.ItemsPrimaryKey...),+ )+ fromV = sqlgraph.Neighbors(_m.driver.Dialect(), step)+ return fromV, nil+ }+ return query+}++// Hooks returns the client hooks.+func (c *TagClient) Hooks() []Hook {+ return c.hooks.Tag+}++// Interceptors returns the client interceptors.+func (c *TagClient) Interceptors() []Interceptor {+ return c.inters.Tag+}++func (c *TagClient) mutate(ctx context.Context, m *TagMutation) (Value, error) {+ switch m.Op() {+ case OpCreate:+ return (&TagCreate{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx)+ case OpUpdate:+ return (&TagUpdate{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx)+ case OpUpdateOne:+ return (&TagUpdateOne{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx)+ case OpDelete, OpDeleteOne:+ return (&TagDelete{config: c.config, hooks: c.Hooks(), mutation: m}).Exec(ctx)+ default:+ return nil, fmt.Errorf("ent: unknown Tag mutation op: %q", m.Op())+ }+}+// TemplateFieldClient is a client for the TemplateField schema.type TemplateFieldClient struct {config@@ -2788,12 +2788,12 @@ func (c *UserClient) mutate(ctx context.Context, m *UserMutation) (Value, error)type (hooks struct {Attachment, AuthRoles, AuthTokens, Group, GroupInvitationToken, Item, ItemField,- ItemTemplate, Label, Location, MaintenanceEntry, Notifier, TemplateField,+ ItemTemplate, Location, MaintenanceEntry, Notifier, Tag, TemplateField,User []ent.Hook}inters struct {Attachment, AuthRoles, AuthTokens, Group, GroupInvitationToken, Item, ItemField,- ItemTemplate, Label, Location, MaintenanceEntry, Notifier, TemplateField,+ ItemTemplate, Location, MaintenanceEntry, Notifier, Tag, TemplateField,User []ent.Interceptor})diff --git a/backend/internal/data/ent/ent.go b/backend/internal/data/ent/ent.goindex ee3abfa7..8ec73e0b 100644--- a/backend/internal/data/ent/ent.go+++ b/backend/internal/data/ent/ent.go@@ -20,10 +20,10 @@ import ("github.com/sysadminsmedia/homebox/backend/internal/data/ent/item""github.com/sysadminsmedia/homebox/backend/internal/data/ent/itemfield""github.com/sysadminsmedia/homebox/backend/internal/data/ent/itemtemplate"- "github.com/sysadminsmedia/homebox/backend/internal/data/ent/label""github.com/sysadminsmedia/homebox/backend/internal/data/ent/location""github.com/sysadminsmedia/homebox/backend/internal/data/ent/maintenanceentry""github.com/sysadminsmedia/homebox/backend/internal/data/ent/notifier"+ "github.com/sysadminsmedia/homebox/backend/internal/data/ent/tag""github.com/sysadminsmedia/homebox/backend/internal/data/ent/templatefield""github.com/sysadminsmedia/homebox/backend/internal/data/ent/user")@@ -94,10 +94,10 @@ func checkColumn(t, c string) error {item.Table: item.ValidColumn,itemfield.Table: itemfield.ValidColumn,itemtemplate.Table: itemtemplate.ValidColumn,- label.Table: label.ValidColumn,location.Table: location.ValidColumn,maintenanceentry.Table: maintenanceentry.ValidColumn,notifier.Table: notifier.ValidColumn,+ tag.Table: tag.ValidColumn,templatefield.Table: templatefield.ValidColumn,user.Table: user.ValidColumn,})diff --git a/backend/internal/data/ent/group.go b/backend/internal/data/ent/group.goindex d20782b9..85e0b35d 100644--- a/backend/internal/data/ent/group.go+++ b/backend/internal/data/ent/group.go@@ -40,8 +40,8 @@ type GroupEdges struct {Locations []*Location `json:"locations,omitempty"`// Items holds the value of the items edge.Items []*Item `json:"items,omitempty"`- // Labels holds the value of the labels edge.- Labels []*Label `json:"labels,omitempty"`+ // Tags holds the value of the tags edge.+ Tags []*Tag `json:"tags,omitempty"`// InvitationTokens holds the value of the invitation_tokens edge.InvitationTokens []*GroupInvitationToken `json:"invitation_tokens,omitempty"`// Notifiers holds the value of the notifiers edge.@@ -80,13 +80,13 @@ func (e GroupEdges) ItemsOrErr() ([]*Item, error) {return nil, &NotLoadedError{edge: "items"}}-// LabelsOrErr returns the Labels value or an error if the edge+// TagsOrErr returns the Tags value or an error if the edge// was not loaded in eager-loading.-func (e GroupEdges) LabelsOrErr() ([]*Label, error) {+func (e GroupEdges) TagsOrErr() ([]*Tag, error) {if e.loadedTypes[3] {- return e.Labels, nil+ return e.Tags, nil}- return nil, &NotLoadedError{edge: "labels"}+ return nil, &NotLoadedError{edge: "tags"}}// InvitationTokensOrErr returns the InvitationTokens value or an error if the edge@@ -200,9 +200,9 @@ func (_m *Group) QueryItems() *ItemQuery {return NewGroupClient(_m.config).QueryItems(_m)}-// QueryLabels queries the "labels" edge of the Group entity.-func (_m *Group) QueryLabels() *LabelQuery {- return NewGroupClient(_m.config).QueryLabels(_m)+// QueryTags queries the "tags" edge of the Group entity.+func (_m *Group) QueryTags() *TagQuery {+ return NewGroupClient(_m.config).QueryTags(_m)}// QueryInvitationTokens queries the "invitation_tokens" edge of the Group entity.diff --git a/backend/internal/data/ent/group/group.go b/backend/internal/data/ent/group/group.goindex 68b49a07..961cc91d 100644--- a/backend/internal/data/ent/group/group.go+++ b/backend/internal/data/ent/group/group.go@@ -29,8 +29,8 @@ const (EdgeLocations = "locations"// EdgeItems holds the string denoting the items edge name in mutations.EdgeItems = "items"- // EdgeLabels holds the string denoting the labels edge name in mutations.- EdgeLabels = "labels"+ // EdgeTags holds the string denoting the tags edge name in mutations.+ EdgeTags = "tags"// EdgeInvitationTokens holds the string denoting the invitation_tokens edge name in mutations.EdgeInvitationTokens = "invitation_tokens"// EdgeNotifiers holds the string denoting the notifiers edge name in mutations.@@ -58,13 +58,13 @@ const (ItemsInverseTable = "items"// ItemsColumn is the table column denoting the items relation/edge.ItemsColumn = "group_items"- // LabelsTable is the table that holds the labels relation/edge.- LabelsTable = "labels"- // LabelsInverseTable is the table name for the Label entity.- // It exists in this package in order to avoid circular dependency with the "label" package.- LabelsInverseTable = "labels"- // LabelsColumn is the table column denoting the labels relation/edge.- LabelsColumn = "group_labels"+ // TagsTable is the table that holds the tags relation/edge.+ TagsTable = "tags"+ // TagsInverseTable is the table name for the Tag entity.+ // It exists in this package in order to avoid circular dependency with the "tag" package.+ TagsInverseTable = "tags"+ // TagsColumn is the table column denoting the tags relation/edge.+ TagsColumn = "group_tags"// InvitationTokensTable is the table that holds the invitation_tokens relation/edge.InvitationTokensTable = "group_invitation_tokens"// InvitationTokensInverseTable is the table name for the GroupInvitationToken entity.@@ -198,17 +198,17 @@ func ByItems(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption {}}-// ByLabelsCount orders the results by labels count.-func ByLabelsCount(opts ...sql.OrderTermOption) OrderOption {+// ByTagsCount orders the results by tags count.+func ByTagsCount(opts ...sql.OrderTermOption) OrderOption {return func(s *sql.Selector) {- sqlgraph.OrderByNeighborsCount(s, newLabelsStep(), opts...)+ sqlgraph.OrderByNeighborsCount(s, newTagsStep(), opts...)}}-// ByLabels orders the results by labels terms.-func ByLabels(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption {+// ByTags orders the results by tags terms.+func ByTags(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption {return func(s *sql.Selector) {- sqlgraph.OrderByNeighborTerms(s, newLabelsStep(), append([]sql.OrderTerm{term}, terms...)...)+ sqlgraph.OrderByNeighborTerms(s, newTagsStep(), append([]sql.OrderTerm{term}, terms...)...)}}@@ -274,11 +274,11 @@ func newItemsStep() *sqlgraph.Step {sqlgraph.Edge(sqlgraph.O2M, false, ItemsTable, ItemsColumn),)}-func newLabelsStep() *sqlgraph.Step {+func newTagsStep() *sqlgraph.Step {return sqlgraph.NewStep(sqlgraph.From(Table, FieldID),- sqlgraph.To(LabelsInverseTable, FieldID),- sqlgraph.Edge(sqlgraph.O2M, false, LabelsTable, LabelsColumn),+ sqlgraph.To(TagsInverseTable, FieldID),+ sqlgraph.Edge(sqlgraph.O2M, false, TagsTable, TagsColumn),)}func newInvitationTokensStep() *sqlgraph.Step {diff --git a/backend/internal/data/ent/group/where.go b/backend/internal/data/ent/group/where.goindex f0c3caf4..85fea4b9 100644--- a/backend/internal/data/ent/group/where.go+++ b/backend/internal/data/ent/group/where.go@@ -355,21 +355,21 @@ func HasItemsWith(preds ...predicate.Item) predicate.Group {})}-// HasLabels applies the HasEdge predicate on the "labels" edge.-func HasLabels() predicate.Group {+// HasTags applies the HasEdge predicate on the "tags" edge.+func HasTags() predicate.Group {return predicate.Group(func(s *sql.Selector) {step := sqlgraph.NewStep(sqlgraph.From(Table, FieldID),- sqlgraph.Edge(sqlgraph.O2M, false, LabelsTable, LabelsColumn),+ sqlgraph.Edge(sqlgraph.O2M, false, TagsTable, TagsColumn),)sqlgraph.HasNeighbors(s, step)})}-// HasLabelsWith applies the HasEdge predicate on the "labels" edge with a given conditions (other predicates).-func HasLabelsWith(preds ...predicate.Label) predicate.Group {+// HasTagsWith applies the HasEdge predicate on the "tags" edge with a given conditions (other predicates).+func HasTagsWith(preds ...predicate.Tag) predicate.Group {return predicate.Group(func(s *sql.Selector) {- step := newLabelsStep()+ step := newTagsStep()sqlgraph.HasNeighborsWith(s, step, func(s *sql.Selector) {for _, p := range preds {p(s)diff --git a/backend/internal/data/ent/group_create.go b/backend/internal/data/ent/group_create.goindex 32e46319..aa60fbd6 100644--- a/backend/internal/data/ent/group_create.go+++ b/backend/internal/data/ent/group_create.go@@ -15,9 +15,9 @@ import ("github.com/sysadminsmedia/homebox/backend/internal/data/ent/groupinvitationtoken""github.com/sysadminsmedia/homebox/backend/internal/data/ent/item""github.com/sysadminsmedia/homebox/backend/internal/data/ent/itemtemplate"- "github.com/sysadminsmedia/homebox/backend/internal/data/ent/label""github.com/sysadminsmedia/homebox/backend/internal/data/ent/location""github.com/sysadminsmedia/homebox/backend/internal/data/ent/notifier"+ "github.com/sysadminsmedia/homebox/backend/internal/data/ent/tag""github.com/sysadminsmedia/homebox/backend/internal/data/ent/user")@@ -135,19 +135,19 @@ func (_c *GroupCreate) AddItems(v ...*Item) *GroupCreate {return _c.AddItemIDs(ids...)}-// AddLabelIDs adds the "labels" edge to the Label entity by IDs.-func (_c *GroupCreate) AddLabelIDs(ids ...uuid.UUID) *GroupCreate {- _c.mutation.AddLabelIDs(ids...)+// AddTagIDs adds the "tags" edge to the Tag entity by IDs.+func (_c *GroupCreate) AddTagIDs(ids ...uuid.UUID) *GroupCreate {+ _c.mutation.AddTagIDs(ids...)return _c}-// AddLabels adds the "labels" edges to the Label entity.-func (_c *GroupCreate) AddLabels(v ...*Label) *GroupCreate {+// AddTags adds the "tags" edges to the Tag entity.+func (_c *GroupCreate) AddTags(v ...*Tag) *GroupCreate {ids := make([]uuid.UUID, len(v))for i := range v {ids[i] = v[i].ID}- return _c.AddLabelIDs(ids...)+ return _c.AddTagIDs(ids...)}// AddInvitationTokenIDs adds the "invitation_tokens" edge to the GroupInvitationToken entity by IDs.@@ -366,15 +366,15 @@ func (_c *GroupCreate) createSpec() (*Group, *sqlgraph.CreateSpec) {}_spec.Edges = append(_spec.Edges, edge)}- if nodes := _c.mutation.LabelsIDs(); len(nodes) > 0 {+ if nodes := _c.mutation.TagsIDs(); len(nodes) > 0 {edge := &sqlgraph.EdgeSpec{Rel: sqlgraph.O2M,Inverse: false,- Table: group.LabelsTable,- Columns: []string{group.LabelsColumn},+ Table: group.TagsTable,+ Columns: []string{group.TagsColumn},Bidi: false,Target: &sqlgraph.EdgeTarget{- IDSpec: sqlgraph.NewFieldSpec(label.FieldID, field.TypeUUID),+ IDSpec: sqlgraph.NewFieldSpec(tag.FieldID, field.TypeUUID),},}for _, k := range nodes {diff --git a/backend/internal/data/ent/group_query.go b/backend/internal/data/ent/group_query.goindex 61fda631..f316aa6c 100644--- a/backend/internal/data/ent/group_query.go+++ b/backend/internal/data/ent/group_query.go@@ -17,10 +17,10 @@ import ("github.com/sysadminsmedia/homebox/backend/internal/data/ent/groupinvitationtoken""github.com/sysadminsmedia/homebox/backend/internal/data/ent/item""github.com/sysadminsmedia/homebox/backend/internal/data/ent/itemtemplate"- "github.com/sysadminsmedia/homebox/backend/internal/data/ent/label""github.com/sysadminsmedia/homebox/backend/internal/data/ent/location""github.com/sysadminsmedia/homebox/backend/internal/data/ent/notifier""github.com/sysadminsmedia/homebox/backend/internal/data/ent/predicate"+ "github.com/sysadminsmedia/homebox/backend/internal/data/ent/tag""github.com/sysadminsmedia/homebox/backend/internal/data/ent/user")@@ -34,7 +34,7 @@ type GroupQuery struct {withUsers *UserQuerywithLocations *LocationQuerywithItems *ItemQuery- withLabels *LabelQuery+ withTags *TagQuerywithInvitationTokens *GroupInvitationTokenQuerywithNotifiers *NotifierQuerywithItemTemplates *ItemTemplateQuery@@ -140,9 +140,9 @@ func (_q *GroupQuery) QueryItems() *ItemQuery {return query}-// QueryLabels chains the current query on the "labels" edge.-func (_q *GroupQuery) QueryLabels() *LabelQuery {- query := (&LabelClient{config: _q.config}).Query()+// QueryTags chains the current query on the "tags" edge.+func (_q *GroupQuery) QueryTags() *TagQuery {+ query := (&TagClient{config: _q.config}).Query()query.path = func(ctx context.Context) (fromU *sql.Selector, err error) {if err := _q.prepareQuery(ctx); err != nil {return nil, err@@ -153,8 +153,8 @@ func (_q *GroupQuery) QueryLabels() *LabelQuery {}step := sqlgraph.NewStep(sqlgraph.From(group.Table, group.FieldID, selector),- sqlgraph.To(label.Table, label.FieldID),- sqlgraph.Edge(sqlgraph.O2M, false, group.LabelsTable, group.LabelsColumn),+ sqlgraph.To(tag.Table, tag.FieldID),+ sqlgraph.Edge(sqlgraph.O2M, false, group.TagsTable, group.TagsColumn),)fromU = sqlgraph.SetNeighbors(_q.driver.Dialect(), step)return fromU, nil@@ -423,7 +423,7 @@ func (_q *GroupQuery) Clone() *GroupQuery {withUsers: _q.withUsers.Clone(),withLocations: _q.withLocations.Clone(),withItems: _q.withItems.Clone(),- withLabels: _q.withLabels.Clone(),+ withTags: _q.withTags.Clone(),withInvitationTokens: _q.withInvitationTokens.Clone(),withNotifiers: _q.withNotifiers.Clone(),withItemTemplates: _q.withItemTemplates.Clone(),@@ -466,14 +466,14 @@ func (_q *GroupQuery) WithItems(opts ...func(*ItemQuery)) *GroupQuery {return _q}-// WithLabels tells the query-builder to eager-load the nodes that are connected to-// the "labels" edge. The optional arguments are used to configure the query builder of the edge.-func (_q *GroupQuery) WithLabels(opts ...func(*LabelQuery)) *GroupQuery {- query := (&LabelClient{config: _q.config}).Query()+// WithTags tells the query-builder to eager-load the nodes that are connected to+// the "tags" edge. The optional arguments are used to configure the query builder of the edge.+func (_q *GroupQuery) WithTags(opts ...func(*TagQuery)) *GroupQuery {+ query := (&TagClient{config: _q.config}).Query()for _, opt := range opts {opt(query)}- _q.withLabels = query+ _q.withTags = queryreturn _q}@@ -592,7 +592,7 @@ func (_q *GroupQuery) sqlAll(ctx context.Context, hooks ...queryHook) ([]*Group,_q.withUsers != nil,_q.withLocations != nil,_q.withItems != nil,- _q.withLabels != nil,+ _q.withTags != nil,_q.withInvitationTokens != nil,_q.withNotifiers != nil,_q.withItemTemplates != nil,@@ -637,10 +637,10 @@ func (_q *GroupQuery) sqlAll(ctx context.Context, hooks ...queryHook) ([]*Group,return nil, err}}- if query := _q.withLabels; query != nil {- if err := _q.loadLabels(ctx, query, nodes,- func(n *Group) { n.Edges.Labels = []*Label{} },- func(n *Group, e *Label) { n.Edges.Labels = append(n.Edges.Labels, e) }); err != nil {+ if query := _q.withTags; query != nil {+ if err := _q.loadTags(ctx, query, nodes,+ func(n *Group) { n.Edges.Tags = []*Tag{} },+ func(n *Group, e *Tag) { n.Edges.Tags = append(n.Edges.Tags, e) }); err != nil {return nil, err}}@@ -793,7 +793,7 @@ func (_q *GroupQuery) loadItems(ctx context.Context, query *ItemQuery, nodes []*}return nil}-func (_q *GroupQuery) loadLabels(ctx context.Context, query *LabelQuery, nodes []*Group, init func(*Group), assign func(*Group, *Label)) error {+func (_q *GroupQuery) loadTags(ctx context.Context, query *TagQuery, nodes []*Group, init func(*Group), assign func(*Group, *Tag)) error {fks := make([]driver.Value, 0, len(nodes))nodeids := make(map[uuid.UUID]*Group)for i := range nodes {@@ -804,21 +804,21 @@ func (_q *GroupQuery) loadLabels(ctx context.Context, query *LabelQuery, nodes [}}query.withFKs = true- query.Where(predicate.Label(func(s *sql.Selector) {- s.Where(sql.InValues(s.C(group.LabelsColumn), fks...))+ query.Where(predicate.Tag(func(s *sql.Selector) {+ s.Where(sql.InValues(s.C(group.TagsColumn), fks...))}))neighbors, err := query.All(ctx)if err != nil {return err}for _, n := range neighbors {- fk := n.group_labels+ fk := n.group_tagsif fk == nil {- return fmt.Errorf(`foreign-key "group_labels" is nil for node %v`, n.ID)+ return fmt.Errorf(`foreign-key "group_tags" is nil for node %v`, n.ID)}node, ok := nodeids[*fk]if !ok {- return fmt.Errorf(`unexpected referenced foreign-key "group_labels" returned %v for node %v`, *fk, n.ID)+ return fmt.Errorf(`unexpected referenced foreign-key "group_tags" returned %v for node %v`, *fk, n.ID)}assign(node, n)}diff --git a/backend/internal/data/ent/group_update.go b/backend/internal/data/ent/group_update.goindex 2258b8ea..c8eb5533 100644--- a/backend/internal/data/ent/group_update.go+++ b/backend/internal/data/ent/group_update.go@@ -16,10 +16,10 @@ import ("github.com/sysadminsmedia/homebox/backend/internal/data/ent/groupinvitationtoken""github.com/sysadminsmedia/homebox/backend/internal/data/ent/item""github.com/sysadminsmedia/homebox/backend/internal/data/ent/itemtemplate"- "github.com/sysadminsmedia/homebox/backend/internal/data/ent/label""github.com/sysadminsmedia/homebox/backend/internal/data/ent/location""github.com/sysadminsmedia/homebox/backend/internal/data/ent/notifier""github.com/sysadminsmedia/homebox/backend/internal/data/ent/predicate"+ "github.com/sysadminsmedia/homebox/backend/internal/data/ent/tag""github.com/sysadminsmedia/homebox/backend/internal/data/ent/user")@@ -115,19 +115,19 @@ func (_u *GroupUpdate) AddItems(v ...*Item) *GroupUpdate {return _u.AddItemIDs(ids...)}-// AddLabelIDs adds the "labels" edge to the Label entity by IDs.-func (_u *GroupUpdate) AddLabelIDs(ids ...uuid.UUID) *GroupUpdate {- _u.mutation.AddLabelIDs(ids...)+// AddTagIDs adds the "tags" edge to the Tag entity by IDs.+func (_u *GroupUpdate) AddTagIDs(ids ...uuid.UUID) *GroupUpdate {+ _u.mutation.AddTagIDs(ids...)return _u}-// AddLabels adds the "labels" edges to the Label entity.-func (_u *GroupUpdate) AddLabels(v ...*Label) *GroupUpdate {+// AddTags adds the "tags" edges to the Tag entity.+func (_u *GroupUpdate) AddTags(v ...*Tag) *GroupUpdate {ids := make([]uuid.UUID, len(v))for i := range v {ids[i] = v[i].ID}- return _u.AddLabelIDs(ids...)+ return _u.AddTagIDs(ids...)}// AddInvitationTokenIDs adds the "invitation_tokens" edge to the GroupInvitationToken entity by IDs.@@ -243,25 +243,25 @@ func (_u *GroupUpdate) RemoveItems(v ...*Item) *GroupUpdate {return _u.RemoveItemIDs(ids...)}-// ClearLabels clears all "labels" edges to the Label entity.-func (_u *GroupUpdate) ClearLabels() *GroupUpdate {- _u.mutation.ClearLabels()+// ClearTags clears all "tags" edges to the Tag entity.+func (_u *GroupUpdate) ClearTags() *GroupUpdate {+ _u.mutation.ClearTags()return _u}-// RemoveLabelIDs removes the "labels" edge to Label entities by IDs.-func (_u *GroupUpdate) RemoveLabelIDs(ids ...uuid.UUID) *GroupUpdate {- _u.mutation.RemoveLabelIDs(ids...)+// RemoveTagIDs removes the "tags" edge to Tag entities by IDs.+func (_u *GroupUpdate) RemoveTagIDs(ids ...uuid.UUID) *GroupUpdate {+ _u.mutation.RemoveTagIDs(ids...)return _u}-// RemoveLabels removes "labels" edges to Label entities.-func (_u *GroupUpdate) RemoveLabels(v ...*Label) *GroupUpdate {+// RemoveTags removes "tags" edges to Tag entities.+func (_u *GroupUpdate) RemoveTags(v ...*Tag) *GroupUpdate {ids := make([]uuid.UUID, len(v))for i := range v {ids[i] = v[i].ID}- return _u.RemoveLabelIDs(ids...)+ return _u.RemoveTagIDs(ids...)}// ClearInvitationTokens clears all "invitation_tokens" edges to the GroupInvitationToken entity.@@ -529,28 +529,28 @@ func (_u *GroupUpdate) sqlSave(ctx context.Context) (_node int, err error) {}_spec.Edges.Add = append(_spec.Edges.Add, edge)}- if _u.mutation.LabelsCleared() {+ if _u.mutation.TagsCleared() {edge := &sqlgraph.EdgeSpec{Rel: sqlgraph.O2M,Inverse: false,- Table: group.LabelsTable,- Columns: []string{group.LabelsColumn},+ Table: group.TagsTable,+ Columns: []string{group.TagsColumn},Bidi: false,Target: &sqlgraph.EdgeTarget{- IDSpec: sqlgraph.NewFieldSpec(label.FieldID, field.TypeUUID),+ IDSpec: sqlgraph.NewFieldSpec(tag.FieldID, field.TypeUUID),},}_spec.Edges.Clear = append(_spec.Edges.Clear, edge)}- if nodes := _u.mutation.RemovedLabelsIDs(); len(nodes) > 0 && !_u.mutation.LabelsCleared() {+ if nodes := _u.mutation.RemovedTagsIDs(); len(nodes) > 0 && !_u.mutation.TagsCleared() {edge := &sqlgraph.EdgeSpec{Rel: sqlgraph.O2M,Inverse: false,- Table: group.LabelsTable,- Columns: []string{group.LabelsColumn},+ Table: group.TagsTable,+ Columns: []string{group.TagsColumn},Bidi: false,Target: &sqlgraph.EdgeTarget{- IDSpec: sqlgraph.NewFieldSpec(label.FieldID, field.TypeUUID),+ IDSpec: sqlgraph.NewFieldSpec(tag.FieldID, field.TypeUUID),},}for _, k := range nodes {@@ -558,15 +558,15 @@ func (_u *GroupUpdate) sqlSave(ctx context.Context) (_node int, err error) {}_spec.Edges.Clear = append(_spec.Edges.Clear, edge)}- if nodes := _u.mutation.LabelsIDs(); len(nodes) > 0 {+ if nodes := _u.mutation.TagsIDs(); len(nodes) > 0 {edge := &sqlgraph.EdgeSpec{Rel: sqlgraph.O2M,Inverse: false,- Table: group.LabelsTable,- Columns: []string{group.LabelsColumn},+ Table: group.TagsTable,+ Columns: []string{group.TagsColumn},Bidi: false,Target: &sqlgraph.EdgeTarget{- IDSpec: sqlgraph.NewFieldSpec(label.FieldID, field.TypeUUID),+ IDSpec: sqlgraph.NewFieldSpec(tag.FieldID, field.TypeUUID),},}for _, k := range nodes {@@ -808,19 +808,19 @@ func (_u *GroupUpdateOne) AddItems(v ...*Item) *GroupUpdateOne {return _u.AddItemIDs(ids...)}-// AddLabelIDs adds the "labels" edge to the Label entity by IDs.-func (_u *GroupUpdateOne) AddLabelIDs(ids ...uuid.UUID) *GroupUpdateOne {- _u.mutation.AddLabelIDs(ids...)+// AddTagIDs adds the "tags" edge to the Tag entity by IDs.+func (_u *GroupUpdateOne) AddTagIDs(ids ...uuid.UUID) *GroupUpdateOne {+ _u.mutation.AddTagIDs(ids...)return _u}-// AddLabels adds the "labels" edges to the Label entity.-func (_u *GroupUpdateOne) AddLabels(v ...*Label) *GroupUpdateOne {+// AddTags adds the "tags" edges to the Tag entity.+func (_u *GroupUpdateOne) AddTags(v ...*Tag) *GroupUpdateOne {ids := make([]uuid.UUID, len(v))for i := range v {ids[i] = v[i].ID}- return _u.AddLabelIDs(ids...)+ return _u.AddTagIDs(ids...)}// AddInvitationTokenIDs adds the "invitation_tokens" edge to the GroupInvitationToken entity by IDs.@@ -936,25 +936,25 @@ func (_u *GroupUpdateOne) RemoveItems(v ...*Item) *GroupUpdateOne {return _u.RemoveItemIDs(ids...)}-// ClearLabels clears all "labels" edges to the Label entity.-func (_u *GroupUpdateOne) ClearLabels() *GroupUpdateOne {- _u.mutation.ClearLabels()+// ClearTags clears all "tags" edges to the Tag entity.+func (_u *GroupUpdateOne) ClearTags() *GroupUpdateOne {+ _u.mutation.ClearTags()return _u}-// RemoveLabelIDs removes the "labels" edge to Label entities by IDs.-func (_u *GroupUpdateOne) RemoveLabelIDs(ids ...uuid.UUID) *GroupUpdateOne {- _u.mutation.RemoveLabelIDs(ids...)+// RemoveTagIDs removes the "tags" edge to Tag entities by IDs.+func (_u *GroupUpdateOne) RemoveTagIDs(ids ...uuid.UUID) *GroupUpdateOne {+ _u.mutation.RemoveTagIDs(ids...)return _u}-// RemoveLabels removes "labels" edges to Label entities.-func (_u *GroupUpdateOne) RemoveLabels(v ...*Label) *GroupUpdateOne {+// RemoveTags removes "tags" edges to Tag entities.+func (_u *GroupUpdateOne) RemoveTags(v ...*Tag) *GroupUpdateOne {ids := make([]uuid.UUID, len(v))for i := range v {ids[i] = v[i].ID}- return _u.RemoveLabelIDs(ids...)+ return _u.RemoveTagIDs(ids...)}// ClearInvitationTokens clears all "invitation_tokens" edges to the GroupInvitationToken entity.@@ -1252,28 +1252,28 @@ func (_u *GroupUpdateOne) sqlSave(ctx context.Context) (_node *Group, err error)}_spec.Edges.Add = append(_spec.Edges.Add, edge)}- if _u.mutation.LabelsCleared() {+ if _u.mutation.TagsCleared() {edge := &sqlgraph.EdgeSpec{Rel: sqlgraph.O2M,Inverse: false,- Table: group.LabelsTable,- Columns: []string{group.LabelsColumn},+ Table: group.TagsTable,+ Columns: []string{group.TagsColumn},Bidi: false,Target: &sqlgraph.EdgeTarget{- IDSpec: sqlgraph.NewFieldSpec(label.FieldID, field.TypeUUID),+ IDSpec: sqlgraph.NewFieldSpec(tag.FieldID, field.TypeUUID),},}_spec.Edges.Clear = append(_spec.Edges.Clear, edge)}- if nodes := _u.mutation.RemovedLabelsIDs(); len(nodes) > 0 && !_u.mutation.LabelsCleared() {+ if nodes := _u.mutation.RemovedTagsIDs(); len(nodes) > 0 && !_u.mutation.TagsCleared() {edge := &sqlgraph.EdgeSpec{Rel: sqlgraph.O2M,Inverse: false,- Table: group.LabelsTable,- Columns: []string{group.LabelsColumn},+ Table: group.TagsTable,+ Columns: []string{group.TagsColumn},Bidi: false,Target: &sqlgraph.EdgeTarget{- IDSpec: sqlgraph.NewFieldSpec(label.FieldID, field.TypeUUID),+ IDSpec: sqlgraph.NewFieldSpec(tag.FieldID, field.TypeUUID),},}for _, k := range nodes {@@ -1281,15 +1281,15 @@ func (_u *GroupUpdateOne) sqlSave(ctx context.Context) (_node *Group, err error)}_spec.Edges.Clear = append(_spec.Edges.Clear, edge)}- if nodes := _u.mutation.LabelsIDs(); len(nodes) > 0 {+ if nodes := _u.mutation.TagsIDs(); len(nodes) > 0 {edge := &sqlgraph.EdgeSpec{Rel: sqlgraph.O2M,Inverse: false,- Table: group.LabelsTable,- Columns: []string{group.LabelsColumn},+ Table: group.TagsTable,+ Columns: []string{group.TagsColumn},Bidi: false,Target: &sqlgraph.EdgeTarget{- IDSpec: sqlgraph.NewFieldSpec(label.FieldID, field.TypeUUID),+ IDSpec: sqlgraph.NewFieldSpec(tag.FieldID, field.TypeUUID),},}for _, k := range nodes {diff --git a/backend/internal/data/ent/has_id.go b/backend/internal/data/ent/has_id.goindex faf28d4e..ad3c89eb 100644--- a/backend/internal/data/ent/has_id.go+++ b/backend/internal/data/ent/has_id.go@@ -36,10 +36,6 @@ func (_m *ItemTemplate) GetID() uuid.UUID {return _m.ID}-func (_m *Label) GetID() uuid.UUID {- return _m.ID-}-func (_m *Location) GetID() uuid.UUID {return _m.ID}@@ -52,6 +48,10 @@ func (_m *Notifier) GetID() uuid.UUID {return _m.ID}+func (_m *Tag) GetID() uuid.UUID {+ return _m.ID+}+func (_m *TemplateField) GetID() uuid.UUID {return _m.ID}diff --git a/backend/internal/data/ent/hook/hook.go b/backend/internal/data/ent/hook/hook.goindex 6859da52..c303dd41 100644--- a/backend/internal/data/ent/hook/hook.go+++ b/backend/internal/data/ent/hook/hook.go@@ -105,18 +105,6 @@ func (f ItemTemplateFunc) Mutate(ctx context.Context, m ent.Mutation) (ent.Valuereturn nil, fmt.Errorf("unexpected mutation type %T. expect *ent.ItemTemplateMutation", m)}-// The LabelFunc type is an adapter to allow the use of ordinary-// function as Label mutator.-type LabelFunc func(context.Context, *ent.LabelMutation) (ent.Value, error)--// Mutate calls f(ctx, m).-func (f LabelFunc) Mutate(ctx context.Context, m ent.Mutation) (ent.Value, error) {- if mv, ok := m.(*ent.LabelMutation); ok {- return f(ctx, mv)- }- return nil, fmt.Errorf("unexpected mutation type %T. expect *ent.LabelMutation", m)-}-// The LocationFunc type is an adapter to allow the use of ordinary// function as Location mutator.type LocationFunc func(context.Context, *ent.LocationMutation) (ent.Value, error)@@ -153,6 +141,18 @@ func (f NotifierFunc) Mutate(ctx context.Context, m ent.Mutation) (ent.Value, erreturn nil, fmt.Errorf("unexpected mutation type %T. expect *ent.NotifierMutation", m)}+// The TagFunc type is an adapter to allow the use of ordinary+// function as Tag mutator.+type TagFunc func(context.Context, *ent.TagMutation) (ent.Value, error)++// Mutate calls f(ctx, m).+func (f TagFunc) Mutate(ctx context.Context, m ent.Mutation) (ent.Value, error) {+ if mv, ok := m.(*ent.TagMutation); ok {+ return f(ctx, mv)+ }+ return nil, fmt.Errorf("unexpected mutation type %T. expect *ent.TagMutation", m)+}+// The TemplateFieldFunc type is an adapter to allow the use of ordinary// function as TemplateField mutator.type TemplateFieldFunc func(context.Context, *ent.TemplateFieldMutation) (ent.Value, error)diff --git a/backend/internal/data/ent/item.go b/backend/internal/data/ent/item.goindex 27c4f38d..f937937f 100644--- a/backend/internal/data/ent/item.go+++ b/backend/internal/data/ent/item.go@@ -85,8 +85,8 @@ type ItemEdges struct {Parent *Item `json:"parent,omitempty"`// Children holds the value of the children edge.Children []*Item `json:"children,omitempty"`- // Label holds the value of the label edge.- Label []*Label `json:"label,omitempty"`+ // Tag holds the value of the tag edge.+ Tag []*Tag `json:"tag,omitempty"`// Location holds the value of the location edge.Location *Location `json:"location,omitempty"`// Fields holds the value of the fields edge.@@ -131,13 +131,13 @@ func (e ItemEdges) ChildrenOrErr() ([]*Item, error) {return nil, &NotLoadedError{edge: "children"}}-// LabelOrErr returns the Label value or an error if the edge+// TagOrErr returns the Tag value or an error if the edge// was not loaded in eager-loading.-func (e ItemEdges) LabelOrErr() ([]*Label, error) {+func (e ItemEdges) TagOrErr() ([]*Tag, error) {if e.loadedTypes[3] {- return e.Label, nil+ return e.Tag, nil}- return nil, &NotLoadedError{edge: "label"}+ return nil, &NotLoadedError{edge: "tag"}}// LocationOrErr returns the Location value or an error if the edge@@ -415,9 +415,9 @@ func (_m *Item) QueryChildren() *ItemQuery {return NewItemClient(_m.config).QueryChildren(_m)}-// QueryLabel queries the "label" edge of the Item entity.-func (_m *Item) QueryLabel() *LabelQuery {- return NewItemClient(_m.config).QueryLabel(_m)+// QueryTag queries the "tag" edge of the Item entity.+func (_m *Item) QueryTag() *TagQuery {+ return NewItemClient(_m.config).QueryTag(_m)}// QueryLocation queries the "location" edge of the Item entity.diff --git a/backend/internal/data/ent/item/item.go b/backend/internal/data/ent/item/item.goindex d3601c64..4c4c27db 100644--- a/backend/internal/data/ent/item/item.go+++ b/backend/internal/data/ent/item/item.go@@ -69,8 +69,8 @@ const (EdgeParent = "parent"// EdgeChildren holds the string denoting the children edge name in mutations.EdgeChildren = "children"- // EdgeLabel holds the string denoting the label edge name in mutations.- EdgeLabel = "label"+ // EdgeTag holds the string denoting the tag edge name in mutations.+ EdgeTag = "tag"// EdgeLocation holds the string denoting the location edge name in mutations.EdgeLocation = "location"// EdgeFields holds the string denoting the fields edge name in mutations.@@ -96,11 +96,11 @@ const (ChildrenTable = "items"// ChildrenColumn is the table column denoting the children relation/edge.ChildrenColumn = "item_children"- // LabelTable is the table that holds the label relation/edge. The primary key declared below.- LabelTable = "label_items"- // LabelInverseTable is the table name for the Label entity.- // It exists in this package in order to avoid circular dependency with the "label" package.- LabelInverseTable = "labels"+ // TagTable is the table that holds the tag relation/edge. The primary key declared below.+ TagTable = "tag_items"+ // TagInverseTable is the table name for the Tag entity.+ // It exists in this package in order to avoid circular dependency with the "tag" package.+ TagInverseTable = "tags"// LocationTable is the table that holds the location relation/edge.LocationTable = "items"// LocationInverseTable is the table name for the Location entity.@@ -169,9 +169,9 @@ var ForeignKeys = []string{}var (- // LabelPrimaryKey and LabelColumn2 are the table columns denoting the- // primary key for the label relation (M2M).- LabelPrimaryKey = []string{"label_id", "item_id"}+ // TagPrimaryKey and TagColumn2 are the table columns denoting the+ // primary key for the tag relation (M2M).+ TagPrimaryKey = []string{"tag_id", "item_id"})// ValidColumn reports if the column name is valid (part of the table columns).@@ -390,17 +390,17 @@ func ByChildren(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption {}}-// ByLabelCount orders the results by label count.-func ByLabelCount(opts ...sql.OrderTermOption) OrderOption {+// ByTagCount orders the results by tag count.+func ByTagCount(opts ...sql.OrderTermOption) OrderOption {return func(s *sql.Selector) {- sqlgraph.OrderByNeighborsCount(s, newLabelStep(), opts...)+ sqlgraph.OrderByNeighborsCount(s, newTagStep(), opts...)}}-// ByLabel orders the results by label terms.-func ByLabel(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption {+// ByTag orders the results by tag terms.+func ByTag(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption {return func(s *sql.Selector) {- sqlgraph.OrderByNeighborTerms(s, newLabelStep(), append([]sql.OrderTerm{term}, terms...)...)+ sqlgraph.OrderByNeighborTerms(s, newTagStep(), append([]sql.OrderTerm{term}, terms...)...)}}@@ -473,11 +473,11 @@ func newChildrenStep() *sqlgraph.Step {sqlgraph.Edge(sqlgraph.O2M, false, ChildrenTable, ChildrenColumn),)}-func newLabelStep() *sqlgraph.Step {+func newTagStep() *sqlgraph.Step {return sqlgraph.NewStep(sqlgraph.From(Table, FieldID),- sqlgraph.To(LabelInverseTable, FieldID),- sqlgraph.Edge(sqlgraph.M2M, true, LabelTable, LabelPrimaryKey...),+ sqlgraph.To(TagInverseTable, FieldID),+ sqlgraph.Edge(sqlgraph.M2M, true, TagTable, TagPrimaryKey...),)}func newLocationStep() *sqlgraph.Step {diff --git a/backend/internal/data/ent/item/where.go b/backend/internal/data/ent/item/where.goindex 5166fa54..65a76a7e 100644--- a/backend/internal/data/ent/item/where.go+++ b/backend/internal/data/ent/item/where.go@@ -1490,21 +1490,21 @@ func HasChildrenWith(preds ...predicate.Item) predicate.Item {})}-// HasLabel applies the HasEdge predicate on the "label" edge.-func HasLabel() predicate.Item {+// HasTag applies the HasEdge predicate on the "tag" edge.+func HasTag() predicate.Item {return predicate.Item(func(s *sql.Selector) {step := sqlgraph.NewStep(sqlgraph.From(Table, FieldID),- sqlgraph.Edge(sqlgraph.M2M, true, LabelTable, LabelPrimaryKey...),+ sqlgraph.Edge(sqlgraph.M2M, true, TagTable, TagPrimaryKey...),)sqlgraph.HasNeighbors(s, step)})}-// HasLabelWith applies the HasEdge predicate on the "label" edge with a given conditions (other predicates).-func HasLabelWith(preds ...predicate.Label) predicate.Item {+// HasTagWith applies the HasEdge predicate on the "tag" edge with a given conditions (other predicates).+func HasTagWith(preds ...predicate.Tag) predicate.Item {return predicate.Item(func(s *sql.Selector) {- step := newLabelStep()+ step := newTagStep()sqlgraph.HasNeighborsWith(s, step, func(s *sql.Selector) {for _, p := range preds {p(s)diff --git a/backend/internal/data/ent/item_create.go b/backend/internal/data/ent/item_create.goindex 48a77a8e..98f74fe1 100644--- a/backend/internal/data/ent/item_create.go+++ b/backend/internal/data/ent/item_create.go@@ -15,9 +15,9 @@ import ("github.com/sysadminsmedia/homebox/backend/internal/data/ent/group""github.com/sysadminsmedia/homebox/backend/internal/data/ent/item""github.com/sysadminsmedia/homebox/backend/internal/data/ent/itemfield"- "github.com/sysadminsmedia/homebox/backend/internal/data/ent/label""github.com/sysadminsmedia/homebox/backend/internal/data/ent/location""github.com/sysadminsmedia/homebox/backend/internal/data/ent/maintenanceentry"+ "github.com/sysadminsmedia/homebox/backend/internal/data/ent/tag")// ItemCreate is the builder for creating a Item entity.@@ -414,19 +414,19 @@ func (_c *ItemCreate) AddChildren(v ...*Item) *ItemCreate {return _c.AddChildIDs(ids...)}-// AddLabelIDs adds the "label" edge to the Label entity by IDs.-func (_c *ItemCreate) AddLabelIDs(ids ...uuid.UUID) *ItemCreate {- _c.mutation.AddLabelIDs(ids...)+// AddTagIDs adds the "tag" edge to the Tag entity by IDs.+func (_c *ItemCreate) AddTagIDs(ids ...uuid.UUID) *ItemCreate {+ _c.mutation.AddTagIDs(ids...)return _c}-// AddLabel adds the "label" edges to the Label entity.-func (_c *ItemCreate) AddLabel(v ...*Label) *ItemCreate {+// AddTag adds the "tag" edges to the Tag entity.+func (_c *ItemCreate) AddTag(v ...*Tag) *ItemCreate {ids := make([]uuid.UUID, len(v))for i := range v {ids[i] = v[i].ID}- return _c.AddLabelIDs(ids...)+ return _c.AddTagIDs(ids...)}// SetLocationID sets the "location" edge to the Location entity by ID.@@ -838,15 +838,15 @@ func (_c *ItemCreate) createSpec() (*Item, *sqlgraph.CreateSpec) {}_spec.Edges = append(_spec.Edges, edge)}- if nodes := _c.mutation.LabelIDs(); len(nodes) > 0 {+ if nodes := _c.mutation.TagIDs(); len(nodes) > 0 {edge := &sqlgraph.EdgeSpec{Rel: sqlgraph.M2M,Inverse: true,- Table: item.LabelTable,- Columns: item.LabelPrimaryKey,+ Table: item.TagTable,+ Columns: item.TagPrimaryKey,Bidi: false,Target: &sqlgraph.EdgeTarget{- IDSpec: sqlgraph.NewFieldSpec(label.FieldID, field.TypeUUID),+ IDSpec: sqlgraph.NewFieldSpec(tag.FieldID, field.TypeUUID),},}for _, k := range nodes {diff --git a/backend/internal/data/ent/item_query.go b/backend/internal/data/ent/item_query.goindex 8cb32410..15658a78 100644--- a/backend/internal/data/ent/item_query.go+++ b/backend/internal/data/ent/item_query.go@@ -17,10 +17,10 @@ import ("github.com/sysadminsmedia/homebox/backend/internal/data/ent/group""github.com/sysadminsmedia/homebox/backend/internal/data/ent/item""github.com/sysadminsmedia/homebox/backend/internal/data/ent/itemfield"- "github.com/sysadminsmedia/homebox/backend/internal/data/ent/label""github.com/sysadminsmedia/homebox/backend/internal/data/ent/location""github.com/sysadminsmedia/homebox/backend/internal/data/ent/maintenanceentry""github.com/sysadminsmedia/homebox/backend/internal/data/ent/predicate"+ "github.com/sysadminsmedia/homebox/backend/internal/data/ent/tag")// ItemQuery is the builder for querying Item entities.@@ -33,7 +33,7 @@ type ItemQuery struct {withGroup *GroupQuerywithParent *ItemQuerywithChildren *ItemQuery- withLabel *LabelQuery+ withTag *TagQuerywithLocation *LocationQuerywithFields *ItemFieldQuerywithMaintenanceEntries *MaintenanceEntryQuery@@ -141,9 +141,9 @@ func (_q *ItemQuery) QueryChildren() *ItemQuery {return query}-// QueryLabel chains the current query on the "label" edge.-func (_q *ItemQuery) QueryLabel() *LabelQuery {- query := (&LabelClient{config: _q.config}).Query()+// QueryTag chains the current query on the "tag" edge.+func (_q *ItemQuery) QueryTag() *TagQuery {+ query := (&TagClient{config: _q.config}).Query()query.path = func(ctx context.Context) (fromU *sql.Selector, err error) {if err := _q.prepareQuery(ctx); err != nil {return nil, err@@ -154,8 +154,8 @@ func (_q *ItemQuery) QueryLabel() *LabelQuery {}step := sqlgraph.NewStep(sqlgraph.From(item.Table, item.FieldID, selector),- sqlgraph.To(label.Table, label.FieldID),- sqlgraph.Edge(sqlgraph.M2M, true, item.LabelTable, item.LabelPrimaryKey...),+ sqlgraph.To(tag.Table, tag.FieldID),+ sqlgraph.Edge(sqlgraph.M2M, true, item.TagTable, item.TagPrimaryKey...),)fromU = sqlgraph.SetNeighbors(_q.driver.Dialect(), step)return fromU, nil@@ -446,7 +446,7 @@ func (_q *ItemQuery) Clone() *ItemQuery {withGroup: _q.withGroup.Clone(),withParent: _q.withParent.Clone(),withChildren: _q.withChildren.Clone(),- withLabel: _q.withLabel.Clone(),+ withTag: _q.withTag.Clone(),withLocation: _q.withLocation.Clone(),withFields: _q.withFields.Clone(),withMaintenanceEntries: _q.withMaintenanceEntries.Clone(),@@ -490,14 +490,14 @@ func (_q *ItemQuery) WithChildren(opts ...func(*ItemQuery)) *ItemQuery {return _q}-// WithLabel tells the query-builder to eager-load the nodes that are connected to-// the "label" edge. The optional arguments are used to configure the query builder of the edge.-func (_q *ItemQuery) WithLabel(opts ...func(*LabelQuery)) *ItemQuery {- query := (&LabelClient{config: _q.config}).Query()+// WithTag tells the query-builder to eager-load the nodes that are connected to+// the "tag" edge. The optional arguments are used to configure the query builder of the edge.+func (_q *ItemQuery) WithTag(opts ...func(*TagQuery)) *ItemQuery {+ query := (&TagClient{config: _q.config}).Query()for _, opt := range opts {opt(query)}- _q.withLabel = query+ _q.withTag = queryreturn _q}@@ -628,7 +628,7 @@ func (_q *ItemQuery) sqlAll(ctx context.Context, hooks ...queryHook) ([]*Item, e_q.withGroup != nil,_q.withParent != nil,_q.withChildren != nil,- _q.withLabel != nil,+ _q.withTag != nil,_q.withLocation != nil,_q.withFields != nil,_q.withMaintenanceEntries != nil,@@ -678,10 +678,10 @@ func (_q *ItemQuery) sqlAll(ctx context.Context, hooks ...queryHook) ([]*Item, ereturn nil, err}}- if query := _q.withLabel; query != nil {- if err := _q.loadLabel(ctx, query, nodes,- func(n *Item) { n.Edges.Label = []*Label{} },- func(n *Item, e *Label) { n.Edges.Label = append(n.Edges.Label, e) }); err != nil {+ if query := _q.withTag; query != nil {+ if err := _q.loadTag(ctx, query, nodes,+ func(n *Item) { n.Edges.Tag = []*Tag{} },+ func(n *Item, e *Tag) { n.Edges.Tag = append(n.Edges.Tag, e) }); err != nil {return nil, err}}@@ -810,7 +810,7 @@ func (_q *ItemQuery) loadChildren(ctx context.Context, query *ItemQuery, nodes [}return nil}-func (_q *ItemQuery) loadLabel(ctx context.Context, query *LabelQuery, nodes []*Item, init func(*Item), assign func(*Item, *Label)) error {+func (_q *ItemQuery) loadTag(ctx context.Context, query *TagQuery, nodes []*Item, init func(*Item), assign func(*Item, *Tag)) error {edgeIDs := make([]driver.Value, len(nodes))byID := make(map[uuid.UUID]*Item)nids := make(map[uuid.UUID]map[*Item]struct{})@@ -822,11 +822,11 @@ func (_q *ItemQuery) loadLabel(ctx context.Context, query *LabelQuery, nodes []*}}query.Where(func(s *sql.Selector) {- joinT := sql.Table(item.LabelTable)- s.Join(joinT).On(s.C(label.FieldID), joinT.C(item.LabelPrimaryKey[0]))- s.Where(sql.InValues(joinT.C(item.LabelPrimaryKey[1]), edgeIDs...))+ joinT := sql.Table(item.TagTable)+ s.Join(joinT).On(s.C(tag.FieldID), joinT.C(item.TagPrimaryKey[0]))+ s.Where(sql.InValues(joinT.C(item.TagPrimaryKey[1]), edgeIDs...))columns := s.SelectedColumns()- s.Select(joinT.C(item.LabelPrimaryKey[1]))+ s.Select(joinT.C(item.TagPrimaryKey[1]))s.AppendSelect(columns...)s.SetDistinct(false)})@@ -856,14 +856,14 @@ func (_q *ItemQuery) loadLabel(ctx context.Context, query *LabelQuery, nodes []*}})})- neighbors, err := withInterceptors[[]*Label](ctx, query, qr, query.inters)+ neighbors, err := withInterceptors[[]*Tag](ctx, query, qr, query.inters)if err != nil {return err}for _, n := range neighbors {nodes, ok := nids[n.ID]if !ok {- return fmt.Errorf(`unexpected "label" node returned %v`, n.ID)+ return fmt.Errorf(`unexpected "tag" node returned %v`, n.ID)}for kn := range nodes {assign(kn, n)diff --git a/backend/internal/data/ent/item_update.go b/backend/internal/data/ent/item_update.goindex 1ff6c01b..b730651e 100644--- a/backend/internal/data/ent/item_update.go+++ b/backend/internal/data/ent/item_update.go@@ -16,10 +16,10 @@ import ("github.com/sysadminsmedia/homebox/backend/internal/data/ent/group""github.com/sysadminsmedia/homebox/backend/internal/data/ent/item""github.com/sysadminsmedia/homebox/backend/internal/data/ent/itemfield"- "github.com/sysadminsmedia/homebox/backend/internal/data/ent/label""github.com/sysadminsmedia/homebox/backend/internal/data/ent/location""github.com/sysadminsmedia/homebox/backend/internal/data/ent/maintenanceentry""github.com/sysadminsmedia/homebox/backend/internal/data/ent/predicate"+ "github.com/sysadminsmedia/homebox/backend/internal/data/ent/tag")// ItemUpdate is the builder for updating Item entities.@@ -500,19 +500,19 @@ func (_u *ItemUpdate) AddChildren(v ...*Item) *ItemUpdate {return _u.AddChildIDs(ids...)}-// AddLabelIDs adds the "label" edge to the Label entity by IDs.-func (_u *ItemUpdate) AddLabelIDs(ids ...uuid.UUID) *ItemUpdate {- _u.mutation.AddLabelIDs(ids...)+// AddTagIDs adds the "tag" edge to the Tag entity by IDs.+func (_u *ItemUpdate) AddTagIDs(ids ...uuid.UUID) *ItemUpdate {+ _u.mutation.AddTagIDs(ids...)return _u}-// AddLabel adds the "label" edges to the Label entity.-func (_u *ItemUpdate) AddLabel(v ...*Label) *ItemUpdate {+// AddTag adds the "tag" edges to the Tag entity.+func (_u *ItemUpdate) AddTag(v ...*Tag) *ItemUpdate {ids := make([]uuid.UUID, len(v))for i := range v {ids[i] = v[i].ID}- return _u.AddLabelIDs(ids...)+ return _u.AddTagIDs(ids...)}// SetLocationID sets the "location" edge to the Location entity by ID.@@ -617,25 +617,25 @@ func (_u *ItemUpdate) RemoveChildren(v ...*Item) *ItemUpdate {return _u.RemoveChildIDs(ids...)}-// ClearLabel clears all "label" edges to the Label entity.-func (_u *ItemUpdate) ClearLabel() *ItemUpdate {- _u.mutation.ClearLabel()+// ClearTag clears all "tag" edges to the Tag entity.+func (_u *ItemUpdate) ClearTag() *ItemUpdate {+ _u.mutation.ClearTag()return _u}-// RemoveLabelIDs removes the "label" edge to Label entities by IDs.-func (_u *ItemUpdate) RemoveLabelIDs(ids ...uuid.UUID) *ItemUpdate {- _u.mutation.RemoveLabelIDs(ids...)+// RemoveTagIDs removes the "tag" edge to Tag entities by IDs.+func (_u *ItemUpdate) RemoveTagIDs(ids ...uuid.UUID) *ItemUpdate {+ _u.mutation.RemoveTagIDs(ids...)return _u}-// RemoveLabel removes "label" edges to Label entities.-func (_u *ItemUpdate) RemoveLabel(v ...*Label) *ItemUpdate {+// RemoveTag removes "tag" edges to Tag entities.+func (_u *ItemUpdate) RemoveTag(v ...*Tag) *ItemUpdate {ids := make([]uuid.UUID, len(v))for i := range v {ids[i] = v[i].ID}- return _u.RemoveLabelIDs(ids...)+ return _u.RemoveTagIDs(ids...)}// ClearLocation clears the "location" edge to the Location entity.@@ -1031,28 +1031,28 @@ func (_u *ItemUpdate) sqlSave(ctx context.Context) (_node int, err error) {}_spec.Edges.Add = append(_spec.Edges.Add, edge)}- if _u.mutation.LabelCleared() {+ if _u.mutation.TagCleared() {edge := &sqlgraph.EdgeSpec{Rel: sqlgraph.M2M,Inverse: true,- Table: item.LabelTable,- Columns: item.LabelPrimaryKey,+ Table: item.TagTable,+ Columns: item.TagPrimaryKey,Bidi: false,Target: &sqlgraph.EdgeTarget{- IDSpec: sqlgraph.NewFieldSpec(label.FieldID, field.TypeUUID),+ IDSpec: sqlgraph.NewFieldSpec(tag.FieldID, field.TypeUUID),},}_spec.Edges.Clear = append(_spec.Edges.Clear, edge)}- if nodes := _u.mutation.RemovedLabelIDs(); len(nodes) > 0 && !_u.mutation.LabelCleared() {+ if nodes := _u.mutation.RemovedTagIDs(); len(nodes) > 0 && !_u.mutation.TagCleared() {edge := &sqlgraph.EdgeSpec{Rel: sqlgraph.M2M,Inverse: true,- Table: item.LabelTable,- Columns: item.LabelPrimaryKey,+ Table: item.TagTable,+ Columns: item.TagPrimaryKey,Bidi: false,Target: &sqlgraph.EdgeTarget{- IDSpec: sqlgraph.NewFieldSpec(label.FieldID, field.TypeUUID),+ IDSpec: sqlgraph.NewFieldSpec(tag.FieldID, field.TypeUUID),},}for _, k := range nodes {@@ -1060,15 +1060,15 @@ func (_u *ItemUpdate) sqlSave(ctx context.Context) (_node int, err error) {}_spec.Edges.Clear = append(_spec.Edges.Clear, edge)}- if nodes := _u.mutation.LabelIDs(); len(nodes) > 0 {+ if nodes := _u.mutation.TagIDs(); len(nodes) > 0 {edge := &sqlgraph.EdgeSpec{Rel: sqlgraph.M2M,Inverse: true,- Table: item.LabelTable,- Columns: item.LabelPrimaryKey,+ Table: item.TagTable,+ Columns: item.TagPrimaryKey,Bidi: false,Target: &sqlgraph.EdgeTarget{- IDSpec: sqlgraph.NewFieldSpec(label.FieldID, field.TypeUUID),+ IDSpec: sqlgraph.NewFieldSpec(tag.FieldID, field.TypeUUID),},}for _, k := range nodes {@@ -1725,19 +1725,19 @@ func (_u *ItemUpdateOne) AddChildren(v ...*Item) *ItemUpdateOne {return _u.AddChildIDs(ids...)}-// AddLabelIDs adds the "label" edge to the Label entity by IDs.-func (_u *ItemUpdateOne) AddLabelIDs(ids ...uuid.UUID) *ItemUpdateOne {- _u.mutation.AddLabelIDs(ids...)+// AddTagIDs adds the "tag" edge to the Tag entity by IDs.+func (_u *ItemUpdateOne) AddTagIDs(ids ...uuid.UUID) *ItemUpdateOne {+ _u.mutation.AddTagIDs(ids...)return _u}-// AddLabel adds the "label" edges to the Label entity.-func (_u *ItemUpdateOne) AddLabel(v ...*Label) *ItemUpdateOne {+// AddTag adds the "tag" edges to the Tag entity.+func (_u *ItemUpdateOne) AddTag(v ...*Tag) *ItemUpdateOne {ids := make([]uuid.UUID, len(v))for i := range v {ids[i] = v[i].ID}- return _u.AddLabelIDs(ids...)+ return _u.AddTagIDs(ids...)}// SetLocationID sets the "location" edge to the Location entity by ID.@@ -1842,25 +1842,25 @@ func (_u *ItemUpdateOne) RemoveChildren(v ...*Item) *ItemUpdateOne {return _u.RemoveChildIDs(ids...)}-// ClearLabel clears all "label" edges to the Label entity.-func (_u *ItemUpdateOne) ClearLabel() *ItemUpdateOne {- _u.mutation.ClearLabel()+// ClearTag clears all "tag" edges to the Tag entity.+func (_u *ItemUpdateOne) ClearTag() *ItemUpdateOne {+ _u.mutation.ClearTag()return _u}-// RemoveLabelIDs removes the "label" edge to Label entities by IDs.-func (_u *ItemUpdateOne) RemoveLabelIDs(ids ...uuid.UUID) *ItemUpdateOne {- _u.mutation.RemoveLabelIDs(ids...)+// RemoveTagIDs removes the "tag" edge to Tag entities by IDs.+func (_u *ItemUpdateOne) RemoveTagIDs(ids ...uuid.UUID) *ItemUpdateOne {+ _u.mutation.RemoveTagIDs(ids...)return _u}-// RemoveLabel removes "label" edges to Label entities.-func (_u *ItemUpdateOne) RemoveLabel(v ...*Label) *ItemUpdateOne {+// RemoveTag removes "tag" edges to Tag entities.+func (_u *ItemUpdateOne) RemoveTag(v ...*Tag) *ItemUpdateOne {ids := make([]uuid.UUID, len(v))for i := range v {ids[i] = v[i].ID}- return _u.RemoveLabelIDs(ids...)+ return _u.RemoveTagIDs(ids...)}// ClearLocation clears the "location" edge to the Location entity.@@ -2286,28 +2286,28 @@ func (_u *ItemUpdateOne) sqlSave(ctx context.Context) (_node *Item, err error) {}_spec.Edges.Add = append(_spec.Edges.Add, edge)}- if _u.mutation.LabelCleared() {+ if _u.mutation.TagCleared() {edge := &sqlgraph.EdgeSpec{Rel: sqlgraph.M2M,Inverse: true,- Table: item.LabelTable,- Columns: item.LabelPrimaryKey,+ Table: item.TagTable,+ Columns: item.TagPrimaryKey,Bidi: false,Target: &sqlgraph.EdgeTarget{- IDSpec: sqlgraph.NewFieldSpec(label.FieldID, field.TypeUUID),+ IDSpec: sqlgraph.NewFieldSpec(tag.FieldID, field.TypeUUID),},}_spec.Edges.Clear = append(_spec.Edges.Clear, edge)}- if nodes := _u.mutation.RemovedLabelIDs(); len(nodes) > 0 && !_u.mutation.LabelCleared() {+ if nodes := _u.mutation.RemovedTagIDs(); len(nodes) > 0 && !_u.mutation.TagCleared() {edge := &sqlgraph.EdgeSpec{Rel: sqlgraph.M2M,Inverse: true,- Table: item.LabelTable,- Columns: item.LabelPrimaryKey,+ Table: item.TagTable,+ Columns: item.TagPrimaryKey,Bidi: false,Target: &sqlgraph.EdgeTarget{- IDSpec: sqlgraph.NewFieldSpec(label.FieldID, field.TypeUUID),+ IDSpec: sqlgraph.NewFieldSpec(tag.FieldID, field.TypeUUID),},}for _, k := range nodes {@@ -2315,15 +2315,15 @@ func (_u *ItemUpdateOne) sqlSave(ctx context.Context) (_node *Item, err error) {}_spec.Edges.Clear = append(_spec.Edges.Clear, edge)}- if nodes := _u.mutation.LabelIDs(); len(nodes) > 0 {+ if nodes := _u.mutation.TagIDs(); len(nodes) > 0 {edge := &sqlgraph.EdgeSpec{Rel: sqlgraph.M2M,Inverse: true,- Table: item.LabelTable,- Columns: item.LabelPrimaryKey,+ Table: item.TagTable,+ Columns: item.TagPrimaryKey,Bidi: false,Target: &sqlgraph.EdgeTarget{- IDSpec: sqlgraph.NewFieldSpec(label.FieldID, field.TypeUUID),+ IDSpec: sqlgraph.NewFieldSpec(tag.FieldID, field.TypeUUID),},}for _, k := range nodes {diff --git a/backend/internal/data/ent/itemtemplate.go b/backend/internal/data/ent/itemtemplate.goindex 0d9f1f2f..6d498b93 100644--- a/backend/internal/data/ent/itemtemplate.go+++ b/backend/internal/data/ent/itemtemplate.go@@ -53,8 +53,8 @@ type ItemTemplate struct {IncludePurchaseFields bool `json:"include_purchase_fields,omitempty"`// Whether to include sold fields in items created from this templateIncludeSoldFields bool `json:"include_sold_fields,omitempty"`- // Default label IDs for items created from this template- DefaultLabelIds []uuid.UUID `json:"default_label_ids,omitempty"`+ // Default tag IDs for items created from this template+ DefaultTagIds []uuid.UUID `json:"default_tag_ids,omitempty"`// Edges holds the relations/edges for other nodes in the graph.// The values are being populated by the ItemTemplateQuery when eager-loading is set.Edges ItemTemplateEdges `json:"edges"`@@ -112,7 +112,7 @@ func (*ItemTemplate) scanValues(columns []string) ([]any, error) {values := make([]any, len(columns))for i := range columns {switch columns[i] {- case itemtemplate.FieldDefaultLabelIds:+ case itemtemplate.FieldDefaultTagIds:values[i] = new([]byte)case itemtemplate.FieldDefaultInsured, itemtemplate.FieldDefaultLifetimeWarranty, itemtemplate.FieldIncludeWarrantyFields, itemtemplate.FieldIncludePurchaseFields, itemtemplate.FieldIncludeSoldFields:values[i] = new(sql.NullBool)@@ -245,12 +245,12 @@ func (_m *ItemTemplate) assignValues(columns []string, values []any) error {} else if value.Valid {_m.IncludeSoldFields = value.Bool}- case itemtemplate.FieldDefaultLabelIds:+ case itemtemplate.FieldDefaultTagIds:if value, ok := values[i].(*[]byte); !ok {- return fmt.Errorf("unexpected type %T for field default_label_ids", values[i])+ return fmt.Errorf("unexpected type %T for field default_tag_ids", values[i])} else if value != nil && len(*value) > 0 {- if err := json.Unmarshal(*value, &_m.DefaultLabelIds); err != nil {- return fmt.Errorf("unmarshal field default_label_ids: %w", err)+ if err := json.Unmarshal(*value, &_m.DefaultTagIds); err != nil {+ return fmt.Errorf("unmarshal field default_tag_ids: %w", err)}}case itemtemplate.ForeignKeys[0]:@@ -366,8 +366,8 @@ func (_m *ItemTemplate) String() string {builder.WriteString("include_sold_fields=")builder.WriteString(fmt.Sprintf("%v", _m.IncludeSoldFields))builder.WriteString(", ")- builder.WriteString("default_label_ids=")- builder.WriteString(fmt.Sprintf("%v", _m.DefaultLabelIds))+ builder.WriteString("default_tag_ids=")+ builder.WriteString(fmt.Sprintf("%v", _m.DefaultTagIds))builder.WriteByte(')')return builder.String()}diff --git a/backend/internal/data/ent/itemtemplate/itemtemplate.go b/backend/internal/data/ent/itemtemplate/itemtemplate.goindex ac308b9d..5f1e8c0b 100644--- a/backend/internal/data/ent/itemtemplate/itemtemplate.go+++ b/backend/internal/data/ent/itemtemplate/itemtemplate.go@@ -47,8 +47,8 @@ const (FieldIncludePurchaseFields = "include_purchase_fields"// FieldIncludeSoldFields holds the string denoting the include_sold_fields field in the database.FieldIncludeSoldFields = "include_sold_fields"- // FieldDefaultLabelIds holds the string denoting the default_label_ids field in the database.- FieldDefaultLabelIds = "default_label_ids"+ // FieldDefaultTagIds holds the string denoting the default_tag_ids field in the database.+ FieldDefaultTagIds = "default_tag_ids"// EdgeGroup holds the string denoting the group edge name in mutations.EdgeGroup = "group"// EdgeFields holds the string denoting the fields edge name in mutations.@@ -99,7 +99,7 @@ var Columns = []string{FieldIncludeWarrantyFields,FieldIncludePurchaseFields,FieldIncludeSoldFields,- FieldDefaultLabelIds,+ FieldDefaultTagIds,}// ForeignKeys holds the SQL foreign-keys that are owned by the "item_templates"diff --git a/backend/internal/data/ent/itemtemplate/where.go b/backend/internal/data/ent/itemtemplate/where.goindex 1ade7376..e5a4910a 100644--- a/backend/internal/data/ent/itemtemplate/where.go+++ b/backend/internal/data/ent/itemtemplate/where.go@@ -896,14 +896,14 @@ func IncludeSoldFieldsNEQ(v bool) predicate.ItemTemplate {return predicate.ItemTemplate(sql.FieldNEQ(FieldIncludeSoldFields, v))}-// DefaultLabelIdsIsNil applies the IsNil predicate on the "default_label_ids" field.-func DefaultLabelIdsIsNil() predicate.ItemTemplate {- return predicate.ItemTemplate(sql.FieldIsNull(FieldDefaultLabelIds))+// DefaultTagIdsIsNil applies the IsNil predicate on the "default_tag_ids" field.+func DefaultTagIdsIsNil() predicate.ItemTemplate {+ return predicate.ItemTemplate(sql.FieldIsNull(FieldDefaultTagIds))}-// DefaultLabelIdsNotNil applies the NotNil predicate on the "default_label_ids" field.-func DefaultLabelIdsNotNil() predicate.ItemTemplate {- return predicate.ItemTemplate(sql.FieldNotNull(FieldDefaultLabelIds))+// DefaultTagIdsNotNil applies the NotNil predicate on the "default_tag_ids" field.+func DefaultTagIdsNotNil() predicate.ItemTemplate {+ return predicate.ItemTemplate(sql.FieldNotNull(FieldDefaultTagIds))}// HasGroup applies the HasEdge predicate on the "group" edge.diff --git a/backend/internal/data/ent/itemtemplate_create.go b/backend/internal/data/ent/itemtemplate_create.goindex 30abd074..8a0f818e 100644--- a/backend/internal/data/ent/itemtemplate_create.go+++ b/backend/internal/data/ent/itemtemplate_create.go@@ -240,9 +240,9 @@ func (_c *ItemTemplateCreate) SetNillableIncludeSoldFields(v *bool) *ItemTemplatreturn _c}-// SetDefaultLabelIds sets the "default_label_ids" field.-func (_c *ItemTemplateCreate) SetDefaultLabelIds(v []uuid.UUID) *ItemTemplateCreate {- _c.mutation.SetDefaultLabelIds(v)+// SetDefaultTagIds sets the "default_tag_ids" field.+func (_c *ItemTemplateCreate) SetDefaultTagIds(v []uuid.UUID) *ItemTemplateCreate {+ _c.mutation.SetDefaultTagIds(v)return _c}@@ -549,9 +549,9 @@ func (_c *ItemTemplateCreate) createSpec() (*ItemTemplate, *sqlgraph.CreateSpec)_spec.SetField(itemtemplate.FieldIncludeSoldFields, field.TypeBool, value)_node.IncludeSoldFields = value}- if value, ok := _c.mutation.DefaultLabelIds(); ok {- _spec.SetField(itemtemplate.FieldDefaultLabelIds, field.TypeJSON, value)- _node.DefaultLabelIds = value+ if value, ok := _c.mutation.DefaultTagIds(); ok {+ _spec.SetField(itemtemplate.FieldDefaultTagIds, field.TypeJSON, value)+ _node.DefaultTagIds = value}if nodes := _c.mutation.GroupIDs(); len(nodes) > 0 {edge := &sqlgraph.EdgeSpec{diff --git a/backend/internal/data/ent/itemtemplate_update.go b/backend/internal/data/ent/itemtemplate_update.goindex 768505ba..b0368255 100644--- a/backend/internal/data/ent/itemtemplate_update.go+++ b/backend/internal/data/ent/itemtemplate_update.go@@ -284,21 +284,21 @@ func (_u *ItemTemplateUpdate) SetNillableIncludeSoldFields(v *bool) *ItemTemplatreturn _u}-// SetDefaultLabelIds sets the "default_label_ids" field.-func (_u *ItemTemplateUpdate) SetDefaultLabelIds(v []uuid.UUID) *ItemTemplateUpdate {- _u.mutation.SetDefaultLabelIds(v)+// SetDefaultTagIds sets the "default_tag_ids" field.+func (_u *ItemTemplateUpdate) SetDefaultTagIds(v []uuid.UUID) *ItemTemplateUpdate {+ _u.mutation.SetDefaultTagIds(v)return _u}-// AppendDefaultLabelIds appends value to the "default_label_ids" field.-func (_u *ItemTemplateUpdate) AppendDefaultLabelIds(v []uuid.UUID) *ItemTemplateUpdate {- _u.mutation.AppendDefaultLabelIds(v)+// AppendDefaultTagIds appends value to the "default_tag_ids" field.+func (_u *ItemTemplateUpdate) AppendDefaultTagIds(v []uuid.UUID) *ItemTemplateUpdate {+ _u.mutation.AppendDefaultTagIds(v)return _u}-// ClearDefaultLabelIds clears the value of the "default_label_ids" field.-func (_u *ItemTemplateUpdate) ClearDefaultLabelIds() *ItemTemplateUpdate {- _u.mutation.ClearDefaultLabelIds()+// ClearDefaultTagIds clears the value of the "default_tag_ids" field.+func (_u *ItemTemplateUpdate) ClearDefaultTagIds() *ItemTemplateUpdate {+ _u.mutation.ClearDefaultTagIds()return _u}@@ -550,16 +550,16 @@ func (_u *ItemTemplateUpdate) sqlSave(ctx context.Context) (_node int, err errorif value, ok := _u.mutation.IncludeSoldFields(); ok {_spec.SetField(itemtemplate.FieldIncludeSoldFields, field.TypeBool, value)}- if value, ok := _u.mutation.DefaultLabelIds(); ok {- _spec.SetField(itemtemplate.FieldDefaultLabelIds, field.TypeJSON, value)+ if value, ok := _u.mutation.DefaultTagIds(); ok {+ _spec.SetField(itemtemplate.FieldDefaultTagIds, field.TypeJSON, value)}- if value, ok := _u.mutation.AppendedDefaultLabelIds(); ok {+ if value, ok := _u.mutation.AppendedDefaultTagIds(); ok {_spec.AddModifier(func(u *sql.UpdateBuilder) {- sqljson.Append(u, itemtemplate.FieldDefaultLabelIds, value)+ sqljson.Append(u, itemtemplate.FieldDefaultTagIds, value)})}- if _u.mutation.DefaultLabelIdsCleared() {- _spec.ClearField(itemtemplate.FieldDefaultLabelIds, field.TypeJSON)+ if _u.mutation.DefaultTagIdsCleared() {+ _spec.ClearField(itemtemplate.FieldDefaultTagIds, field.TypeJSON)}if _u.mutation.GroupCleared() {edge := &sqlgraph.EdgeSpec{@@ -935,21 +935,21 @@ func (_u *ItemTemplateUpdateOne) SetNillableIncludeSoldFields(v *bool) *ItemTempreturn _u}-// SetDefaultLabelIds sets the "default_label_ids" field.-func (_u *ItemTemplateUpdateOne) SetDefaultLabelIds(v []uuid.UUID) *ItemTemplateUpdateOne {- _u.mutation.SetDefaultLabelIds(v)+// SetDefaultTagIds sets the "default_tag_ids" field.+func (_u *ItemTemplateUpdateOne) SetDefaultTagIds(v []uuid.UUID) *ItemTemplateUpdateOne {+ _u.mutation.SetDefaultTagIds(v)return _u}-// AppendDefaultLabelIds appends value to the "default_label_ids" field.-func (_u *ItemTemplateUpdateOne) AppendDefaultLabelIds(v []uuid.UUID) *ItemTemplateUpdateOne {- _u.mutation.AppendDefaultLabelIds(v)+// AppendDefaultTagIds appends value to the "default_tag_ids" field.+func (_u *ItemTemplateUpdateOne) AppendDefaultTagIds(v []uuid.UUID) *ItemTemplateUpdateOne {+ _u.mutation.AppendDefaultTagIds(v)return _u}-// ClearDefaultLabelIds clears the value of the "default_label_ids" field.-func (_u *ItemTemplateUpdateOne) ClearDefaultLabelIds() *ItemTemplateUpdateOne {- _u.mutation.ClearDefaultLabelIds()+// ClearDefaultTagIds clears the value of the "default_tag_ids" field.+func (_u *ItemTemplateUpdateOne) ClearDefaultTagIds() *ItemTemplateUpdateOne {+ _u.mutation.ClearDefaultTagIds()return _u}@@ -1231,16 +1231,16 @@ func (_u *ItemTemplateUpdateOne) sqlSave(ctx context.Context) (_node *ItemTemplaif value, ok := _u.mutation.IncludeSoldFields(); ok {_spec.SetField(itemtemplate.FieldIncludeSoldFields, field.TypeBool, value)}- if value, ok := _u.mutation.DefaultLabelIds(); ok {- _spec.SetField(itemtemplate.FieldDefaultLabelIds, field.TypeJSON, value)+ if value, ok := _u.mutation.DefaultTagIds(); ok {+ _spec.SetField(itemtemplate.FieldDefaultTagIds, field.TypeJSON, value)}- if value, ok := _u.mutation.AppendedDefaultLabelIds(); ok {+ if value, ok := _u.mutation.AppendedDefaultTagIds(); ok {_spec.AddModifier(func(u *sql.UpdateBuilder) {- sqljson.Append(u, itemtemplate.FieldDefaultLabelIds, value)+ sqljson.Append(u, itemtemplate.FieldDefaultTagIds, value)})}- if _u.mutation.DefaultLabelIdsCleared() {- _spec.ClearField(itemtemplate.FieldDefaultLabelIds, field.TypeJSON)+ if _u.mutation.DefaultTagIdsCleared() {+ _spec.ClearField(itemtemplate.FieldDefaultTagIds, field.TypeJSON)}if _u.mutation.GroupCleared() {edge := &sqlgraph.EdgeSpec{diff --git a/backend/internal/data/ent/label/where.go b/backend/internal/data/ent/label/where.godeleted file mode 100644index 7a2f2403..00000000--- a/backend/internal/data/ent/label/where.go+++ /dev/null@@ -1,438 +0,0 @@-// Code generated by ent, DO NOT EDIT.--package label--import (- "time"-- "entgo.io/ent/dialect/sql"- "entgo.io/ent/dialect/sql/sqlgraph"- "github.com/google/uuid"- "github.com/sysadminsmedia/homebox/backend/internal/data/ent/predicate"-)--// ID filters vertices based on their ID field.-func ID(id uuid.UUID) predicate.Label {- return predicate.Label(sql.FieldEQ(FieldID, id))-}--// IDEQ applies the EQ predicate on the ID field.-func IDEQ(id uuid.UUID) predicate.Label {- return predicate.Label(sql.FieldEQ(FieldID, id))-}--// IDNEQ applies the NEQ predicate on the ID field.-func IDNEQ(id uuid.UUID) predicate.Label {- return predicate.Label(sql.FieldNEQ(FieldID, id))-}--// IDIn applies the In predicate on the ID field.-func IDIn(ids ...uuid.UUID) predicate.Label {- return predicate.Label(sql.FieldIn(FieldID, ids...))-}--// IDNotIn applies the NotIn predicate on the ID field.-func IDNotIn(ids ...uuid.UUID) predicate.Label {- return predicate.Label(sql.FieldNotIn(FieldID, ids...))-}--// IDGT applies the GT predicate on the ID field.-func IDGT(id uuid.UUID) predicate.Label {- return predicate.Label(sql.FieldGT(FieldID, id))-}--// IDGTE applies the GTE predicate on the ID field.-func IDGTE(id uuid.UUID) predicate.Label {- return predicate.Label(sql.FieldGTE(FieldID, id))-}--// IDLT applies the LT predicate on the ID field.-func IDLT(id uuid.UUID) predicate.Label {- return predicate.Label(sql.FieldLT(FieldID, id))-}--// IDLTE applies the LTE predicate on the ID field.-func IDLTE(id uuid.UUID) predicate.Label {- return predicate.Label(sql.FieldLTE(FieldID, id))-}--// CreatedAt applies equality check predicate on the "created_at" field. It's identical to CreatedAtEQ.-func CreatedAt(v time.Time) predicate.Label {- return predicate.Label(sql.FieldEQ(FieldCreatedAt, v))-}--// UpdatedAt applies equality check predicate on the "updated_at" field. It's identical to UpdatedAtEQ.-func UpdatedAt(v time.Time) predicate.Label {- return predicate.Label(sql.FieldEQ(FieldUpdatedAt, v))-}--// Name applies equality check predicate on the "name" field. It's identical to NameEQ.-func Name(v string) predicate.Label {- return predicate.Label(sql.FieldEQ(FieldName, v))-}--// Description applies equality check predicate on the "description" field. It's identical to DescriptionEQ.-func Description(v string) predicate.Label {- return predicate.Label(sql.FieldEQ(FieldDescription, v))-}--// Color applies equality check predicate on the "color" field. It's identical to ColorEQ.-func Color(v string) predicate.Label {- return predicate.Label(sql.FieldEQ(FieldColor, v))-}--// CreatedAtEQ applies the EQ predicate on the "created_at" field.-func CreatedAtEQ(v time.Time) predicate.Label {- return predicate.Label(sql.FieldEQ(FieldCreatedAt, v))-}--// CreatedAtNEQ applies the NEQ predicate on the "created_at" field.-func CreatedAtNEQ(v time.Time) predicate.Label {- return predicate.Label(sql.FieldNEQ(FieldCreatedAt, v))-}--// CreatedAtIn applies the In predicate on the "created_at" field.-func CreatedAtIn(vs ...time.Time) predicate.Label {- return predicate.Label(sql.FieldIn(FieldCreatedAt, vs...))-}--// CreatedAtNotIn applies the NotIn predicate on the "created_at" field.-func CreatedAtNotIn(vs ...time.Time) predicate.Label {- return predicate.Label(sql.FieldNotIn(FieldCreatedAt, vs...))-}--// CreatedAtGT applies the GT predicate on the "created_at" field.-func CreatedAtGT(v time.Time) predicate.Label {- return predicate.Label(sql.FieldGT(FieldCreatedAt, v))-}--// CreatedAtGTE applies the GTE predicate on the "created_at" field.-func CreatedAtGTE(v time.Time) predicate.Label {- return predicate.Label(sql.FieldGTE(FieldCreatedAt, v))-}--// CreatedAtLT applies the LT predicate on the "created_at" field.-func CreatedAtLT(v time.Time) predicate.Label {- return predicate.Label(sql.FieldLT(FieldCreatedAt, v))-}--// CreatedAtLTE applies the LTE predicate on the "created_at" field.-func CreatedAtLTE(v time.Time) predicate.Label {- return predicate.Label(sql.FieldLTE(FieldCreatedAt, v))-}--// UpdatedAtEQ applies the EQ predicate on the "updated_at" field.-func UpdatedAtEQ(v time.Time) predicate.Label {- return predicate.Label(sql.FieldEQ(FieldUpdatedAt, v))-}--// UpdatedAtNEQ applies the NEQ predicate on the "updated_at" field.-func UpdatedAtNEQ(v time.Time) predicate.Label {- return predicate.Label(sql.FieldNEQ(FieldUpdatedAt, v))-}--// UpdatedAtIn applies the In predicate on the "updated_at" field.-func UpdatedAtIn(vs ...time.Time) predicate.Label {- return predicate.Label(sql.FieldIn(FieldUpdatedAt, vs...))-}--// UpdatedAtNotIn applies the NotIn predicate on the "updated_at" field.-func UpdatedAtNotIn(vs ...time.Time) predicate.Label {- return predicate.Label(sql.FieldNotIn(FieldUpdatedAt, vs...))-}--// UpdatedAtGT applies the GT predicate on the "updated_at" field.-func UpdatedAtGT(v time.Time) predicate.Label {- return predicate.Label(sql.FieldGT(FieldUpdatedAt, v))-}--// UpdatedAtGTE applies the GTE predicate on the "updated_at" field.-func UpdatedAtGTE(v time.Time) predicate.Label {- return predicate.Label(sql.FieldGTE(FieldUpdatedAt, v))-}--// UpdatedAtLT applies the LT predicate on the "updated_at" field.-func UpdatedAtLT(v time.Time) predicate.Label {- return predicate.Label(sql.FieldLT(FieldUpdatedAt, v))-}--// UpdatedAtLTE applies the LTE predicate on the "updated_at" field.-func UpdatedAtLTE(v time.Time) predicate.Label {- return predicate.Label(sql.FieldLTE(FieldUpdatedAt, v))-}--// NameEQ applies the EQ predicate on the "name" field.-func NameEQ(v string) predicate.Label {- return predicate.Label(sql.FieldEQ(FieldName, v))-}--// NameNEQ applies the NEQ predicate on the "name" field.-func NameNEQ(v string) predicate.Label {- return predicate.Label(sql.FieldNEQ(FieldName, v))-}--// NameIn applies the In predicate on the "name" field.-func NameIn(vs ...string) predicate.Label {- return predicate.Label(sql.FieldIn(FieldName, vs...))-}--// NameNotIn applies the NotIn predicate on the "name" field.-func NameNotIn(vs ...string) predicate.Label {- return predicate.Label(sql.FieldNotIn(FieldName, vs...))-}--// NameGT applies the GT predicate on the "name" field.-func NameGT(v string) predicate.Label {- return predicate.Label(sql.FieldGT(FieldName, v))-}--// NameGTE applies the GTE predicate on the "name" field.-func NameGTE(v string) predicate.Label {- return predicate.Label(sql.FieldGTE(FieldName, v))-}--// NameLT applies the LT predicate on the "name" field.-func NameLT(v string) predicate.Label {- return predicate.Label(sql.FieldLT(FieldName, v))-}--// NameLTE applies the LTE predicate on the "name" field.-func NameLTE(v string) predicate.Label {- return predicate.Label(sql.FieldLTE(FieldName, v))-}--// NameContains applies the Contains predicate on the "name" field.-func NameContains(v string) predicate.Label {- return predicate.Label(sql.FieldContains(FieldName, v))-}--// NameHasPrefix applies the HasPrefix predicate on the "name" field.-func NameHasPrefix(v string) predicate.Label {- return predicate.Label(sql.FieldHasPrefix(FieldName, v))-}--// NameHasSuffix applies the HasSuffix predicate on the "name" field.-func NameHasSuffix(v string) predicate.Label {- return predicate.Label(sql.FieldHasSuffix(FieldName, v))-}--// NameEqualFold applies the EqualFold predicate on the "name" field.-func NameEqualFold(v string) predicate.Label {- return predicate.Label(sql.FieldEqualFold(FieldName, v))-}--// NameContainsFold applies the ContainsFold predicate on the "name" field.-func NameContainsFold(v string) predicate.Label {- return predicate.Label(sql.FieldContainsFold(FieldName, v))-}--// DescriptionEQ applies the EQ predicate on the "description" field.-func DescriptionEQ(v string) predicate.Label {- return predicate.Label(sql.FieldEQ(FieldDescription, v))-}--// DescriptionNEQ applies the NEQ predicate on the "description" field.-func DescriptionNEQ(v string) predicate.Label {- return predicate.Label(sql.FieldNEQ(FieldDescription, v))-}--// DescriptionIn applies the In predicate on the "description" field.-func DescriptionIn(vs ...string) predicate.Label {- return predicate.Label(sql.FieldIn(FieldDescription, vs...))-}--// DescriptionNotIn applies the NotIn predicate on the "description" field.-func DescriptionNotIn(vs ...string) predicate.Label {- return predicate.Label(sql.FieldNotIn(FieldDescription, vs...))-}--// DescriptionGT applies the GT predicate on the "description" field.-func DescriptionGT(v string) predicate.Label {- return predicate.Label(sql.FieldGT(FieldDescription, v))-}--// DescriptionGTE applies the GTE predicate on the "description" field.-func DescriptionGTE(v string) predicate.Label {- return predicate.Label(sql.FieldGTE(FieldDescription, v))-}--// DescriptionLT applies the LT predicate on the "description" field.-func DescriptionLT(v string) predicate.Label {- return predicate.Label(sql.FieldLT(FieldDescription, v))-}--// DescriptionLTE applies the LTE predicate on the "description" field.-func DescriptionLTE(v string) predicate.Label {- return predicate.Label(sql.FieldLTE(FieldDescription, v))-}--// DescriptionContains applies the Contains predicate on the "description" field.-func DescriptionContains(v string) predicate.Label {- return predicate.Label(sql.FieldContains(FieldDescription, v))-}--// DescriptionHasPrefix applies the HasPrefix predicate on the "description" field.-func DescriptionHasPrefix(v string) predicate.Label {- return predicate.Label(sql.FieldHasPrefix(FieldDescription, v))-}--// DescriptionHasSuffix applies the HasSuffix predicate on the "description" field.-func DescriptionHasSuffix(v string) predicate.Label {- return predicate.Label(sql.FieldHasSuffix(FieldDescription, v))-}--// DescriptionIsNil applies the IsNil predicate on the "description" field.-func DescriptionIsNil() predicate.Label {- return predicate.Label(sql.FieldIsNull(FieldDescription))-}--// DescriptionNotNil applies the NotNil predicate on the "description" field.-func DescriptionNotNil() predicate.Label {- return predicate.Label(sql.FieldNotNull(FieldDescription))-}--// DescriptionEqualFold applies the EqualFold predicate on the "description" field.-func DescriptionEqualFold(v string) predicate.Label {- return predicate.Label(sql.FieldEqualFold(FieldDescription, v))-}--// DescriptionContainsFold applies the ContainsFold predicate on the "description" field.-func DescriptionContainsFold(v string) predicate.Label {- return predicate.Label(sql.FieldContainsFold(FieldDescription, v))-}--// ColorEQ applies the EQ predicate on the "color" field.-func ColorEQ(v string) predicate.Label {- return predicate.Label(sql.FieldEQ(FieldColor, v))-}--// ColorNEQ applies the NEQ predicate on the "color" field.-func ColorNEQ(v string) predicate.Label {- return predicate.Label(sql.FieldNEQ(FieldColor, v))-}--// ColorIn applies the In predicate on the "color" field.-func ColorIn(vs ...string) predicate.Label {- return predicate.Label(sql.FieldIn(FieldColor, vs...))-}--// ColorNotIn applies the NotIn predicate on the "color" field.-func ColorNotIn(vs ...string) predicate.Label {- return predicate.Label(sql.FieldNotIn(FieldColor, vs...))-}--// ColorGT applies the GT predicate on the "color" field.-func ColorGT(v string) predicate.Label {- return predicate.Label(sql.FieldGT(FieldColor, v))-}--// ColorGTE applies the GTE predicate on the "color" field.-func ColorGTE(v string) predicate.Label {- return predicate.Label(sql.FieldGTE(FieldColor, v))-}--// ColorLT applies the LT predicate on the "color" field.-func ColorLT(v string) predicate.Label {- return predicate.Label(sql.FieldLT(FieldColor, v))-}--// ColorLTE applies the LTE predicate on the "color" field.-func ColorLTE(v string) predicate.Label {- return predicate.Label(sql.FieldLTE(FieldColor, v))-}--// ColorContains applies the Contains predicate on the "color" field.-func ColorContains(v string) predicate.Label {- return predicate.Label(sql.FieldContains(FieldColor, v))-}--// ColorHasPrefix applies the HasPrefix predicate on the "color" field.-func ColorHasPrefix(v string) predicate.Label {- return predicate.Label(sql.FieldHasPrefix(FieldColor, v))-}--// ColorHasSuffix applies the HasSuffix predicate on the "color" field.-func ColorHasSuffix(v string) predicate.Label {- return predicate.Label(sql.FieldHasSuffix(FieldColor, v))-}--// ColorIsNil applies the IsNil predicate on the "color" field.-func ColorIsNil() predicate.Label {- return predicate.Label(sql.FieldIsNull(FieldColor))-}--// ColorNotNil applies the NotNil predicate on the "color" field.-func ColorNotNil() predicate.Label {- return predicate.Label(sql.FieldNotNull(FieldColor))-}--// ColorEqualFold applies the EqualFold predicate on the "color" field.-func ColorEqualFold(v string) predicate.Label {- return predicate.Label(sql.FieldEqualFold(FieldColor, v))-}--// ColorContainsFold applies the ContainsFold predicate on the "color" field.-func ColorContainsFold(v string) predicate.Label {- return predicate.Label(sql.FieldContainsFold(FieldColor, v))-}--// HasGroup applies the HasEdge predicate on the "group" edge.-func HasGroup() predicate.Label {- return predicate.Label(func(s *sql.Selector) {- step := sqlgraph.NewStep(- sqlgraph.From(Table, FieldID),- sqlgraph.Edge(sqlgraph.M2O, true, GroupTable, GroupColumn),- )- sqlgraph.HasNeighbors(s, step)- })-}--// HasGroupWith applies the HasEdge predicate on the "group" edge with a given conditions (other predicates).-func HasGroupWith(preds ...predicate.Group) predicate.Label {- return predicate.Label(func(s *sql.Selector) {- step := newGroupStep()- sqlgraph.HasNeighborsWith(s, step, func(s *sql.Selector) {- for _, p := range preds {- p(s)- }- })- })-}--// HasItems applies the HasEdge predicate on the "items" edge.-func HasItems() predicate.Label {- return predicate.Label(func(s *sql.Selector) {- step := sqlgraph.NewStep(- sqlgraph.From(Table, FieldID),- sqlgraph.Edge(sqlgraph.M2M, false, ItemsTable, ItemsPrimaryKey...),- )- sqlgraph.HasNeighbors(s, step)- })-}--// HasItemsWith applies the HasEdge predicate on the "items" edge with a given conditions (other predicates).-func HasItemsWith(preds ...predicate.Item) predicate.Label {- return predicate.Label(func(s *sql.Selector) {- step := newItemsStep()- sqlgraph.HasNeighborsWith(s, step, func(s *sql.Selector) {- for _, p := range preds {- p(s)- }- })- })-}--// And groups predicates with the AND operator between them.-func And(predicates ...predicate.Label) predicate.Label {- return predicate.Label(sql.AndPredicates(predicates...))-}--// Or groups predicates with the OR operator between them.-func Or(predicates ...predicate.Label) predicate.Label {- return predicate.Label(sql.OrPredicates(predicates...))-}--// Not applies the not operator on the given predicate.-func Not(p predicate.Label) predicate.Label {- return predicate.Label(sql.NotPredicates(p))-}diff --git a/backend/internal/data/ent/migrate/schema.go b/backend/internal/data/ent/migrate/schema.goindex 743d9b27..9091729a 100644--- a/backend/internal/data/ent/migrate/schema.go+++ b/backend/internal/data/ent/migrate/schema.go@@ -265,7 +265,7 @@ var ({Name: "include_warranty_fields", Type: field.TypeBool, Default: false},{Name: "include_purchase_fields", Type: field.TypeBool, Default: false},{Name: "include_sold_fields", Type: field.TypeBool, Default: false},- {Name: "default_label_ids", Type: field.TypeJSON, Nullable: true},+ {Name: "default_tag_ids", Type: field.TypeJSON, Nullable: true},{Name: "group_item_templates", Type: field.TypeUUID},{Name: "item_template_location", Type: field.TypeUUID, Nullable: true},}@@ -296,30 +296,6 @@ var (},},}- // LabelsColumns holds the columns for the "labels" table.- LabelsColumns = []*schema.Column{- {Name: "id", Type: field.TypeUUID},- {Name: "created_at", Type: field.TypeTime},- {Name: "updated_at", Type: field.TypeTime},- {Name: "name", Type: field.TypeString, Size: 255},- {Name: "description", Type: field.TypeString, Nullable: true, Size: 1000},- {Name: "color", Type: field.TypeString, Nullable: true, Size: 255},- {Name: "group_labels", Type: field.TypeUUID},- }- // LabelsTable holds the schema information for the "labels" table.- LabelsTable = &schema.Table{- Name: "labels",- Columns: LabelsColumns,- PrimaryKey: []*schema.Column{LabelsColumns[0]},- ForeignKeys: []*schema.ForeignKey{- {- Symbol: "labels_groups_labels",- Columns: []*schema.Column{LabelsColumns[6]},- RefColumns: []*schema.Column{GroupsColumns[0]},- OnDelete: schema.Cascade,- },- },- }// LocationsColumns holds the columns for the "locations" table.LocationsColumns = []*schema.Column{{Name: "id", Type: field.TypeUUID},@@ -429,6 +405,30 @@ var (},},}+ // TagsColumns holds the columns for the "tags" table.+ TagsColumns = []*schema.Column{+ {Name: "id", Type: field.TypeUUID},+ {Name: "created_at", Type: field.TypeTime},+ {Name: "updated_at", Type: field.TypeTime},+ {Name: "name", Type: field.TypeString, Size: 255},+ {Name: "description", Type: field.TypeString, Nullable: true, Size: 1000},+ {Name: "color", Type: field.TypeString, Nullable: true, Size: 255},+ {Name: "group_tags", Type: field.TypeUUID},+ }+ // TagsTable holds the schema information for the "tags" table.+ TagsTable = &schema.Table{+ Name: "tags",+ Columns: TagsColumns,+ PrimaryKey: []*schema.Column{TagsColumns[0]},+ ForeignKeys: []*schema.ForeignKey{+ {+ Symbol: "tags_groups_tags",+ Columns: []*schema.Column{TagsColumns[6]},+ RefColumns: []*schema.Column{GroupsColumns[0]},+ OnDelete: schema.Cascade,+ },+ },+ }// TemplateFieldsColumns holds the columns for the "template_fields" table.TemplateFieldsColumns = []*schema.Column{{Name: "id", Type: field.TypeUUID},@@ -483,26 +483,26 @@ var (},},}- // LabelItemsColumns holds the columns for the "label_items" table.- LabelItemsColumns = []*schema.Column{- {Name: "label_id", Type: field.TypeUUID},+ // TagItemsColumns holds the columns for the "tag_items" table.+ TagItemsColumns = []*schema.Column{+ {Name: "tag_id", Type: field.TypeUUID},{Name: "item_id", Type: field.TypeUUID},}- // LabelItemsTable holds the schema information for the "label_items" table.- LabelItemsTable = &schema.Table{- Name: "label_items",- Columns: LabelItemsColumns,- PrimaryKey: []*schema.Column{LabelItemsColumns[0], LabelItemsColumns[1]},+ // TagItemsTable holds the schema information for the "tag_items" table.+ TagItemsTable = &schema.Table{+ Name: "tag_items",+ Columns: TagItemsColumns,+ PrimaryKey: []*schema.Column{TagItemsColumns[0], TagItemsColumns[1]},ForeignKeys: []*schema.ForeignKey{{- Symbol: "label_items_label_id",- Columns: []*schema.Column{LabelItemsColumns[0]},- RefColumns: []*schema.Column{LabelsColumns[0]},+ Symbol: "tag_items_tag_id",+ Columns: []*schema.Column{TagItemsColumns[0]},+ RefColumns: []*schema.Column{TagsColumns[0]},OnDelete: schema.Cascade,},{- Symbol: "label_items_item_id",- Columns: []*schema.Column{LabelItemsColumns[1]},+ Symbol: "tag_items_item_id",+ Columns: []*schema.Column{TagItemsColumns[1]},RefColumns: []*schema.Column{ItemsColumns[0]},OnDelete: schema.Cascade,},@@ -543,13 +543,13 @@ var (ItemsTable,ItemFieldsTable,ItemTemplatesTable,- LabelsTable,LocationsTable,MaintenanceEntriesTable,NotifiersTable,+ TagsTable,TemplateFieldsTable,UsersTable,- LabelItemsTable,+ TagItemsTable,UserGroupsTable,})@@ -566,15 +566,15 @@ func init() {ItemFieldsTable.ForeignKeys[0].RefTable = ItemsTableItemTemplatesTable.ForeignKeys[0].RefTable = GroupsTableItemTemplatesTable.ForeignKeys[1].RefTable = LocationsTable- LabelsTable.ForeignKeys[0].RefTable = GroupsTableLocationsTable.ForeignKeys[0].RefTable = GroupsTableLocationsTable.ForeignKeys[1].RefTable = LocationsTableMaintenanceEntriesTable.ForeignKeys[0].RefTable = ItemsTableNotifiersTable.ForeignKeys[0].RefTable = GroupsTableNotifiersTable.ForeignKeys[1].RefTable = UsersTable+ TagsTable.ForeignKeys[0].RefTable = GroupsTableTemplateFieldsTable.ForeignKeys[0].RefTable = ItemTemplatesTable- LabelItemsTable.ForeignKeys[0].RefTable = LabelsTable- LabelItemsTable.ForeignKeys[1].RefTable = ItemsTable+ TagItemsTable.ForeignKeys[0].RefTable = TagsTable+ TagItemsTable.ForeignKeys[1].RefTable = ItemsTableUserGroupsTable.ForeignKeys[0].RefTable = UsersTableUserGroupsTable.ForeignKeys[1].RefTable = GroupsTable}diff --git a/backend/internal/data/ent/mutation.go b/backend/internal/data/ent/mutation.goindex c6a8fbbf..d8949de4 100644--- a/backend/internal/data/ent/mutation.go+++ b/backend/internal/data/ent/mutation.go@@ -20,11 +20,11 @@ import ("github.com/sysadminsmedia/homebox/backend/internal/data/ent/item""github.com/sysadminsmedia/homebox/backend/internal/data/ent/itemfield""github.com/sysadminsmedia/homebox/backend/internal/data/ent/itemtemplate"- "github.com/sysadminsmedia/homebox/backend/internal/data/ent/label""github.com/sysadminsmedia/homebox/backend/internal/data/ent/location""github.com/sysadminsmedia/homebox/backend/internal/data/ent/maintenanceentry""github.com/sysadminsmedia/homebox/backend/internal/data/ent/notifier""github.com/sysadminsmedia/homebox/backend/internal/data/ent/predicate"+ "github.com/sysadminsmedia/homebox/backend/internal/data/ent/tag""github.com/sysadminsmedia/homebox/backend/internal/data/ent/templatefield""github.com/sysadminsmedia/homebox/backend/internal/data/ent/user")@@ -46,10 +46,10 @@ const (TypeItem = "Item"TypeItemField = "ItemField"TypeItemTemplate = "ItemTemplate"- TypeLabel = "Label"TypeLocation = "Location"TypeMaintenanceEntry = "MaintenanceEntry"TypeNotifier = "Notifier"+ TypeTag = "Tag"TypeTemplateField = "TemplateField"TypeUser = "User")@@ -1869,9 +1869,9 @@ type GroupMutation struct {items map[uuid.UUID]struct{}removeditems map[uuid.UUID]struct{}cleareditems bool- labels map[uuid.UUID]struct{}- removedlabels map[uuid.UUID]struct{}- clearedlabels bool+ tags map[uuid.UUID]struct{}+ removedtags map[uuid.UUID]struct{}+ clearedtags boolinvitation_tokens map[uuid.UUID]struct{}removedinvitation_tokens map[uuid.UUID]struct{}clearedinvitation_tokens bool@@ -2296,58 +2296,58 @@ func (m *GroupMutation) ResetItems() {m.removeditems = nil}-// AddLabelIDs adds the "labels" edge to the Label entity by ids.-func (m *GroupMutation) AddLabelIDs(ids ...uuid.UUID) {- if m.labels == nil {- m.labels = make(map[uuid.UUID]struct{})+// AddTagIDs adds the "tags" edge to the Tag entity by ids.+func (m *GroupMutation) AddTagIDs(ids ...uuid.UUID) {+ if m.tags == nil {+ m.tags = make(map[uuid.UUID]struct{})}for i := range ids {- m.labels[ids[i]] = struct{}{}+ m.tags[ids[i]] = struct{}{}}}-// ClearLabels clears the "labels" edge to the Label entity.-func (m *GroupMutation) ClearLabels() {- m.clearedlabels = true+// ClearTags clears the "tags" edge to the Tag entity.+func (m *GroupMutation) ClearTags() {+ m.clearedtags = true}-// LabelsCleared reports if the "labels" edge to the Label entity was cleared.-func (m *GroupMutation) LabelsCleared() bool {- return m.clearedlabels+// TagsCleared reports if the "tags" edge to the Tag entity was cleared.+func (m *GroupMutation) TagsCleared() bool {+ return m.clearedtags}-// RemoveLabelIDs removes the "labels" edge to the Label entity by IDs.-func (m *GroupMutation) RemoveLabelIDs(ids ...uuid.UUID) {- if m.removedlabels == nil {- m.removedlabels = make(map[uuid.UUID]struct{})+// RemoveTagIDs removes the "tags" edge to the Tag entity by IDs.+func (m *GroupMutation) RemoveTagIDs(ids ...uuid.UUID) {+ if m.removedtags == nil {+ m.removedtags = make(map[uuid.UUID]struct{})}for i := range ids {- delete(m.labels, ids[i])- m.removedlabels[ids[i]] = struct{}{}+ delete(m.tags, ids[i])+ m.removedtags[ids[i]] = struct{}{}}}-// RemovedLabels returns the removed IDs of the "labels" edge to the Label entity.-func (m *GroupMutation) RemovedLabelsIDs() (ids []uuid.UUID) {- for id := range m.removedlabels {+// RemovedTags returns the removed IDs of the "tags" edge to the Tag entity.+func (m *GroupMutation) RemovedTagsIDs() (ids []uuid.UUID) {+ for id := range m.removedtags {ids = append(ids, id)}return}-// LabelsIDs returns the "labels" edge IDs in the mutation.-func (m *GroupMutation) LabelsIDs() (ids []uuid.UUID) {- for id := range m.labels {+// TagsIDs returns the "tags" edge IDs in the mutation.+func (m *GroupMutation) TagsIDs() (ids []uuid.UUID) {+ for id := range m.tags {ids = append(ids, id)}return}-// ResetLabels resets all changes to the "labels" edge.-func (m *GroupMutation) ResetLabels() {- m.labels = nil- m.clearedlabels = false- m.removedlabels = nil+// ResetTags resets all changes to the "tags" edge.+func (m *GroupMutation) ResetTags() {+ m.tags = nil+ m.clearedtags = false+ m.removedtags = nil}// AddInvitationTokenIDs adds the "invitation_tokens" edge to the GroupInvitationToken entity by ids.@@ -2706,8 +2706,8 @@ func (m *GroupMutation) AddedEdges() []string {if m.items != nil {edges = append(edges, group.EdgeItems)}- if m.labels != nil {- edges = append(edges, group.EdgeLabels)+ if m.tags != nil {+ edges = append(edges, group.EdgeTags)}if m.invitation_tokens != nil {edges = append(edges, group.EdgeInvitationTokens)@@ -2743,9 +2743,9 @@ func (m *GroupMutation) AddedIDs(name string) []ent.Value {ids = append(ids, id)}return ids- case group.EdgeLabels:- ids := make([]ent.Value, 0, len(m.labels))- for id := range m.labels {+ case group.EdgeTags:+ ids := make([]ent.Value, 0, len(m.tags))+ for id := range m.tags {ids = append(ids, id)}return ids@@ -2783,8 +2783,8 @@ func (m *GroupMutation) RemovedEdges() []string {if m.removeditems != nil {edges = append(edges, group.EdgeItems)}- if m.removedlabels != nil {- edges = append(edges, group.EdgeLabels)+ if m.removedtags != nil {+ edges = append(edges, group.EdgeTags)}if m.removedinvitation_tokens != nil {edges = append(edges, group.EdgeInvitationTokens)@@ -2820,9 +2820,9 @@ func (m *GroupMutation) RemovedIDs(name string) []ent.Value {ids = append(ids, id)}return ids- case group.EdgeLabels:- ids := make([]ent.Value, 0, len(m.removedlabels))- for id := range m.removedlabels {+ case group.EdgeTags:+ ids := make([]ent.Value, 0, len(m.removedtags))+ for id := range m.removedtags {ids = append(ids, id)}return ids@@ -2860,8 +2860,8 @@ func (m *GroupMutation) ClearedEdges() []string {if m.cleareditems {edges = append(edges, group.EdgeItems)}- if m.clearedlabels {- edges = append(edges, group.EdgeLabels)+ if m.clearedtags {+ edges = append(edges, group.EdgeTags)}if m.clearedinvitation_tokens {edges = append(edges, group.EdgeInvitationTokens)@@ -2885,8 +2885,8 @@ func (m *GroupMutation) EdgeCleared(name string) bool {return m.clearedlocationscase group.EdgeItems:return m.cleareditems- case group.EdgeLabels:- return m.clearedlabels+ case group.EdgeTags:+ return m.clearedtagscase group.EdgeInvitationTokens:return m.clearedinvitation_tokenscase group.EdgeNotifiers:@@ -2918,8 +2918,8 @@ func (m *GroupMutation) ResetEdge(name string) error {case group.EdgeItems:m.ResetItems()return nil- case group.EdgeLabels:- m.ResetLabels()+ case group.EdgeTags:+ m.ResetTags()return nilcase group.EdgeInvitationTokens:m.ResetInvitationTokens()@@ -3627,9 +3627,9 @@ type ItemMutation struct {children map[uuid.UUID]struct{}removedchildren map[uuid.UUID]struct{}clearedchildren bool- label map[uuid.UUID]struct{}- removedlabel map[uuid.UUID]struct{}- clearedlabel bool+ tag map[uuid.UUID]struct{}+ removedtag map[uuid.UUID]struct{}+ clearedtag boollocation *uuid.UUIDclearedlocation boolfields map[uuid.UUID]struct{}@@ -4995,58 +4995,58 @@ func (m *ItemMutation) ResetChildren() {m.removedchildren = nil}-// AddLabelIDs adds the "label" edge to the Label entity by ids.-func (m *ItemMutation) AddLabelIDs(ids ...uuid.UUID) {- if m.label == nil {- m.label = make(map[uuid.UUID]struct{})+// AddTagIDs adds the "tag" edge to the Tag entity by ids.+func (m *ItemMutation) AddTagIDs(ids ...uuid.UUID) {+ if m.tag == nil {+ m.tag = make(map[uuid.UUID]struct{})}for i := range ids {- m.label[ids[i]] = struct{}{}+ m.tag[ids[i]] = struct{}{}}}-// ClearLabel clears the "label" edge to the Label entity.-func (m *ItemMutation) ClearLabel() {- m.clearedlabel = true+// ClearTag clears the "tag" edge to the Tag entity.+func (m *ItemMutation) ClearTag() {+ m.clearedtag = true}-// LabelCleared reports if the "label" edge to the Label entity was cleared.-func (m *ItemMutation) LabelCleared() bool {- return m.clearedlabel+// TagCleared reports if the "tag" edge to the Tag entity was cleared.+func (m *ItemMutation) TagCleared() bool {+ return m.clearedtag}-// RemoveLabelIDs removes the "label" edge to the Label entity by IDs.-func (m *ItemMutation) RemoveLabelIDs(ids ...uuid.UUID) {- if m.removedlabel == nil {- m.removedlabel = make(map[uuid.UUID]struct{})+// RemoveTagIDs removes the "tag" edge to the Tag entity by IDs.+func (m *ItemMutation) RemoveTagIDs(ids ...uuid.UUID) {+ if m.removedtag == nil {+ m.removedtag = make(map[uuid.UUID]struct{})}for i := range ids {- delete(m.label, ids[i])- m.removedlabel[ids[i]] = struct{}{}+ delete(m.tag, ids[i])+ m.removedtag[ids[i]] = struct{}{}}}-// RemovedLabel returns the removed IDs of the "label" edge to the Label entity.-func (m *ItemMutation) RemovedLabelIDs() (ids []uuid.UUID) {- for id := range m.removedlabel {+// RemovedTag returns the removed IDs of the "tag" edge to the Tag entity.+func (m *ItemMutation) RemovedTagIDs() (ids []uuid.UUID) {+ for id := range m.removedtag {ids = append(ids, id)}return}-// LabelIDs returns the "label" edge IDs in the mutation.-func (m *ItemMutation) LabelIDs() (ids []uuid.UUID) {- for id := range m.label {+// TagIDs returns the "tag" edge IDs in the mutation.+func (m *ItemMutation) TagIDs() (ids []uuid.UUID) {+ for id := range m.tag {ids = append(ids, id)}return}-// ResetLabel resets all changes to the "label" edge.-func (m *ItemMutation) ResetLabel() {- m.label = nil- m.clearedlabel = false- m.removedlabel = nil+// ResetTag resets all changes to the "tag" edge.+func (m *ItemMutation) ResetTag() {+ m.tag = nil+ m.clearedtag = false+ m.removedtag = nil}// SetLocationID sets the "location" edge to the Location entity by id.@@ -5916,8 +5916,8 @@ func (m *ItemMutation) AddedEdges() []string {if m.children != nil {edges = append(edges, item.EdgeChildren)}- if m.label != nil {- edges = append(edges, item.EdgeLabel)+ if m.tag != nil {+ edges = append(edges, item.EdgeTag)}if m.location != nil {edges = append(edges, item.EdgeLocation)@@ -5952,9 +5952,9 @@ func (m *ItemMutation) AddedIDs(name string) []ent.Value {ids = append(ids, id)}return ids- case item.EdgeLabel:- ids := make([]ent.Value, 0, len(m.label))- for id := range m.label {+ case item.EdgeTag:+ ids := make([]ent.Value, 0, len(m.tag))+ for id := range m.tag {ids = append(ids, id)}return ids@@ -5990,8 +5990,8 @@ func (m *ItemMutation) RemovedEdges() []string {if m.removedchildren != nil {edges = append(edges, item.EdgeChildren)}- if m.removedlabel != nil {- edges = append(edges, item.EdgeLabel)+ if m.removedtag != nil {+ edges = append(edges, item.EdgeTag)}if m.removedfields != nil {edges = append(edges, item.EdgeFields)@@ -6015,9 +6015,9 @@ func (m *ItemMutation) RemovedIDs(name string) []ent.Value {ids = append(ids, id)}return ids- case item.EdgeLabel:- ids := make([]ent.Value, 0, len(m.removedlabel))- for id := range m.removedlabel {+ case item.EdgeTag:+ ids := make([]ent.Value, 0, len(m.removedtag))+ for id := range m.removedtag {ids = append(ids, id)}return ids@@ -6055,8 +6055,8 @@ func (m *ItemMutation) ClearedEdges() []string {if m.clearedchildren {edges = append(edges, item.EdgeChildren)}- if m.clearedlabel {- edges = append(edges, item.EdgeLabel)+ if m.clearedtag {+ edges = append(edges, item.EdgeTag)}if m.clearedlocation {edges = append(edges, item.EdgeLocation)@@ -6083,8 +6083,8 @@ func (m *ItemMutation) EdgeCleared(name string) bool {return m.clearedparentcase item.EdgeChildren:return m.clearedchildren- case item.EdgeLabel:- return m.clearedlabel+ case item.EdgeTag:+ return m.clearedtagcase item.EdgeLocation:return m.clearedlocationcase item.EdgeFields:@@ -6127,8 +6127,8 @@ func (m *ItemMutation) ResetEdge(name string) error {case item.EdgeChildren:m.ResetChildren()return nil- case item.EdgeLabel:- m.ResetLabel()+ case item.EdgeTag:+ m.ResetTag()return nilcase item.EdgeLocation:m.ResetLocation()@@ -7097,8 +7097,8 @@ type ItemTemplateMutation struct {include_warranty_fields *boolinclude_purchase_fields *boolinclude_sold_fields *bool- default_label_ids *[]uuid.UUID- appenddefault_label_ids []uuid.UUID+ default_tag_ids *[]uuid.UUID+ appenddefault_tag_ids []uuid.UUIDclearedFields map[string]struct{}group *uuid.UUIDclearedgroup bool@@ -7903,69 +7903,69 @@ func (m *ItemTemplateMutation) ResetIncludeSoldFields() {m.include_sold_fields = nil}-// SetDefaultLabelIds sets the "default_label_ids" field.-func (m *ItemTemplateMutation) SetDefaultLabelIds(u []uuid.UUID) {- m.default_label_ids = &u- m.appenddefault_label_ids = nil+// SetDefaultTagIds sets the "default_tag_ids" field.+func (m *ItemTemplateMutation) SetDefaultTagIds(u []uuid.UUID) {+ m.default_tag_ids = &u+ m.appenddefault_tag_ids = nil}-// DefaultLabelIds returns the value of the "default_label_ids" field in the mutation.-func (m *ItemTemplateMutation) DefaultLabelIds() (r []uuid.UUID, exists bool) {- v := m.default_label_ids+// DefaultTagIds returns the value of the "default_tag_ids" field in the mutation.+func (m *ItemTemplateMutation) DefaultTagIds() (r []uuid.UUID, exists bool) {+ v := m.default_tag_idsif v == nil {return}return *v, true}-// OldDefaultLabelIds returns the old "default_label_ids" field's value of the ItemTemplate entity.+// OldDefaultTagIds returns the old "default_tag_ids" field's value of the ItemTemplate entity.// If the ItemTemplate object wasn't provided to the builder, the object is fetched from the database.// An error is returned if the mutation operation is not UpdateOne, or the database query fails.-func (m *ItemTemplateMutation) OldDefaultLabelIds(ctx context.Context) (v []uuid.UUID, err error) {+func (m *ItemTemplateMutation) OldDefaultTagIds(ctx context.Context) (v []uuid.UUID, err error) {if !m.op.Is(OpUpdateOne) {- return v, errors.New("OldDefaultLabelIds is only allowed on UpdateOne operations")+ return v, errors.New("OldDefaultTagIds is only allowed on UpdateOne operations")}if m.id == nil || m.oldValue == nil {- return v, errors.New("OldDefaultLabelIds requires an ID field in the mutation")+ return v, errors.New("OldDefaultTagIds requires an ID field in the mutation")}oldValue, err := m.oldValue(ctx)if err != nil {- return v, fmt.Errorf("querying old value for OldDefaultLabelIds: %w", err)+ return v, fmt.Errorf("querying old value for OldDefaultTagIds: %w", err)}- return oldValue.DefaultLabelIds, nil+ return oldValue.DefaultTagIds, nil}-// AppendDefaultLabelIds adds u to the "default_label_ids" field.-func (m *ItemTemplateMutation) AppendDefaultLabelIds(u []uuid.UUID) {- m.appenddefault_label_ids = append(m.appenddefault_label_ids, u...)+// AppendDefaultTagIds adds u to the "default_tag_ids" field.+func (m *ItemTemplateMutation) AppendDefaultTagIds(u []uuid.UUID) {+ m.appenddefault_tag_ids = append(m.appenddefault_tag_ids, u...)}-// AppendedDefaultLabelIds returns the list of values that were appended to the "default_label_ids" field in this mutation.-func (m *ItemTemplateMutation) AppendedDefaultLabelIds() ([]uuid.UUID, bool) {- if len(m.appenddefault_label_ids) == 0 {+// AppendedDefaultTagIds returns the list of values that were appended to the "default_tag_ids" field in this mutation.+func (m *ItemTemplateMutation) AppendedDefaultTagIds() ([]uuid.UUID, bool) {+ if len(m.appenddefault_tag_ids) == 0 {return nil, false}- return m.appenddefault_label_ids, true+ return m.appenddefault_tag_ids, true}-// ClearDefaultLabelIds clears the value of the "default_label_ids" field.-func (m *ItemTemplateMutation) ClearDefaultLabelIds() {- m.default_label_ids = nil- m.appenddefault_label_ids = nil- m.clearedFields[itemtemplate.FieldDefaultLabelIds] = struct{}{}+// ClearDefaultTagIds clears the value of the "default_tag_ids" field.+func (m *ItemTemplateMutation) ClearDefaultTagIds() {+ m.default_tag_ids = nil+ m.appenddefault_tag_ids = nil+ m.clearedFields[itemtemplate.FieldDefaultTagIds] = struct{}{}}-// DefaultLabelIdsCleared returns if the "default_label_ids" field was cleared in this mutation.-func (m *ItemTemplateMutation) DefaultLabelIdsCleared() bool {- _, ok := m.clearedFields[itemtemplate.FieldDefaultLabelIds]+// DefaultTagIdsCleared returns if the "default_tag_ids" field was cleared in this mutation.+func (m *ItemTemplateMutation) DefaultTagIdsCleared() bool {+ _, ok := m.clearedFields[itemtemplate.FieldDefaultTagIds]return ok}-// ResetDefaultLabelIds resets all changes to the "default_label_ids" field.-func (m *ItemTemplateMutation) ResetDefaultLabelIds() {- m.default_label_ids = nil- m.appenddefault_label_ids = nil- delete(m.clearedFields, itemtemplate.FieldDefaultLabelIds)+// ResetDefaultTagIds resets all changes to the "default_tag_ids" field.+func (m *ItemTemplateMutation) ResetDefaultTagIds() {+ m.default_tag_ids = nil+ m.appenddefault_tag_ids = nil+ delete(m.clearedFields, itemtemplate.FieldDefaultTagIds)}// SetGroupID sets the "group" edge to the Group entity by id.@@ -8183,8 +8183,8 @@ func (m *ItemTemplateMutation) Fields() []string {if m.include_sold_fields != nil {fields = append(fields, itemtemplate.FieldIncludeSoldFields)}- if m.default_label_ids != nil {- fields = append(fields, itemtemplate.FieldDefaultLabelIds)+ if m.default_tag_ids != nil {+ fields = append(fields, itemtemplate.FieldDefaultTagIds)}return fields}@@ -8226,8 +8226,8 @@ func (m *ItemTemplateMutation) Field(name string) (ent.Value, bool) {return m.IncludePurchaseFields()case itemtemplate.FieldIncludeSoldFields:return m.IncludeSoldFields()- case itemtemplate.FieldDefaultLabelIds:- return m.DefaultLabelIds()+ case itemtemplate.FieldDefaultTagIds:+ return m.DefaultTagIds()}return nil, false}@@ -8269,8 +8269,8 @@ func (m *ItemTemplateMutation) OldField(ctx context.Context, name string) (ent.Vreturn m.OldIncludePurchaseFields(ctx)case itemtemplate.FieldIncludeSoldFields:return m.OldIncludeSoldFields(ctx)- case itemtemplate.FieldDefaultLabelIds:- return m.OldDefaultLabelIds(ctx)+ case itemtemplate.FieldDefaultTagIds:+ return m.OldDefaultTagIds(ctx)}return nil, fmt.Errorf("unknown ItemTemplate field %s", name)}@@ -8392,12 +8392,12 @@ func (m *ItemTemplateMutation) SetField(name string, value ent.Value) error {}m.SetIncludeSoldFields(v)return nil- case itemtemplate.FieldDefaultLabelIds:+ case itemtemplate.FieldDefaultTagIds:v, ok := value.([]uuid.UUID)if !ok {return fmt.Errorf("unexpected type %T for field %s", value, name)}- m.SetDefaultLabelIds(v)+ m.SetDefaultTagIds(v)return nil}return fmt.Errorf("unknown ItemTemplate field %s", name)@@ -8465,8 +8465,8 @@ func (m *ItemTemplateMutation) ClearedFields() []string {if m.FieldCleared(itemtemplate.FieldDefaultWarrantyDetails) {fields = append(fields, itemtemplate.FieldDefaultWarrantyDetails)}- if m.FieldCleared(itemtemplate.FieldDefaultLabelIds) {- fields = append(fields, itemtemplate.FieldDefaultLabelIds)+ if m.FieldCleared(itemtemplate.FieldDefaultTagIds) {+ fields = append(fields, itemtemplate.FieldDefaultTagIds)}return fields}@@ -8503,8 +8503,8 @@ func (m *ItemTemplateMutation) ClearField(name string) error {case itemtemplate.FieldDefaultWarrantyDetails:m.ClearDefaultWarrantyDetails()return nil- case itemtemplate.FieldDefaultLabelIds:- m.ClearDefaultLabelIds()+ case itemtemplate.FieldDefaultTagIds:+ m.ClearDefaultTagIds()return nil}return fmt.Errorf("unknown ItemTemplate nullable field %s", name)@@ -8562,8 +8562,8 @@ func (m *ItemTemplateMutation) ResetField(name string) error {case itemtemplate.FieldIncludeSoldFields:m.ResetIncludeSoldFields()return nil- case itemtemplate.FieldDefaultLabelIds:- m.ResetDefaultLabelIds()+ case itemtemplate.FieldDefaultTagIds:+ m.ResetDefaultTagIds()return nil}return fmt.Errorf("unknown ItemTemplate field %s", name)@@ -8689,39 +8689,43 @@ func (m *ItemTemplateMutation) ResetEdge(name string) error {return fmt.Errorf("unknown ItemTemplate edge %s", name)}-// LabelMutation represents an operation that mutates the Label nodes in the graph.-type LabelMutation struct {+// LocationMutation represents an operation that mutates the Location nodes in the graph.+type LocationMutation struct {config- op Op- typ string- id *uuid.UUID- created_at *time.Time- updated_at *time.Time- name *string- description *string- color *string- clearedFields map[string]struct{}- group *uuid.UUID- clearedgroup bool- items map[uuid.UUID]struct{}- removeditems map[uuid.UUID]struct{}- cleareditems bool- done bool- oldValue func(context.Context) (*Label, error)- predicates []predicate.Label+ op Op+ typ string+ id *uuid.UUID+ created_at *time.Time+ updated_at *time.Time+ name *string+ description *string+ clearedFields map[string]struct{}+ group *uuid.UUID+ clearedgroup bool+ parent *uuid.UUID+ clearedparent bool+ children map[uuid.UUID]struct{}+ removedchildren map[uuid.UUID]struct{}+ clearedchildren bool+ items map[uuid.UUID]struct{}+ removeditems map[uuid.UUID]struct{}+ cleareditems bool+ done bool+ oldValue func(context.Context) (*Location, error)+ predicates []predicate.Location}-var _ ent.Mutation = (*LabelMutation)(nil)+var _ ent.Mutation = (*LocationMutation)(nil)-// labelOption allows management of the mutation configuration using functional options.-type labelOption func(*LabelMutation)+// locationOption allows management of the mutation configuration using functional options.+type locationOption func(*LocationMutation)-// newLabelMutation creates new mutation for the Label entity.-func newLabelMutation(c config, op Op, opts ...labelOption) *LabelMutation {- m := &LabelMutation{+// newLocationMutation creates new mutation for the Location entity.+func newLocationMutation(c config, op Op, opts ...locationOption) *LocationMutation {+ m := &LocationMutation{config: c,op: op,- typ: TypeLabel,+ typ: TypeLocation,clearedFields: make(map[string]struct{}),}for _, opt := range opts {@@ -8730,20 +8734,20 @@ func newLabelMutation(c config, op Op, opts ...labelOption) *LabelMutation {return m}-// withLabelID sets the ID field of the mutation.-func withLabelID(id uuid.UUID) labelOption {- return func(m *LabelMutation) {+// withLocationID sets the ID field of the mutation.+func withLocationID(id uuid.UUID) locationOption {+ return func(m *LocationMutation) {var (err erroronce sync.Once- value *Label+ value *Location)- m.oldValue = func(ctx context.Context) (*Label, error) {+ m.oldValue = func(ctx context.Context) (*Location, error) {once.Do(func() {if m.done {err = errors.New("querying old values post mutation is not allowed")} else {- value, err = m.Client().Label.Get(ctx, id)+ value, err = m.Client().Location.Get(ctx, id)}})return value, err@@ -8752,10 +8756,10 @@ func withLabelID(id uuid.UUID) labelOption {}}-// withLabel sets the old Label of the mutation.-func withLabel(node *Label) labelOption {- return func(m *LabelMutation) {- m.oldValue = func(context.Context) (*Label, error) {+// withLocation sets the old Location of the mutation.+func withLocation(node *Location) locationOption {+ return func(m *LocationMutation) {+ m.oldValue = func(context.Context) (*Location, error) {return node, nil}m.id = &node.ID@@ -8764,7 +8768,7 @@ func withLabel(node *Label) labelOption {// Client returns a new `ent.Client` from the mutation. If the mutation was// executed in a transaction (ent.Tx), a transactional client is returned.-func (m LabelMutation) Client() *Client {+func (m LocationMutation) Client() *Client {client := &Client{config: m.config}client.init()return client@@ -8772,7 +8776,7 @@ func (m LabelMutation) Client() *Client {// Tx returns an `ent.Tx` for mutations that were executed in transactions;// it returns an error otherwise.-func (m LabelMutation) Tx() (*Tx, error) {+func (m LocationMutation) Tx() (*Tx, error) {if _, ok := m.driver.(*txDriver); !ok {return nil, errors.New("ent: mutation is not running in a transaction")}@@ -8782,14 +8786,14 @@ func (m LabelMutation) Tx() (*Tx, error) {}// SetID sets the value of the id field. Note that this-// operation is only accepted on creation of Label entities.-func (m *LabelMutation) SetID(id uuid.UUID) {+// operation is only accepted on creation of Location entities.+func (m *LocationMutation) SetID(id uuid.UUID) {m.id = &id}// ID returns the ID value in the mutation. Note that the ID is only available// if it was provided to the builder or after it was returned from the database.-func (m *LabelMutation) ID() (id uuid.UUID, exists bool) {+func (m *LocationMutation) ID() (id uuid.UUID, exists bool) {if m.id == nil {return}@@ -8800,7 +8804,7 @@ func (m *LabelMutation) ID() (id uuid.UUID, exists bool) {// That means, if the mutation is applied within a transaction with an isolation level such// as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated// or updated by the mutation.-func (m *LabelMutation) IDs(ctx context.Context) ([]uuid.UUID, error) {+func (m *LocationMutation) IDs(ctx context.Context) ([]uuid.UUID, error) {switch {case m.op.Is(OpUpdateOne | OpDeleteOne):id, exists := m.ID()@@ -8809,19 +8813,19 @@ func (m *LabelMutation) IDs(ctx context.Context) ([]uuid.UUID, error) {}fallthroughcase m.op.Is(OpUpdate | OpDelete):- return m.Client().Label.Query().Where(m.predicates...).IDs(ctx)+ return m.Client().Location.Query().Where(m.predicates...).IDs(ctx)default:return nil, fmt.Errorf("IDs is not allowed on %s operations", m.op)}}// SetCreatedAt sets the "created_at" field.-func (m *LabelMutation) SetCreatedAt(t time.Time) {+func (m *LocationMutation) SetCreatedAt(t time.Time) {m.created_at = &t}// CreatedAt returns the value of the "created_at" field in the mutation.-func (m *LabelMutation) CreatedAt() (r time.Time, exists bool) {+func (m *LocationMutation) CreatedAt() (r time.Time, exists bool) {v := m.created_atif v == nil {return@@ -8829,10 +8833,10 @@ func (m *LabelMutation) CreatedAt() (r time.Time, exists bool) {return *v, true}-// OldCreatedAt returns the old "created_at" field's value of the Label entity.-// If the Label object wasn't provided to the builder, the object is fetched from the database.+// OldCreatedAt returns the old "created_at" field's value of the Location entity.+// If the Location object wasn't provided to the builder, the object is fetched from the database.// An error is returned if the mutation operation is not UpdateOne, or the database query fails.-func (m *LabelMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error) {+func (m *LocationMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error) {if !m.op.Is(OpUpdateOne) {return v, errors.New("OldCreatedAt is only allowed on UpdateOne operations")}@@ -8847,17 +8851,17 @@ func (m *LabelMutation) OldCreatedAt(ctx context.Context) (v time.Time, err erro}// ResetCreatedAt resets all changes to the "created_at" field.-func (m *LabelMutation) ResetCreatedAt() {+func (m *LocationMutation) ResetCreatedAt() {m.created_at = nil}// SetUpdatedAt sets the "updated_at" field.-func (m *LabelMutation) SetUpdatedAt(t time.Time) {+func (m *LocationMutation) SetUpdatedAt(t time.Time) {m.updated_at = &t}// UpdatedAt returns the value of the "updated_at" field in the mutation.-func (m *LabelMutation) UpdatedAt() (r time.Time, exists bool) {+func (m *LocationMutation) UpdatedAt() (r time.Time, exists bool) {v := m.updated_atif v == nil {return@@ -8865,10 +8869,10 @@ func (m *LabelMutation) UpdatedAt() (r time.Time, exists bool) {return *v, true}-// OldUpdatedAt returns the old "updated_at" field's value of the Label entity.-// If the Label object wasn't provided to the builder, the object is fetched from the database.+// OldUpdatedAt returns the old "updated_at" field's value of the Location entity.+// If the Location object wasn't provided to the builder, the object is fetched from the database.// An error is returned if the mutation operation is not UpdateOne, or the database query fails.-func (m *LabelMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error) {+func (m *LocationMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error) {if !m.op.Is(OpUpdateOne) {return v, errors.New("OldUpdatedAt is only allowed on UpdateOne operations")}@@ -8883,17 +8887,17 @@ func (m *LabelMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err erro}// ResetUpdatedAt resets all changes to the "updated_at" field.-func (m *LabelMutation) ResetUpdatedAt() {+func (m *LocationMutation) ResetUpdatedAt() {m.updated_at = nil}// SetName sets the "name" field.-func (m *LabelMutation) SetName(s string) {+func (m *LocationMutation) SetName(s string) {m.name = &s}// Name returns the value of the "name" field in the mutation.-func (m *LabelMutation) Name() (r string, exists bool) {+func (m *LocationMutation) Name() (r string, exists bool) {v := m.nameif v == nil {return@@ -8901,10 +8905,10 @@ func (m *LabelMutation) Name() (r string, exists bool) {return *v, true}-// OldName returns the old "name" field's value of the Label entity.-// If the Label object wasn't provided to the builder, the object is fetched from the database.+// OldName returns the old "name" field's value of the Location entity.+// If the Location object wasn't provided to the builder, the object is fetched from the database.// An error is returned if the mutation operation is not UpdateOne, or the database query fails.-func (m *LabelMutation) OldName(ctx context.Context) (v string, err error) {+func (m *LocationMutation) OldName(ctx context.Context) (v string, err error) {if !m.op.Is(OpUpdateOne) {return v, errors.New("OldName is only allowed on UpdateOne operations")}@@ -8919,17 +8923,17 @@ func (m *LabelMutation) OldName(ctx context.Context) (v string, err error) {}// ResetName resets all changes to the "name" field.-func (m *LabelMutation) ResetName() {+func (m *LocationMutation) ResetName() {m.name = nil}// SetDescription sets the "description" field.-func (m *LabelMutation) SetDescription(s string) {+func (m *LocationMutation) SetDescription(s string) {m.description = &s}// Description returns the value of the "description" field in the mutation.-func (m *LabelMutation) Description() (r string, exists bool) {+func (m *LocationMutation) Description() (r string, exists bool) {v := m.descriptionif v == nil {return@@ -8937,10 +8941,10 @@ func (m *LabelMutation) Description() (r string, exists bool) {return *v, true}-// OldDescription returns the old "description" field's value of the Label entity.-// If the Label object wasn't provided to the builder, the object is fetched from the database.+// OldDescription returns the old "description" field's value of the Location entity.+// If the Location object wasn't provided to the builder, the object is fetched from the database.// An error is returned if the mutation operation is not UpdateOne, or the database query fails.-func (m *LabelMutation) OldDescription(ctx context.Context) (v string, err error) {+func (m *LocationMutation) OldDescription(ctx context.Context) (v string, err error) {if !m.op.Is(OpUpdateOne) {return v, errors.New("OldDescription is only allowed on UpdateOne operations")}@@ -8955,89 +8959,40 @@ func (m *LabelMutation) OldDescription(ctx context.Context) (v string, err error}// ClearDescription clears the value of the "description" field.-func (m *LabelMutation) ClearDescription() {+func (m *LocationMutation) ClearDescription() {m.description = nil- m.clearedFields[label.FieldDescription] = struct{}{}+ m.clearedFields[location.FieldDescription] = struct{}{}}// DescriptionCleared returns if the "description" field was cleared in this mutation.-func (m *LabelMutation) DescriptionCleared() bool {- _, ok := m.clearedFields[label.FieldDescription]+func (m *LocationMutation) DescriptionCleared() bool {+ _, ok := m.clearedFields[location.FieldDescription]return ok}// ResetDescription resets all changes to the "description" field.-func (m *LabelMutation) ResetDescription() {+func (m *LocationMutation) ResetDescription() {m.description = nil- delete(m.clearedFields, label.FieldDescription)-}--// SetColor sets the "color" field.-func (m *LabelMutation) SetColor(s string) {- m.color = &s-}--// Color returns the value of the "color" field in the mutation.-func (m *LabelMutation) Color() (r string, exists bool) {- v := m.color- if v == nil {- return- }- return *v, true-}--// OldColor returns the old "color" field's value of the Label entity.-// If the Label object wasn't provided to the builder, the object is fetched from the database.-// An error is returned if the mutation operation is not UpdateOne, or the database query fails.-func (m *LabelMutation) OldColor(ctx context.Context) (v string, err error) {- if !m.op.Is(OpUpdateOne) {- return v, errors.New("OldColor is only allowed on UpdateOne operations")- }- if m.id == nil || m.oldValue == nil {- return v, errors.New("OldColor requires an ID field in the mutation")- }- oldValue, err := m.oldValue(ctx)- if err != nil {- return v, fmt.Errorf("querying old value for OldColor: %w", err)- }- return oldValue.Color, nil-}--// ClearColor clears the value of the "color" field.-func (m *LabelMutation) ClearColor() {- m.color = nil- m.clearedFields[label.FieldColor] = struct{}{}-}--// ColorCleared returns if the "color" field was cleared in this mutation.-func (m *LabelMutation) ColorCleared() bool {- _, ok := m.clearedFields[label.FieldColor]- return ok-}--// ResetColor resets all changes to the "color" field.-func (m *LabelMutation) ResetColor() {- m.color = nil- delete(m.clearedFields, label.FieldColor)+ delete(m.clearedFields, location.FieldDescription)}// SetGroupID sets the "group" edge to the Group entity by id.-func (m *LabelMutation) SetGroupID(id uuid.UUID) {+func (m *LocationMutation) SetGroupID(id uuid.UUID) {m.group = &id}// ClearGroup clears the "group" edge to the Group entity.-func (m *LabelMutation) ClearGroup() {+func (m *LocationMutation) ClearGroup() {m.clearedgroup = true}// GroupCleared reports if the "group" edge to the Group entity was cleared.-func (m *LabelMutation) GroupCleared() bool {+func (m *LocationMutation) GroupCleared() bool {return m.clearedgroup}// GroupID returns the "group" edge ID in the mutation.-func (m *LabelMutation) GroupID() (id uuid.UUID, exists bool) {+func (m *LocationMutation) GroupID() (id uuid.UUID, exists bool) {if m.group != nil {return *m.group, true}@@ -9047,7 +9002,7 @@ func (m *LabelMutation) GroupID() (id uuid.UUID, exists bool) {// GroupIDs returns the "group" edge IDs in the mutation.// Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use// GroupID instead. It exists only for internal usage by the builders.-func (m *LabelMutation) GroupIDs() (ids []uuid.UUID) {+func (m *LocationMutation) GroupIDs() (ids []uuid.UUID) {if id := m.group; id != nil {ids = append(ids, *id)}@@ -9055,13 +9010,106 @@ func (m *LabelMutation) GroupIDs() (ids []uuid.UUID) {}// ResetGroup resets all changes to the "group" edge.-func (m *LabelMutation) ResetGroup() {+func (m *LocationMutation) ResetGroup() {m.group = nilm.clearedgroup = false}+// SetParentID sets the "parent" edge to the Location entity by id.+func (m *LocationMutation) SetParentID(id uuid.UUID) {+ m.parent = &id+}++// ClearParent clears the "parent" edge to the Location entity.+func (m *LocationMutation) ClearParent() {+ m.clearedparent = true+}++// ParentCleared reports if the "parent" edge to the Location entity was cleared.+func (m *LocationMutation) ParentCleared() bool {+ return m.clearedparent+}++// ParentID returns the "parent" edge ID in the mutation.+func (m *LocationMutation) ParentID() (id uuid.UUID, exists bool) {+ if m.parent != nil {+ return *m.parent, true+ }+ return+}++// ParentIDs returns the "parent" edge IDs in the mutation.+// Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use+// ParentID instead. It exists only for internal usage by the builders.+func (m *LocationMutation) ParentIDs() (ids []uuid.UUID) {+ if id := m.parent; id != nil {+ ids = append(ids, *id)+ }+ return+}++// ResetParent resets all changes to the "parent" edge.+func (m *LocationMutation) ResetParent() {+ m.parent = nil+ m.clearedparent = false+}++// AddChildIDs adds the "children" edge to the Location entity by ids.+func (m *LocationMutation) AddChildIDs(ids ...uuid.UUID) {+ if m.children == nil {+ m.children = make(map[uuid.UUID]struct{})+ }+ for i := range ids {+ m.children[ids[i]] = struct{}{}+ }+}++// ClearChildren clears the "children" edge to the Location entity.+func (m *LocationMutation) ClearChildren() {+ m.clearedchildren = true+}++// ChildrenCleared reports if the "children" edge to the Location entity was cleared.+func (m *LocationMutation) ChildrenCleared() bool {+ return m.clearedchildren+}++// RemoveChildIDs removes the "children" edge to the Location entity by IDs.+func (m *LocationMutation) RemoveChildIDs(ids ...uuid.UUID) {+ if m.removedchildren == nil {+ m.removedchildren = make(map[uuid.UUID]struct{})+ }+ for i := range ids {+ delete(m.children, ids[i])+ m.removedchildren[ids[i]] = struct{}{}+ }+}++// RemovedChildren returns the removed IDs of the "children" edge to the Location entity.+func (m *LocationMutation) RemovedChildrenIDs() (ids []uuid.UUID) {+ for id := range m.removedchildren {+ ids = append(ids, id)+ }+ return+}++// ChildrenIDs returns the "children" edge IDs in the mutation.+func (m *LocationMutation) ChildrenIDs() (ids []uuid.UUID) {+ for id := range m.children {+ ids = append(ids, id)+ }+ return+}++// ResetChildren resets all changes to the "children" edge.+func (m *LocationMutation) ResetChildren() {+ m.children = nil+ m.clearedchildren = false+ m.removedchildren = nil+}+// AddItemIDs adds the "items" edge to the Item entity by ids.-func (m *LabelMutation) AddItemIDs(ids ...uuid.UUID) {+func (m *LocationMutation) AddItemIDs(ids ...uuid.UUID) {if m.items == nil {m.items = make(map[uuid.UUID]struct{})}@@ -9071,17 +9119,17 @@ func (m *LabelMutation) AddItemIDs(ids ...uuid.UUID) {}// ClearItems clears the "items" edge to the Item entity.-func (m *LabelMutation) ClearItems() {+func (m *LocationMutation) ClearItems() {m.cleareditems = true}// ItemsCleared reports if the "items" edge to the Item entity was cleared.-func (m *LabelMutation) ItemsCleared() bool {+func (m *LocationMutation) ItemsCleared() bool {return m.cleareditems}// RemoveItemIDs removes the "items" edge to the Item entity by IDs.-func (m *LabelMutation) RemoveItemIDs(ids ...uuid.UUID) {+func (m *LocationMutation) RemoveItemIDs(ids ...uuid.UUID) {if m.removeditems == nil {m.removeditems = make(map[uuid.UUID]struct{})}@@ -9092,7 +9140,7 @@ func (m *LabelMutation) RemoveItemIDs(ids ...uuid.UUID) {}// RemovedItems returns the removed IDs of the "items" edge to the Item entity.-func (m *LabelMutation) RemovedItemsIDs() (ids []uuid.UUID) {+func (m *LocationMutation) RemovedItemsIDs() (ids []uuid.UUID) {for id := range m.removeditems {ids = append(ids, id)}@@ -9100,7 +9148,7 @@ func (m *LabelMutation) RemovedItemsIDs() (ids []uuid.UUID) {}// ItemsIDs returns the "items" edge IDs in the mutation.-func (m *LabelMutation) ItemsIDs() (ids []uuid.UUID) {+func (m *LocationMutation) ItemsIDs() (ids []uuid.UUID) {for id := range m.items {ids = append(ids, id)}@@ -9108,21 +9156,21 @@ func (m *LabelMutation) ItemsIDs() (ids []uuid.UUID) {}// ResetItems resets all changes to the "items" edge.-func (m *LabelMutation) ResetItems() {+func (m *LocationMutation) ResetItems() {m.items = nilm.cleareditems = falsem.removeditems = nil}-// Where appends a list predicates to the LabelMutation builder.-func (m *LabelMutation) Where(ps ...predicate.Label) {+// Where appends a list predicates to the LocationMutation builder.+func (m *LocationMutation) Where(ps ...predicate.Location) {m.predicates = append(m.predicates, ps...)}-// WhereP appends storage-level predicates to the LabelMutation builder. Using this method,+// WhereP appends storage-level predicates to the LocationMutation builder. Using this method,// users can use type-assertion to append predicates that do not depend on any generated package.-func (m *LabelMutation) WhereP(ps ...func(*sql.Selector)) {- p := make([]predicate.Label, len(ps))+func (m *LocationMutation) WhereP(ps ...func(*sql.Selector)) {+ p := make([]predicate.Location, len(ps))for i := range ps {p[i] = ps[i]}@@ -9130,39 +9178,36 @@ func (m *LabelMutation) WhereP(ps ...func(*sql.Selector)) {}// Op returns the operation name.-func (m *LabelMutation) Op() Op {+func (m *LocationMutation) Op() Op {return m.op}// SetOp allows setting the mutation operation.-func (m *LabelMutation) SetOp(op Op) {+func (m *LocationMutation) SetOp(op Op) {m.op = op}-// Type returns the node type of this mutation (Label).-func (m *LabelMutation) Type() string {+// Type returns the node type of this mutation (Location).+func (m *LocationMutation) Type() string {return m.typ}// Fields returns all fields that were changed during this mutation. Note that in// order to get all numeric fields that were incremented/decremented, call// AddedFields().-func (m *LabelMutation) Fields() []string {- fields := make([]string, 0, 5)+func (m *LocationMutation) Fields() []string {+ fields := make([]string, 0, 4)if m.created_at != nil {- fields = append(fields, label.FieldCreatedAt)+ fields = append(fields, location.FieldCreatedAt)}if m.updated_at != nil {- fields = append(fields, label.FieldUpdatedAt)+ fields = append(fields, location.FieldUpdatedAt)}if m.name != nil {- fields = append(fields, label.FieldName)+ fields = append(fields, location.FieldName)}if m.description != nil {- fields = append(fields, label.FieldDescription)- }- if m.color != nil {- fields = append(fields, label.FieldColor)+ fields = append(fields, location.FieldDescription)}return fields}@@ -9170,18 +9215,16 @@ func (m *LabelMutation) Fields() []string {// Field returns the value of a field with the given name. The second boolean// return value indicates that this field was not set, or was not defined in the// schema.-func (m *LabelMutation) Field(name string) (ent.Value, bool) {+func (m *LocationMutation) Field(name string) (ent.Value, bool) {switch name {- case label.FieldCreatedAt:+ case location.FieldCreatedAt:return m.CreatedAt()- case label.FieldUpdatedAt:+ case location.FieldUpdatedAt:return m.UpdatedAt()- case label.FieldName:+ case location.FieldName:return m.Name()- case label.FieldDescription:+ case location.FieldDescription:return m.Description()- case label.FieldColor:- return m.Color()}return nil, false}@@ -9189,166 +9232,164 @@ func (m *LabelMutation) Field(name string) (ent.Value, bool) {// OldField returns the old value of the field from the database. An error is// returned if the mutation operation is not UpdateOne, or the query to the// database failed.-func (m *LabelMutation) OldField(ctx context.Context, name string) (ent.Value, error) {+func (m *LocationMutation) OldField(ctx context.Context, name string) (ent.Value, error) {switch name {- case label.FieldCreatedAt:+ case location.FieldCreatedAt:return m.OldCreatedAt(ctx)- case label.FieldUpdatedAt:+ case location.FieldUpdatedAt:return m.OldUpdatedAt(ctx)- case label.FieldName:+ case location.FieldName:return m.OldName(ctx)- case label.FieldDescription:+ case location.FieldDescription:return m.OldDescription(ctx)- case label.FieldColor:- return m.OldColor(ctx)}- return nil, fmt.Errorf("unknown Label field %s", name)+ return nil, fmt.Errorf("unknown Location field %s", name)}// SetField sets the value of a field with the given name. It returns an error if// the field is not defined in the schema, or if the type mismatched the field// type.-func (m *LabelMutation) SetField(name string, value ent.Value) error {+func (m *LocationMutation) SetField(name string, value ent.Value) error {switch name {- case label.FieldCreatedAt:+ case location.FieldCreatedAt:v, ok := value.(time.Time)if !ok {return fmt.Errorf("unexpected type %T for field %s", value, name)}m.SetCreatedAt(v)return nil- case label.FieldUpdatedAt:+ case location.FieldUpdatedAt:v, ok := value.(time.Time)if !ok {return fmt.Errorf("unexpected type %T for field %s", value, name)}m.SetUpdatedAt(v)return nil- case label.FieldName:+ case location.FieldName:v, ok := value.(string)if !ok {return fmt.Errorf("unexpected type %T for field %s", value, name)}m.SetName(v)return nil- case label.FieldDescription:+ case location.FieldDescription:v, ok := value.(string)if !ok {return fmt.Errorf("unexpected type %T for field %s", value, name)}m.SetDescription(v)return nil- case label.FieldColor:- v, ok := value.(string)- if !ok {- return fmt.Errorf("unexpected type %T for field %s", value, name)- }- m.SetColor(v)- return nil}- return fmt.Errorf("unknown Label field %s", name)+ return fmt.Errorf("unknown Location field %s", name)}// AddedFields returns all numeric fields that were incremented/decremented during// this mutation.-func (m *LabelMutation) AddedFields() []string {+func (m *LocationMutation) AddedFields() []string {return nil}// AddedField returns the numeric value that was incremented/decremented on a field// with the given name. The second boolean return value indicates that this field// was not set, or was not defined in the schema.-func (m *LabelMutation) AddedField(name string) (ent.Value, bool) {+func (m *LocationMutation) AddedField(name string) (ent.Value, bool) {return nil, false}// AddField adds the value to the field with the given name. It returns an error if// the field is not defined in the schema, or if the type mismatched the field// type.-func (m *LabelMutation) AddField(name string, value ent.Value) error {+func (m *LocationMutation) AddField(name string, value ent.Value) error {switch name {}- return fmt.Errorf("unknown Label numeric field %s", name)+ return fmt.Errorf("unknown Location numeric field %s", name)}// ClearedFields returns all nullable fields that were cleared during this// mutation.-func (m *LabelMutation) ClearedFields() []string {+func (m *LocationMutation) ClearedFields() []string {var fields []string- if m.FieldCleared(label.FieldDescription) {- fields = append(fields, label.FieldDescription)- }- if m.FieldCleared(label.FieldColor) {- fields = append(fields, label.FieldColor)+ if m.FieldCleared(location.FieldDescription) {+ fields = append(fields, location.FieldDescription)}return fields}// FieldCleared returns a boolean indicating if a field with the given name was// cleared in this mutation.-func (m *LabelMutation) FieldCleared(name string) bool {+func (m *LocationMutation) FieldCleared(name string) bool {_, ok := m.clearedFields[name]return ok}// ClearField clears the value of the field with the given name. It returns an// error if the field is not defined in the schema.-func (m *LabelMutation) ClearField(name string) error {+func (m *LocationMutation) ClearField(name string) error {switch name {- case label.FieldDescription:+ case location.FieldDescription:m.ClearDescription()return nil- case label.FieldColor:- m.ClearColor()- return nil}- return fmt.Errorf("unknown Label nullable field %s", name)+ return fmt.Errorf("unknown Location nullable field %s", name)}// ResetField resets all changes in the mutation for the field with the given name.// It returns an error if the field is not defined in the schema.-func (m *LabelMutation) ResetField(name string) error {+func (m *LocationMutation) ResetField(name string) error {switch name {- case label.FieldCreatedAt:+ case location.FieldCreatedAt:m.ResetCreatedAt()return nil- case label.FieldUpdatedAt:+ case location.FieldUpdatedAt:m.ResetUpdatedAt()return nil- case label.FieldName:+ case location.FieldName:m.ResetName()return nil- case label.FieldDescription:+ case location.FieldDescription:m.ResetDescription()return nil- case label.FieldColor:- m.ResetColor()- return nil}- return fmt.Errorf("unknown Label field %s", name)+ return fmt.Errorf("unknown Location field %s", name)}// AddedEdges returns all edge names that were set/added in this mutation.-func (m *LabelMutation) AddedEdges() []string {- edges := make([]string, 0, 2)+func (m *LocationMutation) AddedEdges() []string {+ edges := make([]string, 0, 4)if m.group != nil {- edges = append(edges, label.EdgeGroup)+ edges = append(edges, location.EdgeGroup)+ }+ if m.parent != nil {+ edges = append(edges, location.EdgeParent)+ }+ if m.children != nil {+ edges = append(edges, location.EdgeChildren)}if m.items != nil {- edges = append(edges, label.EdgeItems)+ edges = append(edges, location.EdgeItems)}return edges}// AddedIDs returns all IDs (to other nodes) that were added for the given edge// name in this mutation.-func (m *LabelMutation) AddedIDs(name string) []ent.Value {+func (m *LocationMutation) AddedIDs(name string) []ent.Value {switch name {- case label.EdgeGroup:+ case location.EdgeGroup:if id := m.group; id != nil {return []ent.Value{*id}}- case label.EdgeItems:+ case location.EdgeParent:+ if id := m.parent; id != nil {+ return []ent.Value{*id}+ }+ case location.EdgeChildren:+ ids := make([]ent.Value, 0, len(m.children))+ for id := range m.children {+ ids = append(ids, id)+ }+ return ids+ case location.EdgeItems:ids := make([]ent.Value, 0, len(m.items))for id := range m.items {ids = append(ids, id)@@ -9359,19 +9400,28 @@ func (m *LabelMutation) AddedIDs(name string) []ent.Value {}// RemovedEdges returns all edge names that were removed in this mutation.-func (m *LabelMutation) RemovedEdges() []string {- edges := make([]string, 0, 2)+func (m *LocationMutation) RemovedEdges() []string {+ edges := make([]string, 0, 4)+ if m.removedchildren != nil {+ edges = append(edges, location.EdgeChildren)+ }if m.removeditems != nil {- edges = append(edges, label.EdgeItems)+ edges = append(edges, location.EdgeItems)}return edges}// RemovedIDs returns all IDs (to other nodes) that were removed for the edge with// the given name in this mutation.-func (m *LabelMutation) RemovedIDs(name string) []ent.Value {+func (m *LocationMutation) RemovedIDs(name string) []ent.Value {switch name {- case label.EdgeItems:+ case location.EdgeChildren:+ ids := make([]ent.Value, 0, len(m.removedchildren))+ for id := range m.removedchildren {+ ids = append(ids, id)+ }+ return ids+ case location.EdgeItems:ids := make([]ent.Value, 0, len(m.removeditems))for id := range m.removeditems {ids = append(ids, id)@@ -9382,24 +9432,34 @@ func (m *LabelMutation) RemovedIDs(name string) []ent.Value {}// ClearedEdges returns all edge names that were cleared in this mutation.-func (m *LabelMutation) ClearedEdges() []string {- edges := make([]string, 0, 2)+func (m *LocationMutation) ClearedEdges() []string {+ edges := make([]string, 0, 4)if m.clearedgroup {- edges = append(edges, label.EdgeGroup)+ edges = append(edges, location.EdgeGroup)+ }+ if m.clearedparent {+ edges = append(edges, location.EdgeParent)+ }+ if m.clearedchildren {+ edges = append(edges, location.EdgeChildren)}if m.cleareditems {- edges = append(edges, label.EdgeItems)+ edges = append(edges, location.EdgeItems)}return edges}// EdgeCleared returns a boolean which indicates if the edge with the given name// was cleared in this mutation.-func (m *LabelMutation) EdgeCleared(name string) bool {+func (m *LocationMutation) EdgeCleared(name string) bool {switch name {- case label.EdgeGroup:+ case location.EdgeGroup:return m.clearedgroup- case label.EdgeItems:+ case location.EdgeParent:+ return m.clearedparent+ case location.EdgeChildren:+ return m.clearedchildren+ case location.EdgeItems:return m.cleareditems}return false@@ -9407,66 +9467,71 @@ func (m *LabelMutation) EdgeCleared(name string) bool {// ClearEdge clears the value of the edge with the given name. It returns an error// if that edge is not defined in the schema.-func (m *LabelMutation) ClearEdge(name string) error {+func (m *LocationMutation) ClearEdge(name string) error {switch name {- case label.EdgeGroup:+ case location.EdgeGroup:m.ClearGroup()return nil+ case location.EdgeParent:+ m.ClearParent()+ return nil}- return fmt.Errorf("unknown Label unique edge %s", name)+ return fmt.Errorf("unknown Location unique edge %s", name)}// ResetEdge resets all changes to the edge with the given name in this mutation.// It returns an error if the edge is not defined in the schema.-func (m *LabelMutation) ResetEdge(name string) error {+func (m *LocationMutation) ResetEdge(name string) error {switch name {- case label.EdgeGroup:+ case location.EdgeGroup:m.ResetGroup()return nil- case label.EdgeItems:+ case location.EdgeParent:+ m.ResetParent()+ return nil+ case location.EdgeChildren:+ m.ResetChildren()+ return nil+ case location.EdgeItems:m.ResetItems()return nil}- return fmt.Errorf("unknown Label edge %s", name)+ return fmt.Errorf("unknown Location edge %s", name)}-// LocationMutation represents an operation that mutates the Location nodes in the graph.-type LocationMutation struct {+// MaintenanceEntryMutation represents an operation that mutates the MaintenanceEntry nodes in the graph.+type MaintenanceEntryMutation struct {config- op Op- typ string- id *uuid.UUID- created_at *time.Time- updated_at *time.Time- name *string- description *string- clearedFields map[string]struct{}- group *uuid.UUID- clearedgroup bool- parent *uuid.UUID- clearedparent bool- children map[uuid.UUID]struct{}- removedchildren map[uuid.UUID]struct{}- clearedchildren bool- items map[uuid.UUID]struct{}- removeditems map[uuid.UUID]struct{}- cleareditems bool- done bool- oldValue func(context.Context) (*Location, error)- predicates []predicate.Location+ op Op+ typ string+ id *uuid.UUID+ created_at *time.Time+ updated_at *time.Time+ date *time.Time+ scheduled_date *time.Time+ name *string+ description *string+ cost *float64+ addcost *float64+ clearedFields map[string]struct{}+ item *uuid.UUID+ cleareditem bool+ done bool+ oldValue func(context.Context) (*MaintenanceEntry, error)+ predicates []predicate.MaintenanceEntry}-var _ ent.Mutation = (*LocationMutation)(nil)+var _ ent.Mutation = (*MaintenanceEntryMutation)(nil)-// locationOption allows management of the mutation configuration using functional options.-type locationOption func(*LocationMutation)+// maintenanceentryOption allows management of the mutation configuration using functional options.+type maintenanceentryOption func(*MaintenanceEntryMutation)-// newLocationMutation creates new mutation for the Location entity.-func newLocationMutation(c config, op Op, opts ...locationOption) *LocationMutation {- m := &LocationMutation{+// newMaintenanceEntryMutation creates new mutation for the MaintenanceEntry entity.+func newMaintenanceEntryMutation(c config, op Op, opts ...maintenanceentryOption) *MaintenanceEntryMutation {+ m := &MaintenanceEntryMutation{config: c,op: op,- typ: TypeLocation,+ typ: TypeMaintenanceEntry,clearedFields: make(map[string]struct{}),}for _, opt := range opts {@@ -9475,20 +9540,20 @@ func newLocationMutation(c config, op Op, opts ...locationOption) *LocationMutatreturn m}-// withLocationID sets the ID field of the mutation.-func withLocationID(id uuid.UUID) locationOption {- return func(m *LocationMutation) {+// withMaintenanceEntryID sets the ID field of the mutation.+func withMaintenanceEntryID(id uuid.UUID) maintenanceentryOption {+ return func(m *MaintenanceEntryMutation) {var (err erroronce sync.Once- value *Location+ value *MaintenanceEntry)- m.oldValue = func(ctx context.Context) (*Location, error) {+ m.oldValue = func(ctx context.Context) (*MaintenanceEntry, error) {once.Do(func() {if m.done {err = errors.New("querying old values post mutation is not allowed")} else {- value, err = m.Client().Location.Get(ctx, id)+ value, err = m.Client().MaintenanceEntry.Get(ctx, id)}})return value, err@@ -9497,10 +9562,10 @@ func withLocationID(id uuid.UUID) locationOption {}}-// withLocation sets the old Location of the mutation.-func withLocation(node *Location) locationOption {- return func(m *LocationMutation) {- m.oldValue = func(context.Context) (*Location, error) {+// withMaintenanceEntry sets the old MaintenanceEntry of the mutation.+func withMaintenanceEntry(node *MaintenanceEntry) maintenanceentryOption {+ return func(m *MaintenanceEntryMutation) {+ m.oldValue = func(context.Context) (*MaintenanceEntry, error) {return node, nil}m.id = &node.ID@@ -9509,7 +9574,7 @@ func withLocation(node *Location) locationOption {// Client returns a new `ent.Client` from the mutation. If the mutation was// executed in a transaction (ent.Tx), a transactional client is returned.-func (m LocationMutation) Client() *Client {+func (m MaintenanceEntryMutation) Client() *Client {client := &Client{config: m.config}client.init()return client@@ -9517,7 +9582,7 @@ func (m LocationMutation) Client() *Client {// Tx returns an `ent.Tx` for mutations that were executed in transactions;// it returns an error otherwise.-func (m LocationMutation) Tx() (*Tx, error) {+func (m MaintenanceEntryMutation) Tx() (*Tx, error) {if _, ok := m.driver.(*txDriver); !ok {return nil, errors.New("ent: mutation is not running in a transaction")}@@ -9527,14 +9592,14 @@ func (m LocationMutation) Tx() (*Tx, error) {}// SetID sets the value of the id field. Note that this-// operation is only accepted on creation of Location entities.-func (m *LocationMutation) SetID(id uuid.UUID) {+// operation is only accepted on creation of MaintenanceEntry entities.+func (m *MaintenanceEntryMutation) SetID(id uuid.UUID) {m.id = &id}// ID returns the ID value in the mutation. Note that the ID is only available// if it was provided to the builder or after it was returned from the database.-func (m *LocationMutation) ID() (id uuid.UUID, exists bool) {+func (m *MaintenanceEntryMutation) ID() (id uuid.UUID, exists bool) {if m.id == nil {return}@@ -9545,7 +9610,7 @@ func (m *LocationMutation) ID() (id uuid.UUID, exists bool) {// That means, if the mutation is applied within a transaction with an isolation level such// as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated// or updated by the mutation.-func (m *LocationMutation) IDs(ctx context.Context) ([]uuid.UUID, error) {+func (m *MaintenanceEntryMutation) IDs(ctx context.Context) ([]uuid.UUID, error) {switch {case m.op.Is(OpUpdateOne | OpDeleteOne):id, exists := m.ID()@@ -9554,19 +9619,19 @@ func (m *LocationMutation) IDs(ctx context.Context) ([]uuid.UUID, error) {}fallthroughcase m.op.Is(OpUpdate | OpDelete):- return m.Client().Location.Query().Where(m.predicates...).IDs(ctx)+ return m.Client().MaintenanceEntry.Query().Where(m.predicates...).IDs(ctx)default:return nil, fmt.Errorf("IDs is not allowed on %s operations", m.op)}}// SetCreatedAt sets the "created_at" field.-func (m *LocationMutation) SetCreatedAt(t time.Time) {+func (m *MaintenanceEntryMutation) SetCreatedAt(t time.Time) {m.created_at = &t}// CreatedAt returns the value of the "created_at" field in the mutation.-func (m *LocationMutation) CreatedAt() (r time.Time, exists bool) {+func (m *MaintenanceEntryMutation) CreatedAt() (r time.Time, exists bool) {v := m.created_atif v == nil {return@@ -9574,10 +9639,10 @@ func (m *LocationMutation) CreatedAt() (r time.Time, exists bool) {return *v, true}-// OldCreatedAt returns the old "created_at" field's value of the Location entity.-// If the Location object wasn't provided to the builder, the object is fetched from the database.+// OldCreatedAt returns the old "created_at" field's value of the MaintenanceEntry entity.+// If the MaintenanceEntry object wasn't provided to the builder, the object is fetched from the database.// An error is returned if the mutation operation is not UpdateOne, or the database query fails.-func (m *LocationMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error) {+func (m *MaintenanceEntryMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error) {if !m.op.Is(OpUpdateOne) {return v, errors.New("OldCreatedAt is only allowed on UpdateOne operations")}@@ -9592,17 +9657,17 @@ func (m *LocationMutation) OldCreatedAt(ctx context.Context) (v time.Time, err e}// ResetCreatedAt resets all changes to the "created_at" field.-func (m *LocationMutation) ResetCreatedAt() {+func (m *MaintenanceEntryMutation) ResetCreatedAt() {m.created_at = nil}// SetUpdatedAt sets the "updated_at" field.-func (m *LocationMutation) SetUpdatedAt(t time.Time) {+func (m *MaintenanceEntryMutation) SetUpdatedAt(t time.Time) {m.updated_at = &t}// UpdatedAt returns the value of the "updated_at" field in the mutation.-func (m *LocationMutation) UpdatedAt() (r time.Time, exists bool) {+func (m *MaintenanceEntryMutation) UpdatedAt() (r time.Time, exists bool) {v := m.updated_atif v == nil {return@@ -9610,10 +9675,10 @@ func (m *LocationMutation) UpdatedAt() (r time.Time, exists bool) {return *v, true}-// OldUpdatedAt returns the old "updated_at" field's value of the Location entity.-// If the Location object wasn't provided to the builder, the object is fetched from the database.+// OldUpdatedAt returns the old "updated_at" field's value of the MaintenanceEntry entity.+// If the MaintenanceEntry object wasn't provided to the builder, the object is fetched from the database.// An error is returned if the mutation operation is not UpdateOne, or the database query fails.-func (m *LocationMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error) {+func (m *MaintenanceEntryMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error) {if !m.op.Is(OpUpdateOne) {return v, errors.New("OldUpdatedAt is only allowed on UpdateOne operations")}@@ -9628,290 +9693,321 @@ func (m *LocationMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err e}// ResetUpdatedAt resets all changes to the "updated_at" field.-func (m *LocationMutation) ResetUpdatedAt() {+func (m *MaintenanceEntryMutation) ResetUpdatedAt() {m.updated_at = nil}-// SetName sets the "name" field.-func (m *LocationMutation) SetName(s string) {- m.name = &s+// SetItemID sets the "item_id" field.+func (m *MaintenanceEntryMutation) SetItemID(u uuid.UUID) {+ m.item = &u}-// Name returns the value of the "name" field in the mutation.-func (m *LocationMutation) Name() (r string, exists bool) {- v := m.name+// ItemID returns the value of the "item_id" field in the mutation.+func (m *MaintenanceEntryMutation) ItemID() (r uuid.UUID, exists bool) {+ v := m.itemif v == nil {return}return *v, true}-// OldName returns the old "name" field's value of the Location entity.-// If the Location object wasn't provided to the builder, the object is fetched from the database.+// OldItemID returns the old "item_id" field's value of the MaintenanceEntry entity.+// If the MaintenanceEntry object wasn't provided to the builder, the object is fetched from the database.// An error is returned if the mutation operation is not UpdateOne, or the database query fails.-func (m *LocationMutation) OldName(ctx context.Context) (v string, err error) {+func (m *MaintenanceEntryMutation) OldItemID(ctx context.Context) (v uuid.UUID, err error) {if !m.op.Is(OpUpdateOne) {- return v, errors.New("OldName is only allowed on UpdateOne operations")+ return v, errors.New("OldItemID is only allowed on UpdateOne operations")}if m.id == nil || m.oldValue == nil {- return v, errors.New("OldName requires an ID field in the mutation")+ return v, errors.New("OldItemID requires an ID field in the mutation")}oldValue, err := m.oldValue(ctx)if err != nil {- return v, fmt.Errorf("querying old value for OldName: %w", err)+ return v, fmt.Errorf("querying old value for OldItemID: %w", err)}- return oldValue.Name, nil+ return oldValue.ItemID, nil}-// ResetName resets all changes to the "name" field.-func (m *LocationMutation) ResetName() {- m.name = nil+// ResetItemID resets all changes to the "item_id" field.+func (m *MaintenanceEntryMutation) ResetItemID() {+ m.item = nil}-// SetDescription sets the "description" field.-func (m *LocationMutation) SetDescription(s string) {- m.description = &s+// SetDate sets the "date" field.+func (m *MaintenanceEntryMutation) SetDate(t time.Time) {+ m.date = &t}-// Description returns the value of the "description" field in the mutation.-func (m *LocationMutation) Description() (r string, exists bool) {- v := m.description+// Date returns the value of the "date" field in the mutation.+func (m *MaintenanceEntryMutation) Date() (r time.Time, exists bool) {+ v := m.dateif v == nil {return}return *v, true}-// OldDescription returns the old "description" field's value of the Location entity.-// If the Location object wasn't provided to the builder, the object is fetched from the database.+// OldDate returns the old "date" field's value of the MaintenanceEntry entity.+// If the MaintenanceEntry object wasn't provided to the builder, the object is fetched from the database.// An error is returned if the mutation operation is not UpdateOne, or the database query fails.-func (m *LocationMutation) OldDescription(ctx context.Context) (v string, err error) {+func (m *MaintenanceEntryMutation) OldDate(ctx context.Context) (v time.Time, err error) {if !m.op.Is(OpUpdateOne) {- return v, errors.New("OldDescription is only allowed on UpdateOne operations")+ return v, errors.New("OldDate is only allowed on UpdateOne operations")}if m.id == nil || m.oldValue == nil {- return v, errors.New("OldDescription requires an ID field in the mutation")+ return v, errors.New("OldDate requires an ID field in the mutation")}oldValue, err := m.oldValue(ctx)if err != nil {- return v, fmt.Errorf("querying old value for OldDescription: %w", err)+ return v, fmt.Errorf("querying old value for OldDate: %w", err)}- return oldValue.Description, nil+ return oldValue.Date, nil}-// ClearDescription clears the value of the "description" field.-func (m *LocationMutation) ClearDescription() {- m.description = nil- m.clearedFields[location.FieldDescription] = struct{}{}+// ClearDate clears the value of the "date" field.+func (m *MaintenanceEntryMutation) ClearDate() {+ m.date = nil+ m.clearedFields[maintenanceentry.FieldDate] = struct{}{}}-// DescriptionCleared returns if the "description" field was cleared in this mutation.-func (m *LocationMutation) DescriptionCleared() bool {- _, ok := m.clearedFields[location.FieldDescription]+// DateCleared returns if the "date" field was cleared in this mutation.+func (m *MaintenanceEntryMutation) DateCleared() bool {+ _, ok := m.clearedFields[maintenanceentry.FieldDate]return ok}-// ResetDescription resets all changes to the "description" field.-func (m *LocationMutation) ResetDescription() {- m.description = nil- delete(m.clearedFields, location.FieldDescription)-}--// SetGroupID sets the "group" edge to the Group entity by id.-func (m *LocationMutation) SetGroupID(id uuid.UUID) {- m.group = &id-}--// ClearGroup clears the "group" edge to the Group entity.-func (m *LocationMutation) ClearGroup() {- m.clearedgroup = true+// ResetDate resets all changes to the "date" field.+func (m *MaintenanceEntryMutation) ResetDate() {+ m.date = nil+ delete(m.clearedFields, maintenanceentry.FieldDate)}-// GroupCleared reports if the "group" edge to the Group entity was cleared.-func (m *LocationMutation) GroupCleared() bool {- return m.clearedgroup+// SetScheduledDate sets the "scheduled_date" field.+func (m *MaintenanceEntryMutation) SetScheduledDate(t time.Time) {+ m.scheduled_date = &t}-// GroupID returns the "group" edge ID in the mutation.-func (m *LocationMutation) GroupID() (id uuid.UUID, exists bool) {- if m.group != nil {- return *m.group, true+// ScheduledDate returns the value of the "scheduled_date" field in the mutation.+func (m *MaintenanceEntryMutation) ScheduledDate() (r time.Time, exists bool) {+ v := m.scheduled_date+ if v == nil {+ return}- return+ return *v, true}-// GroupIDs returns the "group" edge IDs in the mutation.-// Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use-// GroupID instead. It exists only for internal usage by the builders.-func (m *LocationMutation) GroupIDs() (ids []uuid.UUID) {- if id := m.group; id != nil {- ids = append(ids, *id)+// OldScheduledDate returns the old "scheduled_date" field's value of the MaintenanceEntry entity.+// If the MaintenanceEntry object wasn't provided to the builder, the object is fetched from the database.+// An error is returned if the mutation operation is not UpdateOne, or the database query fails.+func (m *MaintenanceEntryMutation) OldScheduledDate(ctx context.Context) (v time.Time, err error) {+ if !m.op.Is(OpUpdateOne) {+ return v, errors.New("OldScheduledDate is only allowed on UpdateOne operations")}- return+ if m.id == nil || m.oldValue == nil {+ return v, errors.New("OldScheduledDate requires an ID field in the mutation")+ }+ oldValue, err := m.oldValue(ctx)+ if err != nil {+ return v, fmt.Errorf("querying old value for OldScheduledDate: %w", err)+ }+ return oldValue.ScheduledDate, nil}-// ResetGroup resets all changes to the "group" edge.-func (m *LocationMutation) ResetGroup() {- m.group = nil- m.clearedgroup = false+// ClearScheduledDate clears the value of the "scheduled_date" field.+func (m *MaintenanceEntryMutation) ClearScheduledDate() {+ m.scheduled_date = nil+ m.clearedFields[maintenanceentry.FieldScheduledDate] = struct{}{}}-// SetParentID sets the "parent" edge to the Location entity by id.-func (m *LocationMutation) SetParentID(id uuid.UUID) {- m.parent = &id+// ScheduledDateCleared returns if the "scheduled_date" field was cleared in this mutation.+func (m *MaintenanceEntryMutation) ScheduledDateCleared() bool {+ _, ok := m.clearedFields[maintenanceentry.FieldScheduledDate]+ return ok}-// ClearParent clears the "parent" edge to the Location entity.-func (m *LocationMutation) ClearParent() {- m.clearedparent = true+// ResetScheduledDate resets all changes to the "scheduled_date" field.+func (m *MaintenanceEntryMutation) ResetScheduledDate() {+ m.scheduled_date = nil+ delete(m.clearedFields, maintenanceentry.FieldScheduledDate)}-// ParentCleared reports if the "parent" edge to the Location entity was cleared.-func (m *LocationMutation) ParentCleared() bool {- return m.clearedparent+// SetName sets the "name" field.+func (m *MaintenanceEntryMutation) SetName(s string) {+ m.name = &s}-// ParentID returns the "parent" edge ID in the mutation.-func (m *LocationMutation) ParentID() (id uuid.UUID, exists bool) {- if m.parent != nil {- return *m.parent, true+// Name returns the value of the "name" field in the mutation.+func (m *MaintenanceEntryMutation) Name() (r string, exists bool) {+ v := m.name+ if v == nil {+ return}- return+ return *v, true}-// ParentIDs returns the "parent" edge IDs in the mutation.-// Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use-// ParentID instead. It exists only for internal usage by the builders.-func (m *LocationMutation) ParentIDs() (ids []uuid.UUID) {- if id := m.parent; id != nil {- ids = append(ids, *id)+// OldName returns the old "name" field's value of the MaintenanceEntry entity.+// If the MaintenanceEntry object wasn't provided to the builder, the object is fetched from the database.+// An error is returned if the mutation operation is not UpdateOne, or the database query fails.+func (m *MaintenanceEntryMutation) OldName(ctx context.Context) (v string, err error) {+ if !m.op.Is(OpUpdateOne) {+ return v, errors.New("OldName is only allowed on UpdateOne operations")}- return+ if m.id == nil || m.oldValue == nil {+ return v, errors.New("OldName requires an ID field in the mutation")+ }+ oldValue, err := m.oldValue(ctx)+ if err != nil {+ return v, fmt.Errorf("querying old value for OldName: %w", err)+ }+ return oldValue.Name, nil}-// ResetParent resets all changes to the "parent" edge.-func (m *LocationMutation) ResetParent() {- m.parent = nil- m.clearedparent = false+// ResetName resets all changes to the "name" field.+func (m *MaintenanceEntryMutation) ResetName() {+ m.name = nil}-// AddChildIDs adds the "children" edge to the Location entity by ids.-func (m *LocationMutation) AddChildIDs(ids ...uuid.UUID) {- if m.children == nil {- m.children = make(map[uuid.UUID]struct{})+// SetDescription sets the "description" field.+func (m *MaintenanceEntryMutation) SetDescription(s string) {+ m.description = &s+}++// Description returns the value of the "description" field in the mutation.+func (m *MaintenanceEntryMutation) Description() (r string, exists bool) {+ v := m.description+ if v == nil {+ return}- for i := range ids {- m.children[ids[i]] = struct{}{}+ return *v, true+}++// OldDescription returns the old "description" field's value of the MaintenanceEntry entity.+// If the MaintenanceEntry object wasn't provided to the builder, the object is fetched from the database.+// An error is returned if the mutation operation is not UpdateOne, or the database query fails.+func (m *MaintenanceEntryMutation) OldDescription(ctx context.Context) (v string, err error) {+ if !m.op.Is(OpUpdateOne) {+ return v, errors.New("OldDescription is only allowed on UpdateOne operations")+ }+ if m.id == nil || m.oldValue == nil {+ return v, errors.New("OldDescription requires an ID field in the mutation")}+ oldValue, err := m.oldValue(ctx)+ if err != nil {+ return v, fmt.Errorf("querying old value for OldDescription: %w", err)+ }+ return oldValue.Description, nil}-// ClearChildren clears the "children" edge to the Location entity.-func (m *LocationMutation) ClearChildren() {- m.clearedchildren = true+// ClearDescription clears the value of the "description" field.+func (m *MaintenanceEntryMutation) ClearDescription() {+ m.description = nil+ m.clearedFields[maintenanceentry.FieldDescription] = struct{}{}}-// ChildrenCleared reports if the "children" edge to the Location entity was cleared.-func (m *LocationMutation) ChildrenCleared() bool {- return m.clearedchildren+// DescriptionCleared returns if the "description" field was cleared in this mutation.+func (m *MaintenanceEntryMutation) DescriptionCleared() bool {+ _, ok := m.clearedFields[maintenanceentry.FieldDescription]+ return ok}-// RemoveChildIDs removes the "children" edge to the Location entity by IDs.-func (m *LocationMutation) RemoveChildIDs(ids ...uuid.UUID) {- if m.removedchildren == nil {- m.removedchildren = make(map[uuid.UUID]struct{})- }- for i := range ids {- delete(m.children, ids[i])- m.removedchildren[ids[i]] = struct{}{}- }+// ResetDescription resets all changes to the "description" field.+func (m *MaintenanceEntryMutation) ResetDescription() {+ m.description = nil+ delete(m.clearedFields, maintenanceentry.FieldDescription)}-// RemovedChildren returns the removed IDs of the "children" edge to the Location entity.-func (m *LocationMutation) RemovedChildrenIDs() (ids []uuid.UUID) {- for id := range m.removedchildren {- ids = append(ids, id)- }- return+// SetCost sets the "cost" field.+func (m *MaintenanceEntryMutation) SetCost(f float64) {+ m.cost = &f+ m.addcost = nil}-// ChildrenIDs returns the "children" edge IDs in the mutation.-func (m *LocationMutation) ChildrenIDs() (ids []uuid.UUID) {- for id := range m.children {- ids = append(ids, id)+// Cost returns the value of the "cost" field in the mutation.+func (m *MaintenanceEntryMutation) Cost() (r float64, exists bool) {+ v := m.cost+ if v == nil {+ return}- return+ return *v, true}-// ResetChildren resets all changes to the "children" edge.-func (m *LocationMutation) ResetChildren() {- m.children = nil- m.clearedchildren = false- m.removedchildren = nil+// OldCost returns the old "cost" field's value of the MaintenanceEntry entity.+// If the MaintenanceEntry object wasn't provided to the builder, the object is fetched from the database.+// An error is returned if the mutation operation is not UpdateOne, or the database query fails.+func (m *MaintenanceEntryMutation) OldCost(ctx context.Context) (v float64, err error) {+ if !m.op.Is(OpUpdateOne) {+ return v, errors.New("OldCost is only allowed on UpdateOne operations")+ }+ if m.id == nil || m.oldValue == nil {+ return v, errors.New("OldCost requires an ID field in the mutation")+ }+ oldValue, err := m.oldValue(ctx)+ if err != nil {+ return v, fmt.Errorf("querying old value for OldCost: %w", err)+ }+ return oldValue.Cost, nil}-// AddItemIDs adds the "items" edge to the Item entity by ids.-func (m *LocationMutation) AddItemIDs(ids ...uuid.UUID) {- if m.items == nil {- m.items = make(map[uuid.UUID]struct{})- }- for i := range ids {- m.items[ids[i]] = struct{}{}+// AddCost adds f to the "cost" field.+func (m *MaintenanceEntryMutation) AddCost(f float64) {+ if m.addcost != nil {+ *m.addcost += f+ } else {+ m.addcost = &f}}-// ClearItems clears the "items" edge to the Item entity.-func (m *LocationMutation) ClearItems() {- m.cleareditems = true+// AddedCost returns the value that was added to the "cost" field in this mutation.+func (m *MaintenanceEntryMutation) AddedCost() (r float64, exists bool) {+ v := m.addcost+ if v == nil {+ return+ }+ return *v, true}-// ItemsCleared reports if the "items" edge to the Item entity was cleared.-func (m *LocationMutation) ItemsCleared() bool {- return m.cleareditems+// ResetCost resets all changes to the "cost" field.+func (m *MaintenanceEntryMutation) ResetCost() {+ m.cost = nil+ m.addcost = nil}-// RemoveItemIDs removes the "items" edge to the Item entity by IDs.-func (m *LocationMutation) RemoveItemIDs(ids ...uuid.UUID) {- if m.removeditems == nil {- m.removeditems = make(map[uuid.UUID]struct{})- }- for i := range ids {- delete(m.items, ids[i])- m.removeditems[ids[i]] = struct{}{}- }+// ClearItem clears the "item" edge to the Item entity.+func (m *MaintenanceEntryMutation) ClearItem() {+ m.cleareditem = true+ m.clearedFields[maintenanceentry.FieldItemID] = struct{}{}}-// RemovedItems returns the removed IDs of the "items" edge to the Item entity.-func (m *LocationMutation) RemovedItemsIDs() (ids []uuid.UUID) {- for id := range m.removeditems {- ids = append(ids, id)- }- return+// ItemCleared reports if the "item" edge to the Item entity was cleared.+func (m *MaintenanceEntryMutation) ItemCleared() bool {+ return m.cleareditem}-// ItemsIDs returns the "items" edge IDs in the mutation.-func (m *LocationMutation) ItemsIDs() (ids []uuid.UUID) {- for id := range m.items {- ids = append(ids, id)+// ItemIDs returns the "item" edge IDs in the mutation.+// Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use+// ItemID instead. It exists only for internal usage by the builders.+func (m *MaintenanceEntryMutation) ItemIDs() (ids []uuid.UUID) {+ if id := m.item; id != nil {+ ids = append(ids, *id)}return}-// ResetItems resets all changes to the "items" edge.-func (m *LocationMutation) ResetItems() {- m.items = nil- m.cleareditems = false- m.removeditems = nil+// ResetItem resets all changes to the "item" edge.+func (m *MaintenanceEntryMutation) ResetItem() {+ m.item = nil+ m.cleareditem = false}-// Where appends a list predicates to the LocationMutation builder.-func (m *LocationMutation) Where(ps ...predicate.Location) {+// Where appends a list predicates to the MaintenanceEntryMutation builder.+func (m *MaintenanceEntryMutation) Where(ps ...predicate.MaintenanceEntry) {m.predicates = append(m.predicates, ps...)}-// WhereP appends storage-level predicates to the LocationMutation builder. Using this method,+// WhereP appends storage-level predicates to the MaintenanceEntryMutation builder. Using this method,// users can use type-assertion to append predicates that do not depend on any generated package.-func (m *LocationMutation) WhereP(ps ...func(*sql.Selector)) {- p := make([]predicate.Location, len(ps))+func (m *MaintenanceEntryMutation) WhereP(ps ...func(*sql.Selector)) {+ p := make([]predicate.MaintenanceEntry, len(ps))for i := range ps {p[i] = ps[i]}@@ -9919,36 +10015,48 @@ func (m *LocationMutation) WhereP(ps ...func(*sql.Selector)) {}// Op returns the operation name.-func (m *LocationMutation) Op() Op {+func (m *MaintenanceEntryMutation) Op() Op {return m.op}// SetOp allows setting the mutation operation.-func (m *LocationMutation) SetOp(op Op) {+func (m *MaintenanceEntryMutation) SetOp(op Op) {m.op = op}-// Type returns the node type of this mutation (Location).-func (m *LocationMutation) Type() string {+// Type returns the node type of this mutation (MaintenanceEntry).+func (m *MaintenanceEntryMutation) Type() string {return m.typ}// Fields returns all fields that were changed during this mutation. Note that in// order to get all numeric fields that were incremented/decremented, call// AddedFields().-func (m *LocationMutation) Fields() []string {- fields := make([]string, 0, 4)+func (m *MaintenanceEntryMutation) Fields() []string {+ fields := make([]string, 0, 8)if m.created_at != nil {- fields = append(fields, location.FieldCreatedAt)+ fields = append(fields, maintenanceentry.FieldCreatedAt)}if m.updated_at != nil {- fields = append(fields, location.FieldUpdatedAt)+ fields = append(fields, maintenanceentry.FieldUpdatedAt)+ }+ if m.item != nil {+ fields = append(fields, maintenanceentry.FieldItemID)+ }+ if m.date != nil {+ fields = append(fields, maintenanceentry.FieldDate)+ }+ if m.scheduled_date != nil {+ fields = append(fields, maintenanceentry.FieldScheduledDate)}if m.name != nil {- fields = append(fields, location.FieldName)+ fields = append(fields, maintenanceentry.FieldName)}if m.description != nil {- fields = append(fields, location.FieldDescription)+ fields = append(fields, maintenanceentry.FieldDescription)+ }+ if m.cost != nil {+ fields = append(fields, maintenanceentry.FieldCost)}return fields}@@ -9956,16 +10064,24 @@ func (m *LocationMutation) Fields() []string {// Field returns the value of a field with the given name. The second boolean// return value indicates that this field was not set, or was not defined in the// schema.-func (m *LocationMutation) Field(name string) (ent.Value, bool) {+func (m *MaintenanceEntryMutation) Field(name string) (ent.Value, bool) {switch name {- case location.FieldCreatedAt:+ case maintenanceentry.FieldCreatedAt:return m.CreatedAt()- case location.FieldUpdatedAt:+ case maintenanceentry.FieldUpdatedAt:return m.UpdatedAt()- case location.FieldName:+ case maintenanceentry.FieldItemID:+ return m.ItemID()+ case maintenanceentry.FieldDate:+ return m.Date()+ case maintenanceentry.FieldScheduledDate:+ return m.ScheduledDate()+ case maintenanceentry.FieldName:return m.Name()- case location.FieldDescription:+ case maintenanceentry.FieldDescription:return m.Description()+ case maintenanceentry.FieldCost:+ return m.Cost()}return nil, false}@@ -9973,306 +10089,308 @@ func (m *LocationMutation) Field(name string) (ent.Value, bool) {// OldField returns the old value of the field from the database. An error is// returned if the mutation operation is not UpdateOne, or the query to the// database failed.-func (m *LocationMutation) OldField(ctx context.Context, name string) (ent.Value, error) {+func (m *MaintenanceEntryMutation) OldField(ctx context.Context, name string) (ent.Value, error) {switch name {- case location.FieldCreatedAt:+ case maintenanceentry.FieldCreatedAt:return m.OldCreatedAt(ctx)- case location.FieldUpdatedAt:+ case maintenanceentry.FieldUpdatedAt:return m.OldUpdatedAt(ctx)- case location.FieldName:+ case maintenanceentry.FieldItemID:+ return m.OldItemID(ctx)+ case maintenanceentry.FieldDate:+ return m.OldDate(ctx)+ case maintenanceentry.FieldScheduledDate:+ return m.OldScheduledDate(ctx)+ case maintenanceentry.FieldName:return m.OldName(ctx)- case location.FieldDescription:+ case maintenanceentry.FieldDescription:return m.OldDescription(ctx)+ case maintenanceentry.FieldCost:+ return m.OldCost(ctx)}- return nil, fmt.Errorf("unknown Location field %s", name)+ return nil, fmt.Errorf("unknown MaintenanceEntry field %s", name)}// SetField sets the value of a field with the given name. It returns an error if// the field is not defined in the schema, or if the type mismatched the field// type.-func (m *LocationMutation) SetField(name string, value ent.Value) error {+func (m *MaintenanceEntryMutation) SetField(name string, value ent.Value) error {switch name {- case location.FieldCreatedAt:+ case maintenanceentry.FieldCreatedAt:v, ok := value.(time.Time)if !ok {return fmt.Errorf("unexpected type %T for field %s", value, name)}m.SetCreatedAt(v)return nil- case location.FieldUpdatedAt:+ case maintenanceentry.FieldUpdatedAt:v, ok := value.(time.Time)if !ok {return fmt.Errorf("unexpected type %T for field %s", value, name)}m.SetUpdatedAt(v)return nil- case location.FieldName:+ case maintenanceentry.FieldItemID:+ v, ok := value.(uuid.UUID)+ if !ok {+ return fmt.Errorf("unexpected type %T for field %s", value, name)+ }+ m.SetItemID(v)+ return nil+ case maintenanceentry.FieldDate:+ v, ok := value.(time.Time)+ if !ok {+ return fmt.Errorf("unexpected type %T for field %s", value, name)+ }+ m.SetDate(v)+ return nil+ case maintenanceentry.FieldScheduledDate:+ v, ok := value.(time.Time)+ if !ok {+ return fmt.Errorf("unexpected type %T for field %s", value, name)+ }+ m.SetScheduledDate(v)+ return nil+ case maintenanceentry.FieldName:v, ok := value.(string)if !ok {return fmt.Errorf("unexpected type %T for field %s", value, name)}m.SetName(v)return nil- case location.FieldDescription:+ case maintenanceentry.FieldDescription:v, ok := value.(string)if !ok {return fmt.Errorf("unexpected type %T for field %s", value, name)}m.SetDescription(v)return nil+ case maintenanceentry.FieldCost:+ v, ok := value.(float64)+ if !ok {+ return fmt.Errorf("unexpected type %T for field %s", value, name)+ }+ m.SetCost(v)+ return nil}- return fmt.Errorf("unknown Location field %s", name)+ return fmt.Errorf("unknown MaintenanceEntry field %s", name)}// AddedFields returns all numeric fields that were incremented/decremented during// this mutation.-func (m *LocationMutation) AddedFields() []string {- return nil+func (m *MaintenanceEntryMutation) AddedFields() []string {+ var fields []string+ if m.addcost != nil {+ fields = append(fields, maintenanceentry.FieldCost)+ }+ return fields}// AddedField returns the numeric value that was incremented/decremented on a field// with the given name. The second boolean return value indicates that this field// was not set, or was not defined in the schema.-func (m *LocationMutation) AddedField(name string) (ent.Value, bool) {+func (m *MaintenanceEntryMutation) AddedField(name string) (ent.Value, bool) {+ switch name {+ case maintenanceentry.FieldCost:+ return m.AddedCost()+ }return nil, false}// AddField adds the value to the field with the given name. It returns an error if// the field is not defined in the schema, or if the type mismatched the field// type.-func (m *LocationMutation) AddField(name string, value ent.Value) error {+func (m *MaintenanceEntryMutation) AddField(name string, value ent.Value) error {switch name {+ case maintenanceentry.FieldCost:+ v, ok := value.(float64)+ if !ok {+ return fmt.Errorf("unexpected type %T for field %s", value, name)+ }+ m.AddCost(v)+ return nil}- return fmt.Errorf("unknown Location numeric field %s", name)+ return fmt.Errorf("unknown MaintenanceEntry numeric field %s", name)}// ClearedFields returns all nullable fields that were cleared during this// mutation.-func (m *LocationMutation) ClearedFields() []string {+func (m *MaintenanceEntryMutation) ClearedFields() []string {var fields []string- if m.FieldCleared(location.FieldDescription) {- fields = append(fields, location.FieldDescription)+ if m.FieldCleared(maintenanceentry.FieldDate) {+ fields = append(fields, maintenanceentry.FieldDate)+ }+ if m.FieldCleared(maintenanceentry.FieldScheduledDate) {+ fields = append(fields, maintenanceentry.FieldScheduledDate)+ }+ if m.FieldCleared(maintenanceentry.FieldDescription) {+ fields = append(fields, maintenanceentry.FieldDescription)}return fields}// FieldCleared returns a boolean indicating if a field with the given name was// cleared in this mutation.-func (m *LocationMutation) FieldCleared(name string) bool {+func (m *MaintenanceEntryMutation) FieldCleared(name string) bool {_, ok := m.clearedFields[name]return ok}// ClearField clears the value of the field with the given name. It returns an// error if the field is not defined in the schema.-func (m *LocationMutation) ClearField(name string) error {+func (m *MaintenanceEntryMutation) ClearField(name string) error {switch name {- case location.FieldDescription:+ case maintenanceentry.FieldDate:+ m.ClearDate()+ return nil+ case maintenanceentry.FieldScheduledDate:+ m.ClearScheduledDate()+ return nil+ case maintenanceentry.FieldDescription:m.ClearDescription()return nil}- return fmt.Errorf("unknown Location nullable field %s", name)+ return fmt.Errorf("unknown MaintenanceEntry nullable field %s", name)}// ResetField resets all changes in the mutation for the field with the given name.// It returns an error if the field is not defined in the schema.-func (m *LocationMutation) ResetField(name string) error {+func (m *MaintenanceEntryMutation) ResetField(name string) error {switch name {- case location.FieldCreatedAt:+ case maintenanceentry.FieldCreatedAt:m.ResetCreatedAt()return nil- case location.FieldUpdatedAt:+ case maintenanceentry.FieldUpdatedAt:m.ResetUpdatedAt()return nil- case location.FieldName:+ case maintenanceentry.FieldItemID:+ m.ResetItemID()+ return nil+ case maintenanceentry.FieldDate:+ m.ResetDate()+ return nil+ case maintenanceentry.FieldScheduledDate:+ m.ResetScheduledDate()+ return nil+ case maintenanceentry.FieldName:m.ResetName()return nil- case location.FieldDescription:+ case maintenanceentry.FieldDescription:m.ResetDescription()return nil+ case maintenanceentry.FieldCost:+ m.ResetCost()+ return nil}- return fmt.Errorf("unknown Location field %s", name)+ return fmt.Errorf("unknown MaintenanceEntry field %s", name)}// AddedEdges returns all edge names that were set/added in this mutation.-func (m *LocationMutation) AddedEdges() []string {- edges := make([]string, 0, 4)- if m.group != nil {- edges = append(edges, location.EdgeGroup)- }- if m.parent != nil {- edges = append(edges, location.EdgeParent)- }- if m.children != nil {- edges = append(edges, location.EdgeChildren)- }- if m.items != nil {- edges = append(edges, location.EdgeItems)+func (m *MaintenanceEntryMutation) AddedEdges() []string {+ edges := make([]string, 0, 1)+ if m.item != nil {+ edges = append(edges, maintenanceentry.EdgeItem)}return edges}// AddedIDs returns all IDs (to other nodes) that were added for the given edge// name in this mutation.-func (m *LocationMutation) AddedIDs(name string) []ent.Value {+func (m *MaintenanceEntryMutation) AddedIDs(name string) []ent.Value {switch name {- case location.EdgeGroup:- if id := m.group; id != nil {- return []ent.Value{*id}- }- case location.EdgeParent:- if id := m.parent; id != nil {+ case maintenanceentry.EdgeItem:+ if id := m.item; id != nil {return []ent.Value{*id}}- case location.EdgeChildren:- ids := make([]ent.Value, 0, len(m.children))- for id := range m.children {- ids = append(ids, id)- }- return ids- case location.EdgeItems:- ids := make([]ent.Value, 0, len(m.items))- for id := range m.items {- ids = append(ids, id)- }- return ids}return nil}// RemovedEdges returns all edge names that were removed in this mutation.-func (m *LocationMutation) RemovedEdges() []string {- edges := make([]string, 0, 4)- if m.removedchildren != nil {- edges = append(edges, location.EdgeChildren)- }- if m.removeditems != nil {- edges = append(edges, location.EdgeItems)- }+func (m *MaintenanceEntryMutation) RemovedEdges() []string {+ edges := make([]string, 0, 1)return edges}// RemovedIDs returns all IDs (to other nodes) that were removed for the edge with// the given name in this mutation.-func (m *LocationMutation) RemovedIDs(name string) []ent.Value {- switch name {- case location.EdgeChildren:- ids := make([]ent.Value, 0, len(m.removedchildren))- for id := range m.removedchildren {- ids = append(ids, id)- }- return ids- case location.EdgeItems:- ids := make([]ent.Value, 0, len(m.removeditems))- for id := range m.removeditems {- ids = append(ids, id)- }- return ids- }+func (m *MaintenanceEntryMutation) RemovedIDs(name string) []ent.Value {return nil}// ClearedEdges returns all edge names that were cleared in this mutation.-func (m *LocationMutation) ClearedEdges() []string {- edges := make([]string, 0, 4)- if m.clearedgroup {- edges = append(edges, location.EdgeGroup)- }- if m.clearedparent {- edges = append(edges, location.EdgeParent)- }- if m.clearedchildren {- edges = append(edges, location.EdgeChildren)- }- if m.cleareditems {- edges = append(edges, location.EdgeItems)+func (m *MaintenanceEntryMutation) ClearedEdges() []string {+ edges := make([]string, 0, 1)+ if m.cleareditem {+ edges = append(edges, maintenanceentry.EdgeItem)}return edges}// EdgeCleared returns a boolean which indicates if the edge with the given name// was cleared in this mutation.-func (m *LocationMutation) EdgeCleared(name string) bool {+func (m *MaintenanceEntryMutation) EdgeCleared(name string) bool {switch name {- case location.EdgeGroup:- return m.clearedgroup- case location.EdgeParent:- return m.clearedparent- case location.EdgeChildren:- return m.clearedchildren- case location.EdgeItems:- return m.cleareditems+ case maintenanceentry.EdgeItem:+ return m.cleareditem}return false}// ClearEdge clears the value of the edge with the given name. It returns an error// if that edge is not defined in the schema.-func (m *LocationMutation) ClearEdge(name string) error {+func (m *MaintenanceEntryMutation) ClearEdge(name string) error {switch name {- case location.EdgeGroup:- m.ClearGroup()- return nil- case location.EdgeParent:- m.ClearParent()+ case maintenanceentry.EdgeItem:+ m.ClearItem()return nil}- return fmt.Errorf("unknown Location unique edge %s", name)+ return fmt.Errorf("unknown MaintenanceEntry unique edge %s", name)}// ResetEdge resets all changes to the edge with the given name in this mutation.// It returns an error if the edge is not defined in the schema.-func (m *LocationMutation) ResetEdge(name string) error {+func (m *MaintenanceEntryMutation) ResetEdge(name string) error {switch name {- case location.EdgeGroup:- m.ResetGroup()- return nil- case location.EdgeParent:- m.ResetParent()- return nil- case location.EdgeChildren:- m.ResetChildren()- return nil- case location.EdgeItems:- m.ResetItems()+ case maintenanceentry.EdgeItem:+ m.ResetItem()return nil}- return fmt.Errorf("unknown Location edge %s", name)+ return fmt.Errorf("unknown MaintenanceEntry edge %s", name)}-// MaintenanceEntryMutation represents an operation that mutates the MaintenanceEntry nodes in the graph.-type MaintenanceEntryMutation struct {+// NotifierMutation represents an operation that mutates the Notifier nodes in the graph.+type NotifierMutation struct {config- op Op- typ string- id *uuid.UUID- created_at *time.Time- updated_at *time.Time- date *time.Time- scheduled_date *time.Time- name *string- description *string- cost *float64- addcost *float64- clearedFields map[string]struct{}- item *uuid.UUID- cleareditem bool- done bool- oldValue func(context.Context) (*MaintenanceEntry, error)- predicates []predicate.MaintenanceEntry+ op Op+ typ string+ id *uuid.UUID+ created_at *time.Time+ updated_at *time.Time+ name *string+ url *string+ is_active *bool+ clearedFields map[string]struct{}+ group *uuid.UUID+ clearedgroup bool+ user *uuid.UUID+ cleareduser bool+ done bool+ oldValue func(context.Context) (*Notifier, error)+ predicates []predicate.Notifier}-var _ ent.Mutation = (*MaintenanceEntryMutation)(nil)+var _ ent.Mutation = (*NotifierMutation)(nil)-// maintenanceentryOption allows management of the mutation configuration using functional options.-type maintenanceentryOption func(*MaintenanceEntryMutation)+// notifierOption allows management of the mutation configuration using functional options.+type notifierOption func(*NotifierMutation)-// newMaintenanceEntryMutation creates new mutation for the MaintenanceEntry entity.-func newMaintenanceEntryMutation(c config, op Op, opts ...maintenanceentryOption) *MaintenanceEntryMutation {- m := &MaintenanceEntryMutation{+// newNotifierMutation creates new mutation for the Notifier entity.+func newNotifierMutation(c config, op Op, opts ...notifierOption) *NotifierMutation {+ m := &NotifierMutation{config: c,op: op,- typ: TypeMaintenanceEntry,+ typ: TypeNotifier,clearedFields: make(map[string]struct{}),}for _, opt := range opts {@@ -10281,20 +10399,20 @@ func newMaintenanceEntryMutation(c config, op Op, opts ...maintenanceentryOptionreturn m}-// withMaintenanceEntryID sets the ID field of the mutation.-func withMaintenanceEntryID(id uuid.UUID) maintenanceentryOption {- return func(m *MaintenanceEntryMutation) {+// withNotifierID sets the ID field of the mutation.+func withNotifierID(id uuid.UUID) notifierOption {+ return func(m *NotifierMutation) {var (err erroronce sync.Once- value *MaintenanceEntry+ value *Notifier)- m.oldValue = func(ctx context.Context) (*MaintenanceEntry, error) {+ m.oldValue = func(ctx context.Context) (*Notifier, error) {once.Do(func() {if m.done {err = errors.New("querying old values post mutation is not allowed")} else {- value, err = m.Client().MaintenanceEntry.Get(ctx, id)+ value, err = m.Client().Notifier.Get(ctx, id)}})return value, err@@ -10303,10 +10421,10 @@ func withMaintenanceEntryID(id uuid.UUID) maintenanceentryOption {}}-// withMaintenanceEntry sets the old MaintenanceEntry of the mutation.-func withMaintenanceEntry(node *MaintenanceEntry) maintenanceentryOption {- return func(m *MaintenanceEntryMutation) {- m.oldValue = func(context.Context) (*MaintenanceEntry, error) {+// withNotifier sets the old Notifier of the mutation.+func withNotifier(node *Notifier) notifierOption {+ return func(m *NotifierMutation) {+ m.oldValue = func(context.Context) (*Notifier, error) {return node, nil}m.id = &node.ID@@ -10315,7 +10433,7 @@ func withMaintenanceEntry(node *MaintenanceEntry) maintenanceentryOption {// Client returns a new `ent.Client` from the mutation. If the mutation was// executed in a transaction (ent.Tx), a transactional client is returned.-func (m MaintenanceEntryMutation) Client() *Client {+func (m NotifierMutation) Client() *Client {client := &Client{config: m.config}client.init()return client@@ -10323,7 +10441,7 @@ func (m MaintenanceEntryMutation) Client() *Client {// Tx returns an `ent.Tx` for mutations that were executed in transactions;// it returns an error otherwise.-func (m MaintenanceEntryMutation) Tx() (*Tx, error) {+func (m NotifierMutation) Tx() (*Tx, error) {if _, ok := m.driver.(*txDriver); !ok {return nil, errors.New("ent: mutation is not running in a transaction")}@@ -10333,14 +10451,14 @@ func (m MaintenanceEntryMutation) Tx() (*Tx, error) {}// SetID sets the value of the id field. Note that this-// operation is only accepted on creation of MaintenanceEntry entities.-func (m *MaintenanceEntryMutation) SetID(id uuid.UUID) {+// operation is only accepted on creation of Notifier entities.+func (m *NotifierMutation) SetID(id uuid.UUID) {m.id = &id}// ID returns the ID value in the mutation. Note that the ID is only available// if it was provided to the builder or after it was returned from the database.-func (m *MaintenanceEntryMutation) ID() (id uuid.UUID, exists bool) {+func (m *NotifierMutation) ID() (id uuid.UUID, exists bool) {if m.id == nil {return}@@ -10351,7 +10469,7 @@ func (m *MaintenanceEntryMutation) ID() (id uuid.UUID, exists bool) {// That means, if the mutation is applied within a transaction with an isolation level such// as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated// or updated by the mutation.-func (m *MaintenanceEntryMutation) IDs(ctx context.Context) ([]uuid.UUID, error) {+func (m *NotifierMutation) IDs(ctx context.Context) ([]uuid.UUID, error) {switch {case m.op.Is(OpUpdateOne | OpDeleteOne):id, exists := m.ID()@@ -10360,19 +10478,19 @@ func (m *MaintenanceEntryMutation) IDs(ctx context.Context) ([]uuid.UUID, error)}fallthroughcase m.op.Is(OpUpdate | OpDelete):- return m.Client().MaintenanceEntry.Query().Where(m.predicates...).IDs(ctx)+ return m.Client().Notifier.Query().Where(m.predicates...).IDs(ctx)default:return nil, fmt.Errorf("IDs is not allowed on %s operations", m.op)}}// SetCreatedAt sets the "created_at" field.-func (m *MaintenanceEntryMutation) SetCreatedAt(t time.Time) {+func (m *NotifierMutation) SetCreatedAt(t time.Time) {m.created_at = &t}// CreatedAt returns the value of the "created_at" field in the mutation.-func (m *MaintenanceEntryMutation) CreatedAt() (r time.Time, exists bool) {+func (m *NotifierMutation) CreatedAt() (r time.Time, exists bool) {v := m.created_atif v == nil {return@@ -10380,10 +10498,10 @@ func (m *MaintenanceEntryMutation) CreatedAt() (r time.Time, exists bool) {return *v, true}-// OldCreatedAt returns the old "created_at" field's value of the MaintenanceEntry entity.-// If the MaintenanceEntry object wasn't provided to the builder, the object is fetched from the database.+// OldCreatedAt returns the old "created_at" field's value of the Notifier entity.+// If the Notifier object wasn't provided to the builder, the object is fetched from the database.// An error is returned if the mutation operation is not UpdateOne, or the database query fails.-func (m *MaintenanceEntryMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error) {+func (m *NotifierMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error) {if !m.op.Is(OpUpdateOne) {return v, errors.New("OldCreatedAt is only allowed on UpdateOne operations")}@@ -10398,17 +10516,17 @@ func (m *MaintenanceEntryMutation) OldCreatedAt(ctx context.Context) (v time.Tim}// ResetCreatedAt resets all changes to the "created_at" field.-func (m *MaintenanceEntryMutation) ResetCreatedAt() {+func (m *NotifierMutation) ResetCreatedAt() {m.created_at = nil}// SetUpdatedAt sets the "updated_at" field.-func (m *MaintenanceEntryMutation) SetUpdatedAt(t time.Time) {+func (m *NotifierMutation) SetUpdatedAt(t time.Time) {m.updated_at = &t}// UpdatedAt returns the value of the "updated_at" field in the mutation.-func (m *MaintenanceEntryMutation) UpdatedAt() (r time.Time, exists bool) {+func (m *NotifierMutation) UpdatedAt() (r time.Time, exists bool) {v := m.updated_atif v == nil {return@@ -10416,10 +10534,10 @@ func (m *MaintenanceEntryMutation) UpdatedAt() (r time.Time, exists bool) {return *v, true}-// OldUpdatedAt returns the old "updated_at" field's value of the MaintenanceEntry entity.-// If the MaintenanceEntry object wasn't provided to the builder, the object is fetched from the database.+// OldUpdatedAt returns the old "updated_at" field's value of the Notifier entity.+// If the Notifier object wasn't provided to the builder, the object is fetched from the database.// An error is returned if the mutation operation is not UpdateOne, or the database query fails.-func (m *MaintenanceEntryMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error) {+func (m *NotifierMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error) {if !m.op.Is(OpUpdateOne) {return v, errors.New("OldUpdatedAt is only allowed on UpdateOne operations")}@@ -10434,151 +10552,89 @@ func (m *MaintenanceEntryMutation) OldUpdatedAt(ctx context.Context) (v time.Tim}// ResetUpdatedAt resets all changes to the "updated_at" field.-func (m *MaintenanceEntryMutation) ResetUpdatedAt() {+func (m *NotifierMutation) ResetUpdatedAt() {m.updated_at = nil}-// SetItemID sets the "item_id" field.-func (m *MaintenanceEntryMutation) SetItemID(u uuid.UUID) {- m.item = &u-}--// ItemID returns the value of the "item_id" field in the mutation.-func (m *MaintenanceEntryMutation) ItemID() (r uuid.UUID, exists bool) {- v := m.item- if v == nil {- return- }- return *v, true-}--// OldItemID returns the old "item_id" field's value of the MaintenanceEntry entity.-// If the MaintenanceEntry object wasn't provided to the builder, the object is fetched from the database.-// An error is returned if the mutation operation is not UpdateOne, or the database query fails.-func (m *MaintenanceEntryMutation) OldItemID(ctx context.Context) (v uuid.UUID, err error) {- if !m.op.Is(OpUpdateOne) {- return v, errors.New("OldItemID is only allowed on UpdateOne operations")- }- if m.id == nil || m.oldValue == nil {- return v, errors.New("OldItemID requires an ID field in the mutation")- }- oldValue, err := m.oldValue(ctx)- if err != nil {- return v, fmt.Errorf("querying old value for OldItemID: %w", err)- }- return oldValue.ItemID, nil-}--// ResetItemID resets all changes to the "item_id" field.-func (m *MaintenanceEntryMutation) ResetItemID() {- m.item = nil-}--// SetDate sets the "date" field.-func (m *MaintenanceEntryMutation) SetDate(t time.Time) {- m.date = &t+// SetGroupID sets the "group_id" field.+func (m *NotifierMutation) SetGroupID(u uuid.UUID) {+ m.group = &u}-// Date returns the value of the "date" field in the mutation.-func (m *MaintenanceEntryMutation) Date() (r time.Time, exists bool) {- v := m.date+// GroupID returns the value of the "group_id" field in the mutation.+func (m *NotifierMutation) GroupID() (r uuid.UUID, exists bool) {+ v := m.groupif v == nil {return}return *v, true}-// OldDate returns the old "date" field's value of the MaintenanceEntry entity.-// If the MaintenanceEntry object wasn't provided to the builder, the object is fetched from the database.+// OldGroupID returns the old "group_id" field's value of the Notifier entity.+// If the Notifier object wasn't provided to the builder, the object is fetched from the database.// An error is returned if the mutation operation is not UpdateOne, or the database query fails.-func (m *MaintenanceEntryMutation) OldDate(ctx context.Context) (v time.Time, err error) {+func (m *NotifierMutation) OldGroupID(ctx context.Context) (v uuid.UUID, err error) {if !m.op.Is(OpUpdateOne) {- return v, errors.New("OldDate is only allowed on UpdateOne operations")+ return v, errors.New("OldGroupID is only allowed on UpdateOne operations")}if m.id == nil || m.oldValue == nil {- return v, errors.New("OldDate requires an ID field in the mutation")+ return v, errors.New("OldGroupID requires an ID field in the mutation")}oldValue, err := m.oldValue(ctx)if err != nil {- return v, fmt.Errorf("querying old value for OldDate: %w", err)+ return v, fmt.Errorf("querying old value for OldGroupID: %w", err)}- return oldValue.Date, nil-}--// ClearDate clears the value of the "date" field.-func (m *MaintenanceEntryMutation) ClearDate() {- m.date = nil- m.clearedFields[maintenanceentry.FieldDate] = struct{}{}-}--// DateCleared returns if the "date" field was cleared in this mutation.-func (m *MaintenanceEntryMutation) DateCleared() bool {- _, ok := m.clearedFields[maintenanceentry.FieldDate]- return ok+ return oldValue.GroupID, nil}-// ResetDate resets all changes to the "date" field.-func (m *MaintenanceEntryMutation) ResetDate() {- m.date = nil- delete(m.clearedFields, maintenanceentry.FieldDate)+// ResetGroupID resets all changes to the "group_id" field.+func (m *NotifierMutation) ResetGroupID() {+ m.group = nil}-// SetScheduledDate sets the "scheduled_date" field.-func (m *MaintenanceEntryMutation) SetScheduledDate(t time.Time) {- m.scheduled_date = &t+// SetUserID sets the "user_id" field.+func (m *NotifierMutation) SetUserID(u uuid.UUID) {+ m.user = &u}-// ScheduledDate returns the value of the "scheduled_date" field in the mutation.-func (m *MaintenanceEntryMutation) ScheduledDate() (r time.Time, exists bool) {- v := m.scheduled_date+// UserID returns the value of the "user_id" field in the mutation.+func (m *NotifierMutation) UserID() (r uuid.UUID, exists bool) {+ v := m.userif v == nil {return}return *v, true}-// OldScheduledDate returns the old "scheduled_date" field's value of the MaintenanceEntry entity.-// If the MaintenanceEntry object wasn't provided to the builder, the object is fetched from the database.+// OldUserID returns the old "user_id" field's value of the Notifier entity.+// If the Notifier object wasn't provided to the builder, the object is fetched from the database.// An error is returned if the mutation operation is not UpdateOne, or the database query fails.-func (m *MaintenanceEntryMutation) OldScheduledDate(ctx context.Context) (v time.Time, err error) {+func (m *NotifierMutation) OldUserID(ctx context.Context) (v uuid.UUID, err error) {if !m.op.Is(OpUpdateOne) {- return v, errors.New("OldScheduledDate is only allowed on UpdateOne operations")+ return v, errors.New("OldUserID is only allowed on UpdateOne operations")}if m.id == nil || m.oldValue == nil {- return v, errors.New("OldScheduledDate requires an ID field in the mutation")+ return v, errors.New("OldUserID requires an ID field in the mutation")}oldValue, err := m.oldValue(ctx)if err != nil {- return v, fmt.Errorf("querying old value for OldScheduledDate: %w", err)+ return v, fmt.Errorf("querying old value for OldUserID: %w", err)}- return oldValue.ScheduledDate, nil-}--// ClearScheduledDate clears the value of the "scheduled_date" field.-func (m *MaintenanceEntryMutation) ClearScheduledDate() {- m.scheduled_date = nil- m.clearedFields[maintenanceentry.FieldScheduledDate] = struct{}{}-}--// ScheduledDateCleared returns if the "scheduled_date" field was cleared in this mutation.-func (m *MaintenanceEntryMutation) ScheduledDateCleared() bool {- _, ok := m.clearedFields[maintenanceentry.FieldScheduledDate]- return ok+ return oldValue.UserID, nil}-// ResetScheduledDate resets all changes to the "scheduled_date" field.-func (m *MaintenanceEntryMutation) ResetScheduledDate() {- m.scheduled_date = nil- delete(m.clearedFields, maintenanceentry.FieldScheduledDate)+// ResetUserID resets all changes to the "user_id" field.+func (m *NotifierMutation) ResetUserID() {+ m.user = nil}// SetName sets the "name" field.-func (m *MaintenanceEntryMutation) SetName(s string) {+func (m *NotifierMutation) SetName(s string) {m.name = &s}// Name returns the value of the "name" field in the mutation.-func (m *MaintenanceEntryMutation) Name() (r string, exists bool) {+func (m *NotifierMutation) Name() (r string, exists bool) {v := m.nameif v == nil {return@@ -10586,10 +10642,10 @@ func (m *MaintenanceEntryMutation) Name() (r string, exists bool) {return *v, true}-// OldName returns the old "name" field's value of the MaintenanceEntry entity.-// If the MaintenanceEntry object wasn't provided to the builder, the object is fetched from the database.+// OldName returns the old "name" field's value of the Notifier entity.+// If the Notifier object wasn't provided to the builder, the object is fetched from the database.// An error is returned if the mutation operation is not UpdateOne, or the database query fails.-func (m *MaintenanceEntryMutation) OldName(ctx context.Context) (v string, err error) {+func (m *NotifierMutation) OldName(ctx context.Context) (v string, err error) {if !m.op.Is(OpUpdateOne) {return v, errors.New("OldName is only allowed on UpdateOne operations")}@@ -10604,151 +10660,145 @@ func (m *MaintenanceEntryMutation) OldName(ctx context.Context) (v string, err e}// ResetName resets all changes to the "name" field.-func (m *MaintenanceEntryMutation) ResetName() {+func (m *NotifierMutation) ResetName() {m.name = nil}-// SetDescription sets the "description" field.-func (m *MaintenanceEntryMutation) SetDescription(s string) {- m.description = &s+// SetURL sets the "url" field.+func (m *NotifierMutation) SetURL(s string) {+ m.url = &s}-// Description returns the value of the "description" field in the mutation.-func (m *MaintenanceEntryMutation) Description() (r string, exists bool) {- v := m.description+// URL returns the value of the "url" field in the mutation.+func (m *NotifierMutation) URL() (r string, exists bool) {+ v := m.urlif v == nil {return}return *v, true}-// OldDescription returns the old "description" field's value of the MaintenanceEntry entity.-// If the MaintenanceEntry object wasn't provided to the builder, the object is fetched from the database.+// OldURL returns the old "url" field's value of the Notifier entity.+// If the Notifier object wasn't provided to the builder, the object is fetched from the database.// An error is returned if the mutation operation is not UpdateOne, or the database query fails.-func (m *MaintenanceEntryMutation) OldDescription(ctx context.Context) (v string, err error) {+func (m *NotifierMutation) OldURL(ctx context.Context) (v string, err error) {if !m.op.Is(OpUpdateOne) {- return v, errors.New("OldDescription is only allowed on UpdateOne operations")+ return v, errors.New("OldURL is only allowed on UpdateOne operations")}if m.id == nil || m.oldValue == nil {- return v, errors.New("OldDescription requires an ID field in the mutation")+ return v, errors.New("OldURL requires an ID field in the mutation")}oldValue, err := m.oldValue(ctx)if err != nil {- return v, fmt.Errorf("querying old value for OldDescription: %w", err)+ return v, fmt.Errorf("querying old value for OldURL: %w", err)}- return oldValue.Description, nil-}--// ClearDescription clears the value of the "description" field.-func (m *MaintenanceEntryMutation) ClearDescription() {- m.description = nil- m.clearedFields[maintenanceentry.FieldDescription] = struct{}{}-}--// DescriptionCleared returns if the "description" field was cleared in this mutation.-func (m *MaintenanceEntryMutation) DescriptionCleared() bool {- _, ok := m.clearedFields[maintenanceentry.FieldDescription]- return ok+ return oldValue.URL, nil}-// ResetDescription resets all changes to the "description" field.-func (m *MaintenanceEntryMutation) ResetDescription() {- m.description = nil- delete(m.clearedFields, maintenanceentry.FieldDescription)+// ResetURL resets all changes to the "url" field.+func (m *NotifierMutation) ResetURL() {+ m.url = nil}-// SetCost sets the "cost" field.-func (m *MaintenanceEntryMutation) SetCost(f float64) {- m.cost = &f- m.addcost = nil+// SetIsActive sets the "is_active" field.+func (m *NotifierMutation) SetIsActive(b bool) {+ m.is_active = &b}-// Cost returns the value of the "cost" field in the mutation.-func (m *MaintenanceEntryMutation) Cost() (r float64, exists bool) {- v := m.cost+// IsActive returns the value of the "is_active" field in the mutation.+func (m *NotifierMutation) IsActive() (r bool, exists bool) {+ v := m.is_activeif v == nil {return}return *v, true}-// OldCost returns the old "cost" field's value of the MaintenanceEntry entity.-// If the MaintenanceEntry object wasn't provided to the builder, the object is fetched from the database.+// OldIsActive returns the old "is_active" field's value of the Notifier entity.+// If the Notifier object wasn't provided to the builder, the object is fetched from the database.// An error is returned if the mutation operation is not UpdateOne, or the database query fails.-func (m *MaintenanceEntryMutation) OldCost(ctx context.Context) (v float64, err error) {+func (m *NotifierMutation) OldIsActive(ctx context.Context) (v bool, err error) {if !m.op.Is(OpUpdateOne) {- return v, errors.New("OldCost is only allowed on UpdateOne operations")+ return v, errors.New("OldIsActive is only allowed on UpdateOne operations")}if m.id == nil || m.oldValue == nil {- return v, errors.New("OldCost requires an ID field in the mutation")+ return v, errors.New("OldIsActive requires an ID field in the mutation")}oldValue, err := m.oldValue(ctx)if err != nil {- return v, fmt.Errorf("querying old value for OldCost: %w", err)+ return v, fmt.Errorf("querying old value for OldIsActive: %w", err)}- return oldValue.Cost, nil+ return oldValue.IsActive, nil}-// AddCost adds f to the "cost" field.-func (m *MaintenanceEntryMutation) AddCost(f float64) {- if m.addcost != nil {- *m.addcost += f- } else {- m.addcost = &f- }+// ResetIsActive resets all changes to the "is_active" field.+func (m *NotifierMutation) ResetIsActive() {+ m.is_active = nil}-// AddedCost returns the value that was added to the "cost" field in this mutation.-func (m *MaintenanceEntryMutation) AddedCost() (r float64, exists bool) {- v := m.addcost- if v == nil {- return+// ClearGroup clears the "group" edge to the Group entity.+func (m *NotifierMutation) ClearGroup() {+ m.clearedgroup = true+ m.clearedFields[notifier.FieldGroupID] = struct{}{}+}++// GroupCleared reports if the "group" edge to the Group entity was cleared.+func (m *NotifierMutation) GroupCleared() bool {+ return m.clearedgroup+}++// GroupIDs returns the "group" edge IDs in the mutation.+// Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use+// GroupID instead. It exists only for internal usage by the builders.+func (m *NotifierMutation) GroupIDs() (ids []uuid.UUID) {+ if id := m.group; id != nil {+ ids = append(ids, *id)}- return *v, true+ return}-// ResetCost resets all changes to the "cost" field.-func (m *MaintenanceEntryMutation) ResetCost() {- m.cost = nil- m.addcost = nil+// ResetGroup resets all changes to the "group" edge.+func (m *NotifierMutation) ResetGroup() {+ m.group = nil+ m.clearedgroup = false}-// ClearItem clears the "item" edge to the Item entity.-func (m *MaintenanceEntryMutation) ClearItem() {- m.cleareditem = true- m.clearedFields[maintenanceentry.FieldItemID] = struct{}{}+// ClearUser clears the "user" edge to the User entity.+func (m *NotifierMutation) ClearUser() {+ m.cleareduser = true+ m.clearedFields[notifier.FieldUserID] = struct{}{}}-// ItemCleared reports if the "item" edge to the Item entity was cleared.-func (m *MaintenanceEntryMutation) ItemCleared() bool {- return m.cleareditem+// UserCleared reports if the "user" edge to the User entity was cleared.+func (m *NotifierMutation) UserCleared() bool {+ return m.cleareduser}-// ItemIDs returns the "item" edge IDs in the mutation.+// UserIDs returns the "user" edge IDs in the mutation.// Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use-// ItemID instead. It exists only for internal usage by the builders.-func (m *MaintenanceEntryMutation) ItemIDs() (ids []uuid.UUID) {- if id := m.item; id != nil {+// UserID instead. It exists only for internal usage by the builders.+func (m *NotifierMutation) UserIDs() (ids []uuid.UUID) {+ if id := m.user; id != nil {ids = append(ids, *id)}return}-// ResetItem resets all changes to the "item" edge.-func (m *MaintenanceEntryMutation) ResetItem() {- m.item = nil- m.cleareditem = false+// ResetUser resets all changes to the "user" edge.+func (m *NotifierMutation) ResetUser() {+ m.user = nil+ m.cleareduser = false}-// Where appends a list predicates to the MaintenanceEntryMutation builder.-func (m *MaintenanceEntryMutation) Where(ps ...predicate.MaintenanceEntry) {+// Where appends a list predicates to the NotifierMutation builder.+func (m *NotifierMutation) Where(ps ...predicate.Notifier) {m.predicates = append(m.predicates, ps...)}-// WhereP appends storage-level predicates to the MaintenanceEntryMutation builder. Using this method,+// WhereP appends storage-level predicates to the NotifierMutation builder. Using this method,// users can use type-assertion to append predicates that do not depend on any generated package.-func (m *MaintenanceEntryMutation) WhereP(ps ...func(*sql.Selector)) {- p := make([]predicate.MaintenanceEntry, len(ps))+func (m *NotifierMutation) WhereP(ps ...func(*sql.Selector)) {+ p := make([]predicate.Notifier, len(ps))for i := range ps {p[i] = ps[i]}@@ -10756,48 +10806,45 @@ func (m *MaintenanceEntryMutation) WhereP(ps ...func(*sql.Selector)) {}// Op returns the operation name.-func (m *MaintenanceEntryMutation) Op() Op {+func (m *NotifierMutation) Op() Op {return m.op}// SetOp allows setting the mutation operation.-func (m *MaintenanceEntryMutation) SetOp(op Op) {+func (m *NotifierMutation) SetOp(op Op) {m.op = op}-// Type returns the node type of this mutation (MaintenanceEntry).-func (m *MaintenanceEntryMutation) Type() string {+// Type returns the node type of this mutation (Notifier).+func (m *NotifierMutation) Type() string {return m.typ}// Fields returns all fields that were changed during this mutation. Note that in// order to get all numeric fields that were incremented/decremented, call// AddedFields().-func (m *MaintenanceEntryMutation) Fields() []string {- fields := make([]string, 0, 8)+func (m *NotifierMutation) Fields() []string {+ fields := make([]string, 0, 7)if m.created_at != nil {- fields = append(fields, maintenanceentry.FieldCreatedAt)+ fields = append(fields, notifier.FieldCreatedAt)}if m.updated_at != nil {- fields = append(fields, maintenanceentry.FieldUpdatedAt)- }- if m.item != nil {- fields = append(fields, maintenanceentry.FieldItemID)+ fields = append(fields, notifier.FieldUpdatedAt)}- if m.date != nil {- fields = append(fields, maintenanceentry.FieldDate)+ if m.group != nil {+ fields = append(fields, notifier.FieldGroupID)}- if m.scheduled_date != nil {- fields = append(fields, maintenanceentry.FieldScheduledDate)+ if m.user != nil {+ fields = append(fields, notifier.FieldUserID)}if m.name != nil {- fields = append(fields, maintenanceentry.FieldName)+ fields = append(fields, notifier.FieldName)}- if m.description != nil {- fields = append(fields, maintenanceentry.FieldDescription)+ if m.url != nil {+ fields = append(fields, notifier.FieldURL)}- if m.cost != nil {- fields = append(fields, maintenanceentry.FieldCost)+ if m.is_active != nil {+ fields = append(fields, notifier.FieldIsActive)}return fields}@@ -10805,24 +10852,22 @@ func (m *MaintenanceEntryMutation) Fields() []string {// Field returns the value of a field with the given name. The second boolean// return value indicates that this field was not set, or was not defined in the// schema.-func (m *MaintenanceEntryMutation) Field(name string) (ent.Value, bool) {+func (m *NotifierMutation) Field(name string) (ent.Value, bool) {switch name {- case maintenanceentry.FieldCreatedAt:+ case notifier.FieldCreatedAt:return m.CreatedAt()- case maintenanceentry.FieldUpdatedAt:+ case notifier.FieldUpdatedAt:return m.UpdatedAt()- case maintenanceentry.FieldItemID:- return m.ItemID()- case maintenanceentry.FieldDate:- return m.Date()- case maintenanceentry.FieldScheduledDate:- return m.ScheduledDate()- case maintenanceentry.FieldName:+ case notifier.FieldGroupID:+ return m.GroupID()+ case notifier.FieldUserID:+ return m.UserID()+ case notifier.FieldName:return m.Name()- case maintenanceentry.FieldDescription:- return m.Description()- case maintenanceentry.FieldCost:- return m.Cost()+ case notifier.FieldURL:+ return m.URL()+ case notifier.FieldIsActive:+ return m.IsActive()}return nil, false}@@ -10830,217 +10875,176 @@ func (m *MaintenanceEntryMutation) Field(name string) (ent.Value, bool) {// OldField returns the old value of the field from the database. An error is// returned if the mutation operation is not UpdateOne, or the query to the// database failed.-func (m *MaintenanceEntryMutation) OldField(ctx context.Context, name string) (ent.Value, error) {+func (m *NotifierMutation) OldField(ctx context.Context, name string) (ent.Value, error) {switch name {- case maintenanceentry.FieldCreatedAt:+ case notifier.FieldCreatedAt:return m.OldCreatedAt(ctx)- case maintenanceentry.FieldUpdatedAt:+ case notifier.FieldUpdatedAt:return m.OldUpdatedAt(ctx)- case maintenanceentry.FieldItemID:- return m.OldItemID(ctx)- case maintenanceentry.FieldDate:- return m.OldDate(ctx)- case maintenanceentry.FieldScheduledDate:- return m.OldScheduledDate(ctx)- case maintenanceentry.FieldName:+ case notifier.FieldGroupID:+ return m.OldGroupID(ctx)+ case notifier.FieldUserID:+ return m.OldUserID(ctx)+ case notifier.FieldName:return m.OldName(ctx)- case maintenanceentry.FieldDescription:- return m.OldDescription(ctx)- case maintenanceentry.FieldCost:- return m.OldCost(ctx)+ case notifier.FieldURL:+ return m.OldURL(ctx)+ case notifier.FieldIsActive:+ return m.OldIsActive(ctx)}- return nil, fmt.Errorf("unknown MaintenanceEntry field %s", name)+ return nil, fmt.Errorf("unknown Notifier field %s", name)}// SetField sets the value of a field with the given name. It returns an error if// the field is not defined in the schema, or if the type mismatched the field// type.-func (m *MaintenanceEntryMutation) SetField(name string, value ent.Value) error {+func (m *NotifierMutation) SetField(name string, value ent.Value) error {switch name {- case maintenanceentry.FieldCreatedAt:+ case notifier.FieldCreatedAt:v, ok := value.(time.Time)if !ok {return fmt.Errorf("unexpected type %T for field %s", value, name)}m.SetCreatedAt(v)return nil- case maintenanceentry.FieldUpdatedAt:+ case notifier.FieldUpdatedAt:v, ok := value.(time.Time)if !ok {return fmt.Errorf("unexpected type %T for field %s", value, name)}m.SetUpdatedAt(v)return nil- case maintenanceentry.FieldItemID:+ case notifier.FieldGroupID:v, ok := value.(uuid.UUID)if !ok {return fmt.Errorf("unexpected type %T for field %s", value, name)}- m.SetItemID(v)- return nil- case maintenanceentry.FieldDate:- v, ok := value.(time.Time)- if !ok {- return fmt.Errorf("unexpected type %T for field %s", value, name)- }- m.SetDate(v)+ m.SetGroupID(v)return nil- case maintenanceentry.FieldScheduledDate:- v, ok := value.(time.Time)+ case notifier.FieldUserID:+ v, ok := value.(uuid.UUID)if !ok {return fmt.Errorf("unexpected type %T for field %s", value, name)}- m.SetScheduledDate(v)+ m.SetUserID(v)return nil- case maintenanceentry.FieldName:+ case notifier.FieldName:v, ok := value.(string)if !ok {return fmt.Errorf("unexpected type %T for field %s", value, name)}m.SetName(v)return nil- case maintenanceentry.FieldDescription:+ case notifier.FieldURL:v, ok := value.(string)if !ok {return fmt.Errorf("unexpected type %T for field %s", value, name)}- m.SetDescription(v)+ m.SetURL(v)return nil- case maintenanceentry.FieldCost:- v, ok := value.(float64)+ case notifier.FieldIsActive:+ v, ok := value.(bool)if !ok {return fmt.Errorf("unexpected type %T for field %s", value, name)}- m.SetCost(v)+ m.SetIsActive(v)return nil}- return fmt.Errorf("unknown MaintenanceEntry field %s", name)+ return fmt.Errorf("unknown Notifier field %s", name)}// AddedFields returns all numeric fields that were incremented/decremented during// this mutation.-func (m *MaintenanceEntryMutation) AddedFields() []string {- var fields []string- if m.addcost != nil {- fields = append(fields, maintenanceentry.FieldCost)- }- return fields+func (m *NotifierMutation) AddedFields() []string {+ return nil}// AddedField returns the numeric value that was incremented/decremented on a field// with the given name. The second boolean return value indicates that this field// was not set, or was not defined in the schema.-func (m *MaintenanceEntryMutation) AddedField(name string) (ent.Value, bool) {- switch name {- case maintenanceentry.FieldCost:- return m.AddedCost()- }+func (m *NotifierMutation) AddedField(name string) (ent.Value, bool) {return nil, false}// AddField adds the value to the field with the given name. It returns an error if// the field is not defined in the schema, or if the type mismatched the field// type.-func (m *MaintenanceEntryMutation) AddField(name string, value ent.Value) error {+func (m *NotifierMutation) AddField(name string, value ent.Value) error {switch name {- case maintenanceentry.FieldCost:- v, ok := value.(float64)- if !ok {- return fmt.Errorf("unexpected type %T for field %s", value, name)- }- m.AddCost(v)- return nil}- return fmt.Errorf("unknown MaintenanceEntry numeric field %s", name)+ return fmt.Errorf("unknown Notifier numeric field %s", name)}// ClearedFields returns all nullable fields that were cleared during this// mutation.-func (m *MaintenanceEntryMutation) ClearedFields() []string {- var fields []string- if m.FieldCleared(maintenanceentry.FieldDate) {- fields = append(fields, maintenanceentry.FieldDate)- }- if m.FieldCleared(maintenanceentry.FieldScheduledDate) {- fields = append(fields, maintenanceentry.FieldScheduledDate)- }- if m.FieldCleared(maintenanceentry.FieldDescription) {- fields = append(fields, maintenanceentry.FieldDescription)- }- return fields+func (m *NotifierMutation) ClearedFields() []string {+ return nil}// FieldCleared returns a boolean indicating if a field with the given name was// cleared in this mutation.-func (m *MaintenanceEntryMutation) FieldCleared(name string) bool {+func (m *NotifierMutation) FieldCleared(name string) bool {_, ok := m.clearedFields[name]return ok}// ClearField clears the value of the field with the given name. It returns an// error if the field is not defined in the schema.-func (m *MaintenanceEntryMutation) ClearField(name string) error {- switch name {- case maintenanceentry.FieldDate:- m.ClearDate()- return nil- case maintenanceentry.FieldScheduledDate:- m.ClearScheduledDate()- return nil- case maintenanceentry.FieldDescription:- m.ClearDescription()- return nil- }- return fmt.Errorf("unknown MaintenanceEntry nullable field %s", name)+func (m *NotifierMutation) ClearField(name string) error {+ return fmt.Errorf("unknown Notifier nullable field %s", name)}// ResetField resets all changes in the mutation for the field with the given name.// It returns an error if the field is not defined in the schema.-func (m *MaintenanceEntryMutation) ResetField(name string) error {+func (m *NotifierMutation) ResetField(name string) error {switch name {- case maintenanceentry.FieldCreatedAt:+ case notifier.FieldCreatedAt:m.ResetCreatedAt()return nil- case maintenanceentry.FieldUpdatedAt:+ case notifier.FieldUpdatedAt:m.ResetUpdatedAt()return nil- case maintenanceentry.FieldItemID:- m.ResetItemID()- return nil- case maintenanceentry.FieldDate:- m.ResetDate()+ case notifier.FieldGroupID:+ m.ResetGroupID()return nil- case maintenanceentry.FieldScheduledDate:- m.ResetScheduledDate()+ case notifier.FieldUserID:+ m.ResetUserID()return nil- case maintenanceentry.FieldName:+ case notifier.FieldName:m.ResetName()return nil- case maintenanceentry.FieldDescription:- m.ResetDescription()+ case notifier.FieldURL:+ m.ResetURL()return nil- case maintenanceentry.FieldCost:- m.ResetCost()+ case notifier.FieldIsActive:+ m.ResetIsActive()return nil}- return fmt.Errorf("unknown MaintenanceEntry field %s", name)+ return fmt.Errorf("unknown Notifier field %s", name)}// AddedEdges returns all edge names that were set/added in this mutation.-func (m *MaintenanceEntryMutation) AddedEdges() []string {- edges := make([]string, 0, 1)- if m.item != nil {- edges = append(edges, maintenanceentry.EdgeItem)+func (m *NotifierMutation) AddedEdges() []string {+ edges := make([]string, 0, 2)+ if m.group != nil {+ edges = append(edges, notifier.EdgeGroup)+ }+ if m.user != nil {+ edges = append(edges, notifier.EdgeUser)}return edges}// AddedIDs returns all IDs (to other nodes) that were added for the given edge// name in this mutation.-func (m *MaintenanceEntryMutation) AddedIDs(name string) []ent.Value {+func (m *NotifierMutation) AddedIDs(name string) []ent.Value {switch name {- case maintenanceentry.EdgeItem:- if id := m.item; id != nil {+ case notifier.EdgeGroup:+ if id := m.group; id != nil {+ return []ent.Value{*id}+ }+ case notifier.EdgeUser:+ if id := m.user; id != nil {return []ent.Value{*id}}}@@ -11048,60 +11052,71 @@ func (m *MaintenanceEntryMutation) AddedIDs(name string) []ent.Value {}// RemovedEdges returns all edge names that were removed in this mutation.-func (m *MaintenanceEntryMutation) RemovedEdges() []string {- edges := make([]string, 0, 1)+func (m *NotifierMutation) RemovedEdges() []string {+ edges := make([]string, 0, 2)return edges}// RemovedIDs returns all IDs (to other nodes) that were removed for the edge with// the given name in this mutation.-func (m *MaintenanceEntryMutation) RemovedIDs(name string) []ent.Value {+func (m *NotifierMutation) RemovedIDs(name string) []ent.Value {return nil}// ClearedEdges returns all edge names that were cleared in this mutation.-func (m *MaintenanceEntryMutation) ClearedEdges() []string {- edges := make([]string, 0, 1)- if m.cleareditem {- edges = append(edges, maintenanceentry.EdgeItem)+func (m *NotifierMutation) ClearedEdges() []string {+ edges := make([]string, 0, 2)+ if m.clearedgroup {+ edges = append(edges, notifier.EdgeGroup)+ }+ if m.cleareduser {+ edges = append(edges, notifier.EdgeUser)}return edges}// EdgeCleared returns a boolean which indicates if the edge with the given name// was cleared in this mutation.-func (m *MaintenanceEntryMutation) EdgeCleared(name string) bool {+func (m *NotifierMutation) EdgeCleared(name string) bool {switch name {- case maintenanceentry.EdgeItem:- return m.cleareditem+ case notifier.EdgeGroup:+ return m.clearedgroup+ case notifier.EdgeUser:+ return m.cleareduser}return false}// ClearEdge clears the value of the edge with the given name. It returns an error// if that edge is not defined in the schema.-func (m *MaintenanceEntryMutation) ClearEdge(name string) error {+func (m *NotifierMutation) ClearEdge(name string) error {switch name {- case maintenanceentry.EdgeItem:- m.ClearItem()+ case notifier.EdgeGroup:+ m.ClearGroup()+ return nil+ case notifier.EdgeUser:+ m.ClearUser()return nil}- return fmt.Errorf("unknown MaintenanceEntry unique edge %s", name)+ return fmt.Errorf("unknown Notifier unique edge %s", name)}// ResetEdge resets all changes to the edge with the given name in this mutation.// It returns an error if the edge is not defined in the schema.-func (m *MaintenanceEntryMutation) ResetEdge(name string) error {+func (m *NotifierMutation) ResetEdge(name string) error {switch name {- case maintenanceentry.EdgeItem:- m.ResetItem()+ case notifier.EdgeGroup:+ m.ResetGroup()+ return nil+ case notifier.EdgeUser:+ m.ResetUser()return nil}- return fmt.Errorf("unknown MaintenanceEntry edge %s", name)+ return fmt.Errorf("unknown Notifier edge %s", name)}-// NotifierMutation represents an operation that mutates the Notifier nodes in the graph.-type NotifierMutation struct {+// TagMutation represents an operation that mutates the Tag nodes in the graph.+type TagMutation struct {configop Optyp string@@ -11109,29 +11124,30 @@ type NotifierMutation struct {created_at *time.Timeupdated_at *time.Timename *string- url *string- is_active *bool+ description *string+ color *stringclearedFields map[string]struct{}group *uuid.UUIDclearedgroup bool- user *uuid.UUID- cleareduser bool+ items map[uuid.UUID]struct{}+ removeditems map[uuid.UUID]struct{}+ cleareditems booldone bool- oldValue func(context.Context) (*Notifier, error)- predicates []predicate.Notifier+ oldValue func(context.Context) (*Tag, error)+ predicates []predicate.Tag}-var _ ent.Mutation = (*NotifierMutation)(nil)+var _ ent.Mutation = (*TagMutation)(nil)-// notifierOption allows management of the mutation configuration using functional options.-type notifierOption func(*NotifierMutation)+// tagOption allows management of the mutation configuration using functional options.+type tagOption func(*TagMutation)-// newNotifierMutation creates new mutation for the Notifier entity.-func newNotifierMutation(c config, op Op, opts ...notifierOption) *NotifierMutation {- m := &NotifierMutation{+// newTagMutation creates new mutation for the Tag entity.+func newTagMutation(c config, op Op, opts ...tagOption) *TagMutation {+ m := &TagMutation{config: c,op: op,- typ: TypeNotifier,+ typ: TypeTag,clearedFields: make(map[string]struct{}),}for _, opt := range opts {@@ -11140,20 +11156,20 @@ func newNotifierMutation(c config, op Op, opts ...notifierOption) *NotifierMutatreturn m}-// withNotifierID sets the ID field of the mutation.-func withNotifierID(id uuid.UUID) notifierOption {- return func(m *NotifierMutation) {+// withTagID sets the ID field of the mutation.+func withTagID(id uuid.UUID) tagOption {+ return func(m *TagMutation) {var (err erroronce sync.Once- value *Notifier+ value *Tag)- m.oldValue = func(ctx context.Context) (*Notifier, error) {+ m.oldValue = func(ctx context.Context) (*Tag, error) {once.Do(func() {if m.done {err = errors.New("querying old values post mutation is not allowed")} else {- value, err = m.Client().Notifier.Get(ctx, id)+ value, err = m.Client().Tag.Get(ctx, id)}})return value, err@@ -11162,10 +11178,10 @@ func withNotifierID(id uuid.UUID) notifierOption {}}-// withNotifier sets the old Notifier of the mutation.-func withNotifier(node *Notifier) notifierOption {- return func(m *NotifierMutation) {- m.oldValue = func(context.Context) (*Notifier, error) {+// withTag sets the old Tag of the mutation.+func withTag(node *Tag) tagOption {+ return func(m *TagMutation) {+ m.oldValue = func(context.Context) (*Tag, error) {return node, nil}m.id = &node.ID@@ -11174,7 +11190,7 @@ func withNotifier(node *Notifier) notifierOption {// Client returns a new `ent.Client` from the mutation. If the mutation was// executed in a transaction (ent.Tx), a transactional client is returned.-func (m NotifierMutation) Client() *Client {+func (m TagMutation) Client() *Client {client := &Client{config: m.config}client.init()return client@@ -11182,7 +11198,7 @@ func (m NotifierMutation) Client() *Client {// Tx returns an `ent.Tx` for mutations that were executed in transactions;// it returns an error otherwise.-func (m NotifierMutation) Tx() (*Tx, error) {+func (m TagMutation) Tx() (*Tx, error) {if _, ok := m.driver.(*txDriver); !ok {return nil, errors.New("ent: mutation is not running in a transaction")}@@ -11192,14 +11208,14 @@ func (m NotifierMutation) Tx() (*Tx, error) {}// SetID sets the value of the id field. Note that this-// operation is only accepted on creation of Notifier entities.-func (m *NotifierMutation) SetID(id uuid.UUID) {+// operation is only accepted on creation of Tag entities.+func (m *TagMutation) SetID(id uuid.UUID) {m.id = &id}// ID returns the ID value in the mutation. Note that the ID is only available// if it was provided to the builder or after it was returned from the database.-func (m *NotifierMutation) ID() (id uuid.UUID, exists bool) {+func (m *TagMutation) ID() (id uuid.UUID, exists bool) {if m.id == nil {return}@@ -11210,7 +11226,7 @@ func (m *NotifierMutation) ID() (id uuid.UUID, exists bool) {// That means, if the mutation is applied within a transaction with an isolation level such// as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated// or updated by the mutation.-func (m *NotifierMutation) IDs(ctx context.Context) ([]uuid.UUID, error) {+func (m *TagMutation) IDs(ctx context.Context) ([]uuid.UUID, error) {switch {case m.op.Is(OpUpdateOne | OpDeleteOne):id, exists := m.ID()@@ -11219,19 +11235,19 @@ func (m *NotifierMutation) IDs(ctx context.Context) ([]uuid.UUID, error) {}fallthroughcase m.op.Is(OpUpdate | OpDelete):- return m.Client().Notifier.Query().Where(m.predicates...).IDs(ctx)+ return m.Client().Tag.Query().Where(m.predicates...).IDs(ctx)default:return nil, fmt.Errorf("IDs is not allowed on %s operations", m.op)}}// SetCreatedAt sets the "created_at" field.-func (m *NotifierMutation) SetCreatedAt(t time.Time) {+func (m *TagMutation) SetCreatedAt(t time.Time) {m.created_at = &t}// CreatedAt returns the value of the "created_at" field in the mutation.-func (m *NotifierMutation) CreatedAt() (r time.Time, exists bool) {+func (m *TagMutation) CreatedAt() (r time.Time, exists bool) {v := m.created_atif v == nil {return@@ -11239,10 +11255,10 @@ func (m *NotifierMutation) CreatedAt() (r time.Time, exists bool) {return *v, true}-// OldCreatedAt returns the old "created_at" field's value of the Notifier entity.-// If the Notifier object wasn't provided to the builder, the object is fetched from the database.+// OldCreatedAt returns the old "created_at" field's value of the Tag entity.+// If the Tag object wasn't provided to the builder, the object is fetched from the database.// An error is returned if the mutation operation is not UpdateOne, or the database query fails.-func (m *NotifierMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error) {+func (m *TagMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error) {if !m.op.Is(OpUpdateOne) {return v, errors.New("OldCreatedAt is only allowed on UpdateOne operations")}@@ -11257,17 +11273,17 @@ func (m *NotifierMutation) OldCreatedAt(ctx context.Context) (v time.Time, err e}// ResetCreatedAt resets all changes to the "created_at" field.-func (m *NotifierMutation) ResetCreatedAt() {+func (m *TagMutation) ResetCreatedAt() {m.created_at = nil}// SetUpdatedAt sets the "updated_at" field.-func (m *NotifierMutation) SetUpdatedAt(t time.Time) {+func (m *TagMutation) SetUpdatedAt(t time.Time) {m.updated_at = &t}// UpdatedAt returns the value of the "updated_at" field in the mutation.-func (m *NotifierMutation) UpdatedAt() (r time.Time, exists bool) {+func (m *TagMutation) UpdatedAt() (r time.Time, exists bool) {v := m.updated_atif v == nil {return@@ -11275,10 +11291,10 @@ func (m *NotifierMutation) UpdatedAt() (r time.Time, exists bool) {return *v, true}-// OldUpdatedAt returns the old "updated_at" field's value of the Notifier entity.-// If the Notifier object wasn't provided to the builder, the object is fetched from the database.+// OldUpdatedAt returns the old "updated_at" field's value of the Tag entity.+// If the Tag object wasn't provided to the builder, the object is fetched from the database.// An error is returned if the mutation operation is not UpdateOne, or the database query fails.-func (m *NotifierMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error) {+func (m *TagMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error) {if !m.op.Is(OpUpdateOne) {return v, errors.New("OldUpdatedAt is only allowed on UpdateOne operations")}@@ -11293,89 +11309,17 @@ func (m *NotifierMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err e}// ResetUpdatedAt resets all changes to the "updated_at" field.-func (m *NotifierMutation) ResetUpdatedAt() {+func (m *TagMutation) ResetUpdatedAt() {m.updated_at = nil}-// SetGroupID sets the "group_id" field.-func (m *NotifierMutation) SetGroupID(u uuid.UUID) {- m.group = &u-}--// GroupID returns the value of the "group_id" field in the mutation.-func (m *NotifierMutation) GroupID() (r uuid.UUID, exists bool) {- v := m.group- if v == nil {- return- }- return *v, true-}--// OldGroupID returns the old "group_id" field's value of the Notifier entity.-// If the Notifier object wasn't provided to the builder, the object is fetched from the database.-// An error is returned if the mutation operation is not UpdateOne, or the database query fails.-func (m *NotifierMutation) OldGroupID(ctx context.Context) (v uuid.UUID, err error) {- if !m.op.Is(OpUpdateOne) {- return v, errors.New("OldGroupID is only allowed on UpdateOne operations")- }- if m.id == nil || m.oldValue == nil {- return v, errors.New("OldGroupID requires an ID field in the mutation")- }- oldValue, err := m.oldValue(ctx)- if err != nil {- return v, fmt.Errorf("querying old value for OldGroupID: %w", err)- }- return oldValue.GroupID, nil-}--// ResetGroupID resets all changes to the "group_id" field.-func (m *NotifierMutation) ResetGroupID() {- m.group = nil-}--// SetUserID sets the "user_id" field.-func (m *NotifierMutation) SetUserID(u uuid.UUID) {- m.user = &u-}--// UserID returns the value of the "user_id" field in the mutation.-func (m *NotifierMutation) UserID() (r uuid.UUID, exists bool) {- v := m.user- if v == nil {- return- }- return *v, true-}--// OldUserID returns the old "user_id" field's value of the Notifier entity.-// If the Notifier object wasn't provided to the builder, the object is fetched from the database.-// An error is returned if the mutation operation is not UpdateOne, or the database query fails.-func (m *NotifierMutation) OldUserID(ctx context.Context) (v uuid.UUID, err error) {- if !m.op.Is(OpUpdateOne) {- return v, errors.New("OldUserID is only allowed on UpdateOne operations")- }- if m.id == nil || m.oldValue == nil {- return v, errors.New("OldUserID requires an ID field in the mutation")- }- oldValue, err := m.oldValue(ctx)- if err != nil {- return v, fmt.Errorf("querying old value for OldUserID: %w", err)- }- return oldValue.UserID, nil-}--// ResetUserID resets all changes to the "user_id" field.-func (m *NotifierMutation) ResetUserID() {- m.user = nil-}-// SetName sets the "name" field.-func (m *NotifierMutation) SetName(s string) {+func (m *TagMutation) SetName(s string) {m.name = &s}// Name returns the value of the "name" field in the mutation.-func (m *NotifierMutation) Name() (r string, exists bool) {+func (m *TagMutation) Name() (r string, exists bool) {v := m.nameif v == nil {return@@ -11383,10 +11327,10 @@ func (m *NotifierMutation) Name() (r string, exists bool) {return *v, true}-// OldName returns the old "name" field's value of the Notifier entity.-// If the Notifier object wasn't provided to the builder, the object is fetched from the database.+// OldName returns the old "name" field's value of the Tag entity.+// If the Tag object wasn't provided to the builder, the object is fetched from the database.// An error is returned if the mutation operation is not UpdateOne, or the database query fails.-func (m *NotifierMutation) OldName(ctx context.Context) (v string, err error) {+func (m *TagMutation) OldName(ctx context.Context) (v string, err error) {if !m.op.Is(OpUpdateOne) {return v, errors.New("OldName is only allowed on UpdateOne operations")}@@ -11401,97 +11345,135 @@ func (m *NotifierMutation) OldName(ctx context.Context) (v string, err error) {}// ResetName resets all changes to the "name" field.-func (m *NotifierMutation) ResetName() {+func (m *TagMutation) ResetName() {m.name = nil}-// SetURL sets the "url" field.-func (m *NotifierMutation) SetURL(s string) {- m.url = &s+// SetDescription sets the "description" field.+func (m *TagMutation) SetDescription(s string) {+ m.description = &s}-// URL returns the value of the "url" field in the mutation.-func (m *NotifierMutation) URL() (r string, exists bool) {- v := m.url+// Description returns the value of the "description" field in the mutation.+func (m *TagMutation) Description() (r string, exists bool) {+ v := m.descriptionif v == nil {return}return *v, true}-// OldURL returns the old "url" field's value of the Notifier entity.-// If the Notifier object wasn't provided to the builder, the object is fetched from the database.+// OldDescription returns the old "description" field's value of the Tag entity.+// If the Tag object wasn't provided to the builder, the object is fetched from the database.// An error is returned if the mutation operation is not UpdateOne, or the database query fails.-func (m *NotifierMutation) OldURL(ctx context.Context) (v string, err error) {+func (m *TagMutation) OldDescription(ctx context.Context) (v string, err error) {if !m.op.Is(OpUpdateOne) {- return v, errors.New("OldURL is only allowed on UpdateOne operations")+ return v, errors.New("OldDescription is only allowed on UpdateOne operations")}if m.id == nil || m.oldValue == nil {- return v, errors.New("OldURL requires an ID field in the mutation")+ return v, errors.New("OldDescription requires an ID field in the mutation")}oldValue, err := m.oldValue(ctx)if err != nil {- return v, fmt.Errorf("querying old value for OldURL: %w", err)+ return v, fmt.Errorf("querying old value for OldDescription: %w", err)}- return oldValue.URL, nil+ return oldValue.Description, nil}-// ResetURL resets all changes to the "url" field.-func (m *NotifierMutation) ResetURL() {- m.url = nil+// ClearDescription clears the value of the "description" field.+func (m *TagMutation) ClearDescription() {+ m.description = nil+ m.clearedFields[tag.FieldDescription] = struct{}{}}-// SetIsActive sets the "is_active" field.-func (m *NotifierMutation) SetIsActive(b bool) {- m.is_active = &b+// DescriptionCleared returns if the "description" field was cleared in this mutation.+func (m *TagMutation) DescriptionCleared() bool {+ _, ok := m.clearedFields[tag.FieldDescription]+ return ok}-// IsActive returns the value of the "is_active" field in the mutation.-func (m *NotifierMutation) IsActive() (r bool, exists bool) {- v := m.is_active+// ResetDescription resets all changes to the "description" field.+func (m *TagMutation) ResetDescription() {+ m.description = nil+ delete(m.clearedFields, tag.FieldDescription)+}++// SetColor sets the "color" field.+func (m *TagMutation) SetColor(s string) {+ m.color = &s+}++// Color returns the value of the "color" field in the mutation.+func (m *TagMutation) Color() (r string, exists bool) {+ v := m.colorif v == nil {return}return *v, true}-// OldIsActive returns the old "is_active" field's value of the Notifier entity.-// If the Notifier object wasn't provided to the builder, the object is fetched from the database.+// OldColor returns the old "color" field's value of the Tag entity.+// If the Tag object wasn't provided to the builder, the object is fetched from the database.// An error is returned if the mutation operation is not UpdateOne, or the database query fails.-func (m *NotifierMutation) OldIsActive(ctx context.Context) (v bool, err error) {+func (m *TagMutation) OldColor(ctx context.Context) (v string, err error) {if !m.op.Is(OpUpdateOne) {- return v, errors.New("OldIsActive is only allowed on UpdateOne operations")+ return v, errors.New("OldColor is only allowed on UpdateOne operations")}if m.id == nil || m.oldValue == nil {- return v, errors.New("OldIsActive requires an ID field in the mutation")+ return v, errors.New("OldColor requires an ID field in the mutation")}oldValue, err := m.oldValue(ctx)if err != nil {- return v, fmt.Errorf("querying old value for OldIsActive: %w", err)+ return v, fmt.Errorf("querying old value for OldColor: %w", err)}- return oldValue.IsActive, nil+ return oldValue.Color, nil}-// ResetIsActive resets all changes to the "is_active" field.-func (m *NotifierMutation) ResetIsActive() {- m.is_active = nil+// ClearColor clears the value of the "color" field.+func (m *TagMutation) ClearColor() {+ m.color = nil+ m.clearedFields[tag.FieldColor] = struct{}{}+}++// ColorCleared returns if the "color" field was cleared in this mutation.+func (m *TagMutation) ColorCleared() bool {+ _, ok := m.clearedFields[tag.FieldColor]+ return ok+}++// ResetColor resets all changes to the "color" field.+func (m *TagMutation) ResetColor() {+ m.color = nil+ delete(m.clearedFields, tag.FieldColor)+}++// SetGroupID sets the "group" edge to the Group entity by id.+func (m *TagMutation) SetGroupID(id uuid.UUID) {+ m.group = &id}// ClearGroup clears the "group" edge to the Group entity.-func (m *NotifierMutation) ClearGroup() {+func (m *TagMutation) ClearGroup() {m.clearedgroup = true- m.clearedFields[notifier.FieldGroupID] = struct{}{}}// GroupCleared reports if the "group" edge to the Group entity was cleared.-func (m *NotifierMutation) GroupCleared() bool {+func (m *TagMutation) GroupCleared() bool {return m.clearedgroup}+// GroupID returns the "group" edge ID in the mutation.+func (m *TagMutation) GroupID() (id uuid.UUID, exists bool) {+ if m.group != nil {+ return *m.group, true+ }+ return+}+// GroupIDs returns the "group" edge IDs in the mutation.// Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use// GroupID instead. It exists only for internal usage by the builders.-func (m *NotifierMutation) GroupIDs() (ids []uuid.UUID) {+func (m *TagMutation) GroupIDs() (ids []uuid.UUID) {if id := m.group; id != nil {ids = append(ids, *id)}@@ -11499,47 +11481,74 @@ func (m *NotifierMutation) GroupIDs() (ids []uuid.UUID) {}// ResetGroup resets all changes to the "group" edge.-func (m *NotifierMutation) ResetGroup() {+func (m *TagMutation) ResetGroup() {m.group = nilm.clearedgroup = false}-// ClearUser clears the "user" edge to the User entity.-func (m *NotifierMutation) ClearUser() {- m.cleareduser = true- m.clearedFields[notifier.FieldUserID] = struct{}{}+// AddItemIDs adds the "items" edge to the Item entity by ids.+func (m *TagMutation) AddItemIDs(ids ...uuid.UUID) {+ if m.items == nil {+ m.items = make(map[uuid.UUID]struct{})+ }+ for i := range ids {+ m.items[ids[i]] = struct{}{}+ }}-// UserCleared reports if the "user" edge to the User entity was cleared.-func (m *NotifierMutation) UserCleared() bool {- return m.cleareduser+// ClearItems clears the "items" edge to the Item entity.+func (m *TagMutation) ClearItems() {+ m.cleareditems = true}-// UserIDs returns the "user" edge IDs in the mutation.-// Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use-// UserID instead. It exists only for internal usage by the builders.-func (m *NotifierMutation) UserIDs() (ids []uuid.UUID) {- if id := m.user; id != nil {- ids = append(ids, *id)+// ItemsCleared reports if the "items" edge to the Item entity was cleared.+func (m *TagMutation) ItemsCleared() bool {+ return m.cleareditems+}++// RemoveItemIDs removes the "items" edge to the Item entity by IDs.+func (m *TagMutation) RemoveItemIDs(ids ...uuid.UUID) {+ if m.removeditems == nil {+ m.removeditems = make(map[uuid.UUID]struct{})+ }+ for i := range ids {+ delete(m.items, ids[i])+ m.removeditems[ids[i]] = struct{}{}+ }+}++// RemovedItems returns the removed IDs of the "items" edge to the Item entity.+func (m *TagMutation) RemovedItemsIDs() (ids []uuid.UUID) {+ for id := range m.removeditems {+ ids = append(ids, id)}return}-// ResetUser resets all changes to the "user" edge.-func (m *NotifierMutation) ResetUser() {- m.user = nil- m.cleareduser = false+// ItemsIDs returns the "items" edge IDs in the mutation.+func (m *TagMutation) ItemsIDs() (ids []uuid.UUID) {+ for id := range m.items {+ ids = append(ids, id)+ }+ return}-// Where appends a list predicates to the NotifierMutation builder.-func (m *NotifierMutation) Where(ps ...predicate.Notifier) {+// ResetItems resets all changes to the "items" edge.+func (m *TagMutation) ResetItems() {+ m.items = nil+ m.cleareditems = false+ m.removeditems = nil+}++// Where appends a list predicates to the TagMutation builder.+func (m *TagMutation) Where(ps ...predicate.Tag) {m.predicates = append(m.predicates, ps...)}-// WhereP appends storage-level predicates to the NotifierMutation builder. Using this method,+// WhereP appends storage-level predicates to the TagMutation builder. Using this method,// users can use type-assertion to append predicates that do not depend on any generated package.-func (m *NotifierMutation) WhereP(ps ...func(*sql.Selector)) {- p := make([]predicate.Notifier, len(ps))+func (m *TagMutation) WhereP(ps ...func(*sql.Selector)) {+ p := make([]predicate.Tag, len(ps))for i := range ps {p[i] = ps[i]}@@ -11547,45 +11556,39 @@ func (m *NotifierMutation) WhereP(ps ...func(*sql.Selector)) {}// Op returns the operation name.-func (m *NotifierMutation) Op() Op {+func (m *TagMutation) Op() Op {return m.op}// SetOp allows setting the mutation operation.-func (m *NotifierMutation) SetOp(op Op) {+func (m *TagMutation) SetOp(op Op) {m.op = op}-// Type returns the node type of this mutation (Notifier).-func (m *NotifierMutation) Type() string {+// Type returns the node type of this mutation (Tag).+func (m *TagMutation) Type() string {return m.typ}// Fields returns all fields that were changed during this mutation. Note that in// order to get all numeric fields that were incremented/decremented, call// AddedFields().-func (m *NotifierMutation) Fields() []string {- fields := make([]string, 0, 7)+func (m *TagMutation) Fields() []string {+ fields := make([]string, 0, 5)if m.created_at != nil {- fields = append(fields, notifier.FieldCreatedAt)+ fields = append(fields, tag.FieldCreatedAt)}if m.updated_at != nil {- fields = append(fields, notifier.FieldUpdatedAt)- }- if m.group != nil {- fields = append(fields, notifier.FieldGroupID)- }- if m.user != nil {- fields = append(fields, notifier.FieldUserID)+ fields = append(fields, tag.FieldUpdatedAt)}if m.name != nil {- fields = append(fields, notifier.FieldName)+ fields = append(fields, tag.FieldName)}- if m.url != nil {- fields = append(fields, notifier.FieldURL)+ if m.description != nil {+ fields = append(fields, tag.FieldDescription)}- if m.is_active != nil {- fields = append(fields, notifier.FieldIsActive)+ if m.color != nil {+ fields = append(fields, tag.FieldColor)}return fields}@@ -11593,22 +11596,18 @@ func (m *NotifierMutation) Fields() []string {// Field returns the value of a field with the given name. The second boolean// return value indicates that this field was not set, or was not defined in the// schema.-func (m *NotifierMutation) Field(name string) (ent.Value, bool) {+func (m *TagMutation) Field(name string) (ent.Value, bool) {switch name {- case notifier.FieldCreatedAt:+ case tag.FieldCreatedAt:return m.CreatedAt()- case notifier.FieldUpdatedAt:+ case tag.FieldUpdatedAt:return m.UpdatedAt()- case notifier.FieldGroupID:- return m.GroupID()- case notifier.FieldUserID:- return m.UserID()- case notifier.FieldName:+ case tag.FieldName:return m.Name()- case notifier.FieldURL:- return m.URL()- case notifier.FieldIsActive:- return m.IsActive()+ case tag.FieldDescription:+ return m.Description()+ case tag.FieldColor:+ return m.Color()}return nil, false}@@ -11616,244 +11615,245 @@ func (m *NotifierMutation) Field(name string) (ent.Value, bool) {// OldField returns the old value of the field from the database. An error is// returned if the mutation operation is not UpdateOne, or the query to the// database failed.-func (m *NotifierMutation) OldField(ctx context.Context, name string) (ent.Value, error) {+func (m *TagMutation) OldField(ctx context.Context, name string) (ent.Value, error) {switch name {- case notifier.FieldCreatedAt:+ case tag.FieldCreatedAt:return m.OldCreatedAt(ctx)- case notifier.FieldUpdatedAt:+ case tag.FieldUpdatedAt:return m.OldUpdatedAt(ctx)- case notifier.FieldGroupID:- return m.OldGroupID(ctx)- case notifier.FieldUserID:- return m.OldUserID(ctx)- case notifier.FieldName:+ case tag.FieldName:return m.OldName(ctx)- case notifier.FieldURL:- return m.OldURL(ctx)- case notifier.FieldIsActive:- return m.OldIsActive(ctx)+ case tag.FieldDescription:+ return m.OldDescription(ctx)+ case tag.FieldColor:+ return m.OldColor(ctx)}- return nil, fmt.Errorf("unknown Notifier field %s", name)+ return nil, fmt.Errorf("unknown Tag field %s", name)}// SetField sets the value of a field with the given name. It returns an error if// the field is not defined in the schema, or if the type mismatched the field// type.-func (m *NotifierMutation) SetField(name string, value ent.Value) error {+func (m *TagMutation) SetField(name string, value ent.Value) error {switch name {- case notifier.FieldCreatedAt:+ case tag.FieldCreatedAt:v, ok := value.(time.Time)if !ok {return fmt.Errorf("unexpected type %T for field %s", value, name)}m.SetCreatedAt(v)return nil- case notifier.FieldUpdatedAt:+ case tag.FieldUpdatedAt:v, ok := value.(time.Time)if !ok {return fmt.Errorf("unexpected type %T for field %s", value, name)}m.SetUpdatedAt(v)return nil- case notifier.FieldGroupID:- v, ok := value.(uuid.UUID)- if !ok {- return fmt.Errorf("unexpected type %T for field %s", value, name)- }- m.SetGroupID(v)- return nil- case notifier.FieldUserID:- v, ok := value.(uuid.UUID)- if !ok {- return fmt.Errorf("unexpected type %T for field %s", value, name)- }- m.SetUserID(v)- return nil- case notifier.FieldName:+ case tag.FieldName:v, ok := value.(string)if !ok {return fmt.Errorf("unexpected type %T for field %s", value, name)}m.SetName(v)return nil- case notifier.FieldURL:+ case tag.FieldDescription:v, ok := value.(string)if !ok {return fmt.Errorf("unexpected type %T for field %s", value, name)}- m.SetURL(v)+ m.SetDescription(v)return nil- case notifier.FieldIsActive:- v, ok := value.(bool)+ case tag.FieldColor:+ v, ok := value.(string)if !ok {return fmt.Errorf("unexpected type %T for field %s", value, name)}- m.SetIsActive(v)+ m.SetColor(v)return nil}- return fmt.Errorf("unknown Notifier field %s", name)+ return fmt.Errorf("unknown Tag field %s", name)}// AddedFields returns all numeric fields that were incremented/decremented during// this mutation.-func (m *NotifierMutation) AddedFields() []string {+func (m *TagMutation) AddedFields() []string {return nil}// AddedField returns the numeric value that was incremented/decremented on a field// with the given name. The second boolean return value indicates that this field// was not set, or was not defined in the schema.-func (m *NotifierMutation) AddedField(name string) (ent.Value, bool) {+func (m *TagMutation) AddedField(name string) (ent.Value, bool) {return nil, false}// AddField adds the value to the field with the given name. It returns an error if// the field is not defined in the schema, or if the type mismatched the field// type.-func (m *NotifierMutation) AddField(name string, value ent.Value) error {+func (m *TagMutation) AddField(name string, value ent.Value) error {switch name {}- return fmt.Errorf("unknown Notifier numeric field %s", name)+ return fmt.Errorf("unknown Tag numeric field %s", name)}// ClearedFields returns all nullable fields that were cleared during this// mutation.-func (m *NotifierMutation) ClearedFields() []string {- return nil+func (m *TagMutation) ClearedFields() []string {+ var fields []string+ if m.FieldCleared(tag.FieldDescription) {+ fields = append(fields, tag.FieldDescription)+ }+ if m.FieldCleared(tag.FieldColor) {+ fields = append(fields, tag.FieldColor)+ }+ return fields}// FieldCleared returns a boolean indicating if a field with the given name was// cleared in this mutation.-func (m *NotifierMutation) FieldCleared(name string) bool {+func (m *TagMutation) FieldCleared(name string) bool {_, ok := m.clearedFields[name]return ok}// ClearField clears the value of the field with the given name. It returns an// error if the field is not defined in the schema.-func (m *NotifierMutation) ClearField(name string) error {- return fmt.Errorf("unknown Notifier nullable field %s", name)+func (m *TagMutation) ClearField(name string) error {+ switch name {+ case tag.FieldDescription:+ m.ClearDescription()+ return nil+ case tag.FieldColor:+ m.ClearColor()+ return nil+ }+ return fmt.Errorf("unknown Tag nullable field %s", name)}// ResetField resets all changes in the mutation for the field with the given name.// It returns an error if the field is not defined in the schema.-func (m *NotifierMutation) ResetField(name string) error {+func (m *TagMutation) ResetField(name string) error {switch name {- case notifier.FieldCreatedAt:+ case tag.FieldCreatedAt:m.ResetCreatedAt()return nil- case notifier.FieldUpdatedAt:+ case tag.FieldUpdatedAt:m.ResetUpdatedAt()return nil- case notifier.FieldGroupID:- m.ResetGroupID()- return nil- case notifier.FieldUserID:- m.ResetUserID()- return nil- case notifier.FieldName:+ case tag.FieldName:m.ResetName()return nil- case notifier.FieldURL:- m.ResetURL()+ case tag.FieldDescription:+ m.ResetDescription()return nil- case notifier.FieldIsActive:- m.ResetIsActive()+ case tag.FieldColor:+ m.ResetColor()return nil}- return fmt.Errorf("unknown Notifier field %s", name)+ return fmt.Errorf("unknown Tag field %s", name)}// AddedEdges returns all edge names that were set/added in this mutation.-func (m *NotifierMutation) AddedEdges() []string {+func (m *TagMutation) AddedEdges() []string {edges := make([]string, 0, 2)if m.group != nil {- edges = append(edges, notifier.EdgeGroup)+ edges = append(edges, tag.EdgeGroup)}- if m.user != nil {- edges = append(edges, notifier.EdgeUser)+ if m.items != nil {+ edges = append(edges, tag.EdgeItems)}return edges}// AddedIDs returns all IDs (to other nodes) that were added for the given edge// name in this mutation.-func (m *NotifierMutation) AddedIDs(name string) []ent.Value {+func (m *TagMutation) AddedIDs(name string) []ent.Value {switch name {- case notifier.EdgeGroup:+ case tag.EdgeGroup:if id := m.group; id != nil {return []ent.Value{*id}}- case notifier.EdgeUser:- if id := m.user; id != nil {- return []ent.Value{*id}+ case tag.EdgeItems:+ ids := make([]ent.Value, 0, len(m.items))+ for id := range m.items {+ ids = append(ids, id)}+ return ids}return nil}// RemovedEdges returns all edge names that were removed in this mutation.-func (m *NotifierMutation) RemovedEdges() []string {+func (m *TagMutation) RemovedEdges() []string {edges := make([]string, 0, 2)+ if m.removeditems != nil {+ edges = append(edges, tag.EdgeItems)+ }return edges}// RemovedIDs returns all IDs (to other nodes) that were removed for the edge with// the given name in this mutation.-func (m *NotifierMutation) RemovedIDs(name string) []ent.Value {+func (m *TagMutation) RemovedIDs(name string) []ent.Value {+ switch name {+ case tag.EdgeItems:+ ids := make([]ent.Value, 0, len(m.removeditems))+ for id := range m.removeditems {+ ids = append(ids, id)+ }+ return ids+ }return nil}// ClearedEdges returns all edge names that were cleared in this mutation.-func (m *NotifierMutation) ClearedEdges() []string {+func (m *TagMutation) ClearedEdges() []string {edges := make([]string, 0, 2)if m.clearedgroup {- edges = append(edges, notifier.EdgeGroup)+ edges = append(edges, tag.EdgeGroup)}- if m.cleareduser {- edges = append(edges, notifier.EdgeUser)+ if m.cleareditems {+ edges = append(edges, tag.EdgeItems)}return edges}// EdgeCleared returns a boolean which indicates if the edge with the given name// was cleared in this mutation.-func (m *NotifierMutation) EdgeCleared(name string) bool {+func (m *TagMutation) EdgeCleared(name string) bool {switch name {- case notifier.EdgeGroup:+ case tag.EdgeGroup:return m.clearedgroup- case notifier.EdgeUser:- return m.cleareduser+ case tag.EdgeItems:+ return m.cleareditems}return false}// ClearEdge clears the value of the edge with the given name. It returns an error// if that edge is not defined in the schema.-func (m *NotifierMutation) ClearEdge(name string) error {+func (m *TagMutation) ClearEdge(name string) error {switch name {- case notifier.EdgeGroup:+ case tag.EdgeGroup:m.ClearGroup()return nil- case notifier.EdgeUser:- m.ClearUser()- return nil}- return fmt.Errorf("unknown Notifier unique edge %s", name)+ return fmt.Errorf("unknown Tag unique edge %s", name)}// ResetEdge resets all changes to the edge with the given name in this mutation.// It returns an error if the edge is not defined in the schema.-func (m *NotifierMutation) ResetEdge(name string) error {+func (m *TagMutation) ResetEdge(name string) error {switch name {- case notifier.EdgeGroup:+ case tag.EdgeGroup:m.ResetGroup()return nil- case notifier.EdgeUser:- m.ResetUser()+ case tag.EdgeItems:+ m.ResetItems()return nil}- return fmt.Errorf("unknown Notifier edge %s", name)+ return fmt.Errorf("unknown Tag edge %s", name)}// TemplateFieldMutation represents an operation that mutates the TemplateField nodes in the graph.diff --git a/backend/internal/data/ent/predicate/predicate.go b/backend/internal/data/ent/predicate/predicate.goindex 0d9d47f5..7f2bfd04 100644--- a/backend/internal/data/ent/predicate/predicate.go+++ b/backend/internal/data/ent/predicate/predicate.go@@ -30,9 +30,6 @@ type ItemField func(*sql.Selector)// ItemTemplate is the predicate function for itemtemplate builders.type ItemTemplate func(*sql.Selector)-// Label is the predicate function for label builders.-type Label func(*sql.Selector)-// Location is the predicate function for location builders.type Location func(*sql.Selector)@@ -42,6 +39,9 @@ type MaintenanceEntry func(*sql.Selector)// Notifier is the predicate function for notifier builders.type Notifier func(*sql.Selector)+// Tag is the predicate function for tag builders.+type Tag func(*sql.Selector)+// TemplateField is the predicate function for templatefield builders.type TemplateField func(*sql.Selector)diff --git a/backend/internal/data/ent/runtime.go b/backend/internal/data/ent/runtime.goindex 0476c5c6..53f76972 100644--- a/backend/internal/data/ent/runtime.go+++ b/backend/internal/data/ent/runtime.go@@ -13,11 +13,11 @@ import ("github.com/sysadminsmedia/homebox/backend/internal/data/ent/item""github.com/sysadminsmedia/homebox/backend/internal/data/ent/itemfield""github.com/sysadminsmedia/homebox/backend/internal/data/ent/itemtemplate"- "github.com/sysadminsmedia/homebox/backend/internal/data/ent/label""github.com/sysadminsmedia/homebox/backend/internal/data/ent/location""github.com/sysadminsmedia/homebox/backend/internal/data/ent/maintenanceentry""github.com/sysadminsmedia/homebox/backend/internal/data/ent/notifier""github.com/sysadminsmedia/homebox/backend/internal/data/ent/schema"+ "github.com/sysadminsmedia/homebox/backend/internal/data/ent/tag""github.com/sysadminsmedia/homebox/backend/internal/data/ent/templatefield""github.com/sysadminsmedia/homebox/backend/internal/data/ent/user")@@ -403,53 +403,6 @@ func init() {itemtemplateDescID := itemtemplateMixinFields0[0].Descriptor()// itemtemplate.DefaultID holds the default value on creation for the id field.itemtemplate.DefaultID = itemtemplateDescID.Default.(func() uuid.UUID)- labelMixin := schema.Label{}.Mixin()- labelMixinFields0 := labelMixin[0].Fields()- _ = labelMixinFields0- labelMixinFields1 := labelMixin[1].Fields()- _ = labelMixinFields1- labelFields := schema.Label{}.Fields()- _ = labelFields- // labelDescCreatedAt is the schema descriptor for created_at field.- labelDescCreatedAt := labelMixinFields0[1].Descriptor()- // label.DefaultCreatedAt holds the default value on creation for the created_at field.- label.DefaultCreatedAt = labelDescCreatedAt.Default.(func() time.Time)- // labelDescUpdatedAt is the schema descriptor for updated_at field.- labelDescUpdatedAt := labelMixinFields0[2].Descriptor()- // label.DefaultUpdatedAt holds the default value on creation for the updated_at field.- label.DefaultUpdatedAt = labelDescUpdatedAt.Default.(func() time.Time)- // label.UpdateDefaultUpdatedAt holds the default value on update for the updated_at field.- label.UpdateDefaultUpdatedAt = labelDescUpdatedAt.UpdateDefault.(func() time.Time)- // labelDescName is the schema descriptor for name field.- labelDescName := labelMixinFields1[0].Descriptor()- // label.NameValidator is a validator for the "name" field. It is called by the builders before save.- label.NameValidator = func() func(string) error {- validators := labelDescName.Validators- fns := [...]func(string) error{- validators[0].(func(string) error),- validators[1].(func(string) error),- }- return func(name string) error {- for _, fn := range fns {- if err := fn(name); err != nil {- return err- }- }- return nil- }- }()- // labelDescDescription is the schema descriptor for description field.- labelDescDescription := labelMixinFields1[1].Descriptor()- // label.DescriptionValidator is a validator for the "description" field. It is called by the builders before save.- label.DescriptionValidator = labelDescDescription.Validators[0].(func(string) error)- // labelDescColor is the schema descriptor for color field.- labelDescColor := labelFields[0].Descriptor()- // label.ColorValidator is a validator for the "color" field. It is called by the builders before save.- label.ColorValidator = labelDescColor.Validators[0].(func(string) error)- // labelDescID is the schema descriptor for id field.- labelDescID := labelMixinFields0[0].Descriptor()- // label.DefaultID holds the default value on creation for the id field.- label.DefaultID = labelDescID.Default.(func() uuid.UUID)locationMixin := schema.Location{}.Mixin()locationMixinFields0 := locationMixin[0].Fields()_ = locationMixinFields0@@ -597,6 +550,53 @@ func init() {notifierDescID := notifierMixinFields0[0].Descriptor()// notifier.DefaultID holds the default value on creation for the id field.notifier.DefaultID = notifierDescID.Default.(func() uuid.UUID)+ tagMixin := schema.Tag{}.Mixin()+ tagMixinFields0 := tagMixin[0].Fields()+ _ = tagMixinFields0+ tagMixinFields1 := tagMixin[1].Fields()+ _ = tagMixinFields1+ tagFields := schema.Tag{}.Fields()+ _ = tagFields+ // tagDescCreatedAt is the schema descriptor for created_at field.+ tagDescCreatedAt := tagMixinFields0[1].Descriptor()+ // tag.DefaultCreatedAt holds the default value on creation for the created_at field.+ tag.DefaultCreatedAt = tagDescCreatedAt.Default.(func() time.Time)+ // tagDescUpdatedAt is the schema descriptor for updated_at field.+ tagDescUpdatedAt := tagMixinFields0[2].Descriptor()+ // tag.DefaultUpdatedAt holds the default value on creation for the updated_at field.+ tag.DefaultUpdatedAt = tagDescUpdatedAt.Default.(func() time.Time)+ // tag.UpdateDefaultUpdatedAt holds the default value on update for the updated_at field.+ tag.UpdateDefaultUpdatedAt = tagDescUpdatedAt.UpdateDefault.(func() time.Time)+ // tagDescName is the schema descriptor for name field.+ tagDescName := tagMixinFields1[0].Descriptor()+ // tag.NameValidator is a validator for the "name" field. It is called by the builders before save.+ tag.NameValidator = func() func(string) error {+ validators := tagDescName.Validators+ fns := [...]func(string) error{+ validators[0].(func(string) error),+ validators[1].(func(string) error),+ }+ return func(name string) error {+ for _, fn := range fns {+ if err := fn(name); err != nil {+ return err+ }+ }+ return nil+ }+ }()+ // tagDescDescription is the schema descriptor for description field.+ tagDescDescription := tagMixinFields1[1].Descriptor()+ // tag.DescriptionValidator is a validator for the "description" field. It is called by the builders before save.+ tag.DescriptionValidator = tagDescDescription.Validators[0].(func(string) error)+ // tagDescColor is the schema descriptor for color field.+ tagDescColor := tagFields[0].Descriptor()+ // tag.ColorValidator is a validator for the "color" field. It is called by the builders before save.+ tag.ColorValidator = tagDescColor.Validators[0].(func(string) error)+ // tagDescID is the schema descriptor for id field.+ tagDescID := tagMixinFields0[0].Descriptor()+ // tag.DefaultID holds the default value on creation for the id field.+ tag.DefaultID = tagDescID.Default.(func() uuid.UUID)templatefieldMixin := schema.TemplateField{}.Mixin()templatefieldMixinFields0 := templatefieldMixin[0].Fields()_ = templatefieldMixinFields0diff --git a/backend/internal/data/ent/schema/group.go b/backend/internal/data/ent/schema/group.goindex 292bee40..d51e4157 100644--- a/backend/internal/data/ent/schema/group.go+++ b/backend/internal/data/ent/schema/group.go@@ -46,7 +46,7 @@ func (Group) Edges() []ent.Edge {edge.From("users", User.Type).Ref("groups"),owned("locations", Location.Type),owned("items", Item.Type),- owned("labels", Label.Type),+ owned("tags", Tag.Type),owned("invitation_tokens", GroupInvitationToken.Type),owned("notifiers", Notifier.Type),owned("item_templates", ItemTemplate.Type),diff --git a/backend/internal/data/ent/schema/item.go b/backend/internal/data/ent/schema/item.goindex b689933e..a2f8f803 100644--- a/backend/internal/data/ent/schema/item.go+++ b/backend/internal/data/ent/schema/item.go@@ -112,7 +112,7 @@ func (Item) Edges() []ent.Edge {edge.To("children", Item.Type).From("parent").Unique(),- edge.From("label", Label.Type).+ edge.From("tag", Tag.Type).Ref("items"),edge.From("location", Location.Type).Ref("items").diff --git a/backend/internal/data/ent/schema/item_template.go b/backend/internal/data/ent/schema/item_template.goindex bb86170a..e609fb8f 100644--- a/backend/internal/data/ent/schema/item_template.go+++ b/backend/internal/data/ent/schema/item_template.go@@ -86,10 +86,10 @@ func (ItemTemplate) Fields() []ent.Field {Comment("Whether to include sold fields in items created from this template"),// ------------------------------------- // Default labels (stored as JSON array of UUIDs to allow reuse across templates)- field.JSON("default_label_ids", []uuid.UUID{}).+ // Default tags (stored as JSON array of UUIDs to allow reuse across templates)+ field.JSON("default_tag_ids", []uuid.UUID{}).Optional().- Comment("Default label IDs for items created from this template"),+ Comment("Default tag IDs for items created from this template"),}}diff --git a/backend/internal/data/ent/schema/label.go b/backend/internal/data/ent/schema/tag.gosimilarity index 60%rename from backend/internal/data/ent/schema/label.gorename to backend/internal/data/ent/schema/tag.goindex 2ec79164..5853aad0 100644--- a/backend/internal/data/ent/schema/label.go+++ b/backend/internal/data/ent/schema/tag.go@@ -7,21 +7,21 @@ import ("github.com/sysadminsmedia/homebox/backend/internal/data/ent/schema/mixins")-// Label holds the schema definition for the Label entity.-type Label struct {+// Tag holds the schema definition for the Tag entity.+type Tag struct {ent.Schema}-func (Label) Mixin() []ent.Mixin {+func (Tag) Mixin() []ent.Mixin {return []ent.Mixin{mixins.BaseMixin{},mixins.DetailsMixin{},- GroupMixin{ref: "labels"},+ GroupMixin{ref: "tags"},}}-// Fields of the Label.-func (Label) Fields() []ent.Field {+// Fields of the Tag.+func (Tag) Fields() []ent.Field {return []ent.Field{field.String("color").MaxLen(255).@@ -29,8 +29,8 @@ func (Label) Fields() []ent.Field {}}-// Edges of the Label.-func (Label) Edges() []ent.Edge {+// Edges of the Tag.+func (Tag) Edges() []ent.Edge {return []ent.Edge{edge.To("items", Item.Type),}diff --git a/backend/internal/data/ent/label.go b/backend/internal/data/ent/tag.gosimilarity index 69%rename from backend/internal/data/ent/label.gorename to backend/internal/data/ent/tag.goindex 8203bd5d..8be402d1 100644--- a/backend/internal/data/ent/label.go+++ b/backend/internal/data/ent/tag.go@@ -11,11 +11,11 @@ import ("entgo.io/ent/dialect/sql""github.com/google/uuid""github.com/sysadminsmedia/homebox/backend/internal/data/ent/group"- "github.com/sysadminsmedia/homebox/backend/internal/data/ent/label"+ "github.com/sysadminsmedia/homebox/backend/internal/data/ent/tag")-// Label is the model entity for the Label schema.-type Label struct {+// Tag is the model entity for the Tag schema.+type Tag struct {config `json:"-"`// ID of the ent.ID uuid.UUID `json:"id,omitempty"`@@ -30,14 +30,14 @@ type Label struct {// Color holds the value of the "color" field.Color string `json:"color,omitempty"`// Edges holds the relations/edges for other nodes in the graph.- // The values are being populated by the LabelQuery when eager-loading is set.- Edges LabelEdges `json:"edges"`- group_labels *uuid.UUID+ // The values are being populated by the TagQuery when eager-loading is set.+ Edges TagEdges `json:"edges"`+ group_tags *uuid.UUIDselectValues sql.SelectValues}-// LabelEdges holds the relations/edges for other nodes in the graph.-type LabelEdges struct {+// TagEdges holds the relations/edges for other nodes in the graph.+type TagEdges struct {// Group holds the value of the group edge.Group *Group `json:"group,omitempty"`// Items holds the value of the items edge.@@ -49,7 +49,7 @@ type LabelEdges struct {// GroupOrErr returns the Group value or an error if the edge// was not loaded in eager-loading, or loaded but was not found.-func (e LabelEdges) GroupOrErr() (*Group, error) {+func (e TagEdges) GroupOrErr() (*Group, error) {if e.Group != nil {return e.Group, nil} else if e.loadedTypes[0] {@@ -60,7 +60,7 @@ func (e LabelEdges) GroupOrErr() (*Group, error) {// ItemsOrErr returns the Items value or an error if the edge// was not loaded in eager-loading.-func (e LabelEdges) ItemsOrErr() ([]*Item, error) {+func (e TagEdges) ItemsOrErr() ([]*Item, error) {if e.loadedTypes[1] {return e.Items, nil}@@ -68,17 +68,17 @@ func (e LabelEdges) ItemsOrErr() ([]*Item, error) {}// scanValues returns the types for scanning values from sql.Rows.-func (*Label) scanValues(columns []string) ([]any, error) {+func (*Tag) scanValues(columns []string) ([]any, error) {values := make([]any, len(columns))for i := range columns {switch columns[i] {- case label.FieldName, label.FieldDescription, label.FieldColor:+ case tag.FieldName, tag.FieldDescription, tag.FieldColor:values[i] = new(sql.NullString)- case label.FieldCreatedAt, label.FieldUpdatedAt:+ case tag.FieldCreatedAt, tag.FieldUpdatedAt:values[i] = new(sql.NullTime)- case label.FieldID:+ case tag.FieldID:values[i] = new(uuid.UUID)- case label.ForeignKeys[0]: // group_labels+ case tag.ForeignKeys[0]: // group_tagsvalues[i] = &sql.NullScanner{S: new(uuid.UUID)}default:values[i] = new(sql.UnknownType)@@ -88,55 +88,55 @@ func (*Label) scanValues(columns []string) ([]any, error) {}// assignValues assigns the values that were returned from sql.Rows (after scanning)-// to the Label fields.-func (_m *Label) assignValues(columns []string, values []any) error {+// to the Tag fields.+func (_m *Tag) assignValues(columns []string, values []any) error {if m, n := len(values), len(columns); m < n {return fmt.Errorf("mismatch number of scan values: %d != %d", m, n)}for i := range columns {switch columns[i] {- case label.FieldID:+ case tag.FieldID:if value, ok := values[i].(*uuid.UUID); !ok {return fmt.Errorf("unexpected type %T for field id", values[i])} else if value != nil {_m.ID = *value}- case label.FieldCreatedAt:+ case tag.FieldCreatedAt:if value, ok := values[i].(*sql.NullTime); !ok {return fmt.Errorf("unexpected type %T for field created_at", values[i])} else if value.Valid {_m.CreatedAt = value.Time}- case label.FieldUpdatedAt:+ case tag.FieldUpdatedAt:if value, ok := values[i].(*sql.NullTime); !ok {return fmt.Errorf("unexpected type %T for field updated_at", values[i])} else if value.Valid {_m.UpdatedAt = value.Time}- case label.FieldName:+ case tag.FieldName:if value, ok := values[i].(*sql.NullString); !ok {return fmt.Errorf("unexpected type %T for field name", values[i])} else if value.Valid {_m.Name = value.String}- case label.FieldDescription:+ case tag.FieldDescription:if value, ok := values[i].(*sql.NullString); !ok {return fmt.Errorf("unexpected type %T for field description", values[i])} else if value.Valid {_m.Description = value.String}- case label.FieldColor:+ case tag.FieldColor:if value, ok := values[i].(*sql.NullString); !ok {return fmt.Errorf("unexpected type %T for field color", values[i])} else if value.Valid {_m.Color = value.String}- case label.ForeignKeys[0]:+ case tag.ForeignKeys[0]:if value, ok := values[i].(*sql.NullScanner); !ok {- return fmt.Errorf("unexpected type %T for field group_labels", values[i])+ return fmt.Errorf("unexpected type %T for field group_tags", values[i])} else if value.Valid {- _m.group_labels = new(uuid.UUID)- *_m.group_labels = *value.S.(*uuid.UUID)+ _m.group_tags = new(uuid.UUID)+ *_m.group_tags = *value.S.(*uuid.UUID)}default:_m.selectValues.Set(columns[i], values[i])@@ -145,44 +145,44 @@ func (_m *Label) assignValues(columns []string, values []any) error {return nil}-// Value returns the ent.Value that was dynamically selected and assigned to the Label.+// Value returns the ent.Value that was dynamically selected and assigned to the Tag.// This includes values selected through modifiers, order, etc.-func (_m *Label) Value(name string) (ent.Value, error) {+func (_m *Tag) Value(name string) (ent.Value, error) {return _m.selectValues.Get(name)}-// QueryGroup queries the "group" edge of the Label entity.-func (_m *Label) QueryGroup() *GroupQuery {- return NewLabelClient(_m.config).QueryGroup(_m)+// QueryGroup queries the "group" edge of the Tag entity.+func (_m *Tag) QueryGroup() *GroupQuery {+ return NewTagClient(_m.config).QueryGroup(_m)}-// QueryItems queries the "items" edge of the Label entity.-func (_m *Label) QueryItems() *ItemQuery {- return NewLabelClient(_m.config).QueryItems(_m)+// QueryItems queries the "items" edge of the Tag entity.+func (_m *Tag) QueryItems() *ItemQuery {+ return NewTagClient(_m.config).QueryItems(_m)}-// Update returns a builder for updating this Label.-// Note that you need to call Label.Unwrap() before calling this method if this Label+// Update returns a builder for updating this Tag.+// Note that you need to call Tag.Unwrap() before calling this method if this Tag// was returned from a transaction, and the transaction was committed or rolled back.-func (_m *Label) Update() *LabelUpdateOne {- return NewLabelClient(_m.config).UpdateOne(_m)+func (_m *Tag) Update() *TagUpdateOne {+ return NewTagClient(_m.config).UpdateOne(_m)}-// Unwrap unwraps the Label entity that was returned from a transaction after it was closed,+// Unwrap unwraps the Tag entity that was returned from a transaction after it was closed,// so that all future queries will be executed through the driver which created the transaction.-func (_m *Label) Unwrap() *Label {+func (_m *Tag) Unwrap() *Tag {_tx, ok := _m.config.driver.(*txDriver)if !ok {- panic("ent: Label is not a transactional entity")+ panic("ent: Tag is not a transactional entity")}_m.config.driver = _tx.drvreturn _m}// String implements the fmt.Stringer.-func (_m *Label) String() string {+func (_m *Tag) String() string {var builder strings.Builder- builder.WriteString("Label(")+ builder.WriteString("Tag(")builder.WriteString(fmt.Sprintf("id=%v, ", _m.ID))builder.WriteString("created_at=")builder.WriteString(_m.CreatedAt.Format(time.ANSIC))@@ -202,5 +202,5 @@ func (_m *Label) String() string {return builder.String()}-// Labels is a parsable slice of Label.-type Labels []*Label+// Tags is a parsable slice of Tag.+type Tags []*Tagdiff --git a/backend/internal/data/ent/label/label.go b/backend/internal/data/ent/tag/tag.gosimilarity index 92%rename from backend/internal/data/ent/label/label.gorename to backend/internal/data/ent/tag/tag.goindex df34c877..c6a2a2c6 100644--- a/backend/internal/data/ent/label/label.go+++ b/backend/internal/data/ent/tag/tag.go@@ -1,6 +1,6 @@// Code generated by ent, DO NOT EDIT.-package label+package tagimport ("time"@@ -11,8 +11,8 @@ import ()const (- // Label holds the string label denoting the label type in the database.- Label = "label"+ // Label holds the string label denoting the tag type in the database.+ Label = "tag"// FieldID holds the string denoting the id field in the database.FieldID = "id"// FieldCreatedAt holds the string denoting the created_at field in the database.@@ -29,23 +29,23 @@ const (EdgeGroup = "group"// EdgeItems holds the string denoting the items edge name in mutations.EdgeItems = "items"- // Table holds the table name of the label in the database.- Table = "labels"+ // Table holds the table name of the tag in the database.+ Table = "tags"// GroupTable is the table that holds the group relation/edge.- GroupTable = "labels"+ GroupTable = "tags"// GroupInverseTable is the table name for the Group entity.// It exists in this package in order to avoid circular dependency with the "group" package.GroupInverseTable = "groups"// GroupColumn is the table column denoting the group relation/edge.- GroupColumn = "group_labels"+ GroupColumn = "group_tags"// ItemsTable is the table that holds the items relation/edge. The primary key declared below.- ItemsTable = "label_items"+ ItemsTable = "tag_items"// ItemsInverseTable is the table name for the Item entity.// It exists in this package in order to avoid circular dependency with the "item" package.ItemsInverseTable = "items")-// Columns holds all SQL columns for label fields.+// Columns holds all SQL columns for tag fields.var Columns = []string{FieldID,FieldCreatedAt,@@ -55,16 +55,16 @@ var Columns = []string{FieldColor,}-// ForeignKeys holds the SQL foreign-keys that are owned by the "labels"+// ForeignKeys holds the SQL foreign-keys that are owned by the "tags"// table and are not defined as standalone fields in the schema.var ForeignKeys = []string{- "group_labels",+ "group_tags",}var (// ItemsPrimaryKey and ItemsColumn2 are the table columns denoting the// primary key for the items relation (M2M).- ItemsPrimaryKey = []string{"label_id", "item_id"}+ ItemsPrimaryKey = []string{"tag_id", "item_id"})// ValidColumn reports if the column name is valid (part of the table columns).@@ -99,7 +99,7 @@ var (DefaultID func() uuid.UUID)-// OrderOption defines the ordering options for the Label queries.+// OrderOption defines the ordering options for the Tag queries.type OrderOption func(*sql.Selector)// ByID orders the results by the id field.diff --git a/backend/internal/data/ent/tag/where.go b/backend/internal/data/ent/tag/where.gonew file mode 100644index 00000000..775a03a8--- /dev/null+++ b/backend/internal/data/ent/tag/where.go@@ -0,0 +1,438 @@+// Code generated by ent, DO NOT EDIT.++package tag++import (+ "time"++ "entgo.io/ent/dialect/sql"+ "entgo.io/ent/dialect/sql/sqlgraph"+ "github.com/google/uuid"+ "github.com/sysadminsmedia/homebox/backend/internal/data/ent/predicate"+)++// ID filters vertices based on their ID field.+func ID(id uuid.UUID) predicate.Tag {+ return predicate.Tag(sql.FieldEQ(FieldID, id))+}++// IDEQ applies the EQ predicate on the ID field.+func IDEQ(id uuid.UUID) predicate.Tag {+ return predicate.Tag(sql.FieldEQ(FieldID, id))+}++// IDNEQ applies the NEQ predicate on the ID field.+func IDNEQ(id uuid.UUID) predicate.Tag {+ return predicate.Tag(sql.FieldNEQ(FieldID, id))+}++// IDIn applies the In predicate on the ID field.+func IDIn(ids ...uuid.UUID) predicate.Tag {+ return predicate.Tag(sql.FieldIn(FieldID, ids...))+}++// IDNotIn applies the NotIn predicate on the ID field.+func IDNotIn(ids ...uuid.UUID) predicate.Tag {+ return predicate.Tag(sql.FieldNotIn(FieldID, ids...))+}++// IDGT applies the GT predicate on the ID field.+func IDGT(id uuid.UUID) predicate.Tag {+ return predicate.Tag(sql.FieldGT(FieldID, id))+}++// IDGTE applies the GTE predicate on the ID field.+func IDGTE(id uuid.UUID) predicate.Tag {+ return predicate.Tag(sql.FieldGTE(FieldID, id))+}++// IDLT applies the LT predicate on the ID field.+func IDLT(id uuid.UUID) predicate.Tag {+ return predicate.Tag(sql.FieldLT(FieldID, id))+}++// IDLTE applies the LTE predicate on the ID field.+func IDLTE(id uuid.UUID) predicate.Tag {+ return predicate.Tag(sql.FieldLTE(FieldID, id))+}++// CreatedAt applies equality check predicate on the "created_at" field. It's identical to CreatedAtEQ.+func CreatedAt(v time.Time) predicate.Tag {+ return predicate.Tag(sql.FieldEQ(FieldCreatedAt, v))+}++// UpdatedAt applies equality check predicate on the "updated_at" field. It's identical to UpdatedAtEQ.+func UpdatedAt(v time.Time) predicate.Tag {+ return predicate.Tag(sql.FieldEQ(FieldUpdatedAt, v))+}++// Name applies equality check predicate on the "name" field. It's identical to NameEQ.+func Name(v string) predicate.Tag {+ return predicate.Tag(sql.FieldEQ(FieldName, v))+}++// Description applies equality check predicate on the "description" field. It's identical to DescriptionEQ.+func Description(v string) predicate.Tag {+ return predicate.Tag(sql.FieldEQ(FieldDescription, v))+}++// Color applies equality check predicate on the "color" field. It's identical to ColorEQ.+func Color(v string) predicate.Tag {+ return predicate.Tag(sql.FieldEQ(FieldColor, v))+}++// CreatedAtEQ applies the EQ predicate on the "created_at" field.+func CreatedAtEQ(v time.Time) predicate.Tag {+ return predicate.Tag(sql.FieldEQ(FieldCreatedAt, v))+}++// CreatedAtNEQ applies the NEQ predicate on the "created_at" field.+func CreatedAtNEQ(v time.Time) predicate.Tag {+ return predicate.Tag(sql.FieldNEQ(FieldCreatedAt, v))+}++// CreatedAtIn applies the In predicate on the "created_at" field.+func CreatedAtIn(vs ...time.Time) predicate.Tag {+ return predicate.Tag(sql.FieldIn(FieldCreatedAt, vs...))+}++// CreatedAtNotIn applies the NotIn predicate on the "created_at" field.+func CreatedAtNotIn(vs ...time.Time) predicate.Tag {+ return predicate.Tag(sql.FieldNotIn(FieldCreatedAt, vs...))+}++// CreatedAtGT applies the GT predicate on the "created_at" field.+func CreatedAtGT(v time.Time) predicate.Tag {+ return predicate.Tag(sql.FieldGT(FieldCreatedAt, v))+}++// CreatedAtGTE applies the GTE predicate on the "created_at" field.+func CreatedAtGTE(v time.Time) predicate.Tag {+ return predicate.Tag(sql.FieldGTE(FieldCreatedAt, v))+}++// CreatedAtLT applies the LT predicate on the "created_at" field.+func CreatedAtLT(v time.Time) predicate.Tag {+ return predicate.Tag(sql.FieldLT(FieldCreatedAt, v))+}++// CreatedAtLTE applies the LTE predicate on the "created_at" field.+func CreatedAtLTE(v time.Time) predicate.Tag {+ return predicate.Tag(sql.FieldLTE(FieldCreatedAt, v))+}++// UpdatedAtEQ applies the EQ predicate on the "updated_at" field.+func UpdatedAtEQ(v time.Time) predicate.Tag {+ return predicate.Tag(sql.FieldEQ(FieldUpdatedAt, v))+}++// UpdatedAtNEQ applies the NEQ predicate on the "updated_at" field.+func UpdatedAtNEQ(v time.Time) predicate.Tag {+ return predicate.Tag(sql.FieldNEQ(FieldUpdatedAt, v))+}++// UpdatedAtIn applies the In predicate on the "updated_at" field.+func UpdatedAtIn(vs ...time.Time) predicate.Tag {+ return predicate.Tag(sql.FieldIn(FieldUpdatedAt, vs...))+}++// UpdatedAtNotIn applies the NotIn predicate on the "updated_at" field.+func UpdatedAtNotIn(vs ...time.Time) predicate.Tag {+ return predicate.Tag(sql.FieldNotIn(FieldUpdatedAt, vs...))+}++// UpdatedAtGT applies the GT predicate on the "updated_at" field.+func UpdatedAtGT(v time.Time) predicate.Tag {+ return predicate.Tag(sql.FieldGT(FieldUpdatedAt, v))+}++// UpdatedAtGTE applies the GTE predicate on the "updated_at" field.+func UpdatedAtGTE(v time.Time) predicate.Tag {+ return predicate.Tag(sql.FieldGTE(FieldUpdatedAt, v))+}++// UpdatedAtLT applies the LT predicate on the "updated_at" field.+func UpdatedAtLT(v time.Time) predicate.Tag {+ return predicate.Tag(sql.FieldLT(FieldUpdatedAt, v))+}++// UpdatedAtLTE applies the LTE predicate on the "updated_at" field.+func UpdatedAtLTE(v time.Time) predicate.Tag {+ return predicate.Tag(sql.FieldLTE(FieldUpdatedAt, v))+}++// NameEQ applies the EQ predicate on the "name" field.+func NameEQ(v string) predicate.Tag {+ return predicate.Tag(sql.FieldEQ(FieldName, v))+}++// NameNEQ applies the NEQ predicate on the "name" field.+func NameNEQ(v string) predicate.Tag {+ return predicate.Tag(sql.FieldNEQ(FieldName, v))+}++// NameIn applies the In predicate on the "name" field.+func NameIn(vs ...string) predicate.Tag {+ return predicate.Tag(sql.FieldIn(FieldName, vs...))+}++// NameNotIn applies the NotIn predicate on the "name" field.+func NameNotIn(vs ...string) predicate.Tag {+ return predicate.Tag(sql.FieldNotIn(FieldName, vs...))+}++// NameGT applies the GT predicate on the "name" field.+func NameGT(v string) predicate.Tag {+ return predicate.Tag(sql.FieldGT(FieldName, v))+}++// NameGTE applies the GTE predicate on the "name" field.+func NameGTE(v string) predicate.Tag {+ return predicate.Tag(sql.FieldGTE(FieldName, v))+}++// NameLT applies the LT predicate on the "name" field.+func NameLT(v string) predicate.Tag {+ return predicate.Tag(sql.FieldLT(FieldName, v))+}++// NameLTE applies the LTE predicate on the "name" field.+func NameLTE(v string) predicate.Tag {+ return predicate.Tag(sql.FieldLTE(FieldName, v))+}++// NameContains applies the Contains predicate on the "name" field.+func NameContains(v string) predicate.Tag {+ return predicate.Tag(sql.FieldContains(FieldName, v))+}++// NameHasPrefix applies the HasPrefix predicate on the "name" field.+func NameHasPrefix(v string) predicate.Tag {+ return predicate.Tag(sql.FieldHasPrefix(FieldName, v))+}++// NameHasSuffix applies the HasSuffix predicate on the "name" field.+func NameHasSuffix(v string) predicate.Tag {+ return predicate.Tag(sql.FieldHasSuffix(FieldName, v))+}++// NameEqualFold applies the EqualFold predicate on the "name" field.+func NameEqualFold(v string) predicate.Tag {+ return predicate.Tag(sql.FieldEqualFold(FieldName, v))+}++// NameContainsFold applies the ContainsFold predicate on the "name" field.+func NameContainsFold(v string) predicate.Tag {+ return predicate.Tag(sql.FieldContainsFold(FieldName, v))+}++// DescriptionEQ applies the EQ predicate on the "description" field.+func DescriptionEQ(v string) predicate.Tag {+ return predicate.Tag(sql.FieldEQ(FieldDescription, v))+}++// DescriptionNEQ applies the NEQ predicate on the "description" field.+func DescriptionNEQ(v string) predicate.Tag {+ return predicate.Tag(sql.FieldNEQ(FieldDescription, v))+}++// DescriptionIn applies the In predicate on the "description" field.+func DescriptionIn(vs ...string) predicate.Tag {+ return predicate.Tag(sql.FieldIn(FieldDescription, vs...))+}++// DescriptionNotIn applies the NotIn predicate on the "description" field.+func DescriptionNotIn(vs ...string) predicate.Tag {+ return predicate.Tag(sql.FieldNotIn(FieldDescription, vs...))+}++// DescriptionGT applies the GT predicate on the "description" field.+func DescriptionGT(v string) predicate.Tag {+ return predicate.Tag(sql.FieldGT(FieldDescription, v))+}++// DescriptionGTE applies the GTE predicate on the "description" field.+func DescriptionGTE(v string) predicate.Tag {+ return predicate.Tag(sql.FieldGTE(FieldDescription, v))+}++// DescriptionLT applies the LT predicate on the "description" field.+func DescriptionLT(v string) predicate.Tag {+ return predicate.Tag(sql.FieldLT(FieldDescription, v))+}++// DescriptionLTE applies the LTE predicate on the "description" field.+func DescriptionLTE(v string) predicate.Tag {+ return predicate.Tag(sql.FieldLTE(FieldDescription, v))+}++// DescriptionContains applies the Contains predicate on the "description" field.+func DescriptionContains(v string) predicate.Tag {+ return predicate.Tag(sql.FieldContains(FieldDescription, v))+}++// DescriptionHasPrefix applies the HasPrefix predicate on the "description" field.+func DescriptionHasPrefix(v string) predicate.Tag {+ return predicate.Tag(sql.FieldHasPrefix(FieldDescription, v))+}++// DescriptionHasSuffix applies the HasSuffix predicate on the "description" field.+func DescriptionHasSuffix(v string) predicate.Tag {+ return predicate.Tag(sql.FieldHasSuffix(FieldDescription, v))+}++// DescriptionIsNil applies the IsNil predicate on the "description" field.+func DescriptionIsNil() predicate.Tag {+ return predicate.Tag(sql.FieldIsNull(FieldDescription))+}++// DescriptionNotNil applies the NotNil predicate on the "description" field.+func DescriptionNotNil() predicate.Tag {+ return predicate.Tag(sql.FieldNotNull(FieldDescription))+}++// DescriptionEqualFold applies the EqualFold predicate on the "description" field.+func DescriptionEqualFold(v string) predicate.Tag {+ return predicate.Tag(sql.FieldEqualFold(FieldDescription, v))+}++// DescriptionContainsFold applies the ContainsFold predicate on the "description" field.+func DescriptionContainsFold(v string) predicate.Tag {+ return predicate.Tag(sql.FieldContainsFold(FieldDescription, v))+}++// ColorEQ applies the EQ predicate on the "color" field.+func ColorEQ(v string) predicate.Tag {+ return predicate.Tag(sql.FieldEQ(FieldColor, v))+}++// ColorNEQ applies the NEQ predicate on the "color" field.+func ColorNEQ(v string) predicate.Tag {+ return predicate.Tag(sql.FieldNEQ(FieldColor, v))+}++// ColorIn applies the In predicate on the "color" field.+func ColorIn(vs ...string) predicate.Tag {+ return predicate.Tag(sql.FieldIn(FieldColor, vs...))+}++// ColorNotIn applies the NotIn predicate on the "color" field.+func ColorNotIn(vs ...string) predicate.Tag {+ return predicate.Tag(sql.FieldNotIn(FieldColor, vs...))+}++// ColorGT applies the GT predicate on the "color" field.+func ColorGT(v string) predicate.Tag {+ return predicate.Tag(sql.FieldGT(FieldColor, v))+}++// ColorGTE applies the GTE predicate on the "color" field.+func ColorGTE(v string) predicate.Tag {+ return predicate.Tag(sql.FieldGTE(FieldColor, v))+}++// ColorLT applies the LT predicate on the "color" field.+func ColorLT(v string) predicate.Tag {+ return predicate.Tag(sql.FieldLT(FieldColor, v))+}++// ColorLTE applies the LTE predicate on the "color" field.+func ColorLTE(v string) predicate.Tag {+ return predicate.Tag(sql.FieldLTE(FieldColor, v))+}++// ColorContains applies the Contains predicate on the "color" field.+func ColorContains(v string) predicate.Tag {+ return predicate.Tag(sql.FieldContains(FieldColor, v))+}++// ColorHasPrefix applies the HasPrefix predicate on the "color" field.+func ColorHasPrefix(v string) predicate.Tag {+ return predicate.Tag(sql.FieldHasPrefix(FieldColor, v))+}++// ColorHasSuffix applies the HasSuffix predicate on the "color" field.+func ColorHasSuffix(v string) predicate.Tag {+ return predicate.Tag(sql.FieldHasSuffix(FieldColor, v))+}++// ColorIsNil applies the IsNil predicate on the "color" field.+func ColorIsNil() predicate.Tag {+ return predicate.Tag(sql.FieldIsNull(FieldColor))+}++// ColorNotNil applies the NotNil predicate on the "color" field.+func ColorNotNil() predicate.Tag {+ return predicate.Tag(sql.FieldNotNull(FieldColor))+}++// ColorEqualFold applies the EqualFold predicate on the "color" field.+func ColorEqualFold(v string) predicate.Tag {+ return predicate.Tag(sql.FieldEqualFold(FieldColor, v))+}++// ColorContainsFold applies the ContainsFold predicate on the "color" field.+func ColorContainsFold(v string) predicate.Tag {+ return predicate.Tag(sql.FieldContainsFold(FieldColor, v))+}++// HasGroup applies the HasEdge predicate on the "group" edge.+func HasGroup() predicate.Tag {+ return predicate.Tag(func(s *sql.Selector) {+ step := sqlgraph.NewStep(+ sqlgraph.From(Table, FieldID),+ sqlgraph.Edge(sqlgraph.M2O, true, GroupTable, GroupColumn),+ )+ sqlgraph.HasNeighbors(s, step)+ })+}++// HasGroupWith applies the HasEdge predicate on the "group" edge with a given conditions (other predicates).+func HasGroupWith(preds ...predicate.Group) predicate.Tag {+ return predicate.Tag(func(s *sql.Selector) {+ step := newGroupStep()+ sqlgraph.HasNeighborsWith(s, step, func(s *sql.Selector) {+ for _, p := range preds {+ p(s)+ }+ })+ })+}++// HasItems applies the HasEdge predicate on the "items" edge.+func HasItems() predicate.Tag {+ return predicate.Tag(func(s *sql.Selector) {+ step := sqlgraph.NewStep(+ sqlgraph.From(Table, FieldID),+ sqlgraph.Edge(sqlgraph.M2M, false, ItemsTable, ItemsPrimaryKey...),+ )+ sqlgraph.HasNeighbors(s, step)+ })+}++// HasItemsWith applies the HasEdge predicate on the "items" edge with a given conditions (other predicates).+func HasItemsWith(preds ...predicate.Item) predicate.Tag {+ return predicate.Tag(func(s *sql.Selector) {+ step := newItemsStep()+ sqlgraph.HasNeighborsWith(s, step, func(s *sql.Selector) {+ for _, p := range preds {+ p(s)+ }+ })+ })+}++// And groups predicates with the AND operator between them.+func And(predicates ...predicate.Tag) predicate.Tag {+ return predicate.Tag(sql.AndPredicates(predicates...))+}++// Or groups predicates with the OR operator between them.+func Or(predicates ...predicate.Tag) predicate.Tag {+ return predicate.Tag(sql.OrPredicates(predicates...))+}++// Not applies the not operator on the given predicate.+func Not(p predicate.Tag) predicate.Tag {+ return predicate.Tag(sql.NotPredicates(p))+}diff --git a/backend/internal/data/ent/label_create.go b/backend/internal/data/ent/tag_create.gosimilarity index 67%rename from backend/internal/data/ent/label_create.gorename to backend/internal/data/ent/tag_create.goindex a1cdf28c..bac61933 100644--- a/backend/internal/data/ent/label_create.go+++ b/backend/internal/data/ent/tag_create.go@@ -13,24 +13,24 @@ import ("github.com/google/uuid""github.com/sysadminsmedia/homebox/backend/internal/data/ent/group""github.com/sysadminsmedia/homebox/backend/internal/data/ent/item"- "github.com/sysadminsmedia/homebox/backend/internal/data/ent/label"+ "github.com/sysadminsmedia/homebox/backend/internal/data/ent/tag")-// LabelCreate is the builder for creating a Label entity.-type LabelCreate struct {+// TagCreate is the builder for creating a Tag entity.+type TagCreate struct {config- mutation *LabelMutation+ mutation *TagMutationhooks []Hook}// SetCreatedAt sets the "created_at" field.-func (_c *LabelCreate) SetCreatedAt(v time.Time) *LabelCreate {+func (_c *TagCreate) SetCreatedAt(v time.Time) *TagCreate {_c.mutation.SetCreatedAt(v)return _c}// SetNillableCreatedAt sets the "created_at" field if the given value is not nil.-func (_c *LabelCreate) SetNillableCreatedAt(v *time.Time) *LabelCreate {+func (_c *TagCreate) SetNillableCreatedAt(v *time.Time) *TagCreate {if v != nil {_c.SetCreatedAt(*v)}@@ -38,13 +38,13 @@ func (_c *LabelCreate) SetNillableCreatedAt(v *time.Time) *LabelCreate {}// SetUpdatedAt sets the "updated_at" field.-func (_c *LabelCreate) SetUpdatedAt(v time.Time) *LabelCreate {+func (_c *TagCreate) SetUpdatedAt(v time.Time) *TagCreate {_c.mutation.SetUpdatedAt(v)return _c}// SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.-func (_c *LabelCreate) SetNillableUpdatedAt(v *time.Time) *LabelCreate {+func (_c *TagCreate) SetNillableUpdatedAt(v *time.Time) *TagCreate {if v != nil {_c.SetUpdatedAt(*v)}@@ -52,19 +52,19 @@ func (_c *LabelCreate) SetNillableUpdatedAt(v *time.Time) *LabelCreate {}// SetName sets the "name" field.-func (_c *LabelCreate) SetName(v string) *LabelCreate {+func (_c *TagCreate) SetName(v string) *TagCreate {_c.mutation.SetName(v)return _c}// SetDescription sets the "description" field.-func (_c *LabelCreate) SetDescription(v string) *LabelCreate {+func (_c *TagCreate) SetDescription(v string) *TagCreate {_c.mutation.SetDescription(v)return _c}// SetNillableDescription sets the "description" field if the given value is not nil.-func (_c *LabelCreate) SetNillableDescription(v *string) *LabelCreate {+func (_c *TagCreate) SetNillableDescription(v *string) *TagCreate {if v != nil {_c.SetDescription(*v)}@@ -72,13 +72,13 @@ func (_c *LabelCreate) SetNillableDescription(v *string) *LabelCreate {}// SetColor sets the "color" field.-func (_c *LabelCreate) SetColor(v string) *LabelCreate {+func (_c *TagCreate) SetColor(v string) *TagCreate {_c.mutation.SetColor(v)return _c}// SetNillableColor sets the "color" field if the given value is not nil.-func (_c *LabelCreate) SetNillableColor(v *string) *LabelCreate {+func (_c *TagCreate) SetNillableColor(v *string) *TagCreate {if v != nil {_c.SetColor(*v)}@@ -86,13 +86,13 @@ func (_c *LabelCreate) SetNillableColor(v *string) *LabelCreate {}// SetID sets the "id" field.-func (_c *LabelCreate) SetID(v uuid.UUID) *LabelCreate {+func (_c *TagCreate) SetID(v uuid.UUID) *TagCreate {_c.mutation.SetID(v)return _c}// SetNillableID sets the "id" field if the given value is not nil.-func (_c *LabelCreate) SetNillableID(v *uuid.UUID) *LabelCreate {+func (_c *TagCreate) SetNillableID(v *uuid.UUID) *TagCreate {if v != nil {_c.SetID(*v)}@@ -100,24 +100,24 @@ func (_c *LabelCreate) SetNillableID(v *uuid.UUID) *LabelCreate {}// SetGroupID sets the "group" edge to the Group entity by ID.-func (_c *LabelCreate) SetGroupID(id uuid.UUID) *LabelCreate {+func (_c *TagCreate) SetGroupID(id uuid.UUID) *TagCreate {_c.mutation.SetGroupID(id)return _c}// SetGroup sets the "group" edge to the Group entity.-func (_c *LabelCreate) SetGroup(v *Group) *LabelCreate {+func (_c *TagCreate) SetGroup(v *Group) *TagCreate {return _c.SetGroupID(v.ID)}// AddItemIDs adds the "items" edge to the Item entity by IDs.-func (_c *LabelCreate) AddItemIDs(ids ...uuid.UUID) *LabelCreate {+func (_c *TagCreate) AddItemIDs(ids ...uuid.UUID) *TagCreate {_c.mutation.AddItemIDs(ids...)return _c}// AddItems adds the "items" edges to the Item entity.-func (_c *LabelCreate) AddItems(v ...*Item) *LabelCreate {+func (_c *TagCreate) AddItems(v ...*Item) *TagCreate {ids := make([]uuid.UUID, len(v))for i := range v {ids[i] = v[i].ID@@ -125,19 +125,19 @@ func (_c *LabelCreate) AddItems(v ...*Item) *LabelCreate {return _c.AddItemIDs(ids...)}-// Mutation returns the LabelMutation object of the builder.-func (_c *LabelCreate) Mutation() *LabelMutation {+// Mutation returns the TagMutation object of the builder.+func (_c *TagCreate) Mutation() *TagMutation {return _c.mutation}-// Save creates the Label in the database.-func (_c *LabelCreate) Save(ctx context.Context) (*Label, error) {+// Save creates the Tag in the database.+func (_c *TagCreate) Save(ctx context.Context) (*Tag, error) {_c.defaults()return withHooks(ctx, _c.sqlSave, _c.mutation, _c.hooks)}// SaveX calls Save and panics if Save returns an error.-func (_c *LabelCreate) SaveX(ctx context.Context) *Label {+func (_c *TagCreate) SaveX(ctx context.Context) *Tag {v, err := _c.Save(ctx)if err != nil {panic(err)@@ -146,67 +146,67 @@ func (_c *LabelCreate) SaveX(ctx context.Context) *Label {}// Exec executes the query.-func (_c *LabelCreate) Exec(ctx context.Context) error {+func (_c *TagCreate) Exec(ctx context.Context) error {_, err := _c.Save(ctx)return err}// ExecX is like Exec, but panics if an error occurs.-func (_c *LabelCreate) ExecX(ctx context.Context) {+func (_c *TagCreate) ExecX(ctx context.Context) {if err := _c.Exec(ctx); err != nil {panic(err)}}// defaults sets the default values of the builder before save.-func (_c *LabelCreate) defaults() {+func (_c *TagCreate) defaults() {if _, ok := _c.mutation.CreatedAt(); !ok {- v := label.DefaultCreatedAt()+ v := tag.DefaultCreatedAt()_c.mutation.SetCreatedAt(v)}if _, ok := _c.mutation.UpdatedAt(); !ok {- v := label.DefaultUpdatedAt()+ v := tag.DefaultUpdatedAt()_c.mutation.SetUpdatedAt(v)}if _, ok := _c.mutation.ID(); !ok {- v := label.DefaultID()+ v := tag.DefaultID()_c.mutation.SetID(v)}}// check runs all checks and user-defined validators on the builder.-func (_c *LabelCreate) check() error {+func (_c *TagCreate) check() error {if _, ok := _c.mutation.CreatedAt(); !ok {- return &ValidationError{Name: "created_at", err: errors.New(`ent: missing required field "Label.created_at"`)}+ return &ValidationError{Name: "created_at", err: errors.New(`ent: missing required field "Tag.created_at"`)}}if _, ok := _c.mutation.UpdatedAt(); !ok {- return &ValidationError{Name: "updated_at", err: errors.New(`ent: missing required field "Label.updated_at"`)}+ return &ValidationError{Name: "updated_at", err: errors.New(`ent: missing required field "Tag.updated_at"`)}}if _, ok := _c.mutation.Name(); !ok {- return &ValidationError{Name: "name", err: errors.New(`ent: missing required field "Label.name"`)}+ return &ValidationError{Name: "name", err: errors.New(`ent: missing required field "Tag.name"`)}}if v, ok := _c.mutation.Name(); ok {- if err := label.NameValidator(v); err != nil {- return &ValidationError{Name: "name", err: fmt.Errorf(`ent: validator failed for field "Label.name": %w`, err)}+ if err := tag.NameValidator(v); err != nil {+ return &ValidationError{Name: "name", err: fmt.Errorf(`ent: validator failed for field "Tag.name": %w`, err)}}}if v, ok := _c.mutation.Description(); ok {- if err := label.DescriptionValidator(v); err != nil {- return &ValidationError{Name: "description", err: fmt.Errorf(`ent: validator failed for field "Label.description": %w`, err)}+ if err := tag.DescriptionValidator(v); err != nil {+ return &ValidationError{Name: "description", err: fmt.Errorf(`ent: validator failed for field "Tag.description": %w`, err)}}}if v, ok := _c.mutation.Color(); ok {- if err := label.ColorValidator(v); err != nil {- return &ValidationError{Name: "color", err: fmt.Errorf(`ent: validator failed for field "Label.color": %w`, err)}+ if err := tag.ColorValidator(v); err != nil {+ return &ValidationError{Name: "color", err: fmt.Errorf(`ent: validator failed for field "Tag.color": %w`, err)}}}if len(_c.mutation.GroupIDs()) == 0 {- return &ValidationError{Name: "group", err: errors.New(`ent: missing required edge "Label.group"`)}+ return &ValidationError{Name: "group", err: errors.New(`ent: missing required edge "Tag.group"`)}}return nil}-func (_c *LabelCreate) sqlSave(ctx context.Context) (*Label, error) {+func (_c *TagCreate) sqlSave(ctx context.Context) (*Tag, error) {if err := _c.check(); err != nil {return nil, err}@@ -229,41 +229,41 @@ func (_c *LabelCreate) sqlSave(ctx context.Context) (*Label, error) {return _node, nil}-func (_c *LabelCreate) createSpec() (*Label, *sqlgraph.CreateSpec) {+func (_c *TagCreate) createSpec() (*Tag, *sqlgraph.CreateSpec) {var (- _node = &Label{config: _c.config}- _spec = sqlgraph.NewCreateSpec(label.Table, sqlgraph.NewFieldSpec(label.FieldID, field.TypeUUID))+ _node = &Tag{config: _c.config}+ _spec = sqlgraph.NewCreateSpec(tag.Table, sqlgraph.NewFieldSpec(tag.FieldID, field.TypeUUID)))if id, ok := _c.mutation.ID(); ok {_node.ID = id_spec.ID.Value = &id}if value, ok := _c.mutation.CreatedAt(); ok {- _spec.SetField(label.FieldCreatedAt, field.TypeTime, value)+ _spec.SetField(tag.FieldCreatedAt, field.TypeTime, value)_node.CreatedAt = value}if value, ok := _c.mutation.UpdatedAt(); ok {- _spec.SetField(label.FieldUpdatedAt, field.TypeTime, value)+ _spec.SetField(tag.FieldUpdatedAt, field.TypeTime, value)_node.UpdatedAt = value}if value, ok := _c.mutation.Name(); ok {- _spec.SetField(label.FieldName, field.TypeString, value)+ _spec.SetField(tag.FieldName, field.TypeString, value)_node.Name = value}if value, ok := _c.mutation.Description(); ok {- _spec.SetField(label.FieldDescription, field.TypeString, value)+ _spec.SetField(tag.FieldDescription, field.TypeString, value)_node.Description = value}if value, ok := _c.mutation.Color(); ok {- _spec.SetField(label.FieldColor, field.TypeString, value)+ _spec.SetField(tag.FieldColor, field.TypeString, value)_node.Color = value}if nodes := _c.mutation.GroupIDs(); len(nodes) > 0 {edge := &sqlgraph.EdgeSpec{Rel: sqlgraph.M2O,Inverse: true,- Table: label.GroupTable,- Columns: []string{label.GroupColumn},+ Table: tag.GroupTable,+ Columns: []string{tag.GroupColumn},Bidi: false,Target: &sqlgraph.EdgeTarget{IDSpec: sqlgraph.NewFieldSpec(group.FieldID, field.TypeUUID),@@ -272,15 +272,15 @@ func (_c *LabelCreate) createSpec() (*Label, *sqlgraph.CreateSpec) {for _, k := range nodes {edge.Target.Nodes = append(edge.Target.Nodes, k)}- _node.group_labels = &nodes[0]+ _node.group_tags = &nodes[0]_spec.Edges = append(_spec.Edges, edge)}if nodes := _c.mutation.ItemsIDs(); len(nodes) > 0 {edge := &sqlgraph.EdgeSpec{Rel: sqlgraph.M2M,Inverse: false,- Table: label.ItemsTable,- Columns: label.ItemsPrimaryKey,+ Table: tag.ItemsTable,+ Columns: tag.ItemsPrimaryKey,Bidi: false,Target: &sqlgraph.EdgeTarget{IDSpec: sqlgraph.NewFieldSpec(item.FieldID, field.TypeUUID),@@ -294,27 +294,27 @@ func (_c *LabelCreate) createSpec() (*Label, *sqlgraph.CreateSpec) {return _node, _spec}-// LabelCreateBulk is the builder for creating many Label entities in bulk.-type LabelCreateBulk struct {+// TagCreateBulk is the builder for creating many Tag entities in bulk.+type TagCreateBulk struct {configerr error- builders []*LabelCreate+ builders []*TagCreate}-// Save creates the Label entities in the database.-func (_c *LabelCreateBulk) Save(ctx context.Context) ([]*Label, error) {+// Save creates the Tag entities in the database.+func (_c *TagCreateBulk) Save(ctx context.Context) ([]*Tag, error) {if _c.err != nil {return nil, _c.err}specs := make([]*sqlgraph.CreateSpec, len(_c.builders))- nodes := make([]*Label, len(_c.builders))+ nodes := make([]*Tag, len(_c.builders))mutators := make([]Mutator, len(_c.builders))for i := range _c.builders {func(i int, root context.Context) {builder := _c.builders[i]builder.defaults()var mut Mutator = MutateFunc(func(ctx context.Context, m Mutation) (Value, error) {- mutation, ok := m.(*LabelMutation)+ mutation, ok := m.(*TagMutation)if !ok {return nil, fmt.Errorf("unexpected mutation type %T", m)}@@ -357,7 +357,7 @@ func (_c *LabelCreateBulk) Save(ctx context.Context) ([]*Label, error) {}// SaveX is like Save, but panics if an error occurs.-func (_c *LabelCreateBulk) SaveX(ctx context.Context) []*Label {+func (_c *TagCreateBulk) SaveX(ctx context.Context) []*Tag {v, err := _c.Save(ctx)if err != nil {panic(err)@@ -366,13 +366,13 @@ func (_c *LabelCreateBulk) SaveX(ctx context.Context) []*Label {}// Exec executes the query.-func (_c *LabelCreateBulk) Exec(ctx context.Context) error {+func (_c *TagCreateBulk) Exec(ctx context.Context) error {_, err := _c.Save(ctx)return err}// ExecX is like Exec, but panics if an error occurs.-func (_c *LabelCreateBulk) ExecX(ctx context.Context) {+func (_c *TagCreateBulk) ExecX(ctx context.Context) {if err := _c.Exec(ctx); err != nil {panic(err)}diff --git a/backend/internal/data/ent/label_delete.go b/backend/internal/data/ent/tag_delete.gosimilarity index 55%rename from backend/internal/data/ent/label_delete.gorename to backend/internal/data/ent/tag_delete.goindex 68cb8fac..4b53b4ed 100644--- a/backend/internal/data/ent/label_delete.go+++ b/backend/internal/data/ent/tag_delete.go@@ -8,30 +8,30 @@ import ("entgo.io/ent/dialect/sql""entgo.io/ent/dialect/sql/sqlgraph""entgo.io/ent/schema/field"- "github.com/sysadminsmedia/homebox/backend/internal/data/ent/label""github.com/sysadminsmedia/homebox/backend/internal/data/ent/predicate"+ "github.com/sysadminsmedia/homebox/backend/internal/data/ent/tag")-// LabelDelete is the builder for deleting a Label entity.-type LabelDelete struct {+// TagDelete is the builder for deleting a Tag entity.+type TagDelete struct {confighooks []Hook- mutation *LabelMutation+ mutation *TagMutation}-// Where appends a list predicates to the LabelDelete builder.-func (_d *LabelDelete) Where(ps ...predicate.Label) *LabelDelete {+// Where appends a list predicates to the TagDelete builder.+func (_d *TagDelete) Where(ps ...predicate.Tag) *TagDelete {_d.mutation.Where(ps...)return _d}// Exec executes the deletion query and returns how many vertices were deleted.-func (_d *LabelDelete) Exec(ctx context.Context) (int, error) {+func (_d *TagDelete) Exec(ctx context.Context) (int, error) {return withHooks(ctx, _d.sqlExec, _d.mutation, _d.hooks)}// ExecX is like Exec, but panics if an error occurs.-func (_d *LabelDelete) ExecX(ctx context.Context) int {+func (_d *TagDelete) ExecX(ctx context.Context) int {n, err := _d.Exec(ctx)if err != nil {panic(err)@@ -39,8 +39,8 @@ func (_d *LabelDelete) ExecX(ctx context.Context) int {return n}-func (_d *LabelDelete) sqlExec(ctx context.Context) (int, error) {- _spec := sqlgraph.NewDeleteSpec(label.Table, sqlgraph.NewFieldSpec(label.FieldID, field.TypeUUID))+func (_d *TagDelete) sqlExec(ctx context.Context) (int, error) {+ _spec := sqlgraph.NewDeleteSpec(tag.Table, sqlgraph.NewFieldSpec(tag.FieldID, field.TypeUUID))if ps := _d.mutation.predicates; len(ps) > 0 {_spec.Predicate = func(selector *sql.Selector) {for i := range ps {@@ -56,32 +56,32 @@ func (_d *LabelDelete) sqlExec(ctx context.Context) (int, error) {return affected, err}-// LabelDeleteOne is the builder for deleting a single Label entity.-type LabelDeleteOne struct {- _d *LabelDelete+// TagDeleteOne is the builder for deleting a single Tag entity.+type TagDeleteOne struct {+ _d *TagDelete}-// Where appends a list predicates to the LabelDelete builder.-func (_d *LabelDeleteOne) Where(ps ...predicate.Label) *LabelDeleteOne {+// Where appends a list predicates to the TagDelete builder.+func (_d *TagDeleteOne) Where(ps ...predicate.Tag) *TagDeleteOne {_d._d.mutation.Where(ps...)return _d}// Exec executes the deletion query.-func (_d *LabelDeleteOne) Exec(ctx context.Context) error {+func (_d *TagDeleteOne) Exec(ctx context.Context) error {n, err := _d._d.Exec(ctx)switch {case err != nil:return errcase n == 0:- return &NotFoundError{label.Label}+ return &NotFoundError{tag.Label}default:return nil}}// ExecX is like Exec, but panics if an error occurs.-func (_d *LabelDeleteOne) ExecX(ctx context.Context) {+func (_d *TagDeleteOne) ExecX(ctx context.Context) {if err := _d.Exec(ctx); err != nil {panic(err)}diff --git a/backend/internal/data/ent/label_query.go b/backend/internal/data/ent/tag_query.gosimilarity index 66%rename from backend/internal/data/ent/label_query.gorename to backend/internal/data/ent/tag_query.goindex f3661691..efa7ada3 100644--- a/backend/internal/data/ent/label_query.go+++ b/backend/internal/data/ent/tag_query.go@@ -15,17 +15,17 @@ import ("github.com/google/uuid""github.com/sysadminsmedia/homebox/backend/internal/data/ent/group""github.com/sysadminsmedia/homebox/backend/internal/data/ent/item"- "github.com/sysadminsmedia/homebox/backend/internal/data/ent/label""github.com/sysadminsmedia/homebox/backend/internal/data/ent/predicate"+ "github.com/sysadminsmedia/homebox/backend/internal/data/ent/tag")-// LabelQuery is the builder for querying Label entities.-type LabelQuery struct {+// TagQuery is the builder for querying Tag entities.+type TagQuery struct {configctx *QueryContext- order []label.OrderOption+ order []tag.OrderOptioninters []Interceptor- predicates []predicate.Label+ predicates []predicate.TagwithGroup *GroupQuerywithItems *ItemQuerywithFKs bool@@ -34,39 +34,39 @@ type LabelQuery struct {path func(context.Context) (*sql.Selector, error)}-// Where adds a new predicate for the LabelQuery builder.-func (_q *LabelQuery) Where(ps ...predicate.Label) *LabelQuery {+// Where adds a new predicate for the TagQuery builder.+func (_q *TagQuery) Where(ps ...predicate.Tag) *TagQuery {_q.predicates = append(_q.predicates, ps...)return _q}// Limit the number of records to be returned by this query.-func (_q *LabelQuery) Limit(limit int) *LabelQuery {+func (_q *TagQuery) Limit(limit int) *TagQuery {_q.ctx.Limit = &limitreturn _q}// Offset to start from.-func (_q *LabelQuery) Offset(offset int) *LabelQuery {+func (_q *TagQuery) Offset(offset int) *TagQuery {_q.ctx.Offset = &offsetreturn _q}// Unique configures the query builder to filter duplicate records on query.// By default, unique is set to true, and can be disabled using this method.-func (_q *LabelQuery) Unique(unique bool) *LabelQuery {+func (_q *TagQuery) Unique(unique bool) *TagQuery {_q.ctx.Unique = &uniquereturn _q}// Order specifies how the records should be ordered.-func (_q *LabelQuery) Order(o ...label.OrderOption) *LabelQuery {+func (_q *TagQuery) Order(o ...tag.OrderOption) *TagQuery {_q.order = append(_q.order, o...)return _q}// QueryGroup chains the current query on the "group" edge.-func (_q *LabelQuery) QueryGroup() *GroupQuery {+func (_q *TagQuery) QueryGroup() *GroupQuery {query := (&GroupClient{config: _q.config}).Query()query.path = func(ctx context.Context) (fromU *sql.Selector, err error) {if err := _q.prepareQuery(ctx); err != nil {@@ -77,9 +77,9 @@ func (_q *LabelQuery) QueryGroup() *GroupQuery {return nil, err}step := sqlgraph.NewStep(- sqlgraph.From(label.Table, label.FieldID, selector),+ sqlgraph.From(tag.Table, tag.FieldID, selector),sqlgraph.To(group.Table, group.FieldID),- sqlgraph.Edge(sqlgraph.M2O, true, label.GroupTable, label.GroupColumn),+ sqlgraph.Edge(sqlgraph.M2O, true, tag.GroupTable, tag.GroupColumn),)fromU = sqlgraph.SetNeighbors(_q.driver.Dialect(), step)return fromU, nil@@ -88,7 +88,7 @@ func (_q *LabelQuery) QueryGroup() *GroupQuery {}// QueryItems chains the current query on the "items" edge.-func (_q *LabelQuery) QueryItems() *ItemQuery {+func (_q *TagQuery) QueryItems() *ItemQuery {query := (&ItemClient{config: _q.config}).Query()query.path = func(ctx context.Context) (fromU *sql.Selector, err error) {if err := _q.prepareQuery(ctx); err != nil {@@ -99,9 +99,9 @@ func (_q *LabelQuery) QueryItems() *ItemQuery {return nil, err}step := sqlgraph.NewStep(- sqlgraph.From(label.Table, label.FieldID, selector),+ sqlgraph.From(tag.Table, tag.FieldID, selector),sqlgraph.To(item.Table, item.FieldID),- sqlgraph.Edge(sqlgraph.M2M, false, label.ItemsTable, label.ItemsPrimaryKey...),+ sqlgraph.Edge(sqlgraph.M2M, false, tag.ItemsTable, tag.ItemsPrimaryKey...),)fromU = sqlgraph.SetNeighbors(_q.driver.Dialect(), step)return fromU, nil@@ -109,21 +109,21 @@ func (_q *LabelQuery) QueryItems() *ItemQuery {return query}-// First returns the first Label entity from the query.-// Returns a *NotFoundError when no Label was found.-func (_q *LabelQuery) First(ctx context.Context) (*Label, error) {+// First returns the first Tag entity from the query.+// Returns a *NotFoundError when no Tag was found.+func (_q *TagQuery) First(ctx context.Context) (*Tag, error) {nodes, err := _q.Limit(1).All(setContextOp(ctx, _q.ctx, ent.OpQueryFirst))if err != nil {return nil, err}if len(nodes) == 0 {- return nil, &NotFoundError{label.Label}+ return nil, &NotFoundError{tag.Label}}return nodes[0], nil}// FirstX is like First, but panics if an error occurs.-func (_q *LabelQuery) FirstX(ctx context.Context) *Label {+func (_q *TagQuery) FirstX(ctx context.Context) *Tag {node, err := _q.First(ctx)if err != nil && !IsNotFound(err) {panic(err)@@ -131,22 +131,22 @@ func (_q *LabelQuery) FirstX(ctx context.Context) *Label {return node}-// FirstID returns the first Label ID from the query.-// Returns a *NotFoundError when no Label ID was found.-func (_q *LabelQuery) FirstID(ctx context.Context) (id uuid.UUID, err error) {+// FirstID returns the first Tag ID from the query.+// Returns a *NotFoundError when no Tag ID was found.+func (_q *TagQuery) FirstID(ctx context.Context) (id uuid.UUID, err error) {var ids []uuid.UUIDif ids, err = _q.Limit(1).IDs(setContextOp(ctx, _q.ctx, ent.OpQueryFirstID)); err != nil {return}if len(ids) == 0 {- err = &NotFoundError{label.Label}+ err = &NotFoundError{tag.Label}return}return ids[0], nil}// FirstIDX is like FirstID, but panics if an error occurs.-func (_q *LabelQuery) FirstIDX(ctx context.Context) uuid.UUID {+func (_q *TagQuery) FirstIDX(ctx context.Context) uuid.UUID {id, err := _q.FirstID(ctx)if err != nil && !IsNotFound(err) {panic(err)@@ -154,10 +154,10 @@ func (_q *LabelQuery) FirstIDX(ctx context.Context) uuid.UUID {return id}-// Only returns a single Label entity found by the query, ensuring it only returns one.-// Returns a *NotSingularError when more than one Label entity is found.-// Returns a *NotFoundError when no Label entities are found.-func (_q *LabelQuery) Only(ctx context.Context) (*Label, error) {+// Only returns a single Tag entity found by the query, ensuring it only returns one.+// Returns a *NotSingularError when more than one Tag entity is found.+// Returns a *NotFoundError when no Tag entities are found.+func (_q *TagQuery) Only(ctx context.Context) (*Tag, error) {nodes, err := _q.Limit(2).All(setContextOp(ctx, _q.ctx, ent.OpQueryOnly))if err != nil {return nil, err@@ -166,14 +166,14 @@ func (_q *LabelQuery) Only(ctx context.Context) (*Label, error) {case 1:return nodes[0], nilcase 0:- return nil, &NotFoundError{label.Label}+ return nil, &NotFoundError{tag.Label}default:- return nil, &NotSingularError{label.Label}+ return nil, &NotSingularError{tag.Label}}}// OnlyX is like Only, but panics if an error occurs.-func (_q *LabelQuery) OnlyX(ctx context.Context) *Label {+func (_q *TagQuery) OnlyX(ctx context.Context) *Tag {node, err := _q.Only(ctx)if err != nil {panic(err)@@ -181,10 +181,10 @@ func (_q *LabelQuery) OnlyX(ctx context.Context) *Label {return node}-// OnlyID is like Only, but returns the only Label ID in the query.-// Returns a *NotSingularError when more than one Label ID is found.+// OnlyID is like Only, but returns the only Tag ID in the query.+// Returns a *NotSingularError when more than one Tag ID is found.// Returns a *NotFoundError when no entities are found.-func (_q *LabelQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error) {+func (_q *TagQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error) {var ids []uuid.UUIDif ids, err = _q.Limit(2).IDs(setContextOp(ctx, _q.ctx, ent.OpQueryOnlyID)); err != nil {return@@ -193,15 +193,15 @@ func (_q *LabelQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error) {case 1:id = ids[0]case 0:- err = &NotFoundError{label.Label}+ err = &NotFoundError{tag.Label}default:- err = &NotSingularError{label.Label}+ err = &NotSingularError{tag.Label}}return}// OnlyIDX is like OnlyID, but panics if an error occurs.-func (_q *LabelQuery) OnlyIDX(ctx context.Context) uuid.UUID {+func (_q *TagQuery) OnlyIDX(ctx context.Context) uuid.UUID {id, err := _q.OnlyID(ctx)if err != nil {panic(err)@@ -209,18 +209,18 @@ func (_q *LabelQuery) OnlyIDX(ctx context.Context) uuid.UUID {return id}-// All executes the query and returns a list of Labels.-func (_q *LabelQuery) All(ctx context.Context) ([]*Label, error) {+// All executes the query and returns a list of Tags.+func (_q *TagQuery) All(ctx context.Context) ([]*Tag, error) {ctx = setContextOp(ctx, _q.ctx, ent.OpQueryAll)if err := _q.prepareQuery(ctx); err != nil {return nil, err}- qr := querierAll[[]*Label, *LabelQuery]()- return withInterceptors[[]*Label](ctx, _q, qr, _q.inters)+ qr := querierAll[[]*Tag, *TagQuery]()+ return withInterceptors[[]*Tag](ctx, _q, qr, _q.inters)}// AllX is like All, but panics if an error occurs.-func (_q *LabelQuery) AllX(ctx context.Context) []*Label {+func (_q *TagQuery) AllX(ctx context.Context) []*Tag {nodes, err := _q.All(ctx)if err != nil {panic(err)@@ -228,20 +228,20 @@ func (_q *LabelQuery) AllX(ctx context.Context) []*Label {return nodes}-// IDs executes the query and returns a list of Label IDs.-func (_q *LabelQuery) IDs(ctx context.Context) (ids []uuid.UUID, err error) {+// IDs executes the query and returns a list of Tag IDs.+func (_q *TagQuery) IDs(ctx context.Context) (ids []uuid.UUID, err error) {if _q.ctx.Unique == nil && _q.path != nil {_q.Unique(true)}ctx = setContextOp(ctx, _q.ctx, ent.OpQueryIDs)- if err = _q.Select(label.FieldID).Scan(ctx, &ids); err != nil {+ if err = _q.Select(tag.FieldID).Scan(ctx, &ids); err != nil {return nil, err}return ids, nil}// IDsX is like IDs, but panics if an error occurs.-func (_q *LabelQuery) IDsX(ctx context.Context) []uuid.UUID {+func (_q *TagQuery) IDsX(ctx context.Context) []uuid.UUID {ids, err := _q.IDs(ctx)if err != nil {panic(err)@@ -250,16 +250,16 @@ func (_q *LabelQuery) IDsX(ctx context.Context) []uuid.UUID {}// Count returns the count of the given query.-func (_q *LabelQuery) Count(ctx context.Context) (int, error) {+func (_q *TagQuery) Count(ctx context.Context) (int, error) {ctx = setContextOp(ctx, _q.ctx, ent.OpQueryCount)if err := _q.prepareQuery(ctx); err != nil {return 0, err}- return withInterceptors[int](ctx, _q, querierCount[*LabelQuery](), _q.inters)+ return withInterceptors[int](ctx, _q, querierCount[*TagQuery](), _q.inters)}// CountX is like Count, but panics if an error occurs.-func (_q *LabelQuery) CountX(ctx context.Context) int {+func (_q *TagQuery) CountX(ctx context.Context) int {count, err := _q.Count(ctx)if err != nil {panic(err)@@ -268,7 +268,7 @@ func (_q *LabelQuery) CountX(ctx context.Context) int {}// Exist returns true if the query has elements in the graph.-func (_q *LabelQuery) Exist(ctx context.Context) (bool, error) {+func (_q *TagQuery) Exist(ctx context.Context) (bool, error) {ctx = setContextOp(ctx, _q.ctx, ent.OpQueryExist)switch _, err := _q.FirstID(ctx); {case IsNotFound(err):@@ -281,7 +281,7 @@ func (_q *LabelQuery) Exist(ctx context.Context) (bool, error) {}// ExistX is like Exist, but panics if an error occurs.-func (_q *LabelQuery) ExistX(ctx context.Context) bool {+func (_q *TagQuery) ExistX(ctx context.Context) bool {exist, err := _q.Exist(ctx)if err != nil {panic(err)@@ -289,18 +289,18 @@ func (_q *LabelQuery) ExistX(ctx context.Context) bool {return exist}-// Clone returns a duplicate of the LabelQuery builder, including all associated steps. It can be+// Clone returns a duplicate of the TagQuery builder, including all associated steps. It can be// used to prepare common query builders and use them differently after the clone is made.-func (_q *LabelQuery) Clone() *LabelQuery {+func (_q *TagQuery) Clone() *TagQuery {if _q == nil {return nil}- return &LabelQuery{+ return &TagQuery{config: _q.config,ctx: _q.ctx.Clone(),- order: append([]label.OrderOption{}, _q.order...),+ order: append([]tag.OrderOption{}, _q.order...),inters: append([]Interceptor{}, _q.inters...),- predicates: append([]predicate.Label{}, _q.predicates...),+ predicates: append([]predicate.Tag{}, _q.predicates...),withGroup: _q.withGroup.Clone(),withItems: _q.withItems.Clone(),// clone intermediate query.@@ -311,7 +311,7 @@ func (_q *LabelQuery) Clone() *LabelQuery {// WithGroup tells the query-builder to eager-load the nodes that are connected to// the "group" edge. The optional arguments are used to configure the query builder of the edge.-func (_q *LabelQuery) WithGroup(opts ...func(*GroupQuery)) *LabelQuery {+func (_q *TagQuery) WithGroup(opts ...func(*GroupQuery)) *TagQuery {query := (&GroupClient{config: _q.config}).Query()for _, opt := range opts {opt(query)@@ -322,7 +322,7 @@ func (_q *LabelQuery) WithGroup(opts ...func(*GroupQuery)) *LabelQuery {// WithItems tells the query-builder to eager-load the nodes that are connected to// the "items" edge. The optional arguments are used to configure the query builder of the edge.-func (_q *LabelQuery) WithItems(opts ...func(*ItemQuery)) *LabelQuery {+func (_q *TagQuery) WithItems(opts ...func(*ItemQuery)) *TagQuery {query := (&ItemClient{config: _q.config}).Query()for _, opt := range opts {opt(query)@@ -341,15 +341,15 @@ func (_q *LabelQuery) WithItems(opts ...func(*ItemQuery)) *LabelQuery {// Count int `json:"count,omitempty"`// }//-// client.Label.Query().-// GroupBy(label.FieldCreatedAt).+// client.Tag.Query().+// GroupBy(tag.FieldCreatedAt).// Aggregate(ent.Count()).// Scan(ctx, &v)-func (_q *LabelQuery) GroupBy(field string, fields ...string) *LabelGroupBy {+func (_q *TagQuery) GroupBy(field string, fields ...string) *TagGroupBy {_q.ctx.Fields = append([]string{field}, fields...)- grbuild := &LabelGroupBy{build: _q}+ grbuild := &TagGroupBy{build: _q}grbuild.flds = &_q.ctx.Fields- grbuild.label = label.Label+ grbuild.label = tag.Labelgrbuild.scan = grbuild.Scanreturn grbuild}@@ -363,23 +363,23 @@ func (_q *LabelQuery) GroupBy(field string, fields ...string) *LabelGroupBy {// CreatedAt time.Time `json:"created_at,omitempty"`// }//-// client.Label.Query().-// Select(label.FieldCreatedAt).+// client.Tag.Query().+// Select(tag.FieldCreatedAt).// Scan(ctx, &v)-func (_q *LabelQuery) Select(fields ...string) *LabelSelect {+func (_q *TagQuery) Select(fields ...string) *TagSelect {_q.ctx.Fields = append(_q.ctx.Fields, fields...)- sbuild := &LabelSelect{LabelQuery: _q}- sbuild.label = label.Label+ sbuild := &TagSelect{TagQuery: _q}+ sbuild.label = tag.Labelsbuild.flds, sbuild.scan = &_q.ctx.Fields, sbuild.Scanreturn sbuild}-// Aggregate returns a LabelSelect configured with the given aggregations.-func (_q *LabelQuery) Aggregate(fns ...AggregateFunc) *LabelSelect {+// Aggregate returns a TagSelect configured with the given aggregations.+func (_q *TagQuery) Aggregate(fns ...AggregateFunc) *TagSelect {return _q.Select().Aggregate(fns...)}-func (_q *LabelQuery) prepareQuery(ctx context.Context) error {+func (_q *TagQuery) prepareQuery(ctx context.Context) error {for _, inter := range _q.inters {if inter == nil {return fmt.Errorf("ent: uninitialized interceptor (forgotten import ent/runtime?)")@@ -391,7 +391,7 @@ func (_q *LabelQuery) prepareQuery(ctx context.Context) error {}}for _, f := range _q.ctx.Fields {- if !label.ValidColumn(f) {+ if !tag.ValidColumn(f) {return &ValidationError{Name: f, err: fmt.Errorf("ent: invalid field %q for query", f)}}}@@ -405,9 +405,9 @@ func (_q *LabelQuery) prepareQuery(ctx context.Context) error {return nil}-func (_q *LabelQuery) sqlAll(ctx context.Context, hooks ...queryHook) ([]*Label, error) {+func (_q *TagQuery) sqlAll(ctx context.Context, hooks ...queryHook) ([]*Tag, error) {var (- nodes = []*Label{}+ nodes = []*Tag{}withFKs = _q.withFKs_spec = _q.querySpec()loadedTypes = [2]bool{@@ -419,13 +419,13 @@ func (_q *LabelQuery) sqlAll(ctx context.Context, hooks ...queryHook) ([]*Label,withFKs = true}if withFKs {- _spec.Node.Columns = append(_spec.Node.Columns, label.ForeignKeys...)+ _spec.Node.Columns = append(_spec.Node.Columns, tag.ForeignKeys...)}_spec.ScanValues = func(columns []string) ([]any, error) {- return (*Label).scanValues(nil, columns)+ return (*Tag).scanValues(nil, columns)}_spec.Assign = func(columns []string, values []any) error {- node := &Label{config: _q.config}+ node := &Tag{config: _q.config}nodes = append(nodes, node)node.Edges.loadedTypes = loadedTypesreturn node.assignValues(columns, values)@@ -441,28 +441,28 @@ func (_q *LabelQuery) sqlAll(ctx context.Context, hooks ...queryHook) ([]*Label,}if query := _q.withGroup; query != nil {if err := _q.loadGroup(ctx, query, nodes, nil,- func(n *Label, e *Group) { n.Edges.Group = e }); err != nil {+ func(n *Tag, e *Group) { n.Edges.Group = e }); err != nil {return nil, err}}if query := _q.withItems; query != nil {if err := _q.loadItems(ctx, query, nodes,- func(n *Label) { n.Edges.Items = []*Item{} },- func(n *Label, e *Item) { n.Edges.Items = append(n.Edges.Items, e) }); err != nil {+ func(n *Tag) { n.Edges.Items = []*Item{} },+ func(n *Tag, e *Item) { n.Edges.Items = append(n.Edges.Items, e) }); err != nil {return nil, err}}return nodes, nil}-func (_q *LabelQuery) loadGroup(ctx context.Context, query *GroupQuery, nodes []*Label, init func(*Label), assign func(*Label, *Group)) error {+func (_q *TagQuery) loadGroup(ctx context.Context, query *GroupQuery, nodes []*Tag, init func(*Tag), assign func(*Tag, *Group)) error {ids := make([]uuid.UUID, 0, len(nodes))- nodeids := make(map[uuid.UUID][]*Label)+ nodeids := make(map[uuid.UUID][]*Tag)for i := range nodes {- if nodes[i].group_labels == nil {+ if nodes[i].group_tags == nil {continue}- fk := *nodes[i].group_labels+ fk := *nodes[i].group_tagsif _, ok := nodeids[fk]; !ok {ids = append(ids, fk)}@@ -479,7 +479,7 @@ func (_q *LabelQuery) loadGroup(ctx context.Context, query *GroupQuery, nodes []for _, n := range neighbors {nodes, ok := nodeids[n.ID]if !ok {- return fmt.Errorf(`unexpected foreign-key "group_labels" returned %v`, n.ID)+ return fmt.Errorf(`unexpected foreign-key "group_tags" returned %v`, n.ID)}for i := range nodes {assign(nodes[i], n)@@ -487,10 +487,10 @@ func (_q *LabelQuery) loadGroup(ctx context.Context, query *GroupQuery, nodes []}return nil}-func (_q *LabelQuery) loadItems(ctx context.Context, query *ItemQuery, nodes []*Label, init func(*Label), assign func(*Label, *Item)) error {+func (_q *TagQuery) loadItems(ctx context.Context, query *ItemQuery, nodes []*Tag, init func(*Tag), assign func(*Tag, *Item)) error {edgeIDs := make([]driver.Value, len(nodes))- byID := make(map[uuid.UUID]*Label)- nids := make(map[uuid.UUID]map[*Label]struct{})+ byID := make(map[uuid.UUID]*Tag)+ nids := make(map[uuid.UUID]map[*Tag]struct{})for i, node := range nodes {edgeIDs[i] = node.IDbyID[node.ID] = node@@ -499,11 +499,11 @@ func (_q *LabelQuery) loadItems(ctx context.Context, query *ItemQuery, nodes []*}}query.Where(func(s *sql.Selector) {- joinT := sql.Table(label.ItemsTable)- s.Join(joinT).On(s.C(item.FieldID), joinT.C(label.ItemsPrimaryKey[1]))- s.Where(sql.InValues(joinT.C(label.ItemsPrimaryKey[0]), edgeIDs...))+ joinT := sql.Table(tag.ItemsTable)+ s.Join(joinT).On(s.C(item.FieldID), joinT.C(tag.ItemsPrimaryKey[1]))+ s.Where(sql.InValues(joinT.C(tag.ItemsPrimaryKey[0]), edgeIDs...))columns := s.SelectedColumns()- s.Select(joinT.C(label.ItemsPrimaryKey[0]))+ s.Select(joinT.C(tag.ItemsPrimaryKey[0]))s.AppendSelect(columns...)s.SetDistinct(false)})@@ -525,7 +525,7 @@ func (_q *LabelQuery) loadItems(ctx context.Context, query *ItemQuery, nodes []*outValue := *values[0].(*uuid.UUID)inValue := *values[1].(*uuid.UUID)if nids[inValue] == nil {- nids[inValue] = map[*Label]struct{}{byID[outValue]: {}}+ nids[inValue] = map[*Tag]struct{}{byID[outValue]: {}}return assign(columns[1:], values[1:])}nids[inValue][byID[outValue]] = struct{}{}@@ -549,7 +549,7 @@ func (_q *LabelQuery) loadItems(ctx context.Context, query *ItemQuery, nodes []*return nil}-func (_q *LabelQuery) sqlCount(ctx context.Context) (int, error) {+func (_q *TagQuery) sqlCount(ctx context.Context) (int, error) {_spec := _q.querySpec()_spec.Node.Columns = _q.ctx.Fieldsif len(_q.ctx.Fields) > 0 {@@ -558,8 +558,8 @@ func (_q *LabelQuery) sqlCount(ctx context.Context) (int, error) {return sqlgraph.CountNodes(ctx, _q.driver, _spec)}-func (_q *LabelQuery) querySpec() *sqlgraph.QuerySpec {- _spec := sqlgraph.NewQuerySpec(label.Table, label.Columns, sqlgraph.NewFieldSpec(label.FieldID, field.TypeUUID))+func (_q *TagQuery) querySpec() *sqlgraph.QuerySpec {+ _spec := sqlgraph.NewQuerySpec(tag.Table, tag.Columns, sqlgraph.NewFieldSpec(tag.FieldID, field.TypeUUID))_spec.From = _q.sqlif unique := _q.ctx.Unique; unique != nil {_spec.Unique = *unique@@ -568,9 +568,9 @@ func (_q *LabelQuery) querySpec() *sqlgraph.QuerySpec {}if fields := _q.ctx.Fields; len(fields) > 0 {_spec.Node.Columns = make([]string, 0, len(fields))- _spec.Node.Columns = append(_spec.Node.Columns, label.FieldID)+ _spec.Node.Columns = append(_spec.Node.Columns, tag.FieldID)for i := range fields {- if fields[i] != label.FieldID {+ if fields[i] != tag.FieldID {_spec.Node.Columns = append(_spec.Node.Columns, fields[i])}}@@ -598,12 +598,12 @@ func (_q *LabelQuery) querySpec() *sqlgraph.QuerySpec {return _spec}-func (_q *LabelQuery) sqlQuery(ctx context.Context) *sql.Selector {+func (_q *TagQuery) sqlQuery(ctx context.Context) *sql.Selector {builder := sql.Dialect(_q.driver.Dialect())- t1 := builder.Table(label.Table)+ t1 := builder.Table(tag.Table)columns := _q.ctx.Fieldsif len(columns) == 0 {- columns = label.Columns+ columns = tag.Columns}selector := builder.Select(t1.Columns(columns...)...).From(t1)if _q.sql != nil {@@ -630,28 +630,28 @@ func (_q *LabelQuery) sqlQuery(ctx context.Context) *sql.Selector {return selector}-// LabelGroupBy is the group-by builder for Label entities.-type LabelGroupBy struct {+// TagGroupBy is the group-by builder for Tag entities.+type TagGroupBy struct {selector- build *LabelQuery+ build *TagQuery}// Aggregate adds the given aggregation functions to the group-by query.-func (_g *LabelGroupBy) Aggregate(fns ...AggregateFunc) *LabelGroupBy {+func (_g *TagGroupBy) Aggregate(fns ...AggregateFunc) *TagGroupBy {_g.fns = append(_g.fns, fns...)return _g}// Scan applies the selector query and scans the result into the given value.-func (_g *LabelGroupBy) Scan(ctx context.Context, v any) error {+func (_g *TagGroupBy) Scan(ctx context.Context, v any) error {ctx = setContextOp(ctx, _g.build.ctx, ent.OpQueryGroupBy)if err := _g.build.prepareQuery(ctx); err != nil {return err}- return scanWithInterceptors[*LabelQuery, *LabelGroupBy](ctx, _g.build, _g, _g.build.inters, v)+ return scanWithInterceptors[*TagQuery, *TagGroupBy](ctx, _g.build, _g, _g.build.inters, v)}-func (_g *LabelGroupBy) sqlScan(ctx context.Context, root *LabelQuery, v any) error {+func (_g *TagGroupBy) sqlScan(ctx context.Context, root *TagQuery, v any) error {selector := root.sqlQuery(ctx).Select()aggregation := make([]string, 0, len(_g.fns))for _, fn := range _g.fns {@@ -678,28 +678,28 @@ func (_g *LabelGroupBy) sqlScan(ctx context.Context, root *LabelQuery, v any) erreturn sql.ScanSlice(rows, v)}-// LabelSelect is the builder for selecting fields of Label entities.-type LabelSelect struct {- *LabelQuery+// TagSelect is the builder for selecting fields of Tag entities.+type TagSelect struct {+ *TagQueryselector}// Aggregate adds the given aggregation functions to the selector query.-func (_s *LabelSelect) Aggregate(fns ...AggregateFunc) *LabelSelect {+func (_s *TagSelect) Aggregate(fns ...AggregateFunc) *TagSelect {_s.fns = append(_s.fns, fns...)return _s}// Scan applies the selector query and scans the result into the given value.-func (_s *LabelSelect) Scan(ctx context.Context, v any) error {+func (_s *TagSelect) Scan(ctx context.Context, v any) error {ctx = setContextOp(ctx, _s.ctx, ent.OpQuerySelect)if err := _s.prepareQuery(ctx); err != nil {return err}- return scanWithInterceptors[*LabelQuery, *LabelSelect](ctx, _s.LabelQuery, _s, _s.inters, v)+ return scanWithInterceptors[*TagQuery, *TagSelect](ctx, _s.TagQuery, _s, _s.inters, v)}-func (_s *LabelSelect) sqlScan(ctx context.Context, root *LabelQuery, v any) error {+func (_s *TagSelect) sqlScan(ctx context.Context, root *TagQuery, v any) error {selector := root.sqlQuery(ctx)aggregation := make([]string, 0, len(_s.fns))for _, fn := range _s.fns {diff --git a/backend/internal/data/ent/label_update.go b/backend/internal/data/ent/tag_update.gosimilarity index 65%rename from backend/internal/data/ent/label_update.gorename to backend/internal/data/ent/tag_update.goindex b9beb1ae..51879f59 100644--- a/backend/internal/data/ent/label_update.go+++ b/backend/internal/data/ent/tag_update.go@@ -14,37 +14,37 @@ import ("github.com/google/uuid""github.com/sysadminsmedia/homebox/backend/internal/data/ent/group""github.com/sysadminsmedia/homebox/backend/internal/data/ent/item"- "github.com/sysadminsmedia/homebox/backend/internal/data/ent/label""github.com/sysadminsmedia/homebox/backend/internal/data/ent/predicate"+ "github.com/sysadminsmedia/homebox/backend/internal/data/ent/tag")-// LabelUpdate is the builder for updating Label entities.-type LabelUpdate struct {+// TagUpdate is the builder for updating Tag entities.+type TagUpdate struct {confighooks []Hook- mutation *LabelMutation+ mutation *TagMutation}-// Where appends a list predicates to the LabelUpdate builder.-func (_u *LabelUpdate) Where(ps ...predicate.Label) *LabelUpdate {+// Where appends a list predicates to the TagUpdate builder.+func (_u *TagUpdate) Where(ps ...predicate.Tag) *TagUpdate {_u.mutation.Where(ps...)return _u}// SetUpdatedAt sets the "updated_at" field.-func (_u *LabelUpdate) SetUpdatedAt(v time.Time) *LabelUpdate {+func (_u *TagUpdate) SetUpdatedAt(v time.Time) *TagUpdate {_u.mutation.SetUpdatedAt(v)return _u}// SetName sets the "name" field.-func (_u *LabelUpdate) SetName(v string) *LabelUpdate {+func (_u *TagUpdate) SetName(v string) *TagUpdate {_u.mutation.SetName(v)return _u}// SetNillableName sets the "name" field if the given value is not nil.-func (_u *LabelUpdate) SetNillableName(v *string) *LabelUpdate {+func (_u *TagUpdate) SetNillableName(v *string) *TagUpdate {if v != nil {_u.SetName(*v)}@@ -52,13 +52,13 @@ func (_u *LabelUpdate) SetNillableName(v *string) *LabelUpdate {}// SetDescription sets the "description" field.-func (_u *LabelUpdate) SetDescription(v string) *LabelUpdate {+func (_u *TagUpdate) SetDescription(v string) *TagUpdate {_u.mutation.SetDescription(v)return _u}// SetNillableDescription sets the "description" field if the given value is not nil.-func (_u *LabelUpdate) SetNillableDescription(v *string) *LabelUpdate {+func (_u *TagUpdate) SetNillableDescription(v *string) *TagUpdate {if v != nil {_u.SetDescription(*v)}@@ -66,19 +66,19 @@ func (_u *LabelUpdate) SetNillableDescription(v *string) *LabelUpdate {}// ClearDescription clears the value of the "description" field.-func (_u *LabelUpdate) ClearDescription() *LabelUpdate {+func (_u *TagUpdate) ClearDescription() *TagUpdate {_u.mutation.ClearDescription()return _u}// SetColor sets the "color" field.-func (_u *LabelUpdate) SetColor(v string) *LabelUpdate {+func (_u *TagUpdate) SetColor(v string) *TagUpdate {_u.mutation.SetColor(v)return _u}// SetNillableColor sets the "color" field if the given value is not nil.-func (_u *LabelUpdate) SetNillableColor(v *string) *LabelUpdate {+func (_u *TagUpdate) SetNillableColor(v *string) *TagUpdate {if v != nil {_u.SetColor(*v)}@@ -86,30 +86,30 @@ func (_u *LabelUpdate) SetNillableColor(v *string) *LabelUpdate {}// ClearColor clears the value of the "color" field.-func (_u *LabelUpdate) ClearColor() *LabelUpdate {+func (_u *TagUpdate) ClearColor() *TagUpdate {_u.mutation.ClearColor()return _u}// SetGroupID sets the "group" edge to the Group entity by ID.-func (_u *LabelUpdate) SetGroupID(id uuid.UUID) *LabelUpdate {+func (_u *TagUpdate) SetGroupID(id uuid.UUID) *TagUpdate {_u.mutation.SetGroupID(id)return _u}// SetGroup sets the "group" edge to the Group entity.-func (_u *LabelUpdate) SetGroup(v *Group) *LabelUpdate {+func (_u *TagUpdate) SetGroup(v *Group) *TagUpdate {return _u.SetGroupID(v.ID)}// AddItemIDs adds the "items" edge to the Item entity by IDs.-func (_u *LabelUpdate) AddItemIDs(ids ...uuid.UUID) *LabelUpdate {+func (_u *TagUpdate) AddItemIDs(ids ...uuid.UUID) *TagUpdate {_u.mutation.AddItemIDs(ids...)return _u}// AddItems adds the "items" edges to the Item entity.-func (_u *LabelUpdate) AddItems(v ...*Item) *LabelUpdate {+func (_u *TagUpdate) AddItems(v ...*Item) *TagUpdate {ids := make([]uuid.UUID, len(v))for i := range v {ids[i] = v[i].ID@@ -117,31 +117,31 @@ func (_u *LabelUpdate) AddItems(v ...*Item) *LabelUpdate {return _u.AddItemIDs(ids...)}-// Mutation returns the LabelMutation object of the builder.-func (_u *LabelUpdate) Mutation() *LabelMutation {+// Mutation returns the TagMutation object of the builder.+func (_u *TagUpdate) Mutation() *TagMutation {return _u.mutation}// ClearGroup clears the "group" edge to the Group entity.-func (_u *LabelUpdate) ClearGroup() *LabelUpdate {+func (_u *TagUpdate) ClearGroup() *TagUpdate {_u.mutation.ClearGroup()return _u}// ClearItems clears all "items" edges to the Item entity.-func (_u *LabelUpdate) ClearItems() *LabelUpdate {+func (_u *TagUpdate) ClearItems() *TagUpdate {_u.mutation.ClearItems()return _u}// RemoveItemIDs removes the "items" edge to Item entities by IDs.-func (_u *LabelUpdate) RemoveItemIDs(ids ...uuid.UUID) *LabelUpdate {+func (_u *TagUpdate) RemoveItemIDs(ids ...uuid.UUID) *TagUpdate {_u.mutation.RemoveItemIDs(ids...)return _u}// RemoveItems removes "items" edges to Item entities.-func (_u *LabelUpdate) RemoveItems(v ...*Item) *LabelUpdate {+func (_u *TagUpdate) RemoveItems(v ...*Item) *TagUpdate {ids := make([]uuid.UUID, len(v))for i := range v {ids[i] = v[i].ID@@ -150,13 +150,13 @@ func (_u *LabelUpdate) RemoveItems(v ...*Item) *LabelUpdate {}// Save executes the query and returns the number of nodes affected by the update operation.-func (_u *LabelUpdate) Save(ctx context.Context) (int, error) {+func (_u *TagUpdate) Save(ctx context.Context) (int, error) {_u.defaults()return withHooks(ctx, _u.sqlSave, _u.mutation, _u.hooks)}// SaveX is like Save, but panics if an error occurs.-func (_u *LabelUpdate) SaveX(ctx context.Context) int {+func (_u *TagUpdate) SaveX(ctx context.Context) int {affected, err := _u.Save(ctx)if err != nil {panic(err)@@ -165,54 +165,54 @@ func (_u *LabelUpdate) SaveX(ctx context.Context) int {}// Exec executes the query.-func (_u *LabelUpdate) Exec(ctx context.Context) error {+func (_u *TagUpdate) Exec(ctx context.Context) error {_, err := _u.Save(ctx)return err}// ExecX is like Exec, but panics if an error occurs.-func (_u *LabelUpdate) ExecX(ctx context.Context) {+func (_u *TagUpdate) ExecX(ctx context.Context) {if err := _u.Exec(ctx); err != nil {panic(err)}}// defaults sets the default values of the builder before save.-func (_u *LabelUpdate) defaults() {+func (_u *TagUpdate) defaults() {if _, ok := _u.mutation.UpdatedAt(); !ok {- v := label.UpdateDefaultUpdatedAt()+ v := tag.UpdateDefaultUpdatedAt()_u.mutation.SetUpdatedAt(v)}}// check runs all checks and user-defined validators on the builder.-func (_u *LabelUpdate) check() error {+func (_u *TagUpdate) check() error {if v, ok := _u.mutation.Name(); ok {- if err := label.NameValidator(v); err != nil {- return &ValidationError{Name: "name", err: fmt.Errorf(`ent: validator failed for field "Label.name": %w`, err)}+ if err := tag.NameValidator(v); err != nil {+ return &ValidationError{Name: "name", err: fmt.Errorf(`ent: validator failed for field "Tag.name": %w`, err)}}}if v, ok := _u.mutation.Description(); ok {- if err := label.DescriptionValidator(v); err != nil {- return &ValidationError{Name: "description", err: fmt.Errorf(`ent: validator failed for field "Label.description": %w`, err)}+ if err := tag.DescriptionValidator(v); err != nil {+ return &ValidationError{Name: "description", err: fmt.Errorf(`ent: validator failed for field "Tag.description": %w`, err)}}}if v, ok := _u.mutation.Color(); ok {- if err := label.ColorValidator(v); err != nil {- return &ValidationError{Name: "color", err: fmt.Errorf(`ent: validator failed for field "Label.color": %w`, err)}+ if err := tag.ColorValidator(v); err != nil {+ return &ValidationError{Name: "color", err: fmt.Errorf(`ent: validator failed for field "Tag.color": %w`, err)}}}if _u.mutation.GroupCleared() && len(_u.mutation.GroupIDs()) > 0 {- return errors.New(`ent: clearing a required unique edge "Label.group"`)+ return errors.New(`ent: clearing a required unique edge "Tag.group"`)}return nil}-func (_u *LabelUpdate) sqlSave(ctx context.Context) (_node int, err error) {+func (_u *TagUpdate) sqlSave(ctx context.Context) (_node int, err error) {if err := _u.check(); err != nil {return _node, err}- _spec := sqlgraph.NewUpdateSpec(label.Table, label.Columns, sqlgraph.NewFieldSpec(label.FieldID, field.TypeUUID))+ _spec := sqlgraph.NewUpdateSpec(tag.Table, tag.Columns, sqlgraph.NewFieldSpec(tag.FieldID, field.TypeUUID))if ps := _u.mutation.predicates; len(ps) > 0 {_spec.Predicate = func(selector *sql.Selector) {for i := range ps {@@ -221,29 +221,29 @@ func (_u *LabelUpdate) sqlSave(ctx context.Context) (_node int, err error) {}}if value, ok := _u.mutation.UpdatedAt(); ok {- _spec.SetField(label.FieldUpdatedAt, field.TypeTime, value)+ _spec.SetField(tag.FieldUpdatedAt, field.TypeTime, value)}if value, ok := _u.mutation.Name(); ok {- _spec.SetField(label.FieldName, field.TypeString, value)+ _spec.SetField(tag.FieldName, field.TypeString, value)}if value, ok := _u.mutation.Description(); ok {- _spec.SetField(label.FieldDescription, field.TypeString, value)+ _spec.SetField(tag.FieldDescription, field.TypeString, value)}if _u.mutation.DescriptionCleared() {- _spec.ClearField(label.FieldDescription, field.TypeString)+ _spec.ClearField(tag.FieldDescription, field.TypeString)}if value, ok := _u.mutation.Color(); ok {- _spec.SetField(label.FieldColor, field.TypeString, value)+ _spec.SetField(tag.FieldColor, field.TypeString, value)}if _u.mutation.ColorCleared() {- _spec.ClearField(label.FieldColor, field.TypeString)+ _spec.ClearField(tag.FieldColor, field.TypeString)}if _u.mutation.GroupCleared() {edge := &sqlgraph.EdgeSpec{Rel: sqlgraph.M2O,Inverse: true,- Table: label.GroupTable,- Columns: []string{label.GroupColumn},+ Table: tag.GroupTable,+ Columns: []string{tag.GroupColumn},Bidi: false,Target: &sqlgraph.EdgeTarget{IDSpec: sqlgraph.NewFieldSpec(group.FieldID, field.TypeUUID),@@ -255,8 +255,8 @@ func (_u *LabelUpdate) sqlSave(ctx context.Context) (_node int, err error) {edge := &sqlgraph.EdgeSpec{Rel: sqlgraph.M2O,Inverse: true,- Table: label.GroupTable,- Columns: []string{label.GroupColumn},+ Table: tag.GroupTable,+ Columns: []string{tag.GroupColumn},Bidi: false,Target: &sqlgraph.EdgeTarget{IDSpec: sqlgraph.NewFieldSpec(group.FieldID, field.TypeUUID),@@ -271,8 +271,8 @@ func (_u *LabelUpdate) sqlSave(ctx context.Context) (_node int, err error) {edge := &sqlgraph.EdgeSpec{Rel: sqlgraph.M2M,Inverse: false,- Table: label.ItemsTable,- Columns: label.ItemsPrimaryKey,+ Table: tag.ItemsTable,+ Columns: tag.ItemsPrimaryKey,Bidi: false,Target: &sqlgraph.EdgeTarget{IDSpec: sqlgraph.NewFieldSpec(item.FieldID, field.TypeUUID),@@ -284,8 +284,8 @@ func (_u *LabelUpdate) sqlSave(ctx context.Context) (_node int, err error) {edge := &sqlgraph.EdgeSpec{Rel: sqlgraph.M2M,Inverse: false,- Table: label.ItemsTable,- Columns: label.ItemsPrimaryKey,+ Table: tag.ItemsTable,+ Columns: tag.ItemsPrimaryKey,Bidi: false,Target: &sqlgraph.EdgeTarget{IDSpec: sqlgraph.NewFieldSpec(item.FieldID, field.TypeUUID),@@ -300,8 +300,8 @@ func (_u *LabelUpdate) sqlSave(ctx context.Context) (_node int, err error) {edge := &sqlgraph.EdgeSpec{Rel: sqlgraph.M2M,Inverse: false,- Table: label.ItemsTable,- Columns: label.ItemsPrimaryKey,+ Table: tag.ItemsTable,+ Columns: tag.ItemsPrimaryKey,Bidi: false,Target: &sqlgraph.EdgeTarget{IDSpec: sqlgraph.NewFieldSpec(item.FieldID, field.TypeUUID),@@ -314,7 +314,7 @@ func (_u *LabelUpdate) sqlSave(ctx context.Context) (_node int, err error) {}if _node, err = sqlgraph.UpdateNodes(ctx, _u.driver, _spec); err != nil {if _, ok := err.(*sqlgraph.NotFoundError); ok {- err = &NotFoundError{label.Label}+ err = &NotFoundError{tag.Label}} else if sqlgraph.IsConstraintError(err) {err = &ConstraintError{msg: err.Error(), wrap: err}}@@ -324,28 +324,28 @@ func (_u *LabelUpdate) sqlSave(ctx context.Context) (_node int, err error) {return _node, nil}-// LabelUpdateOne is the builder for updating a single Label entity.-type LabelUpdateOne struct {+// TagUpdateOne is the builder for updating a single Tag entity.+type TagUpdateOne struct {configfields []stringhooks []Hook- mutation *LabelMutation+ mutation *TagMutation}// SetUpdatedAt sets the "updated_at" field.-func (_u *LabelUpdateOne) SetUpdatedAt(v time.Time) *LabelUpdateOne {+func (_u *TagUpdateOne) SetUpdatedAt(v time.Time) *TagUpdateOne {_u.mutation.SetUpdatedAt(v)return _u}// SetName sets the "name" field.-func (_u *LabelUpdateOne) SetName(v string) *LabelUpdateOne {+func (_u *TagUpdateOne) SetName(v string) *TagUpdateOne {_u.mutation.SetName(v)return _u}// SetNillableName sets the "name" field if the given value is not nil.-func (_u *LabelUpdateOne) SetNillableName(v *string) *LabelUpdateOne {+func (_u *TagUpdateOne) SetNillableName(v *string) *TagUpdateOne {if v != nil {_u.SetName(*v)}@@ -353,13 +353,13 @@ func (_u *LabelUpdateOne) SetNillableName(v *string) *LabelUpdateOne {}// SetDescription sets the "description" field.-func (_u *LabelUpdateOne) SetDescription(v string) *LabelUpdateOne {+func (_u *TagUpdateOne) SetDescription(v string) *TagUpdateOne {_u.mutation.SetDescription(v)return _u}// SetNillableDescription sets the "description" field if the given value is not nil.-func (_u *LabelUpdateOne) SetNillableDescription(v *string) *LabelUpdateOne {+func (_u *TagUpdateOne) SetNillableDescription(v *string) *TagUpdateOne {if v != nil {_u.SetDescription(*v)}@@ -367,19 +367,19 @@ func (_u *LabelUpdateOne) SetNillableDescription(v *string) *LabelUpdateOne {}// ClearDescription clears the value of the "description" field.-func (_u *LabelUpdateOne) ClearDescription() *LabelUpdateOne {+func (_u *TagUpdateOne) ClearDescription() *TagUpdateOne {_u.mutation.ClearDescription()return _u}// SetColor sets the "color" field.-func (_u *LabelUpdateOne) SetColor(v string) *LabelUpdateOne {+func (_u *TagUpdateOne) SetColor(v string) *TagUpdateOne {_u.mutation.SetColor(v)return _u}// SetNillableColor sets the "color" field if the given value is not nil.-func (_u *LabelUpdateOne) SetNillableColor(v *string) *LabelUpdateOne {+func (_u *TagUpdateOne) SetNillableColor(v *string) *TagUpdateOne {if v != nil {_u.SetColor(*v)}@@ -387,30 +387,30 @@ func (_u *LabelUpdateOne) SetNillableColor(v *string) *LabelUpdateOne {}// ClearColor clears the value of the "color" field.-func (_u *LabelUpdateOne) ClearColor() *LabelUpdateOne {+func (_u *TagUpdateOne) ClearColor() *TagUpdateOne {_u.mutation.ClearColor()return _u}// SetGroupID sets the "group" edge to the Group entity by ID.-func (_u *LabelUpdateOne) SetGroupID(id uuid.UUID) *LabelUpdateOne {+func (_u *TagUpdateOne) SetGroupID(id uuid.UUID) *TagUpdateOne {_u.mutation.SetGroupID(id)return _u}// SetGroup sets the "group" edge to the Group entity.-func (_u *LabelUpdateOne) SetGroup(v *Group) *LabelUpdateOne {+func (_u *TagUpdateOne) SetGroup(v *Group) *TagUpdateOne {return _u.SetGroupID(v.ID)}// AddItemIDs adds the "items" edge to the Item entity by IDs.-func (_u *LabelUpdateOne) AddItemIDs(ids ...uuid.UUID) *LabelUpdateOne {+func (_u *TagUpdateOne) AddItemIDs(ids ...uuid.UUID) *TagUpdateOne {_u.mutation.AddItemIDs(ids...)return _u}// AddItems adds the "items" edges to the Item entity.-func (_u *LabelUpdateOne) AddItems(v ...*Item) *LabelUpdateOne {+func (_u *TagUpdateOne) AddItems(v ...*Item) *TagUpdateOne {ids := make([]uuid.UUID, len(v))for i := range v {ids[i] = v[i].ID@@ -418,31 +418,31 @@ func (_u *LabelUpdateOne) AddItems(v ...*Item) *LabelUpdateOne {return _u.AddItemIDs(ids...)}-// Mutation returns the LabelMutation object of the builder.-func (_u *LabelUpdateOne) Mutation() *LabelMutation {+// Mutation returns the TagMutation object of the builder.+func (_u *TagUpdateOne) Mutation() *TagMutation {return _u.mutation}// ClearGroup clears the "group" edge to the Group entity.-func (_u *LabelUpdateOne) ClearGroup() *LabelUpdateOne {+func (_u *TagUpdateOne) ClearGroup() *TagUpdateOne {_u.mutation.ClearGroup()return _u}// ClearItems clears all "items" edges to the Item entity.-func (_u *LabelUpdateOne) ClearItems() *LabelUpdateOne {+func (_u *TagUpdateOne) ClearItems() *TagUpdateOne {_u.mutation.ClearItems()return _u}// RemoveItemIDs removes the "items" edge to Item entities by IDs.-func (_u *LabelUpdateOne) RemoveItemIDs(ids ...uuid.UUID) *LabelUpdateOne {+func (_u *TagUpdateOne) RemoveItemIDs(ids ...uuid.UUID) *TagUpdateOne {_u.mutation.RemoveItemIDs(ids...)return _u}// RemoveItems removes "items" edges to Item entities.-func (_u *LabelUpdateOne) RemoveItems(v ...*Item) *LabelUpdateOne {+func (_u *TagUpdateOne) RemoveItems(v ...*Item) *TagUpdateOne {ids := make([]uuid.UUID, len(v))for i := range v {ids[i] = v[i].ID@@ -450,27 +450,27 @@ func (_u *LabelUpdateOne) RemoveItems(v ...*Item) *LabelUpdateOne {return _u.RemoveItemIDs(ids...)}-// Where appends a list predicates to the LabelUpdate builder.-func (_u *LabelUpdateOne) Where(ps ...predicate.Label) *LabelUpdateOne {+// Where appends a list predicates to the TagUpdate builder.+func (_u *TagUpdateOne) Where(ps ...predicate.Tag) *TagUpdateOne {_u.mutation.Where(ps...)return _u}// Select allows selecting one or more fields (columns) of the returned entity.// The default is selecting all fields defined in the entity schema.-func (_u *LabelUpdateOne) Select(field string, fields ...string) *LabelUpdateOne {+func (_u *TagUpdateOne) Select(field string, fields ...string) *TagUpdateOne {_u.fields = append([]string{field}, fields...)return _u}-// Save executes the query and returns the updated Label entity.-func (_u *LabelUpdateOne) Save(ctx context.Context) (*Label, error) {+// Save executes the query and returns the updated Tag entity.+func (_u *TagUpdateOne) Save(ctx context.Context) (*Tag, error) {_u.defaults()return withHooks(ctx, _u.sqlSave, _u.mutation, _u.hooks)}// SaveX is like Save, but panics if an error occurs.-func (_u *LabelUpdateOne) SaveX(ctx context.Context) *Label {+func (_u *TagUpdateOne) SaveX(ctx context.Context) *Tag {node, err := _u.Save(ctx)if err != nil {panic(err)@@ -479,67 +479,67 @@ func (_u *LabelUpdateOne) SaveX(ctx context.Context) *Label {}// Exec executes the query on the entity.-func (_u *LabelUpdateOne) Exec(ctx context.Context) error {+func (_u *TagUpdateOne) Exec(ctx context.Context) error {_, err := _u.Save(ctx)return err}// ExecX is like Exec, but panics if an error occurs.-func (_u *LabelUpdateOne) ExecX(ctx context.Context) {+func (_u *TagUpdateOne) ExecX(ctx context.Context) {if err := _u.Exec(ctx); err != nil {panic(err)}}// defaults sets the default values of the builder before save.-func (_u *LabelUpdateOne) defaults() {+func (_u *TagUpdateOne) defaults() {if _, ok := _u.mutation.UpdatedAt(); !ok {- v := label.UpdateDefaultUpdatedAt()+ v := tag.UpdateDefaultUpdatedAt()_u.mutation.SetUpdatedAt(v)}}// check runs all checks and user-defined validators on the builder.-func (_u *LabelUpdateOne) check() error {+func (_u *TagUpdateOne) check() error {if v, ok := _u.mutation.Name(); ok {- if err := label.NameValidator(v); err != nil {- return &ValidationError{Name: "name", err: fmt.Errorf(`ent: validator failed for field "Label.name": %w`, err)}+ if err := tag.NameValidator(v); err != nil {+ return &ValidationError{Name: "name", err: fmt.Errorf(`ent: validator failed for field "Tag.name": %w`, err)}}}if v, ok := _u.mutation.Description(); ok {- if err := label.DescriptionValidator(v); err != nil {- return &ValidationError{Name: "description", err: fmt.Errorf(`ent: validator failed for field "Label.description": %w`, err)}+ if err := tag.DescriptionValidator(v); err != nil {+ return &ValidationError{Name: "description", err: fmt.Errorf(`ent: validator failed for field "Tag.description": %w`, err)}}}if v, ok := _u.mutation.Color(); ok {- if err := label.ColorValidator(v); err != nil {- return &ValidationError{Name: "color", err: fmt.Errorf(`ent: validator failed for field "Label.color": %w`, err)}+ if err := tag.ColorValidator(v); err != nil {+ return &ValidationError{Name: "color", err: fmt.Errorf(`ent: validator failed for field "Tag.color": %w`, err)}}}if _u.mutation.GroupCleared() && len(_u.mutation.GroupIDs()) > 0 {- return errors.New(`ent: clearing a required unique edge "Label.group"`)+ return errors.New(`ent: clearing a required unique edge "Tag.group"`)}return nil}-func (_u *LabelUpdateOne) sqlSave(ctx context.Context) (_node *Label, err error) {+func (_u *TagUpdateOne) sqlSave(ctx context.Context) (_node *Tag, err error) {if err := _u.check(); err != nil {return _node, err}- _spec := sqlgraph.NewUpdateSpec(label.Table, label.Columns, sqlgraph.NewFieldSpec(label.FieldID, field.TypeUUID))+ _spec := sqlgraph.NewUpdateSpec(tag.Table, tag.Columns, sqlgraph.NewFieldSpec(tag.FieldID, field.TypeUUID))id, ok := _u.mutation.ID()if !ok {- return nil, &ValidationError{Name: "id", err: errors.New(`ent: missing "Label.id" for update`)}+ return nil, &ValidationError{Name: "id", err: errors.New(`ent: missing "Tag.id" for update`)}}_spec.Node.ID.Value = idif fields := _u.fields; len(fields) > 0 {_spec.Node.Columns = make([]string, 0, len(fields))- _spec.Node.Columns = append(_spec.Node.Columns, label.FieldID)+ _spec.Node.Columns = append(_spec.Node.Columns, tag.FieldID)for _, f := range fields {- if !label.ValidColumn(f) {+ if !tag.ValidColumn(f) {return nil, &ValidationError{Name: f, err: fmt.Errorf("ent: invalid field %q for query", f)}}- if f != label.FieldID {+ if f != tag.FieldID {_spec.Node.Columns = append(_spec.Node.Columns, f)}}@@ -552,29 +552,29 @@ func (_u *LabelUpdateOne) sqlSave(ctx context.Context) (_node *Label, err error)}}if value, ok := _u.mutation.UpdatedAt(); ok {- _spec.SetField(label.FieldUpdatedAt, field.TypeTime, value)+ _spec.SetField(tag.FieldUpdatedAt, field.TypeTime, value)}if value, ok := _u.mutation.Name(); ok {- _spec.SetField(label.FieldName, field.TypeString, value)+ _spec.SetField(tag.FieldName, field.TypeString, value)}if value, ok := _u.mutation.Description(); ok {- _spec.SetField(label.FieldDescription, field.TypeString, value)+ _spec.SetField(tag.FieldDescription, field.TypeString, value)}if _u.mutation.DescriptionCleared() {- _spec.ClearField(label.FieldDescription, field.TypeString)+ _spec.ClearField(tag.FieldDescription, field.TypeString)}if value, ok := _u.mutation.Color(); ok {- _spec.SetField(label.FieldColor, field.TypeString, value)+ _spec.SetField(tag.FieldColor, field.TypeString, value)}if _u.mutation.ColorCleared() {- _spec.ClearField(label.FieldColor, field.TypeString)+ _spec.ClearField(tag.FieldColor, field.TypeString)}if _u.mutation.GroupCleared() {edge := &sqlgraph.EdgeSpec{Rel: sqlgraph.M2O,Inverse: true,- Table: label.GroupTable,- Columns: []string{label.GroupColumn},+ Table: tag.GroupTable,+ Columns: []string{tag.GroupColumn},Bidi: false,Target: &sqlgraph.EdgeTarget{IDSpec: sqlgraph.NewFieldSpec(group.FieldID, field.TypeUUID),@@ -586,8 +586,8 @@ func (_u *LabelUpdateOne) sqlSave(ctx context.Context) (_node *Label, err error)edge := &sqlgraph.EdgeSpec{Rel: sqlgraph.M2O,Inverse: true,- Table: label.GroupTable,- Columns: []string{label.GroupColumn},+ Table: tag.GroupTable,+ Columns: []string{tag.GroupColumn},Bidi: false,Target: &sqlgraph.EdgeTarget{IDSpec: sqlgraph.NewFieldSpec(group.FieldID, field.TypeUUID),@@ -602,8 +602,8 @@ func (_u *LabelUpdateOne) sqlSave(ctx context.Context) (_node *Label, err error)edge := &sqlgraph.EdgeSpec{Rel: sqlgraph.M2M,Inverse: false,- Table: label.ItemsTable,- Columns: label.ItemsPrimaryKey,+ Table: tag.ItemsTable,+ Columns: tag.ItemsPrimaryKey,Bidi: false,Target: &sqlgraph.EdgeTarget{IDSpec: sqlgraph.NewFieldSpec(item.FieldID, field.TypeUUID),@@ -615,8 +615,8 @@ func (_u *LabelUpdateOne) sqlSave(ctx context.Context) (_node *Label, err error)edge := &sqlgraph.EdgeSpec{Rel: sqlgraph.M2M,Inverse: false,- Table: label.ItemsTable,- Columns: label.ItemsPrimaryKey,+ Table: tag.ItemsTable,+ Columns: tag.ItemsPrimaryKey,Bidi: false,Target: &sqlgraph.EdgeTarget{IDSpec: sqlgraph.NewFieldSpec(item.FieldID, field.TypeUUID),@@ -631,8 +631,8 @@ func (_u *LabelUpdateOne) sqlSave(ctx context.Context) (_node *Label, err error)edge := &sqlgraph.EdgeSpec{Rel: sqlgraph.M2M,Inverse: false,- Table: label.ItemsTable,- Columns: label.ItemsPrimaryKey,+ Table: tag.ItemsTable,+ Columns: tag.ItemsPrimaryKey,Bidi: false,Target: &sqlgraph.EdgeTarget{IDSpec: sqlgraph.NewFieldSpec(item.FieldID, field.TypeUUID),@@ -643,12 +643,12 @@ func (_u *LabelUpdateOne) sqlSave(ctx context.Context) (_node *Label, err error)}_spec.Edges.Add = append(_spec.Edges.Add, edge)}- _node = &Label{config: _u.config}+ _node = &Tag{config: _u.config}_spec.Assign = _node.assignValues_spec.ScanValues = _node.scanValuesif err = sqlgraph.UpdateNode(ctx, _u.driver, _spec); err != nil {if _, ok := err.(*sqlgraph.NotFoundError); ok {- err = &NotFoundError{label.Label}+ err = &NotFoundError{tag.Label}} else if sqlgraph.IsConstraintError(err) {err = &ConstraintError{msg: err.Error(), wrap: err}}diff --git a/backend/internal/data/ent/tx.go b/backend/internal/data/ent/tx.goindex f8561a0b..bc3eac6a 100644--- a/backend/internal/data/ent/tx.go+++ b/backend/internal/data/ent/tx.go@@ -28,14 +28,14 @@ type Tx struct {ItemField *ItemFieldClient// ItemTemplate is the client for interacting with the ItemTemplate builders.ItemTemplate *ItemTemplateClient- // Label is the client for interacting with the Label builders.- Label *LabelClient// Location is the client for interacting with the Location builders.Location *LocationClient// MaintenanceEntry is the client for interacting with the MaintenanceEntry builders.MaintenanceEntry *MaintenanceEntryClient// Notifier is the client for interacting with the Notifier builders.Notifier *NotifierClient+ // Tag is the client for interacting with the Tag builders.+ Tag *TagClient// TemplateField is the client for interacting with the TemplateField builders.TemplateField *TemplateFieldClient// User is the client for interacting with the User builders.@@ -179,10 +179,10 @@ func (tx *Tx) init() {tx.Item = NewItemClient(tx.config)tx.ItemField = NewItemFieldClient(tx.config)tx.ItemTemplate = NewItemTemplateClient(tx.config)- tx.Label = NewLabelClient(tx.config)tx.Location = NewLocationClient(tx.config)tx.MaintenanceEntry = NewMaintenanceEntryClient(tx.config)tx.Notifier = NewNotifierClient(tx.config)+ tx.Tag = NewTagClient(tx.config)tx.TemplateField = NewTemplateFieldClient(tx.config)tx.User = NewUserClient(tx.config)}diff --git a/backend/internal/data/migrations/postgres/20251228214900_rename_labels_to_tags.sql b/backend/internal/data/migrations/postgres/20251228214900_rename_labels_to_tags.sqlnew file mode 100644index 00000000..1c2edb86--- /dev/null+++ b/backend/internal/data/migrations/postgres/20251228214900_rename_labels_to_tags.sql@@ -0,0 +1,6 @@+-- +goose Up+ALTER TABLE labels RENAME TO tags;+ALTER TABLE label_items RENAME TO tag_items;+ALTER TABLE tag_items RENAME COLUMN label_id TO tag_id;+ALTER TABLE tags RENAME COLUMN group_labels TO group_tags;+ALTER TABLE item_templates RENAME COLUMN default_label_ids TO default_tag_ids;\ No newline at end of filediff --git a/backend/internal/data/migrations/sqlite3/20251228214900_rename_labels_to_tags.sql b/backend/internal/data/migrations/sqlite3/20251228214900_rename_labels_to_tags.sqlnew file mode 100644index 00000000..5945a5ae--- /dev/null+++ b/backend/internal/data/migrations/sqlite3/20251228214900_rename_labels_to_tags.sql@@ -0,0 +1,100 @@+-- +goose Up+-- +goose no transaction+PRAGMA foreign_keys=off;++CREATE TABLE IF NOT EXISTS tags (+ id uuid not null+ primary key,+ created_at datetime not null,+ updated_at datetime not null,+ name text not null,+ description text,+ color text,+ group_tags uuid not null+ constraint tags_groups_tags+ references groups+ on delete cascade+);++INSERT INTO tags(id, created_at, updated_at, name, description, color, group_tags)+SELECT id, created_at, updated_at, name, description, color, group_labels FROM labels;++DROP TABLE labels;+++CREATE TABLE IF NOT EXISTS tag_items (+ tag_id uuid not null+ constraint tag_items_tag_id+ references tags+ on delete cascade,+ item_id uuid not null+ constraint tag_items_item_id+ references items+ on delete cascade,+ primary key (tag_id, item_id)+);++INSERT INTO tag_items(tag_id, item_id)+SELECT label_id, item_id FROM label_items;++DROP TABLE IF EXISTS label_items;+++CREATE TABLE IF NOT EXISTS item_templates_temp+(+ id uuid not null+ primary key,+ created_at datetime not null,+ updated_at datetime not null,+ name text not null,+ description text,+ notes text,+ default_quantity integer default 1 not null,+ default_insured bool default false not null,+ default_name text,+ default_description text,+ default_manufacturer text,+ default_model_number text,+ default_lifetime_warranty bool default false not null,+ default_warranty_details text,+ include_warranty_fields bool default false not null,+ include_purchase_fields bool default false not null,+ include_sold_fields bool default false not null,+ default_tag_ids json,+ item_template_location uuid+ references locations(id)+ on delete set null,+ group_item_templates uuid not null+ constraint item_templates_groups_item_templates+ references groups+ on delete cascade+);++CREATE TABLE IF NOT EXISTS template_fields_temp+(+ id uuid not null+ primary key,+ created_at datetime not null,+ updated_at datetime not null,+ name text not null,+ description text,+ type text not null,+ text_value text,+ item_template_fields uuid+ constraint template_fields_item_templates_fields+ references item_templates_temp+ on delete cascade+);++INSERT INTO item_templates_temp(id, created_at, updated_at, name, description, notes, default_quantity, default_insured, default_name, default_description, default_manufacturer, default_model_number, default_lifetime_warranty, default_warranty_details, include_warranty_fields, include_purchase_fields, include_sold_fields, default_tag_ids, item_template_location, group_item_templates)+SELECT id, created_at, updated_at, name, description, notes, default_quantity, default_insured, default_name, default_description, default_manufacturer, default_model_number, default_lifetime_warranty, default_warranty_details, include_warranty_fields, include_purchase_fields, include_sold_fields, default_label_ids, item_template_location, group_item_templates FROM item_templates;++INSERT INTO template_fields_temp(id, created_at, updated_at, name, description, type, text_value, item_template_fields)+SELECT id, created_at, updated_at, name, description, type, text_value, item_template_fields FROM template_fields;++DROP TABLE IF EXISTS template_fields;+DROP TABLE IF EXISTS item_templates;+ALTER TABLE item_templates_temp RENAME TO item_templates;+ALTER TABLE template_fields_temp RENAME TO template_fields;++PRAGMA foreign_keys=on;\ No newline at end of filediff --git a/backend/internal/data/repo/repo_group.go b/backend/internal/data/repo/repo_group.goindex 3a42174e..4a1ff642 100644--- a/backend/internal/data/repo/repo_group.go+++ b/backend/internal/data/repo/repo_group.go@@ -13,7 +13,7 @@ import ("github.com/sysadminsmedia/homebox/backend/internal/data/ent/group""github.com/sysadminsmedia/homebox/backend/internal/data/ent/groupinvitationtoken""github.com/sysadminsmedia/homebox/backend/internal/data/ent/item"- "github.com/sysadminsmedia/homebox/backend/internal/data/ent/label"+ "github.com/sysadminsmedia/homebox/backend/internal/data/ent/tag""github.com/sysadminsmedia/homebox/backend/internal/data/ent/location""github.com/sysadminsmedia/homebox/backend/internal/data/ent/notifier""github.com/sysadminsmedia/homebox/backend/internal/data/ent/user"@@ -84,7 +84,7 @@ type (TotalUsers int `json:"totalUsers"`TotalItems int `json:"totalItems"`TotalLocations int `json:"totalLocations"`- TotalLabels int `json:"totalLabels"`+ TotalTags int `json:"totalTags"`TotalItemPrice float64 `json:"totalItemPrice"`TotalWithWarranty int `json:"totalWithWarranty"`}@@ -140,21 +140,21 @@ func (r *GroupRepository) StatsLocationsByPurchasePrice(ctx context.Context, gidreturn v, err}-func (r *GroupRepository) StatsLabelsByPurchasePrice(ctx context.Context, gid uuid.UUID) ([]TotalsByOrganizer, error) {+func (r *GroupRepository) StatsTagsByPurchasePrice(ctx context.Context, gid uuid.UUID) ([]TotalsByOrganizer, error) {var v []TotalsByOrganizer- err := r.db.Label.Query().+ err := r.db.Tag.Query().Where(- label.HasGroupWith(group.ID(gid)),+ tag.HasGroupWith(group.ID(gid)),).- GroupBy(label.FieldID, label.FieldName).+ GroupBy(tag.FieldID, tag.FieldName).Aggregate(func(sq *sql.Selector) string {itemTable := sql.Table(item.Table)- jt := sql.Table(label.ItemsTable)+ jt := sql.Table(tag.ItemsTable)- sq.Join(jt).On(sq.C(label.FieldID), jt.C(label.ItemsPrimaryKey[0]))- sq.Join(itemTable).On(jt.C(label.ItemsPrimaryKey[1]), itemTable.C(item.FieldID))+ sq.Join(jt).On(sq.C(tag.FieldID), jt.C(tag.ItemsPrimaryKey[0]))+ sq.Join(itemTable).On(jt.C(tag.ItemsPrimaryKey[1]), itemTable.C(item.FieldID))return sql.As(sql.Sum(itemTable.C(item.FieldPurchasePrice)), "total")}).@@ -235,7 +235,7 @@ func (r *GroupRepository) StatsGroup(ctx context.Context, gid uuid.UUID) (GroupS(SELECT COUNT(*) FROM user_groups WHERE group_id = $2) AS total_users,(SELECT COUNT(*) FROM items WHERE group_items = $2 AND items.archived = false) AS total_items,(SELECT COUNT(*) FROM locations WHERE group_locations = $2) AS total_locations,- (SELECT COUNT(*) FROM labels WHERE group_labels = $2) AS total_labels,+ (SELECT COUNT(*) FROM tags WHERE group_tags = $2) AS total_tags,(SELECT SUM(purchase_price*quantity) FROM items WHERE group_items = $2 AND items.archived = false) AS total_item_price,(SELECT COUNT(*)FROM items@@ -250,7 +250,7 @@ func (r *GroupRepository) StatsGroup(ctx context.Context, gid uuid.UUID) (GroupSvar maybeTotalItemPrice *float64var maybeTotalWithWarranty *int- err := row.Scan(&stats.TotalUsers, &stats.TotalItems, &stats.TotalLocations, &stats.TotalLabels, &maybeTotalItemPrice, &maybeTotalWithWarranty)+ err := row.Scan(&stats.TotalUsers, &stats.TotalItems, &stats.TotalLocations, &stats.TotalTags, &maybeTotalItemPrice, &maybeTotalWithWarranty)if err != nil {return GroupStatistics{}, err}diff --git a/backend/internal/data/repo/repo_group_test.go b/backend/internal/data/repo/repo_group_test.goindex 3ea48cf5..644c39f3 100644--- a/backend/internal/data/repo/repo_group_test.go+++ b/backend/internal/data/repo/repo_group_test.go@@ -60,13 +60,13 @@ func Test_Group_Update(t *testing.T) {// TODO: Fix this test at some point, the data itself in production/development is working fine, it only fails on the test/*func Test_Group_GroupStatistics(t *testing.T) {useItems(t, 20)- useLabels(t, 20)+ useTags(t, 20)stats, err := tRepos.Groups.StatsGroup(context.Background(), tGroup.ID)require.NoError(t, err)assert.Equal(t, 20, stats.TotalItems)- assert.Equal(t, 20, stats.TotalLabels)+ assert.Equal(t, 20, stats.TotalTags)assert.Equal(t, 1, stats.TotalUsers)assert.Equal(t, 1, stats.TotalLocations)}*/diff --git a/backend/internal/data/repo/repo_item_templates.go b/backend/internal/data/repo/repo_item_templates.goindex 4b64904a..6eae7ca8 100644--- a/backend/internal/data/repo/repo_item_templates.go+++ b/backend/internal/data/repo/repo_item_templates.go@@ -10,7 +10,7 @@ import ("github.com/sysadminsmedia/homebox/backend/internal/data/ent""github.com/sysadminsmedia/homebox/backend/internal/data/ent/group""github.com/sysadminsmedia/homebox/backend/internal/data/ent/itemtemplate"- "github.com/sysadminsmedia/homebox/backend/internal/data/ent/label"+ "github.com/sysadminsmedia/homebox/backend/internal/data/ent/tag""github.com/sysadminsmedia/homebox/backend/internal/data/ent/templatefield")@@ -27,7 +27,7 @@ type (TextValue string `json:"textValue"`}- TemplateLabelSummary struct {+ TemplateTagSummary struct {ID uuid.UUID `json:"id"`Name string `json:"name"`}@@ -52,9 +52,9 @@ type (DefaultLifetimeWarranty bool `json:"defaultLifetimeWarranty"`DefaultWarrantyDetails *string `json:"defaultWarrantyDetails,omitempty" validate:"omitempty,max=1000" extensions:"x-nullable"`- // Default location and labels+ // Default location and tagsDefaultLocationID uuid.UUID `json:"defaultLocationId,omitempty" extensions:"x-nullable"`- DefaultLabelIDs *[]uuid.UUID `json:"defaultLabelIds,omitempty" extensions:"x-nullable"`+ DefaultTagIDs *[]uuid.UUID `json:"defaultTagIds,omitempty" extensions:"x-nullable"`// Metadata flagsIncludeWarrantyFields bool `json:"includeWarrantyFields"`@@ -81,9 +81,9 @@ type (DefaultLifetimeWarranty bool `json:"defaultLifetimeWarranty"`DefaultWarrantyDetails *string `json:"defaultWarrantyDetails,omitempty" validate:"omitempty,max=1000" extensions:"x-nullable"`- // Default location and labels+ // Default location and tagsDefaultLocationID uuid.UUID `json:"defaultLocationId,omitempty" extensions:"x-nullable"`- DefaultLabelIDs *[]uuid.UUID `json:"defaultLabelIds,omitempty" extensions:"x-nullable"`+ DefaultTagIDs *[]uuid.UUID `json:"defaultTagIds,omitempty" extensions:"x-nullable"`// Metadata flagsIncludeWarrantyFields bool `json:"includeWarrantyFields"`@@ -120,9 +120,9 @@ type (DefaultLifetimeWarranty bool `json:"defaultLifetimeWarranty"`DefaultWarrantyDetails string `json:"defaultWarrantyDetails"`- // Default location and labels+ // Default location and tagsDefaultLocation *TemplateLocationSummary `json:"defaultLocation"`- DefaultLabels []TemplateLabelSummary `json:"defaultLabels"`+ DefaultTags []TemplateTagSummary `json:"defaultTags"`// Metadata flagsIncludeWarrantyFields bool `json:"includeWarrantyFields"`@@ -177,15 +177,15 @@ func (r *ItemTemplatesRepository) mapTemplateOut(ctx context.Context, template *}}- // Fetch labels from database using stored IDs- labels := make([]TemplateLabelSummary, 0)- if len(template.DefaultLabelIds) > 0 {- labelEntities, err := r.db.Label.Query().- Where(label.IDIn(template.DefaultLabelIds...)).+ // Fetch tags from database using stored IDs+ tags := make([]TemplateTagSummary, 0)+ if len(template.DefaultTagIds) > 0 {+ tagEntities, err := r.db.Tag.Query().+ Where(tag.IDIn(template.DefaultTagIds...)).All(ctx)if err == nil {- for _, l := range labelEntities {- labels = append(labels, TemplateLabelSummary{+ for _, l := range tagEntities {+ tags = append(tags, TemplateTagSummary{ID: l.ID,Name: l.Name,})@@ -209,7 +209,7 @@ func (r *ItemTemplatesRepository) mapTemplateOut(ctx context.Context, template *DefaultLifetimeWarranty: template.DefaultLifetimeWarranty,DefaultWarrantyDetails: template.DefaultWarrantyDetails,DefaultLocation: location,- DefaultLabels: labels,+ DefaultTags: tags,IncludeWarrantyFields: template.IncludeWarrantyFields,IncludePurchaseFields: template.IncludePurchaseFields,IncludeSoldFields: template.IncludeSoldFields,@@ -284,9 +284,9 @@ func (r *ItemTemplatesRepository) Create(ctx context.Context, gid uuid.UUID, datif data.DefaultLocationID != uuid.Nil {q.SetLocationID(data.DefaultLocationID)}- // Set default label IDs (stored as JSON)- if data.DefaultLabelIDs != nil && len(*data.DefaultLabelIDs) > 0 {- q.SetDefaultLabelIds(*data.DefaultLabelIDs)+ // Set default tag IDs (stored as JSON)+ if data.DefaultTagIDs != nil && len(*data.DefaultTagIDs) > 0 {+ q.SetDefaultTagIds(*data.DefaultTagIDs)}template, err := q.Save(ctx)@@ -351,11 +351,11 @@ func (r *ItemTemplatesRepository) Update(ctx context.Context, gid uuid.UUID, datupdateQ.ClearLocation()}- // Update default label IDs (stored as JSON)- if data.DefaultLabelIDs != nil && len(*data.DefaultLabelIDs) > 0 {- updateQ.SetDefaultLabelIds(*data.DefaultLabelIDs)+ // Update default tag IDs (stored as JSON)+ if data.DefaultTagIDs != nil && len(*data.DefaultTagIDs) > 0 {+ updateQ.SetDefaultTagIds(*data.DefaultTagIDs)} else {- updateQ.ClearDefaultLabelIds()+ updateQ.ClearDefaultTagIds()}_, err = updateQ.Save(ctx)diff --git a/backend/internal/data/repo/repo_item_templates_test.go b/backend/internal/data/repo/repo_item_templates_test.goindex 4f6e6cfb..bc23896f 100644--- a/backend/internal/data/repo/repo_item_templates_test.go+++ b/backend/internal/data/repo/repo_item_templates_test.go@@ -263,34 +263,34 @@ func TestItemTemplatesRepository_CreateWithLocation(t *testing.T) {require.NoError(t, err)}-func TestItemTemplatesRepository_CreateWithLabels(t *testing.T) {- // Create some labels- label1, err := tRepos.Labels.Create(context.Background(), tGroup.ID, LabelCreate{+func TestItemTemplatesRepository_CreateWithTags(t *testing.T) {+ // Create some tags+ tag1, err := tRepos.Tags.Create(context.Background(), tGroup.ID, TagCreate{Name: fk.Str(10),Description: fk.Str(50),})require.NoError(t, err)- label2, err := tRepos.Labels.Create(context.Background(), tGroup.ID, LabelCreate{+ tag2, err := tRepos.Tags.Create(context.Background(), tGroup.ID, TagCreate{Name: fk.Str(10),Description: fk.Str(50),})require.NoError(t, err)t.Cleanup(func() {- _ = tRepos.Labels.delete(context.Background(), label1.ID)- _ = tRepos.Labels.delete(context.Background(), label2.ID)+ _ = tRepos.Tags.delete(context.Background(), tag1.ID)+ _ = tRepos.Tags.delete(context.Background(), tag2.ID)})- // Create template with labels+ // Create template with tagsdata := templateFactory()- labelIDs := []uuid.UUID{label1.ID, label2.ID}- data.DefaultLabelIDs = &labelIDs+ tagIDs := []uuid.UUID{tag1.ID, tag2.ID}+ data.DefaultTagIDs = &tagIDstemplate, err := tRepos.ItemTemplates.Create(context.Background(), tGroup.ID, data)require.NoError(t, err)- assert.Len(t, template.DefaultLabels, 2)+ assert.Len(t, template.DefaultTags, 2)// Cleanuperr = tRepos.ItemTemplates.Delete(context.Background(), tGroup.ID, template.ID)diff --git a/backend/internal/data/repo/repo_items.go b/backend/internal/data/repo/repo_items.goindex 3ad9abee..dc529ffd 100644--- a/backend/internal/data/repo/repo_items.go+++ b/backend/internal/data/repo/repo_items.go@@ -13,7 +13,7 @@ import ("github.com/sysadminsmedia/homebox/backend/internal/data/ent/group""github.com/sysadminsmedia/homebox/backend/internal/data/ent/item""github.com/sysadminsmedia/homebox/backend/internal/data/ent/itemfield"- "github.com/sysadminsmedia/homebox/backend/internal/data/ent/label"+ "github.com/sysadminsmedia/homebox/backend/internal/data/ent/tag""github.com/sysadminsmedia/homebox/backend/internal/data/ent/location""github.com/sysadminsmedia/homebox/backend/internal/data/ent/maintenanceentry""github.com/sysadminsmedia/homebox/backend/internal/data/ent/predicate"@@ -38,8 +38,8 @@ type (Search string `json:"search"`AssetID AssetID `json:"assetId"`LocationIDs []uuid.UUID `json:"locationIds"`- LabelIDs []uuid.UUID `json:"labelIds"`- NegateLabels bool `json:"negateLabels"`+ TagIDs []uuid.UUID `json:"tagIds"`+ NegateTags bool `json:"negateTags"`OnlyWithoutPhoto bool `json:"onlyWithoutPhoto"`OnlyWithPhoto bool `json:"onlyWithPhoto"`ParentItemIDs []uuid.UUID `json:"parentIds"`@@ -76,7 +76,7 @@ type (// EdgesLocationID uuid.UUID `json:"locationId"`- LabelIDs []uuid.UUID `json:"labelIds"`+ TagIDs []uuid.UUID `json:"tagIds"`}ItemUpdate struct {@@ -92,7 +92,7 @@ type (// EdgesLocationID uuid.UUID `json:"locationId"`- LabelIDs []uuid.UUID `json:"labelIds"`+ TagIDs []uuid.UUID `json:"tagIds"`// IdentificationsSerialNumber string `json:"serialNumber"`@@ -125,7 +125,7 @@ type (Quantity *int `json:"quantity,omitempty" extensions:"x-nullable,x-omitempty"`ImportRef *string `json:"-,omitempty" extensions:"x-nullable,x-omitempty"`LocationID uuid.UUID `json:"locationId" extensions:"x-nullable,x-omitempty"`- LabelIDs []uuid.UUID `json:"labelIds" extensions:"x-nullable,x-omitempty"`+ TagIDs []uuid.UUID `json:"tagIds" extensions:"x-nullable,x-omitempty"`}ItemSummary struct {@@ -144,7 +144,7 @@ type (// EdgesLocation *LocationSummary `json:"location,omitempty" extensions:"x-nullable,x-omitempty"`- Labels []LabelSummary `json:"labels"`+ Tags []TagSummary `json:"tags"`ImageID *uuid.UUID `json:"imageId,omitempty" extensions:"x-nullable,x-omitempty"`ThumbnailId *uuid.UUID `json:"thumbnailId,omitempty" extensions:"x-nullable,x-omitempty"`@@ -196,9 +196,9 @@ func mapItemSummary(item *ent.Item) ItemSummary {location = &loc}- labels := make([]LabelSummary, len(item.Edges.Label))- if item.Edges.Label != nil {- labels = mapEach(item.Edges.Label, mapLabelSummary)+ tags := make([]TagSummary, len(item.Edges.Tag))+ if item.Edges.Tag != nil {+ tags = mapEach(item.Edges.Tag, mapTagSummary)}var imageID *uuid.UUID@@ -235,7 +235,7 @@ func mapItemSummary(item *ent.Item) ItemSummary {// EdgesLocation: location,- Labels: labels,+ Tags: tags,// WarrantyInsured: item.Insured,@@ -329,7 +329,7 @@ func (e *ItemsRepository) getOneTx(ctx context.Context, tx *ent.Tx, where ...prereturn mapItemOutErr(q.WithFields().- WithLabel().+ WithTag().WithLocation().WithGroup().WithParent().@@ -412,24 +412,24 @@ func (e *ItemsRepository) QueryByGroup(ctx context.Context, gid uuid.UUID, q Ite// of filters is OR'd together.//// The goal is to allow matches like where the item has- // - one of the selected labels AND+ // - one of the selected tags AND// - one of the selected locations AND// - one of the selected fields key/value matchesvar andPredicates []predicate.Item{- if len(q.LabelIDs) > 0 {- labelPredicates := make([]predicate.Item, 0, len(q.LabelIDs))- for _, l := range q.LabelIDs {- if !q.NegateLabels {- labelPredicates = append(labelPredicates, item.HasLabelWith(label.ID(l)))+ if len(q.TagIDs) > 0 {+ tagPredicates := make([]predicate.Item, 0, len(q.TagIDs))+ for _, l := range q.TagIDs {+ if !q.NegateTags {+ tagPredicates = append(tagPredicates, item.HasTagWith(tag.ID(l)))} else {- labelPredicates = append(labelPredicates, item.Not(item.HasLabelWith(label.ID(l))))+ tagPredicates = append(tagPredicates, item.Not(item.HasTagWith(tag.ID(l))))}}- if !q.NegateLabels {- andPredicates = append(andPredicates, item.Or(labelPredicates...))+ if !q.NegateTags {+ andPredicates = append(andPredicates, item.Or(tagPredicates...))} else {- andPredicates = append(andPredicates, item.And(labelPredicates...))+ andPredicates = append(andPredicates, item.And(tagPredicates...))}}@@ -504,7 +504,7 @@ func (e *ItemsRepository) QueryByGroup(ctx context.Context, gid uuid.UUID, q Ite}qb = qb.- WithLabel().+ WithTag().WithLocation().WithAttachments(func(aq *ent.AttachmentQuery) {aq.Where(@@ -549,7 +549,7 @@ func (e *ItemsRepository) QueryByAssetID(ctx context.Context, gid uuid.UUID, assitems, err := mapItemsSummaryErr(qb.Order(ent.Asc(item.FieldName)).- WithLabel().+ WithTag().WithLocation().All(ctx),)@@ -565,11 +565,11 @@ func (e *ItemsRepository) QueryByAssetID(ctx context.Context, gid uuid.UUID, ass}, nil}-// GetAll returns all the items in the database with the Labels and Locations eager loaded.+// GetAll returns all the items in the database with the Tags and Locations eager loaded.func (e *ItemsRepository) GetAll(ctx context.Context, gid uuid.UUID) ([]ItemOut, error) {return mapItemsOutErr(e.db.Item.Query().Where(item.HasGroupWith(group.ID(gid))).- WithLabel().+ WithTag().WithLocation().WithFields().All(ctx))@@ -641,8 +641,8 @@ func (e *ItemsRepository) Create(ctx context.Context, gid uuid.UUID, data ItemCrq.SetParentID(data.ParentID)}- if len(data.LabelIDs) > 0 {- q.AddLabelIDs(data.LabelIDs...)+ if len(data.TagIDs) > 0 {+ q.AddTagIDs(data.TagIDs...)}result, err := q.Save(ctx)@@ -660,7 +660,7 @@ type ItemCreateFromTemplate struct {Description stringQuantity intLocationID uuid.UUID- LabelIDs []uuid.UUID+ TagIDs []uuid.UUIDInsured boolManufacturer stringModelNumber string@@ -707,8 +707,8 @@ func (e *ItemsRepository) CreateFromTemplate(ctx context.Context, gid uuid.UUID,SetLifetimeWarranty(data.LifetimeWarranty).SetWarrantyDetails(data.WarrantyDetails)- if len(data.LabelIDs) > 0 {- itemBuilder.AddLabelIDs(data.LabelIDs...)+ if len(data.TagIDs) > 0 {+ itemBuilder.AddTagIDs(data.TagIDs...)}_, err = itemBuilder.Save(ctx)@@ -809,7 +809,7 @@ func (e *ItemsRepository) DeleteByGroup(ctx context.Context, gid, id uuid.UUID)return err}-func (e *ItemsRepository) WipeInventory(ctx context.Context, gid uuid.UUID, wipeLabels bool, wipeLocations bool, wipeMaintenance bool) (int, error) {+func (e *ItemsRepository) WipeInventory(ctx context.Context, gid uuid.UUID, wipeTags bool, wipeLocations bool, wipeMaintenance bool) (int, error) {deleted := 0// Wipe maintenance records if requested@@ -865,14 +865,14 @@ func (e *ItemsRepository) WipeInventory(ctx context.Context, gid uuid.UUID, wipedeleted++}- // Wipe labels if requested- if wipeLabels {- labelCount, err := e.db.Label.Delete().Where(label.HasGroupWith(group.ID(gid))).Exec(ctx)+ // Wipe tags if requested+ if wipeTags {+ tagCount, err := e.db.Tag.Delete().Where(tag.HasGroupWith(group.ID(gid))).Exec(ctx)if err != nil {- log.Err(err).Msg("failed to delete labels during wipe inventory")+ log.Err(err).Msg("failed to delete tags during wipe inventory")} else {- log.Info().Int("count", labelCount).Msg("deleted labels during wipe inventory")- deleted += labelCount+ log.Info().Int("count", tagCount).Msg("deleted tags during wipe inventory")+ deleted += tagCount}}@@ -916,23 +916,23 @@ func (e *ItemsRepository) UpdateByGroup(ctx context.Context, gid uuid.UUID, dataSetAssetID(int(data.AssetID)).SetSyncChildItemsLocations(data.SyncChildItemsLocations)- currentLabels, err := e.db.Item.Query().Where(item.ID(data.ID)).QueryLabel().All(ctx)+ currentTags, err := e.db.Item.Query().Where(item.ID(data.ID)).QueryTag().All(ctx)if err != nil {return ItemOut{}, err}- set := newIDSet(currentLabels)+ set := newIDSet(currentTags)- for _, l := range data.LabelIDs {+ for _, l := range data.TagIDs {if set.Contains(l) {set.Remove(l)continue}- q.AddLabelIDs(l)+ q.AddTagIDs(l)}if set.Len() > 0 {- q.RemoveLabelIDs(set.Slice()...)+ q.RemoveTagIDs(set.Slice()...)}if data.ParentID != uuid.Nil {@@ -1087,26 +1087,26 @@ func (e *ItemsRepository) Patch(ctx context.Context, gid, id uuid.UUID, data Itereturn err}- if data.LabelIDs != nil {- currentLabels, err := tx.Item.Query().Where(item.ID(id), item.HasGroupWith(group.ID(gid))).QueryLabel().All(ctx)+ if data.TagIDs != nil {+ currentTags, err := tx.Item.Query().Where(item.ID(id), item.HasGroupWith(group.ID(gid))).QueryTag().All(ctx)if err != nil {return err}- set := newIDSet(currentLabels)+ set := newIDSet(currentTags)- addLabels := []uuid.UUID{}- for _, l := range data.LabelIDs {+ addTags := []uuid.UUID{}+ for _, l := range data.TagIDs {if set.Contains(l) {set.Remove(l)} else {- addLabels = append(addLabels, l)+ addTags = append(addTags, l)}}- if len(addLabels) > 0 {+ if len(addTags) > 0 {if err := tx.Item.Update().Where(item.ID(id), item.HasGroupWith(group.ID(gid))).- AddLabelIDs(addLabels...).+ AddTagIDs(addTags...).Exec(ctx); err != nil {return err}@@ -1114,7 +1114,7 @@ func (e *ItemsRepository) Patch(ctx context.Context, gid, id uuid.UUID, data Iteif set.Len() > 0 {if err := tx.Item.Update().Where(item.ID(id), item.HasGroupWith(group.ID(gid))).- RemoveLabelIDs(set.Slice()...).+ RemoveTagIDs(set.Slice()...).Exec(ctx); err != nil {return err}@@ -1402,13 +1402,13 @@ func (e *ItemsRepository) Duplicate(ctx context.Context, gid, id uuid.UUID, optiitemBuilder.SetParentID(originalItem.Parent.ID)}- // Add labels- if len(originalItem.Labels) > 0 {- labelIDs := make([]uuid.UUID, len(originalItem.Labels))- for i, label := range originalItem.Labels {- labelIDs[i] = label.ID+ // Add tags+ if len(originalItem.Tags) > 0 {+ tagIDs := make([]uuid.UUID, len(originalItem.Tags))+ for i, tag := range originalItem.Tags {+ tagIDs[i] = tag.ID}- itemBuilder.AddLabelIDs(labelIDs...)+ itemBuilder.AddTagIDs(tagIDs...)}_, err = itemBuilder.Save(ctx)diff --git a/backend/internal/data/repo/repo_items_test.go b/backend/internal/data/repo/repo_items_test.goindex a3b26f44..a371938d 100644--- a/backend/internal/data/repo/repo_items_test.go+++ b/backend/internal/data/repo/repo_items_test.go@@ -165,14 +165,14 @@ func TestItemsRepository_Delete(t *testing.T) {assert.Empty(t, results)}-func TestItemsRepository_Update_Labels(t *testing.T) {+func TestItemsRepository_Update_Tags(t *testing.T) {entity := useItems(t, 1)[0]- labels := useLabels(t, 3)+ tags := useTags(t, 3)- labelsIDs := []uuid.UUID{labels[0].ID, labels[1].ID, labels[2].ID}+ tagsIDs := []uuid.UUID{tags[0].ID, tags[1].ID, tags[2].ID}type args struct {- labelIds []uuid.UUID+ tagIds []uuid.UUID}tests := []struct {@@ -181,44 +181,44 @@ func TestItemsRepository_Update_Labels(t *testing.T) {want []uuid.UUID}{{- name: "add all labels",+ name: "add all tags",args: args{- labelIds: labelsIDs,+ tagIds: tagsIDs,},- want: labelsIDs,+ want: tagsIDs,},{- name: "update with one label",+ name: "update with one tag",args: args{- labelIds: labelsIDs[:1],+ tagIds: tagsIDs[:1],},- want: labelsIDs[:1],+ want: tagsIDs[:1],},{- name: "add one new label to existing single label",+ name: "add one new tag to existing single tag",args: args{- labelIds: labelsIDs[1:],+ tagIds: tagsIDs[1:],},- want: labelsIDs[1:],+ want: tagsIDs[1:],},}for _, tt := range tests {t.Run(tt.name, func(t *testing.T) {- // Apply all labels to entity+ // Apply all tags to entityupdateData := ItemUpdate{ID: entity.ID,Name: entity.Name,LocationID: entity.Location.ID,- LabelIDs: tt.args.labelIds,+ TagIDs: tt.args.tagIds,}updated, err := tRepos.Items.UpdateByGroup(context.Background(), tGroup.ID, updateData)require.NoError(t, err)- assert.Len(t, tt.want, len(updated.Labels))+ assert.Len(t, tt.want, len(updated.Tags))- for _, label := range updated.Labels {- assert.Contains(t, tt.want, label.ID)+ for _, tag := range updated.Tags {+ assert.Contains(t, tt.want, tag.ID)}})}@@ -234,7 +234,7 @@ func TestItemsRepository_Update(t *testing.T) {Name: entity.Name,LocationID: entity.Location.ID,SerialNumber: fk.Str(10),- LabelIDs: nil,+ TagIDs: nil,ModelNumber: fk.Str(10),Manufacturer: fk.Str(10),PurchaseTime: types.DateFromTime(time.Now()),@@ -399,8 +399,7 @@ func TestItemsRepository_DeleteByGroupWithAttachments(t *testing.T) {}func TestItemsRepository_WipeInventory(t *testing.T) {- // Create test data: items, labels, locations, and maintenance entries-+ // Create test data: items, tags, locations, and maintenance entries// Create locationsloc1, err := tRepos.Locations.Create(context.Background(), tGroup.ID, LocationCreate{Name: "Test Location 1",@@ -414,16 +413,16 @@ func TestItemsRepository_WipeInventory(t *testing.T) {})require.NoError(t, err)- // Create labels- label1, err := tRepos.Labels.Create(context.Background(), tGroup.ID, LabelCreate{- Name: "Test Label 1",- Description: "Test label for wipe test",+ // Create tags+ tag1, err := tRepos.Tags.Create(context.Background(), tGroup.ID, TagCreate{+ Name: "Test Tag 1",+ Description: "Test tag for wipe test",})require.NoError(t, err)- label2, err := tRepos.Labels.Create(context.Background(), tGroup.ID, LabelCreate{- Name: "Test Label 2",- Description: "Another test label",+ tag2, err := tRepos.Tags.Create(context.Background(), tGroup.ID, TagCreate{+ Name: "Test Tag 2",+ Description: "Another test tag",})require.NoError(t, err)@@ -432,7 +431,7 @@ func TestItemsRepository_WipeInventory(t *testing.T) {Name: "Test Item 1",Description: "Test item for wipe test",LocationID: loc1.ID,- LabelIDs: []uuid.UUID{label1.ID},+ TagIDs: []uuid.UUID{tag1.ID},})require.NoError(t, err)@@ -440,7 +439,7 @@ func TestItemsRepository_WipeInventory(t *testing.T) {Name: "Test Item 2",Description: "Another test item",LocationID: loc2.ID,- LabelIDs: []uuid.UUID{label2.ID},+ TagIDs: []uuid.UUID{tag2.ID},})require.NoError(t, err)@@ -462,11 +461,10 @@ func TestItemsRepository_WipeInventory(t *testing.T) {require.NoError(t, err)// Test 1: Wipe inventory with all options enabled- t.Run("wipe all including labels, locations, and maintenance", func(t *testing.T) {+ t.Run("wipe all including tags, locations, and maintenance", func(t *testing.T) {deleted, err := tRepos.Items.WipeInventory(context.Background(), tGroup.ID, true, true, true)require.NoError(t, err)assert.Positive(t, deleted, "Should have deleted at least some entities")-// Verify items are deleted_, err = tRepos.Items.GetOneByGroup(context.Background(), tGroup.ID, item1.ID)require.Error(t, err, "Item 1 should be deleted")@@ -483,13 +481,12 @@ func TestItemsRepository_WipeInventory(t *testing.T) {require.NoError(t, err)assert.Empty(t, maint2List, "Maintenance entry 2 should be deleted")- // Verify labels are deleted- _, err = tRepos.Labels.GetOneByGroup(context.Background(), tGroup.ID, label1.ID)- require.Error(t, err, "Label 1 should be deleted")-- _, err = tRepos.Labels.GetOneByGroup(context.Background(), tGroup.ID, label2.ID)- require.Error(t, err, "Label 2 should be deleted")+ // Verify tags are deleted+ _, err = tRepos.Tags.GetOneByGroup(context.Background(), tGroup.ID, tag1.ID)+ require.Error(t, err, "Tag 1 should be deleted")+ _, err = tRepos.Tags.GetOneByGroup(context.Background(), tGroup.ID, tag2.ID)+ require.Error(t, err, "Tag 2 should be deleted")// Verify locations are deleted_, err = tRepos.Locations.Get(context.Background(), loc1.ID)require.Error(t, err, "Location 1 should be deleted")@@ -507,9 +504,9 @@ func TestItemsRepository_WipeInventory_OnlyItems(t *testing.T) {})require.NoError(t, err)- label, err := tRepos.Labels.Create(context.Background(), tGroup.ID, LabelCreate{- Name: "Test Label",- Description: "Test label for wipe test",+ tag, err := tRepos.Tags.Create(context.Background(), tGroup.ID, TagCreate{+ Name: "Test Tag",+ Description: "Test tag for wipe test",})require.NoError(t, err)@@ -517,7 +514,7 @@ func TestItemsRepository_WipeInventory_OnlyItems(t *testing.T) {Name: "Test Item",Description: "Test item for wipe test",LocationID: loc.ID,- LabelIDs: []uuid.UUID{label.ID},+ TagIDs: []uuid.UUID{tag.ID},})require.NoError(t, err)@@ -529,11 +526,10 @@ func TestItemsRepository_WipeInventory_OnlyItems(t *testing.T) {})require.NoError(t, err)- // Test: Wipe inventory with only items (no labels, locations, or maintenance)+ // Test: Wipe inventory with only items (no tags, locations, or maintenance)deleted, err := tRepos.Items.WipeInventory(context.Background(), tGroup.ID, false, false, false)require.NoError(t, err)assert.Positive(t, deleted, "Should have deleted at least the item")-// Verify item is deleted_, err = tRepos.Items.GetOneByGroup(context.Background(), tGroup.ID, item.ID)require.Error(t, err, "Item should be deleted")@@ -543,15 +539,15 @@ func TestItemsRepository_WipeInventory_OnlyItems(t *testing.T) {require.NoError(t, err)assert.Empty(t, maintList, "Maintenance entry should be cascade deleted with item")- // Verify label still exists- _, err = tRepos.Labels.GetOneByGroup(context.Background(), tGroup.ID, label.ID)- require.NoError(t, err, "Label should still exist")-+ // Verify tag still exists+ _, err = tRepos.Tags.GetOneByGroup(context.Background(), tGroup.ID, tag.ID)+ require.NoError(t, err, "Tag should still exist")// Verify location still exists_, err = tRepos.Locations.Get(context.Background(), loc.ID)require.NoError(t, err, "Location should still exist")// Cleanup- _ = tRepos.Labels.DeleteByGroup(context.Background(), tGroup.ID, label.ID)+ _ = tRepos.Tags.DeleteByGroup(context.Background(), tGroup.ID, tag.ID)_ = tRepos.Locations.delete(context.Background(), loc.ID)}+diff --git a/backend/internal/data/repo/repo_labels.go b/backend/internal/data/repo/repo_labels.goindex fab7a1ec..43d19a30 100644--- a/backend/internal/data/repo/repo_labels.go+++ b/backend/internal/data/repo/repo_labels.go@@ -8,30 +8,30 @@ import ("github.com/sysadminsmedia/homebox/backend/internal/core/services/reporting/eventbus""github.com/sysadminsmedia/homebox/backend/internal/data/ent""github.com/sysadminsmedia/homebox/backend/internal/data/ent/group"- "github.com/sysadminsmedia/homebox/backend/internal/data/ent/label"+ "github.com/sysadminsmedia/homebox/backend/internal/data/ent/tag""github.com/sysadminsmedia/homebox/backend/internal/data/ent/predicate")-type LabelRepository struct {+type TagRepository struct {db *ent.Clientbus *eventbus.EventBus}type (- LabelCreate struct {+ TagCreate struct {Name string `json:"name" validate:"required,min=1,max=255"`Description string `json:"description" validate:"max=1000"`Color string `json:"color"`}- LabelUpdate struct {+ TagUpdate struct {ID uuid.UUID `json:"id"`Name string `json:"name" validate:"required,min=1,max=255"`Description string `json:"description" validate:"max=1000"`Color string `json:"color"`}- LabelSummary struct {+ TagSummary struct {ID uuid.UUID `json:"id"`Name string `json:"name"`Description string `json:"description"`@@ -40,86 +40,86 @@ type (UpdatedAt time.Time `json:"updatedAt"`}- LabelOut struct {- LabelSummary+ TagOut struct {+ TagSummary})-func mapLabelSummary(label *ent.Label) LabelSummary {- return LabelSummary{- ID: label.ID,- Name: label.Name,- Description: label.Description,- Color: label.Color,- CreatedAt: label.CreatedAt,- UpdatedAt: label.UpdatedAt,+func mapTagSummary(tag *ent.Tag) TagSummary {+ return TagSummary{+ ID: tag.ID,+ Name: tag.Name,+ Description: tag.Description,+ Color: tag.Color,+ CreatedAt: tag.CreatedAt,+ UpdatedAt: tag.UpdatedAt,}}var (- mapLabelOutErr = mapTErrFunc(mapLabelOut)- mapLabelsOut = mapTEachErrFunc(mapLabelSummary)+ mapTagOutErr = mapTErrFunc(mapTagOut)+ mapTagsOut = mapTEachErrFunc(mapTagSummary))-func mapLabelOut(label *ent.Label) LabelOut {- return LabelOut{- LabelSummary: mapLabelSummary(label),+func mapTagOut(tag *ent.Tag) TagOut {+ return TagOut{+ TagSummary: mapTagSummary(tag),}}-func (r *LabelRepository) publishMutationEvent(gid uuid.UUID) {+func (r *TagRepository) publishMutationEvent(gid uuid.UUID) {if r.bus != nil {- r.bus.Publish(eventbus.EventLabelMutation, eventbus.GroupMutationEvent{GID: gid})+ r.bus.Publish(eventbus.EventTagMutation, eventbus.GroupMutationEvent{GID: gid})}}-func (r *LabelRepository) getOne(ctx context.Context, where ...predicate.Label) (LabelOut, error) {- return mapLabelOutErr(r.db.Label.Query().+func (r *TagRepository) getOne(ctx context.Context, where ...predicate.Tag) (TagOut, error) {+ return mapTagOutErr(r.db.Tag.Query().Where(where...).WithGroup().Only(ctx),)}-func (r *LabelRepository) GetOne(ctx context.Context, id uuid.UUID) (LabelOut, error) {- return r.getOne(ctx, label.ID(id))+func (r *TagRepository) GetOne(ctx context.Context, id uuid.UUID) (TagOut, error) {+ return r.getOne(ctx, tag.ID(id))}-func (r *LabelRepository) GetOneByGroup(ctx context.Context, gid, ld uuid.UUID) (LabelOut, error) {- return r.getOne(ctx, label.ID(ld), label.HasGroupWith(group.ID(gid)))+func (r *TagRepository) GetOneByGroup(ctx context.Context, gid, ld uuid.UUID) (TagOut, error) {+ return r.getOne(ctx, tag.ID(ld), tag.HasGroupWith(group.ID(gid)))}-func (r *LabelRepository) GetAll(ctx context.Context, groupID uuid.UUID) ([]LabelSummary, error) {- return mapLabelsOut(r.db.Label.Query().- Where(label.HasGroupWith(group.ID(groupID))).- Order(ent.Asc(label.FieldName)).+func (r *TagRepository) GetAll(ctx context.Context, groupID uuid.UUID) ([]TagSummary, error) {+ return mapTagsOut(r.db.Tag.Query().+ Where(tag.HasGroupWith(group.ID(groupID))).+ Order(ent.Asc(tag.FieldName)).WithGroup().All(ctx),)}-func (r *LabelRepository) Create(ctx context.Context, groupID uuid.UUID, data LabelCreate) (LabelOut, error) {- label, err := r.db.Label.Create().+func (r *TagRepository) Create(ctx context.Context, groupID uuid.UUID, data TagCreate) (TagOut, error) {+ tag, err := r.db.Tag.Create().SetName(data.Name).SetDescription(data.Description).SetColor(data.Color).SetGroupID(groupID).Save(ctx)if err != nil {- return LabelOut{}, err+ return TagOut{}, err}- label.Edges.Group = &ent.Group{ID: groupID} // bootstrap group ID+ tag.Edges.Group = &ent.Group{ID: groupID} // bootstrap group IDr.publishMutationEvent(groupID)- return mapLabelOut(label), err+ return mapTagOut(tag), err}-func (r *LabelRepository) update(ctx context.Context, data LabelUpdate, where ...predicate.Label) (int, error) {+func (r *TagRepository) update(ctx context.Context, data TagUpdate, where ...predicate.Tag) (int, error) {if len(where) == 0 {panic("empty where not supported empty")}- return r.db.Label.Update().+ return r.db.Tag.Update().Where(where...).SetName(data.Name).SetDescription(data.Description).@@ -127,27 +127,27 @@ func (r *LabelRepository) update(ctx context.Context, data LabelUpdate, where ..Save(ctx)}-func (r *LabelRepository) UpdateByGroup(ctx context.Context, gid uuid.UUID, data LabelUpdate) (LabelOut, error) {- _, err := r.update(ctx, data, label.ID(data.ID), label.HasGroupWith(group.ID(gid)))+func (r *TagRepository) UpdateByGroup(ctx context.Context, gid uuid.UUID, data TagUpdate) (TagOut, error) {+ _, err := r.update(ctx, data, tag.ID(data.ID), tag.HasGroupWith(group.ID(gid)))if err != nil {- return LabelOut{}, err+ return TagOut{}, err}r.publishMutationEvent(gid)return r.GetOne(ctx, data.ID)}-// delete removes the label from the database. This should only be used when-// the label's ownership is already confirmed/validated.-func (r *LabelRepository) delete(ctx context.Context, id uuid.UUID) error {- return r.db.Label.DeleteOneID(id).Exec(ctx)+// delete removes the tag from the database. This should only be used when+// the tag's ownership is already confirmed/validated.+func (r *TagRepository) delete(ctx context.Context, id uuid.UUID) error {+ return r.db.Tag.DeleteOneID(id).Exec(ctx)}-func (r *LabelRepository) DeleteByGroup(ctx context.Context, gid, id uuid.UUID) error {- _, err := r.db.Label.Delete().+func (r *TagRepository) DeleteByGroup(ctx context.Context, gid, id uuid.UUID) error {+ _, err := r.db.Tag.Delete().Where(- label.ID(id),- label.HasGroupWith(group.ID(gid)),+ tag.ID(id),+ tag.HasGroupWith(group.ID(gid)),).Exec(ctx)if err != nil {return errdiff --git a/backend/internal/data/repo/repo_labels_test.go b/backend/internal/data/repo/repo_labels_test.goindex 8b1d66fc..4b5a400c 100644--- a/backend/internal/data/repo/repo_labels_test.go+++ b/backend/internal/data/repo/repo_labels_test.go@@ -8,96 +8,96 @@ import ("github.com/stretchr/testify/require")-func labelFactory() LabelCreate {- return LabelCreate{+func tagFactory() TagCreate {+ return TagCreate{Name: fk.Str(10),Description: fk.Str(100),}}-func useLabels(t *testing.T, len int) []LabelOut {+func useTags(t *testing.T, len int) []TagOut {t.Helper()- labels := make([]LabelOut, len)+ tags := make([]TagOut, len)for i := 0; i < len; i++ {- itm := labelFactory()+ itm := tagFactory()- item, err := tRepos.Labels.Create(context.Background(), tGroup.ID, itm)+ item, err := tRepos.Tags.Create(context.Background(), tGroup.ID, itm)require.NoError(t, err)- labels[i] = item+ tags[i] = item}t.Cleanup(func() {- for _, item := range labels {- _ = tRepos.Labels.delete(context.Background(), item.ID)+ for _, item := range tags {+ _ = tRepos.Tags.delete(context.Background(), item.ID)}})- return labels+ return tags}-func TestLabelRepository_Get(t *testing.T) {- labels := useLabels(t, 1)- label := labels[0]+func TestTagRepository_Get(t *testing.T) {+ tags := useTags(t, 1)+ tag := tags[0]// Get by ID- foundLoc, err := tRepos.Labels.GetOne(context.Background(), label.ID)+ foundLoc, err := tRepos.Tags.GetOne(context.Background(), tag.ID)require.NoError(t, err)- assert.Equal(t, label.ID, foundLoc.ID)+ assert.Equal(t, tag.ID, foundLoc.ID)}-func TestLabelRepositoryGetAll(t *testing.T) {- useLabels(t, 10)+func TestTagRepositoryGetAll(t *testing.T) {+ useTags(t, 10)- all, err := tRepos.Labels.GetAll(context.Background(), tGroup.ID)+ all, err := tRepos.Tags.GetAll(context.Background(), tGroup.ID)require.NoError(t, err)assert.Len(t, all, 10)}-func TestLabelRepository_Create(t *testing.T) {- loc, err := tRepos.Labels.Create(context.Background(), tGroup.ID, labelFactory())+func TestTagRepository_Create(t *testing.T) {+ loc, err := tRepos.Tags.Create(context.Background(), tGroup.ID, tagFactory())require.NoError(t, err)// Get by ID- foundLoc, err := tRepos.Labels.GetOne(context.Background(), loc.ID)+ foundLoc, err := tRepos.Tags.GetOne(context.Background(), loc.ID)require.NoError(t, err)assert.Equal(t, loc.ID, foundLoc.ID)- err = tRepos.Labels.delete(context.Background(), loc.ID)+ err = tRepos.Tags.delete(context.Background(), loc.ID)require.NoError(t, err)}-func TestLabelRepository_Update(t *testing.T) {- loc, err := tRepos.Labels.Create(context.Background(), tGroup.ID, labelFactory())+func TestTagsRepository_Update(t *testing.T) {+ loc, err := tRepos.Tags.Create(context.Background(), tGroup.ID, tagFactory())require.NoError(t, err)- updateData := LabelUpdate{+ updateData := TagUpdate{ID: loc.ID,Name: fk.Str(10),Description: fk.Str(100),}- update, err := tRepos.Labels.UpdateByGroup(context.Background(), tGroup.ID, updateData)+ update, err := tRepos.Tags.UpdateByGroup(context.Background(), tGroup.ID, updateData)require.NoError(t, err)- foundLoc, err := tRepos.Labels.GetOne(context.Background(), loc.ID)+ foundLoc, err := tRepos.Tags.GetOne(context.Background(), loc.ID)require.NoError(t, err)assert.Equal(t, update.ID, foundLoc.ID)assert.Equal(t, update.Name, foundLoc.Name)assert.Equal(t, update.Description, foundLoc.Description)- err = tRepos.Labels.delete(context.Background(), loc.ID)+ err = tRepos.Tags.delete(context.Background(), loc.ID)require.NoError(t, err)}-func TestLabelRepository_Delete(t *testing.T) {- loc, err := tRepos.Labels.Create(context.Background(), tGroup.ID, labelFactory())+func TestTagRepository_Delete(t *testing.T) {+ loc, err := tRepos.Tags.Create(context.Background(), tGroup.ID, tagFactory())require.NoError(t, err)- err = tRepos.Labels.delete(context.Background(), loc.ID)+ err = tRepos.Tags.delete(context.Background(), loc.ID)require.NoError(t, err)- _, err = tRepos.Labels.GetOne(context.Background(), loc.ID)+ _, err = tRepos.Tags.GetOne(context.Background(), loc.ID)require.Error(t, err)}diff --git a/backend/internal/data/repo/repo_wipe_integration_test.go b/backend/internal/data/repo/repo_wipe_integration_test.goindex 1fe456bf..3db4e42f 100644--- a/backend/internal/data/repo/repo_wipe_integration_test.go+++ b/backend/internal/data/repo/repo_wipe_integration_test.go@@ -13,7 +13,7 @@ import (// TestWipeInventory_Integration tests the complete wipe inventory flowfunc TestWipeInventory_Integration(t *testing.T) {- // Create test data: locations, labels, items with maintenance+ // Create test data: locations, tags, items with maintenance// 1. Create locationsloc1, err := tRepos.Locations.Create(context.Background(), tGroup.ID, LocationCreate{@@ -28,16 +28,16 @@ func TestWipeInventory_Integration(t *testing.T) {})require.NoError(t, err)- // 2. Create labels- label1, err := tRepos.Labels.Create(context.Background(), tGroup.ID, LabelCreate{+ // 2. Create tags+ tag1, err := tRepos.Tags.Create(context.Background(), tGroup.ID, TagCreate{Name: "Test Electronics",- Description: "Electronics label",+ Description: "Electronics tag",})require.NoError(t, err)- label2, err := tRepos.Labels.Create(context.Background(), tGroup.ID, LabelCreate{+ tag2, err := tRepos.Tags.Create(context.Background(), tGroup.ID, TagCreate{Name: "Test Tools",- Description: "Tools label",+ Description: "Tools tag",})require.NoError(t, err)@@ -46,7 +46,7 @@ func TestWipeInventory_Integration(t *testing.T) {Name: "Test Laptop",Description: "Work laptop",LocationID: loc1.ID,- LabelIDs: []uuid.UUID{label1.ID},+ TagIDs: []uuid.UUID{tag1.ID},})require.NoError(t, err)@@ -54,7 +54,7 @@ func TestWipeInventory_Integration(t *testing.T) {Name: "Test Drill",Description: "Power drill",LocationID: loc2.ID,- LabelIDs: []uuid.UUID{label2.ID},+ TagIDs: []uuid.UUID{tag2.ID},})require.NoError(t, err)@@ -62,7 +62,7 @@ func TestWipeInventory_Integration(t *testing.T) {Name: "Test Monitor",Description: "Computer monitor",LocationID: loc1.ID,- LabelIDs: []uuid.UUID{label1.ID},+ TagIDs: []uuid.UUID{tag1.ID},})require.NoError(t, err)@@ -120,13 +120,12 @@ func TestWipeInventory_Integration(t *testing.T) {require.NoError(t, err)assert.Empty(t, maint1After, "Item 1 maintenance records should be deleted")- // 10. Verify labels are deleted- _, err = tRepos.Labels.GetOneByGroup(context.Background(), tGroup.ID, label1.ID)- require.Error(t, err, "Label 1 should be deleted")-- _, err = tRepos.Labels.GetOneByGroup(context.Background(), tGroup.ID, label2.ID)- require.Error(t, err, "Label 2 should be deleted")+ // 10. Verify tags are deleted+ _, err = tRepos.Tags.GetOneByGroup(context.Background(), tGroup.ID, tag1.ID)+ require.Error(t, err, "Tag 1 should be deleted")+ _, err = tRepos.Tags.GetOneByGroup(context.Background(), tGroup.ID, tag2.ID)+ require.Error(t, err, "Tag 2 should be deleted")// 11. Verify locations are deleted_, err = tRepos.Locations.Get(context.Background(), loc1.ID)require.Error(t, err, "Location 1 should be deleted")@@ -144,9 +143,9 @@ func TestWipeInventory_SelectiveWipe(t *testing.T) {})require.NoError(t, err)- label, err := tRepos.Labels.Create(context.Background(), tGroup.ID, LabelCreate{+ tag, err := tRepos.Tags.Create(context.Background(), tGroup.ID, TagCreate{Name: "Test Important",- Description: "Important label",+ Description: "Important tag",})require.NoError(t, err)@@ -154,7 +153,7 @@ func TestWipeInventory_SelectiveWipe(t *testing.T) {Name: "Test Computer",Description: "Desktop computer",LocationID: loc.ID,- LabelIDs: []uuid.UUID{label.ID},+ TagIDs: []uuid.UUID{tag.ID},})require.NoError(t, err)@@ -166,7 +165,7 @@ func TestWipeInventory_SelectiveWipe(t *testing.T) {})require.NoError(t, err)- // Test: Wipe only items (keep labels and locations)+ // Test: Wipe only items (keep tags and locations)deleted, err := tRepos.Items.WipeInventory(context.Background(), tGroup.ID, false, false, false)require.NoError(t, err)assert.Positive(t, deleted, "Should have deleted at least items")@@ -180,15 +179,14 @@ func TestWipeInventory_SelectiveWipe(t *testing.T) {require.NoError(t, err)assert.Empty(t, maintList, "Maintenance should be cascade deleted")- // Verify label still exists- _, err = tRepos.Labels.GetOneByGroup(context.Background(), tGroup.ID, label.ID)- require.NoError(t, err, "Label should still exist")-+ // Verify tag still exists+ _, err = tRepos.Tags.GetOneByGroup(context.Background(), tGroup.ID, tag.ID)+ require.NoError(t, err, "Tag should still exist")// Verify location still exists_, err = tRepos.Locations.Get(context.Background(), loc.ID)require.NoError(t, err, "Location should still exist")// Cleanup- _ = tRepos.Labels.DeleteByGroup(context.Background(), tGroup.ID, label.ID)+ _ = tRepos.Tags.DeleteByGroup(context.Background(), tGroup.ID, tag.ID)_ = tRepos.Locations.delete(context.Background(), loc.ID)}diff --git a/backend/internal/data/repo/repos_all.go b/backend/internal/data/repo/repos_all.goindex 6109d743..e961822c 100644--- a/backend/internal/data/repo/repos_all.go+++ b/backend/internal/data/repo/repos_all.go@@ -13,7 +13,7 @@ type AllRepos struct {AuthTokens *TokenRepositoryGroups *GroupRepositoryLocations *LocationRepository- Labels *LabelRepository+ Tags *TagRepositoryItems *ItemsRepositoryItemTemplates *ItemTemplatesRepositoryAttachments *AttachmentRepo@@ -28,7 +28,7 @@ func New(db *ent.Client, bus *eventbus.EventBus, storage config.Storage, pubSubCAuthTokens: &TokenRepository{db},Groups: NewGroupRepository(db),Locations: &LocationRepository{db, bus},- Labels: &LabelRepository{db, bus},+ Tags: &TagRepository{db, bus},Items: &ItemsRepository{db, bus, attachments},ItemTemplates: &ItemTemplatesRepository{db, bus},Attachments: attachments,diff --git a/docs/en/advanced/import-csv.md b/docs/en/advanced/import-csv.mdindex 03fe2852..c8bb3e40 100644--- a/docs/en/advanced/import-csv.md+++ b/docs/en/advanced/import-csv.md@@ -6,7 +6,7 @@ Using the CSV import is the recommended way for adding items to the database. It**Current Limitations**- - Imports only support importing items, locations, and labels+ - Imports only support importing items, locations, and tags- Imports and Exports do not support attachments. Attachments must be uploaded after import- CSV Exports do not support nested path exports (e.g. `Home / Office / Desk`) and will only export the Items direct parent, (though imports _do_ support nested paths)- Cannot specify item-to-item relationships (e.g. `Item A` is a child of `Item B`)@@ -40,9 +40,9 @@ Specifying import refs also allows you to update existing items via the CSV impo* Supports Path Separators for nested locations (e.g. `Home / Office / Desk`)-`HB.labels`+`HB.tags`-: List of labels to apply to the item separated by a `;` can be existing or new labels.+: List of tags to apply to the item separated by a `;` can be existing or new tags.`HB.field.{field_name}` (e.g. `HB.field.Serial Number`)diff --git a/docs/en/api/openapi-2.0.json b/docs/en/api/openapi-2.0.jsonindex b2edcda4..edc7c452 100644--- a/docs/en/api/openapi-2.0.json+++ b/docs/en/api/openapi-2.0.json@@ -596,7 +596,7 @@}}},- "/v1/groups/statistics/labels": {+ "/v1/groups/statistics/locations": {"get": {"security": [{@@ -609,7 +609,7 @@"tags": ["Statistics"],- "summary": "Get Label Statistics",+ "summary": "Get Location Statistics","responses": {"200": {"description": "OK",@@ -623,7 +623,7 @@}}},- "/v1/groups/statistics/locations": {+ "/v1/groups/statistics/purchase-price": {"get": {"security": [{@@ -636,21 +636,32 @@"tags": ["Statistics"],- "summary": "Get Location Statistics",+ "summary": "Get Purchase Price Statistics",+ "parameters": [+ {+ "type": "string",+ "description": "start date",+ "name": "start",+ "in": "query"+ },+ {+ "type": "string",+ "description": "end date",+ "name": "end",+ "in": "query"+ }+ ],"responses": {"200": {"description": "OK","schema": {- "type": "array",- "items": {- "$ref": "#/definitions/repo.TotalsByOrganizer"- }+ "$ref": "#/definitions/repo.ValueOverTime"}}}}},- "/v1/groups/statistics/purchase-price": {+ "/v1/groups/statistics/tags": {"get": {"security": [{@@ -663,26 +674,15 @@"tags": ["Statistics"],- "summary": "Get Purchase Price Statistics",- "parameters": [- {- "type": "string",- "description": "start date",- "name": "start",- "in": "query"- },- {- "type": "string",- "description": "end date",- "name": "end",- "in": "query"- }- ],+ "summary": "Get Tags Statistics","responses": {"200": {"description": "OK","schema": {- "$ref": "#/definitions/repo.ValueOverTime"+ "type": "array",+ "items": {+ "$ref": "#/definitions/repo.TotalsByOrganizer"+ }}}}@@ -727,8 +727,8 @@"type": "string"},"collectionFormat": "multi",- "description": "label Ids",- "name": "labels",+ "description": "tags Ids",+ "name": "tags","in": "query"},{@@ -1514,158 +1514,6 @@}}},- "/v1/labels": {- "get": {- "security": [- {- "Bearer": []- }- ],- "produces": [- "application/json"- ],- "tags": [- "Labels"- ],- "summary": "Get All Labels",- "responses": {- "200": {- "description": "OK",- "schema": {- "type": "array",- "items": {- "$ref": "#/definitions/repo.LabelOut"- }- }- }- }- },- "post": {- "security": [- {- "Bearer": []- }- ],- "produces": [- "application/json"- ],- "tags": [- "Labels"- ],- "summary": "Create Label",- "parameters": [- {- "description": "Label Data",- "name": "payload",- "in": "body",- "required": true,- "schema": {- "$ref": "#/definitions/repo.LabelCreate"- }- }- ],- "responses": {- "200": {- "description": "OK",- "schema": {- "$ref": "#/definitions/repo.LabelSummary"- }- }- }- }- },- "/v1/labels/{id}": {- "get": {- "security": [- {- "Bearer": []- }- ],- "produces": [- "application/json"- ],- "tags": [- "Labels"- ],- "summary": "Get Label",- "parameters": [- {- "type": "string",- "description": "Label ID",- "name": "id",- "in": "path",- "required": true- }- ],- "responses": {- "200": {- "description": "OK",- "schema": {- "$ref": "#/definitions/repo.LabelOut"- }- }- }- },- "put": {- "security": [- {- "Bearer": []- }- ],- "produces": [- "application/json"- ],- "tags": [- "Labels"- ],- "summary": "Update Label",- "parameters": [- {- "type": "string",- "description": "Label ID",- "name": "id",- "in": "path",- "required": true- }- ],- "responses": {- "200": {- "description": "OK",- "schema": {- "$ref": "#/definitions/repo.LabelOut"- }- }- }- },- "delete": {- "security": [- {- "Bearer": []- }- ],- "produces": [- "application/json"- ],- "tags": [- "Labels"- ],- "summary": "Delete Label",- "parameters": [- {- "type": "string",- "description": "Label ID",- "name": "id",- "in": "path",- "required": true- }- ],- "responses": {- "204": {- "description": "No Content"- }- }- }- },"/v1/locations": {"get": {"security": [@@ -2248,6 +2096,158 @@}}},+ "/v1/tags": {+ "get": {+ "security": [+ {+ "Bearer": []+ }+ ],+ "produces": [+ "application/json"+ ],+ "tags": [+ "Tags"+ ],+ "summary": "Get All Tags",+ "responses": {+ "200": {+ "description": "OK",+ "schema": {+ "type": "array",+ "items": {+ "$ref": "#/definitions/repo.TagOut"+ }+ }+ }+ }+ },+ "post": {+ "security": [+ {+ "Bearer": []+ }+ ],+ "produces": [+ "application/json"+ ],+ "tags": [+ "Tags"+ ],+ "summary": "Create Tag",+ "parameters": [+ {+ "description": "Tag Data",+ "name": "payload",+ "in": "body",+ "required": true,+ "schema": {+ "$ref": "#/definitions/repo.TagCreate"+ }+ }+ ],+ "responses": {+ "200": {+ "description": "OK",+ "schema": {+ "$ref": "#/definitions/repo.TagSummary"+ }+ }+ }+ }+ },+ "/v1/tags/{id}": {+ "get": {+ "security": [+ {+ "Bearer": []+ }+ ],+ "produces": [+ "application/json"+ ],+ "tags": [+ "Tags"+ ],+ "summary": "Get Tag",+ "parameters": [+ {+ "type": "string",+ "description": "Tag ID",+ "name": "id",+ "in": "path",+ "required": true+ }+ ],+ "responses": {+ "200": {+ "description": "OK",+ "schema": {+ "$ref": "#/definitions/repo.TagOut"+ }+ }+ }+ },+ "put": {+ "security": [+ {+ "Bearer": []+ }+ ],+ "produces": [+ "application/json"+ ],+ "tags": [+ "Tags"+ ],+ "summary": "Update Tag",+ "parameters": [+ {+ "type": "string",+ "description": "Tag ID",+ "name": "id",+ "in": "path",+ "required": true+ }+ ],+ "responses": {+ "200": {+ "description": "OK",+ "schema": {+ "$ref": "#/definitions/repo.TagOut"+ }+ }+ }+ },+ "delete": {+ "security": [+ {+ "Bearer": []+ }+ ],+ "produces": [+ "application/json"+ ],+ "tags": [+ "Tags"+ ],+ "summary": "Delete Tag",+ "parameters": [+ {+ "type": "string",+ "description": "Tag ID",+ "name": "id",+ "in": "path",+ "required": true+ }+ ],+ "responses": {+ "204": {+ "description": "No Content"+ }+ }+ }+ },"/v1/templates": {"get": {"security": [@@ -3015,13 +3015,6 @@"$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",@@ -3036,6 +3029,13 @@"$ref": "#/definitions/ent.Notifier"}},+ "tags": {+ "description": "Tags holds the value of the tags edge.",+ "type": "array",+ "items": {+ "$ref": "#/definitions/ent.Tag"+ }+ },"users": {"description": "Users holds the value of the users edge.","type": "array",@@ -3243,13 +3243,6 @@}]},- "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.","allOf": [@@ -3272,6 +3265,13 @@"$ref": "#/definitions/ent.Item"}]+ },+ "tag": {+ "description": "Tag holds the value of the tag edge.",+ "type": "array",+ "items": {+ "$ref": "#/definitions/ent.Tag"+ }}}},@@ -3360,13 +3360,6 @@"description": "DefaultInsured holds the value of the \"default_insured\" field.","type": "boolean"},- "default_label_ids": {- "description": "Default label IDs for items created from this template",- "type": "array",- "items": {- "type": "string"- }- },"default_lifetime_warranty": {"description": "DefaultLifetimeWarranty holds the value of the \"default_lifetime_warranty\" field.","type": "boolean"@@ -3387,6 +3380,13 @@"description": "DefaultQuantity holds the value of the \"default_quantity\" field.","type": "integer"},+ "default_tag_ids": {+ "description": "Default tag IDs for items created from this template",+ "type": "array",+ "items": {+ "type": "string"+ }+ },"default_warranty_details": {"description": "DefaultWarrantyDetails holds the value of the \"default_warranty_details\" field.","type": "string"@@ -3461,63 +3461,6 @@}}},- "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.",- "allOf": [- {- "$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.",- "allOf": [- {- "$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": {@@ -3656,25 +3599,87 @@"type": "string"},"edges": {- "description": "Edges holds the relations/edges for other nodes in the graph.\nThe values are being populated by the NotifierQuery when eager-loading is set.",+ "description": "Edges holds the relations/edges for other nodes in the graph.\nThe values are being populated by the NotifierQuery when eager-loading is set.",+ "allOf": [+ {+ "$ref": "#/definitions/ent.NotifierEdges"+ }+ ]+ },+ "group_id": {+ "description": "GroupID holds the value of the \"group_id\" field.",+ "type": "string"+ },+ "id": {+ "description": "ID of the ent.",+ "type": "string"+ },+ "is_active": {+ "description": "IsActive holds the value of the \"is_active\" 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"+ },+ "user_id": {+ "description": "UserID holds the value of the \"user_id\" field.",+ "type": "string"+ }+ }+ },+ "ent.NotifierEdges": {+ "type": "object",+ "properties": {+ "group": {+ "description": "Group holds the value of the group edge.",+ "allOf": [+ {+ "$ref": "#/definitions/ent.Group"+ }+ ]+ },+ "user": {+ "description": "User holds the value of the user edge.",+ "allOf": [+ {+ "$ref": "#/definitions/ent.User"+ }+ ]+ }+ }+ },+ "ent.Tag": {+ "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 TagQuery when eager-loading is set.","allOf": [{- "$ref": "#/definitions/ent.NotifierEdges"+ "$ref": "#/definitions/ent.TagEdges"}]},- "group_id": {- "description": "GroupID holds the value of the \"group_id\" field.",- "type": "string"- },"id": {"description": "ID of the ent.","type": "string"},- "is_active": {- "description": "IsActive holds the value of the \"is_active\" field.",- "type": "boolean"- },"name": {"description": "Name holds the value of the \"name\" field.","type": "string"@@ -3682,14 +3687,10 @@"updated_at": {"description": "UpdatedAt holds the value of the \"updated_at\" field.","type": "string"- },- "user_id": {- "description": "UserID holds the value of the \"user_id\" field.",- "type": "string"}}},- "ent.NotifierEdges": {+ "ent.TagEdges": {"type": "object","properties": {"group": {@@ -3700,13 +3701,12 @@}]},- "user": {- "description": "User holds the value of the user edge.",- "allOf": [- {- "$ref": "#/definitions/ent.User"- }- ]+ "items": {+ "description": "Items holds the value of the items edge.",+ "type": "array",+ "items": {+ "$ref": "#/definitions/ent.Item"+ }}}},@@ -3968,10 +3968,10 @@"totalItems": {"type": "integer"},- "totalLabels": {+ "totalLocations": {"type": "integer"},- "totalLocations": {+ "totalTags": {"type": "integer"},"totalUsers": {@@ -4049,12 +4049,6 @@"type": "string","maxLength": 1000},- "labelIds": {- "type": "array",- "items": {- "type": "string"- }- },"locationId": {"description": "Edges","type": "string"@@ -4070,6 +4064,12 @@},"quantity": {"type": "integer"+ },+ "tagIds": {+ "type": "array",+ "items": {+ "type": "string"+ }}}},@@ -4135,12 +4135,6 @@"insured": {"type": "boolean"},- "labels": {- "type": "array",- "items": {- "$ref": "#/definitions/repo.LabelSummary"- }- },"lifetimeWarranty": {"description": "Warranty","type": "boolean"@@ -4209,6 +4203,12 @@"syncChildItemsLocations": {"type": "boolean"},+ "tags": {+ "type": "array",+ "items": {+ "$ref": "#/definitions/repo.TagSummary"+ }+ },"thumbnailId": {"type": "string","x-nullable": true,@@ -4231,14 +4231,6 @@"id": {"type": "string"},- "labelIds": {- "type": "array",- "items": {- "type": "string"- },- "x-nullable": true,- "x-omitempty": true- },"locationId": {"type": "string","x-nullable": true,@@ -4248,6 +4240,14 @@"type": "integer","x-nullable": true,"x-omitempty": true+ },+ "tagIds": {+ "type": "array",+ "items": {+ "type": "string"+ },+ "x-nullable": true,+ "x-omitempty": true}}},@@ -4292,12 +4292,6 @@"insured": {"type": "boolean"},- "labels": {- "type": "array",- "items": {- "$ref": "#/definitions/repo.LabelSummary"- }- },"location": {"description": "Edges","allOf": [@@ -4321,6 +4315,12 @@"description": "Sale details","type": "string"},+ "tags": {+ "type": "array",+ "items": {+ "$ref": "#/definitions/repo.TagSummary"+ }+ },"thumbnailId": {"type": "string","x-nullable": true,@@ -4345,18 +4345,11 @@"defaultInsured": {"type": "boolean"},- "defaultLabelIds": {- "type": "array",- "items": {- "type": "string"- },- "x-nullable": true- },"defaultLifetimeWarranty": {"type": "boolean"},"defaultLocationId": {- "description": "Default location and labels",+ "description": "Default location and tags","type": "string","x-nullable": true},@@ -4380,6 +4373,13 @@"type": "integer","x-nullable": true},+ "defaultTagIds": {+ "type": "array",+ "items": {+ "type": "string"+ },+ "x-nullable": true+ },"defaultWarrantyDetails": {"type": "string","maxLength": 1000,@@ -4429,17 +4429,11 @@"defaultInsured": {"type": "boolean"},- "defaultLabels": {- "type": "array",- "items": {- "$ref": "#/definitions/repo.TemplateLabelSummary"- }- },"defaultLifetimeWarranty": {"type": "boolean"},"defaultLocation": {- "description": "Default location and labels",+ "description": "Default location and tags","allOf": [{"$ref": "#/definitions/repo.TemplateLocationSummary"@@ -4459,6 +4453,12 @@"description": "Default values for items","type": "integer"},+ "defaultTags": {+ "type": "array",+ "items": {+ "$ref": "#/definitions/repo.TemplateTagSummary"+ }+ },"defaultWarrantyDetails": {"type": "string"},@@ -4530,18 +4530,11 @@"defaultInsured": {"type": "boolean"},- "defaultLabelIds": {- "type": "array",- "items": {- "type": "string"- },- "x-nullable": true- },"defaultLifetimeWarranty": {"type": "boolean"},"defaultLocationId": {- "description": "Default location and labels",+ "description": "Default location and tags","type": "string","x-nullable": true},@@ -4565,6 +4558,13 @@"type": "integer","x-nullable": true},+ "defaultTagIds": {+ "type": "array",+ "items": {+ "type": "string"+ },+ "x-nullable": true+ },"defaultWarrantyDetails": {"type": "string","maxLength": 1000,@@ -4644,12 +4644,6 @@"insured": {"type": "boolean"},- "labelIds": {- "type": "array",- "items": {- "type": "string"- }- },"lifetimeWarranty": {"description": "Warranty","type": "boolean"@@ -4717,6 +4711,12 @@"syncChildItemsLocations": {"type": "boolean"},+ "tagIds": {+ "type": "array",+ "items": {+ "type": "string"+ }+ },"warrantyDetails": {"type": "string"},@@ -4725,72 +4725,6 @@}}},- "repo.LabelCreate": {- "type": "object",- "required": [- "name"- ],- "properties": {- "color": {- "type": "string"- },- "description": {- "type": "string",- "maxLength": 1000- },- "name": {- "type": "string",- "maxLength": 255,- "minLength": 1- }- }- },- "repo.LabelOut": {- "type": "object",- "properties": {- "color": {- "type": "string"- },- "createdAt": {- "type": "string"- },- "description": {- "type": "string"- },- "id": {- "type": "string"- },- "name": {- "type": "string"- },- "updatedAt": {- "type": "string"- }- }- },- "repo.LabelSummary": {- "type": "object",- "properties": {- "color": {- "type": "string"- },- "createdAt": {- "type": "string"- },- "description": {- "type": "string"- },- "id": {- "type": "string"- },- "name": {- "type": "string"- },- "updatedAt": {- "type": "string"- }- }- },"repo.LocationCreate": {"type": "object","properties": {@@ -5100,6 +5034,72 @@}}},+ "repo.TagCreate": {+ "type": "object",+ "required": [+ "name"+ ],+ "properties": {+ "color": {+ "type": "string"+ },+ "description": {+ "type": "string",+ "maxLength": 1000+ },+ "name": {+ "type": "string",+ "maxLength": 255,+ "minLength": 1+ }+ }+ },+ "repo.TagOut": {+ "type": "object",+ "properties": {+ "color": {+ "type": "string"+ },+ "createdAt": {+ "type": "string"+ },+ "description": {+ "type": "string"+ },+ "id": {+ "type": "string"+ },+ "name": {+ "type": "string"+ },+ "updatedAt": {+ "type": "string"+ }+ }+ },+ "repo.TagSummary": {+ "type": "object",+ "properties": {+ "color": {+ "type": "string"+ },+ "createdAt": {+ "type": "string"+ },+ "description": {+ "type": "string"+ },+ "id": {+ "type": "string"+ },+ "name": {+ "type": "string"+ },+ "updatedAt": {+ "type": "string"+ }+ }+ },"repo.TemplateField": {"type": "object","properties": {@@ -5117,7 +5117,7 @@}}},- "repo.TemplateLabelSummary": {+ "repo.TemplateLocationSummary": {"type": "object","properties": {"id": {@@ -5128,7 +5128,7 @@}}},- "repo.TemplateLocationSummary": {+ "repo.TemplateTagSummary": {"type": "object","properties": {"id": {@@ -5476,12 +5476,6 @@"type": "string","maxLength": 1000},- "labelIds": {- "type": "array",- "items": {- "type": "string"- }- },"locationId": {"type": "string"},@@ -5492,6 +5486,12 @@},"quantity": {"type": "integer"+ },+ "tagIds": {+ "type": "array",+ "items": {+ "type": "string"+ }}}},@@ -5545,14 +5545,14 @@"v1.WipeInventoryOptions": {"type": "object","properties": {- "wipeLabels": {- "type": "boolean"- },"wipeLocations": {"type": "boolean"},"wipeMaintenance": {"type": "boolean"+ },+ "wipeTags": {+ "type": "boolean"}}},diff --git a/docs/en/api/openapi-2.0.yaml b/docs/en/api/openapi-2.0.yamlindex 96c17e8c..f42a9d9e 100644--- a/docs/en/api/openapi-2.0.yaml+++ b/docs/en/api/openapi-2.0.yaml@@ -189,11 +189,6 @@ definitions:items:$ref: '#/definitions/ent.Item'type: array- labels:- description: Labels holds the value of the labels edge.- items:- $ref: '#/definitions/ent.Label'- type: arraylocations:description: Locations holds the value of the locations edge.items:@@ -204,6 +199,11 @@ definitions:items:$ref: '#/definitions/ent.Notifier'type: array+ tags:+ description: Tags holds the value of the tags edge.+ items:+ $ref: '#/definitions/ent.Tag'+ type: arrayusers:description: Users holds the value of the users edge.items:@@ -352,11 +352,6 @@ definitions:allOf:- $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: arraylocation:allOf:- $ref: '#/definitions/ent.Location'@@ -371,6 +366,11 @@ definitions:allOf:- $ref: '#/definitions/ent.Item'description: Parent holds the value of the parent edge.+ tag:+ description: Tag holds the value of the tag edge.+ items:+ $ref: '#/definitions/ent.Tag'+ type: arraytype: objectent.ItemField:properties:@@ -430,11 +430,6 @@ definitions:default_insured:description: DefaultInsured holds the value of the "default_insured" field.type: boolean- default_label_ids:- description: Default label IDs for items created from this template- items:- type: string- type: arraydefault_lifetime_warranty:description: DefaultLifetimeWarranty holds the value of the "default_lifetime_warranty"field.@@ -452,6 +447,11 @@ definitions:default_quantity:description: DefaultQuantity holds the value of the "default_quantity" field.type: integer+ default_tag_ids:+ description: Default tag IDs for items created from this template+ items:+ type: string+ type: arraydefault_warranty_details:description: DefaultWarrantyDetails holds the value of the "default_warranty_details"field.@@ -505,45 +505,6 @@ definitions:- $ref: '#/definitions/ent.Location'description: Location holds the value of the location 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:- allOf:- - $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:- 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- type: objectent.Location:properties:created_at:@@ -673,6 +634,45 @@ definitions:- $ref: '#/definitions/ent.User'description: User holds the value of the user edge.type: object+ ent.Tag:+ 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.TagEdges'+ description: |-+ Edges holds the relations/edges for other nodes in the graph.+ The values are being populated by the TagQuery 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.TagEdges:+ 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.+ items:+ $ref: '#/definitions/ent.Item'+ type: array+ type: objectent.TemplateField:properties:created_at:@@ -849,10 +849,10 @@ definitions:type: numbertotalItems:type: integer- totalLabels:- type: integertotalLocations:type: integer+ totalTags:+ type: integertotalUsers:type: integertotalWithWarranty:@@ -900,10 +900,6 @@ definitions:description:maxLength: 1000type: string- labelIds:- items:- type: string- type: arraylocationId:description: Edgestype: string@@ -916,6 +912,10 @@ definitions:x-nullable: truequantity:type: integer+ tagIds:+ items:+ type: string+ type: arrayrequired:- nametype: object@@ -961,10 +961,6 @@ definitions:x-omitempty: trueinsured:type: boolean- labels:- items:- $ref: '#/definitions/repo.LabelSummary'- type: arraylifetimeWarranty:description: Warrantytype: boolean@@ -1010,6 +1006,10 @@ definitions:type: stringsyncChildItemsLocations:type: boolean+ tags:+ items:+ $ref: '#/definitions/repo.TagSummary'+ type: arraythumbnailId:type: stringx-nullable: true@@ -1025,12 +1025,6 @@ definitions:properties:id:type: string- labelIds:- items:- type: string- type: array- x-nullable: true- x-omitempty: truelocationId:type: stringx-nullable: true@@ -1039,6 +1033,12 @@ definitions:type: integerx-nullable: truex-omitempty: true+ tagIds:+ items:+ type: string+ type: array+ x-nullable: true+ x-omitempty: truetype: objectrepo.ItemPath:properties:@@ -1068,10 +1068,6 @@ definitions:x-omitempty: trueinsured:type: boolean- labels:- items:- $ref: '#/definitions/repo.LabelSummary'- type: arraylocation:allOf:- $ref: '#/definitions/repo.LocationSummary'@@ -1087,6 +1083,10 @@ definitions:soldTime:description: Sale detailstype: string+ tags:+ items:+ $ref: '#/definitions/repo.TagSummary'+ type: arraythumbnailId:type: stringx-nullable: true@@ -1102,15 +1102,10 @@ definitions:x-nullable: truedefaultInsured:type: boolean- defaultLabelIds:- items:- type: string- type: array- x-nullable: truedefaultLifetimeWarranty:type: booleandefaultLocationId:- description: Default location and labels+ description: Default location and tagstype: stringx-nullable: truedefaultManufacturer:@@ -1129,6 +1124,11 @@ definitions:description: Default values for itemstype: integerx-nullable: true+ defaultTagIds:+ items:+ type: string+ type: array+ x-nullable: truedefaultWarrantyDetails:maxLength: 1000type: string@@ -1166,16 +1166,12 @@ definitions:type: stringdefaultInsured:type: boolean- defaultLabels:- items:- $ref: '#/definitions/repo.TemplateLabelSummary'- type: arraydefaultLifetimeWarranty:type: booleandefaultLocation:allOf:- $ref: '#/definitions/repo.TemplateLocationSummary'- description: Default location and labels+ description: Default location and tagsdefaultManufacturer:type: stringdefaultModelNumber:@@ -1185,6 +1181,10 @@ definitions:defaultQuantity:description: Default values for itemstype: integer+ defaultTags:+ items:+ $ref: '#/definitions/repo.TemplateTagSummary'+ type: arraydefaultWarrantyDetails:type: stringdescription:@@ -1231,15 +1231,10 @@ definitions:x-nullable: truedefaultInsured:type: boolean- defaultLabelIds:- items:- type: string- type: array- x-nullable: truedefaultLifetimeWarranty:type: booleandefaultLocationId:- description: Default location and labels+ description: Default location and tagstype: stringx-nullable: truedefaultManufacturer:@@ -1258,6 +1253,11 @@ definitions:description: Default values for itemstype: integerx-nullable: true+ defaultTagIds:+ items:+ type: string+ type: array+ x-nullable: truedefaultWarrantyDetails:maxLength: 1000type: string@@ -1314,10 +1314,6 @@ definitions:type: stringinsured:type: boolean- labelIds:- items:- type: string- type: arraylifetimeWarranty:description: Warrantytype: boolean@@ -1368,6 +1364,10 @@ definitions:type: stringsyncChildItemsLocations:type: boolean+ tagIds:+ items:+ type: string+ type: arraywarrantyDetails:type: stringwarrantyExpires:@@ -1375,50 +1375,6 @@ definitions:required:- nametype: object- repo.LabelCreate:- properties:- color:- type: string- description:- maxLength: 1000- type: string- name:- maxLength: 255- minLength: 1- type: string- required:- - name- type: object- repo.LabelOut:- properties:- color:- type: string- createdAt:- type: string- description:- type: string- id:- type: string- name:- type: string- updatedAt:- type: string- type: object- repo.LabelSummary:- properties:- color:- type: string- createdAt:- type: string- description:- type: string- id:- type: string- name:- type: string- updatedAt:- type: string- type: objectrepo.LocationCreate:properties:description:@@ -1626,6 +1582,50 @@ definitions:total:type: integertype: object+ repo.TagCreate:+ properties:+ color:+ type: string+ description:+ maxLength: 1000+ type: string+ name:+ maxLength: 255+ minLength: 1+ type: string+ required:+ - name+ type: object+ repo.TagOut:+ properties:+ color:+ type: string+ createdAt:+ type: string+ description:+ type: string+ id:+ type: string+ name:+ type: string+ updatedAt:+ type: string+ type: object+ repo.TagSummary:+ properties:+ color:+ type: string+ createdAt:+ type: string+ description:+ type: string+ id:+ type: string+ name:+ type: string+ updatedAt:+ type: string+ type: objectrepo.TemplateField:properties:id:@@ -1637,14 +1637,14 @@ definitions:type:type: stringtype: object- repo.TemplateLabelSummary:+ repo.TemplateLocationSummary:properties:id:type: stringname:type: stringtype: object- repo.TemplateLocationSummary:+ repo.TemplateTagSummary:properties:id:type: string@@ -1869,10 +1869,6 @@ definitions:description:maxLength: 1000type: string- labelIds:- items:- type: string- type: arraylocationId:type: stringname:@@ -1881,6 +1877,10 @@ definitions:type: stringquantity:type: integer+ tagIds:+ items:+ type: string+ type: arrayrequired:- locationId- name@@ -1918,12 +1918,12 @@ definitions:type: objectv1.WipeInventoryOptions:properties:- wipeLabels:- type: booleanwipeLocations:type: booleanwipeMaintenance:type: boolean+ wipeTags:+ type: booleantype: objectv1.Wrapped:properties:@@ -2293,22 +2293,6 @@ paths:summary: Get Group Statisticstags:- Statistics- /v1/groups/statistics/labels:- get:- produces:- - application/json- responses:- "200":- description: OK- schema:- items:- $ref: '#/definitions/repo.TotalsByOrganizer'- type: array- security:- - Bearer: []- summary: Get Label Statistics- tags:- - Statistics/v1/groups/statistics/locations:get:produces:@@ -2348,6 +2332,22 @@ paths:summary: Get Purchase Price Statisticstags:- Statistics+ /v1/groups/statistics/tags:+ get:+ produces:+ - application/json+ responses:+ "200":+ description: OK+ schema:+ items:+ $ref: '#/definitions/repo.TotalsByOrganizer'+ type: array+ security:+ - Bearer: []+ summary: Get Tags Statistics+ tags:+ - Statistics/v1/items:get:parameters:@@ -2364,11 +2364,11 @@ paths:name: pageSizetype: integer- collectionFormat: multi- description: label Ids+ description: tags Idsin: queryitems:type: string- name: labels+ name: tagstype: array- collectionFormat: multidescription: location Ids@@ -2862,98 +2862,6 @@ paths:summary: Get Location labeltags:- Locations- /v1/labels:- get:- produces:- - application/json- responses:- "200":- description: OK- schema:- items:- $ref: '#/definitions/repo.LabelOut'- type: array- security:- - Bearer: []- summary: Get All Labels- tags:- - Labels- post:- parameters:- - description: Label Data- in: body- name: payload- required: true- schema:- $ref: '#/definitions/repo.LabelCreate'- produces:- - application/json- responses:- "200":- description: OK- schema:- $ref: '#/definitions/repo.LabelSummary'- security:- - Bearer: []- summary: Create Label- tags:- - Labels- /v1/labels/{id}:- delete:- parameters:- - description: Label ID- in: path- name: id- required: true- type: string- produces:- - application/json- responses:- "204":- description: No Content- security:- - Bearer: []- summary: Delete Label- tags:- - Labels- get:- parameters:- - description: Label ID- in: path- name: id- required: true- type: string- produces:- - application/json- responses:- "200":- description: OK- schema:- $ref: '#/definitions/repo.LabelOut'- security:- - Bearer: []- summary: Get Label- tags:- - Labels- put:- parameters:- - description: Label ID- in: path- name: id- required: true- type: string- produces:- - application/json- responses:- "200":- description: OK- schema:- $ref: '#/definitions/repo.LabelOut'- security:- - Bearer: []- summary: Update Label- tags:- - Labels/v1/locations:get:parameters:@@ -3308,6 +3216,98 @@ paths:summary: Application Infotags:- Base+ /v1/tags:+ get:+ produces:+ - application/json+ responses:+ "200":+ description: OK+ schema:+ items:+ $ref: '#/definitions/repo.TagOut'+ type: array+ security:+ - Bearer: []+ summary: Get All Tags+ tags:+ - Tags+ post:+ parameters:+ - description: Tag Data+ in: body+ name: payload+ required: true+ schema:+ $ref: '#/definitions/repo.TagCreate'+ produces:+ - application/json+ responses:+ "200":+ description: OK+ schema:+ $ref: '#/definitions/repo.TagSummary'+ security:+ - Bearer: []+ summary: Create Tag+ tags:+ - Tags+ /v1/tags/{id}:+ delete:+ parameters:+ - description: Tag ID+ in: path+ name: id+ required: true+ type: string+ produces:+ - application/json+ responses:+ "204":+ description: No Content+ security:+ - Bearer: []+ summary: Delete Tag+ tags:+ - Tags+ get:+ parameters:+ - description: Tag ID+ in: path+ name: id+ required: true+ type: string+ produces:+ - application/json+ responses:+ "200":+ description: OK+ schema:+ $ref: '#/definitions/repo.TagOut'+ security:+ - Bearer: []+ summary: Get Tag+ tags:+ - Tags+ put:+ parameters:+ - description: Tag ID+ in: path+ name: id+ required: true+ type: string+ produces:+ - application/json+ responses:+ "200":+ description: OK+ schema:+ $ref: '#/definitions/repo.TagOut'+ security:+ - Bearer: []+ summary: Update Tag+ tags:+ - Tags/v1/templates:get:produces:diff --git a/docs/en/api/openapi-3.0.json b/docs/en/api/openapi-3.0.jsonindex 58eb9a09..afb7ef32 100644--- a/docs/en/api/openapi-3.0.json+++ b/docs/en/api/openapi-3.0.json@@ -603,34 +603,6 @@}}},- "/v1/groups/statistics/labels": {- "get": {- "security": [- {- "Bearer": []- }- ],- "tags": [- "Statistics"- ],- "summary": "Get Label Statistics",- "responses": {- "200": {- "description": "OK",- "content": {- "application/json": {- "schema": {- "type": "array",- "items": {- "$ref": "#/components/schemas/repo.TotalsByOrganizer"- }- }- }- }- }- }- }- },"/v1/groups/statistics/locations": {"get": {"security": [@@ -702,6 +674,34 @@}}},+ "/v1/groups/statistics/tags": {+ "get": {+ "security": [+ {+ "Bearer": []+ }+ ],+ "tags": [+ "Statistics"+ ],+ "summary": "Get Tags Statistics",+ "responses": {+ "200": {+ "description": "OK",+ "content": {+ "application/json": {+ "schema": {+ "type": "array",+ "items": {+ "$ref": "#/components/schemas/repo.TotalsByOrganizer"+ }+ }+ }+ }+ }+ }+ }+ },"/v1/items": {"get": {"security": [@@ -739,8 +739,8 @@}},{- "description": "label Ids",- "name": "labels",+ "description": "tags Ids",+ "name": "tags","in": "query","explode": true,"schema": {@@ -1628,165 +1628,6 @@}}},- "/v1/labels": {- "get": {- "security": [- {- "Bearer": []- }- ],- "tags": [- "Labels"- ],- "summary": "Get All Labels",- "responses": {- "200": {- "description": "OK",- "content": {- "application/json": {- "schema": {- "type": "array",- "items": {- "$ref": "#/components/schemas/repo.LabelOut"- }- }- }- }- }- }- },- "post": {- "security": [- {- "Bearer": []- }- ],- "tags": [- "Labels"- ],- "summary": "Create Label",- "requestBody": {- "content": {- "application/json": {- "schema": {- "$ref": "#/components/schemas/repo.LabelCreate"- }- }- },- "description": "Label Data",- "required": true- },- "responses": {- "200": {- "description": "OK",- "content": {- "application/json": {- "schema": {- "$ref": "#/components/schemas/repo.LabelSummary"- }- }- }- }- }- }- },- "/v1/labels/{id}": {- "get": {- "security": [- {- "Bearer": []- }- ],- "tags": [- "Labels"- ],- "summary": "Get Label",- "parameters": [- {- "description": "Label ID",- "name": "id",- "in": "path",- "required": true,- "schema": {- "type": "string"- }- }- ],- "responses": {- "200": {- "description": "OK",- "content": {- "application/json": {- "schema": {- "$ref": "#/components/schemas/repo.LabelOut"- }- }- }- }- }- },- "put": {- "security": [- {- "Bearer": []- }- ],- "tags": [- "Labels"- ],- "summary": "Update Label",- "parameters": [- {- "description": "Label ID",- "name": "id",- "in": "path",- "required": true,- "schema": {- "type": "string"- }- }- ],- "responses": {- "200": {- "description": "OK",- "content": {- "application/json": {- "schema": {- "$ref": "#/components/schemas/repo.LabelOut"- }- }- }- }- }- },- "delete": {- "security": [- {- "Bearer": []- }- ],- "tags": [- "Labels"- ],- "summary": "Delete Label",- "parameters": [- {- "description": "Label ID",- "name": "id",- "in": "path",- "required": true,- "schema": {- "type": "string"- }- }- ],- "responses": {- "204": {- "description": "No Content"- }- }- }- },"/v1/locations": {"get": {"security": [@@ -2409,7 +2250,7 @@}}},- "/v1/templates": {+ "/v1/tags": {"get": {"security": [{@@ -2417,9 +2258,9 @@}],"tags": [- "Item Templates"+ "Tags"],- "summary": "Get All Item Templates",+ "summary": "Get All Tags","responses": {"200": {"description": "OK",@@ -2428,7 +2269,7 @@"schema": {"type": "array","items": {- "$ref": "#/components/schemas/repo.ItemTemplateSummary"+ "$ref": "#/components/schemas/repo.TagOut"}}}@@ -2443,27 +2284,27 @@}],"tags": [- "Item Templates"+ "Tags"],- "summary": "Create Item Template",+ "summary": "Create Tag","requestBody": {"content": {"application/json": {"schema": {- "$ref": "#/components/schemas/repo.ItemTemplateCreate"+ "$ref": "#/components/schemas/repo.TagCreate"}}},- "description": "Template Data",+ "description": "Tag Data","required": true},"responses": {- "201": {- "description": "Created",+ "200": {+ "description": "OK","content": {"application/json": {"schema": {- "$ref": "#/components/schemas/repo.ItemTemplateOut"+ "$ref": "#/components/schemas/repo.TagSummary"}}}@@ -2471,7 +2312,7 @@}}},- "/v1/templates/{id}": {+ "/v1/tags/{id}": {"get": {"security": [{@@ -2479,12 +2320,12 @@}],"tags": [- "Item Templates"+ "Tags"],- "summary": "Get Item Template",+ "summary": "Get Tag","parameters": [{- "description": "Template ID",+ "description": "Tag ID","name": "id","in": "path","required": true,@@ -2499,7 +2340,7 @@"content": {"application/json": {"schema": {- "$ref": "#/components/schemas/repo.ItemTemplateOut"+ "$ref": "#/components/schemas/repo.TagOut"}}}@@ -2513,12 +2354,12 @@}],"tags": [- "Item Templates"+ "Tags"],- "summary": "Update Item Template",+ "summary": "Update Tag","parameters": [{- "description": "Template ID",+ "description": "Tag ID","name": "id","in": "path","required": true,@@ -2527,24 +2368,13 @@}}],- "requestBody": {- "content": {- "application/json": {- "schema": {- "$ref": "#/components/schemas/repo.ItemTemplateUpdate"- }- }- },- "description": "Template Data",- "required": true- },"responses": {"200": {"description": "OK","content": {"application/json": {"schema": {- "$ref": "#/components/schemas/repo.ItemTemplateOut"+ "$ref": "#/components/schemas/repo.TagOut"}}}@@ -2558,12 +2388,12 @@}],"tags": [- "Item Templates"+ "Tags"],- "summary": "Delete Item Template",+ "summary": "Delete Tag","parameters": [{- "description": "Template ID",+ "description": "Tag ID","name": "id","in": "path","required": true,@@ -2579,8 +2409,8 @@}}},- "/v1/templates/{id}/create-item": {- "post": {+ "/v1/templates": {+ "get": {"security": [{"Bearer": []@@ -2589,21 +2419,191 @@"tags": ["Item Templates"],- "summary": "Create Item from Template",- "parameters": [- {- "description": "Template ID",- "name": "id",- "in": "path",- "required": true,- "schema": {- "type": "string"+ "summary": "Get All Item Templates",+ "responses": {+ "200": {+ "description": "OK",+ "content": {+ "application/json": {+ "schema": {+ "type": "array",+ "items": {+ "$ref": "#/components/schemas/repo.ItemTemplateSummary"+ }+ }+ }}}- ],- "requestBody": {- "content": {- "application/json": {+ }+ },+ "post": {+ "security": [+ {+ "Bearer": []+ }+ ],+ "tags": [+ "Item Templates"+ ],+ "summary": "Create Item Template",+ "requestBody": {+ "content": {+ "application/json": {+ "schema": {+ "$ref": "#/components/schemas/repo.ItemTemplateCreate"+ }+ }+ },+ "description": "Template Data",+ "required": true+ },+ "responses": {+ "201": {+ "description": "Created",+ "content": {+ "application/json": {+ "schema": {+ "$ref": "#/components/schemas/repo.ItemTemplateOut"+ }+ }+ }+ }+ }+ }+ },+ "/v1/templates/{id}": {+ "get": {+ "security": [+ {+ "Bearer": []+ }+ ],+ "tags": [+ "Item Templates"+ ],+ "summary": "Get Item Template",+ "parameters": [+ {+ "description": "Template ID",+ "name": "id",+ "in": "path",+ "required": true,+ "schema": {+ "type": "string"+ }+ }+ ],+ "responses": {+ "200": {+ "description": "OK",+ "content": {+ "application/json": {+ "schema": {+ "$ref": "#/components/schemas/repo.ItemTemplateOut"+ }+ }+ }+ }+ }+ },+ "put": {+ "security": [+ {+ "Bearer": []+ }+ ],+ "tags": [+ "Item Templates"+ ],+ "summary": "Update Item Template",+ "parameters": [+ {+ "description": "Template ID",+ "name": "id",+ "in": "path",+ "required": true,+ "schema": {+ "type": "string"+ }+ }+ ],+ "requestBody": {+ "content": {+ "application/json": {+ "schema": {+ "$ref": "#/components/schemas/repo.ItemTemplateUpdate"+ }+ }+ },+ "description": "Template Data",+ "required": true+ },+ "responses": {+ "200": {+ "description": "OK",+ "content": {+ "application/json": {+ "schema": {+ "$ref": "#/components/schemas/repo.ItemTemplateOut"+ }+ }+ }+ }+ }+ },+ "delete": {+ "security": [+ {+ "Bearer": []+ }+ ],+ "tags": [+ "Item Templates"+ ],+ "summary": "Delete Item Template",+ "parameters": [+ {+ "description": "Template ID",+ "name": "id",+ "in": "path",+ "required": true,+ "schema": {+ "type": "string"+ }+ }+ ],+ "responses": {+ "204": {+ "description": "No Content"+ }+ }+ }+ },+ "/v1/templates/{id}/create-item": {+ "post": {+ "security": [+ {+ "Bearer": []+ }+ ],+ "tags": [+ "Item Templates"+ ],+ "summary": "Create Item from Template",+ "parameters": [+ {+ "description": "Template ID",+ "name": "id",+ "in": "path",+ "required": true,+ "schema": {+ "type": "string"+ }+ }+ ],+ "requestBody": {+ "content": {+ "application/json": {"schema": {"$ref": "#/components/schemas/v1.ItemTemplateCreateItemRequest"}@@ -3214,13 +3214,6 @@"$ref": "#/components/schemas/ent.Item"}},- "labels": {- "description": "Labels holds the value of the labels edge.",- "type": "array",- "items": {- "$ref": "#/components/schemas/ent.Label"- }- },"locations": {"description": "Locations holds the value of the locations edge.","type": "array",@@ -3235,6 +3228,13 @@"$ref": "#/components/schemas/ent.Notifier"}},+ "tags": {+ "description": "Tags holds the value of the tags edge.",+ "type": "array",+ "items": {+ "$ref": "#/components/schemas/ent.Tag"+ }+ },"users": {"description": "Users holds the value of the users edge.","type": "array",@@ -3442,13 +3442,6 @@}]},- "label": {- "description": "Label holds the value of the label edge.",- "type": "array",- "items": {- "$ref": "#/components/schemas/ent.Label"- }- },"location": {"description": "Location holds the value of the location edge.","allOf": [@@ -3471,6 +3464,13 @@"$ref": "#/components/schemas/ent.Item"}]+ },+ "tag": {+ "description": "Tag holds the value of the tag edge.",+ "type": "array",+ "items": {+ "$ref": "#/components/schemas/ent.Tag"+ }}}},@@ -3559,13 +3559,6 @@"description": "DefaultInsured holds the value of the \"default_insured\" field.","type": "boolean"},- "default_label_ids": {- "description": "Default label IDs for items created from this template",- "type": "array",- "items": {- "type": "string"- }- },"default_lifetime_warranty": {"description": "DefaultLifetimeWarranty holds the value of the \"default_lifetime_warranty\" field.","type": "boolean"@@ -3586,6 +3579,13 @@"description": "DefaultQuantity holds the value of the \"default_quantity\" field.","type": "integer"},+ "default_tag_ids": {+ "description": "Default tag IDs for items created from this template",+ "type": "array",+ "items": {+ "type": "string"+ }+ },"default_warranty_details": {"description": "DefaultWarrantyDetails holds the value of the \"default_warranty_details\" field.","type": "string"@@ -3660,63 +3660,6 @@}}},- "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.",- "allOf": [- {- "$ref": "#/components/schemas/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.",- "allOf": [- {- "$ref": "#/components/schemas/ent.Group"- }- ]- },- "items": {- "description": "Items holds the value of the items edge.",- "type": "array",- "items": {- "$ref": "#/components/schemas/ent.Item"- }- }- }- },"ent.Location": {"type": "object","properties": {@@ -3855,25 +3798,87 @@"type": "string"},"edges": {- "description": "Edges holds the relations/edges for other nodes in the graph.\nThe values are being populated by the NotifierQuery when eager-loading is set.",+ "description": "Edges holds the relations/edges for other nodes in the graph.\nThe values are being populated by the NotifierQuery when eager-loading is set.",+ "allOf": [+ {+ "$ref": "#/components/schemas/ent.NotifierEdges"+ }+ ]+ },+ "group_id": {+ "description": "GroupID holds the value of the \"group_id\" field.",+ "type": "string"+ },+ "id": {+ "description": "ID of the ent.",+ "type": "string"+ },+ "is_active": {+ "description": "IsActive holds the value of the \"is_active\" 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"+ },+ "user_id": {+ "description": "UserID holds the value of the \"user_id\" field.",+ "type": "string"+ }+ }+ },+ "ent.NotifierEdges": {+ "type": "object",+ "properties": {+ "group": {+ "description": "Group holds the value of the group edge.",+ "allOf": [+ {+ "$ref": "#/components/schemas/ent.Group"+ }+ ]+ },+ "user": {+ "description": "User holds the value of the user edge.",+ "allOf": [+ {+ "$ref": "#/components/schemas/ent.User"+ }+ ]+ }+ }+ },+ "ent.Tag": {+ "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 TagQuery when eager-loading is set.","allOf": [{- "$ref": "#/components/schemas/ent.NotifierEdges"+ "$ref": "#/components/schemas/ent.TagEdges"}]},- "group_id": {- "description": "GroupID holds the value of the \"group_id\" field.",- "type": "string"- },"id": {"description": "ID of the ent.","type": "string"},- "is_active": {- "description": "IsActive holds the value of the \"is_active\" field.",- "type": "boolean"- },"name": {"description": "Name holds the value of the \"name\" field.","type": "string"@@ -3881,14 +3886,10 @@"updated_at": {"description": "UpdatedAt holds the value of the \"updated_at\" field.","type": "string"- },- "user_id": {- "description": "UserID holds the value of the \"user_id\" field.",- "type": "string"}}},- "ent.NotifierEdges": {+ "ent.TagEdges": {"type": "object","properties": {"group": {@@ -3899,13 +3900,12 @@}]},- "user": {- "description": "User holds the value of the user edge.",- "allOf": [- {- "$ref": "#/components/schemas/ent.User"- }- ]+ "items": {+ "description": "Items holds the value of the items edge.",+ "type": "array",+ "items": {+ "$ref": "#/components/schemas/ent.Item"+ }}}},@@ -4167,10 +4167,10 @@"totalItems": {"type": "integer"},- "totalLabels": {+ "totalLocations": {"type": "integer"},- "totalLocations": {+ "totalTags": {"type": "integer"},"totalUsers": {@@ -4248,12 +4248,6 @@"type": "string","maxLength": 1000},- "labelIds": {- "type": "array",- "items": {- "type": "string"- }- },"locationId": {"description": "Edges","type": "string"@@ -4269,6 +4263,12 @@},"quantity": {"type": "integer"+ },+ "tagIds": {+ "type": "array",+ "items": {+ "type": "string"+ }}}},@@ -4334,12 +4334,6 @@"insured": {"type": "boolean"},- "labels": {- "type": "array",- "items": {- "$ref": "#/components/schemas/repo.LabelSummary"- }- },"lifetimeWarranty": {"description": "Warranty","type": "boolean"@@ -4408,6 +4402,12 @@"syncChildItemsLocations": {"type": "boolean"},+ "tags": {+ "type": "array",+ "items": {+ "$ref": "#/components/schemas/repo.TagSummary"+ }+ },"thumbnailId": {"type": "string","x-omitempty": true,@@ -4430,14 +4430,6 @@"id": {"type": "string"},- "labelIds": {- "type": "array",- "items": {- "type": "string"- },- "x-omitempty": true,- "nullable": true- },"locationId": {"type": "string","x-omitempty": true,@@ -4447,6 +4439,14 @@"type": "integer","x-omitempty": true,"nullable": true+ },+ "tagIds": {+ "type": "array",+ "items": {+ "type": "string"+ },+ "x-omitempty": true,+ "nullable": true}}},@@ -4491,12 +4491,6 @@"insured": {"type": "boolean"},- "labels": {- "type": "array",- "items": {- "$ref": "#/components/schemas/repo.LabelSummary"- }- },"location": {"description": "Edges","allOf": [@@ -4520,6 +4514,12 @@"description": "Sale details","type": "string"},+ "tags": {+ "type": "array",+ "items": {+ "$ref": "#/components/schemas/repo.TagSummary"+ }+ },"thumbnailId": {"type": "string","x-omitempty": true,@@ -4544,18 +4544,11 @@"defaultInsured": {"type": "boolean"},- "defaultLabelIds": {- "type": "array",- "items": {- "type": "string"- },- "nullable": true- },"defaultLifetimeWarranty": {"type": "boolean"},"defaultLocationId": {- "description": "Default location and labels",+ "description": "Default location and tags","type": "string","nullable": true},@@ -4579,6 +4572,13 @@"type": "integer","nullable": true},+ "defaultTagIds": {+ "type": "array",+ "items": {+ "type": "string"+ },+ "nullable": true+ },"defaultWarrantyDetails": {"type": "string","maxLength": 1000,@@ -4628,17 +4628,11 @@"defaultInsured": {"type": "boolean"},- "defaultLabels": {- "type": "array",- "items": {- "$ref": "#/components/schemas/repo.TemplateLabelSummary"- }- },"defaultLifetimeWarranty": {"type": "boolean"},"defaultLocation": {- "description": "Default location and labels",+ "description": "Default location and tags","allOf": [{"$ref": "#/components/schemas/repo.TemplateLocationSummary"@@ -4658,6 +4652,12 @@"description": "Default values for items","type": "integer"},+ "defaultTags": {+ "type": "array",+ "items": {+ "$ref": "#/components/schemas/repo.TemplateTagSummary"+ }+ },"defaultWarrantyDetails": {"type": "string"},@@ -4729,18 +4729,11 @@"defaultInsured": {"type": "boolean"},- "defaultLabelIds": {- "type": "array",- "items": {- "type": "string"- },- "nullable": true- },"defaultLifetimeWarranty": {"type": "boolean"},"defaultLocationId": {- "description": "Default location and labels",+ "description": "Default location and tags","type": "string","nullable": true},@@ -4764,6 +4757,13 @@"type": "integer","nullable": true},+ "defaultTagIds": {+ "type": "array",+ "items": {+ "type": "string"+ },+ "nullable": true+ },"defaultWarrantyDetails": {"type": "string","maxLength": 1000,@@ -4843,12 +4843,6 @@"insured": {"type": "boolean"},- "labelIds": {- "type": "array",- "items": {- "type": "string"- }- },"lifetimeWarranty": {"description": "Warranty","type": "boolean"@@ -4916,6 +4910,12 @@"syncChildItemsLocations": {"type": "boolean"},+ "tagIds": {+ "type": "array",+ "items": {+ "type": "string"+ }+ },"warrantyDetails": {"type": "string"},@@ -4924,72 +4924,6 @@}}},- "repo.LabelCreate": {- "type": "object",- "required": [- "name"- ],- "properties": {- "color": {- "type": "string"- },- "description": {- "type": "string",- "maxLength": 1000- },- "name": {- "type": "string",- "maxLength": 255,- "minLength": 1- }- }- },- "repo.LabelOut": {- "type": "object",- "properties": {- "color": {- "type": "string"- },- "createdAt": {- "type": "string"- },- "description": {- "type": "string"- },- "id": {- "type": "string"- },- "name": {- "type": "string"- },- "updatedAt": {- "type": "string"- }- }- },- "repo.LabelSummary": {- "type": "object",- "properties": {- "color": {- "type": "string"- },- "createdAt": {- "type": "string"- },- "description": {- "type": "string"- },- "id": {- "type": "string"- },- "name": {- "type": "string"- },- "updatedAt": {- "type": "string"- }- }- },"repo.LocationCreate": {"type": "object","properties": {@@ -5299,6 +5233,72 @@}}},+ "repo.TagCreate": {+ "type": "object",+ "required": [+ "name"+ ],+ "properties": {+ "color": {+ "type": "string"+ },+ "description": {+ "type": "string",+ "maxLength": 1000+ },+ "name": {+ "type": "string",+ "maxLength": 255,+ "minLength": 1+ }+ }+ },+ "repo.TagOut": {+ "type": "object",+ "properties": {+ "color": {+ "type": "string"+ },+ "createdAt": {+ "type": "string"+ },+ "description": {+ "type": "string"+ },+ "id": {+ "type": "string"+ },+ "name": {+ "type": "string"+ },+ "updatedAt": {+ "type": "string"+ }+ }+ },+ "repo.TagSummary": {+ "type": "object",+ "properties": {+ "color": {+ "type": "string"+ },+ "createdAt": {+ "type": "string"+ },+ "description": {+ "type": "string"+ },+ "id": {+ "type": "string"+ },+ "name": {+ "type": "string"+ },+ "updatedAt": {+ "type": "string"+ }+ }+ },"repo.TemplateField": {"type": "object","properties": {@@ -5316,7 +5316,7 @@}}},- "repo.TemplateLabelSummary": {+ "repo.TemplateLocationSummary": {"type": "object","properties": {"id": {@@ -5327,7 +5327,7 @@}}},- "repo.TemplateLocationSummary": {+ "repo.TemplateTagSummary": {"type": "object","properties": {"id": {@@ -5675,12 +5675,6 @@"type": "string","maxLength": 1000},- "labelIds": {- "type": "array",- "items": {- "type": "string"- }- },"locationId": {"type": "string"},@@ -5691,6 +5685,12 @@},"quantity": {"type": "integer"+ },+ "tagIds": {+ "type": "array",+ "items": {+ "type": "string"+ }}}},@@ -5744,14 +5744,14 @@"v1.WipeInventoryOptions": {"type": "object","properties": {- "wipeLabels": {- "type": "boolean"- },"wipeLocations": {"type": "boolean"},"wipeMaintenance": {"type": "boolean"+ },+ "wipeTags": {+ "type": "boolean"}}},diff --git a/docs/en/api/openapi-3.0.yaml b/docs/en/api/openapi-3.0.yamlindex da6563b2..50be7f5a 100644--- a/docs/en/api/openapi-3.0.yaml+++ b/docs/en/api/openapi-3.0.yaml@@ -351,22 +351,6 @@ paths:application/json:schema:$ref: "#/components/schemas/repo.GroupStatistics"- /v1/groups/statistics/labels:- get:- security:- - Bearer: []- tags:- - Statistics- summary: Get Label Statistics- responses:- "200":- description: OK- content:- application/json:- schema:- type: array- items:- $ref: "#/components/schemas/repo.TotalsByOrganizer"/v1/groups/statistics/locations:get:security:@@ -408,6 +392,22 @@ paths:application/json:schema:$ref: "#/components/schemas/repo.ValueOverTime"+ /v1/groups/statistics/tags:+ get:+ security:+ - Bearer: []+ tags:+ - Statistics+ summary: Get Tags Statistics+ responses:+ "200":+ description: OK+ content:+ application/json:+ schema:+ type: array+ items:+ $ref: "#/components/schemas/repo.TotalsByOrganizer"/v1/items:get:security:@@ -431,8 +431,8 @@ paths:in: queryschema:type: integer- - description: label Ids- name: labels+ - description: tags Ids+ name: tagsin: queryexplode: trueschema:@@ -965,99 +965,6 @@ paths:application/json:schema:type: string- /v1/labels:- get:- security:- - Bearer: []- tags:- - Labels- summary: Get All Labels- responses:- "200":- description: OK- content:- application/json:- schema:- type: array- items:- $ref: "#/components/schemas/repo.LabelOut"- post:- security:- - Bearer: []- tags:- - Labels- summary: Create Label- requestBody:- content:- application/json:- schema:- $ref: "#/components/schemas/repo.LabelCreate"- description: Label Data- required: true- responses:- "200":- description: OK- content:- application/json:- schema:- $ref: "#/components/schemas/repo.LabelSummary"- "/v1/labels/{id}":- get:- security:- - Bearer: []- tags:- - Labels- summary: Get Label- parameters:- - description: Label ID- name: id- in: path- required: true- schema:- type: string- responses:- "200":- description: OK- content:- application/json:- schema:- $ref: "#/components/schemas/repo.LabelOut"- put:- security:- - Bearer: []- tags:- - Labels- summary: Update Label- parameters:- - description: Label ID- name: id- in: path- required: true- schema:- type: string- responses:- "200":- description: OK- content:- application/json:- schema:- $ref: "#/components/schemas/repo.LabelOut"- delete:- security:- - Bearer: []- tags:- - Labels- summary: Delete Label- parameters:- - description: Label ID- name: id- in: path- required: true- schema:- type: string- responses:- "204":- description: No Content/v1/locations:get:security:@@ -1424,6 +1331,99 @@ paths:application/json:schema:$ref: "#/components/schemas/v1.APISummary"+ /v1/tags:+ get:+ security:+ - Bearer: []+ tags:+ - Tags+ summary: Get All Tags+ responses:+ "200":+ description: OK+ content:+ application/json:+ schema:+ type: array+ items:+ $ref: "#/components/schemas/repo.TagOut"+ post:+ security:+ - Bearer: []+ tags:+ - Tags+ summary: Create Tag+ requestBody:+ content:+ application/json:+ schema:+ $ref: "#/components/schemas/repo.TagCreate"+ description: Tag Data+ required: true+ responses:+ "200":+ description: OK+ content:+ application/json:+ schema:+ $ref: "#/components/schemas/repo.TagSummary"+ "/v1/tags/{id}":+ get:+ security:+ - Bearer: []+ tags:+ - Tags+ summary: Get Tag+ parameters:+ - description: Tag ID+ name: id+ in: path+ required: true+ schema:+ type: string+ responses:+ "200":+ description: OK+ content:+ application/json:+ schema:+ $ref: "#/components/schemas/repo.TagOut"+ put:+ security:+ - Bearer: []+ tags:+ - Tags+ summary: Update Tag+ parameters:+ - description: Tag ID+ name: id+ in: path+ required: true+ schema:+ type: string+ responses:+ "200":+ description: OK+ content:+ application/json:+ schema:+ $ref: "#/components/schemas/repo.TagOut"+ delete:+ security:+ - Bearer: []+ tags:+ - Tags+ summary: Delete Tag+ parameters:+ - description: Tag ID+ name: id+ in: path+ required: true+ schema:+ type: string+ responses:+ "204":+ description: No Content/v1/templates:get:security:@@ -1930,11 +1930,6 @@ components:type: arrayitems:$ref: "#/components/schemas/ent.Item"- labels:- description: Labels holds the value of the labels edge.- type: array- items:- $ref: "#/components/schemas/ent.Label"locations:description: Locations holds the value of the locations edge.type: array@@ -1945,6 +1940,11 @@ components:type: arrayitems:$ref: "#/components/schemas/ent.Notifier"+ tags:+ description: Tags holds the value of the tags edge.+ type: array+ items:+ $ref: "#/components/schemas/ent.Tag"users:description: Users holds the value of the users edge.type: array@@ -2095,11 +2095,6 @@ components:description: Group holds the value of the group edge.allOf:- $ref: "#/components/schemas/ent.Group"- label:- description: Label holds the value of the label edge.- type: array- items:- $ref: "#/components/schemas/ent.Label"location:description: Location holds the value of the location edge.allOf:@@ -2113,6 +2108,11 @@ components:description: Parent holds the value of the parent edge.allOf:- $ref: "#/components/schemas/ent.Item"+ tag:+ description: Tag holds the value of the tag edge.+ type: array+ items:+ $ref: "#/components/schemas/ent.Tag"ent.ItemField:type: objectproperties:@@ -2173,11 +2173,6 @@ components:default_insured:description: DefaultInsured holds the value of the "default_insured" field.type: boolean- default_label_ids:- description: Default label IDs for items created from this template- type: array- items:- type: stringdefault_lifetime_warranty:description: DefaultLifetimeWarranty holds the value of the"default_lifetime_warranty" field.@@ -2195,6 +2190,11 @@ components:default_quantity:description: DefaultQuantity holds the value of the "default_quantity" field.type: integer+ default_tag_ids:+ description: Default tag IDs for items created from this template+ type: array+ items:+ type: stringdefault_warranty_details:description: DefaultWarrantyDetails holds the value of the"default_warranty_details" field.@@ -2248,46 +2248,6 @@ components:description: Location holds the value of the location edge.allOf:- $ref: "#/components/schemas/ent.Location"- 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.-- The values are being populated by the LabelQuery when eager-loading is set.- allOf:- - $ref: "#/components/schemas/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.- allOf:- - $ref: "#/components/schemas/ent.Group"- items:- description: Items holds the value of the items edge.- type: array- items:- $ref: "#/components/schemas/ent.Item"ent.Location:type: objectproperties:@@ -2420,6 +2380,46 @@ components:description: User holds the value of the user edge.allOf:- $ref: "#/components/schemas/ent.User"+ ent.Tag:+ 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.++ The values are being populated by the TagQuery when eager-loading is set.+ allOf:+ - $ref: "#/components/schemas/ent.TagEdges"+ 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.TagEdges:+ type: object+ properties:+ group:+ description: Group holds the value of the group edge.+ allOf:+ - $ref: "#/components/schemas/ent.Group"+ items:+ description: Items holds the value of the items edge.+ type: array+ items:+ $ref: "#/components/schemas/ent.Item"ent.TemplateField:type: objectproperties:@@ -2599,10 +2599,10 @@ components:type: numbertotalItems:type: integer- totalLabels:- type: integertotalLocations:type: integer+ totalTags:+ type: integertotalUsers:type: integertotalWithWarranty:@@ -2652,10 +2652,6 @@ components:description:type: stringmaxLength: 1000- labelIds:- type: array- items:- type: stringlocationId:description: Edgestype: string@@ -2668,6 +2664,10 @@ components:nullable: truequantity:type: integer+ tagIds:+ type: array+ items:+ type: stringrepo.ItemField:type: objectproperties:@@ -2711,10 +2711,6 @@ components:nullable: trueinsured:type: boolean- labels:- type: array- items:- $ref: "#/components/schemas/repo.LabelSummary"lifetimeWarranty:description: Warrantytype: boolean@@ -2760,6 +2756,10 @@ components:type: stringsyncChildItemsLocations:type: boolean+ tags:+ type: array+ items:+ $ref: "#/components/schemas/repo.TagSummary"thumbnailId:type: stringx-omitempty: true@@ -2775,12 +2775,6 @@ components:properties:id:type: string- labelIds:- type: array- items:- type: string- x-omitempty: true- nullable: truelocationId:type: stringx-omitempty: true@@ -2789,6 +2783,12 @@ components:type: integerx-omitempty: truenullable: true+ tagIds:+ type: array+ items:+ type: string+ x-omitempty: true+ nullable: truerepo.ItemPath:type: objectproperties:@@ -2818,10 +2818,6 @@ components:nullable: trueinsured:type: boolean- labels:- type: array- items:- $ref: "#/components/schemas/repo.LabelSummary"location:description: EdgesallOf:@@ -2837,6 +2833,10 @@ components:soldTime:description: Sale detailstype: string+ tags:+ type: array+ items:+ $ref: "#/components/schemas/repo.TagSummary"thumbnailId:type: stringx-omitempty: true@@ -2854,15 +2854,10 @@ components:nullable: truedefaultInsured:type: boolean- defaultLabelIds:- type: array- items:- type: string- nullable: truedefaultLifetimeWarranty:type: booleandefaultLocationId:- description: Default location and labels+ description: Default location and tagstype: stringnullable: truedefaultManufacturer:@@ -2881,6 +2876,11 @@ components:description: Default values for itemstype: integernullable: true+ defaultTagIds:+ type: array+ items:+ type: string+ nullable: truedefaultWarrantyDetails:type: stringmaxLength: 1000@@ -2916,14 +2916,10 @@ components:type: stringdefaultInsured:type: boolean- defaultLabels:- type: array- items:- $ref: "#/components/schemas/repo.TemplateLabelSummary"defaultLifetimeWarranty:type: booleandefaultLocation:- description: Default location and labels+ description: Default location and tagsallOf:- $ref: "#/components/schemas/repo.TemplateLocationSummary"defaultManufacturer:@@ -2935,6 +2931,10 @@ components:defaultQuantity:description: Default values for itemstype: integer+ defaultTags:+ type: array+ items:+ $ref: "#/components/schemas/repo.TemplateTagSummary"defaultWarrantyDetails:type: stringdescription:@@ -2983,15 +2983,10 @@ components:nullable: truedefaultInsured:type: boolean- defaultLabelIds:- type: array- items:- type: string- nullable: truedefaultLifetimeWarranty:type: booleandefaultLocationId:- description: Default location and labels+ description: Default location and tagstype: stringnullable: truedefaultManufacturer:@@ -3010,6 +3005,11 @@ components:description: Default values for itemstype: integernullable: true+ defaultTagIds:+ type: array+ items:+ type: string+ nullable: truedefaultWarrantyDetails:type: stringmaxLength: 1000@@ -3066,10 +3066,6 @@ components:type: stringinsured:type: boolean- labelIds:- type: array- items:- type: stringlifetimeWarranty:description: Warrantytype: boolean@@ -3120,54 +3116,14 @@ components:maxLength: 255syncChildItemsLocations:type: boolean+ tagIds:+ type: array+ items:+ type: stringwarrantyDetails:type: stringwarrantyExpires:type: string- repo.LabelCreate:- type: object- required:- - name- properties:- color:- type: string- description:- type: string- maxLength: 1000- name:- type: string- maxLength: 255- minLength: 1- repo.LabelOut:- type: object- properties:- color:- type: string- createdAt:- type: string- description:- type: string- id:- type: string- name:- type: string- updatedAt:- type: string- repo.LabelSummary:- type: object- properties:- color:- type: string- createdAt:- type: string- description:- type: string- id:- type: string- name:- type: string- updatedAt:- type: stringrepo.LocationCreate:type: objectproperties:@@ -3375,6 +3331,50 @@ components:type: integertotal:type: integer+ repo.TagCreate:+ type: object+ required:+ - name+ properties:+ color:+ type: string+ description:+ type: string+ maxLength: 1000+ name:+ type: string+ maxLength: 255+ minLength: 1+ repo.TagOut:+ type: object+ properties:+ color:+ type: string+ createdAt:+ type: string+ description:+ type: string+ id:+ type: string+ name:+ type: string+ updatedAt:+ type: string+ repo.TagSummary:+ type: object+ properties:+ color:+ type: string+ createdAt:+ type: string+ description:+ type: string+ id:+ type: string+ name:+ type: string+ updatedAt:+ type: stringrepo.TemplateField:type: objectproperties:@@ -3386,14 +3386,14 @@ components:type: stringtype:type: string- repo.TemplateLabelSummary:+ repo.TemplateLocationSummary:type: objectproperties:id:type: stringname:type: string- repo.TemplateLocationSummary:+ repo.TemplateTagSummary:type: objectproperties:id:@@ -3622,10 +3622,6 @@ components:description:type: stringmaxLength: 1000- labelIds:- type: array- items:- type: stringlocationId:type: stringname:@@ -3634,6 +3630,10 @@ components:minLength: 1quantity:type: integer+ tagIds:+ type: array+ items:+ type: stringv1.LoginForm:type: objectproperties:@@ -3668,12 +3668,12 @@ components:v1.WipeInventoryOptions:type: objectproperties:- wipeLabels:- type: booleanwipeLocations:type: booleanwipeMaintenance:type: boolean+ wipeTags:+ type: booleanv1.Wrapped:type: objectproperties:diff --git a/docs/en/api/swagger-2.0.json b/docs/en/api/swagger-2.0.jsonindex b2edcda4..edc7c452 100644--- a/docs/en/api/swagger-2.0.json+++ b/docs/en/api/swagger-2.0.json@@ -596,7 +596,7 @@}}},- "/v1/groups/statistics/labels": {+ "/v1/groups/statistics/locations": {"get": {"security": [{@@ -609,7 +609,7 @@"tags": ["Statistics"],- "summary": "Get Label Statistics",+ "summary": "Get Location Statistics","responses": {"200": {"description": "OK",@@ -623,7 +623,7 @@}}},- "/v1/groups/statistics/locations": {+ "/v1/groups/statistics/purchase-price": {"get": {"security": [{@@ -636,21 +636,32 @@"tags": ["Statistics"],- "summary": "Get Location Statistics",+ "summary": "Get Purchase Price Statistics",+ "parameters": [+ {+ "type": "string",+ "description": "start date",+ "name": "start",+ "in": "query"+ },+ {+ "type": "string",+ "description": "end date",+ "name": "end",+ "in": "query"+ }+ ],"responses": {"200": {"description": "OK","schema": {- "type": "array",- "items": {- "$ref": "#/definitions/repo.TotalsByOrganizer"- }+ "$ref": "#/definitions/repo.ValueOverTime"}}}}},- "/v1/groups/statistics/purchase-price": {+ "/v1/groups/statistics/tags": {"get": {"security": [{@@ -663,26 +674,15 @@"tags": ["Statistics"],- "summary": "Get Purchase Price Statistics",- "parameters": [- {- "type": "string",- "description": "start date",- "name": "start",- "in": "query"- },- {- "type": "string",- "description": "end date",- "name": "end",- "in": "query"- }- ],+ "summary": "Get Tags Statistics","responses": {"200": {"description": "OK","schema": {- "$ref": "#/definitions/repo.ValueOverTime"+ "type": "array",+ "items": {+ "$ref": "#/definitions/repo.TotalsByOrganizer"+ }}}}@@ -727,8 +727,8 @@"type": "string"},"collectionFormat": "multi",- "description": "label Ids",- "name": "labels",+ "description": "tags Ids",+ "name": "tags","in": "query"},{@@ -1514,158 +1514,6 @@}}},- "/v1/labels": {- "get": {- "security": [- {- "Bearer": []- }- ],- "produces": [- "application/json"- ],- "tags": [- "Labels"- ],- "summary": "Get All Labels",- "responses": {- "200": {- "description": "OK",- "schema": {- "type": "array",- "items": {- "$ref": "#/definitions/repo.LabelOut"- }- }- }- }- },- "post": {- "security": [- {- "Bearer": []- }- ],- "produces": [- "application/json"- ],- "tags": [- "Labels"- ],- "summary": "Create Label",- "parameters": [- {- "description": "Label Data",- "name": "payload",- "in": "body",- "required": true,- "schema": {- "$ref": "#/definitions/repo.LabelCreate"- }- }- ],- "responses": {- "200": {- "description": "OK",- "schema": {- "$ref": "#/definitions/repo.LabelSummary"- }- }- }- }- },- "/v1/labels/{id}": {- "get": {- "security": [- {- "Bearer": []- }- ],- "produces": [- "application/json"- ],- "tags": [- "Labels"- ],- "summary": "Get Label",- "parameters": [- {- "type": "string",- "description": "Label ID",- "name": "id",- "in": "path",- "required": true- }- ],- "responses": {- "200": {- "description": "OK",- "schema": {- "$ref": "#/definitions/repo.LabelOut"- }- }- }- },- "put": {- "security": [- {- "Bearer": []- }- ],- "produces": [- "application/json"- ],- "tags": [- "Labels"- ],- "summary": "Update Label",- "parameters": [- {- "type": "string",- "description": "Label ID",- "name": "id",- "in": "path",- "required": true- }- ],- "responses": {- "200": {- "description": "OK",- "schema": {- "$ref": "#/definitions/repo.LabelOut"- }- }- }- },- "delete": {- "security": [- {- "Bearer": []- }- ],- "produces": [- "application/json"- ],- "tags": [- "Labels"- ],- "summary": "Delete Label",- "parameters": [- {- "type": "string",- "description": "Label ID",- "name": "id",- "in": "path",- "required": true- }- ],- "responses": {- "204": {- "description": "No Content"- }- }- }- },"/v1/locations": {"get": {"security": [@@ -2248,6 +2096,158 @@}}},+ "/v1/tags": {+ "get": {+ "security": [+ {+ "Bearer": []+ }+ ],+ "produces": [+ "application/json"+ ],+ "tags": [+ "Tags"+ ],+ "summary": "Get All Tags",+ "responses": {+ "200": {+ "description": "OK",+ "schema": {+ "type": "array",+ "items": {+ "$ref": "#/definitions/repo.TagOut"+ }+ }+ }+ }+ },+ "post": {+ "security": [+ {+ "Bearer": []+ }+ ],+ "produces": [+ "application/json"+ ],+ "tags": [+ "Tags"+ ],+ "summary": "Create Tag",+ "parameters": [+ {+ "description": "Tag Data",+ "name": "payload",+ "in": "body",+ "required": true,+ "schema": {+ "$ref": "#/definitions/repo.TagCreate"+ }+ }+ ],+ "responses": {+ "200": {+ "description": "OK",+ "schema": {+ "$ref": "#/definitions/repo.TagSummary"+ }+ }+ }+ }+ },+ "/v1/tags/{id}": {+ "get": {+ "security": [+ {+ "Bearer": []+ }+ ],+ "produces": [+ "application/json"+ ],+ "tags": [+ "Tags"+ ],+ "summary": "Get Tag",+ "parameters": [+ {+ "type": "string",+ "description": "Tag ID",+ "name": "id",+ "in": "path",+ "required": true+ }+ ],+ "responses": {+ "200": {+ "description": "OK",+ "schema": {+ "$ref": "#/definitions/repo.TagOut"+ }+ }+ }+ },+ "put": {+ "security": [+ {+ "Bearer": []+ }+ ],+ "produces": [+ "application/json"+ ],+ "tags": [+ "Tags"+ ],+ "summary": "Update Tag",+ "parameters": [+ {+ "type": "string",+ "description": "Tag ID",+ "name": "id",+ "in": "path",+ "required": true+ }+ ],+ "responses": {+ "200": {+ "description": "OK",+ "schema": {+ "$ref": "#/definitions/repo.TagOut"+ }+ }+ }+ },+ "delete": {+ "security": [+ {+ "Bearer": []+ }+ ],+ "produces": [+ "application/json"+ ],+ "tags": [+ "Tags"+ ],+ "summary": "Delete Tag",+ "parameters": [+ {+ "type": "string",+ "description": "Tag ID",+ "name": "id",+ "in": "path",+ "required": true+ }+ ],+ "responses": {+ "204": {+ "description": "No Content"+ }+ }+ }+ },"/v1/templates": {"get": {"security": [@@ -3015,13 +3015,6 @@"$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",@@ -3036,6 +3029,13 @@"$ref": "#/definitions/ent.Notifier"}},+ "tags": {+ "description": "Tags holds the value of the tags edge.",+ "type": "array",+ "items": {+ "$ref": "#/definitions/ent.Tag"+ }+ },"users": {"description": "Users holds the value of the users edge.","type": "array",@@ -3243,13 +3243,6 @@}]},- "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.","allOf": [@@ -3272,6 +3265,13 @@"$ref": "#/definitions/ent.Item"}]+ },+ "tag": {+ "description": "Tag holds the value of the tag edge.",+ "type": "array",+ "items": {+ "$ref": "#/definitions/ent.Tag"+ }}}},@@ -3360,13 +3360,6 @@"description": "DefaultInsured holds the value of the \"default_insured\" field.","type": "boolean"},- "default_label_ids": {- "description": "Default label IDs for items created from this template",- "type": "array",- "items": {- "type": "string"- }- },"default_lifetime_warranty": {"description": "DefaultLifetimeWarranty holds the value of the \"default_lifetime_warranty\" field.","type": "boolean"@@ -3387,6 +3380,13 @@"description": "DefaultQuantity holds the value of the \"default_quantity\" field.","type": "integer"},+ "default_tag_ids": {+ "description": "Default tag IDs for items created from this template",+ "type": "array",+ "items": {+ "type": "string"+ }+ },"default_warranty_details": {"description": "DefaultWarrantyDetails holds the value of the \"default_warranty_details\" field.","type": "string"@@ -3461,63 +3461,6 @@}}},- "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.",- "allOf": [- {- "$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.",- "allOf": [- {- "$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": {@@ -3656,25 +3599,87 @@"type": "string"},"edges": {- "description": "Edges holds the relations/edges for other nodes in the graph.\nThe values are being populated by the NotifierQuery when eager-loading is set.",+ "description": "Edges holds the relations/edges for other nodes in the graph.\nThe values are being populated by the NotifierQuery when eager-loading is set.",+ "allOf": [+ {+ "$ref": "#/definitions/ent.NotifierEdges"+ }+ ]+ },+ "group_id": {+ "description": "GroupID holds the value of the \"group_id\" field.",+ "type": "string"+ },+ "id": {+ "description": "ID of the ent.",+ "type": "string"+ },+ "is_active": {+ "description": "IsActive holds the value of the \"is_active\" 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"+ },+ "user_id": {+ "description": "UserID holds the value of the \"user_id\" field.",+ "type": "string"+ }+ }+ },+ "ent.NotifierEdges": {+ "type": "object",+ "properties": {+ "group": {+ "description": "Group holds the value of the group edge.",+ "allOf": [+ {+ "$ref": "#/definitions/ent.Group"+ }+ ]+ },+ "user": {+ "description": "User holds the value of the user edge.",+ "allOf": [+ {+ "$ref": "#/definitions/ent.User"+ }+ ]+ }+ }+ },+ "ent.Tag": {+ "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 TagQuery when eager-loading is set.","allOf": [{- "$ref": "#/definitions/ent.NotifierEdges"+ "$ref": "#/definitions/ent.TagEdges"}]},- "group_id": {- "description": "GroupID holds the value of the \"group_id\" field.",- "type": "string"- },"id": {"description": "ID of the ent.","type": "string"},- "is_active": {- "description": "IsActive holds the value of the \"is_active\" field.",- "type": "boolean"- },"name": {"description": "Name holds the value of the \"name\" field.","type": "string"@@ -3682,14 +3687,10 @@"updated_at": {"description": "UpdatedAt holds the value of the \"updated_at\" field.","type": "string"- },- "user_id": {- "description": "UserID holds the value of the \"user_id\" field.",- "type": "string"}}},- "ent.NotifierEdges": {+ "ent.TagEdges": {"type": "object","properties": {"group": {@@ -3700,13 +3701,12 @@}]},- "user": {- "description": "User holds the value of the user edge.",- "allOf": [- {- "$ref": "#/definitions/ent.User"- }- ]+ "items": {+ "description": "Items holds the value of the items edge.",+ "type": "array",+ "items": {+ "$ref": "#/definitions/ent.Item"+ }}}},@@ -3968,10 +3968,10 @@"totalItems": {"type": "integer"},- "totalLabels": {+ "totalLocations": {"type": "integer"},- "totalLocations": {+ "totalTags": {"type": "integer"},"totalUsers": {@@ -4049,12 +4049,6 @@"type": "string","maxLength": 1000},- "labelIds": {- "type": "array",- "items": {- "type": "string"- }- },"locationId": {"description": "Edges","type": "string"@@ -4070,6 +4064,12 @@},"quantity": {"type": "integer"+ },+ "tagIds": {+ "type": "array",+ "items": {+ "type": "string"+ }}}},@@ -4135,12 +4135,6 @@"insured": {"type": "boolean"},- "labels": {- "type": "array",- "items": {- "$ref": "#/definitions/repo.LabelSummary"- }- },"lifetimeWarranty": {"description": "Warranty","type": "boolean"@@ -4209,6 +4203,12 @@"syncChildItemsLocations": {"type": "boolean"},+ "tags": {+ "type": "array",+ "items": {+ "$ref": "#/definitions/repo.TagSummary"+ }+ },"thumbnailId": {"type": "string","x-nullable": true,@@ -4231,14 +4231,6 @@"id": {"type": "string"},- "labelIds": {- "type": "array",- "items": {- "type": "string"- },- "x-nullable": true,- "x-omitempty": true- },"locationId": {"type": "string","x-nullable": true,@@ -4248,6 +4240,14 @@"type": "integer","x-nullable": true,"x-omitempty": true+ },+ "tagIds": {+ "type": "array",+ "items": {+ "type": "string"+ },+ "x-nullable": true,+ "x-omitempty": true}}},@@ -4292,12 +4292,6 @@"insured": {"type": "boolean"},- "labels": {- "type": "array",- "items": {- "$ref": "#/definitions/repo.LabelSummary"- }- },"location": {"description": "Edges","allOf": [@@ -4321,6 +4315,12 @@"description": "Sale details","type": "string"},+ "tags": {+ "type": "array",+ "items": {+ "$ref": "#/definitions/repo.TagSummary"+ }+ },"thumbnailId": {"type": "string","x-nullable": true,@@ -4345,18 +4345,11 @@"defaultInsured": {"type": "boolean"},- "defaultLabelIds": {- "type": "array",- "items": {- "type": "string"- },- "x-nullable": true- },"defaultLifetimeWarranty": {"type": "boolean"},"defaultLocationId": {- "description": "Default location and labels",+ "description": "Default location and tags","type": "string","x-nullable": true},@@ -4380,6 +4373,13 @@"type": "integer","x-nullable": true},+ "defaultTagIds": {+ "type": "array",+ "items": {+ "type": "string"+ },+ "x-nullable": true+ },"defaultWarrantyDetails": {"type": "string","maxLength": 1000,@@ -4429,17 +4429,11 @@"defaultInsured": {"type": "boolean"},- "defaultLabels": {- "type": "array",- "items": {- "$ref": "#/definitions/repo.TemplateLabelSummary"- }- },"defaultLifetimeWarranty": {"type": "boolean"},"defaultLocation": {- "description": "Default location and labels",+ "description": "Default location and tags","allOf": [{"$ref": "#/definitions/repo.TemplateLocationSummary"@@ -4459,6 +4453,12 @@"description": "Default values for items","type": "integer"},+ "defaultTags": {+ "type": "array",+ "items": {+ "$ref": "#/definitions/repo.TemplateTagSummary"+ }+ },"defaultWarrantyDetails": {"type": "string"},@@ -4530,18 +4530,11 @@"defaultInsured": {"type": "boolean"},- "defaultLabelIds": {- "type": "array",- "items": {- "type": "string"- },- "x-nullable": true- },"defaultLifetimeWarranty": {"type": "boolean"},"defaultLocationId": {- "description": "Default location and labels",+ "description": "Default location and tags","type": "string","x-nullable": true},@@ -4565,6 +4558,13 @@"type": "integer","x-nullable": true},+ "defaultTagIds": {+ "type": "array",+ "items": {+ "type": "string"+ },+ "x-nullable": true+ },"defaultWarrantyDetails": {"type": "string","maxLength": 1000,@@ -4644,12 +4644,6 @@"insured": {"type": "boolean"},- "labelIds": {- "type": "array",- "items": {- "type": "string"- }- },"lifetimeWarranty": {"description": "Warranty","type": "boolean"@@ -4717,6 +4711,12 @@"syncChildItemsLocations": {"type": "boolean"},+ "tagIds": {+ "type": "array",+ "items": {+ "type": "string"+ }+ },"warrantyDetails": {"type": "string"},@@ -4725,72 +4725,6 @@}}},- "repo.LabelCreate": {- "type": "object",- "required": [- "name"- ],- "properties": {- "color": {- "type": "string"- },- "description": {- "type": "string",- "maxLength": 1000- },- "name": {- "type": "string",- "maxLength": 255,- "minLength": 1- }- }- },- "repo.LabelOut": {- "type": "object",- "properties": {- "color": {- "type": "string"- },- "createdAt": {- "type": "string"- },- "description": {- "type": "string"- },- "id": {- "type": "string"- },- "name": {- "type": "string"- },- "updatedAt": {- "type": "string"- }- }- },- "repo.LabelSummary": {- "type": "object",- "properties": {- "color": {- "type": "string"- },- "createdAt": {- "type": "string"- },- "description": {- "type": "string"- },- "id": {- "type": "string"- },- "name": {- "type": "string"- },- "updatedAt": {- "type": "string"- }- }- },"repo.LocationCreate": {"type": "object","properties": {@@ -5100,6 +5034,72 @@}}},+ "repo.TagCreate": {+ "type": "object",+ "required": [+ "name"+ ],+ "properties": {+ "color": {+ "type": "string"+ },+ "description": {+ "type": "string",+ "maxLength": 1000+ },+ "name": {+ "type": "string",+ "maxLength": 255,+ "minLength": 1+ }+ }+ },+ "repo.TagOut": {+ "type": "object",+ "properties": {+ "color": {+ "type": "string"+ },+ "createdAt": {+ "type": "string"+ },+ "description": {+ "type": "string"+ },+ "id": {+ "type": "string"+ },+ "name": {+ "type": "string"+ },+ "updatedAt": {+ "type": "string"+ }+ }+ },+ "repo.TagSummary": {+ "type": "object",+ "properties": {+ "color": {+ "type": "string"+ },+ "createdAt": {+ "type": "string"+ },+ "description": {+ "type": "string"+ },+ "id": {+ "type": "string"+ },+ "name": {+ "type": "string"+ },+ "updatedAt": {+ "type": "string"+ }+ }+ },"repo.TemplateField": {"type": "object","properties": {@@ -5117,7 +5117,7 @@}}},- "repo.TemplateLabelSummary": {+ "repo.TemplateLocationSummary": {"type": "object","properties": {"id": {@@ -5128,7 +5128,7 @@}}},- "repo.TemplateLocationSummary": {+ "repo.TemplateTagSummary": {"type": "object","properties": {"id": {@@ -5476,12 +5476,6 @@"type": "string","maxLength": 1000},- "labelIds": {- "type": "array",- "items": {- "type": "string"- }- },"locationId": {"type": "string"},@@ -5492,6 +5486,12 @@},"quantity": {"type": "integer"+ },+ "tagIds": {+ "type": "array",+ "items": {+ "type": "string"+ }}}},@@ -5545,14 +5545,14 @@"v1.WipeInventoryOptions": {"type": "object","properties": {- "wipeLabels": {- "type": "boolean"- },"wipeLocations": {"type": "boolean"},"wipeMaintenance": {"type": "boolean"+ },+ "wipeTags": {+ "type": "boolean"}}},diff --git a/docs/en/api/swagger-2.0.yaml b/docs/en/api/swagger-2.0.yamlindex 96c17e8c..f42a9d9e 100644--- a/docs/en/api/swagger-2.0.yaml+++ b/docs/en/api/swagger-2.0.yaml@@ -189,11 +189,6 @@ definitions:items:$ref: '#/definitions/ent.Item'type: array- labels:- description: Labels holds the value of the labels edge.- items:- $ref: '#/definitions/ent.Label'- type: arraylocations:description: Locations holds the value of the locations edge.items:@@ -204,6 +199,11 @@ definitions:items:$ref: '#/definitions/ent.Notifier'type: array+ tags:+ description: Tags holds the value of the tags edge.+ items:+ $ref: '#/definitions/ent.Tag'+ type: arrayusers:description: Users holds the value of the users edge.items:@@ -352,11 +352,6 @@ definitions:allOf:- $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: arraylocation:allOf:- $ref: '#/definitions/ent.Location'@@ -371,6 +366,11 @@ definitions:allOf:- $ref: '#/definitions/ent.Item'description: Parent holds the value of the parent edge.+ tag:+ description: Tag holds the value of the tag edge.+ items:+ $ref: '#/definitions/ent.Tag'+ type: arraytype: objectent.ItemField:properties:@@ -430,11 +430,6 @@ definitions:default_insured:description: DefaultInsured holds the value of the "default_insured" field.type: boolean- default_label_ids:- description: Default label IDs for items created from this template- items:- type: string- type: arraydefault_lifetime_warranty:description: DefaultLifetimeWarranty holds the value of the "default_lifetime_warranty"field.@@ -452,6 +447,11 @@ definitions:default_quantity:description: DefaultQuantity holds the value of the "default_quantity" field.type: integer+ default_tag_ids:+ description: Default tag IDs for items created from this template+ items:+ type: string+ type: arraydefault_warranty_details:description: DefaultWarrantyDetails holds the value of the "default_warranty_details"field.@@ -505,45 +505,6 @@ definitions:- $ref: '#/definitions/ent.Location'description: Location holds the value of the location 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:- allOf:- - $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:- 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- type: objectent.Location:properties:created_at:@@ -673,6 +634,45 @@ definitions:- $ref: '#/definitions/ent.User'description: User holds the value of the user edge.type: object+ ent.Tag:+ 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.TagEdges'+ description: |-+ Edges holds the relations/edges for other nodes in the graph.+ The values are being populated by the TagQuery 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.TagEdges:+ 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.+ items:+ $ref: '#/definitions/ent.Item'+ type: array+ type: objectent.TemplateField:properties:created_at:@@ -849,10 +849,10 @@ definitions:type: numbertotalItems:type: integer- totalLabels:- type: integertotalLocations:type: integer+ totalTags:+ type: integertotalUsers:type: integertotalWithWarranty:@@ -900,10 +900,6 @@ definitions:description:maxLength: 1000type: string- labelIds:- items:- type: string- type: arraylocationId:description: Edgestype: string@@ -916,6 +912,10 @@ definitions:x-nullable: truequantity:type: integer+ tagIds:+ items:+ type: string+ type: arrayrequired:- nametype: object@@ -961,10 +961,6 @@ definitions:x-omitempty: trueinsured:type: boolean- labels:- items:- $ref: '#/definitions/repo.LabelSummary'- type: arraylifetimeWarranty:description: Warrantytype: boolean@@ -1010,6 +1006,10 @@ definitions:type: stringsyncChildItemsLocations:type: boolean+ tags:+ items:+ $ref: '#/definitions/repo.TagSummary'+ type: arraythumbnailId:type: stringx-nullable: true@@ -1025,12 +1025,6 @@ definitions:properties:id:type: string- labelIds:- items:- type: string- type: array- x-nullable: true- x-omitempty: truelocationId:type: stringx-nullable: true@@ -1039,6 +1033,12 @@ definitions:type: integerx-nullable: truex-omitempty: true+ tagIds:+ items:+ type: string+ type: array+ x-nullable: true+ x-omitempty: truetype: objectrepo.ItemPath:properties:@@ -1068,10 +1068,6 @@ definitions:x-omitempty: trueinsured:type: boolean- labels:- items:- $ref: '#/definitions/repo.LabelSummary'- type: arraylocation:allOf:- $ref: '#/definitions/repo.LocationSummary'@@ -1087,6 +1083,10 @@ definitions:soldTime:description: Sale detailstype: string+ tags:+ items:+ $ref: '#/definitions/repo.TagSummary'+ type: arraythumbnailId:type: stringx-nullable: true@@ -1102,15 +1102,10 @@ definitions:x-nullable: truedefaultInsured:type: boolean- defaultLabelIds:- items:- type: string- type: array- x-nullable: truedefaultLifetimeWarranty:type: booleandefaultLocationId:- description: Default location and labels+ description: Default location and tagstype: stringx-nullable: truedefaultManufacturer:@@ -1129,6 +1124,11 @@ definitions:description: Default values for itemstype: integerx-nullable: true+ defaultTagIds:+ items:+ type: string+ type: array+ x-nullable: truedefaultWarrantyDetails:maxLength: 1000type: string@@ -1166,16 +1166,12 @@ definitions:type: stringdefaultInsured:type: boolean- defaultLabels:- items:- $ref: '#/definitions/repo.TemplateLabelSummary'- type: arraydefaultLifetimeWarranty:type: booleandefaultLocation:allOf:- $ref: '#/definitions/repo.TemplateLocationSummary'- description: Default location and labels+ description: Default location and tagsdefaultManufacturer:type: stringdefaultModelNumber:@@ -1185,6 +1181,10 @@ definitions:defaultQuantity:description: Default values for itemstype: integer+ defaultTags:+ items:+ $ref: '#/definitions/repo.TemplateTagSummary'+ type: arraydefaultWarrantyDetails:type: stringdescription:@@ -1231,15 +1231,10 @@ definitions:x-nullable: truedefaultInsured:type: boolean- defaultLabelIds:- items:- type: string- type: array- x-nullable: truedefaultLifetimeWarranty:type: booleandefaultLocationId:- description: Default location and labels+ description: Default location and tagstype: stringx-nullable: truedefaultManufacturer:@@ -1258,6 +1253,11 @@ definitions:description: Default values for itemstype: integerx-nullable: true+ defaultTagIds:+ items:+ type: string+ type: array+ x-nullable: truedefaultWarrantyDetails:maxLength: 1000type: string@@ -1314,10 +1314,6 @@ definitions:type: stringinsured:type: boolean- labelIds:- items:- type: string- type: arraylifetimeWarranty:description: Warrantytype: boolean@@ -1368,6 +1364,10 @@ definitions:type: stringsyncChildItemsLocations:type: boolean+ tagIds:+ items:+ type: string+ type: arraywarrantyDetails:type: stringwarrantyExpires:@@ -1375,50 +1375,6 @@ definitions:required:- nametype: object- repo.LabelCreate:- properties:- color:- type: string- description:- maxLength: 1000- type: string- name:- maxLength: 255- minLength: 1- type: string- required:- - name- type: object- repo.LabelOut:- properties:- color:- type: string- createdAt:- type: string- description:- type: string- id:- type: string- name:- type: string- updatedAt:- type: string- type: object- repo.LabelSummary:- properties:- color:- type: string- createdAt:- type: string- description:- type: string- id:- type: string- name:- type: string- updatedAt:- type: string- type: objectrepo.LocationCreate:properties:description:@@ -1626,6 +1582,50 @@ definitions:total:type: integertype: object+ repo.TagCreate:+ properties:+ color:+ type: string+ description:+ maxLength: 1000+ type: string+ name:+ maxLength: 255+ minLength: 1+ type: string+ required:+ - name+ type: object+ repo.TagOut:+ properties:+ color:+ type: string+ createdAt:+ type: string+ description:+ type: string+ id:+ type: string+ name:+ type: string+ updatedAt:+ type: string+ type: object+ repo.TagSummary:+ properties:+ color:+ type: string+ createdAt:+ type: string+ description:+ type: string+ id:+ type: string+ name:+ type: string+ updatedAt:+ type: string+ type: objectrepo.TemplateField:properties:id:@@ -1637,14 +1637,14 @@ definitions:type:type: stringtype: object- repo.TemplateLabelSummary:+ repo.TemplateLocationSummary:properties:id:type: stringname:type: stringtype: object- repo.TemplateLocationSummary:+ repo.TemplateTagSummary:properties:id:type: string@@ -1869,10 +1869,6 @@ definitions:description:maxLength: 1000type: string- labelIds:- items:- type: string- type: arraylocationId:type: stringname:@@ -1881,6 +1877,10 @@ definitions:type: stringquantity:type: integer+ tagIds:+ items:+ type: string+ type: arrayrequired:- locationId- name@@ -1918,12 +1918,12 @@ definitions:type: objectv1.WipeInventoryOptions:properties:- wipeLabels:- type: booleanwipeLocations:type: booleanwipeMaintenance:type: boolean+ wipeTags:+ type: booleantype: objectv1.Wrapped:properties:@@ -2293,22 +2293,6 @@ paths:summary: Get Group Statisticstags:- Statistics- /v1/groups/statistics/labels:- get:- produces:- - application/json- responses:- "200":- description: OK- schema:- items:- $ref: '#/definitions/repo.TotalsByOrganizer'- type: array- security:- - Bearer: []- summary: Get Label Statistics- tags:- - Statistics/v1/groups/statistics/locations:get:produces:@@ -2348,6 +2332,22 @@ paths:summary: Get Purchase Price Statisticstags:- Statistics+ /v1/groups/statistics/tags:+ get:+ produces:+ - application/json+ responses:+ "200":+ description: OK+ schema:+ items:+ $ref: '#/definitions/repo.TotalsByOrganizer'+ type: array+ security:+ - Bearer: []+ summary: Get Tags Statistics+ tags:+ - Statistics/v1/items:get:parameters:@@ -2364,11 +2364,11 @@ paths:name: pageSizetype: integer- collectionFormat: multi- description: label Ids+ description: tags Idsin: queryitems:type: string- name: labels+ name: tagstype: array- collectionFormat: multidescription: location Ids@@ -2862,98 +2862,6 @@ paths:summary: Get Location labeltags:- Locations- /v1/labels:- get:- produces:- - application/json- responses:- "200":- description: OK- schema:- items:- $ref: '#/definitions/repo.LabelOut'- type: array- security:- - Bearer: []- summary: Get All Labels- tags:- - Labels- post:- parameters:- - description: Label Data- in: body- name: payload- required: true- schema:- $ref: '#/definitions/repo.LabelCreate'- produces:- - application/json- responses:- "200":- description: OK- schema:- $ref: '#/definitions/repo.LabelSummary'- security:- - Bearer: []- summary: Create Label- tags:- - Labels- /v1/labels/{id}:- delete:- parameters:- - description: Label ID- in: path- name: id- required: true- type: string- produces:- - application/json- responses:- "204":- description: No Content- security:- - Bearer: []- summary: Delete Label- tags:- - Labels- get:- parameters:- - description: Label ID- in: path- name: id- required: true- type: string- produces:- - application/json- responses:- "200":- description: OK- schema:- $ref: '#/definitions/repo.LabelOut'- security:- - Bearer: []- summary: Get Label- tags:- - Labels- put:- parameters:- - description: Label ID- in: path- name: id- required: true- type: string- produces:- - application/json- responses:- "200":- description: OK- schema:- $ref: '#/definitions/repo.LabelOut'- security:- - Bearer: []- summary: Update Label- tags:- - Labels/v1/locations:get:parameters:@@ -3308,6 +3216,98 @@ paths:summary: Application Infotags:- Base+ /v1/tags:+ get:+ produces:+ - application/json+ responses:+ "200":+ description: OK+ schema:+ items:+ $ref: '#/definitions/repo.TagOut'+ type: array+ security:+ - Bearer: []+ summary: Get All Tags+ tags:+ - Tags+ post:+ parameters:+ - description: Tag Data+ in: body+ name: payload+ required: true+ schema:+ $ref: '#/definitions/repo.TagCreate'+ produces:+ - application/json+ responses:+ "200":+ description: OK+ schema:+ $ref: '#/definitions/repo.TagSummary'+ security:+ - Bearer: []+ summary: Create Tag+ tags:+ - Tags+ /v1/tags/{id}:+ delete:+ parameters:+ - description: Tag ID+ in: path+ name: id+ required: true+ type: string+ produces:+ - application/json+ responses:+ "204":+ description: No Content+ security:+ - Bearer: []+ summary: Delete Tag+ tags:+ - Tags+ get:+ parameters:+ - description: Tag ID+ in: path+ name: id+ required: true+ type: string+ produces:+ - application/json+ responses:+ "200":+ description: OK+ schema:+ $ref: '#/definitions/repo.TagOut'+ security:+ - Bearer: []+ summary: Get Tag+ tags:+ - Tags+ put:+ parameters:+ - description: Tag ID+ in: path+ name: id+ required: true+ type: string+ produces:+ - application/json+ responses:+ "200":+ description: OK+ schema:+ $ref: '#/definitions/repo.TagOut'+ security:+ - Bearer: []+ summary: Update Tag+ tags:+ - Tags/v1/templates:get:produces:diff --git a/docs/en/index.md b/docs/en/index.mdindex c0c0249a..43f7495d 100644--- a/docs/en/index.md+++ b/docs/en/index.md@@ -28,8 +28,8 @@ features:details: Import a CSV file to quickly get started with existing information, or export to save information- title: Custom Reportdetails: Export bill of materials, or generate QR codes for items- - title: Custom labeling and locations- details: Use custom labels and locations to organize items+ - title: Custom tags and locations+ details: Use custom tags and locations to organize items- title: Multi-Tenant Supportdetails: All users are in a group, and can only see what's in the group. Invite family members or share an instance with friends.---diff --git a/docs/en/user-guide/organizing-items.md b/docs/en/user-guide/organizing-items.mdindex 15f1cc34..d4256802 100644--- a/docs/en/user-guide/organizing-items.md+++ b/docs/en/user-guide/organizing-items.md@@ -1,6 +1,6 @@# Organizing Your Items-Homebox allows you to organize your items using locations and labels.+Homebox allows you to organize your items using locations and tags.## Items@@ -10,7 +10,7 @@ To create an item, click on the Create button in the main menu, the select Item- Parent Location (Required) - The location in which the item is stored- Item Name (Required) - Name of the item- Item Description (Optional) - Description of the item-- Labels (Optional) - Here, you can add as many Labels to the item as you like for further organization+- Tags (Optional) - Here, you can add as many Tags to the item as you like for further organization- Photo (Optional) - Allows you to add a photo of the item. Additional photos can be added after the item has been created.::: details Additional Fields@@ -63,18 +63,18 @@ Locations have 3 parameters:To view all locations and the items stored in them, select Locations in the main menu.-## Labels+## Tags-Labels allow you to organize items independently of location. For example, you might have electronic devices all over your house. What if you wanted to see a list of every Electronic Device you own without having to go through every single location?+Tags allow you to organize items independently of location. For example, you might have electronic devices all over your house. What if you wanted to see a list of every Electronic Device you own without having to go through every single location?-Labels enable this. In the example above, if you tag all electronic devices with the "Electronics" label when you create them, you can easily see the list of all your Electronics by going to the related page.+Tags enable this. In the example above, if you tag all electronic devices with the "Electronics" tag when you create them, you can easily see the list of all your Electronics by going to the related page.-To create a Label, click the Create button in the menu, then select Label. Labels have the following parameters:+To create a Tag, click the Create button in the menu, then select Tag. Tags have the following parameters:- Name- Description (Optional)-To see all items related to a specific label (or specific combination of labels):-- From the Home page, scroll to the bottom and select the Label you want to see.-- Alternatively, navigate to the Search page and use the Labels dropdown to filter by one or more labels.+To see all items related to a specific tag (or specific combination of tags):+- From the Home page, scroll to the bottom and select the Tag you want to see.+- Alternatively, navigate to the Search page and use the Tags dropdown to filter by one or more tags.-Items can have as many labels as you wish. The example above is only one example of how labels can be used for organization. Experiment with what labels work best for you!+Items can have as many tags as you wish. The example above is only one example of how tags can be used for organization. Experiment with what tags work best for you!diff --git a/frontend/components/Item/Card.vue b/frontend/components/Item/Card.vueindex c1ee68a9..a373869f 100644--- a/frontend/components/Item/Card.vue+++ b/frontend/components/Item/Card.vue@@ -69,7 +69,7 @@</TooltipProvider><Markdown class="mb-2 line-clamp-3 text-ellipsis" :source="item.description" /><div class="-mr-1 mt-auto flex flex-wrap justify-end gap-2">- <LabelChip v-for="label in itemLabels" :key="label.id" :label="label" size="sm" />+ <TagChip v-for="tag in itemTags" :key="tag.id" :tag="tag" size="sm" /></div></div></NuxtLink>@@ -85,7 +85,7 @@import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from "@/components/ui/tooltip";import { Separator } from "@/components/ui/separator";import Markdown from "@/components/global/Markdown.vue";- import LabelChip from "@/components/Label/Chip.vue";+ import TagChip from "@/components/Tag/Chip.vue";import type { Row } from "@tanstack/vue-table";import { Checkbox } from "@/components/ui/checkbox";@@ -103,8 +103,8 @@}});- const itemLabels = computed(() => {- return props.item.labels || [];+ const itemTags = computed(() => {+ return props.item.tags || [];});const props = defineProps({diff --git a/frontend/components/Item/CreateModal.vue b/frontend/components/Item/CreateModal.vueindex f9ca6fa4..2ec2442d 100644--- a/frontend/components/Item/CreateModal.vue+++ b/frontend/components/Item/CreateModal.vue@@ -106,9 +106,9 @@{{ templateData.defaultLocation.name }}</div></div>- <div v-if="templateData.defaultLabels && templateData.defaultLabels.length > 0" class="mt-1">- <span class="font-medium">{{ $t("global.labels") }}:</span>- {{ templateData.defaultLabels.map((l: any) => l.name).join(", ") }}+ <div v-if="templateData.defaultTags && templateData.defaultTags.length > 0" class="mt-1">+ <span class="font-medium">{{ $t("global.tags") }}:</span>+ {{ templateData.defaultTags.map((t: any) => t.name).join(", ") }}</div><div v-if="templateData.defaultDescription" class="mt-1"><p class="font-medium">{{ $t("components.template.form.item_description") }}:</p>@@ -153,7 +153,7 @@:label="$t('components.item.create_modal.item_description')":max-length="1000"/>- <LabelSelector v-model="form.labels" :labels="labels ?? []" />+ <TagSelector v-model="form.tags" :tags="tags ?? []" /><div class="flex w-full flex-col gap-1.5"><Label for="image-create-photo" class="flex w-full px-1">{{ $t("components.item.create_modal.item_photo") }}@@ -274,7 +274,7 @@import { Label } from "@/components/ui/label";import { Input } from "@/components/ui/input";import type { ItemCreate, ItemTemplateOut, ItemTemplateSummary, LocationOut } from "~~/lib/api/types/data-contracts";- import { useLabelStore } from "~~/stores/labels";+ import { useTagStore } from "~/stores/tags";import { useLocationStore } from "~~/stores/locations";import MdiBarcode from "~icons/mdi/barcode";import MdiBarcodeScan from "~icons/mdi/barcode-scan";@@ -289,7 +289,7 @@import MdiClose from "~icons/mdi/close";import { AttachmentTypes } from "~~/lib/api/types/non-generated";import { useDialog, useDialogHotkey } from "~/components/ui/dialog-provider";- import LabelSelector from "~/components/Label/Selector.vue";+ import TagSelector from "~/components/Tag/Selector.vue";import ItemSelector from "~/components/Item/Selector.vue";import TemplateSelector from "~/components/Template/Selector.vue";import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from "~/components/ui/tooltip";@@ -314,8 +314,8 @@const locationsStore = useLocationStore();const locations = computed(() => locationsStore.allLocations);- const labelStore = useLabelStore();- const labels = computed(() => labelStore.labels);+ const tagStore = useTagStore();+ const tags = computed(() => tagStore.tags);const route = useRoute();const router = useRouter();@@ -325,8 +325,8 @@const subItemCreateParam = useRouteQuery("subItemCreate", "n");const subItemCreate = ref();- const labelId = computed(() => {- if (route.fullPath.includes("/label/")) {+ const tagId = computed(() => {+ if (route.fullPath.includes("/tag/")) {return route.params.id;}return null;@@ -362,7 +362,7 @@quantity: 1,description: "",color: "",- labels: [] as string[],+ tags: [] as string[],photos: [] as PhotoPreview[],});@@ -400,9 +400,9 @@form.location = found;}}- // Pre-fill labels from template- if (data.defaultLabels && data.defaultLabels.length > 0) {- form.labels = data.defaultLabels.map(l => l.id);+ // Pre-fill tags from template+ if (data.defaultTags && data.defaultTags.length > 0) {+ form.tags = data.defaultTags.map(l => l.id);}// Save template ID to localStorage for persistence@@ -440,9 +440,9 @@form.location = found;}}- // Pre-fill labels from template- if (data.defaultLabels && data.defaultLabels.length > 0) {- form.labels = data.defaultLabels.map(l => l.id);+ // Pre-fill tags from template+ if (data.defaultTags && data.defaultTags.length > 0) {+ form.tags = data.defaultTags.map(l => l.id);}}@@ -554,8 +554,8 @@}}- if (labelId.value) {- form.labels = labels.value.filter(l => l.id === labelId.value).map(l => l.id);+ if (tagId.value) {+ form.tags = tags.value.filter(l => l.id === tagId.value).map(l => l.id);}// Restore last used template if available@@ -588,7 +588,7 @@name: form.name,description: form.description,locationId: form.location.id as string,- labelIds: form.labels,+ tagIds: form.tags,quantity: form.quantity,};@@ -603,7 +603,7 @@quantity: form.quantity,description: form.description,locationId: form.location.id as string,- labelIds: form.labels,+ tagIds: form.tags,};const result = await api.items.create(out);@@ -649,7 +649,7 @@form.description = "";form.color = "";form.photos = [];- form.labels = [];+ form.tags = [];selectedTemplate.value = null;templateData.value = null;showTemplateDetails.value = false;diff --git a/frontend/components/Item/View/ItemChangeDetails.vue b/frontend/components/Item/View/ItemChangeDetails.vueindex 4c7925bf..ef0824b1 100644--- a/frontend/components/Item/View/ItemChangeDetails.vue+++ b/frontend/components/Item/View/ItemChangeDetails.vue@@ -3,51 +3,51 @@import { Button } from "@/components/ui/button";import { useDialog } from "@/components/ui/dialog-provider";import { DialogID } from "~/components/ui/dialog-provider/utils";- import type { ItemPatch, ItemSummary, LabelOut, LocationSummary } from "~/lib/api/types/data-contracts";+ import type { ItemPatch, ItemSummary, TagOut, LocationSummary } from "~/lib/api/types/data-contracts";import LocationSelector from "~/components/Location/Selector.vue";import MdiLoading from "~icons/mdi/loading";import { toast } from "~/components/ui/sonner";import { useI18n } from "vue-i18n";- import LabelSelector from "~/components/Label/Selector.vue";+ import TagSelector from "~/components/Tag/Selector.vue";const { closeDialog, registerOpenDialogCallback } = useDialog();const api = useUserApi();const { t } = useI18n();- const labelStore = useLabelStore();+ const tagStore = useTagStore();- const allLabels = computed(() => labelStore.labels);+ const allTags = computed(() => tagStore.tags);const items = ref<ItemSummary[]>([]);const saving = ref(false);const enabled = reactive({changeLocation: false,- addLabels: false,- removeLabels: false,+ addTags: false,+ removeTags: false,});const newLocation = ref<LocationSummary | null>(null);- const addLabels = ref<string[]>([]);- const removeLabels = ref<string[]>([]);+ const addTags = ref<string[]>([]);+ const removeTags = ref<string[]>([]);- const availableToAddLabels = ref<LabelOut[]>([]);- const availableToRemoveLabels = ref<LabelOut[]>([]);+ const availableToAddTags = ref<TagOut[]>([]);+ const availableToRemoveTags = ref<TagOut[]>([]);- const intersectLabelIds = (items: ItemSummary[]): string[] => {+ const intersectTagIds = (items: ItemSummary[]): string[] => {if (items.length === 0) return [];const counts = new Map<string, number>();for (const it of items) {const seen = new Set<string>();- for (const l of it.labels || []) seen.add(l.id);+ for (const l of it.tags || []) seen.add(l.id);for (const id of seen) counts.set(id, (counts.get(id) || 0) + 1);}return [...counts.entries()].filter(([_, c]) => c === items.length).map(([id]) => id);};- const unionLabelIds = (items: ItemSummary[]): string[] => {+ const unionTagIds = (items: ItemSummary[]): string[] => {const s = new Set<string>();- for (const it of items) for (const l of it.labels || []) s.add(l.id);+ for (const it of items) for (const l of it.tags || []) s.add(l.id);return Array.from(s);};@@ -55,8 +55,8 @@const cleanup = registerOpenDialogCallback(DialogID.ItemChangeDetails, params => {items.value = params.items;enabled.changeLocation = params.changeLocation ?? false;- enabled.addLabels = params.addLabels ?? false;- enabled.removeLabels = params.removeLabels ?? false;+ enabled.addTags = params.addTags ?? false;+ enabled.removeTags = params.removeTags ?? false;if (params.changeLocation && params.items.length > 0) {// if all locations are the same then set the current location to said location@@ -68,14 +68,14 @@}}- if (params.addLabels && params.items.length > 0) {- const intersection = intersectLabelIds(params.items);- availableToAddLabels.value = allLabels.value.filter(l => !intersection.includes(l.id));+ if (params.addTags && params.items.length > 0) {+ const intersection = intersectTagIds(params.items);+ availableToAddTags.value = allTags.value.filter(l => !intersection.includes(l.id));}- if (params.removeLabels && params.items.length > 0) {- const union = unionLabelIds(params.items);- availableToRemoveLabels.value = allLabels.value.filter(l => union.includes(l.id));+ if (params.removeTags && params.items.length > 0) {+ const union = unionTagIds(params.items);+ availableToRemoveTags.value = allTags.value.filter(l => union.includes(l.id));}});@@ -84,8 +84,8 @@const save = async () => {const location = newLocation.value;- const labelsToAdd = addLabels.value;- const labelsToRemove = removeLabels.value;+ const tagsToAdd = addTags.value;+ const tagsToRemove = removeTags.value;if (!items.value.length || (enabled.changeLocation && !location)) {return;}@@ -102,18 +102,18 @@patch.locationId = location!.id;}- let currentLabels = item.labels.map(l => l.id);+ let currentTags = item.tags.map(l => l.id);- if (enabled.addLabels) {- currentLabels = currentLabels.concat(labelsToAdd);+ if (enabled.addTags) {+ currentTags = currentTags.concat(tagsToAdd);}- if (enabled.removeLabels) {- currentLabels = currentLabels.filter(l => !labelsToRemove.includes(l));+ if (enabled.removeTags) {+ currentTags = currentTags.filter(l => !tagsToRemove.includes(l));}- if (enabled.addLabels || enabled.removeLabels) {- patch.labelIds = Array.from(new Set(currentLabels));+ if (enabled.addTags || enabled.removeTags) {+ patch.tagIds = Array.from(new Set(currentTags));}const { error, data } = await api.items.patch(item.id, patch);@@ -128,13 +128,13 @@closeDialog(DialogID.ItemChangeDetails, true);enabled.changeLocation = false;- enabled.addLabels = false;- enabled.removeLabels = false;+ enabled.addTags = false;+ enabled.removeTags = false;items.value = [];- addLabels.value = [];- removeLabels.value = [];- availableToAddLabels.value = [];- availableToRemoveLabels.value = [];+ addTags.value = [];+ removeTags.value = [];+ availableToAddTags.value = [];+ availableToRemoveTags.value = [];saving.value = false;};</script>@@ -146,17 +146,17 @@<DialogTitle>{{ $t("components.item.view.change_details.title") }}</DialogTitle></DialogHeader><LocationSelector v-if="enabled.changeLocation" v-model="newLocation" />- <LabelSelector- v-if="enabled.addLabels"- v-model="addLabels"- :labels="availableToAddLabels"- :name="$t('components.item.view.change_details.add_labels')"+ <TagSelector+ v-if="enabled.addTags"+ v-model="addTags"+ :tags="availableToAddTags"+ :name="$t('components.item.view.change_details.add_tags')"/>- <LabelSelector- v-if="enabled.removeLabels"- v-model="removeLabels"- :labels="availableToRemoveLabels"- :name="$t('components.item.view.change_details.remove_labels')"+ <TagSelector+ v-if="enabled.removeTags"+ v-model="removeTags"+ :tags="availableToRemoveTags"+ :name="$t('components.item.view.change_details.remove_tags')"/><DialogFooter><Button type="submit" :disabled="saving || (enabled.changeLocation && !newLocation)" @click="save">diff --git a/frontend/components/Item/View/table/data-table-dropdown.vue b/frontend/components/Item/View/table/data-table-dropdown.vueindex 5e09cf4d..a51e205b 100644--- a/frontend/components/Item/View/table/data-table-dropdown.vue+++ b/frontend/components/Item/View/table/data-table-dropdown.vue@@ -205,25 +205,25 @@>{{ t("components.item.view.table.dropdown.change_location") }}</DropdownMenuItem>- <!-- change labels -->+ <!-- change tags --><DropdownMenuItem@click="openDialog(DialogID.ItemChangeDetails, {params: {items: multi ? multi.items.map(row => row.original) : [item!],- addLabels: true,- removeLabels: true,+ addTags: true,+ removeTags: true,},onClose: result => {if (result) {- toast.success(t('components.item.view.table.dropdown.change_labels_success'));+ toast.success(t('components.item.view.table.dropdown.change_tags_success'));resetSelection();}},})">- {{ t("components.item.view.table.dropdown.change_labels") }}+ {{ t("components.item.view.table.dropdown.change_tags") }}</DropdownMenuItem><!-- maintenance --><DropdownMenuItemdiff --git a/frontend/components/Item/View/table/data-table-expanded-row.vue b/frontend/components/Item/View/table/data-table-expanded-row.vueindex f854bfd5..b588c3c3 100644--- a/frontend/components/Item/View/table/data-table-expanded-row.vue+++ b/frontend/components/Item/View/table/data-table-expanded-row.vue@@ -1,7 +1,7 @@<script setup lang="ts">import { computed } from "vue";import type { ItemSummary } from "~/lib/api/types/data-contracts";- import LabelChip from "@/components/Label/Chip.vue";+ import TagChip from "@/components/Tag/Chip.vue";import Badge from "~/components/ui/badge/Badge.vue";const props = defineProps<{@@ -35,7 +35,7 @@</NuxtLink></Badge><div class="flex flex-wrap gap-2">- <LabelChip v-for="label in item.labels" :key="label.id" :label="label" size="sm" />+ <TagChip v-for="tag in item.tags" :key="tag.id" :tag="tag" size="sm" /></div><p class="whitespace-pre-line break-words text-sm text-muted-foreground">{{ item.description || $t("components.item.no_description") }}diff --git a/frontend/components/Label/Chip.vue b/frontend/components/Tag/Chip.vuesimilarity index 59%rename from frontend/components/Label/Chip.vuerename to frontend/components/Tag/Chip.vueindex c1b4a0f8..dadc79f5 100644--- a/frontend/components/Label/Chip.vue+++ b/frontend/components/Tag/Chip.vue@@ -1,13 +1,13 @@<script setup lang="ts">- import type { LabelOut, LabelSummary } from "~~/lib/api/types/data-contracts";+ import type { TagOut, TagSummary } from "~~/lib/api/types/data-contracts";import MdiArrowUp from "~icons/mdi/arrow-up";import MdiTagOutline from "~icons/mdi/tag-outline";import { getContrastTextColor } from "~/lib/utils";export type sizes = "sm" | "md" | "lg" | "xl";defineProps({- label: {- type: Object as () => LabelOut | LabelSummary,+ tag: {+ type: Object as () => TagOut | TagSummary,required: true,},size: {@@ -19,29 +19,29 @@<template><NuxtLink- class="group/label-chip flex gap-2 rounded-full shadow transition duration-300 hover:bg-accent/50"+ class="group/tag-chip flex gap-2 rounded-full shadow transition duration-300 hover:bg-accent/50":class="{'p-4 py-1 text-base': size === 'lg','p-3 py-1 text-sm': size !== 'sm' && size !== 'lg','p-2 py-0.5 text-xs': size === 'sm',}":style="- label.color- ? { backgroundColor: label.color, color: getContrastTextColor(label.color) }+ tag.color+ ? { backgroundColor: tag.color, color: getContrastTextColor(tag.color) }: { backgroundColor: 'hsl(var(--accent))' }"- :to="`/label/${label.id}`"+ :to="`/tag/${tag.id}`"><div class="relative"><MdiTagOutline class="invisible" /><!-- hack to ensure the size is correct --><div- class="absolute inset-0 flex items-center justify-center transition-transform duration-300 group-hover/label-chip:rotate-90"+ class="absolute inset-0 flex items-center justify-center transition-transform duration-300 group-hover/tag-chip:rotate-90">- <MdiTagOutline class="group-hover/label-chip:hidden" />- <MdiArrowUp class="hidden group-hover/label-chip:block" />+ <MdiTagOutline class="group-hover/tag-chip:hidden" />+ <MdiArrowUp class="hidden group-hover/tag-chip:block" /></div></div>- {{ label.name }}+ {{ tag.name }}</NuxtLink></template>diff --git a/frontend/components/Label/CreateModal.vue b/frontend/components/Tag/CreateModal.vuesimilarity index 72%rename from frontend/components/Label/CreateModal.vuerename to frontend/components/Tag/CreateModal.vueindex 00d32024..9b87ede7 100644--- a/frontend/components/Label/CreateModal.vue+++ b/frontend/components/Tag/CreateModal.vue@@ -1,20 +1,20 @@<template>- <BaseModal :dialog-id="DialogID.CreateLabel" :title="$t('components.label.create_modal.title')">+ <BaseModal :dialog-id="DialogID.CreateTag" :title="$t('components.tag.create_modal.title')"><form class="flex min-w-0 flex-col gap-2" @submit.prevent="create()"><FormTextFieldv-model="form.name":trigger-focus="focused":autofocus="true"- :label="$t('components.label.create_modal.label_name')"+ :label="$t('components.tag.create_modal.tag_name')":max-length="50":min-length="1"/><FormTextAreav-model="form.description"- :label="$t('components.label.create_modal.label_description')"+ :label="$t('components.tag.create_modal.tag_description')":max-length="1000"/>- <ColorSelector v-model="form.color" :label="$t('components.label.create_modal.label_color')" :show-hex="true" />+ <ColorSelector v-model="form.color" :label="$t('components.tag.create_modal.tag_color')" :show-hex="true" /><div class="mt-4 flex flex-row-reverse"><ButtonGroup><Button :disabled="loading" type="submit">{{ $t("global.create") }}</Button>@@ -42,7 +42,7 @@const { closeDialog } = useDialog();- useDialogHotkey(DialogID.CreateLabel, { code: "Digit2", shift: true });+ useDialogHotkey(DialogID.CreateTag, { code: "Digit2", shift: true });const loading = ref(false);const focused = ref(false);@@ -65,11 +65,11 @@async function create(close = true) {if (loading.value) {- toast.error(t("components.label.create_modal.toast.already_creating"));+ toast.error(t("components.tag.create_modal.toast.already_creating"));return;}if (form.name.length > 50) {- toast.error(t("components.label.create_modal.toast.label_name_too_long"));+ toast.error(t("components.tag.create_modal.toast.tag_name_too_long"));return;}@@ -77,20 +77,20 @@if (shift?.value) close = false;- const { error, data } = await api.labels.create(form);+ const { error, data } = await api.tags.create(form);if (error) {- toast.error(t("components.label.create_modal.toast.create_failed"));+ toast.error(t("components.tag.create_modal.toast.create_failed"));loading.value = false;return;}- toast.success(t("components.label.create_modal.toast.create_success"));+ toast.success(t("components.tag.create_modal.toast.create_success"));reset();if (close) {- closeDialog(DialogID.CreateLabel);- navigateTo(`/label/${data.id}`);+ closeDialog(DialogID.CreateTag);+ navigateTo(`/tag/${data.id}`);}}</script>diff --git a/frontend/components/Label/Selector.vue b/frontend/components/Tag/Selector.vuesimilarity index 77%rename from frontend/components/Label/Selector.vuerename to frontend/components/Tag/Selector.vueindex 1c0a8c7e..ec53dbfc 100644--- a/frontend/components/Label/Selector.vue+++ b/frontend/components/Tag/Selector.vue@@ -1,20 +1,20 @@<template><div class="flex flex-col gap-1"><Label :for="id" class="px-1">- {{ props.name ?? $t("global.labels") }}+ {{ props.name ?? $t("global.tags") }}</Label><TagsInputv-model="modelValue"class="w-full gap-0 px-0"- :display-value="v => props.labels.find(l => l.id === v)?.name ?? 'Loading...'"+ :display-value="v => props.tags.find(t => t.id === v)?.name ?? 'Loading...'"><div class="flex flex-wrap items-center gap-2 overflow-hidden px-3"><TagsInputItem v-for="item in modelValue" :key="item" :value="item" class="h-auto overflow-hidden text-wrap"><span- v-if="props.labels.find(l => l.id === item)?.color"+ v-if="props.tags.find(t => t.id === item)?.color"class="ml-2 size-4 shrink-0 rounded-full"- :style="{ backgroundColor: props.labels.find(l => l.id === item)?.color }"+ :style="{ backgroundColor: props.tags.find(t => t.id === item)?.color }"/><TagsInputItemText class="py-0.5" /><TagsInputItemDelete />@@ -23,7 +23,7 @@<ComboboxRoot v-model="modelValue" v-model:open="open" class="w-full" :ignore-filter="true"><ComboboxAnchor as-child>- <ComboboxInput v-model="searchTerm" :placeholder="$t('components.label.selector.select_labels')" as-child>+ <ComboboxInput v-model="searchTerm" :placeholder="$t('components.tag.selector.select_tags')" as-child><TagsInputInput:id="id"class="w-full px-3"@@ -42,9 +42,9 @@<CommandEmpty /><CommandGroup><CommandItem- v-for="label in filteredLabels"- :key="label.value"- :value="label.value"+ v-for="tag in filteredTags"+ :key="tag.value"+ :value="tag.value"@select.prevent="ev => {if (typeof ev.detail.value === 'string') {@@ -62,10 +62,10 @@><spanclass="mr-2 size-4 shrink-0 rounded-full align-middle"- :class="{ border: props.labels.find(l => l.id === label.value)?.color }"- :style="{ backgroundColor: props.labels.find(l => l.id === label.value)?.color }"+ :class="{ border: props.tags.find(t => t.id === tag.value)?.color }"+ :style="{ backgroundColor: props.tags.find(t => t.id === tag.value)?.color }"/>- {{ label.label }}+ {{ tag.label }}</CommandItem></CommandGroup></CommandList>@@ -89,7 +89,7 @@TagsInputItemDelete,TagsInputItemText,} from "@/components/ui/tags-input";- import type { LabelOut } from "~/lib/api/types/data-contracts";+ import type { TagOut } from "~/lib/api/types/data-contracts";import { Label } from "@/components/ui/label";const { t } = useI18n();@@ -104,8 +104,8 @@type: Array as () => string[],default: null,},- labels: {- type: Array as () => LabelOut[],+ tags: {+ type: Array as () => TagOut[],required: true,},name: {@@ -120,9 +120,9 @@const open = ref(false);const searchTerm = ref("");- const filteredLabels = computed(() => {+ const filteredTags = computed(() => {const filtered = fuzzysort- .go(searchTerm.value, props.labels, { key: "name", all: true })+ .go(searchTerm.value, props.tags, { key: "name", all: true }).map(l => ({value: l.obj.id,label: l.obj.name,@@ -132,7 +132,7 @@// Only show "Create" option if search term is not empty and no exact match existsif (searchTerm.value.trim() !== "") {const trimmedSearchTerm = searchTerm.value.trim();- const hasExactMatch = props.labels.some(label => label.name.toLowerCase() === trimmedSearchTerm.toLowerCase());+ const hasExactMatch = props.tags.some(tag => tag.name.toLowerCase() === trimmedSearchTerm.toLowerCase());if (!hasExactMatch) {filtered.push({ value: "create-item", label: `${t("global.create")} ${searchTerm.value}` });@@ -144,24 +144,24 @@const createAndAdd = async (name: string, color = "") => {if (name.length > 50) {- toast.error(t("components.label.create_modal.toast.label_name_too_long"));+ toast.error(t("components.tag.create_modal.toast.tag_name_too_long"));return;}- const { error, data } = await api.labels.create({+ const { error, data } = await api.tags.create({name,color,description: "",});if (error) {- toast.error(t("components.label.create_modal.toast.create_failed"));+ toast.error(t("components.tag.create_modal.toast.create_failed"));return;}- toast.success(t("components.label.create_modal.toast.create_success"));+ toast.success(t("components.tag.create_modal.toast.create_success"));modelValue.value = [...modelValue.value, data.id];};- // TODO: when reka-ui 2 is release use hook to set cursor to end when label is added with click+ // TODO: when reka-ui 2 is release use hook to set cursor to end when tag is added with click</script>diff --git a/frontend/components/Template/Card.vue b/frontend/components/Template/Card.vueindex f9eb179c..61e5930e 100644--- a/frontend/components/Template/Card.vue+++ b/frontend/components/Template/Card.vue@@ -59,7 +59,7 @@defaultLifetimeWarranty: fullTemplate.defaultLifetimeWarranty,defaultWarrantyDetails: fullTemplate.defaultWarrantyDetails,defaultLocationId: fullTemplate.defaultLocation?.id ?? null,- defaultLabelIds: fullTemplate.defaultLabels?.map(l => l.id) || [],+ defaultTagIds: fullTemplate.defaultTags?.map(l => l.id) ?? [],includeWarrantyFields: fullTemplate.includeWarrantyFields,includePurchaseFields: fullTemplate.includePurchaseFields,includeSoldFields: fullTemplate.includeSoldFields,diff --git a/frontend/components/Template/CreateModal.vue b/frontend/components/Template/CreateModal.vueindex b1169552..352fb71a 100644--- a/frontend/components/Template/CreateModal.vue+++ b/frontend/components/Template/CreateModal.vue@@ -40,7 +40,7 @@v-model="form.defaultLocationObject":label="$t('components.template.form.default_location')"/>- <LabelSelector v-model="form.defaultLabelIds" :labels="labels ?? []" />+ <TagSelector v-model="form.defaultTagIds" :tags="tags ?? []" /><div class="flex items-center gap-4"><div class="flex items-center gap-2"><Switch id="defaultInsured" v-model:checked="form.defaultInsured" />@@ -105,15 +105,15 @@import { Switch } from "@/components/ui/switch";import { Label } from "@/components/ui/label";import LocationSelector from "~/components/Location/Selector.vue";- import LabelSelector from "~/components/Label/Selector.vue";- import { useLabelStore } from "~~/stores/labels";+ import TagSelector from "~/components/Tag/Selector.vue";+ import { useTagStore } from "~/stores/tags";import type { LocationSummary } from "~~/lib/api/types/data-contracts";const emit = defineEmits<{ created: [] }>();const { closeDialog } = useDialog();- const labelStore = useLabelStore();- const labels = computed(() => labelStore.labels);+ const tagStore = useTagStore();+ const tags = computed(() => tagStore.tags);const loading = ref(false);const form = reactive({@@ -130,7 +130,7 @@defaultWarrantyDetails: "",defaultLocationId: null as string | null,defaultLocationObject: null as LocationSummary | null,- defaultLabelIds: [] as string[],+ defaultTagIds: [] as string[],includeWarrantyFields: false,includePurchaseFields: false,includeSoldFields: false,@@ -158,7 +158,7 @@defaultWarrantyDetails: "",defaultLocationId: null,defaultLocationObject: null,- defaultLabelIds: [],+ defaultTagIds: [],includeWarrantyFields: false,includePurchaseFields: false,includeSoldFields: false,@@ -189,7 +189,7 @@defaultLifetimeWarranty: form.defaultLifetimeWarranty,defaultWarrantyDetails: form.defaultWarrantyDetails || null,defaultLocationId: form.defaultLocationObject?.id ?? null,- defaultLabelIds: form.defaultLabelIds,+ defaultTagIds: form.defaultTagIds,includeWarrantyFields: form.includeWarrantyFields,includePurchaseFields: form.includePurchaseFields,includeSoldFields: form.includeSoldFields,diff --git a/frontend/components/WipeInventoryDialog.vue b/frontend/components/WipeInventoryDialog.vueindex 29eca418..a61de62d 100644--- a/frontend/components/WipeInventoryDialog.vue+++ b/frontend/components/WipeInventoryDialog.vue@@ -10,14 +10,9 @@<div class="space-y-2"><div class="flex items-center space-x-2">- <input- id="wipe-labels-checkbox"- v-model="wipeLabels"- type="checkbox"- class="size-4 rounded border-gray-300"- />- <label for="wipe-labels-checkbox" class="cursor-pointer text-sm font-medium">- {{ $t("tools.actions_set.wipe_inventory_labels") }}+ <input id="wipe-tags-checkbox" v-model="wipeTags" type="checkbox" class="size-4 rounded border-gray-300" />+ <label for="wipe-tags-checkbox" class="cursor-pointer text-sm font-medium">+ {{ $t("tools.actions_set.wipe_inventory_tags") }}</label></div>@@ -79,14 +74,14 @@const { registerOpenDialogCallback, closeDialog, addAlert, removeAlert } = useDialog();const dialog = ref(false);- const wipeLabels = ref(false);+ const wipeTags = ref(false);const wipeLocations = ref(false);const wipeMaintenance = ref(false);const isConfirming = ref(false);registerOpenDialogCallback(DialogID.WipeInventory, () => {dialog.value = true;- wipeLabels.value = false;+ wipeTags.value = false;wipeLocations.value = false;wipeMaintenance.value = false;isConfirming.value = false;@@ -118,7 +113,7 @@function confirm() {isConfirming.value = true;const result = {- wipeLabels: wipeLabels.value,+ wipeTags: wipeTags.value,wipeLocations: wipeLocations.value,wipeMaintenance: wipeMaintenance.value,};diff --git a/frontend/components/ui/dialog-provider/utils.ts b/frontend/components/ui/dialog-provider/utils.tsindex 4d0acd4e..da9e39f4 100644--- a/frontend/components/ui/dialog-provider/utils.ts+++ b/frontend/components/ui/dialog-provider/utils.ts@@ -14,7 +14,7 @@ export enum DialogID {ChangePassword = "changePassword",CreateItem = "create-item",CreateLocation = "create-location",- CreateLabel = "create-label",+ CreateTag = "create-tag",CreateCollection = "create-collection",CreateGroupInvite = "create-group-invite",JoinCollection = "join-collection",@@ -31,7 +31,7 @@ export enum DialogID {QuickMenu = "quick-menu",Scanner = "scanner",PageQRCode = "page-qr-code",- UpdateLabel = "update-label",+ UpdateTag = "update-tag",UpdateLocation = "update-location",UpdateTemplate = "update-template",ItemChangeDetails = "item-table-updater",@@ -69,8 +69,8 @@ export type DialogParamsMap = {[DialogID.ItemChangeDetails]: {items: ItemSummary[];changeLocation?: boolean;- addLabels?: boolean;- removeLabels?: boolean;+ addTags?: boolean;+ removeTags?: boolean;};[DialogID.CreateCollection]?: { redirectTo?: string };[DialogID.JoinCollection]?: { redirectTo?: string };@@ -83,7 +83,7 @@ export type DialogResultMap = {[DialogID.ItemImage]?: { action: "delete"; id: string };[DialogID.EditMaintenance]?: boolean;[DialogID.ItemChangeDetails]?: boolean;- [DialogID.WipeInventory]?: { wipeLabels: boolean; wipeLocations: boolean; wipeMaintenance: boolean };+ [DialogID.WipeInventory]?: { wipeTags: boolean; wipeLocations: boolean; wipeMaintenance: boolean };[DialogID.CreateGroupInvite]?: GroupInvitation;};diff --git a/frontend/composables/use-item-search.ts b/frontend/composables/use-item-search.tsindex 095bd434..edd10b73 100644--- a/frontend/composables/use-item-search.ts+++ b/frontend/composables/use-item-search.ts@@ -1,4 +1,4 @@-import type { ItemSummary, LabelSummary, LocationSummary } from "~~/lib/api/types/data-contracts";+import type { ItemSummary, TagSummary, LocationSummary } from "~~/lib/api/types/data-contracts";import type { UserClient } from "~~/lib/api/user";type SearchOptions = {@@ -8,7 +8,7 @@ type SearchOptions = {export function useItemSearch(client: UserClient, opts?: SearchOptions) {const query = ref("");const locations = ref<LocationSummary[]>([]);- const labels = ref<LabelSummary[]>([]);+ const tags = ref<TagSummary[]>([]);const results = ref<ItemSummary[]>([]);const includeArchived = ref(false);const isLoading = ref(false);@@ -26,12 +26,12 @@ export function useItemSearch(client: UserClient, opts?: SearchOptions) {isLoading.value = true;try {const locIds = locations.value.map(l => l.id);- const labelIds = labels.value.map(l => l.id);+ const tagIds = tags.value.map(t => t.id);const { data, error } = await client.items.getAll({q: searchQuery,locations: locIds,- labels: labelIds,+ tags: tagIds,includeArchived: includeArchived.value,});@@ -85,7 +85,7 @@ export function useItemSearch(client: UserClient, opts?: SearchOptions) {query,results,locations,- labels,+ tags,isLoading,triggerSearch,};diff --git a/frontend/composables/use-server-events.ts b/frontend/composables/use-server-events.tsindex 0d61087a..22583f96 100644--- a/frontend/composables/use-server-events.ts+++ b/frontend/composables/use-server-events.ts@@ -4,7 +4,7 @@ import { watch } from "vue";export enum ServerEvent {LocationMutation = "location.mutation",ItemMutation = "item.mutation",- LabelMutation = "label.mutation",+ TagMutation = "tag.mutation",}export type EventMessage = {@@ -53,7 +53,7 @@ function connect(onmessage: (m: EventMessage) => void) {thorttled.set(ServerEvent.LocationMutation, useThrottleFn(onmessage, 1000));thorttled.set(ServerEvent.ItemMutation, useThrottleFn(onmessage, 1000));- thorttled.set(ServerEvent.LabelMutation, useThrottleFn(onmessage, 1000));+ thorttled.set(ServerEvent.TagMutation, useThrottleFn(onmessage, 1000));ws.onmessage = msg => {const pm = JSON.parse(msg.data);diff --git a/frontend/layouts/default.vue b/frontend/layouts/default.vueindex 70577502..04a7db6c 100644--- a/frontend/layouts/default.vue+++ b/frontend/layouts/default.vue@@ -9,7 +9,7 @@<OutdatedModal v-if="status" :status="status" /><ItemCreateModal /><WipeInventoryDialog />- <LabelCreateModal />+ <TagCreateModal /><LocationCreateModal /><ItemBarcodeModal /><AppQuickMenuModal :actions="quickMenuActions" />@@ -178,7 +178,7 @@<script lang="ts" setup>import { useI18n } from "vue-i18n";import DOMPurify from "dompurify";- import { useLabelStore } from "~~/stores/labels";+ import { useTagStore } from "~/stores/tags";import { useLocationStore } from "~~/stores/locations";import MdiHome from "~icons/mdi/home";@@ -225,7 +225,7 @@import ItemCreateModal from "~/components/Item/CreateModal.vue";import WipeInventoryDialog from "~/components/WipeInventoryDialog.vue";- import LabelCreateModal from "~/components/Label/CreateModal.vue";+ import TagCreateModal from "~/components/Tag/CreateModal.vue";import LocationCreateModal from "~/components/Location/CreateModal.vue";import ItemBarcodeModal from "~/components/Item/BarcodeModal.vue";import AppQuickMenuModal from "~/components/App/QuickMenuModal.vue";@@ -313,9 +313,9 @@},{id: 2,- name: computed(() => t("menu.create_label")),+ name: computed(() => t("menu.create_tag")),shortcut: "Shift+2",- dialogId: DialogID.CreateLabel,+ dialogId: DialogID.CreateTag,},];@@ -387,8 +387,8 @@})),]);- const labelStore = useLabelStore();- labelStore.ensureAllLabelsFetched();+ const tagStore = useTagStore();+ tagStore.ensureAllTagsFetched();const locationStore = useLocationStore();locationStore.ensureLocationsFetched();@@ -398,8 +398,8 @@locationStore.refreshTree();});- onServerEvent(ServerEvent.LabelMutation, () => {- labelStore.refresh();+ onServerEvent(ServerEvent.TagMutation, () => {+ tagStore.refresh();});onServerEvent(ServerEvent.LocationMutation, () => {diff --git a/frontend/lib/api/__test__/factories/index.ts b/frontend/lib/api/__test__/factories/index.tsindex 47e8e20a..6796a23d 100644--- a/frontend/lib/api/__test__/factories/index.ts+++ b/frontend/lib/api/__test__/factories/index.ts@@ -5,7 +5,7 @@ import { PublicApi } from "../../public";import type {ItemField,ItemTemplateCreate,- LabelCreate,+ TagCreate,LocationCreate,UserRegistration,} from "../../types/data-contracts";@@ -47,7 +47,7 @@ function location(parentId: string | null = null): LocationCreate {};}-function label(): LabelCreate {+function tag(): TagCreate {return {name: faker.lorem.word(),description: faker.lorem.sentence(),@@ -69,7 +69,7 @@ function template(): ItemTemplateCreate {defaultLifetimeWarranty: false,defaultWarrantyDetails: "",defaultLocationId: null,- defaultLabelIds: null,+ defaultTagIds: null,includeWarrantyFields: false,includePurchaseFields: false,includeSoldFields: false,@@ -113,7 +113,7 @@ async function userSingleUse(): Promise<TestUser> {export const factories = {user,location,- label,+ tag,template,itemField,client: {diff --git a/frontend/lib/api/__test__/user/items.test.ts b/frontend/lib/api/__test__/user/items.test.tsindex 87c3e894..3736656a 100644--- a/frontend/lib/api/__test__/user/items.test.ts+++ b/frontend/lib/api/__test__/user/items.test.ts@@ -36,7 +36,7 @@ describe("user should be able to create an item and add an attachment", () => {const { response, data: item } = await api.items.create({parentId: null,name: "test-item",- labelIds: [],+ tagIds: [],description: "test-description",quantity: 2,locationId: location.id,@@ -71,7 +71,7 @@ describe("user should be able to create an item and add an attachment", () => {const { response, data: item } = await api.items.create({parentId: null,name: faker.vehicle.model(),- labelIds: [],+ tagIds: [],description: faker.lorem.paragraph(1),quantity: 2,locationId: location.id,@@ -90,7 +90,7 @@ describe("user should be able to create an item and add an attachment", () => {parentId: null,...item,locationId: item.location?.id || null,- labelIds: item.labels.map(l => l.id),+ tagIds: item.tags.map(l => l.id),fields,};@@ -126,7 +126,7 @@ describe("user should be able to create an item and add an attachment", () => {const { response, data: item } = await api.items.create({parentId: null,name: faker.vehicle.model(),- labelIds: [],+ tagIds: [],description: faker.lorem.paragraph(1),quantity: 2,locationId: location.id,@@ -178,7 +178,7 @@ describe("user should be able to create an item and add an attachment", () => {const { response, data: item } = await api.items.create({name: faker.vehicle.model(),- labelIds: [],+ tagIds: [],description: faker.lorem.paragraph(1),quantity: 2,locationId: lastLocationId,@@ -203,7 +203,7 @@ describe("user should be able to create an item and add an attachment", () => {const { response: parentResponse, data: parent } = await api.items.create({name: "parent-item",- labelIds: [],+ tagIds: [],description: "test-description",quantity: 2,locationId: parentLocation.id,@@ -213,7 +213,7 @@ describe("user should be able to create an item and add an attachment", () => {const { response: child1Response, data: child1Item } = await api.items.create({name: "child1-item",- labelIds: [],+ tagIds: [],description: "test-description",quantity: 2,locationId: childsLocation.id,@@ -223,14 +223,14 @@ describe("user should be able to create an item and add an attachment", () => {parentId: parent.id,...child1Item,locationId: child1Item.location?.id,- labelIds: [],+ tagIds: [],};const { response: child1UpdatedResponse } = await api.items.update(child1Item.id, child1ItemUpdate as ItemUpdate);expect(child1UpdatedResponse.status).toBe(200);const { response: child2Response, data: child2Item } = await api.items.create({name: "child2-item",- labelIds: [],+ tagIds: [],description: "test-description",quantity: 2,locationId: childsLocation.id,@@ -240,7 +240,7 @@ describe("user should be able to create an item and add an attachment", () => {parentId: parent.id,...child2Item,locationId: child2Item.location?.id,- labelIds: [],+ tagIds: [],};const { response: child2UpdatedResponse } = await api.items.update(child2Item.id, child2ItemUpdate as ItemUpdate);expect(child2UpdatedResponse.status).toBe(200);@@ -249,7 +249,7 @@ describe("user should be able to create an item and add an attachment", () => {parentId: null,...parent,locationId: parentLocation.id,- labelIds: [],+ tagIds: [],syncChildItemsLocations: true,};const { response: updateResponse } = await api.items.update(parent.id, itemUpdate);diff --git a/frontend/lib/api/__test__/user/labels.test.ts b/frontend/lib/api/__test__/user/labels.test.tsdeleted file mode 100644index 851f6b1a..00000000--- a/frontend/lib/api/__test__/user/labels.test.ts+++ /dev/null@@ -1,82 +0,0 @@-import { describe, expect, test } from "vitest";-import type { LabelOut } from "../../types/data-contracts";-import type { UserClient } from "../../user";-import { factories } from "../factories";-import { sharedUserClient } from "../test-utils";--describe("locations lifecycle (create, update, delete)", () => {- /**- * useLabel sets up a label resource for testing, and returns a function- * that can be used to delete the label from the backend server.- */- async function useLabel(api: UserClient): Promise<[LabelOut, () => Promise<void>]> {- const { response, data } = await api.labels.create(factories.label());- expect(response.status).toBe(201);-- const cleanup = async () => {- const { response } = await api.labels.delete(data.id);- expect(response.status).toBe(204);- };- return [data, cleanup];- }-- test("user should be able to create a label", async () => {- const api = await sharedUserClient();-- const labelData = factories.label();-- const { response, data } = await api.labels.create(labelData);-- expect(response.status).toBe(201);- expect(data.id).toBeTruthy();-- // Ensure we can get the label- const { response: getResponse, data: getData } = await api.labels.get(data.id);-- expect(getResponse.status).toBe(200);- expect(getData.id).toBe(data.id);- expect(getData.name).toBe(labelData.name);- expect(getData.description).toBe(labelData.description);-- // Cleanup- const { response: deleteResponse } = await api.labels.delete(data.id);- expect(deleteResponse.status).toBe(204);- });-- test("user should be able to update a label", async () => {- const api = await sharedUserClient();- const [label, cleanup] = await useLabel(api);-- const labelData = {- name: "test-label",- description: "test-description",- color: "",- };-- const { response, data } = await api.labels.update(label.id, labelData);- expect(response.status).toBe(200);- expect(data.id).toBe(label.id);-- // Ensure we can get the label- const { response: getResponse, data: getData } = await api.labels.get(data.id);- expect(getResponse.status).toBe(200);- expect(getData.id).toBe(data.id);- expect(getData.name).toBe(labelData.name);- expect(getData.description).toBe(labelData.description);-- // Cleanup- await cleanup();- });-- test("user should be able to delete a label", async () => {- const api = await sharedUserClient();- const [label, _] = await useLabel(api);-- const { response } = await api.labels.delete(label.id);- expect(response.status).toBe(204);-- // Ensure we can't get the label- const { response: getResponse } = await api.labels.get(label.id);- expect(getResponse.status).toBe(404);- });-});diff --git a/frontend/lib/api/__test__/user/stats.test.ts b/frontend/lib/api/__test__/user/stats.test.tsindex baea7da9..6f10677c 100644--- a/frontend/lib/api/__test__/user/stats.test.ts+++ b/frontend/lib/api/__test__/user/stats.test.ts@@ -6,7 +6,7 @@ import { factories } from "../factories";type ImportObj = {[`HB.import_ref`]: string;[`HB.location`]: string;- [`HB.labels`]: string;+ [`HB.tags`]: string;[`HB.quantity`]: number;[`HB.name`]: string;[`HB.description`]: string;@@ -40,7 +40,7 @@ function importFileGenerator(entries: number): ImportObj[] {const pick = (arr: string[]) => arr[Math.floor(Math.random() * arr.length)];- const labels = faker.word.words(5).split(" ").join(";");+ const tags = faker.word.words(5).split(" ").join(";");const locations = faker.word.words(3).split(" ");const half = Math.floor(entries / 2);@@ -52,7 +52,7 @@ function importFileGenerator(entries: number): ImportObj[] {imports.push({[`HB.import_ref`]: faker.database.mongodbObjectId(),[`HB.location`]: pick(locations),- [`HB.labels`]: labels,+ [`HB.tags`]: tags,[`HB.quantity`]: Number(faker.number.int(2)),[`HB.name`]: faker.word.words(3),[`HB.description`]: "",@@ -78,7 +78,7 @@ function importFileGenerator(entries: number): ImportObj[] {describe("group related statistics tests", () => {const TOTAL_ITEMS = 30;- const labelData: Record<string, number> = {};+ const tagData: Record<string, number> = {};const locationData: Record<string, number> = {};let tAPI: UserClient | undefined;@@ -103,12 +103,12 @@ describe("group related statistics tests", () => {expect(setupResp.status).toBe(204);for (const item of imports) {- const labels = item[`HB.labels`].split(";");- for (const label of labels) {- if (labelData[label]) {- labelData[label] += item[`HB.purchase_price`];+ const tags = item[`HB.tags`].split(";");+ for (const tag of tags) {+ if (tagData[tag]) {+ tagData[tag] += item[`HB.purchase_price`];} else {- labelData[label] = item[`HB.purchase_price`];+ tagData[tag] = item[`HB.purchase_price`];}}@@ -126,18 +126,18 @@ describe("group related statistics tests", () => {expect(status).toBe(200);expect(data.totalItems).toEqual(TOTAL_ITEMS);- expect(data.totalLabels).toEqual(11); // default + new+ expect(data.totalTags).toEqual(11); // default + newexpect(data.totalLocations).toEqual(11); // default + newexpect(data.totalUsers).toEqual(1);expect(data.totalWithWarranty).toEqual(Math.floor(TOTAL_ITEMS / 2));});- test("Validate Labels Statistics", async () => {- const { status, data } = await api().stats.labels();+ test("Validate Tags Statistics", async () => {+ const { status, data } = await api().stats.tags();expect(status).toBe(200);- for (const label of data) {- expect(label.total).toEqual(labelData[label.name]);+ for (const tag of data) {+ expect(tag.total).toEqual(tagData[tag.name]);}});diff --git a/frontend/lib/api/__test__/user/tags.test.ts b/frontend/lib/api/__test__/user/tags.test.tsnew file mode 100644index 00000000..8c2fa3bf--- /dev/null+++ b/frontend/lib/api/__test__/user/tags.test.ts@@ -0,0 +1,82 @@+import { describe, expect, test } from "vitest";+import type { TagOut } from "../../types/data-contracts";+import type { UserClient } from "../../user";+import { factories } from "../factories";+import { sharedUserClient } from "../test-utils";++describe("tags lifecycle (create, update, delete)", () => {+ /**+ * useTag sets up a tag resource for testing, and returns a function+ * that can be used to delete the tag from the backend server.+ */+ async function useTag(api: UserClient): Promise<[TagOut, () => Promise<void>]> {+ const { response, data } = await api.tags.create(factories.tag());+ expect(response.status).toBe(201);++ const cleanup = async () => {+ const { response } = await api.tags.delete(data.id);+ expect(response.status).toBe(204);+ };+ return [data, cleanup];+ }++ test("user should be able to create a tag", async () => {+ const api = await sharedUserClient();++ const tagData = factories.tag();++ const { response, data } = await api.tags.create(tagData);++ expect(response.status).toBe(201);+ expect(data.id).toBeTruthy();++ // Ensure we can get the tag+ const { response: getResponse, data: getData } = await api.tags.get(data.id);++ expect(getResponse.status).toBe(200);+ expect(getData.id).toBe(data.id);+ expect(getData.name).toBe(tagData.name);+ expect(getData.description).toBe(tagData.description);++ // Cleanup+ const { response: deleteResponse } = await api.tags.delete(data.id);+ expect(deleteResponse.status).toBe(204);+ });++ test("user should be able to update a tag", async () => {+ const api = await sharedUserClient();+ const [tag, cleanup] = await useTag(api);++ const tagData = {+ name: "test-tag",+ description: "test-description",+ color: "",+ };++ const { response, data } = await api.tags.update(tag.id, tagData);+ expect(response.status).toBe(200);+ expect(data.id).toBe(tag.id);++ // Ensure we can get the tag+ const { response: getResponse, data: getData } = await api.tags.get(data.id);+ expect(getResponse.status).toBe(200);+ expect(getData.id).toBe(data.id);+ expect(getData.name).toBe(tagData.name);+ expect(getData.description).toBe(tagData.description);++ // Cleanup+ await cleanup();+ });++ test("user should be able to delete a tag", async () => {+ const api = await sharedUserClient();+ const [tag, _] = await useTag(api);++ const { response } = await api.tags.delete(tag.id);+ expect(response.status).toBe(204);++ // Ensure we can't get the tag+ const { response: getResponse } = await api.tags.get(tag.id);+ expect(getResponse.status).toBe(404);+ });+});diff --git a/frontend/lib/api/__test__/user/templates.test.ts b/frontend/lib/api/__test__/user/templates.test.tsindex a183e624..8f168cee 100644--- a/frontend/lib/api/__test__/user/templates.test.ts+++ b/frontend/lib/api/__test__/user/templates.test.ts@@ -81,7 +81,7 @@ describe("templates lifecycle (create, update, delete)", () => {defaultLifetimeWarranty: true,defaultWarrantyDetails: "Lifetime coverage",defaultLocationId: null,- defaultLabelIds: null,+ defaultTagIds: null,includeWarrantyFields: true,includePurchaseFields: true,includeSoldFields: false,@@ -174,7 +174,7 @@ describe("templates lifecycle (create, update, delete)", () => {defaultLifetimeWarranty: createdTemplate.defaultLifetimeWarranty,defaultWarrantyDetails: createdTemplate.defaultWarrantyDetails,defaultLocationId: null,- defaultLabelIds: null,+ defaultTagIds: null,includeWarrantyFields: createdTemplate.includeWarrantyFields,includePurchaseFields: createdTemplate.includePurchaseFields,includeSoldFields: createdTemplate.includeSoldFields,@@ -197,7 +197,7 @@ describe("templates lifecycle (create, update, delete)", () => {});});-describe("templates with location and labels", () => {+describe("templates with location and tags", () => {test("user should be able to create a template with a default location", async () => {const api = await sharedUserClient();@@ -222,31 +222,31 @@ describe("templates with location and labels", () => {await api.locations.delete(location.id);});- test("user should be able to create a template with default labels", async () => {+ test("user should be able to create a template with default tags", async () => {const api = await sharedUserClient();- // First create some labels- const { response: label1Response, data: label1 } = await api.labels.create(factories.label());- expect(label1Response.status).toBe(201);+ // First create some tags+ const { response: tag1Response, data: tag1 } = await api.tags.create(factories.tag());+ expect(tag1Response.status).toBe(201);- const { response: label2Response, data: label2 } = await api.labels.create(factories.label());- expect(label2Response.status).toBe(201);+ const { response: tag2Response, data: tag2 } = await api.tags.create(factories.tag());+ expect(tag2Response.status).toBe(201);- // Create template with labels+ // Create template with tagsconst templateData = factories.template();- templateData.defaultLabelIds = [label1.id, label2.id];+ templateData.defaultTagIds = [tag1.id, tag2.id];const { response, data } = await api.templates.create(templateData);expect(response.status).toBe(201);- expect(data.defaultLabels).toHaveLength(2);- expect(data.defaultLabels.map(l => l.id)).toContain(label1.id);- expect(data.defaultLabels.map(l => l.id)).toContain(label2.id);+ expect(data.defaultTags).toHaveLength(2);+ expect(data.defaultTags.map(l => l.id)).toContain(tag1.id);+ expect(data.defaultTags.map(l => l.id)).toContain(tag2.id);// Cleanupawait api.templates.delete(data.id);- await api.labels.delete(label1.id);- await api.labels.delete(label2.id);+ await api.tags.delete(tag1.id);+ await api.tags.delete(tag2.id);});test("user should be able to update template to remove location", async () => {@@ -279,7 +279,7 @@ describe("templates with location and labels", () => {defaultLifetimeWarranty: template.defaultLifetimeWarranty,defaultWarrantyDetails: template.defaultWarrantyDetails,defaultLocationId: null,- defaultLabelIds: null,+ defaultTagIds: null,includeWarrantyFields: template.includeWarrantyFields,includePurchaseFields: template.includePurchaseFields,includeSoldFields: template.includeSoldFields,diff --git a/frontend/lib/api/classes/actions.ts b/frontend/lib/api/classes/actions.tsindex 43057c13..31b14fe2 100644--- a/frontend/lib/api/classes/actions.ts+++ b/frontend/lib/api/classes/actions.ts@@ -32,9 +32,9 @@ export class ActionsAPI extends BaseAPI {});}- wipeInventory(options?: { wipeLabels?: boolean; wipeLocations?: boolean; wipeMaintenance?: boolean }) {+ wipeInventory(options?: { wipeTags?: boolean; wipeLocations?: boolean; wipeMaintenance?: boolean }) {return this.http.post<- { wipeLabels?: boolean; wipeLocations?: boolean; wipeMaintenance?: boolean },+ { wipeTags?: boolean; wipeLocations?: boolean; wipeMaintenance?: boolean },ActionAmountResult>({url: route("/actions/wipe-inventory"),diff --git a/frontend/lib/api/classes/items.ts b/frontend/lib/api/classes/items.tsindex 3639b79e..a4a82dfa 100644--- a/frontend/lib/api/classes/items.ts+++ b/frontend/lib/api/classes/items.ts@@ -22,8 +22,8 @@ export type ItemsQuery = {page?: number;pageSize?: number;locations?: string[];- labels?: string[];- negateLabels?: boolean;+ tags?: string[];+ negateTags?: boolean;onlyWithoutPhoto?: boolean;onlyWithPhoto?: boolean;parentIds?: string[];diff --git a/frontend/lib/api/classes/labels.ts b/frontend/lib/api/classes/labels.tsdeleted file mode 100644index 6f7eaf05..00000000--- a/frontend/lib/api/classes/labels.ts+++ /dev/null@@ -1,24 +0,0 @@-import { BaseAPI, route } from "../base";-import type { LabelCreate, LabelOut } from "../types/data-contracts";--export class LabelsApi extends BaseAPI {- getAll() {- return this.http.get<LabelOut[]>({ url: route("/labels") });- }-- create(body: LabelCreate) {- return this.http.post<LabelCreate, LabelOut>({ url: route("/labels"), body });- }-- get(id: string) {- return this.http.get<LabelOut>({ url: route(`/labels/${id}`) });- }-- delete(id: string) {- return this.http.delete<void>({ url: route(`/labels/${id}`) });- }-- update(id: string, body: LabelCreate) {- return this.http.put<LabelCreate, LabelOut>({ url: route(`/labels/${id}`), body });- }-}diff --git a/frontend/lib/api/classes/stats.ts b/frontend/lib/api/classes/stats.tsindex f6e5cec9..e571ef70 100644--- a/frontend/lib/api/classes/stats.ts+++ b/frontend/lib/api/classes/stats.ts@@ -28,9 +28,9 @@ export class StatsAPI extends BaseAPI {});}- labels() {+ tags() {return this.http.get<TotalsByOrganizer[]>({- url: route("/groups/statistics/labels"),+ url: route("/groups/statistics/tags"),});}diff --git a/frontend/lib/api/classes/tags.ts b/frontend/lib/api/classes/tags.tsnew file mode 100644index 00000000..aef69de9--- /dev/null+++ b/frontend/lib/api/classes/tags.ts@@ -0,0 +1,24 @@+import { BaseAPI, route } from "../base";+import type { TagCreate, TagOut } from "../types/data-contracts";++export class TagsApi extends BaseAPI {+ getAll() {+ return this.http.get<TagOut[]>({ url: route("/tags") });+ }++ create(body: TagCreate) {+ return this.http.post<TagCreate, TagOut>({ url: route("/tags"), body });+ }++ get(id: string) {+ return this.http.get<TagOut>({ url: route(`/tags/${id}`) });+ }++ delete(id: string) {+ return this.http.delete<void>({ url: route(`/tags/${id}`) });+ }++ update(id: string, body: TagCreate) {+ return this.http.put<TagCreate, TagOut>({ url: route(`/tags/${id}`), body });+ }+}diff --git a/frontend/lib/api/types/data-contracts.ts b/frontend/lib/api/types/data-contracts.tsindex c073fcdf..ec1e461e 100644--- a/frontend/lib/api/types/data-contracts.ts+++ b/frontend/lib/api/types/data-contracts.ts@@ -162,12 +162,12 @@ export interface EntGroupEdges {item_templates: EntItemTemplate[];/** 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[];+ /** Tags holds the value of the tags edge. */+ tags: EntTag[];/** Users holds the value of the users edge. */users: EntUser[];}@@ -264,14 +264,14 @@ export interface EntItemEdges {fields: EntItemField[];/** 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;/** MaintenanceEntries holds the value of the maintenance_entries edge. */maintenance_entries: EntMaintenanceEntry[];/** Parent holds the value of the parent edge. */parent: EntItem;+ /** Tag holds the value of the tag edge. */+ tag: EntTag[];}export interface EntItemField {@@ -314,8 +314,6 @@ export interface EntItemTemplate {default_description: string;/** DefaultInsured holds the value of the "default_insured" field. */default_insured: boolean;- /** Default label IDs for items created from this template */- default_label_ids: string[];/** DefaultLifetimeWarranty holds the value of the "default_lifetime_warranty" field. */default_lifetime_warranty: boolean;/** DefaultManufacturer holds the value of the "default_manufacturer" field. */@@ -326,6 +324,8 @@ export interface EntItemTemplate {default_name: string;/** DefaultQuantity holds the value of the "default_quantity" field. */default_quantity: number;+ /** Default tag IDs for items created from this template */+ default_tag_ids: string[];/** DefaultWarrantyDetails holds the value of the "default_warranty_details" field. */default_warranty_details: string;/** Description holds the value of the "description" field. */@@ -360,33 +360,6 @@ export interface EntItemTemplateEdges {location: EntLocation;}-export interface EntLabel {- /** 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 LabelQuery when eager-loading is set.- */- edges: EntLabelEdges;- /** 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 EntLabelEdges {- /** 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;@@ -476,6 +449,33 @@ export interface EntNotifierEdges {user: EntUser;}+export interface EntTag {+ /** 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 TagQuery when eager-loading is set.+ */+ edges: EntTagEdges;+ /** 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 EntTagEdges {+ /** Group holds the value of the group edge. */+ group: EntGroup;+ /** Items holds the value of the items edge. */+ items: EntItem[];+}+export interface EntTemplateField {/** CreatedAt holds the value of the "created_at" field. */created_at: string;@@ -582,8 +582,8 @@ export interface GroupInvitation {export interface GroupStatistics {totalItemPrice: number;totalItems: number;- totalLabels: number;totalLocations: number;+ totalTags: number;totalUsers: number;totalWithWarranty: number;}@@ -614,7 +614,6 @@ export interface ItemAttachmentUpdate {export interface ItemCreate {/** @maxLength 1000 */description: string;- labelIds: string[];/** Edges */locationId: string;/**@@ -624,6 +623,7 @@ export interface ItemCreate {name: string;parentId?: string | null;quantity: number;+ tagIds: string[];}export interface ItemField {@@ -646,7 +646,6 @@ export interface ItemOut {id: string;imageId?: string | null;insured: boolean;- labels: LabelSummary[];/** Warranty */lifetimeWarranty: boolean;/** Edges */@@ -669,6 +668,7 @@ export interface ItemOut {soldTime: Date | string;soldTo: string;syncChildItemsLocations: boolean;+ tags: TagSummary[];thumbnailId?: string | null;updatedAt: Date | string;warrantyDetails: string;@@ -677,9 +677,9 @@ export interface ItemOut {export interface ItemPatch {id: string;- labelIds?: string[] | null;locationId?: string | null;quantity?: number | null;+ tagIds?: string[] | null;}export interface ItemPath {@@ -697,7 +697,6 @@ export interface ItemSummary {id: string;imageId?: string | null;insured: boolean;- labels: LabelSummary[];/** Edges */location?: LocationSummary | null;name: string;@@ -705,6 +704,7 @@ export interface ItemSummary {quantity: number;/** Sale details */soldTime: Date | string;+ tags: TagSummary[];thumbnailId?: string | null;updatedAt: Date | string;}@@ -713,9 +713,8 @@ export interface ItemTemplateCreate {/** @maxLength 1000 */defaultDescription?: string | null;defaultInsured: boolean;- defaultLabelIds?: string[] | null;defaultLifetimeWarranty: boolean;- /** Default location and labels */+ /** Default location and tags */defaultLocationId?: string | null;/** @maxLength 255 */defaultManufacturer?: string | null;@@ -725,6 +724,7 @@ export interface ItemTemplateCreate {defaultName?: string | null;/** Default values for items */defaultQuantity?: number | null;+ defaultTagIds?: string[] | null;/** @maxLength 1000 */defaultWarrantyDetails?: string | null;/** @maxLength 1000 */@@ -748,15 +748,15 @@ export interface ItemTemplateOut {createdAt: Date | string;defaultDescription: string;defaultInsured: boolean;- defaultLabels: TemplateLabelSummary[];defaultLifetimeWarranty: boolean;- /** Default location and labels */+ /** Default location and tags */defaultLocation: TemplateLocationSummary;defaultManufacturer: string;defaultModelNumber: string;defaultName: string;/** Default values for items */defaultQuantity: number;+ defaultTags: TemplateTagSummary[];defaultWarrantyDetails: string;description: string;/** Custom fields */@@ -783,9 +783,8 @@ export interface ItemTemplateUpdate {/** @maxLength 1000 */defaultDescription?: string | null;defaultInsured: boolean;- defaultLabelIds?: string[] | null;defaultLifetimeWarranty: boolean;- /** Default location and labels */+ /** Default location and tags */defaultLocationId?: string | null;/** @maxLength 255 */defaultManufacturer?: string | null;@@ -795,6 +794,7 @@ export interface ItemTemplateUpdate {defaultName?: string | null;/** Default values for items */defaultQuantity?: number | null;+ defaultTagIds?: string[] | null;/** @maxLength 1000 */defaultWarrantyDetails?: string | null;/** @maxLength 1000 */@@ -823,7 +823,6 @@ export interface ItemUpdate {fields: ItemField[];id: string;insured: boolean;- labelIds: string[];/** Warranty */lifetimeWarranty: boolean;/** Edges */@@ -853,39 +852,11 @@ export interface ItemUpdate {/** @maxLength 255 */soldTo: string;syncChildItemsLocations: boolean;+ tagIds: string[];warrantyDetails: string;warrantyExpires: Date | string;}-export interface LabelCreate {- color: string;- /** @maxLength 1000 */- description: string;- /**- * @minLength 1- * @maxLength 255- */- name: string;-}--export interface LabelOut {- color: string;- createdAt: Date | string;- description: string;- id: string;- name: string;- updatedAt: Date | string;-}--export interface LabelSummary {- color: string;- createdAt: Date | string;- description: string;- id: string;- name: string;- updatedAt: Date | string;-}-export interface LocationCreate {description: string;name: string;@@ -1005,6 +976,35 @@ export interface PaginationResultItemSummary {total: number;}+export interface TagCreate {+ color: string;+ /** @maxLength 1000 */+ description: string;+ /**+ * @minLength 1+ * @maxLength 255+ */+ name: string;+}++export interface TagOut {+ color: string;+ createdAt: Date | string;+ description: string;+ id: string;+ name: string;+ updatedAt: Date | string;+}++export interface TagSummary {+ color: string;+ createdAt: Date | string;+ description: string;+ id: string;+ name: string;+ updatedAt: Date | string;+}+export interface TemplateField {id: string;name: string;@@ -1012,12 +1012,12 @@ export interface TemplateField {type: string;}-export interface TemplateLabelSummary {+export interface TemplateLocationSummary {id: string;name: string;}-export interface TemplateLocationSummary {+export interface TemplateTagSummary {id: string;name: string;}@@ -1148,7 +1148,6 @@ export interface ItemAttachmentToken {export interface ItemTemplateCreateItemRequest {/** @maxLength 1000 */description: string;- labelIds: string[];locationId: string;/*** @minLength 1@@ -1156,6 +1155,7 @@ export interface ItemTemplateCreateItemRequest {*/name: string;quantity: number;+ tagIds: string[];}export interface LoginForm {@@ -1180,9 +1180,9 @@ export interface TokenResponse {}export interface WipeInventoryOptions {- wipeLabels: boolean;wipeLocations: boolean;wipeMaintenance: boolean;+ wipeTags: boolean;}export interface Wrapped {diff --git a/frontend/lib/api/user.ts b/frontend/lib/api/user.tsindex ed1d78c2..63cd753b 100644--- a/frontend/lib/api/user.ts+++ b/frontend/lib/api/user.ts@@ -1,6 +1,6 @@import { BaseAPI } from "./base";import { ItemsApi } from "./classes/items";-import { LabelsApi } from "./classes/labels";+import { TagsApi } from "./classes/tags";import { LocationsApi } from "./classes/locations";import { GroupApi } from "./classes/group";import { UserApi } from "./classes/users";@@ -16,7 +16,7 @@ import type { Requests } from "~~/lib/requests";export class UserClient extends BaseAPI {locations: LocationsApi;- labels: LabelsApi;+ tags: TagsApi;items: ItemsApi;templates: TemplatesApi;maintenance: MaintenanceAPI;@@ -33,7 +33,7 @@ export class UserClient extends BaseAPI {super(requests, attachmentToken);this.locations = new LocationsApi(requests);- this.labels = new LabelsApi(requests);+ this.tags = new TagsApi(requests);this.items = new ItemsApi(requests, attachmentToken);this.templates = new TemplatesApi(requests);this.maintenance = new MaintenanceAPI(requests);diff --git a/frontend/locales/en.json b/frontend/locales/en.jsonindex 32bb6a70..f8a6fa94 100644--- a/frontend/locales/en.json+++ b/frontend/locales/en.json@@ -141,9 +141,9 @@},"view": {"change_details": {- "add_labels": "Add Labels",+ "add_tags": "Add Tags","failed_to_update_item": "Failed to update item",- "remove_labels": "Remove Labels",+ "remove_tags": "Remove Tags","title": "Change Item Details"},"selectable": {@@ -158,8 +158,8 @@"table": {"dropdown": {"actions": "Actions",- "change_labels": "Change Labels",- "change_labels_success": "Labels Changed",+ "change_tags": "Change Tags",+ "change_tags_success": "Tags Changed","change_location": "Change Location","change_location_success": "Location Changed","create_maintenance_item": "Create Maintenance Entry for Item",@@ -190,21 +190,21 @@}}},- "label": {+ "tag": {"create_modal": {- "label_color": "Label Color",- "label_description": "Label Description",- "label_name": "Label Name",- "title": "Create Label",+ "tag_color": "Tag Color",+ "tag_description": "Tag Description",+ "tag_name": "Tag Name",+ "title": "Create Tag","toast": {- "already_creating": "Already creating a label",- "create_failed": "Couldn't create label",- "create_success": "Label created",- "label_name_too_long": "Label name must not be longer than 50 characters"+ "already_creating": "Already creating a tag",+ "create_failed": "Couldn't create tag",+ "create_success": "Tag created",+ "tag_name_too_long": "Tag name must not be longer than 50 characters"}},"selector": {- "select_labels": "Select Labels"+ "select_tags": "Select Tags"}},"location": {@@ -364,7 +364,7 @@"insured": "Insured","items": "Items","join_discord": "Join the Discord",- "labels": "Labels",+ "tags": "Tags","loading": "Loading…","locations": "Locations","maintenance": "Maintenance",@@ -389,12 +389,12 @@"yes": "Yes"},"home": {- "labels": "Labels",+ "tags": "Tags","quick_statistics": "Quick Statistics","recently_added": "Recently Added","storage_locations": "Storage Locations","total_items": "Total Items",- "total_labels": "Total Labels",+ "total_tags": "Total Tags","total_locations": "Total Locations","total_value": "Total Value"},@@ -481,7 +481,7 @@"manufacturer": "Manufacturer","model_number": "Model Number","name": "Name",- "negate_labels": "Negate Selected Labels",+ "negate_tags": "Negate Selected Tags","next_page": "Next Page","no_attachments": "No attachments found","no_results": "No Items Found",@@ -513,7 +513,7 @@"sold_price": "Sold Price","sold_to": "Sold To","sync_child_locations": "Sync child items' locations",- "tip_1": "Location and label filters use the 'OR' operation. If more than one is selected only one will be\n required for a match.",+ "tip_1": "Location and tag filters use the 'OR' operation. If more than one is selected only one will be\n required for a match.","tip_2": "Searches prefixed with '#'' will query for a asset ID (example '#000-001')","tip_3": "Field filters use the 'OR' operation. If more than one is selected only one will be required for a\n match.","tips": "Tips",@@ -549,17 +549,17 @@"warranty_details": "Warranty Details","warranty_expires": "Warranty Expires"},- "labels": {- "label_delete_confirm": "Are you sure you want to delete this label? This action cannot be undone.",- "no_results": "No Labels Found",+ "tags": {+ "tag_delete_confirm": "Are you sure you want to delete this tag? This action cannot be undone.",+ "no_results": "No Tags Found","toast": {- "failed_delete_label": "Failed to delete label",- "failed_load_label": "Failed to load label",- "failed_update_label": "Failed to update label",- "label_deleted": "Label deleted",- "label_updated": "Label updated"+ "failed_delete_tag": "Failed to delete tag",+ "failed_load_tag": "Failed to load tag",+ "failed_update_tag": "Failed to update tag",+ "tag_deleted": "Tag deleted",+ "tag_updated": "Tag updated"},- "update_label": "Update Label"+ "update_tag": "Update Tag"},"languages": {"bs-BA": "Bosnian (Bosnia and Herzegovina)",@@ -651,7 +651,7 @@},"menu": {"create_item": "Item / Asset",- "create_label": "Label",+ "create_tag": "Tag","create_location": "Location","home": "Home","locations": "Locations",@@ -791,7 +791,7 @@"wipe_inventory": "Wipe Inventory","wipe_inventory_button": "Wipe Inventory","wipe_inventory_confirm": "Are you sure you want to wipe your entire inventory? This will delete all items and cannot be undone.",- "wipe_inventory_labels": "Also wipe all labels (tags)",+ "wipe_inventory_tags": "Also wipe all tags","wipe_inventory_locations": "Also wipe all locations","wipe_inventory_maintenance": "Also wipe all maintenance records","wipe_inventory_note": "Note: Only group owners can perform this action.",@@ -803,7 +803,7 @@},"actions_sub": "Apply Actions to your inventory in bulk. These are irreversible actions. '<b>'Be careful.'</b>'","demo_mode_error": {- "wipe_inventory": "Inventory, labels, locations and maintenance records cannot be wiped whilst Homebox is in demo mode. Please ensure that you are not in demo mode and try again."+ "wipe_inventory": "Inventory, tags, locations and maintenance records cannot be wiped whilst Homebox is in demo mode. Please ensure that you are not in demo mode and try again."},"import_export": "Import/Export","import_export_set": {diff --git a/frontend/pages/collection/index/tools.vue b/frontend/pages/collection/index/tools.vueindex fb41cfe2..5ca6cf0f 100644--- a/frontend/pages/collection/index/tools.vue+++ b/frontend/pages/collection/index/tools.vue@@ -245,7 +245,7 @@}const apiResult = await api.actions.wipeInventory({- wipeLabels: result.wipeLabels,+ wipeTags: result.wipeTags,wipeLocations: result.wipeLocations,wipeMaintenance: result.wipeMaintenance,});diff --git a/frontend/pages/home/index.vue b/frontend/pages/home/index.vueindex 898220ad..68ab32dd 100644--- a/frontend/pages/home/index.vue+++ b/frontend/pages/home/index.vue@@ -2,7 +2,7 @@import { useI18n } from "vue-i18n";import { statCardData } from "./statistics";import { itemsTable } from "./table";- import { useLabelStore } from "~~/stores/labels";+ import { useTagStore } from "~/stores/tags";import { useLocationStore } from "~~/stores/locations";import BaseContainer from "@/components/Base/Container.vue";import BaseCard from "@/components/Base/Card.vue";@@ -10,7 +10,7 @@import StatCard from "~/components/global/StatCard/StatCard.vue";import ItemCard from "~/components/Item/Card.vue";import LocationCard from "~/components/Location/Card.vue";- import LabelChip from "~/components/Label/Chip.vue";+ import TagChip from "~/components/Tag/Chip.vue";import Table from "~/components/Item/View/Table.vue";const { t } = useI18n();@@ -28,8 +28,8 @@const locationStore = useLocationStore();const locations = computed(() => locationStore.parentLocations);- const labelsStore = useLabelStore();- const labels = computed(() => labelsStore.labels);+ const tagsStore = useTagStore();+ const tags = computed(() => tagsStore.tags);const itemTable = itemsTable(api);const stats = statCardData(api);@@ -66,10 +66,10 @@</section><section>- <Subtitle> {{ $t("home.labels") }} </Subtitle>- <p v-if="labels.length === 0" class="ml-2 text-sm">{{ $t("labels.no_results") }}</p>+ <Subtitle> {{ $t("home.tags") }} </Subtitle>+ <p v-if="tags.length === 0" class="ml-2 text-sm">{{ $t("tags.no_results") }}</p><div v-else class="flex flex-wrap gap-4">- <LabelChip v-for="label in labels" :key="label.id" size="lg" :label="label" class="shadow-md" />+ <TagChip v-for="tag in tags" :key="tag.id" size="lg" :tag="tag" class="shadow-md" /></div></section></BaseContainer>diff --git a/frontend/pages/home/statistics.ts b/frontend/pages/home/statistics.tsindex 7ab7dc53..d15b6752 100644--- a/frontend/pages/home/statistics.ts+++ b/frontend/pages/home/statistics.ts@@ -39,8 +39,8 @@ export function statCardData(api: UserClient) {type: "number",},{- label: t("home.total_labels"),- value: statistics.value?.totalLabels || 0,+ label: t("home.total_tags"),+ value: statistics.value?.totalTags || 0,type: "number",},] as StatCard[];diff --git a/frontend/pages/item/[id]/index.vue b/frontend/pages/item/[id]/index.vueindex 93a1415f..cf193b80 100644--- a/frontend/pages/item/[id]/index.vue+++ b/frontend/pages/item/[id]/index.vue@@ -36,7 +36,7 @@import ItemImageDialog from "~/components/Item/ImageDialog.vue";import ItemDuplicateSettings from "~/components/Item/DuplicateSettings.vue";import { Dialog, DialogContent, DialogFooter, DialogHeader, DialogTitle } from "@/components/ui/dialog";- import LabelChip from "~/components/Label/Chip.vue";+ import TagChip from "~/components/Tag/Chip.vue";import DateTime from "~/components/global/DateTime.vue";import LabelMaker from "~/components/global/LabelMaker.vue";import Markdown from "~/components/global/Markdown.vue";@@ -588,7 +588,7 @@defaultLifetimeWarranty: item.value.lifetimeWarranty,defaultWarrantyDetails: item.value.warrantyDetails || "",defaultLocationId: item.value.location?.id || "",- defaultLabelIds: item.value.labels?.map(l => l.id) || [],+ defaultTagIds: item.value.tags?.map(l => l.id) || [],includeWarrantyFields: !!(item.value.warrantyDetails ||item.value.lifetimeWarranty ||@@ -684,7 +684,7 @@{{ item ? item.name : "" }}</h1><div class="flex flex-wrap gap-2 pb-1">- <LabelChip v-for="label in item?.labels || []" :key="label.id" :label="label" size="sm" />+ <TagChip v-for="tag in item?.tags || []" :key="tag.id" :tag="tag" size="sm" /></div><div class="flex flex-wrap gap-1 text-wrap text-xs"><div>diff --git a/frontend/pages/item/[id]/index/edit.vue b/frontend/pages/item/[id]/index/edit.vueindex c047a6a0..cf551a86 100644--- a/frontend/pages/item/[id]/index/edit.vue+++ b/frontend/pages/item/[id]/index/edit.vue@@ -4,7 +4,7 @@import { toast } from "@/components/ui/sonner";import type { ItemAttachment, ItemField, ItemOut, ItemUpdate } from "~~/lib/api/types/data-contracts";import { AttachmentTypes } from "~~/lib/api/types/non-generated";- import { useLabelStore } from "~~/stores/labels";+ import { useTagStore } from "~/stores/tags";import { useLocationStore } from "~~/stores/locations";import MdiLoading from "~icons/mdi/loading";import MdiDelete from "~icons/mdi/delete";@@ -27,7 +27,7 @@import FormCheckbox from "~/components/Form/Checkbox.vue";import LocationSelector from "~/components/Location/Selector.vue";import ItemSelector from "~/components/Item/Selector.vue";- import LabelSelector from "~/components/Label/Selector.vue";+ import TagSelector from "~/components/Tag/Selector.vue";import BaseCard from "@/components/Base/Card.vue";import { Card } from "~/components/ui/card";import DropZone from "~/components/global/DropZone.vue";@@ -49,8 +49,8 @@const locationStore = useLocationStore();const locations = computed(() => locationStore.allLocations);- const labelStore = useLabelStore();- const labels = computed(() => labelStore.labels);+ const tagStore = useTagStore();+ const tags = computed(() => tagStore.tags);const {data: nullableItem,@@ -79,13 +79,13 @@return data;});- const item = ref<ItemOut & { labelIds: string[] }>(null as never);+ const item = ref<ItemOut & { tagIds: string[] }>(null as never);watchEffect(() => {if (nullableItem.value) {item.value = {...nullableItem.value,- labelIds: nullableItem.value.labels.map(l => l.id) ?? [],+ tagIds: nullableItem.value.tags.map(l => l.id) ?? [],};}});@@ -121,7 +121,7 @@const payload: ItemUpdate = {...item.value,locationId: item.value.location?.id,- labelIds: item.value.labelIds,+ tagIds: item.value.tagIds,parentId: parent.value ? parent.value.id : null,assetId: item.value.assetId,purchasePrice,@@ -486,7 +486,7 @@const payload: ItemUpdate = {...item.value,locationId: item.value.location?.id,- labelIds: item.value.labelIds,+ tagIds: item.value.tagIds,parentId: parent.value ? parent.value.id : null,assetId: item.value.assetId,};@@ -604,7 +604,7 @@<Label class="px-1">{{ $t("items.sync_child_locations") }}</Label><Switch v-model="item.syncChildItemsLocations" @update:model-value="syncChildItemsLocations()" /></div>- <LabelSelector v-model="item.labelIds" :labels="labels" />+ <TagSelector v-model="item.tagIds" :tags="tags" /></div><div class="border-t sm:p-0">diff --git a/frontend/pages/items.vue b/frontend/pages/items.vueindex 88217a56..3e3231be 100644--- a/frontend/pages/items.vue+++ b/frontend/pages/items.vue@@ -2,8 +2,8 @@import { useI18n } from "vue-i18n";import { toast } from "@/components/ui/sonner";import { Input } from "~/components/ui/input";- import type { ItemSummary, LabelSummary, LocationOutCount } from "~~/lib/api/types/data-contracts";- import { useLabelStore } from "~~/stores/labels";+ import type { ItemSummary, TagSummary, LocationOutCount } from "~~/lib/api/types/data-contracts";+ import { useTagStore } from "~/stores/tags";import { useLocationStore } from "~~/stores/locations";import MdiLoading from "~icons/mdi/loading";import MdiMagnify from "~icons/mdi/magnify";@@ -84,12 +84,12 @@const query = useOptionalRouteQuery("q", "");const includeArchived = useOptionalRouteQuery("archived", false);const fieldSelector = useOptionalRouteQuery("fieldSelector", false);- const negateLabels = useOptionalRouteQuery("negateLabels", false);+ const negateTags = useOptionalRouteQuery("negateTags", false);const onlyWithoutPhoto = useOptionalRouteQuery("onlyWithoutPhoto", false);const onlyWithPhoto = useOptionalRouteQuery("onlyWithPhoto", false);const orderBy = useOptionalRouteQuery("orderBy", "name");const qLoc = useOptionalRouteQuery("loc", []);- const qLab = useOptionalRouteQuery("lab", []);+ const qTag = useOptionalRouteQuery("tag", []);const preferences = useViewPreferences();const pageSize = computed(() => preferences.value.itemsPerTablePage);@@ -100,13 +100,13 @@onMounted(async () => {loading.value = true;searchLocked.value = true;- await Promise.all([locationsStore.ensureLocationsFetched(), labelStore.ensureAllLabelsFetched()]);+ await Promise.all([locationsStore.ensureLocationsFetched(), tagStore.ensureAllTagsFetched()]);if (qLoc) {selectedLocations.value = locations.value.filter(l => qLoc.value.includes(l.id));}- if (qLab) {- selectedLabels.value = labels.value.filter(l => qLab.value.includes(l.id));+ if (qTag) {+ selectedTags.value = tags.value.filter(l => qTag.value.includes(l.id));}queryParamsInitialized.value = true;@@ -124,7 +124,7 @@}// trigger search if no changes- if (!qLab && !qLoc) {+ if (!qTag && !qLoc) {search();}@@ -142,14 +142,14 @@const locations = computed(() => locationsStore.allLocations);- const labelStore = useLabelStore();- const labels = computed(() => labelStore.labels);+ const tagStore = useTagStore();+ const tags = computed(() => tagStore.tags);const selectedLocations = ref<LocationOutCount[]>([]);- const selectedLabels = ref<LabelSummary[]>([]);+ const selectedTags = ref<TagSummary[]>([]);const locIDs = computed(() => selectedLocations.value.map(l => l.id));- const labIDs = computed(() => selectedLabels.value.map(l => l.id));+ const tagIDs = computed(() => selectedTags.value.map(l => l.id));function parseAssetIDString(d: string) {d = d.replace(/"/g, "").replace(/-/g, "");@@ -201,7 +201,7 @@}});- watch(negateLabels, (newV, oldV) => {+ watch(negateTags, (newV, oldV) => {if (newV !== oldV) {search();}@@ -265,14 +265,14 @@const push_query: Record<string, string | string[] | number | boolean | undefined> = {archived: includeArchived.value,fieldSelector: fieldSelector.value,- negateLabels: negateLabels.value,+ negateTags: negateTags.value,onlyWithoutPhoto: onlyWithoutPhoto.value,onlyWithPhoto: onlyWithPhoto.value,orderBy: orderBy.value,page: page.value,q: query.value,loc: locIDs.value,- lab: labIDs.value,+ tag: tagIDs.value,fields: fields,};@@ -301,8 +301,8 @@const { data, error } = await api.items.getAll({q: query.value || "",locations: locIDs.value,- labels: labIDs.value,- negateLabels: negateLabels.value,+ tags: tagIDs.value,+ negateTags: negateTags.value,onlyWithoutPhoto: onlyWithoutPhoto.value,onlyWithPhoto: onlyWithPhoto.value,includeArchived: includeArchived.value,@@ -337,7 +337,7 @@initialSearch.value = false;}- watchDebounced([page, pageSize, query, selectedLabels, selectedLocations], search, { debounce: 250, maxWait: 1000 });+ watchDebounced([page, pageSize, query, selectedTags, selectedLocations], search, { debounce: 250, maxWait: 1000 });async function submit() {// Set URL Params@@ -379,7 +379,7 @@<template><BaseContainer>- <div v-if="locations && labels">+ <div v-if="locations && tags"><div class="flex flex-wrap items-end gap-4 md:flex-nowrap"><div class="w-full"><Input v-model:model-value="query" :placeholder="$t('global.search')" class="h-12" />@@ -396,7 +396,7 @@<div class="flex w-full flex-wrap gap-2 py-2 md:flex-nowrap"><SearchFilter v-model="selectedLocations" :label="$t('global.locations')" :options="locationFlatTree" />- <SearchFilter v-model="selectedLabels" :label="$t('global.labels')" :options="labels" />+ <SearchFilter v-model="selectedTags" :label="$t('global.tags')" :options="tags" /><Popover><PopoverTrigger as-child><Button size="sm" variant="outline"> {{ $t("items.options") }}</Button>@@ -413,9 +413,9 @@{{ $t("items.field_selector") }}</Label><Label class="flex cursor-pointer items-center">- <Switch v-model="negateLabels" class="ml-auto" />+ <Switch v-model="negateTags" class="ml-auto" /><div class="grow" />- {{ $t("items.negate_labels") }}+ {{ $t("items.negate_tags") }}</Label><Label class="flex cursor-pointer items-center"><Switch v-model="onlyWithoutPhoto" class="ml-auto" />diff --git a/frontend/pages/label/[id].vue b/frontend/pages/label/[id].vueindex 83620867..edec6fe2 100644--- a/frontend/pages/label/[id].vue+++ b/frontend/pages/label/[id].vue@@ -1,212 +1,12 @@<script setup lang="ts">- import { useI18n } from "vue-i18n";- import { toast } from "@/components/ui/sonner";- import MdiPackageVariant from "~icons/mdi/package-variant";- import MdiPencil from "~icons/mdi/pencil";- import MdiDelete from "~icons/mdi/delete";- import { Dialog, DialogContent, DialogFooter, DialogHeader, DialogTitle } from "@/components/ui/dialog";- import { useDialog } from "@/components/ui/dialog-provider";- import { Card } from "@/components/ui/card";- import { Button } from "@/components/ui/button";- import { Badge } from "@/components/ui/badge";- import { Separator } from "@/components/ui/separator";- import ColorSelector from "@/components/Form/ColorSelector.vue";- import { getContrastTextColor } from "~/lib/utils";- import { DialogID } from "~/components/ui/dialog-provider/utils";- import FormTextField from "~/components/Form/TextField.vue";- import FormTextArea from "~/components/Form/TextArea.vue";- import BaseContainer from "@/components/Base/Container.vue";- import Currency from "~/components/global/Currency.vue";- import DateTime from "~/components/global/DateTime.vue";- import PageQRCode from "~/components/global/PageQRCode.vue";- import Markdown from "~/components/global/Markdown.vue";- import ItemViewSelectable from "~/components/Item/View/Selectable.vue";-- definePageMeta({- middleware: ["auth"],- });-- const { t } = useI18n();-- const { openDialog, closeDialog } = useDialog();-+ // Backwards compatibility redirect from /label/:id to /tag/:idconst route = useRoute();- const api = useUserApi();-- const labelId = computed<string>(() => route.params.id as string);-- const { data: label } = useAsyncData(labelId.value, async () => {- const { data, error } = await api.labels.get(labelId.value);- if (error) {- toast.error(t("labels.toast.failed_load_label"));- navigateTo("/home");- return;- }- return data;- });-- const confirm = useConfirm();-- async function confirmDelete() {- const { isCanceled } = await confirm.open(t("labels.label_delete_confirm"));-- if (isCanceled) {- return;- }-- const { error } = await api.labels.delete(labelId.value);-- if (error) {- toast.error(t("labels.toast.failed_delete_label"));- return;- }- toast.success(t("labels.toast.label_deleted"));- navigateTo("/home");- }+ const tagId = route.params.id as string;- const updating = ref(false);- const updateData = reactive({- name: "",- description: "",- color: "",- });-- function openUpdate() {- updateData.name = label.value?.name || "";- updateData.description = label.value?.description || "";- updateData.color = "";- openDialog(DialogID.UpdateLabel);- }-- async function update() {- updating.value = true;- const { error, data } = await api.labels.update(labelId.value, updateData);-- if (error) {- updating.value = false;- toast.error(t("labels.toast.failed_update_label"));- return;- }-- toast.success(t("labels.toast.label_updated"));- label.value = data;- closeDialog(DialogID.UpdateLabel);- updating.value = false;- }-- const { data: items, refresh: refreshItemList } = useAsyncData(- () => labelId.value + "_item_list",- async () => {- if (!labelId.value) {- return {- items: [],- totalPrice: null,- };- }-- const resp = await api.items.getAll({- labels: [labelId.value],- });-- if (resp.error) {- toast.error(t("items.toast.failed_load_items"));- return {- items: [],- totalPrice: null,- };- }-- return resp.data;- },- {- watch: [labelId],- }- );+ // Redirect to the new tag route+ await navigateTo(`/tag/${tagId}`, { replace: true, redirectCode: 308 });</script><template>- <!-- Update Dialog -->- <Dialog :dialog-id="DialogID.UpdateLabel">- <DialogContent>- <DialogHeader>- <DialogTitle> {{ $t("labels.update_label") }} </DialogTitle>- </DialogHeader>-- <form v-if="label" class="flex flex-col gap-2" @submit.prevent="update">- <FormTextField- v-model="updateData.name"- :autofocus="true"- :label="$t('components.label.create_modal.label_name')"- :max-length="255"- :min-length="1"- />- <FormTextArea- v-model="updateData.description"- :label="$t('components.label.create_modal.label_description')"- :max-length="1000"- />- <ColorSelector- v-model="updateData.color"- :label="$t('components.label.create_modal.label_color')"- :show-hex="true"- :starting-color="label.color"- />- <DialogFooter>- <Button type="submit" :loading="updating"> {{ $t("global.update") }} </Button>- </DialogFooter>- </form>- </DialogContent>- </Dialog>-- <BaseContainer v-if="label">- <!-- set page title -->- <Title>{{ label.name }}</Title>-- <Card class="p-3">- <header :class="{ 'mb-2': label.description }">- <div class="flex flex-wrap items-end gap-2">- <div- class="mb-auto flex size-12 items-center justify-center rounded-full"- :style="- label.color- ? { backgroundColor: label.color, color: getContrastTextColor(label.color) }- : { backgroundColor: 'hsl(var(--secondary))', color: 'hsl(var(--secondary-foreground))' }- "- >- <MdiPackageVariant class="size-7" />- </div>- <div>- <h1 class="flex items-center gap-3 pb-1 text-2xl">- {{ label ? label.name : "" }}- <Badge v-if="items && items.totalPrice" variant="secondary" class="ml-2">- <Currency :amount="items.totalPrice" />- </Badge>- </h1>- <div class="flex flex-wrap gap-1 text-xs">- <div>- {{ $t("global.created") }}- <DateTime :date="label?.createdAt" />- </div>- </div>- </div>- <div class="ml-auto mt-2 flex flex-wrap items-center justify-between gap-3">- <PageQRCode />- <Button @click="openUpdate">- <MdiPencil />- {{ $t("global.edit") }}- </Button>- <Button variant="destructive" @click="confirmDelete()">- <MdiDelete />- {{ $t("global.delete") }}- </Button>- </div>- </div>- </header>- <Separator v-if="label && label.description" />- <Markdown v-if="label && label.description" class="mt-3 text-base" :source="label.description" />- </Card>- <section v-if="label && items">- <ItemViewSelectable :items="items.items" @refresh="refreshItemList" />- </section>- </BaseContainer>+ <div></div></template>diff --git a/frontend/pages/tag/[id].vue b/frontend/pages/tag/[id].vuenew file mode 100644index 00000000..2012e75f--- /dev/null+++ b/frontend/pages/tag/[id].vue@@ -0,0 +1,212 @@+<script setup lang="ts">+ import { useI18n } from "vue-i18n";+ import { toast } from "@/components/ui/sonner";+ import MdiPackageVariant from "~icons/mdi/package-variant";+ import MdiPencil from "~icons/mdi/pencil";+ import MdiDelete from "~icons/mdi/delete";+ import { Dialog, DialogContent, DialogFooter, DialogHeader, DialogTitle } from "@/components/ui/dialog";+ import { useDialog } from "@/components/ui/dialog-provider";+ import { Card } from "@/components/ui/card";+ import { Button } from "@/components/ui/button";+ import { Badge } from "@/components/ui/badge";+ import { Separator } from "@/components/ui/separator";+ import ColorSelector from "@/components/Form/ColorSelector.vue";+ import { getContrastTextColor } from "~/lib/utils";+ import { DialogID } from "~/components/ui/dialog-provider/utils";+ import FormTextField from "~/components/Form/TextField.vue";+ import FormTextArea from "~/components/Form/TextArea.vue";+ import BaseContainer from "@/components/Base/Container.vue";+ import Currency from "~/components/global/Currency.vue";+ import DateTime from "~/components/global/DateTime.vue";+ import PageQRCode from "~/components/global/PageQRCode.vue";+ import Markdown from "~/components/global/Markdown.vue";+ import ItemViewSelectable from "~/components/Item/View/Selectable.vue";++ definePageMeta({+ middleware: ["auth"],+ });++ const { t } = useI18n();++ const { openDialog, closeDialog } = useDialog();++ const route = useRoute();+ const api = useUserApi();++ const tagId = computed<string>(() => route.params.id as string);++ const { data: tag } = useAsyncData(tagId.value, async () => {+ const { data, error } = await api.tags.get(tagId.value);+ if (error) {+ toast.error(t("tags.toast.failed_load_tag"));+ navigateTo("/home");+ return;+ }+ return data;+ });++ const confirm = useConfirm();++ async function confirmDelete() {+ const { isCanceled } = await confirm.open(t("tags.tag_delete_confirm"));++ if (isCanceled) {+ return;+ }++ const { error } = await api.tags.delete(tagId.value);++ if (error) {+ toast.error(t("tags.toast.failed_delete_tag"));+ return;+ }+ toast.success(t("tags.toast.tag_deleted"));+ navigateTo("/home");+ }++ const updating = ref(false);+ const updateData = reactive({+ name: "",+ description: "",+ color: "",+ });++ function openUpdate() {+ updateData.name = tag.value?.name || "";+ updateData.description = tag.value?.description || "";+ updateData.color = "";+ openDialog(DialogID.UpdateTag);+ }++ async function update() {+ updating.value = true;+ const { error, data } = await api.tags.update(tagId.value, updateData);++ if (error) {+ updating.value = false;+ toast.error(t("tags.toast.failed_update_tag"));+ return;+ }++ toast.success(t("tags.toast.tag_updated"));+ tag.value = data;+ closeDialog(DialogID.UpdateTag);+ updating.value = false;+ }++ const { data: items, refresh: refreshItemList } = useAsyncData(+ () => tagId.value + "_item_list",+ async () => {+ if (!tagId.value) {+ return {+ items: [],+ totalPrice: null,+ };+ }++ const resp = await api.items.getAll({+ tags: [tagId.value],+ });++ if (resp.error) {+ toast.error(t("items.toast.failed_load_items"));+ return {+ items: [],+ totalPrice: null,+ };+ }++ return resp.data;+ },+ {+ watch: [tagId],+ }+ );+</script>++<template>+ <!-- Update Dialog -->+ <Dialog :dialog-id="DialogID.UpdateTag">+ <DialogContent>+ <DialogHeader>+ <DialogTitle> {{ $t("tags.update_tag") }} </DialogTitle>+ </DialogHeader>++ <form v-if="tag" class="flex flex-col gap-2" @submit.prevent="update">+ <FormTextField+ v-model="updateData.name"+ :autofocus="true"+ :label="$t('components.tag.create_modal.tag_name')"+ :max-length="255"+ :min-length="1"+ />+ <FormTextArea+ v-model="updateData.description"+ :label="$t('components.tag.create_modal.tag_description')"+ :max-length="1000"+ />+ <ColorSelector+ v-model="updateData.color"+ :label="$t('components.tag.create_modal.tag_color')"+ :show-hex="true"+ :starting-color="tag.color"+ />+ <DialogFooter>+ <Button type="submit" :loading="updating"> {{ $t("global.update") }} </Button>+ </DialogFooter>+ </form>+ </DialogContent>+ </Dialog>++ <BaseContainer v-if="tag">+ <!-- set page title -->+ <Title>{{ tag.name }}</Title>++ <Card class="p-3">+ <header :class="{ 'mb-2': tag.description }">+ <div class="flex flex-wrap items-end gap-2">+ <div+ class="mb-auto flex size-12 items-center justify-center rounded-full"+ :style="+ tag.color+ ? { backgroundColor: tag.color, color: getContrastTextColor(tag.color) }+ : { backgroundColor: 'hsl(var(--secondary))', color: 'hsl(var(--secondary-foreground))' }+ "+ >+ <MdiPackageVariant class="size-7" />+ </div>+ <div>+ <h1 class="flex items-center gap-3 pb-1 text-2xl">+ {{ tag ? tag.name : "" }}+ <Badge v-if="items && items.totalPrice" variant="secondary" class="ml-2">+ <Currency :amount="items.totalPrice" />+ </Badge>+ </h1>+ <div class="flex flex-wrap gap-1 text-xs">+ <div>+ {{ $t("global.created") }}+ <DateTime :date="tag?.createdAt" />+ </div>+ </div>+ </div>+ <div class="ml-auto mt-2 flex flex-wrap items-center justify-between gap-3">+ <PageQRCode />+ <Button @click="openUpdate">+ <MdiPencil />+ {{ $t("global.edit") }}+ </Button>+ <Button variant="destructive" @click="confirmDelete()">+ <MdiDelete />+ {{ $t("global.delete") }}+ </Button>+ </div>+ </div>+ </header>+ <Separator v-if="tag && tag.description" />+ <Markdown v-if="tag && tag.description" class="mt-3 text-base" :source="tag.description" />+ </Card>+ <section v-if="tag && items">+ <ItemViewSelectable :items="items.items" @refresh="refreshItemList" />+ </section>+ </BaseContainer>+</template>diff --git a/frontend/pages/template/[id].vue b/frontend/pages/template/[id].vueindex ff2cf77d..7888cb32 100644--- a/frontend/pages/template/[id].vue+++ b/frontend/pages/template/[id].vue@@ -18,8 +18,8 @@import DateTime from "~/components/global/DateTime.vue";import Markdown from "~/components/global/Markdown.vue";import LocationSelector from "~/components/Location/Selector.vue";- import LabelSelector from "~/components/Label/Selector.vue";- import { useLabelStore } from "~~/stores/labels";+ import TagSelector from "~/components/Tag/Selector.vue";+ import { useTagStore } from "~/stores/tags";import type { LocationOut } from "~~/lib/api/types/data-contracts";definePageMeta({@@ -31,8 +31,8 @@const api = useUserApi();const confirm = useConfirm();- const labelStore = useLabelStore();- const labels = computed(() => labelStore.labels);+ const tagStore = useTagStore();+ const tags = computed(() => tagStore.tags);const templateId = computed<string>(() => route.params.id as string);@@ -76,7 +76,7 @@defaultLifetimeWarranty: false,defaultWarrantyDetails: "",defaultLocation: null as LocationOut | null,- defaultLabelIds: [] as string[],+ defaultTagIds: [] as string[],includeWarrantyFields: false,includePurchaseFields: false,includeSoldFields: false,@@ -99,7 +99,7 @@defaultLifetimeWarranty: template.value.defaultLifetimeWarranty,defaultWarrantyDetails: template.value.defaultWarrantyDetails,defaultLocation: template.value.defaultLocation ?? null,- defaultLabelIds: template.value.defaultLabels?.map(l => l.id) ?? [],+ defaultTagIds: template.value.defaultTags?.map(l => l.id) ?? [],includeWarrantyFields: template.value.includeWarrantyFields,includePurchaseFields: template.value.includePurchaseFields,includeSoldFields: template.value.includeSoldFields,@@ -193,7 +193,7 @@v-model="updateData.defaultLocation":label="$t('components.template.form.default_location')"/>- <LabelSelector v-model="updateData.defaultLabelIds" :labels="labels ?? []" />+ <TagSelector v-model="updateData.defaultTagIds" :tags="tags ?? []" /><div class="flex items-center gap-4"><div class="flex items-center gap-2"><Switch id="editInsured" v-model:checked="updateData.defaultInsured" />@@ -304,9 +304,9 @@<dt class="text-muted-foreground">{{ $t("components.template.form.location") }}</dt><dd>{{ template.defaultLocation.name }}</dd></div>- <div v-if="template.defaultLabels && template.defaultLabels.length > 0" class="flex justify-between">- <dt class="text-muted-foreground">{{ $t("global.labels") }}</dt>- <dd>{{ template.defaultLabels.map(l => l.name).join(", ") }}</dd>+ <div v-if="template.defaultTags && template.defaultTags.length > 0" class="flex justify-between">+ <dt class="text-muted-foreground">{{ $t("global.tags") }}</dt>+ <dd>{{ template.defaultTags.map(t => t.name).join(", ") }}</dd></div><div class="flex justify-between"><dt class="text-muted-foreground">{{ $t("global.insured") }}</dt>diff --git a/frontend/stores/labels.ts b/frontend/stores/labels.tsdeleted file mode 100644index b4290e66..00000000--- a/frontend/stores/labels.ts+++ /dev/null@@ -1,41 +0,0 @@-import { defineStore } from "pinia";-import type { LabelOut } from "~~/lib/api/types/data-contracts";--export const useLabelStore = defineStore("labels", {- state: () => ({- allLabels: null as LabelOut[] | null,- client: useUserApi(),- refreshAllLabelsPromise: null as Promise<void> | null,- }),- getters: {- /**- * labels represents the labels that are currently in the store. The store is- * synched with the server by intercepting the API calls and updating on the- * response.- */- labels(state): LabelOut[] {- return state.allLabels ?? [];- },- },- actions: {- async ensureAllLabelsFetched() {- if (this.allLabels !== null) {- return;- }-- if (this.refreshAllLabelsPromise === null) {- this.refreshAllLabelsPromise = this.refresh().then(() => {});- }- await this.refreshAllLabelsPromise;- },- async refresh() {- const result = await this.client.labels.getAll();- if (result.error) {- return result;- }-- this.allLabels = result.data;- return result;- },- },-});diff --git a/frontend/stores/tags.ts b/frontend/stores/tags.tsnew file mode 100644index 00000000..4afdb6b7--- /dev/null+++ b/frontend/stores/tags.ts@@ -0,0 +1,41 @@+import { defineStore } from "pinia";+import type { TagOut } from "~~/lib/api/types/data-contracts";++export const useTagStore = defineStore("tags", {+ state: () => ({+ allTags: null as TagOut[] | null,+ client: useUserApi(),+ refreshAllTagsPromise: null as Promise<void> | null,+ }),+ getters: {+ /**+ * tags represents the tags that are currently in the store. The store is+ * synched with the server by intercepting the API calls and updating on the+ * response.+ */+ tags(state): TagOut[] {+ return state.allTags ?? [];+ },+ },+ actions: {+ async ensureAllTagsFetched() {+ if (this.allTags !== null) {+ return;+ }++ if (this.refreshAllTagsPromise === null) {+ this.refreshAllTagsPromise = this.refresh().then(() => {});+ }+ await this.refreshAllTagsPromise;+ },+ async refresh() {+ const result = await this.client.tags.getAll();+ if (result.error) {+ return result;+ }++ this.allTags = result.data;+ return result;+ },+ },+});diff --git a/frontend/test/e2e/wipe-inventory.browser.spec.ts b/frontend/test/e2e/wipe-inventory.browser.spec.tsindex a13deca6..4de550fb 100644--- a/frontend/test/e2e/wipe-inventory.browser.spec.ts+++ b/frontend/test/e2e/wipe-inventory.browser.spec.ts@@ -54,12 +54,12 @@ test.describe("Wipe Inventory", () => {await expect(page.getByText(- "Inventory, labels, locations and maintenance records cannot be wiped whilst Homebox is in demo mode.",+ "Inventory, tags, locations and maintenance records cannot be wiped whilst Homebox is in demo mode.",{ exact: false })).toBeVisible();- await expect(page.locator("input#wipe-labels-checkbox")).toHaveCount(0);+ await expect(page.locator("input#wipe-tags-checkbox")).toHaveCount(0);await expect(page.locator("input#wipe-locations-checkbox")).toHaveCount(0);await expect(page.locator("input#wipe-maintenance-checkbox")).toHaveCount(0);});@@ -78,15 +78,15 @@ test.describe("Wipe Inventory", () => {await openWipeInventory(page);await expect(page.getByText("Wipe Inventory").first()).toBeVisible();- const labels = page.locator("input#wipe-labels-checkbox");+ const tags = page.locator("input#wipe-tags-checkbox");const locations = page.locator("input#wipe-locations-checkbox");const maintenance = page.locator("input#wipe-maintenance-checkbox");- await expect(labels).toBeVisible();+ await expect(tags).toBeVisible();await expect(locations).toBeVisible();await expect(maintenance).toBeVisible();- await labels.check();+ await tags.check();await locations.check();await maintenance.check();@@ -95,7 +95,7 @@ test.describe("Wipe Inventory", () => {const request = await requestPromise;expect(request.postDataJSON()).toEqual({- wipeLabels: true,+ wipeTags: true,wipeLocations: true,wipeMaintenance: true,});@@ -123,16 +123,16 @@ test.describe("Wipe Inventory", () => {const checkboxCases = [{- name: "labels only",- selection: { labels: true, locations: false, maintenance: false },+ name: "tags only",+ selection: { tags: true, locations: false, maintenance: false },},{name: "locations only",- selection: { labels: false, locations: true, maintenance: false },+ selection: { tags: false, locations: true, maintenance: false },},{name: "maintenance only",- selection: { labels: false, locations: false, maintenance: true },+ selection: { tags: false, locations: false, maintenance: true },},];@@ -145,14 +145,14 @@ test.describe("Wipe Inventory", () => {await openWipeInventory(page);await expect(page.getByText("Wipe Inventory").first()).toBeVisible();- const labels = page.locator("input#wipe-labels-checkbox");+ const tags = page.locator("input#wipe-tags-checkbox");const locations = page.locator("input#wipe-locations-checkbox");const maintenance = page.locator("input#wipe-maintenance-checkbox");- if (scenario.selection.labels) {- await labels.check();+ if (scenario.selection.tags) {+ await tags.check();} else {- await labels.uncheck();+ await tags.uncheck();}if (scenario.selection.locations) {@@ -172,7 +172,7 @@ test.describe("Wipe Inventory", () => {const request = await requestPromise;expect(request.postDataJSON()).toEqual({- wipeLabels: scenario.selection.labels,+ wipeTags: scenario.selection.tags,wipeLocations: scenario.selection.locations,wipeMaintenance: scenario.selection.maintenance,});diff --git a/frontend/test/upgrade/upgrade-verification.spec.ts b/frontend/test/upgrade/upgrade-verification.spec.tsindex c78c3249..49464a15 100644--- a/frontend/test/upgrade/upgrade-verification.spec.ts+++ b/frontend/test/upgrade/upgrade-verification.spec.ts@@ -23,7 +23,7 @@ interface TestUser {interface TestData {users?: TestUser[];locations?: Record<string, string[]>;- labels?: Record<string, string[]>;+ tags?: Record<string, string[]>;items?: Record<string, string[]>;notifiers?: Record<string, string[]>;}@@ -130,7 +130,7 @@ test.describe("HomeBox Upgrade Verification", () => {}});- test("verify labels are present", async ({ page }) => {+ test("verify tags are present", async ({ page }) => {const firstUser = testData.users?.[0];if (!firstUser) {throw new Error("No users found in test data");@@ -144,20 +144,20 @@ test.describe("HomeBox Upgrade Verification", () => {await page.waitForSelector("body", { state: "visible" });- // Try to find labels link in navigation- const labelsLink = page.locator("a[href*='label'], button:has-text('Labels')").first();+ // Try to find tags link in navigation+ const tagsLink = page.locator("a[href*='tag'], button:has-text('Tags')").first();- if ((await labelsLink.count()) > 0) {- await labelsLink.click();+ if ((await tagsLink.count()) > 0) {+ await tagsLink.click();await page.waitForLoadState("networkidle");const pageContent = await page.textContent("body");- // Verify some of our test labels exist+ // Verify some of our test tags existexpect(pageContent).toContain("Electronics");- console.log("✓ Labels verified");+ console.log("✓ Tags verified");} else {- console.log("! Could not find labels navigation - skipping detailed check");+ console.log("! Could not find tags navigation - skipping detailed check");}});