diff --git a/.github/commit-instructions.md b/.github/commit-instructions.md index 8d78369f9..f3aaaacd5 100644 --- a/.github/commit-instructions.md +++ b/.github/commit-instructions.md @@ -21,41 +21,44 @@ The commit message structure is as follows: 1. **Type**: Indicates the kind of change introduced by the commit. Must be one of the allowed types (see below). 2. **Scope (Optional)**: A noun describing the section of the codebase affected by the change (e.g., `auth`, `ui`, `build`). Enclosed in parentheses. 3. **Description**: A concise summary of the change in the imperative, present tense (e.g., "add login feature", not "added login feature" or "adds login feature"). Starts with a lowercase letter and should not end with a period. Max 72 characters recommended for the entire header line (`[optional scope]: `). -4. **Body (Optional)**: A more detailed explanation of the changes. Use the imperative, present tense. Explain the *what* and *why* vs. *how*. Separate from the description by a blank line. Wrap lines at 72 characters. +4. **Body (Optional)**: A more detailed explanation of the changes. Use the imperative, present tense. Explain the _what_ and _why_ vs. _how_. Separate from the description by a blank line. Wrap lines at 72 characters. 5. **Footer(s) (Optional)**: Contains additional metadata. Common footers include: - * `BREAKING CHANGE:` followed by a description of the breaking change. A `!` can also be appended to the type/scope (`feat!:`) to indicate a breaking change. - * Issue references (e.g., `Refs: #123`, `Closes: #456`). Separate from the body by a blank line. + - `BREAKING CHANGE:` followed by a description of the breaking change. A `!` can also be appended to the type/scope (`feat!:`) to indicate a breaking change. + - Issue references (e.g., `Refs: #123`, `Closes: #456`). Separate from the body by a blank line. --- ### Allowed Types -* **feat**: A new feature for the user. -* **fix**: A bug fix for the user. -* **build**: Changes that affect the build system or external dependencies (e.g., gulp, broccoli, npm). -* **chore**: Other changes that don't modify src or test files (e.g., updating dependencies, build tasks). -* **ci**: Changes to CI configuration files and scripts (e.g., Travis, Circle, BrowserStack, SauceLabs). -* **docs**: Documentation only changes. -* **perf**: A code change that improves performance. -* **refactor**: A code change that neither fixes a bug nor adds a feature. -* **style**: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc). -* **test**: Adding missing tests or correcting existing tests. +- **feat**: A new feature for the user. +- **fix**: A bug fix for the user. +- **build**: Changes that affect the build system or external dependencies (e.g., gulp, broccoli, npm). +- **chore**: Other changes that don't modify src or test files (e.g., updating dependencies, build tasks). +- **ci**: Changes to CI configuration files and scripts (e.g., Travis, Circle, BrowserStack, SauceLabs). +- **docs**: Documentation only changes. +- **perf**: A code change that improves performance. +- **refactor**: A code change that neither fixes a bug nor adds a feature. +- **style**: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc). +- **test**: Adding missing tests or correcting existing tests. --- ### Examples **Commit with description only:** + ``` fix: correct minor typos in code ``` **Commit with scope:** + ``` feat(lang): add polish language ``` **Commit with body and breaking change footer:** + ``` refactor: drop support for Node 6 @@ -66,6 +69,7 @@ BREAKING CHANGE: refactor to use JavaScript features not available in Node 6. ``` **Commit with scope, body, and issue footer:** + ``` docs(readme): improve installation instructions @@ -76,6 +80,7 @@ Closes: #12 ``` **Commit with `!` for breaking change:** + ``` feat(api)!: send an email to the customer when a product is shipped ``` diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md index 4ae09ba2a..67c298fda 100644 --- a/.github/copilot-instructions.md +++ b/.github/copilot-instructions.md @@ -1,17 +1,21 @@ -# Spark Instructions +# Mentor Instructions ## Introduction -You are Spark, a mentor designed to help me with coding, preview my work, and assist me in improving by pointing out areas for enhancement. +You are Mentor, an AI assistant focused on ensuring code quality, strict adherence to best practices, and development efficiency. **Your core function is to enforce the coding standards and guidelines established in this workspace.** Your goal is to help me produce professional, maintainable, and high-performing code. ## Tone and Personality -You are a mentor with a dual approach: when I make a mistake or my work needs improvement, you adopt a strict and technical tone to clearly explain what’s wrong and how to fix it. In all other cases, you are casual and friendly, like a supportive coding buddy, keeping the vibe light and encouraging. +Maintain a professional, objective, and direct tone consistently: + +- **Guideline Enforcement & Error Correction:** When code deviates from guidelines or contains errors, provide precise, technical feedback. Clearly state the issue, cite the relevant guideline or principle, and explain the required correction for optimal, maintainable results. +- **Technical Consultation:** In discussions about architecture, best practices, or complex coding inquiries, remain formal and analytical. Provide clear, well-reasoned explanations and recommendations grounded in industry standards and the project's specific guidelines. ## Behavioral Guidelines -- Focus on constructive feedback; avoid simply rewriting my code unless I ask for it. -- If my question or code is unclear, ask me for clarification or more details. -- Do not discourage me; always frame suggestions as opportunities for growth. -- Avoid giving generic answers—tailor your advice to my specific code or problem. -- Keep my preferences in mind: prioritize Type safety, follow Clean Code principles and emphasize good documentation. +- **Actionable Feedback:** Prioritize constructive, actionable feedback aimed at improving code quality, maintainability, and adherence to standards. Avoid rewriting code; focus on explaining the necessary changes and their rationale based on guidelines. +- **Strict Guideline Adherence:** Base _all_ feedback, suggestions, and explanations rigorously on the guidelines documented within this workspace. Cite specific rules and principles consistently. +- **Demand Clarity:** If a query or code snippet lacks sufficient detail for a thorough, professional analysis, request clarification. +- **Professional Framing:** Frame all feedback objectively, focusing on the technical aspects and the importance of meeting project standards for long-term success. +- **Context-Specific Expertise:** Provide specific, context-aware advice tailored to the code or problem, always within the framework of our established guidelines. +- **Enforce Standards:** Actively enforce project preferences for Type safety, Clean Code principles, and thorough documentation, as mandated by the workspace guidelines. diff --git a/.github/review-instructions.md b/.github/review-instructions.md index 7b1f78619..e80b0cbc1 100644 --- a/.github/review-instructions.md +++ b/.github/review-instructions.md @@ -36,8 +36,9 @@ When conducting a code review, follow these steps to ensure a thorough and const ## Additional Informations -- Treat missing tests and JSDocs as warnings -- Tread missing unit test as warnings +- Missing tests and JSDocs are minor issues +- Missing unit test are minor issues +- Missing End-to-End (E2E) Testing Attributes (`data-what`, `data-which`) are warnings ### Review Template diff --git a/.github/testing-instructions.md b/.github/testing-instructions.md index 9d37206e5..704b157fa 100644 --- a/.github/testing-instructions.md +++ b/.github/testing-instructions.md @@ -1,10 +1,12 @@ # Testing Instructions ## Framework and Tools + - Use **Jest** as the testing framework. - For unit tests, utilize **Spectator** to simplify Angular component testing. ## Guidelines + 1. **Error Case Testing**: Ensure all edge cases and error scenarios are thoroughly tested. 2. **Arrange-Act-Assert Pattern**: Follow the Arrange-Act-Assert pattern for structuring your tests: - **Arrange**: Set up the testing environment and initialize required variables. @@ -12,12 +14,14 @@ - **Assert**: Verify the expected outcomes. ## Best Practices + - Write clear and descriptive test names. - Ensure tests are isolated and do not depend on each other. - Mock external dependencies to avoid side effects. - Aim for high code coverage without compromising test quality. ## Example Test Structure + ```typescript // Example using Jest and Spectator import { createComponentFactory, Spectator } from '@ngneat/spectator'; @@ -57,5 +61,6 @@ describe('MyComponent', () => { ``` ## Additional Resources + - [Jest Documentation](https://jestjs.io/docs/getting-started) -- [Spectator Documentation](https://ngneat.github.io/spectator/) \ No newline at end of file +- [Spectator Documentation](https://ngneat.github.io/spectator/) diff --git a/.vscode/settings.json b/.vscode/settings.json index 7c1a60c0f..cc98f14c3 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -19,7 +19,10 @@ "exportall.config.folderListener": [ "/libs/oms/data-access/src/lib/models", "/libs/oms/data-access/src/lib/schemas", - "/libs/catalogue/data-access/src/lib/models" + "/libs/catalogue/data-access/src/lib/models", + "/libs/common/data-access/src/lib/models", + "/libs/common/data-access/src/lib/error", + "/libs/oms/data-access/src/lib/errors/return-process" ], "github.copilot.chat.commitMessageGeneration.instructions": [ { diff --git a/apps/isa-app/src/domain/printer/printer.service.ts b/apps/isa-app/src/domain/printer/printer.service.ts index eafadd126..763b91e98 100644 --- a/apps/isa-app/src/domain/printer/printer.service.ts +++ b/apps/isa-app/src/domain/printer/printer.service.ts @@ -1,5 +1,9 @@ import { Injectable } from '@angular/core'; -import { ArticleDTO, DisplayInfoDTO, EISPublicDocumentService } from '@generated/swagger/eis-api'; +import { + ArticleDTO, + DisplayInfoDTO, + EISPublicDocumentService, +} from '@generated/swagger/eis-api'; import { CatalogPrintService, CheckoutPrintService, @@ -42,7 +46,9 @@ export class DomainPrinterService { map((response: any) => { if (response.error && response.error.status === 503) { return { - error: response.message ? response.message : 'Das Backend ist derzeit nicht erreichbar', + error: response.message + ? response.message + : 'Das Backend ist derzeit nicht erreichbar', }; } if (response.error && response.error.name === 'TimeoutError') { @@ -77,7 +83,9 @@ export class DomainPrinterService { map((response: any) => { if (response.error && response.error.status === 503) { return { - error: response.message ? response.message : 'Das Backend ist derzeit nicht erreichbar', + error: response.message + ? response.message + : 'Das Backend ist derzeit nicht erreichbar', }; } if (response.error && response.error.name === 'TimeoutError') { @@ -112,7 +120,9 @@ export class DomainPrinterService { map((response: any) => { if (response.error && response.error.status === 503) { return { - error: response.message ? response.message : 'Das Backend ist derzeit nicht erreichbar', + error: response.message + ? response.message + : 'Das Backend ist derzeit nicht erreichbar', }; } if (response.error && response.error.name === 'TimeoutError') { @@ -141,28 +151,61 @@ export class DomainPrinterService { ); } - printOrder({ orderIds, printer }: { orderIds: number[]; printer: string }): Observable { + printOrder({ + orderIds, + printer, + }: { + orderIds: number[]; + printer: string; + }): Observable { const params = { printer: printer, data: orderIds, }; - return this.oMSPrintService.OMSPrintAbholscheinById(params).pipe(timeout(20000)); + return this.oMSPrintService + .OMSPrintAbholscheinById(params) + .pipe(timeout(20000)); } - printShippingNote({ receipts, printer }: { receipts: number[]; printer: string }) { + printShippingNote({ + receipts, + printer, + }: { + receipts: number[]; + printer: string; + }) { return this.oMSPrintService.OMSPrintLieferschein({ printer, data: receipts, }); } - printCompartmentLabel({ orderItemSubsetIds, printer }: { orderItemSubsetIds: number[]; printer: string }) { + printCompartmentLabel({ + orderItemSubsetIds, + printer, + }: { + orderItemSubsetIds: number[]; + printer: string; + }) { return this.oMSPrintService.OMSPrintAbholfachetikett({ printer, data: orderItemSubsetIds, }); } + printReturnReceipt({ + receiptIds, + printer, + }: { + receiptIds: number[]; + printer: string; + }) { + return this.oMSPrintService.OMSPrintReturnReceipt({ + printer, + data: receiptIds, + }); + } + printKubiAgb({ p4mCode, printer }: { p4mCode: string; printer: string }) { return this._loyaltyCardPrintService.LoyaltyCardPrintPrintLoyaltyCardAGB({ printer, @@ -170,20 +213,36 @@ export class DomainPrinterService { }); } - printProduct({ item, printer }: { item: ItemDTO; printer: string }): Observable { + printProduct({ + item, + printer, + }: { + item: ItemDTO; + printer: string; + }): Observable { const params = { printer: printer, data: [item], }; - return this.catalogPrintService.CatalogPrintArtikelDetail(params).pipe(timeout(20000)); + return this.catalogPrintService + .CatalogPrintArtikelDetail(params) + .pipe(timeout(20000)); } - printCart({ cartId, printer }: { cartId: number; printer: string }): Observable { + printCart({ + cartId, + printer, + }: { + cartId: number; + printer: string; + }): Observable { const params = { printer: printer, data: cartId, }; - return this.checkoutPrintService.CheckoutPrintWarenkorbById(params).pipe(timeout(20000)); + return this.checkoutPrintService + .CheckoutPrintWarenkorbById(params) + .pipe(timeout(20000)); } async printGoodsInLabel(subsetItemIds: number[]): Promise { @@ -223,7 +282,9 @@ export class DomainPrinterService { printProductListItemsResponse( payload: DocumentPayloadOfIEnumerableOfProductListItemDTO, ): Observable { - return this._productListService.ProductListProductListItemPdfAsBase64(payload); + return this._productListService.ProductListProductListItemPdfAsBase64( + payload, + ); } printProductListItems({ diff --git a/docs/guidelines/code-style.md b/docs/guidelines/code-style.md index 91271d6a8..9e5ebb33b 100644 --- a/docs/guidelines/code-style.md +++ b/docs/guidelines/code-style.md @@ -200,6 +200,7 @@ This section extends the core code style principles with Angular-specific and ad - **File Organization**: Structure files according to features and follow the recommended folder structure. - **Control Flow**: Use modern control flow syntax (@if, @for) instead of structural directives (*ngIf, *ngFor). - **Signals**: Prefer signals over RxJS for simpler state management within components. +- **Standalone by Default**: Components and directives are standalone by default. The `standalone: true` flag is unnecessary. Only specify `standalone: false` when a component or directive explicitly needs to be part of an NgModule. ### TypeScript Enhancements diff --git a/docs/guidelines/testing.md b/docs/guidelines/testing.md index 6a8079a1b..2993d5c01 100644 --- a/docs/guidelines/testing.md +++ b/docs/guidelines/testing.md @@ -1,196 +1,319 @@ # Testing Guidelines -## Unit Testing Requirements +**Table of Contents** -- Test files should end with `.spec.ts` -- Use Spectator for Component, Directive and Service tests -- Use Jest as the test runner -- Follow the Arrange-Act-Assert (AAA) pattern in tests -- Mock external dependencies to isolate the unit under test -- Mock child components to ensure true unit testing isolation +1. [Introduction](#introduction) +2. [Core Testing Principles](#core-testing-principles) + * [Arrange-Act-Assert (AAA) Pattern](#arrange-act-assert-aaa-pattern) + * [Isolation: Mocking Dependencies](#isolation-mocking-dependencies) + * [Error Case Testing](#error-case-testing) + * [Clarity and Isolation](#clarity-and-isolation) +3. [Testing Tools](#testing-tools) + * [Jest: The Test Runner](#jest-the-test-runner) + * [Spectator: Simplifying Angular Tests](#spectator-simplifying-angular-tests) + * [Overview](#spectator-overview) + * [Core Factory Methods](#core-factory-methods) + * [Querying Elements](#querying-elements) + * [Working with Inputs/Outputs](#working-with-inputsoutputs) + * [Event Triggering](#event-triggering) + * [Custom Matchers](#custom-matchers) + * [ng-mocks: Advanced Mocking](#ng-mocks-advanced-mocking) + * [Overview](#ng-mocks-overview) + * [Key APIs](#key-apis) + * [When to Use ng-mocks](#when-to-use-ng-mocks) + * [Integration with Spectator](#integration-with-spectator) +4. [Best Practices](#best-practices) + * [General](#general) + * [Component Testing](#component-testing) + * [Service Testing](#service-testing) + * [Directive Testing](#directive-testing) + * [Mocking](#mocking) + * [Async Operations](#async-operations) + * [Performance](#performance) + * [Debugging](#debugging) +5. [Example Test Structures](#example-test-structures) + * [Basic Component Test (Spectator)](#basic-component-test-spectator) + * [Host Component Test (Spectator + Overrides)](#host-component-test-spectator--overrides) + * [Service Test (Spectator)](#service-test-spectator) + * [HTTP Service Test (Spectator)](#http-service-test-spectator) + * [Directive Test (Spectator)](#directive-test-spectator) + * [Standalone Component Test (Spectator)](#standalone-component-test-spectator) + * [Deferrable Views Test (Spectator)](#deferrable-views-test-spectator) + * [ng-mocks Example](#ng-mocks-example) +6. [End-to-End (E2E) Testing Attributes (`data-what`, `data-which`)](#end-to-end-e2e-testing-attributes-data-what-data-which) +7. [Running Tests (Nx)](#running-tests-nx) +8. [References](#references) -## Spectator Overview +--- -Spectator is a powerful library that simplifies Angular testing by: +## Introduction -- Reducing boilerplate code in tests -- Providing easy DOM querying utilities -- Offering a clean API for triggering events -- Supporting testing of components, directives, and services -- Including custom matchers for clearer assertions +This document outlines the guidelines and best practices for writing unit tests in this Angular project. Consistent and effective testing ensures code quality, maintainability, and reliability. + +**Key Requirements:** + +- Test files must end with `.spec.ts`. +- Use **Jest** as the primary test runner. +- Utilize **Spectator** for testing Components, Directives, and Services. +- Employ **ng-mocks** for mocking complex dependencies like child components. + +--- + +## Core Testing Principles + +Adhere to these fundamental principles for writing effective unit tests. + +### Arrange-Act-Assert (AAA) Pattern + +Structure your tests using the AAA pattern for clarity and consistency: + +1. **Arrange**: Set up the test environment. Initialize objects, mock dependencies, and prepare inputs. +2. **Act**: Execute the code being tested. Call the function or method under scrutiny. +3. **Assert**: Verify the outcome. Check if the actual result matches the expected result. + +### Isolation: Mocking Dependencies + +Unit tests should focus on a single unit of code in isolation. + +- **Mock External Dependencies**: Services, APIs, or other modules the unit interacts with should be mocked to prevent side effects and external failures from impacting the test. Spectator's `mocks` array in factory options simplifies this. +- **Mock Child Components**: When testing a component, mock its child components using Spectator's `overrideComponents` to ensure you are only testing the parent component's logic and template, not the children's implementation details. + +### Error Case Testing + +Go beyond the "happy path". Ensure your tests cover: + +- Edge cases +- Invalid inputs +- Error scenarios and how the unit handles them + +### Clarity and Isolation + +- **Clear Names**: Write descriptive `describe` and `it` block names that clearly state what is being tested and the expected outcome. +- **Independent Tests**: Ensure tests do not depend on each other. Each test should set up its own state and clean up afterward. Avoid relying on the execution order of tests. + +--- + +## Testing Tools + +### Jest: The Test Runner + +[Jest](https://jestjs.io/docs/getting-started) is the testing framework used for running tests, providing features like test discovery, assertion functions (`expect`), and mocking capabilities (`jest.fn()`, `jest.spyOn()`). + +### Spectator: Simplifying Angular Tests + +[Spectator](https://ngneat.github.io/spectator/) significantly reduces boilerplate and simplifies testing Angular components, directives, and services. + +#### Spectator Overview + +- **Less Boilerplate**: Streamlines `TestBed` configuration. +- **Easy DOM Querying**: Provides intuitive methods (`query`, `queryAll`, `byText`, etc.) to find elements. +- **Clean Event API**: Simplifies triggering user interactions (`click`, `typeInElement`, `keyboard`). +- **Custom Matchers**: Offers Jest matchers (`toExist`, `toHaveText`, `toBeDisabled`, etc.) for more readable assertions. + +#### Core Factory Methods + +Spectator provides factory functions to set up the testing environment: + +- `createComponentFactory`: For testing components in isolation. +- `createHostFactory`: For testing components within a host template (useful for inputs/outputs). +- `createDirectiveFactory`: For testing directives. +- `createServiceFactory`: For testing services. +- `createHttpFactory`: For testing services that interact with `HttpClient`. + +*Example Usage (Component):* +```typescript +import { createComponentFactory, Spectator } from '@ngneat/spectator/jest'; +import { MyComponent } from './my-component.component'; +import { SomeService } from '../some.service'; + +const createComponent = createComponentFactory({ + component: MyComponent, + mocks: [SomeService], // Automatically mocks SomeService + detectChanges: false, // Control initial change detection +}); + +let spectator: Spectator; +beforeEach(() => spectator = createComponent()); +``` + +#### Querying Elements + +Use Spectator's query methods to find elements for interaction or assertion: + +```typescript +// CSS selectors +const button = spectator.query('button.submit'); +const inputs = spectator.queryAll('input'); +// By component/directive type +const child = spectator.query(ChildComponent); +// By text, label, placeholder, etc. +const submitBtn = spectator.query(byText('Submit')); +const usernameInput = spectator.query(byLabel('Username')); +``` + +#### Working with Inputs/Outputs + +Easily set inputs and subscribe to outputs: + +```typescript +// Set single input +spectator.setInput('user', { name: 'Test' }); +// Set multiple inputs +spectator.setInput({ user: { name: 'Test' }, isAdmin: true }); +// Host component input +// spectator.setHostInput('propName', value); // If using createHostFactory + +// Subscribe to output +const outputSpy = jest.fn(); +spectator.output('userLoggedIn').subscribe(outputSpy); +spectator.click('button.login'); +expect(outputSpy).toHaveBeenCalled(); +``` + +#### Event Triggering + +Simulate user interactions: + +```typescript +spectator.click('.login-button'); +spectator.typeInElement('test user', 'input[name="username"]'); +spectator.keyboard.pressEnter('input[name="password"]'); +spectator.selectOption(spectator.query('select'), 'Option 2'); +``` + +#### Custom Matchers + +Improve assertion readability: + +```typescript +expect('.error-message').not.toExist(); +expect('h1.title').toHaveText('Welcome'); +expect('input.email').toHaveValue('test@example.com'); +expect('button.submit').toBeDisabled(); +expect('.parent').toHaveDescendant('.child'); +``` + +### ng-mocks: Advanced Mocking + +[ng-mocks](https://ng-mocks.sudo.eu/) excels at mocking complex Angular artifacts like Components, Directives, Pipes, and Modules, further enhancing test isolation. **Note:** While `ng-mocks` offers powerful features like `MockComponent` and `MockDirective`, in a standalone component architecture, the primary way to replace dependencies (including child components or directives) is often through Spectator's `overrideComponents` feature, as shown in the examples below. `ng-mocks` might still be useful for features like `MockProvider` or `MockInstance`. + +#### ng-mocks Overview + +- **Deep Mocking**: Easily mocks entire modules or specific declarations/providers. +- **Boilerplate Reduction**: Simplifies complex `TestBed` setups. +- **Helper Utilities**: Provides functions for interactions (`ngMocks.change`, `ngMocks.click`) and querying (`ngMocks.find`). + +#### Key APIs + +- **`MockBuilder`**: Fluent API to configure `TestBed`, specifying what to keep real and what to mock. +- **`MockRender`**: Enhanced `TestBed.createComponent` that respects lifecycle hooks and simplifies input/output binding. +- **`MockComponent`, `MockDirective`, `MockPipe`, `MockProvider`**: Functions to create shallow mocks of specific artifacts. (**Note:** For standalone, prefer `overrideComponents` for components/directives). +- **`MockInstance`**: Allows customizing mock behavior *before* initialization (e.g., setting up spies). + +#### When to Use ng-mocks + +- Mocking specific services or pipes using `MockProvider` when more control is needed than Spectator's `mocks` array offers. +- When needing fine-grained control over mock behavior using `MockInstance`. +- Testing components that rely heavily on content projection (`ng-content`). +- **Caution:** Avoid `MockComponent` and `MockDirective` for standalone components/directives; use Spectator's `overrideComponents` instead. + +#### Integration with Spectator + +Spectator and ng-mocks can work together. Use Spectator for the primary test setup and interaction/assertion. Use Spectator's `overrideComponents` to replace standalone child components/directives. Use `ng-mocks`' `MockProvider` or `MockInstance` when needed for services or advanced mocking scenarios. + +```typescript +// Example using Spectator's overrideComponents for a standalone child +import { createComponentFactory, Spectator } from '@ngneat/spectator/jest'; +import { ParentComponent } from './parent.component'; +import { ChildComponent } from './child.component'; +import { MockChildComponent } from './mock-child.component'; // A standalone mock component +import { ComplexService } from './complex.service'; +import { MockProvider } from 'ng-mocks'; // ng-mocks can still be used for providers + +const createComponent = createComponentFactory({ + component: ParentComponent, // Assume ParentComponent imports ChildComponent + overrideComponents: [ + [ + ParentComponent, // Target the component whose imports need overriding + { + remove: { imports: [ChildComponent] }, // Remove the real standalone component + add: { imports: [MockChildComponent] }, // Add the mock standalone component + }, + ], + ], + providers: [ + MockProvider(ComplexService, { // Mock service using ng-mocks' MockProvider + getData: () => of(['mocked data']), + }), + ], +}); + +// ... rest of the test using Spectator API ... +``` + +--- ## Best Practices +### General + +- **Focus**: Each test (`it` block) should ideally test one specific behavior or scenario. +- **Readability**: Use clear variable names and structure tests logically (AAA). +- **Avoid Logic**: Do not put complex logic within tests. Keep them simple and direct. +- **No Implementation Details**: Test the public API or observable behavior, not private methods or internal state. + ### Component Testing -- Use `createComponentFactory` for standalone components -- Use `createHostFactory` when testing components with templates and inputs/outputs -- Use `createDirectiveFactory` for testing directives -- Use `createServiceFactory` for testing services -- Test component inputs, outputs, and lifecycle hooks -- Verify DOM rendering and component behavior separately +- Use `createComponentFactory` for most components. Use `createHostFactory` only when testing interaction via template bindings (inputs/outputs) is necessary. +- Test inputs change behavior as expected. +- Test outputs are emitted correctly upon interaction. +- Test conditional rendering (`@if`, `@switch`) and loops (`@for`). +- Verify important DOM elements are rendered correctly based on state. +- **Mock Standalone Child Components/Directives** using Spectator's `overrideComponents` feature to isolate the component under test. -### Mocking Child Components +### Service Testing -Always mock child components to: +- Use `createServiceFactory`. +- Mock dependencies using the `mocks` array. +- Test public methods, ensuring they return expected values or have the correct side effects (like calling mocked dependencies). +- For services using `HttpClient`, use `createHttpFactory` and `SpectatorHttp` for easy request expectation (`spectator.expectOne`). -- Isolate the component under test -- Prevent unintended side effects -- Reduce test complexity -- Improve test performance +### Directive Testing -```typescript -import { MockComponent } from 'ng-mocks'; -import { ChildComponent } from './child.component'; +- Use `createDirectiveFactory`. +- Test how the directive affects the host element or other elements based on inputs or events. +- If a directive has standalone dependencies, use `overrideDirectives` (similar to `overrideComponents`) in the factory options. -describe('ParentComponent', () => { - const createComponent = createComponentFactory({ - component: ParentComponent, - declarations: [MockComponent(ChildComponent)], - }); -}); -``` +### Mocking -## Spectator API Reference +- Prefer Spectator's `mocks` array for simple service mocking. +- Use `spectator.inject(ServiceToMock)` to get the mocked instance and configure its methods (e.g., `mockService.method.mockReturnValue(...)`). +- Use Spectator's `overrideComponents` or `overrideDirectives` to replace standalone component/directive dependencies with mocks. +- Use `MockProvider` from `ng-mocks` if you need more control over service mocking than Spectator's `mocks` array provides, or for mocking tokens/values. -### Core Factory Methods +### Async Operations -1. **For Components**: +- Use `async/await` with Promises. +- For RxJS Observables, subscribe within the test or use helpers like `waitForAsync` or Jest's timer mocks if needed, though often direct subscription is sufficient. Spectator handles basic async operations well. - ```typescript - const createComponent = createComponentFactory({ - component: MyComponent, - imports: [SomeModule], - declarations: [SomeDirective], - providers: [SomeService], - componentProviders: [], // Providers specific to the component - componentViewProviders: [], // ViewProviders for the component - mocks: [ServiceToMock], // Automatically mocks the service - detectChanges: false, // Whether to run change detection initially - }); - ``` +### Performance -2. **For Components with Host**: +- Mock heavy dependencies (e.g., HTTP calls, complex computations). +- Keep test setup (`beforeEach`) lean. Use `beforeAll` only for setup that is truly read-only and shared across all tests in a `describe` block. - ```typescript - const createHost = createHostFactory({ - component: MyComponent, - template: ``, - // ...other options similar to createComponentFactory - }); - ``` +### Debugging -3. **For Directives**: +- Use `spectator.debug()` to print the current component's DOM structure to the console. +- Use standard `console.log` statements temporarily. +- Utilize your IDE's debugger with breakpoints. - ```typescript - const createDirective = createDirectiveFactory({ - directive: MyDirective, - template: `
`, - // ...other options - }); - ``` - -4. **For Services**: - - ```typescript - const createService = createServiceFactory({ - service: MyService, - providers: [DependencyService], - mocks: [HttpClient], - entryComponents: [], - }); - ``` - -5. **For HTTP Services**: - ```typescript - const createHttpService = createHttpFactory({ - service: MyHttpService, - providers: [SomeService], - mocks: [TokenService], - }); - ``` - -### Querying Elements - -Spectator offers multiple ways to query the DOM: - -```typescript -// Basic CSS selectors -const button = spectator.query('button.submit'); -const inputs = spectator.queryAll('input'); - -// By directive/component type -const childComponent = spectator.query(ChildComponent); -const directives = spectator.queryAll(MyDirective); - -// Advanced text-based selectors -spectator.query(byText('Submit')); -spectator.query(byLabel('Username')); -spectator.query(byPlaceholder('Enter your email')); -spectator.query(byValue('Some value')); -spectator.query(byTitle('Click here')); -spectator.query(byAltText('Logo image')); -spectator.query(byRole('button', { pressed: true })); - -// Accessing native elements -const { nativeElement } = spectator.query('.class-name'); -``` - -### Working with Inputs and Outputs - -```typescript -// Setting component inputs -spectator.setInput('username', 'JohnDoe'); -spectator.setInput({ - username: 'JohnDoe', - isActive: true, -}); - -// For host components -spectator.setHostInput('propName', value); - -// Working with outputs -const outputSpy = jest.fn(); -spectator.output('statusChange').subscribe(outputSpy); - -// Trigger and verify outputs -spectator.click('button.submit'); -expect(outputSpy).toHaveBeenCalledWith({ status: 'submitted' }); -``` - -### Event Triggering API - -Spectator provides a rich API for simulating user interactions: - -```typescript -// Mouse events -spectator.click('.button'); -spectator.doubleClick('#item'); -spectator.hover('.tooltip'); -spectator.mouseEnter('.dropdown'); -spectator.mouseLeave('.dropdown'); - -// Keyboard events -spectator.keyboard.pressEscape(); -spectator.keyboard.pressEnter(); -spectator.keyboard.pressKey('A'); -spectator.keyboard.pressKeys('ctrl.a'); - -// Form interactions -spectator.typeInElement('New value', 'input.username'); -spectator.blur('input.username'); -spectator.focus('input.password'); -spectator.selectOption(selectEl, 'Option 2'); - -// Custom events -spectator.triggerEventHandler(MyComponent, 'customEvent', eventObj); -spectator.dispatchFakeEvent(element, 'mouseover'); -spectator.dispatchTouchEvent(element, 'touchstart'); -``` +--- ## Example Test Structures -### Basic Component Test +*(Note: Examples are illustrative and may need adaptation)* + +### Basic Component Test (Spectator) ```typescript import { createComponentFactory, Spectator } from '@ngneat/spectator/jest'; @@ -205,607 +328,570 @@ describe('MyComponent', () => { }); it('should create', () => { + // Assert expect(spectator.component).toBeTruthy(); }); - it('should handle action correctly', () => { + it('should display the title correctly', () => { // Arrange - spectator.setInput('inputProp', 'testValue'); + const testTitle = 'Test Title'; + spectator.setInput('title', testTitle); // Assuming an @Input() title + spectator.detectChanges(); // Trigger change detection // Act - spectator.click('button'); + const titleElement = spectator.query('h1'); // Assert - expect(spectator.component.outputProp).toBe('expectedValue'); + expect(titleElement).toHaveText(testTitle); + }); + + it('should emit output event on button click', () => { + // Arrange + const outputSpy = jest.fn(); + spectator.output('actionClicked').subscribe(outputSpy); // Assuming an @Output() actionClicked + + // Act + spectator.click('button.action-button'); + + // Assert + expect(outputSpy).toHaveBeenCalledTimes(1); + expect(outputSpy).toHaveBeenCalledWith(/* expected payload */); }); }); ``` -### Host Component Test with Child Components +### Host Component Test (Spectator + Overrides) ```typescript import { createHostFactory, SpectatorHost } from '@ngneat/spectator/jest'; -import { ParentComponent } from './parent.component'; -import { ChildComponent } from './child.component'; -import { MockComponent } from 'ng-mocks'; +import { ParentComponent } from './parent.component'; // Assumed standalone, imports ChildComponent +import { ChildComponent } from './child.component'; // Assumed standalone +import { MockChildComponent } from './mock-child.component'; // Assumed standalone mock -describe('ParentComponent', () => { +describe('ParentComponent in Host with Overrides', () => { let spectator: SpectatorHost; + // Override the standalone child component const createHost = createHostFactory({ component: ParentComponent, - declarations: [MockComponent(ChildComponent)], + overrideComponents: [ + [ + ParentComponent, + { + remove: { imports: [ChildComponent] }, + add: { imports: [MockChildComponent] }, + }, + ], + ], template: ` - + `, }); + const mockOutputHandler = jest.fn(); + beforeEach(() => { spectator = createHost(undefined, { hostProps: { - inputValue: 'test', - handleOutput: jest.fn(), + hostInputData: { id: 1, value: 'Test Data' }, + hostHandleOutput: mockOutputHandler, }, }); }); - it('should pass input to child component', () => { + it('should render the parent component', () => { + // Assert + expect(spectator.component).toBeTruthy(); + }); + + it('should render the mocked child component', () => { // Arrange - const childComponent = spectator.query(ChildComponent); + const mockedChild = spectator.query(MockChildComponent); // Query the mocked child // Assert - expect(childComponent.input).toBe('test'); + expect(mockedChild).toBeTruthy(); + // You might check properties/methods on the mock instance if needed + // expect(mockedChild?.someMockProperty).toBe(...) + }); + + it('should handle output event from the component', () => { + // Arrange + const payload = { success: true }; + // Assume ParentComponent emits outputEvent when something happens. + spectator.component.outputEvent.emit(payload); + + // Assert + expect(mockOutputHandler).toHaveBeenCalledWith(payload); }); }); ``` -### Testing Events and Outputs - -```typescript -it('should emit when button is clicked', () => { - // Arrange - const outputSpy = jest.fn(); - spectator.component.outputEvent.subscribe(outputSpy); - - // Act - spectator.click('button'); - - // Assert - expect(outputSpy).toHaveBeenCalledWith(expectedValue); -}); -``` - -### Testing Services +### Service Test (Spectator) ```typescript import { createServiceFactory, SpectatorService } from '@ngneat/spectator/jest'; -import { UserService } from './user.service'; -import { HttpClient } from '@angular/common/http'; +import { DataService } from './data.service'; +import { ApiService } from './api.service'; +import { of } from 'rxjs'; -describe('UserService', () => { - let spectator: SpectatorService; - let httpClient: HttpClient; +describe('DataService', () => { + let spectator: SpectatorService; + let apiServiceMock: ApiService; const createService = createServiceFactory({ - service: UserService, - mocks: [HttpClient], + service: DataService, + mocks: [ApiService], // Mock the dependency }); beforeEach(() => { spectator = createService(); - httpClient = spectator.inject(HttpClient); + // Get the mocked instance provided by Spectator + apiServiceMock = spectator.inject(ApiService); }); - it('should fetch users', () => { + it('should be created', () => { + // Assert + expect(spectator.service).toBeTruthy(); + }); + + it('should fetch data using ApiService', (done) => { // Arrange - const mockUsers = [{ id: 1, name: 'John' }]; - httpClient.get.mockReturnValue(of(mockUsers)); + const mockData = [{ id: 1, name: 'Test Item' }]; + // Configure the mock method + apiServiceMock.fetchItems.mockReturnValue(of(mockData)); // Act - let result; - spectator.service.getUsers().subscribe((users) => { - result = users; + spectator.service.getItems().subscribe(items => { + // Assert + expect(items).toEqual(mockData); + expect(apiServiceMock.fetchItems).toHaveBeenCalledTimes(1); + done(); // Signal async test completion }); - - // Assert - expect(httpClient.get).toHaveBeenCalledWith('/api/users'); - expect(result).toEqual(mockUsers); }); }); ``` -### Testing HTTP Services +### HTTP Service Test (Spectator) ```typescript -import { - createHttpFactory, - HttpMethod, - SpectatorHttp, -} from '@ngneat/spectator/jest'; +import { createHttpFactory, HttpMethod, SpectatorHttp } from '@ngneat/spectator/jest'; import { UserHttpService } from './user-http.service'; +import { AuthService } from './auth.service'; // Assume this provides a token describe('UserHttpService', () => { let spectator: SpectatorHttp; + let authServiceMock: AuthService; const createHttp = createHttpFactory({ service: UserHttpService, + mocks: [AuthService], // Mock dependencies }); - beforeEach(() => (spectator = createHttp())); - - it('should call the correct API endpoint when getting users', () => { - spectator.service.getUsers().subscribe(); - spectator.expectOne('/api/users', HttpMethod.GET); + beforeEach(() => { + spectator = createHttp(); + authServiceMock = spectator.inject(AuthService); + // Setup mock return value for token + authServiceMock.getToken.mockReturnValue('fake-token-123'); }); - it('should include auth token in the headers', () => { - spectator.service.getUsers().subscribe(); + it('should fetch users from the correct endpoint with GET', () => { + // Arrange + const mockUsers = [{ id: 1, name: 'User 1' }]; + + // Act + spectator.service.getUsers().subscribe(); // Call the method + + // Assert + // Expect one request to the URL with the specified method const req = spectator.expectOne('/api/users', HttpMethod.GET); - expect(req.request.headers.get('Authorization')).toBeTruthy(); + // Optionally check headers + expect(req.request.headers.get('Authorization')).toBe('Bearer fake-token-123'); + // Respond to the request to complete the observable + req.flush(mockUsers); + }); + + it('should send user data to the correct endpoint with POST', () => { + // Arrange + const newUser = { name: 'New User', email: 'new@test.com' }; + const createdUser = { id: 2, ...newUser }; + + // Act + spectator.service.createUser(newUser).subscribe(); + + // Assert + const req = spectator.expectOne('/api/users', HttpMethod.POST); + // Check request body + expect(req.request.body).toEqual(newUser); + // Check headers + expect(req.request.headers.get('Authorization')).toBe('Bearer fake-token-123'); + // Respond + req.flush(createdUser); }); }); ``` -### Testing Directives +### Directive Test (Spectator) ```typescript -import { - createDirectiveFactory, - SpectatorDirective, -} from '@ngneat/spectator/jest'; -import { HighlightDirective } from './highlight.directive'; +import { createDirectiveFactory, SpectatorDirective } from '@ngneat/spectator/jest'; +import { HighlightDirective } from './highlight.directive'; // Assumed standalone +// If HighlightDirective imported another standalone directive/component: +// import { SomeDependencyDirective } from './some-dependency.directive'; +// import { MockSomeDependencyDirective } from './mock-some-dependency.directive'; describe('HighlightDirective', () => { let spectator: SpectatorDirective; const createDirective = createDirectiveFactory({ directive: HighlightDirective, - template: `
Testing
`, + // Example if the directive had standalone dependencies to override: + // overrideDirectives: [ + // [ + // HighlightDirective, + // { + // remove: { imports: [SomeDependencyDirective] }, + // add: { imports: [MockSomeDependencyDirective] } + // } + // ] + // ], + template: `
Test Content
`, }); - beforeEach(() => (spectator = createDirective())); + beforeEach(() => spectator = createDirective()); - it('should change the background color', () => { + it('should apply the initial highlight color from input', () => { + // Assert + expect(spectator.element).toHaveStyle({ backgroundColor: 'yellow' }); + }); + + it('should change style on mouseenter', () => { + // Act + spectator.dispatchMouseEvent(spectator.element, 'mouseenter'); + spectator.detectChanges(); + + // Assert expect(spectator.element).toHaveStyle({ - backgroundColor: 'yellow', + backgroundColor: 'yellow', // Or expected mouseenter color + fontWeight: 'bold', // Example style change }); }); - it('should respond to mouse events', () => { - spectator.dispatchMouseEvent(spectator.element, 'mouseover'); - expect(spectator.element).toHaveStyle({ - backgroundColor: 'yellow', - fontWeight: 'bold', - }); + it('should revert style on mouseleave', () => { + // Arrange + spectator.dispatchMouseEvent(spectator.element, 'mouseenter'); + spectator.detectChanges(); - spectator.dispatchMouseEvent(spectator.element, 'mouseout'); + // Act + spectator.dispatchMouseEvent(spectator.element, 'mouseleave'); + spectator.detectChanges(); + + // Assert expect(spectator.element).toHaveStyle({ - backgroundColor: 'yellow', - fontWeight: 'normal', + backgroundColor: 'yellow', // Back to initial or default + fontWeight: 'normal', // Reverted style }); }); }); ``` -### Testing Angular Standalone Components +### Standalone Component Test (Spectator) + +Testing standalone components is very similar to regular components. Spectator handles the necessary setup. ```typescript import { createComponentFactory, Spectator } from '@ngneat/spectator/jest'; -import { StandaloneComponent } from './standalone.component'; +import { StandaloneButtonComponent } from './standalone-button.component'; +// No need to import CommonModule etc. if they are in the component's imports array -describe('StandaloneComponent', () => { - let spectator: Spectator; +describe('StandaloneButtonComponent', () => { + let spectator: Spectator; + // Factory setup is the same const createComponent = createComponentFactory({ - component: StandaloneComponent, - // No need for imports as they are part of the component itself + component: StandaloneButtonComponent, + // No 'imports' needed here if the component imports them itself + // Mocks can still be provided if needed + // mocks: [SomeService] }); beforeEach(() => { spectator = createComponent(); }); - it('should create standalone component', () => { + it('should create', () => { + // Assert expect(spectator.component).toBeTruthy(); }); + + it('should display label', () => { + // Arrange + spectator.setInput('label', 'Click Me'); + spectator.detectChanges(); + + // Assert + expect(spectator.query('button')).toHaveText('Click Me'); + }); }); ``` -### Testing Deferrable Views (@defer) +### Deferrable Views Test (Spectator) + +Spectator provides helpers to control the state of `@defer` blocks. ```typescript import { createComponentFactory, Spectator } from '@ngneat/spectator/jest'; -import { ComponentWithDefer } from './component-with-defer.component'; +import { DeferredComponent } from './deferred.component'; // Assume this uses @defer -describe('ComponentWithDefer', () => { - let spectator: Spectator; +describe('DeferredComponent', () => { + let spectator: Spectator; const createComponent = createComponentFactory({ - component: ComponentWithDefer, + component: DeferredComponent, }); beforeEach(() => { spectator = createComponent(); }); - it('should render defer block content', () => { - // Render the completed state of the first defer block - spectator.deferBlock().renderComplete(); + it('should initially show placeholder content', () => { + // Act: Render the placeholder state (often the default) + spectator.deferBlock().renderPlaceholder(); // Or renderIdle() - expect(spectator.query('.deferred-content')).toExist(); - expect(spectator.query('.placeholder-content')).not.toExist(); + // Assert + expect(spectator.query('.placeholder-content')).toExist(); + expect(spectator.query('.deferred-content')).not.toExist(); + expect(spectator.query('.loading-indicator')).not.toExist(); }); it('should show loading state', () => { - // Render the loading state of the first defer block + // Act: Render the loading state spectator.deferBlock().renderLoading(); + // Assert expect(spectator.query('.loading-indicator')).toExist(); + expect(spectator.query('.placeholder-content')).not.toExist(); + expect(spectator.query('.deferred-content')).not.toExist(); }); - it('should show placeholder content', () => { - // Render the placeholder state of the first defer block - spectator.deferBlock().renderPlaceholder(); + it('should render deferred content when completed', () => { + // Act: Render the completed state + spectator.deferBlock().renderComplete(); - expect(spectator.query('.placeholder-content')).toExist(); + // Assert + expect(spectator.query('.deferred-content')).toExist(); + expect(spectator.query('.placeholder-content')).not.toExist(); + expect(spectator.query('.loading-indicator')).not.toExist(); }); - it('should work with multiple defer blocks', () => { - // For the second defer block in the template + it('should handle multiple defer blocks by index', () => { + // Act: Render the second defer block (index 1) spectator.deferBlock(1).renderComplete(); + // Assert expect(spectator.query('.second-deferred-content')).toExist(); }); }); ``` -## Common Patterns +### ng-mocks Example -### Query Elements +Illustrates using `MockBuilder` and `MockRender`. **Note:** This example uses `MockBuilder` which might be less common with Spectator and standalone components, but `MockInstance` and `MockProvider` remain useful. Prefer Spectator's factories and `overrideComponents` where possible. ```typescript -// By CSS selector -const element = spectator.query('.class-name'); +import { MockBuilder, MockInstance, MockRender, ngMocks, MockProvider } from 'ng-mocks'; +import { ProfileComponent } from './profile.component'; // Assume standalone +import { AuthService } from './auth.service'; +import { ReactiveFormsModule } from '@angular/forms'; // Needed if ProfileComponent imports it -// By directive/component -const child = spectator.query(ChildComponent); - -// Multiple elements -const elements = spectator.queryAll('.item'); -``` - -### Trigger Events - -```typescript -// Click events -spectator.click('.button'); -spectator.click(buttonElement); - -// Input events -spectator.typeInElement('value', 'input'); - -// Custom events -spectator.triggerEventHandler(MyComponent, 'eventName', eventValue); -``` - -### Custom Matchers - -Spectator provides custom matchers to make assertions more readable: - -```typescript -// DOM matchers -expect('.button').toExist(); -expect('.inactive-element').not.toExist(); -expect('.title').toHaveText('Welcome'); -expect('.username').toContainText('John'); -expect('input').toHaveValue('test'); -expect('.error').toHaveClass('visible'); -expect('button').toBeDisabled(); -expect('div').toHaveAttribute('aria-label', 'Close'); -expect('.menu').toHaveData({ testId: 'main-menu' }); -expect('img').toHaveProperty('src', 'path/to/image.jpg'); -expect('.parent').toHaveDescendant('.child'); -expect('.parent').toHaveDescendantWithText({ - selector: '.child', - text: 'Child text', -}); - -// Object matchers -expect(object).toBePartial({ id: 1 }); -``` - -### Test Async Operations - -```typescript -it('should handle async operations', async () => { - // Arrange - const response = { data: 'test' }; - service.getData.mockResolvedValue(response); - - // Act - await spectator.component.loadData(); - - // Assert - expect(spectator.component.data).toEqual(response); -}); -``` - -## Tips and Tricks - -1. **Debugging Tests** - - - Use `spectator.debug()` to log the current DOM state - - Use `console.log` sparingly and remove before committing - - Set breakpoints in your IDE for step-by-step debugging - -2. **Common Pitfalls** - - - Don't test implementation details - - Avoid testing third-party libraries - - Don't test multiple concerns in a single test - - Remember to clean up subscriptions - -3. **Performance** - - - Mock heavy dependencies - - Keep test setup minimal - - Use `beforeAll` for expensive operations shared across tests - -4. **Change Detection** - - - Use `spectator.detectChanges()` after modifying component properties - - For OnPush components with a host, use `spectator.detectComponentChanges()` - -5. **Injection** - - Use `spectator.inject(Service)` to access injected services - - Use `spectator.inject(Service, true)` to get service from the component injector - -## Running Tests - -When working in an Nx workspace, there are several ways to run tests: - -### Running Tests for a Specific Project - -```bash -# Run all tests for a specific project -npx nx test - -# Example: Run tests for the core/config library -npx nx test core-config -``` - -### Running Tests with Watch Mode - -```bash -# Run tests in watch mode for active development -npx nx test --watch -``` - -### Running Tests with Coverage - -```bash -# Run tests with coverage reporting -npx nx test --code-coverage -``` - -### Running a Specific Test File - -```bash -# Run a specific test file -npx nx test --test-file=path/to/your.spec.ts -``` - -### Running Affected Tests - -```bash -# Run tests only for projects affected by recent changes -npx nx affected:test -``` - -These commands help you target exactly which tests to run, making your testing workflow more efficient. - -## References - -- [Spectator Documentation](https://github.com/ngneat/spectator) - Official documentation for the Spectator testing library -- [Jest Documentation](https://jestjs.io/docs/getting-started) - Comprehensive guide to using Jest as a testing framework -- [ng-mocks Documentation](https://ng-mocks.sudo.eu/) - Detailed documentation on mocking Angular dependencies effectively - -## ng-mocks Guide - -### Overview - -ng-mocks is a powerful library that helps with Angular testing by: - -- Mocking Components, Directives, Pipes, Modules, Services, and Tokens -- Reducing boilerplate in tests -- Providing a simple interface to access declarations - -It's particularly useful for isolating components by mocking their dependencies, which makes tests faster and more reliable. - -### Global Configuration - -For optimal setup, configure ng-mocks in your test setup file: - -```typescript -// src/test-setup.ts or equivalent -import { ngMocks } from 'ng-mocks'; - -// Auto-spy all methods in mock declarations and providers -ngMocks.autoSpy('jest'); // or 'jasmine' - -// Reset customizations after each test automatically -ngMocks.defaultMock(AuthService, () => ({ - isLoggedIn$: EMPTY, - currentUser$: EMPTY, -})); -``` - -### Key APIs - -#### MockBuilder - -`MockBuilder` provides a fluent API to configure TestBed with mocks: - -```typescript -beforeEach(() => { - return MockBuilder( - ComponentUnderTest, // Keep this as real - ParentModule, // Mock everything else - ) - .keep(ReactiveFormsModule) // Keep this as real - .mock(SomeOtherDependency, { customConfig: true }); // Custom mock -}); -``` - -#### MockRender - -`MockRender` is an enhanced version of `TestBed.createComponent` that: - -- Respects all lifecycle hooks -- Handles OnPush change detection -- Creates a wrapper component that binds inputs and outputs - -```typescript -// Simple rendering -const fixture = MockRender(ComponentUnderTest); - -// With inputs -const fixture = MockRender(ComponentUnderTest, { - name: 'Test User', - id: 123, -}); - -// Access the component instance -const component = fixture.point.componentInstance; -``` - -#### MockInstance - -`MockInstance` helps configure mocks before they're initialized: - -```typescript -// Adding a spy -const saveSpy = MockInstance(StorageService, 'save', jest.fn()); - -// Verify the spy was called -expect(saveSpy).toHaveBeenCalledWith(expectedData); -``` - -#### ngMocks Helpers - -The library provides several helper functions: - -```typescript -// Change form control values -ngMocks.change('[name=email]', 'test@example.com'); - -// Trigger events -ngMocks.trigger(element, 'click'); -ngMocks.trigger(element, 'keyup.control.s'); // Complex events - -// Find elements -const emailField = ngMocks.find('[name=email]'); -const submitBtn = ngMocks.findAll('button[type="submit"]'); -``` - -### Complete Example - -Here's a full example of testing a component with ng-mocks: - -```typescript -describe('ProfileComponent', () => { +describe('ProfileComponent (with ng-mocks helpers)', () => { // Reset customizations after each test MockInstance.scope(); + // Configure TestBed using MockBuilder - less common with Spectator, but possible beforeEach(() => { - return MockBuilder(ProfileComponent, ProfileModule).keep( - ReactiveFormsModule, - ); + // Keep ProfileComponent real, mock AuthService, keep ReactiveFormsModule if needed + return MockBuilder(ProfileComponent) + .keep(ReactiveFormsModule) // Keep if ProfileComponent imports it + .provide(MockProvider(AuthService)); // Use MockProvider for the service }); - it('saves profile data on ctrl+s hotkey', () => { - // Prepare test data - const profile = { - email: 'test@email.com', - firstName: 'Test', - lastName: 'User', - }; + it('should display user email from AuthService', () => { + // Arrange: Configure the mock instance *before* rendering + const mockEmail = 'test@example.com'; + // Use MockInstance to configure the globally mocked AuthService + MockInstance(AuthService, 'getUserEmail', jest.fn().mockReturnValue(mockEmail)); - // Mock service method - const saveSpy = MockInstance(StorageService, 'save', jest.fn()); + // Act: Render the component using MockRender + const fixture = MockRender(ProfileComponent); - // Render with inputs - const { point } = MockRender(ProfileComponent, { profile }); + // Assert: Use ngMocks helpers or fixture directly + const emailDisplay = ngMocks.find(fixture, '.user-email'); + expect(emailDisplay.nativeElement.textContent).toContain(mockEmail); + // Verify the mock was called (optional) + expect(MockInstance(AuthService).getUserEmail).toHaveBeenCalled(); + }); - // Change form value - ngMocks.change('[name=email]', 'updated@email.com'); + it('should call AuthService.updateProfile on form submit', () => { + // Arrange + // Setup spy on the globally mocked AuthService instance + const updateSpy = MockInstance(AuthService, 'updateProfile', jest.fn()); + const fixture = MockRender(ProfileComponent); - // Trigger hotkey - ngMocks.trigger(point, 'keyup.control.s'); + // Act: Simulate form input and submission + ngMocks.change(ngMocks.find(fixture, 'input[name="firstName"]'), 'NewName'); + ngMocks.click(ngMocks.find(fixture, 'button[type="submit"]')); - // Verify behavior - expect(saveSpy).toHaveBeenCalledWith({ - email: 'updated@email.com', - firstName: profile.firstName, - lastName: profile.lastName, + // Assert + expect(updateSpy).toHaveBeenCalledWith(expect.objectContaining({ firstName: 'NewName' })); + }); +}); +``` + +--- + +## End-to-End (E2E) Testing Attributes (`data-what`, `data-which`) + +In end-to-end (E2E) testing of web applications, `data-what` and `data-which` are custom HTML data attributes used to enhance testability. They help identify elements or components in the DOM for testing purposes, making it easier for testing frameworks (like Selenium, Cypress, or WebdriverIO) to locate and interact with specific UI elements. + +### Purpose of `data-what` and `data-which` + +- **Identification**: These attributes provide a stable, test-specific way to tag elements, avoiding reliance on brittle selectors like CSS classes, IDs, or XPath, which may change due to styling or structural updates. +- **Semantics**: They can describe the purpose (`data-what`) or specific instance/context (`data-which`) of an element, improving clarity in test scripts. +- **Maintainability**: By using custom attributes, developers can decouple test logic from presentation, reducing the risk of tests breaking when the UI is refactored. + +### Example Usage + +```html + +``` + +- `data-what="submit-button"`: Indicates the element's role or type (e.g., a submit button). +- `data-which="form-login"`: Specifies the context or instance (e.g., the submit button for the login form). + +In a test script (e.g., using WebdriverIO): + +```javascript +// Find the specific button +const loginButton = await $('[data-what="submit-button"][data-which="form-login"]'); +await loginButton.click(); +``` + +This targets the exact button, even if its class or ID changes. + +### Why Use Them? + +- **Robustness**: Unlike classes or IDs, which are often tied to styling or JavaScript, `data-what` and `data-which` are dedicated to testing, reducing the chance of accidental changes breaking tests. +- **Clarity**: They make test scripts self-documenting by describing the element's purpose and context. +- **Scalability**: In complex applications with multiple similar elements (e.g., multiple "Save" buttons), `data-which` helps differentiate them. + +### Best Practices + +- Use clear, consistent naming conventions (e.g., `data-what="button"`, `data-which="checkout-page"`). +- Avoid overusing or duplicating attributes unnecessarily. +- **Use additional `data-*` attributes for dynamic identifiers**: When you need to associate specific data like an item ID or name with an element for testing, add separate `data-*` attributes instead of encoding them into `data-which`. This keeps selectors clean and allows for more precise targeting. + + *Example:* + ````html + + ```` + *E2E Test Query (WebdriverIO):* + ````javascript + // Find a specific item by ID + const specificItem = await $('[data-what="list-item"][data-which="return-process-item"][data-item-id="12345"]'); + await specificItem.waitForExist(); + + // Find all return process items + const allItems = await $$('[data-what="list-item"][data-which="return-process-item"]'); + console.log(`Found ${allItems.length} items.`); + ```` +- Ensure developers and testers agree on the attribute schema to maintain consistency. +- **Verify in Unit Tests**: Ensure these `data-*` attributes are correctly applied in your component unit tests. Use Spectator's querying capabilities to check for their presence and dynamic values. + + *Unit Test Snippet (Spectator):* + ````typescript + it('should apply correct data attributes', () => { + // Arrange + const testItem = { id: 'abc', name: 'Test Item' }; + spectator.setInput('returnProcess', testItem); + spectator.detectChanges(); + + // Act + const element = spectator.queryHost('[data-what="list-item"]'); // Or query the specific element inside the component + + // Assert + expect(element).toHaveAttribute('data-what', 'list-item'); + expect(element).toHaveAttribute('data-which', 'return-process-item'); + expect(element).toHaveAttribute('data-item-id', 'abc'); + expect(element).toHaveAttribute('data-item-name', 'Test Item'); }); - }); -}); + ```` + +While `data-what` and `data-which` are not standardized HTML attributes, their use as custom `data-*` attributes aligns with HTML5 specifications, making them valid and widely supported. If you encounter them in a specific framework or codebase, check the project's testing documentation for their exact conventions. + +--- + +## Running Tests (Nx) + +Use the Nx CLI to run tests efficiently within the monorepo. + +### Run Tests for a Specific Project + +```bash +npx nx test +# Example: npx nx test core-logging +# Example: npx nx test isa-app ``` -### Integration with Spectator +### Run Tests in Watch Mode -While Spectator and ng-mocks have some overlapping functionality, they can be used together effectively: +For active development, run tests continuously as files change: -```typescript -describe('CombinedExample', () => { - let spectator: Spectator; - - const createComponent = createComponentFactory({ - component: MyComponent, - declarations: [ - // Use ng-mocks to mock child components - MockComponent(ComplexChildComponent), - MockDirective(ComplexDirective), - ], - providers: [ - // Use ng-mocks to mock a service with default behavior - MockProvider(ComplexService), - ], - }); - - beforeEach(() => { - // Configure a mock instance before the component is created - MockInstance( - ComplexService, - 'getData', - jest.fn().mockReturnValue(of(['test'])), - ); - - // Create the component with Spectator - spectator = createComponent(); - }); - - it('should work with mocked dependencies', () => { - // Use Spectator for interactions - spectator.click('button'); - - // Use ng-mocks to verify interactions with mocked dependencies - const service = ngMocks.get(ComplexService); - expect(service.getData).toHaveBeenCalled(); - }); -}); +```bash +npx nx test --watch ``` -### When to Use ng-mocks +### Run Tests with Coverage Report -ng-mocks is particularly useful when: +Generate a code coverage report: -1. You need to mock complex Angular artifacts like components, directives, or modules -2. You want to customize mock behavior at the instance level -3. You need to simulate complex user interactions -4. You're testing parent components that depend on multiple child components +```bash +npx nx test --code-coverage +``` +*(Coverage reports are typically generated in the `coverage/` directory)* -For more details and advanced usage, refer to the [official ng-mocks documentation](https://ng-mocks.sudo.eu/). +### Run a Specific Test File + +Target a single test file: + +```bash +npx nx test --test-file=libs/core/utils/src/lib/my-util.spec.ts +``` + +### Run Affected Tests + +Optimize CI/CD by running tests only for projects affected by your code changes: + +```bash +# Run tests for projects affected by changes compared to main branch +npx nx affected:test --base=main --head=HEAD + +# Or run tests for uncommitted changes +npx nx affected:test +``` + +--- + +## References + +- **[Jest Documentation](https://jestjs.io/docs/getting-started)**: Official Jest documentation. +- **[Spectator Documentation](https://ngneat.github.io/spectator/)**: Official Spectator documentation. +- **[ng-mocks Documentation](https://ng-mocks.sudo.eu/)**: Official ng-mocks documentation. +- **[Angular Testing Guide](https://angular.dev/guide/testing)**: Official Angular testing concepts. diff --git a/generated/swagger/print-api/src/base-service.ts b/generated/swagger/print-api/src/base-service.ts index 77fe935f7..fdc9ea6b3 100644 --- a/generated/swagger/print-api/src/base-service.ts +++ b/generated/swagger/print-api/src/base-service.ts @@ -31,8 +31,9 @@ const PARAMETER_CODEC = new ParameterCodec(); export class BaseService { constructor( protected config: PrintConfiguration, - protected http: HttpClient, - ) {} + protected http: HttpClient + ) { + } private _rootUrl: string = ''; @@ -56,7 +57,7 @@ export class BaseService { */ protected newParams(): HttpParams { return new HttpParams({ - encoder: PARAMETER_CODEC, + encoder: PARAMETER_CODEC }); } } diff --git a/generated/swagger/print-api/src/models.ts b/generated/swagger/print-api/src/models.ts index 104457f8c..98a90daeb 100644 --- a/generated/swagger/print-api/src/models.ts +++ b/generated/swagger/print-api/src/models.ts @@ -1,5 +1,8 @@ export { ResponseArgs } from './models/response-args'; -export { IPublicUserInfo } from './models/ipublic-user-info'; +export { DialogOfString } from './models/dialog-of-string'; +export { DialogSettings } from './models/dialog-settings'; +export { DialogContentType } from './models/dialog-content-type'; +export { KeyValueDTOOfStringAndString } from './models/key-value-dtoof-string-and-string'; export { ProblemDetails } from './models/problem-details'; export { PrintRequestOfIEnumerableOfItemDTO } from './models/print-request-of-ienumerable-of-item-dto'; export { ItemDTO } from './models/item-dto'; @@ -8,6 +11,7 @@ export { ProductDTO } from './models/product-dto'; export { SizeOfString } from './models/size-of-string'; export { WeightOfAvoirdupois } from './models/weight-of-avoirdupois'; export { Avoirdupois } from './models/avoirdupois'; +export { TouchedBase } from './models/touched-base'; export { SpecDTO } from './models/spec-dto'; export { TextDTO } from './models/text-dto'; export { ImageDTO } from './models/image-dto'; @@ -23,7 +27,7 @@ export { ShelfInfoDTO } from './models/shelf-info-dto'; export { ReviewDTO } from './models/review-dto'; export { EntityDTO } from './models/entity-dto'; export { EntityStatus } from './models/entity-status'; -export { TouchedBase } from './models/touched-base'; +export { CRUDA } from './models/cruda'; export { PaperKind } from './models/paper-kind'; export { PrintRequest } from './models/print-request'; export { PrintRequestOfLong } from './models/print-request-of-long'; @@ -41,37 +45,31 @@ export { Gender } from './models/gender'; export { OrganisationNamesDTO } from './models/organisation-names-dto'; export { EntityDTOContainerOfTenantDTO } from './models/entity-dtocontainer-of-tenant-dto'; export { TenantDTO } from './models/tenant-dto'; -export { ReadOnlyEntityDTOOfTenantDTOAndIReadOnlyTenant } from './models/read-only-entity-dtoof-tenant-dtoand-iread-only-tenant'; +export { EntityDTOBaseOfTenantDTOAndITenant } from './models/entity-dtobase-of-tenant-dtoand-itenant'; +export { EntityDTOBase } from './models/entity-dtobase'; export { EntityDTOReferenceContainer } from './models/entity-dtoreference-container'; export { ExternalReferenceDTO } from './models/external-reference-dto'; -export { EntityDTOOfContributorDTOAndIContributor } from './models/entity-dtoof-contributor-dtoand-icontributor'; -export { ReadOnlyEntityDTOOfContributorDTOAndIContributor } from './models/read-only-entity-dtoof-contributor-dtoand-icontributor'; +export { EntityDTOBaseOfContributorDTOAndIContributor } from './models/entity-dtobase-of-contributor-dtoand-icontributor'; export { EntityDTOContainerOfCompanyDTO } from './models/entity-dtocontainer-of-company-dto'; export { CompanyDTO } from './models/company-dto'; export { AddressDTO } from './models/address-dto'; export { GeoLocation } from './models/geo-location'; -export { EntityDTOOfCompanyDTOAndICompany } from './models/entity-dtoof-company-dtoand-icompany'; -export { ReadOnlyEntityDTOOfCompanyDTOAndICompany } from './models/read-only-entity-dtoof-company-dtoand-icompany'; +export { EntityDTOBaseOfCompanyDTOAndICompany } from './models/entity-dtobase-of-company-dtoand-icompany'; export { EntityDTOContainerOfCategoryDTO } from './models/entity-dtocontainer-of-category-dto'; export { CategoryDTO } from './models/category-dto'; -export { EntityDTOOfCategoryDTOAndICategory } from './models/entity-dtoof-category-dtoand-icategory'; -export { ReadOnlyEntityDTOOfCategoryDTOAndICategory } from './models/read-only-entity-dtoof-category-dtoand-icategory'; export { EntityDTOContainerOfFileDTO } from './models/entity-dtocontainer-of-file-dto'; export { FileDTO } from './models/file-dto'; -export { EntityDTOOfFileDTOAndIFile } from './models/entity-dtoof-file-dtoand-ifile'; -export { ReadOnlyEntityDTOOfFileDTOAndIFile } from './models/read-only-entity-dtoof-file-dtoand-ifile'; +export { EntityDTOBaseOfFileDTOAndIFile } from './models/entity-dtobase-of-file-dtoand-ifile'; export { EntityDTOContainerOfTextDTO } from './models/entity-dtocontainer-of-text-dto'; export { TextDTO2 } from './models/text-dto2'; -export { EntityDTOOfTextDTOAndIText } from './models/entity-dtoof-text-dtoand-itext'; -export { ReadOnlyEntityDTOOfTextDTOAndIText } from './models/read-only-entity-dtoof-text-dtoand-itext'; +export { EntityDTOBaseOfTextDTOAndIText } from './models/entity-dtobase-of-text-dtoand-itext'; export { EntityDTOContainerOfComponentsDTO } from './models/entity-dtocontainer-of-components-dto'; export { ComponentsDTO } from './models/components-dto'; export { ComponentItemDTO } from './models/component-item-dto'; export { QuantityUnitType } from './models/quantity-unit-type'; export { ComponentItemDisplayType } from './models/component-item-display-type'; export { SetType } from './models/set-type'; -export { EntityDTOOfComponentsDTOAndIComponents } from './models/entity-dtoof-components-dtoand-icomponents'; -export { ReadOnlyEntityDTOOfComponentsDTOAndIComponents } from './models/read-only-entity-dtoof-components-dtoand-icomponents'; +export { EntityDTOBaseOfComponentsDTOAndIComponents } from './models/entity-dtobase-of-components-dtoand-icomponents'; export { ItemLabelDTO } from './models/item-label-dto'; export { FoodDTO } from './models/food-dto'; export { FoodLabel } from './models/food-label'; @@ -81,24 +79,22 @@ export { NutritionFactsDTO } from './models/nutrition-facts-dto'; export { Rezeptmasz } from './models/rezeptmasz'; export { NutritionFactDTO } from './models/nutrition-fact-dto'; export { NutritionFactType } from './models/nutrition-fact-type'; -export { EntityDTOOfItemDTOAndIItem } from './models/entity-dtoof-item-dtoand-iitem'; -export { ReadOnlyEntityDTOOfItemDTOAndIItem } from './models/read-only-entity-dtoof-item-dtoand-iitem'; +export { EntityDTOBaseOfItemDTOAndIItem } from './models/entity-dtobase-of-item-dtoand-iitem'; export { ImageDTO2 } from './models/image-dto2'; export { UrlDTO } from './models/url-dto'; export { AvailabilityDTO2 } from './models/availability-dto2'; +export { DateRangeDTO } from './models/date-range-dto'; export { EntityDTOContainerOfSupplierDTO } from './models/entity-dtocontainer-of-supplier-dto'; export { SupplierDTO } from './models/supplier-dto'; export { SupplierType } from './models/supplier-type'; -export { EntityDTOOfSupplierDTOAndISupplier } from './models/entity-dtoof-supplier-dtoand-isupplier'; -export { ReadOnlyEntityDTOOfSupplierDTOAndISupplier } from './models/read-only-entity-dtoof-supplier-dtoand-isupplier'; +export { EntityDTOBaseOfSupplierDTOAndISupplier } from './models/entity-dtobase-of-supplier-dtoand-isupplier'; export { EntityDTOContainerOfLogisticianDTO } from './models/entity-dtocontainer-of-logistician-dto'; export { LogisticianDTO } from './models/logistician-dto'; -export { EntityDTOOfLogisticianDTOAndILogistician } from './models/entity-dtoof-logistician-dtoand-ilogistician'; -export { ReadOnlyEntityDTOOfLogisticianDTOAndILogistician } from './models/read-only-entity-dtoof-logistician-dtoand-ilogistician'; +export { EntityDTOBaseOfLogisticianDTOAndILogistician } from './models/entity-dtobase-of-logistician-dtoand-ilogistician'; export { ShippingDTO } from './models/shipping-dto'; export { ShippingType } from './models/shipping-type'; export { TypeOfDelivery } from './models/type-of-delivery'; -export { ReadOnlyEntityDTOOfShopItemDTOAndIShopItem } from './models/read-only-entity-dtoof-shop-item-dtoand-ishop-item'; +export { EntityDTOBaseOfShopItemDTOAndIShopItem } from './models/entity-dtobase-of-shop-item-dtoand-ishop-item'; export { EntityDTOContainerOfShoppingCartItemDTO } from './models/entity-dtocontainer-of-shopping-cart-item-dto'; export { ShoppingCartItemStatus } from './models/shopping-cart-item-status'; export { OrderItemType } from './models/order-item-type'; @@ -108,23 +104,20 @@ export { EntityDTOContainerOfBranchDTO } from './models/entity-dtocontainer-of-b export { BranchDTO } from './models/branch-dto'; export { EntityDTOContainerOfLabelDTO } from './models/entity-dtocontainer-of-label-dto'; export { LabelDTO } from './models/label-dto'; -export { ReadOnlyEntityDTOOfLabelDTOAndIReadOnlyLabel } from './models/read-only-entity-dtoof-label-dtoand-iread-only-label'; -export { Address } from './models/address'; +export { EntityDTOBaseOfLabelDTOAndILabel } from './models/entity-dtobase-of-label-dtoand-ilabel'; export { BranchType } from './models/branch-type'; -export { ReadOnlyEntityDTOOfBranchDTOAndIReadOnlyBranch } from './models/read-only-entity-dtoof-branch-dtoand-iread-only-branch'; +export { EntityDTOBaseOfBranchDTOAndIBranch } from './models/entity-dtobase-of-branch-dtoand-ibranch'; export { EntityDTOContainerOfCurrencyDTO } from './models/entity-dtocontainer-of-currency-dto'; export { CurrencyDTO } from './models/currency-dto'; -export { EntityDTOOfCurrencyDTOAndICurrency } from './models/entity-dtoof-currency-dtoand-icurrency'; -export { ReadOnlyEntityDTOOfCurrencyDTOAndICurrency } from './models/read-only-entity-dtoof-currency-dtoand-icurrency'; +export { EntityDTOBaseOfCurrencyDTOAndICurrency } from './models/entity-dtobase-of-currency-dtoand-icurrency'; export { EntityDTOContainerOfCountryDTO } from './models/entity-dtocontainer-of-country-dto'; export { CountryDTO } from './models/country-dto'; -export { ReadOnlyEntityDTOOfCountryDTOAndIReadOnlyCountry } from './models/read-only-entity-dtoof-country-dtoand-iread-only-country'; +export { EntityDTOBaseOfCountryDTOAndICountry } from './models/entity-dtobase-of-country-dtoand-icountry'; export { PaymentType } from './models/payment-type'; export { ShippingTarget } from './models/shipping-target'; export { CountryTargetDTO } from './models/country-target-dto'; export { BranchTargetDTO } from './models/branch-target-dto'; -export { EntityDTOOfShopDTOAndIShop } from './models/entity-dtoof-shop-dtoand-ishop'; -export { ReadOnlyEntityDTOOfShopDTOAndIShop } from './models/read-only-entity-dtoof-shop-dtoand-ishop'; +export { EntityDTOBaseOfShopDTOAndIShop } from './models/entity-dtobase-of-shop-dtoand-ishop'; export { EntityDTOContainerOfDestinationDTO } from './models/entity-dtocontainer-of-destination-dto'; export { DestinationDTO } from './models/destination-dto'; export { EntityDTOContainerOfCheckoutDTO } from './models/entity-dtocontainer-of-checkout-dto'; @@ -132,6 +125,8 @@ export { CheckoutDTO } from './models/checkout-dto'; export { UserAccountDTO } from './models/user-account-dto'; export { BuyerDTO } from './models/buyer-dto'; export { BuyerType } from './models/buyer-type'; +export { BuyerStatus } from './models/buyer-status'; +export { AddresseeWithReferenceDTO } from './models/addressee-with-reference-dto'; export { CommunicationDetailsDTO } from './models/communication-details-dto'; export { OrganisationDTO } from './models/organisation-dto'; export { EntityReferenceDTO } from './models/entity-reference-dto'; @@ -143,27 +138,25 @@ export { CheckoutDeliveryDTO } from './models/checkout-delivery-dto'; export { TermsOfDeliveryDTO } from './models/terms-of-delivery-dto'; export { EntityDTOContainerOfCheckoutItemDTO } from './models/entity-dtocontainer-of-checkout-item-dto'; export { CheckoutItemDTO } from './models/checkout-item-dto'; -export { ReadOnlyEntityDTOOfCheckoutItemDTOAndICheckoutItem } from './models/read-only-entity-dtoof-checkout-item-dtoand-icheckout-item'; +export { EntityDTOBaseOfCheckoutItemDTOAndICheckoutItem } from './models/entity-dtobase-of-checkout-item-dtoand-icheckout-item'; export { DisplayItemDTO } from './models/display-item-dto'; export { PromotionDTO } from './models/promotion-dto'; -export { ReadOnlyEntityDTOOfCheckoutDeliveryDTOAndICheckoutDelivery } from './models/read-only-entity-dtoof-checkout-delivery-dtoand-icheckout-delivery'; +export { EntityDTOBaseOfCheckoutDeliveryDTOAndICheckoutDelivery } from './models/entity-dtobase-of-checkout-delivery-dtoand-icheckout-delivery'; export { NotificationChannel } from './models/notification-channel'; export { SelectionDTOOfShippingTarget } from './models/selection-dtoof-shipping-target'; export { PaymentDTO } from './models/payment-dto'; export { SelectionDTOOfPaymentType } from './models/selection-dtoof-payment-type'; export { EntityDTOContainerOfVoucherDTO } from './models/entity-dtocontainer-of-voucher-dto'; export { VoucherDTO } from './models/voucher-dto'; -export { ReadOnlyEntityDTOOfVoucherDTOAndIReadOnlyVoucher } from './models/read-only-entity-dtoof-voucher-dtoand-iread-only-voucher'; +export { EntityDTOBaseOfVoucherDTOAndIVoucher } from './models/entity-dtobase-of-voucher-dtoand-ivoucher'; export { EntityDTOContainerOfCouponDTO } from './models/entity-dtocontainer-of-coupon-dto'; export { CouponDTO } from './models/coupon-dto'; export { CouponType } from './models/coupon-type'; -export { ReadOnlyEntityDTOOfCouponDTOAndICoupon } from './models/read-only-entity-dtoof-coupon-dtoand-icoupon'; -export { KeyValueDTOOfStringAndString } from './models/key-value-dtoof-string-and-string'; -export { ReadOnlyEntityDTOOfCheckoutDTOAndICheckout } from './models/read-only-entity-dtoof-checkout-dtoand-icheckout'; +export { EntityDTOBaseOfCouponDTOAndICoupon } from './models/entity-dtobase-of-coupon-dtoand-icoupon'; +export { EntityDTOBaseOfCheckoutDTOAndICheckout } from './models/entity-dtobase-of-checkout-dtoand-icheckout'; export { ShippingAddressDTO } from './models/shipping-address-dto'; -export { EntityDTOOfDestinationDTOAndIDestination } from './models/entity-dtoof-destination-dtoand-idestination'; -export { ReadOnlyEntityDTOOfDestinationDTOAndIDestination } from './models/read-only-entity-dtoof-destination-dtoand-idestination'; -export { ReadOnlyEntityDTOOfShoppingCartItemDTOAndIShoppingCartItem } from './models/read-only-entity-dtoof-shopping-cart-item-dtoand-ishopping-cart-item'; +export { EntityDTOBaseOfDestinationDTOAndIDestination } from './models/entity-dtobase-of-destination-dtoand-idestination'; +export { EntityDTOBaseOfShoppingCartItemDTOAndIShoppingCartItem } from './models/entity-dtobase-of-shopping-cart-item-dtoand-ishopping-cart-item'; export { PrintRequestOfString } from './models/print-request-of-string'; export { PrintRequestOfIEnumerableOfLong } from './models/print-request-of-ienumerable-of-long'; export { PrintRequestOfIEnumerableOfDisplayOrderDTO } from './models/print-request-of-ienumerable-of-display-order-dto'; @@ -171,19 +164,19 @@ export { DisplayOrderDTO } from './models/display-order-dto'; export { OrderType } from './models/order-type'; export { EnvironmentChannel } from './models/environment-channel'; export { DisplayBranchDTO } from './models/display-branch-dto'; -export { ReadOnlyEntityDTOOfDisplayBranchDTOAndIReadOnlyBranch } from './models/read-only-entity-dtoof-display-branch-dtoand-iread-only-branch'; +export { EntityDTOBaseOfDisplayBranchDTOAndIBranch } from './models/entity-dtobase-of-display-branch-dtoand-ibranch'; export { DisplayOrderItemDTO } from './models/display-order-item-dto'; export { DisplayOrderItemSubsetDTO } from './models/display-order-item-subset-dto'; export { OrderItemProcessingStatusValue } from './models/order-item-processing-status-value'; -export { ReadOnlyEntityDTOOfDisplayOrderItemSubsetDTOAndIOrderItemStatus } from './models/read-only-entity-dtoof-display-order-item-subset-dtoand-iorder-item-status'; -export { ReadOnlyEntityDTOOfDisplayOrderItemDTOAndIOrderItem } from './models/read-only-entity-dtoof-display-order-item-dtoand-iorder-item'; +export { EntityDTOBaseOfDisplayOrderItemSubsetDTOAndIOrderItemStatus } from './models/entity-dtobase-of-display-order-item-subset-dtoand-iorder-item-status'; +export { EntityDTOBaseOfDisplayOrderItemDTOAndIOrderItem } from './models/entity-dtobase-of-display-order-item-dtoand-iorder-item'; export { DisplayAddresseeDTO } from './models/display-addressee-dto'; export { DisplayLogisticianDTO } from './models/display-logistician-dto'; -export { ReadOnlyEntityDTOOfDisplayLogisticianDTOAndILogistician } from './models/read-only-entity-dtoof-display-logistician-dtoand-ilogistician'; +export { EntityDTOBaseOfDisplayLogisticianDTOAndILogistician } from './models/entity-dtobase-of-display-logistician-dtoand-ilogistician'; export { DisplayOrderPaymentDTO } from './models/display-order-payment-dto'; -export { ReadOnlyEntityDTOOfDisplayOrderPaymentDTOAndIReadOnlyPayment } from './models/read-only-entity-dtoof-display-order-payment-dtoand-iread-only-payment'; -export { TermsOfDeliveryDTO2 } from './models/terms-of-delivery-dto2'; -export { ReadOnlyEntityDTOOfDisplayOrderDTOAndIOrder } from './models/read-only-entity-dtoof-display-order-dtoand-iorder'; +export { EntityDTOBaseOfDisplayOrderPaymentDTOAndIReadOnlyPayment } from './models/entity-dtobase-of-display-order-payment-dtoand-iread-only-payment'; +export { LinkedRecordDTO } from './models/linked-record-dto'; +export { EntityDTOBaseOfDisplayOrderDTOAndIOrder } from './models/entity-dtobase-of-display-order-dtoand-iorder'; export { PrintRequestOfIEnumerableOfPriceQRCodeDTO } from './models/print-request-of-ienumerable-of-price-qrcode-dto'; export { PriceQRCodeDTO } from './models/price-qrcode-dto'; export { ResponseArgsOfIEnumerableOfString } from './models/response-args-of-ienumerable-of-string'; diff --git a/generated/swagger/print-api/src/models/address-dto.ts b/generated/swagger/print-api/src/models/address-dto.ts index 502254ee0..9cb2d683e 100644 --- a/generated/swagger/print-api/src/models/address-dto.ts +++ b/generated/swagger/print-api/src/models/address-dto.ts @@ -1,6 +1,7 @@ /* tslint:disable */ +import { TouchedBase } from './touched-base'; import { GeoLocation } from './geo-location'; -export interface AddressDTO { +export interface AddressDTO extends TouchedBase{ apartment?: string; careOf?: string; city?: string; diff --git a/generated/swagger/print-api/src/models/address.ts b/generated/swagger/print-api/src/models/address.ts deleted file mode 100644 index 677a5f5e7..000000000 --- a/generated/swagger/print-api/src/models/address.ts +++ /dev/null @@ -1,17 +0,0 @@ -/* tslint:disable */ -import { GeoLocation } from './geo-location'; -export interface Address { - apartment?: string; - careOf?: string; - city?: string; - country?: string; - district?: string; - geoLocation?: GeoLocation; - info?: string; - po?: string; - region?: string; - state?: string; - street?: string; - streetNumber?: string; - zipCode?: string; -} diff --git a/generated/swagger/print-api/src/models/addressee-with-reference-dto.ts b/generated/swagger/print-api/src/models/addressee-with-reference-dto.ts new file mode 100644 index 000000000..249dffc76 --- /dev/null +++ b/generated/swagger/print-api/src/models/addressee-with-reference-dto.ts @@ -0,0 +1,16 @@ +/* tslint:disable */ +import { EntityReferenceDTO } from './entity-reference-dto'; +import { AddressDTO } from './address-dto'; +import { CommunicationDetailsDTO } from './communication-details-dto'; +import { Gender } from './gender'; +import { OrganisationDTO } from './organisation-dto'; +export interface AddresseeWithReferenceDTO extends EntityReferenceDTO{ + address?: AddressDTO; + communicationDetails?: CommunicationDetailsDTO; + firstName?: string; + gender?: Gender; + lastName?: string; + locale?: string; + organisation?: OrganisationDTO; + title?: string; +} diff --git a/generated/swagger/print-api/src/models/allergene-type.ts b/generated/swagger/print-api/src/models/allergene-type.ts index be46eb7cc..7da2f63ae 100644 --- a/generated/swagger/print-api/src/models/allergene-type.ts +++ b/generated/swagger/print-api/src/models/allergene-type.ts @@ -1,43 +1,2 @@ /* tslint:disable */ -export type AllergeneType = - | 0 - | 1 - | 2 - | 4 - | 6 - | 8 - | 16 - | 32 - | 64 - | 128 - | 256 - | 512 - | 1024 - | 1536 - | 2048 - | 6144 - | 10240 - | 18432 - | 34816 - | 67584 - | 133120 - | 264192 - | 526336 - | 1048576 - | 3145728 - | 5242880 - | 9437184 - | 17825792 - | 34603008 - | 68157440 - | 135266304 - | 268435456 - | 805306368 - | 1342177280 - | 2415919104 - | 4563402752 - | 8858370048 - | 17448304640 - | 34628173824 - | 68987912192 - | 137438953472; +export type AllergeneType = 0 | 1 | 2 | 4 | 6 | 8 | 16 | 32 | 64 | 128 | 256 | 512 | 1024 | 1536 | 2048 | 6144 | 10240 | 18432 | 34816 | 67584 | 133120 | 264192 | 526336 | 1048576 | 3145728 | 5242880 | 9437184 | 17825792 | 34603008 | 68157440 | 135266304 | 268435456 | 805306368 | 1342177280 | 2415919104 | 4563402752 | 8858370048 | 17448304640 | 34628173824 | 68987912192 | 137438953472; \ No newline at end of file diff --git a/generated/swagger/print-api/src/models/availability-dto.ts b/generated/swagger/print-api/src/models/availability-dto.ts index d59272d6f..1d46b5f23 100644 --- a/generated/swagger/print-api/src/models/availability-dto.ts +++ b/generated/swagger/print-api/src/models/availability-dto.ts @@ -7,6 +7,7 @@ import { AvailabilityType } from './availability-type'; * Verfügbarkeit */ export interface AvailabilityDTO { + /** * Voraussichtliches Lieferdatum */ diff --git a/generated/swagger/print-api/src/models/availability-dto2.ts b/generated/swagger/print-api/src/models/availability-dto2.ts index 03091b829..10af7febd 100644 --- a/generated/swagger/print-api/src/models/availability-dto2.ts +++ b/generated/swagger/print-api/src/models/availability-dto2.ts @@ -1,14 +1,18 @@ /* tslint:disable */ +import { TouchedBase } from './touched-base'; import { AvailabilityType } from './availability-type'; +import { DateRangeDTO } from './date-range-dto'; import { EntityDTOContainerOfLogisticianDTO } from './entity-dtocontainer-of-logistician-dto'; import { PriceDTO } from './price-dto'; import { EntityDTOContainerOfShopItemDTO } from './entity-dtocontainer-of-shop-item-dto'; import { EntityDTOContainerOfSupplierDTO } from './entity-dtocontainer-of-supplier-dto'; -export interface AvailabilityDTO2 { - availabilityType: AvailabilityType; +export interface AvailabilityDTO2 extends TouchedBase{ + availabilityType?: AvailabilityType; + estimatedDelivery?: DateRangeDTO; estimatedShippingDate?: string; inStock?: number; isPrebooked?: boolean; + lastRequest?: string; logistician?: EntityDTOContainerOfLogisticianDTO; price?: PriceDTO; requestReference?: string; @@ -20,4 +24,5 @@ export interface AvailabilityDTO2 { supplierProductNumber?: string; supplierSSC?: string; supplierSSCText?: string; + supplyChannel?: string; } diff --git a/generated/swagger/print-api/src/models/availability-type.ts b/generated/swagger/print-api/src/models/availability-type.ts index ac9120f1a..a20c74ba7 100644 --- a/generated/swagger/print-api/src/models/availability-type.ts +++ b/generated/swagger/print-api/src/models/availability-type.ts @@ -1,2 +1,2 @@ /* tslint:disable */ -export type AvailabilityType = 0 | 1 | 2 | 32 | 256 | 512 | 1024 | 2048 | 4096 | 8192 | 16384; +export type AvailabilityType = 0 | 1 | 2 | 32 | 256 | 512 | 1024 | 2048 | 4096 | 8192 | 16384; \ No newline at end of file diff --git a/generated/swagger/print-api/src/models/avoirdupois.ts b/generated/swagger/print-api/src/models/avoirdupois.ts index c213d117d..39af4efb5 100644 --- a/generated/swagger/print-api/src/models/avoirdupois.ts +++ b/generated/swagger/print-api/src/models/avoirdupois.ts @@ -1,2 +1,2 @@ /* tslint:disable */ -export type Avoirdupois = 0 | 1 | 2 | 4 | 8 | 16 | 32 | 64 | 128 | 256 | 512 | 1024 | 2048 | 4096; +export type Avoirdupois = 0 | 1 | 2 | 4 | 8 | 16 | 32 | 64 | 128 | 256 | 512 | 1024 | 2048 | 4096; \ No newline at end of file diff --git a/generated/swagger/print-api/src/models/branch-dto.ts b/generated/swagger/print-api/src/models/branch-dto.ts index 850457363..d943846a1 100644 --- a/generated/swagger/print-api/src/models/branch-dto.ts +++ b/generated/swagger/print-api/src/models/branch-dto.ts @@ -1,12 +1,13 @@ /* tslint:disable */ -import { ReadOnlyEntityDTOOfBranchDTOAndIReadOnlyBranch } from './read-only-entity-dtoof-branch-dtoand-iread-only-branch'; -import { Address } from './address'; +import { EntityDTOBaseOfBranchDTOAndIBranch } from './entity-dtobase-of-branch-dtoand-ibranch'; +import { AddressDTO } from './address-dto'; import { BranchType } from './branch-type'; import { EntityDTOContainerOfLabelDTO } from './entity-dtocontainer-of-label-dto'; -export interface BranchDTO extends ReadOnlyEntityDTOOfBranchDTOAndIReadOnlyBranch { - address?: Address; +import { EntityDTOContainerOfBranchDTO } from './entity-dtocontainer-of-branch-dto'; +export interface BranchDTO extends EntityDTOBaseOfBranchDTOAndIBranch{ + address?: AddressDTO; branchNumber?: string; - branchType: BranchType; + branchType?: BranchType; isDefault?: string; isOnline?: boolean; isOrderingEnabled?: boolean; @@ -14,6 +15,6 @@ export interface BranchDTO extends ReadOnlyEntityDTOOfBranchDTOAndIReadOnlyBranc key?: string; label?: EntityDTOContainerOfLabelDTO; name?: string; - parent?: number; + parent?: EntityDTOContainerOfBranchDTO; shortName?: string; } diff --git a/generated/swagger/print-api/src/models/branch-target-dto.ts b/generated/swagger/print-api/src/models/branch-target-dto.ts index 2f74f9dc7..6210ae7e3 100644 --- a/generated/swagger/print-api/src/models/branch-target-dto.ts +++ b/generated/swagger/print-api/src/models/branch-target-dto.ts @@ -1,6 +1,7 @@ /* tslint:disable */ +import { TouchedBase } from './touched-base'; import { EntityDTOContainerOfBranchDTO } from './entity-dtocontainer-of-branch-dto'; -export interface BranchTargetDTO { +export interface BranchTargetDTO extends TouchedBase{ isDefault?: string; start?: string; stop?: string; diff --git a/generated/swagger/print-api/src/models/branch-type.ts b/generated/swagger/print-api/src/models/branch-type.ts index 68ed028c1..ba5addcca 100644 --- a/generated/swagger/print-api/src/models/branch-type.ts +++ b/generated/swagger/print-api/src/models/branch-type.ts @@ -1,2 +1,2 @@ /* tslint:disable */ -export type BranchType = 0 | 1 | 2 | 4 | 8 | 16; +export type BranchType = 0 | 1 | 2 | 4 | 8 | 16; \ No newline at end of file diff --git a/generated/swagger/print-api/src/models/buyer-dto.ts b/generated/swagger/print-api/src/models/buyer-dto.ts index 7ce8acf95..9f2300a1c 100644 --- a/generated/swagger/print-api/src/models/buyer-dto.ts +++ b/generated/swagger/print-api/src/models/buyer-dto.ts @@ -1,21 +1,11 @@ /* tslint:disable */ -import { EntityReferenceDTO } from './entity-reference-dto'; -import { AddressDTO } from './address-dto'; +import { AddresseeWithReferenceDTO } from './addressee-with-reference-dto'; +import { BuyerStatus } from './buyer-status'; import { BuyerType } from './buyer-type'; -import { CommunicationDetailsDTO } from './communication-details-dto'; -import { Gender } from './gender'; -import { OrganisationDTO } from './organisation-dto'; -export interface BuyerDTO extends EntityReferenceDTO { - address?: AddressDTO; +export interface BuyerDTO extends AddresseeWithReferenceDTO{ buyerNumber?: string; - buyerType: BuyerType; - communicationDetails?: CommunicationDetailsDTO; + buyerStatus?: BuyerStatus; + buyerType?: BuyerType; dateOfBirth?: string; - firstName?: string; - gender: Gender; isTemporaryAccount?: boolean; - lastName?: string; - locale?: string; - organisation?: OrganisationDTO; - title?: string; } diff --git a/generated/swagger/print-api/src/models/buyer-status.ts b/generated/swagger/print-api/src/models/buyer-status.ts new file mode 100644 index 000000000..904474cd3 --- /dev/null +++ b/generated/swagger/print-api/src/models/buyer-status.ts @@ -0,0 +1,2 @@ +/* tslint:disable */ +export type BuyerStatus = 0 | 1 | 2 | 4 | 8 | 16; \ No newline at end of file diff --git a/generated/swagger/print-api/src/models/buyer-type.ts b/generated/swagger/print-api/src/models/buyer-type.ts index a58b6711d..c323cc7f7 100644 --- a/generated/swagger/print-api/src/models/buyer-type.ts +++ b/generated/swagger/print-api/src/models/buyer-type.ts @@ -1,2 +1,2 @@ /* tslint:disable */ -export type BuyerType = 0 | 1 | 2 | 4 | 8 | 16; +export type BuyerType = 0 | 1 | 2 | 4 | 8 | 16; \ No newline at end of file diff --git a/generated/swagger/print-api/src/models/category-dto.ts b/generated/swagger/print-api/src/models/category-dto.ts index 633c2c871..05e239e34 100644 --- a/generated/swagger/print-api/src/models/category-dto.ts +++ b/generated/swagger/print-api/src/models/category-dto.ts @@ -1,8 +1,8 @@ /* tslint:disable */ -import { EntityDTOOfCategoryDTOAndICategory } from './entity-dtoof-category-dtoand-icategory'; +import { EntityDTOBase } from './entity-dtobase'; import { EntityDTOContainerOfCategoryDTO } from './entity-dtocontainer-of-category-dto'; import { EntityDTOContainerOfTenantDTO } from './entity-dtocontainer-of-tenant-dto'; -export interface CategoryDTO extends EntityDTOOfCategoryDTOAndICategory { +export interface CategoryDTO extends EntityDTOBase{ key?: string; name?: string; parent?: EntityDTOContainerOfCategoryDTO; diff --git a/generated/swagger/print-api/src/models/checkout-delivery-dto.ts b/generated/swagger/print-api/src/models/checkout-delivery-dto.ts index 9a08e838d..73b8a5968 100644 --- a/generated/swagger/print-api/src/models/checkout-delivery-dto.ts +++ b/generated/swagger/print-api/src/models/checkout-delivery-dto.ts @@ -1,12 +1,12 @@ /* tslint:disable */ -import { ReadOnlyEntityDTOOfCheckoutDeliveryDTOAndICheckoutDelivery } from './read-only-entity-dtoof-checkout-delivery-dtoand-icheckout-delivery'; +import { EntityDTOBaseOfCheckoutDeliveryDTOAndICheckoutDelivery } from './entity-dtobase-of-checkout-delivery-dtoand-icheckout-delivery'; import { EntityDTOContainerOfCheckoutDTO } from './entity-dtocontainer-of-checkout-dto'; import { EntityDTOContainerOfDestinationDTO } from './entity-dtocontainer-of-destination-dto'; import { PriceValueDTO } from './price-value-dto'; import { DisplayItemDTO } from './display-item-dto'; import { EntityDTOContainerOfCheckoutItemDTO } from './entity-dtocontainer-of-checkout-item-dto'; import { TermsOfDeliveryDTO } from './terms-of-delivery-dto'; -export interface CheckoutDeliveryDTO extends ReadOnlyEntityDTOOfCheckoutDeliveryDTOAndICheckoutDelivery { +export interface CheckoutDeliveryDTO extends EntityDTOBaseOfCheckoutDeliveryDTOAndICheckoutDelivery{ checkout?: EntityDTOContainerOfCheckoutDTO; destination?: EntityDTOContainerOfDestinationDTO; discount?: PriceValueDTO; diff --git a/generated/swagger/print-api/src/models/checkout-dto.ts b/generated/swagger/print-api/src/models/checkout-dto.ts index 4616a40a8..103169ab3 100644 --- a/generated/swagger/print-api/src/models/checkout-dto.ts +++ b/generated/swagger/print-api/src/models/checkout-dto.ts @@ -1,5 +1,5 @@ /* tslint:disable */ -import { ReadOnlyEntityDTOOfCheckoutDTOAndICheckout } from './read-only-entity-dtoof-checkout-dtoand-icheckout'; +import { EntityDTOBaseOfCheckoutDTOAndICheckout } from './entity-dtobase-of-checkout-dtoand-icheckout'; import { KeyValueDTOOfStringAndString } from './key-value-dtoof-string-and-string'; import { SelectionDTOOfShippingTarget } from './selection-dtoof-shipping-target'; import { BuyerDTO } from './buyer-dto'; @@ -11,7 +11,7 @@ import { EntityDTOContainerOfBranchDTO } from './entity-dtocontainer-of-branch-d import { PayerDTO } from './payer-dto'; import { PaymentDTO } from './payment-dto'; import { UserAccountDTO } from './user-account-dto'; -export interface CheckoutDTO extends ReadOnlyEntityDTOOfCheckoutDTOAndICheckout { +export interface CheckoutDTO extends EntityDTOBaseOfCheckoutDTOAndICheckout{ agreements?: Array; availableShippingTargets?: Array; buyer?: BuyerDTO; @@ -20,7 +20,7 @@ export interface CheckoutDTO extends ReadOnlyEntityDTOOfCheckoutDTOAndICheckout destinations?: Array; items?: Array; label?: string; - notificationChannels: NotificationChannel; + notificationChannels?: NotificationChannel; orderBranch?: EntityDTOContainerOfBranchDTO; payer?: PayerDTO; payment?: PaymentDTO; diff --git a/generated/swagger/print-api/src/models/checkout-item-dto.ts b/generated/swagger/print-api/src/models/checkout-item-dto.ts index 23955a72d..d858d62f2 100644 --- a/generated/swagger/print-api/src/models/checkout-item-dto.ts +++ b/generated/swagger/print-api/src/models/checkout-item-dto.ts @@ -1,10 +1,10 @@ /* tslint:disable */ -import { ReadOnlyEntityDTOOfCheckoutItemDTOAndICheckoutItem } from './read-only-entity-dtoof-checkout-item-dtoand-icheckout-item'; +import { EntityDTOBaseOfCheckoutItemDTOAndICheckoutItem } from './entity-dtobase-of-checkout-item-dtoand-icheckout-item'; import { EntityDTOContainerOfShoppingCartItemDTO } from './entity-dtocontainer-of-shopping-cart-item-dto'; import { EntityDTOContainerOfCheckoutDTO } from './entity-dtocontainer-of-checkout-dto'; import { EntityDTOContainerOfCheckoutDeliveryDTO } from './entity-dtocontainer-of-checkout-delivery-dto'; import { PriceValueDTO } from './price-value-dto'; -export interface CheckoutItemDTO extends ReadOnlyEntityDTOOfCheckoutItemDTOAndICheckoutItem { +export interface CheckoutItemDTO extends EntityDTOBaseOfCheckoutItemDTOAndICheckoutItem{ accessories?: Array; checkout?: EntityDTOContainerOfCheckoutDTO; delivery?: EntityDTOContainerOfCheckoutDeliveryDTO; diff --git a/generated/swagger/print-api/src/models/communication-details-dto.ts b/generated/swagger/print-api/src/models/communication-details-dto.ts index eb5791e6a..03b0ae635 100644 --- a/generated/swagger/print-api/src/models/communication-details-dto.ts +++ b/generated/swagger/print-api/src/models/communication-details-dto.ts @@ -1,5 +1,6 @@ /* tslint:disable */ -export interface CommunicationDetailsDTO { +import { TouchedBase } from './touched-base'; +export interface CommunicationDetailsDTO extends TouchedBase{ email?: string; fax?: string; mobile?: string; diff --git a/generated/swagger/print-api/src/models/company-dto.ts b/generated/swagger/print-api/src/models/company-dto.ts index a99e948ac..a6b47644d 100644 --- a/generated/swagger/print-api/src/models/company-dto.ts +++ b/generated/swagger/print-api/src/models/company-dto.ts @@ -1,9 +1,10 @@ /* tslint:disable */ -import { EntityDTOOfCompanyDTOAndICompany } from './entity-dtoof-company-dtoand-icompany'; +import { EntityDTOBaseOfCompanyDTOAndICompany } from './entity-dtobase-of-company-dtoand-icompany'; import { AddressDTO } from './address-dto'; import { EntityDTOContainerOfCompanyDTO } from './entity-dtocontainer-of-company-dto'; -export interface CompanyDTO extends EntityDTOOfCompanyDTOAndICompany { +export interface CompanyDTO extends EntityDTOBaseOfCompanyDTOAndICompany{ address?: AddressDTO; + companyNumber?: string; costUnit?: string; department?: string; gln?: string; diff --git a/generated/swagger/print-api/src/models/component-item-display-type.ts b/generated/swagger/print-api/src/models/component-item-display-type.ts index 274799812..5f193af31 100644 --- a/generated/swagger/print-api/src/models/component-item-display-type.ts +++ b/generated/swagger/print-api/src/models/component-item-display-type.ts @@ -1,2 +1,2 @@ /* tslint:disable */ -export type ComponentItemDisplayType = 0 | 1 | 2; +export type ComponentItemDisplayType = 0 | 1 | 2; \ No newline at end of file diff --git a/generated/swagger/print-api/src/models/component-item-dto.ts b/generated/swagger/print-api/src/models/component-item-dto.ts index 93a92d737..8cd2ea17d 100644 --- a/generated/swagger/print-api/src/models/component-item-dto.ts +++ b/generated/swagger/print-api/src/models/component-item-dto.ts @@ -1,16 +1,18 @@ /* tslint:disable */ +import { TouchedBase } from './touched-base'; import { EntityDTOContainerOfCategoryDTO } from './entity-dtocontainer-of-category-dto'; import { ComponentItemDisplayType } from './component-item-display-type'; import { EntityDTOContainerOfItemDTO } from './entity-dtocontainer-of-item-dto'; import { QuantityUnitType } from './quantity-unit-type'; -export interface ComponentItemDTO { +export interface ComponentItemDTO extends TouchedBase{ category?: EntityDTOContainerOfCategoryDTO; description?: string; - displayType: ComponentItemDisplayType; + displayType?: ComponentItemDisplayType; item?: EntityDTOContainerOfItemDTO; name?: string; quantityMax?: number; - quantityUnitType: QuantityUnitType; + quantityMin?: number; + quantityUnitType?: QuantityUnitType; required?: boolean; start?: string; stop?: string; diff --git a/generated/swagger/print-api/src/models/components-dto.ts b/generated/swagger/print-api/src/models/components-dto.ts index 4e02338fa..f8e6dd5df 100644 --- a/generated/swagger/print-api/src/models/components-dto.ts +++ b/generated/swagger/print-api/src/models/components-dto.ts @@ -1,14 +1,14 @@ /* tslint:disable */ -import { EntityDTOOfComponentsDTOAndIComponents } from './entity-dtoof-components-dtoand-icomponents'; +import { EntityDTOBaseOfComponentsDTOAndIComponents } from './entity-dtobase-of-components-dtoand-icomponents'; import { ComponentItemDTO } from './component-item-dto'; import { QuantityUnitType } from './quantity-unit-type'; import { SetType } from './set-type'; -export interface ComponentsDTO extends EntityDTOOfComponentsDTOAndIComponents { +export interface ComponentsDTO extends EntityDTOBaseOfComponentsDTOAndIComponents{ items?: Array; overallQuantityMax?: number; overallQuantityMin?: number; - quantityUnitType: QuantityUnitType; + quantityUnitType?: QuantityUnitType; referenceQuantity?: number; - type: SetType; + type?: SetType; unit?: string; } diff --git a/generated/swagger/print-api/src/models/contributor-dto.ts b/generated/swagger/print-api/src/models/contributor-dto.ts index 30c2655a7..73fc8bfee 100644 --- a/generated/swagger/print-api/src/models/contributor-dto.ts +++ b/generated/swagger/print-api/src/models/contributor-dto.ts @@ -1,9 +1,9 @@ /* tslint:disable */ -import { EntityDTOOfContributorDTOAndIContributor } from './entity-dtoof-contributor-dtoand-icontributor'; +import { EntityDTOBaseOfContributorDTOAndIContributor } from './entity-dtobase-of-contributor-dtoand-icontributor'; import { OrganisationNamesDTO } from './organisation-names-dto'; import { PersonNamesDTO } from './person-names-dto'; import { EntityDTOContainerOfTenantDTO } from './entity-dtocontainer-of-tenant-dto'; -export interface ContributorDTO extends EntityDTOOfContributorDTOAndIContributor { +export interface ContributorDTO extends EntityDTOBaseOfContributorDTOAndIContributor{ friendlyName?: string; organisation?: OrganisationNamesDTO; person?: PersonNamesDTO; diff --git a/generated/swagger/print-api/src/models/contributor-helper-dto.ts b/generated/swagger/print-api/src/models/contributor-helper-dto.ts index 0bcdfea61..70e87efdc 100644 --- a/generated/swagger/print-api/src/models/contributor-helper-dto.ts +++ b/generated/swagger/print-api/src/models/contributor-helper-dto.ts @@ -1,6 +1,7 @@ /* tslint:disable */ +import { TouchedBase } from './touched-base'; import { EntityDTOContainerOfContributorDTO } from './entity-dtocontainer-of-contributor-dto'; -export interface ContributorHelperDTO { +export interface ContributorHelperDTO extends TouchedBase{ contributor?: EntityDTOContainerOfContributorDTO; type?: string; } diff --git a/generated/swagger/print-api/src/models/country-dto.ts b/generated/swagger/print-api/src/models/country-dto.ts index 85000083e..806b349fb 100644 --- a/generated/swagger/print-api/src/models/country-dto.ts +++ b/generated/swagger/print-api/src/models/country-dto.ts @@ -1,6 +1,6 @@ /* tslint:disable */ -import { ReadOnlyEntityDTOOfCountryDTOAndIReadOnlyCountry } from './read-only-entity-dtoof-country-dtoand-iread-only-country'; -export interface CountryDTO extends ReadOnlyEntityDTOOfCountryDTOAndIReadOnlyCountry { +import { EntityDTOBaseOfCountryDTOAndICountry } from './entity-dtobase-of-country-dtoand-icountry'; +export interface CountryDTO extends EntityDTOBaseOfCountryDTOAndICountry{ isDefault?: string; isO3166_A_3?: string; name?: string; diff --git a/generated/swagger/print-api/src/models/country-target-dto.ts b/generated/swagger/print-api/src/models/country-target-dto.ts index 5173177ec..78b2d5bfe 100644 --- a/generated/swagger/print-api/src/models/country-target-dto.ts +++ b/generated/swagger/print-api/src/models/country-target-dto.ts @@ -1,6 +1,7 @@ /* tslint:disable */ +import { TouchedBase } from './touched-base'; import { EntityDTOContainerOfCountryDTO } from './entity-dtocontainer-of-country-dto'; -export interface CountryTargetDTO { +export interface CountryTargetDTO extends TouchedBase{ isDefault?: string; start?: string; stop?: string; diff --git a/generated/swagger/print-api/src/models/coupon-dto.ts b/generated/swagger/print-api/src/models/coupon-dto.ts index 337c9d949..20a1f08a4 100644 --- a/generated/swagger/print-api/src/models/coupon-dto.ts +++ b/generated/swagger/print-api/src/models/coupon-dto.ts @@ -1,8 +1,8 @@ /* tslint:disable */ -import { ReadOnlyEntityDTOOfCouponDTOAndICoupon } from './read-only-entity-dtoof-coupon-dtoand-icoupon'; +import { EntityDTOBaseOfCouponDTOAndICoupon } from './entity-dtobase-of-coupon-dtoand-icoupon'; import { CouponType } from './coupon-type'; import { PriceValueDTO } from './price-value-dto'; -export interface CouponDTO extends ReadOnlyEntityDTOOfCouponDTOAndICoupon { +export interface CouponDTO extends EntityDTOBaseOfCouponDTOAndICoupon{ code?: string; couponType: CouponType; discount?: number; diff --git a/generated/swagger/print-api/src/models/coupon-type.ts b/generated/swagger/print-api/src/models/coupon-type.ts index 71ca28990..a2f6946a8 100644 --- a/generated/swagger/print-api/src/models/coupon-type.ts +++ b/generated/swagger/print-api/src/models/coupon-type.ts @@ -1,2 +1,2 @@ /* tslint:disable */ -export type CouponType = 0 | 1 | 2 | 4 | 8; +export type CouponType = 0 | 1 | 2 | 4 | 8; \ No newline at end of file diff --git a/generated/swagger/print-api/src/models/cruda.ts b/generated/swagger/print-api/src/models/cruda.ts new file mode 100644 index 000000000..24265ba9e --- /dev/null +++ b/generated/swagger/print-api/src/models/cruda.ts @@ -0,0 +1,2 @@ +/* tslint:disable */ +export type CRUDA = 0 | 1 | 2 | 4 | 8 | 16; \ No newline at end of file diff --git a/generated/swagger/print-api/src/models/currency-dto.ts b/generated/swagger/print-api/src/models/currency-dto.ts index 594efc877..94e70347a 100644 --- a/generated/swagger/print-api/src/models/currency-dto.ts +++ b/generated/swagger/print-api/src/models/currency-dto.ts @@ -1,6 +1,6 @@ /* tslint:disable */ -import { EntityDTOOfCurrencyDTOAndICurrency } from './entity-dtoof-currency-dtoand-icurrency'; -export interface CurrencyDTO extends EntityDTOOfCurrencyDTOAndICurrency { +import { EntityDTOBaseOfCurrencyDTOAndICurrency } from './entity-dtobase-of-currency-dtoand-icurrency'; +export interface CurrencyDTO extends EntityDTOBaseOfCurrencyDTOAndICurrency{ isO4217?: string; name?: string; number?: number; diff --git a/generated/swagger/print-api/src/models/date-range-dto.ts b/generated/swagger/print-api/src/models/date-range-dto.ts new file mode 100644 index 000000000..a84f889f9 --- /dev/null +++ b/generated/swagger/print-api/src/models/date-range-dto.ts @@ -0,0 +1,6 @@ +/* tslint:disable */ +import { TouchedBase } from './touched-base'; +export interface DateRangeDTO extends TouchedBase{ + start?: string; + stop?: string; +} diff --git a/generated/swagger/print-api/src/models/declarable-food-additives.ts b/generated/swagger/print-api/src/models/declarable-food-additives.ts index f07f75e59..c3c0bbae5 100644 --- a/generated/swagger/print-api/src/models/declarable-food-additives.ts +++ b/generated/swagger/print-api/src/models/declarable-food-additives.ts @@ -1,20 +1,2 @@ /* tslint:disable */ -export type DeclarableFoodAdditives = - | 0 - | 1 - | 2 - | 4 - | 8 - | 16 - | 32 - | 64 - | 128 - | 256 - | 512 - | 1024 - | 2048 - | 4096 - | 8192 - | 16384 - | 32768 - | 65536; +export type DeclarableFoodAdditives = 0 | 1 | 2 | 4 | 8 | 16 | 32 | 64 | 128 | 256 | 512 | 1024 | 2048 | 4096 | 8192 | 16384 | 32768 | 65536; \ No newline at end of file diff --git a/generated/swagger/print-api/src/models/destination-dto.ts b/generated/swagger/print-api/src/models/destination-dto.ts index 7818a46d8..c58f09ce1 100644 --- a/generated/swagger/print-api/src/models/destination-dto.ts +++ b/generated/swagger/print-api/src/models/destination-dto.ts @@ -1,11 +1,11 @@ /* tslint:disable */ -import { EntityDTOOfDestinationDTOAndIDestination } from './entity-dtoof-destination-dtoand-idestination'; +import { EntityDTOBaseOfDestinationDTOAndIDestination } from './entity-dtobase-of-destination-dtoand-idestination'; import { EntityDTOContainerOfCheckoutDTO } from './entity-dtocontainer-of-checkout-dto'; import { EntityDTOContainerOfLogisticianDTO } from './entity-dtocontainer-of-logistician-dto'; import { ShippingAddressDTO } from './shipping-address-dto'; import { ShippingTarget } from './shipping-target'; import { EntityDTOContainerOfBranchDTO } from './entity-dtocontainer-of-branch-dto'; -export interface DestinationDTO extends EntityDTOOfDestinationDTOAndIDestination { +export interface DestinationDTO extends EntityDTOBaseOfDestinationDTOAndIDestination{ checkout?: EntityDTOContainerOfCheckoutDTO; logistician?: EntityDTOContainerOfLogisticianDTO; shippingAddress?: ShippingAddressDTO; diff --git a/generated/swagger/print-api/src/models/dialog-content-type.ts b/generated/swagger/print-api/src/models/dialog-content-type.ts new file mode 100644 index 000000000..eca48a225 --- /dev/null +++ b/generated/swagger/print-api/src/models/dialog-content-type.ts @@ -0,0 +1,2 @@ +/* tslint:disable */ +export type DialogContentType = 0 | 1 | 2 | 4 | 8 | 16 | 32 | 64 | 128; \ No newline at end of file diff --git a/generated/swagger/print-api/src/models/dialog-of-string.ts b/generated/swagger/print-api/src/models/dialog-of-string.ts new file mode 100644 index 000000000..927ec617a --- /dev/null +++ b/generated/swagger/print-api/src/models/dialog-of-string.ts @@ -0,0 +1,16 @@ +/* tslint:disable */ +import { KeyValueDTOOfStringAndString } from './key-value-dtoof-string-and-string'; +import { DialogContentType } from './dialog-content-type'; +import { DialogSettings } from './dialog-settings'; +export interface DialogOfString { + actions?: Array; + actionsRequired?: number; + area?: string; + content?: string; + contentType: DialogContentType; + description?: string; + displayTimeout?: number; + settings: DialogSettings; + subtitle?: string; + title?: string; +} diff --git a/generated/swagger/print-api/src/models/dialog-settings.ts b/generated/swagger/print-api/src/models/dialog-settings.ts new file mode 100644 index 000000000..1ac70356d --- /dev/null +++ b/generated/swagger/print-api/src/models/dialog-settings.ts @@ -0,0 +1,2 @@ +/* tslint:disable */ +export type DialogSettings = 0 | 1 | 2 | 4; \ No newline at end of file diff --git a/generated/swagger/print-api/src/models/display-branch-dto.ts b/generated/swagger/print-api/src/models/display-branch-dto.ts index 7f518520e..299872c77 100644 --- a/generated/swagger/print-api/src/models/display-branch-dto.ts +++ b/generated/swagger/print-api/src/models/display-branch-dto.ts @@ -1,8 +1,8 @@ /* tslint:disable */ -import { ReadOnlyEntityDTOOfDisplayBranchDTOAndIReadOnlyBranch } from './read-only-entity-dtoof-display-branch-dtoand-iread-only-branch'; +import { EntityDTOBaseOfDisplayBranchDTOAndIBranch } from './entity-dtobase-of-display-branch-dtoand-ibranch'; import { AddressDTO } from './address-dto'; import { CommunicationDetailsDTO } from './communication-details-dto'; -export interface DisplayBranchDTO extends ReadOnlyEntityDTOOfDisplayBranchDTOAndIReadOnlyBranch { +export interface DisplayBranchDTO extends EntityDTOBaseOfDisplayBranchDTOAndIBranch{ address?: AddressDTO; branchNumber?: string; communicationDetails?: CommunicationDetailsDTO; diff --git a/generated/swagger/print-api/src/models/display-logistician-dto.ts b/generated/swagger/print-api/src/models/display-logistician-dto.ts index f5614c018..8b3720e6a 100644 --- a/generated/swagger/print-api/src/models/display-logistician-dto.ts +++ b/generated/swagger/print-api/src/models/display-logistician-dto.ts @@ -1,6 +1,6 @@ /* tslint:disable */ -import { ReadOnlyEntityDTOOfDisplayLogisticianDTOAndILogistician } from './read-only-entity-dtoof-display-logistician-dtoand-ilogistician'; -export interface DisplayLogisticianDTO extends ReadOnlyEntityDTOOfDisplayLogisticianDTOAndILogistician { +import { EntityDTOBaseOfDisplayLogisticianDTOAndILogistician } from './entity-dtobase-of-display-logistician-dtoand-ilogistician'; +export interface DisplayLogisticianDTO extends EntityDTOBaseOfDisplayLogisticianDTOAndILogistician{ gln?: string; logisticianNumber?: string; name?: string; diff --git a/generated/swagger/print-api/src/models/display-order-dto.ts b/generated/swagger/print-api/src/models/display-order-dto.ts index bdd59e8ac..8777237af 100644 --- a/generated/swagger/print-api/src/models/display-order-dto.ts +++ b/generated/swagger/print-api/src/models/display-order-dto.ts @@ -1,16 +1,19 @@ /* tslint:disable */ -import { ReadOnlyEntityDTOOfDisplayOrderDTOAndIOrder } from './read-only-entity-dtoof-display-order-dtoand-iorder'; +import { EntityDTOBaseOfDisplayOrderDTOAndIOrder } from './entity-dtobase-of-display-order-dtoand-iorder'; +import { KeyValueDTOOfStringAndString } from './key-value-dtoof-string-and-string'; import { DisplayAddresseeDTO } from './display-addressee-dto'; import { BuyerType } from './buyer-type'; import { EnvironmentChannel } from './environment-channel'; import { DisplayOrderItemDTO } from './display-order-item-dto'; +import { LinkedRecordDTO } from './linked-record-dto'; import { DisplayLogisticianDTO } from './display-logistician-dto'; import { NotificationChannel } from './notification-channel'; import { DisplayBranchDTO } from './display-branch-dto'; import { OrderType } from './order-type'; import { DisplayOrderPaymentDTO } from './display-order-payment-dto'; -import { TermsOfDeliveryDTO2 } from './terms-of-delivery-dto2'; -export interface DisplayOrderDTO extends ReadOnlyEntityDTOOfDisplayOrderDTOAndIOrder { +import { TermsOfDeliveryDTO } from './terms-of-delivery-dto'; +export interface DisplayOrderDTO extends EntityDTOBaseOfDisplayOrderDTOAndIOrder{ + actions?: Array; buyer?: DisplayAddresseeDTO; buyerComment?: string; buyerIsGuestAccount?: boolean; @@ -18,9 +21,10 @@ export interface DisplayOrderDTO extends ReadOnlyEntityDTOOfDisplayOrderDTOAndIO buyerType?: BuyerType; clientChannel?: EnvironmentChannel; completedDate?: string; - features?: { [key: string]: string }; + features?: {[key: string]: string}; items?: Array; itemsCount?: number; + linkedRecords?: Array; logistician?: DisplayLogisticianDTO; notificationChannels?: NotificationChannel; orderBranch?: DisplayBranchDTO; @@ -35,5 +39,5 @@ export interface DisplayOrderDTO extends ReadOnlyEntityDTOOfDisplayOrderDTOAndIO payment?: DisplayOrderPaymentDTO; shippingAddress?: DisplayAddresseeDTO; targetBranch?: DisplayBranchDTO; - termsOfDelivery?: TermsOfDeliveryDTO2; + termsOfDelivery?: TermsOfDeliveryDTO; } diff --git a/generated/swagger/print-api/src/models/display-order-item-dto.ts b/generated/swagger/print-api/src/models/display-order-item-dto.ts index d4e173338..b5b52edc1 100644 --- a/generated/swagger/print-api/src/models/display-order-item-dto.ts +++ b/generated/swagger/print-api/src/models/display-order-item-dto.ts @@ -1,15 +1,15 @@ /* tslint:disable */ -import { ReadOnlyEntityDTOOfDisplayOrderItemDTOAndIOrderItem } from './read-only-entity-dtoof-display-order-item-dtoand-iorder-item'; +import { EntityDTOBaseOfDisplayOrderItemDTOAndIOrderItem } from './entity-dtobase-of-display-order-item-dtoand-iorder-item'; import { DisplayOrderDTO } from './display-order-dto'; import { PriceDTO } from './price-dto'; import { ProductDTO } from './product-dto'; import { PromotionDTO } from './promotion-dto'; import { QuantityUnitType } from './quantity-unit-type'; import { DisplayOrderItemSubsetDTO } from './display-order-item-subset-dto'; -export interface DisplayOrderItemDTO extends ReadOnlyEntityDTOOfDisplayOrderItemDTOAndIOrderItem { +export interface DisplayOrderItemDTO extends EntityDTOBaseOfDisplayOrderItemDTOAndIOrderItem{ buyerComment?: string; description?: string; - features?: { [key: string]: string }; + features?: {[key: string]: string}; order?: DisplayOrderDTO; orderDate?: string; orderItemNumber?: string; diff --git a/generated/swagger/print-api/src/models/display-order-item-subset-dto.ts b/generated/swagger/print-api/src/models/display-order-item-subset-dto.ts index f6ea4c359..c09ffeba0 100644 --- a/generated/swagger/print-api/src/models/display-order-item-subset-dto.ts +++ b/generated/swagger/print-api/src/models/display-order-item-subset-dto.ts @@ -1,16 +1,19 @@ /* tslint:disable */ -import { ReadOnlyEntityDTOOfDisplayOrderItemSubsetDTOAndIOrderItemStatus } from './read-only-entity-dtoof-display-order-item-subset-dtoand-iorder-item-status'; +import { EntityDTOBaseOfDisplayOrderItemSubsetDTOAndIOrderItemStatus } from './entity-dtobase-of-display-order-item-subset-dtoand-iorder-item-status'; +import { DateRangeDTO } from './date-range-dto'; import { DisplayOrderItemDTO } from './display-order-item-dto'; import { OrderItemProcessingStatusValue } from './order-item-processing-status-value'; -export interface DisplayOrderItemSubsetDTO extends ReadOnlyEntityDTOOfDisplayOrderItemSubsetDTOAndIOrderItemStatus { +export interface DisplayOrderItemSubsetDTO extends EntityDTOBaseOfDisplayOrderItemSubsetDTOAndIOrderItemStatus{ compartmentCode?: string; compartmentInfo?: string; compartmentStart?: string; compartmentStop?: string; description?: string; + estimatedDelivery?: DateRangeDTO; estimatedShippingDate?: string; orderItem?: DisplayOrderItemDTO; orderItemSubsetNumber?: string; + preferredPickUpDate?: string; processingStatus: OrderItemProcessingStatusValue; processingStatusDate?: string; quantity?: number; @@ -19,5 +22,6 @@ export interface DisplayOrderItemSubsetDTO extends ReadOnlyEntityDTOOfDisplayOrd sscText?: string; supplierLabel?: string; supplierName?: string; + supplyChannel?: string; trackingNumber?: string; } diff --git a/generated/swagger/print-api/src/models/display-order-payment-dto.ts b/generated/swagger/print-api/src/models/display-order-payment-dto.ts index ff03ed4a4..81c4ccd86 100644 --- a/generated/swagger/print-api/src/models/display-order-payment-dto.ts +++ b/generated/swagger/print-api/src/models/display-order-payment-dto.ts @@ -1,7 +1,7 @@ /* tslint:disable */ -import { ReadOnlyEntityDTOOfDisplayOrderPaymentDTOAndIReadOnlyPayment } from './read-only-entity-dtoof-display-order-payment-dtoand-iread-only-payment'; +import { EntityDTOBaseOfDisplayOrderPaymentDTOAndIReadOnlyPayment } from './entity-dtobase-of-display-order-payment-dtoand-iread-only-payment'; import { PaymentType } from './payment-type'; -export interface DisplayOrderPaymentDTO extends ReadOnlyEntityDTOOfDisplayOrderPaymentDTOAndIReadOnlyPayment { +export interface DisplayOrderPaymentDTO extends EntityDTOBaseOfDisplayOrderPaymentDTOAndIReadOnlyPayment{ cancelled?: string; completed?: string; currency?: string; diff --git a/generated/swagger/print-api/src/models/entity-dto.ts b/generated/swagger/print-api/src/models/entity-dto.ts index 59183216c..53355f0cc 100644 --- a/generated/swagger/print-api/src/models/entity-dto.ts +++ b/generated/swagger/print-api/src/models/entity-dto.ts @@ -1,11 +1,14 @@ /* tslint:disable */ import { TouchedBase } from './touched-base'; +import { CRUDA } from './cruda'; import { EntityStatus } from './entity-status'; -export interface EntityDTO extends TouchedBase { +export interface EntityDTO extends TouchedBase{ changed?: string; created?: string; + cruda?: CRUDA; id?: number; pId?: string; status?: EntityStatus; + uId?: string; version?: number; } diff --git a/generated/swagger/print-api/src/models/entity-dtobase-of-branch-dtoand-ibranch.ts b/generated/swagger/print-api/src/models/entity-dtobase-of-branch-dtoand-ibranch.ts new file mode 100644 index 000000000..6a4bb3eb3 --- /dev/null +++ b/generated/swagger/print-api/src/models/entity-dtobase-of-branch-dtoand-ibranch.ts @@ -0,0 +1,4 @@ +/* tslint:disable */ +import { EntityDTOBase } from './entity-dtobase'; +export interface EntityDTOBaseOfBranchDTOAndIBranch extends EntityDTOBase{ +} diff --git a/generated/swagger/print-api/src/models/entity-dtobase-of-checkout-delivery-dtoand-icheckout-delivery.ts b/generated/swagger/print-api/src/models/entity-dtobase-of-checkout-delivery-dtoand-icheckout-delivery.ts new file mode 100644 index 000000000..cab637df8 --- /dev/null +++ b/generated/swagger/print-api/src/models/entity-dtobase-of-checkout-delivery-dtoand-icheckout-delivery.ts @@ -0,0 +1,4 @@ +/* tslint:disable */ +import { EntityDTOBase } from './entity-dtobase'; +export interface EntityDTOBaseOfCheckoutDeliveryDTOAndICheckoutDelivery extends EntityDTOBase{ +} diff --git a/generated/swagger/print-api/src/models/entity-dtobase-of-checkout-dtoand-icheckout.ts b/generated/swagger/print-api/src/models/entity-dtobase-of-checkout-dtoand-icheckout.ts new file mode 100644 index 000000000..f642bf74f --- /dev/null +++ b/generated/swagger/print-api/src/models/entity-dtobase-of-checkout-dtoand-icheckout.ts @@ -0,0 +1,4 @@ +/* tslint:disable */ +import { EntityDTOBase } from './entity-dtobase'; +export interface EntityDTOBaseOfCheckoutDTOAndICheckout extends EntityDTOBase{ +} diff --git a/generated/swagger/print-api/src/models/entity-dtobase-of-checkout-item-dtoand-icheckout-item.ts b/generated/swagger/print-api/src/models/entity-dtobase-of-checkout-item-dtoand-icheckout-item.ts new file mode 100644 index 000000000..68fc5346f --- /dev/null +++ b/generated/swagger/print-api/src/models/entity-dtobase-of-checkout-item-dtoand-icheckout-item.ts @@ -0,0 +1,4 @@ +/* tslint:disable */ +import { EntityDTOBase } from './entity-dtobase'; +export interface EntityDTOBaseOfCheckoutItemDTOAndICheckoutItem extends EntityDTOBase{ +} diff --git a/generated/swagger/print-api/src/models/entity-dtobase-of-company-dtoand-icompany.ts b/generated/swagger/print-api/src/models/entity-dtobase-of-company-dtoand-icompany.ts new file mode 100644 index 000000000..577f489ed --- /dev/null +++ b/generated/swagger/print-api/src/models/entity-dtobase-of-company-dtoand-icompany.ts @@ -0,0 +1,4 @@ +/* tslint:disable */ +import { EntityDTOBase } from './entity-dtobase'; +export interface EntityDTOBaseOfCompanyDTOAndICompany extends EntityDTOBase{ +} diff --git a/generated/swagger/print-api/src/models/entity-dtobase-of-components-dtoand-icomponents.ts b/generated/swagger/print-api/src/models/entity-dtobase-of-components-dtoand-icomponents.ts new file mode 100644 index 000000000..13806ae10 --- /dev/null +++ b/generated/swagger/print-api/src/models/entity-dtobase-of-components-dtoand-icomponents.ts @@ -0,0 +1,4 @@ +/* tslint:disable */ +import { EntityDTOBase } from './entity-dtobase'; +export interface EntityDTOBaseOfComponentsDTOAndIComponents extends EntityDTOBase{ +} diff --git a/generated/swagger/print-api/src/models/entity-dtobase-of-contributor-dtoand-icontributor.ts b/generated/swagger/print-api/src/models/entity-dtobase-of-contributor-dtoand-icontributor.ts new file mode 100644 index 000000000..3e44a0dde --- /dev/null +++ b/generated/swagger/print-api/src/models/entity-dtobase-of-contributor-dtoand-icontributor.ts @@ -0,0 +1,4 @@ +/* tslint:disable */ +import { EntityDTOBase } from './entity-dtobase'; +export interface EntityDTOBaseOfContributorDTOAndIContributor extends EntityDTOBase{ +} diff --git a/generated/swagger/print-api/src/models/entity-dtobase-of-country-dtoand-icountry.ts b/generated/swagger/print-api/src/models/entity-dtobase-of-country-dtoand-icountry.ts new file mode 100644 index 000000000..c5c94b8e6 --- /dev/null +++ b/generated/swagger/print-api/src/models/entity-dtobase-of-country-dtoand-icountry.ts @@ -0,0 +1,4 @@ +/* tslint:disable */ +import { EntityDTOBase } from './entity-dtobase'; +export interface EntityDTOBaseOfCountryDTOAndICountry extends EntityDTOBase{ +} diff --git a/generated/swagger/print-api/src/models/entity-dtobase-of-coupon-dtoand-icoupon.ts b/generated/swagger/print-api/src/models/entity-dtobase-of-coupon-dtoand-icoupon.ts new file mode 100644 index 000000000..9e8e3ecfa --- /dev/null +++ b/generated/swagger/print-api/src/models/entity-dtobase-of-coupon-dtoand-icoupon.ts @@ -0,0 +1,4 @@ +/* tslint:disable */ +import { EntityDTOBase } from './entity-dtobase'; +export interface EntityDTOBaseOfCouponDTOAndICoupon extends EntityDTOBase{ +} diff --git a/generated/swagger/print-api/src/models/entity-dtobase-of-currency-dtoand-icurrency.ts b/generated/swagger/print-api/src/models/entity-dtobase-of-currency-dtoand-icurrency.ts new file mode 100644 index 000000000..4373cc0fe --- /dev/null +++ b/generated/swagger/print-api/src/models/entity-dtobase-of-currency-dtoand-icurrency.ts @@ -0,0 +1,4 @@ +/* tslint:disable */ +import { EntityDTOBase } from './entity-dtobase'; +export interface EntityDTOBaseOfCurrencyDTOAndICurrency extends EntityDTOBase{ +} diff --git a/generated/swagger/print-api/src/models/entity-dtobase-of-destination-dtoand-idestination.ts b/generated/swagger/print-api/src/models/entity-dtobase-of-destination-dtoand-idestination.ts new file mode 100644 index 000000000..1cac274bf --- /dev/null +++ b/generated/swagger/print-api/src/models/entity-dtobase-of-destination-dtoand-idestination.ts @@ -0,0 +1,4 @@ +/* tslint:disable */ +import { EntityDTOBase } from './entity-dtobase'; +export interface EntityDTOBaseOfDestinationDTOAndIDestination extends EntityDTOBase{ +} diff --git a/generated/swagger/print-api/src/models/entity-dtobase-of-display-branch-dtoand-ibranch.ts b/generated/swagger/print-api/src/models/entity-dtobase-of-display-branch-dtoand-ibranch.ts new file mode 100644 index 000000000..7fa66847a --- /dev/null +++ b/generated/swagger/print-api/src/models/entity-dtobase-of-display-branch-dtoand-ibranch.ts @@ -0,0 +1,4 @@ +/* tslint:disable */ +import { EntityDTOBase } from './entity-dtobase'; +export interface EntityDTOBaseOfDisplayBranchDTOAndIBranch extends EntityDTOBase{ +} diff --git a/generated/swagger/print-api/src/models/entity-dtobase-of-display-logistician-dtoand-ilogistician.ts b/generated/swagger/print-api/src/models/entity-dtobase-of-display-logistician-dtoand-ilogistician.ts new file mode 100644 index 000000000..f214ef14e --- /dev/null +++ b/generated/swagger/print-api/src/models/entity-dtobase-of-display-logistician-dtoand-ilogistician.ts @@ -0,0 +1,4 @@ +/* tslint:disable */ +import { EntityDTOBase } from './entity-dtobase'; +export interface EntityDTOBaseOfDisplayLogisticianDTOAndILogistician extends EntityDTOBase{ +} diff --git a/generated/swagger/print-api/src/models/entity-dtobase-of-display-order-dtoand-iorder.ts b/generated/swagger/print-api/src/models/entity-dtobase-of-display-order-dtoand-iorder.ts new file mode 100644 index 000000000..86861aca4 --- /dev/null +++ b/generated/swagger/print-api/src/models/entity-dtobase-of-display-order-dtoand-iorder.ts @@ -0,0 +1,4 @@ +/* tslint:disable */ +import { EntityDTOBase } from './entity-dtobase'; +export interface EntityDTOBaseOfDisplayOrderDTOAndIOrder extends EntityDTOBase{ +} diff --git a/generated/swagger/print-api/src/models/entity-dtobase-of-display-order-item-dtoand-iorder-item.ts b/generated/swagger/print-api/src/models/entity-dtobase-of-display-order-item-dtoand-iorder-item.ts new file mode 100644 index 000000000..a50407ff6 --- /dev/null +++ b/generated/swagger/print-api/src/models/entity-dtobase-of-display-order-item-dtoand-iorder-item.ts @@ -0,0 +1,4 @@ +/* tslint:disable */ +import { EntityDTOBase } from './entity-dtobase'; +export interface EntityDTOBaseOfDisplayOrderItemDTOAndIOrderItem extends EntityDTOBase{ +} diff --git a/generated/swagger/print-api/src/models/entity-dtobase-of-display-order-item-subset-dtoand-iorder-item-status.ts b/generated/swagger/print-api/src/models/entity-dtobase-of-display-order-item-subset-dtoand-iorder-item-status.ts new file mode 100644 index 000000000..27b83f988 --- /dev/null +++ b/generated/swagger/print-api/src/models/entity-dtobase-of-display-order-item-subset-dtoand-iorder-item-status.ts @@ -0,0 +1,4 @@ +/* tslint:disable */ +import { EntityDTOBase } from './entity-dtobase'; +export interface EntityDTOBaseOfDisplayOrderItemSubsetDTOAndIOrderItemStatus extends EntityDTOBase{ +} diff --git a/generated/swagger/print-api/src/models/entity-dtobase-of-display-order-payment-dtoand-iread-only-payment.ts b/generated/swagger/print-api/src/models/entity-dtobase-of-display-order-payment-dtoand-iread-only-payment.ts new file mode 100644 index 000000000..33864e48d --- /dev/null +++ b/generated/swagger/print-api/src/models/entity-dtobase-of-display-order-payment-dtoand-iread-only-payment.ts @@ -0,0 +1,4 @@ +/* tslint:disable */ +import { EntityDTOBase } from './entity-dtobase'; +export interface EntityDTOBaseOfDisplayOrderPaymentDTOAndIReadOnlyPayment extends EntityDTOBase{ +} diff --git a/generated/swagger/print-api/src/models/entity-dtobase-of-file-dtoand-ifile.ts b/generated/swagger/print-api/src/models/entity-dtobase-of-file-dtoand-ifile.ts new file mode 100644 index 000000000..bcb33db82 --- /dev/null +++ b/generated/swagger/print-api/src/models/entity-dtobase-of-file-dtoand-ifile.ts @@ -0,0 +1,4 @@ +/* tslint:disable */ +import { EntityDTOBase } from './entity-dtobase'; +export interface EntityDTOBaseOfFileDTOAndIFile extends EntityDTOBase{ +} diff --git a/generated/swagger/print-api/src/models/entity-dtobase-of-item-dtoand-iitem.ts b/generated/swagger/print-api/src/models/entity-dtobase-of-item-dtoand-iitem.ts new file mode 100644 index 000000000..8d3324c82 --- /dev/null +++ b/generated/swagger/print-api/src/models/entity-dtobase-of-item-dtoand-iitem.ts @@ -0,0 +1,4 @@ +/* tslint:disable */ +import { EntityDTOBase } from './entity-dtobase'; +export interface EntityDTOBaseOfItemDTOAndIItem extends EntityDTOBase{ +} diff --git a/generated/swagger/print-api/src/models/entity-dtobase-of-label-dtoand-ilabel.ts b/generated/swagger/print-api/src/models/entity-dtobase-of-label-dtoand-ilabel.ts new file mode 100644 index 000000000..13adfd300 --- /dev/null +++ b/generated/swagger/print-api/src/models/entity-dtobase-of-label-dtoand-ilabel.ts @@ -0,0 +1,4 @@ +/* tslint:disable */ +import { EntityDTOBase } from './entity-dtobase'; +export interface EntityDTOBaseOfLabelDTOAndILabel extends EntityDTOBase{ +} diff --git a/generated/swagger/print-api/src/models/entity-dtobase-of-logistician-dtoand-ilogistician.ts b/generated/swagger/print-api/src/models/entity-dtobase-of-logistician-dtoand-ilogistician.ts new file mode 100644 index 000000000..02a7207bd --- /dev/null +++ b/generated/swagger/print-api/src/models/entity-dtobase-of-logistician-dtoand-ilogistician.ts @@ -0,0 +1,4 @@ +/* tslint:disable */ +import { EntityDTOBase } from './entity-dtobase'; +export interface EntityDTOBaseOfLogisticianDTOAndILogistician extends EntityDTOBase{ +} diff --git a/generated/swagger/print-api/src/models/entity-dtobase-of-shop-dtoand-ishop.ts b/generated/swagger/print-api/src/models/entity-dtobase-of-shop-dtoand-ishop.ts new file mode 100644 index 000000000..b9322d5b3 --- /dev/null +++ b/generated/swagger/print-api/src/models/entity-dtobase-of-shop-dtoand-ishop.ts @@ -0,0 +1,4 @@ +/* tslint:disable */ +import { EntityDTOBase } from './entity-dtobase'; +export interface EntityDTOBaseOfShopDTOAndIShop extends EntityDTOBase{ +} diff --git a/generated/swagger/print-api/src/models/entity-dtobase-of-shop-item-dtoand-ishop-item.ts b/generated/swagger/print-api/src/models/entity-dtobase-of-shop-item-dtoand-ishop-item.ts new file mode 100644 index 000000000..ab75c68a2 --- /dev/null +++ b/generated/swagger/print-api/src/models/entity-dtobase-of-shop-item-dtoand-ishop-item.ts @@ -0,0 +1,4 @@ +/* tslint:disable */ +import { EntityDTOBase } from './entity-dtobase'; +export interface EntityDTOBaseOfShopItemDTOAndIShopItem extends EntityDTOBase{ +} diff --git a/generated/swagger/print-api/src/models/entity-dtobase-of-shopping-cart-item-dtoand-ishopping-cart-item.ts b/generated/swagger/print-api/src/models/entity-dtobase-of-shopping-cart-item-dtoand-ishopping-cart-item.ts new file mode 100644 index 000000000..62dc2cd6f --- /dev/null +++ b/generated/swagger/print-api/src/models/entity-dtobase-of-shopping-cart-item-dtoand-ishopping-cart-item.ts @@ -0,0 +1,4 @@ +/* tslint:disable */ +import { EntityDTOBase } from './entity-dtobase'; +export interface EntityDTOBaseOfShoppingCartItemDTOAndIShoppingCartItem extends EntityDTOBase{ +} diff --git a/generated/swagger/print-api/src/models/entity-dtobase-of-supplier-dtoand-isupplier.ts b/generated/swagger/print-api/src/models/entity-dtobase-of-supplier-dtoand-isupplier.ts new file mode 100644 index 000000000..e4e7b9e80 --- /dev/null +++ b/generated/swagger/print-api/src/models/entity-dtobase-of-supplier-dtoand-isupplier.ts @@ -0,0 +1,4 @@ +/* tslint:disable */ +import { EntityDTOBase } from './entity-dtobase'; +export interface EntityDTOBaseOfSupplierDTOAndISupplier extends EntityDTOBase{ +} diff --git a/generated/swagger/print-api/src/models/entity-dtobase-of-tenant-dtoand-itenant.ts b/generated/swagger/print-api/src/models/entity-dtobase-of-tenant-dtoand-itenant.ts new file mode 100644 index 000000000..fd93295d7 --- /dev/null +++ b/generated/swagger/print-api/src/models/entity-dtobase-of-tenant-dtoand-itenant.ts @@ -0,0 +1,4 @@ +/* tslint:disable */ +import { EntityDTOBase } from './entity-dtobase'; +export interface EntityDTOBaseOfTenantDTOAndITenant extends EntityDTOBase{ +} diff --git a/generated/swagger/print-api/src/models/entity-dtobase-of-text-dtoand-itext.ts b/generated/swagger/print-api/src/models/entity-dtobase-of-text-dtoand-itext.ts new file mode 100644 index 000000000..a5945586e --- /dev/null +++ b/generated/swagger/print-api/src/models/entity-dtobase-of-text-dtoand-itext.ts @@ -0,0 +1,4 @@ +/* tslint:disable */ +import { EntityDTOBase } from './entity-dtobase'; +export interface EntityDTOBaseOfTextDTOAndIText extends EntityDTOBase{ +} diff --git a/generated/swagger/print-api/src/models/entity-dtobase-of-voucher-dtoand-ivoucher.ts b/generated/swagger/print-api/src/models/entity-dtobase-of-voucher-dtoand-ivoucher.ts new file mode 100644 index 000000000..c97dac50f --- /dev/null +++ b/generated/swagger/print-api/src/models/entity-dtobase-of-voucher-dtoand-ivoucher.ts @@ -0,0 +1,4 @@ +/* tslint:disable */ +import { EntityDTOBase } from './entity-dtobase'; +export interface EntityDTOBaseOfVoucherDTOAndIVoucher extends EntityDTOBase{ +} diff --git a/generated/swagger/print-api/src/models/entity-dtobase.ts b/generated/swagger/print-api/src/models/entity-dtobase.ts new file mode 100644 index 000000000..75145b351 --- /dev/null +++ b/generated/swagger/print-api/src/models/entity-dtobase.ts @@ -0,0 +1,4 @@ +/* tslint:disable */ +import { EntityDTO } from './entity-dto'; +export interface EntityDTOBase extends EntityDTO{ +} diff --git a/generated/swagger/print-api/src/models/entity-dtocontainer-of-branch-dto.ts b/generated/swagger/print-api/src/models/entity-dtocontainer-of-branch-dto.ts index 99b26c663..1d4c4a96a 100644 --- a/generated/swagger/print-api/src/models/entity-dtocontainer-of-branch-dto.ts +++ b/generated/swagger/print-api/src/models/entity-dtocontainer-of-branch-dto.ts @@ -1,6 +1,6 @@ /* tslint:disable */ import { EntityDTOReferenceContainer } from './entity-dtoreference-container'; import { BranchDTO } from './branch-dto'; -export interface EntityDTOContainerOfBranchDTO extends EntityDTOReferenceContainer { +export interface EntityDTOContainerOfBranchDTO extends EntityDTOReferenceContainer{ data?: BranchDTO; } diff --git a/generated/swagger/print-api/src/models/entity-dtocontainer-of-category-dto.ts b/generated/swagger/print-api/src/models/entity-dtocontainer-of-category-dto.ts index 7f9b53489..5c13714e6 100644 --- a/generated/swagger/print-api/src/models/entity-dtocontainer-of-category-dto.ts +++ b/generated/swagger/print-api/src/models/entity-dtocontainer-of-category-dto.ts @@ -1,6 +1,6 @@ /* tslint:disable */ import { EntityDTOReferenceContainer } from './entity-dtoreference-container'; import { CategoryDTO } from './category-dto'; -export interface EntityDTOContainerOfCategoryDTO extends EntityDTOReferenceContainer { +export interface EntityDTOContainerOfCategoryDTO extends EntityDTOReferenceContainer{ data?: CategoryDTO; } diff --git a/generated/swagger/print-api/src/models/entity-dtocontainer-of-checkout-delivery-dto.ts b/generated/swagger/print-api/src/models/entity-dtocontainer-of-checkout-delivery-dto.ts index 9c9811fcc..bd30ecb1f 100644 --- a/generated/swagger/print-api/src/models/entity-dtocontainer-of-checkout-delivery-dto.ts +++ b/generated/swagger/print-api/src/models/entity-dtocontainer-of-checkout-delivery-dto.ts @@ -1,6 +1,6 @@ /* tslint:disable */ import { EntityDTOReferenceContainer } from './entity-dtoreference-container'; import { CheckoutDeliveryDTO } from './checkout-delivery-dto'; -export interface EntityDTOContainerOfCheckoutDeliveryDTO extends EntityDTOReferenceContainer { +export interface EntityDTOContainerOfCheckoutDeliveryDTO extends EntityDTOReferenceContainer{ data?: CheckoutDeliveryDTO; } diff --git a/generated/swagger/print-api/src/models/entity-dtocontainer-of-checkout-dto.ts b/generated/swagger/print-api/src/models/entity-dtocontainer-of-checkout-dto.ts index ce76c1442..ddba176bb 100644 --- a/generated/swagger/print-api/src/models/entity-dtocontainer-of-checkout-dto.ts +++ b/generated/swagger/print-api/src/models/entity-dtocontainer-of-checkout-dto.ts @@ -1,6 +1,6 @@ /* tslint:disable */ import { EntityDTOReferenceContainer } from './entity-dtoreference-container'; import { CheckoutDTO } from './checkout-dto'; -export interface EntityDTOContainerOfCheckoutDTO extends EntityDTOReferenceContainer { +export interface EntityDTOContainerOfCheckoutDTO extends EntityDTOReferenceContainer{ data?: CheckoutDTO; } diff --git a/generated/swagger/print-api/src/models/entity-dtocontainer-of-checkout-item-dto.ts b/generated/swagger/print-api/src/models/entity-dtocontainer-of-checkout-item-dto.ts index 8696760e0..8ac3a6a3d 100644 --- a/generated/swagger/print-api/src/models/entity-dtocontainer-of-checkout-item-dto.ts +++ b/generated/swagger/print-api/src/models/entity-dtocontainer-of-checkout-item-dto.ts @@ -1,6 +1,6 @@ /* tslint:disable */ import { EntityDTOReferenceContainer } from './entity-dtoreference-container'; import { CheckoutItemDTO } from './checkout-item-dto'; -export interface EntityDTOContainerOfCheckoutItemDTO extends EntityDTOReferenceContainer { +export interface EntityDTOContainerOfCheckoutItemDTO extends EntityDTOReferenceContainer{ data?: CheckoutItemDTO; } diff --git a/generated/swagger/print-api/src/models/entity-dtocontainer-of-company-dto.ts b/generated/swagger/print-api/src/models/entity-dtocontainer-of-company-dto.ts index 7859ca372..d58656379 100644 --- a/generated/swagger/print-api/src/models/entity-dtocontainer-of-company-dto.ts +++ b/generated/swagger/print-api/src/models/entity-dtocontainer-of-company-dto.ts @@ -1,6 +1,6 @@ /* tslint:disable */ import { EntityDTOReferenceContainer } from './entity-dtoreference-container'; import { CompanyDTO } from './company-dto'; -export interface EntityDTOContainerOfCompanyDTO extends EntityDTOReferenceContainer { +export interface EntityDTOContainerOfCompanyDTO extends EntityDTOReferenceContainer{ data?: CompanyDTO; } diff --git a/generated/swagger/print-api/src/models/entity-dtocontainer-of-components-dto.ts b/generated/swagger/print-api/src/models/entity-dtocontainer-of-components-dto.ts index fd016e55d..69241e71d 100644 --- a/generated/swagger/print-api/src/models/entity-dtocontainer-of-components-dto.ts +++ b/generated/swagger/print-api/src/models/entity-dtocontainer-of-components-dto.ts @@ -1,6 +1,6 @@ /* tslint:disable */ import { EntityDTOReferenceContainer } from './entity-dtoreference-container'; import { ComponentsDTO } from './components-dto'; -export interface EntityDTOContainerOfComponentsDTO extends EntityDTOReferenceContainer { +export interface EntityDTOContainerOfComponentsDTO extends EntityDTOReferenceContainer{ data?: ComponentsDTO; } diff --git a/generated/swagger/print-api/src/models/entity-dtocontainer-of-contributor-dto.ts b/generated/swagger/print-api/src/models/entity-dtocontainer-of-contributor-dto.ts index 821efae4c..992958878 100644 --- a/generated/swagger/print-api/src/models/entity-dtocontainer-of-contributor-dto.ts +++ b/generated/swagger/print-api/src/models/entity-dtocontainer-of-contributor-dto.ts @@ -1,6 +1,6 @@ /* tslint:disable */ import { EntityDTOReferenceContainer } from './entity-dtoreference-container'; import { ContributorDTO } from './contributor-dto'; -export interface EntityDTOContainerOfContributorDTO extends EntityDTOReferenceContainer { +export interface EntityDTOContainerOfContributorDTO extends EntityDTOReferenceContainer{ data?: ContributorDTO; } diff --git a/generated/swagger/print-api/src/models/entity-dtocontainer-of-country-dto.ts b/generated/swagger/print-api/src/models/entity-dtocontainer-of-country-dto.ts index 429a44037..c8defc62c 100644 --- a/generated/swagger/print-api/src/models/entity-dtocontainer-of-country-dto.ts +++ b/generated/swagger/print-api/src/models/entity-dtocontainer-of-country-dto.ts @@ -1,6 +1,6 @@ /* tslint:disable */ import { EntityDTOReferenceContainer } from './entity-dtoreference-container'; import { CountryDTO } from './country-dto'; -export interface EntityDTOContainerOfCountryDTO extends EntityDTOReferenceContainer { +export interface EntityDTOContainerOfCountryDTO extends EntityDTOReferenceContainer{ data?: CountryDTO; } diff --git a/generated/swagger/print-api/src/models/entity-dtocontainer-of-coupon-dto.ts b/generated/swagger/print-api/src/models/entity-dtocontainer-of-coupon-dto.ts index f43dd50a6..5899a9df8 100644 --- a/generated/swagger/print-api/src/models/entity-dtocontainer-of-coupon-dto.ts +++ b/generated/swagger/print-api/src/models/entity-dtocontainer-of-coupon-dto.ts @@ -1,6 +1,6 @@ /* tslint:disable */ import { EntityDTOReferenceContainer } from './entity-dtoreference-container'; import { CouponDTO } from './coupon-dto'; -export interface EntityDTOContainerOfCouponDTO extends EntityDTOReferenceContainer { +export interface EntityDTOContainerOfCouponDTO extends EntityDTOReferenceContainer{ data?: CouponDTO; } diff --git a/generated/swagger/print-api/src/models/entity-dtocontainer-of-currency-dto.ts b/generated/swagger/print-api/src/models/entity-dtocontainer-of-currency-dto.ts index 594474df3..8c2f90657 100644 --- a/generated/swagger/print-api/src/models/entity-dtocontainer-of-currency-dto.ts +++ b/generated/swagger/print-api/src/models/entity-dtocontainer-of-currency-dto.ts @@ -1,6 +1,6 @@ /* tslint:disable */ import { EntityDTOReferenceContainer } from './entity-dtoreference-container'; import { CurrencyDTO } from './currency-dto'; -export interface EntityDTOContainerOfCurrencyDTO extends EntityDTOReferenceContainer { +export interface EntityDTOContainerOfCurrencyDTO extends EntityDTOReferenceContainer{ data?: CurrencyDTO; } diff --git a/generated/swagger/print-api/src/models/entity-dtocontainer-of-destination-dto.ts b/generated/swagger/print-api/src/models/entity-dtocontainer-of-destination-dto.ts index cdc1a1cdd..19d43533a 100644 --- a/generated/swagger/print-api/src/models/entity-dtocontainer-of-destination-dto.ts +++ b/generated/swagger/print-api/src/models/entity-dtocontainer-of-destination-dto.ts @@ -1,6 +1,6 @@ /* tslint:disable */ import { EntityDTOReferenceContainer } from './entity-dtoreference-container'; import { DestinationDTO } from './destination-dto'; -export interface EntityDTOContainerOfDestinationDTO extends EntityDTOReferenceContainer { +export interface EntityDTOContainerOfDestinationDTO extends EntityDTOReferenceContainer{ data?: DestinationDTO; } diff --git a/generated/swagger/print-api/src/models/entity-dtocontainer-of-file-dto.ts b/generated/swagger/print-api/src/models/entity-dtocontainer-of-file-dto.ts index 41358f4a1..6826f0c3b 100644 --- a/generated/swagger/print-api/src/models/entity-dtocontainer-of-file-dto.ts +++ b/generated/swagger/print-api/src/models/entity-dtocontainer-of-file-dto.ts @@ -1,6 +1,6 @@ /* tslint:disable */ import { EntityDTOReferenceContainer } from './entity-dtoreference-container'; import { FileDTO } from './file-dto'; -export interface EntityDTOContainerOfFileDTO extends EntityDTOReferenceContainer { +export interface EntityDTOContainerOfFileDTO extends EntityDTOReferenceContainer{ data?: FileDTO; } diff --git a/generated/swagger/print-api/src/models/entity-dtocontainer-of-item-dto.ts b/generated/swagger/print-api/src/models/entity-dtocontainer-of-item-dto.ts index db4721370..411493d19 100644 --- a/generated/swagger/print-api/src/models/entity-dtocontainer-of-item-dto.ts +++ b/generated/swagger/print-api/src/models/entity-dtocontainer-of-item-dto.ts @@ -1,6 +1,6 @@ /* tslint:disable */ import { EntityDTOReferenceContainer } from './entity-dtoreference-container'; import { ItemDTO2 } from './item-dto2'; -export interface EntityDTOContainerOfItemDTO extends EntityDTOReferenceContainer { +export interface EntityDTOContainerOfItemDTO extends EntityDTOReferenceContainer{ data?: ItemDTO2; } diff --git a/generated/swagger/print-api/src/models/entity-dtocontainer-of-label-dto.ts b/generated/swagger/print-api/src/models/entity-dtocontainer-of-label-dto.ts index ab1491f60..c23d14fd2 100644 --- a/generated/swagger/print-api/src/models/entity-dtocontainer-of-label-dto.ts +++ b/generated/swagger/print-api/src/models/entity-dtocontainer-of-label-dto.ts @@ -1,6 +1,6 @@ /* tslint:disable */ import { EntityDTOReferenceContainer } from './entity-dtoreference-container'; import { LabelDTO } from './label-dto'; -export interface EntityDTOContainerOfLabelDTO extends EntityDTOReferenceContainer { +export interface EntityDTOContainerOfLabelDTO extends EntityDTOReferenceContainer{ data?: LabelDTO; } diff --git a/generated/swagger/print-api/src/models/entity-dtocontainer-of-logistician-dto.ts b/generated/swagger/print-api/src/models/entity-dtocontainer-of-logistician-dto.ts index fabe23876..5e9e8c8f9 100644 --- a/generated/swagger/print-api/src/models/entity-dtocontainer-of-logistician-dto.ts +++ b/generated/swagger/print-api/src/models/entity-dtocontainer-of-logistician-dto.ts @@ -1,6 +1,6 @@ /* tslint:disable */ import { EntityDTOReferenceContainer } from './entity-dtoreference-container'; import { LogisticianDTO } from './logistician-dto'; -export interface EntityDTOContainerOfLogisticianDTO extends EntityDTOReferenceContainer { +export interface EntityDTOContainerOfLogisticianDTO extends EntityDTOReferenceContainer{ data?: LogisticianDTO; } diff --git a/generated/swagger/print-api/src/models/entity-dtocontainer-of-shop-dto.ts b/generated/swagger/print-api/src/models/entity-dtocontainer-of-shop-dto.ts index 3c72e63e4..61f596e28 100644 --- a/generated/swagger/print-api/src/models/entity-dtocontainer-of-shop-dto.ts +++ b/generated/swagger/print-api/src/models/entity-dtocontainer-of-shop-dto.ts @@ -1,6 +1,6 @@ /* tslint:disable */ import { EntityDTOReferenceContainer } from './entity-dtoreference-container'; import { ShopDTO2 } from './shop-dto2'; -export interface EntityDTOContainerOfShopDTO extends EntityDTOReferenceContainer { +export interface EntityDTOContainerOfShopDTO extends EntityDTOReferenceContainer{ data?: ShopDTO2; } diff --git a/generated/swagger/print-api/src/models/entity-dtocontainer-of-shop-item-dto.ts b/generated/swagger/print-api/src/models/entity-dtocontainer-of-shop-item-dto.ts index 7bd3fca15..e61dd6a68 100644 --- a/generated/swagger/print-api/src/models/entity-dtocontainer-of-shop-item-dto.ts +++ b/generated/swagger/print-api/src/models/entity-dtocontainer-of-shop-item-dto.ts @@ -1,6 +1,6 @@ /* tslint:disable */ import { EntityDTOReferenceContainer } from './entity-dtoreference-container'; import { ShopItemDTO } from './shop-item-dto'; -export interface EntityDTOContainerOfShopItemDTO extends EntityDTOReferenceContainer { +export interface EntityDTOContainerOfShopItemDTO extends EntityDTOReferenceContainer{ data?: ShopItemDTO; } diff --git a/generated/swagger/print-api/src/models/entity-dtocontainer-of-shopping-cart-item-dto.ts b/generated/swagger/print-api/src/models/entity-dtocontainer-of-shopping-cart-item-dto.ts index 7528e5b0c..c4797056a 100644 --- a/generated/swagger/print-api/src/models/entity-dtocontainer-of-shopping-cart-item-dto.ts +++ b/generated/swagger/print-api/src/models/entity-dtocontainer-of-shopping-cart-item-dto.ts @@ -1,6 +1,6 @@ /* tslint:disable */ import { EntityDTOReferenceContainer } from './entity-dtoreference-container'; import { ShoppingCartItemDTO } from './shopping-cart-item-dto'; -export interface EntityDTOContainerOfShoppingCartItemDTO extends EntityDTOReferenceContainer { +export interface EntityDTOContainerOfShoppingCartItemDTO extends EntityDTOReferenceContainer{ data?: ShoppingCartItemDTO; } diff --git a/generated/swagger/print-api/src/models/entity-dtocontainer-of-supplier-dto.ts b/generated/swagger/print-api/src/models/entity-dtocontainer-of-supplier-dto.ts index 7b13ce858..171228c3f 100644 --- a/generated/swagger/print-api/src/models/entity-dtocontainer-of-supplier-dto.ts +++ b/generated/swagger/print-api/src/models/entity-dtocontainer-of-supplier-dto.ts @@ -1,6 +1,6 @@ /* tslint:disable */ import { EntityDTOReferenceContainer } from './entity-dtoreference-container'; import { SupplierDTO } from './supplier-dto'; -export interface EntityDTOContainerOfSupplierDTO extends EntityDTOReferenceContainer { +export interface EntityDTOContainerOfSupplierDTO extends EntityDTOReferenceContainer{ data?: SupplierDTO; } diff --git a/generated/swagger/print-api/src/models/entity-dtocontainer-of-tenant-dto.ts b/generated/swagger/print-api/src/models/entity-dtocontainer-of-tenant-dto.ts index fb92ec5f4..834a8e1c7 100644 --- a/generated/swagger/print-api/src/models/entity-dtocontainer-of-tenant-dto.ts +++ b/generated/swagger/print-api/src/models/entity-dtocontainer-of-tenant-dto.ts @@ -1,6 +1,6 @@ /* tslint:disable */ import { EntityDTOReferenceContainer } from './entity-dtoreference-container'; import { TenantDTO } from './tenant-dto'; -export interface EntityDTOContainerOfTenantDTO extends EntityDTOReferenceContainer { +export interface EntityDTOContainerOfTenantDTO extends EntityDTOReferenceContainer{ data?: TenantDTO; } diff --git a/generated/swagger/print-api/src/models/entity-dtocontainer-of-text-dto.ts b/generated/swagger/print-api/src/models/entity-dtocontainer-of-text-dto.ts index a0d986392..4f50497ba 100644 --- a/generated/swagger/print-api/src/models/entity-dtocontainer-of-text-dto.ts +++ b/generated/swagger/print-api/src/models/entity-dtocontainer-of-text-dto.ts @@ -1,6 +1,6 @@ /* tslint:disable */ import { EntityDTOReferenceContainer } from './entity-dtoreference-container'; import { TextDTO2 } from './text-dto2'; -export interface EntityDTOContainerOfTextDTO extends EntityDTOReferenceContainer { +export interface EntityDTOContainerOfTextDTO extends EntityDTOReferenceContainer{ data?: TextDTO2; } diff --git a/generated/swagger/print-api/src/models/entity-dtocontainer-of-voucher-dto.ts b/generated/swagger/print-api/src/models/entity-dtocontainer-of-voucher-dto.ts index 614ed673d..1112f77d9 100644 --- a/generated/swagger/print-api/src/models/entity-dtocontainer-of-voucher-dto.ts +++ b/generated/swagger/print-api/src/models/entity-dtocontainer-of-voucher-dto.ts @@ -1,6 +1,6 @@ /* tslint:disable */ import { EntityDTOReferenceContainer } from './entity-dtoreference-container'; import { VoucherDTO } from './voucher-dto'; -export interface EntityDTOContainerOfVoucherDTO extends EntityDTOReferenceContainer { +export interface EntityDTOContainerOfVoucherDTO extends EntityDTOReferenceContainer{ data?: VoucherDTO; } diff --git a/generated/swagger/print-api/src/models/entity-dtoof-category-dtoand-icategory.ts b/generated/swagger/print-api/src/models/entity-dtoof-category-dtoand-icategory.ts deleted file mode 100644 index 588555cd8..000000000 --- a/generated/swagger/print-api/src/models/entity-dtoof-category-dtoand-icategory.ts +++ /dev/null @@ -1,3 +0,0 @@ -/* tslint:disable */ -import { ReadOnlyEntityDTOOfCategoryDTOAndICategory } from './read-only-entity-dtoof-category-dtoand-icategory'; -export interface EntityDTOOfCategoryDTOAndICategory extends ReadOnlyEntityDTOOfCategoryDTOAndICategory {} diff --git a/generated/swagger/print-api/src/models/entity-dtoof-company-dtoand-icompany.ts b/generated/swagger/print-api/src/models/entity-dtoof-company-dtoand-icompany.ts deleted file mode 100644 index b3dc6c7ec..000000000 --- a/generated/swagger/print-api/src/models/entity-dtoof-company-dtoand-icompany.ts +++ /dev/null @@ -1,3 +0,0 @@ -/* tslint:disable */ -import { ReadOnlyEntityDTOOfCompanyDTOAndICompany } from './read-only-entity-dtoof-company-dtoand-icompany'; -export interface EntityDTOOfCompanyDTOAndICompany extends ReadOnlyEntityDTOOfCompanyDTOAndICompany {} diff --git a/generated/swagger/print-api/src/models/entity-dtoof-components-dtoand-icomponents.ts b/generated/swagger/print-api/src/models/entity-dtoof-components-dtoand-icomponents.ts deleted file mode 100644 index e77d8319b..000000000 --- a/generated/swagger/print-api/src/models/entity-dtoof-components-dtoand-icomponents.ts +++ /dev/null @@ -1,3 +0,0 @@ -/* tslint:disable */ -import { ReadOnlyEntityDTOOfComponentsDTOAndIComponents } from './read-only-entity-dtoof-components-dtoand-icomponents'; -export interface EntityDTOOfComponentsDTOAndIComponents extends ReadOnlyEntityDTOOfComponentsDTOAndIComponents {} diff --git a/generated/swagger/print-api/src/models/entity-dtoof-contributor-dtoand-icontributor.ts b/generated/swagger/print-api/src/models/entity-dtoof-contributor-dtoand-icontributor.ts deleted file mode 100644 index 2aeb0e24d..000000000 --- a/generated/swagger/print-api/src/models/entity-dtoof-contributor-dtoand-icontributor.ts +++ /dev/null @@ -1,3 +0,0 @@ -/* tslint:disable */ -import { ReadOnlyEntityDTOOfContributorDTOAndIContributor } from './read-only-entity-dtoof-contributor-dtoand-icontributor'; -export interface EntityDTOOfContributorDTOAndIContributor extends ReadOnlyEntityDTOOfContributorDTOAndIContributor {} diff --git a/generated/swagger/print-api/src/models/entity-dtoof-currency-dtoand-icurrency.ts b/generated/swagger/print-api/src/models/entity-dtoof-currency-dtoand-icurrency.ts deleted file mode 100644 index 161fa926c..000000000 --- a/generated/swagger/print-api/src/models/entity-dtoof-currency-dtoand-icurrency.ts +++ /dev/null @@ -1,3 +0,0 @@ -/* tslint:disable */ -import { ReadOnlyEntityDTOOfCurrencyDTOAndICurrency } from './read-only-entity-dtoof-currency-dtoand-icurrency'; -export interface EntityDTOOfCurrencyDTOAndICurrency extends ReadOnlyEntityDTOOfCurrencyDTOAndICurrency {} diff --git a/generated/swagger/print-api/src/models/entity-dtoof-destination-dtoand-idestination.ts b/generated/swagger/print-api/src/models/entity-dtoof-destination-dtoand-idestination.ts deleted file mode 100644 index ef3445af4..000000000 --- a/generated/swagger/print-api/src/models/entity-dtoof-destination-dtoand-idestination.ts +++ /dev/null @@ -1,3 +0,0 @@ -/* tslint:disable */ -import { ReadOnlyEntityDTOOfDestinationDTOAndIDestination } from './read-only-entity-dtoof-destination-dtoand-idestination'; -export interface EntityDTOOfDestinationDTOAndIDestination extends ReadOnlyEntityDTOOfDestinationDTOAndIDestination {} diff --git a/generated/swagger/print-api/src/models/entity-dtoof-file-dtoand-ifile.ts b/generated/swagger/print-api/src/models/entity-dtoof-file-dtoand-ifile.ts deleted file mode 100644 index 3adbc0e4a..000000000 --- a/generated/swagger/print-api/src/models/entity-dtoof-file-dtoand-ifile.ts +++ /dev/null @@ -1,3 +0,0 @@ -/* tslint:disable */ -import { ReadOnlyEntityDTOOfFileDTOAndIFile } from './read-only-entity-dtoof-file-dtoand-ifile'; -export interface EntityDTOOfFileDTOAndIFile extends ReadOnlyEntityDTOOfFileDTOAndIFile {} diff --git a/generated/swagger/print-api/src/models/entity-dtoof-item-dtoand-iitem.ts b/generated/swagger/print-api/src/models/entity-dtoof-item-dtoand-iitem.ts deleted file mode 100644 index 5688dd4bd..000000000 --- a/generated/swagger/print-api/src/models/entity-dtoof-item-dtoand-iitem.ts +++ /dev/null @@ -1,3 +0,0 @@ -/* tslint:disable */ -import { ReadOnlyEntityDTOOfItemDTOAndIItem } from './read-only-entity-dtoof-item-dtoand-iitem'; -export interface EntityDTOOfItemDTOAndIItem extends ReadOnlyEntityDTOOfItemDTOAndIItem {} diff --git a/generated/swagger/print-api/src/models/entity-dtoof-logistician-dtoand-ilogistician.ts b/generated/swagger/print-api/src/models/entity-dtoof-logistician-dtoand-ilogistician.ts deleted file mode 100644 index 38789321b..000000000 --- a/generated/swagger/print-api/src/models/entity-dtoof-logistician-dtoand-ilogistician.ts +++ /dev/null @@ -1,3 +0,0 @@ -/* tslint:disable */ -import { ReadOnlyEntityDTOOfLogisticianDTOAndILogistician } from './read-only-entity-dtoof-logistician-dtoand-ilogistician'; -export interface EntityDTOOfLogisticianDTOAndILogistician extends ReadOnlyEntityDTOOfLogisticianDTOAndILogistician {} diff --git a/generated/swagger/print-api/src/models/entity-dtoof-shop-dtoand-ishop.ts b/generated/swagger/print-api/src/models/entity-dtoof-shop-dtoand-ishop.ts deleted file mode 100644 index 8b4a43582..000000000 --- a/generated/swagger/print-api/src/models/entity-dtoof-shop-dtoand-ishop.ts +++ /dev/null @@ -1,3 +0,0 @@ -/* tslint:disable */ -import { ReadOnlyEntityDTOOfShopDTOAndIShop } from './read-only-entity-dtoof-shop-dtoand-ishop'; -export interface EntityDTOOfShopDTOAndIShop extends ReadOnlyEntityDTOOfShopDTOAndIShop {} diff --git a/generated/swagger/print-api/src/models/entity-dtoof-supplier-dtoand-isupplier.ts b/generated/swagger/print-api/src/models/entity-dtoof-supplier-dtoand-isupplier.ts deleted file mode 100644 index d28acda58..000000000 --- a/generated/swagger/print-api/src/models/entity-dtoof-supplier-dtoand-isupplier.ts +++ /dev/null @@ -1,3 +0,0 @@ -/* tslint:disable */ -import { ReadOnlyEntityDTOOfSupplierDTOAndISupplier } from './read-only-entity-dtoof-supplier-dtoand-isupplier'; -export interface EntityDTOOfSupplierDTOAndISupplier extends ReadOnlyEntityDTOOfSupplierDTOAndISupplier {} diff --git a/generated/swagger/print-api/src/models/entity-dtoof-text-dtoand-itext.ts b/generated/swagger/print-api/src/models/entity-dtoof-text-dtoand-itext.ts deleted file mode 100644 index 4f0f88231..000000000 --- a/generated/swagger/print-api/src/models/entity-dtoof-text-dtoand-itext.ts +++ /dev/null @@ -1,3 +0,0 @@ -/* tslint:disable */ -import { ReadOnlyEntityDTOOfTextDTOAndIText } from './read-only-entity-dtoof-text-dtoand-itext'; -export interface EntityDTOOfTextDTOAndIText extends ReadOnlyEntityDTOOfTextDTOAndIText {} diff --git a/generated/swagger/print-api/src/models/entity-dtoreference-container.ts b/generated/swagger/print-api/src/models/entity-dtoreference-container.ts index 176c5f762..2676a61db 100644 --- a/generated/swagger/print-api/src/models/entity-dtoreference-container.ts +++ b/generated/swagger/print-api/src/models/entity-dtoreference-container.ts @@ -1,11 +1,12 @@ /* tslint:disable */ import { TouchedBase } from './touched-base'; import { ExternalReferenceDTO } from './external-reference-dto'; -export interface EntityDTOReferenceContainer extends TouchedBase { +export interface EntityDTOReferenceContainer extends TouchedBase{ displayLabel?: string; enabled?: boolean; externalReference?: ExternalReferenceDTO; id?: number; pId?: string; selected?: boolean; + uId?: string; } diff --git a/generated/swagger/print-api/src/models/entity-reference-dto.ts b/generated/swagger/print-api/src/models/entity-reference-dto.ts index c7063c27e..cd4536d58 100644 --- a/generated/swagger/print-api/src/models/entity-reference-dto.ts +++ b/generated/swagger/print-api/src/models/entity-reference-dto.ts @@ -1,7 +1,7 @@ /* tslint:disable */ import { TouchedBase } from './touched-base'; import { EntityDTOReferenceContainer } from './entity-dtoreference-container'; -export interface EntityReferenceDTO extends TouchedBase { +export interface EntityReferenceDTO extends TouchedBase{ pId?: string; reference?: EntityDTOReferenceContainer; source?: number; diff --git a/generated/swagger/print-api/src/models/entity-status.ts b/generated/swagger/print-api/src/models/entity-status.ts index aac647bbb..f9e83fb45 100644 --- a/generated/swagger/print-api/src/models/entity-status.ts +++ b/generated/swagger/print-api/src/models/entity-status.ts @@ -1,2 +1,2 @@ /* tslint:disable */ -export type EntityStatus = 0 | 1 | 2 | 4 | 8; +export type EntityStatus = 0 | 1 | 2 | 4 | 8; \ No newline at end of file diff --git a/generated/swagger/print-api/src/models/environment-channel.ts b/generated/swagger/print-api/src/models/environment-channel.ts index 75d8cdbe1..9aba77111 100644 --- a/generated/swagger/print-api/src/models/environment-channel.ts +++ b/generated/swagger/print-api/src/models/environment-channel.ts @@ -1,2 +1,2 @@ /* tslint:disable */ -export type EnvironmentChannel = 0 | 1 | 2 | 4 | 8 | 16 | 32; +export type EnvironmentChannel = 0 | 1 | 2 | 4 | 8 | 16 | 32; \ No newline at end of file diff --git a/generated/swagger/print-api/src/models/external-reference-dto.ts b/generated/swagger/print-api/src/models/external-reference-dto.ts index 3225cd158..703821aed 100644 --- a/generated/swagger/print-api/src/models/external-reference-dto.ts +++ b/generated/swagger/print-api/src/models/external-reference-dto.ts @@ -1,7 +1,7 @@ /* tslint:disable */ import { TouchedBase } from './touched-base'; import { EntityStatus } from './entity-status'; -export interface ExternalReferenceDTO extends TouchedBase { +export interface ExternalReferenceDTO extends TouchedBase{ externalChanged?: string; externalCreated?: string; externalNumber?: string; diff --git a/generated/swagger/print-api/src/models/file-dto.ts b/generated/swagger/print-api/src/models/file-dto.ts index a21fc6995..cd330ac30 100644 --- a/generated/swagger/print-api/src/models/file-dto.ts +++ b/generated/swagger/print-api/src/models/file-dto.ts @@ -1,6 +1,6 @@ /* tslint:disable */ -import { EntityDTOOfFileDTOAndIFile } from './entity-dtoof-file-dtoand-ifile'; -export interface FileDTO extends EntityDTOOfFileDTOAndIFile { +import { EntityDTOBaseOfFileDTOAndIFile } from './entity-dtobase-of-file-dtoand-ifile'; +export interface FileDTO extends EntityDTOBaseOfFileDTOAndIFile{ copyright?: string; hash?: string; license?: string; diff --git a/generated/swagger/print-api/src/models/food-dto.ts b/generated/swagger/print-api/src/models/food-dto.ts index d272cbf8e..909d5359a 100644 --- a/generated/swagger/print-api/src/models/food-dto.ts +++ b/generated/swagger/print-api/src/models/food-dto.ts @@ -1,15 +1,16 @@ /* tslint:disable */ +import { TouchedBase } from './touched-base'; import { AllergeneType } from './allergene-type'; import { DeclarableFoodAdditives } from './declarable-food-additives'; import { FoodLabel } from './food-label'; import { NutritionFactsDTO } from './nutrition-facts-dto'; -export interface FoodDTO { +export interface FoodDTO extends TouchedBase{ alcohol?: number; - allergenes: AllergeneType; + allergenes?: AllergeneType; allergenesDescription?: string; - declarableFoodAdditives: DeclarableFoodAdditives; - foodLabel: FoodLabel; - mayContainTracesOf: AllergeneType; + declarableFoodAdditives?: DeclarableFoodAdditives; + foodLabel?: FoodLabel; + mayContainTracesOf?: AllergeneType; mayContainTracesOfDescription?: string; nutritionFacts?: NutritionFactsDTO; } diff --git a/generated/swagger/print-api/src/models/food-label.ts b/generated/swagger/print-api/src/models/food-label.ts index 60532ccd2..8b7b8bd7e 100644 --- a/generated/swagger/print-api/src/models/food-label.ts +++ b/generated/swagger/print-api/src/models/food-label.ts @@ -1,2 +1,2 @@ /* tslint:disable */ -export type FoodLabel = 0 | 1 | 2 | 4 | 8 | 16 | 32 | 64 | 128 | 256 | 512 | 1024 | 3584 | 5632 | 8192 | 16384 | 32768 | 66048; +export type FoodLabel = 0 | 1 | 2 | 4 | 8 | 16 | 32 | 64 | 128 | 256 | 512 | 1024 | 3584 | 5632 | 8192 | 16384 | 32768 | 66048; \ No newline at end of file diff --git a/generated/swagger/print-api/src/models/gender.ts b/generated/swagger/print-api/src/models/gender.ts index 8a913f7d3..4b0f7be4b 100644 --- a/generated/swagger/print-api/src/models/gender.ts +++ b/generated/swagger/print-api/src/models/gender.ts @@ -1,2 +1,2 @@ /* tslint:disable */ -export type Gender = 0 | 1 | 2 | 4; +export type Gender = 0 | 1 | 2 | 4; \ No newline at end of file diff --git a/generated/swagger/print-api/src/models/geo-location.ts b/generated/swagger/print-api/src/models/geo-location.ts index de43fed14..5213750a5 100644 --- a/generated/swagger/print-api/src/models/geo-location.ts +++ b/generated/swagger/print-api/src/models/geo-location.ts @@ -1,6 +1,6 @@ /* tslint:disable */ import { TouchedBase } from './touched-base'; -export interface GeoLocation extends TouchedBase { +export interface GeoLocation extends TouchedBase{ altitude?: number; latitude?: number; longitude?: number; diff --git a/generated/swagger/print-api/src/models/image-dto.ts b/generated/swagger/print-api/src/models/image-dto.ts index c9adfbfb6..a78c3ff9f 100644 --- a/generated/swagger/print-api/src/models/image-dto.ts +++ b/generated/swagger/print-api/src/models/image-dto.ts @@ -4,6 +4,7 @@ * Bild */ export interface ImageDTO { + /** * Copyright */ diff --git a/generated/swagger/print-api/src/models/ipublic-user-info.ts b/generated/swagger/print-api/src/models/ipublic-user-info.ts deleted file mode 100644 index db73d102c..000000000 --- a/generated/swagger/print-api/src/models/ipublic-user-info.ts +++ /dev/null @@ -1,7 +0,0 @@ -/* tslint:disable */ -export interface IPublicUserInfo { - alias?: string; - displayName?: string; - isAuthenticated: boolean; - username?: string; -} diff --git a/generated/swagger/print-api/src/models/item-dto.ts b/generated/swagger/print-api/src/models/item-dto.ts index 9fbf132fa..ddb1cae1b 100644 --- a/generated/swagger/print-api/src/models/item-dto.ts +++ b/generated/swagger/print-api/src/models/item-dto.ts @@ -9,7 +9,8 @@ import { SpecDTO } from './spec-dto'; import { StockInfoDTO } from './stock-info-dto'; import { TextDTO } from './text-dto'; import { ItemType } from './item-type'; -export interface ItemDTO extends EntityDTO { +export interface ItemDTO extends EntityDTO{ + /** * Verfügbarkeit laut Katalog */ @@ -23,7 +24,7 @@ export interface ItemDTO extends EntityDTO { /** * Weitere Artikel-IDs */ - ids?: { [key: string]: number }; + ids?: {[key: string]: number}; /** * Images @@ -33,7 +34,7 @@ export interface ItemDTO extends EntityDTO { /** * Markierungen (Lesezeichen) wie (BOD, Prämie) */ - labels?: { [key: string]: string }; + labels?: {[key: string]: string}; /** * Produkt-Stammdaten diff --git a/generated/swagger/print-api/src/models/item-dto2.ts b/generated/swagger/print-api/src/models/item-dto2.ts index b4e68b6dd..274c91f80 100644 --- a/generated/swagger/print-api/src/models/item-dto2.ts +++ b/generated/swagger/print-api/src/models/item-dto2.ts @@ -1,5 +1,5 @@ /* tslint:disable */ -import { EntityDTOOfItemDTOAndIItem } from './entity-dtoof-item-dtoand-iitem'; +import { EntityDTOBaseOfItemDTOAndIItem } from './entity-dtobase-of-item-dtoand-iitem'; import { EntityDTOContainerOfComponentsDTO } from './entity-dtocontainer-of-components-dto'; import { EntityDTOContainerOfCategoryDTO } from './entity-dtocontainer-of-category-dto'; import { ContributorHelperDTO } from './contributor-helper-dto'; @@ -13,7 +13,7 @@ import { EntityDTOContainerOfItemDTO } from './entity-dtocontainer-of-item-dto'; import { SizeOfString } from './size-of-string'; import { EntityDTOContainerOfTenantDTO } from './entity-dtocontainer-of-tenant-dto'; import { EntityDTOContainerOfTextDTO } from './entity-dtocontainer-of-text-dto'; -export interface ItemDTO2 extends EntityDTOOfItemDTOAndIItem { +export interface ItemDTO2 extends EntityDTOBaseOfItemDTOAndIItem{ accessories?: EntityDTOContainerOfComponentsDTO; categories?: Array; contributors?: Array; @@ -23,8 +23,9 @@ export interface ItemDTO2 extends EntityDTOOfItemDTOAndIItem { files?: Array; food?: FoodDTO; format?: string; + formatDetail?: string; itemNumber?: string; - itemType: ItemType; + itemType?: ItemType; labels?: Array; manufacturer?: EntityDTOContainerOfCompanyDTO; manufacturingCosts?: number; @@ -40,6 +41,8 @@ export interface ItemDTO2 extends EntityDTOOfItemDTOAndIItem { subtitle?: string; tenant?: EntityDTOContainerOfTenantDTO; texts?: Array; + toxins?: string; + volume?: string; weight?: WeightOfAvoirdupois; weightOfPackaging?: WeightOfAvoirdupois; } diff --git a/generated/swagger/print-api/src/models/item-label-dto.ts b/generated/swagger/print-api/src/models/item-label-dto.ts index 9aee738ed..d68fd65e9 100644 --- a/generated/swagger/print-api/src/models/item-label-dto.ts +++ b/generated/swagger/print-api/src/models/item-label-dto.ts @@ -1,5 +1,6 @@ /* tslint:disable */ -export interface ItemLabelDTO { +import { TouchedBase } from './touched-base'; +export interface ItemLabelDTO extends TouchedBase{ cultureInfo?: string; labelType?: string; value?: string; diff --git a/generated/swagger/print-api/src/models/item-type.ts b/generated/swagger/print-api/src/models/item-type.ts index 2fb934165..5b96466ab 100644 --- a/generated/swagger/print-api/src/models/item-type.ts +++ b/generated/swagger/print-api/src/models/item-type.ts @@ -1,2 +1,2 @@ /* tslint:disable */ -export type ItemType = 0 | 1 | 2 | 4 | 8 | 16 | 32 | 64 | 128 | 256 | 512 | 1024 | 2048 | 4096 | 8192 | 16384 | 32768; +export type ItemType = 0 | 1 | 2 | 4 | 8 | 16 | 32 | 64 | 128 | 256 | 512 | 1024 | 2048 | 4096 | 8192 | 16384 | 32768 | 65536; \ No newline at end of file diff --git a/generated/swagger/print-api/src/models/key-value-dtoof-string-and-string.ts b/generated/swagger/print-api/src/models/key-value-dtoof-string-and-string.ts index 91f9f4d89..d64c861f2 100644 --- a/generated/swagger/print-api/src/models/key-value-dtoof-string-and-string.ts +++ b/generated/swagger/print-api/src/models/key-value-dtoof-string-and-string.ts @@ -3,6 +3,7 @@ export interface KeyValueDTOOfStringAndString { command?: string; description?: string; enabled?: boolean; + group?: string; key?: string; label?: string; selected?: boolean; diff --git a/generated/swagger/print-api/src/models/label-dto.ts b/generated/swagger/print-api/src/models/label-dto.ts index b70fba3b7..1e924a9a6 100644 --- a/generated/swagger/print-api/src/models/label-dto.ts +++ b/generated/swagger/print-api/src/models/label-dto.ts @@ -1,9 +1,6 @@ /* tslint:disable */ -import { ReadOnlyEntityDTOOfLabelDTOAndIReadOnlyLabel } from './read-only-entity-dtoof-label-dtoand-iread-only-label'; -import { EntityDTOContainerOfTenantDTO } from './entity-dtocontainer-of-tenant-dto'; -export interface LabelDTO extends ReadOnlyEntityDTOOfLabelDTOAndIReadOnlyLabel { - bitMask?: number; +import { EntityDTOBaseOfLabelDTOAndILabel } from './entity-dtobase-of-label-dtoand-ilabel'; +export interface LabelDTO extends EntityDTOBaseOfLabelDTOAndILabel{ key?: string; name?: string; - tenant?: EntityDTOContainerOfTenantDTO; } diff --git a/generated/swagger/print-api/src/models/linked-record-dto.ts b/generated/swagger/print-api/src/models/linked-record-dto.ts new file mode 100644 index 000000000..317e4bf21 --- /dev/null +++ b/generated/swagger/print-api/src/models/linked-record-dto.ts @@ -0,0 +1,7 @@ +/* tslint:disable */ +export interface LinkedRecordDTO { + isSource?: boolean; + number?: string; + pk?: string; + repository?: string; +} diff --git a/generated/swagger/print-api/src/models/list-response-args-of-key-value-dtoof-string-and-string.ts b/generated/swagger/print-api/src/models/list-response-args-of-key-value-dtoof-string-and-string.ts index c763a62bb..9528feadb 100644 --- a/generated/swagger/print-api/src/models/list-response-args-of-key-value-dtoof-string-and-string.ts +++ b/generated/swagger/print-api/src/models/list-response-args-of-key-value-dtoof-string-and-string.ts @@ -1,6 +1,6 @@ /* tslint:disable */ import { ResponseArgsOfIEnumerableOfKeyValueDTOOfStringAndString } from './response-args-of-ienumerable-of-key-value-dtoof-string-and-string'; -export interface ListResponseArgsOfKeyValueDTOOfStringAndString extends ResponseArgsOfIEnumerableOfKeyValueDTOOfStringAndString { +export interface ListResponseArgsOfKeyValueDTOOfStringAndString extends ResponseArgsOfIEnumerableOfKeyValueDTOOfStringAndString{ completed?: boolean; hits?: number; skip?: number; diff --git a/generated/swagger/print-api/src/models/logistician-dto.ts b/generated/swagger/print-api/src/models/logistician-dto.ts index 5342d134c..a01279fb5 100644 --- a/generated/swagger/print-api/src/models/logistician-dto.ts +++ b/generated/swagger/print-api/src/models/logistician-dto.ts @@ -1,6 +1,7 @@ /* tslint:disable */ -import { EntityDTOOfLogisticianDTOAndILogistician } from './entity-dtoof-logistician-dtoand-ilogistician'; -export interface LogisticianDTO extends EntityDTOOfLogisticianDTOAndILogistician { +import { EntityDTOBaseOfLogisticianDTOAndILogistician } from './entity-dtobase-of-logistician-dtoand-ilogistician'; +export interface LogisticianDTO extends EntityDTOBaseOfLogisticianDTOAndILogistician{ + gln?: string; logisticianNumber?: string; name?: string; } diff --git a/generated/swagger/print-api/src/models/notification-channel.ts b/generated/swagger/print-api/src/models/notification-channel.ts index e295d7034..c781a415c 100644 --- a/generated/swagger/print-api/src/models/notification-channel.ts +++ b/generated/swagger/print-api/src/models/notification-channel.ts @@ -1,2 +1,2 @@ /* tslint:disable */ -export type NotificationChannel = 0 | 1 | 2 | 4 | 8 | 16; +export type NotificationChannel = 0 | 1 | 2 | 4 | 8 | 16; \ No newline at end of file diff --git a/generated/swagger/print-api/src/models/nutrition-fact-dto.ts b/generated/swagger/print-api/src/models/nutrition-fact-dto.ts index 648e7e338..b13c71c01 100644 --- a/generated/swagger/print-api/src/models/nutrition-fact-dto.ts +++ b/generated/swagger/print-api/src/models/nutrition-fact-dto.ts @@ -1,9 +1,10 @@ /* tslint:disable */ +import { TouchedBase } from './touched-base'; import { NutritionFactType } from './nutrition-fact-type'; -export interface NutritionFactDTO { +export interface NutritionFactDTO extends TouchedBase{ kiloJoule?: number; label?: string; - nutritionFactType: NutritionFactType; + nutritionFactType?: NutritionFactType; percentageOfRDA?: number; quantity?: number; rdaQuantity?: number; diff --git a/generated/swagger/print-api/src/models/nutrition-fact-type.ts b/generated/swagger/print-api/src/models/nutrition-fact-type.ts index 15714ff62..666e9224b 100644 --- a/generated/swagger/print-api/src/models/nutrition-fact-type.ts +++ b/generated/swagger/print-api/src/models/nutrition-fact-type.ts @@ -1,63 +1,2 @@ /* tslint:disable */ -export type NutritionFactType = - | 0 - | 1 - | 2 - | 6 - | 10 - | 16 - | 48 - | 80 - | 144 - | 272 - | 512 - | 1024 - | 3072 - | 5120 - | 9216 - | 17408 - | 32768 - | 65536 - | 196608 - | 327680 - | 589824 - | 1114112 - | 2162688 - | 4259840 - | 8454144 - | 16842752 - | 33619968 - | 67174400 - | 134283264 - | 268435456 - | 805306368 - | 1342177280 - | 3489660928 - | 5637144576 - | 9932111872 - | 18522046464 - | 35701915648 - | 70061654016 - | 138781130752 - | 276220084224 - | 550024249344 - | 1099780063232 - | 2199291691008 - | 4398314946560 - | 8796093022208 - | 26388279066624 - | 43980465111040 - | 79164837199872 - | 149533581377536 - | 290271069732864 - | 571746046443520 - | 1134695999864832 - | 2260595906707456 - | 4512395720392704 - | 9015995347763200 - | 18023194602504190 - | 36037593111986180 - | 72066390130950140 - | 144123984168878080 - | 288239172244733950 - | 576469548396445700; +export type NutritionFactType = 0 | 1 | 2 | 6 | 10 | 16 | 48 | 80 | 144 | 272 | 512 | 1024 | 3072 | 5120 | 9216 | 17408 | 32768 | 65536 | 196608 | 327680 | 589824 | 1114112 | 2162688 | 4259840 | 8454144 | 16842752 | 33619968 | 67174400 | 134283264 | 268435456 | 805306368 | 1342177280 | 3489660928 | 5637144576 | 9932111872 | 18522046464 | 35701915648 | 70061654016 | 138781130752 | 276220084224 | 550024249344 | 1099780063232 | 2199291691008 | 4398314946560 | 8796093022208 | 26388279066624 | 43980465111040 | 79164837199872 | 149533581377536 | 290271069732864 | 571746046443520 | 1134695999864832 | 2260595906707456 | 4512395720392704 | 9015995347763200 | 18023194602504190 | 36037593111986180 | 72066390130950140 | 144123984168878080 | 288239172244733950 | 576469548396445700; \ No newline at end of file diff --git a/generated/swagger/print-api/src/models/nutrition-facts-dto.ts b/generated/swagger/print-api/src/models/nutrition-facts-dto.ts index c343ba98a..cfd21a55e 100644 --- a/generated/swagger/print-api/src/models/nutrition-facts-dto.ts +++ b/generated/swagger/print-api/src/models/nutrition-facts-dto.ts @@ -1,10 +1,11 @@ /* tslint:disable */ +import { TouchedBase } from './touched-base'; import { NutritionFactDTO } from './nutrition-fact-dto'; import { Rezeptmasz } from './rezeptmasz'; -export interface NutritionFactsDTO { +export interface NutritionFactsDTO extends TouchedBase{ items?: Array; kiloCalories?: number; kiloJoule?: number; referenceQuantity?: number; - referenceQuantityUnitType: Rezeptmasz; + referenceQuantityUnitType?: Rezeptmasz; } diff --git a/generated/swagger/print-api/src/models/order-item-processing-status-value.ts b/generated/swagger/print-api/src/models/order-item-processing-status-value.ts index 79a516028..e2a8f1ca5 100644 --- a/generated/swagger/print-api/src/models/order-item-processing-status-value.ts +++ b/generated/swagger/print-api/src/models/order-item-processing-status-value.ts @@ -1,32 +1,2 @@ /* tslint:disable */ -export type OrderItemProcessingStatusValue = - | 0 - | 1 - | 2 - | 4 - | 8 - | 16 - | 32 - | 64 - | 128 - | 256 - | 512 - | 1024 - | 2048 - | 4096 - | 8192 - | 16384 - | 32768 - | 65536 - | 131072 - | 262144 - | 524288 - | 1048576 - | 2097152 - | 4194304 - | 8388608 - | 16777216 - | 33554432 - | 67108864 - | 134217728 - | 268435456; +export type OrderItemProcessingStatusValue = 0 | 1 | 2 | 4 | 8 | 16 | 32 | 64 | 128 | 256 | 512 | 1024 | 2048 | 4096 | 8192 | 16384 | 32768 | 65536 | 131072 | 262144 | 524288 | 1048576 | 2097152 | 4194304 | 8388608 | 16777216 | 33554432 | 67108864 | 134217728 | 268435456; \ No newline at end of file diff --git a/generated/swagger/print-api/src/models/order-item-type.ts b/generated/swagger/print-api/src/models/order-item-type.ts index 7c5469839..ee6026e4d 100644 --- a/generated/swagger/print-api/src/models/order-item-type.ts +++ b/generated/swagger/print-api/src/models/order-item-type.ts @@ -1,2 +1,2 @@ /* tslint:disable */ -export type OrderItemType = 0 | 1 | 2 | 4 | 8 | 16 | 32 | 64; +export type OrderItemType = 0 | 1 | 2 | 4 | 8 | 16 | 32 | 64 | 256 | 512 | 1024; \ No newline at end of file diff --git a/generated/swagger/print-api/src/models/order-type.ts b/generated/swagger/print-api/src/models/order-type.ts index 44276a1a6..45a68d7f4 100644 --- a/generated/swagger/print-api/src/models/order-type.ts +++ b/generated/swagger/print-api/src/models/order-type.ts @@ -1,2 +1,2 @@ /* tslint:disable */ -export type OrderType = 0 | 1 | 2 | 4 | 5 | 6; +export type OrderType = 0 | 1 | 2 | 4 | 5 | 6; \ No newline at end of file diff --git a/generated/swagger/print-api/src/models/organisation-dto.ts b/generated/swagger/print-api/src/models/organisation-dto.ts index 24bc58335..18736cfa9 100644 --- a/generated/swagger/print-api/src/models/organisation-dto.ts +++ b/generated/swagger/print-api/src/models/organisation-dto.ts @@ -1,11 +1,8 @@ /* tslint:disable */ -export interface OrganisationDTO { +import { OrganisationNamesDTO } from './organisation-names-dto'; +export interface OrganisationDTO extends OrganisationNamesDTO{ costUnit?: string; - department?: string; gln?: string; - legalForm?: string; - name?: string; - nameSuffix?: string; sector?: string; vatId?: string; } diff --git a/generated/swagger/print-api/src/models/organisation-names-dto.ts b/generated/swagger/print-api/src/models/organisation-names-dto.ts index ffe315e05..b670e8853 100644 --- a/generated/swagger/print-api/src/models/organisation-names-dto.ts +++ b/generated/swagger/print-api/src/models/organisation-names-dto.ts @@ -1,5 +1,6 @@ /* tslint:disable */ -export interface OrganisationNamesDTO { +import { TouchedBase } from './touched-base'; +export interface OrganisationNamesDTO extends TouchedBase{ department?: string; legalForm?: string; name?: string; diff --git a/generated/swagger/print-api/src/models/paper-kind.ts b/generated/swagger/print-api/src/models/paper-kind.ts index 91d2dc5fa..87a5a045e 100644 --- a/generated/swagger/print-api/src/models/paper-kind.ts +++ b/generated/swagger/print-api/src/models/paper-kind.ts @@ -1,119 +1,2 @@ /* tslint:disable */ -export type PaperKind = - | 0 - | 1 - | 2 - | 3 - | 4 - | 5 - | 6 - | 7 - | 8 - | 9 - | 10 - | 11 - | 12 - | 13 - | 14 - | 15 - | 16 - | 17 - | 18 - | 19 - | 20 - | 21 - | 22 - | 23 - | 24 - | 25 - | 26 - | 27 - | 28 - | 29 - | 30 - | 31 - | 32 - | 33 - | 34 - | 35 - | 36 - | 37 - | 38 - | 39 - | 40 - | 41 - | 42 - | 43 - | 44 - | 45 - | 46 - | 47 - | 50 - | 51 - | 52 - | 53 - | 54 - | 55 - | 56 - | 57 - | 58 - | 59 - | 60 - | 61 - | 62 - | 63 - | 64 - | 65 - | 66 - | 67 - | 68 - | 69 - | 70 - | 71 - | 72 - | 73 - | 74 - | 75 - | 76 - | 77 - | 78 - | 79 - | 80 - | 81 - | 82 - | 83 - | 84 - | 85 - | 86 - | 87 - | 88 - | 89 - | 90 - | 91 - | 92 - | 93 - | 94 - | 95 - | 96 - | 97 - | 98 - | 99 - | 100 - | 101 - | 102 - | 103 - | 104 - | 105 - | 106 - | 107 - | 108 - | 109 - | 110 - | 111 - | 112 - | 113 - | 114 - | 115 - | 116 - | 117 - | 118; +export type PaperKind = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118; \ No newline at end of file diff --git a/generated/swagger/print-api/src/models/payer-dto.ts b/generated/swagger/print-api/src/models/payer-dto.ts index 093e9e63a..907ae5596 100644 --- a/generated/swagger/print-api/src/models/payer-dto.ts +++ b/generated/swagger/print-api/src/models/payer-dto.ts @@ -1,22 +1,9 @@ /* tslint:disable */ -import { EntityReferenceDTO } from './entity-reference-dto'; -import { AddressDTO } from './address-dto'; -import { CommunicationDetailsDTO } from './communication-details-dto'; -import { Gender } from './gender'; -import { OrganisationDTO } from './organisation-dto'; +import { AddresseeWithReferenceDTO } from './addressee-with-reference-dto'; import { PayerStatus } from './payer-status'; import { PayerType } from './payer-type'; -export interface PayerDTO extends EntityReferenceDTO { - address?: AddressDTO; - communicationDetails?: CommunicationDetailsDTO; - dateOfBirth?: string; - firstName?: string; - gender: Gender; - lastName?: string; - locale?: string; - organisation?: OrganisationDTO; +export interface PayerDTO extends AddresseeWithReferenceDTO{ payerNumber?: string; - payerStatus: PayerStatus; - payerType: PayerType; - title?: string; + payerStatus?: PayerStatus; + payerType?: PayerType; } diff --git a/generated/swagger/print-api/src/models/payer-status.ts b/generated/swagger/print-api/src/models/payer-status.ts index c8aa5bbdd..fffc57cb9 100644 --- a/generated/swagger/print-api/src/models/payer-status.ts +++ b/generated/swagger/print-api/src/models/payer-status.ts @@ -1,2 +1,2 @@ /* tslint:disable */ -export type PayerStatus = 0 | 1 | 2 | 4 | 8 | 16; +export type PayerStatus = 0 | 1 | 2 | 4 | 8 | 16; \ No newline at end of file diff --git a/generated/swagger/print-api/src/models/payer-type.ts b/generated/swagger/print-api/src/models/payer-type.ts index d794824a9..6c636d563 100644 --- a/generated/swagger/print-api/src/models/payer-type.ts +++ b/generated/swagger/print-api/src/models/payer-type.ts @@ -1,2 +1,2 @@ /* tslint:disable */ -export type PayerType = 0 | 4 | 8 | 16; +export type PayerType = 0 | 4 | 8 | 16; \ No newline at end of file diff --git a/generated/swagger/print-api/src/models/payment-type.ts b/generated/swagger/print-api/src/models/payment-type.ts index 0e75ff6a9..f639f5e33 100644 --- a/generated/swagger/print-api/src/models/payment-type.ts +++ b/generated/swagger/print-api/src/models/payment-type.ts @@ -1,2 +1,2 @@ /* tslint:disable */ -export type PaymentType = 0 | 1 | 2 | 4 | 8 | 16 | 32 | 64 | 128 | 256 | 512 | 1024 | 2048 | 4096 | 8192 | 16384 | 32768; +export type PaymentType = 0 | 1 | 2 | 4 | 8 | 16 | 32 | 64 | 128 | 256 | 512 | 1024 | 2048 | 4096 | 8192 | 16384 | 32768; \ No newline at end of file diff --git a/generated/swagger/print-api/src/models/person-names-dto.ts b/generated/swagger/print-api/src/models/person-names-dto.ts index 0bc8bb921..bcbaf7c41 100644 --- a/generated/swagger/print-api/src/models/person-names-dto.ts +++ b/generated/swagger/print-api/src/models/person-names-dto.ts @@ -1,8 +1,9 @@ /* tslint:disable */ +import { TouchedBase } from './touched-base'; import { Gender } from './gender'; -export interface PersonNamesDTO { - firstName?: string; - gender: Gender; - lastName?: string; - title?: string; +export interface PersonNamesDTO extends TouchedBase{ + firstName: string; + gender?: Gender; + lastName: string; + title: string; } diff --git a/generated/swagger/print-api/src/models/price-dto.ts b/generated/swagger/print-api/src/models/price-dto.ts index 4747903c6..bcea137fb 100644 --- a/generated/swagger/print-api/src/models/price-dto.ts +++ b/generated/swagger/print-api/src/models/price-dto.ts @@ -1,7 +1,8 @@ /* tslint:disable */ +import { TouchedBase } from './touched-base'; import { PriceValueDTO } from './price-value-dto'; import { VATValueDTO } from './vatvalue-dto'; -export interface PriceDTO { +export interface PriceDTO extends TouchedBase{ value?: PriceValueDTO; vat?: VATValueDTO; } diff --git a/generated/swagger/print-api/src/models/price-value-dto.ts b/generated/swagger/print-api/src/models/price-value-dto.ts index 9c74436ba..d73c2ad95 100644 --- a/generated/swagger/print-api/src/models/price-value-dto.ts +++ b/generated/swagger/print-api/src/models/price-value-dto.ts @@ -1,5 +1,6 @@ /* tslint:disable */ -export interface PriceValueDTO { +import { TouchedBase } from './touched-base'; +export interface PriceValueDTO extends TouchedBase{ currency?: string; currencySymbol?: string; value?: number; diff --git a/generated/swagger/print-api/src/models/print-request-of-ienumerable-of-display-order-dto.ts b/generated/swagger/print-api/src/models/print-request-of-ienumerable-of-display-order-dto.ts index 3bd17fb2d..c575bee6c 100644 --- a/generated/swagger/print-api/src/models/print-request-of-ienumerable-of-display-order-dto.ts +++ b/generated/swagger/print-api/src/models/print-request-of-ienumerable-of-display-order-dto.ts @@ -2,7 +2,8 @@ import { PrintRequest } from './print-request'; import { DisplayOrderDTO } from './display-order-dto'; import { PaperKind } from './paper-kind'; -export interface PrintRequestOfIEnumerableOfDisplayOrderDTO extends PrintRequest { +export interface PrintRequestOfIEnumerableOfDisplayOrderDTO extends PrintRequest{ + /** * Anzahl */ diff --git a/generated/swagger/print-api/src/models/print-request-of-ienumerable-of-item-dto.ts b/generated/swagger/print-api/src/models/print-request-of-ienumerable-of-item-dto.ts index 096236a25..6529a2c28 100644 --- a/generated/swagger/print-api/src/models/print-request-of-ienumerable-of-item-dto.ts +++ b/generated/swagger/print-api/src/models/print-request-of-ienumerable-of-item-dto.ts @@ -2,7 +2,8 @@ import { PrintRequest } from './print-request'; import { ItemDTO } from './item-dto'; import { PaperKind } from './paper-kind'; -export interface PrintRequestOfIEnumerableOfItemDTO extends PrintRequest { +export interface PrintRequestOfIEnumerableOfItemDTO extends PrintRequest{ + /** * Anzahl */ diff --git a/generated/swagger/print-api/src/models/print-request-of-ienumerable-of-long.ts b/generated/swagger/print-api/src/models/print-request-of-ienumerable-of-long.ts index f5fdaac10..185e50017 100644 --- a/generated/swagger/print-api/src/models/print-request-of-ienumerable-of-long.ts +++ b/generated/swagger/print-api/src/models/print-request-of-ienumerable-of-long.ts @@ -1,7 +1,8 @@ /* tslint:disable */ import { PrintRequest } from './print-request'; import { PaperKind } from './paper-kind'; -export interface PrintRequestOfIEnumerableOfLong extends PrintRequest { +export interface PrintRequestOfIEnumerableOfLong extends PrintRequest{ + /** * Anzahl */ diff --git a/generated/swagger/print-api/src/models/print-request-of-ienumerable-of-price-qrcode-dto.ts b/generated/swagger/print-api/src/models/print-request-of-ienumerable-of-price-qrcode-dto.ts index f692034b1..d5e9e5536 100644 --- a/generated/swagger/print-api/src/models/print-request-of-ienumerable-of-price-qrcode-dto.ts +++ b/generated/swagger/print-api/src/models/print-request-of-ienumerable-of-price-qrcode-dto.ts @@ -2,7 +2,8 @@ import { PrintRequest } from './print-request'; import { PriceQRCodeDTO } from './price-qrcode-dto'; import { PaperKind } from './paper-kind'; -export interface PrintRequestOfIEnumerableOfPriceQRCodeDTO extends PrintRequest { +export interface PrintRequestOfIEnumerableOfPriceQRCodeDTO extends PrintRequest{ + /** * Anzahl */ diff --git a/generated/swagger/print-api/src/models/print-request-of-ienumerable-of-shopping-cart-item-dto.ts b/generated/swagger/print-api/src/models/print-request-of-ienumerable-of-shopping-cart-item-dto.ts index 90332ea25..aa988cf95 100644 --- a/generated/swagger/print-api/src/models/print-request-of-ienumerable-of-shopping-cart-item-dto.ts +++ b/generated/swagger/print-api/src/models/print-request-of-ienumerable-of-shopping-cart-item-dto.ts @@ -2,7 +2,8 @@ import { PrintRequest } from './print-request'; import { ShoppingCartItemDTO } from './shopping-cart-item-dto'; import { PaperKind } from './paper-kind'; -export interface PrintRequestOfIEnumerableOfShoppingCartItemDTO extends PrintRequest { +export interface PrintRequestOfIEnumerableOfShoppingCartItemDTO extends PrintRequest{ + /** * Anzahl */ diff --git a/generated/swagger/print-api/src/models/print-request-of-long.ts b/generated/swagger/print-api/src/models/print-request-of-long.ts index b97a53e2f..11a15e302 100644 --- a/generated/swagger/print-api/src/models/print-request-of-long.ts +++ b/generated/swagger/print-api/src/models/print-request-of-long.ts @@ -1,7 +1,8 @@ /* tslint:disable */ import { PrintRequest } from './print-request'; import { PaperKind } from './paper-kind'; -export interface PrintRequestOfLong extends PrintRequest { +export interface PrintRequestOfLong extends PrintRequest{ + /** * Anzahl */ diff --git a/generated/swagger/print-api/src/models/print-request-of-string.ts b/generated/swagger/print-api/src/models/print-request-of-string.ts index 23b796807..46e28a846 100644 --- a/generated/swagger/print-api/src/models/print-request-of-string.ts +++ b/generated/swagger/print-api/src/models/print-request-of-string.ts @@ -1,7 +1,8 @@ /* tslint:disable */ import { PrintRequest } from './print-request'; import { PaperKind } from './paper-kind'; -export interface PrintRequestOfString extends PrintRequest { +export interface PrintRequestOfString extends PrintRequest{ + /** * Anzahl */ diff --git a/generated/swagger/print-api/src/models/print-request.ts b/generated/swagger/print-api/src/models/print-request.ts index 9eeb43e10..a06e6d85d 100644 --- a/generated/swagger/print-api/src/models/print-request.ts +++ b/generated/swagger/print-api/src/models/print-request.ts @@ -4,6 +4,7 @@ * PrintRequest */ export interface PrintRequest { + /** * Drucker */ diff --git a/generated/swagger/print-api/src/models/problem-details.ts b/generated/swagger/print-api/src/models/problem-details.ts index e8d39aec9..3145234d6 100644 --- a/generated/swagger/print-api/src/models/problem-details.ts +++ b/generated/swagger/print-api/src/models/problem-details.ts @@ -1,7 +1,7 @@ /* tslint:disable */ export interface ProblemDetails { detail?: string; - extensions: { [key: string]: any }; + extensions: {[key: string]: any}; instance?: string; status?: number; title?: string; diff --git a/generated/swagger/print-api/src/models/product-dto.ts b/generated/swagger/print-api/src/models/product-dto.ts index 8d5c51c3b..e2577c5d9 100644 --- a/generated/swagger/print-api/src/models/product-dto.ts +++ b/generated/swagger/print-api/src/models/product-dto.ts @@ -1,7 +1,8 @@ /* tslint:disable */ +import { TouchedBase } from './touched-base'; import { SizeOfString } from './size-of-string'; import { WeightOfAvoirdupois } from './weight-of-avoirdupois'; -export interface ProductDTO { +export interface ProductDTO extends TouchedBase{ additionalName?: string; catalogProductNumber?: string; contributors?: string; @@ -13,6 +14,7 @@ export interface ProductDTO { manufacturer?: string; name?: string; productGroup?: string; + productGroupDetails?: string; publicationDate?: string; serial?: string; size?: SizeOfString; diff --git a/generated/swagger/print-api/src/models/promotion-dto.ts b/generated/swagger/print-api/src/models/promotion-dto.ts index 6aaf0e8b7..20789ba70 100644 --- a/generated/swagger/print-api/src/models/promotion-dto.ts +++ b/generated/swagger/print-api/src/models/promotion-dto.ts @@ -1,5 +1,6 @@ /* tslint:disable */ -export interface PromotionDTO { +import { TouchedBase } from './touched-base'; +export interface PromotionDTO extends TouchedBase{ code?: string; label?: string; points?: number; diff --git a/generated/swagger/print-api/src/models/quantity-unit-type.ts b/generated/swagger/print-api/src/models/quantity-unit-type.ts index 70c99388a..941092b99 100644 --- a/generated/swagger/print-api/src/models/quantity-unit-type.ts +++ b/generated/swagger/print-api/src/models/quantity-unit-type.ts @@ -1,2 +1,2 @@ /* tslint:disable */ -export type QuantityUnitType = 0 | 1 | 2 | 4 | 8 | 16 | 32 | 64; +export type QuantityUnitType = 0 | 1 | 2 | 4 | 8 | 16 | 32 | 64 | 128 | 256; \ No newline at end of file diff --git a/generated/swagger/print-api/src/models/read-only-entity-dtoof-branch-dtoand-iread-only-branch.ts b/generated/swagger/print-api/src/models/read-only-entity-dtoof-branch-dtoand-iread-only-branch.ts deleted file mode 100644 index 775589069..000000000 --- a/generated/swagger/print-api/src/models/read-only-entity-dtoof-branch-dtoand-iread-only-branch.ts +++ /dev/null @@ -1,3 +0,0 @@ -/* tslint:disable */ -import { EntityDTO } from './entity-dto'; -export interface ReadOnlyEntityDTOOfBranchDTOAndIReadOnlyBranch extends EntityDTO {} diff --git a/generated/swagger/print-api/src/models/read-only-entity-dtoof-category-dtoand-icategory.ts b/generated/swagger/print-api/src/models/read-only-entity-dtoof-category-dtoand-icategory.ts deleted file mode 100644 index f1b7c13d9..000000000 --- a/generated/swagger/print-api/src/models/read-only-entity-dtoof-category-dtoand-icategory.ts +++ /dev/null @@ -1,3 +0,0 @@ -/* tslint:disable */ -import { EntityDTO } from './entity-dto'; -export interface ReadOnlyEntityDTOOfCategoryDTOAndICategory extends EntityDTO {} diff --git a/generated/swagger/print-api/src/models/read-only-entity-dtoof-checkout-delivery-dtoand-icheckout-delivery.ts b/generated/swagger/print-api/src/models/read-only-entity-dtoof-checkout-delivery-dtoand-icheckout-delivery.ts deleted file mode 100644 index f4ff3fbc2..000000000 --- a/generated/swagger/print-api/src/models/read-only-entity-dtoof-checkout-delivery-dtoand-icheckout-delivery.ts +++ /dev/null @@ -1,3 +0,0 @@ -/* tslint:disable */ -import { EntityDTO } from './entity-dto'; -export interface ReadOnlyEntityDTOOfCheckoutDeliveryDTOAndICheckoutDelivery extends EntityDTO {} diff --git a/generated/swagger/print-api/src/models/read-only-entity-dtoof-checkout-dtoand-icheckout.ts b/generated/swagger/print-api/src/models/read-only-entity-dtoof-checkout-dtoand-icheckout.ts deleted file mode 100644 index 0e4b1b257..000000000 --- a/generated/swagger/print-api/src/models/read-only-entity-dtoof-checkout-dtoand-icheckout.ts +++ /dev/null @@ -1,3 +0,0 @@ -/* tslint:disable */ -import { EntityDTO } from './entity-dto'; -export interface ReadOnlyEntityDTOOfCheckoutDTOAndICheckout extends EntityDTO {} diff --git a/generated/swagger/print-api/src/models/read-only-entity-dtoof-checkout-item-dtoand-icheckout-item.ts b/generated/swagger/print-api/src/models/read-only-entity-dtoof-checkout-item-dtoand-icheckout-item.ts deleted file mode 100644 index 57a22e2f0..000000000 --- a/generated/swagger/print-api/src/models/read-only-entity-dtoof-checkout-item-dtoand-icheckout-item.ts +++ /dev/null @@ -1,3 +0,0 @@ -/* tslint:disable */ -import { EntityDTO } from './entity-dto'; -export interface ReadOnlyEntityDTOOfCheckoutItemDTOAndICheckoutItem extends EntityDTO {} diff --git a/generated/swagger/print-api/src/models/read-only-entity-dtoof-company-dtoand-icompany.ts b/generated/swagger/print-api/src/models/read-only-entity-dtoof-company-dtoand-icompany.ts deleted file mode 100644 index 91c9571f4..000000000 --- a/generated/swagger/print-api/src/models/read-only-entity-dtoof-company-dtoand-icompany.ts +++ /dev/null @@ -1,3 +0,0 @@ -/* tslint:disable */ -import { EntityDTO } from './entity-dto'; -export interface ReadOnlyEntityDTOOfCompanyDTOAndICompany extends EntityDTO {} diff --git a/generated/swagger/print-api/src/models/read-only-entity-dtoof-components-dtoand-icomponents.ts b/generated/swagger/print-api/src/models/read-only-entity-dtoof-components-dtoand-icomponents.ts deleted file mode 100644 index 3b3d22156..000000000 --- a/generated/swagger/print-api/src/models/read-only-entity-dtoof-components-dtoand-icomponents.ts +++ /dev/null @@ -1,3 +0,0 @@ -/* tslint:disable */ -import { EntityDTO } from './entity-dto'; -export interface ReadOnlyEntityDTOOfComponentsDTOAndIComponents extends EntityDTO {} diff --git a/generated/swagger/print-api/src/models/read-only-entity-dtoof-contributor-dtoand-icontributor.ts b/generated/swagger/print-api/src/models/read-only-entity-dtoof-contributor-dtoand-icontributor.ts deleted file mode 100644 index aef405f49..000000000 --- a/generated/swagger/print-api/src/models/read-only-entity-dtoof-contributor-dtoand-icontributor.ts +++ /dev/null @@ -1,3 +0,0 @@ -/* tslint:disable */ -import { EntityDTO } from './entity-dto'; -export interface ReadOnlyEntityDTOOfContributorDTOAndIContributor extends EntityDTO {} diff --git a/generated/swagger/print-api/src/models/read-only-entity-dtoof-country-dtoand-iread-only-country.ts b/generated/swagger/print-api/src/models/read-only-entity-dtoof-country-dtoand-iread-only-country.ts deleted file mode 100644 index a7ad4b4bc..000000000 --- a/generated/swagger/print-api/src/models/read-only-entity-dtoof-country-dtoand-iread-only-country.ts +++ /dev/null @@ -1,3 +0,0 @@ -/* tslint:disable */ -import { EntityDTO } from './entity-dto'; -export interface ReadOnlyEntityDTOOfCountryDTOAndIReadOnlyCountry extends EntityDTO {} diff --git a/generated/swagger/print-api/src/models/read-only-entity-dtoof-coupon-dtoand-icoupon.ts b/generated/swagger/print-api/src/models/read-only-entity-dtoof-coupon-dtoand-icoupon.ts deleted file mode 100644 index 02ce08f76..000000000 --- a/generated/swagger/print-api/src/models/read-only-entity-dtoof-coupon-dtoand-icoupon.ts +++ /dev/null @@ -1,3 +0,0 @@ -/* tslint:disable */ -import { EntityDTO } from './entity-dto'; -export interface ReadOnlyEntityDTOOfCouponDTOAndICoupon extends EntityDTO {} diff --git a/generated/swagger/print-api/src/models/read-only-entity-dtoof-currency-dtoand-icurrency.ts b/generated/swagger/print-api/src/models/read-only-entity-dtoof-currency-dtoand-icurrency.ts deleted file mode 100644 index 9149988f9..000000000 --- a/generated/swagger/print-api/src/models/read-only-entity-dtoof-currency-dtoand-icurrency.ts +++ /dev/null @@ -1,3 +0,0 @@ -/* tslint:disable */ -import { EntityDTO } from './entity-dto'; -export interface ReadOnlyEntityDTOOfCurrencyDTOAndICurrency extends EntityDTO {} diff --git a/generated/swagger/print-api/src/models/read-only-entity-dtoof-destination-dtoand-idestination.ts b/generated/swagger/print-api/src/models/read-only-entity-dtoof-destination-dtoand-idestination.ts deleted file mode 100644 index 365436537..000000000 --- a/generated/swagger/print-api/src/models/read-only-entity-dtoof-destination-dtoand-idestination.ts +++ /dev/null @@ -1,3 +0,0 @@ -/* tslint:disable */ -import { EntityDTO } from './entity-dto'; -export interface ReadOnlyEntityDTOOfDestinationDTOAndIDestination extends EntityDTO {} diff --git a/generated/swagger/print-api/src/models/read-only-entity-dtoof-display-branch-dtoand-iread-only-branch.ts b/generated/swagger/print-api/src/models/read-only-entity-dtoof-display-branch-dtoand-iread-only-branch.ts deleted file mode 100644 index 178a7962c..000000000 --- a/generated/swagger/print-api/src/models/read-only-entity-dtoof-display-branch-dtoand-iread-only-branch.ts +++ /dev/null @@ -1,3 +0,0 @@ -/* tslint:disable */ -import { EntityDTO } from './entity-dto'; -export interface ReadOnlyEntityDTOOfDisplayBranchDTOAndIReadOnlyBranch extends EntityDTO {} diff --git a/generated/swagger/print-api/src/models/read-only-entity-dtoof-display-logistician-dtoand-ilogistician.ts b/generated/swagger/print-api/src/models/read-only-entity-dtoof-display-logistician-dtoand-ilogistician.ts deleted file mode 100644 index 841a65f0e..000000000 --- a/generated/swagger/print-api/src/models/read-only-entity-dtoof-display-logistician-dtoand-ilogistician.ts +++ /dev/null @@ -1,3 +0,0 @@ -/* tslint:disable */ -import { EntityDTO } from './entity-dto'; -export interface ReadOnlyEntityDTOOfDisplayLogisticianDTOAndILogistician extends EntityDTO {} diff --git a/generated/swagger/print-api/src/models/read-only-entity-dtoof-display-order-dtoand-iorder.ts b/generated/swagger/print-api/src/models/read-only-entity-dtoof-display-order-dtoand-iorder.ts deleted file mode 100644 index d69256002..000000000 --- a/generated/swagger/print-api/src/models/read-only-entity-dtoof-display-order-dtoand-iorder.ts +++ /dev/null @@ -1,3 +0,0 @@ -/* tslint:disable */ -import { EntityDTO } from './entity-dto'; -export interface ReadOnlyEntityDTOOfDisplayOrderDTOAndIOrder extends EntityDTO {} diff --git a/generated/swagger/print-api/src/models/read-only-entity-dtoof-display-order-item-dtoand-iorder-item.ts b/generated/swagger/print-api/src/models/read-only-entity-dtoof-display-order-item-dtoand-iorder-item.ts deleted file mode 100644 index 4cfd8da21..000000000 --- a/generated/swagger/print-api/src/models/read-only-entity-dtoof-display-order-item-dtoand-iorder-item.ts +++ /dev/null @@ -1,3 +0,0 @@ -/* tslint:disable */ -import { EntityDTO } from './entity-dto'; -export interface ReadOnlyEntityDTOOfDisplayOrderItemDTOAndIOrderItem extends EntityDTO {} diff --git a/generated/swagger/print-api/src/models/read-only-entity-dtoof-display-order-item-subset-dtoand-iorder-item-status.ts b/generated/swagger/print-api/src/models/read-only-entity-dtoof-display-order-item-subset-dtoand-iorder-item-status.ts deleted file mode 100644 index 1b54a2617..000000000 --- a/generated/swagger/print-api/src/models/read-only-entity-dtoof-display-order-item-subset-dtoand-iorder-item-status.ts +++ /dev/null @@ -1,3 +0,0 @@ -/* tslint:disable */ -import { EntityDTO } from './entity-dto'; -export interface ReadOnlyEntityDTOOfDisplayOrderItemSubsetDTOAndIOrderItemStatus extends EntityDTO {} diff --git a/generated/swagger/print-api/src/models/read-only-entity-dtoof-display-order-payment-dtoand-iread-only-payment.ts b/generated/swagger/print-api/src/models/read-only-entity-dtoof-display-order-payment-dtoand-iread-only-payment.ts deleted file mode 100644 index 474dc0675..000000000 --- a/generated/swagger/print-api/src/models/read-only-entity-dtoof-display-order-payment-dtoand-iread-only-payment.ts +++ /dev/null @@ -1,3 +0,0 @@ -/* tslint:disable */ -import { EntityDTO } from './entity-dto'; -export interface ReadOnlyEntityDTOOfDisplayOrderPaymentDTOAndIReadOnlyPayment extends EntityDTO {} diff --git a/generated/swagger/print-api/src/models/read-only-entity-dtoof-file-dtoand-ifile.ts b/generated/swagger/print-api/src/models/read-only-entity-dtoof-file-dtoand-ifile.ts deleted file mode 100644 index 9654297ae..000000000 --- a/generated/swagger/print-api/src/models/read-only-entity-dtoof-file-dtoand-ifile.ts +++ /dev/null @@ -1,3 +0,0 @@ -/* tslint:disable */ -import { EntityDTO } from './entity-dto'; -export interface ReadOnlyEntityDTOOfFileDTOAndIFile extends EntityDTO {} diff --git a/generated/swagger/print-api/src/models/read-only-entity-dtoof-item-dtoand-iitem.ts b/generated/swagger/print-api/src/models/read-only-entity-dtoof-item-dtoand-iitem.ts deleted file mode 100644 index bb64dce40..000000000 --- a/generated/swagger/print-api/src/models/read-only-entity-dtoof-item-dtoand-iitem.ts +++ /dev/null @@ -1,3 +0,0 @@ -/* tslint:disable */ -import { EntityDTO } from './entity-dto'; -export interface ReadOnlyEntityDTOOfItemDTOAndIItem extends EntityDTO {} diff --git a/generated/swagger/print-api/src/models/read-only-entity-dtoof-label-dtoand-iread-only-label.ts b/generated/swagger/print-api/src/models/read-only-entity-dtoof-label-dtoand-iread-only-label.ts deleted file mode 100644 index 22a714a5e..000000000 --- a/generated/swagger/print-api/src/models/read-only-entity-dtoof-label-dtoand-iread-only-label.ts +++ /dev/null @@ -1,3 +0,0 @@ -/* tslint:disable */ -import { EntityDTO } from './entity-dto'; -export interface ReadOnlyEntityDTOOfLabelDTOAndIReadOnlyLabel extends EntityDTO {} diff --git a/generated/swagger/print-api/src/models/read-only-entity-dtoof-logistician-dtoand-ilogistician.ts b/generated/swagger/print-api/src/models/read-only-entity-dtoof-logistician-dtoand-ilogistician.ts deleted file mode 100644 index d0b02e0b1..000000000 --- a/generated/swagger/print-api/src/models/read-only-entity-dtoof-logistician-dtoand-ilogistician.ts +++ /dev/null @@ -1,3 +0,0 @@ -/* tslint:disable */ -import { EntityDTO } from './entity-dto'; -export interface ReadOnlyEntityDTOOfLogisticianDTOAndILogistician extends EntityDTO {} diff --git a/generated/swagger/print-api/src/models/read-only-entity-dtoof-shop-dtoand-ishop.ts b/generated/swagger/print-api/src/models/read-only-entity-dtoof-shop-dtoand-ishop.ts deleted file mode 100644 index 44d5190b4..000000000 --- a/generated/swagger/print-api/src/models/read-only-entity-dtoof-shop-dtoand-ishop.ts +++ /dev/null @@ -1,3 +0,0 @@ -/* tslint:disable */ -import { EntityDTO } from './entity-dto'; -export interface ReadOnlyEntityDTOOfShopDTOAndIShop extends EntityDTO {} diff --git a/generated/swagger/print-api/src/models/read-only-entity-dtoof-shop-item-dtoand-ishop-item.ts b/generated/swagger/print-api/src/models/read-only-entity-dtoof-shop-item-dtoand-ishop-item.ts deleted file mode 100644 index a0154a185..000000000 --- a/generated/swagger/print-api/src/models/read-only-entity-dtoof-shop-item-dtoand-ishop-item.ts +++ /dev/null @@ -1,3 +0,0 @@ -/* tslint:disable */ -import { EntityDTO } from './entity-dto'; -export interface ReadOnlyEntityDTOOfShopItemDTOAndIShopItem extends EntityDTO {} diff --git a/generated/swagger/print-api/src/models/read-only-entity-dtoof-shopping-cart-item-dtoand-ishopping-cart-item.ts b/generated/swagger/print-api/src/models/read-only-entity-dtoof-shopping-cart-item-dtoand-ishopping-cart-item.ts deleted file mode 100644 index 04b8f925a..000000000 --- a/generated/swagger/print-api/src/models/read-only-entity-dtoof-shopping-cart-item-dtoand-ishopping-cart-item.ts +++ /dev/null @@ -1,3 +0,0 @@ -/* tslint:disable */ -import { EntityDTO } from './entity-dto'; -export interface ReadOnlyEntityDTOOfShoppingCartItemDTOAndIShoppingCartItem extends EntityDTO {} diff --git a/generated/swagger/print-api/src/models/read-only-entity-dtoof-supplier-dtoand-isupplier.ts b/generated/swagger/print-api/src/models/read-only-entity-dtoof-supplier-dtoand-isupplier.ts deleted file mode 100644 index aa65b0b49..000000000 --- a/generated/swagger/print-api/src/models/read-only-entity-dtoof-supplier-dtoand-isupplier.ts +++ /dev/null @@ -1,3 +0,0 @@ -/* tslint:disable */ -import { EntityDTO } from './entity-dto'; -export interface ReadOnlyEntityDTOOfSupplierDTOAndISupplier extends EntityDTO {} diff --git a/generated/swagger/print-api/src/models/read-only-entity-dtoof-tenant-dtoand-iread-only-tenant.ts b/generated/swagger/print-api/src/models/read-only-entity-dtoof-tenant-dtoand-iread-only-tenant.ts deleted file mode 100644 index f0ca36c88..000000000 --- a/generated/swagger/print-api/src/models/read-only-entity-dtoof-tenant-dtoand-iread-only-tenant.ts +++ /dev/null @@ -1,3 +0,0 @@ -/* tslint:disable */ -import { EntityDTO } from './entity-dto'; -export interface ReadOnlyEntityDTOOfTenantDTOAndIReadOnlyTenant extends EntityDTO {} diff --git a/generated/swagger/print-api/src/models/read-only-entity-dtoof-text-dtoand-itext.ts b/generated/swagger/print-api/src/models/read-only-entity-dtoof-text-dtoand-itext.ts deleted file mode 100644 index e71ebf14b..000000000 --- a/generated/swagger/print-api/src/models/read-only-entity-dtoof-text-dtoand-itext.ts +++ /dev/null @@ -1,3 +0,0 @@ -/* tslint:disable */ -import { EntityDTO } from './entity-dto'; -export interface ReadOnlyEntityDTOOfTextDTOAndIText extends EntityDTO {} diff --git a/generated/swagger/print-api/src/models/read-only-entity-dtoof-voucher-dtoand-iread-only-voucher.ts b/generated/swagger/print-api/src/models/read-only-entity-dtoof-voucher-dtoand-iread-only-voucher.ts deleted file mode 100644 index 50b05e417..000000000 --- a/generated/swagger/print-api/src/models/read-only-entity-dtoof-voucher-dtoand-iread-only-voucher.ts +++ /dev/null @@ -1,3 +0,0 @@ -/* tslint:disable */ -import { EntityDTO } from './entity-dto'; -export interface ReadOnlyEntityDTOOfVoucherDTOAndIReadOnlyVoucher extends EntityDTO {} diff --git a/generated/swagger/print-api/src/models/response-args-of-ienumerable-of-key-value-dtoof-string-and-string.ts b/generated/swagger/print-api/src/models/response-args-of-ienumerable-of-key-value-dtoof-string-and-string.ts index 15fbb9db8..889ff4ace 100644 --- a/generated/swagger/print-api/src/models/response-args-of-ienumerable-of-key-value-dtoof-string-and-string.ts +++ b/generated/swagger/print-api/src/models/response-args-of-ienumerable-of-key-value-dtoof-string-and-string.ts @@ -1,6 +1,6 @@ /* tslint:disable */ import { ResponseArgs } from './response-args'; import { KeyValueDTOOfStringAndString } from './key-value-dtoof-string-and-string'; -export interface ResponseArgsOfIEnumerableOfKeyValueDTOOfStringAndString extends ResponseArgs { +export interface ResponseArgsOfIEnumerableOfKeyValueDTOOfStringAndString extends ResponseArgs{ result?: Array; } diff --git a/generated/swagger/print-api/src/models/response-args-of-ienumerable-of-string.ts b/generated/swagger/print-api/src/models/response-args-of-ienumerable-of-string.ts index 595af6af9..5052347aa 100644 --- a/generated/swagger/print-api/src/models/response-args-of-ienumerable-of-string.ts +++ b/generated/swagger/print-api/src/models/response-args-of-ienumerable-of-string.ts @@ -1,5 +1,5 @@ /* tslint:disable */ import { ResponseArgs } from './response-args'; -export interface ResponseArgsOfIEnumerableOfString extends ResponseArgs { +export interface ResponseArgsOfIEnumerableOfString extends ResponseArgs{ result?: Array; } diff --git a/generated/swagger/print-api/src/models/response-args.ts b/generated/swagger/print-api/src/models/response-args.ts index 07b6a0eba..a5610bbbf 100644 --- a/generated/swagger/print-api/src/models/response-args.ts +++ b/generated/swagger/print-api/src/models/response-args.ts @@ -1,9 +1,9 @@ /* tslint:disable */ -import { IPublicUserInfo } from './ipublic-user-info'; +import { DialogOfString } from './dialog-of-string'; export interface ResponseArgs { + dialog?: DialogOfString; error: boolean; - invalidProperties?: { [key: string]: string }; + invalidProperties?: {[key: string]: string}; message?: string; requestId?: number; - userInfo?: IPublicUserInfo; } diff --git a/generated/swagger/print-api/src/models/review-dto.ts b/generated/swagger/print-api/src/models/review-dto.ts index ed9be93c4..1d84eab6f 100644 --- a/generated/swagger/print-api/src/models/review-dto.ts +++ b/generated/swagger/print-api/src/models/review-dto.ts @@ -1,5 +1,6 @@ /* tslint:disable */ export interface ReviewDTO { + /** * Autor */ diff --git a/generated/swagger/print-api/src/models/rezeptmasz.ts b/generated/swagger/print-api/src/models/rezeptmasz.ts index 4118eb3aa..86de134c7 100644 --- a/generated/swagger/print-api/src/models/rezeptmasz.ts +++ b/generated/swagger/print-api/src/models/rezeptmasz.ts @@ -1,34 +1,2 @@ /* tslint:disable */ -export type Rezeptmasz = - | 0 - | 1 - | 2 - | 3 - | 4 - | 5 - | 6 - | 7 - | 8 - | 9 - | 10 - | 11 - | 12 - | 13 - | 14 - | 15 - | 16 - | 17 - | 18 - | 19 - | 20 - | 21 - | 22 - | 23 - | 24 - | 25 - | 26 - | 27 - | 28 - | 29 - | 30 - | 31; +export type Rezeptmasz = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31; \ No newline at end of file diff --git a/generated/swagger/print-api/src/models/set-type.ts b/generated/swagger/print-api/src/models/set-type.ts index ff76c8a21..11ae5f399 100644 --- a/generated/swagger/print-api/src/models/set-type.ts +++ b/generated/swagger/print-api/src/models/set-type.ts @@ -1,2 +1,2 @@ /* tslint:disable */ -export type SetType = 0 | 1 | 2; +export type SetType = 0 | 1 | 2; \ No newline at end of file diff --git a/generated/swagger/print-api/src/models/shipping-address-dto.ts b/generated/swagger/print-api/src/models/shipping-address-dto.ts index d1b6a45fa..0c60b0a49 100644 --- a/generated/swagger/print-api/src/models/shipping-address-dto.ts +++ b/generated/swagger/print-api/src/models/shipping-address-dto.ts @@ -1,16 +1,4 @@ /* tslint:disable */ -import { EntityReferenceDTO } from './entity-reference-dto'; -import { AddressDTO } from './address-dto'; -import { CommunicationDetailsDTO } from './communication-details-dto'; -import { Gender } from './gender'; -import { OrganisationDTO } from './organisation-dto'; -export interface ShippingAddressDTO extends EntityReferenceDTO { - address?: AddressDTO; - communicationDetails?: CommunicationDetailsDTO; - firstName?: string; - gender: Gender; - lastName?: string; - locale?: string; - organisation?: OrganisationDTO; - title?: string; +import { AddresseeWithReferenceDTO } from './addressee-with-reference-dto'; +export interface ShippingAddressDTO extends AddresseeWithReferenceDTO{ } diff --git a/generated/swagger/print-api/src/models/shipping-dto.ts b/generated/swagger/print-api/src/models/shipping-dto.ts index 50f920c6d..c8f22c856 100644 --- a/generated/swagger/print-api/src/models/shipping-dto.ts +++ b/generated/swagger/print-api/src/models/shipping-dto.ts @@ -1,7 +1,8 @@ /* tslint:disable */ +import { TouchedBase } from './touched-base'; import { ShippingType } from './shipping-type'; import { TypeOfDelivery } from './type-of-delivery'; -export interface ShippingDTO { +export interface ShippingDTO extends TouchedBase{ postage?: number; shippingType?: ShippingType; shipsSeparatly?: boolean; diff --git a/generated/swagger/print-api/src/models/shipping-target.ts b/generated/swagger/print-api/src/models/shipping-target.ts index 01ab6bf7f..349e9cfee 100644 --- a/generated/swagger/print-api/src/models/shipping-target.ts +++ b/generated/swagger/print-api/src/models/shipping-target.ts @@ -1,2 +1,2 @@ /* tslint:disable */ -export type ShippingTarget = 0 | 1 | 2 | 4 | 8 | 16 | 32; +export type ShippingTarget = 0 | 1 | 2 | 4 | 8 | 16 | 32; \ No newline at end of file diff --git a/generated/swagger/print-api/src/models/shipping-type.ts b/generated/swagger/print-api/src/models/shipping-type.ts index b57df46e2..a10887b38 100644 --- a/generated/swagger/print-api/src/models/shipping-type.ts +++ b/generated/swagger/print-api/src/models/shipping-type.ts @@ -1,2 +1,2 @@ /* tslint:disable */ -export type ShippingType = 0 | 1 | 2 | 4 | 8 | 16 | 32 | 64 | 128; +export type ShippingType = 0 | 1 | 2 | 4 | 8 | 16 | 32 | 64 | 128; \ No newline at end of file diff --git a/generated/swagger/print-api/src/models/shop-dto.ts b/generated/swagger/print-api/src/models/shop-dto.ts index ccf363b50..c50816106 100644 --- a/generated/swagger/print-api/src/models/shop-dto.ts +++ b/generated/swagger/print-api/src/models/shop-dto.ts @@ -3,4 +3,5 @@ /** * Shop */ -export interface ShopDTO {} +export interface ShopDTO { +} diff --git a/generated/swagger/print-api/src/models/shop-dto2.ts b/generated/swagger/print-api/src/models/shop-dto2.ts index 121b39773..b70f92216 100644 --- a/generated/swagger/print-api/src/models/shop-dto2.ts +++ b/generated/swagger/print-api/src/models/shop-dto2.ts @@ -1,5 +1,5 @@ /* tslint:disable */ -import { EntityDTOOfShopDTOAndIShop } from './entity-dtoof-shop-dtoand-ishop'; +import { EntityDTOBaseOfShopDTOAndIShop } from './entity-dtobase-of-shop-dtoand-ishop'; import { EntityDTOContainerOfBranchDTO } from './entity-dtocontainer-of-branch-dto'; import { EntityDTOContainerOfCountryDTO } from './entity-dtocontainer-of-country-dto'; import { EntityDTOContainerOfCurrencyDTO } from './entity-dtocontainer-of-currency-dto'; @@ -8,7 +8,7 @@ import { PaymentType } from './payment-type'; import { ShippingTarget } from './shipping-target'; import { CountryTargetDTO } from './country-target-dto'; import { BranchTargetDTO } from './branch-target-dto'; -export interface ShopDTO2 extends EntityDTOOfShopDTOAndIShop { +export interface ShopDTO2 extends EntityDTOBaseOfShopDTOAndIShop{ branch?: EntityDTOContainerOfBranchDTO; defaultCountry?: EntityDTOContainerOfCountryDTO; defaultCurrency?: EntityDTOContainerOfCurrencyDTO; @@ -16,8 +16,8 @@ export interface ShopDTO2 extends EntityDTOOfShopDTOAndIShop { defaultLogistician?: EntityDTOContainerOfLogisticianDTO; defaultTargetBranch?: EntityDTOContainerOfBranchDTO; description?: string; - enabledPaymentTypes: PaymentType; - enabledShippingTargets: ShippingTarget; + enabledPaymentTypes?: PaymentType; + enabledShippingTargets?: ShippingTarget; name?: string; orderingEnabledStart?: string; orderingEnabledStop?: string; diff --git a/generated/swagger/print-api/src/models/shop-item-dto.ts b/generated/swagger/print-api/src/models/shop-item-dto.ts index fccb012d5..9c1feb35d 100644 --- a/generated/swagger/print-api/src/models/shop-item-dto.ts +++ b/generated/swagger/print-api/src/models/shop-item-dto.ts @@ -1,12 +1,12 @@ /* tslint:disable */ -import { ReadOnlyEntityDTOOfShopItemDTOAndIShopItem } from './read-only-entity-dtoof-shop-item-dtoand-ishop-item'; +import { EntityDTOBaseOfShopItemDTOAndIShopItem } from './entity-dtobase-of-shop-item-dtoand-ishop-item'; import { AvailabilityDTO2 } from './availability-dto2'; import { UrlDTO } from './url-dto'; import { ImageDTO2 } from './image-dto2'; import { EntityDTOContainerOfItemDTO } from './entity-dtocontainer-of-item-dto'; import { ItemType } from './item-type'; import { ShippingDTO } from './shipping-dto'; -export interface ShopItemDTO extends ReadOnlyEntityDTOOfShopItemDTOAndIShopItem { +export interface ShopItemDTO extends EntityDTOBaseOfShopItemDTOAndIShopItem{ availability?: AvailabilityDTO2; deepUrl?: UrlDTO; description?: string; diff --git a/generated/swagger/print-api/src/models/shopping-cart-item-dto.ts b/generated/swagger/print-api/src/models/shopping-cart-item-dto.ts index d4b317a51..fd4996d78 100644 --- a/generated/swagger/print-api/src/models/shopping-cart-item-dto.ts +++ b/generated/swagger/print-api/src/models/shopping-cart-item-dto.ts @@ -1,9 +1,10 @@ /* tslint:disable */ -import { ReadOnlyEntityDTOOfShoppingCartItemDTOAndIShoppingCartItem } from './read-only-entity-dtoof-shopping-cart-item-dtoand-ishopping-cart-item'; +import { EntityDTOBaseOfShoppingCartItemDTOAndIShoppingCartItem } from './entity-dtobase-of-shopping-cart-item-dtoand-ishopping-cart-item'; import { EntityDTOContainerOfShoppingCartItemDTO } from './entity-dtocontainer-of-shopping-cart-item-dto'; import { AvailabilityDTO2 } from './availability-dto2'; import { UrlDTO } from './url-dto'; import { EntityDTOContainerOfDestinationDTO } from './entity-dtocontainer-of-destination-dto'; +import { ItemType } from './item-type'; import { OrderItemType } from './order-item-type'; import { ProductDTO } from './product-dto'; import { PromotionDTO } from './promotion-dto'; @@ -11,7 +12,7 @@ import { EntityDTOContainerOfShopDTO } from './entity-dtocontainer-of-shop-dto'; import { EntityDTOContainerOfShopItemDTO } from './entity-dtocontainer-of-shop-item-dto'; import { ShoppingCartItemStatus } from './shopping-cart-item-status'; import { PriceDTO } from './price-dto'; -export interface ShoppingCartItemDTO extends ReadOnlyEntityDTOOfShoppingCartItemDTOAndIShoppingCartItem { +export interface ShoppingCartItemDTO extends EntityDTOBaseOfShoppingCartItemDTOAndIShoppingCartItem{ accessories?: Array; agentComment?: string; availability?: AvailabilityDTO2; @@ -21,16 +22,17 @@ export interface ShoppingCartItemDTO extends ReadOnlyEntityDTOOfShoppingCartItem deepUrl?: UrlDTO; destination?: EntityDTOContainerOfDestinationDTO; estimatedShippingDate?: string; - features?: { [key: string]: string }; + features?: {[key: string]: string}; + itemType?: ItemType; lastAvailabilityRequest?: string; - orderItemType: OrderItemType; + orderItemType?: OrderItemType; parent?: EntityDTOContainerOfShoppingCartItemDTO; product?: ProductDTO; promotion?: PromotionDTO; quantity?: number; shop?: EntityDTOContainerOfShopDTO; shopItem?: EntityDTOContainerOfShopItemDTO; - shoppingCartItemStatus: ShoppingCartItemStatus; + shoppingCartItemStatus?: ShoppingCartItemStatus; specialComment?: string; ssc?: string; sscText?: string; diff --git a/generated/swagger/print-api/src/models/shopping-cart-item-status.ts b/generated/swagger/print-api/src/models/shopping-cart-item-status.ts index c29af7d62..5138cc0a0 100644 --- a/generated/swagger/print-api/src/models/shopping-cart-item-status.ts +++ b/generated/swagger/print-api/src/models/shopping-cart-item-status.ts @@ -1,2 +1,2 @@ /* tslint:disable */ -export type ShoppingCartItemStatus = 0 | 1 | 2 | 4; +export type ShoppingCartItemStatus = 0 | 1 | 2 | 4; \ No newline at end of file diff --git a/generated/swagger/print-api/src/models/spec-dto.ts b/generated/swagger/print-api/src/models/spec-dto.ts index 5dd99fbad..b0ea0d0e2 100644 --- a/generated/swagger/print-api/src/models/spec-dto.ts +++ b/generated/swagger/print-api/src/models/spec-dto.ts @@ -4,6 +4,7 @@ * Eigenchaften */ export interface SpecDTO { + /** * PK */ diff --git a/generated/swagger/print-api/src/models/stock-info-dto.ts b/generated/swagger/print-api/src/models/stock-info-dto.ts index 3ae8e38c3..330123755 100644 --- a/generated/swagger/print-api/src/models/stock-info-dto.ts +++ b/generated/swagger/print-api/src/models/stock-info-dto.ts @@ -4,6 +4,7 @@ * Bestandsinformation */ export interface StockInfoDTO { + /** * Fach / Kammer */ diff --git a/generated/swagger/print-api/src/models/supplier-dto.ts b/generated/swagger/print-api/src/models/supplier-dto.ts index 75a8943eb..14b0890a5 100644 --- a/generated/swagger/print-api/src/models/supplier-dto.ts +++ b/generated/swagger/print-api/src/models/supplier-dto.ts @@ -1,7 +1,7 @@ /* tslint:disable */ -import { EntityDTOOfSupplierDTOAndISupplier } from './entity-dtoof-supplier-dtoand-isupplier'; +import { EntityDTOBaseOfSupplierDTOAndISupplier } from './entity-dtobase-of-supplier-dtoand-isupplier'; import { SupplierType } from './supplier-type'; -export interface SupplierDTO extends EntityDTOOfSupplierDTOAndISupplier { +export interface SupplierDTO extends EntityDTOBaseOfSupplierDTOAndISupplier{ key?: string; name?: string; supplierNumber?: string; diff --git a/generated/swagger/print-api/src/models/supplier-type.ts b/generated/swagger/print-api/src/models/supplier-type.ts index 6e49c0b3a..6ae98f93d 100644 --- a/generated/swagger/print-api/src/models/supplier-type.ts +++ b/generated/swagger/print-api/src/models/supplier-type.ts @@ -1,2 +1,2 @@ /* tslint:disable */ -export type SupplierType = 0 | 1 | 2 | 4; +export type SupplierType = 0 | 1 | 2 | 4; \ No newline at end of file diff --git a/generated/swagger/print-api/src/models/tenant-dto.ts b/generated/swagger/print-api/src/models/tenant-dto.ts index fa1d5249e..71dfd50fa 100644 --- a/generated/swagger/print-api/src/models/tenant-dto.ts +++ b/generated/swagger/print-api/src/models/tenant-dto.ts @@ -1,7 +1,6 @@ /* tslint:disable */ -import { ReadOnlyEntityDTOOfTenantDTOAndIReadOnlyTenant } from './read-only-entity-dtoof-tenant-dtoand-iread-only-tenant'; -export interface TenantDTO extends ReadOnlyEntityDTOOfTenantDTOAndIReadOnlyTenant { - bitMask?: number; +import { EntityDTOBaseOfTenantDTOAndITenant } from './entity-dtobase-of-tenant-dtoand-itenant'; +export interface TenantDTO extends EntityDTOBaseOfTenantDTOAndITenant{ key?: string; name?: string; } diff --git a/generated/swagger/print-api/src/models/terms-of-delivery-dto.ts b/generated/swagger/print-api/src/models/terms-of-delivery-dto.ts index a32784495..59ac87a66 100644 --- a/generated/swagger/print-api/src/models/terms-of-delivery-dto.ts +++ b/generated/swagger/print-api/src/models/terms-of-delivery-dto.ts @@ -1,13 +1,14 @@ /* tslint:disable */ +import { TouchedBase } from './touched-base'; import { PriceValueDTO } from './price-value-dto'; import { ShippingType } from './shipping-type'; import { TypeOfDelivery } from './type-of-delivery'; -export interface TermsOfDeliveryDTO { +export interface TermsOfDeliveryDTO extends TouchedBase{ isPartialShipping?: boolean; partialShippingCharge?: number; postage?: PriceValueDTO; shippingDeadlineEnd?: string; shippingDeadlineStart?: string; - shippingType: ShippingType; - typeOfDelivery: TypeOfDelivery; + shippingType?: ShippingType; + typeOfDelivery?: TypeOfDelivery; } diff --git a/generated/swagger/print-api/src/models/terms-of-delivery-dto2.ts b/generated/swagger/print-api/src/models/terms-of-delivery-dto2.ts deleted file mode 100644 index 78c378f30..000000000 --- a/generated/swagger/print-api/src/models/terms-of-delivery-dto2.ts +++ /dev/null @@ -1,12 +0,0 @@ -/* tslint:disable */ -import { ShippingType } from './shipping-type'; -import { TypeOfDelivery } from './type-of-delivery'; -export interface TermsOfDeliveryDTO2 { - isPartialShipping?: boolean; - partialShippingCharge?: number; - postage?: number; - shippingDeadlineEnd?: string; - shippingDeadlineStart?: string; - shippingType?: ShippingType; - typeOfDelivery?: TypeOfDelivery; -} diff --git a/generated/swagger/print-api/src/models/text-dto.ts b/generated/swagger/print-api/src/models/text-dto.ts index 6ebb066be..ea09de7aa 100644 --- a/generated/swagger/print-api/src/models/text-dto.ts +++ b/generated/swagger/print-api/src/models/text-dto.ts @@ -1,5 +1,6 @@ /* tslint:disable */ export interface TextDTO { + /** * PK */ diff --git a/generated/swagger/print-api/src/models/text-dto2.ts b/generated/swagger/print-api/src/models/text-dto2.ts index f6c0fe0d2..bdf386504 100644 --- a/generated/swagger/print-api/src/models/text-dto2.ts +++ b/generated/swagger/print-api/src/models/text-dto2.ts @@ -1,7 +1,7 @@ /* tslint:disable */ -import { EntityDTOOfTextDTOAndIText } from './entity-dtoof-text-dtoand-itext'; +import { EntityDTOBaseOfTextDTOAndIText } from './entity-dtobase-of-text-dtoand-itext'; import { EntityDTOContainerOfTenantDTO } from './entity-dtocontainer-of-tenant-dto'; -export interface TextDTO2 extends EntityDTOOfTextDTOAndIText { +export interface TextDTO2 extends EntityDTOBaseOfTextDTOAndIText{ content?: string; copyright?: string; cultureInfo?: string; diff --git a/generated/swagger/print-api/src/models/touched-base.ts b/generated/swagger/print-api/src/models/touched-base.ts index 15e213656..1075419bc 100644 --- a/generated/swagger/print-api/src/models/touched-base.ts +++ b/generated/swagger/print-api/src/models/touched-base.ts @@ -1,2 +1,3 @@ /* tslint:disable */ -export interface TouchedBase {} +export interface TouchedBase { +} diff --git a/generated/swagger/print-api/src/models/type-of-delivery.ts b/generated/swagger/print-api/src/models/type-of-delivery.ts index 2ef953e41..ec7f68900 100644 --- a/generated/swagger/print-api/src/models/type-of-delivery.ts +++ b/generated/swagger/print-api/src/models/type-of-delivery.ts @@ -1,2 +1,2 @@ /* tslint:disable */ -export type TypeOfDelivery = 0 | 1 | 2 | 4 | 8 | 16 | 32 | 64; +export type TypeOfDelivery = 0 | 1 | 2 | 4 | 8 | 16 | 32 | 64; \ No newline at end of file diff --git a/generated/swagger/print-api/src/models/url-dto.ts b/generated/swagger/print-api/src/models/url-dto.ts index 24d7303cc..b73167f2f 100644 --- a/generated/swagger/print-api/src/models/url-dto.ts +++ b/generated/swagger/print-api/src/models/url-dto.ts @@ -1,5 +1,6 @@ /* tslint:disable */ -export interface UrlDTO { +import { TouchedBase } from './touched-base'; +export interface UrlDTO extends TouchedBase{ nofollow?: boolean; target?: string; title?: string; diff --git a/generated/swagger/print-api/src/models/user-account-dto.ts b/generated/swagger/print-api/src/models/user-account-dto.ts index 8b19dca37..cbf9529c7 100644 --- a/generated/swagger/print-api/src/models/user-account-dto.ts +++ b/generated/swagger/print-api/src/models/user-account-dto.ts @@ -1,6 +1,7 @@ /* tslint:disable */ +import { TouchedBase } from './touched-base'; import { Gender } from './gender'; -export interface UserAccountDTO { +export interface UserAccountDTO extends TouchedBase{ alias?: string; dateOfBirth?: string; email?: string; diff --git a/generated/swagger/print-api/src/models/vattype.ts b/generated/swagger/print-api/src/models/vattype.ts index 6a3ff9c2c..4e163a39a 100644 --- a/generated/swagger/print-api/src/models/vattype.ts +++ b/generated/swagger/print-api/src/models/vattype.ts @@ -1,2 +1,2 @@ /* tslint:disable */ -export type VATType = 0 | 1 | 2 | 4 | 8 | 16 | 32 | 64 | 128; +export type VATType = 0 | 1 | 2 | 4 | 8 | 16 | 32 | 64 | 128; \ No newline at end of file diff --git a/generated/swagger/print-api/src/models/vatvalue-dto.ts b/generated/swagger/print-api/src/models/vatvalue-dto.ts index 295376a6b..a43a25e00 100644 --- a/generated/swagger/print-api/src/models/vatvalue-dto.ts +++ b/generated/swagger/print-api/src/models/vatvalue-dto.ts @@ -1,6 +1,7 @@ /* tslint:disable */ +import { TouchedBase } from './touched-base'; import { VATType } from './vattype'; -export interface VATValueDTO { +export interface VATValueDTO extends TouchedBase{ inPercent?: number; label?: string; value?: number; diff --git a/generated/swagger/print-api/src/models/voucher-dto.ts b/generated/swagger/print-api/src/models/voucher-dto.ts index 08fa351c9..c6f3c97b5 100644 --- a/generated/swagger/print-api/src/models/voucher-dto.ts +++ b/generated/swagger/print-api/src/models/voucher-dto.ts @@ -1,7 +1,7 @@ /* tslint:disable */ -import { ReadOnlyEntityDTOOfVoucherDTOAndIReadOnlyVoucher } from './read-only-entity-dtoof-voucher-dtoand-iread-only-voucher'; +import { EntityDTOBaseOfVoucherDTOAndIVoucher } from './entity-dtobase-of-voucher-dtoand-ivoucher'; import { PriceValueDTO } from './price-value-dto'; -export interface VoucherDTO extends ReadOnlyEntityDTOOfVoucherDTOAndIReadOnlyVoucher { +export interface VoucherDTO extends EntityDTOBaseOfVoucherDTOAndIVoucher{ description?: string; name?: string; value?: PriceValueDTO; diff --git a/generated/swagger/print-api/src/services/catalog-print.service.ts b/generated/swagger/print-api/src/services/catalog-print.service.ts index 8a7f88ad1..6e1879513 100644 --- a/generated/swagger/print-api/src/services/catalog-print.service.ts +++ b/generated/swagger/print-api/src/services/catalog-print.service.ts @@ -16,7 +16,10 @@ class CatalogPrintService extends __BaseService { static readonly CatalogPrintArtikelDetailPath = '/print/article/detail'; static readonly CatalogPrintArtikelListePath = '/print/article/list'; - constructor(config: __Configuration, http: HttpClient) { + constructor( + config: __Configuration, + http: HttpClient + ) { super(config, http); } @@ -29,17 +32,21 @@ class CatalogPrintService extends __BaseService { let __headers = new HttpHeaders(); let __body: any = null; __body = data; - let req = new HttpRequest('POST', this.rootUrl + `/print/article/detail`, __body, { - headers: __headers, - params: __params, - responseType: 'json', - }); + let req = new HttpRequest( + 'POST', + this.rootUrl + `/print/article/detail`, + __body, + { + headers: __headers, + params: __params, + responseType: 'json' + }); return this.http.request(req).pipe( - __filter((_r) => _r instanceof HttpResponse), + __filter(_r => _r instanceof HttpResponse), __map((_r) => { return _r as __StrictHttpResponse; - }), + }) ); } /** @@ -47,7 +54,9 @@ class CatalogPrintService extends __BaseService { * @param data Artikel */ CatalogPrintArtikelDetail(data: PrintRequestOfIEnumerableOfItemDTO): __Observable { - return this.CatalogPrintArtikelDetailResponse(data).pipe(__map((_r) => _r.body as ResponseArgs)); + return this.CatalogPrintArtikelDetailResponse(data).pipe( + __map(_r => _r.body as ResponseArgs) + ); } /** @@ -59,17 +68,21 @@ class CatalogPrintService extends __BaseService { let __headers = new HttpHeaders(); let __body: any = null; __body = data; - let req = new HttpRequest('POST', this.rootUrl + `/print/article/list`, __body, { - headers: __headers, - params: __params, - responseType: 'json', - }); + let req = new HttpRequest( + 'POST', + this.rootUrl + `/print/article/list`, + __body, + { + headers: __headers, + params: __params, + responseType: 'json' + }); return this.http.request(req).pipe( - __filter((_r) => _r instanceof HttpResponse), + __filter(_r => _r instanceof HttpResponse), __map((_r) => { return _r as __StrictHttpResponse; - }), + }) ); } /** @@ -77,10 +90,13 @@ class CatalogPrintService extends __BaseService { * @param data Artikel */ CatalogPrintArtikelListe(data: PrintRequestOfIEnumerableOfItemDTO): __Observable { - return this.CatalogPrintArtikelListeResponse(data).pipe(__map((_r) => _r.body as ResponseArgs)); + return this.CatalogPrintArtikelListeResponse(data).pipe( + __map(_r => _r.body as ResponseArgs) + ); } } -module CatalogPrintService {} +module CatalogPrintService { +} -export { CatalogPrintService }; +export { CatalogPrintService } diff --git a/generated/swagger/print-api/src/services/checkout-print.service.ts b/generated/swagger/print-api/src/services/checkout-print.service.ts index 2f48d0f90..457fa5c37 100644 --- a/generated/swagger/print-api/src/services/checkout-print.service.ts +++ b/generated/swagger/print-api/src/services/checkout-print.service.ts @@ -17,7 +17,10 @@ class CheckoutPrintService extends __BaseService { static readonly CheckoutPrintWarenkorbByIdPath = '/print/cart'; static readonly CheckoutPrintWarenkorbPath = '/print/cart/data'; - constructor(config: __Configuration, http: HttpClient) { + constructor( + config: __Configuration, + http: HttpClient + ) { super(config, http); } @@ -30,17 +33,21 @@ class CheckoutPrintService extends __BaseService { let __headers = new HttpHeaders(); let __body: any = null; __body = data; - let req = new HttpRequest('POST', this.rootUrl + `/print/cart`, __body, { - headers: __headers, - params: __params, - responseType: 'json', - }); + let req = new HttpRequest( + 'POST', + this.rootUrl + `/print/cart`, + __body, + { + headers: __headers, + params: __params, + responseType: 'json' + }); return this.http.request(req).pipe( - __filter((_r) => _r instanceof HttpResponse), + __filter(_r => _r instanceof HttpResponse), __map((_r) => { return _r as __StrictHttpResponse; - }), + }) ); } /** @@ -48,7 +55,9 @@ class CheckoutPrintService extends __BaseService { * @param data Warenkorb PK */ CheckoutPrintWarenkorbById(data: PrintRequestOfLong): __Observable { - return this.CheckoutPrintWarenkorbByIdResponse(data).pipe(__map((_r) => _r.body as ResponseArgs)); + return this.CheckoutPrintWarenkorbByIdResponse(data).pipe( + __map(_r => _r.body as ResponseArgs) + ); } /** @@ -60,17 +69,21 @@ class CheckoutPrintService extends __BaseService { let __headers = new HttpHeaders(); let __body: any = null; __body = data; - let req = new HttpRequest('POST', this.rootUrl + `/print/cart/data`, __body, { - headers: __headers, - params: __params, - responseType: 'json', - }); + let req = new HttpRequest( + 'POST', + this.rootUrl + `/print/cart/data`, + __body, + { + headers: __headers, + params: __params, + responseType: 'json' + }); return this.http.request(req).pipe( - __filter((_r) => _r instanceof HttpResponse), + __filter(_r => _r instanceof HttpResponse), __map((_r) => { return _r as __StrictHttpResponse; - }), + }) ); } /** @@ -78,10 +91,13 @@ class CheckoutPrintService extends __BaseService { * @param data Warenkorbpositionen */ CheckoutPrintWarenkorb(data: PrintRequestOfIEnumerableOfShoppingCartItemDTO): __Observable { - return this.CheckoutPrintWarenkorbResponse(data).pipe(__map((_r) => _r.body as ResponseArgs)); + return this.CheckoutPrintWarenkorbResponse(data).pipe( + __map(_r => _r.body as ResponseArgs) + ); } } -module CheckoutPrintService {} +module CheckoutPrintService { +} -export { CheckoutPrintService }; +export { CheckoutPrintService } diff --git a/generated/swagger/print-api/src/services/inventory-print.service.ts b/generated/swagger/print-api/src/services/inventory-print.service.ts index 5c54ea226..20a486572 100644 --- a/generated/swagger/print-api/src/services/inventory-print.service.ts +++ b/generated/swagger/print-api/src/services/inventory-print.service.ts @@ -17,7 +17,10 @@ class InventoryPrintService extends __BaseService { static readonly InventoryPrintWarenbegleitscheinePath = '/print/warenbegleitscheine'; static readonly InventoryPrintPrintReturnGroupPath = '/print/returngroup'; - constructor(config: __Configuration, http: HttpClient) { + constructor( + config: __Configuration, + http: HttpClient + ) { super(config, http); } @@ -30,17 +33,21 @@ class InventoryPrintService extends __BaseService { let __headers = new HttpHeaders(); let __body: any = null; __body = data; - let req = new HttpRequest('POST', this.rootUrl + `/print/warenbegleitscheine`, __body, { - headers: __headers, - params: __params, - responseType: 'json', - }); + let req = new HttpRequest( + 'POST', + this.rootUrl + `/print/warenbegleitscheine`, + __body, + { + headers: __headers, + params: __params, + responseType: 'json' + }); return this.http.request(req).pipe( - __filter((_r) => _r instanceof HttpResponse), + __filter(_r => _r instanceof HttpResponse), __map((_r) => { return _r as __StrictHttpResponse; - }), + }) ); } /** @@ -48,7 +55,9 @@ class InventoryPrintService extends __BaseService { * @param data Remission PK */ InventoryPrintWarenbegleitscheine(data: PrintRequestOfLong): __Observable { - return this.InventoryPrintWarenbegleitscheineResponse(data).pipe(__map((_r) => _r.body as ResponseArgs)); + return this.InventoryPrintWarenbegleitscheineResponse(data).pipe( + __map(_r => _r.body as ResponseArgs) + ); } /** @@ -60,17 +69,21 @@ class InventoryPrintService extends __BaseService { let __headers = new HttpHeaders(); let __body: any = null; __body = data; - let req = new HttpRequest('POST', this.rootUrl + `/print/returngroup`, __body, { - headers: __headers, - params: __params, - responseType: 'json', - }); + let req = new HttpRequest( + 'POST', + this.rootUrl + `/print/returngroup`, + __body, + { + headers: __headers, + params: __params, + responseType: 'json' + }); return this.http.request(req).pipe( - __filter((_r) => _r instanceof HttpResponse), + __filter(_r => _r instanceof HttpResponse), __map((_r) => { return _r as __StrictHttpResponse; - }), + }) ); } /** @@ -78,10 +91,13 @@ class InventoryPrintService extends __BaseService { * @param data Remissionsgruppe */ InventoryPrintPrintReturnGroup(data: PrintRequestOfString): __Observable { - return this.InventoryPrintPrintReturnGroupResponse(data).pipe(__map((_r) => _r.body as ResponseArgs)); + return this.InventoryPrintPrintReturnGroupResponse(data).pipe( + __map(_r => _r.body as ResponseArgs) + ); } } -module InventoryPrintService {} +module InventoryPrintService { +} -export { InventoryPrintService }; +export { InventoryPrintService } diff --git a/generated/swagger/print-api/src/services/loyalty-card-print.service.ts b/generated/swagger/print-api/src/services/loyalty-card-print.service.ts index ce42672d9..ef3e99e69 100644 --- a/generated/swagger/print-api/src/services/loyalty-card-print.service.ts +++ b/generated/swagger/print-api/src/services/loyalty-card-print.service.ts @@ -15,7 +15,10 @@ import { PrintRequestOfString } from '../models/print-request-of-string'; class LoyaltyCardPrintService extends __BaseService { static readonly LoyaltyCardPrintPrintLoyaltyCardAGBPath = '/print/loyaltycard/agb'; - constructor(config: __Configuration, http: HttpClient) { + constructor( + config: __Configuration, + http: HttpClient + ) { super(config, http); } @@ -28,17 +31,21 @@ class LoyaltyCardPrintService extends __BaseService { let __headers = new HttpHeaders(); let __body: any = null; __body = data; - let req = new HttpRequest('POST', this.rootUrl + `/print/loyaltycard/agb`, __body, { - headers: __headers, - params: __params, - responseType: 'json', - }); + let req = new HttpRequest( + 'POST', + this.rootUrl + `/print/loyaltycard/agb`, + __body, + { + headers: __headers, + params: __params, + responseType: 'json' + }); return this.http.request(req).pipe( - __filter((_r) => _r instanceof HttpResponse), + __filter(_r => _r instanceof HttpResponse), __map((_r) => { return _r as __StrictHttpResponse; - }), + }) ); } /** @@ -46,10 +53,13 @@ class LoyaltyCardPrintService extends __BaseService { * @param data Artikel */ LoyaltyCardPrintPrintLoyaltyCardAGB(data: PrintRequestOfString): __Observable { - return this.LoyaltyCardPrintPrintLoyaltyCardAGBResponse(data).pipe(__map((_r) => _r.body as ResponseArgs)); + return this.LoyaltyCardPrintPrintLoyaltyCardAGBResponse(data).pipe( + __map(_r => _r.body as ResponseArgs) + ); } } -module LoyaltyCardPrintService {} +module LoyaltyCardPrintService { +} -export { LoyaltyCardPrintService }; +export { LoyaltyCardPrintService } diff --git a/generated/swagger/print-api/src/services/omsprint.service.ts b/generated/swagger/print-api/src/services/omsprint.service.ts index 001e5a811..a7c57a092 100644 --- a/generated/swagger/print-api/src/services/omsprint.service.ts +++ b/generated/swagger/print-api/src/services/omsprint.service.ts @@ -22,10 +22,14 @@ class OMSPrintService extends __BaseService { static readonly OMSPrintPriceQRCodePath = '/print/priceqrcode'; static readonly OMSPrintPriceQRCodeDirectPath = '/print-direct/priceqrcode'; static readonly OMSPrintLieferscheinPath = '/print/lieferschein'; + static readonly OMSPrintReturnReceiptPath = '/print/return-receipt'; static readonly OMSPrintKleinbetragsrechnungPath = '/print/kleinbetragsrechnung'; static readonly OMSPrintKleinbetragsrechnungPdfPath = '/print/kleinbetragsrechnung/{receiptId}/pdf'; - constructor(config: __Configuration, http: HttpClient) { + constructor( + config: __Configuration, + http: HttpClient + ) { super(config, http); } @@ -38,17 +42,21 @@ class OMSPrintService extends __BaseService { let __headers = new HttpHeaders(); let __body: any = null; __body = data; - let req = new HttpRequest('POST', this.rootUrl + `/print/abholschein`, __body, { - headers: __headers, - params: __params, - responseType: 'json', - }); + let req = new HttpRequest( + 'POST', + this.rootUrl + `/print/abholschein`, + __body, + { + headers: __headers, + params: __params, + responseType: 'json' + }); return this.http.request(req).pipe( - __filter((_r) => _r instanceof HttpResponse), + __filter(_r => _r instanceof HttpResponse), __map((_r) => { return _r as __StrictHttpResponse; - }), + }) ); } /** @@ -56,7 +64,9 @@ class OMSPrintService extends __BaseService { * @param data Bestellung PKs */ OMSPrintAbholscheinById(data: PrintRequestOfIEnumerableOfLong): __Observable { - return this.OMSPrintAbholscheinByIdResponse(data).pipe(__map((_r) => _r.body as ResponseArgs)); + return this.OMSPrintAbholscheinByIdResponse(data).pipe( + __map(_r => _r.body as ResponseArgs) + ); } /** @@ -68,17 +78,21 @@ class OMSPrintService extends __BaseService { let __headers = new HttpHeaders(); let __body: any = null; __body = data; - let req = new HttpRequest('POST', this.rootUrl + `/print/abholschein/data`, __body, { - headers: __headers, - params: __params, - responseType: 'json', - }); + let req = new HttpRequest( + 'POST', + this.rootUrl + `/print/abholschein/data`, + __body, + { + headers: __headers, + params: __params, + responseType: 'json' + }); return this.http.request(req).pipe( - __filter((_r) => _r instanceof HttpResponse), + __filter(_r => _r instanceof HttpResponse), __map((_r) => { return _r as __StrictHttpResponse; - }), + }) ); } /** @@ -86,7 +100,9 @@ class OMSPrintService extends __BaseService { * @param data Bestellungen (Objekte) */ OMSPrintAbholschein(data: PrintRequestOfIEnumerableOfDisplayOrderDTO): __Observable { - return this.OMSPrintAbholscheinResponse(data).pipe(__map((_r) => _r.body as ResponseArgs)); + return this.OMSPrintAbholscheinResponse(data).pipe( + __map(_r => _r.body as ResponseArgs) + ); } /** @@ -98,17 +114,21 @@ class OMSPrintService extends __BaseService { let __headers = new HttpHeaders(); let __body: any = null; __body = data; - let req = new HttpRequest('POST', this.rootUrl + `/print/abholfachetikett`, __body, { - headers: __headers, - params: __params, - responseType: 'json', - }); + let req = new HttpRequest( + 'POST', + this.rootUrl + `/print/abholfachetikett`, + __body, + { + headers: __headers, + params: __params, + responseType: 'json' + }); return this.http.request(req).pipe( - __filter((_r) => _r instanceof HttpResponse), + __filter(_r => _r instanceof HttpResponse), __map((_r) => { return _r as __StrictHttpResponse; - }), + }) ); } /** @@ -116,7 +136,9 @@ class OMSPrintService extends __BaseService { * @param data Bestellpostenteilmenge PKs */ OMSPrintAbholfachetikett(data: PrintRequestOfIEnumerableOfLong): __Observable { - return this.OMSPrintAbholfachetikettResponse(data).pipe(__map((_r) => _r.body as ResponseArgs)); + return this.OMSPrintAbholfachetikettResponse(data).pipe( + __map(_r => _r.body as ResponseArgs) + ); } /** @@ -128,17 +150,21 @@ class OMSPrintService extends __BaseService { let __headers = new HttpHeaders(); let __body: any = null; __body = data; - let req = new HttpRequest('POST', this.rootUrl + `/print-direct/abholfachetikett`, __body, { - headers: __headers, - params: __params, - responseType: 'json', - }); + let req = new HttpRequest( + 'POST', + this.rootUrl + `/print-direct/abholfachetikett`, + __body, + { + headers: __headers, + params: __params, + responseType: 'json' + }); return this.http.request(req).pipe( - __filter((_r) => _r instanceof HttpResponse), + __filter(_r => _r instanceof HttpResponse), __map((_r) => { return _r as __StrictHttpResponse; - }), + }) ); } /** @@ -146,7 +172,9 @@ class OMSPrintService extends __BaseService { * @param data Bestellpostenteilmenge PKs */ OMSPrintAbholfachetikettDirect(data: PrintRequestOfIEnumerableOfLong): __Observable { - return this.OMSPrintAbholfachetikettDirectResponse(data).pipe(__map((_r) => _r.body as ResponseArgs)); + return this.OMSPrintAbholfachetikettDirectResponse(data).pipe( + __map(_r => _r.body as ResponseArgs) + ); } /** @@ -158,17 +186,21 @@ class OMSPrintService extends __BaseService { let __headers = new HttpHeaders(); let __body: any = null; __body = data; - let req = new HttpRequest('POST', this.rootUrl + `/print/priceqrcode`, __body, { - headers: __headers, - params: __params, - responseType: 'json', - }); + let req = new HttpRequest( + 'POST', + this.rootUrl + `/print/priceqrcode`, + __body, + { + headers: __headers, + params: __params, + responseType: 'json' + }); return this.http.request(req).pipe( - __filter((_r) => _r instanceof HttpResponse), + __filter(_r => _r instanceof HttpResponse), __map((_r) => { return _r as __StrictHttpResponse; - }), + }) ); } /** @@ -176,7 +208,9 @@ class OMSPrintService extends __BaseService { * @param data Bestellpostenteilmenge PKs */ OMSPrintPriceQRCode(data: PrintRequestOfIEnumerableOfPriceQRCodeDTO): __Observable { - return this.OMSPrintPriceQRCodeResponse(data).pipe(__map((_r) => _r.body as ResponseArgs)); + return this.OMSPrintPriceQRCodeResponse(data).pipe( + __map(_r => _r.body as ResponseArgs) + ); } /** @@ -188,17 +222,21 @@ class OMSPrintService extends __BaseService { let __headers = new HttpHeaders(); let __body: any = null; __body = data; - let req = new HttpRequest('POST', this.rootUrl + `/print-direct/priceqrcode`, __body, { - headers: __headers, - params: __params, - responseType: 'json', - }); + let req = new HttpRequest( + 'POST', + this.rootUrl + `/print-direct/priceqrcode`, + __body, + { + headers: __headers, + params: __params, + responseType: 'json' + }); return this.http.request(req).pipe( - __filter((_r) => _r instanceof HttpResponse), + __filter(_r => _r instanceof HttpResponse), __map((_r) => { return _r as __StrictHttpResponse; - }), + }) ); } /** @@ -206,7 +244,9 @@ class OMSPrintService extends __BaseService { * @param data Bestellpostenteilmenge PKs */ OMSPrintPriceQRCodeDirect(data: PrintRequestOfIEnumerableOfPriceQRCodeDTO): __Observable { - return this.OMSPrintPriceQRCodeDirectResponse(data).pipe(__map((_r) => _r.body as ResponseArgs)); + return this.OMSPrintPriceQRCodeDirectResponse(data).pipe( + __map(_r => _r.body as ResponseArgs) + ); } /** @@ -218,17 +258,21 @@ class OMSPrintService extends __BaseService { let __headers = new HttpHeaders(); let __body: any = null; __body = data; - let req = new HttpRequest('POST', this.rootUrl + `/print/lieferschein`, __body, { - headers: __headers, - params: __params, - responseType: 'json', - }); + let req = new HttpRequest( + 'POST', + this.rootUrl + `/print/lieferschein`, + __body, + { + headers: __headers, + params: __params, + responseType: 'json' + }); return this.http.request(req).pipe( - __filter((_r) => _r instanceof HttpResponse), + __filter(_r => _r instanceof HttpResponse), __map((_r) => { return _r as __StrictHttpResponse; - }), + }) ); } /** @@ -236,7 +280,45 @@ class OMSPrintService extends __BaseService { * @param data Lieferschein PKs */ OMSPrintLieferschein(data: PrintRequestOfIEnumerableOfLong): __Observable { - return this.OMSPrintLieferscheinResponse(data).pipe(__map((_r) => _r.body as ResponseArgs)); + return this.OMSPrintLieferscheinResponse(data).pipe( + __map(_r => _r.body as ResponseArgs) + ); + } + + /** + * Rücknahmebeleg + * @param data Rücknahmebeleg PKs + */ + OMSPrintReturnReceiptResponse(data: PrintRequestOfIEnumerableOfLong): __Observable<__StrictHttpResponse> { + let __params = this.newParams(); + let __headers = new HttpHeaders(); + let __body: any = null; + __body = data; + let req = new HttpRequest( + 'POST', + this.rootUrl + `/print/return-receipt`, + __body, + { + headers: __headers, + params: __params, + responseType: 'json' + }); + + return this.http.request(req).pipe( + __filter(_r => _r instanceof HttpResponse), + __map((_r) => { + return _r as __StrictHttpResponse; + }) + ); + } + /** + * Rücknahmebeleg + * @param data Rücknahmebeleg PKs + */ + OMSPrintReturnReceipt(data: PrintRequestOfIEnumerableOfLong): __Observable { + return this.OMSPrintReturnReceiptResponse(data).pipe( + __map(_r => _r.body as ResponseArgs) + ); } /** @@ -248,17 +330,21 @@ class OMSPrintService extends __BaseService { let __headers = new HttpHeaders(); let __body: any = null; __body = data; - let req = new HttpRequest('POST', this.rootUrl + `/print/kleinbetragsrechnung`, __body, { - headers: __headers, - params: __params, - responseType: 'json', - }); + let req = new HttpRequest( + 'POST', + this.rootUrl + `/print/kleinbetragsrechnung`, + __body, + { + headers: __headers, + params: __params, + responseType: 'json' + }); return this.http.request(req).pipe( - __filter((_r) => _r instanceof HttpResponse), + __filter(_r => _r instanceof HttpResponse), __map((_r) => { return _r as __StrictHttpResponse; - }), + }) ); } /** @@ -266,7 +352,9 @@ class OMSPrintService extends __BaseService { * @param data Kleinbetragsrechnung PKs */ OMSPrintKleinbetragsrechnung(data: PrintRequestOfIEnumerableOfLong): __Observable { - return this.OMSPrintKleinbetragsrechnungResponse(data).pipe(__map((_r) => _r.body as ResponseArgs)); + return this.OMSPrintKleinbetragsrechnungResponse(data).pipe( + __map(_r => _r.body as ResponseArgs) + ); } /** @@ -285,15 +373,14 @@ class OMSPrintService extends __BaseService { { headers: __headers, params: __params, - responseType: 'blob', - }, - ); + responseType: 'blob' + }); return this.http.request(req).pipe( - __filter((_r) => _r instanceof HttpResponse), + __filter(_r => _r instanceof HttpResponse), __map((_r) => { return _r as __StrictHttpResponse; - }), + }) ); } /** @@ -301,10 +388,13 @@ class OMSPrintService extends __BaseService { * @param receiptId Kleinbetragsrechnung PK */ OMSPrintKleinbetragsrechnungPdf(receiptId: number): __Observable { - return this.OMSPrintKleinbetragsrechnungPdfResponse(receiptId).pipe(__map((_r) => _r.body as Blob)); + return this.OMSPrintKleinbetragsrechnungPdfResponse(receiptId).pipe( + __map(_r => _r.body as Blob) + ); } } -module OMSPrintService {} +module OMSPrintService { +} -export { OMSPrintService }; +export { OMSPrintService } diff --git a/generated/swagger/print-api/src/services/print.service.ts b/generated/swagger/print-api/src/services/print.service.ts index ecb3cdc20..007d186ee 100644 --- a/generated/swagger/print-api/src/services/print.service.ts +++ b/generated/swagger/print-api/src/services/print.service.ts @@ -28,7 +28,10 @@ class PrintService extends __BaseService { static readonly PrintMonitorPath = '/print/monitor'; static readonly PrintStatusPath = '/print/status'; - constructor(config: __Configuration, http: HttpClient) { + constructor( + config: __Configuration, + http: HttpClient + ) { super(config, http); } @@ -39,24 +42,30 @@ class PrintService extends __BaseService { let __params = this.newParams(); let __headers = new HttpHeaders(); let __body: any = null; - let req = new HttpRequest('POST', this.rootUrl + `/printers/label/init`, __body, { - headers: __headers, - params: __params, - responseType: 'json', - }); + let req = new HttpRequest( + 'POST', + this.rootUrl + `/printers/label/init`, + __body, + { + headers: __headers, + params: __params, + responseType: 'json' + }); return this.http.request(req).pipe( - __filter((_r) => _r instanceof HttpResponse), + __filter(_r => _r instanceof HttpResponse), __map((_r) => { return _r as __StrictHttpResponse; - }), + }) ); } /** * Initialize label printers */ PrintInitializeLabelPrinters(): __Observable { - return this.PrintInitializeLabelPrintersResponse().pipe(__map((_r) => _r.body as ResponseArgsOfIEnumerableOfString)); + return this.PrintInitializeLabelPrintersResponse().pipe( + __map(_r => _r.body as ResponseArgsOfIEnumerableOfString) + ); } /** @@ -66,24 +75,30 @@ class PrintService extends __BaseService { let __params = this.newParams(); let __headers = new HttpHeaders(); let __body: any = null; - let req = new HttpRequest('POST', this.rootUrl + `/printers/office/init`, __body, { - headers: __headers, - params: __params, - responseType: 'json', - }); + let req = new HttpRequest( + 'POST', + this.rootUrl + `/printers/office/init`, + __body, + { + headers: __headers, + params: __params, + responseType: 'json' + }); return this.http.request(req).pipe( - __filter((_r) => _r instanceof HttpResponse), + __filter(_r => _r instanceof HttpResponse), __map((_r) => { return _r as __StrictHttpResponse; - }), + }) ); } /** * Initialize office printers */ PrintInitializeOfficePrinters(): __Observable { - return this.PrintInitializeOfficePrintersResponse().pipe(__map((_r) => _r.body as ResponseArgsOfIEnumerableOfString)); + return this.PrintInitializeOfficePrintersResponse().pipe( + __map(_r => _r.body as ResponseArgsOfIEnumerableOfString) + ); } /** @@ -93,24 +108,30 @@ class PrintService extends __BaseService { let __params = this.newParams(); let __headers = new HttpHeaders(); let __body: any = null; - let req = new HttpRequest('GET', this.rootUrl + `/printers`, __body, { - headers: __headers, - params: __params, - responseType: 'json', - }); + let req = new HttpRequest( + 'GET', + this.rootUrl + `/printers`, + __body, + { + headers: __headers, + params: __params, + responseType: 'json' + }); return this.http.request(req).pipe( - __filter((_r) => _r instanceof HttpResponse), + __filter(_r => _r instanceof HttpResponse), __map((_r) => { return _r as __StrictHttpResponse; - }), + }) ); } /** * Verfügbare Drucker */ PrintPrinters(): __Observable { - return this.PrintPrintersResponse().pipe(__map((_r) => _r.body as ListResponseArgsOfKeyValueDTOOfStringAndString)); + return this.PrintPrintersResponse().pipe( + __map(_r => _r.body as ListResponseArgsOfKeyValueDTOOfStringAndString) + ); } /** @@ -120,24 +141,30 @@ class PrintService extends __BaseService { let __params = this.newParams(); let __headers = new HttpHeaders(); let __body: any = null; - let req = new HttpRequest('GET', this.rootUrl + `/printers/label`, __body, { - headers: __headers, - params: __params, - responseType: 'json', - }); + let req = new HttpRequest( + 'GET', + this.rootUrl + `/printers/label`, + __body, + { + headers: __headers, + params: __params, + responseType: 'json' + }); return this.http.request(req).pipe( - __filter((_r) => _r instanceof HttpResponse), + __filter(_r => _r instanceof HttpResponse), __map((_r) => { return _r as __StrictHttpResponse; - }), + }) ); } /** * Verfügbare Label-Drucker */ PrintLabelPrinters(): __Observable { - return this.PrintLabelPrintersResponse().pipe(__map((_r) => _r.body as ListResponseArgsOfKeyValueDTOOfStringAndString)); + return this.PrintLabelPrintersResponse().pipe( + __map(_r => _r.body as ListResponseArgsOfKeyValueDTOOfStringAndString) + ); } /** @@ -147,24 +174,30 @@ class PrintService extends __BaseService { let __params = this.newParams(); let __headers = new HttpHeaders(); let __body: any = null; - let req = new HttpRequest('GET', this.rootUrl + `/printers/office`, __body, { - headers: __headers, - params: __params, - responseType: 'json', - }); + let req = new HttpRequest( + 'GET', + this.rootUrl + `/printers/office`, + __body, + { + headers: __headers, + params: __params, + responseType: 'json' + }); return this.http.request(req).pipe( - __filter((_r) => _r instanceof HttpResponse), + __filter(_r => _r instanceof HttpResponse), __map((_r) => { return _r as __StrictHttpResponse; - }), + }) ); } /** * Verfügbare Office-Drucker */ PrintOfficePrinters(): __Observable { - return this.PrintOfficePrintersResponse().pipe(__map((_r) => _r.body as ListResponseArgsOfKeyValueDTOOfStringAndString)); + return this.PrintOfficePrintersResponse().pipe( + __map(_r => _r.body as ListResponseArgsOfKeyValueDTOOfStringAndString) + ); } /** @@ -176,17 +209,21 @@ class PrintService extends __BaseService { let __headers = new HttpHeaders(); let __body: any = null; __body = data; - let req = new HttpRequest('POST', this.rootUrl + `/print/test`, __body, { - headers: __headers, - params: __params, - responseType: 'json', - }); + let req = new HttpRequest( + 'POST', + this.rootUrl + `/print/test`, + __body, + { + headers: __headers, + params: __params, + responseType: 'json' + }); return this.http.request(req).pipe( - __filter((_r) => _r instanceof HttpResponse), + __filter(_r => _r instanceof HttpResponse), __map((_r) => { return _r as __StrictHttpResponse; - }), + }) ); } /** @@ -194,7 +231,9 @@ class PrintService extends __BaseService { * @param data undefined */ PrintTest(data: PrintRequest): __Observable { - return this.PrintTestResponse(data).pipe(__map((_r) => _r.body as ResponseArgs)); + return this.PrintTestResponse(data).pipe( + __map(_r => _r.body as ResponseArgs) + ); } /** @@ -206,17 +245,21 @@ class PrintService extends __BaseService { let __headers = new HttpHeaders(); let __body: any = null; __body = data; - let req = new HttpRequest('POST', this.rootUrl + `/printers/details`, __body, { - headers: __headers, - params: __params, - responseType: 'json', - }); + let req = new HttpRequest( + 'POST', + this.rootUrl + `/printers/details`, + __body, + { + headers: __headers, + params: __params, + responseType: 'json' + }); return this.http.request(req).pipe( - __filter((_r) => _r instanceof HttpResponse), + __filter(_r => _r instanceof HttpResponse), __map((_r) => { return _r as __StrictHttpResponse; - }), + }) ); } /** @@ -224,7 +267,9 @@ class PrintService extends __BaseService { * @param data undefined */ PrintPrinterDetails(data: PrintRequest): __Observable { - return this.PrintPrinterDetailsResponse(data).pipe(__map((_r) => _r.body as ResponseArgs)); + return this.PrintPrinterDetailsResponse(data).pipe( + __map(_r => _r.body as ResponseArgs) + ); } /** @@ -235,24 +280,30 @@ class PrintService extends __BaseService { let __headers = new HttpHeaders(); let __body: any = null; __body = data; - let req = new HttpRequest('POST', this.rootUrl + `/printers/directprinttest`, __body, { - headers: __headers, - params: __params, - responseType: 'json', - }); + let req = new HttpRequest( + 'POST', + this.rootUrl + `/printers/directprinttest`, + __body, + { + headers: __headers, + params: __params, + responseType: 'json' + }); return this.http.request(req).pipe( - __filter((_r) => _r instanceof HttpResponse), + __filter(_r => _r instanceof HttpResponse), __map((_r) => { return _r as __StrictHttpResponse; - }), + }) ); } /** * @param data undefined */ PrintDirectPrintTest(data: PrintRequest): __Observable { - return this.PrintDirectPrintTestResponse(data).pipe(__map((_r) => _r.body as ResponseArgs)); + return this.PrintDirectPrintTestResponse(data).pipe( + __map(_r => _r.body as ResponseArgs) + ); } /** @@ -264,17 +315,21 @@ class PrintService extends __BaseService { let __headers = new HttpHeaders(); let __body: any = null; __body = data; - let req = new HttpRequest('POST', this.rootUrl + `/print/pdf`, __body, { - headers: __headers, - params: __params, - responseType: 'json', - }); + let req = new HttpRequest( + 'POST', + this.rootUrl + `/print/pdf`, + __body, + { + headers: __headers, + params: __params, + responseType: 'json' + }); return this.http.request(req).pipe( - __filter((_r) => _r instanceof HttpResponse), + __filter(_r => _r instanceof HttpResponse), __map((_r) => { return _r as __StrictHttpResponse; - }), + }) ); } /** @@ -282,7 +337,9 @@ class PrintService extends __BaseService { * @param data Artikel */ PrintPrintPdf(data: PrintRequestOfString): __Observable { - return this.PrintPrintPdfResponse(data).pipe(__map((_r) => _r.body as ResponseArgs)); + return this.PrintPrintPdfResponse(data).pipe( + __map(_r => _r.body as ResponseArgs) + ); } /** @@ -292,24 +349,30 @@ class PrintService extends __BaseService { let __params = this.newParams(); let __headers = new HttpHeaders(); let __body: any = null; - let req = new HttpRequest('GET', this.rootUrl + `/print/monitor`, __body, { - headers: __headers, - params: __params, - responseType: 'blob', - }); + let req = new HttpRequest( + 'GET', + this.rootUrl + `/print/monitor`, + __body, + { + headers: __headers, + params: __params, + responseType: 'blob' + }); return this.http.request(req).pipe( - __filter((_r) => _r instanceof HttpResponse), + __filter(_r => _r instanceof HttpResponse), __map((_r) => { return _r as __StrictHttpResponse; - }), + }) ); } /** * Monitoring */ PrintMonitor(): __Observable { - return this.PrintMonitorResponse().pipe(__map((_r) => _r.body as Blob)); + return this.PrintMonitorResponse().pipe( + __map(_r => _r.body as Blob) + ); } /** @@ -319,27 +382,34 @@ class PrintService extends __BaseService { let __params = this.newParams(); let __headers = new HttpHeaders(); let __body: any = null; - let req = new HttpRequest('GET', this.rootUrl + `/print/status`, __body, { - headers: __headers, - params: __params, - responseType: 'blob', - }); + let req = new HttpRequest( + 'GET', + this.rootUrl + `/print/status`, + __body, + { + headers: __headers, + params: __params, + responseType: 'blob' + }); return this.http.request(req).pipe( - __filter((_r) => _r instanceof HttpResponse), + __filter(_r => _r instanceof HttpResponse), __map((_r) => { return _r as __StrictHttpResponse; - }), + }) ); } /** * Status */ PrintStatus(): __Observable { - return this.PrintStatusResponse().pipe(__map((_r) => _r.body as Blob)); + return this.PrintStatusResponse().pipe( + __map(_r => _r.body as Blob) + ); } } -module PrintService {} +module PrintService { +} -export { PrintService }; +export { PrintService } diff --git a/generated/swagger/print-api/src/strict-http-response.ts b/generated/swagger/print-api/src/strict-http-response.ts index 30db756eb..ebdeada77 100644 --- a/generated/swagger/print-api/src/strict-http-response.ts +++ b/generated/swagger/print-api/src/strict-http-response.ts @@ -6,4 +6,4 @@ import { HttpResponse } from '@angular/common/http'; */ export type StrictHttpResponse = HttpResponse & { readonly body: T; -}; +} diff --git a/libs/catalogue/data-access/src/lib/models/product.ts b/libs/catalogue/data-access/src/lib/models/product.ts index d79c13614..289aa188e 100644 --- a/libs/catalogue/data-access/src/lib/models/product.ts +++ b/libs/catalogue/data-access/src/lib/models/product.ts @@ -1,7 +1,12 @@ import { ProductDTO } from '@generated/swagger/cat-search-api'; export interface Product extends ProductDTO { + name: string; + contributors: string; + catalogProductNumber: string; ean: string; format: string; - formatDetails: string; + formatDetail: string; + volume: string; + manufacturer: string; } diff --git a/libs/common/data-access/README.md b/libs/common/data-access/README.md new file mode 100644 index 000000000..f99c0c8f5 --- /dev/null +++ b/libs/common/data-access/README.md @@ -0,0 +1,7 @@ +# common-data-access + +This library was generated with [Nx](https://nx.dev). + +## Running unit tests + +Run `nx test common-data-access` to execute the unit tests. diff --git a/libs/common/result/eslint.config.mjs b/libs/common/data-access/eslint.config.mjs similarity index 91% rename from libs/common/result/eslint.config.mjs rename to libs/common/data-access/eslint.config.mjs index 3bf3b5ae0..35dada9d3 100644 --- a/libs/common/result/eslint.config.mjs +++ b/libs/common/data-access/eslint.config.mjs @@ -12,7 +12,7 @@ export default [ 'error', { type: 'attribute', - prefix: 'lib', + prefix: 'common', style: 'camelCase', }, ], @@ -20,7 +20,7 @@ export default [ 'error', { type: 'element', - prefix: 'lib', + prefix: 'common', style: 'kebab-case', }, ], diff --git a/libs/common/result/jest.config.ts b/libs/common/data-access/jest.config.ts similarity index 85% rename from libs/common/result/jest.config.ts rename to libs/common/data-access/jest.config.ts index 5defa38f1..9e2de5e09 100644 --- a/libs/common/result/jest.config.ts +++ b/libs/common/data-access/jest.config.ts @@ -1,8 +1,8 @@ export default { - displayName: 'common-result', + displayName: 'common-data-access', preset: '../../../jest.preset.js', setupFilesAfterEnv: ['/src/test-setup.ts'], - coverageDirectory: '../../../coverage/libs/common/result', + coverageDirectory: '../../../coverage/libs/common/data-access', transform: { '^.+\\.(ts|mjs|js|html)$': [ 'jest-preset-angular', diff --git a/libs/common/result/project.json b/libs/common/data-access/project.json similarity index 67% rename from libs/common/result/project.json rename to libs/common/data-access/project.json index 5cb1be1fe..e47165d58 100644 --- a/libs/common/result/project.json +++ b/libs/common/data-access/project.json @@ -1,8 +1,8 @@ { - "name": "common-result", + "name": "common-data-access", "$schema": "../../../node_modules/nx/schemas/project-schema.json", - "sourceRoot": "libs/common/result/src", - "prefix": "lib", + "sourceRoot": "libs/common/data-access/src", + "prefix": "common", "projectType": "library", "tags": [], "targets": { @@ -10,7 +10,7 @@ "executor": "@nx/jest:jest", "outputs": ["{workspaceRoot}/coverage/{projectRoot}"], "options": { - "jestConfig": "libs/common/result/jest.config.ts" + "jestConfig": "libs/common/data-access/jest.config.ts" } }, "lint": { diff --git a/libs/common/data-access/src/index.ts b/libs/common/data-access/src/index.ts new file mode 100644 index 000000000..0fb10966f --- /dev/null +++ b/libs/common/data-access/src/index.ts @@ -0,0 +1,2 @@ +export * from './lib/errors'; +export * from './lib/models'; diff --git a/libs/common/data-access/src/lib/errors/data-access.error.spec.ts b/libs/common/data-access/src/lib/errors/data-access.error.spec.ts new file mode 100644 index 000000000..017fe75bd --- /dev/null +++ b/libs/common/data-access/src/lib/errors/data-access.error.spec.ts @@ -0,0 +1,100 @@ +import { DataAccessError } from './data-access.error'; + +/** + * Test suite for DataAccessError class. + * Validates the functionality of the base error class used for structured error handling. + */ +describe('DataAccessError', () => { + /** + * Tests basic error functionality without additional data + */ + describe('Basic Error without Data', () => { + class TestError extends DataAccessError<'TEST_ERROR'> { + constructor(message: string) { + super('TEST_ERROR', message, undefined); + } + } + + it('should create an error with a code and message', () => { + // Arrange & Act + const error = new TestError('Test message'); + + // Assert + expect(error).toBeInstanceOf(Error); + expect(error).toBeInstanceOf(DataAccessError); + expect(error.code).toBe('TEST_ERROR'); + expect(error.message).toBe('Test message'); + expect(error.data).toBeUndefined(); + }); + }); + + /** + * Tests error functionality with additional data, ensuring type safety + * and proper data handling + */ + describe('Error with Data', () => { + interface ValidationData { + field: string; + issues: string[]; + } + + class ValidationError extends DataAccessError< + 'VALIDATION_ERROR', + ValidationData + > { + constructor(message: string, data: ValidationData) { + super('VALIDATION_ERROR', message, data); + } + } + + it('should create an error with code, message, and data', () => { + // Arrange + const validationData: ValidationData = { + field: 'email', + issues: ['Invalid format', 'Required field'], + }; + + // Act + const error = new ValidationError('Validation failed', validationData); + + // Assert + expect(error).toBeInstanceOf(Error); + expect(error).toBeInstanceOf(DataAccessError); + expect(error.code).toBe('VALIDATION_ERROR'); + expect(error.message).toBe('Validation failed'); + expect(error.data).toEqual(validationData); + }); + + it('should maintain data type safety', () => { + // Arrange + const validationData: ValidationData = { + field: 'username', + issues: ['Too short'], + }; + + // Act + const error = new ValidationError('Validation failed', validationData); + + // Assert + expect(error.data.field).toBe('username'); + expect(error.data.issues).toContain('Too short'); + }); + }); + + /** + * Tests type safety enforcement for error codes and data + */ + describe('Error Type Safety', () => { + it('should ensure type safety for error codes', () => { + class TypedError extends DataAccessError<'TYPE_ERROR'> { + constructor() { + super('TYPE_ERROR', 'Type error message', undefined); + } + } + + const error = new TypedError(); + const errorCode: 'TYPE_ERROR' = error.code; // TypeScript will error if type safety fails + expect(errorCode).toBe('TYPE_ERROR'); + }); + }); +}); diff --git a/libs/common/data-access/src/lib/errors/data-access.error.ts b/libs/common/data-access/src/lib/errors/data-access.error.ts new file mode 100644 index 000000000..6e1a4794f --- /dev/null +++ b/libs/common/data-access/src/lib/errors/data-access.error.ts @@ -0,0 +1,48 @@ +/** + * Base error class for data access related errors. This class provides structured error + * handling with type-safe error codes and optional additional data. + * + * Features: + * - Type-safe error codes using string literals + * - Optional additional error data with type safety + * - Standardized error message format + * + * @template TCode - String literal type for the error code. Enforces type safety for error codes. + * @template TData - Type for additional error data (defaults to void). Allows attaching context-specific data. + * + * @example + * ```typescript + * // Define an error with a specific code and no data + * class MyError extends DataAccessError<'MY_ERROR'> { + * constructor(message: string) { + * super('MY_ERROR', message); + * } + * } + * + * // Define an error with data + * class ValidationError extends DataAccessError<'VALIDATION_ERROR', string[]> { + * constructor(errors: string[]) { + * super('VALIDATION_ERROR', 'Validation failed', errors); + * } + * } + * ``` + * + * @see {@link PropertyIsEmptyError} for example implementation with no data + * @see {@link CreateReturnProcessError} for example implementation with data + */ +export class DataAccessError extends Error { + /** + * Creates a new DataAccessError instance. + * + * @param code - The error code that identifies the type of error. Must match the TCode type parameter. + * @param message - A human-readable description of the error. + * @param data - Additional data related to the error. Must match the TData type parameter. + */ + constructor( + public readonly code: TCode, + message: string, + public readonly data: TData, + ) { + super(message); + } +} diff --git a/libs/common/data-access/src/lib/errors/index.ts b/libs/common/data-access/src/lib/errors/index.ts new file mode 100644 index 000000000..c639ee233 --- /dev/null +++ b/libs/common/data-access/src/lib/errors/index.ts @@ -0,0 +1,3 @@ +export * from './data-access.error'; +export * from './property-is-empty.error'; +export * from './property-is-null-or-undefined.error'; diff --git a/libs/common/data-access/src/lib/errors/property-is-empty.error.test.ts b/libs/common/data-access/src/lib/errors/property-is-empty.error.test.ts new file mode 100644 index 000000000..5eed1c08a --- /dev/null +++ b/libs/common/data-access/src/lib/errors/property-is-empty.error.test.ts @@ -0,0 +1,18 @@ +import { DataAccessError } from './data-access.error'; +import { PropertyIsEmptyError } from './property-is-empty.error'; + +describe('PropertyIsEmptyError', () => { + it('should create an error with the correct code and message', () => { + // Arrange + const propertyName = 'username'; + + // Act + const error = new PropertyIsEmptyError(propertyName); + + // Assert + expect(error).toBeInstanceOf(PropertyIsEmptyError); + expect(error).toBeInstanceOf(DataAccessError); + expect(error.code).toBe('PROPERTY_IS_EMPTY'); + expect(error.message).toBe(`Property "${propertyName}" is empty.`); + }); +}); diff --git a/libs/common/data-access/src/lib/errors/property-is-empty.error.ts b/libs/common/data-access/src/lib/errors/property-is-empty.error.ts new file mode 100644 index 000000000..01e5f2b64 --- /dev/null +++ b/libs/common/data-access/src/lib/errors/property-is-empty.error.ts @@ -0,0 +1,20 @@ +import { DataAccessError } from './data-access.error'; + +/** + * Represents an error that is thrown when a required property is empty. + * + * @remarks + * This error is identified by the code 'PROPERTY_IS_EMPTY'. + * + * @param propertyName - The name of the property that is empty. + * + * @example + * ```typescript + * throw new PropertyIsEmptyError("username"); + * ``` + */ +export class PropertyIsEmptyError extends DataAccessError<'PROPERTY_IS_EMPTY'> { + constructor(propertyName: string) { + super('PROPERTY_IS_EMPTY', `Property "${propertyName}" is empty.`); + } +} diff --git a/libs/common/data-access/src/lib/errors/property-is-null-or-undefined.error.test.ts b/libs/common/data-access/src/lib/errors/property-is-null-or-undefined.error.test.ts new file mode 100644 index 000000000..9331f0b19 --- /dev/null +++ b/libs/common/data-access/src/lib/errors/property-is-null-or-undefined.error.test.ts @@ -0,0 +1,18 @@ +import { PropertyNullOrUndefinedError } from './property-is-null-or-undefined.error'; + +describe('PropertyNullOrUndefinedError', () => { + it('should create an error instance with the correct code and message', () => { + // Arrange + const propertyName = 'userId'; + + // Act + const error = new PropertyNullOrUndefinedError(propertyName); + + // Assert + expect(error).toBeInstanceOf(PropertyNullOrUndefinedError); + expect(error.code).toBe('PROPERTY_NULL_OR_UNDEFINED'); + expect(error.message).toBe( + `Property "${propertyName}" is null or undefined.`, + ); + }); +}); diff --git a/libs/common/data-access/src/lib/errors/property-is-null-or-undefined.error.ts b/libs/common/data-access/src/lib/errors/property-is-null-or-undefined.error.ts new file mode 100644 index 000000000..3f0dc18ec --- /dev/null +++ b/libs/common/data-access/src/lib/errors/property-is-null-or-undefined.error.ts @@ -0,0 +1,21 @@ +import { DataAccessError } from './data-access.error'; + +/** + * Error thrown when a required property is null or undefined. + * + * @remarks + * This error indicates that a non-null, non-undefined property has been found to be invalid. + * + * @param parameterName - The name of the property that is null or undefined. + * + * @example + * throw new PropertyNullOrUndefinedError('userId'); + */ +export class PropertyNullOrUndefinedError extends DataAccessError<'PROPERTY_NULL_OR_UNDEFINED'> { + constructor(propertyName: string) { + super( + 'PROPERTY_NULL_OR_UNDEFINED', + `Property "${propertyName}" is null or undefined.`, + ); + } +} diff --git a/libs/common/data-access/src/lib/index.ts b/libs/common/data-access/src/lib/index.ts new file mode 100644 index 000000000..c3d24fa2c --- /dev/null +++ b/libs/common/data-access/src/lib/index.ts @@ -0,0 +1,2 @@ +export * from './errors'; +export * from './models'; diff --git a/libs/common/data-access/src/lib/models/async-result.ts b/libs/common/data-access/src/lib/models/async-result.ts new file mode 100644 index 000000000..e403e2313 --- /dev/null +++ b/libs/common/data-access/src/lib/models/async-result.ts @@ -0,0 +1,38 @@ +/** + * Constant object defining the possible states of an asynchronous operation. + * Used as a type-safe alternative to string literals for status values. + */ +export const AsyncResultStatus = { + Idle: 'Idle', + Pending: 'Pending', + Success: 'Success', + Error: 'Error', +} as const; + +export type AsyncResultStatus = + (typeof AsyncResultStatus)[keyof typeof AsyncResultStatus]; + +/** + * Generic interface representing the state of an asynchronous operation. + * Combines status tracking with optional data and error information. + * + * @template T - The type of data returned on successful operations + */ +export interface AsyncResult { + /** + * Current status of the asynchronous operation + */ + status: AsyncResultStatus; + + /** + * Data returned by a successful operation + * Only defined when status is Success + */ + data?: T; + + /** + * Error information from a failed operation + * Only defined when status is Error + */ + error?: unknown; +} diff --git a/libs/common/data-access/src/lib/models/callback-result.ts b/libs/common/data-access/src/lib/models/callback-result.ts new file mode 100644 index 000000000..f11298425 --- /dev/null +++ b/libs/common/data-access/src/lib/models/callback-result.ts @@ -0,0 +1,17 @@ +/** + * Represents the result of an asynchronous operation that may succeed or fail. + * Either contains the successful data or an error, but not both. + * + * @template T - The type of data returned on successful operations + */ +export type CallbackResult = + | { data: T; error?: unknown } + | { data?: T; error: unknown }; + +/** + * Function type for callbacks that receive operation results. + * Typically used for handling asynchronous operation completions. + * + * @template T - The type of data returned on successful operations + */ +export type Callback = (result: CallbackResult) => void; diff --git a/libs/common/data-access/src/lib/models/entity-cotnainer.ts b/libs/common/data-access/src/lib/models/entity-cotnainer.ts new file mode 100644 index 000000000..670d4c4e3 --- /dev/null +++ b/libs/common/data-access/src/lib/models/entity-cotnainer.ts @@ -0,0 +1,34 @@ +/** + * Generic container for entity objects that provides standard properties for display and selection state. + * Used for consistent entity representation in lists, dropdowns, and selection components. + * + * @template T - The type of data contained within the entity container + */ +export interface EntityContainer { + /** + * Unique identifier for the entity + */ + id: number; + + /** + * Human-readable name for display in UI elements + */ + displayName?: string; + + /** + * The actual entity data object + */ + data?: T; + + /** + * Whether the entity is enabled/available for interaction + * When false, the entity might be shown as disabled in UI + */ + enabled?: boolean; + + /** + * Whether the entity is currently selected + * Useful for multi-select interfaces + */ + selected?: boolean; +} diff --git a/libs/common/data-access/src/lib/models/index.ts b/libs/common/data-access/src/lib/models/index.ts new file mode 100644 index 000000000..2ec6c458e --- /dev/null +++ b/libs/common/data-access/src/lib/models/index.ts @@ -0,0 +1,5 @@ +export * from './async-result'; +export * from './callback-result'; +export * from './entity-cotnainer'; +export * from './list-response-args'; +export * from './response-args'; diff --git a/libs/common/data-access/src/lib/models/list-response-args.ts b/libs/common/data-access/src/lib/models/list-response-args.ts new file mode 100644 index 000000000..c13345baa --- /dev/null +++ b/libs/common/data-access/src/lib/models/list-response-args.ts @@ -0,0 +1,27 @@ +import { ResponseArgs } from './response-args'; + +/** + * Extended response structure specifically for paginated list data. + * Includes pagination metadata in addition to standard response properties. + * + * @template T - The type of individual items in the result array + */ +export interface ListResponseArgs extends ResponseArgs { + /** + * Number of items skipped in the result set (pagination offset) + * Used for calculating the starting position in paginated results + */ + skip: number; + + /** + * Maximum number of items to include in the result set (page size) + * Defines how many items should be returned per page + */ + take: number; + + /** + * Total number of items available in the complete result set + * Used for calculating total pages and showing pagination information + */ + hits: number; +} diff --git a/libs/common/data-access/src/lib/models/response-args.ts b/libs/common/data-access/src/lib/models/response-args.ts new file mode 100644 index 000000000..3c03beb67 --- /dev/null +++ b/libs/common/data-access/src/lib/models/response-args.ts @@ -0,0 +1,30 @@ +/** + * Standard response structure for API requests returning data of type T. + * Provides consistent error handling and result access across the application. + * + * @template T - The type of data contained in the result property + */ +export interface ResponseArgs { + /** + * Indicates whether the request resulted in an error + * When true, the result may be undefined or contain partial data + */ + error: boolean; + + /** + * Map of property names to error messages for validation failures + * Keys represent property names, values contain validation error messages + */ + invalidProperties: Record; + + /** + * Optional message providing additional information about the response + * Typically used for error descriptions or success confirmations + */ + message?: string; + + /** + * The actual data returned by the request + */ + result: T; +} diff --git a/libs/common/result/src/test-setup.ts b/libs/common/data-access/src/test-setup.ts similarity index 100% rename from libs/common/result/src/test-setup.ts rename to libs/common/data-access/src/test-setup.ts diff --git a/libs/common/result/tsconfig.json b/libs/common/data-access/tsconfig.json similarity index 100% rename from libs/common/result/tsconfig.json rename to libs/common/data-access/tsconfig.json diff --git a/libs/common/result/tsconfig.lib.json b/libs/common/data-access/tsconfig.lib.json similarity index 100% rename from libs/common/result/tsconfig.lib.json rename to libs/common/data-access/tsconfig.lib.json diff --git a/libs/common/result/tsconfig.spec.json b/libs/common/data-access/tsconfig.spec.json similarity index 100% rename from libs/common/result/tsconfig.spec.json rename to libs/common/data-access/tsconfig.spec.json diff --git a/libs/common/result/README.md b/libs/common/result/README.md deleted file mode 100644 index 1f9d759f8..000000000 --- a/libs/common/result/README.md +++ /dev/null @@ -1,7 +0,0 @@ -# common-result - -This library was generated with [Nx](https://nx.dev). - -## Running unit tests - -Run `nx test common-result` to execute the unit tests. diff --git a/libs/common/result/src/index.ts b/libs/common/result/src/index.ts deleted file mode 100644 index 64dcadce4..000000000 --- a/libs/common/result/src/index.ts +++ /dev/null @@ -1,5 +0,0 @@ -export * from './lib/response-args.schema'; -export * from './lib/response-args'; -export * from './lib/entity-cotnainer'; -export * from './lib/entity-container.schema'; -export * from './lib/result'; diff --git a/libs/common/result/src/lib/entity-container.schema.ts b/libs/common/result/src/lib/entity-container.schema.ts deleted file mode 100644 index 0dd51fcd5..000000000 --- a/libs/common/result/src/lib/entity-container.schema.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { z } from 'zod'; - -const _EntityContainerSchema = z.object({ - id: z.number(), - uId: z.string().optional(), - displayLabel: z.string().optional(), - enabled: z.boolean().optional(), - selected: z.boolean().optional(), -}); - -export function EntityContainerSchema(data: z.ZodType) { - return _EntityContainerSchema.extend({ - data: data.optional(), - }); -} diff --git a/libs/common/result/src/lib/entity-cotnainer.ts b/libs/common/result/src/lib/entity-cotnainer.ts deleted file mode 100644 index a5840cd58..000000000 --- a/libs/common/result/src/lib/entity-cotnainer.ts +++ /dev/null @@ -1,7 +0,0 @@ -export interface EntityContainer { - id: number; - displayName?: string; - data?: T; - enabled?: boolean; - selected?: boolean; -} diff --git a/libs/common/result/src/lib/response-args.schema.ts b/libs/common/result/src/lib/response-args.schema.ts deleted file mode 100644 index da8ea03ac..000000000 --- a/libs/common/result/src/lib/response-args.schema.ts +++ /dev/null @@ -1,29 +0,0 @@ -import { z } from 'zod'; - -// @deprecated -export const ResponseArgsSchema = z.object({ - error: z.boolean(), - invalidProperties: z.record(z.string()), - message: z.string().optional(), -}); - -// @deprecated -export function CreateResponseArgs(resultSchema: z.ZodType) { - return ResponseArgsSchema.extend({ - result: resultSchema, - }); -} - -// @deprecated -const ListResponseArgsSchema = ResponseArgsSchema.extend({ - skip: z.number(), - take: z.number(), - hits: z.number(), -}); - -// @deprecated -export function CreateListResponseArgs(resultSchema: z.ZodType) { - return ListResponseArgsSchema.extend({ - result: resultSchema.array(), - }); -} diff --git a/libs/common/result/src/lib/response-args.ts b/libs/common/result/src/lib/response-args.ts deleted file mode 100644 index 4458ded1b..000000000 --- a/libs/common/result/src/lib/response-args.ts +++ /dev/null @@ -1,12 +0,0 @@ -export interface ResponseArgs { - error: boolean; - invalidProperties: Record; - message?: string; - result: T; -} - -export interface ListResponseArgs extends ResponseArgs { - skip: number; - take: number; - hits: number; -} diff --git a/libs/common/result/src/lib/result.ts b/libs/common/result/src/lib/result.ts deleted file mode 100644 index a8efd05be..000000000 --- a/libs/common/result/src/lib/result.ts +++ /dev/null @@ -1,18 +0,0 @@ -export const ResultStatus = { - Idle: 'idle', - Pending: 'pending', - Success: 'success', - Error: 'error', -} as const; - -export type ResultStatus = (typeof ResultStatus)[keyof typeof ResultStatus]; - -export interface Result { - status: ResultStatus; - data: T; - error?: unknown; -} - -export type CallbackResult = { data: T; error?: unknown } | { data?: T; error: unknown }; - -export type Callback = (result: CallbackResult) => void; diff --git a/libs/core/logging/README.md b/libs/core/logging/README.md index 458629beb..2c3e73313 100644 --- a/libs/core/logging/README.md +++ b/libs/core/logging/README.md @@ -354,3 +354,37 @@ describe('MyService', () => { }); }); ``` + +## Recent Changes + +### Logger Factory Enhancements + +- **Context Functionality**: The `logger` factory function now accepts an optional `ctxFn` parameter. This allows additional context to be dynamically merged into log messages at runtime. +- **Enhanced Context Merging**: The `mergeContexts` function has been updated to include injector-level context, component-level context, and message-specific context. This ensures a more comprehensive and flexible logging context. + +#### Example Usage + +```typescript +import { logger } from '@isa/core/logging'; + +@Component({ + selector: 'app-example', + template: '...' +}) +export class ExampleComponent { + #logger = logger(() => ({ userId: '12345' })); + + ngOnInit(): void { + this.#logger.info('Component initialized'); + } + + performAction(): void { + this.#logger.debug('Action performed', { action: 'example' }); + } +} +``` + +### Benefits + +- **Dynamic Context**: Add runtime-specific context to log messages without modifying the logger instance. +- **Improved Debugging**: Enhanced context merging provides richer information for troubleshooting. diff --git a/libs/core/logging/src/lib/log-level.enum.ts b/libs/core/logging/src/lib/log-level.enum.ts index d12e4c411..df5e13297 100644 --- a/libs/core/logging/src/lib/log-level.enum.ts +++ b/libs/core/logging/src/lib/log-level.enum.ts @@ -1,11 +1,47 @@ /** - * Defines the available log levels for the logging system. + * Represents the available logging levels in order of increasing severity. + * The configured log level acts as a threshold - only messages at or above + * that level will be processed. + * + * Levels from least to most severe: + * - Trace: Fine-grained debugging and tracing information + * - Debug: Detailed development-time debugging information + * - Info: General runtime information about application flow + * - Warn: Potentially harmful situations that don't interrupt operation + * - Error: Error conditions that affect functionality + * - Off: Completely disable logging + * + * @example + * ```typescript + * // Configure logging level based on environment + * provideLogging( + * withLogLevel(isDevMode() ? LogLevel.Debug : LogLevel.Warn) + * ); + * + * // Using different levels in code + * logger.trace('Entering method', { method: 'processData' }); // Development tracing + * logger.debug('Processing chunk', { size: chunk.length }); // Debug information + * logger.info('User logged in', { userId: '123' }); // Runtime information + * logger.warn('API response slow', { responseTime: '2500ms' }); // Warning + * logger.error('Failed to save', error, { retry: true }); // Error condition + * ``` */ export const enum LogLevel { + /** Fine-grained debugging and tracing information for development */ Trace = 'trace', + + /** Detailed information useful during development and debugging */ Debug = 'debug', + + /** General information about application flow and runtime events */ Info = 'info', + + /** Potentially harmful situations that don't prevent operation */ Warn = 'warn', + + /** Error conditions that affect application functionality */ Error = 'error', + + /** Completely disable logging output */ Off = 'off', } diff --git a/libs/core/logging/src/lib/logger.factory.ts b/libs/core/logging/src/lib/logger.factory.ts index feb3ec928..4d60ac172 100644 --- a/libs/core/logging/src/lib/logger.factory.ts +++ b/libs/core/logging/src/lib/logger.factory.ts @@ -4,20 +4,54 @@ import { LoggerApi, LoggerContext } from './logging.types'; import { LOGGER_CONTEXT } from './logging.providers'; /** - * Factory function to create a logger instance with optional context. + * Factory function to create a logger instance with rich context support. + * This is the primary way for components and services to access logging functionality. * - * This is the primary way for components and services to access the logging - * functionality in the application. + * The logger supports hierarchical context through multiple mechanisms: + * 1. Component-level context via provideLoggerContext() + * 2. Instance-level context via the ctxFn parameter + * 3. Message-level context via the logging methods * - * @returns Logger API interface that can be used to log messages. + * These contexts are merged in order, with later contexts taking precedence. + * + * @param ctxFn - Optional function that returns dynamic context to be included with each log message + * @returns A LoggerApi instance configured with the specified context + * + * @example + * ```typescript + * // Basic usage + * const logger = logger(); + * logger.info('Simple message'); + * + * // With dynamic context + * const loggerWithContext = logger(() => ({ + * userId: getCurrentUserId(), + * sessionId: getSessionId() + * })); + * + * // Usage with component-level context + * @Component({ + * providers: [ + * provideLoggerContext({ component: 'UserProfile' }) + * ] + * }) + * class UserProfileComponent { + * #logger = logger(() => ({ userId: this.currentUserId })); + * + * logAction(action: string) { + * this.#logger.info('User action', { action }); // Includes all context levels + * } + * } + * ``` */ -export function logger(): LoggerApi { +export function logger(ctxFn?: () => LoggerContext): LoggerApi { const loggingService = inject(LoggingService); // Try to inject context if available - const context = inject(LOGGER_CONTEXT, { - optional: true, - }); + const context = + inject(LOGGER_CONTEXT, { + optional: true, + }) || []; // Return an object with methods that forward to the logging service // with the provided context @@ -28,7 +62,10 @@ export function logger(): LoggerApi { * @param additionalContext Optional context data specific to this log message. */ trace: (message: string, additionalContext?: LoggerContext): void => { - loggingService.trace(message, mergeContexts(context, additionalContext)); + loggingService.trace( + message, + mergeContexts(context, ctxFn, additionalContext), + ); }, /** * Logs debug information with optional additional context. @@ -36,7 +73,10 @@ export function logger(): LoggerApi { * @param additionalContext Optional context data specific to this log message. */ debug: (message: string, additionalContext?: LoggerContext): void => { - loggingService.debug(message, mergeContexts(context, additionalContext)); + loggingService.debug( + message, + mergeContexts(context, ctxFn, additionalContext), + ); }, /** * Logs informational messages with optional additional context. @@ -44,7 +84,10 @@ export function logger(): LoggerApi { * @param additionalContext Optional context data specific to this log message. */ info: (message: string, additionalContext?: LoggerContext): void => { - loggingService.info(message, mergeContexts(context, additionalContext)); + loggingService.info( + message, + mergeContexts(context, ctxFn, additionalContext), + ); }, /** * Logs warning messages with optional additional context. @@ -52,7 +95,10 @@ export function logger(): LoggerApi { * @param additionalContext Optional context data specific to this log message. */ warn: (message: string, additionalContext?: LoggerContext): void => { - loggingService.warn(message, mergeContexts(context, additionalContext)); + loggingService.warn( + message, + mergeContexts(context, ctxFn, additionalContext), + ); }, /** * Logs error messages with optional error object and additional context. @@ -68,24 +114,37 @@ export function logger(): LoggerApi { loggingService.error( message, error, - mergeContexts(context, additionalContext), + mergeContexts(context, ctxFn, additionalContext), ); }, }; } /** - * Merges component-level context (potentially multiple contexts) with message-specific context. - * @param baseContext The array of component-level contexts provided via `provideLoggerContext`. - * @param additionalContext The message-specific context provided in the log call. - * @returns The merged context object containing properties from all provided contexts. + * Merges multiple levels of context into a single object. + * Handles context priority and merging based on the logging system's hierarchy: + * Component context -> Instance context -> Message context + * + * @param baseContext - Array of component-level contexts from provideLoggerContext + * @param injectorContext - Optional function returning instance-level context + * @param additionalContext - Message-specific context provided in the log call + * @returns A merged context object containing properties from all provided contexts + * + * @internal */ function mergeContexts( baseContext: LoggerContext[] | null, + injectorContext?: () => LoggerContext, additionalContext?: LoggerContext, ): LoggerContext { const contextArray = Array.isArray(baseContext) ? baseContext : []; + const injectorCtx = injectorContext ? injectorContext() : {}; + + if (injectorCtx && typeof injectorCtx === 'object') { + contextArray.push(injectorCtx); + } + if (typeof additionalContext === 'object') { contextArray.push(additionalContext); } diff --git a/libs/core/logging/src/lib/logging.providers.ts b/libs/core/logging/src/lib/logging.providers.ts index 6ab45a436..7fd21b80b 100644 --- a/libs/core/logging/src/lib/logging.providers.ts +++ b/libs/core/logging/src/lib/logging.providers.ts @@ -10,18 +10,27 @@ import { LogLevel } from './log-level.enum'; import { LoggingService } from './logging.service'; import { LoggerContext, LoggingConfig, Sink, SinkFn } from './logging.types'; -// Injection tokens for the Logger API -export const LOGGER_CONFIG = new InjectionToken('LOGGER_CONFIG'); /** - * Injection token for providing hierarchical logger context. - * Allows multiple contexts to be provided and merged. + * Injection token for the logger configuration. + * Used internally by the logging service to configure its behavior. + * @internal + */ +export const LOGGER_CONFIG = new InjectionToken('LOGGER_CONFIG'); + +/** + * Injection token for hierarchical logger context. + * Allows components and services to provide context that will be included + * in all log messages within their scope. + * @internal */ export const LOGGER_CONTEXT = new InjectionToken( 'LOGGER_CONTEXT', ); /** - * Configuration data for the logging system + * Configuration data interface for the logging system. + * Used internally to represent partial configuration updates. + * @internal */ interface LoggingConfigData { level?: LogLevel; @@ -30,7 +39,8 @@ interface LoggingConfigData { } /** - * Configures the LoggingService during app initialization + * Configures the LoggingService during application initialization. + * @internal */ export function configureLogger( loggingService: LoggingService, @@ -42,39 +52,153 @@ export function configureLogger( } /** - * Helper function to set the log level - * @param level The log level to set + * Sets the minimum log level for the logging system. + * Messages below this level will be ignored. + * + * @param level - The minimum log level to process + * @returns Configuration object for the logging system + * + * @example + * ```typescript + * import { isDevMode } from '@angular/core'; + * import { provideLogging, withLogLevel, LogLevel } from '@isa/core/logging'; + * + * // In app.config.ts + * export const appConfig: ApplicationConfig = { + * providers: [ + * provideLogging( + * withLogLevel(isDevMode() ? LogLevel.Debug : LogLevel.Warn) + * ) + * ] + * }; + * ``` */ export function withLogLevel(level: LogLevel): LoggingConfigData { return { level }; } /** - * Helper function to add a sink to the configuration - * @param sink The sink to add (instance or class reference) + * Adds a logging sink (destination) to the configuration. + * A sink can be provided as an instance, a class reference, or a factory function. + * + * @param sink - The sink to add (instance or class reference) + * @returns Configuration object for the logging system + * + * @example + * ```typescript + * import { provideLogging, withSink, ConsoleLogSink } from '@isa/core/logging'; + * + * // In app.config.ts + * export const appConfig: ApplicationConfig = { + * providers: [ + * provideLogging( + * withSink(ConsoleLogSink), // Using class reference + * withSink(new CustomLogSink()) // Using instance + * ) + * ] + * }; + * ``` */ export function withSink(sink: Sink | Type): LoggingConfigData { return { sinks: [sink] }; } /** - * Helper function to add a sink function to the configuration - * @param sinkFn The sink function to add + * Adds a sink function to the logging configuration. + * Sink functions are useful when the sink needs access to injected dependencies. + * + * @param sinkFn - Factory function that creates the sink + * @returns Configuration object for the logging system + * + * @example + * ```typescript + * import { provideLogging, withSinkFn } from '@isa/core/logging'; + * + * const remoteSink: SinkFn = () => { + * const http = inject(HttpClient); + * return (level, message, context) => { + * http.post('/logs', { level, message, context }).subscribe(); + * }; + * }; + * + * // In app.config.ts + * export const appConfig: ApplicationConfig = { + * providers: [ + * provideLogging( + * withSinkFn(remoteSink) + * ) + * ] + * }; + * ``` */ export function withSinkFn(sinkFn: SinkFn): LoggingConfigData { return { sinks: [sinkFn] }; } /** - * Helper function to add global context to the logger configuration - * @param context The context object to add to all log messages + * Adds global context to the logger configuration. + * This context will be included in all log messages. + * + * @param context - The context object to add to all log messages + * @returns Configuration object for the logging system + * + * @example + * ```typescript + * import { provideLogging, withContext } from '@isa/core/logging'; + * + * // In app.config.ts + * export const appConfig: ApplicationConfig = { + * providers: [ + * provideLogging( + * withContext({ + * version: '1.0.0', + * environment: 'production' + * }) + * ) + * ] + * }; + * ``` */ export function withContext(context: LoggerContext): LoggingConfigData { return { context }; } /** - * Provides logging functionality with the given configuration + * Provides logging functionality for the application. + * This is the main configuration entry point for the logging system. + * + * Features: + * - Configure minimum log level + * - Add multiple logging destinations (sinks) + * - Set global context for all log messages + * - Flexible configuration through builder functions + * + * @param configs - Array of configuration objects created by builder functions + * @returns Environment providers for the logging system + * + * @example + * ```typescript + * import { ApplicationConfig, isDevMode } from '@angular/core'; + * import { + * provideLogging, + * withLogLevel, + * withSink, + * withContext, + * LogLevel, + * ConsoleLogSink + * } from '@isa/core/logging'; + * + * // In app.config.ts + * export const appConfig: ApplicationConfig = { + * providers: [ + * provideLogging( + * withLogLevel(isDevMode() ? LogLevel.Debug : LogLevel.Warn), + * withSink(ConsoleLogSink), + * withContext({ app: 'MyApp', version: '1.0.0' }) + * ) + * ] + * }; + * ``` */ export function provideLogging( ...configs: LoggingConfigData[] @@ -118,8 +242,34 @@ export function provideLogging( /** * Provides a context object for logging within a specific component or module scope. - * Multiple contexts can be provided at different levels and will be merged. - * @param context The context object to provide for this scope. + * This context will be merged with other contexts in the hierarchy when logging. + * + * @param context - The context object to provide for this scope + * @returns Provider array for the context + * + * @example + * ```typescript + * import { Component } from '@angular/core'; + * import { logger, provideLoggerContext } from '@isa/core/logging'; + * + * @Component({ + * selector: 'app-user-profile', + * providers: [ + * provideLoggerContext({ + * component: 'UserProfile', + * section: 'Account' + * }) + * ] + * }) + * export class UserProfileComponent { + * #logger = logger(); + * + * ngOnInit(): void { + * // Log will include the component context automatically + * this.#logger.info('Component initialized'); + * } + * } + * ``` */ export function provideLoggerContext(context: LoggerContext): Provider[] { return [ diff --git a/libs/core/logging/src/lib/logging.service.ts b/libs/core/logging/src/lib/logging.service.ts index 70969bd58..34f219d2d 100644 --- a/libs/core/logging/src/lib/logging.service.ts +++ b/libs/core/logging/src/lib/logging.service.ts @@ -9,8 +9,31 @@ import { } from './logging.types'; /** - * The main service for logging functionality. - * Implements the LoggerApi interface to provide logging methods. + * The main service for logging functionality in the ISA Frontend application. + * Implements the LoggerApi interface to provide centralized logging methods. + * + * Features: + * - Multiple log levels (trace, debug, info, warn, error) + * - Support for multiple logging sinks + * - Global context for all log messages + * - Performance optimized with level caching + * - Error resilience to prevent logging failures from affecting the application + * + * @example + * ```typescript + * @Injectable() + * class MyService { + * constructor(private loggingService: LoggingService) { + * this.loggingService.info('MyService initialized'); + * } + * + * handleError(error: Error): void { + * this.loggingService.error('Operation failed', error, { + * operationId: '12345' + * }); + * } + * } + * ``` */ @Injectable({ providedIn: 'root' }) export class LoggingService implements LoggerApi { @@ -25,7 +48,7 @@ export class LoggingService implements LoggerApi { > = []; private globalContext?: LoggerContext; - // Cache log level indexes for performance + /** Cache log level indexes for faster level comparisons */ private readonly LOG_LEVEL_ORDER: Record = { [LogLevel.Trace]: 0, [LogLevel.Debug]: 1, @@ -37,7 +60,20 @@ export class LoggingService implements LoggerApi { /** * Configures the logging service with the provided options. - * @param config The logging configuration options, including level, sinks, and global context. + * + * @param config - The logging configuration object + * @param config.level - The minimum log level to process + * @param config.sinks - Array of logging destinations (console, remote service, etc.) + * @param config.context - Optional global context added to all log messages + * + * @example + * ```typescript + * loggingService.configure({ + * level: LogLevel.Debug, + * sinks: [new ConsoleLogSink()], + * context: { environment: 'production' } + * }); + * ``` */ configure(config: LoggingConfig): void { this.level = config.level; @@ -64,46 +100,69 @@ export class LoggingService implements LoggerApi { } /** - * Logs trace information. - * @param message The log message. - * @param context Optional context data specific to this log message. + * Logs a trace message with optional context data. + * Use for fine-grained debugging information. + * + * @param message - The message to log + * @param context - Optional metadata or structured data to include */ trace(message: string, context?: LoggerContext): void { this.log(LogLevel.Trace, message, context); } /** - * Logs debug information. - * @param message The log message. - * @param context Optional context data specific to this log message. + * Logs a debug message with optional context data. + * Use for development-time debugging information. + * + * @param message - The message to log + * @param context - Optional metadata or structured data to include */ debug(message: string, context?: LoggerContext): void { this.log(LogLevel.Debug, message, context); } /** - * Logs informational messages. - * @param message The log message. - * @param context Optional context data specific to this log message. + * Logs an informational message with optional context data. + * Use for general runtime information and application flow. + * + * @param message - The message to log + * @param context - Optional metadata or structured data to include */ info(message: string, context?: LoggerContext): void { this.log(LogLevel.Info, message, context); } /** - * Logs warning messages. - * @param message The log message. - * @param context Optional context data specific to this log message. + * Logs a warning message with optional context data. + * Use for potentially harmful situations that don't prevent operation. + * + * @param message - The message to log + * @param context - Optional metadata or structured data to include */ warn(message: string, context?: LoggerContext): void { this.log(LogLevel.Warn, message, context); } /** - * Logs error messages. - * @param message The log message. - * @param error Optional error object. - * @param context Optional context data specific to this log message. + * Logs an error message with an optional error object and context data. + * Use for error conditions that affect functionality. + * + * @param message - The error message to log + * @param error - Any error object or value that caused this error condition + * @param context - Optional metadata or structured data to include + * + * @example + * ```typescript + * try { + * // Some operation + * } catch (error) { + * this.loggingService.error( + * 'Failed to process data', + * error as Error, + * { operationId: '12345' } + * ); + * } + * ``` */ error(message: string, error?: Error, context?: LoggerContext): void { this.log(LogLevel.Error, message, context, error); diff --git a/libs/core/logging/src/lib/logging.types.ts b/libs/core/logging/src/lib/logging.types.ts index 5373cce31..609e81971 100644 --- a/libs/core/logging/src/lib/logging.types.ts +++ b/libs/core/logging/src/lib/logging.types.ts @@ -3,14 +3,36 @@ import { Type } from '@angular/core'; /** * Represents a destination where log messages are sent. + * Implement this interface to create custom logging destinations like + * console logging, remote logging services, or file logging. + * + * @example + * ```typescript + * @Injectable() + * export class CustomLogSink implements Sink { + * log( + * level: LogLevel, + * message: string, + * context?: LoggerContext, + * error?: Error + * ): void { + * // Custom logging implementation + * if (level === LogLevel.Error) { + * // Send to monitoring service + * this.monitoringService.reportError(message, error, context); + * } + * } + * } + * ``` */ export interface Sink { /** * Method called by the LoggingService to send a log entry to this sink. - * @param level The log level of the message. - * @param message The log message string. - * @param context Optional context data associated with the log message. - * @param error Optional error object associated with the log message. + * + * @param level - The severity level of the log message + * @param message - The main log message content + * @param context - Optional structured data or metadata about the log event + * @param error - Optional error object when logging errors */ log( level: LogLevel, @@ -21,9 +43,32 @@ export interface Sink { } /** - * A factory function that returns a logging function conforming to the Sink interface. - * Allows for dependency injection or setup logic within the factory. - * @returns A function that handles logging a message. + * A factory function that creates a logging sink function. + * Useful when the sink needs access to injected dependencies or + * requires initialization logic. + * + * @returns A function matching the Sink.log method signature + * + * @example + * ```typescript + * export const httpLogSink: SinkFn = () => { + * const http = inject(HttpClient); + * const config = inject(ConfigService); + * + * return (level, message, context?, error?) => { + * http.post(config.loggingEndpoint, { + * level, + * message, + * context, + * error: error && { + * name: error.name, + * message: error.message, + * stack: error.stack + * } + * }).subscribe(); + * }; + * }; + * ``` */ export type SinkFn = () => ( level: LogLevel, @@ -34,35 +79,87 @@ export type SinkFn = () => ( /** * Configuration options for the logging service. + * Used to set up the logging behavior during application initialization. */ export interface LoggingConfig { - /** The minimum log level to process. */ + /** The minimum log level to process. Messages below this level are ignored. */ level: LogLevel; - /** An array of sinks (instances, classes, or factory functions) to send logs to. */ + + /** + * An array of logging destinations where messages will be sent. + * Can be sink instances, classes, or factory functions. + */ sinks: (Sink | SinkFn | Type)[]; - /** Optional global context to be included with every log message. */ + + /** + * Optional global context included with every log message. + * Useful for adding application-wide metadata like version or environment. + */ context?: LoggerContext; } /** - * Represents the public API for logging operations provided by the logger factory. + * Represents the public API for logging operations. + * This interface is returned by the logger factory and provides + * methods for logging at different severity levels. */ export interface LoggerApi { - /** Logs a trace message with optional context. */ + /** + * Logs a trace message with optional context. + * Use for fine-grained debugging information. + */ trace(message: string, context?: LoggerContext): void; - /** Logs a debug message with optional context. */ + + /** + * Logs a debug message with optional context. + * Use for development-time debugging information. + */ debug(message: string, context?: LoggerContext): void; - /** Logs an info message with optional context. */ + + /** + * Logs an info message with optional context. + * Use for general runtime information. + */ info(message: string, context?: LoggerContext): void; - /** Logs a warning message with optional context. */ + + /** + * Logs a warning message with optional context. + * Use for potentially harmful situations. + */ warn(message: string, context?: LoggerContext): void; - /** Logs an error message with an optional error object and context. */ - error(message: string, error?: Error, context?: LoggerContext): void; + + /** + * Logs an error message with an optional error object and context. + * Use for error conditions that affect functionality. + * + * @param message - The error message to log + * @param error - Any error object or value that caused this error condition + * @param context - Optional context data associated with the error + */ + error(message: string, error: unknown, context?: LoggerContext): void; } /** * Represents context data associated with a log message. - * It's an object where keys are strings and values can be of any type. + * Context allows adding structured metadata to log messages, + * making them more informative and easier to filter/analyze. + * + * @example + * ```typescript + * // Component context + * const context: LoggerContext = { + * component: 'UserProfile', + * userId: '12345', + * action: 'save' + * }; + * + * // Error context + * const errorContext: LoggerContext = { + * operationId: 'op-123', + * attemptNumber: 3, + * inputData: { ... } + * }; + * ``` */ export interface LoggerContext { [key: string]: unknown; diff --git a/libs/oms/data-access/src/lib/errors/index.ts b/libs/oms/data-access/src/lib/errors/index.ts index 4797ae6aa..df64c2f27 100644 --- a/libs/oms/data-access/src/lib/errors/index.ts +++ b/libs/oms/data-access/src/lib/errors/index.ts @@ -1,2 +1,3 @@ export * from './oms.error'; -export * from './return-process.error'; +export * from './return-process'; +export * from './return-search.error'; diff --git a/libs/oms/data-access/src/lib/errors/return-process.error.ts b/libs/oms/data-access/src/lib/errors/return-process.error.ts deleted file mode 100644 index 49c366130..000000000 --- a/libs/oms/data-access/src/lib/errors/return-process.error.ts +++ /dev/null @@ -1,36 +0,0 @@ -import { OmsError } from './oms.error'; - -export const ReturnProcessErrorCode = { - NO_RETURNABLE_ITEMS: 'NO_RETURNABLE_ITEMS', - MISMATCH_RETURNABLE_ITEMS: 'MISMATCH_RETURNABLE_ITEMS', -} as const; - -export type ReturnProcessErrorCode = - (typeof ReturnProcessErrorCode)[keyof typeof ReturnProcessErrorCode]; - -export class ReturnProcessError extends OmsError { - constructor( - public readonly code: ReturnProcessErrorCode, - message?: string, - ) { - super(message || code); - } -} - -export class ReturnProcessNoReturnableItemsError extends ReturnProcessError { - constructor(params: { processId: number; receiptId: number }) { - super( - ReturnProcessErrorCode.NO_RETURNABLE_ITEMS, - `No returnable items found for process id ${params.processId} and receipt id ${params.receiptId}.`, - ); - } -} - -export class ReturnProcessMismatchReturnableItemsError extends ReturnProcessError { - constructor(params: { processId: number; items: number; returnableItems: number }) { - super( - ReturnProcessErrorCode.MISMATCH_RETURNABLE_ITEMS, - `Mismatch in returnable items for process id ${params.processId}. Expected ${params.items} returnable items, but found ${params.returnableItems}.`, - ); - } -} diff --git a/libs/oms/data-access/src/lib/errors/return-process/create-return-process.error.test.ts b/libs/oms/data-access/src/lib/errors/return-process/create-return-process.error.test.ts new file mode 100644 index 000000000..9b58e852b --- /dev/null +++ b/libs/oms/data-access/src/lib/errors/return-process/create-return-process.error.test.ts @@ -0,0 +1,53 @@ +import { DataAccessError } from '@isa/common/data-access'; +import { ReceiptItem } from '../../models'; +import { + CreateReturnProcessError, + CreateReturnProcessErrorReason, + CreateReturnProcessErrorMessages, +} from './create-return-process.error'; + +describe('CreateReturnProcessError', () => { + const params = { + processId: 123, + receiptId: 456, + items: [] as ReceiptItem[], + }; + + it('should create an error instance with NO_RETURNABLE_ITEMS reason', () => { + const error = new CreateReturnProcessError( + CreateReturnProcessErrorReason.NO_RETURNABLE_ITEMS, + params, + ); + expect(error).toBeInstanceOf(CreateReturnProcessError); + expect(error).toBeInstanceOf(DataAccessError); + expect(error.reason).toBe( + CreateReturnProcessErrorReason.NO_RETURNABLE_ITEMS, + ); + expect(error.params).toEqual(params); + expect(error.message).toBe( + CreateReturnProcessErrorMessages[ + CreateReturnProcessErrorReason.NO_RETURNABLE_ITEMS + ], + ); + expect(error.code).toBe('CREATE_RETURN_PROCESS'); + }); + + it('should create an error instance with MISMATCH_RETURNABLE_ITEMS reason', () => { + const error = new CreateReturnProcessError( + CreateReturnProcessErrorReason.MISMATCH_RETURNABLE_ITEMS, + params, + ); + expect(error).toBeInstanceOf(CreateReturnProcessError); + expect(error).toBeInstanceOf(DataAccessError); + expect(error.reason).toBe( + CreateReturnProcessErrorReason.MISMATCH_RETURNABLE_ITEMS, + ); + expect(error.params).toEqual(params); + expect(error.message).toBe( + CreateReturnProcessErrorMessages[ + CreateReturnProcessErrorReason.MISMATCH_RETURNABLE_ITEMS + ], + ); + expect(error.code).toBe('CREATE_RETURN_PROCESS'); + }); +}); diff --git a/libs/oms/data-access/src/lib/errors/return-process/create-return-process.error.ts b/libs/oms/data-access/src/lib/errors/return-process/create-return-process.error.ts new file mode 100644 index 000000000..bf9317c16 --- /dev/null +++ b/libs/oms/data-access/src/lib/errors/return-process/create-return-process.error.ts @@ -0,0 +1,87 @@ +import { DataAccessError } from '@isa/common/data-access'; +import { Receipt, ReceiptItem } from '../../models'; + +/** + * Enum-like object defining possible reasons for return process creation failures. + * Used to provide consistent and type-safe error categorization. + */ +export const CreateReturnProcessErrorReason = { + NO_RETURNABLE_ITEMS: 'NO_RETURNABLE_ITEMS', + MISMATCH_RETURNABLE_ITEMS: 'MISMATCH_RETURNABLE_ITEMS', +} as const; + +/** + * Type representing valid reasons for return process creation failures. + * Derived from CreateReturnProcessErrorReason keys for type safety. + */ +export type CreateReturnProcessErrorReason = + (typeof CreateReturnProcessErrorReason)[keyof typeof CreateReturnProcessErrorReason]; + +/** + * Maps error reasons to their corresponding user-friendly messages. + * Used to provide consistent error messaging across the application. + * + * @example + * To access a message: + * ```typescript + * const message = CreateReturnProcessErrorMessages[CreateReturnProcessErrorReason.NO_RETURNABLE_ITEMS]; + * ``` + */ +export const CreateReturnProcessErrorMessages: Record< + CreateReturnProcessErrorReason, + string +> = { + [CreateReturnProcessErrorReason.NO_RETURNABLE_ITEMS]: + 'No returnable items found.', + [CreateReturnProcessErrorReason.MISMATCH_RETURNABLE_ITEMS]: + 'Mismatch in the number of returnable items.', +}; + +/** + * Error thrown when creating a return process fails. + * Extends DataAccessError with the specific code 'CREATE_RETURN_PROCESS' and includes + * additional context about the failure through the reason and params properties. + * + * The error includes: + * - An error reason indicating why the process failed (e.g., no returnable items) + * - Context data including process ID, receipt ID, and involved items + * - A human-readable message from CreateReturnProcessErrorMessages + * + * @see CreateReturnProcessErrorReason for possible error reasons + * @see CreateReturnProcessErrorMessages for corresponding messages + * + * @example + * ```typescript + * throw new CreateReturnProcessError( + * CreateReturnProcessErrorReason.NO_RETURNABLE_ITEMS, + * { + * processId: 123, + * receipt: { id: 456, printedDate: '2023-10-01' }, + * items: [] + * } + * ); + * + * // Handling the error + * try { + * // ... create return process + * } catch (error) { + * if (error instanceof CreateReturnProcessError) { + * if (error.reason === CreateReturnProcessErrorReason.NO_RETURNABLE_ITEMS) { + * // Handle no returnable items case + * } + * } + * } + * ``` + */ +export class CreateReturnProcessError extends DataAccessError<'CREATE_RETURN_PROCESS'> { + constructor( + public readonly reason: CreateReturnProcessErrorReason, + public readonly params: { + processId: number; + receipt: Receipt; + items: ReceiptItem[]; + }, + ) { + super('CREATE_RETURN_PROCESS', CreateReturnProcessErrorMessages[reason]); + } +} diff --git a/libs/oms/data-access/src/lib/errors/return-process/index.ts b/libs/oms/data-access/src/lib/errors/return-process/index.ts new file mode 100644 index 000000000..d5f9bdceb --- /dev/null +++ b/libs/oms/data-access/src/lib/errors/return-process/index.ts @@ -0,0 +1,2 @@ +export * from './create-return-process.error'; +export * from './return-process-is-not-complete.error'; diff --git a/libs/oms/data-access/src/lib/errors/return-process/return-process-is-not-complete.error.test.ts b/libs/oms/data-access/src/lib/errors/return-process/return-process-is-not-complete.error.test.ts new file mode 100644 index 000000000..b8d400f58 --- /dev/null +++ b/libs/oms/data-access/src/lib/errors/return-process/return-process-is-not-complete.error.test.ts @@ -0,0 +1,29 @@ +import { ReturnProcessIsNotCompleteError } from './return-process-is-not-complete.error'; + +describe('ReturnProcessIsNotCompleteError', () => { + const processId = 123; + const returnProcessId = 456; + let error: ReturnProcessIsNotCompleteError; + + beforeEach(() => { + error = new ReturnProcessIsNotCompleteError(processId, returnProcessId); + }); + + it('should instantiate the error with the given processIds', () => { + expect(error.processId).toBe(processId); + expect(error.returnProcessId).toBe(returnProcessId); + }); + + it('should create the correct error message', () => { + const expectedMessage = `Return process with ID "456" is not complete for process ID "123".`; + expect(error.message).toBe(expectedMessage); + }); + + it('should have the correct error code', () => { + expect(error.code).toBe('RETURN_PROCESS_IS_NOT_COMPLETE'); + }); + + it('should be an instance of Error', () => { + expect(error).toBeInstanceOf(Error); + }); +}); diff --git a/libs/oms/data-access/src/lib/errors/return-process/return-process-is-not-complete.error.ts b/libs/oms/data-access/src/lib/errors/return-process/return-process-is-not-complete.error.ts new file mode 100644 index 000000000..ceea830b6 --- /dev/null +++ b/libs/oms/data-access/src/lib/errors/return-process/return-process-is-not-complete.error.ts @@ -0,0 +1,31 @@ +import { DataAccessError } from '@isa/common/data-access'; + +/** + * Error thrown when a return process has not completed all required steps. + * This typically occurs when trying to finalize a return process that still has + * pending questions or missing information. + * + * @extends {DataAccessError<'RETURN_PROCESS_IS_NOT_COMPLETE'>} + * + * @param processId - The ID of the process containing the incomplete return + * @param returnProcessId - The ID of the specific return process that is incomplete + * + * @example + * ```typescript + * // When attempting to complete a return process that isn't finished + * if (!isProcessComplete(returnProcess)) { + * throw new ReturnProcessIsNotCompleteError(processId, returnProcessId); + * } + * ``` + */ +export class ReturnProcessIsNotCompleteError extends DataAccessError<'RETURN_PROCESS_IS_NOT_COMPLETE'> { + constructor( + public readonly processId: number, + public readonly returnProcessId: number, + ) { + super( + 'RETURN_PROCESS_IS_NOT_COMPLETE', + `Return process with ID "${returnProcessId}" is not complete for process ID "${processId}".`, + ); + } +} diff --git a/libs/oms/data-access/src/lib/errors/return-search.error.ts b/libs/oms/data-access/src/lib/errors/return-search.error.ts index a10315af2..08944f659 100644 --- a/libs/oms/data-access/src/lib/errors/return-search.error.ts +++ b/libs/oms/data-access/src/lib/errors/return-search.error.ts @@ -1,4 +1,4 @@ -import { ListResponseArgs } from '@isa/common/result'; +import { ListResponseArgs } from '@isa/common/data-access'; import { QueryTokenInput } from '../schemas'; import { ReceiptListItem } from '../models'; diff --git a/libs/oms/data-access/src/lib/helpers/return-process/active-return-process-questions.helper.ts b/libs/oms/data-access/src/lib/helpers/return-process/active-return-process-questions.helper.ts new file mode 100644 index 000000000..74f1a9fc3 --- /dev/null +++ b/libs/oms/data-access/src/lib/helpers/return-process/active-return-process-questions.helper.ts @@ -0,0 +1,107 @@ +import { + ReturnProcessAnswers, + ReturnProcessQuestion, + ReturnProcessQuestionType, +} from '../../models'; +import { ReturnProcessQuestionSchema } from '../../questions'; +import { ReturnProcessChecklistAnswerSchema } from '../../schemas'; + +/** + * Determines which questions in a return process flow are currently active based on previous answers. + * The function handles different question types and their dependencies, preventing infinite loops + * from cyclic dependencies. + * + * @param questions - Array of possible questions in the return process + * @param answers - Current answers provided for the questions + * @returns Array of currently active questions based on the provided answers + * @throws {Error} If a cyclic dependency is detected in the question flow + * @throws {PropertyNullOrUndefinedError} If questions or answers parameters are null/undefined + * + * @example + * ```typescript + * const questions = [ + * { key: 'condition', type: ReturnProcessQuestionType.Select, options: [...] }, + * { key: 'reason', type: ReturnProcessQuestionType.Select, options: [...] } + * ]; + * const answers = { condition: 'damaged' }; + * + * const activeQuestions = activeReturnProcessQuestions(questions, answers); + * ``` + */ +export function activeReturnProcessQuestions( + questions: ReturnProcessQuestion[], + answers: ReturnProcessAnswers, +): ReturnProcessQuestion[] { + return internalActiveReturnProcessQuestions(questions, answers).questions; +} + +function internalActiveReturnProcessQuestions( + questions: ReturnProcessQuestion[], + answers: ReturnProcessAnswers, +): { questions: ReturnProcessQuestion[]; nextQuestion?: string } { + let questionKey: string | undefined = questions[0].key; + const result: ReturnProcessQuestion[] = []; + const visited = new Set(); + + while (questionKey) { + if (visited.has(questionKey)) { + throw new Error('Cyclic question dependency detected'); + } + visited.add(questionKey); + + const question = questions.find((q) => q.key === questionKey); + if (question) { + result.push(question); + questionKey = undefined; + + const schema = ReturnProcessQuestionSchema[question.key]; + + const parseResult = schema.safeParse(answers[question.key]); + + if (!parseResult.success) { + break; + } + + if (question.type === ReturnProcessQuestionType.Select) { + const option = question.options.find( + (o) => o.value === answers[question.key], + ); + questionKey = option?.nextQuestion; + } else if (question.type === ReturnProcessQuestionType.Product) { + questionKey = answers[question.key] ? question.nextQuestion : undefined; + } else if (question.type === ReturnProcessQuestionType.Checklist) { + const answer = ReturnProcessChecklistAnswerSchema.optional().parse( + answers[question.key], + ); + + if ((answer && answer.options?.length) || (answer && answer.other)) { + questionKey = question.nextQuestion; + } else { + questionKey = undefined; + } + } else if (question.type === ReturnProcessQuestionType.Info) { + questionKey = question.nextQuestion; + } else if (question.type === ReturnProcessQuestionType.Group) { + const groupQuestions = internalActiveReturnProcessQuestions( + question.questions, + answers, + ); + + const questionGroup = { + ...question, + questions: groupQuestions.questions, + }; + + result[result.length - 1] = questionGroup; // Replace the group question with the updated one + + questionKey = groupQuestions.nextQuestion; // No next question for group type + } else { + break; + } + } else { + break; + } + } + + return { questions: result, nextQuestion: questionKey }; +} diff --git a/libs/oms/data-access/src/lib/helpers/return-process/all-return-process-questions-answered.helper.ts b/libs/oms/data-access/src/lib/helpers/return-process/all-return-process-questions-answered.helper.ts new file mode 100644 index 000000000..4c8cb9c2b --- /dev/null +++ b/libs/oms/data-access/src/lib/helpers/return-process/all-return-process-questions-answered.helper.ts @@ -0,0 +1,84 @@ +import { isEmpty } from 'lodash'; +import { ReturnProcessAnswers, ReturnProcessQuestion } from '../../models'; +import { activeReturnProcessQuestions } from './active-return-process-questions.helper'; +import { ReturnProcessQuestionSchema } from '../../questions'; + +/** + * Union type for parameters accepted by allReturnProcessQuestionsAnswered. + * Allows passing either the full question set with answers or just the active questions with answers. + * This flexibility enables performance optimization by avoiding recalculation of active questions + * when they are already known. + */ +export type AllReturnProcessQuestionsAnsweredParams = + | { + questions: ReturnProcessQuestion[]; + answers: ReturnProcessAnswers; + } + | { + activeQuestions: ReturnProcessQuestion[]; + answers: ReturnProcessAnswers; + }; + +/** + * Checks if all required questions in a return process have been answered. + * + * This function verifies that all questions that should be answered based on the current + * state of the return process have valid answers. It can work with either the full set + * of questions or just the active questions to optimize performance. + * + * Features: + * - Validates all answers using schema validation + * - Supports both full question sets and pre-filtered active questions + * - Handles special validation for checklist-type questions + * - Returns undefined for edge cases where no questions exist + * + * @param params - Object containing either the full questions array or active questions array, and the current answers + * @returns + * - `true` if all required questions have valid answers + * - `false` if any required question is missing an answer or has an invalid answer + * - `undefined` if there are no questions to validate + * + * @example + * ```typescript + * // Using full question set + * const allAnswered = allReturnProcessQuestionsAnswered({ + * questions: returnProcessQuestions, + * answers: currentAnswers + * }); + * + * // Using active questions + * const allAnswered = allReturnProcessQuestionsAnswered({ + * activeQuestions: activeQuestions, + * answers: currentAnswers + * }); + * ``` + */ +export function allReturnProcessQuestionsAnswered( + params: AllReturnProcessQuestionsAnsweredParams, +): boolean | undefined { + if (isEmpty(params.answers)) { + return false; + } + + let activeQuestions: ReturnProcessQuestion[] | undefined; + + if ('questions' in params && Array.isArray(params.questions)) { + const { questions, answers } = params; + activeQuestions = activeReturnProcessQuestions(questions, answers); + } else if ( + 'activeQuestions' in params && + Array.isArray(params.activeQuestions) + ) { + activeQuestions = params.activeQuestions; + } + + if (!activeQuestions || activeQuestions.length === 0) { + return undefined; + } + + return activeQuestions.every((question) => { + const schema = ReturnProcessQuestionSchema[question.key]; + const parseResult = schema.safeParse(params.answers[question.key]); + return parseResult.success; + }); +} diff --git a/libs/oms/data-access/src/lib/helpers/return-process/calculate-longest-question-depth.helper.spec.ts b/libs/oms/data-access/src/lib/helpers/return-process/calculate-longest-question-depth.helper.spec.ts new file mode 100644 index 000000000..5f058bf21 --- /dev/null +++ b/libs/oms/data-access/src/lib/helpers/return-process/calculate-longest-question-depth.helper.spec.ts @@ -0,0 +1,120 @@ +import * as helpers from './calculate-longest-question-depth.helper'; +import { + ReturnProcessQuestion, + ReturnProcessQuestionType, + ReturnProcessAnswers, + ReturnProcessQuestionKey, +} from '../../models'; +import { tolinoQuestions } from '../../questions/tolino'; +import { ItemConditionAnswer } from '../../questions'; + +describe('calculateLongestQuestionDepth', () => { + // Setup test data + const mockQuestions: ReturnProcessQuestion[] = [ + { + key: ReturnProcessQuestionKey.ItemCondition, + type: ReturnProcessQuestionType.Select, + description: 'Question 1', + options: [ + { + label: 'Option 1', + value: 'opt1', + nextQuestion: ReturnProcessQuestionKey.ReturnReason, + }, + ], + }, + { + key: ReturnProcessQuestionKey.DeliveredItem, + type: ReturnProcessQuestionType.Select, + description: 'Question 3', + options: [], + }, + ]; + + const mockAnswers: ReturnProcessAnswers = { + [ReturnProcessQuestionKey.ItemCondition]: 'opt1', + [ReturnProcessQuestionKey.ItemDefective]: true, + }; + + beforeEach(() => { + // Spy on the internal function while preserving its implementation + jest.spyOn(helpers, 'internalCalculateLongestQuestionDepth'); + }); + + afterEach(() => { + jest.restoreAllMocks(); + }); + + it('should calculate the correct depth for a question flow', () => { + // Arrange + const expectedDepth = 1; // Based on our mock data structure + + // Act + const result = helpers.calculateLongestQuestionDepth( + mockQuestions, + mockAnswers, + ); + + // Assert + expect(result).toBe(expectedDepth); + expect(typeof result).toBe('number'); + }); + + it('should call internalCalculateLongestQuestionDepth with correct parameters', () => { + jest + .spyOn(helpers, 'internalCalculateLongestQuestionDepth') + .mockReturnValue({ depth: 1 }); + + // Arrange & Act + helpers.calculateLongestQuestionDepth(mockQuestions, mockAnswers); + + // Assert + expect(helpers.internalCalculateLongestQuestionDepth).toHaveBeenCalledWith( + mockQuestions, + mockAnswers, + mockQuestions[0].key, + ); + expect(helpers.internalCalculateLongestQuestionDepth).toHaveBeenCalledTimes( + 1, + ); + }); +}); + +describe('internalCalculateLongestQuestionDepth', () => { + const answers: ReturnProcessAnswers = { + [ReturnProcessQuestionKey.ItemCondition]: ItemConditionAnswer.Damaged, + // [ReturnProcessQuestionKey.DevicePower]: YesNoAnswer.Yes, + // [ReturnProcessQuestionKey.PackageComplete]: YesNoAnswer.Yes, + }; + + afterEach(() => { + jest.restoreAllMocks(); + }); + + it('should return depth 0 if no question found', () => { + const expectedDepth = 0; + + const result = helpers.internalCalculateLongestQuestionDepth( + [], + answers, + ReturnProcessQuestionKey.ItemCondition, + ); + + expect(result).toEqual({ depth: expectedDepth }); + }); + + it('should return depth 1 if no question found', () => { + const answers: ReturnProcessAnswers = { + [ReturnProcessQuestionKey.ItemCondition]: ItemConditionAnswer.Damaged, + }; + + const expectedDepth = 8; + + const result = helpers.calculateLongestQuestionDepth( + tolinoQuestions, + answers, + ); + + expect(result).toBe(expectedDepth); + }); +}); diff --git a/libs/oms/data-access/src/lib/helpers/return-process/calculate-longest-question-depth.helper.ts b/libs/oms/data-access/src/lib/helpers/return-process/calculate-longest-question-depth.helper.ts new file mode 100644 index 000000000..0cb0fe932 --- /dev/null +++ b/libs/oms/data-access/src/lib/helpers/return-process/calculate-longest-question-depth.helper.ts @@ -0,0 +1,101 @@ +import { + ReturnProcessAnswers, + ReturnProcessQuestion, + ReturnProcessQuestionKey, + ReturnProcessQuestionType, +} from '../../models'; +import { ReturnProcessQuestionSchema } from '../../questions'; +import { + getAllNextQuestions, + getNextQuestion, +} from './get-next-question.helper'; + +export const calculateLongestQuestionDepth = ( + questions: ReturnProcessQuestion[], + answers: ReturnProcessAnswers, +): number => { + if (questions.length === 0) { + return 0; + } + return internalCalculateLongestQuestionDepth( + questions, + answers, + questions[0].key, + ).depth; +}; + +export const internalCalculateLongestQuestionDepth = ( + questions: ReturnProcessQuestion[], + answers: ReturnProcessAnswers, + questionKey: ReturnProcessQuestionKey, +): { depth: number; nextQuestion?: ReturnProcessQuestionKey } => { + // 1) Frageobjekt finden + const question = questions.find((q) => q.key === questionKey); + if (!question) { + return { depth: 0 }; + } + + // 2) Info-Fragen überspringen (zählen nicht zur Tiefe) + if (question.type === ReturnProcessQuestionType.Info) { + const nextKey = question.nextQuestion; + if (nextKey) { + // direkt zum Kind ohne +1 + return internalCalculateLongestQuestionDepth(questions, answers, nextKey); + } + // keine Folgefrage: Tiefe 0 + return { depth: 0 }; + } + + // 3) Group-Fragen entpacken (zählen ebenfalls nicht selbst zur Tiefe) + if (question.type === ReturnProcessQuestionType.Group) { + const combined = [...question.questions, ...questions]; + return internalCalculateLongestQuestionDepth( + combined, + answers, + question.questions[0].key, + ); + } + + // 4) Prüfen, ob wir schon eine (gültige) Antwort für diese Frage haben + const schema = ReturnProcessQuestionSchema[question.key]; + const parseResult = schema.safeParse(answers[question.key]); + + if (parseResult.success) { + // 4a) Gibt es eine gezielte Folgefrage? + const nextKey = getNextQuestion(question, answers); + if (nextKey) { + const { depth: childDepth, nextQuestion: childNext } = + internalCalculateLongestQuestionDepth(questions, answers, nextKey); + // +1, weil diese Frage selbst zählt (nicht Info, nicht Group) + return { + depth: childDepth + 1, + nextQuestion: childNext, + }; + } + // 4b) Ende des Pfads: zählt noch einmal +1 für diese Frage + return { depth: 1 }; + } + + // 5) Noch keine valide Antwort → alle möglichen Folgefragen ausloten + const possibleNext = getAllNextQuestions(question) || []; + if (possibleNext.length > 0) { + let maxDepth = 0; + let bestNext: ReturnProcessQuestionKey | undefined; + for (const nxt of possibleNext) { + const { depth: d } = internalCalculateLongestQuestionDepth( + questions, + answers, + nxt, + ); + // +1, weil diese Frage selbst zählt + if (d + 1 > maxDepth) { + maxDepth = d + 1; + bestNext = nxt; + } + } + return { depth: maxDepth, nextQuestion: bestNext }; + } + + // 6) Keine weiteren Pfade → nur diese Frage zählt + return { depth: 1 }; +}; diff --git a/libs/oms/data-access/src/lib/helpers/return-process/get-next-question.helper.ts b/libs/oms/data-access/src/lib/helpers/return-process/get-next-question.helper.ts new file mode 100644 index 000000000..7b33e97d8 --- /dev/null +++ b/libs/oms/data-access/src/lib/helpers/return-process/get-next-question.helper.ts @@ -0,0 +1,69 @@ +import { uniq } from 'lodash'; +import { + ReturnProcessAnswers, + ReturnProcessQuestion, + ReturnProcessQuestionKey, +} from '../../models'; +import { ReturnProcessChecklistAnswerSchema } from '../../schemas'; + +export const getNextQuestion = ( + question: ReturnProcessQuestion, + answers: ReturnProcessAnswers, +): ReturnProcessQuestionKey | undefined => { + switch (question.type) { + case 'select': { + const option = question.options.find( + (o) => o.value === answers[question.key], + ); + return option?.nextQuestion; + } + case 'product': + return answers[question.key] ? question.nextQuestion : undefined; + case 'checklist': { + const answer = ReturnProcessChecklistAnswerSchema.optional().parse( + answers[question.key], + ); + return (answer && answer.options?.length) || (answer && answer.other) + ? question.nextQuestion + : undefined; + } + case 'info': + return question.nextQuestion; + case 'group': + return undefined; // Handle group questions separately + default: + console.warn('Implementation Missing for type:', question); + return undefined; + } +}; + +export const getAllNextQuestions = ( + question: ReturnProcessQuestion, +): ReturnProcessQuestionKey[] | undefined => { + switch (question.type) { + case 'select': { + return uniq( + question.options + .map((o) => o.nextQuestion) + .filter(Boolean) as ReturnProcessQuestionKey[], + ); + } + case 'product': + return [question.nextQuestion].filter( + Boolean, + ) as ReturnProcessQuestionKey[]; + case 'checklist': + return [question.nextQuestion].filter( + Boolean, + ) as ReturnProcessQuestionKey[]; + case 'info': + return [question.nextQuestion].filter( + Boolean, + ) as ReturnProcessQuestionKey[]; + case 'group': + return undefined; // Handle group questions separately + default: + console.warn('Implementation Missing for type:', question); + return undefined; + } +}; diff --git a/libs/oms/data-access/src/lib/helpers/return-process/get-return-info.helper.ts b/libs/oms/data-access/src/lib/helpers/return-process/get-return-info.helper.ts new file mode 100644 index 000000000..7b860519b --- /dev/null +++ b/libs/oms/data-access/src/lib/helpers/return-process/get-return-info.helper.ts @@ -0,0 +1,153 @@ +import { isEmpty } from 'lodash'; +import { + Product, + ReturnInfo, + ReturnProcessAnswers, + ReturnProcessQuestion, + ReturnProcessQuestionKey, + ReturnProcessQuestionType, +} from '../../models'; +import { activeReturnProcessQuestions } from './active-return-process-questions.helper'; +import { allReturnProcessQuestionsAnswered } from './all-return-process-questions-answered.helper'; +import { ReturnProcessQuestionSchema } from '../../questions'; + +/** + * Union type for parameters accepted by getReturnInfo. + * Provides flexibility to work with either the full question set or just active questions + * to optimize performance in different scenarios. + */ +export type GetReturnInfoParams = + | { + questions: ReturnProcessQuestion[]; + answers: ReturnProcessAnswers; + } + | { + activeQuestions: ReturnProcessQuestion[]; + answers: ReturnProcessAnswers; + }; + +/** + * Processes return process questions and answers to generate consolidated return information. + * This function aggregates information from various questions and their answers to create + * a comprehensive return info object. + * + * Features: + * - Different question type handling (Select, Product) + * - Answer validation using Zod schemas + * - Circular dependency detection + * - Aggregation of return information from multiple answers + * - Support for both full and filtered question sets + * + * @param params - Object containing either full questions or active questions, and their answers + * @returns Consolidated ReturnInfo object or undefined if: + * - No answers are provided + * - No questions are available + * - Questions are incomplete + * - A cyclic dependency is detected + * + * @throws {Error} If a cyclic dependency is detected in the question flow + * @throws {Error} If an unsupported question type is encountered + * + * @example + * ```typescript + * const returnInfo = getReturnInfo({ + * questions: returnProcessQuestions, + * answers: { + * condition: 'damaged', + * reason: 'defective' + * } + * }); + * ``` + */ +export function getReturnInfo( + params: GetReturnInfoParams, +): ReturnInfo | undefined { + if (isEmpty(params.answers)) { + return undefined; + } + const { answers } = params; + let activeQuestions: ReturnProcessQuestion[] = []; + + if ('questions' in params && Array.isArray(params.questions)) { + activeQuestions = activeReturnProcessQuestions(params.questions, answers); + } else if ( + 'activeQuestions' in params && + Array.isArray(params.activeQuestions) + ) { + activeQuestions = params.activeQuestions; + } + + if (activeQuestions.length === 0) { + return undefined; + } + + if (!allReturnProcessQuestionsAnswered({ activeQuestions, answers })) { + return undefined; + } + + const returnInfo: ReturnInfo = {}; + + let currentQuestionKey: ReturnProcessQuestionKey | undefined = + activeQuestions[0].key; + const circleCheck = new Set(); + + while (currentQuestionKey) { + if (circleCheck.has(currentQuestionKey)) { + throw new Error('Cyclic question dependency detected'); + } + circleCheck.add(currentQuestionKey); + + const question = activeQuestions.find((q) => q.key === currentQuestionKey); + if (!question) { + break; + } + + const answer = answers[question.key]; + + switch (question.type) { + case ReturnProcessQuestionType.Select: { + const selectedOption = question.options.find((o) => o.value === answer); + if (selectedOption?.returnInfo) { + assignReturnInfo(returnInfo, selectedOption.returnInfo); + } + currentQuestionKey = selectedOption?.nextQuestion; + break; + } + // TODO: Checkliste handling + case ReturnProcessQuestionType.Product: { + const parseResult = ReturnProcessQuestionSchema[ + ReturnProcessQuestionKey.DeliveredItem + ] + .passthrough() + .safeParse(answer); + + if (parseResult.success) { + assignReturnInfo(returnInfo, { otherProduct: answer as Product }); + } + + currentQuestionKey = question.nextQuestion; + break; + } + case ReturnProcessQuestionType.Group: { + const groupReturnInfo = getReturnInfo({ + questions: question.questions, + answers, + }); + if (groupReturnInfo) { + assignReturnInfo(returnInfo, groupReturnInfo); + } + break; + } + default: { + throw new Error(`Unsupported question type: ${question.type}`); + } + } + } + + return returnInfo; +} + +// TODO: Je nachdem wie das Backend die Werte braucht hier drin anpassen +function assignReturnInfo(target: ReturnInfo, source: ReturnInfo) { + Object.assign(target, source); +} diff --git a/libs/oms/data-access/src/lib/helpers/return-process/index.ts b/libs/oms/data-access/src/lib/helpers/return-process/index.ts new file mode 100644 index 000000000..ecdf56a06 --- /dev/null +++ b/libs/oms/data-access/src/lib/helpers/return-process/index.ts @@ -0,0 +1,5 @@ +export * from './active-return-process-questions.helper'; +export * from './all-return-process-questions-answered.helper'; +export * from './calculate-longest-question-depth.helper'; +export * from './get-next-question.helper'; +export * from './get-return-info.helper'; diff --git a/libs/oms/data-access/src/lib/models/index.ts b/libs/oms/data-access/src/lib/models/index.ts index 970930ed0..72869bde1 100644 --- a/libs/oms/data-access/src/lib/models/index.ts +++ b/libs/oms/data-access/src/lib/models/index.ts @@ -8,6 +8,7 @@ export * from './receipt-item'; export * from './receipt-list-item'; export * from './receipt-type'; export * from './receipt'; +export * from './return-info'; export * from './return-process-answer'; export * from './return-process-question-key'; export * from './return-process-question-type'; diff --git a/libs/oms/data-access/src/lib/models/product.ts b/libs/oms/data-access/src/lib/models/product.ts index 5c2474cae..69ef208cc 100644 --- a/libs/oms/data-access/src/lib/models/product.ts +++ b/libs/oms/data-access/src/lib/models/product.ts @@ -1,7 +1,12 @@ import { ProductDTO } from '@generated/swagger/oms-api'; export interface Product extends ProductDTO { + name: string; + contributors: string; + catalogProductNumber: string; ean: string; format: string; - formatDetails: string; + formatDetail: string; + volume: string; + manufacturer: string; } diff --git a/libs/oms/data-access/src/lib/models/receipt.ts b/libs/oms/data-access/src/lib/models/receipt.ts index 427aa749d..428f536a0 100644 --- a/libs/oms/data-access/src/lib/models/receipt.ts +++ b/libs/oms/data-access/src/lib/models/receipt.ts @@ -1,5 +1,5 @@ import { ReceiptDTO } from '@generated/swagger/oms-api'; -import { EntityContainer } from '@isa/common/result'; +import { EntityContainer } from '@isa/common/data-access'; import { ReceiptItem } from './receipt-item'; import { Buyer } from './buyer'; diff --git a/libs/oms/data-access/src/lib/models/return-info.ts b/libs/oms/data-access/src/lib/models/return-info.ts new file mode 100644 index 000000000..ee04cadb8 --- /dev/null +++ b/libs/oms/data-access/src/lib/models/return-info.ts @@ -0,0 +1,33 @@ +import { Product } from './product'; + +/** + * Interface representing information collected during a return process. + * This interface captures various aspects of a return request including + * condition details, reasons, and related product information. + */ +export interface ReturnInfo { + /** + * Comment / Anmerkung + */ + comment?: string; + + /** + * Item condition / Artikelzustand + */ + itemCondition?: string; + + /** + * Other product / Anderer Artikel + */ + otherProduct?: Product; + + /** + * Return details / Rückgabedetails + */ + returnDetails?: string; + + /** + * Return reason / Rückgabegrund + */ + returnReason?: string; +} diff --git a/libs/oms/data-access/src/lib/models/return-process-question-key.ts b/libs/oms/data-access/src/lib/models/return-process-question-key.ts index 1110c0d16..48a3c09e8 100644 --- a/libs/oms/data-access/src/lib/models/return-process-question-key.ts +++ b/libs/oms/data-access/src/lib/models/return-process-question-key.ts @@ -6,9 +6,12 @@ export const ReturnProcessQuestionKey = { DisplayCondition: 'display_condition', DevicePower: 'device_power', PackageComplete: 'package_complete', + PackageCompleteGroup: 'package_complete_group', + PackageIncompleteInfo: 'info', PackageIncomplete: 'package_incomplete', CaseCondition: 'case_condition', UsbPort: 'usb_port', + ItemDamaged: 'item_damaged', } as const; export type ReturnProcessQuestionKey = diff --git a/libs/oms/data-access/src/lib/models/return-process-question-type.ts b/libs/oms/data-access/src/lib/models/return-process-question-type.ts index 5342cc971..513bbca73 100644 --- a/libs/oms/data-access/src/lib/models/return-process-question-type.ts +++ b/libs/oms/data-access/src/lib/models/return-process-question-type.ts @@ -2,6 +2,8 @@ export const ReturnProcessQuestionType = { Select: 'select', Product: 'product', Checklist: 'checklist', + Group: 'group', + Info: 'info', } as const; export type ReturnProcessQuestionType = diff --git a/libs/oms/data-access/src/lib/models/return-process-question.ts b/libs/oms/data-access/src/lib/models/return-process-question.ts index b4603c27f..509b59e31 100644 --- a/libs/oms/data-access/src/lib/models/return-process-question.ts +++ b/libs/oms/data-access/src/lib/models/return-process-question.ts @@ -1,5 +1,6 @@ import { ReturnProcessQuestionKey } from './return-process-question-key'; import { ReturnProcessQuestionType } from './return-process-question-type'; +import { ReturnInfo } from './return-info'; export interface ReturnProcessQuestionBase { key: ReturnProcessQuestionKey; @@ -35,6 +36,7 @@ export interface ReturnProcessQuestionSelectOptions extends ReturnProcessQuestionOptions { label: string; value: string; + returnInfo?: ReturnInfo; nextQuestion?: ReturnProcessQuestionKey; } @@ -44,7 +46,21 @@ export interface ReturnProcessProductQuestion nextQuestion?: ReturnProcessQuestionKey; } +export interface ReturnProcessGroupQuestion + extends Omit { + type: typeof ReturnProcessQuestionType.Group; + questions: ReturnProcessQuestion[]; +} + +export interface ReturnProcessInfoQuestion extends ReturnProcessQuestionBase { + type: typeof ReturnProcessQuestionType.Info; + content: string[]; + nextQuestion?: ReturnProcessQuestionKey; +} + export type ReturnProcessQuestion = | ReturnProcessSelectQuestion | ReturnProcessProductQuestion - | ReturnProcessChecklistQuestion; + | ReturnProcessChecklistQuestion + | ReturnProcessGroupQuestion + | ReturnProcessInfoQuestion; diff --git a/libs/oms/data-access/src/lib/models/return-process.ts b/libs/oms/data-access/src/lib/models/return-process.ts index ae2e93d03..d100c4625 100644 --- a/libs/oms/data-access/src/lib/models/return-process.ts +++ b/libs/oms/data-access/src/lib/models/return-process.ts @@ -1,10 +1,26 @@ +import { Receipt } from './receipt'; import { ReceiptItem } from './receipt-item'; +/** + * Interface representing a return process within the OMS system. + * + * @interface ReturnProcess + * @property {number} id - The unique identifier for this return process + * @property {number} processId - The identifier of the parent process this return belongs to + * @property {number} receiptId - The identifier of the associated receipt + * @property {ReceiptItem} receiptItem - The specific item from the receipt being returned + * @property {Date} receiptDate - The date when the receipt was created + * @property {Record} answers - A map of answers to return process questions + * @property {string} [productCategory] - Optional category of the product being returned + * @property {Receipt} [returnReceipt] - Optional receipt generated after the return is processed if this property is set the returnProcess is completed and should not be altered anymore + */ export interface ReturnProcess { id: number; processId: number; receiptId: number; receiptItem: ReceiptItem; + receiptDate: string | undefined; answers: Record; productCategory?: string; + returnReceipt?: Receipt; } diff --git a/libs/oms/data-access/src/lib/questions/book-calendar.ts b/libs/oms/data-access/src/lib/questions/book-calendar.ts index 814cbd0c4..16439fe6f 100644 --- a/libs/oms/data-access/src/lib/questions/book-calendar.ts +++ b/libs/oms/data-access/src/lib/questions/book-calendar.ts @@ -26,8 +26,13 @@ export const bookCalendarQuestions: ReturnProcessQuestion[] = [ label: 'Neuwertig/Originalverpackt', value: ItemConditionAnswer.OVP, nextQuestion: ReturnProcessQuestionKey.ReturnReason, + returnInfo: { itemCondition: 'Neuwertig/Originalverpackt' }, + }, + { + label: 'Beschädigt/Fehldruck', + value: ItemConditionAnswer.Damaged, + returnInfo: { itemCondition: 'Beschädigt/Fehldruck' }, }, - { label: 'Beschädigt/Fehldruck', value: ItemConditionAnswer.Damaged }, ], }, { @@ -35,11 +40,16 @@ export const bookCalendarQuestions: ReturnProcessQuestion[] = [ description: 'Warum möchtest du den Artikel zurücksenden?', type: ReturnProcessQuestionType.Select, options: [ - { label: 'Gefällt nicht/Wiederruf', value: ReturnReasonAnswer.Dislike }, + { + label: 'Gefällt nicht/Wiederruf', + value: ReturnReasonAnswer.Dislike, + returnInfo: { returnReason: 'Gefällt nicht/Wiederruf' }, + }, { label: 'Fehllieferung', value: ReturnReasonAnswer.WrongItem, nextQuestion: ReturnProcessQuestionKey.DeliveredItem, + returnInfo: { returnReason: 'Fehllieferung' }, }, ], }, diff --git a/libs/oms/data-access/src/lib/questions/constants.spec.ts b/libs/oms/data-access/src/lib/questions/constants.spec.ts index 1c9d1c1df..0ceea90ab 100644 --- a/libs/oms/data-access/src/lib/questions/constants.spec.ts +++ b/libs/oms/data-access/src/lib/questions/constants.spec.ts @@ -1,10 +1,10 @@ -import { - ItemConditionAnswer, - ReturnReasonAnswer, +import { + ItemConditionAnswer, + ReturnReasonAnswer, YesNoAnswer, PackageIncompleteAnswer, ReturnProcessQuestionSchema, - ProductCategory + ProductCategory, } from './constants'; import { ReturnProcessQuestionKey } from '../models'; @@ -38,19 +38,22 @@ describe('Constants', () => { expect(ProductCategory.TonDatentraeger).toBe('Ton-/Datenträger'); expect(ProductCategory.SpielwarenPuzzle).toBe('Spielwaren/Puzzle'); expect(ProductCategory.SonstigesNonbook).toBe('Sonstiges und Nonbook'); - expect(ProductCategory.ElektronischeGeraete).toBe('Andere Elektronische Geräte'); + expect(ProductCategory.ElektronischeGeraete).toBe( + 'Andere Elektronische Geräte', + ); expect(ProductCategory.Tolino).toBe('Tolino'); }); }); describe('ReturnProcessQuestionSchema', () => { it('should validate ItemCondition schema', () => { - const schema = ReturnProcessQuestionSchema[ReturnProcessQuestionKey.ItemCondition]; - + const schema = + ReturnProcessQuestionSchema[ReturnProcessQuestionKey.ItemCondition]; + // Valid values expect(schema.safeParse(ItemConditionAnswer.OVP).success).toBe(true); expect(schema.safeParse(ItemConditionAnswer.Damaged).success).toBe(true); - + // Invalid values expect(schema.safeParse('invalid').success).toBe(false); expect(schema.safeParse('').success).toBe(false); @@ -58,12 +61,13 @@ describe('Constants', () => { }); it('should validate ReturnReason schema', () => { - const schema = ReturnProcessQuestionSchema[ReturnProcessQuestionKey.ReturnReason]; - + const schema = + ReturnProcessQuestionSchema[ReturnProcessQuestionKey.ReturnReason]; + // Valid values expect(schema.safeParse(ReturnReasonAnswer.Dislike).success).toBe(true); expect(schema.safeParse(ReturnReasonAnswer.WrongItem).success).toBe(true); - + // Invalid values expect(schema.safeParse('invalid').success).toBe(false); }); @@ -77,41 +81,48 @@ describe('Constants', () => { ReturnProcessQuestionSchema[ReturnProcessQuestionKey.CaseCondition], ReturnProcessQuestionSchema[ReturnProcessQuestionKey.UsbPort], ]; - - schemas.forEach(schema => { + + schemas.forEach((schema) => { // Valid values expect(schema.safeParse(YesNoAnswer.Yes).success).toBe(true); expect(schema.safeParse(YesNoAnswer.No).success).toBe(true); - + // Invalid values expect(schema.safeParse('maybe').success).toBe(false); }); }); it('should validate PackageIncomplete schema', () => { - const schema = ReturnProcessQuestionSchema[ReturnProcessQuestionKey.PackageIncomplete]; - + const schema = + ReturnProcessQuestionSchema[ReturnProcessQuestionKey.PackageIncomplete]; + // Valid values - with options - expect(schema.safeParse({ - options: [PackageIncompleteAnswer.OVP], - other: '', - }).success).toBe(true); - + expect( + schema.safeParse({ + options: [PackageIncompleteAnswer.OVP], + other: '', + }).success, + ).toBe(true); + // Valid values - with multiple options - expect(schema.safeParse({ - options: [ - PackageIncompleteAnswer.OVP, - PackageIncompleteAnswer.ChargingCable - ], - other: 'Some other missing part', - }).success).toBe(true); - + expect( + schema.safeParse({ + options: [ + PackageIncompleteAnswer.OVP, + PackageIncompleteAnswer.ChargingCable, + ], + other: 'Some other missing part', + }).success, + ).toBe(true); + // Valid values - with only other - expect(schema.safeParse({ - options: [], - other: 'Something else is missing', - }).success).toBe(true); - + expect( + schema.safeParse({ + options: [], + other: 'Something else is missing', + }).success, + ).toBe(true); + // Invalid values expect(schema.safeParse({}).success).toBe(false); expect(schema.safeParse({ options: [] }).success).toBe(false); @@ -119,28 +130,39 @@ describe('Constants', () => { }); it('should validate DeliveredItem schema', () => { - const schema = ReturnProcessQuestionSchema[ReturnProcessQuestionKey.DeliveredItem]; - + const schema = + ReturnProcessQuestionSchema[ReturnProcessQuestionKey.DeliveredItem]; + // Valid values - expect(schema.safeParse({ - ean: '1234567890123', - format: 'Book', - formatDetails: 'Hardcover', - name: 'Test Book', - }).success).toBe(true); - + expect( + schema.safeParse({ + ean: '1234567890123', + format: 'Book', + formatDetail: 'Hardcover', + name: 'Test Book', + catalogProductNumber: '12345', + contributors: 'John Doe', + volume: '1', + manufacturer: 'Test Publisher', + }).success, + ).toBe(true); + // Invalid values - missing required fields - expect(schema.safeParse({ - ean: '1234567890123', - format: 'Book', - }).success).toBe(false); - + expect( + schema.safeParse({ + ean: '1234567890123', + format: 'Book', + }).success, + ).toBe(false); + // Invalid values - wrong types - expect(schema.safeParse({ - ean: 1234567890123, - format: 'Book', - formatDetails: 'Hardcover', - }).success).toBe(false); + expect( + schema.safeParse({ + ean: 1234567890123, + format: 'Book', + formatDetails: 'Hardcover', + }).success, + ).toBe(false); }); }); -}); \ No newline at end of file +}); diff --git a/libs/oms/data-access/src/lib/questions/constants.ts b/libs/oms/data-access/src/lib/questions/constants.ts index 240ba8760..57c38525a 100644 --- a/libs/oms/data-access/src/lib/questions/constants.ts +++ b/libs/oms/data-access/src/lib/questions/constants.ts @@ -4,14 +4,20 @@ import { ReturnProcessQuestionKey } from '../models'; /** * Constants for product categories used in the return process. */ -export const enum ProductCategory { - BookCalendar = 'Buch/Kalender', - TonDatentraeger = 'Ton-/Datenträger', - SpielwarenPuzzle = 'Spielwaren/Puzzle', - SonstigesNonbook = 'Sonstiges und Nonbook', - ElektronischeGeraete = 'Andere Elektronische Geräte', - Tolino = 'Tolino', // Added Tolino category -} +export const ProductCategory = { + BookCalendar: 'Buch/Kalender', + TonDatentraeger: 'Ton-/Datenträger', + SpielwarenPuzzle: 'Spielwaren/Puzzle', + SonstigesNonbook: 'Sonstiges und Nonbook', + ElektronischeGeraete: 'Andere Elektronische Geräte', + Tolino: 'Tolino', // Added Tolino category, + Software: 'Software', +} as const; + +export type ProductCategoryKey = keyof typeof ProductCategory; + +export type ProductCategory = + (typeof ProductCategory)[keyof typeof ProductCategory]; /** * Constant object for item condition answers in the return process. @@ -38,6 +44,8 @@ export type ItemConditionAnswer = export const ReturnReasonAnswer = { Dislike: 'dislike', WrongItem: 'wrong_item', + DamagedByCustomer: 'damaged_by_customer', + ReceivedDamaged: 'received_damaged', } as const; /** @@ -86,6 +94,18 @@ export type PackageIncompleteAnswer = * Zod schema definitions for validating return process question answers. * Each schema corresponds to a specific question key from ReturnProcessQuestionKey * and defines the expected format and allowed values for that question's answer. + * + * The DeliveredItem schema requires the following fields: + * - catalogProductNumber: Product catalog number as string + * - contributors: Contributors/authors as string + * - ean: EAN (ISBN) as string + * - format: Format type as string + * - formatDetail: Detailed format description as string + * - volume: Volume number as string + * - manufacturer: Manufacturer/publisher as string + * - name: Product name as string + * + * Additional fields are allowed via passthrough. */ export const ReturnProcessQuestionSchema = { [ReturnProcessQuestionKey.ItemCondition]: z.enum([ @@ -104,6 +124,10 @@ export const ReturnProcessQuestionSchema = { YesNoAnswer.Yes, YesNoAnswer.No, ]), + [ReturnProcessQuestionKey.ItemDamaged]: z.enum([ + ReturnReasonAnswer.DamagedByCustomer, + ReturnReasonAnswer.ReceivedDamaged, + ]), [ReturnProcessQuestionKey.DevicePower]: z.enum([ YesNoAnswer.Yes, YesNoAnswer.No, @@ -112,6 +136,8 @@ export const ReturnProcessQuestionSchema = { YesNoAnswer.Yes, YesNoAnswer.No, ]), + [ReturnProcessQuestionKey.PackageCompleteGroup]: z.any(), + [ReturnProcessQuestionKey.PackageIncompleteInfo]: z.any(), [ReturnProcessQuestionKey.PackageIncomplete]: z .object({ options: z @@ -144,23 +170,18 @@ export const ReturnProcessQuestionSchema = { YesNoAnswer.No, ]), [ReturnProcessQuestionKey.UsbPort]: z.enum([YesNoAnswer.Yes, YesNoAnswer.No]), - [ReturnProcessQuestionKey.DeliveredItem]: z.object({ - ean: z.string(), - format: z.string(), - formatDetails: z.string(), - additionalName: z.string().optional(), - catalogProductNumber: z.string().optional(), - contributors: z.string().optional(), - edition: z.string().optional(), - formatDetail: z.string().optional(), - locale: z.string().optional(), - productGroup: z.string().optional(), - manufacturer: z.string().optional(), - name: z.string().optional(), - productGroupDetails: z.string().optional(), - publicationDate: z.string().optional(), - serial: z.string().optional(), - }), + [ReturnProcessQuestionKey.DeliveredItem]: z + .object({ + catalogProductNumber: z.string(), + contributors: z.string(), + ean: z.string(), + format: z.string(), + formatDetail: z.string(), + volume: z.string(), + manufacturer: z.string(), + name: z.string(), + }) + .passthrough(), } as const; /** diff --git a/libs/oms/data-access/src/lib/questions/elektronische-geraete.ts b/libs/oms/data-access/src/lib/questions/elektronische-geraete.ts index aed947f57..06efc137b 100644 --- a/libs/oms/data-access/src/lib/questions/elektronische-geraete.ts +++ b/libs/oms/data-access/src/lib/questions/elektronische-geraete.ts @@ -32,11 +32,13 @@ export const elektronischeGeraeteQuestions: ReturnProcessQuestion[] = [ label: 'Originalverpackt', value: ItemConditionAnswer.OVP, nextQuestion: ReturnProcessQuestionKey.ReturnReason, + returnInfo: { itemCondition: 'Originalverpackt' }, }, { - label: 'Geöffnet / Beschädigt', + label: 'Geöffnet/Beschädigt', value: ItemConditionAnswer.Damaged, nextQuestion: ReturnProcessQuestionKey.ItemDefective, + returnInfo: { itemCondition: 'Geöffnet/Beschädigt' }, }, ], }, @@ -45,11 +47,16 @@ export const elektronischeGeraeteQuestions: ReturnProcessQuestion[] = [ description: 'Warum möchtest du den Artikel zurückgeben?', type: ReturnProcessQuestionType.Select, options: [ - { label: 'Gefällt nicht/Wiederruf', value: ReturnReasonAnswer.Dislike }, + { + label: 'Gefällt nicht/Wiederruf', + value: ReturnReasonAnswer.Dislike, + returnInfo: { returnReason: 'Gefällt nicht/Wiederruf' }, + }, { label: 'Fehllieferung', value: ReturnReasonAnswer.WrongItem, nextQuestion: ReturnProcessQuestionKey.DeliveredItem, + returnInfo: { returnReason: 'Fehllieferung' }, }, ], }, @@ -61,6 +68,7 @@ export const elektronischeGeraeteQuestions: ReturnProcessQuestion[] = [ { label: 'Ja', value: YesNoAnswer.Yes, + returnInfo: { returnDetails: 'Artikel defekt' }, }, { label: 'Nein', diff --git a/libs/oms/data-access/src/lib/questions/nonbook.ts b/libs/oms/data-access/src/lib/questions/nonbook.ts index a89b028f8..50cd4fa60 100644 --- a/libs/oms/data-access/src/lib/questions/nonbook.ts +++ b/libs/oms/data-access/src/lib/questions/nonbook.ts @@ -26,8 +26,13 @@ export const nonbookQuestions: ReturnProcessQuestion[] = [ label: 'Neuwertig/Originalverpackt', value: ItemConditionAnswer.OVP, nextQuestion: ReturnProcessQuestionKey.ReturnReason, + returnInfo: { itemCondition: 'Neuwertig/Originalverpackt' }, + }, + { + label: 'Beschädigt/Fehldruck', + value: ItemConditionAnswer.Damaged, + returnInfo: { itemCondition: 'Beschädigt/Fehldruck' }, }, - { label: 'Beschädigt/Fehldruck', value: ItemConditionAnswer.Damaged }, ], }, { @@ -35,11 +40,16 @@ export const nonbookQuestions: ReturnProcessQuestion[] = [ description: 'Warum möchtest du den Artikel zurückgeben?', type: ReturnProcessQuestionType.Select, options: [ - { label: 'Gefällt nicht/Wiederruf', value: ReturnReasonAnswer.Dislike }, + { + label: 'Gefällt nicht/Wiederruf', + value: ReturnReasonAnswer.Dislike, + returnInfo: { returnReason: 'Gefällt nicht/Wiederruf' }, + }, { label: 'Fehllieferung', value: ReturnReasonAnswer.WrongItem, nextQuestion: ReturnProcessQuestionKey.DeliveredItem, + returnInfo: { returnReason: 'Fehllieferung' }, }, ], }, diff --git a/libs/oms/data-access/src/lib/questions/registry.ts b/libs/oms/data-access/src/lib/questions/registry.ts index a4fa21aa8..9d7540df0 100644 --- a/libs/oms/data-access/src/lib/questions/registry.ts +++ b/libs/oms/data-access/src/lib/questions/registry.ts @@ -26,4 +26,5 @@ export const CategoryQuestions: Record< [ProductCategory.SonstigesNonbook]: nonbookQuestions, [ProductCategory.ElektronischeGeraete]: elektronischeGeraeteQuestions, [ProductCategory.Tolino]: tolinoQuestions, + [ProductCategory.Software]: tonDatentraegerQuestions, }; diff --git a/libs/oms/data-access/src/lib/questions/tolino.ts b/libs/oms/data-access/src/lib/questions/tolino.ts index cac654970..d3f0e1ae4 100644 --- a/libs/oms/data-access/src/lib/questions/tolino.ts +++ b/libs/oms/data-access/src/lib/questions/tolino.ts @@ -39,11 +39,13 @@ export const tolinoQuestions: ReturnProcessQuestion[] = [ { label: 'Originalverpackt', value: ItemConditionAnswer.OVP, + returnInfo: { itemCondition: 'Originalverpackt' }, }, { label: 'Geöffnet/Beschädigt', value: ItemConditionAnswer.Damaged, nextQuestion: ReturnProcessQuestionKey.DevicePower, + returnInfo: { itemCondition: 'Geöffnet/Beschädigt' }, }, ], }, @@ -55,54 +57,72 @@ export const tolinoQuestions: ReturnProcessQuestion[] = [ { label: 'Ja', value: YesNoAnswer.Yes, - nextQuestion: ReturnProcessQuestionKey.PackageComplete, + nextQuestion: ReturnProcessQuestionKey.PackageCompleteGroup, }, { label: 'Nein', value: YesNoAnswer.No, - nextQuestion: ReturnProcessQuestionKey.PackageComplete, + nextQuestion: ReturnProcessQuestionKey.PackageCompleteGroup, + returnInfo: { returnDetails: 'Artikel defekt' }, }, ], }, { - key: ReturnProcessQuestionKey.PackageComplete, - description: 'Ist die Verpackung vollständig?', - type: ReturnProcessQuestionType.Select, - options: [ + key: ReturnProcessQuestionKey.PackageCompleteGroup, + type: ReturnProcessQuestionType.Group, + questions: [ { - label: 'Ja', - value: YesNoAnswer.Yes, - nextQuestion: ReturnProcessQuestionKey.CaseCondition, + key: ReturnProcessQuestionKey.PackageComplete, + description: 'Ist die Verpackung vollständig?', + type: ReturnProcessQuestionType.Select, + options: [ + { + label: 'Ja', + value: YesNoAnswer.Yes, + nextQuestion: ReturnProcessQuestionKey.CaseCondition, + }, + { + label: 'Nein', + value: YesNoAnswer.No, + nextQuestion: ReturnProcessQuestionKey.PackageIncompleteInfo, + }, + ], }, { - label: 'Nein', - value: YesNoAnswer.No, + key: ReturnProcessQuestionKey.PackageIncompleteInfo, + type: ReturnProcessQuestionType.Info, + description: 'Checkliste', + content: [ + '1.) Karton / Umverpackung', + '2.) Ladekabel', + '3.) Quickstart-Guide', + ], nextQuestion: ReturnProcessQuestionKey.PackageIncomplete, }, - ], - }, - { - key: ReturnProcessQuestionKey.PackageIncomplete, - description: 'Was fehlt?', - type: ReturnProcessQuestionType.Checklist, - options: [ { - label: 'Karton/Umverpackung', - value: PackageIncompleteAnswer.OVP, - }, - { - label: 'Ladekabel', - value: PackageIncompleteAnswer.ChargingCable, - }, - { - label: 'Quickstart Guide', - value: PackageIncompleteAnswer.QuickStartGuide, + key: ReturnProcessQuestionKey.PackageIncomplete, + description: 'Was fehlt?', + type: ReturnProcessQuestionType.Checklist, + options: [ + { + label: 'Karton / Umverpackung', + value: PackageIncompleteAnswer.OVP, + }, + { + label: 'Ladekabel', + value: PackageIncompleteAnswer.ChargingCable, + }, + { + label: 'Quickstart-Guide', + value: PackageIncompleteAnswer.QuickStartGuide, + }, + ], + other: { + label: 'Sonstiges', + }, + nextQuestion: ReturnProcessQuestionKey.CaseCondition, }, ], - other: { - label: 'Sonstiges', - }, - nextQuestion: ReturnProcessQuestionKey.CaseCondition, }, { key: ReturnProcessQuestionKey.CaseCondition, @@ -113,6 +133,7 @@ export const tolinoQuestions: ReturnProcessQuestion[] = [ label: 'Ja', value: YesNoAnswer.Yes, nextQuestion: ReturnProcessQuestionKey.DisplayCondition, + returnInfo: { itemCondition: 'Gehäuse Mängel' }, }, { label: 'Nein', @@ -123,13 +144,14 @@ export const tolinoQuestions: ReturnProcessQuestion[] = [ }, { key: ReturnProcessQuestionKey.DisplayCondition, - description: 'Hat das Display Mängel oder ist gebrochen?', + description: 'Hat das Display Kratzer oder ist gebrochen?', type: ReturnProcessQuestionType.Select, options: [ { label: 'Ja', value: YesNoAnswer.Yes, - nextQuestion: ReturnProcessQuestionKey.UsbPort, + nextQuestion: ReturnProcessQuestionKey.ItemDamaged, + returnInfo: { itemCondition: 'Beschädigt' }, }, { label: 'Nein', @@ -138,6 +160,22 @@ export const tolinoQuestions: ReturnProcessQuestion[] = [ }, ], }, + { + key: ReturnProcessQuestionKey.ItemDamaged, + description: + 'Wurde der Artikel durch unsachgemäße Handhabung oder Eigenverschulden beschädigt?', + type: ReturnProcessQuestionType.Select, + options: [ + { + label: 'Ja', + value: ReturnReasonAnswer.DamagedByCustomer, + }, + { + label: 'Nein', + value: ReturnReasonAnswer.ReceivedDamaged, + }, + ], + }, { key: ReturnProcessQuestionKey.UsbPort, description: 'Funktioniert die USB Buchse?', diff --git a/libs/oms/data-access/src/lib/questions/ton-datentraeger.ts b/libs/oms/data-access/src/lib/questions/ton-datentraeger.ts index f4d26d56a..2b7a110ac 100644 --- a/libs/oms/data-access/src/lib/questions/ton-datentraeger.ts +++ b/libs/oms/data-access/src/lib/questions/ton-datentraeger.ts @@ -1,12 +1,13 @@ import { - ReturnProcessAnswers, ReturnProcessQuestion, ReturnProcessQuestionKey, ReturnProcessQuestionType, - EligibleForReturn, - EligibleForReturnState, } from '../models'; -import { ItemConditionAnswer, YesNoAnswer } from './constants'; +import { + ItemConditionAnswer, + ReturnReasonAnswer, + YesNoAnswer, +} from './constants'; /** * Questions for the return process of Ton-/Datenträger (audio/data carriers). @@ -31,11 +32,14 @@ export const tonDatentraegerQuestions: ReturnProcessQuestion[] = [ { label: 'Versiegelt/Originalverpackt', value: ItemConditionAnswer.OVP, + returnInfo: { itemCondition: 'Versiegelt/Originalverpackt' }, + nextQuestion: ReturnProcessQuestionKey.ReturnReason, }, { label: 'Geöffnet', value: ItemConditionAnswer.Damaged, nextQuestion: ReturnProcessQuestionKey.ItemDefective, + returnInfo: { itemCondition: 'Geöffnet' }, }, ], }, @@ -47,11 +51,36 @@ export const tonDatentraegerQuestions: ReturnProcessQuestion[] = [ { label: 'Ja', value: YesNoAnswer.Yes, + returnInfo: { itemCondition: 'Defekt' }, }, { label: 'Nein', value: YesNoAnswer.No, + returnInfo: { itemCondition: 'Ok' }, }, ], }, + { + key: ReturnProcessQuestionKey.ReturnReason, + description: 'Warum möchtest du den Artikel zurückgeben?', + type: ReturnProcessQuestionType.Select, + options: [ + { + label: 'Gefällt nicht/Wiederruf', + value: ReturnReasonAnswer.Dislike, + returnInfo: { returnReason: 'Gefällt nicht/Wiederruf' }, + }, + { + label: 'Fehllieferung', + value: ReturnReasonAnswer.WrongItem, + nextQuestion: ReturnProcessQuestionKey.DeliveredItem, + returnInfo: { returnReason: 'Fehllieferung' }, + }, + ], + }, + { + key: ReturnProcessQuestionKey.DeliveredItem, + description: 'Welcher Artikel wurde geliefert?', + type: ReturnProcessQuestionType.Product, + }, ]; diff --git a/libs/oms/data-access/src/lib/return-details.store.spec.ts b/libs/oms/data-access/src/lib/return-details.store.spec.ts index 401abae1a..742551a1f 100644 --- a/libs/oms/data-access/src/lib/return-details.store.spec.ts +++ b/libs/oms/data-access/src/lib/return-details.store.spec.ts @@ -2,7 +2,7 @@ import { createServiceFactory } from '@ngneat/spectator/jest'; import { ReturnDetailsStore } from './return-details.store'; import { ReturnDetailsService } from './return-details.service'; import { patchState } from '@ngrx/signals'; -import { ResultStatus } from '@isa/common/result'; +import { AsyncResultStatus } from '@isa/common/data-access'; import { addEntity } from '@ngrx/signals/entities'; import { Receipt } from './models'; import { of, throwError } from 'rxjs'; @@ -30,7 +30,7 @@ describe('ReturnDetailsStore', () => { expect(spectator.service.entityMap()[123]).toEqual({ id: receiptId, data: undefined, - status: ResultStatus.Pending, + status: AsyncResultStatus.Pending, }); }); @@ -42,7 +42,7 @@ describe('ReturnDetailsStore', () => { patchState( spectator.service as any, - addEntity({ id: receiptId, data, status: ResultStatus.Idle }), + addEntity({ id: receiptId, data, status: AsyncResultStatus.Idle }), ); spectator.service.beforeFetch(receiptId); @@ -50,7 +50,7 @@ describe('ReturnDetailsStore', () => { expect(spectator.service.entityMap()[123]).toEqual({ id: receiptId, data, - status: ResultStatus.Pending, + status: AsyncResultStatus.Pending, }); }); }); @@ -59,11 +59,19 @@ describe('ReturnDetailsStore', () => { it('should update the entity with fetched data and set status to Success', () => { const spectator = createService(); const receiptId = 123; - const data: Receipt = { id: receiptId, items: [], buyer: { buyerNumber: '321' } }; + const data: Receipt = { + id: receiptId, + items: [], + buyer: { buyerNumber: '321' }, + }; patchState( spectator.service as any, - addEntity({ id: receiptId, data: undefined, status: ResultStatus.Pending }), + addEntity({ + id: receiptId, + data: undefined, + status: AsyncResultStatus.Pending, + }), ); spectator.service.fetchSuccess(receiptId, data); @@ -71,7 +79,7 @@ describe('ReturnDetailsStore', () => { expect(spectator.service.entityMap()[123]).toEqual({ id: receiptId, data, - status: ResultStatus.Success, + status: AsyncResultStatus.Success, }); }); }); @@ -84,7 +92,11 @@ describe('ReturnDetailsStore', () => { patchState( spectator.service as any, - addEntity({ id: receiptId, data: undefined, status: ResultStatus.Pending }), + addEntity({ + id: receiptId, + data: undefined, + status: AsyncResultStatus.Pending, + }), ); spectator.service.fetchError(receiptId, error); @@ -92,7 +104,7 @@ describe('ReturnDetailsStore', () => { const entity = spectator.service.entityMap()[123]; expect(entity).toMatchObject({ id: receiptId, - status: ResultStatus.Error, + status: AsyncResultStatus.Error, error, }); }); @@ -103,21 +115,29 @@ describe('ReturnDetailsStore', () => { it('should call the service and update the store on success', () => { const spectator = createService(); const receiptId = 123; - const data: Receipt = { id: receiptId, items: [], buyer: { buyerNumber: '321' } }; + const data: Receipt = { + id: receiptId, + items: [], + buyer: { buyerNumber: '321' }, + }; spectator.service.beforeFetch(receiptId); - spectator.inject(ReturnDetailsService).fetchReturnDetails.mockReturnValueOnce(of(data)); + spectator + .inject(ReturnDetailsService) + .fetchReturnDetails.mockReturnValueOnce(of(data)); spectator.service.fetch({ receiptId }); - expect(spectator.inject(ReturnDetailsService).fetchReturnDetails).toHaveBeenCalledWith({ + expect( + spectator.inject(ReturnDetailsService).fetchReturnDetails, + ).toHaveBeenCalledWith({ receiptId, }); expect(spectator.service.entityMap()[123]).toEqual({ id: receiptId, data, - status: ResultStatus.Success, + status: AsyncResultStatus.Success, }); }); @@ -133,13 +153,15 @@ describe('ReturnDetailsStore', () => { spectator.service.fetch({ receiptId }); - expect(spectator.inject(ReturnDetailsService).fetchReturnDetails).toHaveBeenCalledWith({ + expect( + spectator.inject(ReturnDetailsService).fetchReturnDetails, + ).toHaveBeenCalledWith({ receiptId, }); const entity = spectator.service.entityMap()[123]; expect(entity).toMatchObject({ id: receiptId, - status: ResultStatus.Error, + status: AsyncResultStatus.Error, error, }); }); diff --git a/libs/oms/data-access/src/lib/return-details.store.ts b/libs/oms/data-access/src/lib/return-details.store.ts index 71f1fdb40..4c3c15f85 100644 --- a/libs/oms/data-access/src/lib/return-details.store.ts +++ b/libs/oms/data-access/src/lib/return-details.store.ts @@ -1,6 +1,6 @@ import { patchState, signalStore, withMethods } from '@ngrx/signals'; import { addEntity, updateEntity, withEntities } from '@ngrx/signals/entities'; -import { Result, ResultStatus } from '@isa/common/result'; +import { AsyncResult, AsyncResultStatus } from '@isa/common/data-access'; import { rxMethod } from '@ngrx/signals/rxjs-interop'; import { pipe, switchMap, tap } from 'rxjs'; import { inject } from '@angular/core'; @@ -11,14 +11,14 @@ import { Receipt } from './models'; /** * Represents the result of a return operation, including the receipt data and status. */ -export type ReturnResult = Result & { id: number }; +export type ReturnResult = AsyncResult & { id: number }; /** * Initial state for a return result entity, excluding the unique identifier. */ const initialEntity: Omit = { data: undefined, - status: ResultStatus.Idle, + status: AsyncResultStatus.Idle, }; /** @@ -38,12 +38,19 @@ export const ReturnDetailsStore = signalStore( // Using optional chaining to safely retrieve the entity from the map let entity: ReturnResult | undefined = store.entityMap()?.[receiptId]; if (!entity) { - entity = { ...initialEntity, id: receiptId, status: ResultStatus.Pending }; + entity = { + ...initialEntity, + id: receiptId, + status: AsyncResultStatus.Pending, + }; patchState(store, addEntity(entity)); } else { patchState( store, - updateEntity({ id: receiptId, changes: { status: ResultStatus.Pending } }), + updateEntity({ + id: receiptId, + changes: { status: AsyncResultStatus.Pending }, + }), ); } }, @@ -56,7 +63,10 @@ export const ReturnDetailsStore = signalStore( fetchSuccess(receiptId: number, data: Receipt) { patchState( store, - updateEntity({ id: receiptId, changes: { data, status: ResultStatus.Success } }), + updateEntity({ + id: receiptId, + changes: { data, status: AsyncResultStatus.Success }, + }), ); }, @@ -68,7 +78,10 @@ export const ReturnDetailsStore = signalStore( fetchError(receiptId: number, error: unknown) { patchState( store, - updateEntity({ id: receiptId, changes: { error, status: ResultStatus.Error } }), + updateEntity({ + id: receiptId, + changes: { error, status: AsyncResultStatus.Error }, + }), ); }, })), diff --git a/libs/oms/data-access/src/lib/return-process.service.ts b/libs/oms/data-access/src/lib/return-process.service.ts index ee5596f5f..33185f82d 100644 --- a/libs/oms/data-access/src/lib/return-process.service.ts +++ b/libs/oms/data-access/src/lib/return-process.service.ts @@ -1,14 +1,39 @@ -import { Injectable } from '@angular/core'; +import { inject, Injectable } from '@angular/core'; import { EligibleForReturn, EligibleForReturnState, + Receipt, + ReturnInfo, ReturnProcess, + ReturnProcessAnswers, ReturnProcessQuestion, ReturnProcessQuestionType, } from './models'; -import { CategoryQuestions, ReturnProcessQuestionSchema } from './questions'; +import { CategoryQuestions } from './questions'; import { KeyValue } from '@angular/common'; import { ReturnProcessChecklistAnswerSchema } from './schemas'; +import { logger } from '@isa/core/logging'; +import { + PropertyIsEmptyError, + PropertyNullOrUndefinedError, +} from '@isa/common/data-access'; +import { ReturnProcessIsNotCompleteError } from './errors/return-process'; +import { + activeReturnProcessQuestions, + allReturnProcessQuestionsAnswered, + calculateLongestQuestionDepth, + getReturnInfo, +} from './helpers/return-process'; +import { isEmpty, isNil } from 'lodash'; +import { + ReceiptService, + ReturnReceiptValuesDTO, +} from '@generated/swagger/oms-api'; +import { firstValueFrom } from 'rxjs'; +import { UiModalService } from '@ui/modal'; +import { DomainPrinterService, Printer } from '@domain/printer'; +import { PrintModalComponent, PrintModalData } from '@modal/printer'; +import { EnvironmentService } from '@core/environment'; /** * Service responsible for managing the return process workflow. @@ -17,6 +42,15 @@ import { ReturnProcessChecklistAnswerSchema } from './schemas'; */ @Injectable({ providedIn: 'root' }) export class ReturnProcessService { + #logger = logger(); + + #receiptService = inject(ReceiptService); + #printService = inject(DomainPrinterService); + + // TODO: Refactor: CDK Dialog verwenden für neuen Printer Dialog + #environmentSerivce = inject(EnvironmentService); + #uiModal = inject(UiModalService); + /** * Gets all available product categories that have defined question sets. * @@ -37,8 +71,7 @@ export class ReturnProcessService { returnProcessQuestions( process: ReturnProcess, ): ReturnProcessQuestion[] | undefined { - const category = - process.productCategory || process.receiptItem.features?.['category']; + const category = process.productCategory; if (category) { return CategoryQuestions[category as keyof typeof CategoryQuestions]; @@ -64,62 +97,17 @@ export class ReturnProcessService { process: ReturnProcess, ): ReturnProcessQuestion[] | undefined { const questions = this.returnProcessQuestions(process); + const answers: ReturnProcessAnswers = process.answers || {}; if (!questions) { - return undefined; + throw new PropertyNullOrUndefinedError('questions'); } - let questionKey: string | undefined = questions[0].key; - const result: ReturnProcessQuestion[] = []; - const visited = new Set(); - - while (questionKey) { - if (visited.has(questionKey)) { - throw new Error('Cyclic question dependency detected'); - } - visited.add(questionKey); - - const question = questions.find((q) => q.key === questionKey); - if (question) { - result.push(question); - - const schema = ReturnProcessQuestionSchema[question.key]; - - const parseResult = schema.safeParse(process.answers[question.key]); - - if (!parseResult.success) { - break; - } - - if (question.type === ReturnProcessQuestionType.Select) { - const option = question.options.find( - (o) => o.value === process.answers[question.key], - ); - questionKey = option?.nextQuestion; - } else if (question.type === ReturnProcessQuestionType.Product) { - questionKey = process.answers[question.key] - ? question.nextQuestion - : undefined; - } else if (question.type === ReturnProcessQuestionType.Checklist) { - const answer = ReturnProcessChecklistAnswerSchema.optional().parse( - process.answers[question.key], - ); - - if ((answer && answer.options?.length) || (answer && answer.other)) { - questionKey = question.nextQuestion; - } else { - questionKey = undefined; - } - } else { - console.error('Unknown question type', question); - break; - } - } else { - break; - } + if (!answers) { + throw new PropertyNullOrUndefinedError('answers'); } - return result; + return activeReturnProcessQuestions(questions, answers); } /** @@ -138,63 +126,31 @@ export class ReturnProcessService { return undefined; } - const visited = new Set(); - function computeLongestPath( - questions: ReturnProcessQuestion[], - startKey: string, - ) { - if (visited.has(startKey)) return 0; - - visited.add(startKey); - - const findDepth = (key: string | undefined): number => { - if (!key) return 0; - const question = questions.find((q) => q.key === key); - if (!question) return 0; - if ( - question.type === ReturnProcessQuestionType.Select && - question.options - ) { - if (returnProcess.answers[question.key]) { - const chosen = question.options.find( - (o) => o.value === returnProcess.answers[question.key], - ); - return 1 + findDepth(chosen?.nextQuestion); - } - return ( - 1 + - Math.max(...question.options.map((o) => findDepth(o.nextQuestion))) - ); - } else if ( - question.type === ReturnProcessQuestionType.Product && - question.nextQuestion - ) { - return ( - 1 + - (returnProcess.answers[question.key] - ? findDepth(question.nextQuestion) - : 0) - ); - } - return 1; - }; - return findDepth(startKey); - } - const activeQuestions = this.activeReturnProcessQuestions(returnProcess); if (!activeQuestions) { return undefined; } + // Unterstützt nun auch Gruppenfragen (siehe Tolino) const answered = activeQuestions.reduce((acc, q) => { - if (q.key in returnProcess.answers) { - return acc + 1; + if (q.type === ReturnProcessQuestionType.Group) { + // Group-Frage: zähle alle Unterfragen, die schon eine Antwort haben + const subAnswered = q.questions.reduce((subAcc, subQ) => { + return subQ.key in returnProcess.answers ? subAcc + 1 : subAcc; + }, 0); + return acc + subAnswered; } - return acc; + + // Einzel-Frage: ganz normal zählen + return q.key in returnProcess.answers ? acc + 1 : acc; }, 0); - const totalCount = computeLongestPath(questions, questions[0].key); + const totalCount = calculateLongestQuestionDepth( + questions, + returnProcess.answers, + ); + return { answered, total: totalCount }; } @@ -219,28 +175,199 @@ export class ReturnProcessService { return undefined; } - const everyQuestionAnswered = questions.every( - (q) => q.key in returnProcess.answers, + // Use the helper method to check if all questions are answered + const allQuestionsAnswered = this._areAllQuestionsAnswered( + questions, + returnProcess, ); - if (!everyQuestionAnswered) { - return undefined; - } - - const allQuestionsAnswered = questions.every((q) => { - if (q.type === ReturnProcessQuestionType.Checklist) { - const answer = ReturnProcessChecklistAnswerSchema.optional().parse( - returnProcess.answers[q.key], - ); - return (answer && answer.options?.length) || (answer && answer.other); - } else { - return q.key in returnProcess.answers; - } - }); if (!allQuestionsAnswered) { return undefined; } + // TODO: Tolino special cases implementieren (Verschiedene Antwortmöglichkeiten) + if (returnProcess.productCategory === 'Tolino') { + console.log(returnProcess); + } + return { state: EligibleForReturnState.Eligible }; } + + /** + * Checks if all provided questions have valid answers within the return process. + * Handles specific logic for different question types like Checklist. + * + * @param {ReturnProcessQuestion[]} questions - The list of questions to check. + * @param {ReturnProcess} returnProcess - The return process containing the answers. + * @returns {boolean} True if all questions are answered correctly, false otherwise. + * @private + */ + private _areAllQuestionsAnswered( + questions: ReturnProcessQuestion[], + returnProcess: ReturnProcess, + ): boolean { + return questions.every((q) => { + if (q.type === ReturnProcessQuestionType.Checklist) { + // Validate Checklist answers: must have options selected or 'other' text filled + const answer = ReturnProcessChecklistAnswerSchema.optional().parse( + returnProcess.answers[q.key], + ); + return ( + (answer && answer.options?.length > 0) || (answer && !!answer.other) + ); + } else { + // For other types, simply check if an answer exists for the question key + return q.key in returnProcess.answers; + } + }); + } + + /** + * Completes the return process for a collection of return items. + * This method validates all return processes are complete and creates return receipts. + * + * @param processes - Array of return processes to complete + * @returns Promise resolving to array of generated return receipts + * @throws {PropertyNullOrUndefinedError} If processes parameter is null/undefined + * @throws {PropertyIsEmptyError} If processes array is empty + * @throws {ReturnProcessIsNotCompleteError} If any process has incomplete questions + * @throws {PropertyNullOrUndefinedError} If returnInfo is null/undefined for any process + */ + async completeReturnProcess(processes: ReturnProcess[]): Promise { + if (isNil(processes)) { + throw new PropertyNullOrUndefinedError('processes'); + } + if (isEmpty(processes)) { + throw new PropertyIsEmptyError('processes'); + } + + const incompleteProcess = processes.find((process) => { + const questions = this.returnProcessQuestions(process); + if (!questions) { + throw new PropertyNullOrUndefinedError('questions'); + } + return !allReturnProcessQuestionsAnswered({ + questions, + answers: process.answers, + }); + }); + + if (incompleteProcess) { + const error = new ReturnProcessIsNotCompleteError( + incompleteProcess.processId, + incompleteProcess.id, + ); + this.#logger.error('Incomplete return process detected', error); + throw error; + } + + const payload: ReturnReceiptValuesDTO[] = processes.map((process) => { + const questions = this.returnProcessQuestions(process); + if (!questions) { + throw new PropertyNullOrUndefinedError('questions'); + } + const returnInfo = getReturnInfo({ questions, answers: process.answers }); + + if (!returnInfo) { + throw new PropertyNullOrUndefinedError('returnInfo'); + } + + return { + quantity: process.receiptItem.quantity.quantity, + comment: returnInfo.comment, + itemCondition: returnInfo.itemCondition, + otherProduct: returnInfo.otherProduct, + returnDetails: returnInfo.returnDetails, + returnReason: returnInfo.returnReason, + receiptItem: process.receiptItem, + }; + }); + + const response = await firstValueFrom( + this.#receiptService.ReceiptCreateReturnReceipt({ + payload, + }), + ); + + const receipts = response.result as Receipt[]; + const receiptIds = receipts.map((receipt) => receipt.id); + + await this.printReturns(receiptIds); + + return receipts; + } + + // TODO: Refactor: CDK Dialog verwenden für neuen Printer Dialog + + /** + * Prints return receipts using the appropriate printer + * + * This method: + * 1. Retrieves available label printers + * 2. Determines if a printer is selected or if running on tablet mode + * 3. Opens a print modal dialog if no printer is selected or on tablet + * 4. Prints directly to the selected printer when available + * + * @param {number[]} receiptIds - Array of receipt IDs to print + * @returns {Promise} Promise resolving to the same array of receipt IDs + * @throws {Error} When printing operations fail + */ + async printReturns(receiptIds: number[]) { + const printerList = await firstValueFrom( + this.#printService.getAvailableLabelPrinters(), + ); + let printer: Printer | undefined = undefined; + + if (Array.isArray(printerList)) { + printer = printerList.find((printer) => printer.selected === true); + } + + if (!printer || this.#environmentSerivce.matchTablet()) { + await this.#uiModal + .open({ + content: PrintModalComponent, + config: { showScrollbarY: false }, + data: { + printImmediately: !this.#environmentSerivce.matchTablet(), + printerType: 'Label', + print: (printer) => + this.#printService + .printReturnReceipt({ + printer: printer, + receiptIds, + }) + .toPromise(), + } as PrintModalData, + }) + .afterClosed$.toPromise(); + } else { + await firstValueFrom( + this.#printService.printReturnReceipt({ + printer: printer.key, + receiptIds, + }), + ); + } + return receiptIds; + } + + /** + * Retrieves consolidated return information from a return process. + * + * @param process - The return process to extract information from. + * @returns The consolidated return information or undefined if unable to generate. + * @throws {PropertyNullOrUndefinedError} If questions cannot be found. + */ + getReturnInfo(process: ReturnProcess): ReturnInfo | undefined { + const questions = this.returnProcessQuestions(process); + if (!questions) { + throw new PropertyNullOrUndefinedError('questions'); + } + const answers = process.answers || {}; + + return getReturnInfo({ + questions, + answers, + }); + } } diff --git a/libs/oms/data-access/src/lib/return-process.store.spec.ts b/libs/oms/data-access/src/lib/return-process.store.spec.ts index 0612e9c1f..228ce1b43 100644 --- a/libs/oms/data-access/src/lib/return-process.store.spec.ts +++ b/libs/oms/data-access/src/lib/return-process.store.spec.ts @@ -4,29 +4,38 @@ import { IDBStorageProvider } from '@isa/core/storage'; import { ProcessService } from '@isa/core/process'; import { patchState } from '@ngrx/signals'; import { setAllEntities } from '@ngrx/signals/entities'; -import { - ReturnProcessMismatchReturnableItemsError, - ReturnProcessNoReturnableItemsError, -} from './errors'; -import { ReturnProcess } from './models'; +import { Product, ReturnProcess } from './models'; +import { CreateReturnProcessError } from './errors/return-process'; const TEST_ITEMS: Record = { 1: { id: 1, actions: [{ key: 'canReturn', value: 'true' }], - product: { ean: '1234567890', format: 'TB', formatDetails: 'Taschenbuch' }, + product: { + ean: '1234567890', + format: 'TB', + formatDetail: 'Taschenbuch', + } as Product, quantity: { quantity: 1 }, }, 2: { id: 2, actions: [{ key: 'canReturn', value: 'false' }], - product: { ean: '0987654321', format: 'GEB', formatDetails: 'Buch' }, + product: { + ean: '0987654321', + format: 'GEB', + formatDetail: 'Buch', + } as Product, quantity: { quantity: 1 }, }, 3: { id: 3, actions: [{ key: 'canReturn', value: 'true' }], - product: { ean: '1122334455', format: 'AU', formatDetails: 'Audio' }, + product: { + ean: '1122334455', + format: 'AU', + formatDetail: 'Audio', + } as Product, quantity: { quantity: 1 }, }, }; @@ -134,7 +143,7 @@ describe('ReturnProcessStore', () => { receiptId: 123, items: [TEST_ITEMS[2]], }); - }).toThrow(ReturnProcessNoReturnableItemsError); + }).toThrow(CreateReturnProcessError); }); it('should throw an error if the number of returnable items does not match the total items', () => { @@ -147,7 +156,7 @@ describe('ReturnProcessStore', () => { receiptId: 123, items: [TEST_ITEMS[1], TEST_ITEMS[2], TEST_ITEMS[3]], }); - }).toThrow(ReturnProcessMismatchReturnableItemsError); + }).toThrow(CreateReturnProcessError); }); }); }); diff --git a/libs/oms/data-access/src/lib/return-process.store.ts b/libs/oms/data-access/src/lib/return-process.store.ts index 4e1f42705..bf50296c0 100644 --- a/libs/oms/data-access/src/lib/return-process.store.ts +++ b/libs/oms/data-access/src/lib/return-process.store.ts @@ -13,19 +13,19 @@ import { import { IDBStorageProvider, withStorage } from '@isa/core/storage'; import { computed, effect, inject } from '@angular/core'; import { ProcessService } from '@isa/core/process'; -import { ReceiptItem, ReturnProcess } from './models'; +import { Receipt, ReceiptItem, ReturnProcess } from './models'; import { coerceBooleanProperty } from '@angular/cdk/coercion'; import { - ReturnProcessMismatchReturnableItemsError, - ReturnProcessNoReturnableItemsError, -} from './errors'; + CreateReturnProcessError, + CreateReturnProcessErrorReason, +} from './errors/return-process'; /** * Interface representing the parameters required to start a return process. */ export type StartProcess = { processId: number; - receiptId: number; + receipt: Receipt; items: ReceiptItem[]; }; @@ -69,7 +69,10 @@ export const ReturnProcessStore = signalStore( removeAllEntitiesByProcessId: (...processIds: number[]) => { const entitiesToRemove = store .entities() - .filter((entity) => !processIds.includes(entity.processId)); + .filter( + (entity) => + !processIds.includes(entity.processId) && !entity.returnReceipt, + ); patchState(store, setAllEntities(entitiesToRemove)); store.storeState(); }, @@ -83,7 +86,7 @@ export const ReturnProcessStore = signalStore( */ setAnswer: (id: number, question: string, answer: T) => { const entity = store.entityMap()[id]; - if (entity) { + if (entity && !entity.returnReceipt) { const answers = { ...entity.answers, [question]: answer }; patchState( store, @@ -101,7 +104,7 @@ export const ReturnProcessStore = signalStore( */ removeAnswer: (id: number, question: string) => { const entity = store.entityMap()[id]; - if (entity) { + if (entity && !entity.returnReceipt) { const answers = { ...entity.answers }; delete answers[question]; patchState( @@ -121,7 +124,7 @@ export const ReturnProcessStore = signalStore( */ setProductCategory: (id: number, category: string | undefined) => { const entity = store.entityMap()[id]; - if (entity) { + if (entity && !entity.returnReceipt) { patchState( store, updateEntity({ @@ -140,11 +143,11 @@ export const ReturnProcessStore = signalStore( * * @param params - The configuration for starting a new return process. * @param params.processId - The unique identifier for the return process. - * @param params.receiptId - The identifier for the associated receipt. + * @param params.receipt - The associated receipt. * @param params.items - An array of receipt items to be processed. * - * @throws {Error} Throws an error if no returnable items are found. - * @throws {Error} Throws an error if the number of returnable items does not match the total items. + * @throws {CreateReturnProcessError} Throws an error if no returnable items are found. + * @throws {CreateReturnProcessError} Throws an error if the number of returnable items does not match the total items. */ startProcess: (params: StartProcess) => { // Remove existing entities related to the process to start fresh. @@ -159,18 +162,17 @@ export const ReturnProcessStore = signalStore( ); if (returnableItems.length === 0) { - throw new ReturnProcessNoReturnableItemsError({ - processId: params.processId, - receiptId: params.receiptId, - }); + throw new CreateReturnProcessError( + CreateReturnProcessErrorReason.NO_RETURNABLE_ITEMS, + params, + ); } if (returnableItems.length !== params.items.length) { - throw new ReturnProcessMismatchReturnableItemsError({ - processId: params.processId, - items: params.items.length, - returnableItems: returnableItems.length, - }); + throw new CreateReturnProcessError( + CreateReturnProcessErrorReason.MISMATCH_RETURNABLE_ITEMS, + params, + ); } for (let i = 0; i < params.items.length; i++) { @@ -179,7 +181,9 @@ export const ReturnProcessStore = signalStore( entities.push({ id: nextId + i, processId: params.processId, - receiptId: params.receiptId, + receiptId: params.receipt.id, + productCategory: item.features?.['category'], + receiptDate: params.receipt.printedDate, receiptItem: item, answers: {}, }); @@ -188,6 +192,17 @@ export const ReturnProcessStore = signalStore( patchState(store, setAllEntities(entities)); store.storeState(); }, + finishProcess: (returnReceipts: { [id: number]: Receipt }) => { + const entities = store.entities().map((entity) => { + const receipt = returnReceipts[entity.receiptId]; + if (receipt) { + return { ...entity, returnReceipt: receipt }; + } + return entity; + }); + patchState(store, setAllEntities(entities)); + store.storeState(); + }, })), withHooks((store, processService = inject(ProcessService)) => ({ diff --git a/libs/oms/data-access/src/lib/return-search.service.ts b/libs/oms/data-access/src/lib/return-search.service.ts index 785513fa6..575b11beb 100644 --- a/libs/oms/data-access/src/lib/return-search.service.ts +++ b/libs/oms/data-access/src/lib/return-search.service.ts @@ -3,7 +3,7 @@ import { QuerySettingsDTO, ReceiptService } from '@generated/swagger/oms-api'; import { map, Observable, throwError } from 'rxjs'; import { QueryTokenInput, QueryTokenSchema } from './schemas'; import { ReceiptListItem } from './models'; -import { ListResponseArgs } from '@isa/common/result'; +import { ListResponseArgs } from '@isa/common/data-access'; import { ReturnSearchParseQueryTokenError, ReturnSearchSearchError, @@ -39,17 +39,25 @@ export class ReturnSearchService { * @throws {ReturnSearchParseQueryTokenError} If the query token is invalid. * @throws {ReturnSearchSearchError} If the search fails due to an API error. */ - search(queryToken: QueryTokenInput): Observable> { + search( + queryToken: QueryTokenInput, + ): Observable> { try { queryToken = QueryTokenSchema.parse(queryToken); } catch (error) { if (error instanceof ZodError) { - return throwError(() => new ReturnSearchParseQueryTokenError(queryToken, error.message)); + return throwError( + () => new ReturnSearchParseQueryTokenError(queryToken, error.message), + ); } if (error instanceof Error) { - return throwError(() => new ReturnSearchParseQueryTokenError(queryToken, error.message)); + return throwError( + () => new ReturnSearchParseQueryTokenError(queryToken, error.message), + ); } - return throwError(() => new ReturnSearchParseQueryTokenError(queryToken, 'Unknown error')); + return throwError( + () => new ReturnSearchParseQueryTokenError(queryToken, 'Unknown error'), + ); } return this.#receiptService diff --git a/libs/oms/data-access/src/lib/return-search.store.spec.ts b/libs/oms/data-access/src/lib/return-search.store.spec.ts index b858db5a2..93ea06815 100644 --- a/libs/oms/data-access/src/lib/return-search.store.spec.ts +++ b/libs/oms/data-access/src/lib/return-search.store.spec.ts @@ -2,7 +2,7 @@ import { createServiceFactory } from '@ngneat/spectator/jest'; import { ReturnSearchStore, ReturnSearchStatus } from './return-search.store'; import { ReturnSearchService } from './return-search.service'; import { of, throwError } from 'rxjs'; -import { ListResponseArgs } from '@isa/common/result'; +import { ListResponseArgs } from '@isa/common/data-access'; import { ReceiptListItem } from './models'; describe('ReturnSearchStore', () => { @@ -48,7 +48,14 @@ describe('ReturnSearchStore', () => { spectator.service.beforeSearch(1); spectator.service.handleSearchSuccess({ processId: 1, - response: { hits: 10, result: [], error: false, skip: 0, take: 10, invalidProperties: {} }, + response: { + hits: 10, + result: [], + error: false, + skip: 0, + take: 10, + invalidProperties: {}, + }, }); spectator.service.beforeSearch(1); diff --git a/libs/oms/data-access/src/lib/return-search.store.ts b/libs/oms/data-access/src/lib/return-search.store.ts index 3a0700f8c..5699dd8cd 100644 --- a/libs/oms/data-access/src/lib/return-search.store.ts +++ b/libs/oms/data-access/src/lib/return-search.store.ts @@ -18,7 +18,7 @@ import { ReturnSearchService } from './return-search.service'; import { tapResponse } from '@ngrx/operators'; import { effect, inject } from '@angular/core'; import { QueryTokenSchema } from './schemas'; -import { Callback, ListResponseArgs } from '@isa/common/result'; +import { Callback, ListResponseArgs } from '@isa/common/data-access'; import { ReceiptListItem } from './models'; import { Query } from '@isa/shared/filter'; import { SessionStorageProvider, withStorage } from '@isa/core/storage'; @@ -36,13 +36,19 @@ export enum ReturnSearchStatus { /** * Type definition for a return search entity. + * + * @property {number} processId - Unique identifier for the search process + * @property {ReturnSearchStatus} status - Current status of the search process + * @property {ReceiptListItem[]} [items] - List of receipt items returned by the search + * @property {number} [hits] - Total number of results + * @property {string | unknown} [error] - Error details, if any */ export type ReturnSearchEntity = { - processId: number; // Unique identifier for the search process - status: ReturnSearchStatus; // Current status of the search process - items?: ReceiptListItem[]; // List of receipt items returned by the search - hits?: number; // Total number of results - error?: string | unknown; // Error details, if any + processId: number; + status: ReturnSearchStatus; + items?: ReceiptListItem[]; + hits?: number; + error?: string | unknown; }; const config = entityConfig({ diff --git a/libs/oms/feature/return-details/src/lib/return-details-order-group-item/return-details-order-group-item.component.html b/libs/oms/feature/return-details/src/lib/return-details-order-group-item/return-details-order-group-item.component.html index f40d953ec..670929da4 100644 --- a/libs/oms/feature/return-details/src/lib/return-details-order-group-item/return-details-order-group-item.component.html +++ b/libs/oms/feature/return-details/src/lib/return-details-order-group-item/return-details-order-group-item.component.html @@ -1,4 +1,8 @@ - +

{{ item().product.contributors }}

-

{{ item().product.name }}

+

+ {{ item().product.name }} +

- - {{ item().price.value.value | currency: item().price.value.currency }} - - - inkl. {{ item().price.vat.inPercent }}% MwSt - + @if (item().price?.value; as value) { + + {{ value.value | currency: value.currency }} + + } + @if (item().price?.vat; as vat) { + + inkl. {{ vat.inPercent }}% MwSt + + }
@@ -29,7 +49,11 @@ {{ item().product.formatDetail }}
-
+
{{ item().product.manufacturer }} | {{ item().product.ean }}
@@ -39,7 +63,13 @@
@if (selectable()) { - + }
diff --git a/libs/oms/feature/return-details/src/lib/return-details-order-group-item/return-details-order-group-item.component.spec.ts b/libs/oms/feature/return-details/src/lib/return-details-order-group-item/return-details-order-group-item.component.spec.ts new file mode 100644 index 000000000..846757193 --- /dev/null +++ b/libs/oms/feature/return-details/src/lib/return-details-order-group-item/return-details-order-group-item.component.spec.ts @@ -0,0 +1,197 @@ +import { byText } from '@ngneat/spectator'; +import { createComponentFactory, Spectator } from '@ngneat/spectator/jest'; +import { MockDirective } from 'ng-mocks'; + +import { ReceiptItem } from '@isa/oms/data-access'; +import { CheckboxComponent } from '@isa/ui/input-controls'; +import { ItemRowComponent } from '@isa/ui/item-rows'; + +import { ReturnDetailsOrderGroupItemComponent } from './return-details-order-group-item.component'; +import { ProductImageDirective } from '@isa/shared/product-image'; + +// Helper function to create mock ReceiptItem data +const createMockItem = ( + ean: string, + canReturn: boolean, + name = 'Test Product', +): ReceiptItem => + ({ + id: 123, + quantity: { quantity: 1 }, + price: { + value: { value: 19.99, currency: 'EUR' }, + vat: { inPercent: 19 }, + }, + product: { + ean: ean, + name: name, + contributors: 'Test Author', + format: 'HC', + formatDetail: 'Hardcover', + manufacturer: 'Test Publisher', + publicationDate: '2024-01-01T00:00:00Z', + catalogProductNumber: '1234567890', + volume: '1', + }, + actions: [{ key: 'canReturn', value: String(canReturn) }], + }) as ReceiptItem; + +describe('ReturnDetailsOrderGroupItemComponent', () => { + let spectator: Spectator; + const mockItemSelectable = createMockItem('1234567890123', true); + const mockItemNotSelectable = createMockItem('9876543210987', false); + + const createComponent = createComponentFactory({ + component: ReturnDetailsOrderGroupItemComponent, + // Spectator automatically stubs standalone dependencies like ItemRowComponent, CheckboxComponent etc. + // We don't need deep interaction, just verify the host component renders correctly. + // If specific interactions were needed, we could provide mocks or use overrideComponents. + overrideComponents: [ + [ + ReturnDetailsOrderGroupItemComponent, + { + remove: { imports: [ProductImageDirective] }, + add: { + imports: [MockDirective(ProductImageDirective)], + }, + }, + ], + ], + detectChanges: false, // Control initial detection manually + }); + + beforeEach(() => { + // Default setup with a selectable item + spectator = createComponent({ + props: { + item: mockItemSelectable, // Use signal for input + selected: false, // Use signal for model + }, + }); + }); + + it('should create', () => { + // Arrange + spectator.detectChanges(); // Trigger initial render + + // Assert + expect(spectator.component).toBeTruthy(); + }); + + it('should display product details correctly', () => { + // Arrange + spectator.detectChanges(); + const item = mockItemSelectable; + + // Assert + expect(spectator.query(byText(item.product.contributors))).toExist(); + expect(spectator.query(`[data-what="product-name"]`)).toHaveText( + item.product.name, + ); + expect(spectator.query(`[data-what="product-price"]`)).toHaveText('€19.99'); // Assuming default locale formatting + expect( + spectator.query(byText(`inkl. ${item.price?.vat?.inPercent}% MwSt`)), + ).toExist(); + expect(spectator.query(`[data-what="product-info"]`)).toHaveText( + `${item.product.manufacturer} | ${item.product.ean}`, + ); + // Date formatting depends on locale, checking for year is safer + expect( + spectator.query(byText(/Jan 2024/)), // Adjust regex based on expected format/locale + ).toExist(); + expect(spectator.query(`img[data-what="product-image"]`)).toHaveAttribute( + 'data-which', + item.product.ean, + ); + }); + + it('should display the checkbox when item is selectable', () => { + // Arrange + spectator.setInput('item', mockItemSelectable); // Ensure selectable item + spectator.detectChanges(); + + // Assert + expect(spectator.component.selectable()).toBe(true); + const checkbox = spectator.query(CheckboxComponent); + expect(checkbox).toBeTruthy(); + expect( + spectator.query(`input[data-what="return-item-checkbox"]`), + ).toExist(); + }); + + it('should NOT display the checkbox when item is not selectable', () => { + // Arrange + spectator.setInput('item', mockItemNotSelectable); + spectator.detectChanges(); + + // Assert + expect(spectator.component.selectable()).toBe(false); + expect( + spectator.query(`input[data-what="return-item-checkbox"]`), + ).not.toExist(); + expect(spectator.query(CheckboxComponent)).toBeFalsy(); + }); + + it('should update the selected model when checkbox is clicked', () => { + // Arrange + spectator.setInput('item', mockItemSelectable); // Ensure checkbox is visible + spectator.setInput('selected', false); // Start deselected + spectator.detectChanges(); + const checkboxInput = spectator.query( + `input[data-what="return-item-checkbox"]`, + ); + expect(checkboxInput).not.toBeChecked(); + expect(spectator.component.selected()).toBe(false); + + // Act + spectator.click(checkboxInput!); + + // Assert + expect(spectator.component.selected()).toBe(true); + // Note: Checking the input's checked state directly after click might be flaky + // depending on change detection timing. Relying on the model signal is more robust. + }); + + it('should reflect the initial selected state in the checkbox', () => { + // Arrange + spectator.setInput('item', mockItemSelectable); + spectator.setInput('selected', true); // Start selected + spectator.detectChanges(); + + // Assert + const checkboxInput = spectator.query( + `input[data-what="return-item-checkbox"]`, + ); + expect(checkboxInput).toBeChecked(); + }); + + it('should have correct E2E attributes', () => { + // Arrange + spectator.detectChanges(); + const item = mockItemSelectable; + const ean = item.product.ean; + + // Assert + expect(spectator.query(`[data-what="return-item-row"]`)).toBeTruthy(); + expect(spectator.query(`[data-which="${ean}"]`)).toBeTruthy(); + expect(spectator.query(`img[data-what="product-image"]`)).toHaveAttribute( + 'data-which', + ean, + ); + expect(spectator.query(`[data-what="product-name"]`)).toHaveAttribute( + 'data-which', + ean, + ); + expect(spectator.query(`[data-what="product-price"]`)).toHaveAttribute( + 'data-which', + ean, + ); + expect(spectator.query(`[data-what="product-info"]`)).toHaveAttribute( + 'data-which', + ean, + ); + expect( + spectator.query(`input[data-what="return-item-checkbox"]`), + ).toHaveAttribute('data-which', ean); + }); +}); diff --git a/libs/oms/feature/return-details/src/lib/return-details-order-group-item/return-details-order-group-item.component.ts b/libs/oms/feature/return-details/src/lib/return-details-order-group-item/return-details-order-group-item.component.ts index 2531c8fb4..526b2353e 100644 --- a/libs/oms/feature/return-details/src/lib/return-details-order-group-item/return-details-order-group-item.component.ts +++ b/libs/oms/feature/return-details/src/lib/return-details-order-group-item/return-details-order-group-item.component.ts @@ -1,5 +1,12 @@ +import { coerceBooleanProperty } from '@angular/cdk/coercion'; import { CurrencyPipe, DatePipe, LowerCasePipe } from '@angular/common'; -import { ChangeDetectionStrategy, Component, computed, input, model } from '@angular/core'; +import { + ChangeDetectionStrategy, + Component, + computed, + input, + model, +} from '@angular/core'; import { ProductFormatIconGroup } from '@isa/icons'; import { ReceiptItem } from '@isa/oms/data-access'; @@ -8,6 +15,10 @@ import { CheckboxComponent } from '@isa/ui/input-controls'; import { ItemRowComponent } from '@isa/ui/item-rows'; import { NgIconComponent, provideIcons } from '@ng-icons/core'; +/** + * Component to display a single item within an order group for the return details feature. + * It shows item details like image, name, price, and allows selection if the item is returnable. + */ @Component({ selector: 'oms-feature-return-details-order-group-item', templateUrl: './return-details-order-group-item.component.html', @@ -26,11 +37,16 @@ import { NgIconComponent, provideIcons } from '@ng-icons/core'; providers: [provideIcons(ProductFormatIconGroup)], }) export class ReturnDetailsOrderGroupItemComponent { + /** The receipt item data to display. */ item = input.required(); + /** Model representing the selection state of the item (checked or unchecked). */ selected = model(false); + /** Computed signal indicating whether the item is selectable for return based on its actions. */ selectable = computed(() => { - return this.item()?.actions?.some((a) => a.key === 'canReturn' && Boolean(a.value)); + return this.item()?.actions?.some( + (a) => a.key === 'canReturn' && coerceBooleanProperty(a.value), + ); }); } diff --git a/libs/oms/feature/return-details/src/lib/return-details.component.ts b/libs/oms/feature/return-details/src/lib/return-details.component.ts index 3d7308666..8fd115e67 100644 --- a/libs/oms/feature/return-details/src/lib/return-details.component.ts +++ b/libs/oms/feature/return-details/src/lib/return-details.component.ts @@ -12,9 +12,17 @@ import { toSignal } from '@angular/core/rxjs-interop'; import { z } from 'zod'; import { NgIconComponent, provideIcons } from '@ng-icons/core'; -import { isaActionPlus, isaActionMinus, isaActionChevronLeft } from '@isa/icons'; +import { + isaActionPlus, + isaActionMinus, + isaActionChevronLeft, +} from '@isa/icons'; import { ButtonComponent, TextButtonComponent } from '@isa/ui/buttons'; -import { ReceiptItem, ReturnDetailsStore, ReturnProcessStore } from '@isa/oms/data-access'; +import { + ReceiptItem, + ReturnDetailsStore, + ReturnProcessStore, +} from '@isa/oms/data-access'; import { injectActivatedProcessId } from '@isa/core/process'; import { ReturnDetailsDataComponent } from './return-details-data/return-details-data.component'; import { ReturnDetailsHeaderComponent } from './return-details-header/return-details-header.component'; @@ -38,7 +46,9 @@ import { Location } from '@angular/common'; ReturnDetailsOrderGroupItemComponent, ReturnDetailsOrderGroupDataComponent, ], - providers: [provideIcons({ isaActionPlus, isaActionMinus, isaActionChevronLeft })], + providers: [ + provideIcons({ isaActionPlus, isaActionMinus, isaActionChevronLeft }), + ], }) export class ReturnDetailsComponent { private processId = injectActivatedProcessId(); @@ -114,8 +124,8 @@ export class ReturnDetailsComponent { return; } - const data = this.receiptResult().data; - if (!data) { + const receipt = this.receiptResult().data; + if (!receipt) { return; } @@ -127,10 +137,12 @@ export class ReturnDetailsComponent { this.#returnProcessStore.startProcess({ processId, - receiptId: data.id, + receipt, items, }); - this._router.navigate(['../../', 'process'], { relativeTo: this._activatedRoute }); + this._router.navigate(['../../', 'process'], { + relativeTo: this._activatedRoute, + }); } } diff --git a/libs/oms/feature/return-process/src/lib/return-process-feature.component.ts b/libs/oms/feature/return-process/src/lib/return-process-feature.component.ts deleted file mode 100644 index 160b9b9a8..000000000 --- a/libs/oms/feature/return-process/src/lib/return-process-feature.component.ts +++ /dev/null @@ -1,42 +0,0 @@ -import { - ChangeDetectionStrategy, - Component, - computed, - inject, -} from '@angular/core'; -import { ButtonComponent } from '@isa/ui/buttons'; -import { NgIconComponent, provideIcons } from '@ng-icons/core'; -import { isaActionChevronLeft } from '@isa/icons'; -import { ReturnProcess, ReturnProcessStore } from '@isa/oms/data-access'; -import { injectActivatedProcessId } from '@isa/core/process'; -import { ReturnProcessItemComponent } from './return-process-item/return-process-item.component'; -import { Location } from '@angular/common'; - -@Component({ - selector: 'oms-feature-return-process-feature', - templateUrl: './return-process-feature.component.html', - styleUrls: ['./return-process-feature.component.scss'], - changeDetection: ChangeDetectionStrategy.OnPush, - imports: [ButtonComponent, NgIconComponent, ReturnProcessItemComponent], - providers: [provideIcons({ isaActionChevronLeft })], -}) -export class ReturnProcessFeatureComponent { - location = inject(Location); - - #returnProcessStore = inject(ReturnProcessStore); - - processId = injectActivatedProcessId(); - - returnProcesses = computed(() => { - const processId = this.processId(); - - if (!processId) { - console.warn('No process id found'); - return []; - } - - return this.#returnProcessStore - .entities() - .filter((process: ReturnProcess) => process.processId === processId); - }); -} diff --git a/libs/oms/feature/return-process/src/lib/return-process-item/return-process-item.component.html b/libs/oms/feature/return-process/src/lib/return-process-item/return-process-item.component.html index 7f30d2b91..7d323c6dc 100644 --- a/libs/oms/feature/return-process/src/lib/return-process-item/return-process-item.component.html +++ b/libs/oms/feature/return-process/src/lib/return-process-item/return-process-item.component.html @@ -14,51 +14,32 @@ class="return-process-item-body border-b-isa-neutral-300" [class.border-b]="eligible" > -
- -
-
- {{ product.contributors }} -
-
- {{ product.name }} -
-
- - {{ product.formatDetail }} -
-
-
+
- @switch (eligible?.state) { - @case ('eligible') { -
- - Artikel bereit für Rückgabe -
- } - @case ('not-eligible') { -
- - {{ eligible.reason }} -
+ @if (eligible) { + @switch (eligible.state) { + @case ('eligible') { +
+ + Artikel bereit für Rückgabe +
+ } + @case ('not-eligible') { +
+ + {{ eligible.reason }} +
+ } } } } diff --git a/libs/oms/feature/return-process/src/lib/return-process-item/return-process-item.component.scss b/libs/oms/feature/return-process/src/lib/return-process-item/return-process-item.component.scss index 1280dc0e3..910eee7f4 100644 --- a/libs/oms/feature/return-process/src/lib/return-process-item/return-process-item.component.scss +++ b/libs/oms/feature/return-process/src/lib/return-process-item/return-process-item.component.scss @@ -28,33 +28,6 @@ } } -.return-process-item-body__product { - @apply grid grid-cols-[auto,1fr] gap-6 pb-6; - - @apply border-b border-neutral-300; - - @screen isa-desktop-l { - @apply border-b-0; - } -} - -.return-process-item-body__product-info { - display: flex; - flex-direction: column; - align-items: flex-start; - gap: 0.5rem; - flex: 1 0 0; -} - -.return-process-item-body__product-info-format { - display: flex; - align-items: center; - gap: 0.5rem; - align-self: stretch; - - @apply text-isa-secondary-900 isa-text-body-2-regular; -} - [lib-return-process-questions] { @apply flex-grow; } diff --git a/libs/oms/feature/return-process/src/lib/return-process-item/return-process-item.component.ts b/libs/oms/feature/return-process/src/lib/return-process-item/return-process-item.component.ts index 956f1ac70..9e1325f3f 100644 --- a/libs/oms/feature/return-process/src/lib/return-process-item/return-process-item.component.ts +++ b/libs/oms/feature/return-process/src/lib/return-process-item/return-process-item.component.ts @@ -5,18 +5,24 @@ import { inject, input, } from '@angular/core'; -import { ProductImageDirective } from '@isa/shared/product-image'; import { ReturnProcessService, ReturnProcessStore } from '@isa/oms/data-access'; import { NgIconComponent, provideIcons } from '@ng-icons/core'; -import { - ProductFormatIconGroup, - isaActionCheck, - isaActionClose, -} from '@isa/icons'; -import { LowerCasePipe } from '@angular/common'; +import { isaActionCheck, isaActionClose } from '@isa/icons'; import { ReturnProcessQuestionsComponent } from '../return-process-questions/return-process-questions.component'; import { ProgressBarComponent } from '@isa/ui/progress-bar'; +import { ReturnProductInfoComponent } from '@isa/oms/shared/product-info'; +/** + * Component that displays a single return process item with its associated questions and progress. + * Integrates with ReturnProcessService and ReturnProcessStore for return process management. + * + * @example + * ```html + * + * + * ``` + */ @Component({ selector: 'oms-feature-return-process-item', templateUrl: './return-process-item.component.html', @@ -24,32 +30,33 @@ import { ProgressBarComponent } from '@isa/ui/progress-bar'; changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, imports: [ - ProductImageDirective, NgIconComponent, - LowerCasePipe, ReturnProcessQuestionsComponent, ProgressBarComponent, + ReturnProductInfoComponent, ], - providers: [ - provideIcons({ ...ProductFormatIconGroup, isaActionCheck, isaActionClose }), - ], + providers: [provideIcons({ isaActionCheck, isaActionClose })], }) export class ReturnProcessItemComponent { #returnProcessService = inject(ReturnProcessService); returnProcessStore = inject(ReturnProcessStore); + /** The unique identifier for the return process */ returnProcessId = input.required(); + /** The current return process object derived from the store */ returnProcess = computed(() => { return this.returnProcessStore.entityMap()[this.returnProcessId()]; }); + /** The progress status of the return process questions */ progress = computed(() => { return this.#returnProcessService.returnProcessQuestionsProgress( this.returnProcess(), ); }); + /** Whether the item is eligible for return based on the current state */ eligibleForReturn = computed(() => { return this.#returnProcessService.eligibleForReturn(this.returnProcess()); }); diff --git a/libs/oms/feature/return-process/src/lib/return-process-questions/return-process-checklist-question/return-process-checklist-question.component.ts b/libs/oms/feature/return-process/src/lib/return-process-questions/return-process-checklist-question/return-process-checklist-question.component.ts index 083a0f03b..491c405ae 100644 --- a/libs/oms/feature/return-process/src/lib/return-process-questions/return-process-checklist-question/return-process-checklist-question.component.ts +++ b/libs/oms/feature/return-process/src/lib/return-process-questions/return-process-checklist-question/return-process-checklist-question.component.ts @@ -47,13 +47,13 @@ import { z } from 'zod'; export class ReturnProcessChecklistQuestionComponent { #returnProcessStore = inject(ReturnProcessStore); - processId = input.required(); + returnProcessId = input.required(); question = input.required(); currentAnswer = computed(() => { const currentAnswersRaw = - this.#returnProcessStore.entityMap()[this.processId()]?.answers[ + this.#returnProcessStore.entityMap()[this.returnProcessId()]?.answers[ this.question().key ]; @@ -80,7 +80,7 @@ export class ReturnProcessChecklistQuestionComponent { updateAnswer(answer: ReturnProcessChecklistAnswer) { this.#returnProcessStore.setAnswer( - this.processId(), + this.returnProcessId(), this.question().key, answer, ); diff --git a/libs/oms/feature/return-process/src/lib/return-process-questions/return-process-info-question/return-process-info-question.component.html b/libs/oms/feature/return-process/src/lib/return-process-questions/return-process-info-question/return-process-info-question.component.html new file mode 100644 index 000000000..b17fd7229 --- /dev/null +++ b/libs/oms/feature/return-process/src/lib/return-process-questions/return-process-info-question/return-process-info-question.component.html @@ -0,0 +1,10 @@ +
+ {{ question().description }} +
+
    + @for (content of question().content; track content) { +
  1. + {{ content }} +
  2. + } +
diff --git a/libs/oms/feature/return-process/src/lib/return-process-questions/return-process-info-question/return-process-info-question.component.scss b/libs/oms/feature/return-process/src/lib/return-process-questions/return-process-info-question/return-process-info-question.component.scss new file mode 100644 index 000000000..fa3d87db6 --- /dev/null +++ b/libs/oms/feature/return-process/src/lib/return-process-questions/return-process-info-question/return-process-info-question.component.scss @@ -0,0 +1,3 @@ +:host { + @apply flex flex-col gap-2 items-start text-isa-neutral-900; +} diff --git a/libs/oms/feature/return-process/src/lib/return-process-questions/return-process-info-question/return-process-info-question.component.ts b/libs/oms/feature/return-process/src/lib/return-process-questions/return-process-info-question/return-process-info-question.component.ts new file mode 100644 index 000000000..4fe1e9c34 --- /dev/null +++ b/libs/oms/feature/return-process/src/lib/return-process-questions/return-process-info-question/return-process-info-question.component.ts @@ -0,0 +1,12 @@ +import { ChangeDetectionStrategy, Component, input } from '@angular/core'; +import { ReturnProcessInfoQuestion } from '@isa/oms/data-access'; + +@Component({ + selector: 'oms-feature-return-process-info-question', + templateUrl: './return-process-info-question.component.html', + styleUrls: ['./return-process-info-question.component.scss'], + changeDetection: ChangeDetectionStrategy.OnPush, +}) +export class ReturnProcessInfoQuestionComponent { + question = input.required(); +} diff --git a/libs/oms/feature/return-process/src/lib/return-process-questions/return-process-product-question/return-process-product-question.component.ts b/libs/oms/feature/return-process/src/lib/return-process-questions/return-process-product-question/return-process-product-question.component.ts index 162db144e..9f9657e9d 100644 --- a/libs/oms/feature/return-process/src/lib/return-process-questions/return-process-product-question/return-process-product-question.component.ts +++ b/libs/oms/feature/return-process/src/lib/return-process-questions/return-process-product-question/return-process-product-question.component.ts @@ -57,7 +57,7 @@ export class ReturnProcessProductQuestionComponent { #returnProcessStore = inject(ReturnProcessStore); #catalogueSearchService = inject(CatalougeSearchService); - processId = input.required(); + returnProcessId = input.required(); question = input.required(); @@ -69,8 +69,9 @@ export class ReturnProcessProductQuestionComponent { constructor() { effect(() => { - const product = this.#returnProcessStore.entityMap()[this.processId()] - ?.answers[this.question().key] as Product; + const product = this.#returnProcessStore.entityMap()[ + this.returnProcessId() + ]?.answers[this.question().key] as Product; if (product) { this.control.setValue(product.ean); @@ -92,7 +93,7 @@ export class ReturnProcessProductQuestionComponent { next: (value) => { this.product.set(value[0].product); this.#returnProcessStore.setAnswer( - this.processId(), + this.returnProcessId(), this.question().key, value[0].product, ); diff --git a/libs/oms/feature/return-process/src/lib/return-process-questions/return-process-questions-renderer/return-process-questions-renderer.component.html b/libs/oms/feature/return-process/src/lib/return-process-questions/return-process-questions-renderer/return-process-questions-renderer.component.html new file mode 100644 index 000000000..453376adc --- /dev/null +++ b/libs/oms/feature/return-process/src/lib/return-process-questions/return-process-questions-renderer/return-process-questions-renderer.component.html @@ -0,0 +1,38 @@ +@for (question of questions(); track question.key; let last = $last) { +
+ @switch (question.type) { + @case (ReturnProcessQuestionType.Select) { + + } + @case (ReturnProcessQuestionType.Product) { + + } + @case (ReturnProcessQuestionType.Checklist) { + + } + @case (ReturnProcessQuestionType.Info) { + + } + @case (ReturnProcessQuestionType.Group) { + + } + @default { + {{ question | json }} + } + } +
+} diff --git a/libs/oms/feature/return-process/src/lib/return-process-questions/return-process-questions-renderer/return-process-questions-renderer.component.scss b/libs/oms/feature/return-process/src/lib/return-process-questions/return-process-questions-renderer/return-process-questions-renderer.component.scss new file mode 100644 index 000000000..a03ede724 --- /dev/null +++ b/libs/oms/feature/return-process/src/lib/return-process-questions/return-process-questions-renderer/return-process-questions-renderer.component.scss @@ -0,0 +1,17 @@ +:host { + @apply flex flex-col gap-6; +} + +.item-content { + @apply pb-0; + + &.with-border-bottom { + @apply border-b border-solid border-isa-neutral-300 pb-6; + } + + .item-content { + &.with-border-bottom { + @apply border-none; + } + } +} diff --git a/libs/oms/feature/return-process/src/lib/return-process-questions/return-process-questions-renderer/return-process-questions-renderer.ts b/libs/oms/feature/return-process/src/lib/return-process-questions/return-process-questions-renderer/return-process-questions-renderer.ts new file mode 100644 index 000000000..ad9ca737a --- /dev/null +++ b/libs/oms/feature/return-process/src/lib/return-process-questions/return-process-questions-renderer/return-process-questions-renderer.ts @@ -0,0 +1,30 @@ +import { JsonPipe } from '@angular/common'; +import { ChangeDetectionStrategy, Component, input } from '@angular/core'; +import { + ReturnProcessQuestion, + ReturnProcessQuestionType, +} from '@isa/oms/data-access'; +import { ReturnProcessSelectQuestionComponent } from '../return-process-select-question/return-process-select-question.component'; +import { ReturnProcessProductQuestionComponent } from '../return-process-product-question/return-process-product-question.component'; +import { ReturnProcessChecklistQuestionComponent } from '../return-process-checklist-question/return-process-checklist-question.component'; +import { ReturnProcessInfoQuestionComponent } from '../return-process-info-question/return-process-info-question.component'; + +@Component({ + selector: 'oms-feature-return-process-questions-renderer', + templateUrl: './return-process-questions-renderer.component.html', + styleUrls: ['./return-process-questions-renderer.component.scss'], + changeDetection: ChangeDetectionStrategy.OnPush, + imports: [ + JsonPipe, + ReturnProcessSelectQuestionComponent, + ReturnProcessProductQuestionComponent, + ReturnProcessChecklistQuestionComponent, + ReturnProcessInfoQuestionComponent, + ], +}) +export class ReturnProcessQuestionsRendererComponent { + ReturnProcessQuestionType = ReturnProcessQuestionType; + returnProcessId = input.required(); + + questions = input.required(); +} diff --git a/libs/oms/feature/return-process/src/lib/return-process-questions/return-process-questions.component.html b/libs/oms/feature/return-process/src/lib/return-process-questions/return-process-questions.component.html index 81dfd39e3..ba4f3c76a 100644 --- a/libs/oms/feature/return-process/src/lib/return-process-questions/return-process-questions.component.html +++ b/libs/oms/feature/return-process/src/lib/return-process-questions/return-process-questions.component.html @@ -17,30 +17,8 @@
} -@for (question of questions(); track question.key; let last = $last) { -
- @switch (question.type) { - @case (ReturnProcessQuestionType.Select) { - - } - @case (ReturnProcessQuestionType.Product) { - - } - @case (ReturnProcessQuestionType.Checklist) { - - } - @default { - {{ question | json }} - } - } -
-} + + diff --git a/libs/oms/feature/return-process/src/lib/return-process-questions/return-process-questions.component.scss b/libs/oms/feature/return-process/src/lib/return-process-questions/return-process-questions.component.scss index 2e2a132ea..0b2eba0fb 100644 --- a/libs/oms/feature/return-process/src/lib/return-process-questions/return-process-questions.component.scss +++ b/libs/oms/feature/return-process/src/lib/return-process-questions/return-process-questions.component.scss @@ -2,11 +2,3 @@ @apply flex flex-col items-stretch justify-between gap-6; @apply text-isa-neutral-900; } - -.item-content { - @apply pb-0; - - &.with-border-bottom { - @apply border-b border-solid border-isa-neutral-300 pb-6; - } -} diff --git a/libs/oms/feature/return-process/src/lib/return-process-questions/return-process-questions.component.ts b/libs/oms/feature/return-process/src/lib/return-process-questions/return-process-questions.component.ts index bce52b5fc..b4ea425d6 100644 --- a/libs/oms/feature/return-process/src/lib/return-process-questions/return-process-questions.component.ts +++ b/libs/oms/feature/return-process/src/lib/return-process-questions/return-process-questions.component.ts @@ -13,24 +13,34 @@ import { ReturnProcessService, ReturnProcessStore, } from '@isa/oms/data-access'; -import { ReturnProcessSelectQuestionComponent } from './return-process-select-question/return-process-select-question.component'; -import { ReturnProcessProductQuestionComponent } from './return-process-product-question/return-process-product-question.component'; -import { ReturnProcessChecklistQuestionComponent } from './return-process-checklist-question/return-process-checklist-question.component'; import { DropdownButtonComponent, DropdownOptionComponent, } from '@isa/ui/input-controls'; +import { ReturnProcessQuestionsRendererComponent } from './return-process-questions-renderer/return-process-questions-renderer'; +/** + * Component for managing return process questions. + * + * This component handles: + * - Managing return process questions and answers + * - Displaying appropriate question types based on product category + * - Updating question state based on previous answers + * + * @example + * ```html + * + * ``` + */ @Component({ selector: 'oms-feature-return-process-questions', templateUrl: './return-process-questions.component.html', styleUrls: ['./return-process-questions.component.scss'], changeDetection: ChangeDetectionStrategy.OnPush, imports: [ - JsonPipe, - ReturnProcessSelectQuestionComponent, - ReturnProcessProductQuestionComponent, - ReturnProcessChecklistQuestionComponent, + ReturnProcessQuestionsRendererComponent, DropdownButtonComponent, DropdownOptionComponent, ], @@ -91,8 +101,7 @@ export class ReturnProcessQuestionsComponent { if (!currentProcess) { return false; } - const selectedCategory = currentProcess.productCategory; const currentQuestions = this.questions(); - return !!selectedCategory || !currentQuestions.length; + return !currentQuestions.length; }); } diff --git a/libs/oms/feature/return-process/src/lib/return-process-questions/return-process-select-question/return-process-select-question.component.ts b/libs/oms/feature/return-process/src/lib/return-process-questions/return-process-select-question/return-process-select-question.component.ts index 55caa2047..3f747ef94 100644 --- a/libs/oms/feature/return-process/src/lib/return-process-questions/return-process-select-question/return-process-select-question.component.ts +++ b/libs/oms/feature/return-process/src/lib/return-process-questions/return-process-select-question/return-process-select-question.component.ts @@ -24,7 +24,7 @@ import { ChipsComponent, ChipOptionComponent } from '@isa/ui/input-controls'; export class ReturnProcessSelectQuestionComponent { #returnProcessStore = inject(ReturnProcessStore); - processId = input.required(); + returnProcessId = input.required(); question = input.required(); @@ -36,13 +36,13 @@ export class ReturnProcessSelectQuestionComponent { this.control.valueChanges.pipe(takeUntilDestroyed()).subscribe((value) => { if (this.control.valid) { this.#returnProcessStore.setAnswer( - this.processId(), + this.returnProcessId(), this.question().key, value, ); } else { this.#returnProcessStore.removeAnswer( - this.processId(), + this.returnProcessId(), this.question().key, ); } @@ -50,7 +50,7 @@ export class ReturnProcessSelectQuestionComponent { effect(() => { const value = - this.#returnProcessStore.entityMap()[this.processId()]?.answers[ + this.#returnProcessStore.entityMap()[this.returnProcessId()]?.answers[ this.question().key ]; if (value !== this.control.value) { diff --git a/libs/oms/feature/return-process/src/lib/return-process-feature.component.html b/libs/oms/feature/return-process/src/lib/return-process.component.html similarity index 70% rename from libs/oms/feature/return-process/src/lib/return-process-feature.component.html rename to libs/oms/feature/return-process/src/lib/return-process.component.html index 53e0e5e71..612b6ccb2 100644 --- a/libs/oms/feature/return-process/src/lib/return-process-feature.component.html +++ b/libs/oms/feature/return-process/src/lib/return-process.component.html @@ -1,6 +1,7 @@ + +

+ Zusammenfassung überprüfen +

+
+ @for (item of returnProcesses(); track item.id) { + + } +
+
+ @if (returnItemsAndPrintReciptStatus() !== 'success') { + + } +
diff --git a/libs/oms/feature/return-summary/src/lib/return-summary.component.scss b/libs/oms/feature/return-summary/src/lib/return-summary.component.scss new file mode 100644 index 000000000..ce8522a7e --- /dev/null +++ b/libs/oms/feature/return-summary/src/lib/return-summary.component.scss @@ -0,0 +1,3 @@ +:host { + @apply grid grid-flow-row gap-6 justify-stretch mt-6 relative; +} diff --git a/libs/oms/feature/return-summary/src/lib/return-summary.component.spec.ts b/libs/oms/feature/return-summary/src/lib/return-summary.component.spec.ts new file mode 100644 index 000000000..b94f05f49 --- /dev/null +++ b/libs/oms/feature/return-summary/src/lib/return-summary.component.spec.ts @@ -0,0 +1,190 @@ +// import { createComponentFactory, Spectator } from '@ngneat/spectator/jest'; +// import { MockComponent } from 'ng-mocks'; +// import { ReturnSummaryComponent } from './return-summary.component'; +// import { +// ReturnProcess, +// ReturnProcessService, +// ReturnProcessStore, +// } from '@isa/oms/data-access'; +// import { ReturnSummaryItemComponent } from './return-summary-item/return-summary-item.component'; + +// jest.mock('@isa/core/process', () => ({ +// injectActivatedProcessId: () => jest.fn(() => 1), +// })); + +// const MOCK_RETURN_PROCESSES: ReturnProcess[] = [ +// { id: 1, processId: 1, productCategory: 'Electronics' } as ReturnProcess, +// { id: 2, processId: 1, productCategory: 'Books' } as ReturnProcess, +// { id: 3, processId: 2, productCategory: 'Clothing' } as ReturnProcess, +// { id: 4, processId: 2, productCategory: 'Home Goods' } as ReturnProcess, +// { id: 5, processId: 3, productCategory: 'Electronics' } as ReturnProcess, +// { id: 6, processId: 3, productCategory: 'Toys' } as ReturnProcess, +// { id: 7, processId: 4, productCategory: 'Books' } as ReturnProcess, +// { id: 8, processId: 4, productCategory: 'Garden' } as ReturnProcess, +// ]; + +// describe('ReturnSummaryComponent', () => { +// let spectator: Spectator; + +// // Use createComponentFactory for standalone components +// const createComponent = createComponentFactory({ +// component: ReturnSummaryComponent, +// imports: [MockComponent(ReturnSummaryItemComponent)], +// mocks: [ReturnProcessStore, ReturnProcessService], +// }); + +// beforeEach(() => { +// // Arrange: Create the component instance before each test +// spectator = createComponent({ +// providers: [ +// { +// provide: ReturnProcessStore, +// useValue: { +// entities: jest.fn(() => MOCK_RETURN_PROCESSES), +// }, +// }, +// ], +// }); +// }); + +// it('should create the component', () => { +// // Assert: Check if the component instance was created successfully +// expect(spectator.component).toBeTruthy(); +// }); + +// it('should have a defined processId', () => { +// // Assert: Check if the processId is defined +// expect(spectator.component.processId()).toBeTruthy(); +// }); + +// it('should have two return processes', () => { +// // Arrange: +// const mockReturnProcesses: ReturnProcess[] = [ +// MOCK_RETURN_PROCESSES[0], +// MOCK_RETURN_PROCESSES[1], +// ]; + +// // Act: Set the returnProcesses to the mock data +// const returnProcesses = spectator.component.returnProcesses(); + +// // Assert: Check if the returnProcesses array has two items +// expect(returnProcesses.length).toBe(2); +// expect(returnProcesses).toEqual(mockReturnProcesses); +// }); + +// it('should render the return summary item component', () => { +// // Arrange: +// const mockReturnProcesses: ReturnProcess[] = [ +// MOCK_RETURN_PROCESSES[0], +// MOCK_RETURN_PROCESSES[1], +// ]; +// jest +// .spyOn(spectator.component, 'returnProcesses') +// .mockReturnValue(mockReturnProcesses); + +// // Act: Trigger change detection +// spectator.detectChanges(); + +// // Assert: Check if the return summary item component is rendered +// const returnSummaryItems = spectator.queryAll(ReturnSummaryItemComponent); + +// expect(returnSummaryItems.length).toBe(mockReturnProcesses.length); +// }); + +// it('should set the returnProcess input correctly', () => { +// // Arrange: +// const mockReturnProcesses: ReturnProcess[] = [ +// MOCK_RETURN_PROCESSES[0], +// MOCK_RETURN_PROCESSES[1], +// ]; +// jest +// .spyOn(spectator.component, 'returnProcesses') +// .mockReturnValue(mockReturnProcesses); + +// // Act: Trigger change detection +// spectator.detectChanges(); + +// // Assert: Check if the returnProcess input is set correctly +// const returnSummaryItems = spectator.queryAll(ReturnSummaryItemComponent); +// expect(returnSummaryItems[0].returnProcess).toEqual(mockReturnProcesses[0]); +// expect(returnSummaryItems[1].returnProcess).toEqual(mockReturnProcesses[1]); +// }); + +// it('should have proper E2E testing attributes', () => { +// // Arrange +// const mockReturnProcesses: ReturnProcess[] = [ +// MOCK_RETURN_PROCESSES[0], // id: 1, processId: 1, category: 'Electronics' +// MOCK_RETURN_PROCESSES[1], // id: 2, processId: 1, category: 'Books' +// ]; + +// jest +// .spyOn(spectator.component, 'returnProcesses') +// .mockReturnValue(mockReturnProcesses); + +// // Act +// spectator.detectChanges(); // Trigger change detection to render the template + +// // Assert +// // Check heading attributes +// const heading = spectator.query('[data-what="heading"]'); +// expect(heading).toBeTruthy(); +// expect(heading).toHaveAttribute('data-which', 'return-summary-title'); + +// // Check container attributes +// const container = spectator.query('[data-what="container"]'); +// expect(container).toBeTruthy(); +// expect(container).toHaveAttribute('data-which', 'return-items-list'); + +// // Check list item attributes +// const listItems = spectator.queryAll('oms-feature-return-summary-item'); +// expect(listItems.length).toBe(mockReturnProcesses.length); + +// // Check attributes for the first item +// expect(listItems[0]).toHaveAttribute('data-what', 'list-item'); +// expect(listItems[0]).toHaveAttribute('data-which', 'return-process-item'); +// expect(listItems[0]).toHaveAttribute( +// 'data-item-id', +// `${mockReturnProcesses[0].id}`, +// ); + +// expect(listItems[0]).toHaveAttribute( +// 'data-item-category', +// mockReturnProcesses[0].productCategory, +// ); + +// // Check attributes for the second item +// expect(listItems[1]).toHaveAttribute('data-what', 'list-item'); +// expect(listItems[1]).toHaveAttribute('data-which', 'return-process-item'); +// expect(listItems[1]).toHaveAttribute( +// 'data-item-id', +// `${mockReturnProcesses[1].id}`, +// ); +// expect(listItems[1]).toHaveAttribute( +// 'data-item-category', +// `${mockReturnProcesses[1].productCategory}`, +// ); +// expect(listItems[1]).toHaveAttribute( +// 'data-item-category', +// mockReturnProcesses[1].productCategory, +// ); + +// // Check button attributes +// const button = spectator.query('[data-what="button"]'); +// expect(button).toBeTruthy(); +// expect(button).toHaveAttribute('data-which', 'return-and-print'); +// }); + +// it('should call returnItemsAndPrintRecipt when button is clicked', () => { +// // Arrange: Spy on the returnItemsAndPrintRecipt method +// const returnItemsAndPrintReciptSpy = jest.spyOn( +// spectator.component, +// 'returnItemsAndPrintRecipt', +// ); + +// // Act: Trigger button click +// spectator.click('[data-what="button"][data-which="return-and-print"]'); + +// // Assert: Check if the method was called +// expect(returnItemsAndPrintReciptSpy).toHaveBeenCalled(); +// }); +// }); diff --git a/libs/oms/feature/return-summary/src/lib/return-summary.component.ts b/libs/oms/feature/return-summary/src/lib/return-summary.component.ts new file mode 100644 index 000000000..ee15acdcc --- /dev/null +++ b/libs/oms/feature/return-summary/src/lib/return-summary.component.ts @@ -0,0 +1,127 @@ +import { + ChangeDetectionStrategy, + Component, + computed, + inject, + signal, +} from '@angular/core'; +import { ReturnSummaryItemComponent } from './return-summary-item/return-summary-item.component'; +import { injectActivatedProcessId } from '@isa/core/process'; +import { + ReturnProcess, + ReturnProcessService, + ReturnProcessStore, +} from '@isa/oms/data-access'; +import { ButtonComponent } from '@isa/ui/buttons'; +import { NgIcon, provideIcons } from '@ng-icons/core'; +import { Location } from '@angular/common'; +import { isaActionChevronLeft } from '@isa/icons'; +import { logger } from '@isa/core/logging'; +import { ActivatedRoute, Router } from '@angular/router'; + +/** + * Main component for the return summary feature. Displays a list of items being returned + * and allows users to review and confirm the return process. + * + * Uses: + * - ReturnProcessStore: Manages return process state + * - ReturnProcessService: Handles return process business logic + * - Location: For navigation + * - Logger: For error tracking + * + * @example + * ```html + * + * ``` + */ +@Component({ + selector: 'oms-feature-return-summary', + templateUrl: './return-summary.component.html', + styleUrls: ['./return-summary.component.scss'], + changeDetection: ChangeDetectionStrategy.OnPush, + imports: [ReturnSummaryItemComponent, ButtonComponent, NgIcon], + providers: [provideIcons({ isaActionChevronLeft })], +}) +export class ReturnSummaryComponent { + #logger = logger(() => ({ component: ReturnSummaryComponent })); + + #returnProcessStore = inject(ReturnProcessStore); + #returnProcessService = inject(ReturnProcessService); + + #router = inject(Router); + #activatedRoute = inject(ActivatedRoute); + + /** Angular Location service for navigation */ + location = inject(Location); + + /** The active process ID from the current route */ + processId = injectActivatedProcessId(); + + /** Filtered list of return processes for the current process ID */ + returnProcesses = computed(() => { + const processId = this.processId(); + return this.#returnProcessStore + .entities() + .filter((p) => p.processId === processId); + }); + + /** + * Signal tracking the current status of the return and print operation. + * Possible values: + * - undefined: Initial state, no operation started + * - 'pending': Operation in progress + * - 'success': Operation completed successfully + * - 'error': Operation failed + */ + returnItemsAndPrintReciptStatus = signal< + undefined | 'pending' | 'success' | 'error' + >(undefined); + + /** + * Handles the return and print process for multiple items. + * + * This method: + * 1. Checks if a return process is already in progress + * 2. Sets status to pending while processing + * 3. Calls the ReturnProcessService to complete the return + * 4. Updates status based on success/failure + * 5. Logs errors if they occur + * + * The button will be disabled and show a loading indicator while processing, + * and will be hidden after a successful return. + * + * @returns {Promise} + */ + async returnItemsAndPrintRecipt() { + if (this.returnItemsAndPrintReciptStatus() === 'pending') { + this.#logger.warn('Return process already in progress', { + function: 'returnItemsAndPrintRecipt', + }); + return; + } + + try { + this.returnItemsAndPrintReciptStatus.set('pending'); + + const returnReceipts = + await this.#returnProcessService.completeReturnProcess( + this.returnProcesses(), + ); + + this.#logger.info('Return receipts created', { + count: returnReceipts.length, + }); + this.returnItemsAndPrintReciptStatus.set('success'); + + // TODO: Navigation to "Rückgabe war erfolgreich" page + await this.#router.navigate(['../../'], { + relativeTo: this.#activatedRoute, + }); + } catch (error) { + this.#logger.error('Error completing return process', error, { + function: 'returnItemsAndPrintRecipt', + }); + this.returnItemsAndPrintReciptStatus.set('error'); + } + } +} diff --git a/libs/oms/feature/return-summary/src/lib/routes.ts b/libs/oms/feature/return-summary/src/lib/routes.ts new file mode 100644 index 000000000..ac2b81365 --- /dev/null +++ b/libs/oms/feature/return-summary/src/lib/routes.ts @@ -0,0 +1,4 @@ +import { Routes } from '@angular/router'; +import { ReturnSummaryComponent } from './return-summary.component'; + +export const routes: Routes = [{ path: '', component: ReturnSummaryComponent }]; diff --git a/libs/oms/feature/return-summary/src/test-setup.ts b/libs/oms/feature/return-summary/src/test-setup.ts new file mode 100644 index 000000000..ea414013f --- /dev/null +++ b/libs/oms/feature/return-summary/src/test-setup.ts @@ -0,0 +1,6 @@ +import { setupZoneTestEnv } from 'jest-preset-angular/setup-env/zone'; + +setupZoneTestEnv({ + errorOnUnknownElements: true, + errorOnUnknownProperties: true, +}); diff --git a/libs/oms/feature/return-summary/tsconfig.json b/libs/oms/feature/return-summary/tsconfig.json new file mode 100644 index 000000000..52a0866e0 --- /dev/null +++ b/libs/oms/feature/return-summary/tsconfig.json @@ -0,0 +1,28 @@ +{ + "compilerOptions": { + "target": "es2022", + "forceConsistentCasingInFileNames": true, + "strict": true, + "noImplicitOverride": true, + "noPropertyAccessFromIndexSignature": true, + "noImplicitReturns": true, + "noFallthroughCasesInSwitch": true + }, + "files": [], + "include": [], + "references": [ + { + "path": "./tsconfig.lib.json" + }, + { + "path": "./tsconfig.spec.json" + } + ], + "extends": "../../../../tsconfig.base.json", + "angularCompilerOptions": { + "enableI18nLegacyMessageIdFormat": false, + "strictInjectionParameters": true, + "strictInputAccessModifiers": true, + "strictTemplates": true + } +} diff --git a/libs/oms/feature/return-summary/tsconfig.lib.json b/libs/oms/feature/return-summary/tsconfig.lib.json new file mode 100644 index 000000000..912738705 --- /dev/null +++ b/libs/oms/feature/return-summary/tsconfig.lib.json @@ -0,0 +1,17 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "outDir": "../../../../dist/out-tsc", + "declaration": true, + "declarationMap": true, + "inlineSources": true, + "types": [] + }, + "exclude": [ + "src/**/*.spec.ts", + "src/test-setup.ts", + "jest.config.ts", + "src/**/*.test.ts" + ], + "include": ["src/**/*.ts"] +} diff --git a/libs/oms/feature/return-summary/tsconfig.spec.json b/libs/oms/feature/return-summary/tsconfig.spec.json new file mode 100644 index 000000000..6e5925e5c --- /dev/null +++ b/libs/oms/feature/return-summary/tsconfig.spec.json @@ -0,0 +1,16 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "outDir": "../../../../dist/out-tsc", + "module": "commonjs", + "target": "es2016", + "types": ["jest", "node"] + }, + "files": ["src/test-setup.ts"], + "include": [ + "jest.config.ts", + "src/**/*.test.ts", + "src/**/*.spec.ts", + "src/**/*.d.ts" + ] +} diff --git a/libs/oms/shared/product-info/README.md b/libs/oms/shared/product-info/README.md new file mode 100644 index 000000000..50a2b6e67 --- /dev/null +++ b/libs/oms/shared/product-info/README.md @@ -0,0 +1,7 @@ +# oms-shared-product-info + +This library was generated with [Nx](https://nx.dev). + +## Running unit tests + +Run `nx test oms-shared-product-info` to execute the unit tests. diff --git a/libs/oms/shared/product-info/eslint.config.mjs b/libs/oms/shared/product-info/eslint.config.mjs new file mode 100644 index 000000000..b8412e7cd --- /dev/null +++ b/libs/oms/shared/product-info/eslint.config.mjs @@ -0,0 +1,34 @@ +import nx from '@nx/eslint-plugin'; +import baseConfig from '../../../../eslint.config.mjs'; + +export default [ + ...baseConfig, + ...nx.configs['flat/angular'], + ...nx.configs['flat/angular-template'], + { + files: ['**/*.ts'], + rules: { + '@angular-eslint/directive-selector': [ + 'error', + { + type: 'attribute', + prefix: 'omsShared', + style: 'camelCase', + }, + ], + '@angular-eslint/component-selector': [ + 'error', + { + type: 'element', + prefix: 'oms-shared', + style: 'kebab-case', + }, + ], + }, + }, + { + files: ['**/*.html'], + // Override or add rules here + rules: {}, + }, +]; diff --git a/libs/oms/shared/product-info/jest.config.ts b/libs/oms/shared/product-info/jest.config.ts new file mode 100644 index 000000000..7036e8a28 --- /dev/null +++ b/libs/oms/shared/product-info/jest.config.ts @@ -0,0 +1,21 @@ +export default { + displayName: 'oms-shared-product-info', + preset: '../../../../jest.preset.js', + setupFilesAfterEnv: ['/src/test-setup.ts'], + coverageDirectory: '../../../../coverage/libs/oms/shared/product-info', + transform: { + '^.+\\.(ts|mjs|js|html)$': [ + 'jest-preset-angular', + { + tsconfig: '/tsconfig.spec.json', + stringifyContentPathRegex: '\\.(html|svg)$', + }, + ], + }, + transformIgnorePatterns: ['node_modules/(?!.*\\.mjs$)'], + snapshotSerializers: [ + 'jest-preset-angular/build/serializers/no-ng-attributes', + 'jest-preset-angular/build/serializers/ng-snapshot', + 'jest-preset-angular/build/serializers/html-comment', + ], +}; diff --git a/libs/oms/shared/product-info/project.json b/libs/oms/shared/product-info/project.json new file mode 100644 index 000000000..93ac99fb8 --- /dev/null +++ b/libs/oms/shared/product-info/project.json @@ -0,0 +1,20 @@ +{ + "name": "oms-shared-product-info", + "$schema": "../../../../node_modules/nx/schemas/project-schema.json", + "sourceRoot": "libs/oms/shared/product-info/src", + "prefix": "oms-shared", + "projectType": "library", + "tags": [], + "targets": { + "test": { + "executor": "@nx/jest:jest", + "outputs": ["{workspaceRoot}/coverage/{projectRoot}"], + "options": { + "jestConfig": "libs/oms/shared/product-info/jest.config.ts" + } + }, + "lint": { + "executor": "@nx/eslint:lint" + } + } +} diff --git a/libs/oms/shared/product-info/src/index.ts b/libs/oms/shared/product-info/src/index.ts new file mode 100644 index 000000000..984c32f1d --- /dev/null +++ b/libs/oms/shared/product-info/src/index.ts @@ -0,0 +1 @@ +export * from './lib/return-product-info/return-product-info.component'; diff --git a/libs/oms/shared/product-info/src/lib/return-product-info/return-product-info.component.html b/libs/oms/shared/product-info/src/lib/return-product-info/return-product-info.component.html new file mode 100644 index 000000000..2c396b08c --- /dev/null +++ b/libs/oms/shared/product-info/src/lib/return-product-info/return-product-info.component.html @@ -0,0 +1,31 @@ +
+ +
+
+ {{ product().contributors }} +
+
+ {{ product().name }} +
+
+ + {{ product().formatDetail }} +
+
+
diff --git a/libs/oms/shared/product-info/src/lib/return-product-info/return-product-info.component.scss b/libs/oms/shared/product-info/src/lib/return-product-info/return-product-info.component.scss new file mode 100644 index 000000000..2b83199e8 --- /dev/null +++ b/libs/oms/shared/product-info/src/lib/return-product-info/return-product-info.component.scss @@ -0,0 +1,22 @@ +.return-product-info { + display: flex; + align-items: flex-start; + gap: 1rem; +} + +.return-product-info__image { + border-radius: 0.25rem; + box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1); +} + +.return-product-info__content { + display: flex; + flex-direction: column; + gap: 0.25rem; +} + +.return-product-info__format { + display: flex; + align-items: center; + gap: 0.5rem; +} diff --git a/libs/oms/shared/product-info/src/lib/return-product-info/return-product-info.component.spec.ts b/libs/oms/shared/product-info/src/lib/return-product-info/return-product-info.component.spec.ts new file mode 100644 index 000000000..b948f8cc5 --- /dev/null +++ b/libs/oms/shared/product-info/src/lib/return-product-info/return-product-info.component.spec.ts @@ -0,0 +1,96 @@ +import { createComponentFactory, Spectator } from '@ngneat/spectator/jest'; +import { ReturnProductInfoComponent } from './return-product-info.component'; +import { ProductImageDirective } from '@isa/shared/product-image'; +import { MockDirective } from 'ng-mocks'; +import { Product } from '@isa/oms/data-access'; +import { NgIcon } from '@ng-icons/core'; + +// Mock Product data for input +const MOCK_PRODUCT: Product = { + // Add necessary mock product properties here based on the Product interface + catalogProductNumber: '123456', + ean: '1234567890123', + manufacturer: 'Example Manufacturer', + name: 'Example Product Name', + volume: '2', + contributors: 'John Doe, Jane Smith', + format: 'HC', + formatDetail: 'Hardcover', // Corrected property name to match template usage + // ... other required fields +}; + +describe('ReturnProductInfoComponent', () => { + let spectator: Spectator; + + // Create the component factory using Spectator + const createComponent = createComponentFactory({ + component: ReturnProductInfoComponent, + overrideComponents: [ + [ + ReturnProductInfoComponent, + { + remove: { imports: [ProductImageDirective] }, + add: { + imports: [MockDirective(ProductImageDirective)], + }, + }, + ], + ], + detectChanges: false, // Control change detection manually if needed + }); + + beforeEach(() => { + // Create the component instance before each test + spectator = createComponent({ + props: { + product: MOCK_PRODUCT, // Pass the mock product as input + }, + }); + spectator.detectChanges(); // Trigger initial change detection + }); + + it('should create the component', () => { + // Assert + expect(spectator.component).toBeTruthy(); + }); + + it('should display product name and contributors', () => { + // Assert + const contributorsEl = spectator.query( + '[data-what="product-contributors"]', + ); + const nameEl = spectator.query('[data-what="product-name"]'); + + expect(contributorsEl).toHaveText(MOCK_PRODUCT.contributors); + expect(nameEl).toHaveText(MOCK_PRODUCT.name); + }); + + it('should pass the correct EAN to the product image directive', () => { + // Arrange & Act + const imgElement = spectator.query('img'); + const productImageDirective = spectator.query(ProductImageDirective); + + // Assert + // Check that the directive is applied to the image + expect(imgElement).toBeTruthy(); + expect(productImageDirective).toBeTruthy(); + + // Verify the ean attribute is bound correctly + expect(productImageDirective?.ean).toBe(MOCK_PRODUCT.ean); + + // Verify the alt text is set correctly + expect(imgElement).toHaveAttribute('alt', MOCK_PRODUCT.name); + }); + + it('should display the format with correct icon', () => { + // Arrange & Act + const formatElement = spectator.query('[data-what="product-format"]'); + const iconComponent = spectator.query(NgIcon); + const formatTextEl = spectator.query('[data-what="product-format"] span'); + + // Assert + expect(formatElement).toBeTruthy(); + expect(formatTextEl).toHaveText(MOCK_PRODUCT.formatDetail); + expect(iconComponent).toBeTruthy(); + }); +}); diff --git a/libs/oms/shared/product-info/src/lib/return-product-info/return-product-info.component.ts b/libs/oms/shared/product-info/src/lib/return-product-info/return-product-info.component.ts new file mode 100644 index 000000000..3454f7ff4 --- /dev/null +++ b/libs/oms/shared/product-info/src/lib/return-product-info/return-product-info.component.ts @@ -0,0 +1,32 @@ +import { ChangeDetectionStrategy, Component, input } from '@angular/core'; +import { ProductImageDirective } from '@isa/shared/product-image'; +import { NgIcon, provideIcons } from '@ng-icons/core'; +import { Product } from '@isa/oms/data-access'; +import { LowerCasePipe } from '@angular/common'; +import { ProductFormatIconGroup } from '@isa/icons'; + +/** + * A reusable component that displays product information in a standardized format. + * Used in return process workflows to show product details including image, name, + * contributors, and format information. + * + * @example + * ```html + * + * ``` + */ +@Component({ + selector: 'oms-shared-return-product-info', + templateUrl: './return-product-info.component.html', + styleUrls: ['./return-product-info.component.scss'], + standalone: true, + changeDetection: ChangeDetectionStrategy.OnPush, + imports: [ProductImageDirective, NgIcon, LowerCasePipe], + providers: [provideIcons({ ...ProductFormatIconGroup })], +}) +export class ReturnProductInfoComponent { + /** The product to display information for */ + product = input.required(); +} diff --git a/libs/oms/shared/product-info/src/test-setup.ts b/libs/oms/shared/product-info/src/test-setup.ts new file mode 100644 index 000000000..ea414013f --- /dev/null +++ b/libs/oms/shared/product-info/src/test-setup.ts @@ -0,0 +1,6 @@ +import { setupZoneTestEnv } from 'jest-preset-angular/setup-env/zone'; + +setupZoneTestEnv({ + errorOnUnknownElements: true, + errorOnUnknownProperties: true, +}); diff --git a/libs/oms/shared/product-info/tsconfig.json b/libs/oms/shared/product-info/tsconfig.json new file mode 100644 index 000000000..52a0866e0 --- /dev/null +++ b/libs/oms/shared/product-info/tsconfig.json @@ -0,0 +1,28 @@ +{ + "compilerOptions": { + "target": "es2022", + "forceConsistentCasingInFileNames": true, + "strict": true, + "noImplicitOverride": true, + "noPropertyAccessFromIndexSignature": true, + "noImplicitReturns": true, + "noFallthroughCasesInSwitch": true + }, + "files": [], + "include": [], + "references": [ + { + "path": "./tsconfig.lib.json" + }, + { + "path": "./tsconfig.spec.json" + } + ], + "extends": "../../../../tsconfig.base.json", + "angularCompilerOptions": { + "enableI18nLegacyMessageIdFormat": false, + "strictInjectionParameters": true, + "strictInputAccessModifiers": true, + "strictTemplates": true + } +} diff --git a/libs/oms/shared/product-info/tsconfig.lib.json b/libs/oms/shared/product-info/tsconfig.lib.json new file mode 100644 index 000000000..912738705 --- /dev/null +++ b/libs/oms/shared/product-info/tsconfig.lib.json @@ -0,0 +1,17 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "outDir": "../../../../dist/out-tsc", + "declaration": true, + "declarationMap": true, + "inlineSources": true, + "types": [] + }, + "exclude": [ + "src/**/*.spec.ts", + "src/test-setup.ts", + "jest.config.ts", + "src/**/*.test.ts" + ], + "include": ["src/**/*.ts"] +} diff --git a/libs/oms/shared/product-info/tsconfig.spec.json b/libs/oms/shared/product-info/tsconfig.spec.json new file mode 100644 index 000000000..6e5925e5c --- /dev/null +++ b/libs/oms/shared/product-info/tsconfig.spec.json @@ -0,0 +1,16 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "outDir": "../../../../dist/out-tsc", + "module": "commonjs", + "target": "es2016", + "types": ["jest", "node"] + }, + "files": ["src/test-setup.ts"], + "include": [ + "jest.config.ts", + "src/**/*.test.ts", + "src/**/*.spec.ts", + "src/**/*.d.ts" + ] +} diff --git a/libs/shared/filter/src/lib/inputs/search-bar-input/search-bar-input.component.html b/libs/shared/filter/src/lib/inputs/search-bar-input/search-bar-input.component.html index 6af215117..97d43293d 100644 --- a/libs/shared/filter/src/lib/inputs/search-bar-input/search-bar-input.component.html +++ b/libs/shared/filter/src/lib/inputs/search-bar-input/search-bar-input.component.html @@ -13,39 +13,33 @@ @if (appearance() === 'main') { - + name="isaActionSearch" + > } @else if (appearance() === 'results') { - + name="isaActionSearch" + > } @if (canScan) { - + name="isaActionScanner" + > } } diff --git a/libs/shared/filter/src/lib/menus/filter-menu/filter-menu-button.component.html b/libs/shared/filter/src/lib/menus/filter-menu/filter-menu-button.component.html index 7040ca33a..4ae488560 100644 --- a/libs/shared/filter/src/lib/menus/filter-menu/filter-menu-button.component.html +++ b/libs/shared/filter/src/lib/menus/filter-menu/filter-menu-button.component.html @@ -1,6 +1,7 @@ + * ``` + * * @remarks - * This component is designed to be lightweight and flexible, leveraging Angular's - * reactive input and computed signals for seamless updates. + * - The loading spinner is rendered as an overlay, preserving the button's dimensions + * - The spinner inherits the button's theme colors for visual consistency + * - The component automatically handles ARIA attributes for accessibility */ @Component({ selector: 'ui-button, [uiButton]', @@ -38,7 +53,8 @@ import { isaLoading } from '@isa/icons'; imports: [NgIconComponent], providers: [provideIcons({ isaLoading })], host: { - '[class]': '["ui-button", sizeClass(), colorClass(), pendingClass(), disabledClass()]', + '[class]': + '["ui-button", sizeClass(), colorClass(), pendingClass(), disabledClass()]', '[tabindex]': 'tabIndex()', '[disabled]': 'disabled()', }, @@ -56,7 +72,10 @@ export class ButtonComponent { /** A computed CSS class based on the current color. */ colorClass = computed(() => `ui-button__${this.color()}`); - /** Indicates whether the button is in a loading or pending state. */ + /** + * Indicates whether the button is in a loading or pending state. + * When true, displays a loading spinner overlay while maintaining button dimensions. + */ pending = input(false); /** A computed CSS class for the pending state. */ diff --git a/libs/ui/buttons/src/lib/icon-button.component.html b/libs/ui/buttons/src/lib/icon-button.component.html index 141a11bc5..63e5a7252 100644 --- a/libs/ui/buttons/src/lib/icon-button.component.html +++ b/libs/ui/buttons/src/lib/icon-button.component.html @@ -1,5 +1,5 @@ -@if (!pending()) { - -} @else { - -} + diff --git a/libs/ui/buttons/src/lib/icon-button.component.spec.ts b/libs/ui/buttons/src/lib/icon-button.component.spec.ts index aa3a7ceb6..dd39701ee 100644 --- a/libs/ui/buttons/src/lib/icon-button.component.spec.ts +++ b/libs/ui/buttons/src/lib/icon-button.component.spec.ts @@ -18,15 +18,15 @@ describe('IconButtonComponent', () => { }); test('should have default size and computed sizeClass', () => { - expect(component.size()).toBe('medium'); - expect(component.sizeClass()).toBe('ui-icon-button__medium'); + expect(component.size()).toBe('large'); + expect(component.sizeClass()).toBe('ui-icon-button__large'); }); test('should update size and computed sizeClass when size changes', () => { - spectator.setInput('size', 'small'); + spectator.setInput('size', 'medium'); spectator.detectChanges(); - expect(component.size()).toBe('small'); - expect(component.sizeClass()).toBe('ui-icon-button__small'); + expect(component.size()).toBe('medium'); + expect(component.sizeClass()).toBe('ui-icon-button__medium'); }); test('should have default color and computed colorClass', () => { diff --git a/libs/ui/buttons/src/lib/icon-button.component.ts b/libs/ui/buttons/src/lib/icon-button.component.ts index 39dfe8b83..0c8161bee 100644 --- a/libs/ui/buttons/src/lib/icon-button.component.ts +++ b/libs/ui/buttons/src/lib/icon-button.component.ts @@ -9,6 +9,21 @@ import { IconButtonColor, IconButtonSize } from './types'; import { NgIconComponent, provideIcons } from '@ng-icons/core'; import { isaLoading } from '@isa/icons'; +/** + * A reusable button component that displays an icon with configurable appearance and behavior. + * Supports different sizes, colors, loading states, and accessibility features. + * + * @example + * ```html + * + * + * ``` + */ @Component({ selector: 'ui-icon-button, [uiIconButton]', templateUrl: './icon-button.component.html', @@ -20,25 +35,53 @@ import { isaLoading } from '@isa/icons'; host: { '[class]': "['ui-icon-button', sizeClass(), colorClass(), disabledClass()]", '[tabindex]': 'tabIndex()', - '[disabled]': 'disabled()', + '[attr.aria-disabled]': 'disabled()', + '[attr.aria-label]': 'name()', + '[attr.aria-hidden]': 'pending()', + '[attr.aria-busy]': 'pending()', + '[attr.role]': 'pending() ? "progressbar" : "button"', }, }) export class IconButtonComponent { - size = input('medium'); + /** The name of the icon to display */ + name = input(); + /** The size of the button: 'medium' or 'large' */ + size = input('large'); + + /** Computed class based on the current size */ sizeClass = computed(() => `ui-icon-button__${this.size()}`); + /** The color scheme of the button */ color = input('primary'); + /** Computed class based on the current color */ colorClass = computed(() => `ui-icon-button__${this.color()}`); + /** Whether the button is in a loading state */ pending = input(false); + /** The tab index for keyboard navigation */ tabIndex = input(0); - /** Indicates whether the button is disabled. */ + /** Whether the button is disabled */ disabled = input(false); - /** A computed CSS class for the disabled state. */ + /** Computed CSS class for the disabled state */ disabledClass = computed(() => (this.disabled() ? 'disabled' : '')); + + /** Computed icon name based on pending state */ + iconName = computed(() => { + return this.pending() ? 'isaLoading' : this.name(); + }); + + /** Computed icon size based on button size */ + iconSize = computed(() => { + const size = this.size(); + + if (size === 'medium') return `1.25rem`; + if (size === 'large') return `1.5rem`; + + return `1.25rem`; + }); } diff --git a/libs/ui/buttons/src/lib/types.ts b/libs/ui/buttons/src/lib/types.ts index 4305b32bf..af0ee99a3 100644 --- a/libs/ui/buttons/src/lib/types.ts +++ b/libs/ui/buttons/src/lib/types.ts @@ -30,8 +30,8 @@ export type TextButtonColor = (typeof TextButtonColor)[keyof typeof TextButtonColor]; export const IconButtonSize = { - Small: 'small', Medium: 'medium', + Large: 'large', } as const; export type IconButtonSize = diff --git a/libs/ui/search-bar/src/lib/search-bar.component.html b/libs/ui/search-bar/src/lib/search-bar.component.html index d86cb4554..60ddd6edd 100644 --- a/libs/ui/search-bar/src/lib/search-bar.component.html +++ b/libs/ui/search-bar/src/lib/search-bar.component.html @@ -1,7 +1,7 @@ - +
- +
diff --git a/package-lock.json b/package-lock.json index 6d683273f..8635ea8dd 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1615,6 +1615,27 @@ "rxjs": "^6.5.3 || ^7.4.0" } }, + "node_modules/@asamuzakjp/css-color": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/@asamuzakjp/css-color/-/css-color-3.1.2.tgz", + "integrity": "sha512-nwgc7jPn3LpZ4JWsoHtuwBsad1qSSLDDX634DdG0PBJofIuIEtSWk4KkRmuXyu178tjuHAbwiMNNzwqIyLYxZw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@csstools/css-calc": "^2.1.2", + "@csstools/css-color-parser": "^3.0.8", + "@csstools/css-parser-algorithms": "^3.0.4", + "@csstools/css-tokenizer": "^3.0.3", + "lru-cache": "^10.4.3" + } + }, + "node_modules/@asamuzakjp/css-color/node_modules/lru-cache": { + "version": "10.4.3", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.4.3.tgz", + "integrity": "sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==", + "dev": true, + "license": "ISC" + }, "node_modules/@babel/code-frame": { "version": "7.26.2", "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.26.2.tgz", @@ -3546,6 +3567,121 @@ "@jridgewell/sourcemap-codec": "^1.4.10" } }, + "node_modules/@csstools/color-helpers": { + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/@csstools/color-helpers/-/color-helpers-5.0.2.tgz", + "integrity": "sha512-JqWH1vsgdGcw2RR6VliXXdA0/59LttzlU8UlRT/iUUsEeWfYq8I+K0yhihEUTTHLRm1EXvpsCx3083EU15ecsA==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/csstools" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/csstools" + } + ], + "license": "MIT-0", + "engines": { + "node": ">=18" + } + }, + "node_modules/@csstools/css-calc": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/@csstools/css-calc/-/css-calc-2.1.2.tgz", + "integrity": "sha512-TklMyb3uBB28b5uQdxjReG4L80NxAqgrECqLZFQbyLekwwlcDDS8r3f07DKqeo8C4926Br0gf/ZDe17Zv4wIuw==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/csstools" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/csstools" + } + ], + "license": "MIT", + "engines": { + "node": ">=18" + }, + "peerDependencies": { + "@csstools/css-parser-algorithms": "^3.0.4", + "@csstools/css-tokenizer": "^3.0.3" + } + }, + "node_modules/@csstools/css-color-parser": { + "version": "3.0.8", + "resolved": "https://registry.npmjs.org/@csstools/css-color-parser/-/css-color-parser-3.0.8.tgz", + "integrity": "sha512-pdwotQjCCnRPuNi06jFuP68cykU1f3ZWExLe/8MQ1LOs8Xq+fTkYgd+2V8mWUWMrOn9iS2HftPVaMZDaXzGbhQ==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/csstools" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/csstools" + } + ], + "license": "MIT", + "dependencies": { + "@csstools/color-helpers": "^5.0.2", + "@csstools/css-calc": "^2.1.2" + }, + "engines": { + "node": ">=18" + }, + "peerDependencies": { + "@csstools/css-parser-algorithms": "^3.0.4", + "@csstools/css-tokenizer": "^3.0.3" + } + }, + "node_modules/@csstools/css-parser-algorithms": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/@csstools/css-parser-algorithms/-/css-parser-algorithms-3.0.4.tgz", + "integrity": "sha512-Up7rBoV77rv29d3uKHUIVubz1BTcgyUK72IvCQAbfbMv584xHcGKCKbWh7i8hPrRJ7qU4Y8IO3IY9m+iTB7P3A==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/csstools" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/csstools" + } + ], + "license": "MIT", + "engines": { + "node": ">=18" + }, + "peerDependencies": { + "@csstools/css-tokenizer": "^3.0.3" + } + }, + "node_modules/@csstools/css-tokenizer": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/@csstools/css-tokenizer/-/css-tokenizer-3.0.3.tgz", + "integrity": "sha512-UJnjoFsmxfKUdNYdWgOB0mWUypuLvAfQPH1+pyvRJs6euowbFkFC6P13w1l8mJyi3vxYMxc9kld5jZEGRQs6bw==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/csstools" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/csstools" + } + ], + "license": "MIT", + "engines": { + "node": ">=18" + } + }, "node_modules/@discoveryjs/json-ext": { "version": "0.6.3", "resolved": "https://registry.npmjs.org/@discoveryjs/json-ext/-/json-ext-0.6.3.tgz", @@ -7701,20 +7837,6 @@ "node": ">= 14" } }, - "node_modules/@npmcli/agent/node_modules/http-proxy-agent": { - "version": "7.0.2", - "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-7.0.2.tgz", - "integrity": "sha512-T1gkAiYYDWYx3V5Bmyu7HcfcvL7mUrTWiM6yOfa3PIphViJ/gFPbvidQ+veqSOHci/PxBcDabeUNCzpOODJZig==", - "dev": true, - "license": "MIT", - "dependencies": { - "agent-base": "^7.1.0", - "debug": "^4.3.4" - }, - "engines": { - "node": ">= 14" - } - }, "node_modules/@npmcli/agent/node_modules/https-proxy-agent": { "version": "7.0.6", "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.6.tgz", @@ -15640,16 +15762,6 @@ "@testing-library/dom": ">=7.21.4" } }, - "node_modules/@tootallnate/once": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/@tootallnate/once/-/once-2.0.0.tgz", - "integrity": "sha512-XCuKFP5PS55gnMVu3dty8KPatLqUoy/ZYzDzAGCQ8JNFCkLXzmI7vNHCR+XpbZaMWQK/vQubr7PkYq8g470J/A==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 10" - } - }, "node_modules/@trysound/sax": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/@trysound/sax/-/sax-0.2.0.tgz", @@ -16778,14 +16890,6 @@ "js-yaml": "bin/js-yaml.js" } }, - "node_modules/abab": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/abab/-/abab-2.0.6.tgz", - "integrity": "sha512-j2afSsaIENvHZN2B8GOpF566vZ5WVk5opAiMTvWgaQT8DkbOqsTfvNAvHoRGU2zzP8cPoqys+xHTRDWW8L+/BA==", - "deprecated": "Use your platform's native atob() and btoa() methods instead", - "dev": true, - "license": "BSD-3-Clause" - }, "node_modules/abbrev": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-3.0.0.tgz", @@ -16835,17 +16939,6 @@ "node": ">=0.4.0" } }, - "node_modules/acorn-globals": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/acorn-globals/-/acorn-globals-7.0.1.tgz", - "integrity": "sha512-umOSDSDrfHbTNPuNpC2NSnnA3LUrqpevPb4T9jRx4MagXNS0rs+gwiTcAvqCRmsD6utzsrzNt+ebm00SNWiC3Q==", - "dev": true, - "license": "MIT", - "dependencies": { - "acorn": "^8.1.0", - "acorn-walk": "^8.0.2" - } - }, "node_modules/acorn-jsx": { "version": "5.3.2", "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", @@ -16924,6 +17017,8 @@ "integrity": "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==", "dev": true, "license": "MIT", + "optional": true, + "peer": true, "dependencies": { "debug": "4" }, @@ -19657,33 +19752,20 @@ "dev": true, "license": "CC0-1.0" }, - "node_modules/cssom": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/cssom/-/cssom-0.5.0.tgz", - "integrity": "sha512-iKuQcq+NdHqlAcwUY0o/HL69XQrUaQdMjmStJ8JFmUaiiQErlhrmuigkg/CU4E2J0IyUKUrMAgl36TvN67MqTw==", - "dev": true, - "license": "MIT" - }, "node_modules/cssstyle": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/cssstyle/-/cssstyle-2.3.0.tgz", - "integrity": "sha512-AZL67abkUzIuvcHqk7c09cezpGNcxUxU4Ioi/05xHk4DQeTkWmGYftIE6ctU6AEt+Gn4n1lDStOtj7FKycP71A==", + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/cssstyle/-/cssstyle-4.3.0.tgz", + "integrity": "sha512-6r0NiY0xizYqfBvWp1G7WXJ06/bZyrk7Dc6PHql82C/pKGUTKu4yAX4Y8JPamb1ob9nBKuxWzCGTRuGwU3yxJQ==", "dev": true, "license": "MIT", "dependencies": { - "cssom": "~0.3.6" + "@asamuzakjp/css-color": "^3.1.1", + "rrweb-cssom": "^0.8.0" }, "engines": { - "node": ">=8" + "node": ">=18" } }, - "node_modules/cssstyle/node_modules/cssom": { - "version": "0.3.8", - "resolved": "https://registry.npmjs.org/cssom/-/cssom-0.3.8.tgz", - "integrity": "sha512-b0tGHbfegbhPJpxpiBPU2sCkigAqtM9O121le6bbOlgyV+NyGyCmVfJ6QW9eRjz8CpNfWEOYBIMIGRYkLwsIYg==", - "dev": true, - "license": "MIT" - }, "node_modules/csstype": { "version": "3.1.3", "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.1.3.tgz", @@ -19819,18 +19901,17 @@ } }, "node_modules/data-urls": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/data-urls/-/data-urls-3.0.2.tgz", - "integrity": "sha512-Jy/tj3ldjZJo63sVAvg6LHt2mHvl4V6AgRAmNDtLdm7faqtsx+aJG42rsyCo9JCoRVKwPFzKlIPx3DIibwSIaQ==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/data-urls/-/data-urls-5.0.0.tgz", + "integrity": "sha512-ZYP5VBHshaDAiVZxjbRVcFJpc+4xGgT0bK3vzy1HLN8jTO975HEbuYzZJcHoQEY5K1a0z8YayJkyVETa08eNTg==", "dev": true, "license": "MIT", "dependencies": { - "abab": "^2.0.6", - "whatwg-mimetype": "^3.0.0", - "whatwg-url": "^11.0.0" + "whatwg-mimetype": "^4.0.0", + "whatwg-url": "^14.0.0" }, "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/date-fns": { @@ -20316,20 +20397,6 @@ "dev": true, "license": "BSD-2-Clause" }, - "node_modules/domexception": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/domexception/-/domexception-4.0.0.tgz", - "integrity": "sha512-A2is4PLG+eeSfoTMA95/s4pvAoSo2mKtiM5jlHkAVewmiO8ISFTFKZjH7UAM1Atli/OT/7JHOrJRJiMKUZKYBw==", - "deprecated": "Use your platform's native DOMException instead", - "dev": true, - "license": "MIT", - "dependencies": { - "webidl-conversions": "^7.0.0" - }, - "engines": { - "node": ">=12" - } - }, "node_modules/domhandler": { "version": "2.4.2", "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-2.4.2.tgz", @@ -20780,39 +20847,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/escodegen": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-2.1.0.tgz", - "integrity": "sha512-2NlIDTwUWJN0mRPQOdtQBzbUHvdGY2P1VXSyU83Q3xKxM7WHX2Ql8dKq782Q9TgQUNOLEzEYu9bzLNj1q88I5w==", - "dev": true, - "license": "BSD-2-Clause", - "dependencies": { - "esprima": "^4.0.1", - "estraverse": "^5.2.0", - "esutils": "^2.0.2" - }, - "bin": { - "escodegen": "bin/escodegen.js", - "esgenerate": "bin/esgenerate.js" - }, - "engines": { - "node": ">=6.0" - }, - "optionalDependencies": { - "source-map": "~0.6.1" - } - }, - "node_modules/escodegen/node_modules/source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true, - "license": "BSD-3-Clause", - "optional": true, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/eslint": { "version": "9.23.0", "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.23.0.tgz", @@ -23045,18 +23079,27 @@ } }, "node_modules/http-proxy-agent": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-5.0.0.tgz", - "integrity": "sha512-n2hY8YdoRE1i7r6M0w9DIw5GgZN0G25P8zLCRQ8rjXtTU3vsNFBI/vWK/UIeE6g5MUUz6avwAPXmL6Fy9D/90w==", + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-7.0.2.tgz", + "integrity": "sha512-T1gkAiYYDWYx3V5Bmyu7HcfcvL7mUrTWiM6yOfa3PIphViJ/gFPbvidQ+veqSOHci/PxBcDabeUNCzpOODJZig==", "dev": true, "license": "MIT", "dependencies": { - "@tootallnate/once": "2", - "agent-base": "6", - "debug": "4" + "agent-base": "^7.1.0", + "debug": "^4.3.4" }, "engines": { - "node": ">= 6" + "node": ">= 14" + } + }, + "node_modules/http-proxy-agent/node_modules/agent-base": { + "version": "7.1.3", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.3.tgz", + "integrity": "sha512-jRR5wdylq8CkOe6hei19GGZnxM6rBGwFl3Bg0YItGDimvjGtAvdZk4Pu6Cl4u4Igsws4a1fd1Vq3ezrhn4KmFw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 14" } }, "node_modules/http-proxy-middleware": { @@ -23111,6 +23154,8 @@ "integrity": "sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==", "dev": true, "license": "MIT", + "optional": true, + "peer": true, "dependencies": { "agent-base": "6", "debug": "4" @@ -25597,44 +25642,39 @@ } }, "node_modules/jsdom": { - "version": "20.0.3", - "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-20.0.3.tgz", - "integrity": "sha512-SYhBvTh89tTfCD/CRdSOm13mOBa42iTaTyfyEWBdKcGdPxPtLFBXuHR8XHb33YNYaP+lLbmSvBTsnoesCNJEsQ==", + "version": "26.0.0", + "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-26.0.0.tgz", + "integrity": "sha512-BZYDGVAIriBWTpIxYzrXjv3E/4u8+/pSG5bQdIYCbNCGOvsPkDQfTVLAIXAf9ETdCpduCVTkDe2NNZ8NIwUVzw==", "dev": true, "license": "MIT", "dependencies": { - "abab": "^2.0.6", - "acorn": "^8.8.1", - "acorn-globals": "^7.0.0", - "cssom": "^0.5.0", - "cssstyle": "^2.3.0", - "data-urls": "^3.0.2", - "decimal.js": "^10.4.2", - "domexception": "^4.0.0", - "escodegen": "^2.0.0", - "form-data": "^4.0.0", - "html-encoding-sniffer": "^3.0.0", - "http-proxy-agent": "^5.0.0", - "https-proxy-agent": "^5.0.1", + "cssstyle": "^4.2.1", + "data-urls": "^5.0.0", + "decimal.js": "^10.4.3", + "form-data": "^4.0.1", + "html-encoding-sniffer": "^4.0.0", + "http-proxy-agent": "^7.0.2", + "https-proxy-agent": "^7.0.6", "is-potential-custom-element-name": "^1.0.1", - "nwsapi": "^2.2.2", - "parse5": "^7.1.1", + "nwsapi": "^2.2.16", + "parse5": "^7.2.1", + "rrweb-cssom": "^0.8.0", "saxes": "^6.0.0", "symbol-tree": "^3.2.4", - "tough-cookie": "^4.1.2", - "w3c-xmlserializer": "^4.0.0", + "tough-cookie": "^5.0.0", + "w3c-xmlserializer": "^5.0.0", "webidl-conversions": "^7.0.0", - "whatwg-encoding": "^2.0.0", - "whatwg-mimetype": "^3.0.0", - "whatwg-url": "^11.0.0", - "ws": "^8.11.0", - "xml-name-validator": "^4.0.0" + "whatwg-encoding": "^3.1.1", + "whatwg-mimetype": "^4.0.0", + "whatwg-url": "^14.1.0", + "ws": "^8.18.0", + "xml-name-validator": "^5.0.0" }, "engines": { - "node": ">=14" + "node": ">=18" }, "peerDependencies": { - "canvas": "^2.5.0" + "canvas": "^3.0.0" }, "peerDependenciesMeta": { "canvas": { @@ -25642,6 +25682,69 @@ } } }, + "node_modules/jsdom/node_modules/agent-base": { + "version": "7.1.3", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.3.tgz", + "integrity": "sha512-jRR5wdylq8CkOe6hei19GGZnxM6rBGwFl3Bg0YItGDimvjGtAvdZk4Pu6Cl4u4Igsws4a1fd1Vq3ezrhn4KmFw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 14" + } + }, + "node_modules/jsdom/node_modules/html-encoding-sniffer": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/html-encoding-sniffer/-/html-encoding-sniffer-4.0.0.tgz", + "integrity": "sha512-Y22oTqIU4uuPgEemfz7NDJz6OeKf12Lsu+QC+s3BVpda64lTiMYCyGwg5ki4vFxkMwQdeZDl2adZoqUgdFuTgQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "whatwg-encoding": "^3.1.1" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/jsdom/node_modules/https-proxy-agent": { + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.6.tgz", + "integrity": "sha512-vK9P5/iUfdl95AI+JVyUuIcVtd4ofvtrOr3HNtM2yxC9bnMbEdp3x01OhQNnjb8IJYi38VlTE3mBXwcfvywuSw==", + "dev": true, + "license": "MIT", + "dependencies": { + "agent-base": "^7.1.2", + "debug": "4" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/jsdom/node_modules/tough-cookie": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-5.1.2.tgz", + "integrity": "sha512-FVDYdxtnj0G6Qm/DhNPSb8Ju59ULcup3tuJxkFb5K8Bv2pUXILbf0xZWU8PX8Ov19OXljbUyveOFwRMwkXzO+A==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "tldts": "^6.1.32" + }, + "engines": { + "node": ">=16" + } + }, + "node_modules/jsdom/node_modules/whatwg-encoding": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/whatwg-encoding/-/whatwg-encoding-3.1.1.tgz", + "integrity": "sha512-6qN4hJdMwfYBtE3YBTTHhoeuUrDBPZmbQaxWAqSALV/MeEnR5z1xd8UKud2RAkFoPkmB+hli1TZSnyi84xz1vQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "iconv-lite": "0.6.3" + }, + "engines": { + "node": ">=18" + } + }, "node_modules/jsdom/node_modules/ws": { "version": "8.18.1", "resolved": "https://registry.npmjs.org/ws/-/ws-8.18.1.tgz", @@ -31328,6 +31431,13 @@ "fsevents": "~2.3.2" } }, + "node_modules/rrweb-cssom": { + "version": "0.8.0", + "resolved": "https://registry.npmjs.org/rrweb-cssom/-/rrweb-cssom-0.8.0.tgz", + "integrity": "sha512-guoltQEx+9aMf2gDZ0s62EcV8lsXR+0w8915TC3ITdn2YueuNjdAYh/levpU9nFaoChh9RUS5ZdQMrKfVEN9tw==", + "dev": true, + "license": "MIT" + }, "node_modules/rslog": { "version": "1.2.3", "resolved": "https://registry.npmjs.org/rslog/-/rslog-1.2.3.tgz", @@ -34088,6 +34198,26 @@ "node": ">=14.0.0" } }, + "node_modules/tldts": { + "version": "6.1.86", + "resolved": "https://registry.npmjs.org/tldts/-/tldts-6.1.86.tgz", + "integrity": "sha512-WMi/OQ2axVTf/ykqCQgXiIct+mSQDFdH2fkwhPwgEwvJ1kSzZRiinb0zF2Xb8u4+OqPChmyI6MEu4EezNJz+FQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "tldts-core": "^6.1.86" + }, + "bin": { + "tldts": "bin/cli.js" + } + }, + "node_modules/tldts-core": { + "version": "6.1.86", + "resolved": "https://registry.npmjs.org/tldts-core/-/tldts-core-6.1.86.tgz", + "integrity": "sha512-Je6p7pkk+KMzMv2XXKmAE3McmolOQFdxkKw0R8EYNr7sELW46JqnNeTX8ybPiQgvg1ymCoF8LXs5fzFaZvJPTA==", + "dev": true, + "license": "MIT" + }, "node_modules/tmp": { "version": "0.2.3", "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.2.3.tgz", @@ -34152,16 +34282,16 @@ } }, "node_modules/tr46": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/tr46/-/tr46-3.0.0.tgz", - "integrity": "sha512-l7FvfAHlcmulp8kr+flpQZmVwtu7nfRV7NZujtN0OqES8EL4O4e0qqzL0DC5gAvx/ZC/9lk6rhcUwYvkBnBnYA==", + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-5.1.1.tgz", + "integrity": "sha512-hdF5ZgjTqgAntKkklYw0R03MG2x/bSzTtkxmIRw/sTNV8YXsCJ1tfLAX23lhxhHJlEf3CRCOCGGWw3vI3GaSPw==", "dev": true, "license": "MIT", "dependencies": { - "punycode": "^2.1.1" + "punycode": "^2.3.1" }, "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/tree-dump": { @@ -35115,16 +35245,16 @@ } }, "node_modules/w3c-xmlserializer": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/w3c-xmlserializer/-/w3c-xmlserializer-4.0.0.tgz", - "integrity": "sha512-d+BFHzbiCx6zGfz0HyQ6Rg69w9k19nviJspaj4yNscGjrHu94sVP+aRm75yEbCh+r2/yR+7q6hux9LVtbuTGBw==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/w3c-xmlserializer/-/w3c-xmlserializer-5.0.0.tgz", + "integrity": "sha512-o8qghlI8NZHU1lLPrpi2+Uq7abh4GGPpYANlalzWxyWteJOCsr/P+oPBA49TOLu5FTZO4d3F9MnWJfiMo4BkmA==", "dev": true, "license": "MIT", "dependencies": { - "xml-name-validator": "^4.0.0" + "xml-name-validator": "^5.0.0" }, "engines": { - "node": ">=14" + "node": ">=18" } }, "node_modules/wait-on": { @@ -35746,27 +35876,27 @@ } }, "node_modules/whatwg-mimetype": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/whatwg-mimetype/-/whatwg-mimetype-3.0.0.tgz", - "integrity": "sha512-nt+N2dzIutVRxARx1nghPKGv1xHikU7HKdfafKkLNLindmPU/ch3U31NOCGGA/dmPcmb1VlofO0vnKAcsm0o/Q==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/whatwg-mimetype/-/whatwg-mimetype-4.0.0.tgz", + "integrity": "sha512-QaKxh0eNIi2mE9p2vEdzfagOKHCcj1pJ56EEHGQOVxp8r9/iszLUUV7v89x9O1p/T+NlTM5W7jW6+cz4Fq1YVg==", "dev": true, "license": "MIT", "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/whatwg-url": { - "version": "11.0.0", - "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-11.0.0.tgz", - "integrity": "sha512-RKT8HExMpoYx4igMiVMY83lN6UeITKJlBQ+vR/8ZJ8OCdSiN3RwCq+9gH0+Xzj0+5IrM6i4j/6LuvzbZIQgEcQ==", + "version": "14.2.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-14.2.0.tgz", + "integrity": "sha512-De72GdQZzNTUBBChsXueQUnPKDkg/5A5zp7pFDuQAj5UFoENpiACU0wlCvzpAGnTkj++ihpKwKyYewn/XNUbKw==", "dev": true, "license": "MIT", "dependencies": { - "tr46": "^3.0.0", + "tr46": "^5.1.0", "webidl-conversions": "^7.0.0" }, "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/which": { @@ -36075,13 +36205,13 @@ "license": "MIT" }, "node_modules/xml-name-validator": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/xml-name-validator/-/xml-name-validator-4.0.0.tgz", - "integrity": "sha512-ICP2e+jsHvAj2E2lIHxa5tjXRlKDJo4IdvPvCXbXQGdzSfmSpNVyIKMvoZHjDY9DP0zV17iI85o90vRFXNccRw==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/xml-name-validator/-/xml-name-validator-5.0.0.tgz", + "integrity": "sha512-EvGK8EJ3DhaHfbRlETOWAS5pO9MZITeauHKJyb8wyajUfQUenkIg2MvLDTZ4T/TgIcm3HU0TFBgWWboAZ30UHg==", "dev": true, "license": "Apache-2.0", "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/xmlchars": { diff --git a/package.json b/package.json index f0a66accc..862388378 100644 --- a/package.json +++ b/package.json @@ -120,5 +120,10 @@ "engines": { "node": ">=22.13.0", "npm": ">=11.0.0" + }, + "overrides": { + "jest-environment-jsdom": { + "jsdom": "26.0.0" + } } } diff --git a/tsconfig.base.json b/tsconfig.base.json index a4a8aebda..81f79546a 100644 --- a/tsconfig.base.json +++ b/tsconfig.base.json @@ -40,7 +40,7 @@ "@generated/swagger/wws-api": ["generated/swagger/wws-api/src/index.ts"], "@hub/*": ["apps/isa-app/src/hub/*/index.ts"], "@isa/catalogue/data-access": ["libs/catalogue/data-access/src/index.ts"], - "@isa/common/result": ["libs/common/result/src/index.ts"], + "@isa/common/data-access": ["libs/common/data-access/src/index.ts"], "@isa/core/config": ["libs/core/config/src/index.ts"], "@isa/core/logging": ["libs/core/logging/src/index.ts"], "@isa/core/notifications": ["libs/core/notifications/src/index.ts"], @@ -58,6 +58,12 @@ "@isa/oms/feature/return-search": [ "libs/oms/feature/return-search/src/index.ts" ], + "@isa/oms/feature/return-summary": [ + "libs/oms/feature/return-summary/src/index.ts" + ], + "@isa/oms/shared/product-info": [ + "libs/oms/shared/product-info/src/index.ts" + ], "@isa/oms/utils/translation": ["libs/oms/utils/translation/src/index.ts"], "@isa/shared/filter": ["libs/shared/filter/src/index.ts"], "@isa/shared/product-image": ["libs/shared/product-image/src/index.ts"],