commit 048b4bc038486f688bf1b2fdfcedd7b42b0de16e
Author: Lukáš Vlček <vlcek@net-inout.cz>
Date:   Sun May 15 15:36:58 2022 +0200

    Loading final annotation

diff --git a/webapp/api/api.ts b/webapp/api/api.ts
index 0ddd2b4..3ea0bc5 100644
--- a/webapp/api/api.ts
+++ b/webapp/api/api.ts
@@ -301,6 +301,19 @@ export interface CreateCategoryRequest {
      */
     'disabledForAnnotators'?: boolean;
 }
+/**
+ * 
+ * @export
+ * @interface CreateFinalAnnotationResponse
+ */
+export interface CreateFinalAnnotationResponse {
+    /**
+     * 
+     * @type {string}
+     * @memberof CreateFinalAnnotationResponse
+     */
+    'finalAnnotationId'?: string;
+}
 /**
  * 
  * @export
@@ -1287,11 +1300,12 @@ export const AnnotationApiAxiosParamCreator = function (configuration?: Configur
         /**
          * 
          * @param {string} annotationId 
+         * @param {boolean} [isFinal] 
          * @param {MarkAnnotationDoneRequest} [markAnnotationDoneRequest] 
          * @param {*} [options] Override http request option.
          * @throws {RequiredError}
          */
