mirror of
https://github.com/sysadminsmedia/homebox.git
synced 2025-12-21 13:23:14 +01:00
* feat: Add item templates feature (#435) Add ability to create and manage item templates for quick item creation. Templates store default values and custom fields that can be applied when creating new items. Backend changes: - New ItemTemplate and TemplateField Ent schemas - Template CRUD API endpoints - Create item from template endpoint Frontend changes: - Templates management page with create/edit/delete - Template selector in item creation modal - 'Use as Template' action on item detail page - Templates link in navigation menu * refactor: Improve template item creation with a single query - Add `CreateFromTemplate` method to ItemsRepository that creates items with all template data (including custom fields) in a single atomic transaction, replacing the previous two-phase create-then-update pattern - Fix `GetOne` to require group ID parameter so templates can only be accessed by users in the owning group (security fix) - Simplify `HandleItemTemplatesCreateItem` handler using the new transactional method * Refactor item template types and formatting Updated type annotations in CreateModal.vue to use specific ItemTemplate types instead of 'any'. Improved code formatting for template fields and manufacturer display. Also refactored warranty field logic in item details page for better readability. This resolves the linter issues as well that the bot in github keeps nagging at. * Add 'id' property to template fields Introduces an 'id' property to each field object in CreateModal.vue and item details page to support unique identification of fields. This change prepares the codebase for future enhancements that may require field-level identification. * Removed redundant SQL migrations. Removed redundant SQL migrations per @tankerkiller125's findings. * Updates to PR #1099. Regarding pull #1099. Fixed an issue causing some conflict with GUIDs and old rows in the migration files. * Add new fields and location edge to ItemTemplate Addresses recommendations from @tonyaellie. * Relocated add template button * Added more default fields to the template * Added translation of all strings (think so?) * Make oval buttons round * Added duplicate button to the template (this required a rewrite of the migration files, I made sure only 1 exists per DB type) * Added a Save as template button to a item detail view (this creates a template with all the current data of that item) * Changed all occurrences of space to gap and flex where applicable. * Made template selection persistent after item created. * Collapsible template info on creation view. * Updates to translation and fix for labels/locations I also added a test in here because I keep missing small function tests. That should prevent that from happening again. * Linted * Bring up to date with main, fix some lint/type check issues * In theory fix playwright tests * Fix defaults being unable to be nullable/empty (and thus limiting flexibility) * Last few fixes I think * Forgot to fix the golang tests --------- Co-authored-by: Matthew Kilgore <matthew@kilgore.dev>
This commit is contained in:
5195
docs/en/api/openapi-2.0.json
Normal file
5195
docs/en/api/openapi-2.0.json
Normal file
File diff suppressed because it is too large
Load Diff
3369
docs/en/api/openapi-2.0.yaml
Normal file
3369
docs/en/api/openapi-2.0.yaml
Normal file
File diff suppressed because it is too large
Load Diff
@@ -2122,6 +2122,223 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"/v1/templates": {
|
||||
"get": {
|
||||
"security": [
|
||||
{
|
||||
"Bearer": []
|
||||
}
|
||||
],
|
||||
"tags": [
|
||||
"Item Templates"
|
||||
],
|
||||
"summary": "Get All Item Templates",
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "OK",
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/components/schemas/repo.ItemTemplateSummary"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"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"
|
||||
}
|
||||
}
|
||||
},
|
||||
"description": "Item Data",
|
||||
"required": true
|
||||
},
|
||||
"responses": {
|
||||
"201": {
|
||||
"description": "Created",
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/repo.ItemOut"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/v1/users/change-password": {
|
||||
"put": {
|
||||
"security": [
|
||||
@@ -2197,6 +2414,52 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"/v1/users/login/oidc": {
|
||||
"get": {
|
||||
"tags": [
|
||||
"Authentication"
|
||||
],
|
||||
"summary": "OIDC Login Initiation",
|
||||
"responses": {
|
||||
"302": {
|
||||
"description": "Found"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/v1/users/login/oidc/callback": {
|
||||
"get": {
|
||||
"tags": [
|
||||
"Authentication"
|
||||
],
|
||||
"summary": "OIDC Callback Handler",
|
||||
"parameters": [
|
||||
{
|
||||
"description": "Authorization code",
|
||||
"name": "code",
|
||||
"in": "query",
|
||||
"required": true,
|
||||
"schema": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
{
|
||||
"description": "State parameter",
|
||||
"name": "state",
|
||||
"in": "query",
|
||||
"required": true,
|
||||
"schema": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"302": {
|
||||
"description": "Found"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/v1/users/logout": {
|
||||
"post": {
|
||||
"security": [
|
||||
@@ -2254,6 +2517,16 @@
|
||||
"responses": {
|
||||
"204": {
|
||||
"description": "No Content"
|
||||
},
|
||||
"403": {
|
||||
"description": "Local login is not enabled",
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2640,6 +2913,13 @@
|
||||
"$ref": "#/components/schemas/ent.GroupInvitationToken"
|
||||
}
|
||||
},
|
||||
"item_templates": {
|
||||
"description": "ItemTemplates holds the value of the item_templates edge.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/components/schemas/ent.ItemTemplate"
|
||||
}
|
||||
},
|
||||
"items": {
|
||||
"description": "Items holds the value of the items edge.",
|
||||
"type": "array",
|
||||
@@ -2977,6 +3257,122 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"ent.ItemTemplate": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"created_at": {
|
||||
"description": "CreatedAt holds the value of the \"created_at\" field.",
|
||||
"type": "string"
|
||||
},
|
||||
"default_description": {
|
||||
"description": "Default description for items created from this template",
|
||||
"type": "string"
|
||||
},
|
||||
"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": "string"
|
||||
}
|
||||
},
|
||||
"default_lifetime_warranty": {
|
||||
"description": "DefaultLifetimeWarranty holds the value of the \"default_lifetime_warranty\" field.",
|
||||
"type": "boolean"
|
||||
},
|
||||
"default_manufacturer": {
|
||||
"description": "DefaultManufacturer holds the value of the \"default_manufacturer\" field.",
|
||||
"type": "string"
|
||||
},
|
||||
"default_model_number": {
|
||||
"description": "Default model number for items created from this template",
|
||||
"type": "string"
|
||||
},
|
||||
"default_name": {
|
||||
"description": "Default name template for items (can use placeholders)",
|
||||
"type": "string"
|
||||
},
|
||||
"default_quantity": {
|
||||
"description": "DefaultQuantity holds the value of the \"default_quantity\" field.",
|
||||
"type": "integer"
|
||||
},
|
||||
"default_warranty_details": {
|
||||
"description": "DefaultWarrantyDetails holds the value of the \"default_warranty_details\" 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 ItemTemplateQuery when eager-loading is set.",
|
||||
"allOf": [
|
||||
{
|
||||
"$ref": "#/components/schemas/ent.ItemTemplateEdges"
|
||||
}
|
||||
]
|
||||
},
|
||||
"id": {
|
||||
"description": "ID of the ent.",
|
||||
"type": "string"
|
||||
},
|
||||
"include_purchase_fields": {
|
||||
"description": "Whether to include purchase fields in items created from this template",
|
||||
"type": "boolean"
|
||||
},
|
||||
"include_sold_fields": {
|
||||
"description": "Whether to include sold fields in items created from this template",
|
||||
"type": "boolean"
|
||||
},
|
||||
"include_warranty_fields": {
|
||||
"description": "Whether to include warranty fields in items created from this template",
|
||||
"type": "boolean"
|
||||
},
|
||||
"name": {
|
||||
"description": "Name holds the value of the \"name\" field.",
|
||||
"type": "string"
|
||||
},
|
||||
"notes": {
|
||||
"description": "Notes holds the value of the \"notes\" field.",
|
||||
"type": "string"
|
||||
},
|
||||
"updated_at": {
|
||||
"description": "UpdatedAt holds the value of the \"updated_at\" field.",
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"ent.ItemTemplateEdges": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"fields": {
|
||||
"description": "Fields holds the value of the fields edge.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/components/schemas/ent.TemplateField"
|
||||
}
|
||||
},
|
||||
"group": {
|
||||
"description": "Group holds the value of the group edge.",
|
||||
"allOf": [
|
||||
{
|
||||
"$ref": "#/components/schemas/ent.Group"
|
||||
}
|
||||
]
|
||||
},
|
||||
"location": {
|
||||
"description": "Location holds the value of the location edge.",
|
||||
"allOf": [
|
||||
{
|
||||
"$ref": "#/components/schemas/ent.Location"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"ent.Label": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
@@ -3226,6 +3622,64 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"ent.TemplateField": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"created_at": {
|
||||
"description": "CreatedAt holds the value of the \"created_at\" field.",
|
||||
"type": "string"
|
||||
},
|
||||
"description": {
|
||||
"description": "Description holds the value of the \"description\" field.",
|
||||
"type": "string"
|
||||
},
|
||||
"edges": {
|
||||
"description": "Edges holds the relations/edges for other nodes in the graph.\nThe values are being populated by the TemplateFieldQuery when eager-loading is set.",
|
||||
"allOf": [
|
||||
{
|
||||
"$ref": "#/components/schemas/ent.TemplateFieldEdges"
|
||||
}
|
||||
]
|
||||
},
|
||||
"id": {
|
||||
"description": "ID of the ent.",
|
||||
"type": "string"
|
||||
},
|
||||
"name": {
|
||||
"description": "Name holds the value of the \"name\" field.",
|
||||
"type": "string"
|
||||
},
|
||||
"text_value": {
|
||||
"description": "TextValue holds the value of the \"text_value\" field.",
|
||||
"type": "string"
|
||||
},
|
||||
"type": {
|
||||
"description": "Type holds the value of the \"type\" field.",
|
||||
"allOf": [
|
||||
{
|
||||
"$ref": "#/components/schemas/templatefield.Type"
|
||||
}
|
||||
]
|
||||
},
|
||||
"updated_at": {
|
||||
"description": "UpdatedAt holds the value of the \"updated_at\" field.",
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"ent.TemplateFieldEdges": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"item_template": {
|
||||
"description": "ItemTemplate holds the value of the item_template edge.",
|
||||
"allOf": [
|
||||
{
|
||||
"$ref": "#/components/schemas/ent.ItemTemplate"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"ent.User": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
@@ -3261,6 +3715,14 @@
|
||||
"description": "Name holds the value of the \"name\" field.",
|
||||
"type": "string"
|
||||
},
|
||||
"oidc_issuer": {
|
||||
"description": "OidcIssuer holds the value of the \"oidc_issuer\" field.",
|
||||
"type": "string"
|
||||
},
|
||||
"oidc_subject": {
|
||||
"description": "OidcSubject holds the value of the \"oidc_subject\" field.",
|
||||
"type": "string"
|
||||
},
|
||||
"role": {
|
||||
"description": "Role holds the value of the \"role\" field.",
|
||||
"allOf": [
|
||||
@@ -3761,6 +4223,280 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"repo.ItemTemplateCreate": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"name"
|
||||
],
|
||||
"properties": {
|
||||
"defaultDescription": {
|
||||
"type": "string",
|
||||
"maxLength": 1000,
|
||||
"nullable": true
|
||||
},
|
||||
"defaultInsured": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"defaultLabelIds": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
},
|
||||
"nullable": true
|
||||
},
|
||||
"defaultLifetimeWarranty": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"defaultLocationId": {
|
||||
"description": "Default location and labels",
|
||||
"type": "string",
|
||||
"nullable": true
|
||||
},
|
||||
"defaultManufacturer": {
|
||||
"type": "string",
|
||||
"maxLength": 255,
|
||||
"nullable": true
|
||||
},
|
||||
"defaultModelNumber": {
|
||||
"type": "string",
|
||||
"maxLength": 255,
|
||||
"nullable": true
|
||||
},
|
||||
"defaultName": {
|
||||
"type": "string",
|
||||
"maxLength": 255,
|
||||
"nullable": true
|
||||
},
|
||||
"defaultQuantity": {
|
||||
"description": "Default values for items",
|
||||
"type": "integer",
|
||||
"nullable": true
|
||||
},
|
||||
"defaultWarrantyDetails": {
|
||||
"type": "string",
|
||||
"maxLength": 1000,
|
||||
"nullable": true
|
||||
},
|
||||
"description": {
|
||||
"type": "string",
|
||||
"maxLength": 1000
|
||||
},
|
||||
"fields": {
|
||||
"description": "Custom fields",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/components/schemas/repo.TemplateField"
|
||||
}
|
||||
},
|
||||
"includePurchaseFields": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"includeSoldFields": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"includeWarrantyFields": {
|
||||
"description": "Metadata flags",
|
||||
"type": "boolean"
|
||||
},
|
||||
"name": {
|
||||
"type": "string",
|
||||
"maxLength": 255,
|
||||
"minLength": 1
|
||||
},
|
||||
"notes": {
|
||||
"type": "string",
|
||||
"maxLength": 1000
|
||||
}
|
||||
}
|
||||
},
|
||||
"repo.ItemTemplateOut": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"createdAt": {
|
||||
"type": "string"
|
||||
},
|
||||
"defaultDescription": {
|
||||
"type": "string"
|
||||
},
|
||||
"defaultInsured": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"defaultLabels": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/components/schemas/repo.TemplateLabelSummary"
|
||||
}
|
||||
},
|
||||
"defaultLifetimeWarranty": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"defaultLocation": {
|
||||
"description": "Default location and labels",
|
||||
"allOf": [
|
||||
{
|
||||
"$ref": "#/components/schemas/repo.TemplateLocationSummary"
|
||||
}
|
||||
]
|
||||
},
|
||||
"defaultManufacturer": {
|
||||
"type": "string"
|
||||
},
|
||||
"defaultModelNumber": {
|
||||
"type": "string"
|
||||
},
|
||||
"defaultName": {
|
||||
"type": "string"
|
||||
},
|
||||
"defaultQuantity": {
|
||||
"description": "Default values for items",
|
||||
"type": "integer"
|
||||
},
|
||||
"defaultWarrantyDetails": {
|
||||
"type": "string"
|
||||
},
|
||||
"description": {
|
||||
"type": "string"
|
||||
},
|
||||
"fields": {
|
||||
"description": "Custom fields",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/components/schemas/repo.TemplateField"
|
||||
}
|
||||
},
|
||||
"id": {
|
||||
"type": "string"
|
||||
},
|
||||
"includePurchaseFields": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"includeSoldFields": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"includeWarrantyFields": {
|
||||
"description": "Metadata flags",
|
||||
"type": "boolean"
|
||||
},
|
||||
"name": {
|
||||
"type": "string"
|
||||
},
|
||||
"notes": {
|
||||
"type": "string"
|
||||
},
|
||||
"updatedAt": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"repo.ItemTemplateSummary": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"createdAt": {
|
||||
"type": "string"
|
||||
},
|
||||
"description": {
|
||||
"type": "string"
|
||||
},
|
||||
"id": {
|
||||
"type": "string"
|
||||
},
|
||||
"name": {
|
||||
"type": "string"
|
||||
},
|
||||
"updatedAt": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"repo.ItemTemplateUpdate": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"name"
|
||||
],
|
||||
"properties": {
|
||||
"defaultDescription": {
|
||||
"type": "string",
|
||||
"maxLength": 1000,
|
||||
"nullable": true
|
||||
},
|
||||
"defaultInsured": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"defaultLabelIds": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
},
|
||||
"nullable": true
|
||||
},
|
||||
"defaultLifetimeWarranty": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"defaultLocationId": {
|
||||
"description": "Default location and labels",
|
||||
"type": "string",
|
||||
"nullable": true
|
||||
},
|
||||
"defaultManufacturer": {
|
||||
"type": "string",
|
||||
"maxLength": 255,
|
||||
"nullable": true
|
||||
},
|
||||
"defaultModelNumber": {
|
||||
"type": "string",
|
||||
"maxLength": 255,
|
||||
"nullable": true
|
||||
},
|
||||
"defaultName": {
|
||||
"type": "string",
|
||||
"maxLength": 255,
|
||||
"nullable": true
|
||||
},
|
||||
"defaultQuantity": {
|
||||
"description": "Default values for items",
|
||||
"type": "integer",
|
||||
"nullable": true
|
||||
},
|
||||
"defaultWarrantyDetails": {
|
||||
"type": "string",
|
||||
"maxLength": 1000,
|
||||
"nullable": true
|
||||
},
|
||||
"description": {
|
||||
"type": "string",
|
||||
"maxLength": 1000
|
||||
},
|
||||
"fields": {
|
||||
"description": "Custom fields",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/components/schemas/repo.TemplateField"
|
||||
}
|
||||
},
|
||||
"id": {
|
||||
"type": "string"
|
||||
},
|
||||
"includePurchaseFields": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"includeSoldFields": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"includeWarrantyFields": {
|
||||
"description": "Metadata flags",
|
||||
"type": "boolean"
|
||||
},
|
||||
"name": {
|
||||
"type": "string",
|
||||
"maxLength": 255,
|
||||
"minLength": 1
|
||||
},
|
||||
"notes": {
|
||||
"type": "string",
|
||||
"maxLength": 1000
|
||||
}
|
||||
}
|
||||
},
|
||||
"repo.ItemType": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
@@ -4256,6 +4992,45 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"repo.TemplateField": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"id": {
|
||||
"type": "string"
|
||||
},
|
||||
"name": {
|
||||
"type": "string"
|
||||
},
|
||||
"textValue": {
|
||||
"type": "string"
|
||||
},
|
||||
"type": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"repo.TemplateLabelSummary": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"id": {
|
||||
"type": "string"
|
||||
},
|
||||
"name": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"repo.TemplateLocationSummary": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"id": {
|
||||
"type": "string"
|
||||
},
|
||||
"name": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"repo.TotalsByOrganizer": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
@@ -4313,6 +5088,12 @@
|
||||
},
|
||||
"name": {
|
||||
"type": "string"
|
||||
},
|
||||
"oidcIssuer": {
|
||||
"type": "string"
|
||||
},
|
||||
"oidcSubject": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -4392,6 +5173,15 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"templatefield.Type": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"text"
|
||||
],
|
||||
"x-enum-varnames": [
|
||||
"TypeText"
|
||||
]
|
||||
},
|
||||
"user.Role": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
@@ -4429,6 +5219,9 @@
|
||||
"message": {
|
||||
"type": "string"
|
||||
},
|
||||
"oidc": {
|
||||
"$ref": "#/components/schemas/v1.OIDCStatus"
|
||||
},
|
||||
"title": {
|
||||
"type": "string"
|
||||
},
|
||||
@@ -4511,6 +5304,36 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"v1.ItemTemplateCreateItemRequest": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"locationId",
|
||||
"name"
|
||||
],
|
||||
"properties": {
|
||||
"description": {
|
||||
"type": "string",
|
||||
"maxLength": 1000
|
||||
},
|
||||
"labelIds": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"locationId": {
|
||||
"type": "string"
|
||||
},
|
||||
"name": {
|
||||
"type": "string",
|
||||
"maxLength": 255,
|
||||
"minLength": 1
|
||||
},
|
||||
"quantity": {
|
||||
"type": "integer"
|
||||
}
|
||||
}
|
||||
},
|
||||
"v1.LoginForm": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
@@ -4527,6 +5350,23 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"v1.OIDCStatus": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"allowLocal": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"autoRedirect": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"buttonText": {
|
||||
"type": "string"
|
||||
},
|
||||
"enabled": {
|
||||
"type": "boolean"
|
||||
}
|
||||
}
|
||||
},
|
||||
"v1.TokenResponse": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
|
||||
@@ -1257,6 +1257,134 @@ paths:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: "#/components/schemas/v1.APISummary"
|
||||
/v1/templates:
|
||||
get:
|
||||
security:
|
||||
- Bearer: []
|
||||
tags:
|
||||
- Item Templates
|
||||
summary: Get All Item Templates
|
||||
responses:
|
||||
"200":
|
||||
description: OK
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: array
|
||||
items:
|
||||
$ref: "#/components/schemas/repo.ItemTemplateSummary"
|
||||
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"
|
||||
description: Item Data
|
||||
required: true
|
||||
responses:
|
||||
"201":
|
||||
description: Created
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: "#/components/schemas/repo.ItemOut"
|
||||
/v1/users/change-password:
|
||||
put:
|
||||
security:
|
||||
@@ -1302,6 +1430,35 @@ paths:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: "#/components/schemas/v1.TokenResponse"
|
||||
/v1/users/login/oidc:
|
||||
get:
|
||||
tags:
|
||||
- Authentication
|
||||
summary: OIDC Login Initiation
|
||||
responses:
|
||||
"302":
|
||||
description: Found
|
||||
/v1/users/login/oidc/callback:
|
||||
get:
|
||||
tags:
|
||||
- Authentication
|
||||
summary: OIDC Callback Handler
|
||||
parameters:
|
||||
- description: Authorization code
|
||||
name: code
|
||||
in: query
|
||||
required: true
|
||||
schema:
|
||||
type: string
|
||||
- description: State parameter
|
||||
name: state
|
||||
in: query
|
||||
required: true
|
||||
schema:
|
||||
type: string
|
||||
responses:
|
||||
"302":
|
||||
description: Found
|
||||
/v1/users/logout:
|
||||
post:
|
||||
security:
|
||||
@@ -1342,6 +1499,12 @@ paths:
|
||||
responses:
|
||||
"204":
|
||||
description: No Content
|
||||
"403":
|
||||
description: Local login is not enabled
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: string
|
||||
/v1/users/self:
|
||||
get:
|
||||
security:
|
||||
@@ -1590,6 +1753,11 @@ components:
|
||||
type: array
|
||||
items:
|
||||
$ref: "#/components/schemas/ent.GroupInvitationToken"
|
||||
item_templates:
|
||||
description: ItemTemplates holds the value of the item_templates edge.
|
||||
type: array
|
||||
items:
|
||||
$ref: "#/components/schemas/ent.ItemTemplate"
|
||||
items:
|
||||
description: Items holds the value of the items edge.
|
||||
type: array
|
||||
@@ -1826,6 +1994,93 @@ components:
|
||||
description: Item holds the value of the item edge.
|
||||
allOf:
|
||||
- $ref: "#/components/schemas/ent.Item"
|
||||
ent.ItemTemplate:
|
||||
type: object
|
||||
properties:
|
||||
created_at:
|
||||
description: CreatedAt holds the value of the "created_at" field.
|
||||
type: string
|
||||
default_description:
|
||||
description: Default description for items created from this template
|
||||
type: string
|
||||
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: string
|
||||
default_lifetime_warranty:
|
||||
description: DefaultLifetimeWarranty holds the value of the
|
||||
"default_lifetime_warranty" field.
|
||||
type: boolean
|
||||
default_manufacturer:
|
||||
description: DefaultManufacturer holds the value of the "default_manufacturer"
|
||||
field.
|
||||
type: string
|
||||
default_model_number:
|
||||
description: Default model number for items created from this template
|
||||
type: string
|
||||
default_name:
|
||||
description: Default name template for items (can use placeholders)
|
||||
type: string
|
||||
default_quantity:
|
||||
description: DefaultQuantity holds the value of the "default_quantity" field.
|
||||
type: integer
|
||||
default_warranty_details:
|
||||
description: DefaultWarrantyDetails holds the value of the
|
||||
"default_warranty_details" 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 ItemTemplateQuery when eager-loading is set.
|
||||
allOf:
|
||||
- $ref: "#/components/schemas/ent.ItemTemplateEdges"
|
||||
id:
|
||||
description: ID of the ent.
|
||||
type: string
|
||||
include_purchase_fields:
|
||||
description: Whether to include purchase fields in items created from this
|
||||
template
|
||||
type: boolean
|
||||
include_sold_fields:
|
||||
description: Whether to include sold fields in items created from this template
|
||||
type: boolean
|
||||
include_warranty_fields:
|
||||
description: Whether to include warranty fields in items created from this
|
||||
template
|
||||
type: boolean
|
||||
name:
|
||||
description: Name holds the value of the "name" field.
|
||||
type: string
|
||||
notes:
|
||||
description: Notes holds the value of the "notes" field.
|
||||
type: string
|
||||
updated_at:
|
||||
description: UpdatedAt holds the value of the "updated_at" field.
|
||||
type: string
|
||||
ent.ItemTemplateEdges:
|
||||
type: object
|
||||
properties:
|
||||
fields:
|
||||
description: Fields holds the value of the fields edge.
|
||||
type: array
|
||||
items:
|
||||
$ref: "#/components/schemas/ent.TemplateField"
|
||||
group:
|
||||
description: Group holds the value of the group edge.
|
||||
allOf:
|
||||
- $ref: "#/components/schemas/ent.Group"
|
||||
location:
|
||||
description: Location holds the value of the location edge.
|
||||
allOf:
|
||||
- $ref: "#/components/schemas/ent.Location"
|
||||
ent.Label:
|
||||
type: object
|
||||
properties:
|
||||
@@ -1998,6 +2253,45 @@ components:
|
||||
description: User holds the value of the user edge.
|
||||
allOf:
|
||||
- $ref: "#/components/schemas/ent.User"
|
||||
ent.TemplateField:
|
||||
type: object
|
||||
properties:
|
||||
created_at:
|
||||
description: CreatedAt holds the value of the "created_at" field.
|
||||
type: string
|
||||
description:
|
||||
description: Description holds the value of the "description" field.
|
||||
type: string
|
||||
edges:
|
||||
description: >-
|
||||
Edges holds the relations/edges for other nodes in the graph.
|
||||
|
||||
The values are being populated by the TemplateFieldQuery when eager-loading is set.
|
||||
allOf:
|
||||
- $ref: "#/components/schemas/ent.TemplateFieldEdges"
|
||||
id:
|
||||
description: ID of the ent.
|
||||
type: string
|
||||
name:
|
||||
description: Name holds the value of the "name" field.
|
||||
type: string
|
||||
text_value:
|
||||
description: TextValue holds the value of the "text_value" field.
|
||||
type: string
|
||||
type:
|
||||
description: Type holds the value of the "type" field.
|
||||
allOf:
|
||||
- $ref: "#/components/schemas/templatefield.Type"
|
||||
updated_at:
|
||||
description: UpdatedAt holds the value of the "updated_at" field.
|
||||
type: string
|
||||
ent.TemplateFieldEdges:
|
||||
type: object
|
||||
properties:
|
||||
item_template:
|
||||
description: ItemTemplate holds the value of the item_template edge.
|
||||
allOf:
|
||||
- $ref: "#/components/schemas/ent.ItemTemplate"
|
||||
ent.User:
|
||||
type: object
|
||||
properties:
|
||||
@@ -2026,6 +2320,12 @@ components:
|
||||
name:
|
||||
description: Name holds the value of the "name" field.
|
||||
type: string
|
||||
oidc_issuer:
|
||||
description: OidcIssuer holds the value of the "oidc_issuer" field.
|
||||
type: string
|
||||
oidc_subject:
|
||||
description: OidcSubject holds the value of the "oidc_subject" field.
|
||||
type: string
|
||||
role:
|
||||
description: Role holds the value of the "role" field.
|
||||
allOf:
|
||||
@@ -2361,6 +2661,201 @@ components:
|
||||
nullable: true
|
||||
updatedAt:
|
||||
type: string
|
||||
repo.ItemTemplateCreate:
|
||||
type: object
|
||||
required:
|
||||
- name
|
||||
properties:
|
||||
defaultDescription:
|
||||
type: string
|
||||
maxLength: 1000
|
||||
nullable: true
|
||||
defaultInsured:
|
||||
type: boolean
|
||||
defaultLabelIds:
|
||||
type: array
|
||||
items:
|
||||
type: string
|
||||
nullable: true
|
||||
defaultLifetimeWarranty:
|
||||
type: boolean
|
||||
defaultLocationId:
|
||||
description: Default location and labels
|
||||
type: string
|
||||
nullable: true
|
||||
defaultManufacturer:
|
||||
type: string
|
||||
maxLength: 255
|
||||
nullable: true
|
||||
defaultModelNumber:
|
||||
type: string
|
||||
maxLength: 255
|
||||
nullable: true
|
||||
defaultName:
|
||||
type: string
|
||||
maxLength: 255
|
||||
nullable: true
|
||||
defaultQuantity:
|
||||
description: Default values for items
|
||||
type: integer
|
||||
nullable: true
|
||||
defaultWarrantyDetails:
|
||||
type: string
|
||||
maxLength: 1000
|
||||
nullable: true
|
||||
description:
|
||||
type: string
|
||||
maxLength: 1000
|
||||
fields:
|
||||
description: Custom fields
|
||||
type: array
|
||||
items:
|
||||
$ref: "#/components/schemas/repo.TemplateField"
|
||||
includePurchaseFields:
|
||||
type: boolean
|
||||
includeSoldFields:
|
||||
type: boolean
|
||||
includeWarrantyFields:
|
||||
description: Metadata flags
|
||||
type: boolean
|
||||
name:
|
||||
type: string
|
||||
maxLength: 255
|
||||
minLength: 1
|
||||
notes:
|
||||
type: string
|
||||
maxLength: 1000
|
||||
repo.ItemTemplateOut:
|
||||
type: object
|
||||
properties:
|
||||
createdAt:
|
||||
type: string
|
||||
defaultDescription:
|
||||
type: string
|
||||
defaultInsured:
|
||||
type: boolean
|
||||
defaultLabels:
|
||||
type: array
|
||||
items:
|
||||
$ref: "#/components/schemas/repo.TemplateLabelSummary"
|
||||
defaultLifetimeWarranty:
|
||||
type: boolean
|
||||
defaultLocation:
|
||||
description: Default location and labels
|
||||
allOf:
|
||||
- $ref: "#/components/schemas/repo.TemplateLocationSummary"
|
||||
defaultManufacturer:
|
||||
type: string
|
||||
defaultModelNumber:
|
||||
type: string
|
||||
defaultName:
|
||||
type: string
|
||||
defaultQuantity:
|
||||
description: Default values for items
|
||||
type: integer
|
||||
defaultWarrantyDetails:
|
||||
type: string
|
||||
description:
|
||||
type: string
|
||||
fields:
|
||||
description: Custom fields
|
||||
type: array
|
||||
items:
|
||||
$ref: "#/components/schemas/repo.TemplateField"
|
||||
id:
|
||||
type: string
|
||||
includePurchaseFields:
|
||||
type: boolean
|
||||
includeSoldFields:
|
||||
type: boolean
|
||||
includeWarrantyFields:
|
||||
description: Metadata flags
|
||||
type: boolean
|
||||
name:
|
||||
type: string
|
||||
notes:
|
||||
type: string
|
||||
updatedAt:
|
||||
type: string
|
||||
repo.ItemTemplateSummary:
|
||||
type: object
|
||||
properties:
|
||||
createdAt:
|
||||
type: string
|
||||
description:
|
||||
type: string
|
||||
id:
|
||||
type: string
|
||||
name:
|
||||
type: string
|
||||
updatedAt:
|
||||
type: string
|
||||
repo.ItemTemplateUpdate:
|
||||
type: object
|
||||
required:
|
||||
- name
|
||||
properties:
|
||||
defaultDescription:
|
||||
type: string
|
||||
maxLength: 1000
|
||||
nullable: true
|
||||
defaultInsured:
|
||||
type: boolean
|
||||
defaultLabelIds:
|
||||
type: array
|
||||
items:
|
||||
type: string
|
||||
nullable: true
|
||||
defaultLifetimeWarranty:
|
||||
type: boolean
|
||||
defaultLocationId:
|
||||
description: Default location and labels
|
||||
type: string
|
||||
nullable: true
|
||||
defaultManufacturer:
|
||||
type: string
|
||||
maxLength: 255
|
||||
nullable: true
|
||||
defaultModelNumber:
|
||||
type: string
|
||||
maxLength: 255
|
||||
nullable: true
|
||||
defaultName:
|
||||
type: string
|
||||
maxLength: 255
|
||||
nullable: true
|
||||
defaultQuantity:
|
||||
description: Default values for items
|
||||
type: integer
|
||||
nullable: true
|
||||
defaultWarrantyDetails:
|
||||
type: string
|
||||
maxLength: 1000
|
||||
nullable: true
|
||||
description:
|
||||
type: string
|
||||
maxLength: 1000
|
||||
fields:
|
||||
description: Custom fields
|
||||
type: array
|
||||
items:
|
||||
$ref: "#/components/schemas/repo.TemplateField"
|
||||
id:
|
||||
type: string
|
||||
includePurchaseFields:
|
||||
type: boolean
|
||||
includeSoldFields:
|
||||
type: boolean
|
||||
includeWarrantyFields:
|
||||
description: Metadata flags
|
||||
type: boolean
|
||||
name:
|
||||
type: string
|
||||
maxLength: 255
|
||||
minLength: 1
|
||||
notes:
|
||||
type: string
|
||||
maxLength: 1000
|
||||
repo.ItemType:
|
||||
type: string
|
||||
enum:
|
||||
@@ -2698,6 +3193,31 @@ components:
|
||||
type: integer
|
||||
total:
|
||||
type: integer
|
||||
repo.TemplateField:
|
||||
type: object
|
||||
properties:
|
||||
id:
|
||||
type: string
|
||||
name:
|
||||
type: string
|
||||
textValue:
|
||||
type: string
|
||||
type:
|
||||
type: string
|
||||
repo.TemplateLabelSummary:
|
||||
type: object
|
||||
properties:
|
||||
id:
|
||||
type: string
|
||||
name:
|
||||
type: string
|
||||
repo.TemplateLocationSummary:
|
||||
type: object
|
||||
properties:
|
||||
id:
|
||||
type: string
|
||||
name:
|
||||
type: string
|
||||
repo.TotalsByOrganizer:
|
||||
type: object
|
||||
properties:
|
||||
@@ -2737,6 +3257,10 @@ components:
|
||||
type: boolean
|
||||
name:
|
||||
type: string
|
||||
oidcIssuer:
|
||||
type: string
|
||||
oidcSubject:
|
||||
type: string
|
||||
repo.UserUpdate:
|
||||
type: object
|
||||
properties:
|
||||
@@ -2786,6 +3310,12 @@ components:
|
||||
type: string
|
||||
token:
|
||||
type: string
|
||||
templatefield.Type:
|
||||
type: string
|
||||
enum:
|
||||
- text
|
||||
x-enum-varnames:
|
||||
- TypeText
|
||||
user.Role:
|
||||
type: string
|
||||
enum:
|
||||
@@ -2813,6 +3343,8 @@ components:
|
||||
$ref: "#/components/schemas/services.Latest"
|
||||
message:
|
||||
type: string
|
||||
oidc:
|
||||
$ref: "#/components/schemas/v1.OIDCStatus"
|
||||
title:
|
||||
type: string
|
||||
versions:
|
||||
@@ -2865,6 +3397,27 @@ components:
|
||||
properties:
|
||||
token:
|
||||
type: string
|
||||
v1.ItemTemplateCreateItemRequest:
|
||||
type: object
|
||||
required:
|
||||
- locationId
|
||||
- name
|
||||
properties:
|
||||
description:
|
||||
type: string
|
||||
maxLength: 1000
|
||||
labelIds:
|
||||
type: array
|
||||
items:
|
||||
type: string
|
||||
locationId:
|
||||
type: string
|
||||
name:
|
||||
type: string
|
||||
maxLength: 255
|
||||
minLength: 1
|
||||
quantity:
|
||||
type: integer
|
||||
v1.LoginForm:
|
||||
type: object
|
||||
properties:
|
||||
@@ -2876,6 +3429,17 @@ components:
|
||||
username:
|
||||
type: string
|
||||
example: admin@admin.com
|
||||
v1.OIDCStatus:
|
||||
type: object
|
||||
properties:
|
||||
allowLocal:
|
||||
type: boolean
|
||||
autoRedirect:
|
||||
type: boolean
|
||||
buttonText:
|
||||
type: string
|
||||
enabled:
|
||||
type: boolean
|
||||
v1.TokenResponse:
|
||||
type: object
|
||||
properties:
|
||||
|
||||
@@ -1961,6 +1961,209 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"/v1/templates": {
|
||||
"get": {
|
||||
"security": [
|
||||
{
|
||||
"Bearer": []
|
||||
}
|
||||
],
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"Item Templates"
|
||||
],
|
||||
"summary": "Get All Item Templates",
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "OK",
|
||||
"schema": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/definitions/repo.ItemTemplateSummary"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"post": {
|
||||
"security": [
|
||||
{
|
||||
"Bearer": []
|
||||
}
|
||||
],
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"Item Templates"
|
||||
],
|
||||
"summary": "Create Item Template",
|
||||
"parameters": [
|
||||
{
|
||||
"description": "Template Data",
|
||||
"name": "payload",
|
||||
"in": "body",
|
||||
"required": true,
|
||||
"schema": {
|
||||
"$ref": "#/definitions/repo.ItemTemplateCreate"
|
||||
}
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"201": {
|
||||
"description": "Created",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/repo.ItemTemplateOut"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/v1/templates/{id}": {
|
||||
"get": {
|
||||
"security": [
|
||||
{
|
||||
"Bearer": []
|
||||
}
|
||||
],
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"Item Templates"
|
||||
],
|
||||
"summary": "Get Item Template",
|
||||
"parameters": [
|
||||
{
|
||||
"type": "string",
|
||||
"description": "Template ID",
|
||||
"name": "id",
|
||||
"in": "path",
|
||||
"required": true
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "OK",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/repo.ItemTemplateOut"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"put": {
|
||||
"security": [
|
||||
{
|
||||
"Bearer": []
|
||||
}
|
||||
],
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"Item Templates"
|
||||
],
|
||||
"summary": "Update Item Template",
|
||||
"parameters": [
|
||||
{
|
||||
"type": "string",
|
||||
"description": "Template ID",
|
||||
"name": "id",
|
||||
"in": "path",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"description": "Template Data",
|
||||
"name": "payload",
|
||||
"in": "body",
|
||||
"required": true,
|
||||
"schema": {
|
||||
"$ref": "#/definitions/repo.ItemTemplateUpdate"
|
||||
}
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "OK",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/repo.ItemTemplateOut"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"delete": {
|
||||
"security": [
|
||||
{
|
||||
"Bearer": []
|
||||
}
|
||||
],
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"Item Templates"
|
||||
],
|
||||
"summary": "Delete Item Template",
|
||||
"parameters": [
|
||||
{
|
||||
"type": "string",
|
||||
"description": "Template ID",
|
||||
"name": "id",
|
||||
"in": "path",
|
||||
"required": true
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"204": {
|
||||
"description": "No Content"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/v1/templates/{id}/create-item": {
|
||||
"post": {
|
||||
"security": [
|
||||
{
|
||||
"Bearer": []
|
||||
}
|
||||
],
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"Item Templates"
|
||||
],
|
||||
"summary": "Create Item from Template",
|
||||
"parameters": [
|
||||
{
|
||||
"type": "string",
|
||||
"description": "Template ID",
|
||||
"name": "id",
|
||||
"in": "path",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"description": "Item Data",
|
||||
"name": "payload",
|
||||
"in": "body",
|
||||
"required": true,
|
||||
"schema": {
|
||||
"$ref": "#/definitions/v1.ItemTemplateCreateItemRequest"
|
||||
}
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"201": {
|
||||
"description": "Created",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/repo.ItemOut"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/v1/users/change-password": {
|
||||
"put": {
|
||||
"security": [
|
||||
@@ -2030,6 +2233,51 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"/v1/users/login/oidc": {
|
||||
"get": {
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"Authentication"
|
||||
],
|
||||
"summary": "OIDC Login Initiation",
|
||||
"responses": {
|
||||
"302": {
|
||||
"description": "Found"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/v1/users/login/oidc/callback": {
|
||||
"get": {
|
||||
"tags": [
|
||||
"Authentication"
|
||||
],
|
||||
"summary": "OIDC Callback Handler",
|
||||
"parameters": [
|
||||
{
|
||||
"type": "string",
|
||||
"description": "Authorization code",
|
||||
"name": "code",
|
||||
"in": "query",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"description": "State parameter",
|
||||
"name": "state",
|
||||
"in": "query",
|
||||
"required": true
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"302": {
|
||||
"description": "Found"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/v1/users/logout": {
|
||||
"post": {
|
||||
"security": [
|
||||
@@ -2090,6 +2338,12 @@
|
||||
"responses": {
|
||||
"204": {
|
||||
"description": "No Content"
|
||||
},
|
||||
"403": {
|
||||
"description": "Local login is not enabled",
|
||||
"schema": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2460,6 +2714,13 @@
|
||||
"$ref": "#/definitions/ent.GroupInvitationToken"
|
||||
}
|
||||
},
|
||||
"item_templates": {
|
||||
"description": "ItemTemplates holds the value of the item_templates edge.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/definitions/ent.ItemTemplate"
|
||||
}
|
||||
},
|
||||
"items": {
|
||||
"description": "Items holds the value of the items edge.",
|
||||
"type": "array",
|
||||
@@ -2797,6 +3058,122 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"ent.ItemTemplate": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"created_at": {
|
||||
"description": "CreatedAt holds the value of the \"created_at\" field.",
|
||||
"type": "string"
|
||||
},
|
||||
"default_description": {
|
||||
"description": "Default description for items created from this template",
|
||||
"type": "string"
|
||||
},
|
||||
"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": "string"
|
||||
}
|
||||
},
|
||||
"default_lifetime_warranty": {
|
||||
"description": "DefaultLifetimeWarranty holds the value of the \"default_lifetime_warranty\" field.",
|
||||
"type": "boolean"
|
||||
},
|
||||
"default_manufacturer": {
|
||||
"description": "DefaultManufacturer holds the value of the \"default_manufacturer\" field.",
|
||||
"type": "string"
|
||||
},
|
||||
"default_model_number": {
|
||||
"description": "Default model number for items created from this template",
|
||||
"type": "string"
|
||||
},
|
||||
"default_name": {
|
||||
"description": "Default name template for items (can use placeholders)",
|
||||
"type": "string"
|
||||
},
|
||||
"default_quantity": {
|
||||
"description": "DefaultQuantity holds the value of the \"default_quantity\" field.",
|
||||
"type": "integer"
|
||||
},
|
||||
"default_warranty_details": {
|
||||
"description": "DefaultWarrantyDetails holds the value of the \"default_warranty_details\" 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 ItemTemplateQuery when eager-loading is set.",
|
||||
"allOf": [
|
||||
{
|
||||
"$ref": "#/definitions/ent.ItemTemplateEdges"
|
||||
}
|
||||
]
|
||||
},
|
||||
"id": {
|
||||
"description": "ID of the ent.",
|
||||
"type": "string"
|
||||
},
|
||||
"include_purchase_fields": {
|
||||
"description": "Whether to include purchase fields in items created from this template",
|
||||
"type": "boolean"
|
||||
},
|
||||
"include_sold_fields": {
|
||||
"description": "Whether to include sold fields in items created from this template",
|
||||
"type": "boolean"
|
||||
},
|
||||
"include_warranty_fields": {
|
||||
"description": "Whether to include warranty fields in items created from this template",
|
||||
"type": "boolean"
|
||||
},
|
||||
"name": {
|
||||
"description": "Name holds the value of the \"name\" field.",
|
||||
"type": "string"
|
||||
},
|
||||
"notes": {
|
||||
"description": "Notes holds the value of the \"notes\" field.",
|
||||
"type": "string"
|
||||
},
|
||||
"updated_at": {
|
||||
"description": "UpdatedAt holds the value of the \"updated_at\" field.",
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"ent.ItemTemplateEdges": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"fields": {
|
||||
"description": "Fields holds the value of the fields edge.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/definitions/ent.TemplateField"
|
||||
}
|
||||
},
|
||||
"group": {
|
||||
"description": "Group holds the value of the group edge.",
|
||||
"allOf": [
|
||||
{
|
||||
"$ref": "#/definitions/ent.Group"
|
||||
}
|
||||
]
|
||||
},
|
||||
"location": {
|
||||
"description": "Location holds the value of the location edge.",
|
||||
"allOf": [
|
||||
{
|
||||
"$ref": "#/definitions/ent.Location"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"ent.Label": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
@@ -3046,6 +3423,64 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"ent.TemplateField": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"created_at": {
|
||||
"description": "CreatedAt holds the value of the \"created_at\" field.",
|
||||
"type": "string"
|
||||
},
|
||||
"description": {
|
||||
"description": "Description holds the value of the \"description\" field.",
|
||||
"type": "string"
|
||||
},
|
||||
"edges": {
|
||||
"description": "Edges holds the relations/edges for other nodes in the graph.\nThe values are being populated by the TemplateFieldQuery when eager-loading is set.",
|
||||
"allOf": [
|
||||
{
|
||||
"$ref": "#/definitions/ent.TemplateFieldEdges"
|
||||
}
|
||||
]
|
||||
},
|
||||
"id": {
|
||||
"description": "ID of the ent.",
|
||||
"type": "string"
|
||||
},
|
||||
"name": {
|
||||
"description": "Name holds the value of the \"name\" field.",
|
||||
"type": "string"
|
||||
},
|
||||
"text_value": {
|
||||
"description": "TextValue holds the value of the \"text_value\" field.",
|
||||
"type": "string"
|
||||
},
|
||||
"type": {
|
||||
"description": "Type holds the value of the \"type\" field.",
|
||||
"allOf": [
|
||||
{
|
||||
"$ref": "#/definitions/templatefield.Type"
|
||||
}
|
||||
]
|
||||
},
|
||||
"updated_at": {
|
||||
"description": "UpdatedAt holds the value of the \"updated_at\" field.",
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"ent.TemplateFieldEdges": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"item_template": {
|
||||
"description": "ItemTemplate holds the value of the item_template edge.",
|
||||
"allOf": [
|
||||
{
|
||||
"$ref": "#/definitions/ent.ItemTemplate"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"ent.User": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
@@ -3081,6 +3516,14 @@
|
||||
"description": "Name holds the value of the \"name\" field.",
|
||||
"type": "string"
|
||||
},
|
||||
"oidc_issuer": {
|
||||
"description": "OidcIssuer holds the value of the \"oidc_issuer\" field.",
|
||||
"type": "string"
|
||||
},
|
||||
"oidc_subject": {
|
||||
"description": "OidcSubject holds the value of the \"oidc_subject\" field.",
|
||||
"type": "string"
|
||||
},
|
||||
"role": {
|
||||
"description": "Role holds the value of the \"role\" field.",
|
||||
"allOf": [
|
||||
@@ -3581,6 +4024,280 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"repo.ItemTemplateCreate": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"name"
|
||||
],
|
||||
"properties": {
|
||||
"defaultDescription": {
|
||||
"type": "string",
|
||||
"maxLength": 1000,
|
||||
"x-nullable": true
|
||||
},
|
||||
"defaultInsured": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"defaultLabelIds": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
},
|
||||
"x-nullable": true
|
||||
},
|
||||
"defaultLifetimeWarranty": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"defaultLocationId": {
|
||||
"description": "Default location and labels",
|
||||
"type": "string",
|
||||
"x-nullable": true
|
||||
},
|
||||
"defaultManufacturer": {
|
||||
"type": "string",
|
||||
"maxLength": 255,
|
||||
"x-nullable": true
|
||||
},
|
||||
"defaultModelNumber": {
|
||||
"type": "string",
|
||||
"maxLength": 255,
|
||||
"x-nullable": true
|
||||
},
|
||||
"defaultName": {
|
||||
"type": "string",
|
||||
"maxLength": 255,
|
||||
"x-nullable": true
|
||||
},
|
||||
"defaultQuantity": {
|
||||
"description": "Default values for items",
|
||||
"type": "integer",
|
||||
"x-nullable": true
|
||||
},
|
||||
"defaultWarrantyDetails": {
|
||||
"type": "string",
|
||||
"maxLength": 1000,
|
||||
"x-nullable": true
|
||||
},
|
||||
"description": {
|
||||
"type": "string",
|
||||
"maxLength": 1000
|
||||
},
|
||||
"fields": {
|
||||
"description": "Custom fields",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/definitions/repo.TemplateField"
|
||||
}
|
||||
},
|
||||
"includePurchaseFields": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"includeSoldFields": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"includeWarrantyFields": {
|
||||
"description": "Metadata flags",
|
||||
"type": "boolean"
|
||||
},
|
||||
"name": {
|
||||
"type": "string",
|
||||
"maxLength": 255,
|
||||
"minLength": 1
|
||||
},
|
||||
"notes": {
|
||||
"type": "string",
|
||||
"maxLength": 1000
|
||||
}
|
||||
}
|
||||
},
|
||||
"repo.ItemTemplateOut": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"createdAt": {
|
||||
"type": "string"
|
||||
},
|
||||
"defaultDescription": {
|
||||
"type": "string"
|
||||
},
|
||||
"defaultInsured": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"defaultLabels": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/definitions/repo.TemplateLabelSummary"
|
||||
}
|
||||
},
|
||||
"defaultLifetimeWarranty": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"defaultLocation": {
|
||||
"description": "Default location and labels",
|
||||
"allOf": [
|
||||
{
|
||||
"$ref": "#/definitions/repo.TemplateLocationSummary"
|
||||
}
|
||||
]
|
||||
},
|
||||
"defaultManufacturer": {
|
||||
"type": "string"
|
||||
},
|
||||
"defaultModelNumber": {
|
||||
"type": "string"
|
||||
},
|
||||
"defaultName": {
|
||||
"type": "string"
|
||||
},
|
||||
"defaultQuantity": {
|
||||
"description": "Default values for items",
|
||||
"type": "integer"
|
||||
},
|
||||
"defaultWarrantyDetails": {
|
||||
"type": "string"
|
||||
},
|
||||
"description": {
|
||||
"type": "string"
|
||||
},
|
||||
"fields": {
|
||||
"description": "Custom fields",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/definitions/repo.TemplateField"
|
||||
}
|
||||
},
|
||||
"id": {
|
||||
"type": "string"
|
||||
},
|
||||
"includePurchaseFields": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"includeSoldFields": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"includeWarrantyFields": {
|
||||
"description": "Metadata flags",
|
||||
"type": "boolean"
|
||||
},
|
||||
"name": {
|
||||
"type": "string"
|
||||
},
|
||||
"notes": {
|
||||
"type": "string"
|
||||
},
|
||||
"updatedAt": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"repo.ItemTemplateSummary": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"createdAt": {
|
||||
"type": "string"
|
||||
},
|
||||
"description": {
|
||||
"type": "string"
|
||||
},
|
||||
"id": {
|
||||
"type": "string"
|
||||
},
|
||||
"name": {
|
||||
"type": "string"
|
||||
},
|
||||
"updatedAt": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"repo.ItemTemplateUpdate": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"name"
|
||||
],
|
||||
"properties": {
|
||||
"defaultDescription": {
|
||||
"type": "string",
|
||||
"maxLength": 1000,
|
||||
"x-nullable": true
|
||||
},
|
||||
"defaultInsured": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"defaultLabelIds": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
},
|
||||
"x-nullable": true
|
||||
},
|
||||
"defaultLifetimeWarranty": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"defaultLocationId": {
|
||||
"description": "Default location and labels",
|
||||
"type": "string",
|
||||
"x-nullable": true
|
||||
},
|
||||
"defaultManufacturer": {
|
||||
"type": "string",
|
||||
"maxLength": 255,
|
||||
"x-nullable": true
|
||||
},
|
||||
"defaultModelNumber": {
|
||||
"type": "string",
|
||||
"maxLength": 255,
|
||||
"x-nullable": true
|
||||
},
|
||||
"defaultName": {
|
||||
"type": "string",
|
||||
"maxLength": 255,
|
||||
"x-nullable": true
|
||||
},
|
||||
"defaultQuantity": {
|
||||
"description": "Default values for items",
|
||||
"type": "integer",
|
||||
"x-nullable": true
|
||||
},
|
||||
"defaultWarrantyDetails": {
|
||||
"type": "string",
|
||||
"maxLength": 1000,
|
||||
"x-nullable": true
|
||||
},
|
||||
"description": {
|
||||
"type": "string",
|
||||
"maxLength": 1000
|
||||
},
|
||||
"fields": {
|
||||
"description": "Custom fields",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/definitions/repo.TemplateField"
|
||||
}
|
||||
},
|
||||
"id": {
|
||||
"type": "string"
|
||||
},
|
||||
"includePurchaseFields": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"includeSoldFields": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"includeWarrantyFields": {
|
||||
"description": "Metadata flags",
|
||||
"type": "boolean"
|
||||
},
|
||||
"name": {
|
||||
"type": "string",
|
||||
"maxLength": 255,
|
||||
"minLength": 1
|
||||
},
|
||||
"notes": {
|
||||
"type": "string",
|
||||
"maxLength": 1000
|
||||
}
|
||||
}
|
||||
},
|
||||
"repo.ItemType": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
@@ -4076,6 +4793,45 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"repo.TemplateField": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"id": {
|
||||
"type": "string"
|
||||
},
|
||||
"name": {
|
||||
"type": "string"
|
||||
},
|
||||
"textValue": {
|
||||
"type": "string"
|
||||
},
|
||||
"type": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"repo.TemplateLabelSummary": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"id": {
|
||||
"type": "string"
|
||||
},
|
||||
"name": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"repo.TemplateLocationSummary": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"id": {
|
||||
"type": "string"
|
||||
},
|
||||
"name": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"repo.TotalsByOrganizer": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
@@ -4133,6 +4889,12 @@
|
||||
},
|
||||
"name": {
|
||||
"type": "string"
|
||||
},
|
||||
"oidcIssuer": {
|
||||
"type": "string"
|
||||
},
|
||||
"oidcSubject": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -4212,6 +4974,15 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"templatefield.Type": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"text"
|
||||
],
|
||||
"x-enum-varnames": [
|
||||
"TypeText"
|
||||
]
|
||||
},
|
||||
"user.Role": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
@@ -4249,6 +5020,9 @@
|
||||
"message": {
|
||||
"type": "string"
|
||||
},
|
||||
"oidc": {
|
||||
"$ref": "#/definitions/v1.OIDCStatus"
|
||||
},
|
||||
"title": {
|
||||
"type": "string"
|
||||
},
|
||||
@@ -4331,6 +5105,36 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"v1.ItemTemplateCreateItemRequest": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"locationId",
|
||||
"name"
|
||||
],
|
||||
"properties": {
|
||||
"description": {
|
||||
"type": "string",
|
||||
"maxLength": 1000
|
||||
},
|
||||
"labelIds": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"locationId": {
|
||||
"type": "string"
|
||||
},
|
||||
"name": {
|
||||
"type": "string",
|
||||
"maxLength": 255,
|
||||
"minLength": 1
|
||||
},
|
||||
"quantity": {
|
||||
"type": "integer"
|
||||
}
|
||||
}
|
||||
},
|
||||
"v1.LoginForm": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
@@ -4347,6 +5151,23 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"v1.OIDCStatus": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"allowLocal": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"autoRedirect": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"buttonText": {
|
||||
"type": "string"
|
||||
},
|
||||
"enabled": {
|
||||
"type": "boolean"
|
||||
}
|
||||
}
|
||||
},
|
||||
"v1.TokenResponse": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
|
||||
@@ -179,6 +179,11 @@ definitions:
|
||||
items:
|
||||
$ref: '#/definitions/ent.GroupInvitationToken'
|
||||
type: array
|
||||
item_templates:
|
||||
description: ItemTemplates holds the value of the item_templates edge.
|
||||
items:
|
||||
$ref: '#/definitions/ent.ItemTemplate'
|
||||
type: array
|
||||
items:
|
||||
description: Items holds the value of the items edge.
|
||||
items:
|
||||
@@ -414,6 +419,92 @@ definitions:
|
||||
- $ref: '#/definitions/ent.Item'
|
||||
description: Item holds the value of the item edge.
|
||||
type: object
|
||||
ent.ItemTemplate:
|
||||
properties:
|
||||
created_at:
|
||||
description: CreatedAt holds the value of the "created_at" field.
|
||||
type: string
|
||||
default_description:
|
||||
description: Default description for items created from this template
|
||||
type: string
|
||||
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: array
|
||||
default_lifetime_warranty:
|
||||
description: DefaultLifetimeWarranty holds the value of the "default_lifetime_warranty"
|
||||
field.
|
||||
type: boolean
|
||||
default_manufacturer:
|
||||
description: DefaultManufacturer holds the value of the "default_manufacturer"
|
||||
field.
|
||||
type: string
|
||||
default_model_number:
|
||||
description: Default model number for items created from this template
|
||||
type: string
|
||||
default_name:
|
||||
description: Default name template for items (can use placeholders)
|
||||
type: string
|
||||
default_quantity:
|
||||
description: DefaultQuantity holds the value of the "default_quantity" field.
|
||||
type: integer
|
||||
default_warranty_details:
|
||||
description: DefaultWarrantyDetails holds the value of the "default_warranty_details"
|
||||
field.
|
||||
type: string
|
||||
description:
|
||||
description: Description holds the value of the "description" field.
|
||||
type: string
|
||||
edges:
|
||||
allOf:
|
||||
- $ref: '#/definitions/ent.ItemTemplateEdges'
|
||||
description: |-
|
||||
Edges holds the relations/edges for other nodes in the graph.
|
||||
The values are being populated by the ItemTemplateQuery when eager-loading is set.
|
||||
id:
|
||||
description: ID of the ent.
|
||||
type: string
|
||||
include_purchase_fields:
|
||||
description: Whether to include purchase fields in items created from this
|
||||
template
|
||||
type: boolean
|
||||
include_sold_fields:
|
||||
description: Whether to include sold fields in items created from this template
|
||||
type: boolean
|
||||
include_warranty_fields:
|
||||
description: Whether to include warranty fields in items created from this
|
||||
template
|
||||
type: boolean
|
||||
name:
|
||||
description: Name holds the value of the "name" field.
|
||||
type: string
|
||||
notes:
|
||||
description: Notes holds the value of the "notes" field.
|
||||
type: string
|
||||
updated_at:
|
||||
description: UpdatedAt holds the value of the "updated_at" field.
|
||||
type: string
|
||||
type: object
|
||||
ent.ItemTemplateEdges:
|
||||
properties:
|
||||
fields:
|
||||
description: Fields holds the value of the fields edge.
|
||||
items:
|
||||
$ref: '#/definitions/ent.TemplateField'
|
||||
type: array
|
||||
group:
|
||||
allOf:
|
||||
- $ref: '#/definitions/ent.Group'
|
||||
description: Group holds the value of the group edge.
|
||||
location:
|
||||
allOf:
|
||||
- $ref: '#/definitions/ent.Location'
|
||||
description: Location holds the value of the location edge.
|
||||
type: object
|
||||
ent.Label:
|
||||
properties:
|
||||
color:
|
||||
@@ -582,6 +673,44 @@ definitions:
|
||||
- $ref: '#/definitions/ent.User'
|
||||
description: User holds the value of the user edge.
|
||||
type: object
|
||||
ent.TemplateField:
|
||||
properties:
|
||||
created_at:
|
||||
description: CreatedAt holds the value of the "created_at" field.
|
||||
type: string
|
||||
description:
|
||||
description: Description holds the value of the "description" field.
|
||||
type: string
|
||||
edges:
|
||||
allOf:
|
||||
- $ref: '#/definitions/ent.TemplateFieldEdges'
|
||||
description: |-
|
||||
Edges holds the relations/edges for other nodes in the graph.
|
||||
The values are being populated by the TemplateFieldQuery 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
|
||||
text_value:
|
||||
description: TextValue holds the value of the "text_value" field.
|
||||
type: string
|
||||
type:
|
||||
allOf:
|
||||
- $ref: '#/definitions/templatefield.Type'
|
||||
description: Type holds the value of the "type" field.
|
||||
updated_at:
|
||||
description: UpdatedAt holds the value of the "updated_at" field.
|
||||
type: string
|
||||
type: object
|
||||
ent.TemplateFieldEdges:
|
||||
properties:
|
||||
item_template:
|
||||
allOf:
|
||||
- $ref: '#/definitions/ent.ItemTemplate'
|
||||
description: ItemTemplate holds the value of the item_template edge.
|
||||
type: object
|
||||
ent.User:
|
||||
properties:
|
||||
activated_on:
|
||||
@@ -608,6 +737,12 @@ definitions:
|
||||
name:
|
||||
description: Name holds the value of the "name" field.
|
||||
type: string
|
||||
oidc_issuer:
|
||||
description: OidcIssuer holds the value of the "oidc_issuer" field.
|
||||
type: string
|
||||
oidc_subject:
|
||||
description: OidcSubject holds the value of the "oidc_subject" field.
|
||||
type: string
|
||||
role:
|
||||
allOf:
|
||||
- $ref: '#/definitions/user.Role'
|
||||
@@ -944,6 +1079,201 @@ definitions:
|
||||
updatedAt:
|
||||
type: string
|
||||
type: object
|
||||
repo.ItemTemplateCreate:
|
||||
properties:
|
||||
defaultDescription:
|
||||
maxLength: 1000
|
||||
type: string
|
||||
x-nullable: true
|
||||
defaultInsured:
|
||||
type: boolean
|
||||
defaultLabelIds:
|
||||
items:
|
||||
type: string
|
||||
type: array
|
||||
x-nullable: true
|
||||
defaultLifetimeWarranty:
|
||||
type: boolean
|
||||
defaultLocationId:
|
||||
description: Default location and labels
|
||||
type: string
|
||||
x-nullable: true
|
||||
defaultManufacturer:
|
||||
maxLength: 255
|
||||
type: string
|
||||
x-nullable: true
|
||||
defaultModelNumber:
|
||||
maxLength: 255
|
||||
type: string
|
||||
x-nullable: true
|
||||
defaultName:
|
||||
maxLength: 255
|
||||
type: string
|
||||
x-nullable: true
|
||||
defaultQuantity:
|
||||
description: Default values for items
|
||||
type: integer
|
||||
x-nullable: true
|
||||
defaultWarrantyDetails:
|
||||
maxLength: 1000
|
||||
type: string
|
||||
x-nullable: true
|
||||
description:
|
||||
maxLength: 1000
|
||||
type: string
|
||||
fields:
|
||||
description: Custom fields
|
||||
items:
|
||||
$ref: '#/definitions/repo.TemplateField'
|
||||
type: array
|
||||
includePurchaseFields:
|
||||
type: boolean
|
||||
includeSoldFields:
|
||||
type: boolean
|
||||
includeWarrantyFields:
|
||||
description: Metadata flags
|
||||
type: boolean
|
||||
name:
|
||||
maxLength: 255
|
||||
minLength: 1
|
||||
type: string
|
||||
notes:
|
||||
maxLength: 1000
|
||||
type: string
|
||||
required:
|
||||
- name
|
||||
type: object
|
||||
repo.ItemTemplateOut:
|
||||
properties:
|
||||
createdAt:
|
||||
type: string
|
||||
defaultDescription:
|
||||
type: string
|
||||
defaultInsured:
|
||||
type: boolean
|
||||
defaultLabels:
|
||||
items:
|
||||
$ref: '#/definitions/repo.TemplateLabelSummary'
|
||||
type: array
|
||||
defaultLifetimeWarranty:
|
||||
type: boolean
|
||||
defaultLocation:
|
||||
allOf:
|
||||
- $ref: '#/definitions/repo.TemplateLocationSummary'
|
||||
description: Default location and labels
|
||||
defaultManufacturer:
|
||||
type: string
|
||||
defaultModelNumber:
|
||||
type: string
|
||||
defaultName:
|
||||
type: string
|
||||
defaultQuantity:
|
||||
description: Default values for items
|
||||
type: integer
|
||||
defaultWarrantyDetails:
|
||||
type: string
|
||||
description:
|
||||
type: string
|
||||
fields:
|
||||
description: Custom fields
|
||||
items:
|
||||
$ref: '#/definitions/repo.TemplateField'
|
||||
type: array
|
||||
id:
|
||||
type: string
|
||||
includePurchaseFields:
|
||||
type: boolean
|
||||
includeSoldFields:
|
||||
type: boolean
|
||||
includeWarrantyFields:
|
||||
description: Metadata flags
|
||||
type: boolean
|
||||
name:
|
||||
type: string
|
||||
notes:
|
||||
type: string
|
||||
updatedAt:
|
||||
type: string
|
||||
type: object
|
||||
repo.ItemTemplateSummary:
|
||||
properties:
|
||||
createdAt:
|
||||
type: string
|
||||
description:
|
||||
type: string
|
||||
id:
|
||||
type: string
|
||||
name:
|
||||
type: string
|
||||
updatedAt:
|
||||
type: string
|
||||
type: object
|
||||
repo.ItemTemplateUpdate:
|
||||
properties:
|
||||
defaultDescription:
|
||||
maxLength: 1000
|
||||
type: string
|
||||
x-nullable: true
|
||||
defaultInsured:
|
||||
type: boolean
|
||||
defaultLabelIds:
|
||||
items:
|
||||
type: string
|
||||
type: array
|
||||
x-nullable: true
|
||||
defaultLifetimeWarranty:
|
||||
type: boolean
|
||||
defaultLocationId:
|
||||
description: Default location and labels
|
||||
type: string
|
||||
x-nullable: true
|
||||
defaultManufacturer:
|
||||
maxLength: 255
|
||||
type: string
|
||||
x-nullable: true
|
||||
defaultModelNumber:
|
||||
maxLength: 255
|
||||
type: string
|
||||
x-nullable: true
|
||||
defaultName:
|
||||
maxLength: 255
|
||||
type: string
|
||||
x-nullable: true
|
||||
defaultQuantity:
|
||||
description: Default values for items
|
||||
type: integer
|
||||
x-nullable: true
|
||||
defaultWarrantyDetails:
|
||||
maxLength: 1000
|
||||
type: string
|
||||
x-nullable: true
|
||||
description:
|
||||
maxLength: 1000
|
||||
type: string
|
||||
fields:
|
||||
description: Custom fields
|
||||
items:
|
||||
$ref: '#/definitions/repo.TemplateField'
|
||||
type: array
|
||||
id:
|
||||
type: string
|
||||
includePurchaseFields:
|
||||
type: boolean
|
||||
includeSoldFields:
|
||||
type: boolean
|
||||
includeWarrantyFields:
|
||||
description: Metadata flags
|
||||
type: boolean
|
||||
name:
|
||||
maxLength: 255
|
||||
minLength: 1
|
||||
type: string
|
||||
notes:
|
||||
maxLength: 1000
|
||||
type: string
|
||||
required:
|
||||
- name
|
||||
type: object
|
||||
repo.ItemType:
|
||||
enum:
|
||||
- location
|
||||
@@ -1281,6 +1611,31 @@ definitions:
|
||||
total:
|
||||
type: integer
|
||||
type: object
|
||||
repo.TemplateField:
|
||||
properties:
|
||||
id:
|
||||
type: string
|
||||
name:
|
||||
type: string
|
||||
textValue:
|
||||
type: string
|
||||
type:
|
||||
type: string
|
||||
type: object
|
||||
repo.TemplateLabelSummary:
|
||||
properties:
|
||||
id:
|
||||
type: string
|
||||
name:
|
||||
type: string
|
||||
type: object
|
||||
repo.TemplateLocationSummary:
|
||||
properties:
|
||||
id:
|
||||
type: string
|
||||
name:
|
||||
type: string
|
||||
type: object
|
||||
repo.TotalsByOrganizer:
|
||||
properties:
|
||||
id:
|
||||
@@ -1319,6 +1674,10 @@ definitions:
|
||||
type: boolean
|
||||
name:
|
||||
type: string
|
||||
oidcIssuer:
|
||||
type: string
|
||||
oidcSubject:
|
||||
type: string
|
||||
type: object
|
||||
repo.UserUpdate:
|
||||
properties:
|
||||
@@ -1369,6 +1728,12 @@ definitions:
|
||||
token:
|
||||
type: string
|
||||
type: object
|
||||
templatefield.Type:
|
||||
enum:
|
||||
- text
|
||||
type: string
|
||||
x-enum-varnames:
|
||||
- TypeText
|
||||
user.Role:
|
||||
enum:
|
||||
- user
|
||||
@@ -1395,6 +1760,8 @@ definitions:
|
||||
$ref: '#/definitions/services.Latest'
|
||||
message:
|
||||
type: string
|
||||
oidc:
|
||||
$ref: '#/definitions/v1.OIDCStatus'
|
||||
title:
|
||||
type: string
|
||||
versions:
|
||||
@@ -1448,6 +1815,27 @@ definitions:
|
||||
token:
|
||||
type: string
|
||||
type: object
|
||||
v1.ItemTemplateCreateItemRequest:
|
||||
properties:
|
||||
description:
|
||||
maxLength: 1000
|
||||
type: string
|
||||
labelIds:
|
||||
items:
|
||||
type: string
|
||||
type: array
|
||||
locationId:
|
||||
type: string
|
||||
name:
|
||||
maxLength: 255
|
||||
minLength: 1
|
||||
type: string
|
||||
quantity:
|
||||
type: integer
|
||||
required:
|
||||
- locationId
|
||||
- name
|
||||
type: object
|
||||
v1.LoginForm:
|
||||
properties:
|
||||
password:
|
||||
@@ -1459,6 +1847,17 @@ definitions:
|
||||
example: admin@admin.com
|
||||
type: string
|
||||
type: object
|
||||
v1.OIDCStatus:
|
||||
properties:
|
||||
allowLocal:
|
||||
type: boolean
|
||||
autoRedirect:
|
||||
type: boolean
|
||||
buttonText:
|
||||
type: string
|
||||
enabled:
|
||||
type: boolean
|
||||
type: object
|
||||
v1.TokenResponse:
|
||||
properties:
|
||||
attachmentToken:
|
||||
@@ -2679,6 +3078,130 @@ paths:
|
||||
summary: Application Info
|
||||
tags:
|
||||
- Base
|
||||
/v1/templates:
|
||||
get:
|
||||
produces:
|
||||
- application/json
|
||||
responses:
|
||||
"200":
|
||||
description: OK
|
||||
schema:
|
||||
items:
|
||||
$ref: '#/definitions/repo.ItemTemplateSummary'
|
||||
type: array
|
||||
security:
|
||||
- Bearer: []
|
||||
summary: Get All Item Templates
|
||||
tags:
|
||||
- Item Templates
|
||||
post:
|
||||
parameters:
|
||||
- description: Template Data
|
||||
in: body
|
||||
name: payload
|
||||
required: true
|
||||
schema:
|
||||
$ref: '#/definitions/repo.ItemTemplateCreate'
|
||||
produces:
|
||||
- application/json
|
||||
responses:
|
||||
"201":
|
||||
description: Created
|
||||
schema:
|
||||
$ref: '#/definitions/repo.ItemTemplateOut'
|
||||
security:
|
||||
- Bearer: []
|
||||
summary: Create Item Template
|
||||
tags:
|
||||
- Item Templates
|
||||
/v1/templates/{id}:
|
||||
delete:
|
||||
parameters:
|
||||
- description: Template ID
|
||||
in: path
|
||||
name: id
|
||||
required: true
|
||||
type: string
|
||||
produces:
|
||||
- application/json
|
||||
responses:
|
||||
"204":
|
||||
description: No Content
|
||||
security:
|
||||
- Bearer: []
|
||||
summary: Delete Item Template
|
||||
tags:
|
||||
- Item Templates
|
||||
get:
|
||||
parameters:
|
||||
- description: Template ID
|
||||
in: path
|
||||
name: id
|
||||
required: true
|
||||
type: string
|
||||
produces:
|
||||
- application/json
|
||||
responses:
|
||||
"200":
|
||||
description: OK
|
||||
schema:
|
||||
$ref: '#/definitions/repo.ItemTemplateOut'
|
||||
security:
|
||||
- Bearer: []
|
||||
summary: Get Item Template
|
||||
tags:
|
||||
- Item Templates
|
||||
put:
|
||||
parameters:
|
||||
- description: Template ID
|
||||
in: path
|
||||
name: id
|
||||
required: true
|
||||
type: string
|
||||
- description: Template Data
|
||||
in: body
|
||||
name: payload
|
||||
required: true
|
||||
schema:
|
||||
$ref: '#/definitions/repo.ItemTemplateUpdate'
|
||||
produces:
|
||||
- application/json
|
||||
responses:
|
||||
"200":
|
||||
description: OK
|
||||
schema:
|
||||
$ref: '#/definitions/repo.ItemTemplateOut'
|
||||
security:
|
||||
- Bearer: []
|
||||
summary: Update Item Template
|
||||
tags:
|
||||
- Item Templates
|
||||
/v1/templates/{id}/create-item:
|
||||
post:
|
||||
parameters:
|
||||
- description: Template ID
|
||||
in: path
|
||||
name: id
|
||||
required: true
|
||||
type: string
|
||||
- description: Item Data
|
||||
in: body
|
||||
name: payload
|
||||
required: true
|
||||
schema:
|
||||
$ref: '#/definitions/v1.ItemTemplateCreateItemRequest'
|
||||
produces:
|
||||
- application/json
|
||||
responses:
|
||||
"201":
|
||||
description: Created
|
||||
schema:
|
||||
$ref: '#/definitions/repo.ItemOut'
|
||||
security:
|
||||
- Bearer: []
|
||||
summary: Create Item from Template
|
||||
tags:
|
||||
- Item Templates
|
||||
/v1/users/change-password:
|
||||
put:
|
||||
parameters:
|
||||
@@ -2722,6 +3245,35 @@ paths:
|
||||
summary: User Login
|
||||
tags:
|
||||
- Authentication
|
||||
/v1/users/login/oidc:
|
||||
get:
|
||||
produces:
|
||||
- application/json
|
||||
responses:
|
||||
"302":
|
||||
description: Found
|
||||
summary: OIDC Login Initiation
|
||||
tags:
|
||||
- Authentication
|
||||
/v1/users/login/oidc/callback:
|
||||
get:
|
||||
parameters:
|
||||
- description: Authorization code
|
||||
in: query
|
||||
name: code
|
||||
required: true
|
||||
type: string
|
||||
- description: State parameter
|
||||
in: query
|
||||
name: state
|
||||
required: true
|
||||
type: string
|
||||
responses:
|
||||
"302":
|
||||
description: Found
|
||||
summary: OIDC Callback Handler
|
||||
tags:
|
||||
- Authentication
|
||||
/v1/users/logout:
|
||||
post:
|
||||
responses:
|
||||
@@ -2759,6 +3311,10 @@ paths:
|
||||
responses:
|
||||
"204":
|
||||
description: No Content
|
||||
"403":
|
||||
description: Local login is not enabled
|
||||
schema:
|
||||
type: string
|
||||
summary: Register New User
|
||||
tags:
|
||||
- User
|
||||
|
||||
Reference in New Issue
Block a user