### TypeScript File Header Example
Source: https://github.com/ismanix-creator/60_hideandseek/blob/main/CLAUDE.md
Standard header for TypeScript files, including metadata like filename, description, version, timestamps, author, and a changelog. This aids in version tracking and understanding file history.
```typescript
/**
* @file filename.ts
* @description Brief description
* @version 0.1.0
* @created 2026-01-06 12:00:00 CET
* @updated 2026-01-06 12:00:00 CET
* @author Author Name
*
* @changelog
* 0.1.0 - 2026-01-06 - Initial implementation
*/
```
--------------------------------
### Button Component Examples in TSX
Source: https://context7.com/ismanix-creator/60_hideandseek/llms.txt
Demonstrates various use cases of the Button component, showcasing different 'kind' and 'intent' props for navigation, creation, actions, tabs, and dialogs. It highlights how to use icons from 'lucide-react' and manage button states like 'disabled' and 'loading'.
```tsx
import { Button } from '@/components/ui/Button';
import { Plus, Edit, Trash2, ChevronLeft, Package } from 'lucide-react';
// Navigation button (sidebar icons, 48px)
// New button (page header, 32px)
// Action button (table actions, 20px)
// Tab button (payment history tabs, 20px)
// Rectangle button (dialogs, forms)
```
--------------------------------
### Health Check API Endpoint
Source: https://context7.com/ismanix-creator/60_hideandseek/llms.txt
Verifies if the Material-Tracker API server is running and responsive. It's a simple GET request to the /api/health endpoint.
```bash
# Check API health status
curl http://localhost:3000/api/health
# Response
{"success":true}
```
--------------------------------
### Configuration Loading and Access in TypeScript
Source: https://context7.com/ismanix-creator/60_hideandseek/llms.txt
Demonstrates how to import and access application configuration values within a TypeScript project. It shows accessing theme variables, component configurations, and UI text labels.
```typescript
// src/config/index.ts - Single import point for all consumers
import { appConfig } from '@/config';
// Access theme values
const { colors, spacing, typography, breakpoints } = appConfig;
// Access component configs
const { button, dialog, table, badge, input } = appConfig;
// Access UI text (German labels)
const { labels, buttons, dialog_titles, errors, validation } = appConfig;
// Example: Using config in a component
function PriceDisplay({ value }: { value: number }) {
return (
{value.toFixed(2)} EUR
);
}
```
--------------------------------
### Create Material Post API
Source: https://context7.com/ismanix-creator/60_hideandseek/llms.txt
Creates a new material post for a customer. Requires customer ID, material ID, date, quantity, and price.
```bash
curl -X POST http://localhost:3000/api/kunden-posten-mat \
-H "Content-Type: application/json" \
-d '{
"kunde_id": 1,
"material_id": 1,
"datum": "2026-01-15",
"menge": 20,
"preis": 200.00
}'
```
--------------------------------
### Create Debtor Entry API
Source: https://context7.com/ismanix-creator/60_hideandseek/llms.txt
Creates a new debtor entry. Requires date, name, amount, due date, and an optional note.
```bash
curl -X POST http://localhost:3000/api/schuldner \
-H "Content-Type: application/json" \
-d '{
"datum": "2026-01-15",
"name": "Client ABC",
"betrag": 750.00,
"faelligkeit": "2026-02-28",
"notiz": "Consulting fee"
}'
```
--------------------------------
### Configuration Generation Commands
Source: https://context7.com/ismanix-creator/60_hideandseek/llms.txt
Provides bash commands to regenerate TypeScript types from config.toml and generate config reference documentation. It also notes that config validation runs automatically on application startup and fails fast.
```bash
# Generate TypeScript config from config.toml
pnpm run generate:config
# Generate config reference documentation
pnpm run generate:reference
# Config validation runs automatically on app start
# Failed validation causes immediate process.exit(1)
```
--------------------------------
### Create Creditor Entry API
Source: https://context7.com/ismanix-creator/60_hideandseek/llms.txt
Creates a new creditor entry. Requires date, name, amount, due date, and an optional note.
```bash
curl -X POST http://localhost:3000/api/glaeubiger \
-H "Content-Type: application/json" \
-d '{
"datum": "2026-01-15",
"name": "Parts Supplier Ltd",
"betrag": 2500.00,
"faelligkeit": "2026-03-15",
"notiz": "Q1 bulk order"
}'
```
--------------------------------
### Customer Material Posts (Kunden-Posten-Mat)
Source: https://context7.com/ismanix-creator/60_hideandseek/llms.txt
Track material-based open items for customers with payment progress.
```APIDOC
## Customer Material Posts API Endpoints
### List all material posts for a customer
### Method
GET
### Endpoint
/api/kunden-posten-mat/kunde/{kundeId}
### Parameters
#### Path Parameters
- **kundeId** (integer) - Required - The ID of the customer whose material posts are to be listed.
### Response
#### Success Response (200)
- **success** (boolean) - Indicates if the operation was successful.
- **data** (array) - An array of customer material post objects.
- **id** (integer) - Unique identifier for the post.
- **kunde_id** (integer) - The ID of the customer.
- **material_id** (integer) - The ID of the material.
- **datum** (string) - Date of the post.
- **menge** (integer) - Quantity.
- **preis** (float) - Price.
- **bezahlt** (float) - Amount paid.
- **offen** (float) - Amount outstanding.
- **status** (string) - Status of the post (e.g., "teilweise", "offen", "bezahlt").
- **notiz** (string) - Notes about the post.
#### Response Example
```json
{
"success": true,
"data": [
{
"id": 1,
"kunde_id": 1,
"material_id": 1,
"datum": "2026-01-15",
"menge": 10,
"preis": 100.00,
"bezahlt": 50.00,
"offen": 50.00,
"status": "teilweise",
"notiz": "Monthly delivery"
}
]
}
```
```
--------------------------------
### Create Customer Non-Material Post API
Source: https://context7.com/ismanix-creator/60_hideandseek/llms.txt
Creates a new non-material post for a customer. Requires customer ID, date, description, and amount.
```bash
curl -X POST http://localhost:3000/api/kunden-posten-nomat \
-H "Content-Type: application/json" \
-d '{
"kunde_id": 1,
"datum": "2026-01-15",
"bezeichnung": "Service fee",
"betrag": 150.00
}'
```
--------------------------------
### Customer Material Posts API
Source: https://context7.com/ismanix-creator/60_hideandseek/llms.txt
Tracks material-specific open items (posts) for customers, including quantities, prices, and payment status. Allows for partial payments and displays the remaining balance.
```bash
# List all material posts for a customer
curl http://localhost:3000/api/kunden-posten-mat/kunde/1
# Response
{
"success": true,
"data": [
{
"id": 1,
"kunde_id": 1,
"material_id": 1,
"datum": "2026-01-15",
"menge": 10,
"preis": 100.00,
"bezahlt": 50.00,
"offen": 50.00,
"status": "teilweise",
"notiz": "Monthly delivery"
}
]
}
```
--------------------------------
### List Debtors API
Source: https://context7.com/ismanix-creator/60_hideandseek/llms.txt
Retrieves a list of all debtor entries.
```bash
curl http://localhost:3000/api/schuldner
```
--------------------------------
### Customer (Kunden) Management
Source: https://context7.com/ismanix-creator/60_hideandseek/llms.txt
Full customer lifecycle with optional authentication-based access control.
```APIDOC
## Customer API Endpoints
### List all customers
### Method
GET
### Endpoint
/api/kunden
### Parameters
None
### Response
#### Success Response (200)
- **success** (boolean) - Indicates if the operation was successful.
- **data** (array) - An array of customer objects.
- **id** (integer) - Unique identifier for the customer.
- **name** (string) - Name of the customer.
- **created_at** (string) - Timestamp of creation.
- **updated_at** (string) - Timestamp of last update.
#### Response Example
```json
{
"success": true,
"data": [
{
"id": 1,
"name": "Max Mustermann",
"created_at": "2026-01-10T10:00:00Z",
"updated_at": "2026-01-10T10:00:00Z"
}
]
}
```
## Get single customer
### Method
GET
### Endpoint
/api/kunden/{id}
### Parameters
#### Path Parameters
- **id** (integer) - Required - The ID of the customer to retrieve.
### Response
#### Success Response (200)
- Returns a single customer object (structure same as above).
## Create new customer
### Method
POST
### Endpoint
/api/kunden
### Parameters
#### Request Body
- **name** (string) - Required - Name of the customer.
### Request Example
```json
{"name": "Erika Musterfrau"}
```
### Response
#### Success Response (200)
- Returns the created customer object.
## Update customer
### Method
PUT
### Endpoint
/api/kunden/{id}
### Parameters
#### Path Parameters
- **id** (integer) - Required - The ID of the customer to update.
#### Request Body
- **name** (string) - Required - The new name for the customer.
### Request Example
```json
{"name": "Max Mustermann GmbH"}
```
### Response
#### Success Response (200)
- Returns the updated customer object.
## Delete customer
### Method
DELETE
### Endpoint
/api/kunden/{id}
### Parameters
#### Path Parameters
- **id** (integer) - Required - The ID of the customer to delete.
### Response
#### Success Response (200)
- Indicates successful deletion (e.g., `{"success": true}`).
```
--------------------------------
### Dialog Component Usage in TSX
Source: https://context7.com/ismanix-creator/60_hideandseek/llms.txt
Illustrates the implementation of a responsive Dialog component, including its title, actions (Cancel and Save buttons), and form inputs for material details. It shows how to manage dialog state ('open', 'onClose') and handle form data submission. This component uses the Button and Input components.
```tsx
import { Dialog } from '@/components/ui/Dialog';
import { Button } from '@/components/ui/Button';
import { useState } from 'react';
function MaterialDialog({ open, onClose, material }) {
const [formData, setFormData] = useState(material);
const handleSave = async () => {
await saveMaterial(formData);
onClose();
};
return (
);
}
```
--------------------------------
### List Creditors API
Source: https://context7.com/ismanix-creator/60_hideandseek/llms.txt
Retrieves a list of all creditor entries. The response includes details like amount, paid amount, open amount, and due date.
```bash
curl http://localhost:3000/api/glaeubiger
```
--------------------------------
### Customer (Kunden) Management API
Source: https://context7.com/ismanix-creator/60_hideandseek/llms.txt
Manages customer information, including their names and creation/update timestamps. Supports full CRUD operations for customers, with optional authentication for access control.
```bash
# List all customers
curl http://localhost:3000/api/kunden
# Response
{
"success": true,
"data": [
{
"id": 1,
"name": "Max Mustermann",
"created_at": "2026-01-10T10:00:00Z",
"updated_at": "2026-01-10T10:00:00Z"
}
]
}
# Get single customer
curl http://localhost:3000/api/kunden/1
# Create new customer
curl -X POST http://localhost:3000/api/kunden \
-H "Content-Type: application/json" \
-d '{"name": "Erika Musterfrau"}'
# Update customer
curl -X PUT http://localhost:3000/api/kunden/1 \
-H "Content-Type: application/json" \
-d '{"name": "Max Mustermann GmbH"}'
# Delete customer
curl -X DELETE http://localhost:3000/api/kunden/1
```
--------------------------------
### List Customer Non-Material Posts API
Source: https://context7.com/ismanix-creator/60_hideandseek/llms.txt
Retrieves a list of all non-material posts for a specific customer. Requires the customer ID.
```bash
curl http://localhost:3000/api/kunden-posten-nomat/kunde/1
```
--------------------------------
### Creditors Management API
Source: https://context7.com/ismanix-creator/60_hideandseek/llms.txt
Endpoints for managing creditors, including listing, creating, updating, recording payments, and deleting entries.
```APIDOC
## GET /api/glaeubiger
### Description
Lists all creditors.
### Method
GET
### Endpoint
/api/glaeubiger
### Response
#### Success Response (200)
- **success** (boolean) - Indicates if the request was successful.
- **data** (array) - An array of creditor objects.
- **id** (integer) - The ID of the creditor.
- **datum** (string) - The date of the entry (YYYY-MM-DD).
- **name** (string) - The name of the creditor.
- **betrag** (number) - The total amount owed.
- **bezahlt** (number) - The amount already paid.
- **offen** (number) - The remaining open amount.
- **faelligkeit** (string) - The due date (YYYY-MM-DD).
- **status** (string) - The current status (e.g., "offen").
- **notiz** (string) - Notes about the creditor entry.
### Response Example
```json
{
"success": true,
"data": [
{
"id": 1,
"datum": "2026-01-10",
"name": "Supplier Corp",
"betrag": 1000.00,
"bezahlt": 500.00,
"offen": 500.00,
"faelligkeit": "2026-02-10",
"status": "offen",
"notiz": "January shipment"
}
]
}
```
## POST /api/glaeubiger
### Description
Creates a new creditor entry.
### Method
POST
### Endpoint
/api/glaeubiger
### Parameters
#### Request Body
- **datum** (string) - Required - The date of the entry (YYYY-MM-DD).
- **name** (string) - Required - The name of the creditor.
- **betrag** (number) - Required - The total amount owed.
- **faelligkeit** (string) - Required - The due date (YYYY-MM-DD).
- **notiz** (string) - Optional - Notes about the creditor entry.
### Request Example
```json
{
"datum": "2026-01-15",
"name": "Parts Supplier Ltd",
"betrag": 2500.00,
"faelligkeit": "2026-03-15",
"notiz": "Q1 bulk order"
}
```
## POST /api/glaeubiger/{id}/zahlung
### Description
Records a payment made to a creditor.
### Method
POST
### Endpoint
/api/glaeubiger/{id}/zahlung
### Parameters
#### Path Parameters
- **id** (integer) - Required - The ID of the creditor.
#### Request Body
- **betrag** (number) - Required - The amount paid.
### Request Example
```json
{
"betrag": 250.00
}
```
## PUT /api/glaeubiger/{id}
### Description
Updates an existing creditor entry.
### Method
PUT
### Endpoint
/api/glaeubiger/{id}
### Parameters
#### Path Parameters
- **id** (integer) - Required - The ID of the creditor.
#### Request Body
- **faelligkeit** (string) - Optional - The updated due date (YYYY-MM-DD).
- **notiz** (string) - Optional - Updated notes.
### Request Example
```json
{
"faelligkeit": "2026-03-01"
}
```
## DELETE /api/glaeubiger/{id}
### Description
Deletes a specific creditor entry.
### Method
DELETE
### Endpoint
/api/glaeubiger/{id}
### Parameters
#### Path Parameters
- **id** (integer) - Required - The ID of the creditor.
```
--------------------------------
### useResponsive Hook Usage in TSX
Source: https://context7.com/ismanix-creator/60_hideandseek/llms.txt
Demonstrates how to use the `useResponsive` hook to conditionally render components and apply styles based on the viewport size (mobile, tablet, desktop). It shows how to access breakpoint information like 'isMobile', 'isTablet', 'isDesktop', and the current 'width'.
```tsx
import { useResponsive } from '@/hooks/useResponsive';
function ResponsiveLayout({ children }) {
const { isMobile, isTablet, isDesktop, width } = useResponsive();
// Breakpoints from config.toml:
// mobile: < 767px
// tablet: 767px - 1023px
// desktop: >= 1024px
return (
);
}
```
--------------------------------
### Record Payment to Creditor API
Source: https://context7.com/ismanix-creator/60_hideandseek/llms.txt
Records a payment made to a creditor. Requires the creditor ID and the payment amount.
```bash
curl -X POST http://localhost:3000/api/glaeubiger/1/zahlung \
-H "Content-Type: application/json" \
-d '{"betrag": 250.00}'
```
--------------------------------
### Record Payment from Debtor API
Source: https://context7.com/ismanix-creator/60_hideandseek/llms.txt
Records a payment received from a debtor. Requires the debtor ID and the payment amount.
```bash
curl -X POST http://localhost:3000/api/schuldner/1/zahlung \
-H "Content-Type: application/json" \
-d '{"betrag": 250.00}'
```
--------------------------------
### Customer Non-Material Posts API
Source: https://context7.com/ismanix-creator/60_hideandseek/llms.txt
Endpoints for listing, creating, and recording payments on non-material posts for customers.
```APIDOC
## GET /api/kunden-posten-nomat/kunde/{kundeId}
### Description
Lists all non-material posts for a specific customer.
### Method
GET
### Endpoint
/api/kunden-posten-nomat/kunde/{kundeId}
### Parameters
#### Path Parameters
- **kundeId** (integer) - Required - The ID of the customer.
## POST /api/kunden-posten-nomat
### Description
Creates a new non-material post for a customer.
### Method
POST
### Endpoint
/api/kunden-posten-nomat
### Parameters
#### Request Body
- **kunde_id** (integer) - Required - The ID of the customer.
- **datum** (string) - Required - The date of the post (YYYY-MM-DD).
- **bezeichnung** (string) - Required - The description of the charge.
- **betrag** (number) - Required - The amount of the charge.
### Request Example
```json
{
"kunde_id": 1,
"datum": "2026-01-15",
"bezeichnung": "Service fee",
"betrag": 150.00
}
```
## POST /api/kunden-posten-nomat/{id}/zahlung
### Description
Records a payment on a specific non-material post.
### Method
POST
### Endpoint
/api/kunden-posten-nomat/{id}/zahlung
### Parameters
#### Path Parameters
- **id** (integer) - Required - The ID of the non-material post.
#### Request Body
- **betrag** (number) - Required - The amount paid.
### Request Example
```json
{
"betrag": 50.00
}
```
```
--------------------------------
### Record Payment on Material Post API
Source: https://context7.com/ismanix-creator/60_hideandseek/llms.txt
Records a payment against an existing material post. Requires the material post ID and the payment amount.
```bash
curl -X POST http://localhost:3000/api/kunden-posten-mat/1/zahlung \
-H "Content-Type: application/json" \
-d '{"betrag": 75.00}'
```
--------------------------------
### Material Post Management API
Source: https://context7.com/ismanix-creator/60_hideandseek/llms.txt
Endpoints for creating, updating, recording payments on, and deleting material posts.
```APIDOC
## POST /api/kunden-posten-mat
### Description
Creates a new material post for a customer.
### Method
POST
### Endpoint
/api/kunden-posten-mat
### Parameters
#### Request Body
- **kunde_id** (integer) - Required - The ID of the customer.
- **material_id** (integer) - Required - The ID of the material.
- **datum** (string) - Required - The date of the post (YYYY-MM-DD).
- **menge** (integer) - Required - The quantity of the material.
- **preis** (number) - Required - The price of the material.
### Request Example
```json
{
"kunde_id": 1,
"material_id": 1,
"datum": "2026-01-15",
"menge": 20,
"preis": 200.00
}
```
## POST /api/kunden-posten-mat/{id}/zahlung
### Description
Records a payment on a specific material post.
### Method
POST
### Endpoint
/api/kunden-posten-mat/{id}/zahlung
### Parameters
#### Path Parameters
- **id** (integer) - Required - The ID of the material post.
#### Request Body
- **betrag** (number) - Required - The amount paid.
### Request Example
```json
{
"betrag": 75.00
}
```
## PUT /api/kunden-posten-mat/{id}
### Description
Updates an existing material post.
### Method
PUT
### Endpoint
/api/kunden-posten-mat/{id}
### Parameters
#### Path Parameters
- **id** (integer) - Required - The ID of the material post.
#### Request Body
- **notiz** (string) - Optional - Notes to update for the post.
### Request Example
```json
{
"notiz": "Updated delivery terms"
}
```
## DELETE /api/kunden-posten-mat/{id}
### Description
Deletes a specific material post.
### Method
DELETE
### Endpoint
/api/kunden-posten-mat/{id}
### Parameters
#### Path Parameters
- **id** (integer) - Required - The ID of the material post.
```
--------------------------------
### Record Payment on Non-Material Post API
Source: https://context7.com/ismanix-creator/60_hideandseek/llms.txt
Records a payment against an existing non-material post. Requires the non-material post ID and the payment amount.
```bash
curl -X POST http://localhost:3000/api/kunden-posten-nomat/1/zahlung \
-H "Content-Type: application/json" \
-d '{"betrag": 50.00}'
```
--------------------------------
### Debtors Management API
Source: https://context7.com/ismanix-creator/60_hideandseek/llms.txt
Endpoints for managing debtors, including listing, creating, updating, recording payments, and deleting entries.
```APIDOC
## GET /api/schuldner
### Description
Lists all debtors.
### Method
GET
### Endpoint
/api/schuldner
## POST /api/schuldner
### Description
Creates a new debtor entry.
### Method
POST
### Endpoint
/api/schuldner
### Parameters
#### Request Body
- **datum** (string) - Required - The date of the entry (YYYY-MM-DD).
- **name** (string) - Required - The name of the debtor.
- **betrag** (number) - Required - The total amount owed.
- **faelligkeit** (string) - Required - The due date (YYYY-MM-DD).
- **notiz** (string) - Optional - Notes about the debtor entry.
### Request Example
```json
{
"datum": "2026-01-15",
"name": "Client ABC",
"betrag": 750.00,
"faelligkeit": "2026-02-28",
"notiz": "Consulting fee"
}
```
## POST /api/schuldner/{id}/zahlung
### Description
Records a payment received from a debtor.
### Method
POST
### Endpoint
/api/schuldner/{id}/zahlung
### Parameters
#### Path Parameters
- **id** (integer) - Required - The ID of the debtor.
#### Request Body
- **betrag** (number) - Required - The amount paid.
### Request Example
```json
{
"betrag": 250.00
}
```
## PUT /api/schuldner/{id}
### Description
Updates an existing debtor entry.
### Method
PUT
### Endpoint
/api/schuldner/{id}
### Parameters
#### Path Parameters
- **id** (integer) - Required - The ID of the debtor.
#### Request Body
- **notiz** (string) - Optional - Updated notes.
- **faelligkeit** (string) - Optional - The updated due date (YYYY-MM-DD).
### Request Example
```json
{
"notiz": "Payment plan agreed"
}
```
## DELETE /api/schuldner/{id}
### Description
Deletes a specific debtor entry.
### Method
DELETE
### Endpoint
/api/schuldner/{id}
### Parameters
#### Path Parameters
- **id** (integer) - Required - The ID of the debtor.
```
--------------------------------
### Health Check
Source: https://context7.com/ismanix-creator/60_hideandseek/llms.txt
Verify that the API server is running and responsive.
```APIDOC
## GET /api/health
### Description
Simple endpoint to verify the API server is running and responsive.
### Method
GET
### Endpoint
/api/health
### Parameters
#### Query Parameters
None
### Request Example
None
### Response
#### Success Response (200)
- **success** (boolean) - Indicates if the health check was successful.
#### Response Example
```json
{
"success": true
}
```
```
--------------------------------
### Material Movement Operations
Source: https://context7.com/ismanix-creator/60_hideandseek/llms.txt
Track cash sales (BAR) and customer credit sales (KOMBI) with automatic stock deduction.
```APIDOC
## Material Movement API Endpoints
### Record cash sale (BAR movement)
### Method
POST
### Endpoint
/api/material-bewegungen-bar
### Parameters
#### Request Body
- **material_id** (integer) - Required - The ID of the material being sold.
- **datum** (string) - Required - Date of the transaction.
- **menge** (integer) - Required - Quantity sold.
- **preis** (float) - Required - Price of the sale.
- **notiz** (string) - Optional - Notes about the transaction.
### Request Example
```json
{
"material_id": 1,
"datum": "2026-01-15",
"menge": 5,
"preis": 50.00,
"notiz": "Walk-in customer"
}
```
### Response
#### Success Response (200)
- Indicates successful recording of the BAR movement.
## Record customer credit sale (KOMBI movement)
### Method
POST
### Endpoint
/api/material-bewegungen-kombi
### Parameters
#### Request Body
- **material_id** (integer) - Required - The ID of the material being sold.
- **kunde_id** (integer) - Required - The ID of the customer.
- **datum** (string) - Required - Date of the transaction.
- **menge** (integer) - Required - Quantity sold.
- **preis** (float) - Required - Price of the sale.
- **notiz** (string) - Optional - Notes about the transaction.
### Request Example
```json
{
"material_id": 1,
"kunde_id": 1,
"datum": "2026-01-15",
"menge": 10,
"preis": 100.00,
"notiz": "Regular customer order"
}
```
### Response
#### Success Response (200)
- Indicates successful recording of the KOMBI movement.
## List BAR movements for a material
### Method
GET
### Endpoint
/api/material-bewegungen-bar
### Parameters
#### Query Parameters
- **materialId** (integer) - Required - The ID of the material to filter movements by.
### Response
#### Success Response (200)
- Returns an array of BAR movement objects.
## List KOMBI movements for a material
### Method
GET
### Endpoint
/api/material-bewegungen-kombi
### Parameters
#### Query Parameters
- **materialId** (integer) - Required - The ID of the material to filter movements by.
### Response
#### Success Response (200)
- Returns an array of KOMBI movement objects.
## Get combined material history
### Method
GET
### Endpoint
/api/material/historie
### Parameters
#### Query Parameters
- **materialId** (integer) - Required - The ID of the material to get the history for.
### Response
#### Success Response (200)
- Returns the combined history of movements for the specified material.
```
--------------------------------
### Update Debtor API
Source: https://context7.com/ismanix-creator/60_hideandseek/llms.txt
Updates an existing debtor entry. Requires the debtor ID and the fields to update, such as 'notiz'.
```bash
curl -X PUT http://localhost:3000/api/schuldner/1 \
-H "Content-Type: application/json" \
-d '{"notiz": "Payment plan agreed"}'
```
--------------------------------
### Delete Debtor API
Source: https://context7.com/ismanix-creator/60_hideandseek/llms.txt
Deletes an existing debtor entry. Requires the debtor ID.
```bash
curl -X DELETE http://localhost:3000/api/schuldner/1
```
--------------------------------
### Delete Creditor API
Source: https://context7.com/ismanix-creator/60_hideandseek/llms.txt
Deletes an existing creditor entry. Requires the creditor ID.
```bash
curl -X DELETE http://localhost:3000/api/glaeubiger/1
```
--------------------------------
### Material CRUD Operations
Source: https://context7.com/ismanix-creator/60_hideandseek/llms.txt
Complete material inventory management with stock tracking, purchase/sale prices, and revenue calculations.
```APIDOC
## Material API Endpoints
### List all materials
### Method
GET
### Endpoint
/api/material
### Parameters
None
### Response
#### Success Response (200)
- **success** (boolean) - Indicates if the operation was successful.
- **data** (array) - An array of material objects.
- **id** (integer) - Unique identifier for the material.
- **datum** (string) - Date associated with the material entry.
- **bezeichnung** (string) - Name or description of the material.
- **menge** (integer) - Quantity of the material.
- **ek_stueck** (float) - Purchase price per unit.
- **ek_gesamt** (float) - Total purchase price.
- **vk_stueck** (float) - Sale price per unit.
- **bestand** (integer) - Current stock level.
- **einnahmen_bar** (float) - Revenue from cash sales.
- **einnahmen_kombi** (float) - Revenue from credit sales.
- **gewinn_aktuell** (float) - Current profit.
- **gewinn_theoretisch** (float) - Theoretical profit.
- **notiz** (string) - Notes about the material.
- **created_at** (string) - Timestamp of creation.
- **updated_at** (string) - Timestamp of last update.
#### Response Example
```json
{
"success": true,
"data": [
{
"id": 1,
"datum": "2026-01-10",
"bezeichnung": "Premium Widget",
"menge": 100,
"ek_stueck": 5.00,
"ek_gesamt": 500.00,
"vk_stueck": 10.00,
"bestand": 75,
"einnahmen_bar": 150.00,
"einnahmen_kombi": 100.00,
"gewinn_aktuell": 125.00,
"gewinn_theoretisch": 250.00,
"notiz": "First batch",
"created_at": "2026-01-10T10:00:00Z",
"updated_at": "2026-01-10T10:00:00Z"
}
]
}
```
## Get single material by ID
### Method
GET
### Endpoint
/api/material/{id}
### Parameters
#### Path Parameters
- **id** (integer) - Required - The ID of the material to retrieve.
### Response
#### Success Response (200)
- Returns a single material object (structure same as above).
## Create new material
### Method
POST
### Endpoint
/api/material
### Parameters
#### Request Body
- **datum** (string) - Required - Date associated with the material entry.
- **bezeichnung** (string) - Required - Name or description of the material.
- **menge** (integer) - Required - Quantity of the material.
- **ek_stueck** (float) - Required - Purchase price per unit.
- **ek_gesamt** (float) - Required - Total purchase price.
- **vk_stueck** (float) - Required - Sale price per unit.
- **bestand** (integer) - Required - Initial stock level.
- **notiz** (string) - Optional - Notes about the material.
### Request Example
```json
{
"datum": "2026-01-15",
"bezeichnung": "Standard Widget",
"menge": 50,
"ek_stueck": 3.00,
"ek_gesamt": 150.00,
"vk_stueck": 7.50,
"bestand": 50,
"notiz": "Budget line"
}
```
### Response
#### Success Response (200)
- Returns the created material object.
## Update existing material
### Method
PUT
### Endpoint
/api/material/{id}
### Parameters
#### Path Parameters
- **id** (integer) - Required - The ID of the material to update.
#### Request Body
- **bezeichnung** (string) - Optional - New name or description of the material.
- **vk_stueck** (float) - Optional - New sale price per unit.
- Other fields can be updated as well.
### Request Example
```json
{
"bezeichnung": "Premium Widget v2",
"vk_stueck": 12.00
}
```
### Response
#### Success Response (200)
- Returns the updated material object.
## Delete material
### Method
DELETE
### Endpoint
/api/material/{id}
### Parameters
#### Path Parameters
- **id** (integer) - Required - The ID of the material to delete.
### Response
#### Success Response (200)
- Indicates successful deletion (e.g., `{"success": true}`).
```
--------------------------------
### Material CRUD Operations API
Source: https://context7.com/ismanix-creator/60_hideandseek/llms.txt
Manages material inventory, including stock levels, purchase, and sale prices. Supports listing, retrieving, creating, updating, and deleting material entries.
```bash
# List all materials
curl http://localhost:3000/api/material
# Response
{
"success": true,
"data": [
{
"id": 1,
"datum": "2026-01-10",
"bezeichnung": "Premium Widget",
"menge": 100,
"ek_stueck": 5.00,
"ek_gesamt": 500.00,
"vk_stueck": 10.00,
"bestand": 75,
"einnahmen_bar": 150.00,
"einnahmen_kombi": 100.00,
"gewinn_aktuell": 125.00,
"gewinn_theoretisch": 250.00,
"notiz": "First batch",
"created_at": "2026-01-10T10:00:00Z",
"updated_at": "2026-01-10T10:00:00Z"
}
]
}
# Get single material by ID
curl http://localhost:3000/api/material/1
# Create new material
curl -X POST http://localhost:3000/api/material \
-H "Content-Type: application/json" \
-d '{
"datum": "2026-01-15",
"bezeichnung": "Standard Widget",
"menge": 50,
"ek_stueck": 3.00,
"ek_gesamt": 150.00,
"vk_stueck": 7.50,
"bestand": 50,
"notiz": "Budget line"
}'
# Update existing material
curl -X PUT http://localhost:3000/api/material/1 \
-H "Content-Type: application/json" \
-d '{
"bezeichnung": "Premium Widget v2",
"vk_stueck": 12.00
}'
# Delete material
curl -X DELETE http://localhost:3000/api/material/1
```
--------------------------------
### Update Creditor API
Source: https://context7.com/ismanix-creator/60_hideandseek/llms.txt
Updates an existing creditor entry. Requires the creditor ID and the fields to update, such as 'faelligkeit'.
```bash
curl -X PUT http://localhost:3000/api/glaeubiger/1 \
-H "Content-Type: application/json" \
-d '{"faelligkeit": "2026-03-01"}'
```
--------------------------------
### Material Movement Operations API
Source: https://context7.com/ismanix-creator/60_hideandseek/llms.txt
Tracks material sales, differentiating between cash (BAR) and credit (KOMBI) transactions. Automatically updates stock levels upon recording a sale. Supports recording movements and listing transaction history.
```bash
# Record cash sale (BAR movement)
curl -X POST http://localhost:3000/api/material-bewegungen-bar \
-H "Content-Type: application/json" \
-d '{
"material_id": 1,
"datum": "2026-01-15",
"menge": 5,
"preis": 50.00,
"notiz": "Walk-in customer"
}'
# Record customer credit sale (KOMBI movement)
curl -X POST http://localhost:3000/api/material-bewegungen-kombi \
-H "Content-Type: application/json" \
-d '{
"material_id": 1,
"kunde_id": 1,
"datum": "2026-01-15",
"menge": 10,
"preis": 100.00,
"notiz": "Regular customer order"
}'
# List BAR movements for a material
curl "http://localhost:3000/api/material-bewegungen-bar?materialId=1"
# List KOMBI movements for a material
curl "http://localhost:3000/api/material-bewegungen-kombi?materialId=1"
# Get combined material history
curl "http://localhost:3000/api/material/historie?materialId=1"
```
--------------------------------
### Table Component Configuration in TSX
Source: https://context7.com/ismanix-creator/60_hideandseek/llms.txt
Defines the structure and behavior of a data Table component, specifying columns with their keys, labels, widths, types, and custom render functions for actions. It shows how to integrate 'Button' components for edit and delete actions within table rows. The 'Table' component is used here with 'isLoading' state.
```tsx
import { Table } from '@/components/ui/Table';
import type { TableColumn } from '@/types/ui.types';
import { Button } from '@/components/ui/Button';
import { Edit, Trash2 } from 'lucide-react';
interface Material {
id: number;
bezeichnung: string;
menge: number;
vk_stueck: number;
bestand: number;
}
const columns: TableColumn[] = [
{ key: 'bezeichnung', label: 'Bezeichnung', width: '30%', type: 'text' },
{ key: 'menge', label: 'Menge', width: '15%', type: 'number' },
{ key: 'vk_stueck', label: 'VK/Stück', width: '15%', type: 'currency' },
{ key: 'bestand', label: 'Bestand', width: '15%', type: 'number' },
{
key: 'actions',
label: 'Aktionen',
width: '25%',
type: 'actions',
render: (item) => (
);
}
```
--------------------------------
### Update Material Post API
Source: https://context7.com/ismanix-creator/60_hideandseek/llms.txt
Updates an existing material post. Requires the material post ID and the fields to update, such as 'notiz'.
```bash
curl -X PUT http://localhost:3000/api/kunden-posten-mat/1 \
-H "Content-Type: application/json" \
-d '{"notiz": "Updated delivery terms"}'
```
--------------------------------
### Delete Material Post API
Source: https://context7.com/ismanix-creator/60_hideandseek/llms.txt
Deletes an existing material post. Requires the material post ID.
```bash
curl -X DELETE http://localhost:3000/api/kunden-posten-mat/1
```
=== COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.