|
6 | 6 |
|
7 | 7 | This repository contains the credential prototype for connecting MultiFlexi to Stormware Pohoda mServer API. |
8 | 8 |
|
9 | | -## Overview |
| 9 | +## Packages |
10 | 10 |
|
11 | | -This credential prototype defines the configuration fields required to connect to the Pohoda mServer API, including support for a secondary account for year-end (December/January) data entry. |
| 11 | +| Package | Contents | |
| 12 | +|---|---| |
| 13 | +| `multiflexi-mserver` | Credential prototype JSON, SVG logo, `CredentialProtoType\MServer` PHP class | |
| 14 | +| `multiflexi-mserver-ui` | `Ui\CredentialType\MServer` PHP class — web form with live connection test | |
12 | 15 |
|
13 | 16 | ## Fields |
14 | 17 |
|
15 | | -- **POHODA_ICO**: Organization Number for Pohoda (required) |
16 | | -- **POHODA_URL**: URL of the mServer API (required) |
17 | | -- **POHODA_USERNAME**: Username for the mServer API (required) |
18 | | -- **POHODA_PASSWORD**: Password for the mServer API (required) |
19 | | -- **POHODA_SECONDARY_USERNAME**: Secondary account username for writing December data in January (optional) |
20 | | -- **POHODA_SECONDARY_PASSWORD**: Secondary account password for writing December data in January (optional) |
| 18 | +| Keyword | Type | Required | Description | |
| 19 | +|---|---|---|---| |
| 20 | +| `POHODA_ICO` | string | yes | Organization Number (IČO) | |
| 21 | +| `POHODA_URL` | string | yes | mServer API base URL, e.g. `http://pohoda:40000` | |
| 22 | +| `POHODA_USERNAME` | string | yes | mServer API username | |
| 23 | +| `POHODA_PASSWORD` | password | yes | mServer API password | |
| 24 | +| `POHODA_SECONDARY_USERNAME` | string | no | Secondary account username for December→January data entry | |
| 25 | +| `POHODA_SECONDARY_PASSWORD` | password | no | Secondary account password for December→January data entry | |
21 | 26 |
|
22 | | -## Year-End Data Entry Mechanism |
| 27 | +## Smart Credential Prototype (UI) |
23 | 28 |
|
24 | | -If data for December is being entered in January, the system will use the secondary account credentials (if provided) to write data into the previous year, provided the secondary account has the necessary permissions. |
| 29 | +When `multiflexi-mserver-ui` is installed, the credential form performs a live connection test against `{POHODA_URL}/status` using HTTP Basic Auth. On success it displays: |
25 | 30 |
|
26 | | -## Usage |
| 31 | +- **Company** — company name registered in Pohoda |
| 32 | +- **Status** — server state (`idle` / `busy`) |
| 33 | +- **Processing** — number of requests currently being processed |
| 34 | +- **Server** — mServer self-reported URL |
27 | 35 |
|
28 | | -1. Place the `mserver.credprototype.json` file in your MultiFlexi credential prototypes directory. |
29 | | -2. Configure the required fields in the MultiFlexi UI or via configuration management. |
30 | | -3. For organizations that need to write December data in January, provide the secondary account credentials with permissions for the previous year. |
| 36 | +Authentication failures and network errors are shown as inline alerts. |
31 | 37 |
|
| 38 | +## Year-End Data Entry |
| 39 | + |
| 40 | +If data for December is being entered in January, provide the secondary account credentials. That account must have write permissions for the previous fiscal year in Pohoda. |
| 41 | + |
| 42 | +## Installation |
| 43 | + |
| 44 | +```sh |
| 45 | +apt install multiflexi-mserver # core fields + JSON prototype |
| 46 | +apt install multiflexi-mserver-ui # web form with connection check |
| 47 | +``` |
| 48 | + |
| 49 | +The postinst script registers the prototype automatically: |
| 50 | + |
| 51 | +```sh |
| 52 | +multiflexi-cli credential-prototype:import-json \ |
| 53 | + --file /usr/lib/multiflexi-mserver/multiflexi/mserver.credprototype.json |
| 54 | +``` |
32 | 55 |
|
33 | 56 | ## License |
34 | 57 |
|
|
0 commit comments