{ "swagger": "2.0", "info": { "description": "High performance Go API for AceExtension", "title": "AceExtension API", "contact": {}, "version": "1.0" }, "host": "localhost:4000", "basePath": "/api", "paths": { "/api/v1/accounting/accounts": { "get": { "description": "List all accounts", "produces": [ "application/json" ], "tags": [ "Accounting" ], "summary": "List Accounts", "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "$ref": "#/definitions/domain.Account" } } }, "500": { "description": "Internal Server Error", "schema": { "type": "object", "additionalProperties": { "type": "string" } } } } }, "post": { "description": "Create a new account", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Accounting" ], "summary": "Create Account", "parameters": [ { "description": "Account Request", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/dto.CreateAccountRequest" } } ], "responses": { "201": { "description": "Created", "schema": { "$ref": "#/definitions/domain.Account" } }, "400": { "description": "Bad Request", "schema": { "type": "object", "additionalProperties": { "type": "string" } } }, "500": { "description": "Internal Server Error", "schema": { "type": "object", "additionalProperties": { "type": "string" } } } } } }, "/api/v1/accounting/accounts/{id}": { "get": { "description": "Get account by ID", "produces": [ "application/json" ], "tags": [ "Accounting" ], "summary": "Get Account", "parameters": [ { "type": "string", "description": "Account ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/domain.Account" } }, "404": { "description": "Not Found", "schema": { "type": "object", "additionalProperties": { "type": "string" } } }, "500": { "description": "Internal Server Error", "schema": { "type": "object", "additionalProperties": { "type": "string" } } } } }, "put": { "description": "Update account details", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Accounting" ], "summary": "Update Account", "parameters": [ { "type": "string", "description": "Account ID", "name": "id", "in": "path", "required": true }, { "description": "Update Request", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/dto.UpdateAccountRequest" } } ], "responses": { "200": { "description": "OK", "schema": { "type": "object", "additionalProperties": { "type": "string" } } }, "400": { "description": "Bad Request", "schema": { "type": "object", "additionalProperties": { "type": "string" } } }, "500": { "description": "Internal Server Error", "schema": { "type": "object", "additionalProperties": { "type": "string" } } } } } }, "/api/v1/accounting/journals": { "get": { "description": "List journal entries", "produces": [ "application/json" ], "tags": [ "Accounting" ], "summary": "List Journal Entries", "parameters": [ { "type": "string", "description": "Fiscal Year ID", "name": "fiscalYearId", "in": "query", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "$ref": "#/definitions/domain.JournalEntry" } } }, "400": { "description": "Bad Request", "schema": { "type": "object", "additionalProperties": { "type": "string" } } }, "500": { "description": "Internal Server Error", "schema": { "type": "object", "additionalProperties": { "type": "string" } } } } }, "post": { "description": "Create a new manual journal entry", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Accounting" ], "summary": "Create Journal Entry", "parameters": [ { "description": "Journal Entry Request", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/dto.CreateJournalEntryRequest" } } ], "responses": { "201": { "description": "Created", "schema": { "$ref": "#/definitions/domain.JournalEntry" } }, "400": { "description": "Bad Request", "schema": { "type": "object", "additionalProperties": { "type": "string" } } }, "500": { "description": "Internal Server Error", "schema": { "type": "object", "additionalProperties": { "type": "string" } } } } } }, "/api/v1/accounting/journals/{id}": { "get": { "description": "Get journal entry by ID", "produces": [ "application/json" ], "tags": [ "Accounting" ], "summary": "Get Journal Entry", "parameters": [ { "type": "string", "description": "Journal Entry ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/domain.JournalEntry" } }, "404": { "description": "Not Found", "schema": { "type": "object", "additionalProperties": { "type": "string" } } }, "500": { "description": "Internal Server Error", "schema": { "type": "object", "additionalProperties": { "type": "string" } } } } } }, "/api/v1/accounting/journals/{id}/post": { "post": { "description": "Post/Finalize a journal entry", "produces": [ "application/json" ], "tags": [ "Accounting" ], "summary": "Post Journal Entry", "parameters": [ { "type": "string", "description": "Journal Entry ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "type": "object", "additionalProperties": { "type": "string" } } }, "400": { "description": "Bad Request", "schema": { "type": "object", "additionalProperties": { "type": "string" } } }, "500": { "description": "Internal Server Error", "schema": { "type": "object", "additionalProperties": { "type": "string" } } } } } }, "/api/v1/accounting/reports/balance-sheet": { "get": { "description": "Get balance sheet as of a specific date", "produces": [ "application/json" ], "tags": [ "Accounting" ], "summary": "Get Balance Sheet", "parameters": [ { "type": "string", "description": "As Of Date (YYYY-MM-DD)", "name": "date", "in": "query", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/dto.BalanceSheetResponse" } }, "400": { "description": "Bad Request", "schema": { "type": "object", "additionalProperties": { "type": "string" } } }, "500": { "description": "Internal Server Error", "schema": { "type": "object", "additionalProperties": { "type": "string" } } } } } }, "/api/v1/accounting/reports/day-book": { "get": { "description": "Get all transactions for a specific date", "produces": [ "application/json" ], "tags": [ "Accounting" ], "summary": "Get Day Book", "parameters": [ { "type": "string", "description": "Date (YYYY-MM-DD)", "name": "date", "in": "query", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/dto.DayBookResponse" } }, "400": { "description": "Bad Request", "schema": { "type": "object", "additionalProperties": { "type": "string" } } }, "500": { "description": "Internal Server Error", "schema": { "type": "object", "additionalProperties": { "type": "string" } } } } } }, "/api/v1/accounting/reports/general-ledger": { "get": { "description": "Get general ledger entries for an account within a date range", "produces": [ "application/json" ], "tags": [ "Accounting" ], "summary": "Get General Ledger", "parameters": [ { "type": "string", "description": "Account ID", "name": "accountId", "in": "query", "required": true }, { "type": "string", "description": "Start Date (YYYY-MM-DD)", "name": "startDate", "in": "query", "required": true }, { "type": "string", "description": "End Date (YYYY-MM-DD)", "name": "endDate", "in": "query", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "$ref": "#/definitions/domain.LedgerEntry" } } }, "400": { "description": "Bad Request", "schema": { "type": "object", "additionalProperties": { "type": "string" } } }, "500": { "description": "Internal Server Error", "schema": { "type": "object", "additionalProperties": { "type": "string" } } } } } }, "/api/v1/accounting/reports/profit-loss": { "get": { "description": "Get P\u0026L for a date range", "produces": [ "application/json" ], "tags": [ "Accounting" ], "summary": "Get Profit and Loss", "parameters": [ { "type": "string", "description": "Start Date (YYYY-MM-DD)", "name": "startDate", "in": "query", "required": true }, { "type": "string", "description": "End Date (YYYY-MM-DD)", "name": "endDate", "in": "query", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/dto.ProfitLossResponse" } }, "400": { "description": "Bad Request", "schema": { "type": "object", "additionalProperties": { "type": "string" } } }, "500": { "description": "Internal Server Error", "schema": { "type": "object", "additionalProperties": { "type": "string" } } } } } }, "/api/v1/accounting/reports/trial-balance": { "get": { "description": "Get full trial balance", "produces": [ "application/json" ], "tags": [ "Accounting" ], "summary": "Get Trial Balance", "parameters": [ { "type": "string", "description": "Fiscal Year ID", "name": "fiscalYearId", "in": "query", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/dto.TrialBalanceResponse" } }, "400": { "description": "Bad Request", "schema": { "type": "object", "additionalProperties": { "type": "string" } } }, "500": { "description": "Internal Server Error", "schema": { "type": "object", "additionalProperties": { "type": "string" } } } } } }, "/api/v1/categories": { "get": { "security": [ { "BearerAuth": [] } ], "description": "Get all categories for the tenant", "produces": [ "application/json" ], "tags": [ "categories" ], "summary": "List categories", "parameters": [ { "type": "integer", "default": 10, "description": "Limit", "name": "limit", "in": "query" }, { "type": "integer", "default": 0, "description": "Offset", "name": "offset", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "$ref": "#/definitions/handler.CategoryResponse" } } }, "401": { "description": "Unauthorized", "schema": { "type": "object", "additionalProperties": { "type": "string" } } } } }, "post": { "security": [ { "BearerAuth": [] } ], "description": "Create a new product category", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "categories" ], "summary": "Create a new category", "parameters": [ { "description": "Category data", "name": "category", "in": "body", "required": true, "schema": { "$ref": "#/definitions/handler.CreateCategoryRequest" } } ], "responses": { "201": { "description": "Created", "schema": { "$ref": "#/definitions/handler.CategoryResponse" } }, "400": { "description": "Bad Request", "schema": { "type": "object", "additionalProperties": { "type": "string" } } }, "401": { "description": "Unauthorized", "schema": { "type": "object", "additionalProperties": { "type": "string" } } } } } }, "/api/v1/categories/search": { "get": { "security": [ { "BearerAuth": [] } ], "description": "Search categories by name or description", "produces": [ "application/json" ], "tags": [ "categories" ], "summary": "Search categories", "parameters": [ { "type": "string", "description": "Search query", "name": "q", "in": "query", "required": true }, { "type": "integer", "default": 10, "description": "Limit", "name": "limit", "in": "query" }, { "type": "integer", "default": 0, "description": "Offset", "name": "offset", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "$ref": "#/definitions/handler.CategoryResponse" } } }, "401": { "description": "Unauthorized", "schema": { "type": "object", "additionalProperties": { "type": "string" } } } } } }, "/api/v1/categories/tree": { "get": { "security": [ { "BearerAuth": [] } ], "description": "Get root categories (tree structure)", "produces": [ "application/json" ], "tags": [ "categories" ], "summary": "Get category tree", "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "$ref": "#/definitions/handler.CategoryResponse" } } }, "401": { "description": "Unauthorized", "schema": { "type": "object", "additionalProperties": { "type": "string" } } } } } }, "/api/v1/categories/{id}": { "get": { "security": [ { "BearerAuth": [] } ], "description": "Get a specific category by ID", "produces": [ "application/json" ], "tags": [ "categories" ], "summary": "Get category by ID", "parameters": [ { "type": "string", "description": "Category ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/handler.CategoryResponse" } }, "404": { "description": "Not Found", "schema": { "type": "object", "additionalProperties": { "type": "string" } } } } }, "put": { "security": [ { "BearerAuth": [] } ], "description": "Update an existing category", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "categories" ], "summary": "Update category", "parameters": [ { "type": "string", "description": "Category ID", "name": "id", "in": "path", "required": true }, { "description": "Category data", "name": "category", "in": "body", "required": true, "schema": { "$ref": "#/definitions/handler.UpdateCategoryRequest" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/handler.CategoryResponse" } }, "400": { "description": "Bad Request", "schema": { "type": "object", "additionalProperties": { "type": "string" } } }, "404": { "description": "Not Found", "schema": { "type": "object", "additionalProperties": { "type": "string" } } } } }, "delete": { "security": [ { "BearerAuth": [] } ], "description": "Delete a category", "tags": [ "categories" ], "summary": "Delete category", "parameters": [ { "type": "string", "description": "Category ID", "name": "id", "in": "path", "required": true } ], "responses": { "204": { "description": "No Content" }, "404": { "description": "Not Found", "schema": { "type": "object", "additionalProperties": { "type": "string" } } } } } }, "/api/v1/categories/{id}/children": { "get": { "security": [ { "BearerAuth": [] } ], "description": "Get all child categories of a parent", "produces": [ "application/json" ], "tags": [ "categories" ], "summary": "Get child categories", "parameters": [ { "type": "string", "description": "Parent Category ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "$ref": "#/definitions/handler.CategoryResponse" } } }, "404": { "description": "Not Found", "schema": { "type": "object", "additionalProperties": { "type": "string" } } } } } }, "/api/v1/customers": { "get": { "security": [ { "BearerAuth": [] } ], "description": "Get a paginated list of customers for the current tenant", "produces": [ "application/json" ], "tags": [ "customers" ], "summary": "List customers", "parameters": [ { "type": "integer", "default": 10, "description": "Limit", "name": "limit", "in": "query" }, { "type": "integer", "default": 0, "description": "Offset", "name": "offset", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "$ref": "#/definitions/handler.CustomerResponse" } } }, "400": { "description": "Bad Request", "schema": { "type": "object", "additionalProperties": { "type": "string" } } }, "500": { "description": "Internal Server Error", "schema": { "type": "object", "additionalProperties": { "type": "string" } } } } }, "post": { "security": [ { "BearerAuth": [] } ], "description": "Create a new customer with custom attributes", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "customers" ], "summary": "Create a new customer", "parameters": [ { "description": "Customer data", "name": "customer", "in": "body", "required": true, "schema": { "$ref": "#/definitions/handler.CreateCustomerRequest" } } ], "responses": { "201": { "description": "Created", "schema": { "$ref": "#/definitions/handler.CustomerResponse" } }, "400": { "description": "Bad Request", "schema": { "type": "object", "additionalProperties": { "type": "string" } } }, "500": { "description": "Internal Server Error", "schema": { "type": "object", "additionalProperties": { "type": "string" } } } } } }, "/api/v1/customers/search": { "get": { "security": [ { "BearerAuth": [] } ], "description": "Search customers by name, email, phone, or code", "produces": [ "application/json" ], "tags": [ "customers" ], "summary": "Search customers", "parameters": [ { "type": "string", "description": "Search query", "name": "q", "in": "query", "required": true }, { "type": "integer", "default": 10, "description": "Limit", "name": "limit", "in": "query" }, { "type": "integer", "default": 0, "description": "Offset", "name": "offset", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "$ref": "#/definitions/handler.CustomerResponse" } } }, "400": { "description": "Bad Request", "schema": { "type": "object", "additionalProperties": { "type": "string" } } }, "500": { "description": "Internal Server Error", "schema": { "type": "object", "additionalProperties": { "type": "string" } } } } } }, "/api/v1/customers/{id}": { "get": { "security": [ { "BearerAuth": [] } ], "description": "Get a customer by their ID", "produces": [ "application/json" ], "tags": [ "customers" ], "summary": "Get customer by ID", "parameters": [ { "type": "string", "description": "Customer ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/handler.CustomerResponse" } }, "400": { "description": "Bad Request", "schema": { "type": "object", "additionalProperties": { "type": "string" } } }, "404": { "description": "Not Found", "schema": { "type": "object", "additionalProperties": { "type": "string" } } } } }, "put": { "security": [ { "BearerAuth": [] } ], "description": "Update an existing customer", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "customers" ], "summary": "Update customer", "parameters": [ { "type": "string", "description": "Customer ID", "name": "id", "in": "path", "required": true }, { "description": "Customer data", "name": "customer", "in": "body", "required": true, "schema": { "$ref": "#/definitions/handler.UpdateCustomerRequest" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/handler.CustomerResponse" } }, "400": { "description": "Bad Request", "schema": { "type": "object", "additionalProperties": { "type": "string" } } }, "404": { "description": "Not Found", "schema": { "type": "object", "additionalProperties": { "type": "string" } } }, "500": { "description": "Internal Server Error", "schema": { "type": "object", "additionalProperties": { "type": "string" } } } } }, "delete": { "security": [ { "BearerAuth": [] } ], "description": "Delete a customer by ID", "produces": [ "application/json" ], "tags": [ "customers" ], "summary": "Delete customer", "parameters": [ { "type": "string", "description": "Customer ID", "name": "id", "in": "path", "required": true } ], "responses": { "204": { "description": "No Content" }, "400": { "description": "Bad Request", "schema": { "type": "object", "additionalProperties": { "type": "string" } } }, "404": { "description": "Not Found", "schema": { "type": "object", "additionalProperties": { "type": "string" } } }, "500": { "description": "Internal Server Error", "schema": { "type": "object", "additionalProperties": { "type": "string" } } } } } }, "/api/v1/inventory/adjustments": { "post": { "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Inventory" ], "summary": "Adjust Stock", "responses": { "200": { "description": "OK", "schema": { "type": "object", "additionalProperties": { "type": "string" } } } } } }, "/api/v1/inventory/stock": { "get": { "produces": [ "application/json" ], "tags": [ "Inventory" ], "summary": "Get Stock Level", "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/dto.InventoryItemResponse" } } } } }, "/api/v1/inventory/transactions": { "get": { "produces": [ "application/json" ], "tags": [ "Inventory" ], "summary": "Get Stock Transactions", "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "$ref": "#/definitions/dto.StockTransactionResponse" } } } } } }, "/api/v1/inventory/warehouses": { "get": { "produces": [ "application/json" ], "tags": [ "Inventory" ], "summary": "List Warehouses", "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "$ref": "#/definitions/dto.WarehouseResponse" } } } } }, "post": { "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Inventory" ], "summary": "Create Warehouse", "responses": { "201": { "description": "Created", "schema": { "$ref": "#/definitions/dto.WarehouseResponse" } } } } }, "/api/v1/inventory/warehouses/{id}": { "get": { "produces": [ "application/json" ], "tags": [ "Inventory" ], "summary": "Get Warehouse", "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/dto.WarehouseResponse" } } } } }, "/api/v1/inventory/warehouses/{id}/stock": { "get": { "produces": [ "application/json" ], "tags": [ "Inventory" ], "summary": "Get Warehouse Stock", "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "$ref": "#/definitions/dto.InventoryItemResponse" } } } } } }, "/api/v1/notifications/queue": { "get": { "security": [ { "BearerAuth": [] } ], "description": "Get pending notifications in the queue", "produces": [ "application/json" ], "tags": [ "notifications" ], "summary": "Get notification queue", "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "$ref": "#/definitions/domain.Notification" } } }, "401": { "description": "Unauthorized", "schema": { "type": "object", "additionalProperties": { "type": "string" } } } } } }, "/api/v1/notifications/send": { "post": { "security": [ { "BearerAuth": [] } ], "description": "Send a notification (instant or queued)", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "notifications" ], "summary": "Send a notification", "parameters": [ { "description": "Notification Request", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/handler.SendNotificationRequest" } } ], "responses": { "202": { "description": "Accepted", "schema": { "type": "object", "additionalProperties": { "type": "string" } } }, "400": { "description": "Bad Request", "schema": { "type": "object", "additionalProperties": { "type": "string" } } } } } }, "/api/v1/notifications/templates": { "get": { "security": [ { "BearerAuth": [] } ], "description": "List all templates for tenant", "produces": [ "application/json" ], "tags": [ "templates" ], "summary": "List templates", "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "$ref": "#/definitions/handler.TemplateResponse" } } }, "401": { "description": "Unauthorized", "schema": { "type": "object", "additionalProperties": { "type": "string" } } } } }, "post": { "security": [ { "BearerAuth": [] } ], "description": "Create a new notification template", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "templates" ], "summary": "Create a template", "parameters": [ { "description": "Template Request", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/handler.CreateTemplateRequest" } } ], "responses": { "201": { "description": "Created", "schema": { "type": "object", "additionalProperties": { "type": "string" } } }, "400": { "description": "Bad Request", "schema": { "type": "object", "additionalProperties": { "type": "string" } } } } } }, "/api/v1/plans": { "get": { "description": "List all available subscription plans", "produces": [ "application/json" ], "tags": [ "plans" ], "summary": "List plans", "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "type": "object", "additionalProperties": true } } }, "500": { "description": "Internal Server Error", "schema": { "type": "object", "additionalProperties": { "type": "string" } } } } }, "post": { "security": [ { "BearerAuth": [] } ], "description": "Create a new subscription plan (Admin)", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "plans" ], "summary": "Create a plan", "parameters": [ { "description": "Plan Request", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/handler.CreatePlanRequest" } } ], "responses": { "201": { "description": "Created", "schema": { "type": "object", "additionalProperties": { "type": "string" } } }, "400": { "description": "Bad Request", "schema": { "type": "object", "additionalProperties": { "type": "string" } } } } } }, "/api/v1/products": { "get": { "security": [ { "BearerAuth": [] } ], "description": "Get all products for the tenant", "produces": [ "application/json" ], "tags": [ "products" ], "summary": "List products", "parameters": [ { "type": "integer", "default": 10, "description": "Limit", "name": "limit", "in": "query" }, { "type": "integer", "default": 0, "description": "Offset", "name": "offset", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "$ref": "#/definitions/handler.ProductResponse" } } }, "401": { "description": "Unauthorized", "schema": { "type": "object", "additionalProperties": { "type": "string" } } } } }, "post": { "security": [ { "BearerAuth": [] } ], "description": "Create a new product", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "products" ], "summary": "Create a new product", "parameters": [ { "description": "Product data", "name": "product", "in": "body", "required": true, "schema": { "$ref": "#/definitions/handler.CreateProductRequest" } } ], "responses": { "201": { "description": "Created", "schema": { "$ref": "#/definitions/handler.ProductResponse" } }, "400": { "description": "Bad Request", "schema": { "type": "object", "additionalProperties": { "type": "string" } } }, "401": { "description": "Unauthorized", "schema": { "type": "object", "additionalProperties": { "type": "string" } } } } } }, "/api/v1/products/barcode/{barcode}": { "get": { "security": [ { "BearerAuth": [] } ], "description": "Get a product by barcode", "produces": [ "application/json" ], "tags": [ "products" ], "summary": "Get product by barcode", "parameters": [ { "type": "string", "description": "Product Barcode", "name": "barcode", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/handler.ProductResponse" } }, "404": { "description": "Not Found", "schema": { "type": "object", "additionalProperties": { "type": "string" } } } } } }, "/api/v1/products/category/{categoryId}": { "get": { "security": [ { "BearerAuth": [] } ], "description": "Get all products in a category", "produces": [ "application/json" ], "tags": [ "products" ], "summary": "Get products by category", "parameters": [ { "type": "string", "description": "Category ID", "name": "categoryId", "in": "path", "required": true }, { "type": "integer", "default": 10, "description": "Limit", "name": "limit", "in": "query" }, { "type": "integer", "default": 0, "description": "Offset", "name": "offset", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "$ref": "#/definitions/handler.ProductResponse" } } }, "404": { "description": "Not Found", "schema": { "type": "object", "additionalProperties": { "type": "string" } } } } } }, "/api/v1/products/search": { "get": { "security": [ { "BearerAuth": [] } ], "description": "Search products by name, SKU, or barcode", "produces": [ "application/json" ], "tags": [ "products" ], "summary": "Search products", "parameters": [ { "type": "string", "description": "Search query", "name": "q", "in": "query", "required": true }, { "type": "integer", "default": 10, "description": "Limit", "name": "limit", "in": "query" }, { "type": "integer", "default": 0, "description": "Offset", "name": "offset", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "$ref": "#/definitions/handler.ProductResponse" } } }, "401": { "description": "Unauthorized", "schema": { "type": "object", "additionalProperties": { "type": "string" } } } } } }, "/api/v1/products/sku/{sku}": { "get": { "security": [ { "BearerAuth": [] } ], "description": "Get a product by SKU", "produces": [ "application/json" ], "tags": [ "products" ], "summary": "Get product by SKU", "parameters": [ { "type": "string", "description": "Product SKU", "name": "sku", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/handler.ProductResponse" } }, "404": { "description": "Not Found", "schema": { "type": "object", "additionalProperties": { "type": "string" } } } } } }, "/api/v1/products/{id}": { "get": { "security": [ { "BearerAuth": [] } ], "description": "Get a specific product by ID", "produces": [ "application/json" ], "tags": [ "products" ], "summary": "Get product by ID", "parameters": [ { "type": "string", "description": "Product ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/handler.ProductResponse" } }, "404": { "description": "Not Found", "schema": { "type": "object", "additionalProperties": { "type": "string" } } } } }, "put": { "security": [ { "BearerAuth": [] } ], "description": "Update an existing product", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "products" ], "summary": "Update product", "parameters": [ { "type": "string", "description": "Product ID", "name": "id", "in": "path", "required": true }, { "description": "Product data", "name": "product", "in": "body", "required": true, "schema": { "$ref": "#/definitions/handler.UpdateProductRequest" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/handler.ProductResponse" } }, "400": { "description": "Bad Request", "schema": { "type": "object", "additionalProperties": { "type": "string" } } }, "404": { "description": "Not Found", "schema": { "type": "object", "additionalProperties": { "type": "string" } } } } }, "delete": { "security": [ { "BearerAuth": [] } ], "description": "Delete a product", "tags": [ "products" ], "summary": "Delete product", "parameters": [ { "type": "string", "description": "Product ID", "name": "id", "in": "path", "required": true } ], "responses": { "204": { "description": "No Content" }, "404": { "description": "Not Found", "schema": { "type": "object", "additionalProperties": { "type": "string" } } } } } }, "/api/v1/subscriptions/current": { "get": { "security": [ { "BearerAuth": [] } ], "description": "Get usage and subscription details for the tenant", "produces": [ "application/json" ], "tags": [ "subscriptions" ], "summary": "Get current subscription", "responses": { "200": { "description": "OK", "schema": { "type": "object", "additionalProperties": true } }, "404": { "description": "Not Found", "schema": { "type": "object", "additionalProperties": { "type": "string" } } } } } }, "/api/v1/subscriptions/subscribe": { "post": { "security": [ { "BearerAuth": [] } ], "description": "Upgrade or change subscription plan", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "subscriptions" ], "summary": "Subscribe to plan", "parameters": [ { "description": "Subscribe Request", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/handler.SubscribeRequest" } } ], "responses": { "200": { "description": "OK", "schema": { "type": "object", "additionalProperties": true } }, "400": { "description": "Bad Request", "schema": { "type": "object", "additionalProperties": { "type": "string" } } } } } }, "/api/v1/suppliers": { "get": { "security": [ { "BearerAuth": [] } ], "description": "Get a paginated list of suppliers for the current tenant", "produces": [ "application/json" ], "tags": [ "suppliers" ], "summary": "List suppliers", "parameters": [ { "type": "integer", "default": 10, "description": "Limit", "name": "limit", "in": "query" }, { "type": "integer", "default": 0, "description": "Offset", "name": "offset", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "$ref": "#/definitions/handler.SupplierResponse" } } }, "400": { "description": "Bad Request", "schema": { "type": "object", "additionalProperties": { "type": "string" } } }, "500": { "description": "Internal Server Error", "schema": { "type": "object", "additionalProperties": { "type": "string" } } } } }, "post": { "security": [ { "BearerAuth": [] } ], "description": "Create a new supplier with custom attributes", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "suppliers" ], "summary": "Create a new supplier", "parameters": [ { "description": "Supplier data", "name": "supplier", "in": "body", "required": true, "schema": { "$ref": "#/definitions/handler.CreateSupplierRequest" } } ], "responses": { "201": { "description": "Created", "schema": { "$ref": "#/definitions/handler.SupplierResponse" } }, "400": { "description": "Bad Request", "schema": { "type": "object", "additionalProperties": { "type": "string" } } }, "500": { "description": "Internal Server Error", "schema": { "type": "object", "additionalProperties": { "type": "string" } } } } } }, "/api/v1/suppliers/search": { "get": { "security": [ { "BearerAuth": [] } ], "description": "Search suppliers by name, email, phone, or code", "produces": [ "application/json" ], "tags": [ "suppliers" ], "summary": "Search suppliers", "parameters": [ { "type": "string", "description": "Search query", "name": "q", "in": "query", "required": true }, { "type": "integer", "default": 10, "description": "Limit", "name": "limit", "in": "query" }, { "type": "integer", "default": 0, "description": "Offset", "name": "offset", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "$ref": "#/definitions/handler.SupplierResponse" } } }, "400": { "description": "Bad Request", "schema": { "type": "object", "additionalProperties": { "type": "string" } } }, "500": { "description": "Internal Server Error", "schema": { "type": "object", "additionalProperties": { "type": "string" } } } } } }, "/api/v1/suppliers/{id}": { "get": { "security": [ { "BearerAuth": [] } ], "description": "Get a supplier by their ID", "produces": [ "application/json" ], "tags": [ "suppliers" ], "summary": "Get supplier by ID", "parameters": [ { "type": "string", "description": "Supplier ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/handler.SupplierResponse" } }, "400": { "description": "Bad Request", "schema": { "type": "object", "additionalProperties": { "type": "string" } } }, "404": { "description": "Not Found", "schema": { "type": "object", "additionalProperties": { "type": "string" } } } } }, "put": { "security": [ { "BearerAuth": [] } ], "description": "Update an existing supplier", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "suppliers" ], "summary": "Update supplier", "parameters": [ { "type": "string", "description": "Supplier ID", "name": "id", "in": "path", "required": true }, { "description": "Supplier data", "name": "supplier", "in": "body", "required": true, "schema": { "$ref": "#/definitions/handler.UpdateSupplierRequest" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/handler.SupplierResponse" } }, "400": { "description": "Bad Request", "schema": { "type": "object", "additionalProperties": { "type": "string" } } }, "404": { "description": "Not Found", "schema": { "type": "object", "additionalProperties": { "type": "string" } } }, "500": { "description": "Internal Server Error", "schema": { "type": "object", "additionalProperties": { "type": "string" } } } } }, "delete": { "security": [ { "BearerAuth": [] } ], "description": "Delete a supplier by ID", "produces": [ "application/json" ], "tags": [ "suppliers" ], "summary": "Delete supplier", "parameters": [ { "type": "string", "description": "Supplier ID", "name": "id", "in": "path", "required": true } ], "responses": { "204": { "description": "No Content" }, "400": { "description": "Bad Request", "schema": { "type": "object", "additionalProperties": { "type": "string" } } }, "404": { "description": "Not Found", "schema": { "type": "object", "additionalProperties": { "type": "string" } } }, "500": { "description": "Internal Server Error", "schema": { "type": "object", "additionalProperties": { "type": "string" } } } } } }, "/auth/change-password": { "post": { "description": "Change authenticated user password", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "auth" ], "summary": "Change Password", "parameters": [ { "description": "Change Password Data", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/dto.ChangePasswordDTO" } } ], "responses": { "200": { "description": "OK", "schema": { "type": "object", "additionalProperties": { "type": "string" } } } } } }, "/auth/forgot-password": { "post": { "description": "Request OTP for password reset", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "auth" ], "summary": "Forgot Password", "parameters": [ { "description": "Forgot Password Data", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/dto.ForgotPasswordDTO" } } ], "responses": { "200": { "description": "OK", "schema": { "type": "object", "additionalProperties": { "type": "string" } } } } } }, "/auth/impersonate/{tenantId}": { "post": { "description": "Login as tenant owner (Super Admin only)", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "auth" ], "summary": "Impersonate Tenant", "parameters": [ { "type": "string", "description": "Tenant ID", "name": "tenantId", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/dto.AuthResponse" } } } } }, "/auth/login": { "post": { "description": "Login with phone or email and password", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "auth" ], "summary": "User Login", "parameters": [ { "description": "Login Credentials", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/dto.LoginDTO" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/dto.AuthResponse" } }, "400": { "description": "Bad Request", "schema": { "type": "object", "additionalProperties": { "type": "string" } } }, "401": { "description": "Unauthorized", "schema": { "type": "object", "additionalProperties": { "type": "string" } } } } } }, "/auth/logout": { "post": { "description": "Invalidate the session", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "auth" ], "summary": "User Logout", "parameters": [ { "description": "Logout Data", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/dto.LogoutDTO" } } ], "responses": { "200": { "description": "OK", "schema": { "type": "object", "additionalProperties": { "type": "string" } } } } } }, "/auth/me": { "get": { "description": "Get profile of the authenticated user", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "auth" ], "summary": "Get Current User", "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/dto.UserResponse" } }, "401": { "description": "Unauthorized", "schema": { "type": "object", "additionalProperties": { "type": "string" } } } } } }, "/auth/refresh": { "post": { "description": "Get a new access token using refresh token", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "auth" ], "summary": "Refresh Access Token", "parameters": [ { "description": "Refresh Token Data", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/dto.RefreshTokenDTO" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/dto.AuthResponse" } } } } }, "/auth/register": { "post": { "description": "Create a new tenant and its administrative user", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "auth" ], "summary": "Register a new tenant", "parameters": [ { "description": "Tenant Registration Data", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/dto.RegisterTenantDTO" } } ], "responses": { "201": { "description": "Created", "schema": { "type": "object", "additionalProperties": true } }, "400": { "description": "Bad Request", "schema": { "type": "object", "additionalProperties": { "type": "string" } } }, "500": { "description": "Internal Server Error", "schema": { "type": "object", "additionalProperties": { "type": "string" } } } } } }, "/auth/register-individual": { "post": { "description": "Create a new personal account and its owner", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "auth" ], "summary": "Register a new individual user", "parameters": [ { "description": "Individual Registration Data", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/dto.RegisterIndividualDTO" } } ], "responses": { "201": { "description": "Created", "schema": { "type": "object", "additionalProperties": true } }, "400": { "description": "Bad Request", "schema": { "type": "object", "additionalProperties": { "type": "string" } } }, "500": { "description": "Internal Server Error", "schema": { "type": "object", "additionalProperties": { "type": "string" } } } } } }, "/auth/reset-password": { "post": { "description": "Reset password with OTP", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "auth" ], "summary": "Reset Password", "parameters": [ { "description": "Reset Password Data", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/dto.ResetPasswordDTO" } } ], "responses": { "200": { "description": "OK", "schema": { "type": "object", "additionalProperties": { "type": "string" } } } } } }, "/auth/verify-otp": { "post": { "description": "Verify the 6-digit OTP sent during registration", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "auth" ], "summary": "Verify registration OTP", "parameters": [ { "description": "OTP Verification Data", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/dto.VerifyOTPDTO" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/dto.AuthResponse" } }, "400": { "description": "Bad Request", "schema": { "type": "object", "additionalProperties": { "type": "string" } } }, "401": { "description": "Unauthorized", "schema": { "type": "object", "additionalProperties": { "type": "string" } } } } } }, "/users": { "get": { "security": [ { "BearerAuth": [] } ], "description": "Fetch users with advanced filtering, sorting and pagination", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "users" ], "summary": "List tenant users", "parameters": [ { "type": "string", "description": "Search term", "name": "search", "in": "query" }, { "type": "string", "description": "Field to sort by", "name": "sortBy", "in": "query" }, { "type": "string", "description": "Sort order (asc/desc)", "name": "sortOrder", "in": "query" }, { "type": "integer", "description": "Page number", "name": "page", "in": "query" }, { "type": "integer", "description": "Items per page", "name": "limit", "in": "query" }, { "type": "string", "description": "JSON encoded filters", "name": "filters", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/dto.UserListResponse" } } } } }, "/users/invite": { "post": { "security": [ { "BearerAuth": [] } ], "description": "Send an invitation to join the tenant", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "users" ], "summary": "Invite a new user", "parameters": [ { "description": "Invitation Data", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/dto.InviteUserDTO" } } ], "responses": { "201": { "description": "Created", "schema": { "type": "object", "additionalProperties": true } } } } }, "/users/join": { "post": { "description": "Accept invitation and create user account", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "users" ], "summary": "Join tenant via invitation", "parameters": [ { "description": "Join Data", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/dto.JoinTenantDTO" } } ], "responses": { "200": { "description": "OK", "schema": { "type": "object", "additionalProperties": { "type": "string" } } } } } } }, "definitions": { "domain.Account": { "type": "object", "properties": { "code": { "description": "\"1001\", \"2000\"", "type": "string" }, "createdAt": { "type": "string" }, "description": { "type": "string" }, "id": { "type": "string" }, "isActive": { "type": "boolean" }, "name": { "description": "\"Cash on Hand\", \"Sales Revenue\"", "type": "string" }, "parentId": { "description": "For hierarchical CoA", "type": "string" }, "tenantId": { "type": "string" }, "type": { "description": "ASSET, LIABILITY, etc.", "allOf": [ { "$ref": "#/definitions/domain.AccountType" } ] }, "updatedAt": { "type": "string" } } }, "domain.AccountType": { "type": "string", "enum": [ "ASSET", "LIABILITY", "EQUITY", "REVENUE", "EXPENSE" ], "x-enum-varnames": [ "AccountTypeAsset", "AccountTypeLiability", "AccountTypeEquity", "AccountTypeRevenue", "AccountTypeExpense" ] }, "domain.ChannelType": { "type": "string", "enum": [ "SMS", "EMAIL", "WHATSAPP", "IN_APP" ], "x-enum-varnames": [ "ChannelSMS", "ChannelEmail", "ChannelWhatsApp", "ChannelInApp" ] }, "domain.JournalEntry": { "type": "object", "properties": { "createdAt": { "type": "string" }, "createdByUserId": { "type": "string" }, "description": { "type": "string" }, "fiscalYearId": { "type": "string" }, "id": { "type": "string" }, "lines": { "type": "array", "items": { "$ref": "#/definitions/domain.JournalLine" } }, "postedAt": { "type": "string" }, "referenceId": { "description": "InvoiceID, PaymentID", "type": "string" }, "referenceType": { "description": "\"INVOICE\", \"PAYMENT\", \"MANUAL\"", "type": "string" }, "status": { "$ref": "#/definitions/domain.JournalStatus" }, "tenantId": { "type": "string" }, "transactionDate": { "type": "string" }, "updatedAt": { "type": "string" } } }, "domain.JournalLine": { "type": "object", "properties": { "accountId": { "type": "string" }, "credit": { "type": "number" }, "debit": { "type": "number" }, "description": { "type": "string" }, "id": { "type": "string" }, "journalEntryId": { "type": "string" } } }, "domain.JournalStatus": { "type": "string", "enum": [ "DRAFT", "POSTED" ], "x-enum-varnames": [ "JournalStatusDraft", "JournalStatusPosted" ] }, "domain.LedgerEntry": { "type": "object", "properties": { "accountId": { "type": "string" }, "credit": { "type": "number" }, "debit": { "type": "number" }, "description": { "description": "Journal Entry description", "type": "string" }, "id": { "type": "string" }, "journalEntryId": { "type": "string" }, "lineDescription": { "description": "Line specific description", "type": "string" }, "stepBalance": { "description": "Calculated during report generation", "type": "number" }, "transactionDate": { "type": "string" } } }, "domain.Notification": { "type": "object", "properties": { "channel": { "$ref": "#/definitions/domain.ChannelType" }, "content": { "type": "string" }, "createdAt": { "type": "string" }, "errorMessage": { "type": "string" }, "id": { "type": "string" }, "priority": { "$ref": "#/definitions/domain.Priority" }, "recipient": { "type": "string" }, "retryCount": { "type": "integer" }, "sentAt": { "type": "string" }, "status": { "$ref": "#/definitions/domain.NotificationStatus" }, "subject": { "type": "string" }, "templateId": { "type": "string" }, "tenantId": { "type": "string" }, "userId": { "type": "string" } } }, "domain.NotificationStatus": { "type": "string", "enum": [ "PENDING", "PROCESSING", "SENT", "FAILED" ], "x-enum-varnames": [ "StatusPending", "StatusProcessing", "StatusSent", "StatusFailed" ] }, "domain.Priority": { "type": "string", "enum": [ "HIGH", "LOW" ], "x-enum-varnames": [ "PriorityHigh", "PriorityLow" ] }, "domain.TransactionType": { "type": "string", "enum": [ "IN", "OUT", "TRANSFER", "ADJUSTMENT" ], "x-enum-comments": { "TransactionTypeAdjustment": "Stock Take correction", "TransactionTypeIn": "Purchase, Return In", "TransactionTypeOut": "Sales, Return Out, Damage", "TransactionTypeTransfer": "Warehouse to Warehouse" }, "x-enum-descriptions": [ "Purchase, Return In", "Sales, Return Out, Damage", "Warehouse to Warehouse", "Stock Take correction" ], "x-enum-varnames": [ "TransactionTypeIn", "TransactionTypeOut", "TransactionTypeTransfer", "TransactionTypeAdjustment" ] }, "dto.AccountDTO": { "type": "object", "properties": { "category": { "type": "string" }, "id": { "type": "string" }, "name": { "type": "string" }, "role": { "type": "string" } } }, "dto.AuthResponse": { "type": "object", "properties": { "accessToken": { "type": "string" }, "accounts": { "type": "array", "items": { "$ref": "#/definitions/dto.AccountDTO" } }, "refreshToken": { "type": "string" }, "user": { "$ref": "#/definitions/dto.UserResponse" } } }, "dto.BalanceSheetResponse": { "type": "object", "properties": { "assets": { "$ref": "#/definitions/dto.FinancialSection" }, "date": { "type": "string" }, "equity": { "$ref": "#/definitions/dto.FinancialSection" }, "liabilities": { "$ref": "#/definitions/dto.FinancialSection" }, "netAssets": { "description": "Assets - Liabilities", "type": "number" } } }, "dto.ChangePasswordDTO": { "type": "object", "required": [ "newPassword", "oldPassword" ], "properties": { "newPassword": { "type": "string", "minLength": 6 }, "oldPassword": { "type": "string" } } }, "dto.CreateAccountRequest": { "type": "object", "required": [ "code", "name", "type" ], "properties": { "code": { "type": "string" }, "description": { "type": "string" }, "name": { "type": "string" }, "parentId": { "type": "string" }, "type": { "enum": [ "ASSET", "LIABILITY", "EQUITY", "REVENUE", "EXPENSE" ], "allOf": [ { "$ref": "#/definitions/domain.AccountType" } ] } } }, "dto.CreateJournalEntryRequest": { "type": "object", "required": [ "date", "description", "fiscalYearId", "lines" ], "properties": { "date": { "type": "string" }, "description": { "type": "string" }, "fiscalYearId": { "type": "string" }, "lines": { "type": "array", "minItems": 2, "items": { "$ref": "#/definitions/dto.JournalLineRequest" } }, "referenceId": { "type": "string" }, "referenceType": { "type": "string" } } }, "dto.DayBookItem": { "type": "object", "properties": { "amount": { "type": "number" }, "description": { "type": "string" }, "journalId": { "type": "string" }, "type": { "description": "SALES, PURCHASE, RECEIPT, PAYMENT", "type": "string" } } }, "dto.DayBookResponse": { "type": "object", "properties": { "date": { "type": "string" }, "totalCredits": { "type": "number" }, "totalDebits": { "type": "number" }, "transactions": { "type": "array", "items": { "$ref": "#/definitions/dto.DayBookItem" } } } }, "dto.FinancialReportItem": { "type": "object", "properties": { "accountId": { "type": "string" }, "accountName": { "type": "string" }, "balance": { "type": "number" }, "code": { "type": "string" } } }, "dto.FinancialSection": { "type": "object", "properties": { "items": { "type": "array", "items": { "$ref": "#/definitions/dto.FinancialReportItem" } }, "name": { "description": "e.g., \"Current Assets\", \"Revenue\"", "type": "string" }, "total": { "type": "number" } } }, "dto.ForgotPasswordDTO": { "type": "object", "required": [ "identifier" ], "properties": { "identifier": { "type": "string" } } }, "dto.InventoryItemResponse": { "type": "object", "properties": { "id": { "type": "string" }, "lastRestocked": { "type": "string" }, "productId": { "type": "string" }, "quantity": { "type": "number" }, "reorderLevel": { "type": "number" }, "warehouseId": { "type": "string" } } }, "dto.InviteUserDTO": { "type": "object", "required": [ "role" ], "properties": { "email": { "type": "string" }, "phone": { "type": "string", "maxLength": 15, "minLength": 10 }, "role": { "type": "string", "enum": [ "owner", "manager", "staff", "admin" ] } } }, "dto.JoinTenantDTO": { "type": "object", "required": [ "name", "password", "token" ], "properties": { "name": { "type": "string", "maxLength": 100, "minLength": 2 }, "password": { "type": "string", "minLength": 6 }, "token": { "type": "string" } } }, "dto.JournalLineRequest": { "type": "object", "required": [ "accountId" ], "properties": { "accountId": { "type": "string" }, "credit": { "type": "number", "minimum": 0 }, "debit": { "type": "number", "minimum": 0 }, "description": { "type": "string" } } }, "dto.LoginDTO": { "type": "object", "required": [ "password", "phone" ], "properties": { "password": { "type": "string" }, "phone": { "type": "string" } } }, "dto.LogoutDTO": { "type": "object", "properties": { "refreshToken": { "type": "string" } } }, "dto.Pagination": { "type": "object", "properties": { "currentPage": { "type": "integer" }, "limit": { "type": "integer" }, "totalItems": { "type": "integer" }, "totalPages": { "type": "integer" } } }, "dto.ProfitLossResponse": { "type": "object", "properties": { "endDate": { "type": "string" }, "expenses": { "$ref": "#/definitions/dto.FinancialSection" }, "netProfit": { "description": "Revenue - Expenses", "type": "number" }, "revenue": { "$ref": "#/definitions/dto.FinancialSection" }, "startDate": { "type": "string" } } }, "dto.RefreshTokenDTO": { "type": "object", "required": [ "refreshToken" ], "properties": { "refreshToken": { "type": "string" } } }, "dto.RegisterIndividualDTO": { "type": "object", "required": [ "name", "password", "phone" ], "properties": { "email": { "type": "string" }, "name": { "type": "string", "maxLength": 100, "minLength": 2 }, "password": { "type": "string", "maxLength": 50, "minLength": 6 }, "phone": { "type": "string", "maxLength": 15, "minLength": 10 } } }, "dto.RegisterTenantDTO": { "type": "object", "required": [ "ownerName", "password", "phone", "tenantName" ], "properties": { "email": { "type": "string" }, "ownerName": { "type": "string", "maxLength": 100, "minLength": 2 }, "password": { "type": "string", "maxLength": 50, "minLength": 6 }, "phone": { "type": "string", "maxLength": 15, "minLength": 10 }, "tenantName": { "type": "string", "maxLength": 50, "minLength": 3 } } }, "dto.ResetPasswordDTO": { "type": "object", "required": [ "identifier", "newPassword", "otp" ], "properties": { "identifier": { "type": "string" }, "newPassword": { "type": "string", "maxLength": 50, "minLength": 6 }, "otp": { "type": "string" } } }, "dto.StockTransactionResponse": { "type": "object", "properties": { "createdAt": { "type": "string" }, "createdBy": { "type": "string" }, "direction": { "type": "integer" }, "id": { "type": "string" }, "notes": { "type": "string" }, "productId": { "type": "string" }, "quantity": { "type": "number" }, "referenceId": { "type": "string" }, "referenceType": { "type": "string" }, "type": { "$ref": "#/definitions/domain.TransactionType" }, "warehouseId": { "type": "string" } } }, "dto.TrialBalanceItem": { "type": "object", "properties": { "accountCode": { "type": "string" }, "accountId": { "type": "string" }, "accountName": { "type": "string" }, "accountType": { "type": "string" }, "balance": { "description": "Net balance (Debit - Credit)", "type": "number" }, "credit": { "type": "number" }, "debit": { "type": "number" } } }, "dto.TrialBalanceResponse": { "type": "object", "properties": { "fiscalYearId": { "type": "string" }, "generatedAt": { "type": "string" }, "items": { "type": "array", "items": { "$ref": "#/definitions/dto.TrialBalanceItem" } }, "totalCredit": { "type": "number" }, "totalDebit": { "type": "number" } } }, "dto.UpdateAccountRequest": { "type": "object", "properties": { "code": { "type": "string" }, "description": { "type": "string" }, "isActive": { "type": "boolean" }, "name": { "type": "string" }, "parentId": { "type": "string" }, "type": { "$ref": "#/definitions/domain.AccountType" } } }, "dto.UserListResponse": { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/definitions/dto.UserResponse" } }, "pagination": { "$ref": "#/definitions/dto.Pagination" } } }, "dto.UserResponse": { "type": "object", "properties": { "createdAt": { "type": "string" }, "email": { "type": "string" }, "id": { "type": "string" }, "isActive": { "type": "boolean" }, "name": { "type": "string" }, "phone": { "type": "string" }, "role": { "type": "string" }, "tenantId": { "type": "string" } } }, "dto.VerifyOTPDTO": { "type": "object", "required": [ "otp", "phone" ], "properties": { "otp": { "type": "string" }, "phone": { "type": "string" } } }, "dto.WarehouseResponse": { "type": "object", "properties": { "description": { "type": "string" }, "id": { "type": "string" }, "isActive": { "type": "boolean" }, "location": { "type": "string" }, "name": { "type": "string" }, "tenantId": { "type": "string" } } }, "handler.CategoryResponse": { "type": "object", "properties": { "categoryCode": { "type": "string" }, "createdAt": { "type": "string" }, "customAttributes": { "type": "object", "additionalProperties": true }, "description": { "type": "string" }, "id": { "type": "string" }, "isActive": { "type": "boolean" }, "level": { "type": "integer" }, "name": { "type": "string" }, "parentId": { "type": "string" }, "path": { "type": "string" }, "sortOrder": { "type": "integer" }, "tenantId": { "type": "string" }, "updatedAt": { "type": "string" } } }, "handler.CreateCategoryRequest": { "type": "object", "required": [ "name" ], "properties": { "customAttributes": { "type": "object", "additionalProperties": true }, "description": { "type": "string" }, "name": { "type": "string", "maxLength": 255, "minLength": 2 }, "parentId": { "type": "string" }, "sortOrder": { "type": "integer" } } }, "handler.CreateCustomerRequest": { "type": "object", "required": [ "customerType", "name" ], "properties": { "customAttributes": { "type": "object", "additionalProperties": true }, "customerType": { "type": "string", "enum": [ "individual", "business" ] }, "email": { "type": "string" }, "name": { "type": "string", "maxLength": 255, "minLength": 2 }, "phone": { "type": "string" } } }, "handler.CreatePlanRequest": { "type": "object", "required": [ "code", "name" ], "properties": { "code": { "type": "string" }, "description": { "type": "string" }, "features": { "type": "object", "additionalProperties": { "type": "boolean" } }, "interval": { "type": "string", "enum": [ "MONTHLY", "YEARLY" ] }, "limits": { "type": "object", "additionalProperties": { "type": "integer" } }, "name": { "type": "string" }, "price": { "type": "number", "minimum": 0 } } }, "handler.CreateProductRequest": { "type": "object", "required": [ "categoryId", "name", "sellingPrice", "unit" ], "properties": { "barcode": { "type": "string" }, "categoryId": { "type": "string" }, "costPrice": { "type": "number", "minimum": 0 }, "customAttributes": { "type": "object", "additionalProperties": true }, "description": { "type": "string" }, "mrp": { "type": "number" }, "name": { "type": "string", "maxLength": 255, "minLength": 2 }, "sellingPrice": { "type": "number" }, "sku": { "type": "string" }, "taxRate": { "type": "number", "maximum": 100, "minimum": 0 }, "unit": { "type": "string" } } }, "handler.CreateSupplierRequest": { "type": "object", "required": [ "name", "supplierType" ], "properties": { "customAttributes": { "type": "object", "additionalProperties": true }, "email": { "type": "string" }, "name": { "type": "string", "maxLength": 255, "minLength": 2 }, "phone": { "type": "string" }, "supplierType": { "type": "string", "enum": [ "local", "international" ] } } }, "handler.CreateTemplateRequest": { "type": "object", "required": [ "body", "channel", "code" ], "properties": { "body": { "type": "string" }, "channel": { "type": "string" }, "code": { "type": "string" }, "subject": { "type": "string" } } }, "handler.CustomerResponse": { "type": "object", "properties": { "createdAt": { "type": "string" }, "customAttributes": { "type": "object", "additionalProperties": true }, "customerCode": { "type": "string" }, "customerType": { "type": "string" }, "email": { "type": "string" }, "id": { "type": "string" }, "name": { "type": "string" }, "phone": { "type": "string" }, "status": { "type": "string" }, "tenantId": { "type": "string" }, "updatedAt": { "type": "string" } } }, "handler.ProductResponse": { "type": "object", "properties": { "barcode": { "type": "string" }, "categoryId": { "type": "string" }, "costPrice": { "type": "number" }, "createdAt": { "type": "string" }, "customAttributes": { "type": "object", "additionalProperties": true }, "description": { "type": "string" }, "id": { "type": "string" }, "isActive": { "type": "boolean" }, "mrp": { "type": "number" }, "name": { "type": "string" }, "productCode": { "type": "string" }, "sellingPrice": { "type": "number" }, "sku": { "type": "string" }, "status": { "type": "string" }, "taxRate": { "type": "number" }, "tenantId": { "type": "string" }, "unit": { "type": "string" }, "updatedAt": { "type": "string" } } }, "handler.SendNotificationRequest": { "type": "object", "required": [ "channel", "recipient" ], "properties": { "channel": { "type": "string" }, "content": { "type": "string" }, "priority": { "type": "string" }, "recipient": { "type": "string" }, "templateId": { "type": "string" }, "userId": { "type": "string" }, "variables": { "type": "object", "additionalProperties": true } } }, "handler.SubscribeRequest": { "type": "object", "required": [ "password", "planId" ], "properties": { "password": { "type": "string" }, "planId": { "type": "string" } } }, "handler.SupplierResponse": { "type": "object", "properties": { "createdAt": { "type": "string" }, "customAttributes": { "type": "object", "additionalProperties": true }, "email": { "type": "string" }, "id": { "type": "string" }, "name": { "type": "string" }, "phone": { "type": "string" }, "status": { "type": "string" }, "supplierCode": { "type": "string" }, "supplierType": { "type": "string" }, "tenantId": { "type": "string" }, "updatedAt": { "type": "string" } } }, "handler.TemplateResponse": { "type": "object", "properties": { "body": { "type": "string" }, "channel": { "type": "string" }, "code": { "type": "string" }, "createdAt": { "type": "string" }, "id": { "type": "string" }, "isActive": { "type": "boolean" }, "subject": { "type": "string" }, "tenantId": { "type": "string" }, "updatedAt": { "type": "string" } } }, "handler.UpdateCategoryRequest": { "type": "object", "required": [ "name" ], "properties": { "customAttributes": { "type": "object", "additionalProperties": true }, "description": { "type": "string" }, "isActive": { "type": "boolean" }, "name": { "type": "string", "maxLength": 255, "minLength": 2 }, "parentId": { "type": "string" }, "sortOrder": { "type": "integer" } } }, "handler.UpdateCustomerRequest": { "type": "object", "required": [ "customerType", "name", "status" ], "properties": { "customAttributes": { "type": "object", "additionalProperties": true }, "customerType": { "type": "string", "enum": [ "individual", "business" ] }, "email": { "type": "string" }, "name": { "type": "string", "maxLength": 255, "minLength": 2 }, "phone": { "type": "string" }, "status": { "type": "string", "enum": [ "active", "inactive", "blocked" ] } } }, "handler.UpdateProductRequest": { "type": "object", "required": [ "categoryId", "name", "sellingPrice", "status", "unit" ], "properties": { "barcode": { "type": "string" }, "categoryId": { "type": "string" }, "costPrice": { "type": "number", "minimum": 0 }, "customAttributes": { "type": "object", "additionalProperties": true }, "description": { "type": "string" }, "mrp": { "type": "number" }, "name": { "type": "string", "maxLength": 255, "minLength": 2 }, "sellingPrice": { "type": "number" }, "sku": { "type": "string" }, "status": { "type": "string", "enum": [ "active", "inactive", "discontinued" ] }, "taxRate": { "type": "number", "maximum": 100, "minimum": 0 }, "unit": { "type": "string" } } }, "handler.UpdateSupplierRequest": { "type": "object", "required": [ "name", "status", "supplierType" ], "properties": { "customAttributes": { "type": "object", "additionalProperties": true }, "email": { "type": "string" }, "name": { "type": "string", "maxLength": 255, "minLength": 2 }, "phone": { "type": "string" }, "status": { "type": "string", "enum": [ "active", "inactive", "blocked" ] }, "supplierType": { "type": "string", "enum": [ "local", "international" ] } } } } }