docs: update brain knowledge base
This commit is contained in:
@@ -1,227 +0,0 @@
|
|||||||
# LicServer API Spezifikation (v1)
|
|
||||||
|
|
||||||
Dokumentation der REST-Schnittstellen des CASPOS Lizenzservers.
|
|
||||||
|
|
||||||
## 1. Endpunkte (Port 9981 - Activation API)
|
|
||||||
|
|
||||||
### Activation (Aktivierung)
|
|
||||||
|
|
||||||
#### `POST /v1/activate`
|
|
||||||
Aktiviert eine neue Lizenz.
|
|
||||||
|
|
||||||
**Request Body (`application/json`):**
|
|
||||||
```json
|
|
||||||
{
|
|
||||||
"productId": "string",
|
|
||||||
"productVersion": "string",
|
|
||||||
"activationCode": "string",
|
|
||||||
"hardwareBindingType": "string",
|
|
||||||
"hardwareBindingId": "string"
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
**Response `200 OK` (`application/json`):**
|
|
||||||
```json
|
|
||||||
{
|
|
||||||
"licenseData": {
|
|
||||||
"id": "string",
|
|
||||||
"serialNumber": "string",
|
|
||||||
"productId": "string",
|
|
||||||
"filename": "string",
|
|
||||||
"content": "string" // Base64 Byte-Inhalt
|
|
||||||
},
|
|
||||||
"apiKey": "string",
|
|
||||||
"secret": "string"
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
**Response Headers:**
|
|
||||||
- `ETag` (string): Der ETag-Wert der Lizenz.
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
#### `POST /v1/activate-existing`
|
|
||||||
Aktiviert eine bereits vorhandene Lizenz erneut.
|
|
||||||
|
|
||||||
**Request Body (`application/json`):**
|
|
||||||
```json
|
|
||||||
{
|
|
||||||
"productId": "string",
|
|
||||||
"productVersion": "string",
|
|
||||||
"serialNumber": "string",
|
|
||||||
"proofOfPossessionHash": "string",
|
|
||||||
"salt": "string",
|
|
||||||
"hardwareBindingType": "string",
|
|
||||||
"hardwareBindingId": "string"
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
**Response `200 OK` (`application/json`):**
|
|
||||||
*Gleiche Struktur wie bei `/v1/activate`.*
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
### Licenses (Lizenzen)
|
|
||||||
|
|
||||||
#### `GET /v1/licenses/{id}`
|
|
||||||
Holt die Lizenz-Details zu einer bestimmten Lizenz-ID.
|
|
||||||
|
|
||||||
**Request Parameters:**
|
|
||||||
- `id` (path, string, required): Die UUID der Lizenz.
|
|
||||||
- `If-None-Match` (header, string, optional): ETag zur Cache-Validierung.
|
|
||||||
|
|
||||||
**Response `200 OK` (`application/json`):**
|
|
||||||
```json
|
|
||||||
{
|
|
||||||
"id": "string",
|
|
||||||
"serialNumber": "string",
|
|
||||||
"productId": "string",
|
|
||||||
"filename": "string",
|
|
||||||
"content": "string" // Base64 Byte-Inhalt
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
**Response `304 Not Modified`:**
|
|
||||||
Falls die Lizenz nicht verändert wurde.
|
|
||||||
|
|
||||||
**Response `404 Not Found` / `403 Forbidden`:**
|
|
||||||
Standard Fehlerobjekt `ProblemDetails`.
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## 2. Endpunkte (Port 9980 - Management API)
|
|
||||||
|
|
||||||
Alle Anfragen an die Management-API müssen authentifiziert sein.
|
|
||||||
- **Header-Format:** `X-Api-Key: <Schlüssel>`
|
|
||||||
|
|
||||||
### Partners (Partner)
|
|
||||||
|
|
||||||
#### `GET /api-v1/partners`
|
|
||||||
Gibt eine paginierte Liste aller Partner zurück.
|
|
||||||
|
|
||||||
**Request Parameters (Query):**
|
|
||||||
- `search` (string, optional): Filtert nach Name/E-Mail.
|
|
||||||
- `page` (integer, default: 1)
|
|
||||||
- `pageSize` (integer, default: 20)
|
|
||||||
|
|
||||||
**Response `200 OK` (`application/json`):**
|
|
||||||
```json
|
|
||||||
{
|
|
||||||
"page": 1,
|
|
||||||
"pageSize": 20,
|
|
||||||
"totalCount": 1,
|
|
||||||
"totalPages": 1,
|
|
||||||
"hasNextPage": false,
|
|
||||||
"hasPreviousPage": false,
|
|
||||||
"items": [
|
|
||||||
{
|
|
||||||
"id": "string (UUID)",
|
|
||||||
"name": "string",
|
|
||||||
"email": "string",
|
|
||||||
"erpId": "string"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
#### `GET /api-v1/partners/{id}`
|
|
||||||
Holt Partner-Details zu einer bestimmten ID.
|
|
||||||
|
|
||||||
**Response `200 OK` (`application/json`):**
|
|
||||||
```json
|
|
||||||
{
|
|
||||||
"id": "string (UUID)",
|
|
||||||
"name": "string",
|
|
||||||
"email": "string",
|
|
||||||
"erpId": "string"
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
### Customers (Kunden von Partnern)
|
|
||||||
|
|
||||||
#### `GET /api-v1/partners/{partnerId}/customers`
|
|
||||||
Gibt eine paginierte Liste aller Kunden eines bestimmten Partners zurück.
|
|
||||||
|
|
||||||
**Request Parameters (Query):**
|
|
||||||
- `search` (string, optional): Filtert nach Name/E-Mail.
|
|
||||||
- `page` (integer, default: 1)
|
|
||||||
- `pageSize` (integer, default: 20)
|
|
||||||
|
|
||||||
**Response `200 OK` (`application/json`):**
|
|
||||||
```json
|
|
||||||
{
|
|
||||||
"page": 1,
|
|
||||||
"pageSize": 20,
|
|
||||||
"totalCount": 1,
|
|
||||||
"totalPages": 1,
|
|
||||||
"hasNextPage": false,
|
|
||||||
"hasPreviousPage": false,
|
|
||||||
"items": [
|
|
||||||
{
|
|
||||||
"id": "string (UUID)",
|
|
||||||
"name": "string",
|
|
||||||
"street": "string",
|
|
||||||
"houseNumber": "string",
|
|
||||||
"houseNumberAddon": "string",
|
|
||||||
"zipCode": "string",
|
|
||||||
"city": "string",
|
|
||||||
"countryCode": "string",
|
|
||||||
"email": "string",
|
|
||||||
"partnerId": "string (UUID)",
|
|
||||||
"erpId": "string"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
#### `GET /api-v1/partners/{partnerId}/customers/{customerId}`
|
|
||||||
Holt detaillierte Kundeninformationen.
|
|
||||||
|
|
||||||
**Response `200 OK` (`application/json`):**
|
|
||||||
```json
|
|
||||||
{
|
|
||||||
"id": "string (UUID)",
|
|
||||||
"name": "string",
|
|
||||||
"street": "string",
|
|
||||||
"houseNumber": "string",
|
|
||||||
"houseNumberAddon": "string",
|
|
||||||
"zipCode": "string",
|
|
||||||
"city": "string",
|
|
||||||
"countryCode": "string",
|
|
||||||
"email": "string",
|
|
||||||
"partnerId": "string (UUID)",
|
|
||||||
"erpId": "string",
|
|
||||||
"partnerName": "string",
|
|
||||||
"taxNumber": "string",
|
|
||||||
"vatIdNumber": "string",
|
|
||||||
"notes": "string",
|
|
||||||
"locations": []
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## 3. Typen & Schemas
|
|
||||||
|
|
||||||
### `LicenseData`
|
|
||||||
```json
|
|
||||||
{
|
|
||||||
"id": "string",
|
|
||||||
"serialNumber": "string",
|
|
||||||
"productId": "string",
|
|
||||||
"filename": "string",
|
|
||||||
"content": "string" // Base64 Byte-Inhalt
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
### `ProblemDetails`
|
|
||||||
```json
|
|
||||||
{
|
|
||||||
"type": "string",
|
|
||||||
"title": "string",
|
|
||||||
"status": 0,
|
|
||||||
"detail": "string",
|
|
||||||
"instance": "string"
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,64 +0,0 @@
|
|||||||
# Supabase Schema
|
|
||||||
|
|
||||||
## `companies` (Unternehmen)
|
|
||||||
- Repräsentiert die Partner-Unternehmen (Retailer).
|
|
||||||
- `id` (UUID, Primary Key)
|
|
||||||
- `name` (TEXT)
|
|
||||||
- `street`, `zip`, `city`, `email` (Adressdaten)
|
|
||||||
|
|
||||||
## `users` (Systembenutzer)
|
|
||||||
- Erweitert die Authentifizierungsdaten aus `auth.users`.
|
|
||||||
- `id` (UUID, References `auth.users(id)`)
|
|
||||||
- `role` (TEXT, standardmäßig `'partner'`, oder `'admin'`)
|
|
||||||
- `company_id` (UUID, References `public.companies(id)`)
|
|
||||||
|
|
||||||
## `profiles` (Benutzerprofile)
|
|
||||||
- Stammdaten der einzelnen Benutzer.
|
|
||||||
- `id` (UUID, References `auth.users(id)`)
|
|
||||||
- `first_name`, `last_name`, `email` etc.
|
|
||||||
|
|
||||||
## `end_customers` (Endkunden)
|
|
||||||
- `id` (UUID, Primary Key)
|
|
||||||
- `partner_id` (UUID, References `public.companies(id)`)
|
|
||||||
- `company_name` (TEXT)
|
|
||||||
- `first_name`, `last_name`, `street`, `zip`, `city`, `email`
|
|
||||||
- `bank_iban`, `bank_bic`, `bank_name`, `bank_owner`
|
|
||||||
- `is_anonymized` (BOOLEAN)
|
|
||||||
|
|
||||||
## `products` (Katalogprodukte)
|
|
||||||
- `id`, `name`, `base_price`, `tax_rate`, `billing_interval` (`one_time` / `monthly`).
|
|
||||||
- `requirements` (UUID[])
|
|
||||||
- `exclusions` (UUID[])
|
|
||||||
|
|
||||||
## `product_modules` (Zusatzmodule)
|
|
||||||
- `id`, `product_id` (References `products`), `name`, `price`, `has_quantity` (BOOLEAN).
|
|
||||||
- `requirements` (UUID[])
|
|
||||||
- `exclusions` (UUID[])
|
|
||||||
|
|
||||||
## `orders` (Bestellungen / Anfragen)
|
|
||||||
- `id` (UUID, Primary Key)
|
|
||||||
- `user_id` (UUID, References `auth.users(id)`)
|
|
||||||
- `order_number` (TEXT)
|
|
||||||
- `order_hash` (TEXT)
|
|
||||||
- `end_customer_id` (UUID, References `end_customers(id)`)
|
|
||||||
- `total_price` (DECIMAL)
|
|
||||||
- `customer_data` (JSONB)
|
|
||||||
- `order_data` (JSONB)
|
|
||||||
- `pdf_url` (TEXT)
|
|
||||||
- `status` (TEXT)
|
|
||||||
|
|
||||||
## `categories` (Kategorien)
|
|
||||||
- Steuert das Layout und Verhalten im Wizard.
|
|
||||||
- `id` (UUID, Primary Key)
|
|
||||||
- `name` (TEXT)
|
|
||||||
- `is_required` (BOOLEAN)
|
|
||||||
- `allow_multiselect` (BOOLEAN)
|
|
||||||
- `sort_order` (INTEGER)
|
|
||||||
- `show_in_branches` (BOOLEAN)
|
|
||||||
|
|
||||||
## `settings` (Systemeinstellungen)
|
|
||||||
- Globale Shopeinstellungen (SMTP & Lizenzserver).
|
|
||||||
- `id` (TEXT, Primary Key, z.B. `'licserver'`, `'smtp'`)
|
|
||||||
- `host`, `port`, `secure`, `user`, `pass` (SMTP-Konfiguration)
|
|
||||||
- `licserver_base_url`, `licserver_api_key` (CASPOS Lizenzserver-Einstellungen)
|
|
||||||
- `updated_at` (TIMESTAMPTZ)
|
|
||||||
|
|||||||
Reference in New Issue
Block a user