From ea911cf8dd8f45b07aa203130b25e8a66db8f759 Mon Sep 17 00:00:00 2001
From: cwalter <cwalter@ethz.ch>
Date: Fri, 27 Dec 2024 18:30:58 +0000
Subject: [PATCH] kst evaluation

---
 openapi.json               | 272 ++++++++++++++++++-------------------
 src/client/schemas.gen.ts  | 182 +++++++++++++++++--------
 src/client/services.gen.ts |  37 +++--
 src/client/types.gen.ts    |  55 +++++---
 src/main.tsx               |   6 +
 src/pages/KstEval.tsx      |  92 +++++++++++++
 src/pages/root.tsx         |   5 +
 7 files changed, 420 insertions(+), 229 deletions(-)
 create mode 100644 src/pages/KstEval.tsx

diff --git a/openapi.json b/openapi.json
index f396efe..86813e1 100644
--- a/openapi.json
+++ b/openapi.json
@@ -523,15 +523,6 @@
               "title": "Kst  Budget Minus"
             }
           },
-          {
-            "name": "kst__visibility",
-            "in": "query",
-            "required": false,
-            "schema": {
-              "anyOf": [{ "type": "integer" }, { "type": "null" }],
-              "title": "Kst  Visibility"
-            }
-          },
           {
             "name": "debitor__search",
             "in": "query",
@@ -631,15 +622,6 @@
               "title": "Debitor  Kst  Budget Minus"
             }
           },
-          {
-            "name": "debitor__kst__visibility",
-            "in": "query",
-            "required": false,
-            "schema": {
-              "anyOf": [{ "type": "integer" }, { "type": "null" }],
-              "title": "Debitor  Kst  Visibility"
-            }
-          },
           {
             "name": "debitor__ledger__search",
             "in": "query",
@@ -1115,15 +1097,6 @@
               "anyOf": [{ "type": "integer" }, { "type": "null" }],
               "title": "Budget Minus"
             }
-          },
-          {
-            "name": "visibility",
-            "in": "query",
-            "required": false,
-            "schema": {
-              "anyOf": [{ "type": "integer" }, { "type": "null" }],
-              "title": "Visibility"
-            }
           }
         ],
         "responses": {
@@ -1708,15 +1681,6 @@
               "title": "Debitor  Kst  Budget Minus"
             }
           },
-          {
-            "name": "debitor__kst__visibility",
-            "in": "query",
-            "required": false,
-            "schema": {
-              "anyOf": [{ "type": "integer" }, { "type": "null" }],
-              "title": "Debitor  Kst  Visibility"
-            }
-          },
           {
             "name": "debitor__ledger__search",
             "in": "query",
@@ -1879,15 +1843,6 @@
               "title": "Creditor  Kst  Budget Minus"
             }
           },
-          {
-            "name": "creditor__kst__visibility",
-            "in": "query",
-            "required": false,
-            "schema": {
-              "anyOf": [{ "type": "integer" }, { "type": "null" }],
-              "title": "Creditor  Kst  Visibility"
-            }
-          },
           {
             "name": "creditor__ledger__search",
             "in": "query",
@@ -2382,15 +2337,6 @@
               "title": "Creditor  Kst  Budget Minus"
             }
           },
-          {
-            "name": "creditor__kst__visibility",
-            "in": "query",
-            "required": false,
-            "schema": {
-              "anyOf": [{ "type": "integer" }, { "type": "null" }],
-              "title": "Creditor  Kst  Visibility"
-            }
-          },
           {
             "name": "creditor__ledger__search",
             "in": "query",
@@ -2943,15 +2889,6 @@
               "title": "Creditor  Kst  Budget Minus"
             }
           },
-          {
-            "name": "creditor__kst__visibility",
-            "in": "query",
-            "required": false,
-            "schema": {
-              "anyOf": [{ "type": "integer" }, { "type": "null" }],
-              "title": "Creditor  Kst  Visibility"
-            }
-          },
           {
             "name": "creditor__ledger__search",
             "in": "query",
@@ -3437,15 +3374,6 @@
               "title": "Creditor  Kst  Budget Minus"
             }
           },
-          {
-            "name": "creditor__kst__visibility",
-            "in": "query",
-            "required": false,
-            "schema": {
-              "anyOf": [{ "type": "integer" }, { "type": "null" }],
-              "title": "Creditor  Kst  Visibility"
-            }
-          },
           {
             "name": "creditor__ledger__search",
             "in": "query",
@@ -3822,9 +3750,9 @@
     "/api/files/files/{file_id}": {
       "get": {
         "tags": ["files"],
-        "summary": "Get File",
+        "summary": "Get File Request",
         "description": "Generate a presigned URL for downloading the file from MinIO.",
-        "operationId": "files-get_file",
+        "operationId": "files-get_file_request",
         "security": [{ "HTTPBearer": [] }],
         "parameters": [
           {
@@ -4385,15 +4313,6 @@
               "title": "Creditor  Kst  Budget Minus"
             }
           },
-          {
-            "name": "creditor__kst__visibility",
-            "in": "query",
-            "required": false,
-            "schema": {
-              "anyOf": [{ "type": "integer" }, { "type": "null" }],
-              "title": "Creditor  Kst  Visibility"
-            }
-          },
           {
             "name": "creditor__ledger__search",
             "in": "query",
@@ -4877,15 +4796,6 @@
               "title": "Creditor  Kst  Budget Minus"
             }
           },
-          {
-            "name": "creditor__kst__visibility",
-            "in": "query",
-            "required": false,
-            "schema": {
-              "anyOf": [{ "type": "integer" }, { "type": "null" }],
-              "title": "Creditor  Kst  Visibility"
-            }
-          },
           {
             "name": "creditor__ledger__search",
             "in": "query",
@@ -5157,6 +5067,52 @@
           }
         }
       }