-        annotationAnnotationIdDonePut: async (annotationId: string, markAnnotationDoneRequest?: MarkAnnotationDoneRequest, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
+        annotationAnnotationIdDonePut: async (annotationId: string, isFinal?: boolean, markAnnotationDoneRequest?: MarkAnnotationDoneRequest, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
             // verify required parameter 'annotationId' is not null or undefined
             assertParamExists('annotationAnnotationIdDonePut', 'annotationId', annotationId)
             const localVarPath = `/annotation/{annotationId}/done`
@@ -1307,6 +1321,10 @@ export const AnnotationApiAxiosParamCreator = function (configuration?: Configur
             const localVarHeaderParameter = {} as any;
             const localVarQueryParameter = {} as any;
 
+            if (isFinal !== undefined) {
+                localVarQueryParameter['isFinal'] = isFinal;
+            }
+
 
     
             localVarHeaderParameter['Content-Type'] = 'application/json';
@@ -1324,10 +1342,11 @@ export const AnnotationApiAxiosParamCreator = function (configuration?: Configur
         /**
          * 
          * @param {string} annotationId 
+         * @param {boolean} [isFinal] 
          * @param {*} [options] Override http request option.
          * @throws {RequiredError}
          */
-        annotationAnnotationIdGet: async (annotationId: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
+        annotationAnnotationIdGet: async (annotationId: string, isFinal?: boolean, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
             // verify required parameter 'annotationId' is not null or undefined
             assertParamExists('annotationAnnotationIdGet', 'annotationId', annotationId)
             const localVarPath = `/annotation/{annotationId}`
@@ -1343,6 +1362,10 @@ export const AnnotationApiAxiosParamCreator = function (configuration?: Configur
             const localVarHeaderParameter = {} as any;
             const localVarQueryParameter = {} as any;
 
+            if (isFinal !== undefined) {
+                localVarQueryParameter['isFinal'] = isFinal;
+            }
+
 
     
             setSearchParams(localVarUrlObj, localVarQueryParameter);
@@ -1358,11 +1381,12 @@ export const AnnotationApiAxiosParamCreator = function (configuration?: Configur
          * 
          * @param {string} annotationId 
          * @param {string} instanceId 
+         * @param {boolean} [isFinal] 
          * @param {SetInstanceSentimentRequest} [setInstanceSentimentRequest] 
          * @param {*} [options] Override http request option.
          * @throws {RequiredError}
          */
-        annotationAnnotationIdInstanceIdSentimentPut: async (annotationId: string, instanceId: string, setInstanceSentimentRequest?: SetInstanceSentimentRequest, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
+        annotationAnnotationIdInstanceIdSentimentPut: async (annotationId: string, instanceId: string, isFinal?: boolean, setInstanceSentimentRequest?: SetInstanceSentimentRequest, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
             // verify required parameter 'annotationId' is not null or undefined
             assertParamExists('annotationAnnotationIdInstanceIdSentimentPut', 'annotationId', annotationId)
             // verify required parameter 'instanceId' is not null or undefined
@@ -1381,6 +1405,10 @@ export const AnnotationApiAxiosParamCreator = function (configuration?: Configur
             const localVarHeaderParameter = {} as any;
             const localVarQueryParameter = {} as any;
 
+            if (isFinal !== undefined) {
+                localVarQueryParameter['isFinal'] = isFinal;
+            }
+
 
     
             localVarHeaderParameter['Content-Type'] = 'application/json';
@@ -1398,11 +1426,12 @@ export const AnnotationApiAxiosParamCreator = function (configuration?: Configur
         /**
          * 
          * @param {string} annotationId 
+         * @param {boolean} [isFinal] 
          * @param {AddNoteToAnnotationRequest} [addNoteToAnnotationRequest] 
          * @param {*} [options] Override http request option.
          * @throws {RequiredError}
          */
-        annotationAnnotationIdNotePost: async (annotationId: string, addNoteToAnnotationRequest?: AddNoteToAnnotationRequest, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
+        annotationAnnotationIdNotePost: async (annotationId: string, isFinal?: boolean, addNoteToAnnotationRequest?: AddNoteToAnnotationRequest, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
             // verify required parameter 'annotationId' is not null or undefined
             assertParamExists('annotationAnnotationIdNotePost', 'annotationId', annotationId)
             const localVarPath = `/annotation/{annotationId}/note`
@@ -1418,6 +1447,10 @@ export const AnnotationApiAxiosParamCreator = function (configuration?: Configur
             const localVarHeaderParameter = {} as any;
             const localVarQueryParameter = {} as any;
 
+            if (isFinal !== undefined) {
+                localVarQueryParameter['isFinal'] = isFinal;
+            }
+
 
     
             localVarHeaderParameter['Content-Type'] = 'application/json';
@@ -1436,10 +1469,11 @@ export const AnnotationApiAxiosParamCreator = function (configuration?: Configur
          * 
          * @param {string} annotationId 
          * @param {string} occurenceId 
+         * @param {boolean} [isFinal] 
          * @param {*} [options] Override http request option.
          * @throws {RequiredError}
          */
-        annotationAnnotationIdOccurenceIdDelete: async (annotationId: string, occurenceId: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
+        annotationAnnotationIdOccurenceIdDelete: async (annotationId: string, occurenceId: string, isFinal?: boolean, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
             // verify required parameter 'annotationId' is not null or undefined
             assertParamExists('annotationAnnotationIdOccurenceIdDelete', 'annotationId', annotationId)
             // verify required parameter 'occurenceId' is not null or undefined
@@ -1458,6 +1492,10 @@ export const AnnotationApiAxiosParamCreator = function (configuration?: Configur
             const localVarHeaderParameter = {} as any;
             const localVarQueryParameter = {} as any;
 
+            if (isFinal !== undefined) {
+                localVarQueryParameter['isFinal'] = isFinal;
+            }
+
 
     
             setSearchParams(localVarUrlObj, localVarQueryParameter);
@@ -1472,11 +1510,12 @@ export const AnnotationApiAxiosParamCreator = function (configuration?: Configur
         /**
          * 
          * @param {string} annotationId 
+         * @param {boolean} [isFinal] 
          * @param {AnnotationInstanceAddRequest} [annotationInstanceAddRequest] 
          * @param {*} [options] Override http request option.
          * @throws {RequiredError}
          */
-        annotationAnnotationIdPost: async (annotationId: string, annotationInstanceAddRequest?: AnnotationInstanceAddRequest, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
+        annotationAnnotationIdPost: async (annotationId: string, isFinal?: boolean, annotationInstanceAddRequest?: AnnotationInstanceAddRequest, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
             // verify required parameter 'annotationId' is not null or undefined
             assertParamExists('annotationAnnotationIdPost', 'annotationId', annotationId)
             const localVarPath = `/annotation/{annotationId}`
@@ -1492,6 +1531,10 @@ export const AnnotationApiAxiosParamCreator = function (configuration?: Configur
             const localVarHeaderParameter = {} as any;
             const localVarQueryParameter = {} as any;
 
+            if (isFinal !== undefined) {
+                localVarQueryParameter['isFinal'] = isFinal;
+            }
+
 
     
             localVarHeaderParameter['Content-Type'] = 'application/json';
@@ -1510,11 +1553,12 @@ export const AnnotationApiAxiosParamCreator = function (configuration?: Configur
          * 
          * @param {string} annotationId 
          * @param {string} occurenceId 
+         * @param {boolean} [isFinal] 
          * @param {AddNoteToTagOccurenceRequest} [addNoteToTagOccurenceRequest] 
          * @param {*} [options] Override http request option.
          * @throws {RequiredError}
          */
-        annotationAnnotationIdTagOccurenceIdNotePost: async (annotationId: string, occurenceId: string, addNoteToTagOccurenceRequest?: AddNoteToTagOccurenceRequest, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
+        annotationAnnotationIdTagOccurenceIdNotePost: async (annotationId: string, occurenceId: string, isFinal?: boolean, addNoteToTagOccurenceRequest?: AddNoteToTagOccurenceRequest, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
             // verify required parameter 'annotationId' is not null or undefined
             assertParamExists('annotationAnnotationIdTagOccurenceIdNotePost', 'annotationId', annotationId)
             // verify required parameter 'occurenceId' is not null or undefined
@@ -1533,6 +1577,10 @@ export const AnnotationApiAxiosParamCreator = function (configuration?: Configur
             const localVarHeaderParameter = {} as any;
             const localVarQueryParameter = {} as any;
 
+            if (isFinal !== undefined) {
+                localVarQueryParameter['isFinal'] = isFinal;
+            }
+
 
     
             localVarHeaderParameter['Content-Type'] = 'application/json';
@@ -1593,79 +1641,86 @@ export const AnnotationApiFp = function(configuration?: Configuration) {
         /**
          * 
          * @param {string} annotationId 
+         * @param {boolean} [isFinal] 
          * @param {MarkAnnotationDoneRequest} [markAnnotationDoneRequest] 
          * @param {*} [options] Override http request option.
          * @throws {RequiredError}
          */
-        async annotationAnnotationIdDonePut(annotationId: string, markAnnotationDoneRequest?: MarkAnnotationDoneRequest, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<void>> {
-            const localVarAxiosArgs = await localVarAxiosParamCreator.annotationAnnotationIdDonePut(annotationId, markAnnotationDoneRequest, options);
+        async annotationAnnotationIdDonePut(annotationId: string, isFinal?: boolean, markAnnotationDoneRequest?: MarkAnnotationDoneRequest, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<void>> {
+            const localVarAxiosArgs = await localVarAxiosParamCreator.annotationAnnotationIdDonePut(annotationId, isFinal, markAnnotationDoneRequest, options);
             return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
         },
         /**
          * 
          * @param {string} annotationId 
+         * @param {boolean} [isFinal] 
          * @param {*} [options] Override http request option.
          * @throws {RequiredError}
          */
-        async annotationAnnotationIdGet(annotationId: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<AnnotationInfo>> {
-            const localVarAxiosArgs = await localVarAxiosParamCreator.annotationAnnotationIdGet(annotationId, options);
+        async annotationAnnotationIdGet(annotationId: string, isFinal?: boolean, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<AnnotationInfo>> {
+            const localVarAxiosArgs = await localVarAxiosParamCreator.annotationAnnotationIdGet(annotationId, isFinal, options);
             return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
         },
         /**
          * 
          * @param {string} annotationId 
          * @param {string} instanceId 
+         * @param {boolean} [isFinal] 
          * @param {SetInstanceSentimentRequest} [setInstanceSentimentRequest] 
          * @param {*} [options] Override http request option.
          * @throws {RequiredError}
          */
-        async annotationAnnotationIdInstanceIdSentimentPut(annotationId: string, instanceId: string, setInstanceSentimentRequest?: SetInstanceSentimentRequest, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<void>> {
-            const localVarAxiosArgs = await localVarAxiosParamCreator.annotationAnnotationIdInstanceIdSentimentPut(annotationId, instanceId, setInstanceSentimentRequest, options);
+        async annotationAnnotationIdInstanceIdSentimentPut(annotationId: string, instanceId: string, isFinal?: boolean, setInstanceSentimentRequest?: SetInstanceSentimentRequest, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<void>> {
+            const localVarAxiosArgs = await localVarAxiosParamCreator.annotationAnnotationIdInstanceIdSentimentPut(annotationId, instanceId, isFinal, setInstanceSentimentRequest, options);
             return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
         },
         /**
          * 
          * @param {string} annotationId 
+         * @param {boolean} [isFinal] 
          * @param {AddNoteToAnnotationRequest} [addNoteToAnnotationRequest] 
          * @param {*} [options] Override http request option.
          * @throws {RequiredError}
          */
-        async annotationAnnotationIdNotePost(annotationId: string, addNoteToAnnotationRequest?: AddNoteToAnnotationRequest, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<void>> {
-            const localVarAxiosArgs = await localVarAxiosParamCreator.annotationAnnotationIdNotePost(annotationId, addNoteToAnnotationRequest, options);
+        async annotationAnnotationIdNotePost(annotationId: string, isFinal?: boolean, addNoteToAnnotationRequest?: AddNoteToAnnotationRequest, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<void>> {
+            const localVarAxiosArgs = await localVarAxiosParamCreator.annotationAnnotationIdNotePost(annotationId, isFinal, addNoteToAnnotationRequest, options);
             return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
         },
         /**
          * 
          * @param {string} annotationId 
          * @param {string} occurenceId 
+         * @param {boolean} [isFinal] 
          * @param {*} [options] Override http request option.
          * @throws {RequiredError}
          */
-        async annotationAnnotationIdOccurenceIdDelete(annotationId: string, occurenceId: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<void>> {
-            const localVarAxiosArgs = await localVarAxiosParamCreator.annotationAnnotationIdOccurenceIdDelete(annotationId, occurenceId, options);
+        async annotationAnnotationIdOccurenceIdDelete(annotationId: string, occurenceId: string, isFinal?: boolean, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<void>> {
+            const localVarAxiosArgs = await localVarAxiosParamCreator.annotationAnnotationIdOccurenceIdDelete(annotationId, occurenceId, isFinal, options);
             return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
         },
         /**
          * 
          * @param {string} annotationId 
+         * @param {boolean} [isFinal] 
          * @param {AnnotationInstanceAddRequest} [annotationInstanceAddRequest] 
          * @param {*} [options] Override http request option.
          * @throws {RequiredError}
          */
-        async annotationAnnotationIdPost(annotationId: string, annotationInstanceAddRequest?: AnnotationInstanceAddRequest, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<void>> {
-            const localVarAxiosArgs = await localVarAxiosParamCreator.annotationAnnotationIdPost(annotationId, annotationInstanceAddRequest, options);
+        async annotationAnnotationIdPost(annotationId: string, isFinal?: boolean, annotationInstanceAddRequest?: AnnotationInstanceAddRequest, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<void>> {
+            const localVarAxiosArgs = await localVarAxiosParamCreator.annotationAnnotationIdPost(annotationId, isFinal, annotationInstanceAddRequest, options);
             return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
         },
         /**
          * 
          * @param {string} annotationId 
          * @param {string} occurenceId 
+         * @param {boolean} [isFinal] 
          * @param {AddNoteToTagOccurenceRequest} [addNoteToTagOccurenceRequest] 
          * @param {*} [options] Override http request option.
          * @throws {RequiredError}
          */
-        async annotationAnnotationIdTagOccurenceIdNotePost(annotationId: string, occurenceId: string, addNoteToTagOccurenceRequest?: AddNoteToTagOccurenceRequest, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<void>> {
-            const localVarAxiosArgs = await localVarAxiosParamCreator.annotationAnnotationIdTagOccurenceIdNotePost(annotationId, occurenceId, addNoteToTagOccurenceRequest, options);
+        async annotationAnnotationIdTagOccurenceIdNotePost(annotationId: string, occurenceId: string, isFinal?: boolean, addNoteToTagOccurenceRequest?: AddNoteToTagOccurenceRequest, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<void>> {
+            const localVarAxiosArgs = await localVarAxiosParamCreator.annotationAnnotationIdTagOccurenceIdNotePost(annotationId, occurenceId, isFinal, addNoteToTagOccurenceRequest, options);
             return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
         },
         /**
@@ -1691,73 +1746,80 @@ export const AnnotationApiFactory = function (configuration?: Configuration, bas
         /**
          * 
          * @param {string} annotationId 
+         * @param {boolean} [isFinal] 
          * @param {MarkAnnotationDoneRequest} [markAnnotationDoneRequest] 
          * @param {*} [options] Override http request option.
          * @throws {RequiredError}
          */
-        annotationAnnotationIdDonePut(annotationId: string, markAnnotationDoneRequest?: MarkAnnotationDoneRequest, options?: any): AxiosPromise<void> {
-            return localVarFp.annotationAnnotationIdDonePut(annotationId, markAnnotationDoneRequest, options).then((request) => request(axios, basePath));
+        annotationAnnotationIdDonePut(annotationId: string, isFinal?: boolean, markAnnotationDoneRequest?: MarkAnnotationDoneRequest, options?: any): AxiosPromise<void> {
+            return localVarFp.annotationAnnotationIdDonePut(annotationId, isFinal, markAnnotationDoneRequest, options).then((request) => request(axios, basePath));
         },
         /**
          * 
          * @param {string} annotationId 
+         * @param {boolean} [isFinal] 
          * @param {*} [options] Override http request option.
          * @throws {RequiredError}
          */
-        annotationAnnotationIdGet(annotationId: string, options?: any): AxiosPromise<AnnotationInfo> {
-            return localVarFp.annotationAnnotationIdGet(annotationId, options).then((request) => request(axios, basePath));
+        annotationAnnotationIdGet(annotationId: string, isFinal?: boolean, options?: any): AxiosPromise<AnnotationInfo> {
+            return localVarFp.annotationAnnotationIdGet(annotationId, isFinal, options).then((request) => request(axios, basePath));
         },
         /**
          * 
          * @param {string} annotationId 
          * @param {string} instanceId 
+         * @param {boolean} [isFinal] 
          * @param {SetInstanceSentimentRequest} [setInstanceSentimentRequest] 
          * @param {*} [options] Override http request option.
          * @throws {RequiredError}
          */
-        annotationAnnotationIdInstanceIdSentimentPut(annotationId: string, instanceId: string, setInstanceSentimentRequest?: SetInstanceSentimentRequest, options?: any): AxiosPromise<void> {
-            return localVarFp.annotationAnnotationIdInstanceIdSentimentPut(annotationId, instanceId, setInstanceSentimentRequest, options).then((request) => request(axios, basePath));
+        annotationAnnotationIdInstanceIdSentimentPut(annotationId: string, instanceId: string, isFinal?: boolean, setInstanceSentimentRequest?: SetInstanceSentimentRequest, options?: any): AxiosPromise<void> {
+            return localVarFp.annotationAnnotationIdInstanceIdSentimentPut(annotationId, instanceId, isFinal, setInstanceSentimentRequest, options).then((request) => request(axios, basePath));
         },
         /**
          * 
          * @param {string} annotationId 
+         * @param {boolean} [isFinal] 
          * @param {AddNoteToAnnotationRequest} [addNoteToAnnotationRequest] 
          * @param {*} [options] Override http request option.
          * @throws {RequiredError}
          */
-        annotationAnnotationIdNotePost(annotationId: string, addNoteToAnnotationRequest?: AddNoteToAnnotationRequest, options?: any): AxiosPromise<void> {
-            return localVarFp.annotationAnnotationIdNotePost(annotationId, addNoteToAnnotationRequest, options).then((request) => request(axios, basePath));
+        annotationAnnotationIdNotePost(annotationId: string, isFinal?: boolean, addNoteToAnnotationRequest?: AddNoteToAnnotationRequest, options?: any): AxiosPromise<void> {
+            return localVarFp.annotationAnnotationIdNotePost(annotationId, isFinal, addNoteToAnnotationRequest, options).then((request) => request(axios, basePath));
         },
         /**
          * 
          * @param {string} annotationId 
          * @param {string} occurenceId 
+         * @param {boolean} [isFinal] 
          * @param {*} [options] Override http request option.
          * @throws {RequiredError}
          */
-        annotationAnnotationIdOccurenceIdDelete(annotationId: string, occurenceId: string, options?: any): AxiosPromise<void> {
-            return localVarFp.annotationAnnotationIdOccurenceIdDelete(annotationId, occurenceId, options).then((request) => request(axios, basePath));
+        annotationAnnotationIdOccurenceIdDelete(annotationId: string, occurenceId: string, isFinal?: boolean, options?: any): AxiosPromise<void> {
+            return localVarFp.annotationAnnotationIdOccurenceIdDelete(annotationId, occurenceId, isFinal, options).then((request) => request(axios, basePath));
         },
         /**
          * 
          * @param {string} annotationId 
+         * @param {boolean} [isFinal] 
          * @param {AnnotationInstanceAddRequest} [annotationInstanceAddRequest] 
          * @param {*} [options] Override http request option.
          * @throws {RequiredError}
          */
-        annotationAnnotationIdPost(annotationId: string, annotationInstanceAddRequest?: AnnotationInstanceAddRequest, options?: any): AxiosPromise<void> {
-            return localVarFp.annotationAnnotationIdPost(annotationId, annotationInstanceAddRequest, options).then((request) => request(axios, basePath));
+        annotationAnnotationIdPost(annotationId: string, isFinal?: boolean, annotationInstanceAddRequest?: AnnotationInstanceAddRequest, options?: any): AxiosPromise<void> {
+            return localVarFp.annotationAnnotationIdPost(annotationId, isFinal, annotationInstanceAddRequest, options).then((request) => request(axios, basePath));
         },
         /**
          * 
          * @param {string} annotationId 
          * @param {string} occurenceId 
+         * @param {boolean} [isFinal] 
          * @param {AddNoteToTagOccurenceRequest} [addNoteToTagOccurenceRequest] 
          * @param {*} [options] Override http request option.
          * @throws {RequiredError}
          */
-        annotationAnnotationIdTagOccurenceIdNotePost(annotationId: string, occurenceId: string, addNoteToTagOccurenceRequest?: AddNoteToTagOccurenceRequest, options?: any): AxiosPromise<void> {
-            return localVarFp.annotationAnnotationIdTagOccurenceIdNotePost(annotationId, occurenceId, addNoteToTagOccurenceRequest, options).then((request) => request(axios, basePath));
+        annotationAnnotationIdTagOccurenceIdNotePost(annotationId: string, occurenceId: string, isFinal?: boolean, addNoteToTagOccurenceRequest?: AddNoteToTagOccurenceRequest, options?: any): AxiosPromise<void> {
+            return localVarFp.annotationAnnotationIdTagOccurenceIdNotePost(annotationId, occurenceId, isFinal, addNoteToTagOccurenceRequest, options).then((request) => request(axios, basePath));
         },
         /**
          * 
@@ -1781,86 +1843,93 @@ export class AnnotationApi extends BaseAPI {
     /**
      * 
      * @param {string} annotationId 
+     * @param {boolean} [isFinal] 
      * @param {MarkAnnotationDoneRequest} [markAnnotationDoneRequest] 
      * @param {*} [options] Override http request option.
      * @throws {RequiredError}
      * @memberof AnnotationApi
      */
-    public annotationAnnotationIdDonePut(annotationId: string, markAnnotationDoneRequest?: MarkAnnotationDoneRequest, options?: AxiosRequestConfig) {
-        return AnnotationApiFp(this.configuration).annotationAnnotationIdDonePut(annotationId, markAnnotationDoneRequest, options).then((request) => request(this.axios, this.basePath));
+    public annotationAnnotationIdDonePut(annotationId: string, isFinal?: boolean, markAnnotationDoneRequest?: MarkAnnotationDoneRequest, options?: AxiosRequestConfig) {
+        return AnnotationApiFp(this.configuration).annotationAnnotationIdDonePut(annotationId, isFinal, markAnnotationDoneRequest, options).then((request) => request(this.axios, this.basePath));
     }
 
     /**
      * 
      * @param {string} annotationId 
+     * @param {boolean} [isFinal] 
      * @param {*} [options] Override http request option.
      * @throws {RequiredError}
      * @memberof AnnotationApi
      */
-    public annotationAnnotationIdGet(annotationId: string, options?: AxiosRequestConfig) {
-        return AnnotationApiFp(this.configuration).annotationAnnotationIdGet(annotationId, options).then((request) => request(this.axios, this.basePath));
+    public annotationAnnotationIdGet(annotationId: string, isFinal?: boolean, options?: AxiosRequestConfig) {
+        return AnnotationApiFp(this.configuration).annotationAnnotationIdGet(annotationId, isFinal, options).then((request) => request(this.axios, this.basePath));
     }
 
     /**
      * 
      * @param {string} annotationId 
      * @param {string} instanceId 
+     * @param {boolean} [isFinal] 
      * @param {SetInstanceSentimentRequest} [setInstanceSentimentRequest] 
      * @param {*} [options] Override http request option.
      * @throws {RequiredError}
      * @memberof AnnotationApi
      */
-    public annotationAnnotationIdInstanceIdSentimentPut(annotationId: string, instanceId: string, setInstanceSentimentRequest?: SetInstanceSentimentRequest, options?: AxiosRequestConfig) {
-        return AnnotationApiFp(this.configuration).annotationAnnotationIdInstanceIdSentimentPut(annotationId, instanceId, setInstanceSentimentRequest, options).then((request) => request(this.axios, this.basePath));
+    public annotationAnnotationIdInstanceIdSentimentPut(annotationId: string, instanceId: string, isFinal?: boolean, setInstanceSentimentRequest?: SetInstanceSentimentRequest, options?: AxiosRequestConfig) {
+        return AnnotationApiFp(this.configuration).annotationAnnotationIdInstanceIdSentimentPut(annotationId, instanceId, isFinal, setInstanceSentimentRequest, options).then((request) => request(this.axios, this.basePath));
     }
 
     /**
      * 
      * @param {string} annotationId 
+     * @param {boolean} [isFinal] 
      * @param {AddNoteToAnnotationRequest} [addNoteToAnnotationRequest] 
      * @param {*} [options] Override http request option.
      * @throws {RequiredError}
      * @memberof AnnotationApi
      */
-    public annotationAnnotationIdNotePost(annotationId: string, addNoteToAnnotationRequest?: AddNoteToAnnotationRequest, options?: AxiosRequestConfig) {
-        return AnnotationApiFp(this.configuration).annotationAnnotationIdNotePost(annotationId, addNoteToAnnotationRequest, options).then((request) => request(this.axios, this.basePath));
+    public annotationAnnotationIdNotePost(annotationId: string, isFinal?: boolean, addNoteToAnnotationRequest?: AddNoteToAnnotationRequest, options?: AxiosRequestConfig) {
+        return AnnotationApiFp(this.configuration).annotationAnnotationIdNotePost(annotationId, isFinal, addNoteToAnnotationRequest, options).then((request) => request(this.axios, this.basePath));
     }
 
     /**
      * 
      * @param {string} annotationId 
      * @param {string} occurenceId 
+     * @param {boolean} [isFinal] 
      * @param {*} [options] Override http request option.
      * @throws {RequiredError}
      * @memberof AnnotationApi
      */
-    public annotationAnnotationIdOccurenceIdDelete(annotationId: string, occurenceId: string, options?: AxiosRequestConfig) {
-        return AnnotationApiFp(this.configuration).annotationAnnotationIdOccurenceIdDelete(annotationId, occurenceId, options).then((request) => request(this.axios, this.basePath));
+    public annotationAnnotationIdOccurenceIdDelete(annotationId: string, occurenceId: string, isFinal?: boolean, options?: AxiosRequestConfig) {
+        return AnnotationApiFp(this.configuration).annotationAnnotationIdOccurenceIdDelete(annotationId, occurenceId, isFinal, options).then((request) => request(this.axios, this.basePath));
     }
 
     /**
      * 
      * @param {string} annotationId 
+     * @param {boolean} [isFinal] 
      * @param {AnnotationInstanceAddRequest} [annotationInstanceAddRequest] 
      * @param {*} [options] Override http request option.
      * @throws {RequiredError}
      * @memberof AnnotationApi
      */
-    public annotationAnnotationIdPost(annotationId: string, annotationInstanceAddRequest?: AnnotationInstanceAddRequest, options?: AxiosRequestConfig) {
-        return AnnotationApiFp(this.configuration).annotationAnnotationIdPost(annotationId, annotationInstanceAddRequest, options).then((request) => request(this.axios, this.basePath));
+    public annotationAnnotationIdPost(annotationId: string, isFinal?: boolean, annotationInstanceAddRequest?: AnnotationInstanceAddRequest, options?: AxiosRequestConfig) {
+        return AnnotationApiFp(this.configuration).annotationAnnotationIdPost(annotationId, isFinal, annotationInstanceAddRequest, options).then((request) => request(this.axios, this.basePath));
     }
 
     /**
      * 
      * @param {string} annotationId 
      * @param {string} occurenceId 
+     * @param {boolean} [isFinal] 
      * @param {AddNoteToTagOccurenceRequest} [addNoteToTagOccurenceRequest] 
      * @param {*} [options] Override http request option.
      * @throws {RequiredError}
      * @memberof AnnotationApi
      */
-    public annotationAnnotationIdTagOccurenceIdNotePost(annotationId: string, occurenceId: string, addNoteToTagOccurenceRequest?: AddNoteToTagOccurenceRequest, options?: AxiosRequestConfig) {
-        return AnnotationApiFp(this.configuration).annotationAnnotationIdTagOccurenceIdNotePost(annotationId, occurenceId, addNoteToTagOccurenceRequest, options).then((request) => request(this.axios, this.basePath));
+    public annotationAnnotationIdTagOccurenceIdNotePost(annotationId: string, occurenceId: string, isFinal?: boolean, addNoteToTagOccurenceRequest?: AddNoteToTagOccurenceRequest, options?: AxiosRequestConfig) {
+        return AnnotationApiFp(this.configuration).annotationAnnotationIdTagOccurenceIdNotePost(annotationId, occurenceId, isFinal, addNoteToTagOccurenceRequest, options).then((request) => request(this.axios, this.basePath));
     }
 
     /**
@@ -2095,6 +2164,39 @@ export class AuthApi extends BaseAPI {
  */
 export const DocumentApiAxiosParamCreator = function (configuration?: Configuration) {
     return {
+        /**
+         * 
+         * @param {string} documentId 
+         * @param {*} [options] Override http request option.
+         * @throws {RequiredError}
+         */
+        documentDocumentIdFinalPost: async (documentId: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
+            // verify required parameter 'documentId' is not null or undefined
+            assertParamExists('documentDocumentIdFinalPost', 'documentId', documentId)
+            const localVarPath = `/document/{documentId}/final`
+                .replace(`{${"documentId"}}`, encodeURIComponent(String(documentId)));
+            // use dummy base URL string because the URL constructor only accepts absolute URLs.
+            const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
+            let baseOptions;
+            if (configuration) {
+                baseOptions = configuration.baseOptions;
+            }
+
+            const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
+            const localVarHeaderParameter = {} as any;
+            const localVarQueryParameter = {} as any;
+
+
+    
+            setSearchParams(localVarUrlObj, localVarQueryParameter);
+            let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
+            localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
+
+            return {
+                url: toPathString(localVarUrlObj),
+                options: localVarRequestOptions,
+            };
+        },
         /**
          * 
          * @param {string} documentId 
@@ -2305,6 +2407,16 @@ export const DocumentApiAxiosParamCreator = function (configuration?: Configurat
 export const DocumentApiFp = function(configuration?: Configuration) {
     const localVarAxiosParamCreator = DocumentApiAxiosParamCreator(configuration)
     return {
+        /**
+         * 
+         * @param {string} documentId 
+         * @param {*} [options] Override http request option.
+         * @throws {RequiredError}
+         */
+        async documentDocumentIdFinalPost(documentId: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<CreateFinalAnnotationResponse>> {
+            const localVarAxiosArgs = await localVarAxiosParamCreator.documentDocumentIdFinalPost(documentId, options);
+            return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
+        },
         /**
          * 
          * @param {string} documentId 
@@ -2375,6 +2487,15 @@ export const DocumentApiFp = function(configuration?: Configuration) {
 export const DocumentApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
     const localVarFp = DocumentApiFp(configuration)
     return {
+        /**
+         * 
+         * @param {string} documentId 
+         * @param {*} [options] Override http request option.
+         * @throws {RequiredError}
+         */
+        documentDocumentIdFinalPost(documentId: string, options?: any): AxiosPromise<CreateFinalAnnotationResponse> {
+            return localVarFp.documentDocumentIdFinalPost(documentId, options).then((request) => request(axios, basePath));
+        },
         /**
          * 
          * @param {string} documentId 
@@ -2439,6 +2560,17 @@ export const DocumentApiFactory = function (configuration?: Configuration, baseP
  * @extends {BaseAPI}
  */
 export class DocumentApi extends BaseAPI {
+    /**
+     * 
+     * @param {string} documentId 
+     * @param {*} [options] Override http request option.
+     * @throws {RequiredError}
+     * @memberof DocumentApi
+     */
+    public documentDocumentIdFinalPost(documentId: string, options?: AxiosRequestConfig) {
+        return DocumentApiFp(this.configuration).documentDocumentIdFinalPost(documentId, options).then((request) => request(this.axios, this.basePath));
+    }
+
     /**
      * 
      * @param {string} documentId 
diff --git a/webapp/contexts/AnnotationContext.tsx b/webapp/contexts/AnnotationContext.tsx
index 1188815..e4005bd 100644
--- a/webapp/contexts/AnnotationContext.tsx
+++ b/webapp/contexts/AnnotationContext.tsx
@@ -204,6 +204,7 @@ export const AnnotationContext = createContext<IAnnotationContextProvider>({
 const AnnotationProvider = (props: {
     children: React.ReactNode;
     annotationId: string;
+    isFinal: boolean;
 }) => {
     const [annotation, setAnnotation] = useState<AnnotationInfo | null>(null);
 
@@ -244,7 +245,7 @@ const AnnotationProvider = (props: {
         const id = subtagId ?? tagId;
         const type: ETagType = subtagId == null ? ETagType.Tag : ETagType.Subtag;
         const res = await annotationController
-            .annotationAnnotationIdPost(props.annotationId, {
+            .annotationAnnotationIdPost(props.annotationId, props.isFinal, {
                 id: id,
                 instanceId,
                 type,
@@ -295,9 +296,14 @@ const AnnotationProvider = (props: {
         ShowConfirm(
             () =>
                 annotationController
-                    .annotationAnnotationIdDonePut(props.annotationId, req)
+                    .annotationAnnotationIdDonePut(props.annotationId, props.isFinal, req)
                     .then(() => {
-                        router.push('/documents/annotator');
+                        if (props.isFinal) {
+                            router.push('/documents/admin');
+                        } else {
+                            router.push('/documents/annotator');
+                        }
+
                         ShowToast('Anotování bylo úspěšně dokončeno');
                     }),
             'dokončit anotování'
@@ -337,6 +343,7 @@ const AnnotationProvider = (props: {
             await annotationController.annotationAnnotationIdTagOccurenceIdNotePost(
                 props.annotationId,
                 occurrence.occurenceId,
+                props.isFinal,
                 { note: newValue }
             );
 
@@ -361,6 +368,7 @@ const AnnotationProvider = (props: {
             await annotationController.annotationAnnotationIdInstanceIdSentimentPut(
                 props.annotationId,
                 occurrence.instance,
+                props.isFinal,
                 { sentiment: newValue }
             );
 
@@ -391,7 +399,8 @@ const AnnotationProvider = (props: {
 
     async function refreshAnnotation() {
         const data = await annotationController.annotationAnnotationIdGet(
-            props.annotationId
+            props.annotationId,
+            props.isFinal
         );
 
         remapAnnotations(data.data);
diff --git a/webapp/pages/annotation/[id].tsx b/webapp/pages/annotation/[id].tsx
index 80afdcf..a8f41bf 100644
--- a/webapp/pages/annotation/[id].tsx
+++ b/webapp/pages/annotation/[id].tsx
@@ -15,9 +15,11 @@ import { useRouter } from 'next/router';
  */
 function Annotation() {
     const router = useRouter();
-    const { id } = router.query;
+    const { id, final } = router.query;
 
-    if (!id || typeof id !== 'string') {
+    console.log(id, final);
+
+    if (!id || typeof id !== 'string' || typeof final !== 'string') {
         /*(async () => {
             await router.push('/documents');
         })(); // TODO*/
@@ -25,10 +27,13 @@ function Annotation() {
         return <p>Načítání...</p>;
     }
 
+    console.log('ok');
+
     const annotationId: string = Array.isArray(id) ? id[0] : id;
+    const isFinal: boolean = final === 'true';
 
     return (
-        <AnnotationProvider annotationId={annotationId}>
+        <AnnotationProvider annotationId={annotationId} isFinal={isFinal}>
             <TagCategoryProvider>
                 <MainLayout>
                     <div className={styles.layoutWrapper}>
diff --git a/webapp/pages/documents/annotator/index.tsx b/webapp/pages/documents/annotator/index.tsx
index 40a56aa..dc23499 100644
--- a/webapp/pages/documents/annotator/index.tsx
+++ b/webapp/pages/documents/annotator/index.tsx
@@ -101,7 +101,12 @@ function UserDocumentPage() {
                 <Button
                     key={anotationId}
                     type={'primary'}
-                    onClick={() => router.push('/annotation/' + anotationId)}
+                    onClick={() =>
+                        router.push({
+                            pathname: '/annotation/[annotationId]',
+                            query: { annotationId: anotationId, final: false },
+                        })
+                    }
                 >
                     Anotovat
                 </Button>
