From 213e1f99bfd9cec46674ea4e523b7b711598103b Mon Sep 17 00:00:00 2001
From: OZGCloud <ozgcloud@mgm-tp.com>
Date: Thu, 14 Mar 2024 10:35:49 +0100
Subject: [PATCH] OZG-5009 minor cleanup

---
 .../src/lib/+state/bescheid.facade.spec.ts       |  4 ----
 .../src/lib/+state/bescheid.facade.ts            | 16 +++++++++++++++-
 2 files changed, 15 insertions(+), 5 deletions(-)

diff --git a/alfa-client/libs/bescheid-shared/src/lib/+state/bescheid.facade.spec.ts b/alfa-client/libs/bescheid-shared/src/lib/+state/bescheid.facade.spec.ts
index 743c77d19e..1d5c6b1c4d 100644
--- a/alfa-client/libs/bescheid-shared/src/lib/+state/bescheid.facade.spec.ts
+++ b/alfa-client/libs/bescheid-shared/src/lib/+state/bescheid.facade.spec.ts
@@ -40,10 +40,6 @@ describe('BescheidFacade', () => {
     const vorgangWithEingang: VorgangWithEingangResource = createVorgangWithEingangResource();
     const createCommand: CreateCommand = createCreateCommand(CommandOrder.CREATE_BESCHEID);
 
-    beforeEach(() => {
-      jest.resetAllMocks();
-    });
-
     describe('with both Links', () => {
       it('should dispatch "createCommand" to CREATE_BESCHEID', () => {
         var vorgang = createVorgangWithEingangResource([
diff --git a/alfa-client/libs/bescheid-shared/src/lib/+state/bescheid.facade.ts b/alfa-client/libs/bescheid-shared/src/lib/+state/bescheid.facade.ts
index 2bfd2bfbca..ad7d1eb0a8 100644
--- a/alfa-client/libs/bescheid-shared/src/lib/+state/bescheid.facade.ts
+++ b/alfa-client/libs/bescheid-shared/src/lib/+state/bescheid.facade.ts
@@ -1,9 +1,10 @@
-import { Injectable } from '@angular/core';
 import { CommandResource, CreateCommand } from '@alfa-client/command-shared';
 import { StateResource } from '@alfa-client/tech-shared';
 import { VorgangWithEingangLinkRel, VorgangWithEingangResource } from '@alfa-client/vorgang-shared';
+import { Injectable } from '@angular/core';
 import { Store } from '@ngrx/store';
 import { Observable, throwError } from 'rxjs';
+
 import * as CommandActions from '../../../../command-shared/src/lib/+state/command.actions';
 import * as BescheidSelectors from './bescheid.selectors';
 import { hasLink } from '@ngxp/rest';
@@ -41,4 +42,17 @@ export class BescheidFacade {
       }),
     );
   }
+
+  public createBescheidDraft(
+    vorgangWithEingang: VorgangWithEingangResource,
+    command: CreateCommand,
+  ): void {
+    this.store.dispatch(
+      CommandActions.createCommand({
+        resource: vorgangWithEingang,
+        linkRel: VorgangWithEingangLinkRel.CREATE_BESCHEID_DRAFT,
+        command,
+      }),
+    );
+  }
 }
-- 
GitLab