+    },
+    "/api/evaluation/": {
+      "get": {
+        "tags": ["evaluation"],
+        "summary": "Read Ksts",
+        "description": "Retrieve all the ksts and then add the effective_plus and effective_minus fields.\ncalculated from all the creditors/debitors.",
+        "operationId": "evaluation-read_Ksts",
+        "security": [{ "HTTPBearer": [] }],
+        "parameters": [
+          {
+            "name": "page",
+            "in": "query",
+            "required": false,
+            "schema": { "type": "integer", "default": 0, "title": "Page" }
+          },
+          {
+            "name": "limit",
+            "in": "query",
+            "required": false,
+            "schema": {
+              "type": "integer",
+              "maximum": 1000,
+              "default": 100,
+              "title": "Limit"
+            }
+          }
+        ],
+        "responses": {
+          "200": {
+            "description": "Successful Response",
+            "content": {
+              "application/json": {
+                "schema": { "$ref": "#/components/schemas/KstsEval" }
+              }
+            }
+          },
+          "422": {
+            "description": "Validation Error",
+            "content": {
+              "application/json": {
+                "schema": { "$ref": "#/components/schemas/HTTPValidationError" }
+              }
+            }
+          }
+        }
+      }
     }
   },
   "components": {
@@ -5187,13 +5143,13 @@
             "type": "string",
             "format": "date-time",
             "title": "Time Create",
-            "default": "2024-12-22T20:03:37.305318"
+            "default": "2024-12-27T18:58:34.745688"
           },
           "time_modified": {
             "type": "string",
             "format": "date-time",
             "title": "Time Modified",
-            "default": "2024-12-22T20:03:37.305346"
+            "default": "2024-12-27T18:58:34.745718"
           }
         },
         "type": "object",
@@ -5337,11 +5293,15 @@
       },
       "BasicUser": {
         "properties": {
-          "id": { "type": "string", "title": "Amiv Id" },
+          "id": { "type": "string", "title": "Id" },
           "nethz": { "type": "string", "title": "Nethz" },
           "firstname": { "type": "string", "title": "Firstname" },
           "lastname": { "type": "string", "title": "Lastname" },
-          "email": { "type": "string", "format": "email", "title": "Email" }
+          "email": { "type": "string", "format": "email", "title": "Email" },
+          "role": {
+            "anyOf": [{ "type": "string" }, { "type": "null" }],
+            "title": "Role"
+          }
         },
         "type": "object",
         "required": ["id", "nethz", "firstname", "lastname", "email"],
@@ -5371,13 +5331,13 @@
             "type": "string",
             "format": "date-time",
             "title": "Time Create",
-            "default": "2024-12-22T20:03:37.348148"
+            "default": "2024-12-27T18:58:34.792224"
           },
           "time_modified": {
             "type": "string",
             "format": "date-time",
             "title": "Time Modified",
-            "default": "2024-12-22T20:03:37.348171"
+            "default": "2024-12-27T18:58:34.792258"
           },
           "ezag_timestamp": {
             "anyOf": [
@@ -5701,13 +5661,13 @@
             "type": "string",
             "format": "date-time",
             "title": "Time Create",
-            "default": "2024-12-22T20:03:37.358030"
+            "default": "2024-12-27T18:58:34.802763"
           },
           "time_modified": {
             "type": "string",
             "format": "date-time",
             "title": "Time Modified",
-            "default": "2024-12-22T20:03:37.358057"
+            "default": "2024-12-27T18:58:34.802787"
           },
           "ezag_timestamp": {
             "anyOf": [
@@ -5823,7 +5783,11 @@
             ],
             "title": "Q Check Timestamp"
           },
-          "creator_id": { "type": "string", "title": "Creator Id" },
+          "creator_id": {
+            "type": "string",
+            "maxLength": 40,
+            "title": "Creator Id"
+          },
           "name": { "type": "string", "maxLength": 255, "title": "Name" }
         },
         "type": "object",
@@ -5948,7 +5912,11 @@
             ],
             "title": "Q Check Timestamp"
           },
-          "creator_id": { "type": "string", "title": "Creator Id" },
+          "creator_id": {
+            "type": "string",
+            "maxLength": 40,
+            "title": "Creator Id"
+          },
           "name": { "type": "string", "maxLength": 255, "title": "Name" },
           "id": { "type": "string", "format": "uuid", "title": "Id" }
         },
@@ -5971,7 +5939,7 @@
       },
       "DbUserBase": {
         "properties": {
-          "id": { "type": "string", "maxLength": 30, "title": "Amiv Id" },
+          "id": { "type": "string", "maxLength": 30, "title": "Id" },
           "address_id": {
             "type": "string",
             "format": "uuid",
@@ -5986,7 +5954,7 @@
       },
       "DbUserCreate": {
         "properties": {
-          "id": { "type": "string", "title": "Amiv Id" },
+          "id": { "type": "string", "title": "Id" },
           "address": { "$ref": "#/components/schemas/AddressBase" },
           "iban": { "type": "string", "title": "Iban" }
         },
@@ -5996,7 +5964,7 @@
       },
       "DbUserPublic": {
         "properties": {
-          "id": { "type": "string", "maxLength": 30, "title": "Amiv Id" },
+          "id": { "type": "string", "maxLength": 30, "title": "Id" },
           "address_id": {
             "type": "string",
             "format": "uuid",
@@ -6135,13 +6103,13 @@
             "type": "string",
             "format": "date-time",
             "title": "Time Create",
-            "default": "2024-12-22T20:03:37.382328"
+            "default": "2024-12-27T18:58:34.828140"
           },
           "time_modified": {
             "type": "string",
             "format": "date-time",
             "title": "Time Modified",
-            "default": "2024-12-22T20:03:37.382350"
+            "default": "2024-12-27T18:58:34.828162"
           }
         },
         "type": "object",
@@ -6254,13 +6222,13 @@
             "type": "string",
             "format": "date-time",
             "title": "Time Create",
-            "default": "2024-12-22T20:03:37.393993"
+            "default": "2024-12-27T18:58:34.840082"
           },
           "time_modified": {
             "type": "string",
             "format": "date-time",
             "title": "Time Modified",
-            "default": "2024-12-22T20:03:37.394015"
+            "default": "2024-12-27T18:58:34.840106"
           }
         },
         "type": "object",
@@ -6389,13 +6357,13 @@
             "type": "string",
             "format": "date-time",
             "title": "Time Create",
-            "default": "2024-12-22T20:03:37.366814"
+            "default": "2024-12-27T18:58:34.811835"
           },
           "time_modified": {
             "type": "string",
             "format": "date-time",
             "title": "Time Modified",
-            "default": "2024-12-22T20:03:37.366836"
+            "default": "2024-12-27T18:58:34.811858"
           }
         },
         "type": "object",
@@ -6543,23 +6511,18 @@
           "active": { "type": "boolean", "title": "Active", "default": true },
           "budget_plus": { "type": "integer", "title": "Budget Plus" },
           "budget_minus": { "type": "integer", "title": "Budget Minus" },
-          "visibility": {
-            "type": "integer",
-            "title": "Visibility",
-            "default": 0
-          },
           "id": { "type": "string", "format": "uuid", "title": "Id" },
           "time_create": {
             "type": "string",
             "format": "date-time",
             "title": "Time Create",
-            "default": "2024-12-22T20:03:37.314085"
+            "default": "2024-12-27T18:58:34.755137"
           },
           "time_modified": {
             "type": "string",
             "format": "date-time",
             "title": "Time Modified",
-            "default": "2024-12-22T20:03:37.314109"
+            "default": "2024-12-27T18:58:34.755162"
           }
         },
         "type": "object",
@@ -6581,12 +6544,7 @@
           "owner": { "type": "string", "maxLength": 30, "title": "Owner" },
           "active": { "type": "boolean", "title": "Active", "default": true },
           "budget_plus": { "type": "integer", "title": "Budget Plus" },
-          "budget_minus": { "type": "integer", "title": "Budget Minus" },
-          "visibility": {
-            "type": "integer",
-            "title": "Visibility",
-            "default": 0
-          }
+          "budget_minus": { "type": "integer", "title": "Budget Minus" }
         },
         "type": "object",
         "required": [
@@ -6599,6 +6557,33 @@
         ],
         "title": "KstBase"
       },
+      "KstEval": {
+        "properties": {
+          "kst_number": { "type": "integer", "title": "Kst Number" },
+          "name_de": { "type": "string", "maxLength": 30, "title": "Name De" },
+          "name_en": { "type": "string", "maxLength": 30, "title": "Name En" },
+          "owner": { "type": "string", "maxLength": 30, "title": "Owner" },
+          "active": { "type": "boolean", "title": "Active", "default": true },
+          "budget_plus": { "type": "integer", "title": "Budget Plus" },
+          "budget_minus": { "type": "integer", "title": "Budget Minus" },
+          "id": { "type": "string", "format": "uuid", "title": "Id" },
+          "effective_plus": { "type": "integer", "title": "Effective Plus" },
+          "effective_minus": { "type": "integer", "title": "Effective Minus" }
+        },
+        "type": "object",
+        "required": [
+          "kst_number",
+          "name_de",
+          "name_en",
+          "owner",
+          "budget_plus",
+          "budget_minus",
+          "id",
+          "effective_plus",
+          "effective_minus"
+        ],
+        "title": "KstEval"
+      },
       "KstFilter": {
         "properties": {
           "search": {
@@ -6636,10 +6621,6 @@
           "budget_minus": {
             "anyOf": [{ "type": "integer" }, { "type": "null" }],
             "title": "Budget Minus"
-          },
-          "visibility": {
-            "anyOf": [{ "type": "integer" }, { "type": "null" }],
-            "title": "Visibility"
           }
         },
         "type": "object",
@@ -6654,11 +6635,6 @@
           "active": { "type": "boolean", "title": "Active", "default": true },
           "budget_plus": { "type": "integer", "title": "Budget Plus" },
           "budget_minus": { "type": "integer", "title": "Budget Minus" },
-          "visibility": {
-            "type": "integer",
-            "title": "Visibility",
-            "default": 0
-          },
           "id": { "type": "string", "format": "uuid", "title": "Id" }
         },
         "type": "object",
@@ -6673,6 +6649,20 @@
         ],
         "title": "KstPublic"
       },
+      "KstsEval": {
+        "properties": {
+          "items": {
+            "items": { "$ref": "#/components/schemas/KstEval" },
+            "type": "array",
+            "title": "Items"
+          },
+          "count": { "type": "integer", "title": "Count" },
+          "total": { "type": "integer", "title": "Total" }
+        },
+        "type": "object",
+        "required": ["items", "count", "total"],
+        "title": "KstsEval"
+      },
       "KstsPublic": {
         "properties": {
           "items": {
@@ -6708,13 +6698,13 @@
             "type": "string",
             "format": "date-time",
             "title": "Time Create",
-            "default": "2024-12-22T20:03:37.321390"
+            "default": "2024-12-27T18:58:34.762848"
           },
           "time_modified": {
             "type": "string",
             "format": "date-time",
             "title": "Time Modified",
-            "default": "2024-12-22T20:03:37.321416"
+            "default": "2024-12-27T18:58:34.762876"
           }
         },
         "type": "object",
@@ -6814,20 +6804,19 @@
             "format": "uuid",
             "title": "Creditor Id"
           },
-          "reciept": { "type": "string", "maxLength": 30, "title": "Reciept" },
+          "reciept": { "type": "string", "maxLength": 60, "title": "Reciept" },
           "id": { "type": "string", "format": "uuid", "title": "Id" },
-          "name": { "type": "string", "maxLength": 200, "title": "Name" },
           "time_create": {
             "type": "string",
             "format": "date-time",
             "title": "Time Create",
-            "default": "2024-12-22T20:03:37.402259"
+            "default": "2024-12-27T18:58:34.847881"
           },
           "time_modified": {
             "type": "string",
             "format": "date-time",
             "title": "Time Modified",
-            "default": "2024-12-22T20:03:37.402279"
+            "default": "2024-12-27T18:58:34.847906"
           },
           "ezag_timestamp": {
             "anyOf": [
@@ -6850,18 +6839,17 @@
           }
         },
         "type": "object",
-        "required": ["creditor_id", "reciept", "name", "recipient"],
+        "required": ["creditor_id", "reciept", "recipient"],
         "title": "Reimbursement"
       },
       "ReimbursementCreate": {
         "properties": {
           "creditor": { "$ref": "#/components/schemas/CreditorBase" },
-          "name": { "type": "string", "title": "Name" },
           "reciept": { "type": "string", "title": "Reciept" },
           "recipient": { "type": "string", "title": "Recipient" }
         },
         "type": "object",
-        "required": ["creditor", "name", "reciept", "recipient"],
+        "required": ["creditor", "reciept", "recipient"],
         "title": "ReimbursementCreate"
       },
       "ReimbursementPublic-Input": {
diff --git a/src/client/schemas.gen.ts b/src/client/schemas.gen.ts
index 96b7bd8..7e1df33 100644
--- a/src/client/schemas.gen.ts
+++ b/src/client/schemas.gen.ts
@@ -45,13 +45,13 @@ export const AddressSchema = {
       type: "string",
       format: "date-time",
       title: "Time Create",
-      default: "2024-12-22T20:03:37.305318",
+      default: "2024-12-27T18:58:34.745688",
     },
     time_modified: {
       type: "string",
       format: "date-time",
       title: "Time Modified",
-      default: "2024-12-22T20:03:37.305346",
+      default: "2024-12-27T18:58:34.745718",
     },
   },
   type: "object",
@@ -307,7 +307,7 @@ export const BasicUserSchema = {
   properties: {
     id: {
       type: "string",
-      title: "Amiv Id",
+      title: "Id",
     },
     nethz: {
       type: "string",
@@ -326,6 +326,17 @@ export const BasicUserSchema = {
       format: "email",
       title: "Email",
     },
+    role: {
+      anyOf: [
+        {
+          type: "string",
+        },
+        {
+          type: "null",
+        },
+      ],
+      title: "Role",
+    },
   },
   type: "object",
   required: ["id", "nethz", "firstname", "lastname", "email"],
@@ -368,13 +379,13 @@ export const BillSchema = {
       type: "string",
       format: "date-time",
       title: "Time Create",
-      default: "2024-12-22T20:03:37.348148",
+      default: "2024-12-27T18:58:34.792224",
     },
     time_modified: {
       type: "string",
       format: "date-time",
       title: "Time Modified",
-      default: "2024-12-22T20:03:37.348171",
+      default: "2024-12-27T18:58:34.792258",
     },
     ezag_timestamp: {
       anyOf: [
@@ -875,13 +886,13 @@ export const CreditPaymentSchema = {
       type: "string",
       format: "date-time",
       title: "Time Create",
-      default: "2024-12-22T20:03:37.358030",
+      default: "2024-12-27T18:58:34.802763",
     },
     time_modified: {
       type: "string",
       format: "date-time",
       title: "Time Modified",
-      default: "2024-12-22T20:03:37.358057",
+      default: "2024-12-27T18:58:34.802787",
     },
     ezag_timestamp: {
       anyOf: [
@@ -1055,6 +1066,7 @@ export const CreditorBaseSchema = {
     },
     creator_id: {
       type: "string",
+      maxLength: 40,
       title: "Creator Id",
     },
     name: {
@@ -1273,6 +1285,7 @@ export const CreditorPublicSchema = {
     },
     creator_id: {
       type: "string",
+      maxLength: 40,
       title: "Creator Id",
     },
     name: {
@@ -1310,7 +1323,7 @@ export const DbUserBaseSchema = {
     id: {
       type: "string",
       maxLength: 30,
-      title: "Amiv Id",
+      title: "Id",
     },
     address_id: {
       type: "string",
@@ -1337,7 +1350,7 @@ export const DbUserCreateSchema = {
   properties: {
     id: {
       type: "string",
-      title: "Amiv Id",
+      title: "Id",
     },
     address: {
       $ref: "#/components/schemas/AddressBase",
@@ -1357,7 +1370,7 @@ export const DbUserPublicSchema = {
     id: {
       type: "string",
       maxLength: 30,
-      title: "Amiv Id",
+      title: "Id",
     },
     address_id: {
       type: "string",
@@ -1576,13 +1589,13 @@ export const InternalTransferSchema = {
       type: "string",
       format: "date-time",
       title: "Time Create",
-      default: "2024-12-22T20:03:37.382328",
+      default: "2024-12-27T18:58:34.828140",
     },
     time_modified: {
       type: "string",
       format: "date-time",
       title: "Time Modified",
-      default: "2024-12-22T20:03:37.382350",
+      default: "2024-12-27T18:58:34.828162",
     },
   },
   type: "object",
@@ -1739,13 +1752,13 @@ export const InvoiceSchema = {
       type: "string",
       format: "date-time",
       title: "Time Create",
-      default: "2024-12-22T20:03:37.393993",
+      default: "2024-12-27T18:58:34.840082",
     },
     time_modified: {
       type: "string",
       format: "date-time",
       title: "Time Modified",
-      default: "2024-12-22T20:03:37.394015",
+      default: "2024-12-27T18:58:34.840106",
     },
   },
   type: "object",
@@ -1913,13 +1926,13 @@ export const ItemSchema = {
       type: "string",
       format: "date-time",
       title: "Time Create",
-      default: "2024-12-22T20:03:37.366814",
+      default: "2024-12-27T18:58:34.811835",
     },
     time_modified: {
       type: "string",
       format: "date-time",
       title: "Time Modified",
-      default: "2024-12-22T20:03:37.366836",
+      default: "2024-12-27T18:58:34.811858",
     },
   },
   type: "object",
@@ -2148,11 +2161,6 @@ export const KstSchema = {
       type: "integer",
       title: "Budget Minus",
     },
-    visibility: {
-      type: "integer",
-      title: "Visibility",
-      default: 0,
-    },
     id: {
       type: "string",
       format: "uuid",
@@ -2162,13 +2170,13 @@ export const KstSchema = {
       type: "string",
       format: "date-time",
       title: "Time Create",
-      default: "2024-12-22T20:03:37.314085",
+      default: "2024-12-27T18:58:34.755137",
     },
     time_modified: {
       type: "string",
       format: "date-time",
       title: "Time Modified",
-      default: "2024-12-22T20:03:37.314109",
+      default: "2024-12-27T18:58:34.755162",
     },
   },
   type: "object",
@@ -2217,10 +2225,65 @@ export const KstBaseSchema = {
       type: "integer",
       title: "Budget Minus",
     },
-    visibility: {
+  },
+  type: "object",
+  required: [
+    "kst_number",
+    "name_de",
+    "name_en",
+    "owner",
+    "budget_plus",
+    "budget_minus",
+  ],
+  title: "KstBase",
+} as const;
+
+export const KstEvalSchema = {
+  properties: {
+    kst_number: {
       type: "integer",
-      title: "Visibility",
-      default: 0,
+      title: "Kst Number",
+    },
+    name_de: {
+      type: "string",
+      maxLength: 30,
+      title: "Name De",
+    },
+    name_en: {
+      type: "string",
+      maxLength: 30,
+      title: "Name En",
+    },
+    owner: {
+      type: "string",
+      maxLength: 30,
+      title: "Owner",
+    },
+    active: {
+      type: "boolean",
+      title: "Active",
+      default: true,
+    },
+    budget_plus: {
+      type: "integer",
+      title: "Budget Plus",
+    },
+    budget_minus: {
+      type: "integer",
+      title: "Budget Minus",
+    },
+    id: {
+      type: "string",
+      format: "uuid",
+      title: "Id",
+    },
+    effective_plus: {
+      type: "integer",
+      title: "Effective Plus",
+    },
+    effective_minus: {
+      type: "integer",
+      title: "Effective Minus",
     },
   },
   type: "object",
@@ -2231,8 +2294,11 @@ export const KstBaseSchema = {
     "owner",
     "budget_plus",
     "budget_minus",
+    "id",
+    "effective_plus",
+    "effective_minus",
   ],
-  title: "KstBase",
+  title: "KstEval",
 } as const;
 
 export const KstFilterSchema = {
@@ -2336,17 +2402,6 @@ export const KstFilterSchema = {
       ],
       title: "Budget Minus",
     },
-    visibility: {
-      anyOf: [
-        {
-          type: "integer",
-        },
-        {
-          type: "null",
-        },
-      ],
-      title: "Visibility",
-    },
   },
   type: "object",
   title: "KstFilter",
@@ -2386,11 +2441,6 @@ export const KstPublicSchema = {
       type: "integer",
       title: "Budget Minus",
     },
-    visibility: {
-      type: "integer",
-      title: "Visibility",
-      default: 0,
-    },
     id: {
       type: "string",
       format: "uuid",
@@ -2410,6 +2460,29 @@ export const KstPublicSchema = {
   title: "KstPublic",
 } as const;
 
+export const KstsEvalSchema = {
+  properties: {
+    items: {
+      items: {
+        $ref: "#/components/schemas/KstEval",
+      },
+      type: "array",
+      title: "Items",
+    },
+    count: {
+      type: "integer",
+      title: "Count",
+    },
+    total: {
+      type: "integer",
+      title: "Total",
+    },
+  },
+  type: "object",
+  required: ["items", "count", "total"],
+  title: "KstsEval",
+} as const;
+
 export const KstsPublicSchema = {
   properties: {
     items: {
@@ -2470,13 +2543,13 @@ export const LedgerSchema = {
       type: "string",
       format: "date-time",
       title: "Time Create",
-      default: "2024-12-22T20:03:37.321390",
+      default: "2024-12-27T18:58:34.762848",
     },
     time_modified: {
       type: "string",
       format: "date-time",
       title: "Time Modified",
-      default: "2024-12-22T20:03:37.321416",
+      default: "2024-12-27T18:58:34.762876",
     },
   },
   type: "object",
@@ -2661,7 +2734,7 @@ export const ReimbursementSchema = {
     },
     reciept: {
       type: "string",
-      maxLength: 30,
+      maxLength: 60,
       title: "Reciept",
     },
     id: {
@@ -2669,22 +2742,17 @@ export const ReimbursementSchema = {
       format: "uuid",
       title: "Id",
     },
-    name: {
-      type: "string",
-      maxLength: 200,
-      title: "Name",
-    },
     time_create: {
       type: "string",
       format: "date-time",
       title: "Time Create",
-      default: "2024-12-22T20:03:37.402259",
+      default: "2024-12-27T18:58:34.847881",
     },
     time_modified: {
       type: "string",
       format: "date-time",
       title: "Time Modified",
-      default: "2024-12-22T20:03:37.402279",
+      default: "2024-12-27T18:58:34.847906",
     },
     ezag_timestamp: {
       anyOf: [
@@ -2717,7 +2785,7 @@ export const ReimbursementSchema = {
     },
   },
   type: "object",
-  required: ["creditor_id", "reciept", "name", "recipient"],
+  required: ["creditor_id", "reciept", "recipient"],
   title: "Reimbursement",
 } as const;
 
@@ -2726,10 +2794,6 @@ export const ReimbursementCreateSchema = {
     creditor: {
       $ref: "#/components/schemas/CreditorBase",
     },
-    name: {
-      type: "string",
-      title: "Name",
-    },
     reciept: {
       type: "string",
       title: "Reciept",
@@ -2740,7 +2804,7 @@ export const ReimbursementCreateSchema = {
     },
   },
   type: "object",
-  required: ["creditor", "name", "reciept", "recipient"],
+  required: ["creditor", "reciept", "recipient"],
   title: "ReimbursementCreate",
 } as const;
 
diff --git a/src/client/services.gen.ts b/src/client/services.gen.ts
index 6c362ab..36b2bf5 100644
--- a/src/client/services.gen.ts
+++ b/src/client/services.gen.ts
@@ -147,9 +147,9 @@ import {
   type FilesUploadFileData,
   type FilesUploadFileError,
   type FilesUploadFileResponse,
-  type FilesGetFileData,
-  type FilesGetFileError,
-  type FilesGetFileResponse,
+  type FilesGetFileRequestData,
+  type FilesGetFileRequestError,
+  type FilesGetFileRequestResponse,
   type FilesReplaceFileData,
   type FilesReplaceFileError,
   type FilesReplaceFileResponse,
@@ -185,6 +185,9 @@ import {
   type CombinedReadCombinedPaymentsData,
   type CombinedReadCombinedPaymentsError,
   type CombinedReadCombinedPaymentsResponse,
+  type EvaluationReadKstsData,
+  type EvaluationReadKstsError,
+  type EvaluationReadKstsResponse,
   ItemsCreateItemResponseTransformer,
   ItemsReadItemResponseTransformer,
   ItemsUpdateItemResponseTransformer,
@@ -1084,15 +1087,15 @@ export const filesUploadFile = <ThrowOnError extends boolean = false>(
 };
 
 /**
- * Get File
+ * Get File Request
  * Generate a presigned URL for downloading the file from MinIO.
  */
-export const filesGetFile = <ThrowOnError extends boolean = false>(
-  options: Options<FilesGetFileData, ThrowOnError>,
+export const filesGetFileRequest = <ThrowOnError extends boolean = false>(
+  options: Options<FilesGetFileRequestData, ThrowOnError>,
 ) => {
   return (options?.client ?? client).get<
-    FilesGetFileResponse,
-    FilesGetFileError,
+    FilesGetFileRequestResponse,
+    FilesGetFileRequestError,
     ThrowOnError
   >({
     ...options,
@@ -1347,3 +1350,21 @@ export const combinedReadCombinedPayments = <
     url: "/api/combined/",
   });
 };
+
+/**
+ * Read Ksts
+ * Retrieve all the ksts and then add the effective_plus and effective_minus fields.
+ * calculated from all the creditors/debitors.
+ */
+export const evaluationReadKsts = <ThrowOnError extends boolean = false>(
+  options?: Options<EvaluationReadKstsData, ThrowOnError>,
+) => {
+  return (options?.client ?? client).get<
+    EvaluationReadKstsResponse,
+    EvaluationReadKstsError,
+    ThrowOnError
+  >({
+    ...options,
+    url: "/api/evaluation/",
+  });
+};
diff --git a/src/client/types.gen.ts b/src/client/types.gen.ts
index a68e699..f272412 100644
--- a/src/client/types.gen.ts
+++ b/src/client/types.gen.ts
@@ -58,6 +58,7 @@ export type BasicUser = {
   firstname: string;
   lastname: string;
   email: string;
+  role?: string | null;
 };
 
 export type Bill = {
@@ -451,7 +452,6 @@ export type Kst = {
   active?: boolean;
   budget_plus: number;
   budget_minus: number;
-  visibility?: number;
   id?: string;
   time_create?: Date;
   time_modified?: Date;
@@ -465,7 +465,19 @@ export type KstBase = {
   active?: boolean;
   budget_plus: number;
   budget_minus: number;
-  visibility?: number;
+};
+
+export type KstEval = {
+  kst_number: number;
+  name_de: string;
+  name_en: string;
+  owner: string;
+  active?: boolean;
+  budget_plus: number;
+  budget_minus: number;
+  id: string;
+  effective_plus: number;
+  effective_minus: number;
 };
 
 export type KstFilter = {
@@ -478,7 +490,6 @@ export type KstFilter = {
   active?: boolean | null;
   budget_plus?: number | null;
   budget_minus?: number | null;
-  visibility?: number | null;
 };
 
 export type KstPublic = {
@@ -489,10 +500,15 @@ export type KstPublic = {
   active?: boolean;
   budget_plus: number;
   budget_minus: number;
-  visibility?: number;
   id: string;
 };
 
+export type KstsEval = {
+  items: Array<KstEval>;
+  count: number;
+  total: number;
+};
+
 export type KstsPublic = {
   items?: Array<KstPublic>;
   count: number;
@@ -546,7 +562,6 @@ export type Reimbursement = {
   creditor_id: string;
   reciept: string;
   id?: string;
-  name: string;
   time_create?: Date;
   time_modified?: Date;
   ezag_timestamp?: Date | null;
@@ -556,8 +571,7 @@ export type Reimbursement = {
 
 export type ReimbursementCreate = {
   creditor: CreditorBase;
-  name: string;
-  reciept: File;
+  reciept: string;
   recipient: string;
 };
 
@@ -688,7 +702,6 @@ export type InvoicesReadInvoicesData = {
     debitor__kst__owner?: string | null;
     debitor__kst__search?: string | null;
     debitor__kst__sort?: string | null;
-    debitor__kst__visibility?: number | null;
     debitor__ledger__accountnumber?: number | null;
     debitor__ledger__name_de?: string | null;
     debitor__ledger__name_en?: string | null;
@@ -707,7 +720,6 @@ export type InvoicesReadInvoicesData = {
     kst__owner?: string | null;
     kst__search?: string | null;
     kst__sort?: string | null;
-    kst__visibility?: number | null;
     limit?: number;
     mwst?: string | null;
     page?: number;
@@ -800,7 +812,6 @@ export type KstsReadKstsData = {
     page?: number;
     search?: string | null;
     sort?: string | null;
-    visibility?: number | null;
   };
 };
 
@@ -924,7 +935,6 @@ export type InternalTransfersReadInternalTransferesData = {
     creditor__kst__owner?: string | null;
     creditor__kst__search?: string | null;
     creditor__kst__sort?: string | null;
-    creditor__kst__visibility?: number | null;
     creditor__ledger__accountnumber?: number | null;
     creditor__ledger__name_de?: string | null;
     creditor__ledger__name_en?: string | null;
@@ -946,7 +956,6 @@ export type InternalTransfersReadInternalTransferesData = {
     debitor__kst__owner?: string | null;
     debitor__kst__search?: string | null;
     debitor__kst__sort?: string | null;
-    debitor__kst__visibility?: number | null;
     debitor__ledger__accountnumber?: number | null;
     debitor__ledger__name_de?: string | null;
     debitor__ledger__name_en?: string | null;
@@ -1036,7 +1045,6 @@ export type BillsReadBillsData = {
     creditor__kst__owner?: string | null;
     creditor__kst__search?: string | null;
     creditor__kst__sort?: string | null;
-    creditor__kst__visibility?: number | null;
     creditor__ledger__accountnumber?: number | null;
     creditor__ledger__name_de?: string | null;
     creditor__ledger__name_en?: string | null;
@@ -1119,7 +1127,6 @@ export type ReimbursementsReadReimbursementsData = {
     creditor__kst__owner?: string | null;
     creditor__kst__search?: string | null;
     creditor__kst__sort?: string | null;
-    creditor__kst__visibility?: number | null;
     creditor__ledger__accountnumber?: number | null;
     creditor__ledger__name_de?: string | null;
     creditor__ledger__name_en?: string | null;
@@ -1205,7 +1212,6 @@ export type CreditPaymentsReadCreditPaymentsData = {
     creditor__kst__owner?: string | null;
     creditor__kst__search?: string | null;
     creditor__kst__sort?: string | null;
-    creditor__kst__visibility?: number | null;
     creditor__ledger__accountnumber?: number | null;
     creditor__ledger__name_de?: string | null;
     creditor__ledger__name_en?: string | null;
@@ -1284,7 +1290,7 @@ export type FilesUploadFileResponse = unknown;
 
 export type FilesUploadFileError = HTTPValidationError;
 
-export type FilesGetFileData = {
+export type FilesGetFileRequestData = {
   path: {
     file_id: string;
   };
@@ -1293,9 +1299,9 @@ export type FilesGetFileData = {
   };
 };
 
-export type FilesGetFileResponse = unknown;
+export type FilesGetFileRequestResponse = unknown;
 
-export type FilesGetFileError = HTTPValidationError;
+export type FilesGetFileRequestError = HTTPValidationError;
 
 export type FilesReplaceFileData = {
   body: Body_files_replace_file;
@@ -1412,7 +1418,6 @@ export type CombinedReadUncheckedCombinedPaymentsData = {
     creditor__kst__owner?: string | null;
     creditor__kst__search?: string | null;
     creditor__kst__sort?: string | null;
-    creditor__kst__visibility?: number | null;
     creditor__ledger__accountnumber?: number | null;
     creditor__ledger__name_de?: string | null;
     creditor__ledger__name_en?: string | null;
@@ -1471,7 +1476,6 @@ export type CombinedReadCombinedPaymentsData = {
     creditor__kst__owner?: string | null;
     creditor__kst__search?: string | null;
     creditor__kst__sort?: string | null;
-    creditor__kst__visibility?: number | null;
     creditor__ledger__accountnumber?: number | null;
     creditor__ledger__name_de?: string | null;
     creditor__ledger__name_en?: string | null;
@@ -1501,6 +1505,17 @@ export type CombinedReadCombinedPaymentsResponse = CombinedCreditorList;
 
 export type CombinedReadCombinedPaymentsError = HTTPValidationError;
 
+export type EvaluationReadKstsData = {
+  query?: {
+    limit?: number;
+    page?: number;
+  };
+};
+
+export type EvaluationReadKstsResponse = KstsEval;
+
+export type EvaluationReadKstsError = HTTPValidationError;
+
 export type ItemsCreateItemResponseTransformer = (
   data: any,
 ) => Promise<ItemsCreateItemResponse>;
diff --git a/src/main.tsx b/src/main.tsx
index a5714f8..599a14c 100644
--- a/src/main.tsx
+++ b/src/main.tsx
@@ -25,6 +25,7 @@ import EditBills from "./pages/EditBills";
 import EditInternalTransfer from "./pages/EditInternalTransfer";
 import EditReimbursement from "./pages/EditReimbursement";
 import UncheckedPayments from "./pages/UncheckedPayments";
+import KstEval from "./pages/KstEval";
 
 const router = createBrowserRouter([
   {
@@ -92,6 +93,11 @@ const router = createBrowserRouter([
         element: <UncheckedPayments />,
         loader: addCreditListLoader,
       },
+      {
+        path: "KstEval",
+        element: <KstEval />,
+        loader: addCreditListLoader,
+      },
     ],
   },
   { path: "callback", element: <Callback /> },
diff --git a/src/pages/KstEval.tsx b/src/pages/KstEval.tsx
new file mode 100644
index 0000000..073dc86
--- /dev/null
+++ b/src/pages/KstEval.tsx
@@ -0,0 +1,92 @@
+import React from "react";
+import { useLoaderData } from "react-router-dom";
+import {
+  creditPaymentsReadCreditPayments,
+  kstsReadKsts,
+  ledgersReadLedgers,
+  authGetBasicUserInfo,
+  evaluationReadKsts,
+} from "../client/services.gen";
+import { BasicUser, Kst, Ledger } from "../client/types.gen";
+import GenericDataTable from "../components/GenericDataTable";
+import { Button } from "@mui/material";
+
+export async function addLoader() {
+  const kstList = await kstsReadKsts({});
+  const kst = kstList.data?.items || [];
+  const ledgerList = await ledgersReadLedgers({});
+  const ledger = ledgerList.data?.items || [];
+  const userRequest = await authGetBasicUserInfo();
+  const user = userRequest.data;
+  return { kst, ledger, user };
+}
+
+const KstEvalList: React.FC = () => {
+  const { kst, ledger, user } = useLoaderData() as {
+    kst: Kst[];
+    ledger: Ledger[];
+    user: BasicUser;
+  };
+
+  const columns = [
+    { name: "kst_number", label: "KST Number" },
+    { name: "name_de", label: "Name" },
+    { name: "name_en", label: "Name (EN)" },
+    { name: "active", label: "Active" },
+    { name: "budget_plus", label: "Budget Plus" },
+    { name: "budget_minus", label: "Budget Minus" },
+    { name: "effective_plus", label: "Effective Plus" },
+    { name: "effective_minus", label: "Effective Minus" },
+  ];
+
+  // Define the data fetching function for Credit Payments
+  const fetchKstEval = async ({
+    search,
+    sort,
+    filters,
+  }: {
+    search: string;
+    sort: { column: string; direction: "asc" | "desc" } | null;
+    filters: Record<string, any>;
+  }) => {
+    const body: any = {
+      search: search || null,
+      sort: sort ? `${sort.column}:${sort.direction}` : null,
+      ...filters,
+    };
+
+    console.log("Fetching Credit Payments with:", body);
+
+    try {
+      const response = await evaluationReadKsts({ query: body });
+      const results = response.data?.items || [];
+
+      // Transform the fetched data to match the table's columns
+      const transformedData = results.map((item: any) => ({
+        kst_number: item.kst_number,
+        name_de: item.name_de,
+        name_en: item.name_en,
+        active: item.active,
+        budget_plus: item.budget_plus,
+        budget_minus: item.budget_minus,
+        effective_plus: item.effective_plus,
+        effective_minus: item.effective_minus,
+      }));
+
+      return transformedData;
+    } catch (error) {
+      console.error("Error fetching Credit Payments:", error);
+      return [];
+    }
+  };
+
+  return (
+    <GenericDataTable
+      title="KST Evaluation"
+      columns={columns}
+      fetchData={fetchKstEval}
+    />
+  );
+};
+
+export default KstEvalList;
diff --git a/src/pages/root.tsx b/src/pages/root.tsx
index afc05ac..639fb25 100644
--- a/src/pages/root.tsx
+++ b/src/pages/root.tsx
@@ -80,6 +80,11 @@ const navContent = [
     name: "Onboarding",
     icon: <Groups />,
   },
+  {
+    path: "/KstEval",
+    name: "Kst Evaluation",
+    icon: <Groups />,
+  },
 ] as { path: string; name: string; icon: React.ReactNode }[];
 
 function NavigationList() {
-- 
GitLab