diff --git a/.cdsrc.json b/.cdsrc.json index 6d0bda8f..a59d1e0b 100644 --- a/.cdsrc.json +++ b/.cdsrc.json @@ -1,14 +1,8 @@ { - "requires": { - "multitenancy": true, - "extensibility": true, - "toggles": true - }, "build": { "target": "." }, "profiles": [ - "with-mtx-sidecar", "java" ] } diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index 617b09b1..e5ba7ac3 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -21,4 +21,4 @@ jobs: with: java-version: 17 - name: Build with Maven - run: mvn -B clean install + run: mvn -ntp -B clean install diff --git a/.tours/sample-tour.tour b/.tours/sample-tour.tour deleted file mode 100644 index ec85895b..00000000 --- a/.tours/sample-tour.tour +++ /dev/null @@ -1,202 +0,0 @@ -{ - "$schema": "https://aka.ms/codetour-schema", - "title": "CAP Bookshop Sample", - "steps": [ - { - "file": "README.md", - "description": "### Welcome to CAP Samples for Java!\n\nThis tour leads you through a sample project for the [SAP Cloud Application Programming Model (CAP)](https://cap.cloud.sap), explaining some important concepts.\n\nLet's get started!", - "line": 2, - "title": "Welcome" - }, - { - "file": "README.md", - "description": "### Bookshop Sample\n\nThe sample implements a simple bookshop demonstrating selected features of CAP and introduces some essential concepts of CAP for Java:\n\n- [Project Setup](https://cap.cloud.sap/docs/java/getting-started) and [Layouts](https://cap.cloud.sap/docs/java/getting-started#project-layout)\n- [Domain Modeling](https://cap.cloud.sap/docs/guides/domain-models)\n- [Defining Services](https://cap.cloud.sap/docs/guides/services#defining-services)\n- [Generic Providers](https://cap.cloud.sap/docs/guides/generic)\n- [Adding Custom Logic](https://cap.cloud.sap/docs/java/provisioning-api)\n- [Using Databases](https://cap.cloud.sap/docs/guides/databases)", - "line": 25 - }, - { - "file": "db/books.cds", - "description": "### Entity and Type Definitions\n\nEvery CAP project usually starts with the [domain model](https://cap.cloud.sap/docs/guides/domain-models). It defines the entities and types you can use in the services your application wants to offer. Showcased here are some entity definitions which are used by the bookshop application, using [CDL](https://cap.cloud.sap/docs/cds/cdl).\n\nConcepts used:\n\n- [Entity and Type Definitions](https://cap.cloud.sap/docs/cds/cdl#entity-and-type-definitions)\n- [Associations & Compositions](https://cap.cloud.sap/docs/cds/cdl#associations)\n- [Input Validation](https://cap.cloud.sap/docs/cds/annotations#input-validation)\n- [Declaring Localized Data](https://cap.cloud.sap/docs/guides/localized-data#declaring-localized-data)", - "line": 50, - "selection": { - "start": { - "line": 1, - "character": 1 - }, - "end": { - "line": 50, - "character": 1 - } - } - }, - { - "file": "srv/cat-service.cds", - "description": "### Service Definitions\n\nA [service](https://cap.cloud.sap/docs/cds/cdl#service-definitions) interface exposes chosen entities of your domain model for consumption. The endpoint of the exposed service is usually constructed by its name following specific conventions. Here, however the endpoint path to the `CatalogService` is overwritten by the `@path : 'browse'` annotation.\n\nThis `CatalogService` showcases the API for browsing books and adding reviews and demonstrates:\n\n- [Services](https://cap.cloud.sap/docs/java/consumption-api)\n- [Import Directives](https://cap.cloud.sap/docs/cds/cdl#imports)\n- [Namespaces](https://cap.cloud.sap/docs/cds/cdl#namespaces)\n- [Views and Projections](https://cap.cloud.sap/docs/cds/cdl#views)\n- [Annotations](https://cap.cloud.sap/docs/cds/cdl#annotations)\n- [Bound and Unbound Actions](https://cap.cloud.sap/docs/cds/cdl#actions)\n- [Restrictions](https://cap.cloud.sap/docs/guides/authorization#restrictions)", - "line": 66, - "selection": { - "start": { - "line": 1, - "character": 1 - }, - "end": { - "line": 41, - "character": 2 - } - } - }, - { - "file": "srv/admin-service.cds", - "description": "### Service Definitions\n\nHere is another example of a service interface, demonstrating:\n\n- [Restriction using `@requires`](https://cap.cloud.sap/docs/guides/authorization#requires)\n- [Search Capabilities](https://cap.cloud.sap/docs/guides/generic#search-capabilities)\n- Enablement of [Draft-Based Editing](https://cap.cloud.sap/docs/advanced/fiori#fiori-draft-support) for exposed entities", - "line": 46, - "selection": { - "start": { - "line": 1, - "character": 1 - }, - "end": { - "line": 46, - "character": 1 - } - } - }, - { - "file": "srv/src/main/java/my/bookshop/handlers/CatalogServiceHandler.java", - "description": "### Event Handler\n\nAfter defining your domain model and services you can [implement event handlers](https://cap.cloud.sap/docs/java/application-services) reacting to events triggered by these services. This file, for example, showcases an [event handler](https://cap.cloud.sap/docs/java/provisioning-api) for the `CatalogService`. There are various handler implementations reacting to specific [event phases](https://cap.cloud.sap/docs/java/provisioning-api#phases), as showcased in the next steps of this tour.", - "selection": { - "start": { - "line": 79, - "character": 2 - }, - "end": { - "line": 183, - "character": 3 - } - } - }, - { - "file": "srv/src/main/java/my/bookshop/handlers/CatalogServiceHandler.java", - "description": "### Event Handler\n\nThe method `beforeAddReview` demonstrated here is used to validate reviews that are about to be persisted, checking whether the author of the review already created one for the given book. The `ServiceException` thrown in such a case aborts further processing of the current event (of adding a review). The method is bound to the `Before` [event phase](https://cap.cloud.sap/docs/java/provisioning-api#phases), meaning it will be triggerd before the core processing of the event. In the next steps you will see some other event phase handling examples.\n\nThe query run against the database for the check is constructed via the [Query Builder Java API](https://cap.cloud.sap/docs/java/query-api#the-query-builders-java-api).\n\nConcepts used:\n\n- [Event Phase: `Before`](https://cap.cloud.sap/docs/java/provisioning-api#before)\n- [Building CQN Queries](https://cap.cloud.sap/docs/java/query-api)\n- [Indicating Errors](https://cap.cloud.sap/docs/java/indicating-errors)\n- [Static CDS Model](https://cap.cloud.sap/docs/java/advanced#staticmodel)", - "line": 96, - "selection": { - "start": { - "line": 79, - "character": 2 - }, - "end": { - "line": 96, - "character": 3 - } - } - }, - { - "file": "srv/src/main/java/my/bookshop/handlers/CatalogServiceHandler.java", - "description": "### Event Handler\n\nThe `onAddReview` method is bound to the `On` phase of the `AddReview` event, as defined by the bound action in the [`CatalogService`](srv/cat-service.cds). Aside from the `Insert` [query execution](https://cap.cloud.sap/docs/java/query-execution#queries) demonstrated here, you can also see how to [complete the event processing](https://cap.cloud.sap/docs/java/provisioning-api#eventcompletion) necessary in the `On` phase. In this example we are setting the `Reviews` object from the query result in the event context.\n\nConcepts used:\n\n- [Event Phase: `On`](https://cap.cloud.sap/docs/java/provisioning-api#on)\n- [Event Contexts](https://cap.cloud.sap/docs/java/provisioning-api#eventcontext)\n- [Building CQN Queries](https://cap.cloud.sap/docs/java/query-api)\n- [Static CDS Model](https://cap.cloud.sap/docs/java/advanced#staticmodel)", - "line": 123, - "selection": { - "start": { - "line": 98, - "character": 2 - }, - "end": { - "line": 123, - "character": 3 - } - } - }, - { - "file": "srv/cat-service.cds", - "description": "### Bound Action\n\nThe [bound action](https://cap.cloud.sap/docs/cds/cdl#actions) `addReview` here is bound to the `Books` entity within the [`CatalogService`](srv/cat-service.cds). Modeling an action provides you with a more specific [event context](https://cap.cloud.sap/docs/java/provisioning-api#eventcontext) object, such as the `AddReviewContext`, which is used, as shown in the previous step, to implement the `AddReview` event processing.", - "line": 11, - "selection": { - "start": { - "line": 10, - "character": 9 - }, - "end": { - "line": 10, - "character": 91 - } - } - }, - { - "file": "srv/cat-service.cds", - "description": "### Unbound Action\n\nIn contrast, `submitOrder` is modeled as an [unbound action](https://cap.cloud.sap/docs/cds/cdl#actions), meaning it is not bound to an individual entity as `addReview` is bound to `Books`.\n\n[Actions and Functions](https://cap.cloud.sap/docs/java/application-services#actions) as the examples shown here and in the previous step, are generally used to enhance your application service with custom operations.", - "line": 28, - "selection": { - "start": { - "line": 26, - "character": 5 - }, - "end": { - "line": 28, - "character": 7 - } - } - }, - { - "file": "srv/src/main/java/my/bookshop/handlers/BookRatingInitialization.java", - "description": "### Application Start-Up\n\nYou can not only register event handlers for your services, but also handlers that are executed during application start-up. As demonstrated here, for example, we initialize the average rating for all books in the bookshop based on their review ratings, using the [`After`](https://cap.cloud.sap/docs/java/provisioning-api#after) phase of the [`ApplicationLifecycleService.EVENT_APPLICATION_PREPARED`](https://www.javadoc.io/doc/com.sap.cds/cds-services-api/latest/com/sap/cds/services/application/ApplicationPreparedEventContext.html) event.", - "line": 30, - "selection": { - "start": { - "line": 27, - "character": 2 - }, - "end": { - "line": 30, - "character": 3 - } - } - }, - { - "file": "srv/src/main/java/my/bookshop/handlers/DestinationConfiguration.java", - "description": "### Application Start-Up\n\nAnother example of this you can find here in the `DestinationConfiguration` handler.", - "line": 31, - "selection": { - "start": { - "line": 21, - "character": 2 - }, - "end": { - "line": 31, - "character": 3 - } - } - }, - { - "file": "srv/src/main/java/my/bookshop/handlers/AdminServiceHandler.java", - "description": "### SAP Fiori Drafts Support\n\nHere, you can see a handler bound to events of the [SAP Fiori Draft](https://cap.cloud.sap/docs/java/fiori-drafts) flow. Draft-specific events are enabled by annotating entities with `@odata.draft.enabled` as in the [`AdminService`](srv/admin-service.cds).\n\nConcepts used:\n\n- [Draft-based Editing](https://cap.cloud.sap/docs/advanced/fiori#fiori-draft-support)", - "line": 165, - "selection": { - "start": { - "line": 135, - "character": 2 - }, - "end": { - "line": 165, - "character": 3 - } - } - }, - { - "file": "app/browse/fiori-service.cds", - "description": "### SAP Fiori Elements Support\n\nCAP for Java supports SAP Fiori Elements annotations out-of-the-box. The `fiori-service.cds` files in the [app](app) folder altogether add a [SAP Fiori elements application](https://cap.cloud.sap/docs/advanced/fiori) to bookshop, thereby introducing to:\n - [OData Annotations](https://cap.cloud.sap/docs/advanced/odata) in `.cds` files\n - Support for [SAP Fiori Draft](https://cap.cloud.sap/docs/advanced/fiori#fiori-draft-support)\n - Support for [Value Helps](https://cap.cloud.sap/docs/advanced/fiori#value-help-support)\n - Serving SAP Fiori apps locally\n\n[A Vue.js app](app/vue/index.html) is served as well.\n", - "line": 177, - "selection": { - "start": { - "line": 1, - "character": 1 - }, - "end": { - "line": 201, - "character": 1 - } - } - }, - { - "title": "Summary", - "description": "### Summary\n\nThat's it! You have seen:\n\n- Entity and Type Definitions\n- Service Definitions\n- Event Handler\n- Bound and Unbound Actions\n- Fiori Draft Support\n- SAP Fiori Elements Support\n\nFor more information and details, check our [CAP](https://cap.cloud.sap/docs/) documentation." - } - ], - "ref": "guided-tours", - "description": "Demonstrating CAP for Java" -} \ No newline at end of file diff --git a/README.md b/README.md index 4babbd63..6c40e50f 100644 --- a/README.md +++ b/README.md @@ -4,9 +4,7 @@ ![CI status](https://github.com/SAP-samples/cloud-cap-samples-java/workflows/Java%20CI%20with%20Maven/badge.svg) [![REUSE status](https://api.reuse.software/badge/github.com/SAP-samples/cloud-cap-samples-java)](https://api.reuse.software/info/github.com/SAP-samples/cloud-cap-samples-java) -Welcome to the bookshop-java project. It demonstrates how to build business applications using the [CAP Java SDK](https://cap.cloud.sap) providing a book shop web application as an example. The application in this project enables browsing books, managing books, and managing orders. - -![Book Object Page](assets/readmeImages/BookPage.png) +Welcome to the PostgreSQL bookshop-java sample. It demonstrates how to build business applications using the [CAP Java SDK](https://cap.cloud.sap) using PostgreSQL. The application in this project enables browsing books and managing books. ## Outline @@ -16,85 +14,55 @@ Welcome to the bookshop-java project. It demonstrates how to build business appl - [Getting Started](#getting-started) - [Prerequisites](#prerequisites) - [Clone Build & Run](#clone-build--run) - - [Using Eclipse](#using-eclipse) - - [Building and Running](#building-and-running) - - [Using IntelliJ Idea (Community and Ultimate)](#using-intellij-idea-community-and-ultimate) - - [Database Setup and Spring Profiles](#database-setup-and-spring-profiles) - - [API_BUSINESS_PARTNER Remote Service and Spring Profiles](#api_business_partner-remote-service-and-spring-profiles) + - [Database Setup](#database-setup) - [Deploy to SAP Business Technology Platform, Cloud Foundry](#deploy-to-sap-business-technology-platform-cloud-foundry) - - [Deploy to SAP Business Technology Platform, Kyma Runtime](#deploy-to-sap-business-technology-platform-kyma-runtime) - - [Setup Authorizations in SAP Business Technology Platform](#setup-authorizations-in-sap-business-technology-platform) -- [Code Tour](#code-tour) - [Get Support](#get-support) - [License](#license) # Overview -This sample application shows how to conveniently create business applications based on **CDS domain models**, persisting data with **H2**, or **SAP HANA**, and exposing an **OData V4** frontend with an **SAP Fiori** frontend on top. +This sample application shows how to conveniently create business applications based on **CDS domain models**, persisting data with **PostgreSQL**, and exposing an **OData V4** frontend with an **SAP Fiori** frontend on top. This sample uses Spring Boot as an **application framework**. Although a CAP Java application isn’t required to build on Spring Boot, it’s the first choice of framework, as it’s seamlessly integrated. The **domain models** are defined using [CDS entity definitions](https://cap.cloud.sap/docs/cds/cdl#entity-and-type-definitions). -By default, an in-memory H2 database is used for **data persistency**. Once productively deployed to SAP Business Technology Platform, SAP HANA can be used. - **Services** are defined using [CDS Service Models](https://cap.cloud.sap/docs/cds/cdl#services). The **OData V4 Protocol Adapter** translates the CDS service models into corresponding OData schemas and maps the incoming OData requests to the corresponding CDS services. -Although CAP provides generic **event handlers** to serve most CRUD requests out-of-the-box, it’s possible to add business logic through [Custom Event Handlers](https://cap.cloud.sap/docs/get-started/in-a-nutshell#adding-custom-logic). - A SAP Fiori UI is added using predefined SAP Fiori elements templates. **[SAP Fiori annotations](https://cap.cloud.sap/docs/advanced/fiori#fiori-annotations)** add information to the service definitions, on how to render the data. -CAP provides built-in multitenancy support with out-of-the box tenant isolation. The sample application demonstrates usage of MTX sidecar based on [streamlined MTX](https://cap.cloud.sap/docs/guides/deployment/as-saas?impl-variant=java) and can be deployed as multitenant application. The [deprecated classic MTX](https://cap.cloud.sap/docs/java/multitenancy) setup is shown in the [mtx-classic branch](https://github.com/SAP-samples/cloud-cap-samples-java/tree/mtx-classic) for reference. - ## Demonstrated Features Framework and Infrastructure related Features: +- [PostgreSQL database support](#database-setup) with Liquibase for schema evolution. - [Application configuration](https://cap.cloud.sap/docs/java/development#application-configuration) for Spring and CDS using [application.yaml](srv/src/main/resources/application.yaml) - [Mocking users](/srv/src/main/resources/application.yaml) for local development - [Authentication & Authorization](https://cap.cloud.sap/docs/java/security) (including user-specific restrictions with `@restrict` in the [Admin Service](/srv/admin-service.cds)) -- [Cloud Foundry Deployment using MTA](https://cap.cloud.sap/docs/advanced/deploy-to-cloud#deploy-using-mta) with XSUAA [Service Bindings](mta-single-tenant.yaml) +- [Cloud Foundry Deployment using MTA](https://cap.cloud.sap/docs/advanced/deploy-to-cloud#deploy-using-mta) with XSUAA [Service Bindings](mta.yaml) - Application Router configuration including authentication via the XSUAA Service. See [package.json](app/package.json), [xs-app.json](app/xs-app.json) and [xs-security.json](xs-security.json) -- [Multitenancy configuration](https://cap.cloud.sap/docs/java/multitenancy) via [mta-multi-tenant.yaml](mta-multi-tenant.yaml), [.cdsrc.json](.cdsrc.json), [sidecar module](mtx-sidecar) -- [Feature toggles](https://cap.cloud.sap/docs/guides/extensibility/feature-toggles?impl-variant=java#limitations). In CF, features can be toggled by assigning the roles `expert` or `premium-customer` to the user. Domain Model related Features: -- [CDS Query Language with a Static CDS Model](https://cap.cloud.sap/docs/java/advanced#staticmodel) in the [Admin Service](srv/src/main/java/my/bookshop/handlers/AdminServiceHandler.java) -- Use of [Aspects](https://cap.cloud.sap/docs/cds/cdl#aspects) in the Model Definition such as the [`managed` or `cuid` Aspect](https://cap.cloud.sap/docs/cds/common#common-reuse-aspects) in [Books](db/books.cds) +- Use of [Aspects](https://cap.cloud.sap/docs/cds/cdl#aspects) in the Model Definition such as the [`managed` or `cuid` Aspect](https://cap.cloud.sap/docs/cds/common#common-reuse-aspects) in [Books](db/schema.cds) - [Input validation](https://cap.cloud.sap/docs/cds/annotations#input-validation) using model annotation `@assert.format` -- [Data Localization](https://cap.cloud.sap/docs/guides/localized-data) for [Books](db/books.cds) -- Use of [Media Data](https://cap.cloud.sap/docs/guides/providing-services#media-data) in [Books](db/books.cds) and [AdminService](srv/admin-service.cds) - -Service Model related Features: - -- [Custom event handlers](https://cap.cloud.sap/docs/java/provisioning-api) such as the [Custom business logic for the Admin Service](srv/src/main/java/my/bookshop/handlers/AdminServiceHandler.java) -- [Custom actions](https://cap.cloud.sap/docs/cds/cdl#actions) such as `addToOrder` in the [Admin Service](srv/admin-service.cds). The Action implementation is in the [Admin Service Event Handler](srv/src/main/java/my/bookshop/handlers/AdminServiceHandler.java) -- Add annotations for [searchable elements](https://github.wdf.sap.corp/pages/cap/java/query-api#select) in the [Admin Service](srv/admin-service.cds) -- [Localized Messages](https://cap.cloud.sap/docs/java/indicating-errors) in the [Admin Service Event Handler](srv/src/main/java/my/bookshop/handlers/AdminServiceHandler.java) -- role-based restrictions in [AdminService](srv/admin-service.cds) and [ReviewService](srv/review-service.cds) -- Use of [`@cds.persistence.skip`](https://cap.cloud.sap/docs/advanced/hana#cdspersistenceskip) in [AdminService](srv/admin-service.cds) -- [Media Data](https://cap.cloud.sap/docs/guides/providing-services#media-data) processing in the [Admin Service Event Handler](srv/src/main/java/my/bookshop/handlers/AdminServiceHandler.java) +- [Data Localization](https://cap.cloud.sap/docs/guides/localized-data) for [Books](db/schema.cds) User Interface related Features: - Support for [SAP Fiori Elements](https://cap.cloud.sap/docs/advanced/fiori) -- [SAP Fiori Draft based Editing](https://cap.cloud.sap/docs/advanced/fiori#draft-support) for [Books, Orders](srv/admin-service.cds) and [Reviews](srv/review-service.cds) -- [SAP Fiori annotations](https://cap.cloud.sap/docs/advanced/fiori#fiori-annotations) specific for [Browse Books](app/browse/fiori-service.cds), [Manage Books](app/admin/fiori-service.cds), [Manage Orders](app/orders/fiori-service.cds), [Manage Reviews](app/reviews/fiori-service.cds) and [common annotations](app/common.cds), which apply to all UI's -- UI Annotations for custom actions in the [Browse Books](app/browse/fiori-service.cds) and [Manage Books](app/admin/fiori-service.cds) UI, including annotations for a button and a popup -- [Value Help](https://cap.cloud.sap/docs/cds/annotations#odata) for [Books](app/orders/fiori-service.cds) and [Authors](app/common.cds) +- [SAP Fiori Draft based Editing](https://cap.cloud.sap/docs/advanced/fiori#draft-support) for [Books](srv/admin-service.cds) +- [SAP Fiori annotations](https://cap.cloud.sap/docs/advanced/fiori#fiori-annotations) specific for [Browse Books](app/browse/fiori-service.cds) and [Manage Books](app/admin/fiori-service.cds) UIs +- [Value Help](https://cap.cloud.sap/docs/cds/annotations#odata) for [Authors](app/common.cds) - [Model Localization](https://cap.cloud.sap/docs/guides/i18n) for [English](app/_i18n/i18n.properties) and [German](app/_i18n/i18n_de.properties) language for static texts -- [Custom File Upload extension](app/admin/webapp/extension/Upload.js) which provides a button for uploading `CSV` files -- A simple Swagger UI for the CatalogService API at CDS Maven Plugin Features: -- Install [Node.js](srv/pom.xml#L157) in the default version. -- Install a [configured version](pom.xml#L24) of [@sap/cds-dk](srv/pom.xml#L167). -- Execute arbitrary [CDS](srv/pom.xml#L177) commands. -- [Generate](srv/pom.xml#L195) Java POJOs for type-safe access to the CDS model. -- [Clean](srv/pom.xml#L150) project from artifacts of the previous build. +- Install [Node.js](srv/pom.xml#L161) in the default version. +- Execute arbitrary [npm](srv/pom.xml#L161) commands. +- [Generate](srv/pom.xml#L193) Java POJOs for type-safe access to the CDS model. +- [Clean](srv/pom.xml#L154) project from artifacts of the previous build. # Getting Started @@ -102,7 +70,7 @@ The following sections describe how to set up, build, and run the project. ## Prerequisites -Make sure you have set up a development environment (that means, you’ve installed the CDS Compiler, Java, and Apache Maven) [as described here](https://cap.cloud.sap/docs/java/getting-started). +Make sure you have set up a development environment (that means, you’ve installed the CDS Compiler, Java and Apache Maven) [as described here](https://cap.cloud.sap/docs/java/getting-started). This sample also requires Docker Desktop or compatible alternative as described in [testcontainers library documentation](https://java.testcontainers.org/supported_docker_environment/). ## Clone Build & Run @@ -114,453 +82,39 @@ Make sure you have set up a development environment (that means, you’ve instal 2. Build and run the application: +```bash + mvn spring-boot:test-run ``` - mvn spring-boot:run -``` - -## Using Eclipse - -Optionally, use the following steps to import the project to Eclipse: - -1. Import the project using **File > Import > Existing Maven Projects**. - - Now, you should see the projects **bookshop** and **bookshop-parent** in the project/package explorer view. - -2. In Project Explorer, change the property "Package Presentation" from "Flat" to "Hierarchical" for better understanding. - -### Building and Running - -1. To **compile** the project, right-click the file `pom.xml` in the `bookshop-parent` project root folder and select -**Run as** > **Maven build**. - - In the following dialog, enter the string `clean install` into the field labeled with "Goals" and click "Run". - - Note: This step also compiles the CDS artifacts, thus repeat this once you made changes to the CDS model. This step also generates source files, therefore refresh the "bookshop" project in your IDE. - -2. To **run** the application, right-click the `bookshop` project root in the Package Explorer and select **Run as** > **Spring Boot App** (make sure you have [Spring Tools 4 installed](https://marketplace.eclipse.org/content/spring-tools-4-aka-spring-tool-suite-4)). - - This step creates a default Run Configuration named `Bookshop - Application` and starts the application afterwards. To go on with the next step, stop the application again. - -3. Then, set the default working directory by editing your Run Configuration via **Run** > **Run Configurations** > **Bookshop - Application**. On the tab **Arguments** change the default **Working Directory** to: - - ```${workspace_loc:bookshop-parent}``` - - Afterwards, click **Run**. This step starts the applications `main` method located in `src/main/java/my/bookshop/Application.java`. -4. Use the following links in the browser to check if everything works fine: +In the IDE use the [TestApplication](srv/src/test/java/my/bookshop/config/TestApplication.java) to run the application with the PostgreSQL container created by testcontainer. - : This should show the automatically generated index page of served paths. - : This is the actual bookshop application UI. - : This is providing a Swagger UI for the CatalogService API. +## Database Setup - You'll start with a predefined stock of books as this procedure starts the bookshop application with a CSV-initialized in-memory H2 database. +This application is built to use only PostgreSQL as the database. It is used in the tests, can be started locally and, when deployed to SAP BTP, can use PostgreSQL service available there. - Two mock users are defined for local development: - - User: `user`, password: `user` to browse books - - User: `admin`, password: `admin` to manage books and orders +This sample uses [Liquibase](https://www.liquibase.com) for deployment and evolution of database schema. You can find more on that in [CAP Database Guide](https://cap.cloud.sap/docs/guides/databases-postgres). -## Using IntelliJ Idea (Community and Ultimate) +To start the application with built-in PostgresSQL container run `mvn spring-boot:test-run`. Make sure that you have Docker Desktop or compatible alternative up and running. You will see that application created PostgreSQL container, deployed the database there and your application is up and running. -IntelliJ can handle the project more or less out-of-the-box. Since some of the event handlers in the project rely on -the code generated from the CDS model the build path of the project (module) needs to be extended -with the folder containing the generated code. In order to add the generated code you need to add the 'gen' folder -to the build path: +Regular run with `mvn spring-boot:run` will require datasource to be specified explicitly. You may adapt the default configuration if you want to use this sample with persistent database or with PostgreSQL deployed in the cloud. -* Open the project settings. -* Navigate to the 'modules' section. -* Select the srv/src/gen folder and mark it as 'sources'. -* Save and leave the project settings. -* Trigger a rebuild. - -After the generated code is considered by IntelliJ's build the application can be handled just as any other Spring Boot -application in IntelliJ. - -## Database Setup and Spring Profiles - -The application comes with two predefined profiles that determine how to run the application: `default`, and `cloud` (see `srv/src/main/resources/application.yaml`). - - -- The `default` profile specifies to use an in-memory H2 database. - The in-memory database is set up automatically during startup of the application and initialized with some example data from CSV files. - -- When deploying the application to Cloud Foundry, the CF Java Buildpack automatically configures the `cloud` Spring profile. - This profile doesn’t specify any datasource location. In that case CAP Java can automatically detect SAP HANA service bindings available in the environment. - -## API_BUSINESS_PARTNER Remote Service and Spring Profiles - -The behavior of the API_BUSINESS_PARTNER remote service is controlled using profiles (see `srv/src/main/resources/application.yaml`): - -- **Using mock data via internal service:** When using only the `default` profile (default when omitting any profile setting), the API_BUSINESS_PARTNER API is mocked as a local service using the mock data. - -- **Using mock data via internal service through OData:** With the `mocked` profile, all requests to the API_BUSINESS_PARTNER service will be routed through HTTP and OData to itself (`http://localhost:/api/API_BUSINESS_PARTNER/...`). This mode is similar to using a real remote destination, and such helps to prevent issues from differences in local service and remote service behavior. - -- **Using the sandbox environment:** You can access data from the [SAP API Business Hub sandbox](https://api.sap.com/api/API_BUSINESS_PARTNER/overview) with the `sandbox` profile. The API key needs to be provided with the environment variable `CDS_REMOTE_SERVICES_API_BUSINESS_PARTNER_DESTINATION_HEADERS_APIKEY`. You can retrieve it by clicking on *Show API Key* on [this page](https://api.sap.com/api/API_BUSINESS_PARTNER/overview) after logging in. - -- **Using S/4HANA cloud or on-premise system:** With the `destination` profile, you can access data from a real S/4HANA system. You need to create a destination with name `s4-destination` and make sure that an instance of XSUAA and destination service are bound to your application. For an on-premise destination, you additionally need to bind the connectivity service and add an additional property `URL.headers.sap-client` with the S/4HANA client number to your destination. - -The profiles `sandbox` and `destination` can be combined with the `default` profile for [hybrid testing](https://cap.cloud.sap/docs/advanced/hybrid-testing) and with the `cloud` profile when deployed to the cloud. +Unit tests require Docker environment and will fail if executed without one. ## Deploy to SAP Business Technology Platform, Cloud Foundry -CAP Java applications can be deployed to the SAP Business Technology Platform either in single tenant or in multitenancy mode. See [Multitenancy in CAP Java](https://cap.cloud.sap/docs/java/multitenancy) for more information. +CAP Java applications can be deployed to the SAP Business Technology Platform as single tenant application. Prerequisites: - Install the [Cloud MTA Build Tool](https://sap.github.io/cloud-mta-build-tool/): `npm install -g mbt`. - Install the [Cloud Foundry Command Line Interface](https://docs.cloudfoundry.org/cf-cli/install-go-cli.html). - Get an SAP Business Technology Platform account to deploy the services and applications. -- [Create a SAP HANA Cloud Instance](https://developers.sap.com/tutorials/hana-cloud-deploying.html) in your SAP Business Technology Platform space. -- Ensure you have an entitlement for `SAP HANA Schemas & HDI Containers` with plan `hdi-shared` in the same space. -- Ensure that your CF instances are connected to Internet to download SAPMachine JRE 17 as it is available in `sap_java_buildpack` in online mode only. - -Deploy as Single Tenant Application: -- Rename `mta-single-tenant.yaml` to `mta.yaml` -- Run `mbt build` -- Run `cf login` -- Run `cf deploy mta_archives/bookshop_1.0.0.mtar` +- Ensure you have an entitlement for _PostgreSQL, hyperscaler option_ with appropriate plan in the same space. +- Ensure that your CF instances are connected to Internet to download SAPMachine JRE 17 as it is available in `sap_java_buildpack` in online mode only and you run in the landscape where the _PostgreSQL, hyperscaler option_ is available. -Deploy as Multitenant Application: -- Rename `mta-multi-tenant.yaml` to `mta.yaml` +Deploy Application: - Run `mbt build` - Run `cf login` -- Run `cf deploy mta_archives/bookshop-mt_1.0.0.mtar` -- Go to another subaccount in your global account, under subscriptions and subscribe to the application you deployed. -- Run `cf map-route bookshop-mt-app --hostname ---bookshop-mt-app` or create and bind the route manually. - -Before you can access the UI using the (tenant-specific) URL to the bookshop(-mt)-app application, make sure to [Setup Authorizations in SAP Business Technology Platform](#setup-authorizations-in-sap-business-technology-platform). - -## Deploy to SAP Business Technology Platform, Kyma Runtime - -**TIP:** You can find more information in the [Deploy Your CAP Application on SAP BTP Kyma Runtime](https://developers.sap.com/mission.btp-deploy-cap-kyma.html) tutorial and in the [Deploy to Kyma/K8s](https://cap.cloud.sap/docs/guides/deployment/deploy-to-kyma) guide of the CAP documentation. - -### Preconditions - -- BTP Subaccount with Kyma Runtime -- BTP Subaccount with Cloud Foundry Space -- [HANA Cloud instance available](https://developers.sap.com/tutorials/hana-cloud-deploying.html) for your Cloud Foundry space -- BTP Entitlements for: *HANA HDI Services & Container* plan *hdi-shared*, *Launchpad Service* plan *standard* -- Container Registry (e.g. [Docker Hub](https://hub.docker.com/)) -- Command Line Tools: [`kubectl`](https://kubernetes.io/de/docs/tasks/tools/install-kubectl/), [`kubectl-oidc_login`](https://github.com/int128/kubelogin#setup), [`pack`](https://buildpacks.io/docs/tools/pack/), [`docker`](https://docs.docker.com/get-docker/), [`helm`](https://helm.sh/docs/intro/install/), [`cf`](https://docs.cloudfoundry.org/cf-cli/install-go-cli.html) -- Logged into Kyma Runtime (with `kubectl` CLI), Cloud Foundry space (with `cf` CLI) and Container Registry (with `docker login`) -- `@sap/cds-dk` >= 6.6.0 - -### Add Deployment Files - -CAP tooling provides you a Helm chart for deployment to Kyma. - -For single tenant deployment, replace the `requires` section in _`.cdsrc.json`_ with: - -``` - "requires": { - "auth": { - "kind": "xsuaa" - }, - "approuter": { - "kind": "cloudfoundry" - }, - "db": { - "kind": "hana-cloud" - } - }, -``` - -For multi tenant deployment, replace the `requires` section in _`.cdsrc.json`_ with: - -``` - "requires": { - "multitenancy": true, - "extensibility": true, - "toggles": true, - "auth": { - "kind": "xsuaa" - }, - "approuter": { - "kind": "cloudfoundry" - } - }, -``` - -Add the CAP Helm chart with the required features to this project: - -```bash -cds add helm -``` - -#### Use API_BUSSINESS_PARTNER Remote Service (optional, single tenant only) - -You can try the `API_BUSINESS_PARTNER` service with a real S/4HANA system with the following configuration: - -1. Create either an on-premise or cloud destination in your subaccount. - -2. Add configuration required for the destination service by executing the following command. - - ```bash - cds add destination - ``` - -3. Set the profiles `cloud` and `destination` active in your `values.yaml` file: - - ```yaml - srv: - ... - env: - SPRING_PROFILES_ACTIVE: cloud,destination - ``` - -4. For on-premise only: Add the connectivity service to your Helm chart: - - ```bash - cds add connectivity - ``` - - Note: `cds add helm` will not add configuration required to create a Connectivity Service Instance. This Service Instance should be created by the Kyma Cluster Administrator. For more information regarding configuration of Connectivity Instance, please check the [documentation](https://cap.cloud.sap/docs/guides/deployment/deploy-to-kyma#connectivity-service). - -*See also: [API_BUSINESS_PARTNER Remote Service and Spring Profiles](#api_business_partner-remote-service-and-spring-profiles)* - -### Prepare Kubernetes Namespace - -#### Create container registry secret - -Create a secret `container-registry` with credentials to access the container registry: - -``` -bash ./scripts/create-container-registry-secret.sh -``` - -The *Docker Server* is the full qualified hostname of your container registry. - -#### Create a HDI container / Service Manager Instance and a Secret - -This step is only required if you're using a BTP Trial account. If you're using a production or a free tier account then you can create HDI Container from Kyma directly by adding a [mapping to your Kyma namespace in your HANA Cloud Instance](https://blogs.sap.com/2022/12/15/consuming-sap-hana-cloud-from-the-kyma-environment/) and skip this step. - -##### Single Tenant - -``` -bash ./scripts/create-db-secret.sh bookshop-db -``` - -It will create a HDI container `bookshop-db` instance on your currently targeted Cloud Foundry space and a secret `bookshop-db` with the credentials in your current Kubernetes namespace. - -Make the following changes to your _`chart/values.yaml`_. - -```diff -srv: - bindings: - db: -- serviceInstanceName: hana -+ fromSecret: bookshop-db -... - -hana-deployer: - bindings: - hana: -- serviceInstanceName: hana -+ fromSecret: bookshop-db - -... -- hana: -- serviceOfferingName: hana -- servicePlanName: hdi-shared -``` - -Make the following changes to your _`chart/Chart.yaml`_. - -```diff -dependencies: - ... -- - name: service-instance -- alias: hana -- version: ">0.0.0" - ... -``` - -##### Multi Tenant - -``` -bash ./scripts/create-sm-secret.sh bookshop-sm -``` - -It will create a Service Manager `bookshop-sm` instance on your currently targeted Cloud Foundry space and a secret `bookshop-sm` with the credentials in your current Kubernetes namespace. - -Make the following changes to your _`chart/values.yaml`_. - -```diff -srv: - bindings: - service-manager: -- serviceInstanceName: service-manager -+ fromSecret: bookshop-sm -... - -sidecar: - bindings: - service-manager: -- serviceInstanceName: service-manager -+ fromSecret: bookshop-sm - -... -- service-manager: -- serviceOfferingName: service-manager -- servicePlanName: container -``` - -Make the following changes to your _`chart/Chart.yaml`_. - -```diff -dependencies: - ... -- - name: service-instance -- alias: service-manager -- version: ">0.0.0" - ... -``` - -### Build - -```bash -cds build --production -``` - -**Build image for CAP service:** - -```bash -mvn clean package -DskipTests=true -``` - -```bash -pack build $YOUR_CONTAINER_REGISTRY/bookshop-srv \ - --path srv/target/*-exec.jar \ - --buildpack gcr.io/paketo-buildpacks/sap-machine \ - --buildpack gcr.io/paketo-buildpacks/java \ - --builder paketobuildpacks/builder:base \ - --env SPRING_PROFILES_ACTIVE=cloud \ - --env BP_JVM_VERSION=17 -``` - -(Replace `$YOUR_CONTAINER_REGISTRY` with the full-qualified hostname of your container registry) - -**Build Approuter Image:** - -```bash -pack build $YOUR_CONTAINER_REGISTRY/bookshop-approuter \ - --path app \ - --buildpack gcr.io/paketo-buildpacks/nodejs \ - --builder paketobuildpacks/builder:base \ - --env BP_NODE_RUN_SCRIPTS="" -``` - -**Build database deployer image (single tenant only):** - -```bash -pack build $YOUR_CONTAINER_REGISTRY/bookshop-hana-deployer \ - --path db \ - --buildpack gcr.io/paketo-buildpacks/nodejs \ - --builder paketobuildpacks/builder:base \ - --env BP_NODE_RUN_SCRIPTS="" -``` - -**Build sidecar image (multi tenant only):** - -```bash -pack build $YOUR_CONTAINER_REGISTRY/bookshop-sidecar \ - --path mtx/sidecar/gen \ - --buildpack gcr.io/paketo-buildpacks/nodejs \ - --builder paketobuildpacks/builder:base \ - --env BP_NODE_RUN_SCRIPTS="" -``` - -### Push container images - -You can push all the container images to your container registry, using: - -```bash -docker push $YOUR_CONTAINER_REGISTRY/bookshop-srv - -docker push $YOUR_CONTAINER_REGISTRY/bookshop-approuter -``` - -#### Single Tenant - -```bash -docker push $YOUR_CONTAINER_REGISTRY/bookshop-hana-deployer -``` - -#### Multi Tenant - -```bash -docker push $YOUR_CONTAINER_REGISTRY/bookshop-sidecar -``` - -### Configuration - -Make the following changes in the _`chart/values.yaml`_ file. - -1. Change value of `global.domain` key to your cluster domain. - -2. Replace `` in `xsuaa.parameters.oauth2-configuration.redirect-uris` with your cluster domain. - -3. Replace `` with your container registry. - -4. Make the following change to add backend destinations required by Approuter. - -```diff -- backendDestinations: {} -+ backendDestinations: -+ backend: -+ service: srv -+ mtx-api: -+ service: srv -``` - -5. Add your image registry secret created in [Create container registry secret](#create-container-registry-secret) step. - -```diff -global: - domain: null -- imagePullSecret: {} -+ imagePullSecret: -+ name: container-registry -``` - -6. If the application is deployed multiple times in the same cluster, make sure to adapt the values of `xsappname` and `appName` under `saasRegistryParameters` in `values/Chart.yaml` - -### Deployment - -Deploy the helm chart using the following command: - -#### Single Tenant - -```bash -helm install bookshop ./chart --set-file xsuaa.jsonParameters=xs-security.json -``` - -Before you can access the UI you should make sure to [Setup Authorizations in SAP Business Technology Platform](#setup-authorizations-in-sap-business-technology-platform). - -Click on the approuter url logged by the `helm install` to access the UI. - -#### Multi Tenant - -```bash -helm install bookshop ./chart --set-file xsuaa.jsonParameters=xs-security-mt.json -``` - -In case of multi tenant, you'll have to subscribe to the application from a different subaccount. You can follow the steps mentioned [here](https://cap.cloud.sap/docs/guides/deployment/as-saas#subscribe) to access the application. - -## Setup Authorizations in SAP Business Technology Platform - -To access services and UIs that require specific authorizations (e.g. `admin`) you need to assign a corresponding role and role collections to your user in SAP BTP Cockpit. - -1. For single-tenant applications open the subaccount where you deployed the `bookshop` application to. For multitenant applications open the subaccount where you subscribed to the `bookshop` application. -2. Navigate to *Security* -> *Roles* -3. Create a role with name `bookshop-admin` based on the `admin` role template of the `bookshop` application: - 1. Enter a Business Partner ID of your S/4 system as value for the `businessPartner` attribute. When using the sandbox environment use `10401010`. -4. Navigate to *Security* -> *Role Collections* -5. Create a new role collection `bookshop-admin`: - 1. Assign the `bookshop-admin` role to this role collection - 2. Assign the role collection to your user - -# Code Tour - -Take the [guided tour](.tours) in VS Code through our CAP Samples for Java and learn which CAP features are showcased by the different parts of the repository. Just install the [CodeTour extension](https://marketplace.visualstudio.com/items?itemName=vsls-contrib.codetour) for VS Code. +- Run `cf deploy mta_archives/bookshop-pg_1.0.0.mtar` # Get Support diff --git a/app/_i18n/i18n.properties b/app/_i18n/i18n.properties index f2e76aa0..cdeebb9b 100644 --- a/app/_i18n/i18n.properties +++ b/app/_i18n/i18n.properties @@ -18,7 +18,6 @@ Stock = Stock Price = Price Description = Description BookPrice = Book Price -AddToOrder = Add to Order Authors = Authors Author = Author @@ -26,32 +25,7 @@ AuthorID = Author ID Name = Name AuthorName = Author's Name -Order = Order -Orders = Orders -OrderNumber = Order Number -Total = Order Value - -OrderItem = Order Item -OrderItems = Order Items -Quantity = Quantity -Amount = Amount - -ShippingAddress = Shipping Address -ShippingAddresses = Shipping Addresses -CityName = City Name -HouseNumber = House Number -StreetName = Street Name -PostalCode = Postal Code -Country = Country -AddressID = Address ID -BusinessPartner = Contact - Locale = Language - -Reviews = Reviews -Review = Review -Rating = Rating -Subject = Subject Date = Date User = User @@ -59,9 +33,4 @@ Text = Text Image = Image Genres = Genres Genre = Genre - -AddReview = Add Review - -Notes = Notes -Note = Note ISBN = ISBN diff --git a/app/addresses/fiori-service.cds b/app/addresses/fiori-service.cds deleted file mode 100644 index 51887f31..00000000 --- a/app/addresses/fiori-service.cds +++ /dev/null @@ -1,83 +0,0 @@ -using NotesService from '../../srv/notes-mashup'; - -annotate NotesService.Addresses with @(UI : { - LineItem : [ - { - Value : businessPartner, - Label : '{i18n>BusinessPartner}' - }, - { - Value : ID, - Label : '{i18n>ID}' - }, - { - Value : street, - Label : '{i18n>StreetName}' - }, - { - Value : city, - Label : '{i18n>CityName}' - }, - { - Value : country, - Label : '{i18n>Country}' - } - ], - HeaderInfo : { - TypeName : '{i18n>ShippingAddress}', - TypeNamePlural : '{i18n>ShippingAddresses}', - Title : {Value : ID}, - Description : {Value : businessPartner}, - }, - PresentationVariant : { - Text : 'Default', - Visualizations : ['@UI.LineItem'] - }, - Facets : [ - { - $Type : 'UI.ReferenceFacet', - Target : '@UI.FieldGroup#Address', - Label : '{i18n>ShippingAddress}', - }, - { - $Type : 'UI.ReferenceFacet', - Label : '{i18n>Notes}', - Target : 'notes/@UI.LineItem' - } - ], - FieldGroup #Address : {Data : [ - { - Value : street, - Label : '{i18n>StreetName}' - }, - { - Value : houseNumber, - Label : '{i18n>HouseNumber}' - }, - { - Value : postalCode, - Label : '{i18n>PostalCode}' - }, - { - Value : city, - Label : '{i18n>CityName}' - }, - { - Value : country, - Label : '{i18n>Country}' - } - ]}, -}) { - businessPartner - @title : '{i18n>BusinessPartner}' - @UI.HiddenFilter; - ID - @title : '{i18n>ID}' - @UI.HiddenFilter; - street - @title : '{i18n>StreetName}'; - city - @title : '{i18n>CityName}'; - country - @title : '{i18n>Country}'; -}; diff --git a/app/addresses/package.json b/app/addresses/package.json deleted file mode 100644 index 8e75334b..00000000 --- a/app/addresses/package.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "name": "addresses", - "version": "1.0.0", - "description": "", - "main": "index.js", - "scripts": { - "test": "echo \"Error: no test specified\" && exit 1" - }, - "keywords": [], - "author": "", - "license": "ISC" -} diff --git a/app/addresses/webapp/Component.js b/app/addresses/webapp/Component.js deleted file mode 100644 index 5def6d12..00000000 --- a/app/addresses/webapp/Component.js +++ /dev/null @@ -1,3 +0,0 @@ -sap.ui.define(["sap/fe/core/AppComponent"], ac => ac.extend("addresses.Component", { - metadata:{ manifest:'json' } -})) diff --git a/app/addresses/webapp/i18n/i18n.properties b/app/addresses/webapp/i18n/i18n.properties deleted file mode 100644 index 32c07eed..00000000 --- a/app/addresses/webapp/i18n/i18n.properties +++ /dev/null @@ -1,2 +0,0 @@ -appTitle=Show Shipping Addresses -appDescription=Show Shipping Addresses - Sample Application diff --git a/app/addresses/webapp/i18n/i18n_de.properties b/app/addresses/webapp/i18n/i18n_de.properties deleted file mode 100644 index a150555b..00000000 --- a/app/addresses/webapp/i18n/i18n_de.properties +++ /dev/null @@ -1,2 +0,0 @@ -appTitle=Zeige Lieferaddressen -appDescription=Zeige Lieferaddressen - Beispielanwendung diff --git a/app/addresses/webapp/index.html b/app/addresses/webapp/index.html deleted file mode 100644 index a59fa7d2..00000000 --- a/app/addresses/webapp/index.html +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - - Show Shipping Addresses - - - - -
- - diff --git a/app/addresses/webapp/manifest.json b/app/addresses/webapp/manifest.json deleted file mode 100644 index 5266df52..00000000 --- a/app/addresses/webapp/manifest.json +++ /dev/null @@ -1,142 +0,0 @@ -{ - "_version": "1.8.0", - "sap.app": { - "id": "addresses", - "type": "application", - "title": "{{appTitle}}", - "description": "{{appDescription}}", - "applicationVersion": { - "version": "1.0.0" - }, - "dataSources": { - "NotesService": { - "uri": "/api/notes/", - "type": "OData", - "settings": { - "odataVersion": "4.0" - } - } - }, - "-sourceTemplate": { - "id": "ui5template.basicSAPUI5ApplicationProject", - "-id": "ui5template.smartTemplate", - "-version": "1.40.12" - }, - "crossNavigation": { - "inbounds": { - "Addresses-show": { - "signature": { - "parameters": {}, - "additionalParameters": "allowed" - }, - "semanticObject": "Addresses", - "action": "show" - } - } - } - }, - "sap.ui5": { - "dependencies": { - "libs": { - "sap.fe.templates": {} - } - }, - "models": { - "i18n": { - "type": "sap.ui.model.resource.ResourceModel", - "uri": "i18n/i18n.properties" - }, - "": { - "dataSource": "NotesService", - "settings": { - "synchronizationMode": "None", - "operationMode": "Server", - "autoExpandSelect" : true, - "earlyRequests": true, - "groupProperties": { - "default": { - "submit": "Auto" - } - } - } - } - }, - "routing": { - "routes": [ - { - "pattern": ":?query:", - "name": "AddressesList", - "target": "AddressesList" - }, - { - "pattern": "Addresses({key}):?query:", - "name": "AddressesDetails", - "target": "AddressesDetails" - }, - { - "pattern": "Addresses({key})/notes({key2}):?query:", - "name": "NotesDetails", - "target": "NotesDetails" - } - ], - "targets": { - "AddressesList": { - "type": "Component", - "id": "AddressesList", - "name": "sap.fe.templates.ListReport", - "options": { - "settings" : { - "entitySet" : "Addresses", - "navigation" : { - "Addresses" : { - "detail" : { - "route" : "AddressesDetails" - } - } - } - } - } - }, - "AddressesDetails": { - "type": "Component", - "id": "AddressesDetails", - "name": "sap.fe.templates.ObjectPage", - "options": { - "settings" : { - "entitySet" : "Addresses", - "navigation" : { - "notes" : { - "detail" : { - "route" : "NotesDetails" - } - } - } - } - } - }, - "NotesDetails": { - "type": "Component", - "id": "NotesDetails", - "name": "sap.fe.templates.ObjectPage", - "options": { - "settings" : { - "entitySet": "Notes" - } - } - } - } - }, - "contentDensities": { - "compact": true, - "cozy": true - } - }, - "sap.ui": { - "technology": "UI5", - "fullWidth": false - }, - "sap.fiori": { - "registrationIds": [], - "archeType": "transactional" - } -} diff --git a/app/admin/fiori-service.cds b/app/admin/fiori-service.cds index 2480f4cc..fb389131 100644 --- a/app/admin/fiori-service.cds +++ b/app/admin/fiori-service.cds @@ -37,6 +37,10 @@ annotate AdminService.Books with @(UI : { {Value : author_ID}, {Value : genre_ID}, {Value : descr}, + { + Value: isbn, + Label: '{i18n>ISBN}' + }, ]}, FieldGroup #Details : {Data : [ {Value : stock}, @@ -93,41 +97,3 @@ annotate AdminService.Books.texts { type : #fixed } } - -annotate AdminService.Books actions { - @( - Common.SideEffects : { - TargetProperties : ['_it/order_ID'], - TargetEntities : [_it] - }, - cds.odata.bindingparameter.name : '_it' - ) - addToOrder(order_ID @( - title : '{i18n>Order}', - Common : {ValueListMapping : { - Label : '{i18n>Orders}', - CollectionPath : 'Orders', - Parameters : [ - { - $Type : 'Common.ValueListParameterInOut', - LocalDataProperty : order_ID, - ValueListProperty : 'ID' - }, - { - $Type : 'Common.ValueListParameterDisplayOnly', - ValueListProperty : 'OrderNo' - }, - { - $Type : 'Common.ValueListParameterDisplayOnly', - ValueListProperty : 'createdBy' - }, - { - $Type : 'Common.ValueListParameterDisplayOnly', - ValueListProperty : 'createdAt' - } - ], - }} - ), - quantity @title : '{i18n>Quantity}' - ) -} diff --git a/app/appconfig/fioriSandboxConfig.json b/app/appconfig/fioriSandboxConfig.json index 1dc45ef8..737450a1 100644 --- a/app/appconfig/fioriSandboxConfig.json +++ b/app/appconfig/fioriSandboxConfig.json @@ -38,51 +38,6 @@ "title": "Manage Books", "description": "Add/edit/delete books" } - }, - { - "id": "manage-orders", - "tileType": "sap.ushell.ui.tile.StaticTile", - "properties": { - "targetURL": "#Orders-manage", - "title": "Manage Orders", - "description": "Find & manage orders" - } - }, - { - "id": "manage-reviews", - "tileType": "sap.ushell.ui.tile.StaticTile", - "properties": { - "targetURL": "#Reviews-manage", - "title": "Manage Reviews", - "description": "Add/edit/delete reviews" - } - } - ] - }, - { - "id": "Shipping", - "title": "Shipping", - "isPreset": true, - "isVisible": true, - "isGroupLocked": false, - "tiles": [ - { - "id": "manage-notes", - "tileType": "sap.ushell.ui.tile.StaticTile", - "properties": { - "targetURL": "#Notes-manage", - "title": "Manage Notes", - "description": "Read & create notes for addresses" - } - }, - { - "id": "show-addresses", - "tileType": "sap.ushell.ui.tile.StaticTile", - "properties": { - "targetURL": "#Addresses-display", - "title": "Show Shipping Addresses", - "description": "Find the right shipping address" - } } ] } @@ -124,58 +79,6 @@ "additionalInformation": "SAPUI5.Component=admin", "url": "/admin/webapp" } - }, - "manage-orders": { - "semanticObject": "Orders", - "action": "manage", - "signature": { - "parameters": {}, - "additionalParameters": "allowed" - }, - "resolutionResult": { - "applicationType": "SAPUI5", - "additionalInformation": "SAPUI5.Component=orders", - "url": "/orders/webapp" - } - }, - "manage-reviews": { - "semanticObject": "Reviews", - "action": "manage", - "signature": { - "parameters": {}, - "additionalParameters": "allowed" - }, - "resolutionResult": { - "applicationType": "SAPUI5", - "additionalInformation": "SAPUI5.Component=reviews", - "url": "/reviews/webapp" - } - }, - "manage-notes": { - "semanticObject": "Notes", - "action": "manage", - "signature": { - "parameters": {}, - "additionalParameters": "allowed" - }, - "resolutionResult": { - "applicationType": "SAPUI5", - "additionalInformation": "SAPUI5.Component=notes", - "url": "/notes/webapp" - } - }, - "show-addresses": { - "semanticObject": "Addresses", - "action": "display", - "signature": { - "parameters": {}, - "additionalParameters": "allowed" - }, - "resolutionResult": { - "applicationType": "SAPUI5", - "additionalInformation": "SAPUI5.Component=addresses", - "url": "/addresses/webapp" - } } } } diff --git a/app/browse/fiori-service.cds b/app/browse/fiori-service.cds index 953c39dc..b91c5f63 100644 --- a/app/browse/fiori-service.cds +++ b/app/browse/fiori-service.cds @@ -16,12 +16,7 @@ annotate CatalogService.Books with @(UI : { Description : {Value : author.name} }, Identification : [ - {Value : title}, - { - $Type : 'UI.DataFieldForAction', - Label : '{i18n>AddReview}', - Action : 'CatalogService.addReview' - } + {Value : title} ], PresentationVariant : { Text : 'Default', @@ -32,16 +27,6 @@ annotate CatalogService.Books with @(UI : { author_ID, genre_ID ], - HeaderFacets : [ - { - $Type : 'UI.ReferenceFacet', - Target : '@UI.DataPoint#rating' - }, - { - $Type : 'UI.ReferenceFacet', - Target : '@UI.DataPoint#price' - } - ], LineItem : [ {Value : title}, { @@ -52,17 +37,12 @@ annotate CatalogService.Books with @(UI : { Value : genre.name, Label : '{i18n>Genre}' }, - { - $Type : 'UI.DataFieldForAnnotation', - Target : '@UI.DataPoint#rating', - Label : '{i18n>Rating}' - }, {Value : price}, + {Value: title}, { - $Type : 'UI.DataFieldForAnnotation', - Label : '{i18n>AddReview}', - Target : '@UI.FieldGroup#AddReview' - } + Value: isbn, + Label: '{i18n>ISBN}' + }, ], Facets : [ { @@ -74,23 +54,17 @@ annotate CatalogService.Books with @(UI : { $Type : 'UI.ReferenceFacet', Label : '{i18n>Description}', Target : '@UI.FieldGroup#Descr' - }, - { - $Type : 'UI.ReferenceFacet', - Label : '{i18n>Reviews}', - Target : 'reviews/@UI.LineItem' } ], - FieldGroup #AddReview : {Data : [{ - $Type : 'UI.DataFieldForAction', - Label : '{i18n>AddReview}', - Action : 'CatalogService.addReview', - InvocationGrouping : #ChangeSet - }, ]}, FieldGroup #General : {Data : [ {Value : title}, {Value : author_ID}, - {Value : genre_ID} + {Value : genre_ID}, + {Value: title}, + { + Value: isbn, + Label: '{i18n>ISBN}' + }, ]}, FieldGroup #Descr : {Data : [{Value : descr}]}, DataPoint #stock : { @@ -100,14 +74,6 @@ annotate CatalogService.Books with @(UI : { DataPoint #price : { Value : price, Title : '{i18n>Price}' - }, - DataPoint #rating : { - Value : rating, - Title : '{i18n>Rating}', - Visualization : #Rating, - MinimumValue : 0, - MaximumValue : 5, - TargetValue : 5 } }) { @Measures.ISOCurrency : currency_code @@ -118,60 +84,4 @@ annotate CatalogService.Books.texts with @(UI : {LineItem : [ {Value : locale}, {Value : title}, {Value : descr} -]}); - -annotate CatalogService.Reviews with @(UI : { - PresentationVariant : { - $Type : 'UI.PresentationVariantType', - SortOrder : [{ - $Type : 'Common.SortOrderType', - Property : modifiedAt, - Descending : true - }, ], - }, - LineItem : [ - { - $Type : 'UI.DataFieldForAnnotation', - Label : '{i18n>Rating}', - Target : '@UI.DataPoint#rating' - }, - { - $Type : 'UI.DataFieldForAnnotation', - Label : '{i18n>User}', - Target : '@UI.FieldGroup#ReviewerAndDate' - }, - { - Value : title, - Label : '{i18n>Title}' - }, - { - Value : text, - Label : '{i18n>Text}' - }, - ], - DataPoint #rating : { - Value : rating, - Visualization : #Rating, - MinimumValue : 0, - MaximumValue : 5 - }, - FieldGroup #ReviewerAndDate : {Data : [ - {Value : createdBy}, - {Value : modifiedAt} - ]} -}); - -annotate CatalogService.Books actions { - @( - Common.SideEffects : { - TargetProperties : ['_it/rating'], - TargetEntities : [ - _it, - _it.reviews - ] - }, - cds.odata.bindingparameter.name : '_it', - Core.OperationAvailable : _it.isReviewable - ) - addReview(rating @title : '{i18n>Rating}', title @title : '{i18n>Title}', text @title : '{i18n>Text}') -} +]}); \ No newline at end of file diff --git a/app/common.cds b/app/common.cds index 787e85bf..841c223d 100644 --- a/app/common.cds +++ b/app/common.cds @@ -1,7 +1,7 @@ /* Common Annotations shared by all apps */ -using {my.bookshop as my} from '../db/index'; +using {my.bookshop as my} from '../db/schema'; //////////////////////////////////////////////////////////////////////////// @@ -32,12 +32,7 @@ annotate my.Books with { Value : currency.symbol, Label : ' ' - }, - { - $Type : 'UI.DataFieldForAction', - Label : '{i18n>AddToOrder}', - Action : 'AdminService.addToOrder' - }, + } ] } ) { @@ -92,82 +87,6 @@ annotate my.Books with { } -//////////////////////////////////////////////////////////////////////////// -// -// Reviews List -// -annotate my.Reviews with -@(UI : { - Identification : [ - { - Value : ID, - ![@UI.Hidden] - }, - {Value : title} - ], - SelectionFields : [ - book_ID, - rating - ], - LineItem : [ - { - Value : modifiedAt, - Label : 'Date' - }, - { - Value : createdBy, - Label : '{i18n>User}' - }, - { - $Type : 'UI.DataFieldForAnnotation', - Label : '{i18n>Book}', - Target : '@UI.FieldGroup#BookAndAuthor' - }, - { - $Type : 'UI.DataFieldForAnnotation', - Label : '{i18n>Rating}', - Target : '@UI.DataPoint#rating' - }, - { - Value : title, - Label : '{i18n>Review}' - } - ], - FieldGroup #BookAndAuthor : {Data : [ - {Value : book.title}, - {Value : book.author.name} - ]}, - DataPoint #rating : { - Value : rating, - Visualization : #Rating, - MinimumValue : 0, - MaximumValue : 5 - } -}); - -annotate my.Reviews with { - ID - @title : '{i18n>ID}' - @UI.HiddenFilter; - title - @title : '{i18n>Title}'; - book - @ValueList.entity : 'Books' - @title : '{i18n>Book}' - @Common : { - Text : book.title, - TextArrangement : #TextOnly - }; - date - @title : '{i18n>Date}'; - rating - @title : '{i18n>Rating}'; - text - @title : '{i18n>Text}' - @UI.MultiLineText; -} - - //////////////////////////////////////////////////////////////////////////// // // Genres List diff --git a/app/index.cds b/app/index.cds index dcbf40e5..ccba0587 100644 --- a/app/index.cds +++ b/app/index.cds @@ -4,8 +4,4 @@ using from './admin/fiori-service'; using from './browse/fiori-service'; -using from './orders/fiori-service'; -using from './reviews/fiori-service'; -using from './notes/fiori-service'; -using from './addresses/fiori-service'; using from './common'; diff --git a/app/notes/fiori-service.cds b/app/notes/fiori-service.cds deleted file mode 100644 index 102095b1..00000000 --- a/app/notes/fiori-service.cds +++ /dev/null @@ -1,133 +0,0 @@ -using NotesService from '../../srv/notes-mashup'; - -annotate NotesService.Notes with @odata.draft.enabled @(UI : { - LineItem : [ - { - Value : address.businessPartner, - Label : '{i18n>BusinessPartner}' - }, - { - Value : address.street, - Label : '{i18n>StreetName}' - }, - { - Value : address.city, - Label : '{i18n>CityName}' - }, - { - Value : note, - Label : '{i18n>Note}' - } - ], - HeaderInfo : { - TypeName : '{i18n>Note}', - TypeNamePlural : '{i18n>Notes}', - Title : {Value : '{i18n>Note}'}, - Description : {Value : ID}, - }, - PresentationVariant : { - Text : 'Default', - Visualizations : ['@UI.LineItem'] - }, - Facets : [ - { - $Type : 'UI.ReferenceFacet', - Target : '@UI.FieldGroup#Note', - Label : '{i18n>Note}', - }, - { - $Type : 'UI.ReferenceFacet', - Target : '@UI.FieldGroup#Address', - Label : '{i18n>ShippingAddress}', - } - ], - FieldGroup #Note : {Data : [ - { - Value : note, - Label : '{i18n>Note}' - } - ]}, - FieldGroup #Address : {Data : [ - { - Value : address_businessPartner, - Label : '{i18n>BusinessPartner}' - }, - { - Value : address.ID, - Label : '{i18n>ID}' - }, - { - Value : address.street, - Label : '{i18n>StreetName}' - }, - { - Value : address.houseNumber, - Label : '{i18n>HouseNumber}' - }, - { - Value : address.postalCode, - Label : '{i18n>PostalCode}' - }, - { - Value : address.city, - Label : '{i18n>CityName}' - }, - { - Value : address.country, - Label : '{i18n>Country}' - } - ]}, -}, Common : { - SideEffects #AddressChanges : { - SourceProperties : [address_businessPartner], - TargetEntities : [address] - } -}) { - ID - @title : '{i18n>ID}' - @UI.HiddenFilter; - note - @title : '{i18n>Note}' - @UI.MultiLineText; - address - @(Common : { - FieldControl : #Mandatory, - ValueList : { - CollectionPath : 'Addresses', - Label : '{i18n>ShippingAddress}', - SearchSupported : false, - Parameters : [ - { - $Type : 'Common.ValueListParameterOut', - LocalDataProperty : 'address_businessPartner', - ValueListProperty : 'businessPartner' - }, - { - $Type : 'Common.ValueListParameterOut', - LocalDataProperty : 'address_ID', - ValueListProperty : 'ID', - }, - { - $Type : 'Common.ValueListParameterDisplayOnly', - ValueListProperty : 'postalCode' - }, - { - $Type : 'Common.ValueListParameterDisplayOnly', - ValueListProperty : 'city' - }, - { - $Type : 'Common.ValueListParameterDisplayOnly', - ValueListProperty : 'country' - }, - { - $Type : 'Common.ValueListParameterDisplayOnly', - ValueListProperty : 'street' - }, - { - $Type : 'Common.ValueListParameterDisplayOnly', - ValueListProperty : 'houseNumber' - }, - ] - } - }); -}; diff --git a/app/notes/package.json b/app/notes/package.json deleted file mode 100644 index 555c053e..00000000 --- a/app/notes/package.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "name": "notes", - "version": "1.0.0", - "description": "", - "main": "index.js", - "scripts": { - "test": "echo \"Error: no test specified\" && exit 1" - }, - "keywords": [], - "author": "", - "license": "ISC" -} diff --git a/app/notes/webapp/Component.js b/app/notes/webapp/Component.js deleted file mode 100644 index aa5843fc..00000000 --- a/app/notes/webapp/Component.js +++ /dev/null @@ -1,3 +0,0 @@ -sap.ui.define(["sap/fe/core/AppComponent"], ac => ac.extend("notes.Component", { - metadata:{ manifest:'json' } -})) diff --git a/app/notes/webapp/i18n/i18n.properties b/app/notes/webapp/i18n/i18n.properties deleted file mode 100644 index e4d3ed2f..00000000 --- a/app/notes/webapp/i18n/i18n.properties +++ /dev/null @@ -1,2 +0,0 @@ -appTitle=Manage Notes -appDescription=Manage Notes - Sample Application diff --git a/app/notes/webapp/i18n/i18n_de.properties b/app/notes/webapp/i18n/i18n_de.properties deleted file mode 100644 index 5451c4e2..00000000 --- a/app/notes/webapp/i18n/i18n_de.properties +++ /dev/null @@ -1,2 +0,0 @@ -appTitle=Administriere Notizen -appDescription=Administriere Notizen - Beispielanwendung diff --git a/app/notes/webapp/index.html b/app/notes/webapp/index.html deleted file mode 100644 index d91b7503..00000000 --- a/app/notes/webapp/index.html +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - - Manage Notes - - - - -
- - diff --git a/app/notes/webapp/manifest.json b/app/notes/webapp/manifest.json deleted file mode 100644 index f75a99b2..00000000 --- a/app/notes/webapp/manifest.json +++ /dev/null @@ -1,120 +0,0 @@ -{ - "_version": "1.8.0", - "sap.app": { - "id": "notes", - "type": "application", - "title": "{{appTitle}}", - "description": "{{appDescription}}", - "applicationVersion": { - "version": "1.0.0" - }, - "dataSources": { - "NotesService": { - "uri": "/api/notes/", - "type": "OData", - "settings": { - "odataVersion": "4.0" - } - } - }, - "-sourceTemplate": { - "id": "ui5template.basicSAPUI5ApplicationProject", - "-id": "ui5template.smartTemplate", - "-version": "1.40.12" - }, - "crossNavigation": { - "inbounds": { - "Notes-manage": { - "signature": { - "parameters": {}, - "additionalParameters": "allowed" - }, - "semanticObject": "Notes", - "action": "manage" - } - } - } - }, - "sap.ui5": { - "dependencies": { - "libs": { - "sap.fe.templates": {} - } - }, - "models": { - "i18n": { - "type": "sap.ui.model.resource.ResourceModel", - "uri": "i18n/i18n.properties" - }, - "": { - "dataSource": "NotesService", - "settings": { - "synchronizationMode": "None", - "operationMode": "Server", - "autoExpandSelect" : true, - "earlyRequests": true, - "groupProperties": { - "default": { - "submit": "Auto" - } - } - } - } - }, - "routing": { - "routes": [ - { - "pattern": ":?query:", - "name": "NotesList", - "target": "NotesList" - }, - { - "pattern": "Notes({key}):?query:", - "name": "NotesDetails", - "target": "NotesDetails" - } - ], - "targets": { - "NotesList": { - "type": "Component", - "id": "NotesList", - "name": "sap.fe.templates.ListReport", - "options": { - "settings" : { - "entitySet" : "Notes", - "navigation" : { - "Notes" : { - "detail" : { - "route" : "NotesDetails" - } - } - } - } - } - }, - "NotesDetails": { - "type": "Component", - "id": "NotesDetails", - "name": "sap.fe.templates.ObjectPage", - "options": { - "settings" : { - "entitySet" : "Notes" - } - } - } - } - }, - "contentDensities": { - "compact": true, - "cozy": true - } - }, - "sap.ui": { - "technology": "UI5", - "fullWidth": false - }, - "sap.fiori": { - "registrationIds": [], - "archeType": "transactional" - } -} diff --git a/app/orders/fiori-service.cds b/app/orders/fiori-service.cds deleted file mode 100644 index 11d37f0d..00000000 --- a/app/orders/fiori-service.cds +++ /dev/null @@ -1,283 +0,0 @@ -/* - Annotations for the Manage Orders App -*/ - -using AdminService from '../../srv/admin-service'; - - -//////////////////////////////////////////////////////////////////////////// -// -// Common -// -annotate AdminService.OrderItems with { - book @( - Common : { - Text : book.title, - FieldControl : #Mandatory - }, - ValueList.entity : 'Books', - ); - quantity @(Common.FieldControl : #Mandatory); -} - -annotate AdminService.Orders with { - shippingAddress @(Common : { - FieldControl : #Mandatory, - ValueList : { - CollectionPath : 'Addresses', - Label : 'Addresses', - SearchSupported : 'true', - Parameters : [ - { - $Type : 'Common.ValueListParameterOut', - LocalDataProperty : 'shippingAddress_ID', - ValueListProperty : 'ID' - }, - { - $Type : 'Common.ValueListParameterOut', - LocalDataProperty : 'shippingAddress_businessPartner', - ValueListProperty : 'businessPartner' - }, - { - $Type : 'Common.ValueListParameterDisplayOnly', - ValueListProperty : 'postalCode' - }, - { - $Type : 'Common.ValueListParameterDisplayOnly', - ValueListProperty : 'city' - }, - { - $Type : 'Common.ValueListParameterDisplayOnly', - ValueListProperty : 'country' - }, - { - $Type : 'Common.ValueListParameterDisplayOnly', - ValueListProperty : 'street' - }, - { - $Type : 'Common.ValueListParameterDisplayOnly', - ValueListProperty : 'houseNumber' - }, - ] - } - }); -} - -//////////////////////////////////////////////////////////////////////////// -// -// UI -// -annotate AdminService.Orders with @( - UI : { - //////////////////////////////////////////////////////////////////////////// - // - // Lists of Orders - // - SelectionFields : [ - createdAt, - createdBy - ], - LineItem : [ - { - Value : createdBy, - Label : '{i18n>Customer}' - }, - { - Value : total, - Label : '{i18n>Total}' - }, - { - Value : createdAt, - Label : '{i18n>Date}' - } - ], - //////////////////////////////////////////////////////////////////////////// - // - // Order Details - // - HeaderInfo : { - TypeName : '{i18n>Order}', - TypeNamePlural : '{i18n>Orders}', - Title : { - Label : '{i18n>OrderNumber}', //A label is possible but it is not considered on the ObjectPage yet - Value : OrderNo - }, - Description : {Value : createdBy} - }, - Identification : [ //Is the main field group - { - Value : createdBy, - Label : '{i18n>Customer}' - }, - { - Value : createdAt, - Label : '{i18n>Date}' - }, - {Value : OrderNo}, - { - Value : 'shippingAddress', - Label : '{i18n>ID}' - } - ], - HeaderFacets : [ - { - $Type : 'UI.ReferenceFacet', - Label : '{i18n>Created}', - Target : '@UI.FieldGroup#Created' - }, - { - $Type : 'UI.ReferenceFacet', - Label : '{i18n>Modified}', - Target : '@UI.FieldGroup#Modified' - }, - ], - Facets : [ - { - $Type : 'UI.ReferenceFacet', - Label : '{i18n>ShippingAddress}', - Target : '@UI.FieldGroup#ShippingAddress' - }, - { - $Type : 'UI.ReferenceFacet', - Label : '{i18n>Details}', - Target : '@UI.FieldGroup#Details' - }, - { - $Type : 'UI.ReferenceFacet', - Label : '{i18n>OrderItems}', - Target : 'Items/@UI.LineItem' - }, - ], - FieldGroup #Details : {Data : [ - { - Value : total, - Label : '{i18n>Total}' - }, - { - Value : currency_code, - Label : '{i18n>Currency}' - } - ]}, - FieldGroup #Created : {Data : [ - {Value : createdBy}, - {Value : createdAt}, - ]}, - FieldGroup #Modified : {Data : [ - {Value : modifiedBy}, - {Value : modifiedAt}, - ]}, - FieldGroup #ShippingAddress : {Data : [ - { - Value : shippingAddress_ID, - Label : '{i18n>ShippingAddress}' - }, - { - Value : shippingAddress.houseNumber, - Label : '{i18n>HouseNumber}' - }, - { - Value : shippingAddress.street, - Label : '{i18n>StreetName}' - }, - { - Value : shippingAddress.city, - Label : '{i18n>CityName}' - }, - { - Value : shippingAddress.postalCode, - Label : '{i18n>PostalCode}' - }, - ]} - }, - Common : { - SideEffects #ItemsChanges : { - SourceEntities : [Items], - TargetProperties : ['total'] - }, - SideEffects #CurrencyChanges : { - SourceProperties : [currency_code], - TargetEntities : [currency] - }, - SideEffects #AddressChanges : { - SourceProperties : [shippingAddress_ID], - TargetEntities : [shippingAddress] - } - } -) { - createdAt @UI.HiddenFilter : false; - createdBy @UI.HiddenFilter : false; - total - @Common.FieldControl : #ReadOnly - @Measures.ISOCurrency : currency.code; //Bind the currency field to the amount field -//In all services we always find currency as the code and not as an object that contains a property code -//it seems to work but at least to me this is unconventional modeling. -}; - -//The enity types name is AdminService.my_bookshop_OrderItems -//The annotations below are not generated in edmx WHY? -annotate AdminService.OrderItems with @( - UI : { - HeaderInfo : { - TypeName : '{i18n>OrderItem}', - TypeNamePlural : '{i18n>OrderItems}', - Title : {Value : book.title}, - Description : {Value : book.descr} - }, - // There is no filterbar for items so the selctionfileds is not needed - SelectionFields : [book_ID], - //////////////////////////////////////////////////////////////////////////// - // - // Lists of OrderItems - // - LineItem : [ - { - Value : book_ID, - Label : '{i18n>Books}' - }, - { - Value : quantity, - Label : '{i18n>Quantity}' - }, - { - Value : amount, - Label : '{i18n>Amount}' - } - ], - Identification : [ //Is the main field group - //{Value: ID, Label:'{i18n>ID}'}, //A guid shouldn't be on the UI - { - Value : book_ID, - Label : '{i18n>Book}' - }, - { - Value : quantity, - Label : '{i18n>Quantity}' - }, - { - Value : amount, - Label : '{i18n>Amount}' - } - ], - Facets : [{ - $Type : 'UI.ReferenceFacet', - Label : '{i18n>OrderItem}', - Target : '@UI.Identification' - }, ], - }, - Common : { - SideEffects #AmountChanges : { - SourceProperties : [quantity], - TargetProperties : ['amount'] - }, - SideEffects #BookChanges : { - SourceProperties : [book_ID], - TargetEntities : [book], - TargetProperties : ['amount'] - } - } -) { - amount - @Common.FieldControl : #ReadOnly; -//ERROR ALERT: The following line refering to the parents currency code will lead to a server error -//@Measures.ISOCurrency:parent.currency.code; //Bind the currency field to the quantity field of the parent -}; diff --git a/app/orders/package.json b/app/orders/package.json deleted file mode 100644 index eecfe0e9..00000000 --- a/app/orders/package.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "name": "orders", - "version": "1.0.0", - "description": "", - "main": "index.js", - "scripts": { - "test": "echo \"Error: no test specified\" && exit 1" - }, - "keywords": [], - "author": "", - "license": "ISC" -} diff --git a/app/orders/webapp/Component.js b/app/orders/webapp/Component.js deleted file mode 100644 index 2417b681..00000000 --- a/app/orders/webapp/Component.js +++ /dev/null @@ -1,3 +0,0 @@ -sap.ui.define(["sap/fe/core/AppComponent"], ac => ac.extend("orders.Component", { - metadata:{ manifest:'json' } -})) diff --git a/app/orders/webapp/i18n/i18n.properties b/app/orders/webapp/i18n/i18n.properties deleted file mode 100644 index 441b619d..00000000 --- a/app/orders/webapp/i18n/i18n.properties +++ /dev/null @@ -1,2 +0,0 @@ -appTitle=Manage Orders -appDescription=Manage Orders - Sample Application diff --git a/app/orders/webapp/i18n/i18n_de.properties b/app/orders/webapp/i18n/i18n_de.properties deleted file mode 100644 index df522267..00000000 --- a/app/orders/webapp/i18n/i18n_de.properties +++ /dev/null @@ -1,2 +0,0 @@ -appTitle=Administriere Bestellungen -appDescription=Administriere Bestellungen - Beispielanwendung diff --git a/app/orders/webapp/index.html b/app/orders/webapp/index.html deleted file mode 100644 index 1b3b7355..00000000 --- a/app/orders/webapp/index.html +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - - Manage Orders - - - - -
- - \ No newline at end of file diff --git a/app/orders/webapp/manifest.json b/app/orders/webapp/manifest.json deleted file mode 100644 index 758e31f2..00000000 --- a/app/orders/webapp/manifest.json +++ /dev/null @@ -1,184 +0,0 @@ -{ - "_version": "1.8.0", - "sap.app": { - "id": "orders", - "type": "application", - "title": "{{appTitle}}", - "description": "{{appDescription}}", - "applicationVersion": { - "version": "1.0.0" - }, - "dataSources": { - "AdminService": { - "uri": "/api/admin/", - "type": "OData", - "settings": { - "odataVersion": "4.0" - } - } - }, - "-sourceTemplate": { - "id": "ui5template.basicSAPUI5ApplicationProject", - "-id": "ui5template.smartTemplate", - "-version": "1.40.12" - }, - "crossNavigation": { - "inbounds": { - "Orders-manage": { - "signature": { - "parameters": {}, - "additionalParameters": "allowed" - }, - "semanticObject": "Orders", - "action": "manage" - } - } - } - }, - "sap.ui5": { - "dependencies": { - "libs": { - "sap.fe.templates": {} - } - }, - "models": { - "i18n": { - "type": "sap.ui.model.resource.ResourceModel", - "uri": "i18n/i18n.properties" - }, - "": { - "dataSource": "AdminService", - "settings": { - "synchronizationMode": "None", - "operationMode": "Server", - "autoExpandSelect" : true, - "earlyRequests": true, - "groupProperties": { - "default": { - "submit": "Auto" - } - } - } - } - }, - "routing": { - "routes": [ - { - "pattern": ":?query:", - "name": "OrdersList", - "target": "OrdersList" - }, - { - "pattern": "Orders({key}):?query:", - "name": "OrdersDetails", - "target": "OrdersDetails" - }, - { - "pattern": "Orders({boo})/Items({boo2}):?query:", - "name": "OrderItemsDetails", - "target": "OrderItemsDetails" - }, - { - "pattern": "Books({key}):?query:", - "name": "BooksDetails", - "target": "BooksDetails" - } - ], - "targets": { - "OrdersList": { - "type": "Component", - "id": "OrdersList", - "name": "sap.fe.templates.ListReport", - "options": { - "settings" : { - "entitySet" : "Orders", - "navigation" : { - "Orders" : { - "detail" : { - "route" : "OrdersDetails" - } - } - } - } - } - }, - "OrdersDetails": { - "type": "Component", - "id": "OrdersDetails", - "name": "sap.fe.templates.ObjectPage", - "options": { - "settings" : { - "entitySet": "Orders", - "navigation" : { - "Items": { - "detail": { - "route": "OrderItemsDetails" - } - }, - "book": { - "detail": { - "route": "BooksDetails" - } - }, - "dummy": { - "detail": { - "route": "BooksDetails" - } - } - } - } - } - }, - "OrderItemsDetails": { - "type": "Component", - "id": "OrderItemsDetails", - "name": "sap.fe.templates.ObjectPage", - "options": { - "settings" : { - "entitySet": "OrderItems" - } - } - }, - "BooksDetails": { - "type": "Component", - "id": "BooksDetails", - "name": "sap.fe.templates.ObjectPage", - "options": { - "settings" : { - "entitySet": "Books", - "navigation": { - "author": { - "detail": { - "route": "AuthorsDetails" - } - } - } - } - } - }, - "AuthorsDetails": { - "type": "Component", - "id": "AuthorsDetails", - "name": "sap.fe.templates.ObjectPage", - "options": { - "settings" : { - "entitySet": "Authors" - } - } - } - } - }, - "contentDensities": { - "compact": true, - "cozy": true - } - }, - "sap.ui": { - "technology": "UI5", - "fullWidth": false - }, - "sap.fiori": { - "registrationIds": [], - "archeType": "transactional" - } -} diff --git a/app/reviews/fiori-service.cds b/app/reviews/fiori-service.cds deleted file mode 100644 index ee77c5c4..00000000 --- a/app/reviews/fiori-service.cds +++ /dev/null @@ -1,90 +0,0 @@ -/* - Annotations for the Browse Books App -*/ - -using ReviewService from '../../srv/review-service'; - -annotate ReviewService.Reviews with @(UI : { - HeaderInfo : { - TypeName : '{i18n>Review}', - TypeNamePlural : '{i18n>Reviews}', - Title : {Value : title}, - Description : {Value : createdBy}, - }, - PresentationVariant : { - Text : 'Default', - SortOrder : [{ - Property : modifiedAt, - Descending : true - }], - Visualizations : ['@UI.LineItem'] - }, - SelectionFields : [ - book_ID, - rating - ], - HeaderFacets : [{ - $Type : 'UI.ReferenceFacet', - Target : '@UI.DataPoint#rating' - }, ], - Facets : [ - { - $Type : 'UI.ReferenceFacet', - Target : '@UI.FieldGroup#General', - Label : '{i18n>General}' - }, - { - $Type : 'UI.ReferenceFacet', - Target : '@UI.FieldGroup#Review', - Label : '{i18n>Review}', - } - ], - FieldGroup #General : {Data : [ - { - Value : createdAt, - Label : '{i18n>Created}' - }, - { - Value : createdBy, - Label : '{i18n>CreatedBy}' - }, - { - Value : modifiedAt, - Label : '{i18n>Modified}' - }, - { - Value : modifiedBy, - Label : '{i18n>ModifiedBy}' - }, - {Value : book_ID}, - ]}, - FieldGroup #Review : {Data : [ - { - Value : rating, - Label : '{i18n>Rating}' - }, - { - Value : title, - Label : '{i18n>Title}' - }, - { - Value : text, - Label : '{i18n>Text}' - } - ]}, - FieldGroup #BookAndAuthor : {Data : [ - {Value : book.title}, - {Value : book.author.name} - ]}, - DataPoint #rating : { - Title : '{i18n>Rating}', - Value : rating, - Visualization : #Rating, - MinimumValue : 0, - MaximumValue : 5 - } -}) { - rating @title : '{i18n>Rating}'; - title @title : '{i18n>Title}'; - text @title : '{i18n>Text}' @UI.MultiLineText; -}; diff --git a/app/reviews/package.json b/app/reviews/package.json deleted file mode 100644 index 22ad679d..00000000 --- a/app/reviews/package.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "name": "reviews", - "version": "1.0.0", - "description": "", - "main": "index.js", - "scripts": { - "test": "echo \"Error: no test specified\" && exit 1" - }, - "keywords": [], - "author": "", - "license": "ISC" -} diff --git a/app/reviews/webapp/Component.js b/app/reviews/webapp/Component.js deleted file mode 100644 index 4140a28e..00000000 --- a/app/reviews/webapp/Component.js +++ /dev/null @@ -1,3 +0,0 @@ -sap.ui.define(["sap/fe/core/AppComponent"], ac => ac.extend("reviews.Component", { - metadata:{ manifest:'json' } -})) diff --git a/app/reviews/webapp/i18n/i18n.properties b/app/reviews/webapp/i18n/i18n.properties deleted file mode 100644 index 9aadf3e7..00000000 --- a/app/reviews/webapp/i18n/i18n.properties +++ /dev/null @@ -1,2 +0,0 @@ -appTitle=Manage Reviews -appDescription=Manage Reviews - Sample Application diff --git a/app/reviews/webapp/i18n/i18n_de.properties b/app/reviews/webapp/i18n/i18n_de.properties deleted file mode 100644 index 1cc53e4c..00000000 --- a/app/reviews/webapp/i18n/i18n_de.properties +++ /dev/null @@ -1,2 +0,0 @@ -appTitle=Administriere Reviews -appDescription=Administriere Reviews - Beispielanwendung diff --git a/app/reviews/webapp/index.html b/app/reviews/webapp/index.html deleted file mode 100644 index d2215894..00000000 --- a/app/reviews/webapp/index.html +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - - Manage Reviews - - - - -
- - \ No newline at end of file diff --git a/app/reviews/webapp/manifest.json b/app/reviews/webapp/manifest.json deleted file mode 100644 index 78dd8f8c..00000000 --- a/app/reviews/webapp/manifest.json +++ /dev/null @@ -1,142 +0,0 @@ -{ - "_version": "1.8.0", - "sap.app": { - "id": "reviews", - "type": "application", - "title": "{{appTitle}}", - "description": "{{appDescription}}", - "applicationVersion": { - "version": "1.0.0" - }, - "dataSources": { - "ReviewService": { - "uri": "/api/review/", - "type": "OData", - "settings": { - "odataVersion": "4.0" - } - } - }, - "-sourceTemplate": { - "id": "ui5template.basicSAPUI5ApplicationProject", - "-id": "ui5template.smartTemplate", - "-version": "1.40.12" - }, - "crossNavigation": { - "inbounds": { - "Reviews-manage": { - "signature": { - "parameters": {}, - "additionalParameters": "allowed" - }, - "semanticObject": "Reviews", - "action": "manage" - } - } - } - }, - "sap.ui5": { - "dependencies": { - "libs": { - "sap.fe.templates": {} - } - }, - "models": { - "i18n": { - "type": "sap.ui.model.resource.ResourceModel", - "uri": "i18n/i18n.properties" - }, - "": { - "dataSource": "ReviewService", - "settings": { - "synchronizationMode": "None", - "operationMode": "Server", - "autoExpandSelect" : true, - "earlyRequests": true, - "groupProperties": { - "default": { - "submit": "Auto" - } - } - } - } - }, - "routing": { - "routes": [ - { - "pattern": ":?query:", - "name": "ReviewsList", - "target": "ReviewsList" - }, - { - "pattern": "Reviews({key}):?query:", - "name": "ReviewsDetails", - "target": "ReviewsDetails" - }, - { - "pattern": "Reviews({key}/book({key2}):?query:", - "name": "BooksDetails", - "target": "BooksDetails" - } - ], - "targets": { - "ReviewsList": { - "type": "Component", - "id": "ReviewsList", - "name": "sap.fe.templates.ListReport", - "options": { - "settings" : { - "entitySet" : "Reviews", - "navigation" : { - "Reviews" : { - "detail" : { - "route" : "ReviewsDetails" - } - } - } - } - } - }, - "ReviewsDetails": { - "type": "Component", - "id": "ReviewsDetails", - "name": "sap.fe.templates.ObjectPage", - "options": { - "settings" : { - "entitySet" : "Reviews", - "navigation" : { - "Books" : { - "detail" : { - "route" : "BooksDetails" - } - } - } - } - } - }, - "BooksDetails": { - "type": "Component", - "id": "BooksDetails", - "name": "sap.fe.templates.ObjectPage", - "options": { - "settings" : { - "entitySet" : "Books" - } - } - } - } - }, - "contentDensities": { - "compact": true, - "cozy": true - } - }, - "sap.ui": { - "technology": "UI5", - "fullWidth": false - }, - "sap.fiori": { - "registrationIds": [], - "archeType": "transactional" - } -} diff --git a/app/vue/app.js b/app/vue/app.js deleted file mode 100644 index 8b4a6f05..00000000 --- a/app/vue/app.js +++ /dev/null @@ -1,122 +0,0 @@ -/* global Vue axios */ //> from index.html -const $ = (sel) => document.querySelector(sel); - -const httpClient = axios.create({ - withCredentials: true, -}); - -// adding csrf token to request headers -axios - .head("/api/browse", { - headers: { - "X-CSRF-Token": "Fetch", - "X-Requested-With": "XMLHttpRequest", - }, - }) - .then((res) => { - xcsrfToken = res.headers["x-csrf-token"]; - httpClient.defaults.headers.common["X-CSRF-Token"] = xcsrfToken; - }); - -const GET = (url) => httpClient.get("/api/browse" + url); -const POST = (cmd, data) => httpClient.post("/api/browse" + cmd, data); - -const bookshop = new Vue({ - el: "#app", - - data: { - books: [], - reviews: [], - book: undefined, - review: undefined, - order: { quantity: 1, succeeded: "", failed: "" }, - message: {}, - Ratings: Object.entries({ - 5: "★★★★★", - 4: "★★★★", - 3: "★★★", - 2: "★★", - 1: "★", - }).reverse(), - }, - - methods: { - searchBooks: ({ target: { value: v } }) => - bookshop.fetchBooks(v && "&$search=" + v), - - searchReviews: ({ target: { value: v } }) => - bookshop.fetchReviews(v && "?$search=" + v), - - async fetchBooks(etc = "") { - const { data } = await GET(`/Books?$expand=author,genre,currency${etc}`); - bookshop.books = data.value; - }, - - async fetchReviews(etc = "") { - const { data } = await GET( - `/Books(ID=${bookshop.book.ID})/reviews${etc}` - ); - bookshop.reviews = data.value; - }, - - async inspectBook(eve) { - const book = (bookshop.book = - bookshop.books[eve.currentTarget.rowIndex - 1]); - const res = await GET( - `/Books(ID=${book.ID})?$expand=reviews&$select=descr,stock` - ); - Object.assign(book, res.data); - bookshop.order = { quantity: 1 }; - bookshop.reviews = book.reviews; - setTimeout(() => $("form > input").focus(), 111); - }, - - async submitOrder() { - const { book, order } = bookshop, - quantity = parseInt(bookshop.order.quantity) || 1; // REVISIT: Okra should be less strict - try { - const res = await POST(`/submitOrder`, { quantity, book: book.ID }); - book.stock = res.data.stock; - bookshop.order = { - quantity, - succeeded: `Successfully ordered ${quantity} item(s).`, - }; - } catch (e) { - bookshop.order = { quantity, failed: e.response.data.error.message }; - } - }, - - async inspectReview(eve) { - bookshop.review = bookshop.reviews[eve.currentTarget.rowIndex - 1]; - }, - - newReview() { - bookshop.review = {}; - bookshop.message = {}; - }, - - async submitReview() { - const review = bookshop.review; - review.rating = parseInt(review.rating); // REVISIT: Okra should be less strict - const payload = { - rating: review.rating, - title: review.title, - text: review.text, - }; - try { - await POST( - `/Books(ID=${bookshop.book.ID})/CatalogService.addReview`, - payload - ); - bookshop.message = { - succeeded: "Your review was submitted successfully. Thanks.", - }; - } catch (e) { - bookshop.message = { failed: e.response.data.error.message }; - } - }, - }, -}); - -// initially fill list of books -bookshop.fetchBooks(); diff --git a/app/vue/index.html b/app/vue/index.html deleted file mode 100644 index f103c836..00000000 --- a/app/vue/index.html +++ /dev/null @@ -1,104 +0,0 @@ - - - - - Capire Bookshop - - - - - - - -
- -

{{ document.title }}

- - - - - - - - - - - - - - - - - - -
Book Author Genre Rating Price
{{ book.title }}{{ book.author.name }}{{ book.genre.name }} - {{ ('★'.repeat(Math.round(book.rating))+'☆☆☆☆☆').slice(0,5) }} - {{ book.currency && book.currency.symbol }} {{ book.price }}
- -
- -
- - -
-

{{ book.title }}

-

{{ book.descr }}

- -

Reviews

- - - - - - - - - - - - - - - - -
Date User Rating Title
{{ review.modifiedAt | datetime }}{{ review.createdBy }} - {{ ('★'.repeat(Math.round(review.rating))+'☆☆☆☆☆').slice(0,5) }} - {{ review.title }}
- - - -
- - - - - {{ message.succeeded }} - {{ message.failed }} -
-
- ( click on a row to see details... ) -
- -
-
- ( click on a row to see details... ) -
- -
- - - - - diff --git a/app/xs-app.json b/app/xs-app.json index f6adf5a4..bd045856 100644 --- a/app/xs-app.json +++ b/app/xs-app.json @@ -24,31 +24,6 @@ "localDir": "./", "authenticationType": "xsuaa" }, - { - "source": "^/orders/webapp/(.*)$", - "localDir": "./", - "authenticationType": "xsuaa" - }, - { - "source": "^/reviews/webapp/(.*)$", - "localDir": "./", - "authenticationType": "xsuaa" - }, - { - "source": "^/notes/webapp/(.*)$", - "localDir": "./", - "authenticationType": "xsuaa" - }, - { - "source": "^/addresses/webapp/(.*)$", - "localDir": "./", - "authenticationType": "xsuaa" - }, - { - "source": "^/vue/(.*)$", - "localDir": "./", - "authenticationType": "xsuaa" - }, { "source": "^/api/admin/(.*)", "authenticationType": "xsuaa", diff --git a/assets/books.csv b/assets/books.csv deleted file mode 100644 index cf08555d..00000000 --- a/assets/books.csv +++ /dev/null @@ -1,6 +0,0 @@ -ID;TITLE;DESCR;AUTHOR_ID;STOCK;PRICE;CURRENCY_CODE;GENRE_ID;RATING -8f45cc39-df65-4790-a63f-634e151da734;Pride and Prejudice;It is a truth universally acknowledged that when most people think of Jane Austen they think of this charming and humorous story of love, difficult families and the tricky task of finding a handsome husband with a good fortune.;b834ddb0-613a-4edf-8d47-7d80989e1325;111;20;GBP;15; -3f09036d-3a1a-4eaf-91e2-5aa6f50dcfe0;To Kill a Mockingbird;A novel before its time, Harper Lee’s Pulitzer-prize winner addresses issues of race, inequality and segregation with both levity and compassion. Told through the eyes of loveable rogues Scout and Jem, it also created one of literature’s most beloved heroes – Atticus Finch, a man determined to right the racial wrongs of the Deep South.;b22f5293-7eea-49bb-9ee7-17c5de81f1df;33;7.99;GBP;11; -21c12f7b-089b-42da-8416-d5f67606f939;The Great Gatsby;Jay Gatsby, the enigmatic millionaire who throws decadent parties but doesn’t attend them, is one of the great characters of American literature. This is F. Scott Fitzgerald at his most sparkling and devastating.;a57f75fa-2bda-47b5-ab4d-b644570f29cd;444;6.99;GBP;10; -c49c354e-8c18-4022-804c-78025b529fb1;One Hundred Years of Solitude;Gabriel García Márquez’s multi-generational spanning magnum opus was a landmark in Spanish literature.;1d2ec887-cbf1-491e-943e-33a2b4f39a6f;55;8.99;GBP;10; -0c1ffc7e-734e-4c1d-ba87-3a032ad8a5a0;In Cold Blood;The ‘true crime’ TV show / podcast you’re obsessed with probably owes a debt to this masterpiece of reportage by Truman Capote. Chilling and brilliant.;c0526b1a-9a75-4a43-9133-163325cbbd2b;66;9.99;GBP;16; diff --git a/assets/readmeImages/BookPage.png b/assets/readmeImages/BookPage.png deleted file mode 100644 index 41fd37a7..00000000 Binary files a/assets/readmeImages/BookPage.png and /dev/null differ diff --git a/assets/readmeImages/FioriHome.png b/assets/readmeImages/FioriHome.png deleted file mode 100644 index 6bfbe2b1..00000000 Binary files a/assets/readmeImages/FioriHome.png and /dev/null differ diff --git a/assets/readmeImages/core-concepts.png b/assets/readmeImages/core-concepts.png deleted file mode 100644 index 286989fc..00000000 Binary files a/assets/readmeImages/core-concepts.png and /dev/null differ diff --git a/db/common.cds b/db/common.cds deleted file mode 100644 index a1c0cd80..00000000 --- a/db/common.cds +++ /dev/null @@ -1,10 +0,0 @@ -namespace my.bookshop; - -//////////////////////////////////////////////////////////////////////////// -// -// Commmon Types -// -type TechnicalBooleanFlag : Boolean @( - UI.Hidden, - Core.Computed -); diff --git a/db/data/API_BUSINESS_PARTNER-A_BusinessPartnerAddress.csv b/db/data/API_BUSINESS_PARTNER-A_BusinessPartnerAddress.csv deleted file mode 100644 index 0e0ab64c..00000000 --- a/db/data/API_BUSINESS_PARTNER-A_BusinessPartnerAddress.csv +++ /dev/null @@ -1,6 +0,0 @@ -AddressID;BusinessPartner;Country;CityName;PostalCode;StreetName;HouseNumber -100;10401010;DE;Walldorf;68199;Dietmar-Hopp-Allee;16 -200;10401010;DE;St.Leon-Rot;68789;SAP-Allee;29 -300;10401010;DE;Potsdam;14469;Konrad-Zuse-Ring;10 -400;1000020;US;Newtown Square;19073;West Chester Pike;3999 -500;1000020;US;Palo Alto;94304;Hillview Avenue;3410 diff --git a/db/data/my.bookshop-Notes.csv b/db/data/my.bookshop-Notes.csv deleted file mode 100644 index c5a06979..00000000 --- a/db/data/my.bookshop-Notes.csv +++ /dev/null @@ -1,4 +0,0 @@ -ID,note,address_businessPartner,address_ID -83e2643b-aecc-47d3-9f85-a8ba14eff07d,Packages can be dropped off at the reception,10401010,100 -880147b0-8d2d-4ef8-bb52-ae5ae6002fc5,Don't deliver packages after 5pm,10401010,100 -5efc842c-c70d-4ee2-af1d-81c7d257aff7,Ring at building 8,1000020,500 diff --git a/db/data/my.bookshop-OrderItems.csv b/db/data/my.bookshop-OrderItems.csv deleted file mode 100644 index b13f3b2e..00000000 --- a/db/data/my.bookshop-OrderItems.csv +++ /dev/null @@ -1,4 +0,0 @@ -ID;QUANTITY;PARENT_ID;BOOK_ID;AMOUNT -58040e66-1dcd-4ffb-ab10-fdce32028b79;1;7e2f2640-6866-4dcf-8f4d-3027aa831cad;f846b0b9-01d4-4f6d-82a4-d79204f62278;11.11 -64e718c9-ff99-47f1-8ca3-950c850777d4;1;7e2f2640-6866-4dcf-8f4d-3027aa831cad;4a519e61-3c3a-4bd9-ab12-d7e0c5329933;15 -e9641166-e050-4261-bfee-d1e797e6cb7f;2;64e718c9-ff99-47f1-8ca3-950c850777d4;aebdfc8a-0dfa-4468-bd36-48aabd65e663;28 \ No newline at end of file diff --git a/db/data/my.bookshop-Orders.csv b/db/data/my.bookshop-Orders.csv deleted file mode 100644 index 3439fcfb..00000000 --- a/db/data/my.bookshop-Orders.csv +++ /dev/null @@ -1,3 +0,0 @@ -ID;CREATEDBY;ORDERNO;CURRENCY_CODE -7e2f2640-6866-4dcf-8f4d-3027aa831cad;john.doe@test.com;1;EUR -64e718c9-ff99-47f1-8ca3-950c850777d4;jane.doe@test.com;2;EUR diff --git a/db/data/my.bookshop-Reviews.csv b/db/data/my.bookshop-Reviews.csv deleted file mode 100644 index 679dcdd5..00000000 --- a/db/data/my.bookshop-Reviews.csv +++ /dev/null @@ -1,25 +0,0 @@ -MODIFIEDAT;CREATEDAT;BOOK_ID;RATING;TEXT;TITLE;CREATEDBY;ID -2019-11-26T03:29:46.178Z;2019-11-26T03:29:46.178Z;f846b0b9-01d4-4f6d-82a4-d79204f62278;1;So expensive. ...you can buy the same product for less money :( It broke after 1 day. Poor Quality. Called customer service..no answer. I'd expect a little more durability. I'm a dummy for not throwing all in the trash.;Just crazy! Don't buy it, PLEASE!;roman.zamora@test.sap.com;8089768a-14ae-3cd0-807e-c77ceab8f91e -2019-03-18T17:51:25.128Z;2019-03-18T17:51:25.128Z;f846b0b9-01d4-4f6d-82a4-d79204f62278;3;Lower quality than expected. Would buy a better quality next time. Works fine, but it is fragile.... For a straight up purchase not a bad choice. Does not look the same as the picture provided...which was disappointing, but ok. Packaging is not the same as getting it from the website. Everything's working like it should. Quite ok -- nothing extraordinary, though.;Exactly what I expected;minnie.biddle@test.sap.com;8098ea0a-e4b9-3265-9a21-95758a1e49e0 -2019-09-10T11:57:14.747Z;2019-09-10T11:57:14.747Z;f846b0b9-01d4-4f6d-82a4-d79204f62278;5;Can't relate to the bad reviews I saw, I definitely like it. This product is incredible awesome! Perfect for my needs. Wow, wow, wow. Speachless! This product has changed my life.;Highly recommended!;howard.pitts@test.sap.com;80a31701-4c04-3107-a50e-7a2ead69e421 -2018-09-20T06:33:01.940Z;2018-09-20T06:33:01.940Z;f846b0b9-01d4-4f6d-82a4-d79204f62278;5;Overall I am extremely pleased with it.;Great Product;frank.birdwell@test.sap.com;80b4a989-ca48-3b62-bc10-3545412152f8 -2019-11-15T19:56:56.923Z;2019-11-15T19:56:56.923Z;f846b0b9-01d4-4f6d-82a4-d79204f62278;1;Why is this even available here? We were able to return it for a full refund. I have to say that I'm quite disappointed. I'm a dummy for not throwing all in the trash. Too expensive for what I received. Not recommending to anyone. Very cheap. I don't recommend and will not purchase this brand again. I'm actually really surprised by the positive reviews, which I relied on when ordering.;Don't consider...;tyler.liu@test.sap.com;80d832ed-54c7-3296-bcb9-8a377af1639e -2019-03-06T12:37:07.494Z;2019-03-06T12:37:07.494Z;9b084139-0b1e-43b6-b12a-7b3669d75f02;1;Reading these reviews, I really had to wonder if I had bought the same product. Didn't work, that is why I cannot recommend this product. We were able to return it for a full refund. I'm a dummy for not throwing all in the trash. Not recommending to anyone. Very cheap. No instructions included for use or installation. The Worst I have ever seen!;Overrated and overpriced;latonya.nash@test.sap.com;80db5094-4fab-34cb-882a-84514eedd58f -2020-03-19T09:23:29.028Z;2020-03-19T09:23:29.028Z;9b084139-0b1e-43b6-b12a-7b3669d75f02;2;Works as advertised. Not good, not bad. Works fine, but it is fragile.... I would recommend this item to anyone who wants it. Not bad for the price I suppose. Does not look the same as the picture provided...which was disappointing, but ok. Material seems a bit cheaper than I had expected. It's okay. Nothing special to mention on this one.;Cheaply made, not so cheap price.;phillip.smart@test.sap.com;80db9105-b865-312e-acf8-ec42d9bff2cf -2019-05-04T13:59:10.057Z;2019-05-04T13:59:10.057Z;9b084139-0b1e-43b6-b12a-7b3669d75f02;5;Can't relate to the bad reviews I saw, I definitely like it. I do really love this product and think it's a good buy. I love it so much. It looks beautiful and modern. Never saw a quality like that before. Sleek product! A great purchase, thank you! I was surprised how nice this product really looks. Overall I am extremely pleased with it.;Perfect choice!;dona.lawrence@test.sap.com;814f6f8a-94a1-3f05-87f6-74c186536efe -2019-11-24T10:16:53.266Z;2019-11-24T10:16:53.266Z;9b084139-0b1e-43b6-b12a-7b3669d75f02;5;Excellent engineering and the feeling of a very high quality product. I love it so much. I do really love this product and think it's a good buy. Unique and beautiful. Excellent quality. Great service. I would buy this product again, if I ever need too, big smile. Not expensive for the quality. Why didn't I buy these sooner? Such a cool Design! That was a good choice, would definitely pick it again.;Nice Product!;dustin.park@test.sap.com;81718a76-0ecd-3aa1-97b8-c04df011aa16 -2019-06-13T18:24:50.994Z;2019-06-13T18:24:50.994Z;9b084139-0b1e-43b6-b12a-7b3669d75f02;1;Too expensive for what I received. Not recommending to anyone. Very cheap. This is a role model for annoying a customer.;Not Suggested;phillip.brewer@test.sap.com;8186e063-0e1c-3310-9313-451bcef5f1f6 -2018-08-11T10:49:14.710Z;2018-08-11T10:49:14.710Z;51061ce3-ddde-4d70-a2dc-6314afbcc73e;5;Fantastic, I'm totally blown away. After using that product my business skyrocketed! Why didn't I buy these sooner? Such a cool Design! Everyone in my big family has one now - both adults, four teen and one middle schooler. It's convienent for me.;Love this brand!;rita.spencer@test.sap.com;819b6821-3482-3fd5-963b-ea9361d60986 -2020-11-07T07:45:10.731Z;2020-11-07T07:45:10.731Z;51061ce3-ddde-4d70-a2dc-6314afbcc73e;2;Haven't seen good alternatives, so I picked this one. Would buy a better quality next time. It does it's job. For a straight up purchase not a bad choice. I would recommend this item to anyone who wants it. Quite ok -- nothing extraordinary, though.;Well...;kelly.zheng@test.sap.com;819da75a-2d12-3167-86bf-8987f82d7c12 -2020-01-12T22:01:00.127Z;2020-01-12T22:01:00.127Z;51061ce3-ddde-4d70-a2dc-6314afbcc73e;1;It is fatally flawed and should be avoided. Nice looking product, but never worked well. I'm a dummy for not throwing all in the trash.;It's just ok;jay.townsend@test.sap.com;81aaf7f7-e6cf-3650-9b9f-660588e2ca38 -2020-06-20T05:07:17.150Z;2020-06-20T05:07:17.150Z;51061ce3-ddde-4d70-a2dc-6314afbcc73e;5;Does what it should, so definitely deserves a good rating. Definitely worth the investment. Unique and beautiful. Excellent quality. Great service. A great purchase, thank you! They hold up and last a very long time. Great quality and exactly what was described. I looked around quite a bit before deciding to try this and it fulfills all that I wanted. That was a good choice, would definitely pick it again.;Great Product;lawrence.harp@test.sap.com;81d030d3-90ba-3bd1-bef8-0347d990bcdf -2018-09-25T13:54:52.786Z;2018-09-25T13:54:52.786Z;51061ce3-ddde-4d70-a2dc-6314afbcc73e;1;I should have read the reviews that warned about how short, or small, this product is. I'd expect a little more durability. Lower quality than expected. I don't recommend and will not purchase this brand again. I'm actually really surprised by the positive reviews, which I relied on when ordering. Didn't receive what the picture looked like. This is a role model for annoying a customer.;Don't buy;eddie.hart@test.sap.com;81d1152c-acbb-3fa1-abbc-66397150f2eb -2018-09-19T17:30:31.927Z;2018-09-19T17:30:31.927Z;aebdfc8a-0dfa-4468-bd36-48aabd65e663;2;Go for it, not really bad at all. Works as advertised. I would recommend this item to anyone who wants it. It serves the intended purpose.;Ok, but has a few issues;stephen.bratten@test.sap.com;81ea3917-8374-38b2-897d-000ced6c10db -2020-09-07T16:28:48.032Z;2020-09-07T16:28:48.032Z;aebdfc8a-0dfa-4468-bd36-48aabd65e663;1;Called customer service..no answer. Horrible! Unsatisfied in every way! No instructions included for use or installation.;Please don't;karrie.lawrence@test.sap.com;81f015f4-59c2-33ef-8d2e-d77692e7ce8e -2018-05-21T22:58:40.021Z;2018-05-21T22:58:40.021Z;aebdfc8a-0dfa-4468-bd36-48aabd65e663;1;So expensive. ...you can buy the same product for less money :( The description is wrong. I sent it back. Looks better than it works. Horrible! Unsatisfied in every way! Lower quality than expected. This is a role model for annoying a customer.;Useless;abbie.banes@test.sap.com;81fa4a9e-4071-3c74-a07e-8bae2ca88168 -2018-12-01T14:29:03.340Z;2018-12-01T14:29:03.340Z;aebdfc8a-0dfa-4468-bd36-48aabd65e663;5;I love it so much. Unique and beautiful. Excellent quality. Great service. I was surprised how nice this product really looks.;You need this!;marshall.alexander@test.sap.com;82011880-e1aa-3019-8899-dee0647d2be8 -2020-03-07T06:46:29.181Z;2020-03-07T06:46:29.181Z;aebdfc8a-0dfa-4468-bd36-48aabd65e663;1;Didn't work, that is why I cannot recommend this product. I'd expect a little more durability.;I don't recommend and will not purchase this brand again;kay.steinberg@test.sap.com;8216ead4-3292-38e6-a53f-ecf0555bc9f2 -2018-08-22T00:11:59.829Z;2018-08-22T00:11:59.829Z;4a519e61-3c3a-4bd9-ab12-d7e0c5329933;5;Definitely worth the investment. Does what it should, so definitely deserves a good rating. The good things are still available, this is the proof! This is great! Unique and beautiful. Excellent quality. Great service. They hold up and last a very long time. It's convienent for me. That was a good choice, would definitely pick it again.;Good value;isabelle.wong@test.sap.com;823e509b-8565-3a12-8cbb-2af042e5e509 -2018-08-19T16:11:20.884Z;2018-08-19T16:11:20.884Z;4a519e61-3c3a-4bd9-ab12-d7e0c5329933;1;Nice looking product, but never worked well. I'd expect a little more durability. Lower quality than expected.;Don't buy;tracy.zhang@test.sap.com;827ebe9b-b6d0-36ea-a3dc-3ca50bc4809b -2020-06-28T10:00:33.344Z;2020-06-28T10:00:33.344Z;4a519e61-3c3a-4bd9-ab12-d7e0c5329933;2;I didn't bother to return it but will not be purchasing this again. If you're looking for something durable and heavy-duty I would not recommend this one. It does it's job. Works as advertised. Works fine, but it is fragile.... Does not look the same as the picture provided...which was disappointing, but ok. Quite ok -- nothing extraordinary, though.;Just regular general purpose;rodney.franklin@test.sap.com;82813174-e1f2-31f5-8b8c-1d044857979d -2020-11-07T03:11:14.727Z;2020-11-07T03:11:14.727Z;4a519e61-3c3a-4bd9-ab12-d7e0c5329933;5;Does what it should, so definitely deserves a good rating. Fantastic, I'm totally blown away. This is great! They hold up and last a very long time. Not expensive for the quality. Why didn't I buy these sooner? Such a cool Design! This product is incredible awesome! It's convienent for me. Wow, wow, wow. Speachless!;Good Value - Good Quality;phillip.smart@test.sap.com;8298deea-443c-372e-bba3-628b003f6845 \ No newline at end of file diff --git a/db/index.cds b/db/index.cds deleted file mode 100644 index 8d94253a..00000000 --- a/db/index.cds +++ /dev/null @@ -1,6 +0,0 @@ -using from './books'; -using from './orders'; -using from './reviews'; -using from './notes'; -using from './common'; -using from '@sap/cds/srv/outbox'; diff --git a/db/notes.cds b/db/notes.cds deleted file mode 100644 index 47d3687c..00000000 --- a/db/notes.cds +++ /dev/null @@ -1,7 +0,0 @@ -namespace my.bookshop; - -using { cuid } from '@sap/cds/common'; - -entity Notes: cuid { - note: String; -} diff --git a/db/orders.cds b/db/orders.cds deleted file mode 100644 index e09ef50b..00000000 --- a/db/orders.cds +++ /dev/null @@ -1,25 +0,0 @@ -namespace my.bookshop; - -using { - Currency, - User, - managed, - cuid -} from '@sap/cds/common'; -using my.bookshop.Books from './books'; - -entity Orders : cuid, managed { - OrderNo : String @title : '{i18n>OrderNumber}' @mandatory; //> readable key - Items : Composition of many OrderItems - on Items.parent = $self; - buyer : User; - total : Decimal(9, 2)@readonly; - currency : Currency; -} - -entity OrderItems : cuid { - parent : Association to Orders; - book : Association to Books @mandatory @assert.target; - quantity : Integer; - amount : Decimal(9, 2); -} diff --git a/db/package.json b/db/package.json deleted file mode 100644 index 5988fc9c..00000000 --- a/db/package.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "name": "deploy", - "dependencies": { - "@sap/hdi-deploy": "^4" - }, - "engines": { - "node": "^16" - }, - "scripts": { - "start": "node node_modules/@sap/hdi-deploy/deploy.js", - "build": "npm i && npx cds build .. --for hana --production" - } -} diff --git a/db/reviews.cds b/db/reviews.cds deleted file mode 100644 index 82392741..00000000 --- a/db/reviews.cds +++ /dev/null @@ -1,32 +0,0 @@ -namespace my.bookshop; - -using { - User, - managed, - cuid -} from '@sap/cds/common'; -using my.bookshop.Books from './books'; - -entity Reviews : cuid, managed { - @cds.odata.ValueList - book : Association to Books; - rating : Rating; - title : String(111); - text : String(1111); -} - -// input validation -annotate Reviews with { - subject @mandatory; - title @mandatory; - rating @assert.range; - book @mandatory @assert.target; -} - -type Rating : Integer enum { - Best = 5; - Good = 4; - Avg = 3; - Poor = 2; - Worst = 1; -} diff --git a/db/books.cds b/db/schema.cds similarity index 59% rename from db/books.cds rename to db/schema.cds index 5a1724fb..71484bfb 100644 --- a/db/books.cds +++ b/db/schema.cds @@ -6,8 +6,6 @@ using { managed, cuid } from '@sap/cds/common'; -using my.bookshop.Reviews from './reviews'; -using my.bookshop.TechnicalBooleanFlag from './common'; @fiori.draft.enabled entity Books : cuid, managed { @@ -19,13 +17,11 @@ entity Books : cuid, managed { price : Decimal(9, 2); currency : Currency; rating : Decimal(2, 1); - reviews : Association to many Reviews - on reviews.book = $self; - isReviewable : TechnicalBooleanFlag not null default true; + isbn : String(40); } entity Authors : cuid, managed { - @assert.format : '^\p{Lu}.*' // assert that name starts with a capital letter + @assert.format: '^\p{Lu}.*' // assert that name starts with a capital letter name : String(111); dateOfBirth : Date; dateOfDeath : Date; @@ -35,15 +31,6 @@ entity Authors : cuid, managed { on books.author = $self; } -// annotations for Data Privacy -annotate Authors with -@PersonalData : { DataSubjectRole : 'Author', EntitySemantics : 'DataSubject' } -@AuditLog.Operation : { Read : true, Insert : true, Update : true, Delete : true } -{ - ID @PersonalData.FieldSemantics : 'DataSubjectID'; - name @PersonalData.IsPotentiallySensitive; -} - /** * Hierarchically organized Code List for Genres */ diff --git a/fts/isbn/schema.cds b/fts/isbn/schema.cds deleted file mode 100644 index abc3702a..00000000 --- a/fts/isbn/schema.cds +++ /dev/null @@ -1,31 +0,0 @@ -using {CatalogService} from '../../app/browse/fiori-service'; -using {my.bookshop as my} from '../../db/index'; - - -// domain model - -extend my.Books with { - isbn : String(40); -} - -// Feature 'isbn' will display ISBN in table and on object page -annotate CatalogService.Books with @(UI: { - FieldGroup #General: {Data: [ - ...up to - {Value: title}, - { - Value: isbn, - Label: '{i18n>ISBN}' - }, - ... - ]}, - LineItem: [ - ...up to - {Value: title}, - { - Value: isbn, - Label: '{i18n>ISBN}' - }, - ... - ] -}); diff --git a/integration-tests/pom.xml b/integration-tests/pom.xml deleted file mode 100644 index a31af807..00000000 --- a/integration-tests/pom.xml +++ /dev/null @@ -1,120 +0,0 @@ - - 4.0.0 - - - my - bookshop-parent - ${revision} - - - bookshop-integration-tests - - bookshop-integration-tests - - - ../mtx/sidecar - - - - - my - bookshop - ${revision} - - - ch.qos.logback - logback-classic - - - - - - org.springframework.boot - spring-boot-starter-test - test - - - - org.springframework.security - spring-security-test - test - - - - - - - org.apache.maven.plugins - maven-surefire-plugin - 3.0.0 - - false - - - - - - org.apache.maven.plugins - maven-failsafe-plugin - 3.0.0 - - - - integration-test - verify - - - - - - - com.sap.cds - cds-maven-plugin - ${cds.services.version} - - - - install-sidecar - - npm - - pre-integration-test - - install --no-save - ${skipTests} - ${sidecar.dir} - - - - - start-sidecar - - npx - - pre-integration-test - - pm2 -l sidecar.log --time start --name=sidecar npm -- run start - ${skipTests} - ${sidecar.dir} - - - - - stop-sidecar - - npx - - post-integration-test - - pm2 delete sidecar - ${skipTests} - ${sidecar.dir} - - - - - - - diff --git a/integration-tests/src/test/java/my/bookshop/it/FeatureTogglesIT.java b/integration-tests/src/test/java/my/bookshop/it/FeatureTogglesIT.java deleted file mode 100644 index 816337c4..00000000 --- a/integration-tests/src/test/java/my/bookshop/it/FeatureTogglesIT.java +++ /dev/null @@ -1,58 +0,0 @@ -package my.bookshop.it; - -import static org.hamcrest.CoreMatchers.containsString; -import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; -import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath; -import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; - -import org.junit.jupiter.api.Test; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.security.test.context.support.WithMockUser; -import org.springframework.test.context.ActiveProfiles; -import org.springframework.test.web.servlet.MockMvc; - -// This test case is executable only when MTX sidecar is running. -@ActiveProfiles({"default", "ft"}) -@AutoConfigureMockMvc -@SpringBootTest -class FeatureTogglesIT { - - private static final String ENDPOINT = "/api/browse/Books(aebdfc8a-0dfa-4468-bd36-48aabd65e663)"; - - @Autowired - private MockMvc client; - - @Test - @WithMockUser("authenticated") // This user has all feature toggles disabled - void withoutToggles_basicModelVisible() throws Exception { - // Elements are not visible and not changed by the event handler - client.perform(get(ENDPOINT)) - .andExpect(status().isOk()) - .andExpect(jsonPath("$.isbn").doesNotExist()) - .andExpect(jsonPath("$.title").value(containsString("11%"))); - } - - @Test - @WithMockUser("admin") // This user has all feature toggles enabled - void togglesOn_extensionsAndChangesAreVisible() throws Exception { - // Elements are visible and changed by the event handler - client.perform(get(ENDPOINT)) - .andExpect(status().isOk()) - .andExpect(jsonPath("$.isbn").value("979-8669820985")) - .andExpect(jsonPath("$.title").value(containsString("14%"))); - } - - @Test - @WithMockUser("user") // This user has only 'isbn' toggle enabled - void toggleIsbnOn_extensionsAndChangesAreVisible() throws Exception { - // Elements are visible - client.perform(get(ENDPOINT)) - .andExpect(status().isOk()) - .andExpect(jsonPath("$.isbn").value("979-8669820985")) - .andExpect(jsonPath("$.title").value(containsString("11%"))); - } - -} - diff --git a/mta-multi-tenant.yaml b/mta-multi-tenant.yaml deleted file mode 100644 index 7ca6504b..00000000 --- a/mta-multi-tenant.yaml +++ /dev/null @@ -1,135 +0,0 @@ -_schema-version: '2.1' -ID: bookshop-mt -version: 1.0.0 -description: "Multitenant Bookshop CAP Java Project with UI" -parameters: - enable-parallel-deployments: true -modules: -# --------------------- SERVER MODULE ------------------------ - - name: bookshop-mt-srv -# ------------------------------------------------------------ - type: java - path: srv - parameters: - memory: 1024M - disk-quota: 512M - buildpack: sap_java_buildpack - properties: - SPRING_PROFILES_ACTIVE: cloud,sandbox - CDS_MULTITENANCY_APPUI_TENANTSEPARATOR: "-" - JBP_CONFIG_COMPONENTS: "jres: ['com.sap.xs.java.buildpack.jre.SAPMachineJRE']" - JBP_CONFIG_SAP_MACHINE_JRE: '{ use_offline_repository: false, version: 17.+ }' - build-parameters: - builder: custom - commands: - - mvn clean package -DskipTests=true - build-result: target/*-exec.jar - requires: - - name: bookshop-mt-service-manager - - name: bookshop-mt-uaa - - name: bookshop-mt-saas-registry - - name: mtx-api - properties: - CDS_MULTITENANCY_SIDECAR_URL: ~{mtx-url} - - name: app-api - properties: - CDS_MULTITENANCY_APPUI_URL: ~{app-url} - - name: cf-logging - provides: - - name: srv-api - properties: - srv-url: '${default-url}' -# --------------------- SIDECAR MODULE ----------------------- - - name: bookshop-mt-sidecar -# ------------------------------------------------------------ - type: nodejs - path: mtx/sidecar - parameters: - memory: 256M - disk-quota: 1024M - build-parameters: - builder: custom - build-result: gen - commands: - - npm run build - requires: - - name: bookshop-mt-srv - requires: - - name: bookshop-mt-service-manager - - name: bookshop-mt-uaa - - name: cf-logging - provides: - - name: mtx-api - properties: - mtx-url: ${default-url} -# --------------------- APPROUTER MODULE --------------------- - - name: bookshop-mt-app -# ------------------------------------------------------------ - type: approuter.nodejs - path: app - parameters: - memory: 256M - disk-quota: 512M - keep-existing-routes: true - properties: - TENANT_HOST_PATTERN: ^(.*)-${default-uri} # testing only, use custom domain with wildcard for production - requires: - - name: srv-api - group: destinations - properties: - name: backend - url: ~{srv-url} - forwardAuthToken: true - strictSSL: true - - name: bookshop-mt-uaa - provides: - - name: app-api - properties: - app-url: '${default-url}' - app-domain: '${domain}' -# --------------------- RESOURCES --------------------- -resources: -# ----------------------------------------------------- - - name: bookshop-mt-uaa - type: org.cloudfoundry.managed-service - parameters: - service: xsuaa - service-plan: application - path: ./xs-security-mt.json - config: # override xsappname as it needs to be unique - xsappname: bookshop-mt-${org}-${space} - oauth2-configuration: - redirect-uris: - - https://*.~{app-api/app-domain}/** - requires: - - name: app-api - - name: bookshop-mt-service-manager - type: org.cloudfoundry.managed-service - parameters: - service: service-manager - service-plan: container - - name: bookshop-mt-saas-registry - type: org.cloudfoundry.managed-service - parameters: - service: saas-registry - service-plan: application - config: - appName: bookshop-mt-${org}-${space} # this is the text on the tile - xsappname: bookshop-mt-${org}-${space} # this is the value from xsuaa.parameters.config.xsappname - appUrls: - getDependencies: ~{srv-api/srv-url}/mt/v1.0/subscriptions/dependencies - onSubscription: ~{srv-api/srv-url}/mt/v1.0/subscriptions/tenants/{tenantId} - onSubscriptionAsync: true - onUnSubscriptionAsync: true - onUpdateDependenciesAsync: true - callbackTimeoutMillis: 3600000 - displayName: bookshop-java - description: A simple CAP Java project. - category: 'Category' - requires: - - name: srv-api - - name: cf-logging - type: org.cloudfoundry.managed-service - parameters: - service: application-logs - service-plan: lite diff --git a/mta-single-tenant.yaml b/mta.yaml similarity index 71% rename from mta-single-tenant.yaml rename to mta.yaml index 9282f729..ada3397e 100644 --- a/mta-single-tenant.yaml +++ b/mta.yaml @@ -1,12 +1,12 @@ _schema-version: '2.1' -ID: bookshop +ID: bookshop-pg version: 1.0.0 -description: "Bookshop CAP Java Project with UI" +description: "CAP Java Bookshop on PostgreSQL with UI" parameters: enable-parallel-deployments: true modules: # --------------------- SERVER MODULE ------------------------ - - name: bookshop-srv + - name: bookshop-pg-srv # ------------------------------------------------------------ type: java path: srv @@ -15,7 +15,7 @@ modules: disk-quota: 512M buildpack: sap_java_buildpack properties: - SPRING_PROFILES_ACTIVE: cloud,sandbox + SPRING_PROFILES_ACTIVE: cloud JBP_CONFIG_COMPONENTS: "jres: ['com.sap.xs.java.buildpack.jre.SAPMachineJRE']" JBP_CONFIG_SAP_MACHINE_JRE: '{ use_offline_repository: false, version: 17.+ }' build-parameters: @@ -24,30 +24,16 @@ modules: - mvn clean package -DskipTests=true build-result: target/*-exec.jar requires: - - name: bookshop-hdi-container - - name: bookshop-uaa + - name: bookshop-pg-db + - name: bookshop-pg-uaa - name: cf-logging provides: - name: srv-api properties: srv-url: '${default-url}' -# --------------------- DB MODULE --------------------------- - - name: bookshop-db -# ----------------------------------------------------------- - type: hdb - path: db - parameters: - buildpack: nodejs_buildpack - build-parameters: - builder: custom - commands: - - npm run build - requires: - - name: bookshop-srv - requires: - - name: bookshop-hdi-container + # --------------------- APPROUTER MODULE --------------------- - - name: bookshop-app + - name: bookshop-pg-app # ------------------------------------------------------------ type: approuter.nodejs path: app @@ -62,32 +48,38 @@ modules: url: ~{srv-url} forwardAuthToken: true strictSSL: true - - name: bookshop-uaa + - name: bookshop-pg-uaa provides: - name: app-api properties: app-url: '${default-url}' + # --------------------- RESOURCES --------------------- resources: # ----------------------------------------------------- - - name: bookshop-uaa + - name: bookshop-pg-uaa type: org.cloudfoundry.managed-service parameters: service: xsuaa service-plan: application path: ./xs-security.json config: # override xsappname as it needs to be unique - xsappname: bookshop-${org}-${space} + xsappname: bookshop-pg-${org}-${space} oauth2-configuration: redirect-uris: - ~{app-api/app-url}/** requires: - name: app-api - - name: bookshop-hdi-container + + - name: bookshop-pg-db type: org.cloudfoundry.managed-service parameters: - service: hana - service-plan: hdi-shared + service: postgresql-db + service-plan: standard + config: + engine_version: "13" + multi_az: false + - name: cf-logging type: org.cloudfoundry.managed-service parameters: diff --git a/mtx/sidecar/package.json b/mtx/sidecar/package.json deleted file mode 100644 index 25f90de5..00000000 --- a/mtx/sidecar/package.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "dependencies": { - "@sap/cds": "^7", - "@sap/cds-mtxs": "^1", - "@sap/xssec": "^3", - "express": "^4", - "hdb": "^0", - "passport": "^0" - }, - "devDependencies": { - "sqlite3": "^5", - "pm2": "^5.3.0" - }, - "engines": { - "node": "^16" - }, - "cds": { - "profile": "mtx-sidecar", - "[development]": { - "requires": { "auth": "dummy" } - } - }, - "scripts": { - "start": "cds-serve", - "build": "cds build ../.. --for mtx-sidecar --production && cd gen && npm install" - } -} diff --git a/package.json b/package.json index 8470b71c..444d75e8 100644 --- a/package.json +++ b/package.json @@ -3,5 +3,9 @@ "version": "1.0.0", "description": "Bookshop using CAP Java NG", "license": "Apache License Version 2.0", - "repository": "https://github.com/SAP-samples/cloud-cap-samples-java.git" + "repository": "https://github.com/SAP-samples/cloud-cap-samples-java.git", + "devDependencies": { + "@sap/cds-dk": "~7", + "@cap-js/postgres": "~1" + } } diff --git a/pom.xml b/pom.xml index deee2202..b0e35feb 100644 --- a/pom.xml +++ b/pom.xml @@ -16,17 +16,13 @@ 17 - 2.0.2 - 3.0.8 - 4.14.0 - 3.0.1 + 2.1.0 + 3.1.2 3.7.0 - 7.0.1 srv - integration-tests @@ -48,24 +44,6 @@ pom import - - - - com.sap.cloud.sdk - sdk-modules-bom - ${cloud.sdk.version} - pom - import - - - - - com.sap.cloud.security - java-bom - ${xsuaa.version} - pom - import - @@ -102,12 +80,6 @@ - - org.apache.maven.plugins - maven-failsafe-plugin - 3.0.0-M9 - - org.codehaus.mojo diff --git a/requests.http b/requests.http deleted file mode 100644 index c8c0e019..00000000 --- a/requests.http +++ /dev/null @@ -1,16 +0,0 @@ -### Trigger BusinessPartner.Changed event through S/4 mock - -PATCH http://localhost:8080/api/API_BUSINESS_PARTNER/A_BusinessPartnerAddress(BusinessPartner='10401010',AddressID='200') -Content-Type: application/json -Authorization: Basic authenticated: - -{"HouseNumber": "30"} - -### Subscribe t1 tenant, in local-mtxs - -POST http://localhost:4005/-/cds/deployment/subscribe HTTP/1.1 -Content-Type: application/json - -{ - "tenant": "t1" -} diff --git a/scripts/create-container-registry-secret.sh b/scripts/create-container-registry-secret.sh deleted file mode 100755 index e18abeaf..00000000 --- a/scripts/create-container-registry-secret.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/bin/bash - -read -p "Docker Server: " DOCKER_SERVER - -read -p "User ($USER): " DOCKER_USER -if [ "$DOCKER_USER" == "" ]; then - DOCKER_USER="$USER" -fi - -if [ "$EMAIL" == "" ]; then - read -p "EMail: " DOCKER_EMAIL -else - read -p "EMail ($EMAIL): " DOCKER_EMAIL - if [ "$DOCKER_EMAIL" == "" ]; then - DOCKER_EMAIL="$EMAIL" - fi -fi - -read -sp "API Key: " API_KEY - -echo -echo - -kubectl create secret docker-registry container-registry \ - "--docker-server=$DOCKER_SERVER" \ - "--docker-username=$DOCKER_USER" \ - "--docker-email=$DOCKER_EMAIL" \ - "--docker-password=$API_KEY" diff --git a/scripts/create-db-secret.sh b/scripts/create-db-secret.sh deleted file mode 100755 index 9282a209..00000000 --- a/scripts/create-db-secret.sh +++ /dev/null @@ -1,78 +0,0 @@ -#!/bin/bash - -set -e -cd "$(dirname "$(dirname "$0")")" - -npm install --no-save yaml - -function value() { - node ./scripts/value.js "$1" -} - -NAME="$1" -if [ "$NAME" == "" ]; then - NAME="$(value srv.bindings.db.fromSecret)" - if [ "$NAME" == "" -o "$NAME" == "" ]; then - echo >&2 "[ERROR] Please either specify the name for the DB secret or maintain it in the Helm chart" - exit 1 - fi -fi - -SECRET_HEADER="$(cat </dev/null >/dev/null service $NAME || cf create-service hana hdi-shared $NAME -while true; do - STATUS="$(cf 2>/dev/null service $NAME | grep status: | head -n 1)" - echo $STATUS - if [[ "$STATUS" = *succeeded* ]]; then - break - fi - sleep 1 -done - -cf create-service-key $NAME $NAME-key - -node "$(dirname "$0")/format-kyma-secret.js" -- "$(echo "$SECRET_HEADER")" "$(cf service-key $NAME $NAME-key)" | kubectl apply -f - -echo -echo "HANA DB Kubernetes secret '$NAME' created." -echo -echo "You can view it using:" -echo -echo "kubectl get secret $NAME -o yaml" -exit 0 \ No newline at end of file diff --git a/scripts/create-sm-secret.sh b/scripts/create-sm-secret.sh deleted file mode 100755 index aecc9ada..00000000 --- a/scripts/create-sm-secret.sh +++ /dev/null @@ -1,96 +0,0 @@ -#!/bin/bash - -set -e -cd "$(dirname "$(dirname "$0")")" - -npm install --no-save yaml - -function value() { - node ./scripts/value.js "$1" -} - -NAME="$1" -if [ "$NAME" == "" ]; then - if [ ! -f "chart/values.yaml" ]; then - echo >&2 "[ERROR] Please either specify the name for the service manager secret or maintain it in the Helm chart" - exit 1 - fi - NAME="$(value .srv.bindings.db.fromSecret)" - if [ "$NAME" == "" -o "$NAME" == "" ]; then - echo >&2 "[ERROR] Please either specify the name for the service manager secret or maintain it in the Helm chart" - exit 1 - fi -fi - -SECRET_HEADER="$(cat </dev/null >/dev/null service $NAME || cf create-service service-manager container $NAME -while true; do - STATUS="$(cf 2>/dev/null service $NAME | grep status: | head -n 1)" - echo $STATUS - if [[ "$STATUS" = *succeeded* ]]; then - break - fi - sleep 1 -done - -cf create-service-key $NAME $NAME-key - -node "$(dirname "$0")/format-kyma-secret.js" -- "$(echo "$SECRET_HEADER")" "$(cf service-key $NAME $NAME-key)" | kubectl apply -f - -echo -echo "Service Manager container secret '$NAME' created." -echo -echo "You can view it using:" -echo -echo "kubectl get secret $NAME -o yaml" -exit 0 \ No newline at end of file diff --git a/scripts/format-kyma-secret.js b/scripts/format-kyma-secret.js deleted file mode 100644 index eccc78a6..00000000 --- a/scripts/format-kyma-secret.js +++ /dev/null @@ -1,9 +0,0 @@ -const key=JSON.parse(process.argv[4].replace(/^.*/, "")); -const credentials=key.credentials /* new cfcli? */ || key; -console.log(process.argv[3]); -console.log(Object.keys(credentials).map(k => { - if (credentials[k].match(/\n/s)) - return (` ${k}: |\n${credentials[k]}`).replace(/\n/gs,"\n ") - else - return ` ${k}: "${credentials[k]}"` -}).join("\n")) \ No newline at end of file diff --git a/scripts/value.js b/scripts/value.js deleted file mode 100755 index 91c9ed3e..00000000 --- a/scripts/value.js +++ /dev/null @@ -1,38 +0,0 @@ -#!/usr/bin/env node - -const yaml = require('yaml'); -const fs = require('fs'); - -const path = process.argv[2]; -if (!path) { - console.error('missing path'); - process.exit(1); -} - -const segments = path.split('.'); - -function printProperty(file) { - let valuesYaml; - try { - valuesYaml = fs.readFileSync(file, 'utf-8'); - } catch(error) { - return false; - } - const values = yaml.parse(valuesYaml); - - let o = values; - for (let segment of segments) { - o = o[segment]; - if (typeof o === "undefined" || o === null) return false; - } - - if (typeof o === "object") { - console.log(JSON.stringify(o)); - } else { - console.log(o); - } - - return true; -} - -printProperty('.values.yaml') || printProperty('values.yaml') || printProperty('chart/values.yaml') || process.exit(1); \ No newline at end of file diff --git a/srv/admin-service.cds b/srv/admin-service.cds index 4fb63410..cfd6c42d 100644 --- a/srv/admin-service.cds +++ b/srv/admin-service.cds @@ -1,38 +1,14 @@ using {sap.common.Languages as CommonLanguages} from '@sap/cds/common'; -using {my.bookshop as my} from '../db/index'; +using {my.bookshop as my} from '../db/schema'; -@path : 'admin' -service AdminService @(requires : 'admin') { - entity Books as projection on my.Books actions { - action addToOrder(order_ID : UUID, quantity : Integer) returns Orders; - } +@path: 'admin' +service AdminService @(requires: 'admin') { + @odata.draft.enabled + entity Books as projection on my.Books; - entity Authors as projection on my.Authors; - entity Orders as select from my.Orders; - - @cds.persistence.skip - entity Upload @odata.singleton { - csv : LargeBinary @Core.MediaType : 'text/csv'; - } + entity Authors as projection on my.Authors; } -// Deep Search Items -annotate AdminService.Orders with @cds.search : { - OrderNo, - Items -}; - -annotate AdminService.OrderItems with @cds.search : {book}; - -annotate AdminService.Books with @cds.search : { - descr, - title -}; - -// Enable Fiori Draft for Orders -annotate AdminService.Orders with @odata.draft.enabled; -annotate AdminService.Books with @odata.draft.enabled; - // workaround to enable the value help for languages // Necessary because auto exposure is currently not working // for if Languages is only referenced by the generated diff --git a/srv/cat-service.cds b/srv/cat-service.cds index e887271f..7ba8def0 100644 --- a/srv/cat-service.cds +++ b/srv/cat-service.cds @@ -1,4 +1,4 @@ -using {my.bookshop as my} from '../db/index'; +using {my.bookshop as my} from '../db/schema'; @path : 'browse' service CatalogService @(requires: 'any') { @@ -6,29 +6,8 @@ service CatalogService @(requires: 'any') { entity Books as projection on my.Books excluding { createdBy, modifiedBy - } actions { - action addReview(rating : Integer, title : String, text : String) returns Reviews; }; @readonly entity Authors as projection on my.Authors; - - @readonly - entity Reviews as projection on my.Reviews; - - action submitOrder(book : Books : ID, quantity : Integer) returns { - stock : Integer - }; - - // access control restrictions - annotate Reviews with @restrict : [ - { - grant : 'READ', - to : 'any' - }, - { - grant : 'CREATE', - to : 'authenticated-user' - } - ]; } diff --git a/srv/external.cds b/srv/external.cds deleted file mode 100644 index edcd5d55..00000000 --- a/srv/external.cds +++ /dev/null @@ -1,40 +0,0 @@ -using { API_BUSINESS_PARTNER as external } from './external/API_BUSINESS_PARTNER'; - -/** - * Tailor the imported API to our needs... - */ -extend service external with { - - /** - * Add asynchronous eventing API - */ - @topic: 'sap.s4.beh.businesspartner.v1.BusinessPartner.Changed.v1' - event BusinessPartner.Changed { - BusinessPartner: String; - } - -} - -/** - * Simplified view on external addresses, which in addition acts as a table to store replicated external address data. - */ -@cds.persistence:{table,skip:false} //> create a table with the view's inferred signature -@cds.autoexpose //> auto-expose in services as targets for ValueHelps and joins -entity my.bookshop.Addresses as projection on external.A_BusinessPartnerAddress { - key AddressID as ID, - key BusinessPartner as businessPartner, - @readonly Country as country, - @readonly CityName as city, - @readonly PostalCode as postalCode, - @readonly StreetName as street, - @readonly HouseNumber as houseNumber, - false as tombstone: Boolean -} - -/** - * Extend Orders with references to replicated external Addresses - */ -using { my.bookshop } from '../db/index'; -extend bookshop.Orders with { - shippingAddress : Association to bookshop.Addresses; -} diff --git a/srv/external/API_BUSINESS_PARTNER.cds b/srv/external/API_BUSINESS_PARTNER.cds deleted file mode 100644 index 72c3173a..00000000 --- a/srv/external/API_BUSINESS_PARTNER.cds +++ /dev/null @@ -1,3977 +0,0 @@ -/* checksum : 33c2afcba69718abba5b5d612738f7cd */ -@cds.external : true -@m.IsDefaultEntityContainer : 'true' -@sap.message.scope.supported : 'true' -@sap.supported.formats : 'atom json xlsx' -service API_BUSINESS_PARTNER {}; - -@cds.external : true -@cds.persistence.skip : true -@sap.content.version : '1' -@sap.label : 'Email Address' -entity API_BUSINESS_PARTNER.A_AddressEmailAddress { - /** - * Internal key for identifying a Business Address Services address. - * - * For more information about the meaning and use of the address number and the Business Address Services concepts, see the function group SZA0 documentation. - */ - @sap.display.format : 'UpperCase' - @sap.label : 'Address Number' - key AddressID : String(10) not null; - /** - * Internal key for identifying a person in Business Address Services. - * - * For more information about the meaning and use of the person number and Business Address Services concepts, see the function group SZA0 documentation. - */ - @sap.display.format : 'UpperCase' - @sap.label : 'Person number' - key Person : String(10) not null; - @sap.display.format : 'NonNegative' - @sap.label : 'Sequence Number' - key OrdinalNumber : String(3) not null; - @sap.display.format : 'UpperCase' - @sap.label : 'Standard addr.' - @sap.quickinfo : 'Flag: this address is the default address' - IsDefaultEmailAddress : Boolean; - /** - * Internet mail address, also called e-mail address. - * - * Example: user.name@company.comThe Internet mail address is used to send mail via the Internet world-wide; the protocol used is SMTP (Simple Mail Transfer Protocol).The Internet mail address format is specified in various RFCs (Internet Request for Comment), including RFCs 821 and 822.This is not an IP address (192.56.30.6). - */ - @sap.label : 'Email Address' - EmailAddress : String(241); - /** - * This field is generated by the system from the complete Internet mail address and is stored in table ADR6. - * - * It contains the first 20 characters of the Internet mail address in normalized form, that is, without comment characters and converted into uppercase.The field cannot be maintained by the user or from an interface.The table ADR6 contains an index for this field.Using an Internet mail address, the corresponding key of table ADR6 and the owner of the address are determined (for example, business partner or user). - */ - @sap.display.format : 'UpperCase' - @sap.label : 'E-Mail Address' - @sap.quickinfo : 'E-Mail Address Search Field' - SearchEmailAddress : String(20); - /** - * Additional information about the communication connection - * - * You can maintain further information about the communication connection here. In the case of telephone numbers, for example, you can maintain the times at which the call recipient is available and those at which they are not, or you can specify whether the number is that of the secretary.The information is stored in table ADRT, regardless of language. - */ - @sap.label : 'Notes' - @sap.quickinfo : 'Communication link notes' - AddressCommunicationRemarkText : String(50); -}; - -@cds.external : true -@cds.persistence.skip : true -@sap.content.version : '1' -@sap.label : 'Fax Number' -entity API_BUSINESS_PARTNER.A_AddressFaxNumber { - /** - * Internal key for identifying a Business Address Services address. - * - * For more information about the meaning and use of the address number and the Business Address Services concepts, see the function group SZA0 documentation. - */ - @sap.display.format : 'UpperCase' - @sap.label : 'Address Number' - key AddressID : String(10) not null; - /** - * Internal key for identifying a person in Business Address Services. - * - * For more information about the meaning and use of the person number and Business Address Services concepts, see the function group SZA0 documentation. - */ - @sap.display.format : 'UpperCase' - @sap.label : 'Person number' - key Person : String(10) not null; - @sap.display.format : 'NonNegative' - @sap.label : 'Sequence Number' - key OrdinalNumber : String(3) not null; - /** - * If several addresses are maintained for one communication type, the user in the SAP System can be reached under one of these addresses. One address can be set as theStandard Address. - * - * The standard address is used for the following functions:When sending using the SMTP nodein SAPconnect, the home address of the communication type used is the one set as the sender address. The recipient can see this address in the sender information and can also reply directly to this address. The standard address is also transferred and can be used for incoming status notifications, for example.When sending using an RFC node in SAPconnect, the standard address of the communication type used is the one set as the sender address. The structure defined in the case of the RFC does not permit another address to be transferred, so the standard address is used for incoming status notifications too.The SAP users have the addresses of their exchange P.O. boxes in their standard communication type 'Internet Mail' as the home address and their Internet address in the SAP system as their standard address. Example:Home address: Bernard.Brown@Company.comStandard address: Bernard.Brown@System.Company.comSending using an SMTP nodeThe home address of the communication type 'Internet Mail' (Bernard.Brown@Company.com) is used as the sender address. If a reply is sent to this address the user receives directly in the exchange postbox.Sending using the RFC nodeThe standard address of the communication type 'Internet Mail' (Bernard.Brown@System.Company.com) is used as the sender address. If a reply is sent to this address, it arrives back to the SAP system.Example using a mail system groupThe users should get all messages in their Microsoft Exchange postboxes. In the SAP system the mail system group is activated for this using the setting "Send Messages to the Home Address".The address settings of the SAP users remain unchanged:Home address: Bernard.Brown@Company.comStandard address: Bernard.Brown@System.Company.comSending using an SMTP nodeThe home address of the communication type 'Internet Mail' (Bernard.Brown@Company.com) is used as the sender address. If a reply is sent to this address the user receives directly in the exchange postbox.Sending using the RFC nodeThe standard address of the communication type 'Internet Mail' (Bernard.Brown@System.Company.com) is used as the sender address. If a reply is sent to this address it arrives back in the SAP system. It is then forwarded using the mail system group to the home address and the user gets it in the exchange postbox. - */ - @sap.display.format : 'UpperCase' - @sap.label : 'Standard No.' - @sap.quickinfo : 'Standard Sender Address in this Communication Type' - IsDefaultFaxNumber : Boolean; - /** - * The country for the telephone number or fax number is maintained here. - * - * This specification is used to determine the correct country code. A normalized form of the telephone number or fax number is then derived and stored in a field for a program-driven search.In most cases, the telephone number or fax number refers directly to an address.If this is the case, when a new number is created, the country of the address is proposed.If this is not the case (for example, with address-independent communication data for a business partner), the country from the user parameter LND is proposed (if it is maintained). If the user parameter LND is not maintained, the country of the company address assigned in the user master data is proposed.If the country of the address changes, the country of the corresponding telephone number and fax address is not changed automatically.Example: A business partner moves abroad.If the telephone number is for a permanent connection, the telephone number also changes when the business partner moves and has to be maintained again in the system.If the telephone number is for a mobile telephone and the number is retained, the original country for this telephone number also has to be retained and must not be changed automatically to the new country of the address. - */ - @sap.display.format : 'UpperCase' - @sap.label : 'Country' - @sap.quickinfo : 'Country for telephone/fax number' - FaxCountry : String(3); - /** - * Fax number, consisting of dialling code and number, but without country dialling code. - * - * If the fax number consists of a company number and an extension, the extension must be entered in the field extension.Fax number, as it is to be dialled from within the same country.Enter the following for the number "01234/567-0":Fax: 01234/567Extension: 0Enter the following for the number "01234/567-891":Fax: 01234/567Extension: 891For the number "012-345-678" (678 as extension) enter the following:Fax: 012-345Extension: 678In the following cases, enter the complete number (without country dialing code) in the field Fax:No part of the number can be considered as an extension.You are not sure which part of the number can be considered as an extension. - */ - @sap.display.format : 'UpperCase' - @sap.label : 'Fax' - @sap.quickinfo : 'Fax number: dialling code+number' - FaxNumber : String(30); - /** - * Fax extension number - * - * If the fax number consists of a company number and an extension, the extension must be entered here.Enter the extensionThe following rules apply for the format of telephone and fax numbers:The length of the entries in the field Telephone and Extension (Fax and Extension) cannot be more than 24 characters in total.Leading spaces are not allowed in the field Telephone or Fax or in the field Extension.Valid characters are:Numbers (0123456789)Letters (ABCDEFGHIJKLMNOPQRSTUVWXYZ)Following other characters: /, (, ), - *, # and " " (space), but not as a leading space.If an + is entered as the first character, the system checks whether the specified number starts with a country code. If so, a warning message is displayed because the country code is automatically determined by the system and should not be stored in the Telephone number (Fax number) field.If an & is entered as the first character, the automatic check and formatting of the telephone number (fax number), as well as the determination of the country code, is suppressed.Enter the following for the number "01234/567-0":Fax: 01234/567Extension: 0Enter the following for the number "01234/567-891":Fax: 01234/567Extension: 891For the number "012-345-678" (678 as extension) enter the following:Fax: 012-345Extension: 678In the following cases, enter the complete number (without country dialing code) in the field Fax:No part of the number can be considered as an extension.You are not sure which part of the number can be considered as an extension. - */ - @sap.display.format : 'UpperCase' - @sap.label : 'Extension' - @sap.quickinfo : 'Fax no.: Extension' - FaxNumberExtension : String(10); - /** - * The content of this field is automatically calculated by the system based on fax number and country code components. - * - * This field is therefore not to be filled when Business Address Services function modules are called. - */ - @sap.display.format : 'UpperCase' - @sap.label : 'Fax Number' - @sap.quickinfo : 'Complete Number: Dialling Code+Number+Extension' - InternationalFaxNumber : String(30); - /** - * Additional information about the communication connection - * - * You can maintain further information about the communication connection here. In the case of telephone numbers, for example, you can maintain the times at which the call recipient is available and those at which they are not, or you can specify whether the number is that of the secretary.The information is stored in table ADRT, regardless of language. - */ - @sap.label : 'Notes' - @sap.quickinfo : 'Communication link notes' - AddressCommunicationRemarkText : String(50); -}; - -@cds.external : true -@cds.persistence.skip : true -@sap.content.version : '1' -@sap.label : 'Home Page URL' -entity API_BUSINESS_PARTNER.A_AddressHomePageURL { - /** - * Internal key for identifying a Business Address Services address. - * - * For more information about the meaning and use of the address number and the Business Address Services concepts, see the function group SZA0 documentation. - */ - @sap.display.format : 'UpperCase' - @sap.label : 'Address Number' - key AddressID : String(10) not null; - /** - * Internal key for identifying a person in Business Address Services. - * - * For more information about the meaning and use of the person number and Business Address Services concepts, see the function group SZA0 documentation. - */ - @sap.display.format : 'UpperCase' - @sap.label : 'Person number' - key Person : String(10) not null; - @sap.display.format : 'NonNegative' - @sap.label : 'Sequence Number' - key OrdinalNumber : String(3) not null; - @sap.display.format : 'Date' - @sap.label : 'from' - @sap.quickinfo : 'Valid-from date - in current Release only 00010101 possible' - key ValidityStartDate : Date not null; - @sap.display.format : 'UpperCase' - @sap.label : 'Standard addr.' - @sap.quickinfo : 'Flag: this address is the default address' - key IsDefaultURLAddress : Boolean not null; - @sap.display.format : 'UpperCase' - @sap.label : 'URI address' - @sap.quickinfo : 'URI address search field' - SearchURLAddress : String(50); - /** - * Additional information about the communication connection - * - * You can maintain further information about the communication connection here. In the case of telephone numbers, for example, you can maintain the times at which the call recipient is available and those at which they are not, or you can specify whether the number is that of the secretary.The information is stored in table ADRT, regardless of language. - */ - @sap.label : 'Notes' - @sap.quickinfo : 'Communication link notes' - AddressCommunicationRemarkText : String(50); - @sap.label : 'URI length' - @sap.quickinfo : 'URI field length' - URLFieldLength : Integer; - @sap.label : 'URI' - @sap.quickinfo : 'Universal Resource Identifier (URI)' - WebsiteURL : String(2048); -}; - -@cds.external : true -@cds.persistence.skip : true -@sap.content.version : '1' -@sap.label : 'Phone Number' -entity API_BUSINESS_PARTNER.A_AddressPhoneNumber { - /** - * Internal key for identifying a Business Address Services address. - * - * For more information about the meaning and use of the address number and the Business Address Services concepts, see the function group SZA0 documentation. - */ - @sap.display.format : 'UpperCase' - @sap.label : 'Address Number' - key AddressID : String(10) not null; - /** - * Internal key for identifying a person in Business Address Services. - * - * For more information about the meaning and use of the person number and Business Address Services concepts, see the function group SZA0 documentation. - */ - @sap.display.format : 'UpperCase' - @sap.label : 'Person number' - key Person : String(10) not null; - @sap.display.format : 'NonNegative' - @sap.label : 'Sequence Number' - key OrdinalNumber : String(3) not null; - /** - * The country for the telephone number or fax number is maintained here. - * - * This specification is used to determine the correct country code. A normalized form of the telephone number or fax number is then derived and stored in a field for a program-driven search.In most cases, the telephone number or fax number refers directly to an address.If this is the case, when a new number is created, the country of the address is proposed.If this is not the case (for example, with address-independent communication data for a business partner), the country from the user parameter LND is proposed (if it is maintained). If the user parameter LND is not maintained, the country of the company address assigned in the user master data is proposed.If the country of the address changes, the country of the corresponding telephone number and fax address is not changed automatically.Example: A business partner moves abroad.If the telephone number is for a permanent connection, the telephone number also changes when the business partner moves and has to be maintained again in the system.If the telephone number is for a mobile telephone and the number is retained, the original country for this telephone number also has to be retained and must not be changed automatically to the new country of the address. - */ - @sap.display.format : 'UpperCase' - @sap.label : 'Country' - @sap.quickinfo : 'Country for telephone/fax number' - DestinationLocationCountry : String(3); - /** - * If several addresses are maintained for one communication type, the user in the SAP System can be reached under one of these addresses. One address can be set as theStandard Address. - * - * The standard address is used for the following functions:When sending using the SMTP nodein SAPconnect, the home address of the communication type used is the one set as the sender address. The recipient can see this address in the sender information and can also reply directly to this address. The standard address is also transferred and can be used for incoming status notifications, for example.When sending using an RFC node in SAPconnect, the standard address of the communication type used is the one set as the sender address. The structure defined in the case of the RFC does not permit another address to be transferred, so the standard address is used for incoming status notifications too.The SAP users have the addresses of their exchange P.O. boxes in their standard communication type 'Internet Mail' as the home address and their Internet address in the SAP system as their standard address. Example:Home address: Bernard.Brown@Company.comStandard address: Bernard.Brown@System.Company.comSending using an SMTP nodeThe home address of the communication type 'Internet Mail' (Bernard.Brown@Company.com) is used as the sender address. If a reply is sent to this address the user receives directly in the exchange postbox.Sending using the RFC nodeThe standard address of the communication type 'Internet Mail' (Bernard.Brown@System.Company.com) is used as the sender address. If a reply is sent to this address, it arrives back to the SAP system.Example using a mail system groupThe users should get all messages in their Microsoft Exchange postboxes. In the SAP system the mail system group is activated for this using the setting "Send Messages to the Home Address".The address settings of the SAP users remain unchanged:Home address: Bernard.Brown@Company.comStandard address: Bernard.Brown@System.Company.comSending using an SMTP nodeThe home address of the communication type 'Internet Mail' (Bernard.Brown@Company.com) is used as the sender address. If a reply is sent to this address the user receives directly in the exchange postbox.Sending using the RFC nodeThe standard address of the communication type 'Internet Mail' (Bernard.Brown@System.Company.com) is used as the sender address. If a reply is sent to this address it arrives back in the SAP system. It is then forwarded using the mail system group to the home address and the user gets it in the exchange postbox. - */ - @sap.display.format : 'UpperCase' - @sap.label : 'Standard No.' - @sap.quickinfo : 'Standard Sender Address in this Communication Type' - IsDefaultPhoneNumber : Boolean; - /** - * Telephone number, consisting of dialling code and number, but without country dialling code. - * - * If the telephone number consists of a company number and an extension, the extension must be entered in the field extension.Telephone number, as it is dialled from within the country.For the number "01234/567-0" enter the following:Telephone: 01234/567Estension: 0For the number "01234/567-891" enter the following:Telephone: 01234/567Extension: 891For the number "012-345-678" (678 as extension) enter the following:Telepone: 012-345Extension: 678In the following cases enter the complete number (without country dialling code) in the field Telephone:No part of the number can be regarded as an extension.You are not sure which part of the number can be regarded as an extension. - */ - @sap.display.format : 'UpperCase' - @sap.label : 'Telephone' - @sap.quickinfo : 'Telephone no.: dialling code+number' - PhoneNumber : String(30); - /** - * Telephone extension number - * - * If the telephone number consists of a company number and an extension, the extension should be entered here.Enter the extension.The following rules apply for the format of telephone and fax numbers:The length of the entries in the field Telephone and Extension (Fax and Extension) cannot be more than 24 characters in total.Leading spaces are not allowed in the field Telephone or Fax or in the field Extension.Valid characters are:Numbers (0123456789)Letters (ABCDEFGHIJKLMNOPQRSTUVWXYZ)Following other characters: /, (, ), - *, # and " " (space), but not as a leading space.If an + is entered as the first character, the system checks whether the specified number starts with a country code. If so, a warning message is displayed because the country code is automatically determined by the system and should not be stored in the Telephone number (Fax number) field.If an & is entered as the first character, the automatic check and formatting of the telephone number (fax number), as well as the determination of the country code, is suppressed.For the number "01234/567-0" enter the following:Telephone: 01234/567Estension: 0For the number "01234/567-891" enter the following:Telephone: 01234/567Extension: 891For the number "012-345-678" (678 as extension) enter the following:Telepone: 012-345Extension: 678In the following cases enter the complete number (without country dialling code) in the field Telephone:No part of the number can be regarded as an extension.You are not sure which part of the number can be regarded as an extension. - */ - @sap.display.format : 'UpperCase' - @sap.label : 'Extension' - @sap.quickinfo : 'Telephone no.: Extension' - PhoneNumberExtension : String(10); - /** - * The content of this field is automatically calculated by the system based on the telephone number and country code components. - * - * This field is therefore not to be filled when Business Address Services function modules are called. - */ - @sap.display.format : 'UpperCase' - @sap.label : 'Telephone Number' - @sap.quickinfo : 'Complete Number: Dialling Code+Number+Extension' - InternationalPhoneNumber : String(30); - /** - * This field specifies whether the telephone number is a mobile telephone number. - * - * ' ' : The telephone number is a fixed-line telephone'1' : The telephone number is the standard fixed-line telephone'2' : The telephone nubmer is a mobile telephone'3' : The telephone number is the standard mobile telephoneEither the standard fixed-line telephone number or the standard mobile telephone number is also the standard telephone number (FLGDEFAULT = 'X').In older data sets, this field may have also have the value ' ' for the standard fixed-line telephone. In this case, however, FLGDEFAULT is always 'X'.In Customizing, you can specify whether the SMS-compatible indicator is to be proposed for new mobile telephone numbers created in dialog by choosing General Settings -> Set countries -> Define Mobile Telephone Attributes for each country. - */ - @sap.display.format : 'UpperCase' - @sap.label : 'Mobile phone' - @sap.quickinfo : 'Indicator: Telephone is a Mobile Telephone' - PhoneNumberType : String(1); - /** - * Additional information about the communication connection - * - * You can maintain further information about the communication connection here. In the case of telephone numbers, for example, you can maintain the times at which the call recipient is available and those at which they are not, or you can specify whether the number is that of the secretary.The information is stored in table ADRT, regardless of language. - */ - @sap.label : 'Notes' - @sap.quickinfo : 'Communication link notes' - AddressCommunicationRemarkText : String(50); -}; - -@cds.external : true -@cds.persistence.skip : true -@sap.creatable : 'false' -@sap.updatable : 'false' -@sap.deletable : 'false' -@sap.content.version : '1' -@sap.label : 'Contact Person Address' -entity API_BUSINESS_PARTNER.A_BPContactToAddress { - /** The business partner relationship number is an internal number that identifies the business partner relationship set. */ - @sap.display.format : 'UpperCase' - @sap.label : 'BP Relationship No.' - @sap.quickinfo : 'BP Relationship Number' - key RelationshipNumber : String(12) not null; - /** Key identifying a business partner in the SAP system. The key is unique within a client. */ - @sap.display.format : 'UpperCase' - @sap.label : 'Business Partner' - @sap.quickinfo : 'Business Partner Number' - key BusinessPartnerCompany : String(10) not null; - /** Key identifying a business partner in the SAP system. The key is unique within a client. */ - @sap.display.format : 'UpperCase' - @sap.label : 'Business Partner' - @sap.quickinfo : 'Business Partner Number' - key BusinessPartnerPerson : String(10) not null; - @sap.display.format : 'Date' - @sap.label : 'Valid To' - @sap.quickinfo : 'Validity Date (Valid To)' - key ValidityEndDate : Date not null; - /** - * Internal key for identifying a Business Address Services address. - * - * For more information about the meaning and use of the address number and the Business Address Services concepts, see the function group SZA0 documentation. - */ - @sap.display.format : 'UpperCase' - @sap.label : 'Address Number' - key AddressID : String(10) not null; - /** - * Internal key for identifying a Business Address Services address. - * - * For more information about the meaning and use of the address number and the Business Address Services concepts, see the function group SZA0 documentation. - */ - @sap.display.format : 'UpperCase' - @sap.label : 'Address Number' - AddressNumber : String(10); - /** - * Additional address field which is printed above the Street line. - * - * The Street address contains two lines above the street and two lines below the street.See Print the Street address. - */ - @sap.label : 'Street 3' - AdditionalStreetPrefixName : String(40); - /** - * Additional address field which is printed under the Street line. - * - * The Street address has two lines above the street and two lines below the steet.See Print the Street address. - */ - @sap.label : 'Street 5' - AdditionalStreetSuffixName : String(40); - /** - * Time zone as part of an address. - * - * The time zone is automatically determined by the system in address maintenance if time zone Customizing is maintained.It depends on the country and the region. (Region means state, province or county, depending on the country)The automatic determination is only made if there is no value in the time zone field. - */ - @sap.display.format : 'UpperCase' - @sap.label : 'Time zone' - @sap.quickinfo : 'Address time zone' - AddressTimeZone : String(6); - /** - * Part of the address (c/o = care of) if the recipient is different from the occupant and the names are not similar (e.g. subtenants). - * - * Put the country-specific code (e.g. c/o) in front of the name of the occupant. This is not automatically done in the print format, like the language-specific word "PO Box".John Smithc/o David BrownThis field is not always automatically printed, as it was subsequently added to the address structure.The print program or form may need to be adjusted.This exception applies to the following fields:Street2, Street3, Street4, Street5, c/o name, and to all address fields added after Release 4.5. - */ - @sap.label : 'c/o' - @sap.quickinfo : 'c/o name' - CareOfName : String(40); - @sap.display.format : 'UpperCase' - @sap.label : 'City Code' - @sap.quickinfo : 'City code for city/street file' - CityCode : String(12); - /** - * City name as part of the address. - * - * The city name is saved redundantly in another database field in upper- case letters, for search help.If the Postal regional structure ('city file') is active, the city name is checked against the Cities defined in the regional structure. - */ - @sap.label : 'City' - CityName : String(40); - /** - * Postal code that is assigned directly to one company (= company postal code = major customer postal code). - * - * This field is used for countries where major companies are assigned their own postal code by the national post office.This postal code has to be entered in the field "Company Postal Code". Postal codes for group major customers, however, have to be entered in the field "PO Box Postal Code", since individual customers with a shared postal code for group major customers are differentiated by means of their PO box. - */ - @sap.display.format : 'UpperCase' - @sap.label : 'Company Postal Code' - @sap.quickinfo : 'Company Postal Code (for Large Customers)' - CompanyPostalCode : String(10); - /** - * The country key contains information which the system uses to check entries such as the length of the postal code or bank account number. - * - * The two-character ISO code in accordance with ISO 3166, which is delivered by SAP as a default, is usually used.It could also be the vehicle license plate country-code or a typical country key, for example, in Germany the Federal statistics office key.The country keys are determined at system installation in the global settings.The definition of the country key in the SAP system does not have to match political or government entities.Since the country key does not have to correspond to the ISO code in all installations, programs that differ according to certain values of the country key cannot query the country key T005-LAND1, but have to program based on the ISO code T005 INTCA. - */ - @sap.display.format : 'UpperCase' - @sap.label : 'Country Key' - Country : String(3); - /** - * Specifies the county’s name - * - * This field is used to store the county’s name. You can enter the name of the county in this field. - */ - @sap.label : 'County' - County : String(40); - /** - * The delivery service is part of the PO box address. - * - * Some countries offer different services in addition to regular postal delivery and PO boxes, for example the Private Bag or Response Bag. If an address is related to one of these delivery services, the information about this particular delivery service has to be entered in the corresponding fields.In the field "Number of Delivery Service," the number of the Private Bag, Response Bag, or other relevant service has to be entered. Entering a number is not mandatory for each delivery service.For each address, either the information about the PO box or the information about the delivery service can be entered, but not both types of information at the same time.Mr PickeringPrivate Bag 106999Timaru 7942Delivery services will only be taken into account for address formatting in countries in which they are commonly used in addition to regular postal delivery and PO boxes, for example, in Australia, New Zealand, and the USA. In all other countries, these fields will not be taken into account for address formatting. - */ - @sap.display.format : 'UpperCase' - @sap.label : 'Delivery Service No.' - @sap.quickinfo : 'Number of Delivery Service' - DeliveryServiceNumber : String(10); - /** - * The delivery service is part of the PO box address. - * - * Some countries offer different services in addition to regular postal delivery and PO boxes, for example the Private Bag or Response Bag. If an address is related to one of these delivery services, the information about this particular delivery service has to be entered in the corresponding fields.In the field "Type of Delivery Service," the type of the delivery service has to be entered.For each address, either the information about the PO box or the information about the delivery service can be entered, but not both types of information at the same time.Mr PickeringPrivate Bag 106999Timaru 7942Delivery services will only be taken into account for address formatting in countries in which they are commonly used in addition to regular postal delivery and PO boxes, for example, in Australia, New Zealand, and the USA. In all other countries, these fields will not be taken into account for address formatting. - */ - @sap.display.format : 'UpperCase' - @sap.label : 'Delvry Serv Type' - @sap.quickinfo : 'Type of Delivery Service' - DeliveryServiceTypeCode : String(4); - /** - * City or District supplement - * - * In some countries, this entry is appended with a hyphen to the city name by the automatic address formatting, other countries, it is output on a line of its own or (e.g. in the USA) not printed.See the examples in the Address Layout Key documentation. - */ - @sap.label : 'District' - District : String(40); - /** - * Key for form of address text. - * - * You can also define a form of address text in Customizing.The form of address text can be maintained in different languages. - */ - @sap.display.format : 'UpperCase' - @sap.label : 'Title' - @sap.quickinfo : 'Form-of-Address Key' - @sap.creatable : 'false' - @sap.updatable : 'false' - FormOfAddress : String(4); - /** - * This field contains the full name or formatted name of a party. - * - * For organizations or document addresses, typically the fields Name1 and Name2 are concatenated.For persons the field contains the formatted name according to country specific rules. It corresponds e.g. to the content of the fields BUT000-NAME1_TEXT or ADRP-NAME_TEXT. - */ - @sap.label : 'Full Name' - @sap.quickinfo : 'Full name of a party (Bus. Partner, Org. Unit, Doc. address)' - @sap.creatable : 'false' - @sap.updatable : 'false' - FullName : String(80); - /** - * City of residence which is different from the postal city - * - * In some countries, the residential city is required if it differs from the postal city.In the USA, the official street indexes, against which data can be checked, are based on the residential city, not the postal city, which may be different.It is the same in France, where a postally correct address must contain the residential city in a separate line above the postal city, if it differs from the postal city.This field is not always automatically printed, as it was subsequently added to the address structure.The print program or form may need to be adjusted.This exception applies to the following fields:Street2, Street3, Street4, Street5, c/o name, and to all address fields added after Release 4.5. - */ - @sap.label : 'Different City' - @sap.quickinfo : 'City (different from postal city)' - HomeCityName : String(40); - /** - * House number as part of an address. - * - * It is printed in the Street line.Other supplementary street information can be entered in the House number supplement or one of the Street2, Street3, Street4 or Street5 fields. See Print the Street address.A house number (e.g. 117) or a house number with supplement (e.g. 117a), or a house number range (e.g. 16-20), can be maintained in this field. - */ - @sap.label : 'House Number' - HouseNumber : String(10); - /** - * House number supplement as part of an address, e.g. - * - * App. 17 orSuite 600.It is printed in the Street line.Further Street supplements can be put in one of the fields Street2, Street3, Street4 or Street5.See Print the Street address. - */ - @sap.label : 'Supplement' - @sap.quickinfo : 'House number supplement' - HouseNumberSupplementText : String(10); - /** - * The language key indicates - * - * - the language in which texts are displayed,- the language in which you enter texts,- the language in which the system prints texts. - */ - @sap.label : 'Language Key' - Language : String(2); - /** - * PO Box number as part of an address. - * - * Only enter the PO Box number in this field. The text "PO Box" is provided in the recipient language by the system when you print the address.When you print an address, the "Street address" and the "PO Box address" are distinguished. The print program determines which of them has priority if both are maintained in an address record.Besides the PO Box number, the PO Box address uses the following fields:PO Box postal code, if specified (otherwise the normal postal code)PO Box city, if specified (otherwise the normal city)PO Box region, if specified (otherwise the normal region)PO Box country, if specified (otherwise the normal country)If the address is a "PO Box" (without a number), do not fill the "PO Box" field. Select the "PO Box w/o Number" indicator instead.You can also enter a company postal code for organizational addresses, instead of a PO Box. A separate field is predefined for this entry.For general information and examples about address formatting, see the documentation on the Address Structure Key. - */ - @sap.display.format : 'UpperCase' - @sap.label : 'PO Box' - POBox : String(10); - /** - * Different city for the PO Box as an address component. - * - * The PO Box city can be entered here if it is different from the address city.If the address is only a PO Box address, enter the city in the normal city field.If the address contains two different city names for the address and the PO Box address, use this field. - */ - @sap.label : 'PO Box City' - @sap.quickinfo : 'PO Box city' - POBoxDeviatingCityName : String(40); - /** - * Different PO Box country in address. - * - * The PO Box country can be entered here, if it is different from the street address country.If the address only has a PO Box address, the country is in the normal country field.Use this field if the address has two different country values for the street address and the PO Box address.This field is not always automatically printed, as it was subsequently added to the address structure.The print program or form may need to be adjusted.This exception applies to the following fields:Street2, Street3, Street4, Street5, c/o name, and to all address fields added after Release 4.5. - */ - @sap.display.format : 'UpperCase' - @sap.label : 'PO box country' - POBoxDeviatingCountry : String(3); - /** - * Different Region for PO Box in an address. - * - * Enter the PO Box Region here, if it differs from the street address region.If the address only has a PO Box address, the Region in in the normal Region field.Use this field if the address has two different Region values for the street address and the PO Box address.This field is not always automatically printed, as it was subsequently added to the address structure.The print program or form may need to be adjusted.This exception applies to the following fields:Street2, Street3, Street4, Street5, c/o name, and to all address fields added after Release 4.5. - */ - @sap.display.format : 'UpperCase' - @sap.label : 'PO Box Region' - @sap.quickinfo : 'Region for PO Box (Country, State, Province, ...)' - POBoxDeviatingRegion : String(3); - /** - * PO Box address without PO Box number flag. - * - * Only the word 'PO Box' is output in PO Box addresses without PO Box number.Set this flag for a PO Box address without PO Box number.This field is not always automatically printed, as it was subsequently added to the address structure.The print program or form may need to be adjusted.This exception applies to the following fields:Street2, Street3, Street4, Street5, c/o name, and to all address fields added after Release 4.5. - */ - @sap.display.format : 'UpperCase' - @sap.label : 'PO Box w/o No.' - @sap.quickinfo : 'Flag: PO Box Without Number' - POBoxIsWithoutNumber : Boolean; - /** - * The PO box lobby is part of the PO box address. - * - * In some countries, entering a PO box, postal code and city is not sufficient to uniquely identify a PO box, because the same PO box number is assigned multiple times in some cities.Therefore, additional information might be required to determine the post office of the PO box in question. This information can be entered in the field "PO Box Lobby."Mr NellingPO Box 4099HighfieldTimaru 7942The PO box lobby will only be taken into account for address formatting in countries in which it is commonly used in addition to regular postal delivery and PO boxes, for example, in Canada or New Zealand. In all other countries, this field will not be taken into account for address formatting. - */ - @sap.label : 'PO Box Lobby' - POBoxLobbyName : String(40); - /** - * Postal code that is required for a unique assignment of the PO box. - * - * This field is used for countries where a different postal code applies to mail that is sent to the PO box rather than to the street address of a particular business partner.Postal codes for group major customers also have to be entered in the field for the PO box postal code since individual customers with a shared postal code for group major customers are differentiated by means of the PO box. Postal codes for major customers (= company postal codes), however, are assigned to one customer only and have to be entered in the field 'Company Postal Code'. - */ - @sap.display.format : 'UpperCase' - @sap.label : 'PO Box Postal Code' - POBoxPostalCode : String(10); - /** - * Internal key for identifying a person in Business Address Services. - * - * For more information about the meaning and use of the person number and Business Address Services concepts, see the function group SZA0 documentation. - */ - @sap.display.format : 'UpperCase' - @sap.label : 'Person number' - @sap.creatable : 'false' - @sap.updatable : 'false' - Person : String(10); - /** - * Postal code as part of the address - * - * If different postal codes are maintained for the PO Box and Street address of an address, this field contains the Street address postal code. - */ - @sap.display.format : 'UpperCase' - @sap.label : 'Postal Code' - @sap.quickinfo : 'City Postal Code' - PostalCode : String(10); - /** - * Communication method with which you can exchange documents and messages with a business partner. - * - * In Business Address Services, you can specify a standard communication method that can be used by programs to determine the means of communication for sending messages.One business partner wants all messages by fax, another by e-mail.The application context can restrict the possible methods of communication. For example, invitations should perhaps only be sent by post because of enclosures, whereas minutes can be sent by post, fax or e-mail.Communication strategies can be defined for this purpose and applied in application contexts. - */ - @sap.display.format : 'UpperCase' - @sap.label : 'Comm. Method' - @sap.quickinfo : 'Communication Method (Key) (Business Address Services)' - PrfrdCommMediumType : String(3); - /** - * In some countries, the region forms part of the address. The meaning depends on the country. - * - * The automatic address formatting function prints the region in addresses in the USA, Canada, Italy, Brazil or Australia, and the county in Great Britain.For more information, see the examples in the documentation on the Address Layout Key.Meaning of the regional code in ...Australia -> ProvinceBrazil -> StateCanada -> ProvinceGermany -> StateGreat Britain -> CountyItaly -> ProvinceJapan -> PrefectureSwitzerland -> CantonUSA -> State - */ - @sap.display.format : 'UpperCase' - @sap.label : 'Region' - @sap.quickinfo : 'Region (State, Province, County)' - Region : String(3); - /** - * Street name as part of the address. - * - * The street name is saved, redundantly in upper case in another database field, for search help purposes.There are other fields for address parts which can be printed above or below the street. See Print the Street address.The house number and other supplements are usually maintained in their own fields. See Formatting the Street line. - */ - @sap.label : 'Street' - StreetName : String(60); - /** - * Additional address field which is printed above the Street line. - * - * The Street address contains two lines above the street and two lines below the street.See Print the Street address.This field is not always automatically printed, as it was subsequently added to the address structure.The print program or form may need to be adjusted.This exception applies to the following fields:Street2, Street3, Street4, Street5, c/o name, and to all address fields added after Release 4.5. - */ - @sap.label : 'Street 2' - StreetPrefixName : String(40); - /** - * Additional address field which is printed below the Street line. - * - * The Street address contains two lines above the street and two lines below the street.See Print the Street address. - */ - @sap.label : 'Street 4' - StreetSuffixName : String(40); - /** Specifies the tax jurisdiction. */ - @sap.display.format : 'UpperCase' - @sap.label : 'Tax Jurisdiction' - TaxJurisdiction : String(15); - /** - * Sales and distribution: - * - * Regional zone of Goods recipient.Purchasing:Regional zone of supplier.You can define regional zones to suit the requirements of your own business and country.Sales and distributionthe system automatically proposes a suitable route by using the transportation zone of the goods recipient in combination with other information about the delivery, such as theCountries of origin and destinationShipping conditionsTransportation groupIn the USA, for example, you can define regional zones to correspond to the US postal zip codes. - */ - @sap.display.format : 'UpperCase' - @sap.label : 'Transportation Zone' - @sap.quickinfo : 'Transportation zone to or from which the goods are delivered' - TransportZone : String(10); - @cds.ambiguous : 'missing on condition?' - to_EmailAddress : Association to many API_BUSINESS_PARTNER.A_AddressEmailAddress { }; - @cds.ambiguous : 'missing on condition?' - to_FaxNumber : Association to many API_BUSINESS_PARTNER.A_AddressFaxNumber { }; - @cds.ambiguous : 'missing on condition?' - to_MobilePhoneNumber : Association to many API_BUSINESS_PARTNER.A_AddressPhoneNumber { }; - @cds.ambiguous : 'missing on condition?' - to_PhoneNumber : Association to many API_BUSINESS_PARTNER.A_AddressPhoneNumber { }; - @cds.ambiguous : 'missing on condition?' - to_URLAddress : Association to many API_BUSINESS_PARTNER.A_AddressHomePageURL { }; -}; - -@cds.external : true -@cds.persistence.skip : true -@sap.creatable : 'false' -@sap.deletable : 'false' -@sap.content.version : '1' -@sap.label : 'Function and Department' -entity API_BUSINESS_PARTNER.A_BPContactToFuncAndDept { - /** The business partner relationship number is an internal number that identifies the business partner relationship set. */ - @sap.display.format : 'UpperCase' - @sap.label : 'BP Relationship No.' - @sap.quickinfo : 'BP Relationship Number' - key RelationshipNumber : String(12) not null; - /** Key identifying a business partner in the SAP system. The key is unique within a client. */ - @sap.display.format : 'UpperCase' - @sap.label : 'Business Partner' - @sap.quickinfo : 'Business Partner Number' - key BusinessPartnerCompany : String(10) not null; - /** Key identifying a business partner in the SAP system. The key is unique within a client. */ - @sap.display.format : 'UpperCase' - @sap.label : 'Business Partner' - @sap.quickinfo : 'Business Partner Number' - key BusinessPartnerPerson : String(10) not null; - @sap.display.format : 'Date' - @sap.label : 'Valid To' - @sap.quickinfo : 'Validity Date (Valid To)' - key ValidityEndDate : Date not null; - /** - * Identifies the function that a person has within a company. - * - * This is a contact person attribute that you can define in Customizing.Personnel managerSecretary - */ - @sap.display.format : 'UpperCase' - @sap.label : 'Function' - @sap.quickinfo : 'Function of partner' - ContactPersonFunction : String(4); - /** - * Name of the department of a business partner for your internal usage. - * - * The name given by the business partner to this particular department may differ from the name that you use. You can enter the name given by the business partner in the field company department.This is a contact person attribute that you can define in Customizing.For your purposes, the department name is "Sales". The business partner names the same department "Sales South". - */ - @sap.display.format : 'UpperCase' - @sap.label : 'Department' - ContactPersonDepartment : String(4); - /** - * Telephone number, consisting of dialling code and number, but without country dialling code. - * - * If the telephone number consists of a company number and an extension, the extension must be entered in the field extension.Telephone number, as it is dialled from within the country.For the number "01234/567-0" enter the following:Telephone: 01234/567Estension: 0For the number "01234/567-891" enter the following:Telephone: 01234/567Extension: 891For the number "012-345-678" (678 as extension) enter the following:Telepone: 012-345Extension: 678In the following cases enter the complete number (without country dialling code) in the field Telephone:No part of the number can be regarded as an extension.You are not sure which part of the number can be regarded as an extension. - */ - @sap.display.format : 'UpperCase' - @sap.label : 'Telephone' - @sap.quickinfo : 'Telephone no.: dialling code+number' - PhoneNumber : String(30); - /** - * Telephone extension number - * - * If the telephone number consists of a company number and an extension, the extension should be entered here.Enter the extension.The following rules apply for the format of telephone and fax numbers:The length of the entries in the field Telephone and Extension (Fax and Extension) cannot be more than 24 characters in total.Leading spaces are not allowed in the field Telephone or Fax or in the field Extension.Valid characters are:Numbers (0123456789)Letters (ABCDEFGHIJKLMNOPQRSTUVWXYZ)Following other characters: /, (, ), - *, # and " " (space), but not as a leading space.If an + is entered as the first character, the system checks whether the specified number starts with a country code. If so, a warning message is displayed because the country code is automatically determined by the system and should not be stored in the Telephone number (Fax number) field.If an & is entered as the first character, the automatic check and formatting of the telephone number (fax number), as well as the determination of the country code, is suppressed.For the number "01234/567-0" enter the following:Telephone: 01234/567Estension: 0For the number "01234/567-891" enter the following:Telephone: 01234/567Extension: 891For the number "012-345-678" (678 as extension) enter the following:Telepone: 012-345Extension: 678In the following cases enter the complete number (without country dialling code) in the field Telephone:No part of the number can be regarded as an extension.You are not sure which part of the number can be regarded as an extension. - */ - @sap.display.format : 'UpperCase' - @sap.label : 'Extension' - @sap.quickinfo : 'Telephone no.: Extension' - PhoneNumberExtension : String(10); - /** - * Fax number, consisting of dialling code and number, but without country dialling code. - * - * If the fax number consists of a company number and an extension, the extension must be entered in the field extension.Fax number, as it is to be dialled from within the same country.Enter the following for the number "01234/567-0":Fax: 01234/567Extension: 0Enter the following for the number "01234/567-891":Fax: 01234/567Extension: 891For the number "012-345-678" (678 as extension) enter the following:Fax: 012-345Extension: 678In the following cases, enter the complete number (without country dialing code) in the field Fax:No part of the number can be considered as an extension.You are not sure which part of the number can be considered as an extension. - */ - @sap.display.format : 'UpperCase' - @sap.label : 'Fax' - @sap.quickinfo : 'Fax number: dialling code+number' - FaxNumber : String(30); - /** - * Fax extension number - * - * If the fax number consists of a company number and an extension, the extension must be entered here.Enter the extensionThe following rules apply for the format of telephone and fax numbers:The length of the entries in the field Telephone and Extension (Fax and Extension) cannot be more than 24 characters in total.Leading spaces are not allowed in the field Telephone or Fax or in the field Extension.Valid characters are:Numbers (0123456789)Letters (ABCDEFGHIJKLMNOPQRSTUVWXYZ)Following other characters: /, (, ), - *, # and " " (space), but not as a leading space.If an + is entered as the first character, the system checks whether the specified number starts with a country code. If so, a warning message is displayed because the country code is automatically determined by the system and should not be stored in the Telephone number (Fax number) field.If an & is entered as the first character, the automatic check and formatting of the telephone number (fax number), as well as the determination of the country code, is suppressed.Enter the following for the number "01234/567-0":Fax: 01234/567Extension: 0Enter the following for the number "01234/567-891":Fax: 01234/567Extension: 891For the number "012-345-678" (678 as extension) enter the following:Fax: 012-345Extension: 678In the following cases, enter the complete number (without country dialing code) in the field Fax:No part of the number can be considered as an extension.You are not sure which part of the number can be considered as an extension. - */ - @sap.display.format : 'UpperCase' - @sap.label : 'Extension' - @sap.quickinfo : 'Fax no.: Extension' - FaxNumberExtension : String(10); - /** - * Internet mail address, also called e-mail address. - * - * Example: user.name@company.comThe Internet mail address is used to send mail via the Internet world-wide; the protocol used is SMTP (Simple Mail Transfer Protocol).The Internet mail address format is specified in various RFCs (Internet Request for Comment), including RFCs 821 and 822.This is not an IP address (192.56.30.6). - */ - @sap.label : 'Email Address' - EmailAddress : String(241); - /** - * A relationship may exist between two business partners. The business partner relationship category characterizes the features of the relationship. - * - * A distinction is made between a one-way and an undirected business partner relationship category. In a one-way relationship category, the relationship extends from one partner to another, but not vice versa.Marriage (undirected)Employee (one-way)Contact person (one-way) - */ - @sap.display.format : 'UpperCase' - @sap.label : 'Relationship Cat.' - @sap.quickinfo : 'Business Partner Relationship Category' - RelationshipCategory : String(6); -}; - -@cds.external : true -@cds.persistence.skip : true -@sap.content.version : '1' -@sap.label : 'Address Usage' -entity API_BUSINESS_PARTNER.A_BuPaAddressUsage { - /** Key identifying a business partner in the SAP system. The key is unique within a client. */ - @sap.display.format : 'UpperCase' - @sap.label : 'Business Partner' - @sap.quickinfo : 'Business Partner Number' - key BusinessPartner : String(10) not null; - @odata.Type : 'Edm.DateTimeOffset' - @sap.label : 'Valid To' - @sap.quickinfo : 'Validity End of a Business Partner Address Usage' - key ValidityEndDate : DateTime not null; - /** - * Business partner attribute, which you can use to distinguish between various addresses by defining the address usage for communication with business partners. - * - * Maintain the usage types for addresses (address types) in Customizing.You can create a short description and a name for the address type.When maintaining business partners you can use the function address usage to assign business partner addresses to address types.If necessary, you can set the indicator for multiple use in Customizing.Correspondence addressDelivery address - */ - @sap.display.format : 'UpperCase' - @sap.label : 'Address Type' - key AddressUsage : String(10) not null; - /** - * Internal key for identifying a Business Address Services address. - * - * For more information about the meaning and use of the address number and the Business Address Services concepts, see the function group SZA0 documentation. - */ - @sap.display.format : 'UpperCase' - @sap.label : 'Address Number' - key AddressID : String(10) not null; - @odata.Type : 'Edm.DateTimeOffset' - @sap.label : 'Valid From' - @sap.quickinfo : 'Validity Start of a Business Partner Address Usage' - ValidityStartDate : DateTime; - /** - * Establishes which is the standard address for an address usage. - * - * Several addresses per period can be assigned to an address usage.If this is the case, then this indicator controls which of the assigned addresses should be the standard address of the relevant usage. This is determined automatically when the address usage is accessed. - */ - @sap.display.format : 'UpperCase' - @sap.label : 'Standard Usage' - @sap.quickinfo : 'Indicator: Standard Address Usage' - StandardUsage : Boolean; - /** - * You can use authorization groups to stipulate which business partners a user is allowed to process. - * - * Use the following authorization object:'Business partners: authorization groups' (B_BUPA_GRP).The system only checks this authorization if you made an entry in the "Authorization group" field for the business partner. Otherwise, any user may process the business partner. - */ - @sap.display.format : 'UpperCase' - @sap.label : 'Authorization Group' - AuthorizationGroup : String(4); -}; - -@cds.external : true -@cds.persistence.skip : true -@sap.content.version : '1' -@sap.label : 'Identification' -entity API_BUSINESS_PARTNER.A_BuPaIdentification { - /** Key identifying a business partner in the SAP system. The key is unique within a client. */ - @sap.display.format : 'UpperCase' - @sap.label : 'Business Partner' - @sap.quickinfo : 'Business Partner Number' - key BusinessPartner : String(10) not null; - /** - * A document (such as an ID card or driver's license) or an entry in a system of records (such as a commercial register) whose key can be stored as an attribute for a business partner. - * - * The identification type is for classifying identification numbers.You can define the identification types and their descriptions in Customizing.You can also specify for which business partner category an ID type should be valid.If necessary, assign the identification type to an Identification Category.You can only assign one identification type to an identification category. - */ - @sap.display.format : 'UpperCase' - @sap.label : 'Identification Type' - key BPIdentificationType : String(6) not null; - /** Number that serves to identify a business partner, such as driver's license, or ID card number. */ - @sap.display.format : 'UpperCase' - @sap.label : 'ID number' - @sap.quickinfo : 'Identification Number' - key BPIdentificationNumber : String(60) not null; - /** Institution that adminsters or assigns an ID number. */ - @sap.label : 'Responsible Institn' - @sap.quickinfo : 'Responsible Institution for ID Number' - BPIdnNmbrIssuingInstitute : String(40); - /** Date on which the ID number was registered or assigned by the appropriate authority. */ - @sap.display.format : 'Date' - @sap.label : 'Entry date' - @sap.quickinfo : 'Date of Entry for ID Number' - BPIdentificationEntryDate : Date; - /** Country in which an ID number was assigned, or in which the number is valid. */ - @sap.display.format : 'UpperCase' - @sap.label : 'Country' - @sap.quickinfo : 'Country in Which ID Number is Valid or Was Assigned' - Country : String(3); - /** - * In some countries, the region forms part of the address. The meaning depends on the country. - * - * The automatic address formatting function prints the region in addresses in the USA, Canada, Italy, Brazil or Australia, and the county in Great Britain.For more information, see the examples in the documentation on the Address Layout Key.Meaning of the regional code in ...Australia -> ProvinceBrazil -> StateCanada -> ProvinceGermany -> StateGreat Britain -> CountyItaly -> ProvinceJapan -> PrefectureSwitzerland -> CantonUSA -> State - */ - @sap.display.format : 'UpperCase' - @sap.label : 'Region' - @sap.quickinfo : 'Region (State, Province, County)' - Region : String(3); - /** This date marks the start of validity of an ID number. */ - @sap.display.format : 'Date' - @sap.label : 'Valid from' - @sap.quickinfo : 'Validity Start for ID Number' - ValidityStartDate : Date; - /** This date marks the end of validity of an ID number. */ - @sap.display.format : 'Date' - @sap.label : 'Valid To' - @sap.quickinfo : 'Validity End for ID Number' - ValidityEndDate : Date; - /** - * You can use authorization groups to stipulate which business partners a user is allowed to process. - * - * Use the following authorization object:'Business partners: authorization groups' (B_BUPA_GRP).The system only checks this authorization if you made an entry in the "Authorization group" field for the business partner. Otherwise, any user may process the business partner. - */ - @sap.display.format : 'UpperCase' - @sap.label : 'Authorization Group' - AuthorizationGroup : String(4); -}; - -@cds.external : true -@cds.persistence.skip : true -@sap.content.version : '1' -@sap.label : 'Industry' -entity API_BUSINESS_PARTNER.A_BuPaIndustry { - /** - * Describes an industry. - * - * An industry is a classification of companies according to their main business activity. For example, you can use Commerce, Banking, Services, Industry, Healthcare, Public Sector, Media, and so on, as industries.You can define industries along with their descriptions in Customizing.Assign the industry key to an industry key system. - */ - @sap.display.format : 'UpperCase' - @sap.label : 'Industry' - key IndustrySector : String(10) not null; - /** - * Serves to combine and categorize several industries into a group. - * - * You can create different industry systems, each with its own catalog of industries, whereby an industry can be assigned to several industry systems.You have to select one industry system as the standard industry system. This is then automatically displayed in the initial screen for the maintenance of industry data.You can define an industry system along with its description in Customizing. You can assign several industry systems to a business partner.If you choose the button All Industry Systems, you can access all the industry systems defined in the Customizing using the input help. - */ - @sap.display.format : 'UpperCase' - @sap.label : 'Industry System' - key IndustrySystemType : String(4) not null; - /** Key identifying a business partner in the SAP system. The key is unique within a client. */ - @sap.display.format : 'UpperCase' - @sap.label : 'Business Partner' - @sap.quickinfo : 'Business Partner Number' - key BusinessPartner : String(10) not null; - /** - * Identifies the industry in an industry system that can be defined as the standard industry. - * - * It is recommended that you define an industry within an industry system as the standard industry, because only the standard industries can be determined at the interfaces to BW or the APIs, for example.This means that even if only one industry exists within an industry system, it should be indicated as the standard industry as this this information cannot be determined otherwise. - */ - @sap.display.format : 'UpperCase' - @sap.label : 'Standard Industry' - @sap.quickinfo : 'Industry is Standard for BP in Industry System' - IsStandardIndustry : String(1); - @sap.label : 'Description' - IndustryKeyDescription : String(100); -}; - -@cds.external : true -@cds.persistence.skip : true -@sap.deletable : 'false' -@sap.content.version : '1' -@sap.label : 'Business Partner' -entity API_BUSINESS_PARTNER.A_BusinessPartner { - /** Key identifying a business partner in the SAP system. The key is unique within a client. */ - @sap.display.format : 'UpperCase' - @sap.label : 'Business Partner' - @sap.quickinfo : 'Business Partner Number' - key BusinessPartner : String(10) not null; - /** Gives an alphanumeric key, which clearly identifies the customer or vendor in the SAP system. */ - @sap.display.format : 'UpperCase' - @sap.label : 'Customer' - @sap.quickinfo : 'Customer Number' - @sap.creatable : 'false' - @sap.updatable : 'false' - Customer : String(10); - /** Specifies an alphanumeric key that uniquely identifies the supplier in the SAP system. */ - @sap.display.format : 'UpperCase' - @sap.label : 'Supplier' - @sap.quickinfo : 'Account Number of Supplier' - @sap.creatable : 'false' - @sap.updatable : 'false' - Supplier : String(10); - /** - * Key for academic title. - * - * You can define a key for an academic title in Customizing. - */ - @sap.display.format : 'UpperCase' - @sap.label : 'Academic Title 1' - @sap.quickinfo : 'Academic Title: Key' - AcademicTitle : String(4); - /** - * You can use authorization groups to stipulate which business partners a user is allowed to process. - * - * Use the following authorization object:'Business partners: authorization groups' (B_BUPA_GRP).The system only checks this authorization if you made an entry in the "Authorization group" field for the business partner. Otherwise, any user may process the business partner. - */ - @sap.display.format : 'UpperCase' - @sap.label : 'Authorization Group' - AuthorizationGroup : String(4); - /** - * Category under which a business partner is classified. - * - * You can distinguish between the following business partner categories:OrganizationNatural personGroup of natural persons or organizationsThe processing screens for the business partner categories are set up differently.So, for example, the screen for an organization contains the field Legal form, but this is not needed in the screen for a natural person. - */ - @sap.display.format : 'UpperCase' - @sap.label : 'BP Category' - @sap.quickinfo : 'Business Partner Category' - BusinessPartnerCategory : String(1); - @sap.creatable : 'false' - @sap.updatable : 'false' - BusinessPartnerFullName : String(81); - /** - * Classification assigned when creating a business partner. - * - * Assign each business partner to a grouping when you create the business partner. The grouping determines the number range. You cannot change the assignment afterwards.You can define the groupings, their descriptions, the associated number range and other attributes in Customizing.You can define standard groupings for the internal and the external number assignment.For each grouping create a number range.When you create a business partner, the entry in the grouping field determines whether and how an entry is made in the business partner number field. - */ - @sap.display.format : 'UpperCase' - @sap.label : 'Grouping' - @sap.quickinfo : 'Business Partner Grouping' - BusinessPartnerGrouping : String(4); - @sap.creatable : 'false' - @sap.updatable : 'false' - BusinessPartnerName : String(81); - @sap.label : 'BP GUID' - @sap.quickinfo : 'Business Partner GUID' - @sap.creatable : 'false' - @sap.updatable : 'false' - BusinessPartnerUUID : UUID; - /** - * Correspondence language (written) for business partners in the 'Person' category. Maintain the correspondence language for business partners in the 'Organization' and 'Group' category with the address (communication). - * - * When transferring data (direct input), make sure that for a'Person', the field 'LANGU_CORR' and for an'Organization' or "Group" the field 'LANGU'has an entry. - */ - @sap.label : 'Correspondence lang.' - @sap.quickinfo : 'Business Partner: Correspondence Language' - CorrespondenceLanguage : String(2); - @sap.display.format : 'UpperCase' - @sap.label : 'Created By' - @sap.quickinfo : 'User who created the object' - @sap.creatable : 'false' - @sap.updatable : 'false' - CreatedByUser : String(12); - @sap.display.format : 'Date' - @sap.label : 'Created on' - @sap.quickinfo : 'Date on which the object was created' - @sap.creatable : 'false' - @sap.updatable : 'false' - CreationDate : Date; - @sap.label : 'Created at' - @sap.quickinfo : 'Time at which the object was created' - @sap.creatable : 'false' - @sap.updatable : 'false' - CreationTime : Time; - @sap.label : 'First Name' - @sap.quickinfo : 'First Name of Business Partner (Person)' - FirstName : String(40); - /** - * Key for form of address text. - * - * You can also define a form of address text in Customizing.The form of address text can be maintained in different languages. - */ - @sap.display.format : 'UpperCase' - @sap.label : 'Title' - @sap.quickinfo : 'Form-of-Address Key' - FormOfAddress : String(4); - /** - * An industry sector is the term used to classify a company according to its main business activity. - * - * You can assign an industry sector to business partners in the category 'Organization'RetailBanksServicesIndustryHealth servicePublic sectorMedia - */ - @sap.display.format : 'UpperCase' - @sap.label : 'Industry sector' - Industry : String(10); - /** - * Here you enter the first 7 digits of the international location number. - * - * The International Location Number (ILN) is assigned (in Germany by the Centrale for Coorganisation GmbH)) when a company is founded. It consists of 13 digits, the last digit being the check digit. There are two categories of location numbers:Participants who only need an ILN to cleary and unmistakably identify themselves for communication with the business partner are given a category 1 ILN. This cannot be used to identify articles by means of EAN.Participants who wish to assign the location numbers for their own enterprise areas are given a category 2 ILN. For a category 2 ILN, digits 1 to 7 are described as basis number. This is used as basis for the creation of article numbers (EAN). - */ - @sap.display.format : 'NonNegative' - @sap.label : 'Int. location no. 1' - @sap.quickinfo : 'International location number (part 1)' - InternationalLocationNumber1 : String(7); - /** - * Here, you enter digits 8-12 of the 13-digit international location number. - * - * The international location number (ILN) is assigned when establishing a company (by the "Zentrale für Coorganisation GmbH" in Germany). It consists of 13 digits, the last of which is the check digit. There are two types of international location numbers:Subscribers who only need one ILN to identify themselves in communication with the business partner are given an ILN of type 1. These cannot be used for identifying articles by means of EAN.Subscribers who need to assign location numbers for their own company areas are given an ILN of type 2. Positions 1 through 7 of the ILN type 2 are known as the basis number. This basis number forms the basis for article numbers (EAN). - */ - @sap.display.format : 'NonNegative' - @sap.label : 'Int. location no. 2' - @sap.quickinfo : 'International location number (Part 2)' - InternationalLocationNumber2 : String(5); - @sap.display.format : 'UpperCase' - @sap.label : 'Female' - @sap.quickinfo : 'Selection: Business partner is female' - IsFemale : Boolean; - @sap.display.format : 'UpperCase' - @sap.label : 'Male' - @sap.quickinfo : 'Selection: Business partner is male' - IsMale : Boolean; - /** - * Indicator through which a distinction between natural and legal persons can be made during tax reporting. - * - * Is used in Italy and Mexico ,among other countries.Brasil: If the indicator is not set, 'CGC' is relevant in tax number 1. If the indicator is set, 'CPF' is relevant in tax number 2.Colombia: In the case of some natural persons, the NIT number does not have a check digit. In this case you should set this indicator and the check is deactivated. - */ - @sap.display.format : 'UpperCase' - @sap.label : 'Natural Person' - @sap.quickinfo : 'Business Partner Is a Natural Person Under the Tax Laws' - IsNaturalPerson : String(1); - @sap.display.format : 'UpperCase' - @sap.label : 'Unknown' - @sap.quickinfo : 'Selection: Sex of business partner is not known' - IsSexUnknown : Boolean; - @sap.display.format : 'UpperCase' - @sap.label : 'Gender' - @sap.quickinfo : 'Gender of Business Partner (Person)' - GenderCodeName : String(1); - /** - * Language for verbal communication with a business partner. - * - * This language may differ from the language(s) defined for written correspondence. - */ - @sap.label : 'Language' - @sap.quickinfo : 'Business partner: Language' - Language : String(2); - @sap.display.format : 'Date' - @sap.label : 'Changed on' - @sap.quickinfo : 'Date when object was last changed' - @sap.creatable : 'false' - @sap.updatable : 'false' - LastChangeDate : Date; - @sap.label : 'Changed at' - @sap.quickinfo : 'Time at which object was last changed' - @sap.creatable : 'false' - @sap.updatable : 'false' - LastChangeTime : Time; - @sap.display.format : 'UpperCase' - @sap.label : 'Changed by' - @sap.quickinfo : 'Last user to change object' - @sap.creatable : 'false' - @sap.updatable : 'false' - LastChangedByUser : String(12); - @sap.label : 'Last Name' - @sap.quickinfo : 'Last Name of Business Partner (Person)' - LastName : String(40); - /** - * Denotes certain legal norms that are of significance for the organization of a company. - * - * For business partners in the category "Organization", you can state the legal form of the company. This is for information purposes only.Stock corporation (AG in Germany)Limited liability company (GmbH in Germany) - */ - @sap.display.format : 'UpperCase' - @sap.label : 'Legal form' - @sap.quickinfo : 'BP: Legal form of organization' - LegalForm : String(2); - /** First name field for business partners in the Organization category. */ - @sap.label : 'Name 1' - @sap.quickinfo : 'Name 1 of organization' - OrganizationBPName1 : String(40); - /** Second name field for business partners in the Organization category. */ - @sap.label : 'Name 2' - @sap.quickinfo : 'Name 2 of organization' - OrganizationBPName2 : String(40); - /** Third name field for business partners in the Organization category. */ - @sap.label : 'Name 3' - @sap.quickinfo : 'Name 3 of organization' - OrganizationBPName3 : String(40); - /** Fourth name field for business partners in the Organization category. */ - @sap.label : 'Name 4' - @sap.quickinfo : 'Name 4 of organization' - OrganizationBPName4 : String(40); - /** - * Indicates the official registration of a company in the Commercial Register. - * - * If a company is not officially registered in the Commercial Register, it has to use some type of text addition, such as foundation pending, when referring to the legal form. - */ - @sap.display.format : 'Date' - @sap.label : 'Date founded' - @sap.quickinfo : 'Date organization founded' - OrganizationFoundationDate : Date; - /** - * Term for the end of bankruptcy proceedings. - * - * This date also indicates that the company no longer exists. - */ - @sap.display.format : 'Date' - @sap.label : 'Liquidation date' - @sap.quickinfo : 'Liquidation date of organization' - OrganizationLiquidationDate : Date; - /** Denotes the term that you define for a business partner, and via which you can restrict the search for a business partner in the business partner search or in the locator. */ - @sap.display.format : 'UpperCase' - @sap.label : 'Search term 1' - @sap.quickinfo : 'Search term 1 for business partner' - SearchTerm1 : String(20); - /** Denotes the term that you define for a business partner, and via which you can restrict the search for a business partner in the business partner search or in the locator. */ - @sap.display.format : 'UpperCase' - @sap.label : 'Search term 2' - @sap.quickinfo : 'Search term 2 for business partner' - SearchTerm2 : String(20); - @sap.label : 'Other Last Name' - @sap.quickinfo : 'Other Last Name of a Person' - AdditionalLastName : String(40); - @sap.display.format : 'Date' - @sap.label : 'Date of Birth' - @sap.quickinfo : 'Date of Birth of Business Partner' - BirthDate : Date; - @sap.label : 'Birthplace' - @sap.quickinfo : 'Birthplace of business partner' - BusinessPartnerBirthplaceName : String(40); - /** If the business partner is blocked centrally, certain activities cannot be executed. */ - @sap.display.format : 'UpperCase' - @sap.label : 'Central Block' - @sap.quickinfo : 'Central Block for Business Partner' - BusinessPartnerIsBlocked : Boolean; - /** - * You can use the business partner type to group business partners according to your own criteria in Customizing (IMG). - * - * In Customizing you can show or hide fields for data entry, depending on the requirements of the relevant business partner type.Select a business partner type. You can obtain help by pressing the F4 key. - */ - @sap.display.format : 'UpperCase' - @sap.label : 'BP Type' - @sap.quickinfo : 'Business Partner Type' - BusinessPartnerType : String(4); - @sap.creatable : 'false' - @sap.updatable : 'false' - ETag : String(26); - /** First name field for business partners in the Group category. */ - @sap.label : 'Name 1' - @sap.quickinfo : 'Name 1 (group)' - GroupBusinessPartnerName1 : String(40); - /** Second name field for business partners in the Group category. */ - @sap.label : 'Name 2' - @sap.quickinfo : 'Name 2 (group)' - GroupBusinessPartnerName2 : String(40); - /** - * Internal key for identifying the address for communication data that spans all addresses in Business Partner. - * - * For more information on the significance and usage of the address number, see the documentation for Business Address Services (BAS). - */ - @sap.display.format : 'UpperCase' - @sap.label : 'Address Number' - @sap.creatable : 'false' - @sap.updatable : 'false' - IndependentAddressID : String(10); - /** The check digit is derived from a special check digit procedure from digits of the previous international location numbers. In this way, you can check whether the ILN entered is actually valid. */ - @sap.display.format : 'NonNegative' - @sap.label : 'Check digit' - @sap.quickinfo : 'Check digit for the international location number' - InternationalLocationNumber3 : String(1); - @sap.label : 'Middle Name' - @sap.quickinfo : 'Middle Name or Second Forename of a Person' - MiddleName : String(40); - /** - * The name format rule country and the name format rule key together uniquely identify a formatting rule. - * - * A country can have several formats which correspond to different rules. Formatting rules describe the format of a person name. - */ - @sap.display.format : 'UpperCase' - @sap.label : 'Country for format' - @sap.quickinfo : 'Country for Name Format Rule' - NameCountry : String(3); - /** See Name format. */ - @sap.display.format : 'UpperCase' - @sap.label : 'Name Format' - @sap.quickinfo : 'Name format' - NameFormat : String(2); - /** - * States the complete name of a person. - * - * The complete name is generally generated and saved by the Business Address Services (BAS) according to country-specific rules from the individual name components (without the form of address).If, during the formatting of an address, you want to use an alternative name, you can manually format the alternative name here. - */ - @sap.label : 'Full Name' - PersonFullName : String(80); - /** - * Internal key for identifying a person in Business Address Services. - * - * For more information about the meaning and use of the person number and Business Address Services concepts, see the function group SZA0 documentation. - */ - @sap.display.format : 'UpperCase' - @sap.label : 'Person number' - @sap.creatable : 'false' - @sap.updatable : 'false' - PersonNumber : String(10); - /** - * Establishes if the business partner is meant to be archived. - * - * If the indicator is set, the relevant business partner can be archived from the view of the business partner administration.If the check of the data to be archived shows, for example, that there are still active business transactions the archiving of the business partner data is prevented even if the indicator is set.If the indicator is not set, the business partner will not be taken into consideration during archiving. - */ - @sap.display.format : 'UpperCase' - @sap.label : 'Archiving Flag' - @sap.quickinfo : 'Central Archiving Flag' - IsMarkedForArchiving : Boolean; - /** - * Business partner number from an external system or a legacy system. - * - * If the current business partner is known under a different number in an external system, you can store this number here for information purposes.Direct input gives you the option of maintaining a business partner by specifying the external business partner number. If you maintain business partner data in your legacy system, you can transmit changes made to business partners to the SAP system without having to know the SAP business partner number in the legacy system. - */ - @sap.display.format : 'UpperCase' - @sap.label : 'External BP Number' - @sap.quickinfo : 'Business Partner Number in External System' - BusinessPartnerIDByExtSystem : String(20); - /** Company ID standard for the whole group. */ - @sap.display.format : 'UpperCase' - @sap.label : 'Trading Partner No.' - @sap.quickinfo : 'Company ID of trading partner' - TradingPartner : String(6); - @cds.ambiguous : 'missing on condition?' - to_BuPaIdentification : Association to many API_BUSINESS_PARTNER.A_BuPaIdentification { }; - @cds.ambiguous : 'missing on condition?' - to_BuPaIndustry : Association to many API_BUSINESS_PARTNER.A_BuPaIndustry { }; - @cds.ambiguous : 'missing on condition?' - to_BusinessPartnerAddress : Association to many API_BUSINESS_PARTNER.A_BusinessPartnerAddress { }; - @cds.ambiguous : 'missing on condition?' - to_BusinessPartnerBank : Association to many API_BUSINESS_PARTNER.A_BusinessPartnerBank { }; - @cds.ambiguous : 'missing on condition?' - to_BusinessPartnerContact : Association to many API_BUSINESS_PARTNER.A_BusinessPartnerContact { }; - @cds.ambiguous : 'missing on condition?' - to_BusinessPartnerRole : Association to many API_BUSINESS_PARTNER.A_BusinessPartnerRole { }; - @cds.ambiguous : 'missing on condition?' - to_BusinessPartnerTax : Association to many API_BUSINESS_PARTNER.A_BusinessPartnerTaxNumber { }; - @cds.ambiguous : 'missing on condition?' - to_Customer : Association to API_BUSINESS_PARTNER.A_Customer { }; - @cds.ambiguous : 'missing on condition?' - to_Supplier : Association to API_BUSINESS_PARTNER.A_Supplier { }; -}; - -@cds.external : true -@cds.persistence.skip : true -@sap.content.version : '1' -@sap.label : 'Address' -entity API_BUSINESS_PARTNER.A_BusinessPartnerAddress { - /** Key identifying a business partner in the SAP system. The key is unique within a client. */ - @sap.display.format : 'UpperCase' - @sap.label : 'Business Partner' - @sap.quickinfo : 'Business Partner Number' - key BusinessPartner : String(10) not null; - /** - * Internal key for identifying a Business Address Services address. - * - * For more information about the meaning and use of the address number and the Business Address Services concepts, see the function group SZA0 documentation. - */ - @sap.display.format : 'UpperCase' - @sap.label : 'Address Number' - key AddressID : String(10) not null; - @odata.Type : 'Edm.DateTimeOffset' - @sap.label : 'Valid From' - @sap.quickinfo : 'Validity Start of a Business Partner Address' - ValidityStartDate : DateTime; - @odata.Type : 'Edm.DateTimeOffset' - @sap.label : 'Valid To' - @sap.quickinfo : 'Validity End of a Business Partner Address' - ValidityEndDate : DateTime; - /** - * You can use authorization groups to stipulate which business partners a user is allowed to process. - * - * Use the following authorization object:'Business partners: authorization groups' (B_BUPA_GRP).The system only checks this authorization if you made an entry in the "Authorization group" field for the business partner. Otherwise, any user may process the business partner. - */ - @sap.display.format : 'UpperCase' - @sap.label : 'Authorization Group' - AuthorizationGroup : String(4); - @sap.label : 'GUID of a Business Partner Address' - @sap.heading : '' - @sap.creatable : 'false' - @sap.updatable : 'false' - AddressUUID : UUID; - /** - * Additional address field which is printed above the Street line. - * - * The Street address contains two lines above the street and two lines below the street.See Print the Street address. - */ - @sap.label : 'Street 3' - AdditionalStreetPrefixName : String(40); - /** - * Additional address field which is printed under the Street line. - * - * The Street address has two lines above the street and two lines below the steet.See Print the Street address. - */ - @sap.label : 'Street 5' - AdditionalStreetSuffixName : String(40); - /** - * Time zone as part of an address. - * - * The time zone is automatically determined by the system in address maintenance if time zone Customizing is maintained.It depends on the country and the region. (Region means state, province or county, depending on the country)The automatic determination is only made if there is no value in the time zone field. - */ - @sap.display.format : 'UpperCase' - @sap.label : 'Time zone' - @sap.quickinfo : 'Address time zone' - AddressTimeZone : String(6); - /** - * Part of the address (c/o = care of) if the recipient is different from the occupant and the names are not similar (e.g. subtenants). - * - * Put the country-specific code (e.g. c/o) in front of the name of the occupant. This is not automatically done in the print format, like the language-specific word "PO Box".John Smithc/o David BrownThis field is not always automatically printed, as it was subsequently added to the address structure.The print program or form may need to be adjusted.This exception applies to the following fields:Street2, Street3, Street4, Street5, c/o name, and to all address fields added after Release 4.5. - */ - @sap.label : 'c/o' - @sap.quickinfo : 'c/o name' - CareOfName : String(40); - @sap.display.format : 'UpperCase' - @sap.label : 'City Code' - @sap.quickinfo : 'City code for city/street file' - CityCode : String(12); - /** - * City name as part of the address. - * - * The city name is saved redundantly in another database field in upper- case letters, for search help.If the Postal regional structure ('city file') is active, the city name is checked against the Cities defined in the regional structure. - */ - @sap.label : 'City' - CityName : String(40); - /** - * Postal code that is assigned directly to one company (= company postal code = major customer postal code). - * - * This field is used for countries where major companies are assigned their own postal code by the national post office.This postal code has to be entered in the field "Company Postal Code". Postal codes for group major customers, however, have to be entered in the field "PO Box Postal Code", since individual customers with a shared postal code for group major customers are differentiated by means of their PO box. - */ - @sap.display.format : 'UpperCase' - @sap.label : 'Company Postal Code' - @sap.quickinfo : 'Company Postal Code (for Large Customers)' - CompanyPostalCode : String(10); - /** - * The country key contains information which the system uses to check entries such as the length of the postal code or bank account number. - * - * The two-character ISO code in accordance with ISO 3166, which is delivered by SAP as a default, is usually used.It could also be the vehicle license plate country-code or a typical country key, for example, in Germany the Federal statistics office key.The country keys are determined at system installation in the global settings.The definition of the country key in the SAP system does not have to match political or government entities.Since the country key does not have to correspond to the ISO code in all installations, programs that differ according to certain values of the country key cannot query the country key T005-LAND1, but have to program based on the ISO code T005 INTCA. - */ - @sap.display.format : 'UpperCase' - @sap.label : 'Country Key' - Country : String(3); - /** - * Specifies the county’s name - * - * This field is used to store the county’s name. You can enter the name of the county in this field. - */ - @sap.label : 'County' - County : String(40); - /** - * The delivery service is part of the PO box address. - * - * Some countries offer different services in addition to regular postal delivery and PO boxes, for example the Private Bag or Response Bag. If an address is related to one of these delivery services, the information about this particular delivery service has to be entered in the corresponding fields.In the field "Number of Delivery Service," the number of the Private Bag, Response Bag, or other relevant service has to be entered. Entering a number is not mandatory for each delivery service.For each address, either the information about the PO box or the information about the delivery service can be entered, but not both types of information at the same time.Mr PickeringPrivate Bag 106999Timaru 7942Delivery services will only be taken into account for address formatting in countries in which they are commonly used in addition to regular postal delivery and PO boxes, for example, in Australia, New Zealand, and the USA. In all other countries, these fields will not be taken into account for address formatting. - */ - @sap.display.format : 'UpperCase' - @sap.label : 'Delivery Service No.' - @sap.quickinfo : 'Number of Delivery Service' - DeliveryServiceNumber : String(10); - /** - * The delivery service is part of the PO box address. - * - * Some countries offer different services in addition to regular postal delivery and PO boxes, for example the Private Bag or Response Bag. If an address is related to one of these delivery services, the information about this particular delivery service has to be entered in the corresponding fields.In the field "Type of Delivery Service," the type of the delivery service has to be entered.For each address, either the information about the PO box or the information about the delivery service can be entered, but not both types of information at the same time.Mr PickeringPrivate Bag 106999Timaru 7942Delivery services will only be taken into account for address formatting in countries in which they are commonly used in addition to regular postal delivery and PO boxes, for example, in Australia, New Zealand, and the USA. In all other countries, these fields will not be taken into account for address formatting. - */ - @sap.display.format : 'UpperCase' - @sap.label : 'Delvry Serv Type' - @sap.quickinfo : 'Type of Delivery Service' - DeliveryServiceTypeCode : String(4); - /** - * City or District supplement - * - * In some countries, this entry is appended with a hyphen to the city name by the automatic address formatting, other countries, it is output on a line of its own or (e.g. in the USA) not printed.See the examples in the Address Layout Key documentation. - */ - @sap.label : 'District' - District : String(40); - /** - * Key for form of address text. - * - * You can also define a form of address text in Customizing.The form of address text can be maintained in different languages. - */ - @sap.display.format : 'UpperCase' - @sap.label : 'Title' - @sap.quickinfo : 'Form-of-Address Key' - @sap.creatable : 'false' - @sap.updatable : 'false' - FormOfAddress : String(4); - /** - * This field contains the full name or formatted name of a party. - * - * For organizations or document addresses, typically the fields Name1 and Name2 are concatenated.For persons the field contains the formatted name according to country specific rules. It corresponds e.g. to the content of the fields BUT000-NAME1_TEXT or ADRP-NAME_TEXT. - */ - @sap.label : 'Full Name' - @sap.quickinfo : 'Full name of a party (Bus. Partner, Org. Unit, Doc. address)' - @sap.creatable : 'false' - @sap.updatable : 'false' - FullName : String(80); - /** - * City of residence which is different from the postal city - * - * In some countries, the residential city is required if it differs from the postal city.In the USA, the official street indexes, against which data can be checked, are based on the residential city, not the postal city, which may be different.It is the same in France, where a postally correct address must contain the residential city in a separate line above the postal city, if it differs from the postal city.This field is not always automatically printed, as it was subsequently added to the address structure.The print program or form may need to be adjusted.This exception applies to the following fields:Street2, Street3, Street4, Street5, c/o name, and to all address fields added after Release 4.5. - */ - @sap.label : 'Different City' - @sap.quickinfo : 'City (different from postal city)' - HomeCityName : String(40); - /** - * House number as part of an address. - * - * It is printed in the Street line.Other supplementary street information can be entered in the House number supplement or one of the Street2, Street3, Street4 or Street5 fields. See Print the Street address.A house number (e.g. 117) or a house number with supplement (e.g. 117a), or a house number range (e.g. 16-20), can be maintained in this field. - */ - @sap.label : 'House Number' - HouseNumber : String(10); - /** - * House number supplement as part of an address, e.g. - * - * App. 17 orSuite 600.It is printed in the Street line.Further Street supplements can be put in one of the fields Street2, Street3, Street4 or Street5.See Print the Street address. - */ - @sap.label : 'Supplement' - @sap.quickinfo : 'House number supplement' - HouseNumberSupplementText : String(10); - /** - * The language key indicates - * - * - the language in which texts are displayed,- the language in which you enter texts,- the language in which the system prints texts. - */ - @sap.label : 'Language Key' - Language : String(2); - /** - * PO Box number as part of an address. - * - * Only enter the PO Box number in this field. The text "PO Box" is provided in the recipient language by the system when you print the address.When you print an address, the "Street address" and the "PO Box address" are distinguished. The print program determines which of them has priority if both are maintained in an address record.Besides the PO Box number, the PO Box address uses the following fields:PO Box postal code, if specified (otherwise the normal postal code)PO Box city, if specified (otherwise the normal city)PO Box region, if specified (otherwise the normal region)PO Box country, if specified (otherwise the normal country)If the address is a "PO Box" (without a number), do not fill the "PO Box" field. Select the "PO Box w/o Number" indicator instead.You can also enter a company postal code for organizational addresses, instead of a PO Box. A separate field is predefined for this entry.For general information and examples about address formatting, see the documentation on the Address Structure Key. - */ - @sap.display.format : 'UpperCase' - @sap.label : 'PO Box' - POBox : String(10); - /** - * Different city for the PO Box as an address component. - * - * The PO Box city can be entered here if it is different from the address city.If the address is only a PO Box address, enter the city in the normal city field.If the address contains two different city names for the address and the PO Box address, use this field. - */ - @sap.label : 'PO Box City' - @sap.quickinfo : 'PO Box city' - POBoxDeviatingCityName : String(40); - /** - * Different PO Box country in address. - * - * The PO Box country can be entered here, if it is different from the street address country.If the address only has a PO Box address, the country is in the normal country field.Use this field if the address has two different country values for the street address and the PO Box address.This field is not always automatically printed, as it was subsequently added to the address structure.The print program or form may need to be adjusted.This exception applies to the following fields:Street2, Street3, Street4, Street5, c/o name, and to all address fields added after Release 4.5. - */ - @sap.display.format : 'UpperCase' - @sap.label : 'PO box country' - POBoxDeviatingCountry : String(3); - /** - * Different Region for PO Box in an address. - * - * Enter the PO Box Region here, if it differs from the street address region.If the address only has a PO Box address, the Region in in the normal Region field.Use this field if the address has two different Region values for the street address and the PO Box address.This field is not always automatically printed, as it was subsequently added to the address structure.The print program or form may need to be adjusted.This exception applies to the following fields:Street2, Street3, Street4, Street5, c/o name, and to all address fields added after Release 4.5. - */ - @sap.display.format : 'UpperCase' - @sap.label : 'PO Box Region' - @sap.quickinfo : 'Region for PO Box (Country, State, Province, ...)' - POBoxDeviatingRegion : String(3); - /** - * PO Box address without PO Box number flag. - * - * Only the word 'PO Box' is output in PO Box addresses without PO Box number.Set this flag for a PO Box address without PO Box number.This field is not always automatically printed, as it was subsequently added to the address structure.The print program or form may need to be adjusted.This exception applies to the following fields:Street2, Street3, Street4, Street5, c/o name, and to all address fields added after Release 4.5. - */ - @sap.display.format : 'UpperCase' - @sap.label : 'PO Box w/o No.' - @sap.quickinfo : 'Flag: PO Box Without Number' - POBoxIsWithoutNumber : Boolean; - /** - * The PO box lobby is part of the PO box address. - * - * In some countries, entering a PO box, postal code and city is not sufficient to uniquely identify a PO box, because the same PO box number is assigned multiple times in some cities.Therefore, additional information might be required to determine the post office of the PO box in question. This information can be entered in the field "PO Box Lobby."Mr NellingPO Box 4099HighfieldTimaru 7942The PO box lobby will only be taken into account for address formatting in countries in which it is commonly used in addition to regular postal delivery and PO boxes, for example, in Canada or New Zealand. In all other countries, this field will not be taken into account for address formatting. - */ - @sap.label : 'PO Box Lobby' - POBoxLobbyName : String(40); - /** - * Postal code that is required for a unique assignment of the PO box. - * - * This field is used for countries where a different postal code applies to mail that is sent to the PO box rather than to the street address of a particular business partner.Postal codes for group major customers also have to be entered in the field for the PO box postal code since individual customers with a shared postal code for group major customers are differentiated by means of the PO box. Postal codes for major customers (= company postal codes), however, are assigned to one customer only and have to be entered in the field 'Company Postal Code'. - */ - @sap.display.format : 'UpperCase' - @sap.label : 'PO Box Postal Code' - POBoxPostalCode : String(10); - /** - * Internal key for identifying a person in Business Address Services. - * - * For more information about the meaning and use of the person number and Business Address Services concepts, see the function group SZA0 documentation. - */ - @sap.display.format : 'UpperCase' - @sap.label : 'Person number' - @sap.creatable : 'false' - @sap.updatable : 'false' - Person : String(10); - /** - * Postal code as part of the address - * - * If different postal codes are maintained for the PO Box and Street address of an address, this field contains the Street address postal code. - */ - @sap.display.format : 'UpperCase' - @sap.label : 'Postal Code' - @sap.quickinfo : 'City Postal Code' - PostalCode : String(10); - /** - * Communication method with which you can exchange documents and messages with a business partner. - * - * In Business Address Services, you can specify a standard communication method that can be used by programs to determine the means of communication for sending messages.One business partner wants all messages by fax, another by e-mail.The application context can restrict the possible methods of communication. For example, invitations should perhaps only be sent by post because of enclosures, whereas minutes can be sent by post, fax or e-mail.Communication strategies can be defined for this purpose and applied in application contexts. - */ - @sap.display.format : 'UpperCase' - @sap.label : 'Comm. Method' - @sap.quickinfo : 'Communication Method (Key) (Business Address Services)' - PrfrdCommMediumType : String(3); - /** - * In some countries, the region forms part of the address. The meaning depends on the country. - * - * The automatic address formatting function prints the region in addresses in the USA, Canada, Italy, Brazil or Australia, and the county in Great Britain.For more information, see the examples in the documentation on the Address Layout Key.Meaning of the regional code in ...Australia -> ProvinceBrazil -> StateCanada -> ProvinceGermany -> StateGreat Britain -> CountyItaly -> ProvinceJapan -> PrefectureSwitzerland -> CantonUSA -> State - */ - @sap.display.format : 'UpperCase' - @sap.label : 'Region' - @sap.quickinfo : 'Region (State, Province, County)' - Region : String(3); - /** - * Street name as part of the address. - * - * The street name is saved, redundantly in upper case in another database field, for search help purposes.There are other fields for address parts which can be printed above or below the street. See Print the Street address.The house number and other supplements are usually maintained in their own fields. See Formatting the Street line. - */ - @sap.label : 'Street' - StreetName : String(60); - /** - * Additional address field which is printed above the Street line. - * - * The Street address contains two lines above the street and two lines below the street.See Print the Street address.This field is not always automatically printed, as it was subsequently added to the address structure.The print program or form may need to be adjusted.This exception applies to the following fields:Street2, Street3, Street4, Street5, c/o name, and to all address fields added after Release 4.5. - */ - @sap.label : 'Street 2' - StreetPrefixName : String(40); - /** - * Additional address field which is printed below the Street line. - * - * The Street address contains two lines above the street and two lines below the street.See Print the Street address. - */ - @sap.label : 'Street 4' - StreetSuffixName : String(40); - /** Specifies the tax jurisdiction. */ - @sap.display.format : 'UpperCase' - @sap.label : 'Tax Jurisdiction' - TaxJurisdiction : String(15); - /** - * Sales and distribution: - * - * Regional zone of Goods recipient.Purchasing:Regional zone of supplier.You can define regional zones to suit the requirements of your own business and country.Sales and distributionthe system automatically proposes a suitable route by using the transportation zone of the goods recipient in combination with other information about the delivery, such as theCountries of origin and destinationShipping conditionsTransportation groupIn the USA, for example, you can define regional zones to correspond to the US postal zip codes. - */ - @sap.display.format : 'UpperCase' - @sap.label : 'Transportation Zone' - @sap.quickinfo : 'Transportation zone to or from which the goods are delivered' - TransportZone : String(10); - /** - * Address number from an external system or a legacy system - * - * If the current address has a different number in an external system, you can save this number here for information purposes.In direct input you are able to maintain an address for a business partner by stating the external address number. If your business partner data is maintained in a legacy system, you can thus transmit changes to a BP address to the SAP system without having to know the SAP address number in the legacy system. - */ - @sap.display.format : 'UpperCase' - @sap.label : 'External Address No.' - @sap.quickinfo : 'Address number in external system' - AddressIDByExternalSystem : String(20); - @cds.ambiguous : 'missing on condition?' - to_AddressUsage : Association to many API_BUSINESS_PARTNER.A_BuPaAddressUsage { }; - @cds.ambiguous : 'missing on condition?' - to_EmailAddress : Association to many API_BUSINESS_PARTNER.A_AddressEmailAddress { }; - @cds.ambiguous : 'missing on condition?' - to_FaxNumber : Association to many API_BUSINESS_PARTNER.A_AddressFaxNumber { }; - @cds.ambiguous : 'missing on condition?' - to_MobilePhoneNumber : Association to many API_BUSINESS_PARTNER.A_AddressPhoneNumber { }; - @cds.ambiguous : 'missing on condition?' - to_PhoneNumber : Association to many API_BUSINESS_PARTNER.A_AddressPhoneNumber { }; - @cds.ambiguous : 'missing on condition?' - to_URLAddress : Association to many API_BUSINESS_PARTNER.A_AddressHomePageURL { }; -}; - -@cds.external : true -@cds.persistence.skip : true -@sap.content.version : '1' -@sap.label : 'Bank' -entity API_BUSINESS_PARTNER.A_BusinessPartnerBank { - /** Key identifying a business partner in the SAP system. The key is unique within a client. */ - @sap.display.format : 'UpperCase' - @sap.label : 'Business Partner' - @sap.quickinfo : 'Business Partner Number' - key BusinessPartner : String(10) not null; - /** - * Key identifying a business partner's bank details. - * - * Enter a bank details ID for each separate set of bank details for a business partner.Business Partner: H. MillerBD-ID Fin.institution Acct no. 0001 Chemical Bank, NYC 56234560002 Chemical Bank, NYC 56231220003 First Bank of Pittsburgh ...Business partner: T.Wolsey and Co.BD-ID Fin.institution Acct no.GIR0 Citibank, Charleston ...GIR1 Chemical Bank, NYC ... - */ - @sap.display.format : 'UpperCase' - @sap.label : 'Bank details ID' - key BankIdentification : String(4) not null; - /** - * Identifies the country in which the bank is based. - * - * The country key determines according to which rules the remaining bank data (for example, bank number and bank account number) is checked. - */ - @sap.display.format : 'UpperCase' - @sap.label : 'Bank Country' - @sap.quickinfo : 'Bank Country Key' - BankCountryKey : String(3); - /** The name under which the bank operates. */ - @sap.label : 'Bank Name' - @sap.creatable : 'false' - @sap.updatable : 'false' - BankName : String(60); - /** - * The bank key (under which the bank data is stored in the appropriate country) is specified in this field. - * - * The country-specific meaning of this bank key is specified when defining country key.Normally banks have a bank number, which then also appears in the control data of the bank.In certain countries the bank account number assumes this function; in such a case there would be no bank numbers, the bank details are then under the account number.For data medium exchange it can be useful to be able create banks for foreign business partners without a bank number, even if the country in question has bank numbers. In such cases the bank key can be assigned internally.If the bank data is under another key, such as the SWIFT code for example, numbers can also be assigned externally. - */ - @sap.display.format : 'UpperCase' - @sap.label : 'Bank Key' - BankNumber : String(15); - /** - * Uniquely identifies a bank throughout the world. - * - * SWIFT stands for Society for Worldwide Interbank Financial Telecommunication.BIC stands for Bank Identifier Code.This globally unique code can be used in international payment transactions to identify the bank without the need to specify an address or bank number. Specification of the SWIFT code/BIC is mainly relevant for automatic payment transactions. - */ - @sap.display.format : 'UpperCase' - @sap.label : 'SWIFT/BIC' - @sap.quickinfo : 'SWIFT/BIC for International Payments' - @sap.creatable : 'false' - @sap.updatable : 'false' - SWIFTCode : String(11); - /** - * Brazil, France, Spain, Portugal and Italy - * - * The field contains a check key for the combination bank number and bank account number.USAIn USA this field is used to differentiate between a savings and a current account (if no value is entered, the default value 01 is used).01 Current account02 Savings account03 Loan account04 General ledgerJapanIn Japan this field specifies the type of account. This information is is copied from the payment medium print program into payment medium. The following is an example of the account types used:01 FUTSU (similar to a savings account)02 TOUZA (similar to a current account)04 CHOCHIKU (similar to an investment account)09 Other types of bank accountsSouth AfricaIn South Africa this field specifies the type of account. The information entered here is forwarded to the bank that carries out the payment order. The following account types are permitted in ABC format:01 Current (Cheque) Account02 Savings Account03 Transmission Account04 Bond Account06 Subscription Share AccountArgentinaIn Argentina this field specifies the type of account:CC Current Account (Cuenta corriente)CA Saving Account (Caja de ahorro)CE Special Saving Account (Caja de ahorro especial)CS Salary Account (Cuenta sueldos)VenezuelaIn Venezuela this field specifies the type of account:CC Checking Account (Cuenta corriente)CA Saving Account (Cuenta de ahorro)CE Special Saving Account (Cuenta de ahorro especial)CS Salary Account (Cuenta sueldos)MexicoIn Mexico this field contains a two-digit key for classifying the bank account (for example, as a savings or current account). This key have different definitions, depending on the bank.NoteFor countries that are not listed here, this field can be used for account-specific information. - */ - @sap.display.format : 'UpperCase' - @sap.label : 'Bank Control Key' - BankControlKey : String(2); - /** Here you can enter another name that the payment program can use if the name of the account holder is not the same as the name of the Business Partner. */ - @sap.label : 'Account Holder' - @sap.quickinfo : 'Account Holder Name' - BankAccountHolderName : String(60); - @sap.label : 'Account Name' - @sap.quickinfo : 'Name of Bank Account' - BankAccountName : String(40); - @odata.Type : 'Edm.DateTimeOffset' - @sap.label : 'Valid From' - @sap.quickinfo : 'Validity Start of Business Partner Bank Details' - ValidityStartDate : DateTime; - @odata.Type : 'Edm.DateTimeOffset' - @sap.label : 'Valid To' - @sap.quickinfo : 'Validity End of Business Partner Bank Details' - ValidityEndDate : DateTime; - /** - * A uniform standardized ID number for representing bank details that is in accordance with the ECBS (European Committee for Banking Standards). An IBAN has a maximum of 34 alphanumeric characters and is a combination of the following elements: - * - * Country key of the bank (ISO code)Two-digit check numberCountry-specific account number (in Germany this consists of the bank number and account number, in France the bank number, account number and check key).The IBAN not only makes international payments easier, in some countries it has advantages for domestic payments as well. Depending on the country, it can mean advantages for value and fees.The IBAN can be maintained in parallel with the bank details but does not replace them. It is stored under the master data of the business partner and can then be used when creating the payment medium.Since it is only the bank that has the account that may generate the IBAN corresponding to an account number, the SAP system only generates a proposal. You can confirm or change this proposal. If no proposal is generated, enter the IBAN manually.An IBAN in Belgium may look like this:Electronic Form:BE62510007547061Printed form, as it would appear on an invoice:IBAN BE62 5100 0754 7061 - */ - @sap.display.format : 'UpperCase' - @sap.label : 'IBAN' - @sap.quickinfo : 'IBAN (International Bank Account Number)' - IBAN : String(34); - @sap.display.format : 'Date' - @sap.label : 'IBAN valid from' - @sap.quickinfo : 'Validity start of IBAN' - IBANValidityStartDate : Date; - /** This field contains the number under which the account is managed at the bank. */ - @sap.display.format : 'UpperCase' - @sap.label : 'Bank Account' - @sap.quickinfo : 'Bank Account Number' - BankAccount : String(18); - /** - * Additional details for the bank details of the business partner. - * - * In some countries the data for the bank details of the business partner (bank number, bank account number, name of the account holder) have to supplemented by other details in order to be able to use certain payment processes. This supplementary details are defined here.If additional data is required for the bank details for payment transactions in your country (see the following examples), enter the reference information.If for an automatic debit the bank requires the reference number of the collection authorization in Norway or Great Britain, specify this number here.In Great Britain when making payments to an account in a 'Building Society' you must specify which number payment recipient has. These details must be defined in the reference field, whereas the fields Bank Key and Account Number are to be used for the bank details of the 'Building Society'.In Great Britain when entering a building society account number, the name of the building society should also be maintained in the system. - */ - @sap.display.format : 'UpperCase' - @sap.label : 'Reference Details' - @sap.quickinfo : 'Reference Details for Bank Details' - BankAccountReferenceText : String(20); - /** - * States that the bank has collection authorization from the business partner for the account. - * - * Set this indicator if the bank has collection authorization.Note for Accounts Receivable (FI-AR)If this indicator is not set, there is no bank collection.Note for Contract Accounts Receivable and Payable (FI-CA)This indicator is not relevant. - */ - @sap.display.format : 'UpperCase' - @sap.label : 'Collect.author.' - @sap.quickinfo : 'Indicator: Collection Authorization' - CollectionAuthInd : Boolean; - /** Name of the city as a part of the address. */ - @sap.label : 'City' - @sap.creatable : 'false' - @sap.updatable : 'false' - CityName : String(35); - /** - * You can use authorization groups to stipulate which business partners a user is allowed to process. - * - * Use the following authorization object:'Business partners: authorization groups' (B_BUPA_GRP).The system only checks this authorization if you made an entry in the "Authorization group" field for the business partner. Otherwise, any user may process the business partner. - */ - @sap.display.format : 'UpperCase' - @sap.label : 'Authorization Group' - AuthorizationGroup : String(4); -}; - -@cds.external : true -@cds.persistence.skip : true -@sap.content.version : '1' -@sap.label : 'Contact' -entity API_BUSINESS_PARTNER.A_BusinessPartnerContact { - /** The business partner relationship number is an internal number that identifies the business partner relationship set. */ - @sap.display.format : 'UpperCase' - @sap.label : 'BP Relationship No.' - @sap.quickinfo : 'BP Relationship Number' - key RelationshipNumber : String(12) not null; - /** Key identifying a business partner in the SAP system. The key is unique within a client. */ - @sap.display.format : 'UpperCase' - @sap.label : 'Business Partner' - @sap.quickinfo : 'Business Partner Number' - key BusinessPartnerCompany : String(10) not null; - /** Key identifying a business partner in the SAP system. The key is unique within a client. */ - @sap.display.format : 'UpperCase' - @sap.label : 'Business Partner' - @sap.quickinfo : 'Business Partner Number' - key BusinessPartnerPerson : String(10) not null; - @sap.display.format : 'Date' - @sap.label : 'Valid To' - @sap.quickinfo : 'Validity Date (Valid To)' - key ValidityEndDate : Date not null; - @sap.display.format : 'Date' - @sap.label : 'Valid From' - @sap.quickinfo : 'Validity Date (Valid From)' - ValidityStartDate : Date; - /** - * States whether the relationship is a standard relationship. - * - * If several relationships of the BP relationship category contact person have been defined for, you can set the indicator standard relationship for one of these relationships.A relationship that is marked as a standard relationship can be used whenA certain scenario automatically selects a contact personThe contact person responsible is not knownYou can give this indicator to only one business partner relationship of a BP relationship category for a particular period. Another relationship of the same relationship category can be indicated as the standard relationship only if the periods for the relationship do not overlap or coincide. - */ - @sap.display.format : 'UpperCase' - @sap.label : 'Standard' - @sap.quickinfo : 'Standard Relationship' - IsStandardRelationship : Boolean; - /** - * A relationship may exist between two business partners. The business partner relationship category characterizes the features of the relationship. - * - * A distinction is made between a one-way and an undirected business partner relationship category. In a one-way relationship category, the relationship extends from one partner to another, but not vice versa.Marriage (undirected)Employee (one-way)Contact person (one-way) - */ - @sap.display.format : 'UpperCase' - @sap.label : 'Relationship Cat.' - @sap.quickinfo : 'Business Partner Relationship Category' - RelationshipCategory : String(6); - @cds.ambiguous : 'missing on condition?' - to_ContactAddress : Association to many API_BUSINESS_PARTNER.A_BPContactToAddress { }; - @cds.ambiguous : 'missing on condition?' - to_ContactRelationship : Association to API_BUSINESS_PARTNER.A_BPContactToFuncAndDept { }; -}; - -@cds.external : true -@cds.persistence.skip : true -@sap.deletable : 'false' -@sap.content.version : '1' -@sap.label : 'Role' -entity API_BUSINESS_PARTNER.A_BusinessPartnerRole { - /** Key identifying a business partner in the SAP system. The key is unique within a client. */ - @sap.display.format : 'UpperCase' - @sap.label : 'Business Partner' - @sap.quickinfo : 'Business Partner Number' - key BusinessPartner : String(10) not null; - /** - * Function that a business partner takes on, depending on a business transaction. - * - * You can define business partner roles along with their attributes in Customizing.You can create an alphanumeric, 6-digit key for the BP role. You can also choose a title as the short form and a description as the long form for the role text.Screen control in the dialog takes place by assigning a BP view.A program can access specific business partner roles for a business partner using thebusiness partner role category . The role categories are also in the TB003 table. - */ - @sap.display.format : 'UpperCase' - @sap.label : 'BP Role' - key BusinessPartnerRole : String(6) not null; - @odata.Type : 'Edm.DateTimeOffset' - @sap.label : 'Valid From' - @sap.quickinfo : 'Validity Start of a BP Role' - ValidFrom : DateTime; - @odata.Type : 'Edm.DateTimeOffset' - @sap.label : 'Valid To' - @sap.quickinfo : 'Validity End of a BP Role' - ValidTo : DateTime; - /** - * You can use authorization groups to stipulate which business partners a user is allowed to process. - * - * Use the following authorization object:'Business partners: authorization groups' (B_BUPA_GRP).The system only checks this authorization if you made an entry in the "Authorization group" field for the business partner. Otherwise, any user may process the business partner. - */ - @sap.display.format : 'UpperCase' - @sap.label : 'Authorization Group' - AuthorizationGroup : String(4); -}; - -@cds.external : true -@cds.persistence.skip : true -@sap.content.version : '1' -@sap.label : 'Tax Number' -entity API_BUSINESS_PARTNER.A_BusinessPartnerTaxNumber { - /** Key identifying a business partner in the SAP system. The key is unique within a client. */ - @sap.display.format : 'UpperCase' - @sap.label : 'Business Partner' - @sap.quickinfo : 'Business Partner Number' - key BusinessPartner : String(10) not null; - /** Specifies the tax number category. */ - @sap.display.format : 'UpperCase' - @sap.label : 'Tax Number Category' - key BPTaxType : String(4) not null; - /** Specifies the tax number. */ - @sap.display.format : 'UpperCase' - @sap.label : 'Tax number' - @sap.quickinfo : 'Business Partner Tax Number' - BPTaxNumber : String(20); - /** - * Specifies the tax number. - * - * You can enter up to 60 characters in this field. - */ - @sap.display.format : 'UpperCase' - @sap.label : 'Tax Number' - @sap.quickinfo : 'Business Partner Tax Number' - BPTaxLongNumber : String(60); - /** - * You can use authorization groups to stipulate which business partners a user is allowed to process. - * - * Use the following authorization object:'Business partners: authorization groups' (B_BUPA_GRP).The system only checks this authorization if you made an entry in the "Authorization group" field for the business partner. Otherwise, any user may process the business partner. - */ - @sap.display.format : 'UpperCase' - @sap.label : 'Authorization Group' - AuthorizationGroup : String(4); -}; - -@cds.external : true -@cds.persistence.skip : true -@sap.creatable : 'false' -@sap.deletable : 'false' -@sap.content.version : '1' -@sap.label : 'Customer' -entity API_BUSINESS_PARTNER.A_Customer { - /** Gives an alphanumeric key, which clearly identifies the customer or vendor in the SAP system. */ - @sap.display.format : 'UpperCase' - @sap.label : 'Customer' - @sap.quickinfo : 'Customer Number' - key Customer : String(10) not null; - /** The authorization group allows extended authorization protection for particular objects. The authorization groups are freely definable. The authorization groups usually occur in authorization objects together with an activity. */ - @sap.display.format : 'UpperCase' - @sap.label : 'Authorization' - @sap.quickinfo : 'Authorization Group' - AuthorizationGroup : String(4); - /** - * Indicates if the processing of billing documents is blocked for the customer in all sales areas (company-wide, for example). - * - * You can define different kinds of block, according to the needs of your organization. You can, for example, automatically block the processing of all credit memos to a certain customer, pending manual approval. - */ - @sap.display.format : 'UpperCase' - @sap.label : 'Billing Block' - @sap.quickinfo : 'Central Billing Block for Customer' - BillingIsBlockedForCustomer : String(2); - /** Name with which the user who entered the master record was logged on in the R/3 System. */ - @sap.display.format : 'UpperCase' - @sap.label : 'Created by' - @sap.quickinfo : 'Name of Person who Created the Object' - @sap.creatable : 'false' - @sap.updatable : 'false' - CreatedByUser : String(12); - /** Date on which the master record, or the part of the master record being viewed, was created. */ - @sap.display.format : 'Date' - @sap.label : 'Created on' - @sap.quickinfo : 'Date on which the Record Was Created' - @sap.creatable : 'false' - @sap.updatable : 'false' - CreationDate : Date; - /** - * The account group is a classifying feature within customer master records. The account group determines: - * - * in which number range the customer account number should be;whether the number is assigned by the user or by the system;which specifications are necessary or possible in the master record. - */ - @sap.display.format : 'UpperCase' - @sap.label : 'Account Group' - @sap.quickinfo : 'Customer Account Group' - CustomerAccountGroup : String(4); - /** - * Specifies a classification of the customer (for example, classifies the customer as a bulk purchaser). - * - * The classifications are freely definable according to the needs of your organization. - */ - @sap.display.format : 'UpperCase' - @sap.label : 'Customer Classific.' - @sap.quickinfo : 'Customer Classification' - CustomerClassification : String(2); - @sap.display.format : 'UpperCase' - @sap.label : 'Customer Name' - @sap.quickinfo : 'Customer Full Name' - @sap.creatable : 'false' - @sap.updatable : 'false' - CustomerFullName : String(220); - @sap.label : 'Name of Customer' - @sap.creatable : 'false' - @sap.updatable : 'false' - CustomerName : String(80); - /** - * Indicates if delivery processing is blocked for the customer in all sales areas (company-wide, for example). - * - * You can define different kinds of block, according to the needs of your organization. You can, for example, automatically block all deliveries to a certain customer for credit reasons. - */ - @sap.display.format : 'UpperCase' - @sap.label : 'Delivery block' - @sap.quickinfo : 'Central delivery block for the customer' - DeliveryIsBlocked : String(2); - /** - * Denotes a natural person. - * - * In the following countries, the system needs to know whether the taxpayer is a legal or natural person so that it can check the tax numbers correctly:BrazilBulgariaColombiaCroatiaGreeceItalyMexicoPeruSloveniaThailandUkraineThe flag is also used in conjunction with the Statement of Payments to Natural Persons report, as used in the Czech Republic and in Slovakia. This report only covers customers and vendors for whom you have set this indicator.In South Korea, it is used in conjunction with the Generic Withholding Tax Reporting program. - */ - @sap.display.format : 'UpperCase' - @sap.label : 'Natural Person' - NFPartnerIsNaturalPerson : String(1); - /** - * Indicates if sales order processing is blocked for the customer in all sales areas (company-wide, for example). - * - * If you block sales order processing, the block counts for the following partner functions of the customer:Sold-to partyShip-to partyPayerIf you want to process an order where the ship-to party differs from the sold-to party, and the ship-to party is blocked, you cannot process the order.You can define different kinds of block, according to the needs of your organization. You can, for example, automatically block all free of charge deliveries and credit memo requests for a certain customer, pending manual approval before further processing can take place. - */ - @sap.display.format : 'UpperCase' - @sap.label : 'Order Block' - @sap.quickinfo : 'Central Order Block for Customer' - OrderIsBlockedForCustomer : String(2); - /** - * Indicates that the account is blocked for posting for all company codes. - * - * If you set this indicator, the system prevents users from posting items to this account and issues an error message to inform them that the account is blocked. - */ - @sap.display.format : 'UpperCase' - @sap.label : 'Posting Block' - @sap.quickinfo : 'Central Posting Block' - PostingIsBlocked : Boolean; - /** Specifies an alphanumeric key that uniquely identifies the supplier in the SAP system. */ - @sap.display.format : 'UpperCase' - @sap.label : 'Supplier' - @sap.quickinfo : 'Account Number of Supplier' - Supplier : String(10); - /** - * If the customer or the vendor belongs to a group, you can enter a group key here. The group key is freely assignable. - * - * If you create a matchcode using this group key, group evaluations are possible. - */ - @sap.display.format : 'UpperCase' - @sap.label : 'Group Key' - CustomerCorporateGroup : String(10); - /** Account number of another master record in which the official address is stored. This address is used, for example, for tax reports to the tax authorities in Italy. */ - @sap.display.format : 'UpperCase' - @sap.label : 'Fiscal address' - @sap.quickinfo : 'Account number of the master record with the fiscal address' - FiscalAddress : String(10); - /** - * An industry is a distinct group of companies with the same basic business activity. The industry key is used in selecting data for evaluations (for example, a vendor master data list). You can specify industries such as trade, banking, service, manufacturing, health care, public service, media and so on. - * - * The industry field belongs to the general data area of customer and vendor master records. - */ - @sap.display.format : 'UpperCase' - @sap.label : 'Industry' - @sap.quickinfo : 'Industry key' - @sap.creatable : 'false' - @sap.updatable : 'false' - Industry : String(4); - /** - * Specifies the code that uniquely identifies the industry (or industries) of the customer. - * - * Depending on the standards your organization uses (for example, Standard Industry Codes (SIC)), enter the appropriate code. You can assign more than one industry code to a customer by choosing Create more. - */ - @sap.display.format : 'UpperCase' - @sap.label : 'Industry Code 1' - @sap.creatable : 'false' - @sap.updatable : 'false' - IndustryCode1 : String(10); - /** - * Specifies an additional code that identifies the industry (or industries) of the customer. - * - * Depending on the standards your organization uses (for example, Standard Industry Codes (SIC)), enter the appropriate code. - */ - @sap.display.format : 'UpperCase' - @sap.label : 'Industry Code 2' - @sap.creatable : 'false' - @sap.updatable : 'false' - IndustryCode2 : String(10); - /** - * Specifies an additional code that identifies the industry (or industries) of the customer. - * - * Depending on the standards your organization uses (for example, Standard Industry Codes (SIC)), enter the appropriate code. - */ - @sap.display.format : 'UpperCase' - @sap.label : 'Industry Code 3' - @sap.creatable : 'false' - @sap.updatable : 'false' - IndustryCode3 : String(10); - /** - * Specifies an additional code that identifies the industry (or industries) of the customer. - * - * Depending on the standards your organization uses (for example, Standard Industry Codes (SIC)), enter the appropriate code. - */ - @sap.display.format : 'UpperCase' - @sap.label : 'Industry Code 4' - @sap.creatable : 'false' - @sap.updatable : 'false' - IndustryCode4 : String(10); - /** - * Specifies an additional code that identifies the industry (or industries) of the customer. - * - * Depending on the standards your organization uses (for example, Standard Industry Codes (SIC)), enter the appropriate code. - */ - @sap.display.format : 'UpperCase' - @sap.label : 'Industry Code 5' - @sap.creatable : 'false' - @sap.updatable : 'false' - IndustryCode5 : String(10); - /** - * Here you enter the first 7 digits of the international location number. - * - * The International Location Number (ILN) is assigned (in Germany by the Centrale for Coorganisation GmbH)) when a company is founded. It consists of 13 digits, the last digit being the check digit. There are two categories of location numbers:Participants who only need an ILN to cleary and unmistakably identify themselves for communication with the business partner are given a category 1 ILN. This cannot be used to identify articles by means of EAN.Participants who wish to assign the location numbers for their own enterprise areas are given a category 2 ILN. For a category 2 ILN, digits 1 to 7 are described as basis number. This is used as basis for the creation of article numbers (EAN). - */ - @sap.display.format : 'NonNegative' - @sap.label : 'Int. location no. 1' - @sap.quickinfo : 'International location number (part 1)' - InternationalLocationNumber1 : String(7); - /** - * Specifies a regional division according to the market categories created by the A. C. Nielsen company. - * - * By allocating a Nielsen division, you can use the services of the Nielsen Institute to create a market analysis of your customers. - */ - @sap.display.format : 'UpperCase' - @sap.label : 'Nielsen Indicator' - @sap.quickinfo : 'Nielsen ID' - NielsenRegion : String(2); - /** Classification of companies according to tax aspects. */ - @sap.display.format : 'UpperCase' - @sap.label : 'Tax type' - ResponsibleType : String(2); - /** - * Specifies the tax number. - * - * Enter the appropriate tax number:Country Tax NumberArgentina CUIT number or CUIL numberBelgium Enterprise numberBrazil CNPJ numberBulgaria Unified identification codeChile RUT numberChina VAT registration number (shui wu deng ji hao)Colombia NIT numberCroatia Legal persons: company identification numberNatural persons: JMBG numberCzech Republic DIC numberFrance SIRET numberGreece Personal IDHungary Tax numberItaly Fiscal codeKazakhstan RNN (obsolete)Mexico RFC numberNetherlands SI registration number (Aansluitnummer UWV) of chain- liability vendorNorway VAT numberPeru RUC numberPhilippines Taxpayer identification number (see below)Poland NIP numberPortugal NIF numberRomania Tax numberRussia INNSlovakia DIC numberSlovenia Tax numberSouth Korea Natural persons: Personal identification numberLegal persons: Corporation IDSpain NIF numberSwitzerland UID numberTaiwan - China GUI registration numberThailand Personal IDTurkey Name of business partner's tax officeUkraine Taxpayer identification numberUnited Kingdom Company registration numberUnited States Social security numberVenezuela RIF numberIn the Philippines, enter the taxpayer identification number with a V or N at the end, as follows:If the business partner is liable to VAT: 999-999-999-999VIf the business partner is not liable to VAT: 999-999-999-999N - */ - @sap.display.format : 'UpperCase' - @sap.label : 'Tax Number 1' - @sap.creatable : 'false' - @sap.updatable : 'false' - TaxNumber1 : String(16); - /** - * Specifies the tax number. - * - * Enter the appropriate tax number:Country Tax NumberArgentina NIP number or CM numberBelgium VAT numberBrazil CPF numberBulgaria Legal persons: tax numberNatural persons: personal IDCroatia OIB number Czech Republic ICO numberFrance SIREN numberGreece AFM numberIndia TINItaly VAT numberKazakhstan BC (Beneficiary Code)Netherlands BSN numberRussia OKPO codeSlovakia ICO numberSouth Korea VAT registration numberSweden Organization registration numberSwitzerland VAT numberTaiwan - China Tax registration numberUkraine Legal persons: USREOU numberNatural persons: SRNP numberTurkey Tax numberUnited Kingdom NI numberUnited States Employer identification numberVenezuela NIT number - */ - @sap.display.format : 'UpperCase' - @sap.label : 'Tax Number 2' - @sap.creatable : 'false' - @sap.updatable : 'false' - TaxNumber2 : String(11); - /** - * Specifies the tax number. - * - * Enter the tax number that applies:Country Tax numberArgentina Withholding agent numberBrazil State tax numberBulgaria Social security numberMexico CURP numberKazakhstan BINNetherlands Tax registration number (Loonbelastingnummer) of the chain-liability vendorRussia KPP numberThailand Tax ID Ukraine VAT registration number - */ - @sap.display.format : 'UpperCase' - @sap.label : 'Tax Number 3' - @sap.creatable : 'false' - @sap.updatable : 'false' - TaxNumber3 : String(18); - /** - * Specifies the tax number. - * - * Enter the appropriate tax number:Country Tax NumberBrazil Municipal tax numberKazakhstan IINRussia OFK number (for public bodies only) - */ - @sap.display.format : 'UpperCase' - @sap.label : 'Tax Number 4' - @sap.creatable : 'false' - @sap.updatable : 'false' - TaxNumber4 : String(18); - /** - * Kazakhstan - * - * Specifies the certificate of registration as VAT payer in the following format: XXXXXYYYYYYYZZZZZZZZ, where: XXXXX is the certificate serial number, YYYYYYY is the certificate number and ZZZZZZZZ is the date of certificate issue. - */ - @sap.display.format : 'UpperCase' - @sap.label : 'Tax Number 5' - @sap.creatable : 'false' - @sap.updatable : 'false' - TaxNumber5 : String(60); - /** - * Taxes in Argentina: - * - * The format and the check of tax number 1 depend on the two-digit tax number type.The tax number type is an identification type for tax in Argentina (for example, 80 for CUIT) and is used for the DGI tax report. - */ - @sap.display.format : 'UpperCase' - @sap.label : 'Tax Number Type' - TaxNumberType : String(2); - /** - * VAT registration number (VAT reg.no.) of the customer, vendor or your company code. - * - * The VAT registration number is used within the EU for tax-exempt deliveries for the "EC sales list". The check rules are defined for each EU country and cannot be changed. - */ - @sap.display.format : 'UpperCase' - @sap.label : 'VAT Registration No.' - @sap.quickinfo : 'VAT Registration Number' - VATRegistration : String(20); - /** - * Indicates that all data in this master record is to be deleted. - * - * To delete this data, you have to run the archiving program for Accounts Receivable or Payable. This program will archive all master records marked for deletion provided that there is no dependent data in them.Deletion flags can also be used in the program for deleting master data. You should, however, run this program only to delete test data prior to production startup. - */ - @sap.display.format : 'UpperCase' - @sap.label : 'Deletion flag' - @sap.quickinfo : 'Central Deletion Flag for Master Record' - DeletionIndicator : Boolean; - @cds.ambiguous : 'missing on condition?' - to_CustomerCompany : Association to many API_BUSINESS_PARTNER.A_CustomerCompany { }; - @cds.ambiguous : 'missing on condition?' - to_CustomerSalesArea : Association to many API_BUSINESS_PARTNER.A_CustomerSalesArea { }; -}; - -@cds.external : true -@cds.persistence.skip : true -@sap.deletable : 'false' -@sap.content.version : '1' -@sap.label : 'Customer Company' -entity API_BUSINESS_PARTNER.A_CustomerCompany { - /** Gives an alphanumeric key, which clearly identifies the customer or vendor in the SAP system. */ - @sap.display.format : 'UpperCase' - @sap.label : 'Customer' - @sap.quickinfo : 'Customer Number' - key Customer : String(10) not null; - /** The company code is an organizational unit within financial accounting. */ - @sap.display.format : 'UpperCase' - @sap.label : 'Company Code' - key CompanyCode : String(4) not null; - /** Contains settings that control how the system handles differences between the invoice amount and the amount received from a customer or the amount paid to a supplier. A tolerance group is unique within a company code. */ - @sap.display.format : 'UpperCase' - @sap.label : 'Tolerance Group' - @sap.quickinfo : 'Tolerance Group for Business Partner/G/L Account' - APARToleranceGroup : String(4); - /** This field contains the account number the company is listed under at the customer. */ - @sap.display.format : 'UpperCase' - @sap.label : 'Account at customer' - @sap.quickinfo : 'Our account number at customer' - AccountByCustomer : String(12); - /** - * Identification code for the accounting clerk. - * - * The name of the accounting clerk defined by this identification code can be used in the payment program for correspondence and reporting (for example, open item lists). - */ - @sap.display.format : 'UpperCase' - @sap.label : 'Clerk Abbrev.' - @sap.quickinfo : 'Accounting Clerk Abbreviation' - AccountingClerk : String(2); - @sap.label : 'Acctg clerk''s fax' - @sap.quickinfo : 'Accounting clerk''s fax number at the customer/vendor' - AccountingClerkFaxNumber : String(31); - @sap.label : 'Clrk''s internet add.' - @sap.quickinfo : 'Internet address of partner company clerk' - AccountingClerkInternetAddress : String(130); - @sap.display.format : 'UpperCase' - @sap.label : 'Acct.clerks tel.no.' - @sap.quickinfo : 'Accounting clerk''s telephone number at business partner' - AccountingClerkPhoneNumber : String(30); - /** - * - * - * Account number of the customer for whom automatic payment transactions are to be carried out.The account number is only needed if bank collections are not to be made via the customer who owes the receivables. The same applies to refunds of payables.The specification in this field only applies to this company code. There is another field in which you can enter an alternative payee for all company codes. If both fields are filled, the specification for the company code has priority. - */ - @sap.display.format : 'UpperCase' - @sap.label : 'Alternative payer' - @sap.quickinfo : 'Account number of an alternative payer' - AlternativePayerAccount : String(10); - /** The authorization group allows extended authorization protection for particular objects. The authorization groups are freely definable. The authorization groups usually occur in authorization objects together with an activity. */ - @sap.display.format : 'UpperCase' - @sap.label : 'Authorization' - @sap.quickinfo : 'Authorization Group' - AuthorizationGroup : String(4); - /** Indicator which specifies at what intervals the collective invoices are to be created for the customer. */ - @sap.display.format : 'UpperCase' - @sap.label : 'Coll.Invoice Variant' - @sap.quickinfo : 'Collective Invoice Variant' - CollectiveInvoiceVariant : String(1); - /** - * Internal memo of the accounting department. - * - * The memo serves only as information on special features of the customer/vendor. - */ - @sap.label : 'Account Memo' - @sap.quickinfo : 'Memo' - CustomerAccountNote : String(30); - /** - * This field contains the account number of the head office. - * - * This account number is only specified for branch accounts. All postings for which the account number of the branch is specified, are automatically posted to the head office account. The account number of the branch affected is noted in the line items.No line items or balances are managed in the branch account. - */ - @sap.display.format : 'UpperCase' - @sap.label : 'Head office' - @sap.quickinfo : 'Head office account number (in branch accounts)' - CustomerHeadOffice : String(10); - /** - * Indicates that during automatic payment transactions clearing is made with the corresponding vendor account, and that during manual clearing procedures, the items of that vendor account are also selected. - * - * To use this function in automatic payment transactions, you have toenter the vendor account number in the customer master record,enter the customer account number in the vendor master record, andselect the "Clearing with customer" indicator in the vendor master record.If you set this indicator, the system will also include items of the vendor account in customer dunning. - */ - @sap.display.format : 'UpperCase' - @sap.label : 'Clearing with vendor' - @sap.quickinfo : 'Indicator: Clearing between customer and vendor ?' - CustomerSupplierClearingIsUsed : Boolean; - /** All bank data is determined using this key. */ - @sap.display.format : 'UpperCase' - @sap.label : 'House Bank' - @sap.quickinfo : 'Short Key for a House Bank' - HouseBank : String(5); - /** Enter an interest calculation indicator here if the account is to be included in automatic interest calculation. */ - @sap.display.format : 'UpperCase' - @sap.label : 'Interest indicator' - @sap.quickinfo : 'Interest calculation indicator' - InterestCalculationCode : String(2); - /** - * The date in this field displays the last time the interest calculation program processed this account. This is generally the upper limit of the last interest run. - * - * Generally, this date is automatically maintained by the program (batch input). A manual entry in this field should only be made if an error has occurred or when implementing the interest calculation. - */ - @sap.display.format : 'Date' - @sap.label : 'Last Key Date' - @sap.quickinfo : 'Key Date of Last Interest Calculation' - InterestCalculationDate : Date; - /** - * Indicates that payment transactions and dunning notices are created for the branch. - * - * Normally automatic payment transactions and dunning notices are created for the head office.NoteSelect this indicator only if this account is a head office account. - */ - @sap.display.format : 'UpperCase' - @sap.label : 'Local Processing' - @sap.quickinfo : 'Indicator: Local Processing?' - IsToBeLocallyProcessed : Boolean; - /** If this indicator is set, every customer/vendor open item is paid separately during automatic payment transactions. This means that open items are not grouped together for payment. */ - @sap.display.format : 'UpperCase' - @sap.label : 'Individual Payment' - @sap.quickinfo : 'Indicator: Pay All Items Separately?' - ItemIsToBePaidSeparately : Boolean; - /** - * Indicates the layout rule for the Allocation field in the document line item. - * - * The system uses a standard sort sequence for displaying line items. Among other things, it sorts the items according to the content of the Allocation field. This field can be filled either manually or automatically (by the system) when a document line item is entered.For this purpose, the system requires rules that determine which information is to be taken from the document header or from the document line item and placed in the field. The rules can be stored in the master record of an account which enables you to determine the standard sort sequence on an account-specific basis.NoteField information from another document line item cannot be adopted into the field of a particular item. - */ - @sap.display.format : 'UpperCase' - @sap.label : 'Sort Key' - @sap.quickinfo : 'Key for Sorting According to Assignment Numbers' - LayoutSortingRule : String(3); - /** - * Block key (enqueue key) that is used to block an open item or an account to payment transactions. - * - * You can use the block key as described below.Automatic Payment TransactionsIn automatic payment transactions, the block takes effect when it is entered in the system as follows:In the master recordIn the documentIf you enter the block in the master record then all open items for this account are contained in the exception list.The following block keys have a special meaning in the master record:The block key * has the effect that all items of the account are skipped in automatic payment transactions.The block key + has the effect that all items are skipped in which a payment method was not entered explicitly.The block key A is always set automatically when a down payment is entered. Therefore, you must not delete the block key A or use it for other purposes.Whether a block key can be set or removed in payment proposal processing depends on the attribute Changeable in payment proposal of the block key.Manual PaymentsManual payments are only affected by a block key in the document if you set the attribute Blocked for manual payments in the block key.A block key that was set in the master record does not have any effect on manual payments. You can have the system issue a warning message in that case. To do so, you have to make system settings. Set up message 671 of work area F5 in message control accordingly. - */ - @sap.display.format : 'UpperCase' - @sap.label : 'Payment Block' - @sap.quickinfo : 'Block Key for Payment' - PaymentBlockingReason : String(1); - /** - * List of payment methods which may be used in automatic payment transactions with this customer/vendor if you do not specify a payment method in the item to be paid. - * - * If you do specify a particular payment method in the item to be paid, this specification has priority over the specifications in the master record. You may also specify payment methods in the item which are not listed in the master record. - */ - @sap.display.format : 'UpperCase' - @sap.label : 'Payment Methods' - @sap.quickinfo : 'List of Respected Payment Methods' - PaymentMethodsList : String(10); - /** - * Key for defining payment terms composed of cash discount percentages and payment periods. - * - * It is used in sales orders, purchase orders, and invoices. Terms of payment provide information for:Cash managementDunning proceduresPayment transactionsData can be entered in the field for the terms of payment key in various ways as you enter a business transaction:In most business transactions, the system defaults the key specified in the master record of the customer/vendor in question.In some transactions (for example, credit memos), however, the system does not default the key from the master record. Despite this, you can use the key from the customer/vendor master record by entering "*" in the field.Regardless of whether or not a key is defaulted from the master record, you can manually enter a key during document entry at:item level in sales ordersheader level in purchase orders and invoicesMaster records have separate areas for Financial Accounting, Sales, and Purchasing. You can specify different terms of payment keys in each of these areas. When you then enter a business transaction, the application in question will use the key specified in its area of the master record. - */ - @sap.display.format : 'UpperCase' - @sap.label : 'Terms of Payment' - @sap.quickinfo : 'Terms of Payment Key' - PaymentTerms : String(4); - /** This indicator specifies that the customer/vendor should be sent all payment advice information by EDI. */ - @sap.display.format : 'UpperCase' - @sap.label : 'Pmnt advice by EDI' - @sap.quickinfo : 'Indicator: Send Payment Advices by EDI' - PaytAdviceIsSentbyEDI : Boolean; - /** - * Indicates that the account is blocked for posting in the specified company code. - * - * If you set this indicator, the system prevents users from posting items to this account and issues an error message to inform them that the account is blocked. - */ - @sap.display.format : 'UpperCase' - @sap.label : 'Co.code post.block' - @sap.quickinfo : 'Posting block for company code' - PhysicalInventoryBlockInd : Boolean; - /** - * The reconciliation account in G/L accounting is the account which is updated parallel to the subledger account for normal postings (for example, invoice or payment). - * - * For special postings (for example, down payment or bill of exchange), this account is replaced by another account (for example, 'down payments received' instead of 'receivables').The replacement takes place due to the special G/L indicator which you must specify for these types of postings. - */ - @sap.display.format : 'UpperCase' - @sap.label : 'Reconciliation Acct' - @sap.quickinfo : 'Reconciliation Account in General Ledger' - ReconciliationAccount : String(10); - /** - * Indicator that the payment history of the customer is to be recorded. - * - * The amount and number of payments are then recorded per calendar month, as well as the average days in arrears.Information about cash discount payments and net payments is recorded separately.The indicator should not be set for one-time accounts and accounts which are paid automatically (bank collection or bank bill in Germany, bill of exchange payment request in France).You can only carry out evaluation of the payment history, for example, with the report for customer evaluation with OI listing, if you have selected this field. - */ - @sap.display.format : 'UpperCase' - @sap.label : 'Record Pmnt History' - @sap.quickinfo : 'Indicator: Record Payment History ?' - RecordPaymentHistoryIndicator : Boolean; - /** Name or identification code of the accounting clerk at the customer. */ - @sap.label : 'User at customer' - UserAtCustomer : String(15); - /** - * Indicates that the company code data in this master record is to be deleted. - * - * To delete this data, you have to run the archiving program for Accounts Receivable or Payable. This program will archive all master records marked for deletion provided that there is no dependent data in them.This deletion flag cannot be used in the program that deletes master data. You should, however, run this program only to delete test data prior to production startup. - */ - @sap.display.format : 'UpperCase' - @sap.label : 'Co.cde deletion flag' - @sap.quickinfo : 'Deletion Flag for Master Record (Company Code Level)' - DeletionIndicator : Boolean; - /** - * In cash management, customers and vendors are allocated to planning groups by means of an entry made in the master record. - * - * You can define these planning groups in Customizing or the Implementation Guide (you will need to ensure that they are all the same length). In order to improve the liquidity forecast display for major customers and vendors, it can be advisable to enter their account number as the planning group.For the planning groups themselves a naming convention should be set up to improve liquidity forecasting. In the following examples, the customer planning groups begin with an "R" for receipts, and the vendor planning groups begin with an "E" for expenses.R1 Customers paying by bank collectionR2 Other domestic customersR3 Customers abroadR4 Affiliated company customersR5 High risk customersR6 Major customersR7 Rental incomeR8 Repayment of loans...E1 Domestic vendorsE2 Vendors abroadE3 Affiliated company vendorsE4 Major vendorsE5 Personnel costsE6 TaxesE7 Investments... - */ - @sap.display.format : 'UpperCase' - @sap.label : 'Planning Group' - CashPlanningGroup : String(10); - /** With the key specified here, you can refer to known/negotiated leave. */ - @sap.display.format : 'UpperCase' - @sap.label : 'Known/Negotiat.Leave' - @sap.quickinfo : 'Short Key for Known/Negotiated Leave' - KnownOrNegotiatedLeave : String(4); - /** The value adjustment key controls the way the open items are processed during individual value adjustment. */ - @sap.display.format : 'UpperCase' - @sap.label : 'Value Adjustment' - @sap.quickinfo : 'Value Adjustment Key' - ValueAdjustmentKey : String(2); - /** - * The account group is a classifying feature within customer master records. The account group determines: - * - * in which number range the customer account number should be;whether the number is assigned by the user or by the system;which specifications are necessary or possible in the master record. - */ - @sap.display.format : 'UpperCase' - @sap.label : 'Account Group' - @sap.quickinfo : 'Customer Account Group' - CustomerAccountGroup : String(4); - @cds.ambiguous : 'missing on condition?' - to_CustomerDunning : Association to many API_BUSINESS_PARTNER.A_CustomerDunning { }; - @cds.ambiguous : 'missing on condition?' - to_WithHoldingTax : Association to many API_BUSINESS_PARTNER.A_CustomerWithHoldingTax { }; -}; - -@cds.external : true -@cds.persistence.skip : true -@sap.content.version : '1' -@sap.label : 'Customer Dunning' -entity API_BUSINESS_PARTNER.A_CustomerDunning { - /** Gives an alphanumeric key, which clearly identifies the customer or vendor in the SAP system. */ - @sap.display.format : 'UpperCase' - @sap.label : 'Customer' - @sap.quickinfo : 'Customer Number' - key Customer : String(10) not null; - /** The company code is an organizational unit within financial accounting. */ - @sap.display.format : 'UpperCase' - @sap.label : 'Company Code' - key CompanyCode : String(4) not null; - /** - * The dunning area represents an organizational entity that is responsible for dunning. The dunning areas represent a sub-structure of the company codes. - * - * If different responsibilities or different dunning procedures exist within a company code, you can set up corresponding dunning areas.All dunning notices are made separately according to dunning areas, and if necessary with different dunning procedures.The dunning area must be noted in the line items. As long as documents are copied from preliminary work areas (billing documents), the dunning area can be derived from details such as division or sales area, if necessary. - */ - @sap.display.format : 'UpperCase' - @sap.label : 'Dunning Area' - key DunningArea : String(2) not null; - /** Key which reflects the reason for a dunning block indicator. */ - @sap.display.format : 'UpperCase' - @sap.label : 'Dunning Block' - DunningBlock : String(1); - /** - * Number that specifies how often an item or account has been dunned. - * - * The business partner has received the dunning level from the last dunning run.If you use dunning areas, it is the dunning level that the business partner received from the last dunning run in the dunning area assigned.The dunning program sets the dunning level automatically when the customer or vendor receives a dunning notice. - */ - @sap.display.format : 'NonNegative' - @sap.label : 'Dunning Level' - DunningLevel : String(1); - /** This field contains the key for the dunning procedure to be used. */ - @sap.display.format : 'UpperCase' - @sap.label : 'Dunning Procedure' - DunningProcedure : String(4); - /** - * Account number of the customer who is to be the recipient of the dunning letters. - * - * The account number is only needed if dunning letters are not sent to the customer who owes the receivables. - */ - @sap.display.format : 'UpperCase' - @sap.label : 'Dunning Recipient' - @sap.quickinfo : 'Account Number of the Dunning Recipient' - DunningRecipient : String(10); - /** Date on which the last dunning notice was made. */ - @sap.display.format : 'Date' - @sap.label : 'Last Dunned' - @sap.quickinfo : 'Date of Last Dunning Notice' - LastDunnedOn : Date; - /** - * Date on which a legal dunning procedure was initiated. - * - * The printing of dunning notices in the legal dunning procedure generates an internal notice about any further account movements. A dunning notice is not created for the customer.If the Legal dunning procedure field in the master record contains a date, this means that the account is involved in a legal dunning procedure. The relationship between this date and the dunning date does not affect how the account is processed.The printing of account movements in the legal dunning procedure differs from the normal printing of dunning notices as follows:You must specify a separate form for your dunning procedure in Customizing. For more information, see Customizing (IMG) under Dunning Forms.The dunning program also displays text element 520 "Legal dunning procedure". This makes it possible to display the date of the legal dunning procedure from the master record.The program also displays the documents blocked for dunning and those with a payment method (automatic debit, bank direct debit).Although dunning notices are printed, the dunning level does not change in the master record or in the items. New dunning level = old dunning level.The program only updates the date of the last dunning run.Enter the date manually. - */ - @sap.display.format : 'Date' - @sap.label : 'Legal Dunn.Proc.From' - @sap.quickinfo : 'Date of the Legal Dunning Proceedings' - LegDunningProcedureOn : Date; - /** - * Identification code for the accounting clerk dealing with dunning letters. - * - * Using this identification code, the accounting clerk whose name is printed on the dunning letters is determined.If this field is not filled, then the entry from the Accounting clerk field is used. - */ - @sap.display.format : 'UpperCase' - @sap.label : 'Dunning Clerk' - DunningClerk : String(2); - /** The authorization group allows extended authorization protection for particular objects. The authorization groups are freely definable. The authorization groups usually occur in authorization objects together with an activity. */ - @sap.display.format : 'UpperCase' - @sap.label : 'Authorization' - @sap.quickinfo : 'Authorization Group' - AuthorizationGroup : String(4); - /** - * The account group is a classifying feature within customer master records. The account group determines: - * - * in which number range the customer account number should be;whether the number is assigned by the user or by the system;which specifications are necessary or possible in the master record. - */ - @sap.display.format : 'UpperCase' - @sap.label : 'Account Group' - @sap.quickinfo : 'Customer Account Group' - CustomerAccountGroup : String(4); -}; - -@cds.external : true -@cds.persistence.skip : true -@sap.deletable : 'false' -@sap.content.version : '1' -@sap.label : 'Sales Area' -entity API_BUSINESS_PARTNER.A_CustomerSalesArea { - /** Gives an alphanumeric key, which clearly identifies the customer or vendor in the SAP system. */ - @sap.display.format : 'UpperCase' - @sap.label : 'Customer' - @sap.quickinfo : 'Customer Number' - key Customer : String(10) not null; - /** - * An organizational unit responsible for the sale of certain products or services. The responsibility of a sales organization may include legal liability for products and customer claims. - * - * You can assign any number of distribution channels and divisions to a sales organization. A particular combination of sales organization, distribution channel, and division is known as a sales area. - */ - @sap.display.format : 'UpperCase' - @sap.label : 'Sales Organization' - key SalesOrganization : String(4) not null; - /** - * The way in which products or services reach the customer. Typical examples of distribution channels are wholesale, retail, or direct sales. - * - * You can maintain information about customers and materials by sales organization and distribution channel. Within a sales organization you can deliver goods to a given customer through more than one distribution channel.You can assign a distribution channel to one or more sales organizations. If, for example, you have numerous sales organizations, each sales organization may use the "Wholesale" distribution channel.For each combination of sales organization and distribution channel, you can further assign one or more of the divisions that are defined for the sales organization. You can, for example, assign "Food" and "Non-food" divisions to the "Wholesale" distribution channel. A particular combination of sales organization, distribution channel, and division is known as a sales area. - */ - @sap.display.format : 'UpperCase' - @sap.label : 'Distribution Channel' - key DistributionChannel : String(2) not null; - /** - * A way of grouping materials, products, or services. The system uses divisions to determine the sales areas and the business areas for a material, product, or service. - * - * A product or service is always assigned to just one division. From the point of view of sales and distribution, the use of divisions lets you organize your sales structure around groups of similar products or product lines. This allows the people in a division who process orders and service customers to specialize within a manageable area of expertise.If a sales organization sells food and non-food products through both retail and wholesaledistribution channels each distribution channel could then be further split into food and non-food divisions. - */ - @sap.display.format : 'UpperCase' - @sap.label : 'Division' - key Division : String(2) not null; - /** This field contains the account number your company is listed under at the customer or vendor. */ - @sap.display.format : 'UpperCase' - @sap.label : 'Account at customer' - @sap.quickinfo : 'Shipper''s (Our) Account Number at the Customer or Vendor' - AccountByCustomer : String(12); - /** - * The authorization group enables you protect access to certain objects. - * - * In order to carry out a specific activity, the user must have authorization for the combination of the activity and the authorization group. - */ - @sap.display.format : 'UpperCase' - @sap.label : 'Authorization Group' - AuthorizationGroup : String(4); - /** - * Indicates if further billing activities are blocked for the customer. The block applies throughout the specified sales area. - * - * If you enter a blocking indicator, billing that is already underway is continued. However, you cannot process the document further.Enter one of the values predefined for your system. If you want to block billing for a customer throughout an entire sales organization, you must enter a blocking indicator for each sales area in which the sales organization is defined.You can block billing for a customer if, for example, there are credit-related or legal problems to be resolved. - */ - @sap.display.format : 'UpperCase' - @sap.label : 'BBlock for SlsA' - @sap.quickinfo : 'Billing block for customer (sales and distribution)' - BillingIsBlockedForCustomer : String(2); - /** Indicates whether a sales order must be delivered completely in a single delivery or whether the order can be partially delivered and completed over a number of deliveries. */ - @sap.display.format : 'UpperCase' - @sap.label : 'Complete Delivery' - @sap.quickinfo : 'Complete Delivery Defined for Each Sales Order?' - CompleteDeliveryIsDefined : Boolean; - /** Customer's currency for a sales area. This currency will be used to settle the customer's charges for the given sales organization. */ - @sap.label : 'Currency' - @sap.semantics : 'currency-code' - Currency : String(5); - @sap.display.format : 'UpperCase' - @sap.label : 'ABC classification' - @sap.quickinfo : 'Customer classification (ABC analysis)' - CustomerABCClassification : String(2); - /** - * The account assignment group to which the system automatically posts the sales document. - * - * The system uses the account assignment group as one of the criteria during the automatic determination of revenue accounts.The system automatically proposes the account assignment group from the customer master record of the payer. You can change the default value in the sales document or the billing document. - */ - @sap.display.format : 'UpperCase' - @sap.label : 'Acct Assmt Grp Cust.' - @sap.quickinfo : 'Account Assignment Group for this customer' - CustomerAccountAssignmentGroup : String(2); - /** Identifies a particular group of customers (for example, wholesale or retail) for the purpose of pricing or generating statistics. */ - @sap.display.format : 'UpperCase' - @sap.label : 'Customer Group' - CustomerGroup : String(2); - /** - * Key for defining payment terms composed of cash discount percentages and payment periods. - * - * It is used in sales orders, purchase orders, and invoices. Terms of payment provide information for:Cash managementDunning proceduresPayment transactionsData can be entered in the field for the terms of payment key in various ways as you enter a business transaction:In most business transactions, the system defaults the key specified in the master record of the customer/vendor in question.In some transactions (for example, credit memos), however, the system does not default the key from the master record. Despite this, you can use the key from the customer/vendor master record by entering "*" in the field.Regardless of whether or not a key is defaulted from the master record, you can manually enter a key during document entry at:item level in sales ordersheader level in purchase orders and invoicesMaster records have separate areas for Financial Accounting, Sales, and Purchasing. You can specify different terms of payment keys in each of these areas. When you then enter a business transaction, the application in question will use the key specified in its area of the master record. - */ - @sap.display.format : 'UpperCase' - @sap.label : 'Terms of Payment' - @sap.quickinfo : 'Terms of Payment Key' - CustomerPaymentTerms : String(4); - /** - * A grouping of customers who share the same pricing requirements. - * - * You can define price groups according to the needs of your organization and create pricing records for each group. You can, for example, define a group of customers to whom you want to give the same kind of discount. You can assign a price group to an individual customer either in the customer master record or in the sales document.The system can propose the price group from the customer master record. You can change the proposed value manually in the sales document at both header and item level. - */ - @sap.display.format : 'UpperCase' - @sap.label : 'Customer Price Group' - CustomerPriceGroup : String(2); - /** - * Determines which pricing procedure the system should apply when you create a sales document for the customer. - * - * You can define different pricing procedures for your system. A pricing procedure determines the type and sequence of conditions that the system uses for pricing in, for example, a sales order. - */ - @sap.display.format : 'UpperCase' - @sap.label : 'Cust.Pric.Procedure' - @sap.quickinfo : 'Customer Classification for Pricing Procedure Determination' - CustomerPricingProcedure : String(2); - /** - * Indicates if further delivery processing is blocked for the customer. The block applies throughout the specified sales area. - * - * If you enter a blocking indicator, delivery processing that is already underway is continued. However, no new processing can take place.Enter one of the values predefined for your system. If you want to block delivery processing for a customer within a particular sales organization, you must enter a blocking indicator for each sales area in which the sales organization is defined.You can block delivery processing for a customer if, for example, there are credit-related or legal problems to be resolved. - */ - @sap.display.format : 'UpperCase' - @sap.label : 'DelBlckSalesAr.' - @sap.quickinfo : 'Customer delivery block (sales area)' - DeliveryIsBlockedForCustomer : String(2); - /** - * The delivery priority assigned to an item. - * - * You can assign delivery priority to either a particular material or to a combination of customer and material. When you process deliveries collectively, you can use delivery priority as one of the selection criteria. - */ - @sap.display.format : 'NonNegative' - @sap.label : 'Delivery Priority' - DeliveryPriority : String(2); - /** - * Commonly used trading terms that comply with the standards established by the International Chamber of Commerce (ICC). - * - * Incoterms specify internationally recognized procedures that the shipper and the receiving party must follow for the shipping transaction to be completed successfully.If goods are shipped through a port of departure, the appropriate Incoterm might be: FOB ("Free On Board"). You can provide further details (for example, the name of the port) in the secondary Incoterm field: FOB Boston, for example. - */ - @sap.display.format : 'UpperCase' - @sap.label : 'Incoterms' - @sap.quickinfo : 'Incoterms (Part 1)' - IncotermsClassification : String(3); - /** - * Provides additional information for the Incoterms. This field is only available for C-Clauses (if customized appropriately). Note the following for the incoterms versions below: - * - * No Version:This field is disabledIncoterm Version 2000This field is disabled as part of standard delivery unless a customer decides to enable it by the way of Customizing for Sales and Distribution under Master Data -> Business Partners -> Customers -> Billing Document -> Incoterms -> Map Incoterms to Versions.Incoterm Version 2010For this version, the field represents:Sea and inland waterway transport - Port of DestinationAny mode of transport - Place of Destination2010 Incoterms are divided as follows:Group 1: Rules for any mode or modes of transport (including by vessel)Incoterms Incoterms Description Location 2CPT Carriage Paid To Place of DestinationCIP Carriage & Insurance Paid To Place of DestinationGroup 2: Rules for sea and inland waterwaysIncoterms Incoterms Description Location 2CFR Cost & Freight Port of DestinationCIF Cost Insurance & Freight Port of Destination - */ - @sap.label : 'Incoterms Location 2' - IncotermsLocation2 : String(70); - /** An incoterms version is an edition containing a list of international terms for transportation that is defined by the International Chamber of Commerce (ICC). */ - @sap.display.format : 'UpperCase' - @sap.label : 'Incoterms Version' - IncotermsVersion : String(4); - /** - * Provides additional information for the primary Incoterm. For Incoterms 2010, this field represents: - * - * 1. For sea and inland waterway transport - Port of Shipment2. For any mode of transport - Place of Delivery 2010Incoterms are divided as follows:Group 1: Rules for any mode or modes of transport (including by vessel)Incoterms Incoterms Description Location 1 EXW Ex Works Place of DeliveryFCA Free Carrier Place of DeliveryCPT Carriage Paid To Place of DestinationCIP Carriage & Insurance Paid To Place of DestinationDAF Delivered at Frontier Place of DeliveryDDP Delivered Duty Paid Place of DestinationDDU Delivered Duty Unpaid Place of DestinationGroup 2: Rules for sea and inland waterwaysIncoterms Incoterms Description Location 1 FAS Free Alongside Ship Port of ShipmentFOB Free On Board Port of ShipmentCFR Cost & Freight Port of DestinationCIF Cost Insurance & Freight Port of DestinationDEQ Delivered Eq Quay (Duty Paid) Port of DestinationDES Delivered Ex Ship Port of DestinationIf the primary incoterm is specified as FOB “Free on Board”, the second field provides details of the port from which the delivery leaves, such as FOB Boston. - */ - @sap.label : 'Incoterms Location 1' - IncotermsLocation1 : String(70); - /** Indicates that all data in the master record will be deleted for the specified sales area. Before the deletion is made, the system checks for dependent data that would prevent the deletion. */ - @sap.display.format : 'UpperCase' - @sap.label : 'Del.ID SlsArea' - @sap.quickinfo : 'Deletion flag for customer (sales level)' - DeletionIndicator : Boolean; - /** - * Additional information for the primary Incoterm. - * - * If the primary Incoterm is, for example, FOB ("Free on Board"), then the second field provides details of the port from which the delivery leaves (for example, "FOB Boston"). - */ - @sap.label : 'Incoterms (Part 2)' - IncotermsTransferLocation : String(28); - /** - * Identifies the calendar that determines the schedule of billing dates for the customer. - * - * If, for example, a customer wants to consolidate the invoices you send out, you can predefine the billing schedule in a calendar in the system. During billing, the system automatically proposes the appropriate billing date from the calendar.The system proposes the billing schedule from the customer master record of the payer. You can change the value manually in the sales document. - */ - @sap.display.format : 'UpperCase' - @sap.label : 'Invoicing Dates' - @sap.quickinfo : 'Invoice Dates (Calendar Identification)' - InvoiceDate : String(2); - /** - * The probability (expressed as a percentage) of the customer confirming the inquiry or quotation item as part of a sales order. - * - * The system combines the probability factors from the sales document type and from the customer master record of the sold-to party.If probability is 80% for the sales document type and 50% in the customer master record, the system combines the two values. In this case, the system takes 50% of 80% and proposes 40% for the item.The system proposes the probability. You can change the value manually for the item.You can generate requirements from quotations. Accordingly, the probability of quotation items affects how requirements are passed on. For example, a quotation for 100 pieces and a probability of 50% will generate requirements for 50 pieces. - */ - @sap.display.format : 'NonNegative' - @sap.label : 'Order Probability' - @sap.quickinfo : 'Order Probability of the Item' - ItemOrderProbabilityInPercent : String(3); - /** - * Indicates whether you are allowed to combine orders during delivery processing. - * - * The system proposes the indicator from the customer master record. You can change the value manually in the sales document at both header and item level. - */ - @sap.display.format : 'UpperCase' - @sap.label : 'Order Combination' - @sap.quickinfo : 'Order Combination Indicator' - OrderCombinationIsAllowed : Boolean; - /** - * Indicates if further sales order processing is blocked for the customer. The block applies throughout the specified sales area. - * - * You can define blocks according to the needs of your organization. If you enter a blocking indicator, sales order processing that is already underway is continued. However, no new processing can occur.Enter one of the values predefined for your system. If you want to block sales order processing for a customer within a particular sales organization, you must enter a blocking indicator for each sales area in which the sale organization is defined.You can block sales order processing for a customer if, for example, there are credit-related or legal problems to be resolved. - */ - @sap.display.format : 'UpperCase' - @sap.label : 'Ord.blk:sls ar.' - @sap.quickinfo : 'Customer order block (sales area)' - OrderIsBlockedForCustomer : String(2); - /** - * Specifies whether the customer requires full or partial delivery for the item. - * - * You use this field to control partial deliveries at the item level. If the customer allows partial delivery, you can choose from different partial delivery options. For example, you can specify whether the customer allows you to make one delivery attempt only on the requested delivery date or whether unlimited delivery attempts are possible.When partial delivery indicator 'D' is set, the order can never have status 'fully delivered'. You must complete each item by entering a reason for rejection. This could be applied to scheduling agreements, for example.You can enter a value in this field only if the customer allows partial deliveries for the entire sales document. - */ - @sap.display.format : 'UpperCase' - @sap.label : 'Partial Deliv./Item' - @sap.quickinfo : 'Partial Delivery at Item Level' - PartialDeliveryIsAllowed : String(1); - /** - * Identifies a price list or other condition type (for example, a surcharge or discount). - * - * You can define price list types according to the needs of your own organization. Price list types can be grouped according to:the kind of price list (for example, wholesale or retail)the currency in which the price appearsthe number of the price list typeYou can use price list types to apply conditions during pricing or to generate statistics.In the customer master record, enter one of the values predefined for your system. The system proposes the value automatically during sales order processing. You can change the value manually in the sales document header. - */ - @sap.display.format : 'UpperCase' - @sap.label : 'Price List Type' - PriceListType : String(2); - /** - * A group of sales people who are responsible for processing sales of certain products or services. - * - * By using sales groups you can designate different areas of responsibility within a sales office. When you generate sales statistics, you can use the sales group as one of the selection criteria.If sales office personnel service both retail and wholesale markets, you can assign a sales group to each market.You assign each salesperson to a sales group in his or her user master record. You assign each customer to a particular sales group in the customer's master record. - */ - @sap.display.format : 'UpperCase' - @sap.label : 'Sales Group' - SalesGroup : String(3); - /** - * A physical location (for example, a branch office) that has responsibility for the sale of certain products or services within a given geographical area. - * - * When you create sales statistics, you can use a sales office as one of the selection criteria. When you print out order confirmations, you can include the address of the sales office.You can assign each customer to a sales office in the customer master record.Within a sales office you can establish sales groups (for example, departments) with specific sales responsibilities. Each person who works in the sales office can be assigned to a sales group in his or her user master record. Each customer can also be assigned to a particular sales group in the customer master record. - */ - @sap.display.format : 'UpperCase' - @sap.label : 'Sales Office' - SalesOffice : String(4); - /** - * General shipping strategy for the delivery of goods from the vendor to the customer. - * - * You can define shipping conditions in your system which correspond to the requirements of your company. You can specify a shipping condition in the customer master and in the vendor master.Shipping point determination (outbound delivery):The loading group, the plant and the shipping condition determine the shipping point that will be proposed by the system.Route determination (outbound delivery):Apart from the country and the geographical region of the shipping point, the ship-to party and the transportation group, the shipping condition determines the route that the system proposes in the order for the delivery of the goods. In the delivery, the route proposal also takes the weight group into account.A particular customer always requires immediate delivery. You enter the appropriate shipping condition into the customer master record. This means that when you process orders for this customer, the system automatically proposes the express mail room as a shipping point and the quickest way to the airport as a route.If a shipping condition has been assigned to a sales document type in Customizing, this condition will be proposed by the system in the corresponding sales document. If there is no assignment, the system copies the relevant data from the corresponding customer master record of the sold-to party. You cannot change this value during delivery processing. The shipping condition will not be copied from the delivery into the shipment. The shipping condition is one of several criteria for selecting deliveries when you create a shipment. You can enter a shipping condition manually in the shipment where it only serves as a characteristic for grouping shipments. - */ - @sap.display.format : 'UpperCase' - @sap.label : 'Shipping Conditions' - ShippingCondition : String(2); - /** - * Plant from which the goods should be delivered to the customer. - * - * This plant is automatically copied into the sales order item as the default value.If there is no default value when you process the sales order item, enter a delivering plant.The value proposed in the item is eitherfrom the customer master record of the goods recipient, orfrom the material master recordThe system checks whether it can propose a value (and for your own plants, whether the material has been created in the plant). If the system can propose a value, the plant is copied to the sales order item where you can change it as required. - */ - @sap.display.format : 'UpperCase' - @sap.label : 'Delivering Plant' - @sap.quickinfo : 'Delivering Plant (Own or External)' - SupplyingPlant : String(4); - /** - * A geographical sales district or region. - * - * Each customer can be assigned to a sales district. You can use sales districts to apply pricing conditions. When you want to generate sales statistics, you can use sales districts as a selection criteria.The system can propose a value from the customer master record of the sold-to party. You can change the value manually in the document at the header or item level. - */ - @sap.display.format : 'UpperCase' - @sap.label : 'Sales District' - SalesDistrict : String(6); - /** - * Identifies the customer's factory calendar that is used during the processing of invoice lists. - * - * An invoice list is a list of invoices (single or collective) that you create for the customer either periodically or on predefined dates. The periods and dates are defined in the customer's factory calendar. Typically, the recipient of an invoice list takes on the responsibility for collecting payments from numerous individual customers and receives a factoring or del credere discount for the service.If you want to create invoice lists for the customer, you must enter an identifier for a predefined factory calendar. - */ - @sap.display.format : 'UpperCase' - @sap.label : 'Invoice List Sched.' - @sap.quickinfo : 'Invoice List Schedule (calendar identification)' - InvoiceListSchedule : String(2); - /** - * Key representing a type of exchange rate in the system. - * - * You enter the exchange rate type to store different exchange rates.You can use the exchange rate type to define a buying rate, selling rate, or average rate for translating foreign currency amounts. You can use the average rate for the currency translation, and the bank buying and selling rates for valuation of foreign currency amounts. - */ - @sap.display.format : 'UpperCase' - @sap.label : 'Exchange Rate Type' - ExchangeRateType : String(4); - /** - * Specifies a customer-defined group of customers. - * - * You can define up to five different groups of customers, according to the needs of your organization. You specify the groups in the customer master record under "Additional data". If you assign a particular customer to one or more groups, the system automatically displays the groups in the header data of corresponding sales orders.You can define customer groups in Tables TVV1 through TVV5 and assign them to specific languages in Tables TVV1T through TVV5T. - */ - @sap.display.format : 'UpperCase' - @sap.label : 'Customer Group 1' - @sap.quickinfo : 'Customer group 1' - AdditionalCustomerGroup1 : String(3); - /** - * Specifies a customer-defined group of customers. - * - * You can define up to five different groups of customers, according to the needs of your organization. You specify the groups in the customer master record under "Additional data". If you assign a particular customer to one or more groups, the system automatically displays the groups in the header data of corresponding sales orders.You can define customer groups in Tables TVV1 through TVV5 and assign them to specific languages in Tables TVV1T through TVV5T. - */ - @sap.display.format : 'UpperCase' - @sap.label : 'Customer Group 2' - @sap.quickinfo : 'Customer group 2' - AdditionalCustomerGroup2 : String(3); - /** - * Specifies a customer-defined group of customers. - * - * You can define up to five different groups of customers, according to the needs of your organization. You specify the groups in the customer master record under "Additional data". If you assign a particular customer to one or more groups, the system automatically displays the groups in the header data of corresponding sales orders.You can define customer groups in Tables TVV1 through TVV5 and assign them to specific languages in Tables TVV1T through TVV5T. - */ - @sap.display.format : 'UpperCase' - @sap.label : 'Customer Group 3' - @sap.quickinfo : 'Customer group 3' - AdditionalCustomerGroup3 : String(3); - /** - * Specifies a customer-defined group of customers. - * - * You can define up to five different groups of customers, according to the needs of your organization. You specify the groups in the customer master record under "Additional data". If you assign a particular customer to one or more groups, the system automatically displays the groups in the header data of corresponding sales orders.You can define customer groups in Tables TVV1 through TVV5 and assign them to specific languages in Tables TVV1T through TVV5T. - */ - @sap.display.format : 'UpperCase' - @sap.label : 'Customer Group 4' - @sap.quickinfo : 'Customer group 4' - AdditionalCustomerGroup4 : String(3); - /** - * Specifies a customer-defined group of customers. - * - * You can define up to five different groups of customers, according to the needs of your organization. You specify the groups in the customer master record under "Additional data". If you assign a particular customer to one or more groups, the system automatically displays the groups in the header data of corresponding sales orders.You can define customer groups in Tables TVV1 through TVV5 and assign them to specific languages in Tables TVV1T through TVV5T. - */ - @sap.display.format : 'UpperCase' - @sap.label : 'Customer Group 5' - @sap.quickinfo : 'Customer group 5' - AdditionalCustomerGroup5 : String(3); - /** - * This key identifies the customer payment guarantee procedure. - * - * The customer payment guarantee procedure determines which payment guarantee procedure the system automatically uses when you create a sales document for the customer.In receivables risk management, the system determines the payment guarantee procedure taking into account:the key for the document payment guarantee procedure in the header for the sales document type.the customer payment guarantee procedure key in the customer master.You can define different payment guarantee procedures for your system. The payment guarantee procedure defines the type and sequence of forms of payment guarantee that the system assigns to the sales document items. - */ - @sap.display.format : 'UpperCase' - @sap.label : 'Paymt guarant. proc.' - @sap.quickinfo : 'Customer payment guarantee procedure' - PaymentGuaranteeProcedure : String(4); - /** - * The account group is a classifying feature within customer master records. The account group determines: - * - * in which number range the customer account number should be;whether the number is assigned by the user or by the system;which specifications are necessary or possible in the master record. - */ - @sap.display.format : 'UpperCase' - @sap.label : 'Account Group' - @sap.quickinfo : 'Customer Account Group' - CustomerAccountGroup : String(4); - @cds.ambiguous : 'missing on condition?' - to_PartnerFunction : Association to many API_BUSINESS_PARTNER.A_CustSalesPartnerFunc { }; - @cds.ambiguous : 'missing on condition?' - to_SalesAreaTax : Association to many API_BUSINESS_PARTNER.A_CustomerSalesAreaTax { }; -}; - -@cds.external : true -@cds.persistence.skip : true -@sap.deletable : 'false' -@sap.content.version : '1' -@sap.label : 'Sales Area Tax' -entity API_BUSINESS_PARTNER.A_CustomerSalesAreaTax { - /** Gives an alphanumeric key, which clearly identifies the customer or vendor in the SAP system. */ - @sap.display.format : 'UpperCase' - @sap.label : 'Customer' - @sap.quickinfo : 'Customer Number' - key Customer : String(10) not null; - /** - * An organizational unit responsible for the sale of certain products or services. The responsibility of a sales organization may include legal liability for products and customer claims. - * - * You can assign any number of distribution channels and divisions to a sales organization. A particular combination of sales organization, distribution channel, and division is known as a sales area. - */ - @sap.display.format : 'UpperCase' - @sap.label : 'Sales Organization' - key SalesOrganization : String(4) not null; - /** - * Specifies a distribution channel that you want to use as a reference for customer and material master data for other distribution channels. - * - * You can specify one distribution channel as the source of customer and material master data for other distribution channels. You need then only to maintain the data in one place.Distrib.channel Ref.distrib.channel01 0102 0103 0104 04In this example, only distribution channels 01 and 04 have customer and material master data defined. Distribution channels 01, 02, and 03 share the master data that you defined for distribution channel 01. Distribution channel 04 has its own master data. When you create a sales order in distribution channel 03, the system checks the customer and material master data against the data defined for distribution channel 01. - */ - @sap.display.format : 'UpperCase' - @sap.label : 'RefDistCh-Cust/Mat.' - @sap.quickinfo : 'Reference distrib.channel for cust.and material masters' - key DistributionChannel : String(2) not null; - /** - * A way of grouping materials, products, or services. The system uses divisions to determine the sales areas and the business areas for a material, product, or service. - * - * A product or service is always assigned to just one division. From the point of view of sales and distribution, the use of divisions lets you organize your sales structure around groups of similar products or product lines. This allows the people in a division who process orders and service customers to specialize within a manageable area of expertise.If a sales organization sells food and non-food products through both retail and wholesaledistribution channels each distribution channel could then be further split into food and non-food divisions. - */ - @sap.display.format : 'UpperCase' - @sap.label : 'Division' - key Division : String(2) not null; - /** - * Identifies the country in which the delivery originates. - * - * You can define the country key in a table. As a rule, it is a good idea to use the existing international standards for identifying vehicles from different countries (for example: USA = United States, I = Italy, and so on). The system uses the key tohelp determine the relevant taxes during pricingdetermine important country-specific standards (the length of postal codes and bank account numbers, for example) - */ - @sap.display.format : 'UpperCase' - @sap.label : 'Country' - @sap.quickinfo : 'Departure country (country from which the goods are sent)' - key DepartureCountry : String(3) not null; - /** - * Identifies the condition that the system uses to automatically determine country-specific taxes during pricing. - * - * You can define one or more tax categories for each country. During sales order processing, the system applies the tax category according tothe geographical location of your delivering plant and the location of the customer receiving the goodstax classifications in the customer master record and the material master record.In the USA, for example, you can define tax categories for Federal Sales Tax and Federal Excise Tax. In the U.K., you can define a tax category for Value Added Tax (VAT). - */ - @sap.display.format : 'UpperCase' - @sap.label : 'Tax Category' - @sap.quickinfo : 'Tax category (sales tax, federal sales tax,...)' - key CustomerTaxCategory : String(4) not null; - /** - * Specifies the tax liability of the customer, based on the tax structure of the customer's country. - * - * You can use the tax classification to specify, for example, whether a customer is liable for sales taxes, such as VAT or state sales taxes.During sales order processing, the system copies the tax classification from the tax information stored in thecustomer master record of the payer, if the payer is different from the sold-to party and the sales tax identification number is maintained for the payer.ship to party, if the sales tax identification number of the ship-to party is maintained.sold-to party, if none of the criteria for the payer or the ship-to party are met.During pricing, the system calculates any relevant taxes by taking the following factors into account:The tax classification of the customer and the materialThe country keys of the customer and the delivering plant - */ - @sap.display.format : 'UpperCase' - @sap.label : 'Tax Classification' - @sap.quickinfo : 'Tax classification for customer' - CustomerTaxClassification : String(1); -}; - -@cds.external : true -@cds.persistence.skip : true -@sap.content.version : '1' -@sap.label : 'Withholding Tax' -entity API_BUSINESS_PARTNER.A_CustomerWithHoldingTax { - /** Gives an alphanumeric key, which clearly identifies the customer or vendor in the SAP system. */ - @sap.display.format : 'UpperCase' - @sap.label : 'Customer' - @sap.quickinfo : 'Customer Number' - key Customer : String(10) not null; - /** The company code is an organizational unit within financial accounting. */ - @sap.display.format : 'UpperCase' - @sap.label : 'Company Code' - key CompanyCode : String(4) not null; - /** - * This indicator is used to classify the different types of withholding tax. - * - * Withholding tax types classify particular features of a withholding tax including:The time at which the withholding tax is postedThe basis on which the base amount is calculatedThe basis for accumulation (if applicable)Withholding tax types are to be distinguished from withholding tax codes, to which are allocated the withholding tax percentage rate example.Whether a withholding tax can be defined as an existing type by means of a new code, or if a new type needs to be defined will depend on the type of transaction (see below).Note that a business transaction can only be assigned one withholding tax code per withholding tax type. If the business transaction is subject to several withholding taxes simultaneously, these must be represented by different types.This is the case in Argentina for example, where up to four kinds of withholding tax per business transaction are possible. - */ - @sap.display.format : 'UpperCase' - @sap.label : 'Withholding Tax Type' - @sap.quickinfo : 'Indicator for Withholding Tax Type' - key WithholdingTaxType : String(2) not null; - /** - * One or more "withholding tax codes" are assigned to each withholding tax type. One of the things these codes determine is the various percentage rates for the withholding tax type. - * - * Note that when processing a business transaction, no more than one withholding tax code can be assigned per withholding tax type. If the business transaction is subject to more than one withholding taxes, these must be represented in the system by defining various withholding tax types. - */ - @sap.display.format : 'UpperCase' - @sap.label : 'W/Tax Code' - @sap.quickinfo : 'Withholding Tax Code' - WithholdingTaxCode : String(2); - @sap.display.format : 'UpperCase' - @sap.label : 'WTax Agent' - @sap.quickinfo : 'Indicator: Withholding Tax Agent?' - WithholdingTaxAgent : Boolean; - /** - * Date from which: - * - * The company code is obligated to withhold tax for the given withholding tax type.This date must be entered in Customizing under the withholding tax information for the company code.The customer is obligated to withhold tax for the withholding tax type.This date must be defined in the customer master record. - */ - @sap.display.format : 'Date' - @sap.label : 'W/Tax Obligated Frm' - @sap.quickinfo : 'Obligated to Withhold Tax From' - ObligationDateBegin : Date; - /** - * Date to which: - * - * The company code is obligated to withhold tax for the withholding tax type.This date must be entered in Customizing under the withholding tax information for the company code.The customer is obigated to withhold tax for the withholding tax type. - */ - @sap.display.format : 'Date' - @sap.label : 'Oblig.to W/Tax Until' - @sap.quickinfo : 'Obligated to Withhold Tax Until' - ObligationDateEnd : Date; - /** - * This is a number issued by the tax authorities per withholding tax type. - * - * This number must be specified in Customizing either:(a) As part of the withholding tax information defined for the company code, or(b) As part of the withholding tax information defined in the customer or vendor master record. - */ - @sap.display.format : 'UpperCase' - @sap.label : 'W/tax number' - @sap.quickinfo : 'Withholding tax identification number' - WithholdingTaxNumber : String(16); - /** - * Numbered assigned by the relevant authorities for exemption from withholding tax. - * - * This number must be entered in the system as follows:In the vendor master record in the case of vendorsFor customers, in Customizing under the settings for withholding tax information for the company code per withholding tax type. - */ - @sap.display.format : 'UpperCase' - @sap.label : 'Exemption Number' - @sap.quickinfo : 'Exemption Certificate Number' - WithholdingTaxCertificate : String(25); - /** - * Rate of exemption from withholding tax. - * - * Those persons/activities subject to withholding tax can be exempted from withholding tax up to the percentage rate you enter here. This exemption rate refers to the withholding tax amount itself and not to the whole amount liable to withholding tax (withholding tax base amount).The gross amount of an invoice is 100.00 and the withholding tax base amount is defined as gross. The withholding tax rate is 10% meaning that the withholding tax amount is 10.00. Given an exemption rate of 30%, the withholding tax amount is reduced to 7.00. - */ - @sap.label : 'Exemption Rate' - WithholdingTaxExmptPercent : Decimal(5, 2); - /** Date from which withholding tax exemption applies. */ - @sap.display.format : 'Date' - @sap.label : 'Exemption Start Date' - @sap.quickinfo : 'Date on Which Exemption Begins' - ExemptionDateBegin : Date; - /** Date on which withholding tax exemption expires. */ - @sap.display.format : 'Date' - @sap.label : 'Exemption End Date' - @sap.quickinfo : 'Date on Which Exemption Ends' - ExemptionDateEnd : Date; - /** - * Indicator used to classify different types of exemption from liability to a particular withholding tax. - * - * These indicators can be defined per withholding tax type in the vendor master record. - */ - @sap.display.format : 'UpperCase' - @sap.label : 'Exemption Reason' - @sap.quickinfo : 'Reason for Exemption' - ExemptionReason : String(2); - /** The authorization group allows extended authorization protection for particular objects. The authorization groups are freely definable. The authorization groups usually occur in authorization objects together with an activity. */ - @sap.display.format : 'UpperCase' - @sap.label : 'Authorization' - @sap.quickinfo : 'Authorization Group' - AuthorizationGroup : String(4); -}; - -@cds.external : true -@cds.persistence.skip : true -@sap.content.version : '1' -@sap.label : 'Sales Partner Functions' -entity API_BUSINESS_PARTNER.A_CustSalesPartnerFunc { - /** Gives an alphanumeric key, which clearly identifies the customer or vendor in the SAP system. */ - @sap.display.format : 'UpperCase' - @sap.label : 'Customer' - @sap.quickinfo : 'Customer Number' - key Customer : String(10) not null; - /** - * An organizational unit responsible for the sale of certain products or services. The responsibility of a sales organization may include legal liability for products and customer claims. - * - * You can assign any number of distribution channels and divisions to a sales organization. A particular combination of sales organization, distribution channel, and division is known as a sales area. - */ - @sap.display.format : 'UpperCase' - @sap.label : 'Sales Organization' - key SalesOrganization : String(4) not null; - /** - * The way in which products or services reach the customer. Typical examples of distribution channels are wholesale, retail, or direct sales. - * - * You can maintain information about customers and materials by sales organization and distribution channel. Within a sales organization you can deliver goods to a given customer through more than one distribution channel.You can assign a distribution channel to one or more sales organizations. If, for example, you have numerous sales organizations, each sales organization may use the "Wholesale" distribution channel.For each combination of sales organization and distribution channel, you can further assign one or more of the divisions that are defined for the sales organization. You can, for example, assign "Food" and "Non-food" divisions to the "Wholesale" distribution channel. A particular combination of sales organization, distribution channel, and division is known as a sales area. - */ - @sap.display.format : 'UpperCase' - @sap.label : 'Distribution Channel' - key DistributionChannel : String(2) not null; - /** - * A way of grouping materials, products, or services. The system uses divisions to determine the sales areas and the business areas for a material, product, or service. - * - * A product or service is always assigned to just one division. From the point of view of sales and distribution, the use of divisions lets you organize your sales structure around groups of similar products or product lines. This allows the people in a division who process orders and service customers to specialize within a manageable area of expertise.If a sales organization sells food and non-food products through both retail and wholesaledistribution channels each distribution channel could then be further split into food and non-food divisions. - */ - @sap.display.format : 'UpperCase' - @sap.label : 'Division' - key Division : String(2) not null; - /** - * The sequential number that the system applies when there is more than one partner for a particular partner function. - * - * When you create a sales order for a particular customer, there may be more than one ship-to party defined. The different ship-to parties are numbered sequentially. - */ - @sap.display.format : 'NonNegative' - @sap.label : 'Partner counter' - key PartnerCounter : String(3) not null; - /** The abbreviated form of the name that identifies the partner function. */ - @sap.display.format : 'UpperCase' - @sap.label : 'Partner Function' - key PartnerFunction : String(2) not null; - @sap.display.format : 'UpperCase' - @sap.label : 'Customer' - @sap.quickinfo : 'Customer number of business partner' - BPCustomerNumber : String(10); - /** - * Sold-to party number sent in by the customer in delivery schedules. - * - * The system uses this number to automatically determine the ship-to party. - */ - @sap.label : 'Partner Description' - @sap.quickinfo : 'Cust.-Specif. Descr. of Business Partner (Plant, Stor. Loc.)' - CustomerPartnerDescription : String(30); - /** - * Specifies a partner as the default for a particular partner function. - * - * When you enter more than one partner for a particular partner function (for example, you define three different ship-to parties), you can select one partner as the default. During sales or purchasing processing, if you have defined multiple partners for a partner function, the system prompts you to choose just one partner. The system presents the default partner as the first choice in the pop-up window. - */ - @sap.display.format : 'UpperCase' - @sap.label : 'Default Partner' - DefaultPartner : Boolean; - /** The authorization group allows extended authorization protection for particular objects. The authorization groups are freely definable. The authorization groups usually occur in authorization objects together with an activity. */ - @sap.display.format : 'UpperCase' - @sap.label : 'Authorization' - @sap.quickinfo : 'Authorization Group' - AuthorizationGroup : String(4); -}; - -@cds.external : true -@cds.persistence.skip : true -@sap.creatable : 'false' -@sap.deletable : 'false' -@sap.content.version : '1' -@sap.label : 'Supplier' -entity API_BUSINESS_PARTNER.A_Supplier { - /** Specifies an alphanumeric key that uniquely identifies the supplier in the SAP system. */ - @sap.display.format : 'UpperCase' - @sap.label : 'Supplier' - @sap.quickinfo : 'Account Number of Supplier' - key Supplier : String(10) not null; - /** - * The account number of the vendor with whom automatic payment transactions are carried out. - * - * The field is only needed if payments are not to be made directly to the vendor to whom the payable is owed. The same applies to bank collections of receivables.The specification in this field applies to all company codes. There is a further field in which every company code can enter an alternative payee separately. If both fields are filled, the company code specification has priority. - */ - @sap.display.format : 'UpperCase' - @sap.label : 'Alternative Payee' - @sap.quickinfo : 'Account Number of the Alternative Payee' - AlternativePayeeAccountNumber : String(10); - /** The authorization group allows extended authorization protection for particular objects. The authorization groups are freely definable. The authorization groups usually occur in authorization objects together with an activity. */ - @sap.display.format : 'UpperCase' - @sap.label : 'Authorization' - @sap.quickinfo : 'Authorization Group' - AuthorizationGroup : String(4); - /** Name with which the user who entered the master record was logged on in the R/3 System. */ - @sap.display.format : 'UpperCase' - @sap.label : 'Created by' - @sap.quickinfo : 'Name of Person who Created the Object' - @sap.creatable : 'false' - @sap.updatable : 'false' - CreatedByUser : String(12); - /** Date on which the master record, or the part of the master record being viewed, was created. */ - @sap.display.format : 'Date' - @sap.label : 'Created on' - @sap.quickinfo : 'Date on which the Record Was Created' - @sap.creatable : 'false' - @sap.updatable : 'false' - CreationDate : Date; - /** Gives an alphanumeric key, which clearly identifies the customer or vendor in the SAP system. */ - @sap.display.format : 'UpperCase' - @sap.label : 'Customer' - @sap.quickinfo : 'Customer Number' - Customer : String(10); - @sap.display.format : 'UpperCase' - @sap.label : 'Payment block' - @sap.quickinfo : 'Payment Block' - PaymentIsBlockedForSupplier : Boolean; - /** - * Indicates that the account is blocked for posting for all company codes. - * - * If you set this indicator, the system prevents users from posting items to this account and issues an error message to inform them that the account is blocked. - */ - @sap.display.format : 'UpperCase' - @sap.label : 'Posting Block' - @sap.quickinfo : 'Central Posting Block' - PostingIsBlocked : Boolean; - /** Indicates whether or not the supplier master record is blocked for all departments (that is, whether or not posting to this record is allowed at all). */ - @sap.display.format : 'UpperCase' - @sap.label : 'Purch. block' - @sap.quickinfo : 'Centrally imposed purchasing block' - PurchasingIsBlocked : Boolean; - /** - * The account group is a classifying feature within vendor master records. The account group determines: - * - * the number interval for the account number of the vendor,whether the number is assigned by the user or by the system,which specifications are necessary and/or possible in the master record. - */ - @sap.display.format : 'UpperCase' - @sap.label : 'Account Group' - @sap.quickinfo : 'Supplier Account Group' - SupplierAccountGroup : String(4); - @sap.display.format : 'UpperCase' - @sap.label : 'Supplier Name' - @sap.quickinfo : 'Supplier Full Name' - @sap.creatable : 'false' - @sap.updatable : 'false' - SupplierFullName : String(220); - @sap.label : 'Name of Supplier' - @sap.creatable : 'false' - @sap.updatable : 'false' - SupplierName : String(80); - /** - * VAT registration number (VAT reg.no.) of the customer, vendor or your company code. - * - * The VAT registration number is used within the EU for tax-exempt deliveries for the "EC sales list". The check rules are defined for each EU country and cannot be changed. - */ - @sap.display.format : 'UpperCase' - @sap.label : 'VAT Registration No.' - @sap.quickinfo : 'VAT Registration Number' - VATRegistration : String(20); - @sap.display.format : 'Date' - @sap.label : 'Date of Birth' - @sap.quickinfo : 'Date of Birth of the Person Subject to Withholding Tax' - BirthDate : Date; - @sap.label : 'Int. Location No.' - @sap.quickinfo : 'Cocatenated International Location Number' - @sap.creatable : 'false' - @sap.updatable : 'false' - ConcatenatedInternationalLocNo : String(20); - /** - * Indicates that all data in this master record is to be deleted. - * - * To delete this data, you have to run the archiving program for Accounts Receivable or Payable. This program will archive all master records marked for deletion provided that there is no dependent data in them.Deletion flags can also be used in the program for deleting master data. You should, however, run this program only to delete test data prior to production startup. - */ - @sap.display.format : 'UpperCase' - @sap.label : 'Deletion flag' - @sap.quickinfo : 'Central Deletion Flag for Master Record' - DeletionIndicator : Boolean; - /** - * Specifies an additional master record in which the official address is stored. - * - * This address is used in Italy for business transactions with the tax office in Italy. - */ - @sap.display.format : 'UpperCase' - @sap.label : 'Fiscal address' - @sap.quickinfo : 'Account number of the master record with fiscal address' - FiscalAddress : String(10); - /** - * An industry is a distinct group of companies with the same basic business activity. The industry key is used in selecting data for evaluations (for example, a vendor master data list). You can specify industries such as trade, banking, service, manufacturing, health care, public service, media and so on. - * - * The industry field belongs to the general data area of customer and vendor master records. - */ - @sap.display.format : 'UpperCase' - @sap.label : 'Industry' - @sap.quickinfo : 'Industry key' - @sap.creatable : 'false' - @sap.updatable : 'false' - Industry : String(4); - /** - * Here you enter the first 7 digits of the international location number. - * - * The International Location Number (ILN) is assigned (in Germany by the Centrale for Coorganisation GmbH)) when a company is founded. It consists of 13 digits, the last digit being the check digit. There are two categories of location numbers:Participants who only need an ILN to cleary and unmistakably identify themselves for communication with the business partner are given a category 1 ILN. This cannot be used to identify articles by means of EAN.Participants who wish to assign the location numbers for their own enterprise areas are given a category 2 ILN. For a category 2 ILN, digits 1 to 7 are described as basis number. This is used as basis for the creation of article numbers (EAN). - */ - @sap.display.format : 'NonNegative' - @sap.label : 'Int. location no. 1' - @sap.quickinfo : 'International location number (part 1)' - InternationalLocationNumber1 : String(7); - /** - * Here, you enter digits 8-12 of the 13-digit international location number. - * - * The international location number (ILN) is assigned when establishing a company (by the "Zentrale für Coorganisation GmbH" in Germany). It consists of 13 digits, the last of which is the check digit. There are two types of international location numbers:Subscribers who only need one ILN to identify themselves in communication with the business partner are given an ILN of type 1. These cannot be used for identifying articles by means of EAN.Subscribers who need to assign location numbers for their own company areas are given an ILN of type 2. Positions 1 through 7 of the ILN type 2 are known as the basis number. This basis number forms the basis for article numbers (EAN). - */ - @sap.display.format : 'NonNegative' - @sap.label : 'Int. location no. 2' - @sap.quickinfo : 'International location number (Part 2)' - InternationalLocationNumber2 : String(5); - /** The check digit is derived from a special check digit procedure from digits of the previous international location numbers. In this way, you can check whether the ILN entered is actually valid. */ - @sap.display.format : 'NonNegative' - @sap.label : 'Check digit' - @sap.quickinfo : 'Check digit for the international location number' - InternationalLocationNumber3 : String(1); - /** - * Denotes a natural person. - * - * In the following countries, the system needs to know whether the taxpayer is a legal or natural person so that it can check the tax numbers correctly:BrazilBulgariaColombiaCroatiaGreeceItalyMexicoPeruSloveniaThailandUkraineThe flag is also used in conjunction with the Statement of Payments to Natural Persons report, as used in the Czech Republic and in Slovakia. This report only covers customers and vendors for whom you have set this indicator.In South Korea, it is used in conjunction with the Generic Withholding Tax Reporting program. - */ - @sap.display.format : 'UpperCase' - @sap.label : 'Natural Person' - IsNaturalPerson : String(1); - /** Classification of companies according to tax aspects. */ - @sap.display.format : 'UpperCase' - @sap.label : 'Tax type' - ResponsibleType : String(2); - /** Date up to which the certification of the QM-system is valid. */ - @sap.display.format : 'Date' - @sap.label : 'QM System Valid To' - @sap.quickinfo : 'Validity date of certification' - SuplrQltyInProcmtCertfnValidTo : Date; - /** - * If a QM system is maintained by the supplier, you can store a description of the QM system here. - * - * If a material is activated for QM in procurement, the system initiates the following check whenever purchasing functions are carried out (for example, when a request for a quotation is made or if a purchase order is created):Whether the supplier's verified QM system, according to supplier master record or quality info-record (for a combination of supplier/material) meets the requirements for QM systems as specified in the material masterIn carrying out the check, the system relies on the defined assignments for target QM systems and actual QM systems in the Customizing application.If the check is unsuccessful, a warning message is issued when a request for quotation is initiated and an error message is issued for all other procurement activities. - */ - @sap.display.format : 'UpperCase' - @sap.label : 'Actual QM System' - @sap.quickinfo : 'Supplier''s QM system' - SuplrQualityManagementSystem : String(4); - /** - * If the customer or the vendor belongs to a group, you can enter a group key here. The group key is freely assignable. - * - * If you create a matchcode using this group key, group evaluations are possible. - */ - @sap.display.format : 'UpperCase' - @sap.label : 'Group Key' - SupplierCorporateGroup : String(10); - /** - * Key that determines which procurement functions (for example, request for quotation, purchase order, or goods receipt) should be blocked for quality reasons. - * - * You can enter a block key in the:Supplier master recordIn this case, the supplier block applies to all materials and plants.Quality info record for QM in procurementIn this case, the supplier block applies to a single material and plant.A block for quality reasons applies only to those materials for which QM in procurement is active. - */ - @sap.display.format : 'UpperCase' - @sap.label : 'Block Function' - @sap.quickinfo : 'Function That Will Be Blocked' - SupplierProcurementBlock : String(2); - /** - * Specifies the tax number. - * - * Enter the appropriate tax number:Country Tax NumberArgentina CUIT number or CUIL numberBelgium Enterprise numberBrazil CNPJ numberBulgaria Unified identification codeChile RUT numberChina VAT registration number (shui wu deng ji hao)Colombia NIT numberCroatia Legal persons: company identification numberNatural persons: JMBG numberCzech Republic DIC numberFrance SIRET numberGreece Personal IDHungary Tax numberItaly Fiscal codeKazakhstan RNN (obsolete)Mexico RFC numberNetherlands SI registration number (Aansluitnummer UWV) of chain- liability vendorNorway VAT numberPeru RUC numberPhilippines Taxpayer identification number (see below)Poland NIP numberPortugal NIF numberRomania Tax numberRussia INNSlovakia DIC numberSlovenia Tax numberSouth Korea Natural persons: Personal identification numberLegal persons: Corporation IDSpain NIF numberSwitzerland UID numberTaiwan - China GUI registration numberThailand Personal IDTurkey Name of business partner's tax officeUkraine Taxpayer identification numberUnited Kingdom Company registration numberUnited States Social security numberVenezuela RIF numberIn the Philippines, enter the taxpayer identification number with a V or N at the end, as follows:If the business partner is liable to VAT: 999-999-999-999VIf the business partner is not liable to VAT: 999-999-999-999N - */ - @sap.display.format : 'UpperCase' - @sap.label : 'Tax Number 1' - @sap.creatable : 'false' - @sap.updatable : 'false' - TaxNumber1 : String(16); - /** - * Specifies the tax number. - * - * Enter the appropriate tax number:Country Tax NumberArgentina NIP number or CM numberBelgium VAT numberBrazil CPF numberBulgaria Legal persons: tax numberNatural persons: personal IDCroatia OIB number Czech Republic ICO numberFrance SIREN numberGreece AFM numberIndia TINItaly VAT numberKazakhstan BC (Beneficiary Code)Netherlands BSN numberRussia OKPO codeSlovakia ICO numberSouth Korea VAT registration numberSweden Organization registration numberSwitzerland VAT numberTaiwan - China Tax registration numberUkraine Legal persons: USREOU numberNatural persons: SRNP numberTurkey Tax numberUnited Kingdom NI numberUnited States Employer identification numberVenezuela NIT number - */ - @sap.display.format : 'UpperCase' - @sap.label : 'Tax Number 2' - @sap.creatable : 'false' - @sap.updatable : 'false' - TaxNumber2 : String(11); - /** - * Specifies the tax number. - * - * Enter the tax number that applies:Country Tax numberArgentina Withholding agent numberBrazil State tax numberBulgaria Social security numberMexico CURP numberKazakhstan BINNetherlands Tax registration number (Loonbelastingnummer) of the chain-liability vendorRussia KPP numberThailand Tax ID Ukraine VAT registration number - */ - @sap.display.format : 'UpperCase' - @sap.label : 'Tax Number 3' - @sap.creatable : 'false' - @sap.updatable : 'false' - TaxNumber3 : String(18); - /** - * Specifies the tax number. - * - * Enter the appropriate tax number:Country Tax NumberBrazil Municipal tax numberKazakhstan IINRussia OFK number (for public bodies only) - */ - @sap.display.format : 'UpperCase' - @sap.label : 'Tax Number 4' - @sap.creatable : 'false' - @sap.updatable : 'false' - TaxNumber4 : String(18); - /** - * Kazakhstan - * - * Specifies the certificate of registration as VAT payer in the following format: XXXXXYYYYYYYZZZZZZZZ, where: XXXXX is the certificate serial number, YYYYYYY is the certificate number and ZZZZZZZZ is the date of certificate issue. - */ - @sap.display.format : 'UpperCase' - @sap.label : 'Tax Number 5' - @sap.creatable : 'false' - @sap.updatable : 'false' - TaxNumber5 : String(60); - /** The tax number of the vendor at the responsible tax authority. */ - @sap.display.format : 'UpperCase' - @sap.label : 'Tax Number' - @sap.quickinfo : 'Tax Number at Responsible Tax Authority' - TaxNumberResponsible : String(18); - /** - * Taxes in Argentina: - * - * The format and the check of tax number 1 depend on the two-digit tax number type.The tax number type is an identification type for tax in Argentina (for example, 80 for CUIT) and is used for the DGI tax report. - */ - @sap.display.format : 'UpperCase' - @sap.label : 'Tax Number Type' - TaxNumberType : String(2); - /** - * This indicator controls the process of proof of delivery during the incoming goods process for inbound deliveries. Processing is activating by switching on this indicator in the supplier master and by switching on the corresponding indicator in the delivery item category. - * - * There are the following different characteristics:' ': not relevant for POD'A': generally relevant for POD'B': only relevant for POD if differences(Difference between notified quantity and actual quantity received) - */ - @sap.display.format : 'UpperCase' - @sap.label : 'Relevant for POD' - @sap.quickinfo : 'Supplier indicator relevant for proof of delivery' - SuplrProofOfDelivRlvtCode : String(1); - /** - * Tax calculation for Brazil: - * - * The IPI tax value is split up for this vendor. 50% of the calculated IPI tax value is posted as deductible input tax, 50% is deducted from the inventory posting or posting to expense account. - */ - @sap.display.format : 'UpperCase' - @sap.label : 'Tax split' - @sap.quickinfo : 'Tax Split' - BR_TaxIsSplit : Boolean; - @cds.ambiguous : 'missing on condition?' - to_SupplierCompany : Association to many API_BUSINESS_PARTNER.A_SupplierCompany { }; - @cds.ambiguous : 'missing on condition?' - to_SupplierPurchasingOrg : Association to many API_BUSINESS_PARTNER.A_SupplierPurchasingOrg { }; -}; - -@cds.external : true -@cds.persistence.skip : true -@sap.deletable : 'false' -@sap.content.version : '1' -@sap.label : 'Supplier Company' -entity API_BUSINESS_PARTNER.A_SupplierCompany { - /** Specifies an alphanumeric key that uniquely identifies the supplier in the SAP system. */ - @sap.display.format : 'UpperCase' - @sap.label : 'Supplier' - @sap.quickinfo : 'Account Number of Supplier' - key Supplier : String(10) not null; - /** The company code is an organizational unit within financial accounting. */ - @sap.display.format : 'UpperCase' - @sap.label : 'Company Code' - key CompanyCode : String(4) not null; - /** The authorization group allows extended authorization protection for particular objects. The authorization groups are freely definable. The authorization groups usually occur in authorization objects together with an activity. */ - @sap.display.format : 'UpperCase' - @sap.label : 'Authorization' - @sap.quickinfo : 'Authorization Group' - AuthorizationGroup : String(4); - @sap.label : 'Company Name' - @sap.quickinfo : 'Name of Company Code or Company' - @sap.creatable : 'false' - @sap.updatable : 'false' - CompanyCodeName : String(25); - /** - * Block key (enqueue key) that is used to block an open item or an account to payment transactions. - * - * You can use the block key as described below.Automatic Payment TransactionsIn automatic payment transactions, the block takes effect when it is entered in the system as follows:In the master recordIn the documentIf you enter the block in the master record then all open items for this account are contained in the exception list.The following block keys have a special meaning in the master record:The block key * has the effect that all items of the account are skipped in automatic payment transactions.The block key + has the effect that all items are skipped in which a payment method was not entered explicitly.The block key A is always set automatically when a down payment is entered. Therefore, you must not delete the block key A or use it for other purposes.Whether a block key can be set or removed in payment proposal processing depends on the attribute Changeable in payment proposal of the block key.Manual PaymentsManual payments are only affected by a block key in the document if you set the attribute Blocked for manual payments in the block key.A block key that was set in the master record does not have any effect on manual payments. You can have the system issue a warning message in that case. To do so, you have to make system settings. Set up message 671 of work area F5 in message control accordingly. - */ - @sap.display.format : 'UpperCase' - @sap.label : 'Payment Block' - @sap.quickinfo : 'Block Key for Payment' - PaymentBlockingReason : String(1); - /** - * Indicates that the account is blocked for posting in the specified company code. - * - * If you set this indicator, the system prevents users from posting items to this account and issues an error message to inform them that the account is blocked. - */ - @sap.display.format : 'UpperCase' - @sap.label : 'Co.code post.block' - @sap.quickinfo : 'Posting block for company code' - SupplierIsBlockedForPosting : Boolean; - /** - * Identification code for the accounting clerk. - * - * The name of the accounting clerk defined by this identification code can be used in the payment program for correspondence and reporting (for example, open item lists). - */ - @sap.display.format : 'UpperCase' - @sap.label : 'Clerk Abbrev.' - @sap.quickinfo : 'Accounting Clerk Abbreviation' - AccountingClerk : String(2); - @sap.label : 'Acctg clerk''s fax' - @sap.quickinfo : 'Accounting clerk''s fax number at the customer/vendor' - AccountingClerkFaxNumber : String(31); - @sap.display.format : 'UpperCase' - @sap.label : 'Acct.clerks tel.no.' - @sap.quickinfo : 'Accounting clerk''s telephone number at business partner' - AccountingClerkPhoneNumber : String(30); - /** Name or identification code of the accounting clerk at the vendor. */ - @sap.label : 'Clerk at vendor' - SupplierClerk : String(15); - @sap.label : 'Clrk''s internet add.' - @sap.quickinfo : 'Internet address of partner company clerk' - SupplierClerkURL : String(130); - /** - * List of payment methods which may be used in automatic payment transactions with this customer/vendor if you do not specify a payment method in the item to be paid. - * - * If you do specify a particular payment method in the item to be paid, this specification has priority over the specifications in the master record. You may also specify payment methods in the item which are not listed in the master record. - */ - @sap.display.format : 'UpperCase' - @sap.label : 'Payment Methods' - @sap.quickinfo : 'List of Respected Payment Methods' - PaymentMethodsList : String(10); - /** - * Key for defining payment terms composed of cash discount percentages and payment periods. - * - * It is used in sales orders, purchase orders, and invoices. Terms of payment provide information for:Cash managementDunning proceduresPayment transactionsData can be entered in the field for the terms of payment key in various ways as you enter a business transaction:In most business transactions, the system defaults the key specified in the master record of the customer/vendor in question.In some transactions (for example, credit memos), however, the system does not default the key from the master record. Despite this, you can use the key from the customer/vendor master record by entering "*" in the field.Regardless of whether or not a key is defaulted from the master record, you can manually enter a key during document entry at:item level in sales ordersheader level in purchase orders and invoicesMaster records have separate areas for Financial Accounting, Sales, and Purchasing. You can specify different terms of payment keys in each of these areas. When you then enter a business transaction, the application in question will use the key specified in its area of the master record. - */ - @sap.display.format : 'UpperCase' - @sap.label : 'Terms of Payment' - @sap.quickinfo : 'Terms of Payment Key' - PaymentTerms : String(4); - /** - * Indicates that during automatic payment transactions, clearing is made with the corresponding customer account, and that during manual clearing procedures, the items of that customer account are also selected. - * - * To use this function in automatic payment transactions, you have toenter the customer account number in the vendor master record,enter the vendor account number in the customer master record, andselect the "Clearing with vendor" indicator in the customer master record.If this indicator is set, items belonging to the customer account will be included in any dunning run. - */ - @sap.display.format : 'UpperCase' - @sap.label : 'Clearing with cust.' - @sap.quickinfo : 'Indicator: Clearing between customer and vendor?' - ClearCustomerSupplier : Boolean; - /** - * Indicates that payment transactions and dunning notices are created for the branch. - * - * Normally automatic payment transactions and dunning notices are created for the head office.NoteSelect this indicator only if this account is a head office account. - */ - @sap.display.format : 'UpperCase' - @sap.label : 'Local Processing' - @sap.quickinfo : 'Indicator: Local Processing?' - IsToBeLocallyProcessed : Boolean; - /** If this indicator is set, every customer/vendor open item is paid separately during automatic payment transactions. This means that open items are not grouped together for payment. */ - @sap.display.format : 'UpperCase' - @sap.label : 'Individual Payment' - @sap.quickinfo : 'Indicator: Pay All Items Separately?' - ItemIsToBePaidSeparately : Boolean; - /** This indicator specifies that the customer/vendor should be sent all payment advice information by EDI. */ - @sap.display.format : 'UpperCase' - @sap.label : 'Pmnt advice by EDI' - @sap.quickinfo : 'Indicator: Send Payment Advices by EDI' - PaymentIsToBeSentByEDI : Boolean; - /** All bank data is determined using this key. */ - @sap.display.format : 'UpperCase' - @sap.label : 'House Bank' - @sap.quickinfo : 'Short Key for a House Bank' - HouseBank : String(5); - /** - * Number of days which usually pass until the vendor has cashed your check. - * - * During automatic payment transactions, the system calculates the value date for check payments using this information and stores the date in the line item. The date is calculated as follows:Value date = posting date + check cashing timeIn Cash Management, the value date is used as information about the expected cash outflow. - */ - @sap.label : 'Check Cashing Time' - @sap.quickinfo : 'Probable Time Until Check Is Paid' - CheckPaidDurationInDays : Decimal(3, 0); - /** Currency key for amounts in the system. */ - @sap.label : 'Currency' - @sap.quickinfo : 'Currency Key' - @sap.semantics : 'currency-code' - Currency : String(5); - /** - * Maximum amount which may be issued on a bill of exchange if it is to be used in payment transactions with the business partner. - * - * The amount limit is taken into consideration in automatic payment transactions for payments by bill of exchange and bill of exchange payment requests. Several bill of exchange forms are created if the amount to be settled is higher than the maximum amount given here. Each of these bills of exchange is issued for the maximum amount or for a smaller amount.Amount limits for bills of exchange are used in Spain, for example. - */ - @sap.unit : 'Currency' - @sap.label : 'Bill/Ex. Limit' - @sap.quickinfo : 'Bill of Exchange Limit (in Local Currency)' - BillOfExchLmtAmtInCoCodeCrcy : Decimal(14, 3); - /** This field contains the account number the company is listed under at the vendor. */ - @sap.display.format : 'UpperCase' - @sap.label : 'Account with vendor' - @sap.quickinfo : 'Our account number with the vendor' - SupplierClerkIDBySupplier : String(12); - /** - * The reconciliation account in G/L accounting is the account which is updated parallel to the subledger account for normal postings (for example, invoice or payment). - * - * For special postings (for example, down payment or bill of exchange), this account is replaced by another account (for example, 'down payments received' instead of 'receivables').The replacement takes place due to the special G/L indicator which you must specify for these types of postings. - */ - @sap.display.format : 'UpperCase' - @sap.label : 'Reconciliation Acct' - @sap.quickinfo : 'Reconciliation Account in General Ledger' - ReconciliationAccount : String(10); - /** Enter an interest calculation indicator here if the account is to be included in automatic interest calculation. */ - @sap.display.format : 'UpperCase' - @sap.label : 'Interest indicator' - @sap.quickinfo : 'Interest calculation indicator' - InterestCalculationCode : String(2); - /** - * The date in this field displays the last time the interest calculation program processed this account. This is generally the upper limit of the last interest run. - * - * Generally, this date is automatically maintained by the program (batch input). A manual entry in this field should only be made if an error has occurred or when implementing the interest calculation. - */ - @sap.display.format : 'Date' - @sap.label : 'Last Key Date' - @sap.quickinfo : 'Key Date of Last Interest Calculation' - InterestCalculationDate : Date; - /** - * This field contains the account number of the master record for the head office account. - * - * You specify this account number only for branch accounts. Items that you post using the branch account number are automatically posted to the head office account. The system records the branch account number in the line items.Neither transactions nor balances are kept in the branch account. - */ - @sap.display.format : 'UpperCase' - @sap.label : 'Head office' - @sap.quickinfo : 'Head office account number' - SupplierHeadOffice : String(10); - /** - * The account number of the vendor with whom automatic payment transactions are to be carried out. - * - * The field is only needed if payments are not to be made directly to the vendor to whom the payable is owed. The same applies to bank collections of receivables.The specification in this field applies only to the company code. There is a further field in which you can enter an alternative payee for each company code. If both fields are filled, the company code specified has priority. - */ - @sap.display.format : 'UpperCase' - @sap.label : 'Alternative payee' - @sap.quickinfo : 'Account number of the alternative payee' - AlternativePayee : String(10); - /** - * Indicates the layout rule for the Allocation field in the document line item. - * - * The system uses a standard sort sequence for displaying line items. Among other things, it sorts the items according to the content of the Allocation field. This field can be filled either manually or automatically (by the system) when a document line item is entered.For this purpose, the system requires rules that determine which information is to be taken from the document header or from the document line item and placed in the field. The rules can be stored in the master record of an account which enables you to determine the standard sort sequence on an account-specific basis.NoteField information from another document line item cannot be adopted into the field of a particular item. - */ - @sap.display.format : 'UpperCase' - @sap.label : 'Sort Key' - @sap.quickinfo : 'Key for Sorting According to Assignment Numbers' - LayoutSortingRule : String(3); - /** Contains settings that control how the system handles differences between the invoice amount and the amount received from a customer or the amount paid to a supplier. A tolerance group is unique within a company code. */ - @sap.display.format : 'UpperCase' - @sap.label : 'Tolerance Group' - @sap.quickinfo : 'Tolerance Group for Business Partner/G/L Account' - APARToleranceGroup : String(4); - /** - * US government requirement. - * - * Date field in which to enter certification date for small companies run by women or minorities. This certificate must be renewed every two years. - */ - @sap.display.format : 'Date' - @sap.label : 'Certification Date' - SupplierCertificationDate : Date; - /** - * Internal memo of the accounting department. - * - * The memo serves only as information on special features of the customer/vendor. - */ - @sap.label : 'Account Memo' - @sap.quickinfo : 'Memo' - SupplierAccountNote : String(30); - /** - * In some countries, an additional country is needed for calculating or reporting withholding tax. - * - * The calculation can depend on the payee's country.A particular country key can be required by law for reporting which may possibly be different to the key used in the address.Examples: Japan, USA (1042), Argentina - */ - @sap.display.format : 'UpperCase' - @sap.label : 'WTax Country' - @sap.quickinfo : 'Withholding Tax Country Key' - WithholdingTaxCountry : String(3); - /** - * Indicates that the company code data in this master record is to be deleted. - * - * To delete this data, you have to run the archiving program for Accounts Receivable or Payable. This program will archive all master records marked for deletion provided that there is no dependent data in them.This deletion flag cannot be used in the program that deletes master data. You should, however, run this program only to delete test data prior to production startup. - */ - @sap.display.format : 'UpperCase' - @sap.label : 'Co.cde deletion flag' - @sap.quickinfo : 'Deletion Flag for Master Record (Company Code Level)' - DeletionIndicator : Boolean; - /** - * In cash management, customers and vendors are allocated to planning groups by means of an entry made in the master record. - * - * You can define these planning groups in Customizing or the Implementation Guide (you will need to ensure that they are all the same length). In order to improve the liquidity forecast display for major customers and vendors, it can be advisable to enter their account number as the planning group.For the planning groups themselves a naming convention should be set up to improve liquidity forecasting. In the following examples, the customer planning groups begin with an "R" for receipts, and the vendor planning groups begin with an "E" for expenses.R1 Customers paying by bank collectionR2 Other domestic customersR3 Customers abroadR4 Affiliated company customersR5 High risk customersR6 Major customersR7 Rental incomeR8 Repayment of loans...E1 Domestic vendorsE2 Vendors abroadE3 Affiliated company vendorsE4 Major vendorsE5 Personnel costsE6 TaxesE7 Investments... - */ - @sap.display.format : 'UpperCase' - @sap.label : 'Planning Group' - CashPlanningGroup : String(10); - /** - * When incoming invoices are entered or when memos are entered in Financial Accounting (FI), the system checks whether an invoice or credit memo has already been entered for the same date. - * - * Checking Logistics DocumentsThe system checks whether the invoice documents have already been entered in the Logistics invoice verification. For this, the system checks invoices that have been held or parked or that contain errors, or invoices that were entered for invoice verification in the background. The check is performed only if you specify the reference document number when you enter the invoices.When checking for duplicate invoices, the system compares the following specified characteristics:VendorCurrencyCompany CodeGross Invoice AmountReference Document NumberInvoice Document DateIf all of these characteristics are the same, the system issues a message for which you can change the message type in Customizing.When you enter credit memos or subsequent adjustments, the system does not check for duplicate invoices.Exception: The exception is the Argentina country version, where the system checks for duplicate invoices and credit memos.No message is issued if you enter a document that has previously been reversed.In Customizing for Logistics Invoice Verification under Incoming Invoice -> Set Check for Duplicate Invoices, you can specify that the following characteristics are not checked:Reference Document NumberInvoice Document DateCompany CodeHaving fewer attributes to check increases the likelihood that the system will find a duplicate invoice.Example:The following document has already been entered and posted:Reference Document Number 333Invoice Date: 4/28/2000Gross Invoice Amount 100.00Currency: EURVendor: SpencerCompany Code: ChicagoYou have set up the check for duplicate invoices as follows in Customizing:The characteristics Reference Document Number and Company Code are not activated. Consequently, these characteristics are not checked.Now you enter the following invoice:Reference Document Number 334Invoice Date: 4/28/2000Gross Invoice Amount 100.00Currency: EURVendor: SpencerCompany Code: FlagstaffResultBecause you entered a reference document when you entered the invoice, the system checks for duplicate invoices. Compared against the invoice entered earlier, the invoice just entered has different values in the characteristics Reference and Company Code. However, these characteristics are not checked due to the settings that you have made in Customizing. All other characteristics are the same. The system issues a message telling you that an invoice has been entered twice.If the characteristic "Reference Document Number" had been selected in Customizing, the system would have checked the reference document number and established that it was different from the invoice entered earlier, and it consequently would not have issued a message.Checking FI DocumentsThe system checks whether there are FI documents that were posted or parked with the Logistics invoice verification or with an FI invoice transaction. Depending on the entry in the Reference field, one of the following checks is performed:If a reference number was specified in the sequential invoice/credit memo, the system checks whether an invoice/credit memo has already been posted for which all the following attributes agree:Company CodeVendorCurrencyDocument DateReference NumberIf no reference number was specified in the sequential invoice/credit memo, the system checks whether an invoice/credit memo has already been posted for which all the following attributes agree:Company CodeVendorCurrencyDocument DateAmount in Document CurrencyIn Materials Management, the system applies the check for duplicate invoices for invoices only, not for credit memos. - */ - @sap.display.format : 'UpperCase' - @sap.label : 'Check Double Invoice' - @sap.quickinfo : 'Check Flag for Double Invoices or Credit Memos' - IsToBeCheckedForDuplicates : Boolean; - @sap.display.format : 'UpperCase' - @sap.label : 'Minority Indicator' - MinorityGroup : String(3); - /** - * The account group is a classifying feature within vendor master records. The account group determines: - * - * the number interval for the account number of the vendor,whether the number is assigned by the user or by the system,which specifications are necessary and/or possible in the master record. - */ - @sap.display.format : 'UpperCase' - @sap.label : 'Account Group' - @sap.quickinfo : 'Supplier Account Group' - SupplierAccountGroup : String(4); - @cds.ambiguous : 'missing on condition?' - to_SupplierDunning : Association to many API_BUSINESS_PARTNER.A_SupplierDunning { }; - @cds.ambiguous : 'missing on condition?' - to_SupplierWithHoldingTax : Association to many API_BUSINESS_PARTNER.A_SupplierWithHoldingTax { }; -}; - -@cds.external : true -@cds.persistence.skip : true -@sap.content.version : '1' -@sap.label : 'Supplier Dunning' -entity API_BUSINESS_PARTNER.A_SupplierDunning { - /** Specifies an alphanumeric key that uniquely identifies the supplier in the SAP system. */ - @sap.display.format : 'UpperCase' - @sap.label : 'Supplier' - @sap.quickinfo : 'Account Number of Supplier' - key Supplier : String(10) not null; - /** The company code is an organizational unit within financial accounting. */ - @sap.display.format : 'UpperCase' - @sap.label : 'Company Code' - key CompanyCode : String(4) not null; - /** - * The dunning area represents an organizational entity that is responsible for dunning. The dunning areas represent a sub-structure of the company codes. - * - * If different responsibilities or different dunning procedures exist within a company code, you can set up corresponding dunning areas.All dunning notices are made separately according to dunning areas, and if necessary with different dunning procedures.The dunning area must be noted in the line items. As long as documents are copied from preliminary work areas (billing documents), the dunning area can be derived from details such as division or sales area, if necessary. - */ - @sap.display.format : 'UpperCase' - @sap.label : 'Dunning Area' - key DunningArea : String(2) not null; - /** Key which reflects the reason for a dunning block indicator. */ - @sap.display.format : 'UpperCase' - @sap.label : 'Dunning Block' - DunningBlock : String(1); - /** - * Number that specifies how often an item or account has been dunned. - * - * The business partner has received the dunning level from the last dunning run.If you use dunning areas, it is the dunning level that the business partner received from the last dunning run in the dunning area assigned.The dunning program sets the dunning level automatically when the customer or vendor receives a dunning notice. - */ - @sap.display.format : 'NonNegative' - @sap.label : 'Dunning Level' - DunningLevel : String(1); - /** This field contains the key for the dunning procedure to be used. */ - @sap.display.format : 'UpperCase' - @sap.label : 'Dunning Procedure' - DunningProcedure : String(4); - /** - * Account number of the vendor who is to receive the dunning notice. - * - * Note:If an entry is not made in this field, the dunning notice is sent to the address of the vendor to be processed. - */ - @sap.display.format : 'UpperCase' - @sap.label : 'Dunn.recipient' - @sap.quickinfo : 'Account number of the dunning recipient' - DunningRecipient : String(10); - /** Date on which the last dunning notice was made. */ - @sap.display.format : 'Date' - @sap.label : 'Last Dunned' - @sap.quickinfo : 'Date of Last Dunning Notice' - LastDunnedOn : Date; - /** - * Date on which a legal dunning procedure was initiated. - * - * The printing of dunning notices in the legal dunning procedure generates an internal notice about any further account movements. A dunning notice is not created for the customer.If the Legal dunning procedure field in the master record contains a date, this means that the account is involved in a legal dunning procedure. The relationship between this date and the dunning date does not affect how the account is processed.The printing of account movements in the legal dunning procedure differs from the normal printing of dunning notices as follows:You must specify a separate form for your dunning procedure in Customizing. For more information, see Customizing (IMG) under Dunning Forms.The dunning program also displays text element 520 "Legal dunning procedure". This makes it possible to display the date of the legal dunning procedure from the master record.The program also displays the documents blocked for dunning and those with a payment method (automatic debit, bank direct debit).Although dunning notices are printed, the dunning level does not change in the master record or in the items. New dunning level = old dunning level.The program only updates the date of the last dunning run.Enter the date manually. - */ - @sap.display.format : 'Date' - @sap.label : 'Legal Dunn.Proc.From' - @sap.quickinfo : 'Date of the Legal Dunning Proceedings' - LegDunningProcedureOn : Date; - /** - * Identification code for the accounting clerk dealing with dunning letters. - * - * Using this identification code, the accounting clerk whose name is printed on the dunning letters is determined.If this field is not filled, then the entry from the Accounting clerk field is used. - */ - @sap.display.format : 'UpperCase' - @sap.label : 'Dunning Clerk' - DunningClerk : String(2); - /** The authorization group allows extended authorization protection for particular objects. The authorization groups are freely definable. The authorization groups usually occur in authorization objects together with an activity. */ - @sap.display.format : 'UpperCase' - @sap.label : 'Authorization' - @sap.quickinfo : 'Authorization Group' - AuthorizationGroup : String(4); - /** - * The account group is a classifying feature within vendor master records. The account group determines: - * - * the number interval for the account number of the vendor,whether the number is assigned by the user or by the system,which specifications are necessary and/or possible in the master record. - */ - @sap.display.format : 'UpperCase' - @sap.label : 'Account Group' - @sap.quickinfo : 'Supplier Account Group' - SupplierAccountGroup : String(4); -}; - -@cds.external : true -@cds.persistence.skip : true -@sap.content.version : '1' -@sap.label : 'Purchasing Partner Functions' -entity API_BUSINESS_PARTNER.A_SupplierPartnerFunc { - /** Specifies an alphanumeric key that uniquely identifies the supplier in the SAP system. */ - @sap.display.format : 'UpperCase' - @sap.label : 'Supplier' - @sap.quickinfo : 'Account Number of Supplier' - key Supplier : String(10) not null; - /** Denotes the purchasing organization. */ - @sap.display.format : 'UpperCase' - @sap.label : 'Purch. Organization' - @sap.quickinfo : 'Purchasing Organization' - key PurchasingOrganization : String(4) not null; - /** - * Subdivision of a supplier's overall product range according to various criteria. - * - * For each supplier sub-range:The master data is kept on a common basisCertain conditions applyIn the supplier master, you can create different purchasing data and different partner functions for each supplier sub-range.You can also maintain and change the conditions for each supplier sub-range. You assign a material to a supplier sub-range in the info record.In the supplier master, you can maintain different data for particular supplier sub-ranges, such as ordering addresses or terms of payment, for example.When creating a purchase order with a known supplier, different data is only determined if the supplier sub-range is entered in the initial screen.Your supplier Smith in Houston has two sub-ranges: paint and glue.All materials from the "paint" sub-range are ordered in Houston.You have maintained an alternative ordering address in Detroit for the "glue" sub-range.If you order materials from the "glue" sub-range, the supplier sub-range finds the Detroit ordering address. - */ - @sap.display.format : 'UpperCase' - @sap.label : 'Supplier Subrange' - key SupplierSubrange : String(6) not null; - /** Key uniquely identifying a plant. */ - @sap.display.format : 'UpperCase' - @sap.label : 'Plant' - key Plant : String(4) not null; - /** The abbreviated form of the name that identifies the partner function. */ - @sap.display.format : 'UpperCase' - @sap.label : 'Partner Function' - key PartnerFunction : String(2) not null; - /** - * The sequential number that the system applies when there is more than one partner for a particular partner function. - * - * When you create a sales order for a particular customer, there may be more than one ship-to party defined. The different ship-to parties are numbered sequentially. - */ - @sap.display.format : 'NonNegative' - @sap.label : 'Partner counter' - key PartnerCounter : String(3) not null; - /** - * Specifies a partner as the default for a particular partner function. - * - * When you enter more than one partner for a particular partner function (for example, you define three different ship-to parties), you can select one partner as the default. During sales or purchasing processing, if you have defined multiple partners for a partner function, the system prompts you to choose just one partner. The system presents the default partner as the first choice in the pop-up window. - */ - @sap.display.format : 'UpperCase' - @sap.label : 'Default Partner' - DefaultPartner : Boolean; - @sap.display.format : 'Date' - @sap.label : 'Created On' - @sap.quickinfo : 'Date on Which Record Was Created' - @sap.creatable : 'false' - @sap.updatable : 'false' - CreationDate : Date; - @sap.display.format : 'UpperCase' - @sap.label : 'Created By' - @sap.quickinfo : 'Name of Person Who Created Object' - @sap.creatable : 'false' - @sap.updatable : 'false' - CreatedByUser : String(12); - @sap.display.format : 'UpperCase' - @sap.label : 'Ref. to vendor' - @sap.quickinfo : 'Reference to other vendor' - ReferenceSupplier : String(10); - /** The authorization group allows extended authorization protection for particular objects. The authorization groups are freely definable. The authorization groups usually occur in authorization objects together with an activity. */ - @sap.display.format : 'UpperCase' - @sap.label : 'Authorization' - @sap.quickinfo : 'Authorization Group' - AuthorizationGroup : String(4); -}; - -@cds.external : true -@cds.persistence.skip : true -@sap.deletable : 'false' -@sap.content.version : '1' -@sap.label : 'Purchasing Organization' -entity API_BUSINESS_PARTNER.A_SupplierPurchasingOrg { - /** - * Alphanumeric key uniquely identifying the document. - * - * With the supplier number, information from the supplier master record (such as the supplier's address and bank details) is copied into a purchasing document (such as a request for quotation or a purchase order).You can use the supplier number to keep track of requests for quotation, purchase orders and outline agreements. - */ - @sap.display.format : 'UpperCase' - @sap.label : 'Supplier' - @sap.quickinfo : 'Supplier''s Account Number' - key Supplier : String(10) not null; - /** Denotes the purchasing organization. */ - @sap.display.format : 'UpperCase' - @sap.label : 'Purch. Organization' - @sap.quickinfo : 'Purchasing Organization' - key PurchasingOrganization : String(4) not null; - /** - * Determines which calculation schema (pricing procedure) is to be used in purchasing documents containing this supplier number. - * - * You can use the schema group to specify the calculation schema per purchasing organization or supplier. The relevant calculation schema is determined by reference to the schema group.The effect of this is that the conditions to be maintained in a purchasing document can differ depending on the relevant purchasing organization or supplier.If a calculation schema is only to be valid for certain purchasing organizations or suppliers, proceed as follows:Define the schema group for the purchasing organization or the supplier using the relevant function in the menu "Calculation schema -> Schema groups".Assign the schema group to the calculation schema via "Calculation schema -> Determine schema".Enter the schema group for the supplier in the supplier master records to which the calculation schema is to be assigned. Assign the schema group of the purchasing organization to the relevant purchasing organization using "Calculation schema -> Schema group -> Assign to purch. org.". - */ - @sap.display.format : 'UpperCase' - @sap.label : 'Schema Grp, Supplier' - @sap.quickinfo : 'Group for Calculation Schema (Supplier)' - CalculationSchemaGroupCode : String(2); - /** Indicates whether or not the supplier master record is earmarked for deletion. */ - @sap.display.format : 'UpperCase' - @sap.label : 'Del. flag POrg.' - @sap.quickinfo : 'Deletion Indicator for Supplier at Purchasing Level' - DeletionIndicator : Boolean; - /** - * Commonly used trading terms that comply with the standards established by the International Chamber of Commerce (ICC). - * - * Incoterms specify internationally recognized procedures that the shipper and the receiving party must follow for the shipping transaction to be completed successfully.If goods are shipped through a port of departure, the appropriate Incoterm might be: FOB ("Free On Board"). You can provide further details (for example, the name of the port) in the secondary Incoterm field: FOB Boston, for example. - */ - @sap.display.format : 'UpperCase' - @sap.label : 'Incoterms' - @sap.quickinfo : 'Incoterms (Part 1)' - IncotermsClassification : String(3); - /** - * Additional information for the primary Incoterm. - * - * If the primary Incoterm is, for example, FOB ("Free on Board"), then the second field provides details of the port from which the delivery leaves (for example, "FOB Boston"). - */ - @sap.label : 'Incoterms (Part 2)' - IncotermsTransferLocation : String(28); - /** An incoterms version is an edition containing a list of international terms for transportation that is defined by the International Chamber of Commerce (ICC). */ - @sap.display.format : 'UpperCase' - @sap.label : 'Incoterms Version' - IncotermsVersion : String(4); - /** - * Provides additional information for the primary Incoterm. For Incoterms 2010, this field represents: - * - * 1. For sea and inland waterway transport - Port of Shipment2. For any mode of transport - Place of Delivery 2010Incoterms are divided as follows:Group 1: Rules for any mode or modes of transport (including by vessel)Incoterms Incoterms Description Location 1 EXW Ex Works Place of DeliveryFCA Free Carrier Place of DeliveryCPT Carriage Paid To Place of DestinationCIP Carriage & Insurance Paid To Place of DestinationDAF Delivered at Frontier Place of DeliveryDDP Delivered Duty Paid Place of DestinationDDU Delivered Duty Unpaid Place of DestinationGroup 2: Rules for sea and inland waterwaysIncoterms Incoterms Description Location 1 FAS Free Alongside Ship Port of ShipmentFOB Free On Board Port of ShipmentCFR Cost & Freight Port of DestinationCIF Cost Insurance & Freight Port of DestinationDEQ Delivered Eq Quay (Duty Paid) Port of DestinationDES Delivered Ex Ship Port of DestinationIf the primary incoterm is specified as FOB “Free on Board”, the second field provides details of the port from which the delivery leaves, such as FOB Boston. - */ - @sap.label : 'Incoterms Location 1' - IncotermsLocation1 : String(70); - /** - * Provides additional information for the Incoterms. This field is only available for C-Clauses (if customized appropriately). Note the following for the incoterms versions below: - * - * No Version:This field is disabledIncoterm Version 2000This field is disabled as part of standard delivery unless a customer decides to enable it by the way of Customizing for Sales and Distribution under Master Data -> Business Partners -> Customers -> Billing Document -> Incoterms -> Map Incoterms to Versions.Incoterm Version 2010For this version, the field represents:Sea and inland waterway transport - Port of DestinationAny mode of transport - Place of Destination2010 Incoterms are divided as follows:Group 1: Rules for any mode or modes of transport (including by vessel)Incoterms Incoterms Description Location 2CPT Carriage Paid To Place of DestinationCIP Carriage & Insurance Paid To Place of DestinationGroup 2: Rules for sea and inland waterwaysIncoterms Incoterms Description Location 2CFR Cost & Freight Port of DestinationCIF Cost Insurance & Freight Port of Destination - */ - @sap.label : 'Incoterms Location 2' - IncotermsLocation2 : String(70); - /** Indicator specifying that provision has been made for goods-receipt-based invoice verification for a purchase order item or invoice item. */ - @sap.display.format : 'UpperCase' - @sap.label : 'GR-Based Inv. Verif.' - @sap.quickinfo : 'Indicator: GR-Based Invoice Verification' - InvoiceIsGoodsReceiptBased : Boolean; - /** - * Number of calendar days needed to obtain the material or service if it is procured externally. - * - * If you have different vendors for a material, you must specify an average value. The same applies if you order the material from a fixed vendor that has varying delivery times.If you use the SAP Retail System, the planned delivery time can be suggested from the vendor sub-range in the vendor master record. - */ - @sap.label : 'Planned Deliv. Time' - @sap.quickinfo : 'Planned Delivery Time in Days' - MaterialPlannedDeliveryDurn : Decimal(3, 0); - /** Minimum value specified for purchase orders issued to the relevant supplier. */ - @sap.unit : 'PurchaseOrderCurrency' - @sap.label : 'Minimum order value' - MinimumOrderAmount : Decimal(14, 3); - /** - * Key for defining payment terms composed of cash discount percentages and payment periods. - * - * It is used in sales orders, purchase orders, and invoices. Terms of payment provide information for:Cash managementDunning proceduresPayment transactionsData can be entered in the field for the terms of payment key in various ways as you enter a business transaction:In most business transactions, the system defaults the key specified in the master record of the customer/vendor in question.In some transactions (for example, credit memos), however, the system does not default the key from the master record. Despite this, you can use the key from the customer/vendor master record by entering "*" in the field.Regardless of whether or not a key is defaulted from the master record, you can manually enter a key during document entry at:item level in sales ordersheader level in purchase orders and invoicesMaster records have separate areas for Financial Accounting, Sales, and Purchasing. You can specify different terms of payment keys in each of these areas. When you then enter a business transaction, the application in question will use the key specified in its area of the master record. - */ - @sap.display.format : 'UpperCase' - @sap.label : 'Terms of Payment' - @sap.quickinfo : 'Terms of Payment Key' - PaymentTerms : String(4); - /** - * Determines which date is to be used for price determination (pricing) purposes. - * - * Enter the key for the desired date.If you choose the date of goods receipt, for example, a new price will be determined upon the arrival of the goods, causing the item to be revaluated at this time.NoteIf you have chosen the delivery date as the date for price determination and an item contains several delivery dates (i.e. has a delivery schedule), the first delivery date (the delivery date specified in the first schedule line) is taken. - */ - @sap.display.format : 'UpperCase' - @sap.label : 'Pricing Date Control' - @sap.quickinfo : 'Price Determination (Pricing) Date Control' - PricingDateControl : String(1); - /** - * Allows you to automatically generate purchase orders from purchase requisitions if the requisition has been assigned to a supplier (source of supply). - * - * If you want to use automatic conversion, note the following additional conditions:In the case of purchase requisitions for materials, you should also select the indicator Autom.purch.ord. in the Purchasing view in the material master record.In the case of purchase requisitions for services, you should also select the indicator Automatic creation of POs for service PReqs in Customizing for Services by choosing:IMG -> MM -> External Services Management -> Source Determination and Default Values- for Client or- for Purchasing Organization - */ - @sap.display.format : 'UpperCase' - @sap.label : 'Automatic PO' - @sap.quickinfo : 'Automatic Generation of Purchase Order Allowed' - PurOrdAutoGenerationIsAllowed : Boolean; - /** Key for the currency on which an order placed with a supplier is based. */ - @sap.label : 'Order currency' - @sap.quickinfo : 'Purchase order currency' - @sap.semantics : 'currency-code' - PurchaseOrderCurrency : String(5); - /** - * Key for a buyer or a group of buyers, who is/are responsible for certain purchasing activities. - * - * Internally, the purchasing group is responsible for the procurement of a material or a class of materials.Externally, it is the medium through which contacts with the vendor are maintained. - */ - @sap.display.format : 'UpperCase' - @sap.label : 'Purchasing Group' - PurchasingGroup : String(3); - /** Indicates whether or not the supplier master record is blocked for the purchasing organization for posting purposes. */ - @sap.display.format : 'UpperCase' - @sap.label : 'Pur. block POrg' - @sap.quickinfo : 'Purchasing block at purchasing organization level' - PurchasingIsBlockedForSupplier : Boolean; - /** - * General shipping strategy for the delivery of goods from the vendor to the customer. - * - * You can define shipping conditions in your system which correspond to the requirements of your company. You can specify a shipping condition in the customer master and in the vendor master.Shipping point determination (outbound delivery):The loading group, the plant and the shipping condition determine the shipping point that will be proposed by the system.Route determination (outbound delivery):Apart from the country and the geographical region of the shipping point, the ship-to party and the transportation group, the shipping condition determines the route that the system proposes in the order for the delivery of the goods. In the delivery, the route proposal also takes the weight group into account.A particular customer always requires immediate delivery. You enter the appropriate shipping condition into the customer master record. This means that when you process orders for this customer, the system automatically proposes the express mail room as a shipping point and the quickest way to the airport as a route.If a shipping condition has been assigned to a sales document type in Customizing, this condition will be proposed by the system in the corresponding sales document. If there is no assignment, the system copies the relevant data from the corresponding customer master record of the sold-to party. You cannot change this value during delivery processing. The shipping condition will not be copied from the delivery into the shipment. The shipping condition is one of several criteria for selecting deliveries when you create a shipment. You can enter a shipping condition manually in the shipment where it only serves as a characteristic for grouping shipments. - */ - @sap.display.format : 'UpperCase' - @sap.label : 'Shipping Conditions' - ShippingCondition : String(2); - /** - * Means of classifying suppliers according to their significance to your company. - * - * The indicator serves to assign the supplier to one of the categories A, B or C, in accordance with ABC analysis.'A' category suppliers, for instance, are those accounting for the greatest share of the company's total annual spend (in value terms). - */ - @sap.display.format : 'UpperCase' - @sap.label : 'ABC indicator' - SupplierABCClassificationCode : String(1); - /** This telephone number is maintained in the supplier master record and adopted in the purchasing document. */ - @sap.label : 'Telephone' - @sap.quickinfo : 'Supplier''s Telephone Number' - SupplierPhoneNumber : String(16); - @sap.label : 'Salesperson' - @sap.quickinfo : 'Responsible Salesperson at Supplier''s Office' - SupplierRespSalesPersonName : String(30); - /** The authorization group allows extended authorization protection for particular objects. The authorization groups are freely definable. The authorization groups usually occur in authorization objects together with an activity. */ - @sap.display.format : 'UpperCase' - @sap.label : 'Authorization' - @sap.quickinfo : 'Authorization Group' - AuthorizationGroup : String(4); - /** - * The account group is a classifying feature within vendor master records. The account group determines: - * - * the number interval for the account number of the vendor,whether the number is assigned by the user or by the system,which specifications are necessary and/or possible in the master record. - */ - @sap.display.format : 'UpperCase' - @sap.label : 'Account Group' - @sap.quickinfo : 'Supplier Account Group' - SupplierAccountGroup : String(4); - @cds.ambiguous : 'missing on condition?' - to_PartnerFunction : Association to many API_BUSINESS_PARTNER.A_SupplierPartnerFunc { }; -}; - -@cds.external : true -@cds.persistence.skip : true -@sap.content.version : '1' -@sap.label : 'Company Withholding Tax' -entity API_BUSINESS_PARTNER.A_SupplierWithHoldingTax { - /** Specifies an alphanumeric key that uniquely identifies the supplier in the SAP system. */ - @sap.display.format : 'UpperCase' - @sap.label : 'Supplier' - @sap.quickinfo : 'Account Number of Supplier' - key Supplier : String(10) not null; - /** The company code is an organizational unit within financial accounting. */ - @sap.display.format : 'UpperCase' - @sap.label : 'Company Code' - key CompanyCode : String(4) not null; - /** - * This indicator is used to classify the different types of withholding tax. - * - * Withholding tax types classify particular features of a withholding tax including:The time at which the withholding tax is postedThe basis on which the base amount is calculatedThe basis for accumulation (if applicable)Withholding tax types are to be distinguished from withholding tax codes, to which are allocated the withholding tax percentage rate example.Whether a withholding tax can be defined as an existing type by means of a new code, or if a new type needs to be defined will depend on the type of transaction (see below).Note that a business transaction can only be assigned one withholding tax code per withholding tax type. If the business transaction is subject to several withholding taxes simultaneously, these must be represented by different types.This is the case in Argentina for example, where up to four kinds of withholding tax per business transaction are possible. - */ - @sap.display.format : 'UpperCase' - @sap.label : 'Withholding Tax Type' - @sap.quickinfo : 'Indicator for Withholding Tax Type' - key WithholdingTaxType : String(2) not null; - /** Date from which withholding tax exemption applies. */ - @sap.display.format : 'Date' - @sap.label : 'Exemption Start Date' - @sap.quickinfo : 'Date on Which Exemption Begins' - ExemptionDateBegin : Date; - /** Date on which withholding tax exemption expires. */ - @sap.display.format : 'Date' - @sap.label : 'Exemption End Date' - @sap.quickinfo : 'Date on Which Exemption Ends' - ExemptionDateEnd : Date; - /** - * Indicator used to classify different types of exemption from liability to a particular withholding tax. - * - * These indicators can be defined per withholding tax type in the vendor master record. - */ - @sap.display.format : 'UpperCase' - @sap.label : 'Exemption Reason' - @sap.quickinfo : 'Reason for Exemption' - ExemptionReason : String(2); - @sap.display.format : 'UpperCase' - @sap.label : 'Subject to W/Tx' - @sap.quickinfo : 'Indicator: Subject to Withholding Tax?' - IsWithholdingTaxSubject : Boolean; - /** - * The type of recipient can be defined in the vendor master record. - * - * It is used to group vendors together according to particular characteristics such as occupations that may be subject to the same withholding tax type, but which are required to pay different percentage rates (as defined by the withholding tax code).Application in ThailandThis corresponds to the official Thai form number (Phaw.Ngor.Daw) and is used to determine the sequential numbering of a withholding tax certificate. The form number is defined in the vendor master record. - */ - @sap.display.format : 'UpperCase' - @sap.label : 'Recipient Type' - @sap.quickinfo : 'Type of Recipient' - RecipientType : String(2); - /** - * Numbered assigned by the relevant authorities for exemption from withholding tax. - * - * This number must be entered in the system as follows:In the vendor master record in the case of vendorsFor customers, in Customizing under the settings for withholding tax information for the company code per withholding tax type. - */ - @sap.display.format : 'UpperCase' - @sap.label : 'Exemption Number' - @sap.quickinfo : 'Exemption Certificate Number' - WithholdingTaxCertificate : String(25); - /** - * One or more "withholding tax codes" are assigned to each withholding tax type. One of the things these codes determine is the various percentage rates for the withholding tax type. - * - * Note that when processing a business transaction, no more than one withholding tax code can be assigned per withholding tax type. If the business transaction is subject to more than one withholding taxes, these must be represented in the system by defining various withholding tax types. - */ - @sap.display.format : 'UpperCase' - @sap.label : 'W/Tax Code' - @sap.quickinfo : 'Withholding Tax Code' - WithholdingTaxCode : String(2); - /** - * Rate of exemption from withholding tax. - * - * Those persons/activities subject to withholding tax can be exempted from withholding tax up to the percentage rate you enter here. This exemption rate refers to the withholding tax amount itself and not to the whole amount liable to withholding tax (withholding tax base amount).The gross amount of an invoice is 100.00 and the withholding tax base amount is defined as gross. The withholding tax rate is 10% meaning that the withholding tax amount is 10.00. Given an exemption rate of 30%, the withholding tax amount is reduced to 7.00. - */ - @sap.label : 'Exemption Rate' - WithholdingTaxExmptPercent : Decimal(5, 2); - /** - * This is a number issued by the tax authorities per withholding tax type. - * - * This number must be specified in Customizing either:(a) As part of the withholding tax information defined for the company code, or(b) As part of the withholding tax information defined in the customer or vendor master record. - */ - @sap.display.format : 'UpperCase' - @sap.label : 'W/tax number' - @sap.quickinfo : 'Withholding tax identification number' - WithholdingTaxNumber : String(16); - /** The authorization group allows extended authorization protection for particular objects. The authorization groups are freely definable. The authorization groups usually occur in authorization objects together with an activity. */ - @sap.display.format : 'UpperCase' - @sap.label : 'Authorization' - @sap.quickinfo : 'Authorization Group' - AuthorizationGroup : String(4); -}; - - diff --git a/srv/external/API_BUSINESS_PARTNER.edmx b/srv/external/API_BUSINESS_PARTNER.edmx deleted file mode 100644 index 5a6ddcc3..00000000 --- a/srv/external/API_BUSINESS_PARTNER.edmx +++ /dev/null @@ -1,3376 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Internal key for identifying a Business Address Services address. - For more information about the meaning and use of the address number and the Business Address Services concepts, see the function group SZA0 documentation. - - - - - Internal key for identifying a person in Business Address Services. - For more information about the meaning and use of the person number and Business Address Services concepts, see the function group SZA0 documentation. - - - - - - - Internet mail address, also called e-mail address. - Example: user.name@company.comThe Internet mail address is used to send mail via the Internet world-wide; the protocol used is SMTP (Simple Mail Transfer Protocol).The Internet mail address format is specified in various RFCs (Internet Request for Comment), including RFCs 821 and 822.This is not an IP address (192.56.30.6). - - - - - This field is generated by the system from the complete Internet mail address and is stored in table ADR6. - It contains the first 20 characters of the Internet mail address in normalized form, that is, without comment characters and converted into uppercase.The field cannot be maintained by the user or from an interface.The table ADR6 contains an index for this field.Using an Internet mail address, the corresponding key of table ADR6 and the owner of the address are determined (for example, business partner or user). - - - - - Additional information about the communication connection - You can maintain further information about the communication connection here. In the case of telephone numbers, for example, you can maintain the times at which the call recipient is available and those at which they are not, or you can specify whether the number is that of the secretary.The information is stored in table ADRT, regardless of language. - - - - - - - - - - - - Internal key for identifying a Business Address Services address. - For more information about the meaning and use of the address number and the Business Address Services concepts, see the function group SZA0 documentation. - - - - - Internal key for identifying a person in Business Address Services. - For more information about the meaning and use of the person number and Business Address Services concepts, see the function group SZA0 documentation. - - - - - - If several addresses are maintained for one communication type, the user in the SAP System can be reached under one of these addresses. One address can be set as theStandard Address. - The standard address is used for the following functions:When sending using the SMTP nodein SAPconnect, the home address of the communication type used is the one set as the sender address. The recipient can see this address in the sender information and can also reply directly to this address. The standard address is also transferred and can be used for incoming status notifications, for example.When sending using an RFC node in SAPconnect, the standard address of the communication type used is the one set as the sender address. The structure defined in the case of the RFC does not permit another address to be transferred, so the standard address is used for incoming status notifications too.The SAP users have the addresses of their exchange P.O. boxes in their standard communication type 'Internet Mail' as the home address and their Internet address in the SAP system as their standard address. Example:Home address: Bernard.Brown@Company.comStandard address: Bernard.Brown@System.Company.comSending using an SMTP nodeThe home address of the communication type 'Internet Mail' (Bernard.Brown@Company.com) is used as the sender address. If a reply is sent to this address the user receives directly in the exchange postbox.Sending using the RFC nodeThe standard address of the communication type 'Internet Mail' (Bernard.Brown@System.Company.com) is used as the sender address. If a reply is sent to this address, it arrives back to the SAP system.Example using a mail system groupThe users should get all messages in their Microsoft Exchange postboxes. In the SAP system the mail system group is activated for this using the setting "Send Messages to the Home Address".The address settings of the SAP users remain unchanged:Home address: Bernard.Brown@Company.comStandard address: Bernard.Brown@System.Company.comSending using an SMTP nodeThe home address of the communication type 'Internet Mail' (Bernard.Brown@Company.com) is used as the sender address. If a reply is sent to this address the user receives directly in the exchange postbox.Sending using the RFC nodeThe standard address of the communication type 'Internet Mail' (Bernard.Brown@System.Company.com) is used as the sender address. If a reply is sent to this address it arrives back in the SAP system. It is then forwarded using the mail system group to the home address and the user gets it in the exchange postbox. - - - - - The country for the telephone number or fax number is maintained here. - This specification is used to determine the correct country code. A normalized form of the telephone number or fax number is then derived and stored in a field for a program-driven search.In most cases, the telephone number or fax number refers directly to an address.If this is the case, when a new number is created, the country of the address is proposed.If this is not the case (for example, with address-independent communication data for a business partner), the country from the user parameter LND is proposed (if it is maintained). If the user parameter LND is not maintained, the country of the company address assigned in the user master data is proposed.If the country of the address changes, the country of the corresponding telephone number and fax address is not changed automatically.Example: A business partner moves abroad.If the telephone number is for a permanent connection, the telephone number also changes when the business partner moves and has to be maintained again in the system.If the telephone number is for a mobile telephone and the number is retained, the original country for this telephone number also has to be retained and must not be changed automatically to the new country of the address. - - - - - Fax number, consisting of dialling code and number, but without country dialling code. - If the fax number consists of a company number and an extension, the extension must be entered in the field extension.Fax number, as it is to be dialled from within the same country.Enter the following for the number "01234/567-0":Fax: 01234/567Extension: 0Enter the following for the number "01234/567-891":Fax: 01234/567Extension: 891For the number "012-345-678" (678 as extension) enter the following:Fax: 012-345Extension: 678In the following cases, enter the complete number (without country dialing code) in the field Fax:No part of the number can be considered as an extension.You are not sure which part of the number can be considered as an extension. - - - - - Fax extension number - If the fax number consists of a company number and an extension, the extension must be entered here.Enter the extensionThe following rules apply for the format of telephone and fax numbers:The length of the entries in the field Telephone and Extension (Fax and Extension) cannot be more than 24 characters in total.Leading spaces are not allowed in the field Telephone or Fax or in the field Extension.Valid characters are:Numbers (0123456789)Letters (ABCDEFGHIJKLMNOPQRSTUVWXYZ)Following other characters: /, (, ), - *, # and " " (space), but not as a leading space.If an + is entered as the first character, the system checks whether the specified number starts with a country code. If so, a warning message is displayed because the country code is automatically determined by the system and should not be stored in the Telephone number (Fax number) field.If an & is entered as the first character, the automatic check and formatting of the telephone number (fax number), as well as the determination of the country code, is suppressed.Enter the following for the number "01234/567-0":Fax: 01234/567Extension: 0Enter the following for the number "01234/567-891":Fax: 01234/567Extension: 891For the number "012-345-678" (678 as extension) enter the following:Fax: 012-345Extension: 678In the following cases, enter the complete number (without country dialing code) in the field Fax:No part of the number can be considered as an extension.You are not sure which part of the number can be considered as an extension. - - - - - The content of this field is automatically calculated by the system based on fax number and country code components. - This field is therefore not to be filled when Business Address Services function modules are called. - - - - - Additional information about the communication connection - You can maintain further information about the communication connection here. In the case of telephone numbers, for example, you can maintain the times at which the call recipient is available and those at which they are not, or you can specify whether the number is that of the secretary.The information is stored in table ADRT, regardless of language. - - - - - - - - - - - - - - Internal key for identifying a Business Address Services address. - For more information about the meaning and use of the address number and the Business Address Services concepts, see the function group SZA0 documentation. - - - - - Internal key for identifying a person in Business Address Services. - For more information about the meaning and use of the person number and Business Address Services concepts, see the function group SZA0 documentation. - - - - - - - - - Additional information about the communication connection - You can maintain further information about the communication connection here. In the case of telephone numbers, for example, you can maintain the times at which the call recipient is available and those at which they are not, or you can specify whether the number is that of the secretary.The information is stored in table ADRT, regardless of language. - - - - - - - - - - - - - - Internal key for identifying a Business Address Services address. - For more information about the meaning and use of the address number and the Business Address Services concepts, see the function group SZA0 documentation. - - - - - Internal key for identifying a person in Business Address Services. - For more information about the meaning and use of the person number and Business Address Services concepts, see the function group SZA0 documentation. - - - - - - The country for the telephone number or fax number is maintained here. - This specification is used to determine the correct country code. A normalized form of the telephone number or fax number is then derived and stored in a field for a program-driven search.In most cases, the telephone number or fax number refers directly to an address.If this is the case, when a new number is created, the country of the address is proposed.If this is not the case (for example, with address-independent communication data for a business partner), the country from the user parameter LND is proposed (if it is maintained). If the user parameter LND is not maintained, the country of the company address assigned in the user master data is proposed.If the country of the address changes, the country of the corresponding telephone number and fax address is not changed automatically.Example: A business partner moves abroad.If the telephone number is for a permanent connection, the telephone number also changes when the business partner moves and has to be maintained again in the system.If the telephone number is for a mobile telephone and the number is retained, the original country for this telephone number also has to be retained and must not be changed automatically to the new country of the address. - - - - - If several addresses are maintained for one communication type, the user in the SAP System can be reached under one of these addresses. One address can be set as theStandard Address. - The standard address is used for the following functions:When sending using the SMTP nodein SAPconnect, the home address of the communication type used is the one set as the sender address. The recipient can see this address in the sender information and can also reply directly to this address. The standard address is also transferred and can be used for incoming status notifications, for example.When sending using an RFC node in SAPconnect, the standard address of the communication type used is the one set as the sender address. The structure defined in the case of the RFC does not permit another address to be transferred, so the standard address is used for incoming status notifications too.The SAP users have the addresses of their exchange P.O. boxes in their standard communication type 'Internet Mail' as the home address and their Internet address in the SAP system as their standard address. Example:Home address: Bernard.Brown@Company.comStandard address: Bernard.Brown@System.Company.comSending using an SMTP nodeThe home address of the communication type 'Internet Mail' (Bernard.Brown@Company.com) is used as the sender address. If a reply is sent to this address the user receives directly in the exchange postbox.Sending using the RFC nodeThe standard address of the communication type 'Internet Mail' (Bernard.Brown@System.Company.com) is used as the sender address. If a reply is sent to this address, it arrives back to the SAP system.Example using a mail system groupThe users should get all messages in their Microsoft Exchange postboxes. In the SAP system the mail system group is activated for this using the setting "Send Messages to the Home Address".The address settings of the SAP users remain unchanged:Home address: Bernard.Brown@Company.comStandard address: Bernard.Brown@System.Company.comSending using an SMTP nodeThe home address of the communication type 'Internet Mail' (Bernard.Brown@Company.com) is used as the sender address. If a reply is sent to this address the user receives directly in the exchange postbox.Sending using the RFC nodeThe standard address of the communication type 'Internet Mail' (Bernard.Brown@System.Company.com) is used as the sender address. If a reply is sent to this address it arrives back in the SAP system. It is then forwarded using the mail system group to the home address and the user gets it in the exchange postbox. - - - - - Telephone number, consisting of dialling code and number, but without country dialling code. - If the telephone number consists of a company number and an extension, the extension must be entered in the field extension.Telephone number, as it is dialled from within the country.For the number "01234/567-0" enter the following:Telephone: 01234/567Estension: 0For the number "01234/567-891" enter the following:Telephone: 01234/567Extension: 891For the number "012-345-678" (678 as extension) enter the following:Telepone: 012-345Extension: 678In the following cases enter the complete number (without country dialling code) in the field Telephone:No part of the number can be regarded as an extension.You are not sure which part of the number can be regarded as an extension. - - - - - Telephone extension number - If the telephone number consists of a company number and an extension, the extension should be entered here.Enter the extension.The following rules apply for the format of telephone and fax numbers:The length of the entries in the field Telephone and Extension (Fax and Extension) cannot be more than 24 characters in total.Leading spaces are not allowed in the field Telephone or Fax or in the field Extension.Valid characters are:Numbers (0123456789)Letters (ABCDEFGHIJKLMNOPQRSTUVWXYZ)Following other characters: /, (, ), - *, # and " " (space), but not as a leading space.If an + is entered as the first character, the system checks whether the specified number starts with a country code. If so, a warning message is displayed because the country code is automatically determined by the system and should not be stored in the Telephone number (Fax number) field.If an & is entered as the first character, the automatic check and formatting of the telephone number (fax number), as well as the determination of the country code, is suppressed.For the number "01234/567-0" enter the following:Telephone: 01234/567Estension: 0For the number "01234/567-891" enter the following:Telephone: 01234/567Extension: 891For the number "012-345-678" (678 as extension) enter the following:Telepone: 012-345Extension: 678In the following cases enter the complete number (without country dialling code) in the field Telephone:No part of the number can be regarded as an extension.You are not sure which part of the number can be regarded as an extension. - - - - - The content of this field is automatically calculated by the system based on the telephone number and country code components. - This field is therefore not to be filled when Business Address Services function modules are called. - - - - - This field specifies whether the telephone number is a mobile telephone number. - ' ' : The telephone number is a fixed-line telephone'1' : The telephone number is the standard fixed-line telephone'2' : The telephone nubmer is a mobile telephone'3' : The telephone number is the standard mobile telephoneEither the standard fixed-line telephone number or the standard mobile telephone number is also the standard telephone number (FLGDEFAULT = 'X').In older data sets, this field may have also have the value ' ' for the standard fixed-line telephone. In this case, however, FLGDEFAULT is always 'X'.In Customizing, you can specify whether the SMS-compatible indicator is to be proposed for new mobile telephone numbers created in dialog by choosing General Settings -> Set countries -> Define Mobile Telephone Attributes for each country. - - - - - Additional information about the communication connection - You can maintain further information about the communication connection here. In the case of telephone numbers, for example, you can maintain the times at which the call recipient is available and those at which they are not, or you can specify whether the number is that of the secretary.The information is stored in table ADRT, regardless of language. - - - - - - - - - - - - - - The business partner relationship number is an internal number that identifies the business partner relationship set. - - - - - - Key identifying a business partner in the SAP system. The key is unique within a client. - - - - - - Key identifying a business partner in the SAP system. The key is unique within a client. - - - - - - - Internal key for identifying a Business Address Services address. - For more information about the meaning and use of the address number and the Business Address Services concepts, see the function group SZA0 documentation. - - - - - Internal key for identifying a Business Address Services address. - For more information about the meaning and use of the address number and the Business Address Services concepts, see the function group SZA0 documentation. - - - - - Additional address field which is printed above the Street line. - The Street address contains two lines above the street and two lines below the street.See Print the Street address. - - - - - Additional address field which is printed under the Street line. - The Street address has two lines above the street and two lines below the steet.See Print the Street address. - - - - - Time zone as part of an address. - The time zone is automatically determined by the system in address maintenance if time zone Customizing is maintained.It depends on the country and the region. (Region means state, province or county, depending on the country)The automatic determination is only made if there is no value in the time zone field. - - - - - Part of the address (c/o = care of) if the recipient is different from the occupant and the names are not similar (e.g. subtenants). - Put the country-specific code (e.g. c/o) in front of the name of the occupant. This is not automatically done in the print format, like the language-specific word "PO Box".John Smithc/o David BrownThis field is not always automatically printed, as it was subsequently added to the address structure.The print program or form may need to be adjusted.This exception applies to the following fields:Street2, Street3, Street4, Street5, c/o name, and to all address fields added after Release 4.5. - - - - - - City name as part of the address. - The city name is saved redundantly in another database field in upper- case letters, for search help.If the Postal regional structure ('city file') is active, the city name is checked against the Cities defined in the regional structure. - - - - - Postal code that is assigned directly to one company (= company postal code = major customer postal code). - This field is used for countries where major companies are assigned their own postal code by the national post office.This postal code has to be entered in the field "Company Postal Code". Postal codes for group major customers, however, have to be entered in the field "PO Box Postal Code", since individual customers with a shared postal code for group major customers are differentiated by means of their PO box. - - - - - The country key contains information which the system uses to check entries such as the length of the postal code or bank account number. - The two-character ISO code in accordance with ISO 3166, which is delivered by SAP as a default, is usually used.It could also be the vehicle license plate country-code or a typical country key, for example, in Germany the Federal statistics office key.The country keys are determined at system installation in the global settings.The definition of the country key in the SAP system does not have to match political or government entities.Since the country key does not have to correspond to the ISO code in all installations, programs that differ according to certain values of the country key cannot query the country key T005-LAND1, but have to program based on the ISO code T005 INTCA. - - - - - Specifies the county’s name - This field is used to store the county’s name. You can enter the name of the county in this field. - - - - - The delivery service is part of the PO box address. - Some countries offer different services in addition to regular postal delivery and PO boxes, for example the Private Bag or Response Bag. If an address is related to one of these delivery services, the information about this particular delivery service has to be entered in the corresponding fields.In the field "Number of Delivery Service," the number of the Private Bag, Response Bag, or other relevant service has to be entered. Entering a number is not mandatory for each delivery service.For each address, either the information about the PO box or the information about the delivery service can be entered, but not both types of information at the same time.Mr PickeringPrivate Bag 106999Timaru 7942Delivery services will only be taken into account for address formatting in countries in which they are commonly used in addition to regular postal delivery and PO boxes, for example, in Australia, New Zealand, and the USA. In all other countries, these fields will not be taken into account for address formatting. - - - - - The delivery service is part of the PO box address. - Some countries offer different services in addition to regular postal delivery and PO boxes, for example the Private Bag or Response Bag. If an address is related to one of these delivery services, the information about this particular delivery service has to be entered in the corresponding fields.In the field "Type of Delivery Service," the type of the delivery service has to be entered.For each address, either the information about the PO box or the information about the delivery service can be entered, but not both types of information at the same time.Mr PickeringPrivate Bag 106999Timaru 7942Delivery services will only be taken into account for address formatting in countries in which they are commonly used in addition to regular postal delivery and PO boxes, for example, in Australia, New Zealand, and the USA. In all other countries, these fields will not be taken into account for address formatting. - - - - - City or District supplement - In some countries, this entry is appended with a hyphen to the city name by the automatic address formatting, other countries, it is output on a line of its own or (e.g. in the USA) not printed.See the examples in the Address Layout Key documentation. - - - - - Key for form of address text. - You can also define a form of address text in Customizing.The form of address text can be maintained in different languages. - - - - - This field contains the full name or formatted name of a party. - For organizations or document addresses, typically the fields Name1 and Name2 are concatenated.For persons the field contains the formatted name according to country specific rules. It corresponds e.g. to the content of the fields BUT000-NAME1_TEXT or ADRP-NAME_TEXT. - - - - - City of residence which is different from the postal city - In some countries, the residential city is required if it differs from the postal city.In the USA, the official street indexes, against which data can be checked, are based on the residential city, not the postal city, which may be different.It is the same in France, where a postally correct address must contain the residential city in a separate line above the postal city, if it differs from the postal city.This field is not always automatically printed, as it was subsequently added to the address structure.The print program or form may need to be adjusted.This exception applies to the following fields:Street2, Street3, Street4, Street5, c/o name, and to all address fields added after Release 4.5. - - - - - House number as part of an address. - It is printed in the Street line.Other supplementary street information can be entered in the House number supplement or one of the Street2, Street3, Street4 or Street5 fields. See Print the Street address.A house number (e.g. 117) or a house number with supplement (e.g. 117a), or a house number range (e.g. 16-20), can be maintained in this field. - - - - - House number supplement as part of an address, e.g. - App. 17 orSuite 600.It is printed in the Street line.Further Street supplements can be put in one of the fields Street2, Street3, Street4 or Street5.See Print the Street address. - - - - - The language key indicates - - the language in which texts are displayed,- the language in which you enter texts,- the language in which the system prints texts. - - - - - PO Box number as part of an address. - Only enter the PO Box number in this field. The text "PO Box" is provided in the recipient language by the system when you print the address.When you print an address, the "Street address" and the "PO Box address" are distinguished. The print program determines which of them has priority if both are maintained in an address record.Besides the PO Box number, the PO Box address uses the following fields:PO Box postal code, if specified (otherwise the normal postal code)PO Box city, if specified (otherwise the normal city)PO Box region, if specified (otherwise the normal region)PO Box country, if specified (otherwise the normal country)If the address is a "PO Box" (without a number), do not fill the "PO Box" field. Select the "PO Box w/o Number" indicator instead.You can also enter a company postal code for organizational addresses, instead of a PO Box. A separate field is predefined for this entry.For general information and examples about address formatting, see the documentation on the Address Structure Key. - - - - - Different city for the PO Box as an address component. - The PO Box city can be entered here if it is different from the address city.If the address is only a PO Box address, enter the city in the normal city field.If the address contains two different city names for the address and the PO Box address, use this field. - - - - - Different PO Box country in address. - The PO Box country can be entered here, if it is different from the street address country.If the address only has a PO Box address, the country is in the normal country field.Use this field if the address has two different country values for the street address and the PO Box address.This field is not always automatically printed, as it was subsequently added to the address structure.The print program or form may need to be adjusted.This exception applies to the following fields:Street2, Street3, Street4, Street5, c/o name, and to all address fields added after Release 4.5. - - - - - Different Region for PO Box in an address. - Enter the PO Box Region here, if it differs from the street address region.If the address only has a PO Box address, the Region in in the normal Region field.Use this field if the address has two different Region values for the street address and the PO Box address.This field is not always automatically printed, as it was subsequently added to the address structure.The print program or form may need to be adjusted.This exception applies to the following fields:Street2, Street3, Street4, Street5, c/o name, and to all address fields added after Release 4.5. - - - - - PO Box address without PO Box number flag. - Only the word 'PO Box' is output in PO Box addresses without PO Box number.Set this flag for a PO Box address without PO Box number.This field is not always automatically printed, as it was subsequently added to the address structure.The print program or form may need to be adjusted.This exception applies to the following fields:Street2, Street3, Street4, Street5, c/o name, and to all address fields added after Release 4.5. - - - - - The PO box lobby is part of the PO box address. - In some countries, entering a PO box, postal code and city is not sufficient to uniquely identify a PO box, because the same PO box number is assigned multiple times in some cities.Therefore, additional information might be required to determine the post office of the PO box in question. This information can be entered in the field "PO Box Lobby."Mr NellingPO Box 4099HighfieldTimaru 7942The PO box lobby will only be taken into account for address formatting in countries in which it is commonly used in addition to regular postal delivery and PO boxes, for example, in Canada or New Zealand. In all other countries, this field will not be taken into account for address formatting. - - - - - Postal code that is required for a unique assignment of the PO box. - This field is used for countries where a different postal code applies to mail that is sent to the PO box rather than to the street address of a particular business partner.Postal codes for group major customers also have to be entered in the field for the PO box postal code since individual customers with a shared postal code for group major customers are differentiated by means of the PO box. Postal codes for major customers (= company postal codes), however, are assigned to one customer only and have to be entered in the field 'Company Postal Code'. - - - - - Internal key for identifying a person in Business Address Services. - For more information about the meaning and use of the person number and Business Address Services concepts, see the function group SZA0 documentation. - - - - - Postal code as part of the address - If different postal codes are maintained for the PO Box and Street address of an address, this field contains the Street address postal code. - - - - - Communication method with which you can exchange documents and messages with a business partner. - In Business Address Services, you can specify a standard communication method that can be used by programs to determine the means of communication for sending messages.One business partner wants all messages by fax, another by e-mail.The application context can restrict the possible methods of communication. For example, invitations should perhaps only be sent by post because of enclosures, whereas minutes can be sent by post, fax or e-mail.Communication strategies can be defined for this purpose and applied in application contexts. - - - - - In some countries, the region forms part of the address. The meaning depends on the country. - The automatic address formatting function prints the region in addresses in the USA, Canada, Italy, Brazil or Australia, and the county in Great Britain.For more information, see the examples in the documentation on the Address Layout Key.Meaning of the regional code in ...Australia -> ProvinceBrazil -> StateCanada -> ProvinceGermany -> StateGreat Britain -> CountyItaly -> ProvinceJapan -> PrefectureSwitzerland -> CantonUSA -> State - - - - - Street name as part of the address. - The street name is saved, redundantly in upper case in another database field, for search help purposes.There are other fields for address parts which can be printed above or below the street. See Print the Street address.The house number and other supplements are usually maintained in their own fields. See Formatting the Street line. - - - - - Additional address field which is printed above the Street line. - The Street address contains two lines above the street and two lines below the street.See Print the Street address.This field is not always automatically printed, as it was subsequently added to the address structure.The print program or form may need to be adjusted.This exception applies to the following fields:Street2, Street3, Street4, Street5, c/o name, and to all address fields added after Release 4.5. - - - - - Additional address field which is printed below the Street line. - The Street address contains two lines above the street and two lines below the street.See Print the Street address. - - - - - Specifies the tax jurisdiction. - - - - - - Sales and distribution: - Regional zone of Goods recipient.Purchasing:Regional zone of supplier.You can define regional zones to suit the requirements of your own business and country.Sales and distributionthe system automatically proposes a suitable route by using the transportation zone of the goods recipient in combination with other information about the delivery, such as theCountries of origin and destinationShipping conditionsTransportation groupIn the USA, for example, you can define regional zones to correspond to the US postal zip codes. - - - - - - - - - - - - - - - - - - The business partner relationship number is an internal number that identifies the business partner relationship set. - - - - - - Key identifying a business partner in the SAP system. The key is unique within a client. - - - - - - Key identifying a business partner in the SAP system. The key is unique within a client. - - - - - - - Identifies the function that a person has within a company. - This is a contact person attribute that you can define in Customizing.Personnel managerSecretary - - - - - Name of the department of a business partner for your internal usage. - The name given by the business partner to this particular department may differ from the name that you use. You can enter the name given by the business partner in the field company department.This is a contact person attribute that you can define in Customizing.For your purposes, the department name is "Sales". The business partner names the same department "Sales South". - - - - - Telephone number, consisting of dialling code and number, but without country dialling code. - If the telephone number consists of a company number and an extension, the extension must be entered in the field extension.Telephone number, as it is dialled from within the country.For the number "01234/567-0" enter the following:Telephone: 01234/567Estension: 0For the number "01234/567-891" enter the following:Telephone: 01234/567Extension: 891For the number "012-345-678" (678 as extension) enter the following:Telepone: 012-345Extension: 678In the following cases enter the complete number (without country dialling code) in the field Telephone:No part of the number can be regarded as an extension.You are not sure which part of the number can be regarded as an extension. - - - - - Telephone extension number - If the telephone number consists of a company number and an extension, the extension should be entered here.Enter the extension.The following rules apply for the format of telephone and fax numbers:The length of the entries in the field Telephone and Extension (Fax and Extension) cannot be more than 24 characters in total.Leading spaces are not allowed in the field Telephone or Fax or in the field Extension.Valid characters are:Numbers (0123456789)Letters (ABCDEFGHIJKLMNOPQRSTUVWXYZ)Following other characters: /, (, ), - *, # and " " (space), but not as a leading space.If an + is entered as the first character, the system checks whether the specified number starts with a country code. If so, a warning message is displayed because the country code is automatically determined by the system and should not be stored in the Telephone number (Fax number) field.If an & is entered as the first character, the automatic check and formatting of the telephone number (fax number), as well as the determination of the country code, is suppressed.For the number "01234/567-0" enter the following:Telephone: 01234/567Estension: 0For the number "01234/567-891" enter the following:Telephone: 01234/567Extension: 891For the number "012-345-678" (678 as extension) enter the following:Telepone: 012-345Extension: 678In the following cases enter the complete number (without country dialling code) in the field Telephone:No part of the number can be regarded as an extension.You are not sure which part of the number can be regarded as an extension. - - - - - Fax number, consisting of dialling code and number, but without country dialling code. - If the fax number consists of a company number and an extension, the extension must be entered in the field extension.Fax number, as it is to be dialled from within the same country.Enter the following for the number "01234/567-0":Fax: 01234/567Extension: 0Enter the following for the number "01234/567-891":Fax: 01234/567Extension: 891For the number "012-345-678" (678 as extension) enter the following:Fax: 012-345Extension: 678In the following cases, enter the complete number (without country dialing code) in the field Fax:No part of the number can be considered as an extension.You are not sure which part of the number can be considered as an extension. - - - - - Fax extension number - If the fax number consists of a company number and an extension, the extension must be entered here.Enter the extensionThe following rules apply for the format of telephone and fax numbers:The length of the entries in the field Telephone and Extension (Fax and Extension) cannot be more than 24 characters in total.Leading spaces are not allowed in the field Telephone or Fax or in the field Extension.Valid characters are:Numbers (0123456789)Letters (ABCDEFGHIJKLMNOPQRSTUVWXYZ)Following other characters: /, (, ), - *, # and " " (space), but not as a leading space.If an + is entered as the first character, the system checks whether the specified number starts with a country code. If so, a warning message is displayed because the country code is automatically determined by the system and should not be stored in the Telephone number (Fax number) field.If an & is entered as the first character, the automatic check and formatting of the telephone number (fax number), as well as the determination of the country code, is suppressed.Enter the following for the number "01234/567-0":Fax: 01234/567Extension: 0Enter the following for the number "01234/567-891":Fax: 01234/567Extension: 891For the number "012-345-678" (678 as extension) enter the following:Fax: 012-345Extension: 678In the following cases, enter the complete number (without country dialing code) in the field Fax:No part of the number can be considered as an extension.You are not sure which part of the number can be considered as an extension. - - - - - Internet mail address, also called e-mail address. - Example: user.name@company.comThe Internet mail address is used to send mail via the Internet world-wide; the protocol used is SMTP (Simple Mail Transfer Protocol).The Internet mail address format is specified in various RFCs (Internet Request for Comment), including RFCs 821 and 822.This is not an IP address (192.56.30.6). - - - - - A relationship may exist between two business partners. The business partner relationship category characterizes the features of the relationship. - A distinction is made between a one-way and an undirected business partner relationship category. In a one-way relationship category, the relationship extends from one partner to another, but not vice versa.Marriage (undirected)Employee (one-way)Contact person (one-way) - - - - - - - - - - - - - Key identifying a business partner in the SAP system. The key is unique within a client. - - - - - - - Business partner attribute, which you can use to distinguish between various addresses by defining the address usage for communication with business partners. - Maintain the usage types for addresses (address types) in Customizing.You can create a short description and a name for the address type.When maintaining business partners you can use the function address usage to assign business partner addresses to address types.If necessary, you can set the indicator for multiple use in Customizing.Correspondence addressDelivery address - - - - - Internal key for identifying a Business Address Services address. - For more information about the meaning and use of the address number and the Business Address Services concepts, see the function group SZA0 documentation. - - - - - - Establishes which is the standard address for an address usage. - Several addresses per period can be assigned to an address usage.If this is the case, then this indicator controls which of the assigned addresses should be the standard address of the relevant usage. This is determined automatically when the address usage is accessed. - - - - - You can use authorization groups to stipulate which business partners a user is allowed to process. - Use the following authorization object:'Business partners: authorization groups' (B_BUPA_GRP).The system only checks this authorization if you made an entry in the "Authorization group" field for the business partner. Otherwise, any user may process the business partner. - - - - - - - - - - - - Key identifying a business partner in the SAP system. The key is unique within a client. - - - - - - A document (such as an ID card or driver's license) or an entry in a system of records (such as a commercial register) whose key can be stored as an attribute for a business partner. - The identification type is for classifying identification numbers.You can define the identification types and their descriptions in Customizing.You can also specify for which business partner category an ID type should be valid.If necessary, assign the identification type to an Identification Category.You can only assign one identification type to an identification category. - - - - - Number that serves to identify a business partner, such as driver's license, or ID card number. - - - - - - Institution that adminsters or assigns an ID number. - - - - - - Date on which the ID number was registered or assigned by the appropriate authority. - - - - - - Country in which an ID number was assigned, or in which the number is valid. - - - - - - In some countries, the region forms part of the address. The meaning depends on the country. - The automatic address formatting function prints the region in addresses in the USA, Canada, Italy, Brazil or Australia, and the county in Great Britain.For more information, see the examples in the documentation on the Address Layout Key.Meaning of the regional code in ...Australia -> ProvinceBrazil -> StateCanada -> ProvinceGermany -> StateGreat Britain -> CountyItaly -> ProvinceJapan -> PrefectureSwitzerland -> CantonUSA -> State - - - - - This date marks the start of validity of an ID number. - - - - - - This date marks the end of validity of an ID number. - - - - - - You can use authorization groups to stipulate which business partners a user is allowed to process. - Use the following authorization object:'Business partners: authorization groups' (B_BUPA_GRP).The system only checks this authorization if you made an entry in the "Authorization group" field for the business partner. Otherwise, any user may process the business partner. - - - - - - - - - - - - Describes an industry. - An industry is a classification of companies according to their main business activity. For example, you can use Commerce, Banking, Services, Industry, Healthcare, Public Sector, Media, and so on, as industries.You can define industries along with their descriptions in Customizing.Assign the industry key to an industry key system. - - - - - Serves to combine and categorize several industries into a group. - You can create different industry systems, each with its own catalog of industries, whereby an industry can be assigned to several industry systems.You have to select one industry system as the standard industry system. This is then automatically displayed in the initial screen for the maintenance of industry data.You can define an industry system along with its description in Customizing. You can assign several industry systems to a business partner.If you choose the button All Industry Systems, you can access all the industry systems defined in the Customizing using the input help. - - - - - Key identifying a business partner in the SAP system. The key is unique within a client. - - - - - - Identifies the industry in an industry system that can be defined as the standard industry. - It is recommended that you define an industry within an industry system as the standard industry, because only the standard industries can be determined at the interfaces to BW or the APIs, for example.This means that even if only one industry exists within an industry system, it should be indicated as the standard industry as this this information cannot be determined otherwise. - - - - - - - - - - - Key identifying a business partner in the SAP system. The key is unique within a client. - - - - - - Gives an alphanumeric key, which clearly identifies the customer or vendor in the SAP system. - - - - - - Specifies an alphanumeric key that uniquely identifies the supplier in the SAP system. - - - - - - Key for academic title. - You can define a key for an academic title in Customizing. - - - - - You can use authorization groups to stipulate which business partners a user is allowed to process. - Use the following authorization object:'Business partners: authorization groups' (B_BUPA_GRP).The system only checks this authorization if you made an entry in the "Authorization group" field for the business partner. Otherwise, any user may process the business partner. - - - - - Category under which a business partner is classified. - You can distinguish between the following business partner categories:OrganizationNatural personGroup of natural persons or organizationsThe processing screens for the business partner categories are set up differently.So, for example, the screen for an organization contains the field Legal form, but this is not needed in the screen for a natural person. - - - - - - Classification assigned when creating a business partner. - Assign each business partner to a grouping when you create the business partner. The grouping determines the number range. You cannot change the assignment afterwards.You can define the groupings, their descriptions, the associated number range and other attributes in Customizing.You can define standard groupings for the internal and the external number assignment.For each grouping create a number range.When you create a business partner, the entry in the grouping field determines whether and how an entry is made in the business partner number field. - - - - - - - Correspondence language (written) for business partners in the 'Person' category. Maintain the correspondence language for business partners in the 'Organization' and 'Group' category with the address (communication). - When transferring data (direct input), make sure that for a'Person', the field 'LANGU_CORR' and for an'Organization' or "Group" the field 'LANGU'has an entry. - - - - - - - - - Key for form of address text. - You can also define a form of address text in Customizing.The form of address text can be maintained in different languages. - - - - - An industry sector is the term used to classify a company according to its main business activity. - You can assign an industry sector to business partners in the category 'Organization'RetailBanksServicesIndustryHealth servicePublic sectorMedia - - - - - Here you enter the first 7 digits of the international location number. - The International Location Number (ILN) is assigned (in Germany by the Centrale for Coorganisation GmbH)) when a company is founded. It consists of 13 digits, the last digit being the check digit. There are two categories of location numbers:Participants who only need an ILN to cleary and unmistakably identify themselves for communication with the business partner are given a category 1 ILN. This cannot be used to identify articles by means of EAN.Participants who wish to assign the location numbers for their own enterprise areas are given a category 2 ILN. For a category 2 ILN, digits 1 to 7 are described as basis number. This is used as basis for the creation of article numbers (EAN). - - - - - Here, you enter digits 8-12 of the 13-digit international location number. - The international location number (ILN) is assigned when establishing a company (by the "Zentrale für Coorganisation GmbH" in Germany). It consists of 13 digits, the last of which is the check digit. There are two types of international location numbers:Subscribers who only need one ILN to identify themselves in communication with the business partner are given an ILN of type 1. These cannot be used for identifying articles by means of EAN.Subscribers who need to assign location numbers for their own company areas are given an ILN of type 2. Positions 1 through 7 of the ILN type 2 are known as the basis number. This basis number forms the basis for article numbers (EAN). - - - - - - - Indicator through which a distinction between natural and legal persons can be made during tax reporting. - Is used in Italy and Mexico ,among other countries.Brasil: If the indicator is not set, 'CGC' is relevant in tax number 1. If the indicator is set, 'CPF' is relevant in tax number 2.Colombia: In the case of some natural persons, the NIT number does not have a check digit. In this case you should set this indicator and the check is deactivated. - - - - - - - Language for verbal communication with a business partner. - This language may differ from the language(s) defined for written correspondence. - - - - - - - - - Denotes certain legal norms that are of significance for the organization of a company. - For business partners in the category "Organization", you can state the legal form of the company. This is for information purposes only.Stock corporation (AG in Germany)Limited liability company (GmbH in Germany) - - - - - First name field for business partners in the Organization category. - - - - - - Second name field for business partners in the Organization category. - - - - - - Third name field for business partners in the Organization category. - - - - - - Fourth name field for business partners in the Organization category. - - - - - - Indicates the official registration of a company in the Commercial Register. - If a company is not officially registered in the Commercial Register, it has to use some type of text addition, such as foundation pending, when referring to the legal form. - - - - - Term for the end of bankruptcy proceedings. - This date also indicates that the company no longer exists. - - - - - Denotes the term that you define for a business partner, and via which you can restrict the search for a business partner in the business partner search or in the locator. - - - - - - Denotes the term that you define for a business partner, and via which you can restrict the search for a business partner in the business partner search or in the locator. - - - - - - - - - If the business partner is blocked centrally, certain activities cannot be executed. - - - - - - You can use the business partner type to group business partners according to your own criteria in Customizing (IMG). - In Customizing you can show or hide fields for data entry, depending on the requirements of the relevant business partner type.Select a business partner type. You can obtain help by pressing the F4 key. - - - - - - First name field for business partners in the Group category. - - - - - - Second name field for business partners in the Group category. - - - - - - Internal key for identifying the address for communication data that spans all addresses in Business Partner. - For more information on the significance and usage of the address number, see the documentation for Business Address Services (BAS). - - - - - The check digit is derived from a special check digit procedure from digits of the previous international location numbers. In this way, you can check whether the ILN entered is actually valid. - - - - - - - The name format rule country and the name format rule key together uniquely identify a formatting rule. - A country can have several formats which correspond to different rules. Formatting rules describe the format of a person name. - - - - - See Name format. - - - - - - States the complete name of a person. - The complete name is generally generated and saved by the Business Address Services (BAS) according to country-specific rules from the individual name components (without the form of address).If, during the formatting of an address, you want to use an alternative name, you can manually format the alternative name here. - - - - - Internal key for identifying a person in Business Address Services. - For more information about the meaning and use of the person number and Business Address Services concepts, see the function group SZA0 documentation. - - - - - Establishes if the business partner is meant to be archived. - If the indicator is set, the relevant business partner can be archived from the view of the business partner administration.If the check of the data to be archived shows, for example, that there are still active business transactions the archiving of the business partner data is prevented even if the indicator is set.If the indicator is not set, the business partner will not be taken into consideration during archiving. - - - - - Business partner number from an external system or a legacy system. - If the current business partner is known under a different number in an external system, you can store this number here for information purposes.Direct input gives you the option of maintaining a business partner by specifying the external business partner number. If you maintain business partner data in your legacy system, you can transmit changes made to business partners to the SAP system without having to know the SAP business partner number in the legacy system. - - - - - Company ID standard for the whole group. - - - - - - - - - - - - - - - - - - - - - Key identifying a business partner in the SAP system. The key is unique within a client. - - - - - - Internal key for identifying a Business Address Services address. - For more information about the meaning and use of the address number and the Business Address Services concepts, see the function group SZA0 documentation. - - - - - - - You can use authorization groups to stipulate which business partners a user is allowed to process. - Use the following authorization object:'Business partners: authorization groups' (B_BUPA_GRP).The system only checks this authorization if you made an entry in the "Authorization group" field for the business partner. Otherwise, any user may process the business partner. - - - - - - Additional address field which is printed above the Street line. - The Street address contains two lines above the street and two lines below the street.See Print the Street address. - - - - - Additional address field which is printed under the Street line. - The Street address has two lines above the street and two lines below the steet.See Print the Street address. - - - - - Time zone as part of an address. - The time zone is automatically determined by the system in address maintenance if time zone Customizing is maintained.It depends on the country and the region. (Region means state, province or county, depending on the country)The automatic determination is only made if there is no value in the time zone field. - - - - - Part of the address (c/o = care of) if the recipient is different from the occupant and the names are not similar (e.g. subtenants). - Put the country-specific code (e.g. c/o) in front of the name of the occupant. This is not automatically done in the print format, like the language-specific word "PO Box".John Smithc/o David BrownThis field is not always automatically printed, as it was subsequently added to the address structure.The print program or form may need to be adjusted.This exception applies to the following fields:Street2, Street3, Street4, Street5, c/o name, and to all address fields added after Release 4.5. - - - - - - City name as part of the address. - The city name is saved redundantly in another database field in upper- case letters, for search help.If the Postal regional structure ('city file') is active, the city name is checked against the Cities defined in the regional structure. - - - - - Postal code that is assigned directly to one company (= company postal code = major customer postal code). - This field is used for countries where major companies are assigned their own postal code by the national post office.This postal code has to be entered in the field "Company Postal Code". Postal codes for group major customers, however, have to be entered in the field "PO Box Postal Code", since individual customers with a shared postal code for group major customers are differentiated by means of their PO box. - - - - - The country key contains information which the system uses to check entries such as the length of the postal code or bank account number. - The two-character ISO code in accordance with ISO 3166, which is delivered by SAP as a default, is usually used.It could also be the vehicle license plate country-code or a typical country key, for example, in Germany the Federal statistics office key.The country keys are determined at system installation in the global settings.The definition of the country key in the SAP system does not have to match political or government entities.Since the country key does not have to correspond to the ISO code in all installations, programs that differ according to certain values of the country key cannot query the country key T005-LAND1, but have to program based on the ISO code T005 INTCA. - - - - - Specifies the county’s name - This field is used to store the county’s name. You can enter the name of the county in this field. - - - - - The delivery service is part of the PO box address. - Some countries offer different services in addition to regular postal delivery and PO boxes, for example the Private Bag or Response Bag. If an address is related to one of these delivery services, the information about this particular delivery service has to be entered in the corresponding fields.In the field "Number of Delivery Service," the number of the Private Bag, Response Bag, or other relevant service has to be entered. Entering a number is not mandatory for each delivery service.For each address, either the information about the PO box or the information about the delivery service can be entered, but not both types of information at the same time.Mr PickeringPrivate Bag 106999Timaru 7942Delivery services will only be taken into account for address formatting in countries in which they are commonly used in addition to regular postal delivery and PO boxes, for example, in Australia, New Zealand, and the USA. In all other countries, these fields will not be taken into account for address formatting. - - - - - The delivery service is part of the PO box address. - Some countries offer different services in addition to regular postal delivery and PO boxes, for example the Private Bag or Response Bag. If an address is related to one of these delivery services, the information about this particular delivery service has to be entered in the corresponding fields.In the field "Type of Delivery Service," the type of the delivery service has to be entered.For each address, either the information about the PO box or the information about the delivery service can be entered, but not both types of information at the same time.Mr PickeringPrivate Bag 106999Timaru 7942Delivery services will only be taken into account for address formatting in countries in which they are commonly used in addition to regular postal delivery and PO boxes, for example, in Australia, New Zealand, and the USA. In all other countries, these fields will not be taken into account for address formatting. - - - - - City or District supplement - In some countries, this entry is appended with a hyphen to the city name by the automatic address formatting, other countries, it is output on a line of its own or (e.g. in the USA) not printed.See the examples in the Address Layout Key documentation. - - - - - Key for form of address text. - You can also define a form of address text in Customizing.The form of address text can be maintained in different languages. - - - - - This field contains the full name or formatted name of a party. - For organizations or document addresses, typically the fields Name1 and Name2 are concatenated.For persons the field contains the formatted name according to country specific rules. It corresponds e.g. to the content of the fields BUT000-NAME1_TEXT or ADRP-NAME_TEXT. - - - - - City of residence which is different from the postal city - In some countries, the residential city is required if it differs from the postal city.In the USA, the official street indexes, against which data can be checked, are based on the residential city, not the postal city, which may be different.It is the same in France, where a postally correct address must contain the residential city in a separate line above the postal city, if it differs from the postal city.This field is not always automatically printed, as it was subsequently added to the address structure.The print program or form may need to be adjusted.This exception applies to the following fields:Street2, Street3, Street4, Street5, c/o name, and to all address fields added after Release 4.5. - - - - - House number as part of an address. - It is printed in the Street line.Other supplementary street information can be entered in the House number supplement or one of the Street2, Street3, Street4 or Street5 fields. See Print the Street address.A house number (e.g. 117) or a house number with supplement (e.g. 117a), or a house number range (e.g. 16-20), can be maintained in this field. - - - - - House number supplement as part of an address, e.g. - App. 17 orSuite 600.It is printed in the Street line.Further Street supplements can be put in one of the fields Street2, Street3, Street4 or Street5.See Print the Street address. - - - - - The language key indicates - - the language in which texts are displayed,- the language in which you enter texts,- the language in which the system prints texts. - - - - - PO Box number as part of an address. - Only enter the PO Box number in this field. The text "PO Box" is provided in the recipient language by the system when you print the address.When you print an address, the "Street address" and the "PO Box address" are distinguished. The print program determines which of them has priority if both are maintained in an address record.Besides the PO Box number, the PO Box address uses the following fields:PO Box postal code, if specified (otherwise the normal postal code)PO Box city, if specified (otherwise the normal city)PO Box region, if specified (otherwise the normal region)PO Box country, if specified (otherwise the normal country)If the address is a "PO Box" (without a number), do not fill the "PO Box" field. Select the "PO Box w/o Number" indicator instead.You can also enter a company postal code for organizational addresses, instead of a PO Box. A separate field is predefined for this entry.For general information and examples about address formatting, see the documentation on the Address Structure Key. - - - - - Different city for the PO Box as an address component. - The PO Box city can be entered here if it is different from the address city.If the address is only a PO Box address, enter the city in the normal city field.If the address contains two different city names for the address and the PO Box address, use this field. - - - - - Different PO Box country in address. - The PO Box country can be entered here, if it is different from the street address country.If the address only has a PO Box address, the country is in the normal country field.Use this field if the address has two different country values for the street address and the PO Box address.This field is not always automatically printed, as it was subsequently added to the address structure.The print program or form may need to be adjusted.This exception applies to the following fields:Street2, Street3, Street4, Street5, c/o name, and to all address fields added after Release 4.5. - - - - - Different Region for PO Box in an address. - Enter the PO Box Region here, if it differs from the street address region.If the address only has a PO Box address, the Region in in the normal Region field.Use this field if the address has two different Region values for the street address and the PO Box address.This field is not always automatically printed, as it was subsequently added to the address structure.The print program or form may need to be adjusted.This exception applies to the following fields:Street2, Street3, Street4, Street5, c/o name, and to all address fields added after Release 4.5. - - - - - PO Box address without PO Box number flag. - Only the word 'PO Box' is output in PO Box addresses without PO Box number.Set this flag for a PO Box address without PO Box number.This field is not always automatically printed, as it was subsequently added to the address structure.The print program or form may need to be adjusted.This exception applies to the following fields:Street2, Street3, Street4, Street5, c/o name, and to all address fields added after Release 4.5. - - - - - The PO box lobby is part of the PO box address. - In some countries, entering a PO box, postal code and city is not sufficient to uniquely identify a PO box, because the same PO box number is assigned multiple times in some cities.Therefore, additional information might be required to determine the post office of the PO box in question. This information can be entered in the field "PO Box Lobby."Mr NellingPO Box 4099HighfieldTimaru 7942The PO box lobby will only be taken into account for address formatting in countries in which it is commonly used in addition to regular postal delivery and PO boxes, for example, in Canada or New Zealand. In all other countries, this field will not be taken into account for address formatting. - - - - - Postal code that is required for a unique assignment of the PO box. - This field is used for countries where a different postal code applies to mail that is sent to the PO box rather than to the street address of a particular business partner.Postal codes for group major customers also have to be entered in the field for the PO box postal code since individual customers with a shared postal code for group major customers are differentiated by means of the PO box. Postal codes for major customers (= company postal codes), however, are assigned to one customer only and have to be entered in the field 'Company Postal Code'. - - - - - Internal key for identifying a person in Business Address Services. - For more information about the meaning and use of the person number and Business Address Services concepts, see the function group SZA0 documentation. - - - - - Postal code as part of the address - If different postal codes are maintained for the PO Box and Street address of an address, this field contains the Street address postal code. - - - - - Communication method with which you can exchange documents and messages with a business partner. - In Business Address Services, you can specify a standard communication method that can be used by programs to determine the means of communication for sending messages.One business partner wants all messages by fax, another by e-mail.The application context can restrict the possible methods of communication. For example, invitations should perhaps only be sent by post because of enclosures, whereas minutes can be sent by post, fax or e-mail.Communication strategies can be defined for this purpose and applied in application contexts. - - - - - In some countries, the region forms part of the address. The meaning depends on the country. - The automatic address formatting function prints the region in addresses in the USA, Canada, Italy, Brazil or Australia, and the county in Great Britain.For more information, see the examples in the documentation on the Address Layout Key.Meaning of the regional code in ...Australia -> ProvinceBrazil -> StateCanada -> ProvinceGermany -> StateGreat Britain -> CountyItaly -> ProvinceJapan -> PrefectureSwitzerland -> CantonUSA -> State - - - - - Street name as part of the address. - The street name is saved, redundantly in upper case in another database field, for search help purposes.There are other fields for address parts which can be printed above or below the street. See Print the Street address.The house number and other supplements are usually maintained in their own fields. See Formatting the Street line. - - - - - Additional address field which is printed above the Street line. - The Street address contains two lines above the street and two lines below the street.See Print the Street address.This field is not always automatically printed, as it was subsequently added to the address structure.The print program or form may need to be adjusted.This exception applies to the following fields:Street2, Street3, Street4, Street5, c/o name, and to all address fields added after Release 4.5. - - - - - Additional address field which is printed below the Street line. - The Street address contains two lines above the street and two lines below the street.See Print the Street address. - - - - - Specifies the tax jurisdiction. - - - - - - Sales and distribution: - Regional zone of Goods recipient.Purchasing:Regional zone of supplier.You can define regional zones to suit the requirements of your own business and country.Sales and distributionthe system automatically proposes a suitable route by using the transportation zone of the goods recipient in combination with other information about the delivery, such as theCountries of origin and destinationShipping conditionsTransportation groupIn the USA, for example, you can define regional zones to correspond to the US postal zip codes. - - - - - Address number from an external system or a legacy system - If the current address has a different number in an external system, you can save this number here for information purposes.In direct input you are able to maintain an address for a business partner by stating the external address number. If your business partner data is maintained in a legacy system, you can thus transmit changes to a BP address to the SAP system without having to know the SAP address number in the legacy system. - - - - - - - - - - - - - - - - - Key identifying a business partner in the SAP system. The key is unique within a client. - - - - - - Key identifying a business partner's bank details. - Enter a bank details ID for each separate set of bank details for a business partner.Business Partner: H. MillerBD-ID Fin.institution Acct no. 0001 Chemical Bank, NYC 56234560002 Chemical Bank, NYC 56231220003 First Bank of Pittsburgh ...Business partner: T.Wolsey and Co.BD-ID Fin.institution Acct no.GIR0 Citibank, Charleston ...GIR1 Chemical Bank, NYC ... - - - - - Identifies the country in which the bank is based. - The country key determines according to which rules the remaining bank data (for example, bank number and bank account number) is checked. - - - - - The name under which the bank operates. - - - - - - The bank key (under which the bank data is stored in the appropriate country) is specified in this field. - The country-specific meaning of this bank key is specified when defining country key.Normally banks have a bank number, which then also appears in the control data of the bank.In certain countries the bank account number assumes this function; in such a case there would be no bank numbers, the bank details are then under the account number.For data medium exchange it can be useful to be able create banks for foreign business partners without a bank number, even if the country in question has bank numbers. In such cases the bank key can be assigned internally.If the bank data is under another key, such as the SWIFT code for example, numbers can also be assigned externally. - - - - - Uniquely identifies a bank throughout the world. - SWIFT stands for Society for Worldwide Interbank Financial Telecommunication.BIC stands for Bank Identifier Code.This globally unique code can be used in international payment transactions to identify the bank without the need to specify an address or bank number. Specification of the SWIFT code/BIC is mainly relevant for automatic payment transactions. - - - - - Brazil, France, Spain, Portugal and Italy - The field contains a check key for the combination bank number and bank account number.USAIn USA this field is used to differentiate between a savings and a current account (if no value is entered, the default value 01 is used).01 Current account02 Savings account03 Loan account04 General ledgerJapanIn Japan this field specifies the type of account. This information is is copied from the payment medium print program into payment medium. The following is an example of the account types used:01 FUTSU (similar to a savings account)02 TOUZA (similar to a current account)04 CHOCHIKU (similar to an investment account)09 Other types of bank accountsSouth AfricaIn South Africa this field specifies the type of account. The information entered here is forwarded to the bank that carries out the payment order. The following account types are permitted in ABC format:01 Current (Cheque) Account02 Savings Account03 Transmission Account04 Bond Account06 Subscription Share AccountArgentinaIn Argentina this field specifies the type of account:CC Current Account (Cuenta corriente)CA Saving Account (Caja de ahorro)CE Special Saving Account (Caja de ahorro especial)CS Salary Account (Cuenta sueldos)VenezuelaIn Venezuela this field specifies the type of account:CC Checking Account (Cuenta corriente)CA Saving Account (Cuenta de ahorro)CE Special Saving Account (Cuenta de ahorro especial)CS Salary Account (Cuenta sueldos)MexicoIn Mexico this field contains a two-digit key for classifying the bank account (for example, as a savings or current account). This key have different definitions, depending on the bank.NoteFor countries that are not listed here, this field can be used for account-specific information. - - - - - Here you can enter another name that the payment program can use if the name of the account holder is not the same as the name of the Business Partner. - - - - - - - - - A uniform standardized ID number for representing bank details that is in accordance with the ECBS (European Committee for Banking Standards). An IBAN has a maximum of 34 alphanumeric characters and is a combination of the following elements: - Country key of the bank (ISO code)Two-digit check numberCountry-specific account number (in Germany this consists of the bank number and account number, in France the bank number, account number and check key).The IBAN not only makes international payments easier, in some countries it has advantages for domestic payments as well. Depending on the country, it can mean advantages for value and fees.The IBAN can be maintained in parallel with the bank details but does not replace them. It is stored under the master data of the business partner and can then be used when creating the payment medium.Since it is only the bank that has the account that may generate the IBAN corresponding to an account number, the SAP system only generates a proposal. You can confirm or change this proposal. If no proposal is generated, enter the IBAN manually.An IBAN in Belgium may look like this:Electronic Form:BE62510007547061Printed form, as it would appear on an invoice:IBAN BE62 5100 0754 7061 - - - - - - This field contains the number under which the account is managed at the bank. - - - - - - Additional details for the bank details of the business partner. - In some countries the data for the bank details of the business partner (bank number, bank account number, name of the account holder) have to supplemented by other details in order to be able to use certain payment processes. This supplementary details are defined here.If additional data is required for the bank details for payment transactions in your country (see the following examples), enter the reference information.If for an automatic debit the bank requires the reference number of the collection authorization in Norway or Great Britain, specify this number here.In Great Britain when making payments to an account in a 'Building Society' you must specify which number payment recipient has. These details must be defined in the reference field, whereas the fields Bank Key and Account Number are to be used for the bank details of the 'Building Society'.In Great Britain when entering a building society account number, the name of the building society should also be maintained in the system. - - - - - States that the bank has collection authorization from the business partner for the account. - Set this indicator if the bank has collection authorization.Note for Accounts Receivable (FI-AR)If this indicator is not set, there is no bank collection.Note for Contract Accounts Receivable and Payable (FI-CA)This indicator is not relevant. - - - - - Name of the city as a part of the address. - - - - - - You can use authorization groups to stipulate which business partners a user is allowed to process. - Use the following authorization object:'Business partners: authorization groups' (B_BUPA_GRP).The system only checks this authorization if you made an entry in the "Authorization group" field for the business partner. Otherwise, any user may process the business partner. - - - - - - - - - - - - - The business partner relationship number is an internal number that identifies the business partner relationship set. - - - - - - Key identifying a business partner in the SAP system. The key is unique within a client. - - - - - - Key identifying a business partner in the SAP system. The key is unique within a client. - - - - - - - - States whether the relationship is a standard relationship. - If several relationships of the BP relationship category contact person have been defined for, you can set the indicator standard relationship for one of these relationships.A relationship that is marked as a standard relationship can be used whenA certain scenario automatically selects a contact personThe contact person responsible is not knownYou can give this indicator to only one business partner relationship of a BP relationship category for a particular period. Another relationship of the same relationship category can be indicated as the standard relationship only if the periods for the relationship do not overlap or coincide. - - - - - A relationship may exist between two business partners. The business partner relationship category characterizes the features of the relationship. - A distinction is made between a one-way and an undirected business partner relationship category. In a one-way relationship category, the relationship extends from one partner to another, but not vice versa.Marriage (undirected)Employee (one-way)Contact person (one-way) - - - - - - - - - - - - - Key identifying a business partner in the SAP system. The key is unique within a client. - - - - - - Function that a business partner takes on, depending on a business transaction. - You can define business partner roles along with their attributes in Customizing.You can create an alphanumeric, 6-digit key for the BP role. You can also choose a title as the short form and a description as the long form for the role text.Screen control in the dialog takes place by assigning a BP view.A program can access specific business partner roles for a business partner using thebusiness partner role category . The role categories are also in the TB003 table. - - - - - - - You can use authorization groups to stipulate which business partners a user is allowed to process. - Use the following authorization object:'Business partners: authorization groups' (B_BUPA_GRP).The system only checks this authorization if you made an entry in the "Authorization group" field for the business partner. Otherwise, any user may process the business partner. - - - - - - - - - - - Key identifying a business partner in the SAP system. The key is unique within a client. - - - - - - Specifies the tax number category. - - - - - - Specifies the tax number. - - - - - - Specifies the tax number. - You can enter up to 60 characters in this field. - - - - - You can use authorization groups to stipulate which business partners a user is allowed to process. - Use the following authorization object:'Business partners: authorization groups' (B_BUPA_GRP).The system only checks this authorization if you made an entry in the "Authorization group" field for the business partner. Otherwise, any user may process the business partner. - - - - - - - - - - Gives an alphanumeric key, which clearly identifies the customer or vendor in the SAP system. - - - - - - The authorization group allows extended authorization protection for particular objects. The authorization groups are freely definable. The authorization groups usually occur in authorization objects together with an activity. - - - - - - Indicates if the processing of billing documents is blocked for the customer in all sales areas (company-wide, for example). - You can define different kinds of block, according to the needs of your organization. You can, for example, automatically block the processing of all credit memos to a certain customer, pending manual approval. - - - - - Name with which the user who entered the master record was logged on in the R/3 System. - - - - - - Date on which the master record, or the part of the master record being viewed, was created. - - - - - - The account group is a classifying feature within customer master records. The account group determines: - in which number range the customer account number should be;whether the number is assigned by the user or by the system;which specifications are necessary or possible in the master record. - - - - - Specifies a classification of the customer (for example, classifies the customer as a bulk purchaser). - The classifications are freely definable according to the needs of your organization. - - - - - - - Indicates if delivery processing is blocked for the customer in all sales areas (company-wide, for example). - You can define different kinds of block, according to the needs of your organization. You can, for example, automatically block all deliveries to a certain customer for credit reasons. - - - - - Denotes a natural person. - In the following countries, the system needs to know whether the taxpayer is a legal or natural person so that it can check the tax numbers correctly:BrazilBulgariaColombiaCroatiaGreeceItalyMexicoPeruSloveniaThailandUkraineThe flag is also used in conjunction with the Statement of Payments to Natural Persons report, as used in the Czech Republic and in Slovakia. This report only covers customers and vendors for whom you have set this indicator.In South Korea, it is used in conjunction with the Generic Withholding Tax Reporting program. - - - - - Indicates if sales order processing is blocked for the customer in all sales areas (company-wide, for example). - If you block sales order processing, the block counts for the following partner functions of the customer:Sold-to partyShip-to partyPayerIf you want to process an order where the ship-to party differs from the sold-to party, and the ship-to party is blocked, you cannot process the order.You can define different kinds of block, according to the needs of your organization. You can, for example, automatically block all free of charge deliveries and credit memo requests for a certain customer, pending manual approval before further processing can take place. - - - - - Indicates that the account is blocked for posting for all company codes. - If you set this indicator, the system prevents users from posting items to this account and issues an error message to inform them that the account is blocked. - - - - - Specifies an alphanumeric key that uniquely identifies the supplier in the SAP system. - - - - - - If the customer or the vendor belongs to a group, you can enter a group key here. The group key is freely assignable. - If you create a matchcode using this group key, group evaluations are possible. - - - - - Account number of another master record in which the official address is stored. This address is used, for example, for tax reports to the tax authorities in Italy. - - - - - - An industry is a distinct group of companies with the same basic business activity. The industry key is used in selecting data for evaluations (for example, a vendor master data list). You can specify industries such as trade, banking, service, manufacturing, health care, public service, media and so on. - The industry field belongs to the general data area of customer and vendor master records. - - - - - Specifies the code that uniquely identifies the industry (or industries) of the customer. - Depending on the standards your organization uses (for example, Standard Industry Codes (SIC)), enter the appropriate code. You can assign more than one industry code to a customer by choosing Create more. - - - - - Specifies an additional code that identifies the industry (or industries) of the customer. - Depending on the standards your organization uses (for example, Standard Industry Codes (SIC)), enter the appropriate code. - - - - - Specifies an additional code that identifies the industry (or industries) of the customer. - Depending on the standards your organization uses (for example, Standard Industry Codes (SIC)), enter the appropriate code. - - - - - Specifies an additional code that identifies the industry (or industries) of the customer. - Depending on the standards your organization uses (for example, Standard Industry Codes (SIC)), enter the appropriate code. - - - - - Specifies an additional code that identifies the industry (or industries) of the customer. - Depending on the standards your organization uses (for example, Standard Industry Codes (SIC)), enter the appropriate code. - - - - - Here you enter the first 7 digits of the international location number. - The International Location Number (ILN) is assigned (in Germany by the Centrale for Coorganisation GmbH)) when a company is founded. It consists of 13 digits, the last digit being the check digit. There are two categories of location numbers:Participants who only need an ILN to cleary and unmistakably identify themselves for communication with the business partner are given a category 1 ILN. This cannot be used to identify articles by means of EAN.Participants who wish to assign the location numbers for their own enterprise areas are given a category 2 ILN. For a category 2 ILN, digits 1 to 7 are described as basis number. This is used as basis for the creation of article numbers (EAN). - - - - - Specifies a regional division according to the market categories created by the A. C. Nielsen company. - By allocating a Nielsen division, you can use the services of the Nielsen Institute to create a market analysis of your customers. - - - - - Classification of companies according to tax aspects. - - - - - - Specifies the tax number. - Enter the appropriate tax number:Country Tax NumberArgentina CUIT number or CUIL numberBelgium Enterprise numberBrazil CNPJ numberBulgaria Unified identification codeChile RUT numberChina VAT registration number (shui wu deng ji hao)Colombia NIT numberCroatia Legal persons: company identification numberNatural persons: JMBG numberCzech Republic DIC numberFrance SIRET numberGreece Personal IDHungary Tax numberItaly Fiscal codeKazakhstan RNN (obsolete)Mexico RFC numberNetherlands SI registration number (Aansluitnummer UWV) of chain- liability vendorNorway VAT numberPeru RUC numberPhilippines Taxpayer identification number (see below)Poland NIP numberPortugal NIF numberRomania Tax numberRussia INNSlovakia DIC numberSlovenia Tax numberSouth Korea Natural persons: Personal identification numberLegal persons: Corporation IDSpain NIF numberSwitzerland UID numberTaiwan - China GUI registration numberThailand Personal IDTurkey Name of business partner's tax officeUkraine Taxpayer identification numberUnited Kingdom Company registration numberUnited States Social security numberVenezuela RIF numberIn the Philippines, enter the taxpayer identification number with a V or N at the end, as follows:If the business partner is liable to VAT: 999-999-999-999VIf the business partner is not liable to VAT: 999-999-999-999N - - - - - Specifies the tax number. - Enter the appropriate tax number:Country Tax NumberArgentina NIP number or CM numberBelgium VAT numberBrazil CPF numberBulgaria Legal persons: tax numberNatural persons: personal IDCroatia OIB number Czech Republic ICO numberFrance SIREN numberGreece AFM numberIndia TINItaly VAT numberKazakhstan BC (Beneficiary Code)Netherlands BSN numberRussia OKPO codeSlovakia ICO numberSouth Korea VAT registration numberSweden Organization registration numberSwitzerland VAT numberTaiwan - China Tax registration numberUkraine Legal persons: USREOU numberNatural persons: SRNP numberTurkey Tax numberUnited Kingdom NI numberUnited States Employer identification numberVenezuela NIT number - - - - - Specifies the tax number. - Enter the tax number that applies:Country Tax numberArgentina Withholding agent numberBrazil State tax numberBulgaria Social security numberMexico CURP numberKazakhstan BINNetherlands Tax registration number (Loonbelastingnummer) of the chain-liability vendorRussia KPP numberThailand Tax ID Ukraine VAT registration number - - - - - Specifies the tax number. - Enter the appropriate tax number:Country Tax NumberBrazil Municipal tax numberKazakhstan IINRussia OFK number (for public bodies only) - - - - - Kazakhstan - Specifies the certificate of registration as VAT payer in the following format: XXXXXYYYYYYYZZZZZZZZ, where: XXXXX is the certificate serial number, YYYYYYY is the certificate number and ZZZZZZZZ is the date of certificate issue. - - - - - Taxes in Argentina: - The format and the check of tax number 1 depend on the two-digit tax number type.The tax number type is an identification type for tax in Argentina (for example, 80 for CUIT) and is used for the DGI tax report. - - - - - VAT registration number (VAT reg.no.) of the customer, vendor or your company code. - The VAT registration number is used within the EU for tax-exempt deliveries for the "EC sales list". The check rules are defined for each EU country and cannot be changed. - - - - - Indicates that all data in this master record is to be deleted. - To delete this data, you have to run the archiving program for Accounts Receivable or Payable. This program will archive all master records marked for deletion provided that there is no dependent data in them.Deletion flags can also be used in the program for deleting master data. You should, however, run this program only to delete test data prior to production startup. - - - - - - - - - - - - - Gives an alphanumeric key, which clearly identifies the customer or vendor in the SAP system. - - - - - - The company code is an organizational unit within financial accounting. - - - - - - Contains settings that control how the system handles differences between the invoice amount and the amount received from a customer or the amount paid to a supplier. A tolerance group is unique within a company code. - - - - - - This field contains the account number the company is listed under at the customer. - - - - - - Identification code for the accounting clerk. - The name of the accounting clerk defined by this identification code can be used in the payment program for correspondence and reporting (for example, open item lists). - - - - - - - - - Account number of the customer for whom automatic payment transactions are to be carried out.The account number is only needed if bank collections are not to be made via the customer who owes the receivables. The same applies to refunds of payables.The specification in this field only applies to this company code. There is another field in which you can enter an alternative payee for all company codes. If both fields are filled, the specification for the company code has priority. - - - - - The authorization group allows extended authorization protection for particular objects. The authorization groups are freely definable. The authorization groups usually occur in authorization objects together with an activity. - - - - - - Indicator which specifies at what intervals the collective invoices are to be created for the customer. - - - - - - Internal memo of the accounting department. - The memo serves only as information on special features of the customer/vendor. - - - - - This field contains the account number of the head office. - This account number is only specified for branch accounts. All postings for which the account number of the branch is specified, are automatically posted to the head office account. The account number of the branch affected is noted in the line items.No line items or balances are managed in the branch account. - - - - - Indicates that during automatic payment transactions clearing is made with the corresponding vendor account, and that during manual clearing procedures, the items of that vendor account are also selected. - To use this function in automatic payment transactions, you have toenter the vendor account number in the customer master record,enter the customer account number in the vendor master record, andselect the "Clearing with customer" indicator in the vendor master record.If you set this indicator, the system will also include items of the vendor account in customer dunning. - - - - - All bank data is determined using this key. - - - - - - Enter an interest calculation indicator here if the account is to be included in automatic interest calculation. - - - - - - The date in this field displays the last time the interest calculation program processed this account. This is generally the upper limit of the last interest run. - Generally, this date is automatically maintained by the program (batch input). A manual entry in this field should only be made if an error has occurred or when implementing the interest calculation. - - - - - Indicates that payment transactions and dunning notices are created for the branch. - Normally automatic payment transactions and dunning notices are created for the head office.NoteSelect this indicator only if this account is a head office account. - - - - - If this indicator is set, every customer/vendor open item is paid separately during automatic payment transactions. This means that open items are not grouped together for payment. - - - - - - Indicates the layout rule for the Allocation field in the document line item. - The system uses a standard sort sequence for displaying line items. Among other things, it sorts the items according to the content of the Allocation field. This field can be filled either manually or automatically (by the system) when a document line item is entered.For this purpose, the system requires rules that determine which information is to be taken from the document header or from the document line item and placed in the field. The rules can be stored in the master record of an account which enables you to determine the standard sort sequence on an account-specific basis.NoteField information from another document line item cannot be adopted into the field of a particular item. - - - - - Block key (enqueue key) that is used to block an open item or an account to payment transactions. - You can use the block key as described below.Automatic Payment TransactionsIn automatic payment transactions, the block takes effect when it is entered in the system as follows:In the master recordIn the documentIf you enter the block in the master record then all open items for this account are contained in the exception list.The following block keys have a special meaning in the master record:The block key * has the effect that all items of the account are skipped in automatic payment transactions.The block key + has the effect that all items are skipped in which a payment method was not entered explicitly.The block key A is always set automatically when a down payment is entered. Therefore, you must not delete the block key A or use it for other purposes.Whether a block key can be set or removed in payment proposal processing depends on the attribute Changeable in payment proposal of the block key.Manual PaymentsManual payments are only affected by a block key in the document if you set the attribute Blocked for manual payments in the block key.A block key that was set in the master record does not have any effect on manual payments. You can have the system issue a warning message in that case. To do so, you have to make system settings. Set up message 671 of work area F5 in message control accordingly. - - - - - List of payment methods which may be used in automatic payment transactions with this customer/vendor if you do not specify a payment method in the item to be paid. - If you do specify a particular payment method in the item to be paid, this specification has priority over the specifications in the master record. You may also specify payment methods in the item which are not listed in the master record. - - - - - Key for defining payment terms composed of cash discount percentages and payment periods. - It is used in sales orders, purchase orders, and invoices. Terms of payment provide information for:Cash managementDunning proceduresPayment transactionsData can be entered in the field for the terms of payment key in various ways as you enter a business transaction:In most business transactions, the system defaults the key specified in the master record of the customer/vendor in question.In some transactions (for example, credit memos), however, the system does not default the key from the master record. Despite this, you can use the key from the customer/vendor master record by entering "*" in the field.Regardless of whether or not a key is defaulted from the master record, you can manually enter a key during document entry at:item level in sales ordersheader level in purchase orders and invoicesMaster records have separate areas for Financial Accounting, Sales, and Purchasing. You can specify different terms of payment keys in each of these areas. When you then enter a business transaction, the application in question will use the key specified in its area of the master record. - - - - - This indicator specifies that the customer/vendor should be sent all payment advice information by EDI. - - - - - - Indicates that the account is blocked for posting in the specified company code. - If you set this indicator, the system prevents users from posting items to this account and issues an error message to inform them that the account is blocked. - - - - - The reconciliation account in G/L accounting is the account which is updated parallel to the subledger account for normal postings (for example, invoice or payment). - For special postings (for example, down payment or bill of exchange), this account is replaced by another account (for example, 'down payments received' instead of 'receivables').The replacement takes place due to the special G/L indicator which you must specify for these types of postings. - - - - - Indicator that the payment history of the customer is to be recorded. - The amount and number of payments are then recorded per calendar month, as well as the average days in arrears.Information about cash discount payments and net payments is recorded separately.The indicator should not be set for one-time accounts and accounts which are paid automatically (bank collection or bank bill in Germany, bill of exchange payment request in France).You can only carry out evaluation of the payment history, for example, with the report for customer evaluation with OI listing, if you have selected this field. - - - - - Name or identification code of the accounting clerk at the customer. - - - - - - Indicates that the company code data in this master record is to be deleted. - To delete this data, you have to run the archiving program for Accounts Receivable or Payable. This program will archive all master records marked for deletion provided that there is no dependent data in them.This deletion flag cannot be used in the program that deletes master data. You should, however, run this program only to delete test data prior to production startup. - - - - - In cash management, customers and vendors are allocated to planning groups by means of an entry made in the master record. - You can define these planning groups in Customizing or the Implementation Guide (you will need to ensure that they are all the same length). In order to improve the liquidity forecast display for major customers and vendors, it can be advisable to enter their account number as the planning group.For the planning groups themselves a naming convention should be set up to improve liquidity forecasting. In the following examples, the customer planning groups begin with an "R" for receipts, and the vendor planning groups begin with an "E" for expenses.R1 Customers paying by bank collectionR2 Other domestic customersR3 Customers abroadR4 Affiliated company customersR5 High risk customersR6 Major customersR7 Rental incomeR8 Repayment of loans...E1 Domestic vendorsE2 Vendors abroadE3 Affiliated company vendorsE4 Major vendorsE5 Personnel costsE6 TaxesE7 Investments... - - - - - With the key specified here, you can refer to known/negotiated leave. - - - - - - The value adjustment key controls the way the open items are processed during individual value adjustment. - - - - - - The account group is a classifying feature within customer master records. The account group determines: - in which number range the customer account number should be;whether the number is assigned by the user or by the system;which specifications are necessary or possible in the master record. - - - - - - - - - - - - - - Gives an alphanumeric key, which clearly identifies the customer or vendor in the SAP system. - - - - - - The company code is an organizational unit within financial accounting. - - - - - - The dunning area represents an organizational entity that is responsible for dunning. The dunning areas represent a sub-structure of the company codes. - If different responsibilities or different dunning procedures exist within a company code, you can set up corresponding dunning areas.All dunning notices are made separately according to dunning areas, and if necessary with different dunning procedures.The dunning area must be noted in the line items. As long as documents are copied from preliminary work areas (billing documents), the dunning area can be derived from details such as division or sales area, if necessary. - - - - - Key which reflects the reason for a dunning block indicator. - - - - - - Number that specifies how often an item or account has been dunned. - The business partner has received the dunning level from the last dunning run.If you use dunning areas, it is the dunning level that the business partner received from the last dunning run in the dunning area assigned.The dunning program sets the dunning level automatically when the customer or vendor receives a dunning notice. - - - - - This field contains the key for the dunning procedure to be used. - - - - - - Account number of the customer who is to be the recipient of the dunning letters. - The account number is only needed if dunning letters are not sent to the customer who owes the receivables. - - - - - Date on which the last dunning notice was made. - - - - - - Date on which a legal dunning procedure was initiated. - The printing of dunning notices in the legal dunning procedure generates an internal notice about any further account movements. A dunning notice is not created for the customer.If the Legal dunning procedure field in the master record contains a date, this means that the account is involved in a legal dunning procedure. The relationship between this date and the dunning date does not affect how the account is processed.The printing of account movements in the legal dunning procedure differs from the normal printing of dunning notices as follows:You must specify a separate form for your dunning procedure in Customizing. For more information, see Customizing (IMG) under Dunning Forms.The dunning program also displays text element 520 "Legal dunning procedure". This makes it possible to display the date of the legal dunning procedure from the master record.The program also displays the documents blocked for dunning and those with a payment method (automatic debit, bank direct debit).Although dunning notices are printed, the dunning level does not change in the master record or in the items. New dunning level = old dunning level.The program only updates the date of the last dunning run.Enter the date manually. - - - - - Identification code for the accounting clerk dealing with dunning letters. - Using this identification code, the accounting clerk whose name is printed on the dunning letters is determined.If this field is not filled, then the entry from the Accounting clerk field is used. - - - - - The authorization group allows extended authorization protection for particular objects. The authorization groups are freely definable. The authorization groups usually occur in authorization objects together with an activity. - - - - - - The account group is a classifying feature within customer master records. The account group determines: - in which number range the customer account number should be;whether the number is assigned by the user or by the system;which specifications are necessary or possible in the master record. - - - - - - - - - - - - - Gives an alphanumeric key, which clearly identifies the customer or vendor in the SAP system. - - - - - - An organizational unit responsible for the sale of certain products or services. The responsibility of a sales organization may include legal liability for products and customer claims. - You can assign any number of distribution channels and divisions to a sales organization. A particular combination of sales organization, distribution channel, and division is known as a sales area. - - - - - The way in which products or services reach the customer. Typical examples of distribution channels are wholesale, retail, or direct sales. - You can maintain information about customers and materials by sales organization and distribution channel. Within a sales organization you can deliver goods to a given customer through more than one distribution channel.You can assign a distribution channel to one or more sales organizations. If, for example, you have numerous sales organizations, each sales organization may use the "Wholesale" distribution channel.For each combination of sales organization and distribution channel, you can further assign one or more of the divisions that are defined for the sales organization. You can, for example, assign "Food" and "Non-food" divisions to the "Wholesale" distribution channel. A particular combination of sales organization, distribution channel, and division is known as a sales area. - - - - - A way of grouping materials, products, or services. The system uses divisions to determine the sales areas and the business areas for a material, product, or service. - A product or service is always assigned to just one division. From the point of view of sales and distribution, the use of divisions lets you organize your sales structure around groups of similar products or product lines. This allows the people in a division who process orders and service customers to specialize within a manageable area of expertise.If a sales organization sells food and non-food products through both retail and wholesaledistribution channels each distribution channel could then be further split into food and non-food divisions. - - - - - This field contains the account number your company is listed under at the customer or vendor. - - - - - - The authorization group enables you protect access to certain objects. - In order to carry out a specific activity, the user must have authorization for the combination of the activity and the authorization group. - - - - - Indicates if further billing activities are blocked for the customer. The block applies throughout the specified sales area. - If you enter a blocking indicator, billing that is already underway is continued. However, you cannot process the document further.Enter one of the values predefined for your system. If you want to block billing for a customer throughout an entire sales organization, you must enter a blocking indicator for each sales area in which the sales organization is defined.You can block billing for a customer if, for example, there are credit-related or legal problems to be resolved. - - - - - Indicates whether a sales order must be delivered completely in a single delivery or whether the order can be partially delivered and completed over a number of deliveries. - - - - - - Customer's currency for a sales area. This currency will be used to settle the customer's charges for the given sales organization. - - - - - - - The account assignment group to which the system automatically posts the sales document. - The system uses the account assignment group as one of the criteria during the automatic determination of revenue accounts.The system automatically proposes the account assignment group from the customer master record of the payer. You can change the default value in the sales document or the billing document. - - - - - Identifies a particular group of customers (for example, wholesale or retail) for the purpose of pricing or generating statistics. - - - - - - Key for defining payment terms composed of cash discount percentages and payment periods. - It is used in sales orders, purchase orders, and invoices. Terms of payment provide information for:Cash managementDunning proceduresPayment transactionsData can be entered in the field for the terms of payment key in various ways as you enter a business transaction:In most business transactions, the system defaults the key specified in the master record of the customer/vendor in question.In some transactions (for example, credit memos), however, the system does not default the key from the master record. Despite this, you can use the key from the customer/vendor master record by entering "*" in the field.Regardless of whether or not a key is defaulted from the master record, you can manually enter a key during document entry at:item level in sales ordersheader level in purchase orders and invoicesMaster records have separate areas for Financial Accounting, Sales, and Purchasing. You can specify different terms of payment keys in each of these areas. When you then enter a business transaction, the application in question will use the key specified in its area of the master record. - - - - - A grouping of customers who share the same pricing requirements. - You can define price groups according to the needs of your organization and create pricing records for each group. You can, for example, define a group of customers to whom you want to give the same kind of discount. You can assign a price group to an individual customer either in the customer master record or in the sales document.The system can propose the price group from the customer master record. You can change the proposed value manually in the sales document at both header and item level. - - - - - Determines which pricing procedure the system should apply when you create a sales document for the customer. - You can define different pricing procedures for your system. A pricing procedure determines the type and sequence of conditions that the system uses for pricing in, for example, a sales order. - - - - - Indicates if further delivery processing is blocked for the customer. The block applies throughout the specified sales area. - If you enter a blocking indicator, delivery processing that is already underway is continued. However, no new processing can take place.Enter one of the values predefined for your system. If you want to block delivery processing for a customer within a particular sales organization, you must enter a blocking indicator for each sales area in which the sales organization is defined.You can block delivery processing for a customer if, for example, there are credit-related or legal problems to be resolved. - - - - - The delivery priority assigned to an item. - You can assign delivery priority to either a particular material or to a combination of customer and material. When you process deliveries collectively, you can use delivery priority as one of the selection criteria. - - - - - Commonly used trading terms that comply with the standards established by the International Chamber of Commerce (ICC). - Incoterms specify internationally recognized procedures that the shipper and the receiving party must follow for the shipping transaction to be completed successfully.If goods are shipped through a port of departure, the appropriate Incoterm might be: FOB ("Free On Board"). You can provide further details (for example, the name of the port) in the secondary Incoterm field: FOB Boston, for example. - - - - - Provides additional information for the Incoterms. This field is only available for C-Clauses (if customized appropriately). Note the following for the incoterms versions below: - No Version:This field is disabledIncoterm Version 2000This field is disabled as part of standard delivery unless a customer decides to enable it by the way of Customizing for Sales and Distribution under Master Data -> Business Partners -> Customers -> Billing Document -> Incoterms -> Map Incoterms to Versions.Incoterm Version 2010For this version, the field represents:Sea and inland waterway transport - Port of DestinationAny mode of transport - Place of Destination2010 Incoterms are divided as follows:Group 1: Rules for any mode or modes of transport (including by vessel)Incoterms Incoterms Description Location 2CPT Carriage Paid To Place of DestinationCIP Carriage & Insurance Paid To Place of DestinationGroup 2: Rules for sea and inland waterwaysIncoterms Incoterms Description Location 2CFR Cost & Freight Port of DestinationCIF Cost Insurance & Freight Port of Destination - - - - - An incoterms version is an edition containing a list of international terms for transportation that is defined by the International Chamber of Commerce (ICC). - - - - - - Provides additional information for the primary Incoterm. For Incoterms 2010, this field represents: - 1. For sea and inland waterway transport - Port of Shipment2. For any mode of transport - Place of Delivery 2010Incoterms are divided as follows:Group 1: Rules for any mode or modes of transport (including by vessel)Incoterms Incoterms Description Location 1 EXW Ex Works Place of DeliveryFCA Free Carrier Place of DeliveryCPT Carriage Paid To Place of DestinationCIP Carriage & Insurance Paid To Place of DestinationDAF Delivered at Frontier Place of DeliveryDDP Delivered Duty Paid Place of DestinationDDU Delivered Duty Unpaid Place of DestinationGroup 2: Rules for sea and inland waterwaysIncoterms Incoterms Description Location 1 FAS Free Alongside Ship Port of ShipmentFOB Free On Board Port of ShipmentCFR Cost & Freight Port of DestinationCIF Cost Insurance & Freight Port of DestinationDEQ Delivered Eq Quay (Duty Paid) Port of DestinationDES Delivered Ex Ship Port of DestinationIf the primary incoterm is specified as FOB “Free on Board”, the second field provides details of the port from which the delivery leaves, such as FOB Boston. - - - - - Indicates that all data in the master record will be deleted for the specified sales area. Before the deletion is made, the system checks for dependent data that would prevent the deletion. - - - - - - Additional information for the primary Incoterm. - If the primary Incoterm is, for example, FOB ("Free on Board"), then the second field provides details of the port from which the delivery leaves (for example, "FOB Boston"). - - - - - Identifies the calendar that determines the schedule of billing dates for the customer. - If, for example, a customer wants to consolidate the invoices you send out, you can predefine the billing schedule in a calendar in the system. During billing, the system automatically proposes the appropriate billing date from the calendar.The system proposes the billing schedule from the customer master record of the payer. You can change the value manually in the sales document. - - - - - The probability (expressed as a percentage) of the customer confirming the inquiry or quotation item as part of a sales order. - The system combines the probability factors from the sales document type and from the customer master record of the sold-to party.If probability is 80% for the sales document type and 50% in the customer master record, the system combines the two values. In this case, the system takes 50% of 80% and proposes 40% for the item.The system proposes the probability. You can change the value manually for the item.You can generate requirements from quotations. Accordingly, the probability of quotation items affects how requirements are passed on. For example, a quotation for 100 pieces and a probability of 50% will generate requirements for 50 pieces. - - - - - Indicates whether you are allowed to combine orders during delivery processing. - The system proposes the indicator from the customer master record. You can change the value manually in the sales document at both header and item level. - - - - - Indicates if further sales order processing is blocked for the customer. The block applies throughout the specified sales area. - You can define blocks according to the needs of your organization. If you enter a blocking indicator, sales order processing that is already underway is continued. However, no new processing can occur.Enter one of the values predefined for your system. If you want to block sales order processing for a customer within a particular sales organization, you must enter a blocking indicator for each sales area in which the sale organization is defined.You can block sales order processing for a customer if, for example, there are credit-related or legal problems to be resolved. - - - - - Specifies whether the customer requires full or partial delivery for the item. - You use this field to control partial deliveries at the item level. If the customer allows partial delivery, you can choose from different partial delivery options. For example, you can specify whether the customer allows you to make one delivery attempt only on the requested delivery date or whether unlimited delivery attempts are possible.When partial delivery indicator 'D' is set, the order can never have status 'fully delivered'. You must complete each item by entering a reason for rejection. This could be applied to scheduling agreements, for example.You can enter a value in this field only if the customer allows partial deliveries for the entire sales document. - - - - - Identifies a price list or other condition type (for example, a surcharge or discount). - You can define price list types according to the needs of your own organization. Price list types can be grouped according to:the kind of price list (for example, wholesale or retail)the currency in which the price appearsthe number of the price list typeYou can use price list types to apply conditions during pricing or to generate statistics.In the customer master record, enter one of the values predefined for your system. The system proposes the value automatically during sales order processing. You can change the value manually in the sales document header. - - - - - A group of sales people who are responsible for processing sales of certain products or services. - By using sales groups you can designate different areas of responsibility within a sales office. When you generate sales statistics, you can use the sales group as one of the selection criteria.If sales office personnel service both retail and wholesale markets, you can assign a sales group to each market.You assign each salesperson to a sales group in his or her user master record. You assign each customer to a particular sales group in the customer's master record. - - - - - A physical location (for example, a branch office) that has responsibility for the sale of certain products or services within a given geographical area. - When you create sales statistics, you can use a sales office as one of the selection criteria. When you print out order confirmations, you can include the address of the sales office.You can assign each customer to a sales office in the customer master record.Within a sales office you can establish sales groups (for example, departments) with specific sales responsibilities. Each person who works in the sales office can be assigned to a sales group in his or her user master record. Each customer can also be assigned to a particular sales group in the customer master record. - - - - - General shipping strategy for the delivery of goods from the vendor to the customer. - You can define shipping conditions in your system which correspond to the requirements of your company. You can specify a shipping condition in the customer master and in the vendor master.Shipping point determination (outbound delivery):The loading group, the plant and the shipping condition determine the shipping point that will be proposed by the system.Route determination (outbound delivery):Apart from the country and the geographical region of the shipping point, the ship-to party and the transportation group, the shipping condition determines the route that the system proposes in the order for the delivery of the goods. In the delivery, the route proposal also takes the weight group into account.A particular customer always requires immediate delivery. You enter the appropriate shipping condition into the customer master record. This means that when you process orders for this customer, the system automatically proposes the express mail room as a shipping point and the quickest way to the airport as a route.If a shipping condition has been assigned to a sales document type in Customizing, this condition will be proposed by the system in the corresponding sales document. If there is no assignment, the system copies the relevant data from the corresponding customer master record of the sold-to party. You cannot change this value during delivery processing. The shipping condition will not be copied from the delivery into the shipment. The shipping condition is one of several criteria for selecting deliveries when you create a shipment. You can enter a shipping condition manually in the shipment where it only serves as a characteristic for grouping shipments. - - - - - Plant from which the goods should be delivered to the customer. - This plant is automatically copied into the sales order item as the default value.If there is no default value when you process the sales order item, enter a delivering plant.The value proposed in the item is eitherfrom the customer master record of the goods recipient, orfrom the material master recordThe system checks whether it can propose a value (and for your own plants, whether the material has been created in the plant). If the system can propose a value, the plant is copied to the sales order item where you can change it as required. - - - - - A geographical sales district or region. - Each customer can be assigned to a sales district. You can use sales districts to apply pricing conditions. When you want to generate sales statistics, you can use sales districts as a selection criteria.The system can propose a value from the customer master record of the sold-to party. You can change the value manually in the document at the header or item level. - - - - - Identifies the customer's factory calendar that is used during the processing of invoice lists. - An invoice list is a list of invoices (single or collective) that you create for the customer either periodically or on predefined dates. The periods and dates are defined in the customer's factory calendar. Typically, the recipient of an invoice list takes on the responsibility for collecting payments from numerous individual customers and receives a factoring or del credere discount for the service.If you want to create invoice lists for the customer, you must enter an identifier for a predefined factory calendar. - - - - - Key representing a type of exchange rate in the system. - You enter the exchange rate type to store different exchange rates.You can use the exchange rate type to define a buying rate, selling rate, or average rate for translating foreign currency amounts. You can use the average rate for the currency translation, and the bank buying and selling rates for valuation of foreign currency amounts. - - - - - Specifies a customer-defined group of customers. - You can define up to five different groups of customers, according to the needs of your organization. You specify the groups in the customer master record under "Additional data". If you assign a particular customer to one or more groups, the system automatically displays the groups in the header data of corresponding sales orders.You can define customer groups in Tables TVV1 through TVV5 and assign them to specific languages in Tables TVV1T through TVV5T. - - - - - Specifies a customer-defined group of customers. - You can define up to five different groups of customers, according to the needs of your organization. You specify the groups in the customer master record under "Additional data". If you assign a particular customer to one or more groups, the system automatically displays the groups in the header data of corresponding sales orders.You can define customer groups in Tables TVV1 through TVV5 and assign them to specific languages in Tables TVV1T through TVV5T. - - - - - Specifies a customer-defined group of customers. - You can define up to five different groups of customers, according to the needs of your organization. You specify the groups in the customer master record under "Additional data". If you assign a particular customer to one or more groups, the system automatically displays the groups in the header data of corresponding sales orders.You can define customer groups in Tables TVV1 through TVV5 and assign them to specific languages in Tables TVV1T through TVV5T. - - - - - Specifies a customer-defined group of customers. - You can define up to five different groups of customers, according to the needs of your organization. You specify the groups in the customer master record under "Additional data". If you assign a particular customer to one or more groups, the system automatically displays the groups in the header data of corresponding sales orders.You can define customer groups in Tables TVV1 through TVV5 and assign them to specific languages in Tables TVV1T through TVV5T. - - - - - Specifies a customer-defined group of customers. - You can define up to five different groups of customers, according to the needs of your organization. You specify the groups in the customer master record under "Additional data". If you assign a particular customer to one or more groups, the system automatically displays the groups in the header data of corresponding sales orders.You can define customer groups in Tables TVV1 through TVV5 and assign them to specific languages in Tables TVV1T through TVV5T. - - - - - This key identifies the customer payment guarantee procedure. - The customer payment guarantee procedure determines which payment guarantee procedure the system automatically uses when you create a sales document for the customer.In receivables risk management, the system determines the payment guarantee procedure taking into account:the key for the document payment guarantee procedure in the header for the sales document type.the customer payment guarantee procedure key in the customer master.You can define different payment guarantee procedures for your system. The payment guarantee procedure defines the type and sequence of forms of payment guarantee that the system assigns to the sales document items. - - - - - The account group is a classifying feature within customer master records. The account group determines: - in which number range the customer account number should be;whether the number is assigned by the user or by the system;which specifications are necessary or possible in the master record. - - - - - - - - - - - - - - - - - Gives an alphanumeric key, which clearly identifies the customer or vendor in the SAP system. - - - - - - An organizational unit responsible for the sale of certain products or services. The responsibility of a sales organization may include legal liability for products and customer claims. - You can assign any number of distribution channels and divisions to a sales organization. A particular combination of sales organization, distribution channel, and division is known as a sales area. - - - - - Specifies a distribution channel that you want to use as a reference for customer and material master data for other distribution channels. - You can specify one distribution channel as the source of customer and material master data for other distribution channels. You need then only to maintain the data in one place.Distrib.channel Ref.distrib.channel01 0102 0103 0104 04In this example, only distribution channels 01 and 04 have customer and material master data defined. Distribution channels 01, 02, and 03 share the master data that you defined for distribution channel 01. Distribution channel 04 has its own master data. When you create a sales order in distribution channel 03, the system checks the customer and material master data against the data defined for distribution channel 01. - - - - - A way of grouping materials, products, or services. The system uses divisions to determine the sales areas and the business areas for a material, product, or service. - A product or service is always assigned to just one division. From the point of view of sales and distribution, the use of divisions lets you organize your sales structure around groups of similar products or product lines. This allows the people in a division who process orders and service customers to specialize within a manageable area of expertise.If a sales organization sells food and non-food products through both retail and wholesaledistribution channels each distribution channel could then be further split into food and non-food divisions. - - - - - Identifies the country in which the delivery originates. - You can define the country key in a table. As a rule, it is a good idea to use the existing international standards for identifying vehicles from different countries (for example: USA = United States, I = Italy, and so on). The system uses the key tohelp determine the relevant taxes during pricingdetermine important country-specific standards (the length of postal codes and bank account numbers, for example) - - - - - Identifies the condition that the system uses to automatically determine country-specific taxes during pricing. - You can define one or more tax categories for each country. During sales order processing, the system applies the tax category according tothe geographical location of your delivering plant and the location of the customer receiving the goodstax classifications in the customer master record and the material master record.In the USA, for example, you can define tax categories for Federal Sales Tax and Federal Excise Tax. In the U.K., you can define a tax category for Value Added Tax (VAT). - - - - - Specifies the tax liability of the customer, based on the tax structure of the customer's country. - You can use the tax classification to specify, for example, whether a customer is liable for sales taxes, such as VAT or state sales taxes.During sales order processing, the system copies the tax classification from the tax information stored in thecustomer master record of the payer, if the payer is different from the sold-to party and the sales tax identification number is maintained for the payer.ship to party, if the sales tax identification number of the ship-to party is maintained.sold-to party, if none of the criteria for the payer or the ship-to party are met.During pricing, the system calculates any relevant taxes by taking the following factors into account:The tax classification of the customer and the materialThe country keys of the customer and the delivering plant - - - - - - - - - - - - Gives an alphanumeric key, which clearly identifies the customer or vendor in the SAP system. - - - - - - The company code is an organizational unit within financial accounting. - - - - - - This indicator is used to classify the different types of withholding tax. - Withholding tax types classify particular features of a withholding tax including:The time at which the withholding tax is postedThe basis on which the base amount is calculatedThe basis for accumulation (if applicable)Withholding tax types are to be distinguished from withholding tax codes, to which are allocated the withholding tax percentage rate example.Whether a withholding tax can be defined as an existing type by means of a new code, or if a new type needs to be defined will depend on the type of transaction (see below).Note that a business transaction can only be assigned one withholding tax code per withholding tax type. If the business transaction is subject to several withholding taxes simultaneously, these must be represented by different types.This is the case in Argentina for example, where up to four kinds of withholding tax per business transaction are possible. - - - - - One or more "withholding tax codes" are assigned to each withholding tax type. One of the things these codes determine is the various percentage rates for the withholding tax type. - Note that when processing a business transaction, no more than one withholding tax code can be assigned per withholding tax type. If the business transaction is subject to more than one withholding taxes, these must be represented in the system by defining various withholding tax types. - - - - - - Date from which: - The company code is obligated to withhold tax for the given withholding tax type.This date must be entered in Customizing under the withholding tax information for the company code.The customer is obligated to withhold tax for the withholding tax type.This date must be defined in the customer master record. - - - - - Date to which: - The company code is obligated to withhold tax for the withholding tax type.This date must be entered in Customizing under the withholding tax information for the company code.The customer is obigated to withhold tax for the withholding tax type. - - - - - This is a number issued by the tax authorities per withholding tax type. - This number must be specified in Customizing either:(a) As part of the withholding tax information defined for the company code, or(b) As part of the withholding tax information defined in the customer or vendor master record. - - - - - Numbered assigned by the relevant authorities for exemption from withholding tax. - This number must be entered in the system as follows:In the vendor master record in the case of vendorsFor customers, in Customizing under the settings for withholding tax information for the company code per withholding tax type. - - - - - Rate of exemption from withholding tax. - Those persons/activities subject to withholding tax can be exempted from withholding tax up to the percentage rate you enter here. This exemption rate refers to the withholding tax amount itself and not to the whole amount liable to withholding tax (withholding tax base amount).The gross amount of an invoice is 100.00 and the withholding tax base amount is defined as gross. The withholding tax rate is 10% meaning that the withholding tax amount is 10.00. Given an exemption rate of 30%, the withholding tax amount is reduced to 7.00. - - - - - Date from which withholding tax exemption applies. - - - - - - Date on which withholding tax exemption expires. - - - - - - Indicator used to classify different types of exemption from liability to a particular withholding tax. - These indicators can be defined per withholding tax type in the vendor master record. - - - - - The authorization group allows extended authorization protection for particular objects. The authorization groups are freely definable. The authorization groups usually occur in authorization objects together with an activity. - - - - - - - - - - - - - - - - Gives an alphanumeric key, which clearly identifies the customer or vendor in the SAP system. - - - - - - An organizational unit responsible for the sale of certain products or services. The responsibility of a sales organization may include legal liability for products and customer claims. - You can assign any number of distribution channels and divisions to a sales organization. A particular combination of sales organization, distribution channel, and division is known as a sales area. - - - - - The way in which products or services reach the customer. Typical examples of distribution channels are wholesale, retail, or direct sales. - You can maintain information about customers and materials by sales organization and distribution channel. Within a sales organization you can deliver goods to a given customer through more than one distribution channel.You can assign a distribution channel to one or more sales organizations. If, for example, you have numerous sales organizations, each sales organization may use the "Wholesale" distribution channel.For each combination of sales organization and distribution channel, you can further assign one or more of the divisions that are defined for the sales organization. You can, for example, assign "Food" and "Non-food" divisions to the "Wholesale" distribution channel. A particular combination of sales organization, distribution channel, and division is known as a sales area. - - - - - A way of grouping materials, products, or services. The system uses divisions to determine the sales areas and the business areas for a material, product, or service. - A product or service is always assigned to just one division. From the point of view of sales and distribution, the use of divisions lets you organize your sales structure around groups of similar products or product lines. This allows the people in a division who process orders and service customers to specialize within a manageable area of expertise.If a sales organization sells food and non-food products through both retail and wholesaledistribution channels each distribution channel could then be further split into food and non-food divisions. - - - - - The sequential number that the system applies when there is more than one partner for a particular partner function. - When you create a sales order for a particular customer, there may be more than one ship-to party defined. The different ship-to parties are numbered sequentially. - - - - - The abbreviated form of the name that identifies the partner function. - - - - - - - Sold-to party number sent in by the customer in delivery schedules. - The system uses this number to automatically determine the ship-to party. - - - - - Specifies a partner as the default for a particular partner function. - When you enter more than one partner for a particular partner function (for example, you define three different ship-to parties), you can select one partner as the default. During sales or purchasing processing, if you have defined multiple partners for a partner function, the system prompts you to choose just one partner. The system presents the default partner as the first choice in the pop-up window. - - - - - The authorization group allows extended authorization protection for particular objects. The authorization groups are freely definable. The authorization groups usually occur in authorization objects together with an activity. - - - - - - - - - - - Specifies an alphanumeric key that uniquely identifies the supplier in the SAP system. - - - - - - The account number of the vendor with whom automatic payment transactions are carried out. - The field is only needed if payments are not to be made directly to the vendor to whom the payable is owed. The same applies to bank collections of receivables.The specification in this field applies to all company codes. There is a further field in which every company code can enter an alternative payee separately. If both fields are filled, the company code specification has priority. - - - - - The authorization group allows extended authorization protection for particular objects. The authorization groups are freely definable. The authorization groups usually occur in authorization objects together with an activity. - - - - - - Name with which the user who entered the master record was logged on in the R/3 System. - - - - - - Date on which the master record, or the part of the master record being viewed, was created. - - - - - - Gives an alphanumeric key, which clearly identifies the customer or vendor in the SAP system. - - - - - - - Indicates that the account is blocked for posting for all company codes. - If you set this indicator, the system prevents users from posting items to this account and issues an error message to inform them that the account is blocked. - - - - - Indicates whether or not the supplier master record is blocked for all departments (that is, whether or not posting to this record is allowed at all). - - - - - - The account group is a classifying feature within vendor master records. The account group determines: - the number interval for the account number of the vendor,whether the number is assigned by the user or by the system,which specifications are necessary and/or possible in the master record. - - - - - - - VAT registration number (VAT reg.no.) of the customer, vendor or your company code. - The VAT registration number is used within the EU for tax-exempt deliveries for the "EC sales list". The check rules are defined for each EU country and cannot be changed. - - - - - - - Indicates that all data in this master record is to be deleted. - To delete this data, you have to run the archiving program for Accounts Receivable or Payable. This program will archive all master records marked for deletion provided that there is no dependent data in them.Deletion flags can also be used in the program for deleting master data. You should, however, run this program only to delete test data prior to production startup. - - - - - Specifies an additional master record in which the official address is stored. - This address is used in Italy for business transactions with the tax office in Italy. - - - - - An industry is a distinct group of companies with the same basic business activity. The industry key is used in selecting data for evaluations (for example, a vendor master data list). You can specify industries such as trade, banking, service, manufacturing, health care, public service, media and so on. - The industry field belongs to the general data area of customer and vendor master records. - - - - - Here you enter the first 7 digits of the international location number. - The International Location Number (ILN) is assigned (in Germany by the Centrale for Coorganisation GmbH)) when a company is founded. It consists of 13 digits, the last digit being the check digit. There are two categories of location numbers:Participants who only need an ILN to cleary and unmistakably identify themselves for communication with the business partner are given a category 1 ILN. This cannot be used to identify articles by means of EAN.Participants who wish to assign the location numbers for their own enterprise areas are given a category 2 ILN. For a category 2 ILN, digits 1 to 7 are described as basis number. This is used as basis for the creation of article numbers (EAN). - - - - - Here, you enter digits 8-12 of the 13-digit international location number. - The international location number (ILN) is assigned when establishing a company (by the "Zentrale für Coorganisation GmbH" in Germany). It consists of 13 digits, the last of which is the check digit. There are two types of international location numbers:Subscribers who only need one ILN to identify themselves in communication with the business partner are given an ILN of type 1. These cannot be used for identifying articles by means of EAN.Subscribers who need to assign location numbers for their own company areas are given an ILN of type 2. Positions 1 through 7 of the ILN type 2 are known as the basis number. This basis number forms the basis for article numbers (EAN). - - - - - The check digit is derived from a special check digit procedure from digits of the previous international location numbers. In this way, you can check whether the ILN entered is actually valid. - - - - - - Denotes a natural person. - In the following countries, the system needs to know whether the taxpayer is a legal or natural person so that it can check the tax numbers correctly:BrazilBulgariaColombiaCroatiaGreeceItalyMexicoPeruSloveniaThailandUkraineThe flag is also used in conjunction with the Statement of Payments to Natural Persons report, as used in the Czech Republic and in Slovakia. This report only covers customers and vendors for whom you have set this indicator.In South Korea, it is used in conjunction with the Generic Withholding Tax Reporting program. - - - - - Classification of companies according to tax aspects. - - - - - - Date up to which the certification of the QM-system is valid. - - - - - - If a QM system is maintained by the supplier, you can store a description of the QM system here. - If a material is activated for QM in procurement, the system initiates the following check whenever purchasing functions are carried out (for example, when a request for a quotation is made or if a purchase order is created):Whether the supplier's verified QM system, according to supplier master record or quality info-record (for a combination of supplier/material) meets the requirements for QM systems as specified in the material masterIn carrying out the check, the system relies on the defined assignments for target QM systems and actual QM systems in the Customizing application.If the check is unsuccessful, a warning message is issued when a request for quotation is initiated and an error message is issued for all other procurement activities. - - - - - If the customer or the vendor belongs to a group, you can enter a group key here. The group key is freely assignable. - If you create a matchcode using this group key, group evaluations are possible. - - - - - Key that determines which procurement functions (for example, request for quotation, purchase order, or goods receipt) should be blocked for quality reasons. - You can enter a block key in the:Supplier master recordIn this case, the supplier block applies to all materials and plants.Quality info record for QM in procurementIn this case, the supplier block applies to a single material and plant.A block for quality reasons applies only to those materials for which QM in procurement is active. - - - - - Specifies the tax number. - Enter the appropriate tax number:Country Tax NumberArgentina CUIT number or CUIL numberBelgium Enterprise numberBrazil CNPJ numberBulgaria Unified identification codeChile RUT numberChina VAT registration number (shui wu deng ji hao)Colombia NIT numberCroatia Legal persons: company identification numberNatural persons: JMBG numberCzech Republic DIC numberFrance SIRET numberGreece Personal IDHungary Tax numberItaly Fiscal codeKazakhstan RNN (obsolete)Mexico RFC numberNetherlands SI registration number (Aansluitnummer UWV) of chain- liability vendorNorway VAT numberPeru RUC numberPhilippines Taxpayer identification number (see below)Poland NIP numberPortugal NIF numberRomania Tax numberRussia INNSlovakia DIC numberSlovenia Tax numberSouth Korea Natural persons: Personal identification numberLegal persons: Corporation IDSpain NIF numberSwitzerland UID numberTaiwan - China GUI registration numberThailand Personal IDTurkey Name of business partner's tax officeUkraine Taxpayer identification numberUnited Kingdom Company registration numberUnited States Social security numberVenezuela RIF numberIn the Philippines, enter the taxpayer identification number with a V or N at the end, as follows:If the business partner is liable to VAT: 999-999-999-999VIf the business partner is not liable to VAT: 999-999-999-999N - - - - - Specifies the tax number. - Enter the appropriate tax number:Country Tax NumberArgentina NIP number or CM numberBelgium VAT numberBrazil CPF numberBulgaria Legal persons: tax numberNatural persons: personal IDCroatia OIB number Czech Republic ICO numberFrance SIREN numberGreece AFM numberIndia TINItaly VAT numberKazakhstan BC (Beneficiary Code)Netherlands BSN numberRussia OKPO codeSlovakia ICO numberSouth Korea VAT registration numberSweden Organization registration numberSwitzerland VAT numberTaiwan - China Tax registration numberUkraine Legal persons: USREOU numberNatural persons: SRNP numberTurkey Tax numberUnited Kingdom NI numberUnited States Employer identification numberVenezuela NIT number - - - - - Specifies the tax number. - Enter the tax number that applies:Country Tax numberArgentina Withholding agent numberBrazil State tax numberBulgaria Social security numberMexico CURP numberKazakhstan BINNetherlands Tax registration number (Loonbelastingnummer) of the chain-liability vendorRussia KPP numberThailand Tax ID Ukraine VAT registration number - - - - - Specifies the tax number. - Enter the appropriate tax number:Country Tax NumberBrazil Municipal tax numberKazakhstan IINRussia OFK number (for public bodies only) - - - - - Kazakhstan - Specifies the certificate of registration as VAT payer in the following format: XXXXXYYYYYYYZZZZZZZZ, where: XXXXX is the certificate serial number, YYYYYYY is the certificate number and ZZZZZZZZ is the date of certificate issue. - - - - - The tax number of the vendor at the responsible tax authority. - - - - - - Taxes in Argentina: - The format and the check of tax number 1 depend on the two-digit tax number type.The tax number type is an identification type for tax in Argentina (for example, 80 for CUIT) and is used for the DGI tax report. - - - - - This indicator controls the process of proof of delivery during the incoming goods process for inbound deliveries. Processing is activating by switching on this indicator in the supplier master and by switching on the corresponding indicator in the delivery item category. - There are the following different characteristics:' ': not relevant for POD'A': generally relevant for POD'B': only relevant for POD if differences(Difference between notified quantity and actual quantity received) - - - - - Tax calculation for Brazil: - The IPI tax value is split up for this vendor. 50% of the calculated IPI tax value is posted as deductible input tax, 50% is deducted from the inventory posting or posting to expense account. - - - - - - - - - - - - - Specifies an alphanumeric key that uniquely identifies the supplier in the SAP system. - - - - - - The company code is an organizational unit within financial accounting. - - - - - - The authorization group allows extended authorization protection for particular objects. The authorization groups are freely definable. The authorization groups usually occur in authorization objects together with an activity. - - - - - - - Block key (enqueue key) that is used to block an open item or an account to payment transactions. - You can use the block key as described below.Automatic Payment TransactionsIn automatic payment transactions, the block takes effect when it is entered in the system as follows:In the master recordIn the documentIf you enter the block in the master record then all open items for this account are contained in the exception list.The following block keys have a special meaning in the master record:The block key * has the effect that all items of the account are skipped in automatic payment transactions.The block key + has the effect that all items are skipped in which a payment method was not entered explicitly.The block key A is always set automatically when a down payment is entered. Therefore, you must not delete the block key A or use it for other purposes.Whether a block key can be set or removed in payment proposal processing depends on the attribute Changeable in payment proposal of the block key.Manual PaymentsManual payments are only affected by a block key in the document if you set the attribute Blocked for manual payments in the block key.A block key that was set in the master record does not have any effect on manual payments. You can have the system issue a warning message in that case. To do so, you have to make system settings. Set up message 671 of work area F5 in message control accordingly. - - - - - Indicates that the account is blocked for posting in the specified company code. - If you set this indicator, the system prevents users from posting items to this account and issues an error message to inform them that the account is blocked. - - - - - Identification code for the accounting clerk. - The name of the accounting clerk defined by this identification code can be used in the payment program for correspondence and reporting (for example, open item lists). - - - - - - - Name or identification code of the accounting clerk at the vendor. - - - - - - - List of payment methods which may be used in automatic payment transactions with this customer/vendor if you do not specify a payment method in the item to be paid. - If you do specify a particular payment method in the item to be paid, this specification has priority over the specifications in the master record. You may also specify payment methods in the item which are not listed in the master record. - - - - - Key for defining payment terms composed of cash discount percentages and payment periods. - It is used in sales orders, purchase orders, and invoices. Terms of payment provide information for:Cash managementDunning proceduresPayment transactionsData can be entered in the field for the terms of payment key in various ways as you enter a business transaction:In most business transactions, the system defaults the key specified in the master record of the customer/vendor in question.In some transactions (for example, credit memos), however, the system does not default the key from the master record. Despite this, you can use the key from the customer/vendor master record by entering "*" in the field.Regardless of whether or not a key is defaulted from the master record, you can manually enter a key during document entry at:item level in sales ordersheader level in purchase orders and invoicesMaster records have separate areas for Financial Accounting, Sales, and Purchasing. You can specify different terms of payment keys in each of these areas. When you then enter a business transaction, the application in question will use the key specified in its area of the master record. - - - - - Indicates that during automatic payment transactions, clearing is made with the corresponding customer account, and that during manual clearing procedures, the items of that customer account are also selected. - To use this function in automatic payment transactions, you have toenter the customer account number in the vendor master record,enter the vendor account number in the customer master record, andselect the "Clearing with vendor" indicator in the customer master record.If this indicator is set, items belonging to the customer account will be included in any dunning run. - - - - - Indicates that payment transactions and dunning notices are created for the branch. - Normally automatic payment transactions and dunning notices are created for the head office.NoteSelect this indicator only if this account is a head office account. - - - - - If this indicator is set, every customer/vendor open item is paid separately during automatic payment transactions. This means that open items are not grouped together for payment. - - - - - - This indicator specifies that the customer/vendor should be sent all payment advice information by EDI. - - - - - - All bank data is determined using this key. - - - - - - Number of days which usually pass until the vendor has cashed your check. - During automatic payment transactions, the system calculates the value date for check payments using this information and stores the date in the line item. The date is calculated as follows:Value date = posting date + check cashing timeIn Cash Management, the value date is used as information about the expected cash outflow. - - - - - Currency key for amounts in the system. - - - - - - Maximum amount which may be issued on a bill of exchange if it is to be used in payment transactions with the business partner. - The amount limit is taken into consideration in automatic payment transactions for payments by bill of exchange and bill of exchange payment requests. Several bill of exchange forms are created if the amount to be settled is higher than the maximum amount given here. Each of these bills of exchange is issued for the maximum amount or for a smaller amount.Amount limits for bills of exchange are used in Spain, for example. - - - - - This field contains the account number the company is listed under at the vendor. - - - - - - The reconciliation account in G/L accounting is the account which is updated parallel to the subledger account for normal postings (for example, invoice or payment). - For special postings (for example, down payment or bill of exchange), this account is replaced by another account (for example, 'down payments received' instead of 'receivables').The replacement takes place due to the special G/L indicator which you must specify for these types of postings. - - - - - Enter an interest calculation indicator here if the account is to be included in automatic interest calculation. - - - - - - The date in this field displays the last time the interest calculation program processed this account. This is generally the upper limit of the last interest run. - Generally, this date is automatically maintained by the program (batch input). A manual entry in this field should only be made if an error has occurred or when implementing the interest calculation. - - - - - This field contains the account number of the master record for the head office account. - You specify this account number only for branch accounts. Items that you post using the branch account number are automatically posted to the head office account. The system records the branch account number in the line items.Neither transactions nor balances are kept in the branch account. - - - - - The account number of the vendor with whom automatic payment transactions are to be carried out. - The field is only needed if payments are not to be made directly to the vendor to whom the payable is owed. The same applies to bank collections of receivables.The specification in this field applies only to the company code. There is a further field in which you can enter an alternative payee for each company code. If both fields are filled, the company code specified has priority. - - - - - Indicates the layout rule for the Allocation field in the document line item. - The system uses a standard sort sequence for displaying line items. Among other things, it sorts the items according to the content of the Allocation field. This field can be filled either manually or automatically (by the system) when a document line item is entered.For this purpose, the system requires rules that determine which information is to be taken from the document header or from the document line item and placed in the field. The rules can be stored in the master record of an account which enables you to determine the standard sort sequence on an account-specific basis.NoteField information from another document line item cannot be adopted into the field of a particular item. - - - - - Contains settings that control how the system handles differences between the invoice amount and the amount received from a customer or the amount paid to a supplier. A tolerance group is unique within a company code. - - - - - - US government requirement. - Date field in which to enter certification date for small companies run by women or minorities. This certificate must be renewed every two years. - - - - - Internal memo of the accounting department. - The memo serves only as information on special features of the customer/vendor. - - - - - In some countries, an additional country is needed for calculating or reporting withholding tax. - The calculation can depend on the payee's country.A particular country key can be required by law for reporting which may possibly be different to the key used in the address.Examples: Japan, USA (1042), Argentina - - - - - Indicates that the company code data in this master record is to be deleted. - To delete this data, you have to run the archiving program for Accounts Receivable or Payable. This program will archive all master records marked for deletion provided that there is no dependent data in them.This deletion flag cannot be used in the program that deletes master data. You should, however, run this program only to delete test data prior to production startup. - - - - - In cash management, customers and vendors are allocated to planning groups by means of an entry made in the master record. - You can define these planning groups in Customizing or the Implementation Guide (you will need to ensure that they are all the same length). In order to improve the liquidity forecast display for major customers and vendors, it can be advisable to enter their account number as the planning group.For the planning groups themselves a naming convention should be set up to improve liquidity forecasting. In the following examples, the customer planning groups begin with an "R" for receipts, and the vendor planning groups begin with an "E" for expenses.R1 Customers paying by bank collectionR2 Other domestic customersR3 Customers abroadR4 Affiliated company customersR5 High risk customersR6 Major customersR7 Rental incomeR8 Repayment of loans...E1 Domestic vendorsE2 Vendors abroadE3 Affiliated company vendorsE4 Major vendorsE5 Personnel costsE6 TaxesE7 Investments... - - - - - When incoming invoices are entered or when memos are entered in Financial Accounting (FI), the system checks whether an invoice or credit memo has already been entered for the same date. - Checking Logistics DocumentsThe system checks whether the invoice documents have already been entered in the Logistics invoice verification. For this, the system checks invoices that have been held or parked or that contain errors, or invoices that were entered for invoice verification in the background. The check is performed only if you specify the reference document number when you enter the invoices.When checking for duplicate invoices, the system compares the following specified characteristics:VendorCurrencyCompany CodeGross Invoice AmountReference Document NumberInvoice Document DateIf all of these characteristics are the same, the system issues a message for which you can change the message type in Customizing.When you enter credit memos or subsequent adjustments, the system does not check for duplicate invoices.Exception: The exception is the Argentina country version, where the system checks for duplicate invoices and credit memos.No message is issued if you enter a document that has previously been reversed.In Customizing for Logistics Invoice Verification under Incoming Invoice -> Set Check for Duplicate Invoices, you can specify that the following characteristics are not checked:Reference Document NumberInvoice Document DateCompany CodeHaving fewer attributes to check increases the likelihood that the system will find a duplicate invoice.Example:The following document has already been entered and posted:Reference Document Number 333Invoice Date: 4/28/2000Gross Invoice Amount 100.00Currency: EURVendor: SpencerCompany Code: ChicagoYou have set up the check for duplicate invoices as follows in Customizing:The characteristics Reference Document Number and Company Code are not activated. Consequently, these characteristics are not checked.Now you enter the following invoice:Reference Document Number 334Invoice Date: 4/28/2000Gross Invoice Amount 100.00Currency: EURVendor: SpencerCompany Code: FlagstaffResultBecause you entered a reference document when you entered the invoice, the system checks for duplicate invoices. Compared against the invoice entered earlier, the invoice just entered has different values in the characteristics Reference and Company Code. However, these characteristics are not checked due to the settings that you have made in Customizing. All other characteristics are the same. The system issues a message telling you that an invoice has been entered twice.If the characteristic "Reference Document Number" had been selected in Customizing, the system would have checked the reference document number and established that it was different from the invoice entered earlier, and it consequently would not have issued a message.Checking FI DocumentsThe system checks whether there are FI documents that were posted or parked with the Logistics invoice verification or with an FI invoice transaction. Depending on the entry in the Reference field, one of the following checks is performed:If a reference number was specified in the sequential invoice/credit memo, the system checks whether an invoice/credit memo has already been posted for which all the following attributes agree:Company CodeVendorCurrencyDocument DateReference NumberIf no reference number was specified in the sequential invoice/credit memo, the system checks whether an invoice/credit memo has already been posted for which all the following attributes agree:Company CodeVendorCurrencyDocument DateAmount in Document CurrencyIn Materials Management, the system applies the check for duplicate invoices for invoices only, not for credit memos. - - - - - - The account group is a classifying feature within vendor master records. The account group determines: - the number interval for the account number of the vendor,whether the number is assigned by the user or by the system,which specifications are necessary and/or possible in the master record. - - - - - - - - - - - - - - Specifies an alphanumeric key that uniquely identifies the supplier in the SAP system. - - - - - - The company code is an organizational unit within financial accounting. - - - - - - The dunning area represents an organizational entity that is responsible for dunning. The dunning areas represent a sub-structure of the company codes. - If different responsibilities or different dunning procedures exist within a company code, you can set up corresponding dunning areas.All dunning notices are made separately according to dunning areas, and if necessary with different dunning procedures.The dunning area must be noted in the line items. As long as documents are copied from preliminary work areas (billing documents), the dunning area can be derived from details such as division or sales area, if necessary. - - - - - Key which reflects the reason for a dunning block indicator. - - - - - - Number that specifies how often an item or account has been dunned. - The business partner has received the dunning level from the last dunning run.If you use dunning areas, it is the dunning level that the business partner received from the last dunning run in the dunning area assigned.The dunning program sets the dunning level automatically when the customer or vendor receives a dunning notice. - - - - - This field contains the key for the dunning procedure to be used. - - - - - - Account number of the vendor who is to receive the dunning notice. - Note:If an entry is not made in this field, the dunning notice is sent to the address of the vendor to be processed. - - - - - Date on which the last dunning notice was made. - - - - - - Date on which a legal dunning procedure was initiated. - The printing of dunning notices in the legal dunning procedure generates an internal notice about any further account movements. A dunning notice is not created for the customer.If the Legal dunning procedure field in the master record contains a date, this means that the account is involved in a legal dunning procedure. The relationship between this date and the dunning date does not affect how the account is processed.The printing of account movements in the legal dunning procedure differs from the normal printing of dunning notices as follows:You must specify a separate form for your dunning procedure in Customizing. For more information, see Customizing (IMG) under Dunning Forms.The dunning program also displays text element 520 "Legal dunning procedure". This makes it possible to display the date of the legal dunning procedure from the master record.The program also displays the documents blocked for dunning and those with a payment method (automatic debit, bank direct debit).Although dunning notices are printed, the dunning level does not change in the master record or in the items. New dunning level = old dunning level.The program only updates the date of the last dunning run.Enter the date manually. - - - - - Identification code for the accounting clerk dealing with dunning letters. - Using this identification code, the accounting clerk whose name is printed on the dunning letters is determined.If this field is not filled, then the entry from the Accounting clerk field is used. - - - - - The authorization group allows extended authorization protection for particular objects. The authorization groups are freely definable. The authorization groups usually occur in authorization objects together with an activity. - - - - - - The account group is a classifying feature within vendor master records. The account group determines: - the number interval for the account number of the vendor,whether the number is assigned by the user or by the system,which specifications are necessary and/or possible in the master record. - - - - - - - - - - - - - - - Specifies an alphanumeric key that uniquely identifies the supplier in the SAP system. - - - - - - Denotes the purchasing organization. - - - - - - Subdivision of a supplier's overall product range according to various criteria. - For each supplier sub-range:The master data is kept on a common basisCertain conditions applyIn the supplier master, you can create different purchasing data and different partner functions for each supplier sub-range.You can also maintain and change the conditions for each supplier sub-range. You assign a material to a supplier sub-range in the info record.In the supplier master, you can maintain different data for particular supplier sub-ranges, such as ordering addresses or terms of payment, for example.When creating a purchase order with a known supplier, different data is only determined if the supplier sub-range is entered in the initial screen.Your supplier Smith in Houston has two sub-ranges: paint and glue.All materials from the "paint" sub-range are ordered in Houston.You have maintained an alternative ordering address in Detroit for the "glue" sub-range.If you order materials from the "glue" sub-range, the supplier sub-range finds the Detroit ordering address. - - - - - Key uniquely identifying a plant. - - - - - - The abbreviated form of the name that identifies the partner function. - - - - - - The sequential number that the system applies when there is more than one partner for a particular partner function. - When you create a sales order for a particular customer, there may be more than one ship-to party defined. The different ship-to parties are numbered sequentially. - - - - - Specifies a partner as the default for a particular partner function. - When you enter more than one partner for a particular partner function (for example, you define three different ship-to parties), you can select one partner as the default. During sales or purchasing processing, if you have defined multiple partners for a partner function, the system prompts you to choose just one partner. The system presents the default partner as the first choice in the pop-up window. - - - - - - - - The authorization group allows extended authorization protection for particular objects. The authorization groups are freely definable. The authorization groups usually occur in authorization objects together with an activity. - - - - - - - - - - - - Alphanumeric key uniquely identifying the document. - With the supplier number, information from the supplier master record (such as the supplier's address and bank details) is copied into a purchasing document (such as a request for quotation or a purchase order).You can use the supplier number to keep track of requests for quotation, purchase orders and outline agreements. - - - - - Denotes the purchasing organization. - - - - - - Determines which calculation schema (pricing procedure) is to be used in purchasing documents containing this supplier number. - You can use the schema group to specify the calculation schema per purchasing organization or supplier. The relevant calculation schema is determined by reference to the schema group.The effect of this is that the conditions to be maintained in a purchasing document can differ depending on the relevant purchasing organization or supplier.If a calculation schema is only to be valid for certain purchasing organizations or suppliers, proceed as follows:Define the schema group for the purchasing organization or the supplier using the relevant function in the menu "Calculation schema -> Schema groups".Assign the schema group to the calculation schema via "Calculation schema -> Determine schema".Enter the schema group for the supplier in the supplier master records to which the calculation schema is to be assigned. Assign the schema group of the purchasing organization to the relevant purchasing organization using "Calculation schema -> Schema group -> Assign to purch. org.". - - - - - Indicates whether or not the supplier master record is earmarked for deletion. - - - - - - Commonly used trading terms that comply with the standards established by the International Chamber of Commerce (ICC). - Incoterms specify internationally recognized procedures that the shipper and the receiving party must follow for the shipping transaction to be completed successfully.If goods are shipped through a port of departure, the appropriate Incoterm might be: FOB ("Free On Board"). You can provide further details (for example, the name of the port) in the secondary Incoterm field: FOB Boston, for example. - - - - - Additional information for the primary Incoterm. - If the primary Incoterm is, for example, FOB ("Free on Board"), then the second field provides details of the port from which the delivery leaves (for example, "FOB Boston"). - - - - - An incoterms version is an edition containing a list of international terms for transportation that is defined by the International Chamber of Commerce (ICC). - - - - - - Provides additional information for the primary Incoterm. For Incoterms 2010, this field represents: - 1. For sea and inland waterway transport - Port of Shipment2. For any mode of transport - Place of Delivery 2010Incoterms are divided as follows:Group 1: Rules for any mode or modes of transport (including by vessel)Incoterms Incoterms Description Location 1 EXW Ex Works Place of DeliveryFCA Free Carrier Place of DeliveryCPT Carriage Paid To Place of DestinationCIP Carriage & Insurance Paid To Place of DestinationDAF Delivered at Frontier Place of DeliveryDDP Delivered Duty Paid Place of DestinationDDU Delivered Duty Unpaid Place of DestinationGroup 2: Rules for sea and inland waterwaysIncoterms Incoterms Description Location 1 FAS Free Alongside Ship Port of ShipmentFOB Free On Board Port of ShipmentCFR Cost & Freight Port of DestinationCIF Cost Insurance & Freight Port of DestinationDEQ Delivered Eq Quay (Duty Paid) Port of DestinationDES Delivered Ex Ship Port of DestinationIf the primary incoterm is specified as FOB “Free on Board”, the second field provides details of the port from which the delivery leaves, such as FOB Boston. - - - - - Provides additional information for the Incoterms. This field is only available for C-Clauses (if customized appropriately). Note the following for the incoterms versions below: - No Version:This field is disabledIncoterm Version 2000This field is disabled as part of standard delivery unless a customer decides to enable it by the way of Customizing for Sales and Distribution under Master Data -> Business Partners -> Customers -> Billing Document -> Incoterms -> Map Incoterms to Versions.Incoterm Version 2010For this version, the field represents:Sea and inland waterway transport - Port of DestinationAny mode of transport - Place of Destination2010 Incoterms are divided as follows:Group 1: Rules for any mode or modes of transport (including by vessel)Incoterms Incoterms Description Location 2CPT Carriage Paid To Place of DestinationCIP Carriage & Insurance Paid To Place of DestinationGroup 2: Rules for sea and inland waterwaysIncoterms Incoterms Description Location 2CFR Cost & Freight Port of DestinationCIF Cost Insurance & Freight Port of Destination - - - - - Indicator specifying that provision has been made for goods-receipt-based invoice verification for a purchase order item or invoice item. - - - - - - Number of calendar days needed to obtain the material or service if it is procured externally. - If you have different vendors for a material, you must specify an average value. The same applies if you order the material from a fixed vendor that has varying delivery times.If you use the SAP Retail System, the planned delivery time can be suggested from the vendor sub-range in the vendor master record. - - - - - Minimum value specified for purchase orders issued to the relevant supplier. - - - - - - Key for defining payment terms composed of cash discount percentages and payment periods. - It is used in sales orders, purchase orders, and invoices. Terms of payment provide information for:Cash managementDunning proceduresPayment transactionsData can be entered in the field for the terms of payment key in various ways as you enter a business transaction:In most business transactions, the system defaults the key specified in the master record of the customer/vendor in question.In some transactions (for example, credit memos), however, the system does not default the key from the master record. Despite this, you can use the key from the customer/vendor master record by entering "*" in the field.Regardless of whether or not a key is defaulted from the master record, you can manually enter a key during document entry at:item level in sales ordersheader level in purchase orders and invoicesMaster records have separate areas for Financial Accounting, Sales, and Purchasing. You can specify different terms of payment keys in each of these areas. When you then enter a business transaction, the application in question will use the key specified in its area of the master record. - - - - - Determines which date is to be used for price determination (pricing) purposes. - Enter the key for the desired date.If you choose the date of goods receipt, for example, a new price will be determined upon the arrival of the goods, causing the item to be revaluated at this time.NoteIf you have chosen the delivery date as the date for price determination and an item contains several delivery dates (i.e. has a delivery schedule), the first delivery date (the delivery date specified in the first schedule line) is taken. - - - - - Allows you to automatically generate purchase orders from purchase requisitions if the requisition has been assigned to a supplier (source of supply). - If you want to use automatic conversion, note the following additional conditions:In the case of purchase requisitions for materials, you should also select the indicator Autom.purch.ord. in the Purchasing view in the material master record.In the case of purchase requisitions for services, you should also select the indicator Automatic creation of POs for service PReqs in Customizing for Services by choosing:IMG -> MM -> External Services Management -> Source Determination and Default Values- for Client or- for Purchasing Organization - - - - - Key for the currency on which an order placed with a supplier is based. - - - - - - Key for a buyer or a group of buyers, who is/are responsible for certain purchasing activities. - Internally, the purchasing group is responsible for the procurement of a material or a class of materials.Externally, it is the medium through which contacts with the vendor are maintained. - - - - - Indicates whether or not the supplier master record is blocked for the purchasing organization for posting purposes. - - - - - - General shipping strategy for the delivery of goods from the vendor to the customer. - You can define shipping conditions in your system which correspond to the requirements of your company. You can specify a shipping condition in the customer master and in the vendor master.Shipping point determination (outbound delivery):The loading group, the plant and the shipping condition determine the shipping point that will be proposed by the system.Route determination (outbound delivery):Apart from the country and the geographical region of the shipping point, the ship-to party and the transportation group, the shipping condition determines the route that the system proposes in the order for the delivery of the goods. In the delivery, the route proposal also takes the weight group into account.A particular customer always requires immediate delivery. You enter the appropriate shipping condition into the customer master record. This means that when you process orders for this customer, the system automatically proposes the express mail room as a shipping point and the quickest way to the airport as a route.If a shipping condition has been assigned to a sales document type in Customizing, this condition will be proposed by the system in the corresponding sales document. If there is no assignment, the system copies the relevant data from the corresponding customer master record of the sold-to party. You cannot change this value during delivery processing. The shipping condition will not be copied from the delivery into the shipment. The shipping condition is one of several criteria for selecting deliveries when you create a shipment. You can enter a shipping condition manually in the shipment where it only serves as a characteristic for grouping shipments. - - - - - Means of classifying suppliers according to their significance to your company. - The indicator serves to assign the supplier to one of the categories A, B or C, in accordance with ABC analysis.'A' category suppliers, for instance, are those accounting for the greatest share of the company's total annual spend (in value terms). - - - - - This telephone number is maintained in the supplier master record and adopted in the purchasing document. - - - - - - - The authorization group allows extended authorization protection for particular objects. The authorization groups are freely definable. The authorization groups usually occur in authorization objects together with an activity. - - - - - - The account group is a classifying feature within vendor master records. The account group determines: - the number interval for the account number of the vendor,whether the number is assigned by the user or by the system,which specifications are necessary and/or possible in the master record. - - - - - - - - - - - - - Specifies an alphanumeric key that uniquely identifies the supplier in the SAP system. - - - - - - The company code is an organizational unit within financial accounting. - - - - - - This indicator is used to classify the different types of withholding tax. - Withholding tax types classify particular features of a withholding tax including:The time at which the withholding tax is postedThe basis on which the base amount is calculatedThe basis for accumulation (if applicable)Withholding tax types are to be distinguished from withholding tax codes, to which are allocated the withholding tax percentage rate example.Whether a withholding tax can be defined as an existing type by means of a new code, or if a new type needs to be defined will depend on the type of transaction (see below).Note that a business transaction can only be assigned one withholding tax code per withholding tax type. If the business transaction is subject to several withholding taxes simultaneously, these must be represented by different types.This is the case in Argentina for example, where up to four kinds of withholding tax per business transaction are possible. - - - - - Date from which withholding tax exemption applies. - - - - - - Date on which withholding tax exemption expires. - - - - - - Indicator used to classify different types of exemption from liability to a particular withholding tax. - These indicators can be defined per withholding tax type in the vendor master record. - - - - - - The type of recipient can be defined in the vendor master record. - It is used to group vendors together according to particular characteristics such as occupations that may be subject to the same withholding tax type, but which are required to pay different percentage rates (as defined by the withholding tax code).Application in ThailandThis corresponds to the official Thai form number (Phaw.Ngor.Daw) and is used to determine the sequential numbering of a withholding tax certificate. The form number is defined in the vendor master record. - - - - - Numbered assigned by the relevant authorities for exemption from withholding tax. - This number must be entered in the system as follows:In the vendor master record in the case of vendorsFor customers, in Customizing under the settings for withholding tax information for the company code per withholding tax type. - - - - - One or more "withholding tax codes" are assigned to each withholding tax type. One of the things these codes determine is the various percentage rates for the withholding tax type. - Note that when processing a business transaction, no more than one withholding tax code can be assigned per withholding tax type. If the business transaction is subject to more than one withholding taxes, these must be represented in the system by defining various withholding tax types. - - - - - Rate of exemption from withholding tax. - Those persons/activities subject to withholding tax can be exempted from withholding tax up to the percentage rate you enter here. This exemption rate refers to the withholding tax amount itself and not to the whole amount liable to withholding tax (withholding tax base amount).The gross amount of an invoice is 100.00 and the withholding tax base amount is defined as gross. The withholding tax rate is 10% meaning that the withholding tax amount is 10.00. Given an exemption rate of 30%, the withholding tax amount is reduced to 7.00. - - - - - This is a number issued by the tax authorities per withholding tax type. - This number must be specified in Customizing either:(a) As part of the withholding tax information defined for the company code, or(b) As part of the withholding tax information defined in the customer or vendor master record. - - - - - The authorization group allows extended authorization protection for particular objects. The authorization groups are freely definable. The authorization groups usually occur in authorization objects together with an activity. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - aggregate - groupby - filter - - - - - - - - - - - diff --git a/srv/notes-mashup.cds b/srv/notes-mashup.cds deleted file mode 100644 index 71c209d6..00000000 --- a/srv/notes-mashup.cds +++ /dev/null @@ -1,32 +0,0 @@ -using { API_BUSINESS_PARTNER } from './external/API_BUSINESS_PARTNER'; - -/** - * Simplified view on external addresses, which is used as an association target in Notes. - */ -entity my.bookshop.NoteableAddresses as select from API_BUSINESS_PARTNER.A_BusinessPartnerAddress mixin { - // bi-directional association - notes : Composition of many bookshop.Notes on notes.address.businessPartner = $projection.businessPartner and notes.address.ID = $projection.ID -} into { - key AddressID as ID, - key BusinessPartner as businessPartner, - @readonly Country as country, - @readonly CityName as city, - @readonly PostalCode as postalCode, - @readonly StreetName as street, - @readonly HouseNumber as houseNumber, - notes -}; - -/** - * Extend Notes with references to external Addresses. - */ -using { my.bookshop } from '../db/index'; -extend bookshop.Notes { - address: Association to bookshop.NoteableAddresses; -} - -using { NotesService } from './notes-service'; -extend service NotesService with { - @readonly - entity Addresses as projection on bookshop.NoteableAddresses -} diff --git a/srv/notes-service.cds b/srv/notes-service.cds deleted file mode 100644 index 1a4fb617..00000000 --- a/srv/notes-service.cds +++ /dev/null @@ -1,6 +0,0 @@ -using my.bookshop from '../db/notes'; - -@path: 'notes' -service NotesService { - entity Notes as projection on bookshop.Notes; -} diff --git a/srv/pom.xml b/srv/pom.xml index 17132e65..11052bbd 100644 --- a/srv/pom.xml +++ b/srv/pom.xml @@ -22,62 +22,42 @@ cds-starter-spring-boot - - com.sap.cds - cds-adapter-api - - - - com.sap.cds - cds-adapter-odata-v4 - runtime - - com.sap.cds cds-starter-cloudfoundry runtime + + + com.sap.cds + cds-feature-hana + + + com.sap.cds + cds-feature-mt + + com.sap.cds - cds-starter-k8s - runtime + cds-adapter-api com.sap.cds - cds-feature-enterprise-messaging + cds-adapter-odata-v4 runtime - + com.sap.cds - cds-feature-remote-odata - runtime - - - - - com.sap.cloud.sdk.cloudplatform - resilience - - - - com.sap.cloud.sdk.cloudplatform - scp-cf - - - - - com.h2database - h2 + cds-feature-postgresql runtime - org.xerial - sqlite-jdbc + org.liquibase + liquibase-core runtime @@ -93,16 +73,6 @@ ${cf-java-logging-support.version} - - org.springframework.boot - spring-boot-starter-security - - - - org.springframework.boot - spring-boot-starter-actuator - - org.springframework.boot spring-boot-starter-test @@ -117,15 +87,20 @@ org.springframework.boot - spring-boot-starter-webflux - test + spring-boot-devtools + true - org.springframework.boot - spring-boot-devtools - true + spring-boot-testcontainers + test + + + + org.testcontainers + postgresql + test @@ -173,9 +148,6 @@ install-node - - ${cdsdk-global} - @@ -184,7 +156,7 @@ npm - install @sap/cds-dk@${cds.install-cdsdk.version} @sap/cds-mtxs@^1 --no-save + install @@ -196,12 +168,6 @@ build --for java - deploy --to h2 --with-mocks --dry > - ${project.basedir}/src/main/resources/schema.sql - deploy --to h2 --dry > - ${project.basedir}/src/main/resources/schema-nomocks.sql - compile srv/cat-service.cds -2 openapi --openapi:url /api/browse > - ${project.basedir}/src/main/resources/swagger/openapi.json @@ -219,14 +185,4 @@ - - - - - cdsdk-global - - true - - - diff --git a/srv/review-service.cds b/srv/review-service.cds deleted file mode 100644 index 60debda1..00000000 --- a/srv/review-service.cds +++ /dev/null @@ -1,30 +0,0 @@ -using {my.bookshop as my} from '../db/index'; - -@path : 'review' -service ReviewService { - entity Reviews as projection on my.Reviews; - - @readonly - entity Books as projection on my.Books excluding { - createdBy, - modifiedBy - } - - @readonly - entity Authors as projection on my.Authors; - - // access control restrictions - annotate Reviews with @restrict : [ - { - grant : '*', - to : 'authenticated-user', - where : 'createdBy=$user' - }, - { - grant : '*', - to : 'admin', - } - ]; -} - -annotate ReviewService.Reviews with @odata.draft.enabled; diff --git a/srv/src/main/java/my/bookshop/MessageKeys.java b/srv/src/main/java/my/bookshop/MessageKeys.java deleted file mode 100644 index 9f217eb9..00000000 --- a/srv/src/main/java/my/bookshop/MessageKeys.java +++ /dev/null @@ -1,19 +0,0 @@ -package my.bookshop; - -public class MessageKeys { - - public static final String QUANTITY_REQUIRE_MINIMUM = "quantity.require.minimum"; - public static final String BOOK_REQUIRE_STOCK = "book.require.stock"; - public static final String BOOK_ADDED_ORDER = "book.added.order"; - public static final String BOOK_MISSING = "book.missing"; - public static final String ORDERITEM_MISSING = "orderitem.missing"; - public static final String ORDER_MISSING = "order.missing"; - public static final String ORDER_INDRAFT = "order.indraft"; - public static final String BUPA_MISSING = "bupa.missing"; - - public static final String REVIEW_ADDED = "review.added"; - public static final String REVIEW_ADD_FORBIDDEN = "review.add.forbidden"; - public static final String ORDER_EXCEEDS_STOCK = "order.exceeds.stock"; - public static final String BOOK_IMPORT_FAILED = "book.import.failed"; - public static final String BOOK_IMPORT_INVALID_CSV = "book.import.invalid.csv"; -} diff --git a/srv/src/main/java/my/bookshop/RatingCalculator.java b/srv/src/main/java/my/bookshop/RatingCalculator.java deleted file mode 100644 index 3acee017..00000000 --- a/srv/src/main/java/my/bookshop/RatingCalculator.java +++ /dev/null @@ -1,63 +0,0 @@ -package my.bookshop; - -import java.math.BigDecimal; -import java.math.RoundingMode; -import java.util.OptionalDouble; -import java.util.stream.Stream; - -import org.springframework.stereotype.Component; - -import com.sap.cds.Result; -import com.sap.cds.ql.Select; -import com.sap.cds.ql.Update; -import com.sap.cds.services.persistence.PersistenceService; - -import cds.gen.my.bookshop.Books; -import cds.gen.my.bookshop.Bookshop_; -import cds.gen.my.bookshop.Reviews; - -/** - * Takes care of calculating the average rating of a book based on its review - * ratings. - */ -@Component -public class RatingCalculator { - - private PersistenceService db; - - RatingCalculator(PersistenceService db) { - this.db = db; - } - - /** - * Initializes the ratings for all existing books based on their reviews. - */ - public void initBookRatings() { - Result result = db.run(Select.from(Bookshop_.BOOKS).columns(b -> b.ID())); - for (Books book : result.listOf(Books.class)) { - setBookRating(book.getId()); - } - } - - /** - * Sets the average rating for the given book. - * - * @param bookId - */ - public void setBookRating(String bookId) { - Result run = db.run(Select.from(Bookshop_.BOOKS, b -> b.filter(b.ID().eq(bookId)).reviews())); - - Stream ratings = run.streamOf(Reviews.class).map(r -> r.getRating().doubleValue()); - BigDecimal rating = getAvgRating(ratings); - - db.run(Update.entity(Bookshop_.BOOKS).byId(bookId).data(Books.RATING, rating)); - } - - static BigDecimal getAvgRating(Stream ratings) { - OptionalDouble avg = ratings.mapToDouble(Double::doubleValue).average(); - if (!avg.isPresent()) { - return BigDecimal.ZERO; - } - return BigDecimal.valueOf(avg.getAsDouble()).setScale(1, RoundingMode.HALF_UP); - } -} diff --git a/srv/src/main/java/my/bookshop/config/CustomFeatureToggleProvider.java b/srv/src/main/java/my/bookshop/config/CustomFeatureToggleProvider.java deleted file mode 100644 index af294e38..00000000 --- a/srv/src/main/java/my/bookshop/config/CustomFeatureToggleProvider.java +++ /dev/null @@ -1,25 +0,0 @@ -package my.bookshop.config; - -import java.util.HashMap; -import java.util.Map; - -import org.springframework.context.annotation.Profile; -import org.springframework.stereotype.Component; - -import com.sap.cds.services.request.FeatureTogglesInfo; -import com.sap.cds.services.request.ParameterInfo; -import com.sap.cds.services.request.UserInfo; -import com.sap.cds.services.runtime.FeatureTogglesInfoProvider; - -@Component -@Profile("cloud") // locally, feature toggles are configured directly with mock users -public class CustomFeatureToggleProvider implements FeatureTogglesInfoProvider { - - @Override - public FeatureTogglesInfo get(UserInfo userInfo, ParameterInfo parameterInfo) { - Map toggles = new HashMap<>(); - toggles.put("isbn", userInfo.hasRole("expert")); - toggles.put("discount", userInfo.hasRole("premium-customer")); - return FeatureTogglesInfo.create(toggles); - } -} diff --git a/srv/src/main/java/my/bookshop/config/DestinationConfiguration.java b/srv/src/main/java/my/bookshop/config/DestinationConfiguration.java deleted file mode 100644 index 94f796a4..00000000 --- a/srv/src/main/java/my/bookshop/config/DestinationConfiguration.java +++ /dev/null @@ -1,37 +0,0 @@ -package my.bookshop.config; - -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.context.event.ApplicationReadyEvent; -import org.springframework.context.annotation.Profile; -import org.springframework.context.event.EventListener; -import org.springframework.core.env.Environment; -import org.springframework.stereotype.Component; - -import com.sap.cloud.sdk.cloudplatform.connectivity.DefaultDestinationLoader; -import com.sap.cloud.sdk.cloudplatform.connectivity.DefaultHttpDestination; -import com.sap.cloud.sdk.cloudplatform.connectivity.DestinationAccessor; -import com.sap.cloud.sdk.cloudplatform.security.BasicCredentials; - -@Component -@Profile("mocked") -public class DestinationConfiguration { - - @Autowired - private Environment environment; - - @EventListener - void applicationReady(ApplicationReadyEvent ready) { - Integer port = environment.getProperty("local.server.port", Integer.class); - String destinationName = environment.getProperty("cds.remote.services.'[API_BUSINESS_PARTNER]'.destination.name"); - if(port != null && destinationName != null) { - DefaultHttpDestination httpDestination = DefaultHttpDestination - .builder("http://localhost:" + port) - .basicCredentials(new BasicCredentials("authenticated", "")) - .name(destinationName).build(); - - DestinationAccessor.prependDestinationLoader( - new DefaultDestinationLoader().registerDestination(httpDestination)); - } - } - -} diff --git a/srv/src/main/java/my/bookshop/config/SwaggerResourceConfig.java b/srv/src/main/java/my/bookshop/config/SwaggerResourceConfig.java deleted file mode 100644 index af8b24b2..00000000 --- a/srv/src/main/java/my/bookshop/config/SwaggerResourceConfig.java +++ /dev/null @@ -1,14 +0,0 @@ -package my.bookshop.config; - -import org.springframework.context.annotation.Configuration; -import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry; -import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; - -@Configuration -public class SwaggerResourceConfig implements WebMvcConfigurer { - - @Override - public void addResourceHandlers(ResourceHandlerRegistry registry) { - registry.addResourceHandler("/swagger/**").addResourceLocations("classpath:/swagger/"); - } -} diff --git a/srv/src/main/java/my/bookshop/config/WebSecurityConfig.java b/srv/src/main/java/my/bookshop/config/WebSecurityConfig.java deleted file mode 100644 index 346a784f..00000000 --- a/srv/src/main/java/my/bookshop/config/WebSecurityConfig.java +++ /dev/null @@ -1,25 +0,0 @@ -package my.bookshop.config; - -import static org.springframework.security.web.util.matcher.AntPathRequestMatcher.antMatcher; - -import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; -import org.springframework.core.annotation.Order; -import org.springframework.security.config.annotation.web.builders.HttpSecurity; -import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; -import org.springframework.security.web.SecurityFilterChain; - -@Configuration -@ConditionalOnWebApplication -@EnableWebSecurity -@Order(1) -public class WebSecurityConfig { - - @Bean - public SecurityFilterChain configure(HttpSecurity http) throws Exception { - return http.securityMatchers(s -> s.requestMatchers(antMatcher("/actuator/health"), antMatcher("/swagger/**"))) // - .csrf(c -> c.disable()).authorizeHttpRequests(a -> a.anyRequest().permitAll()) - .build(); - } -} diff --git a/srv/src/main/java/my/bookshop/handlers/AdminServiceAddressHandler.java b/srv/src/main/java/my/bookshop/handlers/AdminServiceAddressHandler.java deleted file mode 100644 index 12573db0..00000000 --- a/srv/src/main/java/my/bookshop/handlers/AdminServiceAddressHandler.java +++ /dev/null @@ -1,153 +0,0 @@ -package my.bookshop.handlers; - -import static cds.gen.adminservice.AdminService_.ADDRESSES; - -import java.time.Duration; -import java.util.Optional; -import java.util.stream.Stream; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Qualifier; -import org.springframework.stereotype.Component; - -import com.sap.cds.Result; -import com.sap.cds.ql.CQL; -import com.sap.cds.ql.Insert; -import com.sap.cds.ql.Predicate; -import com.sap.cds.ql.Select; -import com.sap.cds.ql.Upsert; -import com.sap.cds.ql.cqn.CqnSelect; -import com.sap.cds.ql.cqn.Modifier; -import com.sap.cds.services.ErrorStatuses; -import com.sap.cds.services.EventContext; -import com.sap.cds.services.ServiceException; -import com.sap.cds.services.cds.CdsReadEventContext; -import com.sap.cds.services.cds.CqnService; -import com.sap.cds.services.draft.DraftService; -import com.sap.cds.services.handler.EventHandler; -import com.sap.cds.services.handler.annotations.Before; -import com.sap.cds.services.handler.annotations.On; -import com.sap.cds.services.handler.annotations.ServiceName; -import com.sap.cds.services.persistence.PersistenceService; -import com.sap.cloud.sdk.cloudplatform.resilience.ResilienceConfiguration; -import com.sap.cloud.sdk.cloudplatform.resilience.ResilienceConfiguration.TimeLimiterConfiguration; -import com.sap.cloud.sdk.cloudplatform.resilience.ResilienceDecorator; - -import cds.gen.adminservice.Addresses; -import cds.gen.adminservice.Addresses_; -import cds.gen.adminservice.AdminService_; -import cds.gen.adminservice.Orders; -import cds.gen.api_business_partner.ApiBusinessPartner_; -import cds.gen.api_business_partner.BusinessPartnerChangedContext; -import my.bookshop.MessageKeys; - -/** - * Custom handler for the Admin Service Addresses, which come from a remote S/4 System - */ -@Component -@ServiceName(AdminService_.CDS_NAME) -public class AdminServiceAddressHandler implements EventHandler { - - private final static Logger logger = LoggerFactory.getLogger(AdminServiceAddressHandler.class); - - // We are mashing up the AdminService with two other services... - private final PersistenceService db; - private final CqnService bupa; - - AdminServiceAddressHandler(PersistenceService db, @Qualifier(ApiBusinessPartner_.CDS_NAME) CqnService bupa) { - this.db = db; - this.bupa = bupa; - } - - // Delegate ValueHelp requests to S/4 backend, fetching current user's addresses from there - @On(entity = Addresses_.CDS_NAME) - public void readAddresses(CdsReadEventContext context) { - if(context.getCqn().ref().segments().size() != 1) { - return; // no value help request - } - - // add BusinessPartner where condition - String businessPartner = context.getUserInfo().getAttributeValues("businessPartner").stream().findFirst() - .orElseThrow(() -> new ServiceException(ErrorStatuses.FORBIDDEN, MessageKeys.BUPA_MISSING)); - - CqnSelect select = CQL.copy(context.getCqn(), new Modifier() { - - public Predicate where(Predicate original) { - Predicate where = CQL.get(Addresses.BUSINESS_PARTNER).eq(businessPartner); - if(original != null) { - where = original.and(where); - } - return where; - } - - }); - - // using Cloud SDK resilience capabilities.. - ResilienceConfiguration config = ResilienceConfiguration.of(AdminServiceAddressHandler.class) - .timeLimiterConfiguration(TimeLimiterConfiguration.of(Duration.ofSeconds(10))); - - context.setResult(ResilienceDecorator.executeSupplier(() -> { - // ..to access the S/4 system in a resilient way.. - logger.info("Delegating GET Addresses to S/4 service"); - return bupa.run(select); - }, config, (t) -> { - // ..falling back to the already replicated addresses in our own database - logger.warn("Falling back to already replicated Addresses"); - return db.run(select); - })); - } - - // Replicate chosen addresses from S/4 when filling orders - @Before(event = { CqnService.EVENT_CREATE, CqnService.EVENT_UPDATE, DraftService.EVENT_DRAFT_PATCH }) - public void patchAddressId(EventContext context, Stream orders) { - String businessPartner = context.getUserInfo().getAttributeValues("businessPartner").stream().findFirst() - .orElseThrow(() -> new ServiceException(ErrorStatuses.FORBIDDEN, MessageKeys.BUPA_MISSING)); - - orders.filter(o -> o.getShippingAddressId() != null).forEach(order -> { - String addressId = order.getShippingAddressId(); - Result replica = db.run(Select.from(ADDRESSES).where(a -> a.businessPartner().eq(businessPartner).and(a.ID().eq(addressId)))); - // check if the address was not yet replicated - if(replica.rowCount() < 1) { - logger.info("Replicating Address '{}' from S/4 service", addressId); - Addresses remoteAddress = bupa.run(Select.from(ADDRESSES) - .where(a -> a.businessPartner().eq(businessPartner).and(a.ID().eq(addressId)))) - .single(Addresses.class); - - remoteAddress.setTombstone(false); - db.run(Insert.into(ADDRESSES).entry(remoteAddress)); - } - order.setShippingAddressBusinessPartner(businessPartner); - }); - } - - @On(service = ApiBusinessPartner_.CDS_NAME) - public void updateBusinessPartnerAddresses(BusinessPartnerChangedContext context) { - logger.info(">> received: " + context.getData()); - String businessPartner = context.getData().getBusinessPartner(); - - // fetch affected entries from local replicas - Result replicas = db.run(Select.from(ADDRESSES).where(a -> a.businessPartner().eq(businessPartner))); - if(replicas.rowCount() > 0) { - logger.info("Updating Addresses for BusinessPartner '{}'", businessPartner); - // fetch changed data from S/4 -> might be less than local due to deletes - Result remoteAddresses = bupa.run(Select.from(ADDRESSES).where(a -> a.businessPartner().eq(businessPartner))); - // update replicas or add tombstone if external address was deleted - replicas.streamOf(Addresses.class).forEach(rep -> { - Optional matching = remoteAddresses - .streamOf(Addresses.class) - .filter(ext -> ext.getId().equals(rep.getId())) - .findFirst(); - - if(!matching.isPresent()) { - rep.setTombstone(true); - } else { - matching.get().forEach(rep::put); - } - }); - // update local replicas with changes from S/4 - db.run(Upsert.into(ADDRESSES).entries(replicas)); - } - } - -} diff --git a/srv/src/main/java/my/bookshop/handlers/AdminServiceAuditHandler.java b/srv/src/main/java/my/bookshop/handlers/AdminServiceAuditHandler.java deleted file mode 100644 index aeb63e49..00000000 --- a/srv/src/main/java/my/bookshop/handlers/AdminServiceAuditHandler.java +++ /dev/null @@ -1,145 +0,0 @@ -package my.bookshop.handlers; - -import static cds.gen.adminservice.AdminService_.ORDERS; - -import java.util.Arrays; -import java.util.Optional; -import java.util.stream.Stream; - -import org.apache.commons.lang3.StringUtils; -import org.springframework.stereotype.Component; - -import com.sap.cds.ql.Select; -import com.sap.cds.ql.cqn.CqnDelete; -import com.sap.cds.services.EventContext; -import com.sap.cds.services.auditlog.Action; -import com.sap.cds.services.auditlog.AuditLogService; -import com.sap.cds.services.auditlog.ChangedAttribute; -import com.sap.cds.services.auditlog.ConfigChange; -import com.sap.cds.services.auditlog.DataObject; -import com.sap.cds.services.auditlog.KeyValuePair; -import com.sap.cds.services.cds.CdsDeleteEventContext; -import com.sap.cds.services.cds.CqnService; -import com.sap.cds.services.handler.EventHandler; -import com.sap.cds.services.handler.annotations.Before; -import com.sap.cds.services.handler.annotations.ServiceName; -import com.sap.cds.services.persistence.PersistenceService; - -import cds.gen.adminservice.AdminService_; -import cds.gen.adminservice.Orders; -import cds.gen.adminservice.Orders_; - -/** - * A custom handler that creates AuditLog messages. - */ -@Component -@ServiceName(AdminService_.CDS_NAME) -class AdminServiceAuditHandler implements EventHandler { - - private final PersistenceService db; - - private final AuditLogService auditLog; - - AdminServiceAuditHandler(PersistenceService db, AuditLogService auditLog) { - this.db = db; - this.auditLog = auditLog; - } - - @Before(event = { CqnService.EVENT_CREATE }) - public void beforeCreateOrder(Stream orders) { - orders.forEach(order -> { - ConfigChange cfgChange = createConfigChange(order, null); - this.auditLog.logConfigChange(Action.CREATE, cfgChange); - }); - } - - @Before(event = { CqnService.EVENT_UPDATE, CqnService.EVENT_UPSERT }) - public void beforeUpdateOrUpsertOrder(EventContext context, Stream orders) { - orders.forEach(order -> { - ConfigChange cfgChange = null; - Action action = null; - Optional oldOrders = readOldOrders(order.getId()); - if (oldOrders.isPresent()) { - if (!StringUtils.equals(order.getCurrencyCode(), oldOrders.get().getCurrencyCode())) { - cfgChange = createConfigChange(order, oldOrders.get()); - action = Action.UPDATE; - } - } else { - cfgChange = createConfigChange(order, null); - action = Action.CREATE; - } - if (cfgChange != null && action != null) { - auditCfgChange(action, cfgChange, context); - } - }); - } - - @Before(event = { CqnService.EVENT_DELETE }, entity = { Orders_.CDS_NAME }) - public void beforeDelete(CdsDeleteEventContext context) { - // prepare a select statement to read old currency code - Select ordersSelect = toSelect(context.getCqn()); - - // read old order number from DB - this.db.run(ordersSelect).first(Orders.class).ifPresent(oldOrders -> { - ConfigChange cfgChange = createConfigChange(null, oldOrders); - auditCfgChange(Action.DELETE, cfgChange, context); - }); - } - - private void auditCfgChange(final Action action, final ConfigChange cfgChange, EventContext context) { - // create new request context and set tenant to null - context.getCdsRuntime().requestContext().modifyUser(user -> user.setTenant(null)).run(ctx -> { - // send audit log message into provider tenant as user's tenant is null - this.auditLog.logConfigChange(action, cfgChange); - }); - } - - private Optional readOldOrders(String ordersId) { - // prepare a select statement to read old order number - Select ordersSelect = Select.from(ORDERS).columns(Orders_::OrderNo) - .where(o -> o.ID().eq(ordersId).and(o.IsActiveEntity().eq(true))); - - // read old orders from DB - return this.db.run(ordersSelect).first(Orders.class); - } - - private static ConfigChange createConfigChange(Orders orders, Orders oldOrders) { - ChangedAttribute currencyCodeAttr = createChangedAttribute(orders != null ? orders.getCurrencyCode() : null, - oldOrders != null ? oldOrders.getCurrencyCode() : null); - - ConfigChange cfgChange = ConfigChange.create(); - cfgChange.setDataObject(createDataObject(orders != null ? orders : oldOrders)); - cfgChange.setAttributes(Arrays.asList(currencyCodeAttr)); - return cfgChange; - } - - private static DataObject createDataObject(Orders order) { - KeyValuePair id = createId(order); - - DataObject dataObject = DataObject.create(); - dataObject.setType(Orders_.CDS_NAME); - dataObject.setId(Arrays.asList(id)); - return dataObject; - } - - private static ChangedAttribute createChangedAttribute(String newValue, String oldValue) { - ChangedAttribute attribute = ChangedAttribute.create(); - attribute.setName(Orders.CURRENCY_CODE); - attribute.setOldValue(oldValue); - attribute.setNewValue(newValue); - return attribute; - } - - private static KeyValuePair createId(Orders order) { - KeyValuePair id = KeyValuePair.create(); - id.setKeyName(Orders.ID); - id.setValue(order.getId()); - return id; - } - - private static Select toSelect(CqnDelete delete) { - Select select = Select.from(delete.ref()); - delete.where().ifPresent(select::where); - return select; - } -} diff --git a/srv/src/main/java/my/bookshop/handlers/AdminServiceHandler.java b/srv/src/main/java/my/bookshop/handlers/AdminServiceHandler.java deleted file mode 100644 index 68170b7f..00000000 --- a/srv/src/main/java/my/bookshop/handlers/AdminServiceHandler.java +++ /dev/null @@ -1,320 +0,0 @@ -package my.bookshop.handlers; - -import static cds.gen.adminservice.AdminService_.ORDERS; -import static cds.gen.adminservice.AdminService_.ORDER_ITEMS; -import static cds.gen.my.bookshop.Bookshop_.BOOKS; - -import java.io.BufferedReader; -import java.io.IOException; -import java.io.InputStream; -import java.io.InputStreamReader; -import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import java.util.UUID; -import java.util.function.Supplier; -import java.util.stream.Stream; - -import org.springframework.beans.factory.annotation.Qualifier; -import org.springframework.stereotype.Component; - -import com.sap.cds.Result; -import com.sap.cds.ql.Select; -import com.sap.cds.ql.Update; -import com.sap.cds.ql.Upsert; -import com.sap.cds.ql.cqn.CqnAnalyzer; -import com.sap.cds.reflect.CdsModel; -import com.sap.cds.services.ErrorStatuses; -import com.sap.cds.services.EventContext; -import com.sap.cds.services.ServiceException; -import com.sap.cds.services.cds.CdsUpdateEventContext; -import com.sap.cds.services.cds.CqnService; -import com.sap.cds.services.draft.DraftCancelEventContext; -import com.sap.cds.services.draft.DraftPatchEventContext; -import com.sap.cds.services.draft.DraftService; -import com.sap.cds.services.handler.EventHandler; -import com.sap.cds.services.handler.annotations.Before; -import com.sap.cds.services.handler.annotations.On; -import com.sap.cds.services.handler.annotations.ServiceName; -import com.sap.cds.services.messages.Messages; -import com.sap.cds.services.persistence.PersistenceService; - -import cds.gen.adminservice.AddToOrderContext; -import cds.gen.adminservice.AdminService_; -import cds.gen.adminservice.Books; -import cds.gen.adminservice.Books_; -import cds.gen.adminservice.OrderItems; -import cds.gen.adminservice.OrderItems_; -import cds.gen.adminservice.Orders; -import cds.gen.adminservice.Upload; -import cds.gen.adminservice.Upload_; -import cds.gen.my.bookshop.Bookshop_; -import my.bookshop.MessageKeys; - -/** - * Custom business logic for the "Admin Service" (see admin-service.cds) - * - * Handles creating and editing orders. - */ -@Component -@ServiceName(AdminService_.CDS_NAME) -class AdminServiceHandler implements EventHandler { - - private final DraftService adminService; - - private final PersistenceService db; - - private final Messages messages; - - private final CqnAnalyzer analyzer; - - AdminServiceHandler(@Qualifier(AdminService_.CDS_NAME) DraftService adminService, PersistenceService db, - Messages messages, CdsModel model) { - this.adminService = adminService; - this.db = db; - this.messages = messages; - - // model is a tenant-dependant model proxy - this.analyzer = CqnAnalyzer.create(model); - } - - /** - * Validate correctness of an order before finishing the order proces: - * 1. Check Order quantity for each Item and return a message if quantity is empty or <= 0 - * 2. Check Order quantity for each Item is available, return message if the stock is too low - * - * @param orders - */ - @Before(event = { CqnService.EVENT_CREATE, CqnService.EVENT_UPSERT, CqnService.EVENT_UPDATE }) - public void beforeCreateOrder(Stream orders, EventContext context) { - orders.forEach(order -> { - // reset total - order.setTotal(BigDecimal.valueOf(0)); - if(order.getItems() != null) { - order.getItems().forEach(orderItem -> { - // validation of the Order creation request - Integer quantity = orderItem.getQuantity(); - if (quantity == null || quantity <= 0) { - // errors with localized messages from property files - // exceptions abort the request and set an error http status code - // messages in contrast allow to collect multiple errors - messages.error(MessageKeys.QUANTITY_REQUIRE_MINIMUM) - .target("in", ORDERS, o -> o.Items(i -> i.ID().eq(orderItem.getId()).and(i.IsActiveEntity().eq(orderItem.getIsActiveEntity()))).quantity()); - } - - String bookId = orderItem.getBookId(); - - if(quantity == null || quantity <= 0 || bookId == null) { - return; // follow up validations rely on these - } - - // calculate the actual quantity difference - // FIXME this should handle book changes, currently only quantity changes are handled - int diffQuantity = quantity - db.run(Select.from(Bookshop_.ORDER_ITEMS).columns(i -> i.quantity()).byId(orderItem.getId())) - .first(OrderItems.class).map(i -> i.getQuantity()).orElse(0); - - // check if enough books are available - Result result = db.run(Select.from(BOOKS).columns(b -> b.ID(), b -> b.stock(), b -> b.price()).byId(bookId)); - result.first(Books.class).ifPresent(book -> { - if (book.getStock() < diffQuantity) { - // Tip: you can have localized messages and use parameters in your messages - messages.error(MessageKeys.BOOK_REQUIRE_STOCK, book.getStock()) - .target("in", ORDERS, o -> o.Items(i -> i.ID().eq(orderItem.getId()).and(i.IsActiveEntity().eq(orderItem.getIsActiveEntity()))).quantity()); - return; // no need to update follow-up values with invalid quantity / stock - } - - // update the book with the new stock - book.setStock(book.getStock() - diffQuantity); - db.run(Update.entity(BOOKS).data(book)); - - // update the amount - BigDecimal updatedAmount = book.getPrice().multiply(BigDecimal.valueOf(quantity)); - orderItem.setAmount(updatedAmount); - - // update the total - order.setTotal(order.getTotal().add(updatedAmount)); - }); - }); - } - }); - } - - /** - * Calculate the total order value preview when editing an order item - * - * @param context - * @param orderItem - */ - @Before(event = DraftService.EVENT_DRAFT_PATCH) - public void patchOrderItems(DraftPatchEventContext context, OrderItems orderItem) { - // check if quantity or book was updated - Integer quantity = orderItem.getQuantity(); - String bookId = orderItem.getBookId(); - String orderItemId = orderItem.getId(); - BigDecimal amount = calculateAmountInDraft(orderItemId, quantity, bookId, true); - if (amount != null) { - orderItem.setAmount(amount); - } - } - - /** - * Calculate the total order value preview when deleting an order item from the order - * - * @param context - */ - @Before(event = DraftService.EVENT_DRAFT_CANCEL, entity = OrderItems_.CDS_NAME) - public void cancelOrderItems(DraftCancelEventContext context) { - String orderItemId = (String) analyzer.analyze(context.getCqn()).targetKeys().get(OrderItems.ID); - if(orderItemId != null) { - calculateAmountInDraft(orderItemId, 0, null, false); - } - } - - private BigDecimal calculateAmountInDraft(String orderItemId, Integer newQuantity, String newBookId, boolean includeWarnings) { - Integer quantity = newQuantity; - String bookId = newBookId; - if (quantity == null && bookId == null) { - return null; // nothing changed - } - - // get the order item that was updated (to get access to the book price, quantity and order total) - Result result = adminService.run(Select.from(ORDER_ITEMS) - .columns(o -> o.quantity(), o -> o.amount(), - o -> o.book().expand(b -> b.ID(), b -> b.price()), - o -> o.parent().expand(p -> p.ID(), p -> p.total())) - .where(o -> o.ID().eq(orderItemId).and(o.IsActiveEntity().eq(false)))); - OrderItems itemToPatch = result.first(OrderItems.class).orElseThrow(notFound(MessageKeys.ORDERITEM_MISSING)); - BigDecimal bookPrice = null; - - // fallback to existing values - if(quantity == null) { - quantity = itemToPatch.getQuantity(); - } - - if(bookId == null && itemToPatch.getBook() != null) { - bookId = itemToPatch.getBook().getId(); - bookPrice = itemToPatch.getBook().getPrice(); - } - - if(quantity == null || bookId == null) { - return null; // not enough data available - } - - // only warn about invalid values as we are in draft mode - if(includeWarnings && quantity <= 0) { - // Tip: add additional messages with localized messages from property files - // these messages are transported in sap-messages and do not abort the request - messages.warn(MessageKeys.QUANTITY_REQUIRE_MINIMUM); - } - - // get the price of the updated book ID - if(bookPrice == null) { - result = db.run(Select.from(BOOKS).byId(bookId).columns(b -> b.price())); - Books book = result.first(Books.class).orElseThrow(notFound(MessageKeys.BOOK_MISSING)); - bookPrice = book.getPrice(); - } - - // update the amount of the order item - BigDecimal updatedAmount = bookPrice.multiply(BigDecimal.valueOf(quantity)); - - // update the order's total - BigDecimal previousAmount = defaultZero(itemToPatch.getAmount()); - BigDecimal currentTotal = defaultZero(itemToPatch.getParent().getTotal()); - BigDecimal newTotal = currentTotal.subtract(previousAmount).add(updatedAmount); - adminService.patchDraft(Update.entity(ORDERS) - .where(o -> o.ID().eq(itemToPatch.getParent().getId()).and(o.IsActiveEntity().eq(false))) - .data(Orders.TOTAL, newTotal)); - - return updatedAmount; - } - - /** - * Adds a book to an order - * @param context - */ - @On(entity = Books_.CDS_NAME) - public void addBookToOrder(AddToOrderContext context) { - String orderId = context.getOrderId(); - List orders = adminService.run(Select.from(ORDERS).columns(o -> o._all(), o -> o.Items().expand()).where(o -> o.ID().eq(orderId))).listOf(Orders.class); - Orders order = orders.stream().filter(p -> p.getIsActiveEntity()).findFirst().orElse(null); - - // check that the order with given ID exists and is not in draft-mode - if((orders.size() > 0 && order == null) || orders.size() > 1) { - throw new ServiceException(ErrorStatuses.CONFLICT, MessageKeys.ORDER_INDRAFT); - } else if (orders.size() <= 0) { - throw new ServiceException(ErrorStatuses.NOT_FOUND, MessageKeys.ORDER_MISSING); - } - - if(order.getItems() == null) { - order.setItems(new ArrayList<>()); - } - - // get ID of the book on which the action was called (bound action) - String bookId = (String) analyzer.analyze(context.getCqn()).targetKeys().get(Books.ID); - - // create order item - OrderItems newItem = OrderItems.create(); - newItem.setId(UUID.randomUUID().toString()); - newItem.setBookId(bookId); - newItem.setQuantity(context.getQuantity()); - order.getItems().add(newItem); - - Orders updatedOrder = adminService.run(Update.entity(ORDERS).data(order)).single(Orders.class); - messages.success(MessageKeys.BOOK_ADDED_ORDER); - context.setResult(updatedOrder); - } - - /** - * @return the static CSV singleton upload entity - */ - @On(entity = Upload_.CDS_NAME, event = CqnService.EVENT_READ) - public Upload getUploadSingleton() { - return Upload.create(); - } - - /** - * Handles CSV uploads with book data - * @param context - * @param csv - */ - @On - public void addBooksViaCsv(CdsUpdateEventContext context, Upload upload) { - InputStream is = upload.getCsv(); - if (is != null) { - try (BufferedReader br = new BufferedReader(new InputStreamReader(is))) { - br.lines().skip(1).forEach((line) -> { - String[] p = line.split(";"); - Books book = Books.create(); - book.setId(p[0]); - book.setTitle(p[1]); - book.setDescr(p[2]); - book.setAuthorId(p[3]); - book.setStock(Integer.valueOf(p[4]).intValue()); - book.setPrice(BigDecimal.valueOf(Double.valueOf(p[5]))); - book.setCurrencyCode(p[6]); - book.setGenreId(Integer.valueOf(p[7])); - - // separate transaction per line - context.getCdsRuntime().changeSetContext().run(ctx -> { - db.run(Upsert.into(Bookshop_.BOOKS).entry(book)); - }); - }); - } catch (IOException e) { - throw new ServiceException(ErrorStatuses.SERVER_ERROR, MessageKeys.BOOK_IMPORT_FAILED, e); - } catch (IndexOutOfBoundsException e) { - throw new ServiceException(ErrorStatuses.SERVER_ERROR, MessageKeys.BOOK_IMPORT_INVALID_CSV, e); - } - } - context.setResult(Arrays.asList(upload)); - } - - private Supplier notFound(String message) { - return () -> new ServiceException(ErrorStatuses.NOT_FOUND, message); - } - - private BigDecimal defaultZero(BigDecimal decimal) { - return decimal == null ? BigDecimal.valueOf(0) : decimal; - } - -} diff --git a/srv/src/main/java/my/bookshop/handlers/BookRatingInitialization.java b/srv/src/main/java/my/bookshop/handlers/BookRatingInitialization.java deleted file mode 100644 index 6e482dfd..00000000 --- a/srv/src/main/java/my/bookshop/handlers/BookRatingInitialization.java +++ /dev/null @@ -1,31 +0,0 @@ -package my.bookshop.handlers; - -import org.springframework.context.annotation.Profile; -import org.springframework.stereotype.Component; - -import com.sap.cds.services.application.ApplicationLifecycleService; -import com.sap.cds.services.handler.EventHandler; -import com.sap.cds.services.handler.annotations.After; -import com.sap.cds.services.handler.annotations.ServiceName; - -import my.bookshop.RatingCalculator; - -/** - * Initializes the book ratings based on their review ratings. - */ -@Component -@Profile("default") -@ServiceName(ApplicationLifecycleService.DEFAULT_NAME) -public class BookRatingInitialization implements EventHandler { - - private RatingCalculator ratingCalculator; - - BookRatingInitialization(RatingCalculator ratingCalculator) { - this.ratingCalculator = ratingCalculator; - } - - @After(event = ApplicationLifecycleService.EVENT_APPLICATION_PREPARED) - public void initBookRatings() { - this.ratingCalculator.initBookRatings(); - } -} diff --git a/srv/src/main/java/my/bookshop/handlers/CatalogServiceHandler.java b/srv/src/main/java/my/bookshop/handlers/CatalogServiceHandler.java deleted file mode 100644 index 3f110e4f..00000000 --- a/srv/src/main/java/my/bookshop/handlers/CatalogServiceHandler.java +++ /dev/null @@ -1,201 +0,0 @@ -package my.bookshop.handlers; - -import static cds.gen.catalogservice.CatalogService_.BOOKS; - -import java.util.List; -import java.util.Optional; -import java.util.Set; -import java.util.stream.Collectors; -import java.util.stream.Stream; - -import org.springframework.beans.factory.annotation.Qualifier; -import org.springframework.stereotype.Component; - -import com.sap.cds.Result; -import com.sap.cds.Struct; -import com.sap.cds.ql.Insert; -import com.sap.cds.ql.Select; -import com.sap.cds.ql.Update; -import com.sap.cds.ql.cqn.CqnAnalyzer; -import com.sap.cds.ql.cqn.CqnSelect; -import com.sap.cds.reflect.CdsModel; -import com.sap.cds.services.ErrorStatuses; -import com.sap.cds.services.ServiceException; -import com.sap.cds.services.cds.CdsReadEventContext; -import com.sap.cds.services.cds.CqnService; -import com.sap.cds.services.draft.DraftService; -import com.sap.cds.services.handler.EventHandler; -import com.sap.cds.services.handler.annotations.After; -import com.sap.cds.services.handler.annotations.Before; -import com.sap.cds.services.handler.annotations.On; -import com.sap.cds.services.handler.annotations.ServiceName; -import com.sap.cds.services.messages.Messages; -import com.sap.cds.services.persistence.PersistenceService; -import com.sap.cds.services.request.FeatureTogglesInfo; - -import cds.gen.catalogservice.AddReviewContext; -import cds.gen.catalogservice.Books; -import cds.gen.catalogservice.Books_; -import cds.gen.catalogservice.CatalogService_; -import cds.gen.catalogservice.Reviews; -import cds.gen.catalogservice.Reviews_; -import cds.gen.catalogservice.SubmitOrderContext; -import cds.gen.reviewservice.ReviewService_; -import my.bookshop.MessageKeys; -import my.bookshop.RatingCalculator; - -/** - * Custom business logic for the "Catalog Service" (see cat-service.cds) - * - * Handles Reading of Books - * - * Adds Discount Message to the Book Title if too much stock is available - * - * Provides adding book reviews - */ -@Component -@ServiceName(CatalogService_.CDS_NAME) -class CatalogServiceHandler implements EventHandler { - - private final PersistenceService db; - private final DraftService reviewService; - - private final Messages messages; - private final FeatureTogglesInfo featureToggles; - private final RatingCalculator ratingCalculator; - private final CqnAnalyzer analyzer; - - CatalogServiceHandler(PersistenceService db, @Qualifier(ReviewService_.CDS_NAME) DraftService reviewService, - Messages messages, FeatureTogglesInfo featureToggles, RatingCalculator ratingCalculator, CdsModel model) { - this.db = db; - this.reviewService = reviewService; - this.messages = messages; - this.featureToggles = featureToggles; - this.ratingCalculator = ratingCalculator; - this.analyzer = CqnAnalyzer.create(model); - } - - /** - * Invokes some validations before creating a review. - * - * @param context {@link ReviewContext} - */ - @Before(entity = Books_.CDS_NAME) - public void beforeAddReview(AddReviewContext context) { - String user = context.getUserInfo().getName(); - String bookId = (String) analyzer.analyze(context.getCqn()).targetKeys().get(Books.ID); - - Result result = db.run(Select.from(CatalogService_.REVIEWS) - .where(review -> review.book_ID().eq(bookId).and(review.createdBy().eq(user)))); - - if (result.first().isPresent()) { - throw new ServiceException(ErrorStatuses.METHOD_NOT_ALLOWED, MessageKeys.REVIEW_ADD_FORBIDDEN) - .messageTarget(Reviews_.class, r -> r.createdBy()); - } - } - - /** - * Handles the review creation from the given context. - * - * @param context {@link ReviewContext} - */ - @On(entity = Books_.CDS_NAME) - public void onAddReview(AddReviewContext context) { - Integer rating = context.getRating(); - String title = context.getTitle(); - String text = context.getText(); - - String bookId = (String) analyzer.analyze(context.getCqn()).targetKeys().get(Books.ID); - - cds.gen.reviewservice.Reviews review = cds.gen.reviewservice.Reviews.create(); - review.setBookId(bookId); - review.setRating(rating); - review.setTitle(title); - review.setText(text); - - Result res = reviewService.run(Insert.into(ReviewService_.REVIEWS).entry(review)); - cds.gen.reviewservice.Reviews inserted = res.single(cds.gen.reviewservice.Reviews.class); - - messages.success(MessageKeys.REVIEW_ADDED); - - context.setResult(Struct.access(inserted).as(Reviews.class)); - } - - /** - * Recalculates and sets the book rating after a new review for the given book. - * - * @param context {@link ReviewContext} - */ - @After(entity = Books_.CDS_NAME) - public void afterAddReview(AddReviewContext context) { - ratingCalculator.setBookRating(context.getResult().getBookId()); - } - - @After(event = CqnService.EVENT_READ) - public void discountBooks(Stream books) { - books.filter(b -> b.getTitle() != null).forEach(b -> { - loadStockIfNotSet(b); - discountBooksWithMoreThan111Stock(b, featureToggles.isEnabled("discount")); - }); - } - - @After - public void setIsReviewable(CdsReadEventContext context, List books) { - String user = context.getUserInfo().getName(); - List bookIds = books.stream().filter(b -> b.getId() != null).map(b -> b.getId()) - .collect(Collectors.toList()); - - if (bookIds.isEmpty()) { - return; - } - - CqnSelect query = Select.from(CatalogService_.BOOKS, b -> b.filter(b.ID().in(bookIds)).reviews()) - .where(r -> r.createdBy().eq(user)); - - Set reviewedBooks = db.run(query).streamOf(Reviews.class).map(Reviews::getBookId) - .collect(Collectors.toSet()); - - for (Books book : books) { - if (reviewedBooks.contains(book.getId())) { - book.setIsReviewable(false); - } - } - } - - @On - public void onSubmitOrder(SubmitOrderContext context) { - Integer quantity = context.getQuantity(); - String bookId = context.getBook(); - - Optional book = db.run(Select.from(BOOKS).columns(Books_::stock).byId(bookId)).first(Books.class); - - book.orElseThrow(() -> new ServiceException(ErrorStatuses.NOT_FOUND, MessageKeys.BOOK_MISSING) - .messageTarget(Books_.class, b -> b.ID())); - - int stock = book.map(Books::getStock).get(); - - if (stock >= quantity) { - db.run(Update.entity(BOOKS).byId(bookId).data(Books.STOCK, stock -= quantity)); - - SubmitOrderContext.ReturnType result = SubmitOrderContext.ReturnType.create(); - result.setStock(stock); - - context.setResult(result); - } else { - throw new ServiceException(ErrorStatuses.CONFLICT, MessageKeys.ORDER_EXCEEDS_STOCK, quantity); - } - } - - private void discountBooksWithMoreThan111Stock(Books b, boolean premium) { - if (b.getStock() != null && b.getStock() > 111) { - b.setTitle(String.format("%s -- %s%% discount", b.getTitle(), premium ? 14 : 11)); - } - } - - private void loadStockIfNotSet(Books b) { - if (b.getId() != null && b.getStock() == null) { - b.setStock(db.run(Select.from(BOOKS).byId(b.getId()).columns(Books_::stock)).single(Books.class).getStock()); - } - } - -} diff --git a/srv/src/main/java/my/bookshop/handlers/NotesServiceHandler.java b/srv/src/main/java/my/bookshop/handlers/NotesServiceHandler.java deleted file mode 100644 index 10ee116d..00000000 --- a/srv/src/main/java/my/bookshop/handlers/NotesServiceHandler.java +++ /dev/null @@ -1,207 +0,0 @@ -package my.bookshop.handlers; - -import java.util.ArrayList; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; -import java.util.concurrent.atomic.AtomicReference; -import java.util.stream.Collectors; - -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.beans.factory.annotation.Qualifier; -import org.springframework.stereotype.Component; - -import com.sap.cds.Result; -import com.sap.cds.ql.CQL; -import com.sap.cds.ql.Predicate; -import com.sap.cds.ql.Select; -import com.sap.cds.ql.cqn.CqnAnalyzer; -import com.sap.cds.ql.cqn.CqnExpand; -import com.sap.cds.ql.cqn.CqnPredicate; -import com.sap.cds.ql.cqn.CqnReference.Segment; -import com.sap.cds.ql.cqn.CqnSelect; -import com.sap.cds.ql.cqn.CqnSelectListItem; -import com.sap.cds.ql.cqn.CqnStructuredTypeRef; -import com.sap.cds.ql.cqn.Modifier; -import com.sap.cds.reflect.CdsModel; -import com.sap.cds.services.cds.CdsReadEventContext; -import com.sap.cds.services.cds.CqnService; -import com.sap.cds.services.handler.EventHandler; -import com.sap.cds.services.handler.annotations.On; -import com.sap.cds.services.handler.annotations.ServiceName; - -import cds.gen.api_business_partner.ApiBusinessPartner_; -import cds.gen.notesservice.Addresses; -import cds.gen.notesservice.Addresses_; -import cds.gen.notesservice.Notes; -import cds.gen.notesservice.NotesService_; -import cds.gen.notesservice.Notes_; - -@Component -@ServiceName(NotesService_.CDS_NAME) -public class NotesServiceHandler implements EventHandler { - - private final CqnService bupa; - private final CqnAnalyzer analyzer; - - @Autowired - NotesServiceHandler(@Qualifier(ApiBusinessPartner_.CDS_NAME) CqnService bupa, CdsModel model) { - this.bupa = bupa; - this.analyzer = CqnAnalyzer.create(model); - } - - @On(entity = Addresses_.CDS_NAME) - Result readAddresses(CdsReadEventContext context) { - List segments = context.getCqn().ref().segments(); - // via note - if(segments.size() == 2 && segments.get(0).id().equals(Notes_.CDS_NAME)) { - Map noteKeys = analyzer.analyze(context.getCqn()).rootKeys(); - Notes note = context.getService().run(Select.from(Notes_.class).columns(n -> n.address_businessPartner(), n -> n.address_ID()).matching(noteKeys)).single(Notes.class); - CqnSelect addressOfNote = CQL.copy(context.getCqn(), new Modifier() { - - @Override - public CqnStructuredTypeRef ref(CqnStructuredTypeRef ref) { - return CQL.entity(Addresses_.CDS_NAME) - .filter(p -> p.get(Addresses.BUSINESS_PARTNER).eq(note.getAddressBusinessPartner()) - .and(p.get(Addresses.ID).eq(note.getAddressId()))) - .asRef(); - } - - }); - return context.getService().run(addressOfNote); - } - - // notes expanded? - AtomicReference notesExpandHolder = new AtomicReference<>(); - CqnSelect noNotesExpand = CQL.copy(context.getCqn(), new Modifier() { - - public List items(List items) { - notesExpandHolder.set(removeIfExpanded(items, Addresses.NOTES)); - return ensureSelected(items, Addresses.BUSINESS_PARTNER, Addresses.ID); - } - - }); - - // read addresses - Result addresses = bupa.run(noNotesExpand); - - // add expanded notes? - CqnExpand notesExpand = notesExpandHolder.get(); - if(notesExpand != null) { - Select notesSelect = Select.from(Notes_.class) - .columns(ensureSelected(notesExpand.items(), Notes.ADDRESS_BUSINESS_PARTNER, Notes.ADDRESS_ID)) - .orderBy(notesExpand.orderBy()) - .where(n -> CQL.or(addresses.streamOf(Addresses.class) - .map(address -> n.address_businessPartner().eq(address.getBusinessPartner()).and(n.address_ID().eq(address.getId()))) - .collect(Collectors.toList())) - .and(predicate(notesExpand.ref().rootSegment()))); - - Result notes = context.getService().run(notesSelect); - for(Addresses address : addresses.listOf(Addresses.class)) { - address.setNotes( - notes.streamOf(Notes.class) - .filter(n -> n.getAddressBusinessPartner().equals(address.getBusinessPartner()) - && n.getAddressId().equals(address.getId())) - .collect(Collectors.toList())); - } - } - - return addresses; - } - - @On(entity = Notes_.CDS_NAME) - void readNotes(CdsReadEventContext context) { - List segments = context.getCqn().ref().segments(); - // via addresses - if(segments.size() == 2 && segments.get(0).id().equals(Addresses_.CDS_NAME)) { - Map addressKeys = analyzer.analyze(context.getCqn()).rootKeys(); - CqnSelect notesOfAddress = CQL.copy(context.getCqn(), new Modifier() { - - @Override - public CqnStructuredTypeRef ref(CqnStructuredTypeRef ref) { - return CQL.entity(Notes_.CDS_NAME).filter(predicate(segments.get(1))).asRef(); - } - - @Override - public Predicate where(Predicate where) { - Predicate ofAddress = CQL.get(Notes.ADDRESS_BUSINESS_PARTNER).eq(addressKeys.get(Addresses.BUSINESS_PARTNER)) - .and(CQL.get(Notes.ADDRESS_ID).eq(addressKeys.get(Addresses.ID))); - if(where != null) { - ofAddress = ofAddress.and(where); - } - return ofAddress; - } - - }); - context.setResult(context.getService().run(notesOfAddress)); - return; - } - - // address expanded? - AtomicReference addressExpandHolder = new AtomicReference<>(); - CqnSelect noAddressExpand = CQL.copy(context.getCqn(), new Modifier() { - - public List items(List items) { - addressExpandHolder.set(removeIfExpanded(items, Notes.ADDRESS)); - return ensureSelected(items, Notes.ADDRESS_BUSINESS_PARTNER, Notes.ADDRESS_ID); - } - - }); - - CqnExpand addressExpand = addressExpandHolder.get(); - if(addressExpand != null) { - // read notes and join with addresses - Result notes = context.getService().run(noAddressExpand); - List notesWithAddresses = notes.streamOf(Notes.class).filter(n -> n.getAddressBusinessPartner() != null && n.getAddressId() != null).collect(Collectors.toList()); - if (notesWithAddresses.size() > 0) { - Select addressSelect = Select.from(Addresses_.class) - .columns(ensureSelected(addressExpand.items(), Addresses.BUSINESS_PARTNER, Addresses.ID)) - .orderBy(addressExpand.orderBy()) - .where(a -> CQL.or(notesWithAddresses.stream() - .map(n -> a.businessPartner().eq(n.getAddressBusinessPartner()).and(a.ID().eq(n.getAddressId()))) - .collect(Collectors.toList())) - .and(predicate(addressExpand.ref().rootSegment()))); - - Result addresses = context.getService().run(addressSelect); - for(Notes note : notes.listOf(Notes.class)) { - note.setAddress(addresses.streamOf(Addresses.class) - .filter(a -> a.getBusinessPartner().equals(note.getAddressBusinessPartner()) - && a.getId().equals(note.getAddressId())) - .findFirst().orElse(null)); - } - } - context.setResult(notes); - return; - } - } - - private CqnExpand removeIfExpanded(List items, String association) { - CqnExpand expanded = items.stream().filter(i -> i.isExpand()).map(i -> i.asExpand()) - .filter(i -> i.ref().firstSegment().equals(association)).findFirst().orElse(null); - if(expanded != null) { - items.remove(expanded); - } - return expanded; - } - - private List ensureSelected(List items, String... elements) { - if(items.stream().anyMatch(i -> i.isStar())) { - return items; - } - Set newElements = new HashSet<>(); - for(String element : elements) { - if(!items.stream().anyMatch(i -> i.isValue() && i.asValue().displayName().equals(element))) { - newElements.add(element); - } - } - List newItems = new ArrayList<>(items); - newElements.forEach(element -> newItems.add(CQL.get(element))); - return newItems; - } - - private CqnPredicate predicate(Segment segment) { - return segment.filter().orElse(CQL.constant(true).eq(true)); - } - -} diff --git a/srv/src/main/java/my/bookshop/handlers/SubscriptionHandler.java b/srv/src/main/java/my/bookshop/handlers/SubscriptionHandler.java deleted file mode 100644 index 8b70715f..00000000 --- a/srv/src/main/java/my/bookshop/handlers/SubscriptionHandler.java +++ /dev/null @@ -1,33 +0,0 @@ -package my.bookshop.handlers; - -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.context.annotation.Profile; -import org.springframework.stereotype.Component; - -import com.sap.cds.services.auditlog.AuditLogService; -import com.sap.cds.services.handler.EventHandler; -import com.sap.cds.services.handler.annotations.After; -import com.sap.cds.services.handler.annotations.ServiceName; -import com.sap.cds.services.mt.DeploymentService; -import com.sap.cds.services.mt.SubscribeEventContext; - -/** - * Handler that implements subscription logic - */ -@Component -@Profile("cloud") -@ServiceName(DeploymentService.DEFAULT_NAME) -class SubscriptionHandler implements EventHandler { - - @Autowired - private AuditLogService auditLog; - - @After - public void afterSubscribe(SubscribeEventContext context) { - String msg = String.format("New tenant '%s' subscribed.", context.getTenant()); - - // send audit log security message to provider tenant as user's tenant is null - auditLog.logSecurityEvent("tenant subscribed", msg); - } - -} diff --git a/srv/src/main/java/my/bookshop/handlers/external/ApiBusinessPartnerEventMockHandler.java b/srv/src/main/java/my/bookshop/handlers/external/ApiBusinessPartnerEventMockHandler.java deleted file mode 100644 index 2a353754..00000000 --- a/srv/src/main/java/my/bookshop/handlers/external/ApiBusinessPartnerEventMockHandler.java +++ /dev/null @@ -1,50 +0,0 @@ -package my.bookshop.handlers.external; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.context.annotation.Profile; -import org.springframework.stereotype.Component; - -import com.sap.cds.ql.cqn.CqnAnalyzer; -import com.sap.cds.services.cds.ApplicationService; -import com.sap.cds.services.cds.CdsUpdateEventContext; -import com.sap.cds.services.cds.CqnService; -import com.sap.cds.services.handler.EventHandler; -import com.sap.cds.services.handler.annotations.After; -import com.sap.cds.services.handler.annotations.ServiceName; - -import cds.gen.api_business_partner.ABusinessPartnerAddress; -import cds.gen.api_business_partner.ABusinessPartnerAddress_; -import cds.gen.api_business_partner.ApiBusinessPartner_; -import cds.gen.api_business_partner.BusinessPartnerChanged; -import cds.gen.api_business_partner.BusinessPartnerChangedContext; - -/** - * This class mocks the event emitting of the S/4 API - */ -@Component -@Profile("!cloud") -@ServiceName(value = { ApiBusinessPartner_.CDS_NAME, "api-business-partner-mocked"}, type = ApplicationService.class) -public class ApiBusinessPartnerEventMockHandler implements EventHandler { - - private final static Logger logger = LoggerFactory.getLogger(ApiBusinessPartnerEventMockHandler.class); - - @After(event = CqnService.EVENT_UPDATE, entity = ABusinessPartnerAddress_.CDS_NAME) - public void businessPartnerChanged(CdsUpdateEventContext context) { - // Get BusinessPartner ID - CqnAnalyzer analyzer = CqnAnalyzer.create(context.getModel()); - String businessPartner = (String) analyzer.analyze(context.getCqn().ref()).targetKeys().get(ABusinessPartnerAddress.BUSINESS_PARTNER); - - // Construct S/4 HANA Payload - BusinessPartnerChanged payload = BusinessPartnerChanged.create(); - payload.setBusinessPartner(businessPartner); - - // Emit Changed Event - logger.info("<< emitting: " + payload); - BusinessPartnerChangedContext changed = BusinessPartnerChangedContext.create(); - changed.setData(payload); - context.getService().emit(changed); - } - - -} diff --git a/srv/src/main/java/my/bookshop/health/AppActuator.java b/srv/src/main/java/my/bookshop/health/AppActuator.java deleted file mode 100644 index e661e1f4..00000000 --- a/srv/src/main/java/my/bookshop/health/AppActuator.java +++ /dev/null @@ -1,27 +0,0 @@ -package my.bookshop.health; - -import java.util.LinkedHashMap; -import java.util.Map; - -import org.springframework.boot.actuate.endpoint.annotation.Endpoint; -import org.springframework.boot.actuate.endpoint.annotation.ReadOperation; -import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; -import org.springframework.stereotype.Component; - - -/** - * Custom app actuator implementation. - */ -@Component -@ConditionalOnClass(Endpoint.class) -@Endpoint(id = "bookshop", enableByDefault = true) -public class AppActuator { - - @ReadOperation - public Map info() { - Map info = new LinkedHashMap<>(); - info.put("Version", "1.0.0"); - return info; - } - -} diff --git a/srv/src/main/java/my/bookshop/health/CustomHealthIndicator.java b/srv/src/main/java/my/bookshop/health/CustomHealthIndicator.java deleted file mode 100644 index ba702f7f..00000000 --- a/srv/src/main/java/my/bookshop/health/CustomHealthIndicator.java +++ /dev/null @@ -1,28 +0,0 @@ -package my.bookshop.health; - -import org.springframework.boot.actuate.autoconfigure.health.ConditionalOnEnabledHealthIndicator; -import org.springframework.boot.actuate.health.Health; -import org.springframework.boot.actuate.health.HealthIndicator; -import org.springframework.stereotype.Component; - -/** - * Custom health indicator implementation. - */ -@Component("myhealth") -@ConditionalOnEnabledHealthIndicator("myhealth") -public class CustomHealthIndicator implements HealthIndicator { - - @Override - public Health health() { - if (check() != 0) { - return Health.down().build(); - } - return Health.up().build(); - } - - private int check() { - // perform some health check - return 0; - } - -} diff --git a/srv/src/main/java/my/bookshop/index/UiIndexContentProviderFactory.java b/srv/src/main/java/my/bookshop/index/UiIndexContentProviderFactory.java index bc380d1f..1afacc40 100644 --- a/srv/src/main/java/my/bookshop/index/UiIndexContentProviderFactory.java +++ b/srv/src/main/java/my/bookshop/index/UiIndexContentProviderFactory.java @@ -42,8 +42,6 @@ public String getSectionTitle() { public void writeContent(PrintWriter writer, String contextPath) { writer.print(ENDPOINT_START); writer.printf(ENDPOINT, contextPath + "/fiori.html", "Fiori UI"); - writer.printf(ENDPOINT, contextPath + "/vue/index.html", "Vue.js UI"); - writer.printf(ENDPOINT, contextPath + "/swagger/index.html", "Swagger UI"); writer.print(ENDPOINT_END); } diff --git a/srv/src/main/resources/application.yaml b/srv/src/main/resources/application.yaml index d0866ebd..5f24857a 100644 --- a/srv/src/main/resources/application.yaml +++ b/srv/src/main/resources/application.yaml @@ -1,128 +1,30 @@ --- -logging: - level: - '[com.sap.cds.auditlog]': DEBUG -spring: - web.resources.static-locations: "file:./app" - jmx: - enabled: true -cds: - odata-v4.endpoint.path: "/api" - odata-v4.serializer.enabled: true - multi-tenancy: - compatibility.enabled: false - mtxs.enabled: true - security: - authentication.normalize-provider-tenant: true - mock.users: - admin: - password: admin - roles: - - admin - attributes: - businessPartner: - - "10401010" - user: - password: user -server.servlet.encoding: - charset: UTF-8 - force: true -management: - endpoint: - health: - show-components: always - show-details: always - endpoints: - web: - exposure: - include: "health" - health: - defaults.enabled: false - ping.enabled: true - db.enabled: true - myhealth.enabled: true - ---- -spring: - config.activate.on-profile: cloud - sql.init.schema-locations: "classpath:schema-nomocks.sql" -cds: - messaging.services: - bupa-messaging: - kind: enterprise-messaging - format: cloudevents - subscribe-prefix: sap/S4HANAOD/java/ce/ - ---- -spring: - config.activate.on-profile: sandbox -cds: - remote.services: - '[API_BUSINESS_PARTNER]': - destination: - type: "odata-v2" - properties: - url: "https://sandbox.api.sap.com/s4hanacloud/sap/opu/odata/sap" - headers: - APIKey: "" # Place API Key from SAP API Business Hub here or use environment variable CDS_REMOTE_SERVICES_API_BUSINESS_PARTNER_DESTINATION_HEADERS_APIKEY - ---- -spring: - config.activate.on-profile: destination -cds: - remote.services: - '[API_BUSINESS_PARTNER]': - destination: - type: "odata-v2" - name: "s4-destination" - suffix: "/sap/opu/odata/sap" +my.bookshop.postgresImage: postgres:13 ---- spring: - config.activate.on-profile: mocked -cds: - messaging.services: - bupa-messaging: - kind: file-based-messaging - application.services: - api-business-partner-mocked: - model: API_BUSINESS_PARTNER - serve: - path: API_BUSINESS_PARTNER - remote.services: - '[API_BUSINESS_PARTNER]': - destination: - name: "myself" - suffix: "/api" + web.resources.static-locations: "file:./app" ---- -spring: - config.activate.on-profile: ft cds: - model.provider.url: http://localhost:4005 + dataSource.csv: + initializationMode: always + singleChangeset: true + odata-v4.endpoint.path: "/api" security.mock.users: admin: - features: - - isbn - - discount + password: admin + roles: + - admin user: - features: - - isbn + password: user --- spring: - config.activate.on-profile: local-mtxs -cds: - multi-tenancy.sidecar.url: http://localhost:4005 - security.mock.users: - admin: - tenant: t1 - user: - tenant: t1 + config.activate.on-profile: cloud --- spring: config.activate.on-profile: default cds: - data-source: + dataSource: auto-config.enabled: false + diff --git a/srv/src/main/resources/db/changelog/.gitignore b/srv/src/main/resources/db/changelog/.gitignore new file mode 100644 index 00000000..362b4e3c --- /dev/null +++ b/srv/src/main/resources/db/changelog/.gitignore @@ -0,0 +1,2 @@ +!*.sql +!*.json \ No newline at end of file diff --git a/srv/src/main/resources/db/changelog/db.changelog-master.yaml b/srv/src/main/resources/db/changelog/db.changelog-master.yaml new file mode 100644 index 00000000..18b16267 --- /dev/null +++ b/srv/src/main/resources/db/changelog/db.changelog-master.yaml @@ -0,0 +1,15 @@ +databaseChangeLog: + - changeSet: + id: "initial" + author: CAP Java + changes: + - sqlFile: + dbms: postgresql + path: db/changelog/v1/model.sql + - changeSet: + id: "with-isbn" + author: CAP Java + changes: + - sqlFile: + dbms: postgresql + path: db/changelog/v2/model.sql \ No newline at end of file diff --git a/srv/src/main/resources/db/changelog/v1/model.csn b/srv/src/main/resources/db/changelog/v1/model.csn new file mode 100644 index 00000000..0eb13bc4 --- /dev/null +++ b/srv/src/main/resources/db/changelog/v1/model.csn @@ -0,0 +1 @@ +{"namespace":"my.bookshop","definitions":{"my.bookshop.Books":{"kind":"entity","@fiori.draft.enabled":true,"@Common.SemanticKey":[{"=":"title"}],"@UI.Identification":[{"Value":{"=":"title"}}],"@UI.SelectionFields":[{"=":"ID"},{"=":"author_ID"},{"=":"price"},{"=":"currency_code"}],"@UI.LineItem":[{"Value":{"=":"ID"}},{"Value":{"=":"title"}},{"Value":{"=":"author.name"},"Label":"{i18n>Author}"},{"Value":{"=":"genre.name"}},{"Value":{"=":"stock"}},{"Value":{"=":"price"}},{"Value":{"=":"currency.symbol"},"Label":" "}],"@UI.HeaderInfo.TypeName":"{i18n>Book}","@UI.HeaderInfo.TypeNamePlural":"{i18n>Books}","@UI.HeaderInfo.TypeImageUrl":"sap-icon://course-book","@UI.HeaderInfo.Title.Value":{"=":"title"},"@UI.HeaderInfo.Description.Value":{"=":"author.name"},"elements":{"ID":{"@title":"{i18n>ID}","@UI.HiddenFilter":true,"@Core.Computed":true,"key":true,"type":"cds.String","length":36,"@cds.persistence.name":"ID"},"createdAt":{"@cds.on.insert":{"=":"$now"},"@UI.HiddenFilter":true,"@Core.Immutable":true,"@title":"{i18n>CreatedAt}","@readonly":true,"type":"cds.UTCTimestamp","@cds.persistence.name":"CREATEDAT"},"createdBy":{"@cds.on.insert":{"=":"$user"},"@UI.HiddenFilter":true,"@Core.Immutable":true,"@title":"{i18n>CreatedBy}","@readonly":true,"@description":"{i18n>UserID.Description}","type":"cds.String","length":255,"@cds.persistence.name":"CREATEDBY"},"modifiedAt":{"@cds.on.insert":{"=":"$now"},"@cds.on.update":{"=":"$now"},"@UI.HiddenFilter":true,"@title":"{i18n>ChangedAt}","@readonly":true,"type":"cds.UTCTimestamp","@cds.persistence.name":"MODIFIEDAT"},"modifiedBy":{"@cds.on.insert":{"=":"$user"},"@cds.on.update":{"=":"$user"},"@UI.HiddenFilter":true,"@title":"{i18n>ChangedBy}","@readonly":true,"@description":"{i18n>UserID.Description}","type":"cds.String","length":255,"@cds.persistence.name":"MODIFIEDBY"},"title":{"@title":"{i18n>Title}","type":"cds.String","length":111,"@cds.persistence.name":"TITLE"},"descr":{"@title":"{i18n>Description}","@UI.MultiLineText":true,"type":"cds.String","length":1111,"@cds.persistence.name":"DESCR"},"author":{"@ValueList.entity":"Authors","@title":"{i18n>Author}","@Common.Text":{"=":"author.name"},"@Common.TextArrangement":{"#":"TextOnly"},"type":"cds.Association","target":"my.bookshop.Authors","keys":[{"ref":["ID"],"as":"ID","$generatedFieldName":"author_ID"}],"on":[{"ref":["author","ID"]},"=",{"ref":["author_ID"]}],"@cds.persistence.name":"AUTHOR"},"author_ID":{"type":"cds.String","length":36,"@odata.foreignKey4":"author","@cds.persistence.name":"AUTHOR_ID"},"genre":{"@title":"{i18n>Genre}","@Common.Text":{"=":"genre.name"},"@Common.TextArrangement":{"#":"TextOnly"},"type":"cds.Association","target":"my.bookshop.Genres","keys":[{"ref":["ID"],"as":"ID","$generatedFieldName":"genre_ID"}],"on":[{"ref":["genre","ID"]},"=",{"ref":["genre_ID"]}],"@cds.persistence.name":"GENRE"},"genre_ID":{"type":"cds.Integer","@odata.foreignKey4":"genre","@cds.persistence.name":"GENRE_ID"},"stock":{"@title":"{i18n>Stock}","type":"cds.Integer","@cds.persistence.name":"STOCK"},"price":{"@title":"{i18n>Price}","type":"cds.Decimal","precision":9,"scale":2,"@cds.persistence.name":"PRICE"},"currency":{"@title":"{i18n>Currency}","@description":"{i18n>CurrencyCode.Description}","type":"cds.Association","target":"sap.common.Currencies","keys":[{"ref":["code"],"as":"code","$generatedFieldName":"currency_code"}],"on":[{"ref":["currency","code"]},"=",{"ref":["currency_code"]}],"@cds.persistence.name":"CURRENCY"},"currency_code":{"type":"cds.String","length":3,"@odata.foreignKey4":"currency","@cds.persistence.name":"CURRENCY_CODE"},"rating":{"type":"cds.Decimal","precision":2,"scale":1,"@cds.persistence.name":"RATING"},"texts":{"type":"cds.Composition","cardinality":{"max":"*"},"target":"my.bookshop.Books.texts","on":[{"ref":["texts","ID"]},"=",{"ref":["ID"]}],"@cds.persistence.name":"TEXTS"},"localized":{"type":"cds.Association","target":"my.bookshop.Books.texts","on":[{"ref":["localized","ID"]},"=",{"ref":["ID"]},"and",{"ref":["localized","locale"]},"=",{"ref":["$user","locale"]}],"@cds.persistence.name":"LOCALIZED"}},"@cds.persistence.name":"MY_BOOKSHOP_BOOKS"},"my.bookshop.Authors":{"kind":"entity","@Common.SemanticKey":[{"=":"name"}],"@UI.Identification":[{"Value":{"=":"name"}}],"@UI.SelectionFields":[{"=":"name"}],"@UI.LineItem":[{"Value":{"=":"ID"}},{"Value":{"=":"name"}},{"Value":{"=":"dateOfBirth"}},{"Value":{"=":"dateOfDeath"}},{"Value":{"=":"placeOfBirth"}},{"Value":{"=":"placeOfDeath"}}],"@UI.HeaderInfo.TypeName":"{i18n>Author}","@UI.HeaderInfo.TypeNamePlural":"{i18n>Authors}","@UI.HeaderInfo.Title.Value":{"=":"name"},"@UI.HeaderInfo.Description.Value":{"=":"dateOfBirth"},"@UI.Facets":[{"$Type":"UI.ReferenceFacet","Target":"books/@UI.LineItem"}],"elements":{"ID":{"@title":"{i18n>ID}","@UI.HiddenFilter":true,"@Core.Computed":true,"key":true,"type":"cds.String","length":36,"@cds.persistence.name":"ID"},"createdAt":{"@cds.on.insert":{"=":"$now"},"@UI.HiddenFilter":true,"@Core.Immutable":true,"@title":"{i18n>CreatedAt}","@readonly":true,"type":"cds.UTCTimestamp","@cds.persistence.name":"CREATEDAT"},"createdBy":{"@cds.on.insert":{"=":"$user"},"@UI.HiddenFilter":true,"@Core.Immutable":true,"@title":"{i18n>CreatedBy}","@readonly":true,"@description":"{i18n>UserID.Description}","type":"cds.String","length":255,"@cds.persistence.name":"CREATEDBY"},"modifiedAt":{"@cds.on.insert":{"=":"$now"},"@cds.on.update":{"=":"$now"},"@UI.HiddenFilter":true,"@title":"{i18n>ChangedAt}","@readonly":true,"type":"cds.UTCTimestamp","@cds.persistence.name":"MODIFIEDAT"},"modifiedBy":{"@cds.on.insert":{"=":"$user"},"@cds.on.update":{"=":"$user"},"@UI.HiddenFilter":true,"@title":"{i18n>ChangedBy}","@readonly":true,"@description":"{i18n>UserID.Description}","type":"cds.String","length":255,"@cds.persistence.name":"MODIFIEDBY"},"name":{"@assert.format":"^\\p{Lu}.*","@title":"{i18n>Name}","type":"cds.String","length":111,"@cds.persistence.name":"NAME"},"dateOfBirth":{"@title":"{i18n>DateOfBirth}","type":"cds.LocalDate","@cds.persistence.name":"DATEOFBIRTH"},"dateOfDeath":{"@title":"{i18n>DateOfDeath}","type":"cds.LocalDate","@cds.persistence.name":"DATEOFDEATH"},"placeOfBirth":{"@title":"{i18n>PlaceOfBirth}","type":"cds.String","length":255,"@cds.persistence.name":"PLACEOFBIRTH"},"placeOfDeath":{"@title":"{i18n>PlaceOfDeath}","type":"cds.String","length":255,"@cds.persistence.name":"PLACEOFDEATH"},"books":{"type":"cds.Association","cardinality":{"max":"*"},"target":"my.bookshop.Books","on":[{"ref":["books","author_ID"]},"=",{"ref":["ID"]}],"@cds.persistence.name":"BOOKS"}},"@cds.persistence.name":"MY_BOOKSHOP_AUTHORS"},"my.bookshop.Genres":{"kind":"entity","@Common.SemanticKey":[{"=":"name"}],"@UI.SelectionFields":[{"=":"name"}],"@UI.LineItem":[{"Value":{"=":"name"}},{"Value":{"=":"parent.name"},"Label":"Main Genre"}],"@UI.Identification":[{"Value":{"=":"name"}}],"@UI.HeaderInfo.TypeName":"{i18n>Genre}","@UI.HeaderInfo.TypeNamePlural":"{i18n>Genres}","@UI.HeaderInfo.Title.Value":{"=":"name"},"@UI.HeaderInfo.Description.Value":{"=":"ID"},"@UI.Facets":[{"$Type":"UI.ReferenceFacet","Label":"{i18n>SubGenres}","Target":"children/@UI.LineItem"}],"@cds.autoexpose":true,"@cds.persistence.skip":"if-unused","@cds.odata.valuelist":true,"elements":{"name":{"@title":"{i18n>Genre}","type":"cds.String","length":255,"@cds.persistence.name":"NAME"},"descr":{"@title":"{i18n>Description}","type":"cds.String","length":1000,"@cds.persistence.name":"DESCR"},"ID":{"@title":"{i18n>ID}","key":true,"type":"cds.Integer","@cds.persistence.name":"ID"},"parent":{"type":"cds.Association","target":"my.bookshop.Genres","keys":[{"ref":["ID"],"as":"ID","$generatedFieldName":"parent_ID"}],"on":[{"ref":["parent","ID"]},"=",{"ref":["parent_ID"]}],"@cds.persistence.name":"PARENT"},"parent_ID":{"type":"cds.Integer","@odata.foreignKey4":"parent","@cds.persistence.name":"PARENT_ID"},"children":{"type":"cds.Composition","cardinality":{"max":"*"},"target":"my.bookshop.Genres","on":[{"ref":["children","parent_ID"]},"=",{"ref":["ID"]}],"@cds.persistence.name":"CHILDREN"},"texts":{"type":"cds.Composition","cardinality":{"max":"*"},"target":"my.bookshop.Genres.texts","on":[{"ref":["texts","ID"]},"=",{"ref":["ID"]}],"@cds.persistence.name":"TEXTS"},"localized":{"type":"cds.Association","target":"my.bookshop.Genres.texts","on":[{"ref":["localized","ID"]},"=",{"ref":["ID"]},"and",{"ref":["localized","locale"]},"=",{"ref":["$user","locale"]}],"@cds.persistence.name":"LOCALIZED"}},"@cds.persistence.name":"MY_BOOKSHOP_GENRES"},"AdminService":{"kind":"service","@path":"admin","@requires":"admin"},"AdminService.Books":{"kind":"entity","@cds.search.descr":true,"@cds.search.title":true,"@odata.draft.enabled":true,"@UI.Facets":[{"$Type":"UI.ReferenceFacet","Label":"{i18n>General}","Target":"@UI.FieldGroup#General"},{"$Type":"UI.ReferenceFacet","Label":"{i18n>Translations}","Target":"texts/@UI.LineItem"},{"$Type":"UI.ReferenceFacet","Label":"{i18n>Details}","Target":"@UI.FieldGroup#Details"},{"$Type":"UI.ReferenceFacet","Label":"{i18n>Admin}","Target":"@UI.FieldGroup#Admin"}],"@UI.FieldGroup#General.Data":[{"Value":{"=":"title"}},{"Value":{"=":"author_ID"}},{"Value":{"=":"genre_ID"}},{"Value":{"=":"descr"}}],"@UI.FieldGroup#Details.Data":[{"Value":{"=":"stock"}},{"Value":{"=":"price"}},{"Value":{"=":"currency_code"},"Label":"{i18n>Currency}"}],"@UI.FieldGroup#Admin.Data":[{"Value":{"=":"createdBy"}},{"Value":{"=":"createdAt"}},{"Value":{"=":"modifiedBy"}},{"Value":{"=":"modifiedAt"}}],"@fiori.draft.enabled":true,"@Common.SemanticKey":[{"=":"title"}],"@UI.Identification":[{"Value":{"=":"title"}}],"@UI.SelectionFields":[{"=":"ID"},{"=":"author_ID"},{"=":"price"},{"=":"currency_code"}],"@UI.LineItem":[{"Value":{"=":"ID"}},{"Value":{"=":"title"}},{"Value":{"=":"author.name"},"Label":"{i18n>Author}"},{"Value":{"=":"genre.name"}},{"Value":{"=":"stock"}},{"Value":{"=":"price"}},{"Value":{"=":"currency.symbol"},"Label":" "}],"@UI.HeaderInfo.TypeName":"{i18n>Book}","@UI.HeaderInfo.TypeNamePlural":"{i18n>Books}","@UI.HeaderInfo.TypeImageUrl":"sap-icon://course-book","@UI.HeaderInfo.Title.Value":{"=":"title"},"@UI.HeaderInfo.Description.Value":{"=":"author.name"},"elements":{"ID":{"@title":"{i18n>ID}","@UI.HiddenFilter":true,"@Core.Computed":true,"key":true,"type":"cds.String","length":36,"@cds.persistence.name":"ID"},"createdAt":{"@cds.on.insert":{"=":"$now"},"@UI.HiddenFilter":true,"@Core.Immutable":true,"@title":"{i18n>CreatedAt}","@readonly":true,"type":"cds.UTCTimestamp","@cds.persistence.name":"CREATEDAT"},"createdBy":{"@cds.on.insert":{"=":"$user"},"@UI.HiddenFilter":true,"@Core.Immutable":true,"@title":"{i18n>CreatedBy}","@readonly":true,"@description":"{i18n>UserID.Description}","type":"cds.String","length":255,"@cds.persistence.name":"CREATEDBY"},"modifiedAt":{"@cds.on.insert":{"=":"$now"},"@cds.on.update":{"=":"$now"},"@UI.HiddenFilter":true,"@title":"{i18n>ChangedAt}","@readonly":true,"type":"cds.UTCTimestamp","@cds.persistence.name":"MODIFIEDAT"},"modifiedBy":{"@cds.on.insert":{"=":"$user"},"@cds.on.update":{"=":"$user"},"@UI.HiddenFilter":true,"@title":"{i18n>ChangedBy}","@readonly":true,"@description":"{i18n>UserID.Description}","type":"cds.String","length":255,"@cds.persistence.name":"MODIFIEDBY"},"title":{"@title":"{i18n>Title}","type":"cds.String","length":111,"@cds.persistence.name":"TITLE"},"descr":{"@title":"{i18n>Description}","@UI.MultiLineText":true,"type":"cds.String","length":1111,"@cds.persistence.name":"DESCR"},"author":{"@ValueList.entity":"Authors","@title":"{i18n>Author}","@Common.Text":{"=":"author.name"},"@Common.TextArrangement":{"#":"TextOnly"},"type":"cds.Association","target":"AdminService.Authors","keys":[{"ref":["ID"],"as":"ID","$generatedFieldName":"author_ID"}],"on":[{"ref":["author","ID"]},"=",{"ref":["author_ID"]}],"@cds.persistence.name":"AUTHOR"},"author_ID":{"type":"cds.String","length":36,"@odata.foreignKey4":"author","@cds.persistence.name":"AUTHOR_ID"},"genre":{"@title":"{i18n>Genre}","@Common.Text":{"=":"genre.name"},"@Common.TextArrangement":{"#":"TextOnly"},"type":"cds.Association","target":"AdminService.Genres","keys":[{"ref":["ID"],"as":"ID","$generatedFieldName":"genre_ID"}],"on":[{"ref":["genre","ID"]},"=",{"ref":["genre_ID"]}],"@cds.persistence.name":"GENRE"},"genre_ID":{"type":"cds.Integer","@odata.foreignKey4":"genre","@cds.persistence.name":"GENRE_ID"},"stock":{"@title":"{i18n>Stock}","type":"cds.Integer","@cds.persistence.name":"STOCK"},"price":{"@title":"{i18n>Price}","type":"cds.Decimal","precision":9,"scale":2,"@cds.persistence.name":"PRICE"},"currency":{"@title":"{i18n>Currency}","@description":"{i18n>CurrencyCode.Description}","type":"cds.Association","target":"AdminService.Currencies","keys":[{"ref":["code"],"as":"code","$generatedFieldName":"currency_code"}],"on":[{"ref":["currency","code"]},"=",{"ref":["currency_code"]}],"@cds.persistence.name":"CURRENCY"},"currency_code":{"type":"cds.String","length":3,"@odata.foreignKey4":"currency","@cds.persistence.name":"CURRENCY_CODE"},"rating":{"type":"cds.Decimal","precision":2,"scale":1,"@cds.persistence.name":"RATING"},"texts":{"type":"cds.Composition","cardinality":{"max":"*"},"target":"AdminService.Books.texts","on":[{"ref":["texts","ID"]},"=",{"ref":["ID"]}],"@cds.persistence.name":"TEXTS"},"localized":{"type":"cds.Association","target":"AdminService.Books.texts","on":[{"ref":["localized","ID"]},"=",{"ref":["ID"]},"and",{"ref":["localized","locale"]},"=",{"ref":["$user","locale"]}],"@cds.persistence.name":"LOCALIZED"}},"@cds.persistence.name":"ADMINSERVICE_BOOKS","projection":{"from":{"ref":["my.bookshop.Books"],"as":"Books_0"},"columns":[{"ref":["Books_0","ID"]},{"ref":["Books_0","createdAt"]},{"ref":["Books_0","createdBy"]},{"ref":["Books_0","modifiedAt"]},{"ref":["Books_0","modifiedBy"]},{"ref":["Books_0","title"]},{"ref":["Books_0","descr"]},{"ref":["___author"],"as":"author"},{"ref":["Books_0","author_ID"]},{"ref":["___genre"],"as":"genre"},{"ref":["Books_0","genre_ID"]},{"ref":["Books_0","stock"]},{"ref":["Books_0","price"]},{"ref":["___currency"],"as":"currency"},{"ref":["Books_0","currency_code"]},{"ref":["Books_0","rating"]},{"ref":["___texts"],"as":"texts"},{"ref":["___localized"],"as":"localized"}],"mixin":{"___author":{"@ValueList.entity":"Authors","@title":"{i18n>Author}","@Common.Text":{"=":"author.name"},"@Common.TextArrangement":{"#":"TextOnly"},"type":"cds.Association","target":"AdminService.Authors","keys":[{"ref":["ID"],"as":"ID","$generatedFieldName":"author_ID"}],"on":[{"ref":["___author","ID"]},"=",{"ref":["$projection","author_ID"]}]},"___genre":{"@title":"{i18n>Genre}","@Common.Text":{"=":"genre.name"},"@Common.TextArrangement":{"#":"TextOnly"},"type":"cds.Association","target":"AdminService.Genres","keys":[{"ref":["ID"],"as":"ID","$generatedFieldName":"genre_ID"}],"on":[{"ref":["___genre","ID"]},"=",{"ref":["$projection","genre_ID"]}]},"___currency":{"@title":"{i18n>Currency}","@description":"{i18n>CurrencyCode.Description}","type":"cds.Association","target":"AdminService.Currencies","keys":[{"ref":["code"],"as":"code","$generatedFieldName":"currency_code"}],"on":[{"ref":["___currency","code"]},"=",{"ref":["$projection","currency_code"]}]},"___texts":{"type":"cds.Composition","cardinality":{"max":"*"},"target":"AdminService.Books.texts","on":[{"ref":["___texts","ID"]},"=",{"ref":["$projection","ID"]}]},"___localized":{"type":"cds.Association","target":"AdminService.Books.texts","on":[{"ref":["___localized","ID"]},"=",{"ref":["$projection","ID"]},"and",{"ref":["___localized","locale"]},"=",{"ref":["$user","locale"]}]}}}},"AdminService.Authors":{"kind":"entity","@Common.SemanticKey":[{"=":"name"}],"@UI.Identification":[{"Value":{"=":"name"}}],"@UI.SelectionFields":[{"=":"name"}],"@UI.LineItem":[{"Value":{"=":"ID"}},{"Value":{"=":"name"}},{"Value":{"=":"dateOfBirth"}},{"Value":{"=":"dateOfDeath"}},{"Value":{"=":"placeOfBirth"}},{"Value":{"=":"placeOfDeath"}}],"@UI.HeaderInfo.TypeName":"{i18n>Author}","@UI.HeaderInfo.TypeNamePlural":"{i18n>Authors}","@UI.HeaderInfo.Title.Value":{"=":"name"},"@UI.HeaderInfo.Description.Value":{"=":"dateOfBirth"},"@UI.Facets":[{"$Type":"UI.ReferenceFacet","Target":"books/@UI.LineItem"}],"elements":{"ID":{"@title":"{i18n>ID}","@UI.HiddenFilter":true,"@Core.Computed":true,"key":true,"type":"cds.String","length":36,"@cds.persistence.name":"ID"},"createdAt":{"@cds.on.insert":{"=":"$now"},"@UI.HiddenFilter":true,"@Core.Immutable":true,"@title":"{i18n>CreatedAt}","@readonly":true,"type":"cds.UTCTimestamp","@cds.persistence.name":"CREATEDAT"},"createdBy":{"@cds.on.insert":{"=":"$user"},"@UI.HiddenFilter":true,"@Core.Immutable":true,"@title":"{i18n>CreatedBy}","@readonly":true,"@description":"{i18n>UserID.Description}","type":"cds.String","length":255,"@cds.persistence.name":"CREATEDBY"},"modifiedAt":{"@cds.on.insert":{"=":"$now"},"@cds.on.update":{"=":"$now"},"@UI.HiddenFilter":true,"@title":"{i18n>ChangedAt}","@readonly":true,"type":"cds.UTCTimestamp","@cds.persistence.name":"MODIFIEDAT"},"modifiedBy":{"@cds.on.insert":{"=":"$user"},"@cds.on.update":{"=":"$user"},"@UI.HiddenFilter":true,"@title":"{i18n>ChangedBy}","@readonly":true,"@description":"{i18n>UserID.Description}","type":"cds.String","length":255,"@cds.persistence.name":"MODIFIEDBY"},"name":{"@assert.format":"^\\p{Lu}.*","@title":"{i18n>Name}","type":"cds.String","length":111,"@cds.persistence.name":"NAME"},"dateOfBirth":{"@title":"{i18n>DateOfBirth}","type":"cds.LocalDate","@cds.persistence.name":"DATEOFBIRTH"},"dateOfDeath":{"@title":"{i18n>DateOfDeath}","type":"cds.LocalDate","@cds.persistence.name":"DATEOFDEATH"},"placeOfBirth":{"@title":"{i18n>PlaceOfBirth}","type":"cds.String","length":255,"@cds.persistence.name":"PLACEOFBIRTH"},"placeOfDeath":{"@title":"{i18n>PlaceOfDeath}","type":"cds.String","length":255,"@cds.persistence.name":"PLACEOFDEATH"},"books":{"type":"cds.Association","cardinality":{"max":"*"},"target":"AdminService.Books","on":[{"ref":["books","author_ID"]},"=",{"ref":["ID"]}],"@cds.persistence.name":"BOOKS"}},"@cds.persistence.name":"ADMINSERVICE_AUTHORS","projection":{"from":{"ref":["my.bookshop.Authors"],"as":"Authors_0"},"columns":[{"ref":["Authors_0","ID"]},{"ref":["Authors_0","createdAt"]},{"ref":["Authors_0","createdBy"]},{"ref":["Authors_0","modifiedAt"]},{"ref":["Authors_0","modifiedBy"]},{"ref":["Authors_0","name"]},{"ref":["Authors_0","dateOfBirth"]},{"ref":["Authors_0","dateOfDeath"]},{"ref":["Authors_0","placeOfBirth"]},{"ref":["Authors_0","placeOfDeath"]},{"ref":["___books"],"as":"books"}],"mixin":{"___books":{"type":"cds.Association","cardinality":{"max":"*"},"target":"AdminService.Books","on":[{"ref":["___books","author_ID"]},"=",{"ref":["$projection","ID"]}]}}}},"AdminService.Languages":{"kind":"entity","@cds.autoexpose":true,"@cds.persistence.skip":"if-unused","@UI.Identification":[{"Value":{"=":"name"}}],"@cds.odata.valuelist":true,"elements":{"name":{"@title":"{i18n>Name}","type":"cds.String","length":255,"@cds.persistence.name":"NAME"},"descr":{"@title":"{i18n>Description}","type":"cds.String","length":1000,"@cds.persistence.name":"DESCR"},"code":{"@Common.Text":{"=":"name"},"@title":"{i18n>LanguageCode}","key":true,"type":"cds.String","length":14,"@cds.persistence.name":"CODE"},"texts":{"type":"cds.Composition","cardinality":{"max":"*"},"target":"AdminService.Languages.texts","on":[{"ref":["texts","code"]},"=",{"ref":["code"]}],"@cds.persistence.name":"TEXTS"},"localized":{"type":"cds.Association","target":"AdminService.Languages.texts","on":[{"ref":["localized","code"]},"=",{"ref":["code"]},"and",{"ref":["localized","locale"]},"=",{"ref":["$user","locale"]}],"@cds.persistence.name":"LOCALIZED"}},"@cds.persistence.name":"ADMINSERVICE_LANGUAGES","projection":{"from":{"ref":["sap.common.Languages"],"as":"CommonLanguages_0"},"columns":[{"ref":["CommonLanguages_0","name"]},{"ref":["CommonLanguages_0","descr"]},{"ref":["CommonLanguages_0","code"]},{"ref":["___texts"],"as":"texts"},{"ref":["___localized"],"as":"localized"}],"mixin":{"___texts":{"type":"cds.Composition","cardinality":{"max":"*"},"target":"AdminService.Languages.texts","on":[{"ref":["___texts","code"]},"=",{"ref":["$projection","code"]}]},"___localized":{"type":"cds.Association","target":"AdminService.Languages.texts","on":[{"ref":["___localized","code"]},"=",{"ref":["$projection","code"]},"and",{"ref":["___localized","locale"]},"=",{"ref":["$user","locale"]}]}}}},"CatalogService":{"kind":"service","@path":"browse","@requires":"any"},"CatalogService.Books":{"kind":"entity","@readonly":true,"@UI.HeaderInfo.TypeName":"{i18n>Book}","@UI.HeaderInfo.TypeNamePlural":"{i18n>Books}","@UI.HeaderInfo.Title.Value":{"=":"title"},"@UI.HeaderInfo.Description.Value":{"=":"author.name"},"@UI.Identification":[{"Value":{"=":"title"}}],"@UI.PresentationVariant.Text":"Default","@UI.PresentationVariant.SortOrder":[{"Property":{"=":"title"}}],"@UI.PresentationVariant.Visualizations":["@UI.LineItem"],"@UI.SelectionFields":[{"=":"author_ID"},{"=":"genre_ID"}],"@UI.LineItem":[{"Value":{"=":"title"}},{"Value":{"=":"author.name"},"Label":"{i18n>Author}"},{"Value":{"=":"genre.name"},"Label":"{i18n>Genre}"},{"Value":{"=":"price"}},{"Value":{"=":"title"}}],"@UI.Facets":[{"$Type":"UI.ReferenceFacet","Label":"{i18n>General}","Target":"@UI.FieldGroup#General"},{"$Type":"UI.ReferenceFacet","Label":"{i18n>Description}","Target":"@UI.FieldGroup#Descr"}],"@UI.FieldGroup#General.Data":[{"Value":{"=":"title"}},{"Value":{"=":"author_ID"}},{"Value":{"=":"genre_ID"}},{"Value":{"=":"title"}}],"@UI.FieldGroup#Descr.Data":[{"Value":{"=":"descr"}}],"@UI.DataPoint#stock.Value":{"=":"stock"},"@UI.DataPoint#stock.Title":"{i18n>Stock}","@UI.DataPoint#price.Value":{"=":"price"},"@UI.DataPoint#price.Title":"{i18n>Price}","@fiori.draft.enabled":true,"@Common.SemanticKey":[{"=":"title"}],"@UI.HeaderInfo.TypeImageUrl":"sap-icon://course-book","elements":{"ID":{"@title":"{i18n>ID}","@UI.HiddenFilter":true,"@Core.Computed":true,"key":true,"type":"cds.String","length":36,"@cds.persistence.name":"ID"},"createdAt":{"@cds.on.insert":{"=":"$now"},"@UI.HiddenFilter":true,"@Core.Immutable":true,"@title":"{i18n>CreatedAt}","@readonly":true,"type":"cds.UTCTimestamp","@cds.persistence.name":"CREATEDAT"},"modifiedAt":{"@cds.on.insert":{"=":"$now"},"@cds.on.update":{"=":"$now"},"@UI.HiddenFilter":true,"@title":"{i18n>ChangedAt}","@readonly":true,"type":"cds.UTCTimestamp","@cds.persistence.name":"MODIFIEDAT"},"title":{"@title":"{i18n>Title}","type":"cds.String","length":111,"@cds.persistence.name":"TITLE"},"descr":{"@title":"{i18n>Description}","@UI.MultiLineText":true,"type":"cds.String","length":1111,"@cds.persistence.name":"DESCR"},"author":{"@ValueList.entity":"Authors","@title":"{i18n>Author}","@Common.Text":{"=":"author.name"},"@Common.TextArrangement":{"#":"TextOnly"},"type":"cds.Association","target":"CatalogService.Authors","keys":[{"ref":["ID"],"as":"ID","$generatedFieldName":"author_ID"}],"on":[{"ref":["author","ID"]},"=",{"ref":["author_ID"]}],"@cds.persistence.name":"AUTHOR"},"author_ID":{"type":"cds.String","length":36,"@odata.foreignKey4":"author","@cds.persistence.name":"AUTHOR_ID"},"genre":{"@title":"{i18n>Genre}","@Common.Text":{"=":"genre.name"},"@Common.TextArrangement":{"#":"TextOnly"},"type":"cds.Association","target":"CatalogService.Genres","keys":[{"ref":["ID"],"as":"ID","$generatedFieldName":"genre_ID"}],"on":[{"ref":["genre","ID"]},"=",{"ref":["genre_ID"]}],"@cds.persistence.name":"GENRE"},"genre_ID":{"type":"cds.Integer","@odata.foreignKey4":"genre","@cds.persistence.name":"GENRE_ID"},"stock":{"@title":"{i18n>Stock}","type":"cds.Integer","@cds.persistence.name":"STOCK"},"price":{"@Measures.ISOCurrency":{"=":"currency_code"},"@title":"{i18n>Price}","type":"cds.Decimal","precision":9,"scale":2,"@cds.persistence.name":"PRICE"},"currency":{"@title":"{i18n>Currency}","@description":"{i18n>CurrencyCode.Description}","type":"cds.Association","target":"CatalogService.Currencies","keys":[{"ref":["code"],"as":"code","$generatedFieldName":"currency_code"}],"on":[{"ref":["currency","code"]},"=",{"ref":["currency_code"]}],"@cds.persistence.name":"CURRENCY"},"currency_code":{"type":"cds.String","length":3,"@odata.foreignKey4":"currency","@cds.persistence.name":"CURRENCY_CODE"},"rating":{"type":"cds.Decimal","precision":2,"scale":1,"@cds.persistence.name":"RATING"},"texts":{"type":"cds.Composition","cardinality":{"max":"*"},"target":"CatalogService.Books.texts","on":[{"ref":["texts","ID"]},"=",{"ref":["ID"]}],"@cds.persistence.name":"TEXTS"},"localized":{"type":"cds.Association","target":"CatalogService.Books.texts","on":[{"ref":["localized","ID"]},"=",{"ref":["ID"]},"and",{"ref":["localized","locale"]},"=",{"ref":["$user","locale"]}],"@cds.persistence.name":"LOCALIZED"}},"@cds.persistence.name":"CATALOGSERVICE_BOOKS","projection":{"from":{"ref":["my.bookshop.Books"],"as":"Books_0"},"columns":[{"ref":["Books_0","ID"]},{"ref":["Books_0","createdAt"]},{"ref":["Books_0","modifiedAt"]},{"ref":["Books_0","title"]},{"ref":["Books_0","descr"]},{"ref":["___author"],"as":"author"},{"ref":["Books_0","author_ID"]},{"ref":["___genre"],"as":"genre"},{"ref":["Books_0","genre_ID"]},{"ref":["Books_0","stock"]},{"ref":["Books_0","price"]},{"ref":["___currency"],"as":"currency"},{"ref":["Books_0","currency_code"]},{"ref":["Books_0","rating"]},{"ref":["___texts"],"as":"texts"},{"ref":["___localized"],"as":"localized"}],"mixin":{"___author":{"@ValueList.entity":"Authors","@title":"{i18n>Author}","@Common.Text":{"=":"author.name"},"@Common.TextArrangement":{"#":"TextOnly"},"type":"cds.Association","target":"CatalogService.Authors","keys":[{"ref":["ID"],"as":"ID","$generatedFieldName":"author_ID"}],"on":[{"ref":["___author","ID"]},"=",{"ref":["$projection","author_ID"]}]},"___genre":{"@title":"{i18n>Genre}","@Common.Text":{"=":"genre.name"},"@Common.TextArrangement":{"#":"TextOnly"},"type":"cds.Association","target":"CatalogService.Genres","keys":[{"ref":["ID"],"as":"ID","$generatedFieldName":"genre_ID"}],"on":[{"ref":["___genre","ID"]},"=",{"ref":["$projection","genre_ID"]}]},"___currency":{"@title":"{i18n>Currency}","@description":"{i18n>CurrencyCode.Description}","type":"cds.Association","target":"CatalogService.Currencies","keys":[{"ref":["code"],"as":"code","$generatedFieldName":"currency_code"}],"on":[{"ref":["___currency","code"]},"=",{"ref":["$projection","currency_code"]}]},"___texts":{"type":"cds.Composition","cardinality":{"max":"*"},"target":"CatalogService.Books.texts","on":[{"ref":["___texts","ID"]},"=",{"ref":["$projection","ID"]}]},"___localized":{"type":"cds.Association","target":"CatalogService.Books.texts","on":[{"ref":["___localized","ID"]},"=",{"ref":["$projection","ID"]},"and",{"ref":["___localized","locale"]},"=",{"ref":["$user","locale"]}]}}}},"CatalogService.Authors":{"kind":"entity","@readonly":true,"@Common.SemanticKey":[{"=":"name"}],"@UI.Identification":[{"Value":{"=":"name"}}],"@UI.SelectionFields":[{"=":"name"}],"@UI.LineItem":[{"Value":{"=":"ID"}},{"Value":{"=":"name"}},{"Value":{"=":"dateOfBirth"}},{"Value":{"=":"dateOfDeath"}},{"Value":{"=":"placeOfBirth"}},{"Value":{"=":"placeOfDeath"}}],"@UI.HeaderInfo.TypeName":"{i18n>Author}","@UI.HeaderInfo.TypeNamePlural":"{i18n>Authors}","@UI.HeaderInfo.Title.Value":{"=":"name"},"@UI.HeaderInfo.Description.Value":{"=":"dateOfBirth"},"@UI.Facets":[{"$Type":"UI.ReferenceFacet","Target":"books/@UI.LineItem"}],"elements":{"ID":{"@title":"{i18n>ID}","@UI.HiddenFilter":true,"@Core.Computed":true,"key":true,"type":"cds.String","length":36,"@cds.persistence.name":"ID"},"createdAt":{"@cds.on.insert":{"=":"$now"},"@UI.HiddenFilter":true,"@Core.Immutable":true,"@title":"{i18n>CreatedAt}","@readonly":true,"type":"cds.UTCTimestamp","@cds.persistence.name":"CREATEDAT"},"createdBy":{"@cds.on.insert":{"=":"$user"},"@UI.HiddenFilter":true,"@Core.Immutable":true,"@title":"{i18n>CreatedBy}","@readonly":true,"@description":"{i18n>UserID.Description}","type":"cds.String","length":255,"@cds.persistence.name":"CREATEDBY"},"modifiedAt":{"@cds.on.insert":{"=":"$now"},"@cds.on.update":{"=":"$now"},"@UI.HiddenFilter":true,"@title":"{i18n>ChangedAt}","@readonly":true,"type":"cds.UTCTimestamp","@cds.persistence.name":"MODIFIEDAT"},"modifiedBy":{"@cds.on.insert":{"=":"$user"},"@cds.on.update":{"=":"$user"},"@UI.HiddenFilter":true,"@title":"{i18n>ChangedBy}","@readonly":true,"@description":"{i18n>UserID.Description}","type":"cds.String","length":255,"@cds.persistence.name":"MODIFIEDBY"},"name":{"@assert.format":"^\\p{Lu}.*","@title":"{i18n>Name}","type":"cds.String","length":111,"@cds.persistence.name":"NAME"},"dateOfBirth":{"@title":"{i18n>DateOfBirth}","type":"cds.LocalDate","@cds.persistence.name":"DATEOFBIRTH"},"dateOfDeath":{"@title":"{i18n>DateOfDeath}","type":"cds.LocalDate","@cds.persistence.name":"DATEOFDEATH"},"placeOfBirth":{"@title":"{i18n>PlaceOfBirth}","type":"cds.String","length":255,"@cds.persistence.name":"PLACEOFBIRTH"},"placeOfDeath":{"@title":"{i18n>PlaceOfDeath}","type":"cds.String","length":255,"@cds.persistence.name":"PLACEOFDEATH"},"books":{"type":"cds.Association","cardinality":{"max":"*"},"target":"CatalogService.Books","on":[{"ref":["books","author_ID"]},"=",{"ref":["ID"]}],"@cds.persistence.name":"BOOKS"}},"@cds.persistence.name":"CATALOGSERVICE_AUTHORS","projection":{"from":{"ref":["my.bookshop.Authors"],"as":"Authors_0"},"columns":[{"ref":["Authors_0","ID"]},{"ref":["Authors_0","createdAt"]},{"ref":["Authors_0","createdBy"]},{"ref":["Authors_0","modifiedAt"]},{"ref":["Authors_0","modifiedBy"]},{"ref":["Authors_0","name"]},{"ref":["Authors_0","dateOfBirth"]},{"ref":["Authors_0","dateOfDeath"]},{"ref":["Authors_0","placeOfBirth"]},{"ref":["Authors_0","placeOfDeath"]},{"ref":["___books"],"as":"books"}],"mixin":{"___books":{"type":"cds.Association","cardinality":{"max":"*"},"target":"CatalogService.Books","on":[{"ref":["___books","author_ID"]},"=",{"ref":["$projection","ID"]}]}}}},"Currency":{"kind":"type","@title":"{i18n>Currency}","@description":"{i18n>CurrencyCode.Description}","type":"cds.Association","target":"sap.common.Currencies","keys":[{"ref":["code"]}],"@cds.persistence.name":"CURRENCY"},"sap.common.Locale":{"kind":"type","@title":"{i18n>LanguageCode}","type":"cds.String","length":14,"@cds.persistence.name":"SAP_COMMON_LOCALE"},"sap.common.Languages":{"kind":"entity","@cds.autoexpose":true,"@cds.persistence.skip":"if-unused","@UI.Identification":[{"Value":{"=":"name"}}],"@cds.odata.valuelist":true,"elements":{"name":{"@title":"{i18n>Name}","type":"cds.String","length":255,"@cds.persistence.name":"NAME"},"descr":{"@title":"{i18n>Description}","type":"cds.String","length":1000,"@cds.persistence.name":"DESCR"},"code":{"@Common.Text":{"=":"name"},"@title":"{i18n>LanguageCode}","key":true,"type":"cds.String","length":14,"@cds.persistence.name":"CODE"},"texts":{"type":"cds.Composition","cardinality":{"max":"*"},"target":"sap.common.Languages.texts","on":[{"ref":["texts","code"]},"=",{"ref":["code"]}],"@cds.persistence.name":"TEXTS"},"localized":{"type":"cds.Association","target":"sap.common.Languages.texts","on":[{"ref":["localized","code"]},"=",{"ref":["code"]},"and",{"ref":["localized","locale"]},"=",{"ref":["$user","locale"]}],"@cds.persistence.name":"LOCALIZED"}},"@cds.persistence.name":"SAP_COMMON_LANGUAGES"},"sap.common.Currencies":{"kind":"entity","@cds.autoexpose":true,"@cds.persistence.skip":"if-unused","@UI.Identification":[{"Value":{"=":"name"}}],"@cds.odata.valuelist":true,"elements":{"name":{"@title":"{i18n>Name}","type":"cds.String","length":255,"@cds.persistence.name":"NAME"},"descr":{"@title":"{i18n>Description}","type":"cds.String","length":1000,"@cds.persistence.name":"DESCR"},"code":{"@title":"{i18n>CurrencyCode}","@Common.Text":{"=":"name"},"key":true,"type":"cds.String","length":3,"@cds.persistence.name":"CODE"},"symbol":{"@title":"{i18n>CurrencySymbol}","type":"cds.String","length":5,"@cds.persistence.name":"SYMBOL"},"minorUnit":{"@title":"{i18n>CurrencyMinorUnit}","type":"cds.Int16","@cds.persistence.name":"MINORUNIT"},"texts":{"type":"cds.Composition","cardinality":{"max":"*"},"target":"sap.common.Currencies.texts","on":[{"ref":["texts","code"]},"=",{"ref":["code"]}],"@cds.persistence.name":"TEXTS"},"localized":{"type":"cds.Association","target":"sap.common.Currencies.texts","on":[{"ref":["localized","code"]},"=",{"ref":["code"]},"and",{"ref":["localized","locale"]},"=",{"ref":["$user","locale"]}],"@cds.persistence.name":"LOCALIZED"}},"@cds.persistence.name":"SAP_COMMON_CURRENCIES"},"sap.common.CodeList":{"kind":"aspect","@cds.autoexpose":true,"@cds.persistence.skip":"if-unused","@UI.Identification":[{"Value":{"=":"name"}}],"@cds.odata.valuelist":true,"elements":{"name":{"@title":"{i18n>Name}","type":"cds.String","length":255,"@cds.persistence.name":"NAME"},"descr":{"@title":"{i18n>Description}","type":"cds.String","length":1000,"@cds.persistence.name":"DESCR"}},"@cds.persistence.name":"SAP_COMMON_CODELIST"},"sap.common.TextsAspect":{"kind":"aspect","elements":{"locale":{"@title":"{i18n>LanguageCode}","key":true,"type":"cds.String","length":14,"@cds.persistence.name":"LOCALE"}},"@cds.persistence.name":"SAP_COMMON_TEXTSASPECT"},"cuid":{"kind":"aspect","elements":{"ID":{"@Core.Computed":true,"key":true,"type":"cds.String","length":36,"@cds.persistence.name":"ID"}},"@cds.persistence.name":"CUID"},"managed":{"kind":"aspect","elements":{"createdAt":{"@cds.on.insert":{"=":"$now"},"@UI.HiddenFilter":true,"@Core.Immutable":true,"@title":"{i18n>CreatedAt}","@readonly":true,"type":"cds.UTCTimestamp","@cds.persistence.name":"CREATEDAT"},"createdBy":{"@cds.on.insert":{"=":"$user"},"@UI.HiddenFilter":true,"@Core.Immutable":true,"@title":"{i18n>CreatedBy}","@readonly":true,"@description":"{i18n>UserID.Description}","type":"cds.String","length":255,"@cds.persistence.name":"CREATEDBY"},"modifiedAt":{"@cds.on.insert":{"=":"$now"},"@cds.on.update":{"=":"$now"},"@UI.HiddenFilter":true,"@title":"{i18n>ChangedAt}","@readonly":true,"type":"cds.UTCTimestamp","@cds.persistence.name":"MODIFIEDAT"},"modifiedBy":{"@cds.on.insert":{"=":"$user"},"@cds.on.update":{"=":"$user"},"@UI.HiddenFilter":true,"@title":"{i18n>ChangedBy}","@readonly":true,"@description":"{i18n>UserID.Description}","type":"cds.String","length":255,"@cds.persistence.name":"MODIFIEDBY"}},"@cds.persistence.name":"MANAGED"},"User":{"kind":"type","@title":"{i18n>UserID}","@description":"{i18n>UserID.Description}","type":"cds.String","length":255,"@cds.persistence.name":"USER"},"my.bookshop.Books.texts":{"kind":"entity","@assert.unique.locale":[{"=":"locale"},{"=":"ID"}],"elements":{"ID_texts":{"key":true,"type":"cds.String","length":36,"@cds.persistence.name":"ID_TEXTS"},"locale":{"@title":"{i18n>LanguageCode}","type":"cds.String","length":14,"@cds.persistence.name":"LOCALE"},"ID":{"@title":"{i18n>ID}","@UI.HiddenFilter":true,"@Core.Computed":true,"type":"cds.String","length":36,"@cds.persistence.name":"ID"},"title":{"@title":"{i18n>Title}","localized":null,"type":"cds.String","length":111,"@cds.persistence.name":"TITLE"},"descr":{"@title":"{i18n>Description}","@UI.MultiLineText":true,"localized":null,"type":"cds.String","length":1111,"@cds.persistence.name":"DESCR"}},"$tableConstraints":{"unique":{"locale":{"paths":[{"ref":["locale"],"isChecked":true},{"ref":["ID"],"isChecked":true}],"parentTable":"my.bookshop.Books.texts"}}},"@cds.persistence.name":"MY_BOOKSHOP_BOOKS_TEXTS"},"my.bookshop.Genres.texts":{"kind":"entity","@odata.draft.enabled":false,"elements":{"locale":{"@title":"{i18n>LanguageCode}","key":true,"type":"cds.String","length":14,"@cds.persistence.name":"LOCALE"},"name":{"@title":"{i18n>Genre}","localized":null,"type":"cds.String","length":255,"@cds.persistence.name":"NAME"},"descr":{"@title":"{i18n>Description}","localized":null,"type":"cds.String","length":1000,"@cds.persistence.name":"DESCR"},"ID":{"@odata.containment.ignore":true,"@title":"{i18n>ID}","key":true,"type":"cds.Integer","@cds.persistence.name":"ID"}},"@cds.persistence.name":"MY_BOOKSHOP_GENRES_TEXTS"},"sap.common.Languages.texts":{"kind":"entity","@odata.draft.enabled":false,"elements":{"locale":{"@title":"{i18n>LanguageCode}","key":true,"type":"cds.String","length":14,"@cds.persistence.name":"LOCALE"},"name":{"@title":"{i18n>Name}","localized":null,"type":"cds.String","length":255,"@cds.persistence.name":"NAME"},"descr":{"@title":"{i18n>Description}","localized":null,"type":"cds.String","length":1000,"@cds.persistence.name":"DESCR"},"code":{"@odata.containment.ignore":true,"@Common.Text":{"=":"name"},"@title":"{i18n>LanguageCode}","key":true,"type":"cds.String","length":14,"@cds.persistence.name":"CODE"}},"@cds.persistence.name":"SAP_COMMON_LANGUAGES_TEXTS"},"sap.common.Currencies.texts":{"kind":"entity","@odata.draft.enabled":false,"elements":{"locale":{"@title":"{i18n>LanguageCode}","key":true,"type":"cds.String","length":14,"@cds.persistence.name":"LOCALE"},"name":{"@title":"{i18n>Name}","localized":null,"type":"cds.String","length":255,"@cds.persistence.name":"NAME"},"descr":{"@title":"{i18n>Description}","localized":null,"type":"cds.String","length":1000,"@cds.persistence.name":"DESCR"},"code":{"@odata.containment.ignore":true,"@title":"{i18n>CurrencyCode}","@Common.Text":{"=":"name"},"key":true,"type":"cds.String","length":3,"@cds.persistence.name":"CODE"}},"@cds.persistence.name":"SAP_COMMON_CURRENCIES_TEXTS"},"AdminService.Genres":{"kind":"entity","@cds.autoexposed":true,"@Common.SemanticKey":[{"=":"name"}],"@UI.SelectionFields":[{"=":"name"}],"@UI.LineItem":[{"Value":{"=":"name"}},{"Value":{"=":"parent.name"},"Label":"Main Genre"}],"@UI.Identification":[{"Value":{"=":"name"}}],"@UI.HeaderInfo.TypeName":"{i18n>Genre}","@UI.HeaderInfo.TypeNamePlural":"{i18n>Genres}","@UI.HeaderInfo.Title.Value":{"=":"name"},"@UI.HeaderInfo.Description.Value":{"=":"ID"},"@UI.Facets":[{"$Type":"UI.ReferenceFacet","Label":"{i18n>SubGenres}","Target":"children/@UI.LineItem"}],"@cds.autoexpose":true,"@cds.persistence.skip":"if-unused","@cds.odata.valuelist":true,"elements":{"name":{"@title":"{i18n>Genre}","type":"cds.String","length":255,"@cds.persistence.name":"NAME"},"descr":{"@title":"{i18n>Description}","type":"cds.String","length":1000,"@cds.persistence.name":"DESCR"},"ID":{"@title":"{i18n>ID}","key":true,"type":"cds.Integer","@cds.persistence.name":"ID"},"parent":{"type":"cds.Association","target":"AdminService.Genres","keys":[{"ref":["ID"],"as":"ID","$generatedFieldName":"parent_ID"}],"on":[{"ref":["parent","ID"]},"=",{"ref":["parent_ID"]}],"@cds.persistence.name":"PARENT"},"parent_ID":{"type":"cds.Integer","@odata.foreignKey4":"parent","@cds.persistence.name":"PARENT_ID"},"children":{"type":"cds.Composition","cardinality":{"max":"*"},"target":"AdminService.Genres","on":[{"ref":["children","parent_ID"]},"=",{"ref":["ID"]}],"@cds.persistence.name":"CHILDREN"},"texts":{"type":"cds.Composition","cardinality":{"max":"*"},"target":"AdminService.Genres.texts","on":[{"ref":["texts","ID"]},"=",{"ref":["ID"]}],"@cds.persistence.name":"TEXTS"},"localized":{"type":"cds.Association","target":"AdminService.Genres.texts","on":[{"ref":["localized","ID"]},"=",{"ref":["ID"]},"and",{"ref":["localized","locale"]},"=",{"ref":["$user","locale"]}],"@cds.persistence.name":"LOCALIZED"}},"@cds.persistence.name":"ADMINSERVICE_GENRES","projection":{"from":{"ref":["my.bookshop.Genres"],"as":"Genres_0"},"columns":[{"ref":["Genres_0","name"]},{"ref":["Genres_0","descr"]},{"ref":["Genres_0","ID"]},{"ref":["___parent"],"as":"parent"},{"ref":["Genres_0","parent_ID"]},{"ref":["___children"],"as":"children"},{"ref":["___texts"],"as":"texts"},{"ref":["___localized"],"as":"localized"}],"mixin":{"___parent":{"type":"cds.Association","target":"AdminService.Genres","keys":[{"ref":["ID"],"as":"ID","$generatedFieldName":"parent_ID"}],"on":[{"ref":["___parent","ID"]},"=",{"ref":["$projection","parent_ID"]}]},"___children":{"type":"cds.Composition","cardinality":{"max":"*"},"target":"AdminService.Genres","on":[{"ref":["___children","parent_ID"]},"=",{"ref":["$projection","ID"]}]},"___texts":{"type":"cds.Composition","cardinality":{"max":"*"},"target":"AdminService.Genres.texts","on":[{"ref":["___texts","ID"]},"=",{"ref":["$projection","ID"]}]},"___localized":{"type":"cds.Association","target":"AdminService.Genres.texts","on":[{"ref":["___localized","ID"]},"=",{"ref":["$projection","ID"]},"and",{"ref":["___localized","locale"]},"=",{"ref":["$user","locale"]}]}}}},"AdminService.Currencies":{"kind":"entity","@cds.autoexposed":true,"@cds.autoexpose":true,"@cds.persistence.skip":"if-unused","@UI.Identification":[{"Value":{"=":"name"}}],"@cds.odata.valuelist":true,"elements":{"name":{"@title":"{i18n>Name}","type":"cds.String","length":255,"@cds.persistence.name":"NAME"},"descr":{"@title":"{i18n>Description}","type":"cds.String","length":1000,"@cds.persistence.name":"DESCR"},"code":{"@title":"{i18n>CurrencyCode}","@Common.Text":{"=":"name"},"key":true,"type":"cds.String","length":3,"@cds.persistence.name":"CODE"},"symbol":{"@title":"{i18n>CurrencySymbol}","type":"cds.String","length":5,"@cds.persistence.name":"SYMBOL"},"minorUnit":{"@title":"{i18n>CurrencyMinorUnit}","type":"cds.Int16","@cds.persistence.name":"MINORUNIT"},"texts":{"type":"cds.Composition","cardinality":{"max":"*"},"target":"AdminService.Currencies.texts","on":[{"ref":["texts","code"]},"=",{"ref":["code"]}],"@cds.persistence.name":"TEXTS"},"localized":{"type":"cds.Association","target":"AdminService.Currencies.texts","on":[{"ref":["localized","code"]},"=",{"ref":["code"]},"and",{"ref":["localized","locale"]},"=",{"ref":["$user","locale"]}],"@cds.persistence.name":"LOCALIZED"}},"@cds.persistence.name":"ADMINSERVICE_CURRENCIES","projection":{"from":{"ref":["sap.common.Currencies"],"as":"Currencies_0"},"columns":[{"ref":["Currencies_0","name"]},{"ref":["Currencies_0","descr"]},{"ref":["Currencies_0","code"]},{"ref":["Currencies_0","symbol"]},{"ref":["Currencies_0","minorUnit"]},{"ref":["___texts"],"as":"texts"},{"ref":["___localized"],"as":"localized"}],"mixin":{"___texts":{"type":"cds.Composition","cardinality":{"max":"*"},"target":"AdminService.Currencies.texts","on":[{"ref":["___texts","code"]},"=",{"ref":["$projection","code"]}]},"___localized":{"type":"cds.Association","target":"AdminService.Currencies.texts","on":[{"ref":["___localized","code"]},"=",{"ref":["$projection","code"]},"and",{"ref":["___localized","locale"]},"=",{"ref":["$user","locale"]}]}}}},"AdminService.Books.texts":{"kind":"entity","@cds.autoexposed":true,"@UI.Identification":[{"Value":{"=":"title"}}],"@UI.SelectionFields":[{"=":"locale"},{"=":"title"}],"@UI.LineItem":[{"Value":{"=":"locale"},"Label":"Locale"},{"Value":{"=":"title"},"Label":"Title"},{"Value":{"=":"descr"},"Label":"Description"}],"@assert.unique.locale":[{"=":"locale"},{"=":"ID"}],"elements":{"ID_texts":{"key":true,"type":"cds.String","length":36,"@cds.persistence.name":"ID_TEXTS"},"locale":{"@ValueList.entity":"Languages","@ValueList.type":{"#":"fixed"},"@title":"{i18n>LanguageCode}","type":"cds.String","length":14,"@cds.persistence.name":"LOCALE"},"ID":{"@title":"{i18n>ID}","@UI.HiddenFilter":true,"@Core.Computed":true,"type":"cds.String","length":36,"@cds.persistence.name":"ID"},"title":{"@title":"{i18n>Title}","localized":null,"type":"cds.String","length":111,"@cds.persistence.name":"TITLE"},"descr":{"@title":"{i18n>Description}","@UI.MultiLineText":true,"localized":null,"type":"cds.String","length":1111,"@cds.persistence.name":"DESCR"}},"@cds.persistence.name":"ADMINSERVICE_BOOKS_TEXTS","projection":{"from":{"ref":["my.bookshop.Books.texts"],"as":"texts_0"},"columns":[{"ref":["texts_0","ID_texts"]},{"ref":["texts_0","locale"]},{"ref":["texts_0","ID"]},{"ref":["texts_0","title"]},{"ref":["texts_0","descr"]}]}},"AdminService.Languages.texts":{"kind":"entity","@cds.autoexposed":true,"@odata.draft.enabled":false,"elements":{"locale":{"@title":"{i18n>LanguageCode}","key":true,"type":"cds.String","length":14,"@cds.persistence.name":"LOCALE"},"name":{"@title":"{i18n>Name}","localized":null,"type":"cds.String","length":255,"@cds.persistence.name":"NAME"},"descr":{"@title":"{i18n>Description}","localized":null,"type":"cds.String","length":1000,"@cds.persistence.name":"DESCR"},"code":{"@odata.containment.ignore":true,"@Common.Text":{"=":"name"},"@title":"{i18n>LanguageCode}","key":true,"type":"cds.String","length":14,"@cds.persistence.name":"CODE"}},"@cds.persistence.name":"ADMINSERVICE_LANGUAGES_TEXTS","projection":{"from":{"ref":["sap.common.Languages.texts"],"as":"texts_0"},"columns":[{"ref":["texts_0","locale"]},{"ref":["texts_0","name"]},{"ref":["texts_0","descr"]},{"ref":["texts_0","code"]}]}},"CatalogService.Genres":{"kind":"entity","@cds.autoexposed":true,"@Common.SemanticKey":[{"=":"name"}],"@UI.SelectionFields":[{"=":"name"}],"@UI.LineItem":[{"Value":{"=":"name"}},{"Value":{"=":"parent.name"},"Label":"Main Genre"}],"@UI.Identification":[{"Value":{"=":"name"}}],"@UI.HeaderInfo.TypeName":"{i18n>Genre}","@UI.HeaderInfo.TypeNamePlural":"{i18n>Genres}","@UI.HeaderInfo.Title.Value":{"=":"name"},"@UI.HeaderInfo.Description.Value":{"=":"ID"},"@UI.Facets":[{"$Type":"UI.ReferenceFacet","Label":"{i18n>SubGenres}","Target":"children/@UI.LineItem"}],"@cds.autoexpose":true,"@cds.persistence.skip":"if-unused","@cds.odata.valuelist":true,"elements":{"name":{"@title":"{i18n>Genre}","type":"cds.String","length":255,"@cds.persistence.name":"NAME"},"descr":{"@title":"{i18n>Description}","type":"cds.String","length":1000,"@cds.persistence.name":"DESCR"},"ID":{"@title":"{i18n>ID}","key":true,"type":"cds.Integer","@cds.persistence.name":"ID"},"parent":{"type":"cds.Association","target":"CatalogService.Genres","keys":[{"ref":["ID"],"as":"ID","$generatedFieldName":"parent_ID"}],"on":[{"ref":["parent","ID"]},"=",{"ref":["parent_ID"]}],"@cds.persistence.name":"PARENT"},"parent_ID":{"type":"cds.Integer","@odata.foreignKey4":"parent","@cds.persistence.name":"PARENT_ID"},"children":{"type":"cds.Composition","cardinality":{"max":"*"},"target":"CatalogService.Genres","on":[{"ref":["children","parent_ID"]},"=",{"ref":["ID"]}],"@cds.persistence.name":"CHILDREN"},"texts":{"type":"cds.Composition","cardinality":{"max":"*"},"target":"CatalogService.Genres.texts","on":[{"ref":["texts","ID"]},"=",{"ref":["ID"]}],"@cds.persistence.name":"TEXTS"},"localized":{"type":"cds.Association","target":"CatalogService.Genres.texts","on":[{"ref":["localized","ID"]},"=",{"ref":["ID"]},"and",{"ref":["localized","locale"]},"=",{"ref":["$user","locale"]}],"@cds.persistence.name":"LOCALIZED"}},"@cds.persistence.name":"CATALOGSERVICE_GENRES","projection":{"from":{"ref":["my.bookshop.Genres"],"as":"Genres_0"},"columns":[{"ref":["Genres_0","name"]},{"ref":["Genres_0","descr"]},{"ref":["Genres_0","ID"]},{"ref":["___parent"],"as":"parent"},{"ref":["Genres_0","parent_ID"]},{"ref":["___children"],"as":"children"},{"ref":["___texts"],"as":"texts"},{"ref":["___localized"],"as":"localized"}],"mixin":{"___parent":{"type":"cds.Association","target":"CatalogService.Genres","keys":[{"ref":["ID"],"as":"ID","$generatedFieldName":"parent_ID"}],"on":[{"ref":["___parent","ID"]},"=",{"ref":["$projection","parent_ID"]}]},"___children":{"type":"cds.Composition","cardinality":{"max":"*"},"target":"CatalogService.Genres","on":[{"ref":["___children","parent_ID"]},"=",{"ref":["$projection","ID"]}]},"___texts":{"type":"cds.Composition","cardinality":{"max":"*"},"target":"CatalogService.Genres.texts","on":[{"ref":["___texts","ID"]},"=",{"ref":["$projection","ID"]}]},"___localized":{"type":"cds.Association","target":"CatalogService.Genres.texts","on":[{"ref":["___localized","ID"]},"=",{"ref":["$projection","ID"]},"and",{"ref":["___localized","locale"]},"=",{"ref":["$user","locale"]}]}}}},"CatalogService.Currencies":{"kind":"entity","@cds.autoexposed":true,"@cds.autoexpose":true,"@cds.persistence.skip":"if-unused","@UI.Identification":[{"Value":{"=":"name"}}],"@cds.odata.valuelist":true,"elements":{"name":{"@title":"{i18n>Name}","type":"cds.String","length":255,"@cds.persistence.name":"NAME"},"descr":{"@title":"{i18n>Description}","type":"cds.String","length":1000,"@cds.persistence.name":"DESCR"},"code":{"@title":"{i18n>CurrencyCode}","@Common.Text":{"=":"name"},"key":true,"type":"cds.String","length":3,"@cds.persistence.name":"CODE"},"symbol":{"@title":"{i18n>CurrencySymbol}","type":"cds.String","length":5,"@cds.persistence.name":"SYMBOL"},"minorUnit":{"@title":"{i18n>CurrencyMinorUnit}","type":"cds.Int16","@cds.persistence.name":"MINORUNIT"},"texts":{"type":"cds.Composition","cardinality":{"max":"*"},"target":"CatalogService.Currencies.texts","on":[{"ref":["texts","code"]},"=",{"ref":["code"]}],"@cds.persistence.name":"TEXTS"},"localized":{"type":"cds.Association","target":"CatalogService.Currencies.texts","on":[{"ref":["localized","code"]},"=",{"ref":["code"]},"and",{"ref":["localized","locale"]},"=",{"ref":["$user","locale"]}],"@cds.persistence.name":"LOCALIZED"}},"@cds.persistence.name":"CATALOGSERVICE_CURRENCIES","projection":{"from":{"ref":["sap.common.Currencies"],"as":"Currencies_0"},"columns":[{"ref":["Currencies_0","name"]},{"ref":["Currencies_0","descr"]},{"ref":["Currencies_0","code"]},{"ref":["Currencies_0","symbol"]},{"ref":["Currencies_0","minorUnit"]},{"ref":["___texts"],"as":"texts"},{"ref":["___localized"],"as":"localized"}],"mixin":{"___texts":{"type":"cds.Composition","cardinality":{"max":"*"},"target":"CatalogService.Currencies.texts","on":[{"ref":["___texts","code"]},"=",{"ref":["$projection","code"]}]},"___localized":{"type":"cds.Association","target":"CatalogService.Currencies.texts","on":[{"ref":["___localized","code"]},"=",{"ref":["$projection","code"]},"and",{"ref":["___localized","locale"]},"=",{"ref":["$user","locale"]}]}}}},"CatalogService.Books.texts":{"kind":"entity","@cds.autoexposed":true,"@UI.LineItem":[{"Value":{"=":"locale"}},{"Value":{"=":"title"}},{"Value":{"=":"descr"}}],"@assert.unique.locale":[{"=":"locale"},{"=":"ID"}],"elements":{"ID_texts":{"key":true,"type":"cds.String","length":36,"@cds.persistence.name":"ID_TEXTS"},"locale":{"@title":"{i18n>LanguageCode}","type":"cds.String","length":14,"@cds.persistence.name":"LOCALE"},"ID":{"@title":"{i18n>ID}","@UI.HiddenFilter":true,"@Core.Computed":true,"type":"cds.String","length":36,"@cds.persistence.name":"ID"},"title":{"@title":"{i18n>Title}","localized":null,"type":"cds.String","length":111,"@cds.persistence.name":"TITLE"},"descr":{"@title":"{i18n>Description}","@UI.MultiLineText":true,"localized":null,"type":"cds.String","length":1111,"@cds.persistence.name":"DESCR"}},"@cds.persistence.name":"CATALOGSERVICE_BOOKS_TEXTS","projection":{"from":{"ref":["my.bookshop.Books.texts"],"as":"texts_0"},"columns":[{"ref":["texts_0","ID_texts"]},{"ref":["texts_0","locale"]},{"ref":["texts_0","ID"]},{"ref":["texts_0","title"]},{"ref":["texts_0","descr"]}]}},"AdminService.Genres.texts":{"kind":"entity","@cds.autoexposed":true,"@odata.draft.enabled":false,"elements":{"locale":{"@title":"{i18n>LanguageCode}","key":true,"type":"cds.String","length":14,"@cds.persistence.name":"LOCALE"},"name":{"@title":"{i18n>Genre}","localized":null,"type":"cds.String","length":255,"@cds.persistence.name":"NAME"},"descr":{"@title":"{i18n>Description}","localized":null,"type":"cds.String","length":1000,"@cds.persistence.name":"DESCR"},"ID":{"@odata.containment.ignore":true,"@title":"{i18n>ID}","key":true,"type":"cds.Integer","@cds.persistence.name":"ID"}},"@cds.persistence.name":"ADMINSERVICE_GENRES_TEXTS","projection":{"from":{"ref":["my.bookshop.Genres.texts"],"as":"texts_0"},"columns":[{"ref":["texts_0","locale"]},{"ref":["texts_0","name"]},{"ref":["texts_0","descr"]},{"ref":["texts_0","ID"]}]}},"AdminService.Currencies.texts":{"kind":"entity","@cds.autoexposed":true,"@odata.draft.enabled":false,"elements":{"locale":{"@title":"{i18n>LanguageCode}","key":true,"type":"cds.String","length":14,"@cds.persistence.name":"LOCALE"},"name":{"@title":"{i18n>Name}","localized":null,"type":"cds.String","length":255,"@cds.persistence.name":"NAME"},"descr":{"@title":"{i18n>Description}","localized":null,"type":"cds.String","length":1000,"@cds.persistence.name":"DESCR"},"code":{"@odata.containment.ignore":true,"@title":"{i18n>CurrencyCode}","@Common.Text":{"=":"name"},"key":true,"type":"cds.String","length":3,"@cds.persistence.name":"CODE"}},"@cds.persistence.name":"ADMINSERVICE_CURRENCIES_TEXTS","projection":{"from":{"ref":["sap.common.Currencies.texts"],"as":"texts_0"},"columns":[{"ref":["texts_0","locale"]},{"ref":["texts_0","name"]},{"ref":["texts_0","descr"]},{"ref":["texts_0","code"]}]}},"CatalogService.Genres.texts":{"kind":"entity","@cds.autoexposed":true,"@odata.draft.enabled":false,"elements":{"locale":{"@title":"{i18n>LanguageCode}","key":true,"type":"cds.String","length":14,"@cds.persistence.name":"LOCALE"},"name":{"@title":"{i18n>Genre}","localized":null,"type":"cds.String","length":255,"@cds.persistence.name":"NAME"},"descr":{"@title":"{i18n>Description}","localized":null,"type":"cds.String","length":1000,"@cds.persistence.name":"DESCR"},"ID":{"@odata.containment.ignore":true,"@title":"{i18n>ID}","key":true,"type":"cds.Integer","@cds.persistence.name":"ID"}},"@cds.persistence.name":"CATALOGSERVICE_GENRES_TEXTS","projection":{"from":{"ref":["my.bookshop.Genres.texts"],"as":"texts_0"},"columns":[{"ref":["texts_0","locale"]},{"ref":["texts_0","name"]},{"ref":["texts_0","descr"]},{"ref":["texts_0","ID"]}]}},"CatalogService.Currencies.texts":{"kind":"entity","@cds.autoexposed":true,"@odata.draft.enabled":false,"elements":{"locale":{"@title":"{i18n>LanguageCode}","key":true,"type":"cds.String","length":14,"@cds.persistence.name":"LOCALE"},"name":{"@title":"{i18n>Name}","localized":null,"type":"cds.String","length":255,"@cds.persistence.name":"NAME"},"descr":{"@title":"{i18n>Description}","localized":null,"type":"cds.String","length":1000,"@cds.persistence.name":"DESCR"},"code":{"@odata.containment.ignore":true,"@title":"{i18n>CurrencyCode}","@Common.Text":{"=":"name"},"key":true,"type":"cds.String","length":3,"@cds.persistence.name":"CODE"}},"@cds.persistence.name":"CATALOGSERVICE_CURRENCIES_TEXTS","projection":{"from":{"ref":["sap.common.Currencies.texts"],"as":"texts_0"},"columns":[{"ref":["texts_0","locale"]},{"ref":["texts_0","name"]},{"ref":["texts_0","descr"]},{"ref":["texts_0","code"]}]}},"localized.my.bookshop.Books":{"@odata.draft.enabled":false,"kind":"entity","query":{"SELECT":{"from":{"join":"left","args":[{"ref":["my.bookshop.Books"],"as":"L_0"},{"ref":["my.bookshop.Books.texts"],"as":"localized_1"}],"on":[{"ref":["localized_1","ID"]},"=",{"ref":["L_0","ID"]},"and",{"ref":["localized_1","locale"]},"=",{"ref":["$user","locale"]}]},"columns":[{"ref":["L_0","ID"]},{"ref":["L_0","createdAt"]},{"ref":["L_0","createdBy"]},{"ref":["L_0","modifiedAt"]},{"ref":["L_0","modifiedBy"]},{"func":"coalesce","args":[{"ref":["localized_1","title"]},{"ref":["L_0","title"]}],"as":"title"},{"func":"coalesce","args":[{"ref":["localized_1","descr"]},{"ref":["L_0","descr"]}],"as":"descr"},{"ref":["___author"],"as":"author"},{"ref":["L_0","author_ID"]},{"ref":["___genre"],"as":"genre"},{"ref":["L_0","genre_ID"]},{"ref":["L_0","stock"]},{"ref":["L_0","price"]},{"ref":["___currency"],"as":"currency"},{"ref":["L_0","currency_code"]},{"ref":["L_0","rating"]},{"ref":["___texts"],"as":"texts"},{"ref":["___localized"],"as":"localized"}],"mixin":{"___author":{"@ValueList.entity":"Authors","@title":"{i18n>Author}","@Common.Text":{"=":"author.name"},"@Common.TextArrangement":{"#":"TextOnly"},"type":"cds.Association","target":"localized.my.bookshop.Authors","keys":[{"ref":["ID"],"as":"ID","$generatedFieldName":"author_ID"}],"on":[{"ref":["___author","ID"]},"=",{"ref":["$projection","author_ID"]}]},"___genre":{"@title":"{i18n>Genre}","@Common.Text":{"=":"genre.name"},"@Common.TextArrangement":{"#":"TextOnly"},"type":"cds.Association","target":"localized.my.bookshop.Genres","keys":[{"ref":["ID"],"as":"ID","$generatedFieldName":"genre_ID"}],"on":[{"ref":["___genre","ID"]},"=",{"ref":["$projection","genre_ID"]}]},"___currency":{"@title":"{i18n>Currency}","@description":"{i18n>CurrencyCode.Description}","type":"cds.Association","target":"localized.sap.common.Currencies","keys":[{"ref":["code"],"as":"code","$generatedFieldName":"currency_code"}],"on":[{"ref":["___currency","code"]},"=",{"ref":["$projection","currency_code"]}]},"___texts":{"type":"cds.Composition","cardinality":{"max":"*"},"target":"my.bookshop.Books.texts","on":[{"ref":["___texts","ID"]},"=",{"ref":["$projection","ID"]}]},"___localized":{"type":"cds.Association","target":"my.bookshop.Books.texts","on":[{"ref":["___localized","ID"]},"=",{"ref":["$projection","ID"]},"and",{"ref":["___localized","locale"]},"=",{"ref":["$user","locale"]}]}}}},"elements":{"ID":{"@title":"{i18n>ID}","@UI.HiddenFilter":true,"@Core.Computed":true,"key":true,"type":"cds.String","length":36,"@cds.persistence.name":"ID"},"createdAt":{"@cds.on.insert":{"=":"$now"},"@UI.HiddenFilter":true,"@Core.Immutable":true,"@title":"{i18n>CreatedAt}","@readonly":true,"type":"cds.UTCTimestamp","@cds.persistence.name":"CREATEDAT"},"createdBy":{"@cds.on.insert":{"=":"$user"},"@UI.HiddenFilter":true,"@Core.Immutable":true,"@title":"{i18n>CreatedBy}","@readonly":true,"@description":"{i18n>UserID.Description}","type":"cds.String","length":255,"@cds.persistence.name":"CREATEDBY"},"modifiedAt":{"@cds.on.insert":{"=":"$now"},"@cds.on.update":{"=":"$now"},"@UI.HiddenFilter":true,"@title":"{i18n>ChangedAt}","@readonly":true,"type":"cds.UTCTimestamp","@cds.persistence.name":"MODIFIEDAT"},"modifiedBy":{"@cds.on.insert":{"=":"$user"},"@cds.on.update":{"=":"$user"},"@UI.HiddenFilter":true,"@title":"{i18n>ChangedBy}","@readonly":true,"@description":"{i18n>UserID.Description}","type":"cds.String","length":255,"@cds.persistence.name":"MODIFIEDBY"},"title":{"@title":"{i18n>Title}","type":"cds.String","length":111,"@Core.Computed":true,"@cds.persistence.name":"TITLE"},"descr":{"@title":"{i18n>Description}","@UI.MultiLineText":true,"type":"cds.String","length":1111,"@Core.Computed":true,"@cds.persistence.name":"DESCR"},"author":{"@ValueList.entity":"Authors","@title":"{i18n>Author}","@Common.Text":{"=":"author.name"},"@Common.TextArrangement":{"#":"TextOnly"},"type":"cds.Association","target":"localized.my.bookshop.Authors","keys":[{"ref":["ID"],"as":"ID","$generatedFieldName":"author_ID"}],"on":[{"ref":["author","ID"]},"=",{"ref":["author_ID"]}],"@cds.persistence.name":"AUTHOR"},"author_ID":{"@odata.foreignKey4":"author","type":"cds.String","length":36,"@cds.persistence.name":"AUTHOR_ID"},"genre":{"@title":"{i18n>Genre}","@Common.Text":{"=":"genre.name"},"@Common.TextArrangement":{"#":"TextOnly"},"type":"cds.Association","target":"localized.my.bookshop.Genres","keys":[{"ref":["ID"],"as":"ID","$generatedFieldName":"genre_ID"}],"on":[{"ref":["genre","ID"]},"=",{"ref":["genre_ID"]}],"@cds.persistence.name":"GENRE"},"genre_ID":{"@odata.foreignKey4":"genre","type":"cds.Integer","@cds.persistence.name":"GENRE_ID"},"stock":{"@title":"{i18n>Stock}","type":"cds.Integer","@cds.persistence.name":"STOCK"},"price":{"@title":"{i18n>Price}","type":"cds.Decimal","precision":9,"scale":2,"@cds.persistence.name":"PRICE"},"currency":{"@title":"{i18n>Currency}","@description":"{i18n>CurrencyCode.Description}","type":"cds.Association","target":"localized.sap.common.Currencies","keys":[{"ref":["code"],"as":"code","$generatedFieldName":"currency_code"}],"on":[{"ref":["currency","code"]},"=",{"ref":["currency_code"]}],"@cds.persistence.name":"CURRENCY"},"currency_code":{"@odata.foreignKey4":"currency","type":"cds.String","length":3,"@cds.persistence.name":"CURRENCY_CODE"},"rating":{"type":"cds.Decimal","precision":2,"scale":1,"@cds.persistence.name":"RATING"},"texts":{"type":"cds.Composition","cardinality":{"max":"*"},"target":"my.bookshop.Books.texts","on":[{"ref":["texts","ID"]},"=",{"ref":["ID"]}],"@cds.persistence.name":"TEXTS"},"localized":{"type":"cds.Association","target":"my.bookshop.Books.texts","on":[{"ref":["localized","ID"]},"=",{"ref":["ID"]},"and",{"ref":["localized","locale"]},"=",{"ref":["$user","locale"]}],"@cds.persistence.name":"LOCALIZED"}},"@cds.persistence.name":"LOCALIZED_MY_BOOKSHOP_BOOKS"},"localized.my.bookshop.Genres":{"@odata.draft.enabled":false,"kind":"entity","query":{"SELECT":{"from":{"join":"left","args":[{"ref":["my.bookshop.Genres"],"as":"L_0"},{"ref":["my.bookshop.Genres.texts"],"as":"localized_1"}],"on":[{"ref":["localized_1","ID"]},"=",{"ref":["L_0","ID"]},"and",{"ref":["localized_1","locale"]},"=",{"ref":["$user","locale"]}]},"columns":[{"func":"coalesce","args":[{"ref":["localized_1","name"]},{"ref":["L_0","name"]}],"as":"name"},{"func":"coalesce","args":[{"ref":["localized_1","descr"]},{"ref":["L_0","descr"]}],"as":"descr"},{"ref":["L_0","ID"]},{"ref":["___parent"],"as":"parent"},{"ref":["L_0","parent_ID"]},{"ref":["___children"],"as":"children"},{"ref":["___texts"],"as":"texts"},{"ref":["___localized"],"as":"localized"}],"mixin":{"___parent":{"type":"cds.Association","target":"localized.my.bookshop.Genres","keys":[{"ref":["ID"],"as":"ID","$generatedFieldName":"parent_ID"}],"on":[{"ref":["___parent","ID"]},"=",{"ref":["$projection","parent_ID"]}]},"___children":{"type":"cds.Composition","cardinality":{"max":"*"},"target":"localized.my.bookshop.Genres","on":[{"ref":["___children","parent_ID"]},"=",{"ref":["$projection","ID"]}]},"___texts":{"type":"cds.Composition","cardinality":{"max":"*"},"target":"my.bookshop.Genres.texts","on":[{"ref":["___texts","ID"]},"=",{"ref":["$projection","ID"]}]},"___localized":{"type":"cds.Association","target":"my.bookshop.Genres.texts","on":[{"ref":["___localized","ID"]},"=",{"ref":["$projection","ID"]},"and",{"ref":["___localized","locale"]},"=",{"ref":["$user","locale"]}]}}}},"elements":{"name":{"@title":"{i18n>Genre}","type":"cds.String","length":255,"@Core.Computed":true,"@cds.persistence.name":"NAME"},"descr":{"@title":"{i18n>Description}","type":"cds.String","length":1000,"@Core.Computed":true,"@cds.persistence.name":"DESCR"},"ID":{"@title":"{i18n>ID}","key":true,"type":"cds.Integer","@cds.persistence.name":"ID"},"parent":{"type":"cds.Association","target":"localized.my.bookshop.Genres","keys":[{"ref":["ID"],"as":"ID","$generatedFieldName":"parent_ID"}],"on":[{"ref":["parent","ID"]},"=",{"ref":["parent_ID"]}],"@cds.persistence.name":"PARENT"},"parent_ID":{"@odata.foreignKey4":"parent","type":"cds.Integer","@cds.persistence.name":"PARENT_ID"},"children":{"type":"cds.Composition","cardinality":{"max":"*"},"target":"localized.my.bookshop.Genres","on":[{"ref":["children","parent_ID"]},"=",{"ref":["ID"]}],"@cds.persistence.name":"CHILDREN"},"texts":{"type":"cds.Composition","cardinality":{"max":"*"},"target":"my.bookshop.Genres.texts","on":[{"ref":["texts","ID"]},"=",{"ref":["ID"]}],"@cds.persistence.name":"TEXTS"},"localized":{"type":"cds.Association","target":"my.bookshop.Genres.texts","on":[{"ref":["localized","ID"]},"=",{"ref":["ID"]},"and",{"ref":["localized","locale"]},"=",{"ref":["$user","locale"]}],"@cds.persistence.name":"LOCALIZED"}},"@cds.persistence.skip":"if-unused","@cds.persistence.name":"LOCALIZED_MY_BOOKSHOP_GENRES"},"localized.sap.common.Languages":{"@odata.draft.enabled":false,"kind":"entity","query":{"SELECT":{"from":{"join":"left","args":[{"ref":["sap.common.Languages"],"as":"L_0"},{"ref":["sap.common.Languages.texts"],"as":"localized_1"}],"on":[{"ref":["localized_1","code"]},"=",{"ref":["L_0","code"]},"and",{"ref":["localized_1","locale"]},"=",{"ref":["$user","locale"]}]},"columns":[{"func":"coalesce","args":[{"ref":["localized_1","name"]},{"ref":["L_0","name"]}],"as":"name"},{"func":"coalesce","args":[{"ref":["localized_1","descr"]},{"ref":["L_0","descr"]}],"as":"descr"},{"ref":["L_0","code"]},{"ref":["___texts"],"as":"texts"},{"ref":["___localized"],"as":"localized"}],"mixin":{"___texts":{"type":"cds.Composition","cardinality":{"max":"*"},"target":"sap.common.Languages.texts","on":[{"ref":["___texts","code"]},"=",{"ref":["$projection","code"]}]},"___localized":{"type":"cds.Association","target":"sap.common.Languages.texts","on":[{"ref":["___localized","code"]},"=",{"ref":["$projection","code"]},"and",{"ref":["___localized","locale"]},"=",{"ref":["$user","locale"]}]}}}},"elements":{"name":{"@title":"{i18n>Name}","type":"cds.String","length":255,"@Core.Computed":true,"@cds.persistence.name":"NAME"},"descr":{"@title":"{i18n>Description}","type":"cds.String","length":1000,"@Core.Computed":true,"@cds.persistence.name":"DESCR"},"code":{"@Common.Text":{"=":"name"},"@title":"{i18n>LanguageCode}","key":true,"type":"cds.String","length":14,"@cds.persistence.name":"CODE"},"texts":{"type":"cds.Composition","cardinality":{"max":"*"},"target":"sap.common.Languages.texts","on":[{"ref":["texts","code"]},"=",{"ref":["code"]}],"@cds.persistence.name":"TEXTS"},"localized":{"type":"cds.Association","target":"sap.common.Languages.texts","on":[{"ref":["localized","code"]},"=",{"ref":["code"]},"and",{"ref":["localized","locale"]},"=",{"ref":["$user","locale"]}],"@cds.persistence.name":"LOCALIZED"}},"@cds.persistence.skip":"if-unused","@cds.persistence.name":"LOCALIZED_SAP_COMMON_LANGUAGES"},"localized.sap.common.Currencies":{"@odata.draft.enabled":false,"kind":"entity","query":{"SELECT":{"from":{"join":"left","args":[{"ref":["sap.common.Currencies"],"as":"L_0"},{"ref":["sap.common.Currencies.texts"],"as":"localized_1"}],"on":[{"ref":["localized_1","code"]},"=",{"ref":["L_0","code"]},"and",{"ref":["localized_1","locale"]},"=",{"ref":["$user","locale"]}]},"columns":[{"func":"coalesce","args":[{"ref":["localized_1","name"]},{"ref":["L_0","name"]}],"as":"name"},{"func":"coalesce","args":[{"ref":["localized_1","descr"]},{"ref":["L_0","descr"]}],"as":"descr"},{"ref":["L_0","code"]},{"ref":["L_0","symbol"]},{"ref":["L_0","minorUnit"]},{"ref":["___texts"],"as":"texts"},{"ref":["___localized"],"as":"localized"}],"mixin":{"___texts":{"type":"cds.Composition","cardinality":{"max":"*"},"target":"sap.common.Currencies.texts","on":[{"ref":["___texts","code"]},"=",{"ref":["$projection","code"]}]},"___localized":{"type":"cds.Association","target":"sap.common.Currencies.texts","on":[{"ref":["___localized","code"]},"=",{"ref":["$projection","code"]},"and",{"ref":["___localized","locale"]},"=",{"ref":["$user","locale"]}]}}}},"elements":{"name":{"@title":"{i18n>Name}","type":"cds.String","length":255,"@Core.Computed":true,"@cds.persistence.name":"NAME"},"descr":{"@title":"{i18n>Description}","type":"cds.String","length":1000,"@Core.Computed":true,"@cds.persistence.name":"DESCR"},"code":{"@title":"{i18n>CurrencyCode}","@Common.Text":{"=":"name"},"key":true,"type":"cds.String","length":3,"@cds.persistence.name":"CODE"},"symbol":{"@title":"{i18n>CurrencySymbol}","type":"cds.String","length":5,"@cds.persistence.name":"SYMBOL"},"minorUnit":{"@title":"{i18n>CurrencyMinorUnit}","type":"cds.Int16","@cds.persistence.name":"MINORUNIT"},"texts":{"type":"cds.Composition","cardinality":{"max":"*"},"target":"sap.common.Currencies.texts","on":[{"ref":["texts","code"]},"=",{"ref":["code"]}],"@cds.persistence.name":"TEXTS"},"localized":{"type":"cds.Association","target":"sap.common.Currencies.texts","on":[{"ref":["localized","code"]},"=",{"ref":["code"]},"and",{"ref":["localized","locale"]},"=",{"ref":["$user","locale"]}],"@cds.persistence.name":"LOCALIZED"}},"@cds.persistence.skip":"if-unused","@cds.persistence.name":"LOCALIZED_SAP_COMMON_CURRENCIES"},"localized.my.bookshop.Authors":{"@odata.draft.enabled":false,"kind":"entity","query":{"SELECT":{"from":{"ref":["my.bookshop.Authors"],"as":"L"},"columns":[{"ref":["L","ID"]},{"ref":["L","createdAt"]},{"ref":["L","createdBy"]},{"ref":["L","modifiedAt"]},{"ref":["L","modifiedBy"]},{"ref":["L","name"]},{"ref":["L","dateOfBirth"]},{"ref":["L","dateOfDeath"]},{"ref":["L","placeOfBirth"]},{"ref":["L","placeOfDeath"]},{"ref":["___books"],"as":"books"}],"mixin":{"___books":{"type":"cds.Association","cardinality":{"max":"*"},"target":"localized.my.bookshop.Books","on":[{"ref":["___books","author_ID"]},"=",{"ref":["$projection","ID"]}]}}}},"elements":{"ID":{"@title":"{i18n>ID}","@UI.HiddenFilter":true,"@Core.Computed":true,"key":true,"type":"cds.String","length":36,"@cds.persistence.name":"ID"},"createdAt":{"@cds.on.insert":{"=":"$now"},"@UI.HiddenFilter":true,"@Core.Immutable":true,"@title":"{i18n>CreatedAt}","@readonly":true,"type":"cds.UTCTimestamp","@cds.persistence.name":"CREATEDAT"},"createdBy":{"@cds.on.insert":{"=":"$user"},"@UI.HiddenFilter":true,"@Core.Immutable":true,"@title":"{i18n>CreatedBy}","@readonly":true,"@description":"{i18n>UserID.Description}","type":"cds.String","length":255,"@cds.persistence.name":"CREATEDBY"},"modifiedAt":{"@cds.on.insert":{"=":"$now"},"@cds.on.update":{"=":"$now"},"@UI.HiddenFilter":true,"@title":"{i18n>ChangedAt}","@readonly":true,"type":"cds.UTCTimestamp","@cds.persistence.name":"MODIFIEDAT"},"modifiedBy":{"@cds.on.insert":{"=":"$user"},"@cds.on.update":{"=":"$user"},"@UI.HiddenFilter":true,"@title":"{i18n>ChangedBy}","@readonly":true,"@description":"{i18n>UserID.Description}","type":"cds.String","length":255,"@cds.persistence.name":"MODIFIEDBY"},"name":{"@assert.format":"^\\p{Lu}.*","@title":"{i18n>Name}","type":"cds.String","length":111,"@cds.persistence.name":"NAME"},"dateOfBirth":{"@title":"{i18n>DateOfBirth}","type":"cds.LocalDate","@cds.persistence.name":"DATEOFBIRTH"},"dateOfDeath":{"@title":"{i18n>DateOfDeath}","type":"cds.LocalDate","@cds.persistence.name":"DATEOFDEATH"},"placeOfBirth":{"@title":"{i18n>PlaceOfBirth}","type":"cds.String","length":255,"@cds.persistence.name":"PLACEOFBIRTH"},"placeOfDeath":{"@title":"{i18n>PlaceOfDeath}","type":"cds.String","length":255,"@cds.persistence.name":"PLACEOFDEATH"},"books":{"type":"cds.Association","cardinality":{"max":"*"},"target":"localized.my.bookshop.Books","on":[{"ref":["books","author_ID"]},"=",{"ref":["ID"]}],"@cds.persistence.name":"BOOKS"}},"@cds.persistence.name":"LOCALIZED_MY_BOOKSHOP_AUTHORS"},"localized.AdminService.Books":{"kind":"entity","@odata.draft.enabled":false,"query":{"SELECT":{"from":{"ref":["localized.my.bookshop.Books"],"as":"Books_0"},"columns":[{"ref":["Books_0","ID"]},{"ref":["Books_0","createdAt"]},{"ref":["Books_0","createdBy"]},{"ref":["Books_0","modifiedAt"]},{"ref":["Books_0","modifiedBy"]},{"ref":["Books_0","title"]},{"ref":["Books_0","descr"]},{"ref":["___author"],"as":"author"},{"ref":["Books_0","author_ID"]},{"ref":["___genre"],"as":"genre"},{"ref":["Books_0","genre_ID"]},{"ref":["Books_0","stock"]},{"ref":["Books_0","price"]},{"ref":["___currency"],"as":"currency"},{"ref":["Books_0","currency_code"]},{"ref":["Books_0","rating"]},{"ref":["___texts"],"as":"texts"},{"ref":["___localized"],"as":"localized"}],"mixin":{"___author":{"@ValueList.entity":"Authors","@title":"{i18n>Author}","@Common.Text":{"=":"author.name"},"@Common.TextArrangement":{"#":"TextOnly"},"type":"cds.Association","target":"localized.AdminService.Authors","keys":[{"ref":["ID"],"as":"ID","$generatedFieldName":"author_ID"}],"on":[{"ref":["___author","ID"]},"=",{"ref":["$projection","author_ID"]}]},"___genre":{"@title":"{i18n>Genre}","@Common.Text":{"=":"genre.name"},"@Common.TextArrangement":{"#":"TextOnly"},"type":"cds.Association","target":"localized.AdminService.Genres","keys":[{"ref":["ID"],"as":"ID","$generatedFieldName":"genre_ID"}],"on":[{"ref":["___genre","ID"]},"=",{"ref":["$projection","genre_ID"]}]},"___currency":{"@title":"{i18n>Currency}","@description":"{i18n>CurrencyCode.Description}","type":"cds.Association","target":"localized.AdminService.Currencies","keys":[{"ref":["code"],"as":"code","$generatedFieldName":"currency_code"}],"on":[{"ref":["___currency","code"]},"=",{"ref":["$projection","currency_code"]}]},"___texts":{"type":"cds.Composition","cardinality":{"max":"*"},"target":"AdminService.Books.texts","on":[{"ref":["___texts","ID"]},"=",{"ref":["$projection","ID"]}]},"___localized":{"type":"cds.Association","target":"AdminService.Books.texts","on":[{"ref":["___localized","ID"]},"=",{"ref":["$projection","ID"]},"and",{"ref":["___localized","locale"]},"=",{"ref":["$user","locale"]}]}}}},"elements":{"ID":{"@title":"{i18n>ID}","@UI.HiddenFilter":true,"@Core.Computed":true,"key":true,"type":"cds.String","length":36,"@cds.persistence.name":"ID"},"createdAt":{"@cds.on.insert":{"=":"$now"},"@UI.HiddenFilter":true,"@Core.Immutable":true,"@title":"{i18n>CreatedAt}","@readonly":true,"type":"cds.UTCTimestamp","@cds.persistence.name":"CREATEDAT"},"createdBy":{"@cds.on.insert":{"=":"$user"},"@UI.HiddenFilter":true,"@Core.Immutable":true,"@title":"{i18n>CreatedBy}","@readonly":true,"@description":"{i18n>UserID.Description}","type":"cds.String","length":255,"@cds.persistence.name":"CREATEDBY"},"modifiedAt":{"@cds.on.insert":{"=":"$now"},"@cds.on.update":{"=":"$now"},"@UI.HiddenFilter":true,"@title":"{i18n>ChangedAt}","@readonly":true,"type":"cds.UTCTimestamp","@cds.persistence.name":"MODIFIEDAT"},"modifiedBy":{"@cds.on.insert":{"=":"$user"},"@cds.on.update":{"=":"$user"},"@UI.HiddenFilter":true,"@title":"{i18n>ChangedBy}","@readonly":true,"@description":"{i18n>UserID.Description}","type":"cds.String","length":255,"@cds.persistence.name":"MODIFIEDBY"},"title":{"@title":"{i18n>Title}","type":"cds.String","length":111,"@Core.Computed":true,"@cds.persistence.name":"TITLE"},"descr":{"@title":"{i18n>Description}","@UI.MultiLineText":true,"type":"cds.String","length":1111,"@Core.Computed":true,"@cds.persistence.name":"DESCR"},"author":{"@ValueList.entity":"Authors","@title":"{i18n>Author}","@Common.Text":{"=":"author.name"},"@Common.TextArrangement":{"#":"TextOnly"},"type":"cds.Association","target":"localized.AdminService.Authors","keys":[{"ref":["ID"],"as":"ID","$generatedFieldName":"author_ID"}],"on":[{"ref":["author","ID"]},"=",{"ref":["author_ID"]}],"@cds.persistence.name":"AUTHOR"},"author_ID":{"@odata.foreignKey4":"author","type":"cds.String","length":36,"@cds.persistence.name":"AUTHOR_ID"},"genre":{"@title":"{i18n>Genre}","@Common.Text":{"=":"genre.name"},"@Common.TextArrangement":{"#":"TextOnly"},"type":"cds.Association","target":"localized.AdminService.Genres","keys":[{"ref":["ID"],"as":"ID","$generatedFieldName":"genre_ID"}],"on":[{"ref":["genre","ID"]},"=",{"ref":["genre_ID"]}],"@cds.persistence.name":"GENRE"},"genre_ID":{"@odata.foreignKey4":"genre","type":"cds.Integer","@cds.persistence.name":"GENRE_ID"},"stock":{"@title":"{i18n>Stock}","type":"cds.Integer","@cds.persistence.name":"STOCK"},"price":{"@title":"{i18n>Price}","type":"cds.Decimal","precision":9,"scale":2,"@cds.persistence.name":"PRICE"},"currency":{"@title":"{i18n>Currency}","@description":"{i18n>CurrencyCode.Description}","type":"cds.Association","target":"localized.AdminService.Currencies","keys":[{"ref":["code"],"as":"code","$generatedFieldName":"currency_code"}],"on":[{"ref":["currency","code"]},"=",{"ref":["currency_code"]}],"@cds.persistence.name":"CURRENCY"},"currency_code":{"@odata.foreignKey4":"currency","type":"cds.String","length":3,"@cds.persistence.name":"CURRENCY_CODE"},"rating":{"type":"cds.Decimal","precision":2,"scale":1,"@cds.persistence.name":"RATING"},"texts":{"type":"cds.Composition","cardinality":{"max":"*"},"target":"AdminService.Books.texts","on":[{"ref":["texts","ID"]},"=",{"ref":["ID"]}],"@cds.persistence.name":"TEXTS"},"localized":{"type":"cds.Association","target":"AdminService.Books.texts","on":[{"ref":["localized","ID"]},"=",{"ref":["ID"]},"and",{"ref":["localized","locale"]},"=",{"ref":["$user","locale"]}],"@cds.persistence.name":"LOCALIZED"}},"@cds.persistence.name":"LOCALIZED_ADMINSERVICE_BOOKS"},"localized.AdminService.Languages":{"kind":"entity","@odata.draft.enabled":false,"query":{"SELECT":{"from":{"ref":["localized.sap.common.Languages"],"as":"CommonLanguages_0"},"columns":[{"ref":["CommonLanguages_0","name"]},{"ref":["CommonLanguages_0","descr"]},{"ref":["CommonLanguages_0","code"]},{"ref":["___texts"],"as":"texts"},{"ref":["___localized"],"as":"localized"}],"mixin":{"___texts":{"type":"cds.Composition","cardinality":{"max":"*"},"target":"AdminService.Languages.texts","on":[{"ref":["___texts","code"]},"=",{"ref":["$projection","code"]}]},"___localized":{"type":"cds.Association","target":"AdminService.Languages.texts","on":[{"ref":["___localized","code"]},"=",{"ref":["$projection","code"]},"and",{"ref":["___localized","locale"]},"=",{"ref":["$user","locale"]}]}}}},"elements":{"name":{"@title":"{i18n>Name}","type":"cds.String","length":255,"@Core.Computed":true,"@cds.persistence.name":"NAME"},"descr":{"@title":"{i18n>Description}","type":"cds.String","length":1000,"@Core.Computed":true,"@cds.persistence.name":"DESCR"},"code":{"@Common.Text":{"=":"name"},"@title":"{i18n>LanguageCode}","key":true,"type":"cds.String","length":14,"@cds.persistence.name":"CODE"},"texts":{"type":"cds.Composition","cardinality":{"max":"*"},"target":"AdminService.Languages.texts","on":[{"ref":["texts","code"]},"=",{"ref":["code"]}],"@cds.persistence.name":"TEXTS"},"localized":{"type":"cds.Association","target":"AdminService.Languages.texts","on":[{"ref":["localized","code"]},"=",{"ref":["code"]},"and",{"ref":["localized","locale"]},"=",{"ref":["$user","locale"]}],"@cds.persistence.name":"LOCALIZED"}},"@cds.persistence.skip":"if-unused","@cds.persistence.name":"LOCALIZED_ADMINSERVICE_LANGUAGES"},"localized.CatalogService.Books":{"kind":"entity","@odata.draft.enabled":false,"query":{"SELECT":{"from":{"ref":["localized.my.bookshop.Books"],"as":"Books_0"},"columns":[{"ref":["Books_0","ID"]},{"ref":["Books_0","createdAt"]},{"ref":["Books_0","modifiedAt"]},{"ref":["Books_0","title"]},{"ref":["Books_0","descr"]},{"ref":["___author"],"as":"author"},{"ref":["Books_0","author_ID"]},{"ref":["___genre"],"as":"genre"},{"ref":["Books_0","genre_ID"]},{"ref":["Books_0","stock"]},{"ref":["Books_0","price"]},{"ref":["___currency"],"as":"currency"},{"ref":["Books_0","currency_code"]},{"ref":["Books_0","rating"]},{"ref":["___texts"],"as":"texts"},{"ref":["___localized"],"as":"localized"}],"mixin":{"___author":{"@ValueList.entity":"Authors","@title":"{i18n>Author}","@Common.Text":{"=":"author.name"},"@Common.TextArrangement":{"#":"TextOnly"},"type":"cds.Association","target":"localized.CatalogService.Authors","keys":[{"ref":["ID"],"as":"ID","$generatedFieldName":"author_ID"}],"on":[{"ref":["___author","ID"]},"=",{"ref":["$projection","author_ID"]}]},"___genre":{"@title":"{i18n>Genre}","@Common.Text":{"=":"genre.name"},"@Common.TextArrangement":{"#":"TextOnly"},"type":"cds.Association","target":"localized.CatalogService.Genres","keys":[{"ref":["ID"],"as":"ID","$generatedFieldName":"genre_ID"}],"on":[{"ref":["___genre","ID"]},"=",{"ref":["$projection","genre_ID"]}]},"___currency":{"@title":"{i18n>Currency}","@description":"{i18n>CurrencyCode.Description}","type":"cds.Association","target":"localized.CatalogService.Currencies","keys":[{"ref":["code"],"as":"code","$generatedFieldName":"currency_code"}],"on":[{"ref":["___currency","code"]},"=",{"ref":["$projection","currency_code"]}]},"___texts":{"type":"cds.Composition","cardinality":{"max":"*"},"target":"CatalogService.Books.texts","on":[{"ref":["___texts","ID"]},"=",{"ref":["$projection","ID"]}]},"___localized":{"type":"cds.Association","target":"CatalogService.Books.texts","on":[{"ref":["___localized","ID"]},"=",{"ref":["$projection","ID"]},"and",{"ref":["___localized","locale"]},"=",{"ref":["$user","locale"]}]}}}},"elements":{"ID":{"@title":"{i18n>ID}","@UI.HiddenFilter":true,"@Core.Computed":true,"key":true,"type":"cds.String","length":36,"@cds.persistence.name":"ID"},"createdAt":{"@cds.on.insert":{"=":"$now"},"@UI.HiddenFilter":true,"@Core.Immutable":true,"@title":"{i18n>CreatedAt}","@readonly":true,"type":"cds.UTCTimestamp","@cds.persistence.name":"CREATEDAT"},"modifiedAt":{"@cds.on.insert":{"=":"$now"},"@cds.on.update":{"=":"$now"},"@UI.HiddenFilter":true,"@title":"{i18n>ChangedAt}","@readonly":true,"type":"cds.UTCTimestamp","@cds.persistence.name":"MODIFIEDAT"},"title":{"@title":"{i18n>Title}","type":"cds.String","length":111,"@Core.Computed":true,"@cds.persistence.name":"TITLE"},"descr":{"@title":"{i18n>Description}","@UI.MultiLineText":true,"type":"cds.String","length":1111,"@Core.Computed":true,"@cds.persistence.name":"DESCR"},"author":{"@ValueList.entity":"Authors","@title":"{i18n>Author}","@Common.Text":{"=":"author.name"},"@Common.TextArrangement":{"#":"TextOnly"},"type":"cds.Association","target":"localized.CatalogService.Authors","keys":[{"ref":["ID"],"as":"ID","$generatedFieldName":"author_ID"}],"on":[{"ref":["author","ID"]},"=",{"ref":["author_ID"]}],"@cds.persistence.name":"AUTHOR"},"author_ID":{"@odata.foreignKey4":"author","type":"cds.String","length":36,"@cds.persistence.name":"AUTHOR_ID"},"genre":{"@title":"{i18n>Genre}","@Common.Text":{"=":"genre.name"},"@Common.TextArrangement":{"#":"TextOnly"},"type":"cds.Association","target":"localized.CatalogService.Genres","keys":[{"ref":["ID"],"as":"ID","$generatedFieldName":"genre_ID"}],"on":[{"ref":["genre","ID"]},"=",{"ref":["genre_ID"]}],"@cds.persistence.name":"GENRE"},"genre_ID":{"@odata.foreignKey4":"genre","type":"cds.Integer","@cds.persistence.name":"GENRE_ID"},"stock":{"@title":"{i18n>Stock}","type":"cds.Integer","@cds.persistence.name":"STOCK"},"price":{"@Measures.ISOCurrency":{"=":"currency_code"},"@title":"{i18n>Price}","type":"cds.Decimal","precision":9,"scale":2,"@cds.persistence.name":"PRICE"},"currency":{"@title":"{i18n>Currency}","@description":"{i18n>CurrencyCode.Description}","type":"cds.Association","target":"localized.CatalogService.Currencies","keys":[{"ref":["code"],"as":"code","$generatedFieldName":"currency_code"}],"on":[{"ref":["currency","code"]},"=",{"ref":["currency_code"]}],"@cds.persistence.name":"CURRENCY"},"currency_code":{"@odata.foreignKey4":"currency","type":"cds.String","length":3,"@cds.persistence.name":"CURRENCY_CODE"},"rating":{"type":"cds.Decimal","precision":2,"scale":1,"@cds.persistence.name":"RATING"},"texts":{"type":"cds.Composition","cardinality":{"max":"*"},"target":"CatalogService.Books.texts","on":[{"ref":["texts","ID"]},"=",{"ref":["ID"]}],"@cds.persistence.name":"TEXTS"},"localized":{"type":"cds.Association","target":"CatalogService.Books.texts","on":[{"ref":["localized","ID"]},"=",{"ref":["ID"]},"and",{"ref":["localized","locale"]},"=",{"ref":["$user","locale"]}],"@cds.persistence.name":"LOCALIZED"}},"@cds.persistence.name":"LOCALIZED_CATALOGSERVICE_BOOKS"},"localized.AdminService.Genres":{"kind":"entity","@odata.draft.enabled":false,"query":{"SELECT":{"from":{"ref":["localized.my.bookshop.Genres"],"as":"Genres_0"},"columns":[{"ref":["Genres_0","name"]},{"ref":["Genres_0","descr"]},{"ref":["Genres_0","ID"]},{"ref":["___parent"],"as":"parent"},{"ref":["Genres_0","parent_ID"]},{"ref":["___children"],"as":"children"},{"ref":["___texts"],"as":"texts"},{"ref":["___localized"],"as":"localized"}],"mixin":{"___parent":{"type":"cds.Association","target":"localized.AdminService.Genres","keys":[{"ref":["ID"],"as":"ID","$generatedFieldName":"parent_ID"}],"on":[{"ref":["___parent","ID"]},"=",{"ref":["$projection","parent_ID"]}]},"___children":{"type":"cds.Composition","cardinality":{"max":"*"},"target":"localized.AdminService.Genres","on":[{"ref":["___children","parent_ID"]},"=",{"ref":["$projection","ID"]}]},"___texts":{"type":"cds.Composition","cardinality":{"max":"*"},"target":"AdminService.Genres.texts","on":[{"ref":["___texts","ID"]},"=",{"ref":["$projection","ID"]}]},"___localized":{"type":"cds.Association","target":"AdminService.Genres.texts","on":[{"ref":["___localized","ID"]},"=",{"ref":["$projection","ID"]},"and",{"ref":["___localized","locale"]},"=",{"ref":["$user","locale"]}]}}}},"elements":{"name":{"@title":"{i18n>Genre}","type":"cds.String","length":255,"@Core.Computed":true,"@cds.persistence.name":"NAME"},"descr":{"@title":"{i18n>Description}","type":"cds.String","length":1000,"@Core.Computed":true,"@cds.persistence.name":"DESCR"},"ID":{"@title":"{i18n>ID}","key":true,"type":"cds.Integer","@cds.persistence.name":"ID"},"parent":{"type":"cds.Association","target":"localized.AdminService.Genres","keys":[{"ref":["ID"],"as":"ID","$generatedFieldName":"parent_ID"}],"on":[{"ref":["parent","ID"]},"=",{"ref":["parent_ID"]}],"@cds.persistence.name":"PARENT"},"parent_ID":{"@odata.foreignKey4":"parent","type":"cds.Integer","@cds.persistence.name":"PARENT_ID"},"children":{"type":"cds.Composition","cardinality":{"max":"*"},"target":"localized.AdminService.Genres","on":[{"ref":["children","parent_ID"]},"=",{"ref":["ID"]}],"@cds.persistence.name":"CHILDREN"},"texts":{"type":"cds.Composition","cardinality":{"max":"*"},"target":"AdminService.Genres.texts","on":[{"ref":["texts","ID"]},"=",{"ref":["ID"]}],"@cds.persistence.name":"TEXTS"},"localized":{"type":"cds.Association","target":"AdminService.Genres.texts","on":[{"ref":["localized","ID"]},"=",{"ref":["ID"]},"and",{"ref":["localized","locale"]},"=",{"ref":["$user","locale"]}],"@cds.persistence.name":"LOCALIZED"}},"@cds.persistence.skip":"if-unused","@cds.persistence.name":"LOCALIZED_ADMINSERVICE_GENRES"},"localized.AdminService.Currencies":{"kind":"entity","@odata.draft.enabled":false,"query":{"SELECT":{"from":{"ref":["localized.sap.common.Currencies"],"as":"Currencies_0"},"columns":[{"ref":["Currencies_0","name"]},{"ref":["Currencies_0","descr"]},{"ref":["Currencies_0","code"]},{"ref":["Currencies_0","symbol"]},{"ref":["Currencies_0","minorUnit"]},{"ref":["___texts"],"as":"texts"},{"ref":["___localized"],"as":"localized"}],"mixin":{"___texts":{"type":"cds.Composition","cardinality":{"max":"*"},"target":"AdminService.Currencies.texts","on":[{"ref":["___texts","code"]},"=",{"ref":["$projection","code"]}]},"___localized":{"type":"cds.Association","target":"AdminService.Currencies.texts","on":[{"ref":["___localized","code"]},"=",{"ref":["$projection","code"]},"and",{"ref":["___localized","locale"]},"=",{"ref":["$user","locale"]}]}}}},"elements":{"name":{"@title":"{i18n>Name}","type":"cds.String","length":255,"@Core.Computed":true,"@cds.persistence.name":"NAME"},"descr":{"@title":"{i18n>Description}","type":"cds.String","length":1000,"@Core.Computed":true,"@cds.persistence.name":"DESCR"},"code":{"@title":"{i18n>CurrencyCode}","@Common.Text":{"=":"name"},"key":true,"type":"cds.String","length":3,"@cds.persistence.name":"CODE"},"symbol":{"@title":"{i18n>CurrencySymbol}","type":"cds.String","length":5,"@cds.persistence.name":"SYMBOL"},"minorUnit":{"@title":"{i18n>CurrencyMinorUnit}","type":"cds.Int16","@cds.persistence.name":"MINORUNIT"},"texts":{"type":"cds.Composition","cardinality":{"max":"*"},"target":"AdminService.Currencies.texts","on":[{"ref":["texts","code"]},"=",{"ref":["code"]}],"@cds.persistence.name":"TEXTS"},"localized":{"type":"cds.Association","target":"AdminService.Currencies.texts","on":[{"ref":["localized","code"]},"=",{"ref":["code"]},"and",{"ref":["localized","locale"]},"=",{"ref":["$user","locale"]}],"@cds.persistence.name":"LOCALIZED"}},"@cds.persistence.skip":"if-unused","@cds.persistence.name":"LOCALIZED_ADMINSERVICE_CURRENCIES"},"localized.CatalogService.Genres":{"kind":"entity","@odata.draft.enabled":false,"query":{"SELECT":{"from":{"ref":["localized.my.bookshop.Genres"],"as":"Genres_0"},"columns":[{"ref":["Genres_0","name"]},{"ref":["Genres_0","descr"]},{"ref":["Genres_0","ID"]},{"ref":["___parent"],"as":"parent"},{"ref":["Genres_0","parent_ID"]},{"ref":["___children"],"as":"children"},{"ref":["___texts"],"as":"texts"},{"ref":["___localized"],"as":"localized"}],"mixin":{"___parent":{"type":"cds.Association","target":"localized.CatalogService.Genres","keys":[{"ref":["ID"],"as":"ID","$generatedFieldName":"parent_ID"}],"on":[{"ref":["___parent","ID"]},"=",{"ref":["$projection","parent_ID"]}]},"___children":{"type":"cds.Composition","cardinality":{"max":"*"},"target":"localized.CatalogService.Genres","on":[{"ref":["___children","parent_ID"]},"=",{"ref":["$projection","ID"]}]},"___texts":{"type":"cds.Composition","cardinality":{"max":"*"},"target":"CatalogService.Genres.texts","on":[{"ref":["___texts","ID"]},"=",{"ref":["$projection","ID"]}]},"___localized":{"type":"cds.Association","target":"CatalogService.Genres.texts","on":[{"ref":["___localized","ID"]},"=",{"ref":["$projection","ID"]},"and",{"ref":["___localized","locale"]},"=",{"ref":["$user","locale"]}]}}}},"elements":{"name":{"@title":"{i18n>Genre}","type":"cds.String","length":255,"@Core.Computed":true,"@cds.persistence.name":"NAME"},"descr":{"@title":"{i18n>Description}","type":"cds.String","length":1000,"@Core.Computed":true,"@cds.persistence.name":"DESCR"},"ID":{"@title":"{i18n>ID}","key":true,"type":"cds.Integer","@cds.persistence.name":"ID"},"parent":{"type":"cds.Association","target":"localized.CatalogService.Genres","keys":[{"ref":["ID"],"as":"ID","$generatedFieldName":"parent_ID"}],"on":[{"ref":["parent","ID"]},"=",{"ref":["parent_ID"]}],"@cds.persistence.name":"PARENT"},"parent_ID":{"@odata.foreignKey4":"parent","type":"cds.Integer","@cds.persistence.name":"PARENT_ID"},"children":{"type":"cds.Composition","cardinality":{"max":"*"},"target":"localized.CatalogService.Genres","on":[{"ref":["children","parent_ID"]},"=",{"ref":["ID"]}],"@cds.persistence.name":"CHILDREN"},"texts":{"type":"cds.Composition","cardinality":{"max":"*"},"target":"CatalogService.Genres.texts","on":[{"ref":["texts","ID"]},"=",{"ref":["ID"]}],"@cds.persistence.name":"TEXTS"},"localized":{"type":"cds.Association","target":"CatalogService.Genres.texts","on":[{"ref":["localized","ID"]},"=",{"ref":["ID"]},"and",{"ref":["localized","locale"]},"=",{"ref":["$user","locale"]}],"@cds.persistence.name":"LOCALIZED"}},"@cds.persistence.skip":"if-unused","@cds.persistence.name":"LOCALIZED_CATALOGSERVICE_GENRES"},"localized.CatalogService.Currencies":{"kind":"entity","@odata.draft.enabled":false,"query":{"SELECT":{"from":{"ref":["localized.sap.common.Currencies"],"as":"Currencies_0"},"columns":[{"ref":["Currencies_0","name"]},{"ref":["Currencies_0","descr"]},{"ref":["Currencies_0","code"]},{"ref":["Currencies_0","symbol"]},{"ref":["Currencies_0","minorUnit"]},{"ref":["___texts"],"as":"texts"},{"ref":["___localized"],"as":"localized"}],"mixin":{"___texts":{"type":"cds.Composition","cardinality":{"max":"*"},"target":"CatalogService.Currencies.texts","on":[{"ref":["___texts","code"]},"=",{"ref":["$projection","code"]}]},"___localized":{"type":"cds.Association","target":"CatalogService.Currencies.texts","on":[{"ref":["___localized","code"]},"=",{"ref":["$projection","code"]},"and",{"ref":["___localized","locale"]},"=",{"ref":["$user","locale"]}]}}}},"elements":{"name":{"@title":"{i18n>Name}","type":"cds.String","length":255,"@Core.Computed":true,"@cds.persistence.name":"NAME"},"descr":{"@title":"{i18n>Description}","type":"cds.String","length":1000,"@Core.Computed":true,"@cds.persistence.name":"DESCR"},"code":{"@title":"{i18n>CurrencyCode}","@Common.Text":{"=":"name"},"key":true,"type":"cds.String","length":3,"@cds.persistence.name":"CODE"},"symbol":{"@title":"{i18n>CurrencySymbol}","type":"cds.String","length":5,"@cds.persistence.name":"SYMBOL"},"minorUnit":{"@title":"{i18n>CurrencyMinorUnit}","type":"cds.Int16","@cds.persistence.name":"MINORUNIT"},"texts":{"type":"cds.Composition","cardinality":{"max":"*"},"target":"CatalogService.Currencies.texts","on":[{"ref":["texts","code"]},"=",{"ref":["code"]}],"@cds.persistence.name":"TEXTS"},"localized":{"type":"cds.Association","target":"CatalogService.Currencies.texts","on":[{"ref":["localized","code"]},"=",{"ref":["code"]},"and",{"ref":["localized","locale"]},"=",{"ref":["$user","locale"]}],"@cds.persistence.name":"LOCALIZED"}},"@cds.persistence.skip":"if-unused","@cds.persistence.name":"LOCALIZED_CATALOGSERVICE_CURRENCIES"},"localized.AdminService.Authors":{"kind":"entity","@odata.draft.enabled":false,"query":{"SELECT":{"from":{"ref":["localized.my.bookshop.Authors"],"as":"Authors_0"},"columns":[{"ref":["Authors_0","ID"]},{"ref":["Authors_0","createdAt"]},{"ref":["Authors_0","createdBy"]},{"ref":["Authors_0","modifiedAt"]},{"ref":["Authors_0","modifiedBy"]},{"ref":["Authors_0","name"]},{"ref":["Authors_0","dateOfBirth"]},{"ref":["Authors_0","dateOfDeath"]},{"ref":["Authors_0","placeOfBirth"]},{"ref":["Authors_0","placeOfDeath"]},{"ref":["___books"],"as":"books"}],"mixin":{"___books":{"type":"cds.Association","cardinality":{"max":"*"},"target":"localized.AdminService.Books","on":[{"ref":["___books","author_ID"]},"=",{"ref":["$projection","ID"]}]}}}},"elements":{"ID":{"@title":"{i18n>ID}","@UI.HiddenFilter":true,"@Core.Computed":true,"key":true,"type":"cds.String","length":36,"@cds.persistence.name":"ID"},"createdAt":{"@cds.on.insert":{"=":"$now"},"@UI.HiddenFilter":true,"@Core.Immutable":true,"@title":"{i18n>CreatedAt}","@readonly":true,"type":"cds.UTCTimestamp","@cds.persistence.name":"CREATEDAT"},"createdBy":{"@cds.on.insert":{"=":"$user"},"@UI.HiddenFilter":true,"@Core.Immutable":true,"@title":"{i18n>CreatedBy}","@readonly":true,"@description":"{i18n>UserID.Description}","type":"cds.String","length":255,"@cds.persistence.name":"CREATEDBY"},"modifiedAt":{"@cds.on.insert":{"=":"$now"},"@cds.on.update":{"=":"$now"},"@UI.HiddenFilter":true,"@title":"{i18n>ChangedAt}","@readonly":true,"type":"cds.UTCTimestamp","@cds.persistence.name":"MODIFIEDAT"},"modifiedBy":{"@cds.on.insert":{"=":"$user"},"@cds.on.update":{"=":"$user"},"@UI.HiddenFilter":true,"@title":"{i18n>ChangedBy}","@readonly":true,"@description":"{i18n>UserID.Description}","type":"cds.String","length":255,"@cds.persistence.name":"MODIFIEDBY"},"name":{"@assert.format":"^\\p{Lu}.*","@title":"{i18n>Name}","type":"cds.String","length":111,"@cds.persistence.name":"NAME"},"dateOfBirth":{"@title":"{i18n>DateOfBirth}","type":"cds.LocalDate","@cds.persistence.name":"DATEOFBIRTH"},"dateOfDeath":{"@title":"{i18n>DateOfDeath}","type":"cds.LocalDate","@cds.persistence.name":"DATEOFDEATH"},"placeOfBirth":{"@title":"{i18n>PlaceOfBirth}","type":"cds.String","length":255,"@cds.persistence.name":"PLACEOFBIRTH"},"placeOfDeath":{"@title":"{i18n>PlaceOfDeath}","type":"cds.String","length":255,"@cds.persistence.name":"PLACEOFDEATH"},"books":{"type":"cds.Association","cardinality":{"max":"*"},"target":"localized.AdminService.Books","on":[{"ref":["books","author_ID"]},"=",{"ref":["ID"]}],"@cds.persistence.name":"BOOKS"}},"@cds.persistence.name":"LOCALIZED_ADMINSERVICE_AUTHORS"},"localized.CatalogService.Authors":{"kind":"entity","@odata.draft.enabled":false,"query":{"SELECT":{"from":{"ref":["localized.my.bookshop.Authors"],"as":"Authors_0"},"columns":[{"ref":["Authors_0","ID"]},{"ref":["Authors_0","createdAt"]},{"ref":["Authors_0","createdBy"]},{"ref":["Authors_0","modifiedAt"]},{"ref":["Authors_0","modifiedBy"]},{"ref":["Authors_0","name"]},{"ref":["Authors_0","dateOfBirth"]},{"ref":["Authors_0","dateOfDeath"]},{"ref":["Authors_0","placeOfBirth"]},{"ref":["Authors_0","placeOfDeath"]},{"ref":["___books"],"as":"books"}],"mixin":{"___books":{"type":"cds.Association","cardinality":{"max":"*"},"target":"localized.CatalogService.Books","on":[{"ref":["___books","author_ID"]},"=",{"ref":["$projection","ID"]}]}}}},"elements":{"ID":{"@title":"{i18n>ID}","@UI.HiddenFilter":true,"@Core.Computed":true,"key":true,"type":"cds.String","length":36,"@cds.persistence.name":"ID"},"createdAt":{"@cds.on.insert":{"=":"$now"},"@UI.HiddenFilter":true,"@Core.Immutable":true,"@title":"{i18n>CreatedAt}","@readonly":true,"type":"cds.UTCTimestamp","@cds.persistence.name":"CREATEDAT"},"createdBy":{"@cds.on.insert":{"=":"$user"},"@UI.HiddenFilter":true,"@Core.Immutable":true,"@title":"{i18n>CreatedBy}","@readonly":true,"@description":"{i18n>UserID.Description}","type":"cds.String","length":255,"@cds.persistence.name":"CREATEDBY"},"modifiedAt":{"@cds.on.insert":{"=":"$now"},"@cds.on.update":{"=":"$now"},"@UI.HiddenFilter":true,"@title":"{i18n>ChangedAt}","@readonly":true,"type":"cds.UTCTimestamp","@cds.persistence.name":"MODIFIEDAT"},"modifiedBy":{"@cds.on.insert":{"=":"$user"},"@cds.on.update":{"=":"$user"},"@UI.HiddenFilter":true,"@title":"{i18n>ChangedBy}","@readonly":true,"@description":"{i18n>UserID.Description}","type":"cds.String","length":255,"@cds.persistence.name":"MODIFIEDBY"},"name":{"@assert.format":"^\\p{Lu}.*","@title":"{i18n>Name}","type":"cds.String","length":111,"@cds.persistence.name":"NAME"},"dateOfBirth":{"@title":"{i18n>DateOfBirth}","type":"cds.LocalDate","@cds.persistence.name":"DATEOFBIRTH"},"dateOfDeath":{"@title":"{i18n>DateOfDeath}","type":"cds.LocalDate","@cds.persistence.name":"DATEOFDEATH"},"placeOfBirth":{"@title":"{i18n>PlaceOfBirth}","type":"cds.String","length":255,"@cds.persistence.name":"PLACEOFBIRTH"},"placeOfDeath":{"@title":"{i18n>PlaceOfDeath}","type":"cds.String","length":255,"@cds.persistence.name":"PLACEOFDEATH"},"books":{"type":"cds.Association","cardinality":{"max":"*"},"target":"localized.CatalogService.Books","on":[{"ref":["books","author_ID"]},"=",{"ref":["ID"]}],"@cds.persistence.name":"BOOKS"}},"@cds.persistence.name":"LOCALIZED_CATALOGSERVICE_AUTHORS"},"DRAFT.DraftAdministrativeData":{"kind":"entity","elements":{"DraftUUID":{"type":"cds.String","key":true,"length":36,"@UI.Hidden":true,"@Common.Label":"{i18n>Draft_DraftUUID}","@cds.persistence.name":"DRAFTUUID"},"CreationDateTime":{"type":"cds.UTCTimestamp","@Common.Label":"{i18n>Draft_CreationDateTime}","@cds.persistence.name":"CREATIONDATETIME"},"CreatedByUser":{"type":"cds.String","length":256,"@Common.Label":"{i18n>Draft_CreatedByUser}","@cds.persistence.name":"CREATEDBYUSER"},"DraftIsCreatedByMe":{"type":"cds.Boolean","@UI.Hidden":true,"@Common.Label":"{i18n>Draft_DraftIsCreatedByMe}","@cds.persistence.name":"DRAFTISCREATEDBYME"},"LastChangeDateTime":{"type":"cds.UTCTimestamp","@Common.Label":"{i18n>Draft_LastChangeDateTime}","@cds.persistence.name":"LASTCHANGEDATETIME"},"LastChangedByUser":{"type":"cds.String","length":256,"@Common.Label":"{i18n>Draft_LastChangedByUser}","@cds.persistence.name":"LASTCHANGEDBYUSER"},"InProcessByUser":{"type":"cds.String","length":256,"@Common.Label":"{i18n>Draft_InProcessByUser}","@cds.persistence.name":"INPROCESSBYUSER"},"DraftIsProcessedByMe":{"type":"cds.Boolean","@UI.Hidden":true,"@Common.Label":"{i18n>Draft_DraftIsProcessedByMe}","@cds.persistence.name":"DRAFTISPROCESSEDBYME"}},"@Common.Label":"{i18n>Draft_DraftAdministrativeData}","@cds.persistence.name":"DRAFT_DRAFTADMINISTRATIVEDATA"},"AdminService.DraftAdministrativeData":{"kind":"entity","projection":{"from":{"ref":["DRAFT.DraftAdministrativeData"]},"columns":[{"key":true,"ref":["DraftAdministrativeData","DraftUUID"]},{"ref":["DraftAdministrativeData","CreationDateTime"]},{"ref":["DraftAdministrativeData","CreatedByUser"]},{"ref":["DraftAdministrativeData","DraftIsCreatedByMe"]},{"ref":["DraftAdministrativeData","LastChangeDateTime"]},{"ref":["DraftAdministrativeData","LastChangedByUser"]},{"ref":["DraftAdministrativeData","InProcessByUser"]},{"ref":["DraftAdministrativeData","DraftIsProcessedByMe"]}]},"elements":{"DraftUUID":{"type":"cds.String","key":true,"length":36,"@UI.Hidden":true,"@Common.Label":"{i18n>Draft_DraftUUID}","@cds.persistence.name":"DRAFTUUID"},"CreationDateTime":{"type":"cds.UTCTimestamp","@Common.Label":"{i18n>Draft_CreationDateTime}","@cds.persistence.name":"CREATIONDATETIME"},"CreatedByUser":{"type":"cds.String","length":256,"@Common.Label":"{i18n>Draft_CreatedByUser}","@cds.persistence.name":"CREATEDBYUSER"},"DraftIsCreatedByMe":{"type":"cds.Boolean","@UI.Hidden":true,"@Common.Label":"{i18n>Draft_DraftIsCreatedByMe}","@cds.persistence.name":"DRAFTISCREATEDBYME"},"LastChangeDateTime":{"type":"cds.UTCTimestamp","@Common.Label":"{i18n>Draft_LastChangeDateTime}","@cds.persistence.name":"LASTCHANGEDATETIME"},"LastChangedByUser":{"type":"cds.String","length":256,"@Common.Label":"{i18n>Draft_LastChangedByUser}","@cds.persistence.name":"LASTCHANGEDBYUSER"},"InProcessByUser":{"type":"cds.String","length":256,"@Common.Label":"{i18n>Draft_InProcessByUser}","@cds.persistence.name":"INPROCESSBYUSER"},"DraftIsProcessedByMe":{"type":"cds.Boolean","@UI.Hidden":true,"@Common.Label":"{i18n>Draft_DraftIsProcessedByMe}","@cds.persistence.name":"DRAFTISPROCESSEDBYME"}},"@Common.Label":"{i18n>Draft_DraftAdministrativeData}","@cds.persistence.name":"ADMINSERVICE_DRAFTADMINISTRATIVEDATA"},"AdminService.Books.drafts":{"kind":"entity","elements":{"ID":{"@title":"{i18n>ID}","@UI.HiddenFilter":true,"@Core.Computed":true,"key":true,"type":"cds.String","length":36,"@cds.persistence.name":"ID"},"createdAt":{"@cds.on.insert":{"=":"$now"},"@UI.HiddenFilter":true,"@Core.Immutable":true,"@title":"{i18n>CreatedAt}","@readonly":true,"type":"cds.UTCTimestamp","notNull":false,"@cds.persistence.name":"CREATEDAT"},"createdBy":{"@cds.on.insert":{"=":"$user"},"@UI.HiddenFilter":true,"@Core.Immutable":true,"@title":"{i18n>CreatedBy}","@readonly":true,"@description":"{i18n>UserID.Description}","type":"cds.String","length":255,"notNull":false,"@cds.persistence.name":"CREATEDBY"},"modifiedAt":{"@cds.on.insert":{"=":"$now"},"@cds.on.update":{"=":"$now"},"@UI.HiddenFilter":true,"@title":"{i18n>ChangedAt}","@readonly":true,"type":"cds.UTCTimestamp","notNull":false,"@cds.persistence.name":"MODIFIEDAT"},"modifiedBy":{"@cds.on.insert":{"=":"$user"},"@cds.on.update":{"=":"$user"},"@UI.HiddenFilter":true,"@title":"{i18n>ChangedBy}","@readonly":true,"@description":"{i18n>UserID.Description}","type":"cds.String","length":255,"notNull":false,"@cds.persistence.name":"MODIFIEDBY"},"title":{"@title":"{i18n>Title}","type":"cds.String","length":111,"notNull":false,"@cds.persistence.name":"TITLE"},"descr":{"@title":"{i18n>Description}","@UI.MultiLineText":true,"type":"cds.String","length":1111,"notNull":false,"@cds.persistence.name":"DESCR"},"author":{"@ValueList.entity":"Authors","@title":"{i18n>Author}","@Common.Text":{"=":"author.name"},"@Common.TextArrangement":{"#":"TextOnly"},"type":"cds.Association","target":"AdminService.Authors","keys":[{"ref":["ID"],"as":"ID","$generatedFieldName":"author_ID"}],"on":[{"ref":["author","ID"]},"=",{"ref":["author_ID"]}],"@cds.persistence.name":"AUTHOR"},"author_ID":{"type":"cds.String","length":36,"@odata.foreignKey4":"author","notNull":false,"@cds.persistence.name":"AUTHOR_ID"},"genre":{"@title":"{i18n>Genre}","@Common.Text":{"=":"genre.name"},"@Common.TextArrangement":{"#":"TextOnly"},"type":"cds.Association","target":"AdminService.Genres","keys":[{"ref":["ID"],"as":"ID","$generatedFieldName":"genre_ID"}],"on":[{"ref":["genre","ID"]},"=",{"ref":["genre_ID"]}],"@cds.persistence.name":"GENRE"},"genre_ID":{"type":"cds.Integer","@odata.foreignKey4":"genre","notNull":false,"@cds.persistence.name":"GENRE_ID"},"stock":{"@title":"{i18n>Stock}","type":"cds.Integer","notNull":false,"@cds.persistence.name":"STOCK"},"price":{"@title":"{i18n>Price}","type":"cds.Decimal","precision":9,"scale":2,"notNull":false,"@cds.persistence.name":"PRICE"},"currency":{"@title":"{i18n>Currency}","@description":"{i18n>CurrencyCode.Description}","type":"cds.Association","target":"AdminService.Currencies","keys":[{"ref":["code"],"as":"code","$generatedFieldName":"currency_code"}],"on":[{"ref":["currency","code"]},"=",{"ref":["currency_code"]}],"@cds.persistence.name":"CURRENCY"},"currency_code":{"type":"cds.String","length":3,"@odata.foreignKey4":"currency","notNull":false,"@cds.persistence.name":"CURRENCY_CODE"},"rating":{"type":"cds.Decimal","precision":2,"scale":1,"notNull":false,"@cds.persistence.name":"RATING"},"texts":{"type":"cds.Composition","cardinality":{"max":"*"},"target":"AdminService.Books.texts.drafts","on":[{"ref":["texts","ID"]},"=",{"ref":["ID"]}],"@cds.persistence.name":"TEXTS"},"localized":{"type":"cds.Association","target":"AdminService.Books.texts.drafts","on":[{"ref":["localized","ID"]},"=",{"ref":["ID"]},"and",{"ref":["localized","locale"]},"=",{"ref":["$user","locale"]}],"@cds.persistence.name":"LOCALIZED"},"IsActiveEntity":{"type":"cds.Boolean","@cds.persistence.name":"ISACTIVEENTITY"},"HasActiveEntity":{"type":"cds.Boolean","@cds.persistence.name":"HASACTIVEENTITY"},"HasDraftEntity":{"type":"cds.Boolean","@cds.persistence.name":"HASDRAFTENTITY"},"DraftAdministrativeData":{"type":"cds.Association","target":"AdminService.DraftAdministrativeData","keys":[{"ref":["DraftUUID"],"$generatedFieldName":"DraftAdministrativeData_DraftUUID"}],"cardinality":{"max":1},"on":[{"ref":["DraftAdministrativeData","DraftUUID"]},"=",{"ref":["DraftAdministrativeData_DraftUUID"]}],"@cds.persistence.name":"DRAFTADMINISTRATIVEDATA"},"DraftAdministrativeData_DraftUUID":{"type":"cds.String","length":36,"notNull":true,"@odata.foreignKey4":"DraftAdministrativeData","@cds.persistence.name":"DRAFTADMINISTRATIVEDATA_DRAFTUUID"}},"@cds.persistence.name":"ADMINSERVICE_BOOKS_DRAFTS"},"AdminService.Books.texts.drafts":{"kind":"entity","elements":{"ID_texts":{"key":true,"type":"cds.String","length":36,"@cds.persistence.name":"ID_TEXTS"},"locale":{"@ValueList.entity":"Languages","@ValueList.type":{"#":"fixed"},"@title":"{i18n>LanguageCode}","type":"cds.String","length":14,"notNull":false,"@cds.persistence.name":"LOCALE"},"ID":{"@title":"{i18n>ID}","@UI.HiddenFilter":true,"@Core.Computed":true,"type":"cds.String","length":36,"notNull":false,"@cds.persistence.name":"ID"},"title":{"@title":"{i18n>Title}","localized":null,"type":"cds.String","length":111,"notNull":false,"@cds.persistence.name":"TITLE"},"descr":{"@title":"{i18n>Description}","@UI.MultiLineText":true,"localized":null,"type":"cds.String","length":1111,"notNull":false,"@cds.persistence.name":"DESCR"},"IsActiveEntity":{"type":"cds.Boolean","@cds.persistence.name":"ISACTIVEENTITY"},"HasActiveEntity":{"type":"cds.Boolean","@cds.persistence.name":"HASACTIVEENTITY"},"HasDraftEntity":{"type":"cds.Boolean","@cds.persistence.name":"HASDRAFTENTITY"},"DraftAdministrativeData":{"type":"cds.Association","target":"AdminService.DraftAdministrativeData","keys":[{"ref":["DraftUUID"],"$generatedFieldName":"DraftAdministrativeData_DraftUUID"}],"cardinality":{"max":1},"on":[{"ref":["DraftAdministrativeData","DraftUUID"]},"=",{"ref":["DraftAdministrativeData_DraftUUID"]}],"@cds.persistence.name":"DRAFTADMINISTRATIVEDATA"},"DraftAdministrativeData_DraftUUID":{"type":"cds.String","length":36,"notNull":true,"@odata.foreignKey4":"DraftAdministrativeData","@cds.persistence.name":"DRAFTADMINISTRATIVEDATA_DRAFTUUID"}},"@cds.persistence.name":"ADMINSERVICE_BOOKS_TEXTS_DRAFTS"}},"extensions":[{"annotate":"common.Currencies","@Common.SemanticKey":[{"=":"code"}],"@Identification":[{"Value":{"=":"code"}}],"@UI.SelectionFields":[{"=":"name"},{"=":"descr"}],"@UI.LineItem":[{"Value":{"=":"descr"}},{"Value":{"=":"symbol"}},{"Value":{"=":"code"}}],"@UI.HeaderInfo.TypeName":"{i18n>Currency}","@UI.HeaderInfo.TypeNamePlural":"{i18n>Currencies}","@UI.HeaderInfo.Title.Value":{"=":"descr"},"@UI.HeaderInfo.Description.Value":{"=":"code"},"@UI.Facets":[{"$Type":"UI.ReferenceFacet","Label":"{i18n>Details}","Target":"@UI.FieldGroup#Details"},{"$Type":"UI.ReferenceFacet","Label":"{i18n>Extended}","Target":"@UI.FieldGroup#Extended"}],"@UI.FieldGroup#Details.Data":[{"Value":{"=":"name"}},{"Value":{"=":"symbol"}},{"Value":{"=":"code"}},{"Value":{"=":"descr"}}],"@UI.FieldGroup#Extended.Data":[{"Value":{"=":"numcode"}},{"Value":{"=":"minor"}},{"Value":{"=":"exponent"}}],"elements":{"numcode":{"@title":"{i18n>NumCode}"},"minor":{"@title":"{i18n>MinorUnit}"},"exponent":{"@title":"{i18n>Exponent}"}}},{"annotate":"common.Languages","@Common.SemanticKey":[{"=":"code"}],"@Identification":[{"Value":{"=":"code"}}],"@UI.SelectionFields":[{"=":"name"},{"=":"descr"}],"@UI.LineItem":[{"Value":{"=":"code"}},{"Value":{"=":"name"}}],"@UI.HeaderInfo.TypeName":"{i18n>Language}","@UI.HeaderInfo.TypeNamePlural":"{i18n>Languages}","@UI.HeaderInfo.Title.Value":{"=":"name"},"@UI.HeaderInfo.Description.Value":{"=":"descr"},"@UI.Facets":[{"$Type":"UI.ReferenceFacet","Label":"{i18n>Details}","Target":"@UI.FieldGroup#Details"}],"@UI.FieldGroup#Details.Data":[{"Value":{"=":"code"}},{"Value":{"=":"name"}},{"Value":{"=":"descr"}}]}],"meta":{"creator":"CDS Compiler v4.1.2"},"$version":"2.0"} diff --git a/srv/src/main/resources/db/changelog/v1/model.sql b/srv/src/main/resources/db/changelog/v1/model.sql new file mode 100644 index 00000000..c03dd91d --- /dev/null +++ b/srv/src/main/resources/db/changelog/v1/model.sql @@ -0,0 +1,433 @@ + + +CREATE TABLE my_bookshop_Books ( + ID VARCHAR(36) NOT NULL, + createdAt TIMESTAMP, + createdBy VARCHAR(255), + modifiedAt TIMESTAMP, + modifiedBy VARCHAR(255), + title VARCHAR(111), + descr VARCHAR(1111), + author_ID VARCHAR(36), + genre_ID INTEGER, + stock INTEGER, + price DECIMAL(9, 2), + currency_code VARCHAR(3), + rating DECIMAL(2, 1), + PRIMARY KEY(ID) +); + +CREATE TABLE my_bookshop_Authors ( + ID VARCHAR(36) NOT NULL, + createdAt TIMESTAMP, + createdBy VARCHAR(255), + modifiedAt TIMESTAMP, + modifiedBy VARCHAR(255), + name VARCHAR(111), + dateOfBirth DATE, + dateOfDeath DATE, + placeOfBirth VARCHAR(255), + placeOfDeath VARCHAR(255), + PRIMARY KEY(ID) +); + +CREATE TABLE my_bookshop_Genres ( + name VARCHAR(255), + descr VARCHAR(1000), + ID INTEGER NOT NULL, + parent_ID INTEGER, + PRIMARY KEY(ID) +); + +CREATE TABLE sap_common_Languages ( + name VARCHAR(255), + descr VARCHAR(1000), + code VARCHAR(14) NOT NULL, + PRIMARY KEY(code) +); + +CREATE TABLE sap_common_Currencies ( + name VARCHAR(255), + descr VARCHAR(1000), + code VARCHAR(3) NOT NULL, + symbol VARCHAR(5), + minorUnit SMALLINT, + PRIMARY KEY(code) +); + +CREATE TABLE my_bookshop_Books_texts ( + ID_texts VARCHAR(36) NOT NULL, + locale VARCHAR(14), + ID VARCHAR(36), + title VARCHAR(111), + descr VARCHAR(1111), + PRIMARY KEY(ID_texts), + CONSTRAINT my_bookshop_Books_texts_locale UNIQUE (locale, ID) +); + +CREATE TABLE my_bookshop_Genres_texts ( + locale VARCHAR(14) NOT NULL, + name VARCHAR(255), + descr VARCHAR(1000), + ID INTEGER NOT NULL, + PRIMARY KEY(locale, ID) +); + +CREATE TABLE sap_common_Languages_texts ( + locale VARCHAR(14) NOT NULL, + name VARCHAR(255), + descr VARCHAR(1000), + code VARCHAR(14) NOT NULL, + PRIMARY KEY(locale, code) +); + +CREATE TABLE sap_common_Currencies_texts ( + locale VARCHAR(14) NOT NULL, + name VARCHAR(255), + descr VARCHAR(1000), + code VARCHAR(3) NOT NULL, + PRIMARY KEY(locale, code) +); + +CREATE TABLE DRAFT_DraftAdministrativeData ( + DraftUUID VARCHAR(36) NOT NULL, + CreationDateTime TIMESTAMP, + CreatedByUser VARCHAR(256), + DraftIsCreatedByMe BOOLEAN, + LastChangeDateTime TIMESTAMP, + LastChangedByUser VARCHAR(256), + InProcessByUser VARCHAR(256), + DraftIsProcessedByMe BOOLEAN, + PRIMARY KEY(DraftUUID) +); + +CREATE TABLE AdminService_Books_drafts ( + ID VARCHAR(36) NOT NULL, + createdAt TIMESTAMP NULL, + createdBy VARCHAR(255) NULL, + modifiedAt TIMESTAMP NULL, + modifiedBy VARCHAR(255) NULL, + title VARCHAR(111) NULL, + descr VARCHAR(1111) NULL, + author_ID VARCHAR(36) NULL, + genre_ID INTEGER NULL, + stock INTEGER NULL, + price DECIMAL(9, 2) NULL, + currency_code VARCHAR(3) NULL, + rating DECIMAL(2, 1) NULL, + IsActiveEntity BOOLEAN, + HasActiveEntity BOOLEAN, + HasDraftEntity BOOLEAN, + DraftAdministrativeData_DraftUUID VARCHAR(36) NOT NULL, + PRIMARY KEY(ID) +); + +CREATE TABLE AdminService_Books_texts_drafts ( + ID_texts VARCHAR(36) NOT NULL, + locale VARCHAR(14) NULL, + ID VARCHAR(36) NULL, + title VARCHAR(111) NULL, + descr VARCHAR(1111) NULL, + IsActiveEntity BOOLEAN, + HasActiveEntity BOOLEAN, + HasDraftEntity BOOLEAN, + DraftAdministrativeData_DraftUUID VARCHAR(36) NOT NULL, + PRIMARY KEY(ID_texts) +); + +CREATE VIEW AdminService_Books AS SELECT + Books_0.ID, + Books_0.createdAt, + Books_0.createdBy, + Books_0.modifiedAt, + Books_0.modifiedBy, + Books_0.title, + Books_0.descr, + Books_0.author_ID, + Books_0.genre_ID, + Books_0.stock, + Books_0.price, + Books_0.currency_code, + Books_0.rating +FROM my_bookshop_Books AS Books_0; + +CREATE VIEW AdminService_Authors AS SELECT + Authors_0.ID, + Authors_0.createdAt, + Authors_0.createdBy, + Authors_0.modifiedAt, + Authors_0.modifiedBy, + Authors_0.name, + Authors_0.dateOfBirth, + Authors_0.dateOfDeath, + Authors_0.placeOfBirth, + Authors_0.placeOfDeath +FROM my_bookshop_Authors AS Authors_0; + +CREATE VIEW AdminService_Languages AS SELECT + CommonLanguages_0.name, + CommonLanguages_0.descr, + CommonLanguages_0.code +FROM sap_common_Languages AS CommonLanguages_0; + +CREATE VIEW CatalogService_Books AS SELECT + Books_0.ID, + Books_0.createdAt, + Books_0.modifiedAt, + Books_0.title, + Books_0.descr, + Books_0.author_ID, + Books_0.genre_ID, + Books_0.stock, + Books_0.price, + Books_0.currency_code, + Books_0.rating +FROM my_bookshop_Books AS Books_0; + +CREATE VIEW CatalogService_Authors AS SELECT + Authors_0.ID, + Authors_0.createdAt, + Authors_0.createdBy, + Authors_0.modifiedAt, + Authors_0.modifiedBy, + Authors_0.name, + Authors_0.dateOfBirth, + Authors_0.dateOfDeath, + Authors_0.placeOfBirth, + Authors_0.placeOfDeath +FROM my_bookshop_Authors AS Authors_0; + +CREATE VIEW AdminService_Genres AS SELECT + Genres_0.name, + Genres_0.descr, + Genres_0.ID, + Genres_0.parent_ID +FROM my_bookshop_Genres AS Genres_0; + +CREATE VIEW AdminService_Currencies AS SELECT + Currencies_0.name, + Currencies_0.descr, + Currencies_0.code, + Currencies_0.symbol, + Currencies_0.minorUnit +FROM sap_common_Currencies AS Currencies_0; + +CREATE VIEW AdminService_Books_texts AS SELECT + texts_0.ID_texts, + texts_0.locale, + texts_0.ID, + texts_0.title, + texts_0.descr +FROM my_bookshop_Books_texts AS texts_0; + +CREATE VIEW AdminService_Languages_texts AS SELECT + texts_0.locale, + texts_0.name, + texts_0.descr, + texts_0.code +FROM sap_common_Languages_texts AS texts_0; + +CREATE VIEW CatalogService_Genres AS SELECT + Genres_0.name, + Genres_0.descr, + Genres_0.ID, + Genres_0.parent_ID +FROM my_bookshop_Genres AS Genres_0; + +CREATE VIEW CatalogService_Currencies AS SELECT + Currencies_0.name, + Currencies_0.descr, + Currencies_0.code, + Currencies_0.symbol, + Currencies_0.minorUnit +FROM sap_common_Currencies AS Currencies_0; + +CREATE VIEW CatalogService_Books_texts AS SELECT + texts_0.ID_texts, + texts_0.locale, + texts_0.ID, + texts_0.title, + texts_0.descr +FROM my_bookshop_Books_texts AS texts_0; + +CREATE VIEW AdminService_Genres_texts AS SELECT + texts_0.locale, + texts_0.name, + texts_0.descr, + texts_0.ID +FROM my_bookshop_Genres_texts AS texts_0; + +CREATE VIEW AdminService_Currencies_texts AS SELECT + texts_0.locale, + texts_0.name, + texts_0.descr, + texts_0.code +FROM sap_common_Currencies_texts AS texts_0; + +CREATE VIEW CatalogService_Genres_texts AS SELECT + texts_0.locale, + texts_0.name, + texts_0.descr, + texts_0.ID +FROM my_bookshop_Genres_texts AS texts_0; + +CREATE VIEW CatalogService_Currencies_texts AS SELECT + texts_0.locale, + texts_0.name, + texts_0.descr, + texts_0.code +FROM sap_common_Currencies_texts AS texts_0; + +CREATE VIEW localized_my_bookshop_Books AS SELECT + L_0.ID, + L_0.createdAt, + L_0.createdBy, + L_0.modifiedAt, + L_0.modifiedBy, + coalesce(localized_1.title, L_0.title) AS title, + coalesce(localized_1.descr, L_0.descr) AS descr, + L_0.author_ID, + L_0.genre_ID, + L_0.stock, + L_0.price, + L_0.currency_code, + L_0.rating +FROM (my_bookshop_Books AS L_0 LEFT JOIN my_bookshop_Books_texts AS localized_1 ON localized_1.ID = L_0.ID AND localized_1.locale = current_setting('cap.locale')); + +CREATE VIEW localized_my_bookshop_Genres AS SELECT + coalesce(localized_1.name, L_0.name) AS name, + coalesce(localized_1.descr, L_0.descr) AS descr, + L_0.ID, + L_0.parent_ID +FROM (my_bookshop_Genres AS L_0 LEFT JOIN my_bookshop_Genres_texts AS localized_1 ON localized_1.ID = L_0.ID AND localized_1.locale = current_setting('cap.locale')); + +CREATE VIEW localized_sap_common_Languages AS SELECT + coalesce(localized_1.name, L_0.name) AS name, + coalesce(localized_1.descr, L_0.descr) AS descr, + L_0.code +FROM (sap_common_Languages AS L_0 LEFT JOIN sap_common_Languages_texts AS localized_1 ON localized_1.code = L_0.code AND localized_1.locale = current_setting('cap.locale')); + +CREATE VIEW localized_sap_common_Currencies AS SELECT + coalesce(localized_1.name, L_0.name) AS name, + coalesce(localized_1.descr, L_0.descr) AS descr, + L_0.code, + L_0.symbol, + L_0.minorUnit +FROM (sap_common_Currencies AS L_0 LEFT JOIN sap_common_Currencies_texts AS localized_1 ON localized_1.code = L_0.code AND localized_1.locale = current_setting('cap.locale')); + +CREATE VIEW localized_my_bookshop_Authors AS SELECT + L.ID, + L.createdAt, + L.createdBy, + L.modifiedAt, + L.modifiedBy, + L.name, + L.dateOfBirth, + L.dateOfDeath, + L.placeOfBirth, + L.placeOfDeath +FROM my_bookshop_Authors AS L; + +CREATE VIEW AdminService_DraftAdministrativeData AS SELECT + DraftAdministrativeData.DraftUUID, + DraftAdministrativeData.CreationDateTime, + DraftAdministrativeData.CreatedByUser, + DraftAdministrativeData.DraftIsCreatedByMe, + DraftAdministrativeData.LastChangeDateTime, + DraftAdministrativeData.LastChangedByUser, + DraftAdministrativeData.InProcessByUser, + DraftAdministrativeData.DraftIsProcessedByMe +FROM DRAFT_DraftAdministrativeData AS DraftAdministrativeData; + +CREATE VIEW localized_AdminService_Books AS SELECT + Books_0.ID, + Books_0.createdAt, + Books_0.createdBy, + Books_0.modifiedAt, + Books_0.modifiedBy, + Books_0.title, + Books_0.descr, + Books_0.author_ID, + Books_0.genre_ID, + Books_0.stock, + Books_0.price, + Books_0.currency_code, + Books_0.rating +FROM localized_my_bookshop_Books AS Books_0; + +CREATE VIEW localized_AdminService_Languages AS SELECT + CommonLanguages_0.name, + CommonLanguages_0.descr, + CommonLanguages_0.code +FROM localized_sap_common_Languages AS CommonLanguages_0; + +CREATE VIEW localized_CatalogService_Books AS SELECT + Books_0.ID, + Books_0.createdAt, + Books_0.modifiedAt, + Books_0.title, + Books_0.descr, + Books_0.author_ID, + Books_0.genre_ID, + Books_0.stock, + Books_0.price, + Books_0.currency_code, + Books_0.rating +FROM localized_my_bookshop_Books AS Books_0; + +CREATE VIEW localized_AdminService_Genres AS SELECT + Genres_0.name, + Genres_0.descr, + Genres_0.ID, + Genres_0.parent_ID +FROM localized_my_bookshop_Genres AS Genres_0; + +CREATE VIEW localized_AdminService_Currencies AS SELECT + Currencies_0.name, + Currencies_0.descr, + Currencies_0.code, + Currencies_0.symbol, + Currencies_0.minorUnit +FROM localized_sap_common_Currencies AS Currencies_0; + +CREATE VIEW localized_CatalogService_Genres AS SELECT + Genres_0.name, + Genres_0.descr, + Genres_0.ID, + Genres_0.parent_ID +FROM localized_my_bookshop_Genres AS Genres_0; + +CREATE VIEW localized_CatalogService_Currencies AS SELECT + Currencies_0.name, + Currencies_0.descr, + Currencies_0.code, + Currencies_0.symbol, + Currencies_0.minorUnit +FROM localized_sap_common_Currencies AS Currencies_0; + +CREATE VIEW localized_AdminService_Authors AS SELECT + Authors_0.ID, + Authors_0.createdAt, + Authors_0.createdBy, + Authors_0.modifiedAt, + Authors_0.modifiedBy, + Authors_0.name, + Authors_0.dateOfBirth, + Authors_0.dateOfDeath, + Authors_0.placeOfBirth, + Authors_0.placeOfDeath +FROM localized_my_bookshop_Authors AS Authors_0; + +CREATE VIEW localized_CatalogService_Authors AS SELECT + Authors_0.ID, + Authors_0.createdAt, + Authors_0.createdBy, + Authors_0.modifiedAt, + Authors_0.modifiedBy, + Authors_0.name, + Authors_0.dateOfBirth, + Authors_0.dateOfDeath, + Authors_0.placeOfBirth, + Authors_0.placeOfDeath +FROM localized_my_bookshop_Authors AS Authors_0; + diff --git a/srv/src/main/resources/db/changelog/v2/model.csn b/srv/src/main/resources/db/changelog/v2/model.csn new file mode 100644 index 00000000..3b285d85 --- /dev/null +++ b/srv/src/main/resources/db/changelog/v2/model.csn @@ -0,0 +1 @@ +{"namespace":"my.bookshop","definitions":{"my.bookshop.Books":{"kind":"entity","@fiori.draft.enabled":true,"@Common.SemanticKey":[{"=":"title"}],"@UI.Identification":[{"Value":{"=":"title"}}],"@UI.SelectionFields":[{"=":"ID"},{"=":"author_ID"},{"=":"price"},{"=":"currency_code"}],"@UI.LineItem":[{"Value":{"=":"ID"}},{"Value":{"=":"title"}},{"Value":{"=":"author.name"},"Label":"{i18n>Author}"},{"Value":{"=":"genre.name"}},{"Value":{"=":"stock"}},{"Value":{"=":"price"}},{"Value":{"=":"currency.symbol"},"Label":" "}],"@UI.HeaderInfo.TypeName":"{i18n>Book}","@UI.HeaderInfo.TypeNamePlural":"{i18n>Books}","@UI.HeaderInfo.TypeImageUrl":"sap-icon://course-book","@UI.HeaderInfo.Title.Value":{"=":"title"},"@UI.HeaderInfo.Description.Value":{"=":"author.name"},"elements":{"ID":{"@title":"{i18n>ID}","@UI.HiddenFilter":true,"@Core.Computed":true,"key":true,"type":"cds.String","length":36,"@cds.persistence.name":"ID"},"createdAt":{"@cds.on.insert":{"=":"$now"},"@UI.HiddenFilter":true,"@Core.Immutable":true,"@title":"{i18n>CreatedAt}","@readonly":true,"type":"cds.UTCTimestamp","@cds.persistence.name":"CREATEDAT"},"createdBy":{"@cds.on.insert":{"=":"$user"},"@UI.HiddenFilter":true,"@Core.Immutable":true,"@title":"{i18n>CreatedBy}","@readonly":true,"@description":"{i18n>UserID.Description}","type":"cds.String","length":255,"@cds.persistence.name":"CREATEDBY"},"modifiedAt":{"@cds.on.insert":{"=":"$now"},"@cds.on.update":{"=":"$now"},"@UI.HiddenFilter":true,"@title":"{i18n>ChangedAt}","@readonly":true,"type":"cds.UTCTimestamp","@cds.persistence.name":"MODIFIEDAT"},"modifiedBy":{"@cds.on.insert":{"=":"$user"},"@cds.on.update":{"=":"$user"},"@UI.HiddenFilter":true,"@title":"{i18n>ChangedBy}","@readonly":true,"@description":"{i18n>UserID.Description}","type":"cds.String","length":255,"@cds.persistence.name":"MODIFIEDBY"},"title":{"@title":"{i18n>Title}","type":"cds.String","length":111,"@cds.persistence.name":"TITLE"},"descr":{"@title":"{i18n>Description}","@UI.MultiLineText":true,"type":"cds.String","length":1111,"@cds.persistence.name":"DESCR"},"author":{"@ValueList.entity":"Authors","@title":"{i18n>Author}","@Common.Text":{"=":"author.name"},"@Common.TextArrangement":{"#":"TextOnly"},"type":"cds.Association","target":"my.bookshop.Authors","keys":[{"ref":["ID"],"as":"ID","$generatedFieldName":"author_ID"}],"on":[{"ref":["author","ID"]},"=",{"ref":["author_ID"]}],"@cds.persistence.name":"AUTHOR"},"author_ID":{"type":"cds.String","length":36,"@odata.foreignKey4":"author","@cds.persistence.name":"AUTHOR_ID"},"genre":{"@title":"{i18n>Genre}","@Common.Text":{"=":"genre.name"},"@Common.TextArrangement":{"#":"TextOnly"},"type":"cds.Association","target":"my.bookshop.Genres","keys":[{"ref":["ID"],"as":"ID","$generatedFieldName":"genre_ID"}],"on":[{"ref":["genre","ID"]},"=",{"ref":["genre_ID"]}],"@cds.persistence.name":"GENRE"},"genre_ID":{"type":"cds.Integer","@odata.foreignKey4":"genre","@cds.persistence.name":"GENRE_ID"},"stock":{"@title":"{i18n>Stock}","type":"cds.Integer","@cds.persistence.name":"STOCK"},"price":{"@title":"{i18n>Price}","type":"cds.Decimal","precision":9,"scale":2,"@cds.persistence.name":"PRICE"},"currency":{"@title":"{i18n>Currency}","@description":"{i18n>CurrencyCode.Description}","type":"cds.Association","target":"sap.common.Currencies","keys":[{"ref":["code"],"as":"code","$generatedFieldName":"currency_code"}],"on":[{"ref":["currency","code"]},"=",{"ref":["currency_code"]}],"@cds.persistence.name":"CURRENCY"},"currency_code":{"type":"cds.String","length":3,"@odata.foreignKey4":"currency","@cds.persistence.name":"CURRENCY_CODE"},"rating":{"type":"cds.Decimal","precision":2,"scale":1,"@cds.persistence.name":"RATING"},"isbn":{"type":"cds.String","length":40,"@cds.persistence.name":"ISBN"},"texts":{"type":"cds.Composition","cardinality":{"max":"*"},"target":"my.bookshop.Books.texts","on":[{"ref":["texts","ID"]},"=",{"ref":["ID"]}],"@cds.persistence.name":"TEXTS"},"localized":{"type":"cds.Association","target":"my.bookshop.Books.texts","on":[{"ref":["localized","ID"]},"=",{"ref":["ID"]},"and",{"ref":["localized","locale"]},"=",{"ref":["$user","locale"]}],"@cds.persistence.name":"LOCALIZED"}},"@cds.persistence.name":"MY_BOOKSHOP_BOOKS"},"my.bookshop.Authors":{"kind":"entity","@Common.SemanticKey":[{"=":"name"}],"@UI.Identification":[{"Value":{"=":"name"}}],"@UI.SelectionFields":[{"=":"name"}],"@UI.LineItem":[{"Value":{"=":"ID"}},{"Value":{"=":"name"}},{"Value":{"=":"dateOfBirth"}},{"Value":{"=":"dateOfDeath"}},{"Value":{"=":"placeOfBirth"}},{"Value":{"=":"placeOfDeath"}}],"@UI.HeaderInfo.TypeName":"{i18n>Author}","@UI.HeaderInfo.TypeNamePlural":"{i18n>Authors}","@UI.HeaderInfo.Title.Value":{"=":"name"},"@UI.HeaderInfo.Description.Value":{"=":"dateOfBirth"},"@UI.Facets":[{"$Type":"UI.ReferenceFacet","Target":"books/@UI.LineItem"}],"elements":{"ID":{"@title":"{i18n>ID}","@UI.HiddenFilter":true,"@Core.Computed":true,"key":true,"type":"cds.String","length":36,"@cds.persistence.name":"ID"},"createdAt":{"@cds.on.insert":{"=":"$now"},"@UI.HiddenFilter":true,"@Core.Immutable":true,"@title":"{i18n>CreatedAt}","@readonly":true,"type":"cds.UTCTimestamp","@cds.persistence.name":"CREATEDAT"},"createdBy":{"@cds.on.insert":{"=":"$user"},"@UI.HiddenFilter":true,"@Core.Immutable":true,"@title":"{i18n>CreatedBy}","@readonly":true,"@description":"{i18n>UserID.Description}","type":"cds.String","length":255,"@cds.persistence.name":"CREATEDBY"},"modifiedAt":{"@cds.on.insert":{"=":"$now"},"@cds.on.update":{"=":"$now"},"@UI.HiddenFilter":true,"@title":"{i18n>ChangedAt}","@readonly":true,"type":"cds.UTCTimestamp","@cds.persistence.name":"MODIFIEDAT"},"modifiedBy":{"@cds.on.insert":{"=":"$user"},"@cds.on.update":{"=":"$user"},"@UI.HiddenFilter":true,"@title":"{i18n>ChangedBy}","@readonly":true,"@description":"{i18n>UserID.Description}","type":"cds.String","length":255,"@cds.persistence.name":"MODIFIEDBY"},"name":{"@assert.format":"^\\p{Lu}.*","@title":"{i18n>Name}","type":"cds.String","length":111,"@cds.persistence.name":"NAME"},"dateOfBirth":{"@title":"{i18n>DateOfBirth}","type":"cds.LocalDate","@cds.persistence.name":"DATEOFBIRTH"},"dateOfDeath":{"@title":"{i18n>DateOfDeath}","type":"cds.LocalDate","@cds.persistence.name":"DATEOFDEATH"},"placeOfBirth":{"@title":"{i18n>PlaceOfBirth}","type":"cds.String","length":255,"@cds.persistence.name":"PLACEOFBIRTH"},"placeOfDeath":{"@title":"{i18n>PlaceOfDeath}","type":"cds.String","length":255,"@cds.persistence.name":"PLACEOFDEATH"},"books":{"type":"cds.Association","cardinality":{"max":"*"},"target":"my.bookshop.Books","on":[{"ref":["books","author_ID"]},"=",{"ref":["ID"]}],"@cds.persistence.name":"BOOKS"}},"@cds.persistence.name":"MY_BOOKSHOP_AUTHORS"},"my.bookshop.Genres":{"kind":"entity","@Common.SemanticKey":[{"=":"name"}],"@UI.SelectionFields":[{"=":"name"}],"@UI.LineItem":[{"Value":{"=":"name"}},{"Value":{"=":"parent.name"},"Label":"Main Genre"}],"@UI.Identification":[{"Value":{"=":"name"}}],"@UI.HeaderInfo.TypeName":"{i18n>Genre}","@UI.HeaderInfo.TypeNamePlural":"{i18n>Genres}","@UI.HeaderInfo.Title.Value":{"=":"name"},"@UI.HeaderInfo.Description.Value":{"=":"ID"},"@UI.Facets":[{"$Type":"UI.ReferenceFacet","Label":"{i18n>SubGenres}","Target":"children/@UI.LineItem"}],"@cds.autoexpose":true,"@cds.persistence.skip":"if-unused","@cds.odata.valuelist":true,"elements":{"name":{"@title":"{i18n>Genre}","type":"cds.String","length":255,"@cds.persistence.name":"NAME"},"descr":{"@title":"{i18n>Description}","type":"cds.String","length":1000,"@cds.persistence.name":"DESCR"},"ID":{"@title":"{i18n>ID}","key":true,"type":"cds.Integer","@cds.persistence.name":"ID"},"parent":{"type":"cds.Association","target":"my.bookshop.Genres","keys":[{"ref":["ID"],"as":"ID","$generatedFieldName":"parent_ID"}],"on":[{"ref":["parent","ID"]},"=",{"ref":["parent_ID"]}],"@cds.persistence.name":"PARENT"},"parent_ID":{"type":"cds.Integer","@odata.foreignKey4":"parent","@cds.persistence.name":"PARENT_ID"},"children":{"type":"cds.Composition","cardinality":{"max":"*"},"target":"my.bookshop.Genres","on":[{"ref":["children","parent_ID"]},"=",{"ref":["ID"]}],"@cds.persistence.name":"CHILDREN"},"texts":{"type":"cds.Composition","cardinality":{"max":"*"},"target":"my.bookshop.Genres.texts","on":[{"ref":["texts","ID"]},"=",{"ref":["ID"]}],"@cds.persistence.name":"TEXTS"},"localized":{"type":"cds.Association","target":"my.bookshop.Genres.texts","on":[{"ref":["localized","ID"]},"=",{"ref":["ID"]},"and",{"ref":["localized","locale"]},"=",{"ref":["$user","locale"]}],"@cds.persistence.name":"LOCALIZED"}},"@cds.persistence.name":"MY_BOOKSHOP_GENRES"},"AdminService":{"kind":"service","@path":"admin","@requires":"admin"},"AdminService.Books":{"kind":"entity","@cds.search.descr":true,"@cds.search.title":true,"@odata.draft.enabled":true,"@UI.Facets":[{"$Type":"UI.ReferenceFacet","Label":"{i18n>General}","Target":"@UI.FieldGroup#General"},{"$Type":"UI.ReferenceFacet","Label":"{i18n>Translations}","Target":"texts/@UI.LineItem"},{"$Type":"UI.ReferenceFacet","Label":"{i18n>Details}","Target":"@UI.FieldGroup#Details"},{"$Type":"UI.ReferenceFacet","Label":"{i18n>Admin}","Target":"@UI.FieldGroup#Admin"}],"@UI.FieldGroup#General.Data":[{"Value":{"=":"title"}},{"Value":{"=":"author_ID"}},{"Value":{"=":"genre_ID"}},{"Value":{"=":"descr"}},{"Value":{"=":"isbn"},"Label":"{i18n>ISBN}"}],"@UI.FieldGroup#Details.Data":[{"Value":{"=":"stock"}},{"Value":{"=":"price"}},{"Value":{"=":"currency_code"},"Label":"{i18n>Currency}"}],"@UI.FieldGroup#Admin.Data":[{"Value":{"=":"createdBy"}},{"Value":{"=":"createdAt"}},{"Value":{"=":"modifiedBy"}},{"Value":{"=":"modifiedAt"}}],"@fiori.draft.enabled":true,"@Common.SemanticKey":[{"=":"title"}],"@UI.Identification":[{"Value":{"=":"title"}}],"@UI.SelectionFields":[{"=":"ID"},{"=":"author_ID"},{"=":"price"},{"=":"currency_code"}],"@UI.LineItem":[{"Value":{"=":"ID"}},{"Value":{"=":"title"}},{"Value":{"=":"author.name"},"Label":"{i18n>Author}"},{"Value":{"=":"genre.name"}},{"Value":{"=":"stock"}},{"Value":{"=":"price"}},{"Value":{"=":"currency.symbol"},"Label":" "}],"@UI.HeaderInfo.TypeName":"{i18n>Book}","@UI.HeaderInfo.TypeNamePlural":"{i18n>Books}","@UI.HeaderInfo.TypeImageUrl":"sap-icon://course-book","@UI.HeaderInfo.Title.Value":{"=":"title"},"@UI.HeaderInfo.Description.Value":{"=":"author.name"},"elements":{"ID":{"@title":"{i18n>ID}","@UI.HiddenFilter":true,"@Core.Computed":true,"key":true,"type":"cds.String","length":36,"@cds.persistence.name":"ID"},"createdAt":{"@cds.on.insert":{"=":"$now"},"@UI.HiddenFilter":true,"@Core.Immutable":true,"@title":"{i18n>CreatedAt}","@readonly":true,"type":"cds.UTCTimestamp","@cds.persistence.name":"CREATEDAT"},"createdBy":{"@cds.on.insert":{"=":"$user"},"@UI.HiddenFilter":true,"@Core.Immutable":true,"@title":"{i18n>CreatedBy}","@readonly":true,"@description":"{i18n>UserID.Description}","type":"cds.String","length":255,"@cds.persistence.name":"CREATEDBY"},"modifiedAt":{"@cds.on.insert":{"=":"$now"},"@cds.on.update":{"=":"$now"},"@UI.HiddenFilter":true,"@title":"{i18n>ChangedAt}","@readonly":true,"type":"cds.UTCTimestamp","@cds.persistence.name":"MODIFIEDAT"},"modifiedBy":{"@cds.on.insert":{"=":"$user"},"@cds.on.update":{"=":"$user"},"@UI.HiddenFilter":true,"@title":"{i18n>ChangedBy}","@readonly":true,"@description":"{i18n>UserID.Description}","type":"cds.String","length":255,"@cds.persistence.name":"MODIFIEDBY"},"title":{"@title":"{i18n>Title}","type":"cds.String","length":111,"@cds.persistence.name":"TITLE"},"descr":{"@title":"{i18n>Description}","@UI.MultiLineText":true,"type":"cds.String","length":1111,"@cds.persistence.name":"DESCR"},"author":{"@ValueList.entity":"Authors","@title":"{i18n>Author}","@Common.Text":{"=":"author.name"},"@Common.TextArrangement":{"#":"TextOnly"},"type":"cds.Association","target":"AdminService.Authors","keys":[{"ref":["ID"],"as":"ID","$generatedFieldName":"author_ID"}],"on":[{"ref":["author","ID"]},"=",{"ref":["author_ID"]}],"@cds.persistence.name":"AUTHOR"},"author_ID":{"type":"cds.String","length":36,"@odata.foreignKey4":"author","@cds.persistence.name":"AUTHOR_ID"},"genre":{"@title":"{i18n>Genre}","@Common.Text":{"=":"genre.name"},"@Common.TextArrangement":{"#":"TextOnly"},"type":"cds.Association","target":"AdminService.Genres","keys":[{"ref":["ID"],"as":"ID","$generatedFieldName":"genre_ID"}],"on":[{"ref":["genre","ID"]},"=",{"ref":["genre_ID"]}],"@cds.persistence.name":"GENRE"},"genre_ID":{"type":"cds.Integer","@odata.foreignKey4":"genre","@cds.persistence.name":"GENRE_ID"},"stock":{"@title":"{i18n>Stock}","type":"cds.Integer","@cds.persistence.name":"STOCK"},"price":{"@title":"{i18n>Price}","type":"cds.Decimal","precision":9,"scale":2,"@cds.persistence.name":"PRICE"},"currency":{"@title":"{i18n>Currency}","@description":"{i18n>CurrencyCode.Description}","type":"cds.Association","target":"AdminService.Currencies","keys":[{"ref":["code"],"as":"code","$generatedFieldName":"currency_code"}],"on":[{"ref":["currency","code"]},"=",{"ref":["currency_code"]}],"@cds.persistence.name":"CURRENCY"},"currency_code":{"type":"cds.String","length":3,"@odata.foreignKey4":"currency","@cds.persistence.name":"CURRENCY_CODE"},"rating":{"type":"cds.Decimal","precision":2,"scale":1,"@cds.persistence.name":"RATING"},"isbn":{"type":"cds.String","length":40,"@cds.persistence.name":"ISBN"},"texts":{"type":"cds.Composition","cardinality":{"max":"*"},"target":"AdminService.Books.texts","on":[{"ref":["texts","ID"]},"=",{"ref":["ID"]}],"@cds.persistence.name":"TEXTS"},"localized":{"type":"cds.Association","target":"AdminService.Books.texts","on":[{"ref":["localized","ID"]},"=",{"ref":["ID"]},"and",{"ref":["localized","locale"]},"=",{"ref":["$user","locale"]}],"@cds.persistence.name":"LOCALIZED"}},"@cds.persistence.name":"ADMINSERVICE_BOOKS","projection":{"from":{"ref":["my.bookshop.Books"],"as":"Books_0"},"columns":[{"ref":["Books_0","ID"]},{"ref":["Books_0","createdAt"]},{"ref":["Books_0","createdBy"]},{"ref":["Books_0","modifiedAt"]},{"ref":["Books_0","modifiedBy"]},{"ref":["Books_0","title"]},{"ref":["Books_0","descr"]},{"ref":["___author"],"as":"author"},{"ref":["Books_0","author_ID"]},{"ref":["___genre"],"as":"genre"},{"ref":["Books_0","genre_ID"]},{"ref":["Books_0","stock"]},{"ref":["Books_0","price"]},{"ref":["___currency"],"as":"currency"},{"ref":["Books_0","currency_code"]},{"ref":["Books_0","rating"]},{"ref":["Books_0","isbn"]},{"ref":["___texts"],"as":"texts"},{"ref":["___localized"],"as":"localized"}],"mixin":{"___author":{"@ValueList.entity":"Authors","@title":"{i18n>Author}","@Common.Text":{"=":"author.name"},"@Common.TextArrangement":{"#":"TextOnly"},"type":"cds.Association","target":"AdminService.Authors","keys":[{"ref":["ID"],"as":"ID","$generatedFieldName":"author_ID"}],"on":[{"ref":["___author","ID"]},"=",{"ref":["$projection","author_ID"]}]},"___genre":{"@title":"{i18n>Genre}","@Common.Text":{"=":"genre.name"},"@Common.TextArrangement":{"#":"TextOnly"},"type":"cds.Association","target":"AdminService.Genres","keys":[{"ref":["ID"],"as":"ID","$generatedFieldName":"genre_ID"}],"on":[{"ref":["___genre","ID"]},"=",{"ref":["$projection","genre_ID"]}]},"___currency":{"@title":"{i18n>Currency}","@description":"{i18n>CurrencyCode.Description}","type":"cds.Association","target":"AdminService.Currencies","keys":[{"ref":["code"],"as":"code","$generatedFieldName":"currency_code"}],"on":[{"ref":["___currency","code"]},"=",{"ref":["$projection","currency_code"]}]},"___texts":{"type":"cds.Composition","cardinality":{"max":"*"},"target":"AdminService.Books.texts","on":[{"ref":["___texts","ID"]},"=",{"ref":["$projection","ID"]}]},"___localized":{"type":"cds.Association","target":"AdminService.Books.texts","on":[{"ref":["___localized","ID"]},"=",{"ref":["$projection","ID"]},"and",{"ref":["___localized","locale"]},"=",{"ref":["$user","locale"]}]}}}},"AdminService.Authors":{"kind":"entity","@Common.SemanticKey":[{"=":"name"}],"@UI.Identification":[{"Value":{"=":"name"}}],"@UI.SelectionFields":[{"=":"name"}],"@UI.LineItem":[{"Value":{"=":"ID"}},{"Value":{"=":"name"}},{"Value":{"=":"dateOfBirth"}},{"Value":{"=":"dateOfDeath"}},{"Value":{"=":"placeOfBirth"}},{"Value":{"=":"placeOfDeath"}}],"@UI.HeaderInfo.TypeName":"{i18n>Author}","@UI.HeaderInfo.TypeNamePlural":"{i18n>Authors}","@UI.HeaderInfo.Title.Value":{"=":"name"},"@UI.HeaderInfo.Description.Value":{"=":"dateOfBirth"},"@UI.Facets":[{"$Type":"UI.ReferenceFacet","Target":"books/@UI.LineItem"}],"elements":{"ID":{"@title":"{i18n>ID}","@UI.HiddenFilter":true,"@Core.Computed":true,"key":true,"type":"cds.String","length":36,"@cds.persistence.name":"ID"},"createdAt":{"@cds.on.insert":{"=":"$now"},"@UI.HiddenFilter":true,"@Core.Immutable":true,"@title":"{i18n>CreatedAt}","@readonly":true,"type":"cds.UTCTimestamp","@cds.persistence.name":"CREATEDAT"},"createdBy":{"@cds.on.insert":{"=":"$user"},"@UI.HiddenFilter":true,"@Core.Immutable":true,"@title":"{i18n>CreatedBy}","@readonly":true,"@description":"{i18n>UserID.Description}","type":"cds.String","length":255,"@cds.persistence.name":"CREATEDBY"},"modifiedAt":{"@cds.on.insert":{"=":"$now"},"@cds.on.update":{"=":"$now"},"@UI.HiddenFilter":true,"@title":"{i18n>ChangedAt}","@readonly":true,"type":"cds.UTCTimestamp","@cds.persistence.name":"MODIFIEDAT"},"modifiedBy":{"@cds.on.insert":{"=":"$user"},"@cds.on.update":{"=":"$user"},"@UI.HiddenFilter":true,"@title":"{i18n>ChangedBy}","@readonly":true,"@description":"{i18n>UserID.Description}","type":"cds.String","length":255,"@cds.persistence.name":"MODIFIEDBY"},"name":{"@assert.format":"^\\p{Lu}.*","@title":"{i18n>Name}","type":"cds.String","length":111,"@cds.persistence.name":"NAME"},"dateOfBirth":{"@title":"{i18n>DateOfBirth}","type":"cds.LocalDate","@cds.persistence.name":"DATEOFBIRTH"},"dateOfDeath":{"@title":"{i18n>DateOfDeath}","type":"cds.LocalDate","@cds.persistence.name":"DATEOFDEATH"},"placeOfBirth":{"@title":"{i18n>PlaceOfBirth}","type":"cds.String","length":255,"@cds.persistence.name":"PLACEOFBIRTH"},"placeOfDeath":{"@title":"{i18n>PlaceOfDeath}","type":"cds.String","length":255,"@cds.persistence.name":"PLACEOFDEATH"},"books":{"type":"cds.Association","cardinality":{"max":"*"},"target":"AdminService.Books","on":[{"ref":["books","author_ID"]},"=",{"ref":["ID"]}],"@cds.persistence.name":"BOOKS"}},"@cds.persistence.name":"ADMINSERVICE_AUTHORS","projection":{"from":{"ref":["my.bookshop.Authors"],"as":"Authors_0"},"columns":[{"ref":["Authors_0","ID"]},{"ref":["Authors_0","createdAt"]},{"ref":["Authors_0","createdBy"]},{"ref":["Authors_0","modifiedAt"]},{"ref":["Authors_0","modifiedBy"]},{"ref":["Authors_0","name"]},{"ref":["Authors_0","dateOfBirth"]},{"ref":["Authors_0","dateOfDeath"]},{"ref":["Authors_0","placeOfBirth"]},{"ref":["Authors_0","placeOfDeath"]},{"ref":["___books"],"as":"books"}],"mixin":{"___books":{"type":"cds.Association","cardinality":{"max":"*"},"target":"AdminService.Books","on":[{"ref":["___books","author_ID"]},"=",{"ref":["$projection","ID"]}]}}}},"AdminService.Languages":{"kind":"entity","@cds.autoexpose":true,"@cds.persistence.skip":"if-unused","@UI.Identification":[{"Value":{"=":"name"}}],"@cds.odata.valuelist":true,"elements":{"name":{"@title":"{i18n>Name}","type":"cds.String","length":255,"@cds.persistence.name":"NAME"},"descr":{"@title":"{i18n>Description}","type":"cds.String","length":1000,"@cds.persistence.name":"DESCR"},"code":{"@Common.Text":{"=":"name"},"@title":"{i18n>LanguageCode}","key":true,"type":"cds.String","length":14,"@cds.persistence.name":"CODE"},"texts":{"type":"cds.Composition","cardinality":{"max":"*"},"target":"AdminService.Languages.texts","on":[{"ref":["texts","code"]},"=",{"ref":["code"]}],"@cds.persistence.name":"TEXTS"},"localized":{"type":"cds.Association","target":"AdminService.Languages.texts","on":[{"ref":["localized","code"]},"=",{"ref":["code"]},"and",{"ref":["localized","locale"]},"=",{"ref":["$user","locale"]}],"@cds.persistence.name":"LOCALIZED"}},"@cds.persistence.name":"ADMINSERVICE_LANGUAGES","projection":{"from":{"ref":["sap.common.Languages"],"as":"CommonLanguages_0"},"columns":[{"ref":["CommonLanguages_0","name"]},{"ref":["CommonLanguages_0","descr"]},{"ref":["CommonLanguages_0","code"]},{"ref":["___texts"],"as":"texts"},{"ref":["___localized"],"as":"localized"}],"mixin":{"___texts":{"type":"cds.Composition","cardinality":{"max":"*"},"target":"AdminService.Languages.texts","on":[{"ref":["___texts","code"]},"=",{"ref":["$projection","code"]}]},"___localized":{"type":"cds.Association","target":"AdminService.Languages.texts","on":[{"ref":["___localized","code"]},"=",{"ref":["$projection","code"]},"and",{"ref":["___localized","locale"]},"=",{"ref":["$user","locale"]}]}}}},"CatalogService":{"kind":"service","@path":"browse","@requires":"any"},"CatalogService.Books":{"kind":"entity","@readonly":true,"@UI.HeaderInfo.TypeName":"{i18n>Book}","@UI.HeaderInfo.TypeNamePlural":"{i18n>Books}","@UI.HeaderInfo.Title.Value":{"=":"title"},"@UI.HeaderInfo.Description.Value":{"=":"author.name"},"@UI.Identification":[{"Value":{"=":"title"}}],"@UI.PresentationVariant.Text":"Default","@UI.PresentationVariant.SortOrder":[{"Property":{"=":"title"}}],"@UI.PresentationVariant.Visualizations":["@UI.LineItem"],"@UI.SelectionFields":[{"=":"author_ID"},{"=":"genre_ID"}],"@UI.LineItem":[{"Value":{"=":"title"}},{"Value":{"=":"author.name"},"Label":"{i18n>Author}"},{"Value":{"=":"genre.name"},"Label":"{i18n>Genre}"},{"Value":{"=":"price"}},{"Value":{"=":"title"}},{"Value":{"=":"isbn"},"Label":"{i18n>ISBN}"}],"@UI.Facets":[{"$Type":"UI.ReferenceFacet","Label":"{i18n>General}","Target":"@UI.FieldGroup#General"},{"$Type":"UI.ReferenceFacet","Label":"{i18n>Description}","Target":"@UI.FieldGroup#Descr"}],"@UI.FieldGroup#General.Data":[{"Value":{"=":"title"}},{"Value":{"=":"author_ID"}},{"Value":{"=":"genre_ID"}},{"Value":{"=":"title"}},{"Value":{"=":"isbn"},"Label":"{i18n>ISBN}"}],"@UI.FieldGroup#Descr.Data":[{"Value":{"=":"descr"}}],"@UI.DataPoint#stock.Value":{"=":"stock"},"@UI.DataPoint#stock.Title":"{i18n>Stock}","@UI.DataPoint#price.Value":{"=":"price"},"@UI.DataPoint#price.Title":"{i18n>Price}","@fiori.draft.enabled":true,"@Common.SemanticKey":[{"=":"title"}],"@UI.HeaderInfo.TypeImageUrl":"sap-icon://course-book","elements":{"ID":{"@title":"{i18n>ID}","@UI.HiddenFilter":true,"@Core.Computed":true,"key":true,"type":"cds.String","length":36,"@cds.persistence.name":"ID"},"createdAt":{"@cds.on.insert":{"=":"$now"},"@UI.HiddenFilter":true,"@Core.Immutable":true,"@title":"{i18n>CreatedAt}","@readonly":true,"type":"cds.UTCTimestamp","@cds.persistence.name":"CREATEDAT"},"modifiedAt":{"@cds.on.insert":{"=":"$now"},"@cds.on.update":{"=":"$now"},"@UI.HiddenFilter":true,"@title":"{i18n>ChangedAt}","@readonly":true,"type":"cds.UTCTimestamp","@cds.persistence.name":"MODIFIEDAT"},"title":{"@title":"{i18n>Title}","type":"cds.String","length":111,"@cds.persistence.name":"TITLE"},"descr":{"@title":"{i18n>Description}","@UI.MultiLineText":true,"type":"cds.String","length":1111,"@cds.persistence.name":"DESCR"},"author":{"@ValueList.entity":"Authors","@title":"{i18n>Author}","@Common.Text":{"=":"author.name"},"@Common.TextArrangement":{"#":"TextOnly"},"type":"cds.Association","target":"CatalogService.Authors","keys":[{"ref":["ID"],"as":"ID","$generatedFieldName":"author_ID"}],"on":[{"ref":["author","ID"]},"=",{"ref":["author_ID"]}],"@cds.persistence.name":"AUTHOR"},"author_ID":{"type":"cds.String","length":36,"@odata.foreignKey4":"author","@cds.persistence.name":"AUTHOR_ID"},"genre":{"@title":"{i18n>Genre}","@Common.Text":{"=":"genre.name"},"@Common.TextArrangement":{"#":"TextOnly"},"type":"cds.Association","target":"CatalogService.Genres","keys":[{"ref":["ID"],"as":"ID","$generatedFieldName":"genre_ID"}],"on":[{"ref":["genre","ID"]},"=",{"ref":["genre_ID"]}],"@cds.persistence.name":"GENRE"},"genre_ID":{"type":"cds.Integer","@odata.foreignKey4":"genre","@cds.persistence.name":"GENRE_ID"},"stock":{"@title":"{i18n>Stock}","type":"cds.Integer","@cds.persistence.name":"STOCK"},"price":{"@Measures.ISOCurrency":{"=":"currency_code"},"@title":"{i18n>Price}","type":"cds.Decimal","precision":9,"scale":2,"@cds.persistence.name":"PRICE"},"currency":{"@title":"{i18n>Currency}","@description":"{i18n>CurrencyCode.Description}","type":"cds.Association","target":"CatalogService.Currencies","keys":[{"ref":["code"],"as":"code","$generatedFieldName":"currency_code"}],"on":[{"ref":["currency","code"]},"=",{"ref":["currency_code"]}],"@cds.persistence.name":"CURRENCY"},"currency_code":{"type":"cds.String","length":3,"@odata.foreignKey4":"currency","@cds.persistence.name":"CURRENCY_CODE"},"rating":{"type":"cds.Decimal","precision":2,"scale":1,"@cds.persistence.name":"RATING"},"isbn":{"type":"cds.String","length":40,"@cds.persistence.name":"ISBN"},"texts":{"type":"cds.Composition","cardinality":{"max":"*"},"target":"CatalogService.Books.texts","on":[{"ref":["texts","ID"]},"=",{"ref":["ID"]}],"@cds.persistence.name":"TEXTS"},"localized":{"type":"cds.Association","target":"CatalogService.Books.texts","on":[{"ref":["localized","ID"]},"=",{"ref":["ID"]},"and",{"ref":["localized","locale"]},"=",{"ref":["$user","locale"]}],"@cds.persistence.name":"LOCALIZED"}},"@cds.persistence.name":"CATALOGSERVICE_BOOKS","projection":{"from":{"ref":["my.bookshop.Books"],"as":"Books_0"},"columns":[{"ref":["Books_0","ID"]},{"ref":["Books_0","createdAt"]},{"ref":["Books_0","modifiedAt"]},{"ref":["Books_0","title"]},{"ref":["Books_0","descr"]},{"ref":["___author"],"as":"author"},{"ref":["Books_0","author_ID"]},{"ref":["___genre"],"as":"genre"},{"ref":["Books_0","genre_ID"]},{"ref":["Books_0","stock"]},{"ref":["Books_0","price"]},{"ref":["___currency"],"as":"currency"},{"ref":["Books_0","currency_code"]},{"ref":["Books_0","rating"]},{"ref":["Books_0","isbn"]},{"ref":["___texts"],"as":"texts"},{"ref":["___localized"],"as":"localized"}],"mixin":{"___author":{"@ValueList.entity":"Authors","@title":"{i18n>Author}","@Common.Text":{"=":"author.name"},"@Common.TextArrangement":{"#":"TextOnly"},"type":"cds.Association","target":"CatalogService.Authors","keys":[{"ref":["ID"],"as":"ID","$generatedFieldName":"author_ID"}],"on":[{"ref":["___author","ID"]},"=",{"ref":["$projection","author_ID"]}]},"___genre":{"@title":"{i18n>Genre}","@Common.Text":{"=":"genre.name"},"@Common.TextArrangement":{"#":"TextOnly"},"type":"cds.Association","target":"CatalogService.Genres","keys":[{"ref":["ID"],"as":"ID","$generatedFieldName":"genre_ID"}],"on":[{"ref":["___genre","ID"]},"=",{"ref":["$projection","genre_ID"]}]},"___currency":{"@title":"{i18n>Currency}","@description":"{i18n>CurrencyCode.Description}","type":"cds.Association","target":"CatalogService.Currencies","keys":[{"ref":["code"],"as":"code","$generatedFieldName":"currency_code"}],"on":[{"ref":["___currency","code"]},"=",{"ref":["$projection","currency_code"]}]},"___texts":{"type":"cds.Composition","cardinality":{"max":"*"},"target":"CatalogService.Books.texts","on":[{"ref":["___texts","ID"]},"=",{"ref":["$projection","ID"]}]},"___localized":{"type":"cds.Association","target":"CatalogService.Books.texts","on":[{"ref":["___localized","ID"]},"=",{"ref":["$projection","ID"]},"and",{"ref":["___localized","locale"]},"=",{"ref":["$user","locale"]}]}}}},"CatalogService.Authors":{"kind":"entity","@readonly":true,"@Common.SemanticKey":[{"=":"name"}],"@UI.Identification":[{"Value":{"=":"name"}}],"@UI.SelectionFields":[{"=":"name"}],"@UI.LineItem":[{"Value":{"=":"ID"}},{"Value":{"=":"name"}},{"Value":{"=":"dateOfBirth"}},{"Value":{"=":"dateOfDeath"}},{"Value":{"=":"placeOfBirth"}},{"Value":{"=":"placeOfDeath"}}],"@UI.HeaderInfo.TypeName":"{i18n>Author}","@UI.HeaderInfo.TypeNamePlural":"{i18n>Authors}","@UI.HeaderInfo.Title.Value":{"=":"name"},"@UI.HeaderInfo.Description.Value":{"=":"dateOfBirth"},"@UI.Facets":[{"$Type":"UI.ReferenceFacet","Target":"books/@UI.LineItem"}],"elements":{"ID":{"@title":"{i18n>ID}","@UI.HiddenFilter":true,"@Core.Computed":true,"key":true,"type":"cds.String","length":36,"@cds.persistence.name":"ID"},"createdAt":{"@cds.on.insert":{"=":"$now"},"@UI.HiddenFilter":true,"@Core.Immutable":true,"@title":"{i18n>CreatedAt}","@readonly":true,"type":"cds.UTCTimestamp","@cds.persistence.name":"CREATEDAT"},"createdBy":{"@cds.on.insert":{"=":"$user"},"@UI.HiddenFilter":true,"@Core.Immutable":true,"@title":"{i18n>CreatedBy}","@readonly":true,"@description":"{i18n>UserID.Description}","type":"cds.String","length":255,"@cds.persistence.name":"CREATEDBY"},"modifiedAt":{"@cds.on.insert":{"=":"$now"},"@cds.on.update":{"=":"$now"},"@UI.HiddenFilter":true,"@title":"{i18n>ChangedAt}","@readonly":true,"type":"cds.UTCTimestamp","@cds.persistence.name":"MODIFIEDAT"},"modifiedBy":{"@cds.on.insert":{"=":"$user"},"@cds.on.update":{"=":"$user"},"@UI.HiddenFilter":true,"@title":"{i18n>ChangedBy}","@readonly":true,"@description":"{i18n>UserID.Description}","type":"cds.String","length":255,"@cds.persistence.name":"MODIFIEDBY"},"name":{"@assert.format":"^\\p{Lu}.*","@title":"{i18n>Name}","type":"cds.String","length":111,"@cds.persistence.name":"NAME"},"dateOfBirth":{"@title":"{i18n>DateOfBirth}","type":"cds.LocalDate","@cds.persistence.name":"DATEOFBIRTH"},"dateOfDeath":{"@title":"{i18n>DateOfDeath}","type":"cds.LocalDate","@cds.persistence.name":"DATEOFDEATH"},"placeOfBirth":{"@title":"{i18n>PlaceOfBirth}","type":"cds.String","length":255,"@cds.persistence.name":"PLACEOFBIRTH"},"placeOfDeath":{"@title":"{i18n>PlaceOfDeath}","type":"cds.String","length":255,"@cds.persistence.name":"PLACEOFDEATH"},"books":{"type":"cds.Association","cardinality":{"max":"*"},"target":"CatalogService.Books","on":[{"ref":["books","author_ID"]},"=",{"ref":["ID"]}],"@cds.persistence.name":"BOOKS"}},"@cds.persistence.name":"CATALOGSERVICE_AUTHORS","projection":{"from":{"ref":["my.bookshop.Authors"],"as":"Authors_0"},"columns":[{"ref":["Authors_0","ID"]},{"ref":["Authors_0","createdAt"]},{"ref":["Authors_0","createdBy"]},{"ref":["Authors_0","modifiedAt"]},{"ref":["Authors_0","modifiedBy"]},{"ref":["Authors_0","name"]},{"ref":["Authors_0","dateOfBirth"]},{"ref":["Authors_0","dateOfDeath"]},{"ref":["Authors_0","placeOfBirth"]},{"ref":["Authors_0","placeOfDeath"]},{"ref":["___books"],"as":"books"}],"mixin":{"___books":{"type":"cds.Association","cardinality":{"max":"*"},"target":"CatalogService.Books","on":[{"ref":["___books","author_ID"]},"=",{"ref":["$projection","ID"]}]}}}},"Currency":{"kind":"type","@title":"{i18n>Currency}","@description":"{i18n>CurrencyCode.Description}","type":"cds.Association","target":"sap.common.Currencies","keys":[{"ref":["code"]}],"@cds.persistence.name":"CURRENCY"},"sap.common.Locale":{"kind":"type","@title":"{i18n>LanguageCode}","type":"cds.String","length":14,"@cds.persistence.name":"SAP_COMMON_LOCALE"},"sap.common.Languages":{"kind":"entity","@cds.autoexpose":true,"@cds.persistence.skip":"if-unused","@UI.Identification":[{"Value":{"=":"name"}}],"@cds.odata.valuelist":true,"elements":{"name":{"@title":"{i18n>Name}","type":"cds.String","length":255,"@cds.persistence.name":"NAME"},"descr":{"@title":"{i18n>Description}","type":"cds.String","length":1000,"@cds.persistence.name":"DESCR"},"code":{"@Common.Text":{"=":"name"},"@title":"{i18n>LanguageCode}","key":true,"type":"cds.String","length":14,"@cds.persistence.name":"CODE"},"texts":{"type":"cds.Composition","cardinality":{"max":"*"},"target":"sap.common.Languages.texts","on":[{"ref":["texts","code"]},"=",{"ref":["code"]}],"@cds.persistence.name":"TEXTS"},"localized":{"type":"cds.Association","target":"sap.common.Languages.texts","on":[{"ref":["localized","code"]},"=",{"ref":["code"]},"and",{"ref":["localized","locale"]},"=",{"ref":["$user","locale"]}],"@cds.persistence.name":"LOCALIZED"}},"@cds.persistence.name":"SAP_COMMON_LANGUAGES"},"sap.common.Currencies":{"kind":"entity","@cds.autoexpose":true,"@cds.persistence.skip":"if-unused","@UI.Identification":[{"Value":{"=":"name"}}],"@cds.odata.valuelist":true,"elements":{"name":{"@title":"{i18n>Name}","type":"cds.String","length":255,"@cds.persistence.name":"NAME"},"descr":{"@title":"{i18n>Description}","type":"cds.String","length":1000,"@cds.persistence.name":"DESCR"},"code":{"@title":"{i18n>CurrencyCode}","@Common.Text":{"=":"name"},"key":true,"type":"cds.String","length":3,"@cds.persistence.name":"CODE"},"symbol":{"@title":"{i18n>CurrencySymbol}","type":"cds.String","length":5,"@cds.persistence.name":"SYMBOL"},"minorUnit":{"@title":"{i18n>CurrencyMinorUnit}","type":"cds.Int16","@cds.persistence.name":"MINORUNIT"},"texts":{"type":"cds.Composition","cardinality":{"max":"*"},"target":"sap.common.Currencies.texts","on":[{"ref":["texts","code"]},"=",{"ref":["code"]}],"@cds.persistence.name":"TEXTS"},"localized":{"type":"cds.Association","target":"sap.common.Currencies.texts","on":[{"ref":["localized","code"]},"=",{"ref":["code"]},"and",{"ref":["localized","locale"]},"=",{"ref":["$user","locale"]}],"@cds.persistence.name":"LOCALIZED"}},"@cds.persistence.name":"SAP_COMMON_CURRENCIES"},"sap.common.CodeList":{"kind":"aspect","@cds.autoexpose":true,"@cds.persistence.skip":"if-unused","@UI.Identification":[{"Value":{"=":"name"}}],"@cds.odata.valuelist":true,"elements":{"name":{"@title":"{i18n>Name}","type":"cds.String","length":255,"@cds.persistence.name":"NAME"},"descr":{"@title":"{i18n>Description}","type":"cds.String","length":1000,"@cds.persistence.name":"DESCR"}},"@cds.persistence.name":"SAP_COMMON_CODELIST"},"sap.common.TextsAspect":{"kind":"aspect","elements":{"locale":{"@title":"{i18n>LanguageCode}","key":true,"type":"cds.String","length":14,"@cds.persistence.name":"LOCALE"}},"@cds.persistence.name":"SAP_COMMON_TEXTSASPECT"},"cuid":{"kind":"aspect","elements":{"ID":{"@Core.Computed":true,"key":true,"type":"cds.String","length":36,"@cds.persistence.name":"ID"}},"@cds.persistence.name":"CUID"},"managed":{"kind":"aspect","elements":{"createdAt":{"@cds.on.insert":{"=":"$now"},"@UI.HiddenFilter":true,"@Core.Immutable":true,"@title":"{i18n>CreatedAt}","@readonly":true,"type":"cds.UTCTimestamp","@cds.persistence.name":"CREATEDAT"},"createdBy":{"@cds.on.insert":{"=":"$user"},"@UI.HiddenFilter":true,"@Core.Immutable":true,"@title":"{i18n>CreatedBy}","@readonly":true,"@description":"{i18n>UserID.Description}","type":"cds.String","length":255,"@cds.persistence.name":"CREATEDBY"},"modifiedAt":{"@cds.on.insert":{"=":"$now"},"@cds.on.update":{"=":"$now"},"@UI.HiddenFilter":true,"@title":"{i18n>ChangedAt}","@readonly":true,"type":"cds.UTCTimestamp","@cds.persistence.name":"MODIFIEDAT"},"modifiedBy":{"@cds.on.insert":{"=":"$user"},"@cds.on.update":{"=":"$user"},"@UI.HiddenFilter":true,"@title":"{i18n>ChangedBy}","@readonly":true,"@description":"{i18n>UserID.Description}","type":"cds.String","length":255,"@cds.persistence.name":"MODIFIEDBY"}},"@cds.persistence.name":"MANAGED"},"User":{"kind":"type","@title":"{i18n>UserID}","@description":"{i18n>UserID.Description}","type":"cds.String","length":255,"@cds.persistence.name":"USER"},"my.bookshop.Books.texts":{"kind":"entity","@assert.unique.locale":[{"=":"locale"},{"=":"ID"}],"elements":{"ID_texts":{"key":true,"type":"cds.String","length":36,"@cds.persistence.name":"ID_TEXTS"},"locale":{"@title":"{i18n>LanguageCode}","type":"cds.String","length":14,"@cds.persistence.name":"LOCALE"},"ID":{"@title":"{i18n>ID}","@UI.HiddenFilter":true,"@Core.Computed":true,"type":"cds.String","length":36,"@cds.persistence.name":"ID"},"title":{"@title":"{i18n>Title}","localized":null,"type":"cds.String","length":111,"@cds.persistence.name":"TITLE"},"descr":{"@title":"{i18n>Description}","@UI.MultiLineText":true,"localized":null,"type":"cds.String","length":1111,"@cds.persistence.name":"DESCR"}},"$tableConstraints":{"unique":{"locale":{"paths":[{"ref":["locale"],"isChecked":true},{"ref":["ID"],"isChecked":true}],"parentTable":"my.bookshop.Books.texts"}}},"@cds.persistence.name":"MY_BOOKSHOP_BOOKS_TEXTS"},"my.bookshop.Genres.texts":{"kind":"entity","@odata.draft.enabled":false,"elements":{"locale":{"@title":"{i18n>LanguageCode}","key":true,"type":"cds.String","length":14,"@cds.persistence.name":"LOCALE"},"name":{"@title":"{i18n>Genre}","localized":null,"type":"cds.String","length":255,"@cds.persistence.name":"NAME"},"descr":{"@title":"{i18n>Description}","localized":null,"type":"cds.String","length":1000,"@cds.persistence.name":"DESCR"},"ID":{"@odata.containment.ignore":true,"@title":"{i18n>ID}","key":true,"type":"cds.Integer","@cds.persistence.name":"ID"}},"@cds.persistence.name":"MY_BOOKSHOP_GENRES_TEXTS"},"sap.common.Languages.texts":{"kind":"entity","@odata.draft.enabled":false,"elements":{"locale":{"@title":"{i18n>LanguageCode}","key":true,"type":"cds.String","length":14,"@cds.persistence.name":"LOCALE"},"name":{"@title":"{i18n>Name}","localized":null,"type":"cds.String","length":255,"@cds.persistence.name":"NAME"},"descr":{"@title":"{i18n>Description}","localized":null,"type":"cds.String","length":1000,"@cds.persistence.name":"DESCR"},"code":{"@odata.containment.ignore":true,"@Common.Text":{"=":"name"},"@title":"{i18n>LanguageCode}","key":true,"type":"cds.String","length":14,"@cds.persistence.name":"CODE"}},"@cds.persistence.name":"SAP_COMMON_LANGUAGES_TEXTS"},"sap.common.Currencies.texts":{"kind":"entity","@odata.draft.enabled":false,"elements":{"locale":{"@title":"{i18n>LanguageCode}","key":true,"type":"cds.String","length":14,"@cds.persistence.name":"LOCALE"},"name":{"@title":"{i18n>Name}","localized":null,"type":"cds.String","length":255,"@cds.persistence.name":"NAME"},"descr":{"@title":"{i18n>Description}","localized":null,"type":"cds.String","length":1000,"@cds.persistence.name":"DESCR"},"code":{"@odata.containment.ignore":true,"@title":"{i18n>CurrencyCode}","@Common.Text":{"=":"name"},"key":true,"type":"cds.String","length":3,"@cds.persistence.name":"CODE"}},"@cds.persistence.name":"SAP_COMMON_CURRENCIES_TEXTS"},"AdminService.Genres":{"kind":"entity","@cds.autoexposed":true,"@Common.SemanticKey":[{"=":"name"}],"@UI.SelectionFields":[{"=":"name"}],"@UI.LineItem":[{"Value":{"=":"name"}},{"Value":{"=":"parent.name"},"Label":"Main Genre"}],"@UI.Identification":[{"Value":{"=":"name"}}],"@UI.HeaderInfo.TypeName":"{i18n>Genre}","@UI.HeaderInfo.TypeNamePlural":"{i18n>Genres}","@UI.HeaderInfo.Title.Value":{"=":"name"},"@UI.HeaderInfo.Description.Value":{"=":"ID"},"@UI.Facets":[{"$Type":"UI.ReferenceFacet","Label":"{i18n>SubGenres}","Target":"children/@UI.LineItem"}],"@cds.autoexpose":true,"@cds.persistence.skip":"if-unused","@cds.odata.valuelist":true,"elements":{"name":{"@title":"{i18n>Genre}","type":"cds.String","length":255,"@cds.persistence.name":"NAME"},"descr":{"@title":"{i18n>Description}","type":"cds.String","length":1000,"@cds.persistence.name":"DESCR"},"ID":{"@title":"{i18n>ID}","key":true,"type":"cds.Integer","@cds.persistence.name":"ID"},"parent":{"type":"cds.Association","target":"AdminService.Genres","keys":[{"ref":["ID"],"as":"ID","$generatedFieldName":"parent_ID"}],"on":[{"ref":["parent","ID"]},"=",{"ref":["parent_ID"]}],"@cds.persistence.name":"PARENT"},"parent_ID":{"type":"cds.Integer","@odata.foreignKey4":"parent","@cds.persistence.name":"PARENT_ID"},"children":{"type":"cds.Composition","cardinality":{"max":"*"},"target":"AdminService.Genres","on":[{"ref":["children","parent_ID"]},"=",{"ref":["ID"]}],"@cds.persistence.name":"CHILDREN"},"texts":{"type":"cds.Composition","cardinality":{"max":"*"},"target":"AdminService.Genres.texts","on":[{"ref":["texts","ID"]},"=",{"ref":["ID"]}],"@cds.persistence.name":"TEXTS"},"localized":{"type":"cds.Association","target":"AdminService.Genres.texts","on":[{"ref":["localized","ID"]},"=",{"ref":["ID"]},"and",{"ref":["localized","locale"]},"=",{"ref":["$user","locale"]}],"@cds.persistence.name":"LOCALIZED"}},"@cds.persistence.name":"ADMINSERVICE_GENRES","projection":{"from":{"ref":["my.bookshop.Genres"],"as":"Genres_0"},"columns":[{"ref":["Genres_0","name"]},{"ref":["Genres_0","descr"]},{"ref":["Genres_0","ID"]},{"ref":["___parent"],"as":"parent"},{"ref":["Genres_0","parent_ID"]},{"ref":["___children"],"as":"children"},{"ref":["___texts"],"as":"texts"},{"ref":["___localized"],"as":"localized"}],"mixin":{"___parent":{"type":"cds.Association","target":"AdminService.Genres","keys":[{"ref":["ID"],"as":"ID","$generatedFieldName":"parent_ID"}],"on":[{"ref":["___parent","ID"]},"=",{"ref":["$projection","parent_ID"]}]},"___children":{"type":"cds.Composition","cardinality":{"max":"*"},"target":"AdminService.Genres","on":[{"ref":["___children","parent_ID"]},"=",{"ref":["$projection","ID"]}]},"___texts":{"type":"cds.Composition","cardinality":{"max":"*"},"target":"AdminService.Genres.texts","on":[{"ref":["___texts","ID"]},"=",{"ref":["$projection","ID"]}]},"___localized":{"type":"cds.Association","target":"AdminService.Genres.texts","on":[{"ref":["___localized","ID"]},"=",{"ref":["$projection","ID"]},"and",{"ref":["___localized","locale"]},"=",{"ref":["$user","locale"]}]}}}},"AdminService.Currencies":{"kind":"entity","@cds.autoexposed":true,"@cds.autoexpose":true,"@cds.persistence.skip":"if-unused","@UI.Identification":[{"Value":{"=":"name"}}],"@cds.odata.valuelist":true,"elements":{"name":{"@title":"{i18n>Name}","type":"cds.String","length":255,"@cds.persistence.name":"NAME"},"descr":{"@title":"{i18n>Description}","type":"cds.String","length":1000,"@cds.persistence.name":"DESCR"},"code":{"@title":"{i18n>CurrencyCode}","@Common.Text":{"=":"name"},"key":true,"type":"cds.String","length":3,"@cds.persistence.name":"CODE"},"symbol":{"@title":"{i18n>CurrencySymbol}","type":"cds.String","length":5,"@cds.persistence.name":"SYMBOL"},"minorUnit":{"@title":"{i18n>CurrencyMinorUnit}","type":"cds.Int16","@cds.persistence.name":"MINORUNIT"},"texts":{"type":"cds.Composition","cardinality":{"max":"*"},"target":"AdminService.Currencies.texts","on":[{"ref":["texts","code"]},"=",{"ref":["code"]}],"@cds.persistence.name":"TEXTS"},"localized":{"type":"cds.Association","target":"AdminService.Currencies.texts","on":[{"ref":["localized","code"]},"=",{"ref":["code"]},"and",{"ref":["localized","locale"]},"=",{"ref":["$user","locale"]}],"@cds.persistence.name":"LOCALIZED"}},"@cds.persistence.name":"ADMINSERVICE_CURRENCIES","projection":{"from":{"ref":["sap.common.Currencies"],"as":"Currencies_0"},"columns":[{"ref":["Currencies_0","name"]},{"ref":["Currencies_0","descr"]},{"ref":["Currencies_0","code"]},{"ref":["Currencies_0","symbol"]},{"ref":["Currencies_0","minorUnit"]},{"ref":["___texts"],"as":"texts"},{"ref":["___localized"],"as":"localized"}],"mixin":{"___texts":{"type":"cds.Composition","cardinality":{"max":"*"},"target":"AdminService.Currencies.texts","on":[{"ref":["___texts","code"]},"=",{"ref":["$projection","code"]}]},"___localized":{"type":"cds.Association","target":"AdminService.Currencies.texts","on":[{"ref":["___localized","code"]},"=",{"ref":["$projection","code"]},"and",{"ref":["___localized","locale"]},"=",{"ref":["$user","locale"]}]}}}},"AdminService.Books.texts":{"kind":"entity","@cds.autoexposed":true,"@UI.Identification":[{"Value":{"=":"title"}}],"@UI.SelectionFields":[{"=":"locale"},{"=":"title"}],"@UI.LineItem":[{"Value":{"=":"locale"},"Label":"Locale"},{"Value":{"=":"title"},"Label":"Title"},{"Value":{"=":"descr"},"Label":"Description"}],"@assert.unique.locale":[{"=":"locale"},{"=":"ID"}],"elements":{"ID_texts":{"key":true,"type":"cds.String","length":36,"@cds.persistence.name":"ID_TEXTS"},"locale":{"@ValueList.entity":"Languages","@ValueList.type":{"#":"fixed"},"@title":"{i18n>LanguageCode}","type":"cds.String","length":14,"@cds.persistence.name":"LOCALE"},"ID":{"@title":"{i18n>ID}","@UI.HiddenFilter":true,"@Core.Computed":true,"type":"cds.String","length":36,"@cds.persistence.name":"ID"},"title":{"@title":"{i18n>Title}","localized":null,"type":"cds.String","length":111,"@cds.persistence.name":"TITLE"},"descr":{"@title":"{i18n>Description}","@UI.MultiLineText":true,"localized":null,"type":"cds.String","length":1111,"@cds.persistence.name":"DESCR"}},"@cds.persistence.name":"ADMINSERVICE_BOOKS_TEXTS","projection":{"from":{"ref":["my.bookshop.Books.texts"],"as":"texts_0"},"columns":[{"ref":["texts_0","ID_texts"]},{"ref":["texts_0","locale"]},{"ref":["texts_0","ID"]},{"ref":["texts_0","title"]},{"ref":["texts_0","descr"]}]}},"AdminService.Languages.texts":{"kind":"entity","@cds.autoexposed":true,"@odata.draft.enabled":false,"elements":{"locale":{"@title":"{i18n>LanguageCode}","key":true,"type":"cds.String","length":14,"@cds.persistence.name":"LOCALE"},"name":{"@title":"{i18n>Name}","localized":null,"type":"cds.String","length":255,"@cds.persistence.name":"NAME"},"descr":{"@title":"{i18n>Description}","localized":null,"type":"cds.String","length":1000,"@cds.persistence.name":"DESCR"},"code":{"@odata.containment.ignore":true,"@Common.Text":{"=":"name"},"@title":"{i18n>LanguageCode}","key":true,"type":"cds.String","length":14,"@cds.persistence.name":"CODE"}},"@cds.persistence.name":"ADMINSERVICE_LANGUAGES_TEXTS","projection":{"from":{"ref":["sap.common.Languages.texts"],"as":"texts_0"},"columns":[{"ref":["texts_0","locale"]},{"ref":["texts_0","name"]},{"ref":["texts_0","descr"]},{"ref":["texts_0","code"]}]}},"CatalogService.Genres":{"kind":"entity","@cds.autoexposed":true,"@Common.SemanticKey":[{"=":"name"}],"@UI.SelectionFields":[{"=":"name"}],"@UI.LineItem":[{"Value":{"=":"name"}},{"Value":{"=":"parent.name"},"Label":"Main Genre"}],"@UI.Identification":[{"Value":{"=":"name"}}],"@UI.HeaderInfo.TypeName":"{i18n>Genre}","@UI.HeaderInfo.TypeNamePlural":"{i18n>Genres}","@UI.HeaderInfo.Title.Value":{"=":"name"},"@UI.HeaderInfo.Description.Value":{"=":"ID"},"@UI.Facets":[{"$Type":"UI.ReferenceFacet","Label":"{i18n>SubGenres}","Target":"children/@UI.LineItem"}],"@cds.autoexpose":true,"@cds.persistence.skip":"if-unused","@cds.odata.valuelist":true,"elements":{"name":{"@title":"{i18n>Genre}","type":"cds.String","length":255,"@cds.persistence.name":"NAME"},"descr":{"@title":"{i18n>Description}","type":"cds.String","length":1000,"@cds.persistence.name":"DESCR"},"ID":{"@title":"{i18n>ID}","key":true,"type":"cds.Integer","@cds.persistence.name":"ID"},"parent":{"type":"cds.Association","target":"CatalogService.Genres","keys":[{"ref":["ID"],"as":"ID","$generatedFieldName":"parent_ID"}],"on":[{"ref":["parent","ID"]},"=",{"ref":["parent_ID"]}],"@cds.persistence.name":"PARENT"},"parent_ID":{"type":"cds.Integer","@odata.foreignKey4":"parent","@cds.persistence.name":"PARENT_ID"},"children":{"type":"cds.Composition","cardinality":{"max":"*"},"target":"CatalogService.Genres","on":[{"ref":["children","parent_ID"]},"=",{"ref":["ID"]}],"@cds.persistence.name":"CHILDREN"},"texts":{"type":"cds.Composition","cardinality":{"max":"*"},"target":"CatalogService.Genres.texts","on":[{"ref":["texts","ID"]},"=",{"ref":["ID"]}],"@cds.persistence.name":"TEXTS"},"localized":{"type":"cds.Association","target":"CatalogService.Genres.texts","on":[{"ref":["localized","ID"]},"=",{"ref":["ID"]},"and",{"ref":["localized","locale"]},"=",{"ref":["$user","locale"]}],"@cds.persistence.name":"LOCALIZED"}},"@cds.persistence.name":"CATALOGSERVICE_GENRES","projection":{"from":{"ref":["my.bookshop.Genres"],"as":"Genres_0"},"columns":[{"ref":["Genres_0","name"]},{"ref":["Genres_0","descr"]},{"ref":["Genres_0","ID"]},{"ref":["___parent"],"as":"parent"},{"ref":["Genres_0","parent_ID"]},{"ref":["___children"],"as":"children"},{"ref":["___texts"],"as":"texts"},{"ref":["___localized"],"as":"localized"}],"mixin":{"___parent":{"type":"cds.Association","target":"CatalogService.Genres","keys":[{"ref":["ID"],"as":"ID","$generatedFieldName":"parent_ID"}],"on":[{"ref":["___parent","ID"]},"=",{"ref":["$projection","parent_ID"]}]},"___children":{"type":"cds.Composition","cardinality":{"max":"*"},"target":"CatalogService.Genres","on":[{"ref":["___children","parent_ID"]},"=",{"ref":["$projection","ID"]}]},"___texts":{"type":"cds.Composition","cardinality":{"max":"*"},"target":"CatalogService.Genres.texts","on":[{"ref":["___texts","ID"]},"=",{"ref":["$projection","ID"]}]},"___localized":{"type":"cds.Association","target":"CatalogService.Genres.texts","on":[{"ref":["___localized","ID"]},"=",{"ref":["$projection","ID"]},"and",{"ref":["___localized","locale"]},"=",{"ref":["$user","locale"]}]}}}},"CatalogService.Currencies":{"kind":"entity","@cds.autoexposed":true,"@cds.autoexpose":true,"@cds.persistence.skip":"if-unused","@UI.Identification":[{"Value":{"=":"name"}}],"@cds.odata.valuelist":true,"elements":{"name":{"@title":"{i18n>Name}","type":"cds.String","length":255,"@cds.persistence.name":"NAME"},"descr":{"@title":"{i18n>Description}","type":"cds.String","length":1000,"@cds.persistence.name":"DESCR"},"code":{"@title":"{i18n>CurrencyCode}","@Common.Text":{"=":"name"},"key":true,"type":"cds.String","length":3,"@cds.persistence.name":"CODE"},"symbol":{"@title":"{i18n>CurrencySymbol}","type":"cds.String","length":5,"@cds.persistence.name":"SYMBOL"},"minorUnit":{"@title":"{i18n>CurrencyMinorUnit}","type":"cds.Int16","@cds.persistence.name":"MINORUNIT"},"texts":{"type":"cds.Composition","cardinality":{"max":"*"},"target":"CatalogService.Currencies.texts","on":[{"ref":["texts","code"]},"=",{"ref":["code"]}],"@cds.persistence.name":"TEXTS"},"localized":{"type":"cds.Association","target":"CatalogService.Currencies.texts","on":[{"ref":["localized","code"]},"=",{"ref":["code"]},"and",{"ref":["localized","locale"]},"=",{"ref":["$user","locale"]}],"@cds.persistence.name":"LOCALIZED"}},"@cds.persistence.name":"CATALOGSERVICE_CURRENCIES","projection":{"from":{"ref":["sap.common.Currencies"],"as":"Currencies_0"},"columns":[{"ref":["Currencies_0","name"]},{"ref":["Currencies_0","descr"]},{"ref":["Currencies_0","code"]},{"ref":["Currencies_0","symbol"]},{"ref":["Currencies_0","minorUnit"]},{"ref":["___texts"],"as":"texts"},{"ref":["___localized"],"as":"localized"}],"mixin":{"___texts":{"type":"cds.Composition","cardinality":{"max":"*"},"target":"CatalogService.Currencies.texts","on":[{"ref":["___texts","code"]},"=",{"ref":["$projection","code"]}]},"___localized":{"type":"cds.Association","target":"CatalogService.Currencies.texts","on":[{"ref":["___localized","code"]},"=",{"ref":["$projection","code"]},"and",{"ref":["___localized","locale"]},"=",{"ref":["$user","locale"]}]}}}},"CatalogService.Books.texts":{"kind":"entity","@cds.autoexposed":true,"@UI.LineItem":[{"Value":{"=":"locale"}},{"Value":{"=":"title"}},{"Value":{"=":"descr"}}],"@assert.unique.locale":[{"=":"locale"},{"=":"ID"}],"elements":{"ID_texts":{"key":true,"type":"cds.String","length":36,"@cds.persistence.name":"ID_TEXTS"},"locale":{"@title":"{i18n>LanguageCode}","type":"cds.String","length":14,"@cds.persistence.name":"LOCALE"},"ID":{"@title":"{i18n>ID}","@UI.HiddenFilter":true,"@Core.Computed":true,"type":"cds.String","length":36,"@cds.persistence.name":"ID"},"title":{"@title":"{i18n>Title}","localized":null,"type":"cds.String","length":111,"@cds.persistence.name":"TITLE"},"descr":{"@title":"{i18n>Description}","@UI.MultiLineText":true,"localized":null,"type":"cds.String","length":1111,"@cds.persistence.name":"DESCR"}},"@cds.persistence.name":"CATALOGSERVICE_BOOKS_TEXTS","projection":{"from":{"ref":["my.bookshop.Books.texts"],"as":"texts_0"},"columns":[{"ref":["texts_0","ID_texts"]},{"ref":["texts_0","locale"]},{"ref":["texts_0","ID"]},{"ref":["texts_0","title"]},{"ref":["texts_0","descr"]}]}},"AdminService.Genres.texts":{"kind":"entity","@cds.autoexposed":true,"@odata.draft.enabled":false,"elements":{"locale":{"@title":"{i18n>LanguageCode}","key":true,"type":"cds.String","length":14,"@cds.persistence.name":"LOCALE"},"name":{"@title":"{i18n>Genre}","localized":null,"type":"cds.String","length":255,"@cds.persistence.name":"NAME"},"descr":{"@title":"{i18n>Description}","localized":null,"type":"cds.String","length":1000,"@cds.persistence.name":"DESCR"},"ID":{"@odata.containment.ignore":true,"@title":"{i18n>ID}","key":true,"type":"cds.Integer","@cds.persistence.name":"ID"}},"@cds.persistence.name":"ADMINSERVICE_GENRES_TEXTS","projection":{"from":{"ref":["my.bookshop.Genres.texts"],"as":"texts_0"},"columns":[{"ref":["texts_0","locale"]},{"ref":["texts_0","name"]},{"ref":["texts_0","descr"]},{"ref":["texts_0","ID"]}]}},"AdminService.Currencies.texts":{"kind":"entity","@cds.autoexposed":true,"@odata.draft.enabled":false,"elements":{"locale":{"@title":"{i18n>LanguageCode}","key":true,"type":"cds.String","length":14,"@cds.persistence.name":"LOCALE"},"name":{"@title":"{i18n>Name}","localized":null,"type":"cds.String","length":255,"@cds.persistence.name":"NAME"},"descr":{"@title":"{i18n>Description}","localized":null,"type":"cds.String","length":1000,"@cds.persistence.name":"DESCR"},"code":{"@odata.containment.ignore":true,"@title":"{i18n>CurrencyCode}","@Common.Text":{"=":"name"},"key":true,"type":"cds.String","length":3,"@cds.persistence.name":"CODE"}},"@cds.persistence.name":"ADMINSERVICE_CURRENCIES_TEXTS","projection":{"from":{"ref":["sap.common.Currencies.texts"],"as":"texts_0"},"columns":[{"ref":["texts_0","locale"]},{"ref":["texts_0","name"]},{"ref":["texts_0","descr"]},{"ref":["texts_0","code"]}]}},"CatalogService.Genres.texts":{"kind":"entity","@cds.autoexposed":true,"@odata.draft.enabled":false,"elements":{"locale":{"@title":"{i18n>LanguageCode}","key":true,"type":"cds.String","length":14,"@cds.persistence.name":"LOCALE"},"name":{"@title":"{i18n>Genre}","localized":null,"type":"cds.String","length":255,"@cds.persistence.name":"NAME"},"descr":{"@title":"{i18n>Description}","localized":null,"type":"cds.String","length":1000,"@cds.persistence.name":"DESCR"},"ID":{"@odata.containment.ignore":true,"@title":"{i18n>ID}","key":true,"type":"cds.Integer","@cds.persistence.name":"ID"}},"@cds.persistence.name":"CATALOGSERVICE_GENRES_TEXTS","projection":{"from":{"ref":["my.bookshop.Genres.texts"],"as":"texts_0"},"columns":[{"ref":["texts_0","locale"]},{"ref":["texts_0","name"]},{"ref":["texts_0","descr"]},{"ref":["texts_0","ID"]}]}},"CatalogService.Currencies.texts":{"kind":"entity","@cds.autoexposed":true,"@odata.draft.enabled":false,"elements":{"locale":{"@title":"{i18n>LanguageCode}","key":true,"type":"cds.String","length":14,"@cds.persistence.name":"LOCALE"},"name":{"@title":"{i18n>Name}","localized":null,"type":"cds.String","length":255,"@cds.persistence.name":"NAME"},"descr":{"@title":"{i18n>Description}","localized":null,"type":"cds.String","length":1000,"@cds.persistence.name":"DESCR"},"code":{"@odata.containment.ignore":true,"@title":"{i18n>CurrencyCode}","@Common.Text":{"=":"name"},"key":true,"type":"cds.String","length":3,"@cds.persistence.name":"CODE"}},"@cds.persistence.name":"CATALOGSERVICE_CURRENCIES_TEXTS","projection":{"from":{"ref":["sap.common.Currencies.texts"],"as":"texts_0"},"columns":[{"ref":["texts_0","locale"]},{"ref":["texts_0","name"]},{"ref":["texts_0","descr"]},{"ref":["texts_0","code"]}]}},"localized.my.bookshop.Books":{"@odata.draft.enabled":false,"kind":"entity","query":{"SELECT":{"from":{"join":"left","args":[{"ref":["my.bookshop.Books"],"as":"L_0"},{"ref":["my.bookshop.Books.texts"],"as":"localized_1"}],"on":[{"ref":["localized_1","ID"]},"=",{"ref":["L_0","ID"]},"and",{"ref":["localized_1","locale"]},"=",{"ref":["$user","locale"]}]},"columns":[{"ref":["L_0","ID"]},{"ref":["L_0","createdAt"]},{"ref":["L_0","createdBy"]},{"ref":["L_0","modifiedAt"]},{"ref":["L_0","modifiedBy"]},{"func":"coalesce","args":[{"ref":["localized_1","title"]},{"ref":["L_0","title"]}],"as":"title"},{"func":"coalesce","args":[{"ref":["localized_1","descr"]},{"ref":["L_0","descr"]}],"as":"descr"},{"ref":["___author"],"as":"author"},{"ref":["L_0","author_ID"]},{"ref":["___genre"],"as":"genre"},{"ref":["L_0","genre_ID"]},{"ref":["L_0","stock"]},{"ref":["L_0","price"]},{"ref":["___currency"],"as":"currency"},{"ref":["L_0","currency_code"]},{"ref":["L_0","rating"]},{"ref":["L_0","isbn"]},{"ref":["___texts"],"as":"texts"},{"ref":["___localized"],"as":"localized"}],"mixin":{"___author":{"@ValueList.entity":"Authors","@title":"{i18n>Author}","@Common.Text":{"=":"author.name"},"@Common.TextArrangement":{"#":"TextOnly"},"type":"cds.Association","target":"localized.my.bookshop.Authors","keys":[{"ref":["ID"],"as":"ID","$generatedFieldName":"author_ID"}],"on":[{"ref":["___author","ID"]},"=",{"ref":["$projection","author_ID"]}]},"___genre":{"@title":"{i18n>Genre}","@Common.Text":{"=":"genre.name"},"@Common.TextArrangement":{"#":"TextOnly"},"type":"cds.Association","target":"localized.my.bookshop.Genres","keys":[{"ref":["ID"],"as":"ID","$generatedFieldName":"genre_ID"}],"on":[{"ref":["___genre","ID"]},"=",{"ref":["$projection","genre_ID"]}]},"___currency":{"@title":"{i18n>Currency}","@description":"{i18n>CurrencyCode.Description}","type":"cds.Association","target":"localized.sap.common.Currencies","keys":[{"ref":["code"],"as":"code","$generatedFieldName":"currency_code"}],"on":[{"ref":["___currency","code"]},"=",{"ref":["$projection","currency_code"]}]},"___texts":{"type":"cds.Composition","cardinality":{"max":"*"},"target":"my.bookshop.Books.texts","on":[{"ref":["___texts","ID"]},"=",{"ref":["$projection","ID"]}]},"___localized":{"type":"cds.Association","target":"my.bookshop.Books.texts","on":[{"ref":["___localized","ID"]},"=",{"ref":["$projection","ID"]},"and",{"ref":["___localized","locale"]},"=",{"ref":["$user","locale"]}]}}}},"elements":{"ID":{"@title":"{i18n>ID}","@UI.HiddenFilter":true,"@Core.Computed":true,"key":true,"type":"cds.String","length":36,"@cds.persistence.name":"ID"},"createdAt":{"@cds.on.insert":{"=":"$now"},"@UI.HiddenFilter":true,"@Core.Immutable":true,"@title":"{i18n>CreatedAt}","@readonly":true,"type":"cds.UTCTimestamp","@cds.persistence.name":"CREATEDAT"},"createdBy":{"@cds.on.insert":{"=":"$user"},"@UI.HiddenFilter":true,"@Core.Immutable":true,"@title":"{i18n>CreatedBy}","@readonly":true,"@description":"{i18n>UserID.Description}","type":"cds.String","length":255,"@cds.persistence.name":"CREATEDBY"},"modifiedAt":{"@cds.on.insert":{"=":"$now"},"@cds.on.update":{"=":"$now"},"@UI.HiddenFilter":true,"@title":"{i18n>ChangedAt}","@readonly":true,"type":"cds.UTCTimestamp","@cds.persistence.name":"MODIFIEDAT"},"modifiedBy":{"@cds.on.insert":{"=":"$user"},"@cds.on.update":{"=":"$user"},"@UI.HiddenFilter":true,"@title":"{i18n>ChangedBy}","@readonly":true,"@description":"{i18n>UserID.Description}","type":"cds.String","length":255,"@cds.persistence.name":"MODIFIEDBY"},"title":{"@title":"{i18n>Title}","type":"cds.String","length":111,"@Core.Computed":true,"@cds.persistence.name":"TITLE"},"descr":{"@title":"{i18n>Description}","@UI.MultiLineText":true,"type":"cds.String","length":1111,"@Core.Computed":true,"@cds.persistence.name":"DESCR"},"author":{"@ValueList.entity":"Authors","@title":"{i18n>Author}","@Common.Text":{"=":"author.name"},"@Common.TextArrangement":{"#":"TextOnly"},"type":"cds.Association","target":"localized.my.bookshop.Authors","keys":[{"ref":["ID"],"as":"ID","$generatedFieldName":"author_ID"}],"on":[{"ref":["author","ID"]},"=",{"ref":["author_ID"]}],"@cds.persistence.name":"AUTHOR"},"author_ID":{"@odata.foreignKey4":"author","type":"cds.String","length":36,"@cds.persistence.name":"AUTHOR_ID"},"genre":{"@title":"{i18n>Genre}","@Common.Text":{"=":"genre.name"},"@Common.TextArrangement":{"#":"TextOnly"},"type":"cds.Association","target":"localized.my.bookshop.Genres","keys":[{"ref":["ID"],"as":"ID","$generatedFieldName":"genre_ID"}],"on":[{"ref":["genre","ID"]},"=",{"ref":["genre_ID"]}],"@cds.persistence.name":"GENRE"},"genre_ID":{"@odata.foreignKey4":"genre","type":"cds.Integer","@cds.persistence.name":"GENRE_ID"},"stock":{"@title":"{i18n>Stock}","type":"cds.Integer","@cds.persistence.name":"STOCK"},"price":{"@title":"{i18n>Price}","type":"cds.Decimal","precision":9,"scale":2,"@cds.persistence.name":"PRICE"},"currency":{"@title":"{i18n>Currency}","@description":"{i18n>CurrencyCode.Description}","type":"cds.Association","target":"localized.sap.common.Currencies","keys":[{"ref":["code"],"as":"code","$generatedFieldName":"currency_code"}],"on":[{"ref":["currency","code"]},"=",{"ref":["currency_code"]}],"@cds.persistence.name":"CURRENCY"},"currency_code":{"@odata.foreignKey4":"currency","type":"cds.String","length":3,"@cds.persistence.name":"CURRENCY_CODE"},"rating":{"type":"cds.Decimal","precision":2,"scale":1,"@cds.persistence.name":"RATING"},"isbn":{"type":"cds.String","length":40,"@cds.persistence.name":"ISBN"},"texts":{"type":"cds.Composition","cardinality":{"max":"*"},"target":"my.bookshop.Books.texts","on":[{"ref":["texts","ID"]},"=",{"ref":["ID"]}],"@cds.persistence.name":"TEXTS"},"localized":{"type":"cds.Association","target":"my.bookshop.Books.texts","on":[{"ref":["localized","ID"]},"=",{"ref":["ID"]},"and",{"ref":["localized","locale"]},"=",{"ref":["$user","locale"]}],"@cds.persistence.name":"LOCALIZED"}},"@cds.persistence.name":"LOCALIZED_MY_BOOKSHOP_BOOKS"},"localized.my.bookshop.Genres":{"@odata.draft.enabled":false,"kind":"entity","query":{"SELECT":{"from":{"join":"left","args":[{"ref":["my.bookshop.Genres"],"as":"L_0"},{"ref":["my.bookshop.Genres.texts"],"as":"localized_1"}],"on":[{"ref":["localized_1","ID"]},"=",{"ref":["L_0","ID"]},"and",{"ref":["localized_1","locale"]},"=",{"ref":["$user","locale"]}]},"columns":[{"func":"coalesce","args":[{"ref":["localized_1","name"]},{"ref":["L_0","name"]}],"as":"name"},{"func":"coalesce","args":[{"ref":["localized_1","descr"]},{"ref":["L_0","descr"]}],"as":"descr"},{"ref":["L_0","ID"]},{"ref":["___parent"],"as":"parent"},{"ref":["L_0","parent_ID"]},{"ref":["___children"],"as":"children"},{"ref":["___texts"],"as":"texts"},{"ref":["___localized"],"as":"localized"}],"mixin":{"___parent":{"type":"cds.Association","target":"localized.my.bookshop.Genres","keys":[{"ref":["ID"],"as":"ID","$generatedFieldName":"parent_ID"}],"on":[{"ref":["___parent","ID"]},"=",{"ref":["$projection","parent_ID"]}]},"___children":{"type":"cds.Composition","cardinality":{"max":"*"},"target":"localized.my.bookshop.Genres","on":[{"ref":["___children","parent_ID"]},"=",{"ref":["$projection","ID"]}]},"___texts":{"type":"cds.Composition","cardinality":{"max":"*"},"target":"my.bookshop.Genres.texts","on":[{"ref":["___texts","ID"]},"=",{"ref":["$projection","ID"]}]},"___localized":{"type":"cds.Association","target":"my.bookshop.Genres.texts","on":[{"ref":["___localized","ID"]},"=",{"ref":["$projection","ID"]},"and",{"ref":["___localized","locale"]},"=",{"ref":["$user","locale"]}]}}}},"elements":{"name":{"@title":"{i18n>Genre}","type":"cds.String","length":255,"@Core.Computed":true,"@cds.persistence.name":"NAME"},"descr":{"@title":"{i18n>Description}","type":"cds.String","length":1000,"@Core.Computed":true,"@cds.persistence.name":"DESCR"},"ID":{"@title":"{i18n>ID}","key":true,"type":"cds.Integer","@cds.persistence.name":"ID"},"parent":{"type":"cds.Association","target":"localized.my.bookshop.Genres","keys":[{"ref":["ID"],"as":"ID","$generatedFieldName":"parent_ID"}],"on":[{"ref":["parent","ID"]},"=",{"ref":["parent_ID"]}],"@cds.persistence.name":"PARENT"},"parent_ID":{"@odata.foreignKey4":"parent","type":"cds.Integer","@cds.persistence.name":"PARENT_ID"},"children":{"type":"cds.Composition","cardinality":{"max":"*"},"target":"localized.my.bookshop.Genres","on":[{"ref":["children","parent_ID"]},"=",{"ref":["ID"]}],"@cds.persistence.name":"CHILDREN"},"texts":{"type":"cds.Composition","cardinality":{"max":"*"},"target":"my.bookshop.Genres.texts","on":[{"ref":["texts","ID"]},"=",{"ref":["ID"]}],"@cds.persistence.name":"TEXTS"},"localized":{"type":"cds.Association","target":"my.bookshop.Genres.texts","on":[{"ref":["localized","ID"]},"=",{"ref":["ID"]},"and",{"ref":["localized","locale"]},"=",{"ref":["$user","locale"]}],"@cds.persistence.name":"LOCALIZED"}},"@cds.persistence.skip":"if-unused","@cds.persistence.name":"LOCALIZED_MY_BOOKSHOP_GENRES"},"localized.sap.common.Languages":{"@odata.draft.enabled":false,"kind":"entity","query":{"SELECT":{"from":{"join":"left","args":[{"ref":["sap.common.Languages"],"as":"L_0"},{"ref":["sap.common.Languages.texts"],"as":"localized_1"}],"on":[{"ref":["localized_1","code"]},"=",{"ref":["L_0","code"]},"and",{"ref":["localized_1","locale"]},"=",{"ref":["$user","locale"]}]},"columns":[{"func":"coalesce","args":[{"ref":["localized_1","name"]},{"ref":["L_0","name"]}],"as":"name"},{"func":"coalesce","args":[{"ref":["localized_1","descr"]},{"ref":["L_0","descr"]}],"as":"descr"},{"ref":["L_0","code"]},{"ref":["___texts"],"as":"texts"},{"ref":["___localized"],"as":"localized"}],"mixin":{"___texts":{"type":"cds.Composition","cardinality":{"max":"*"},"target":"sap.common.Languages.texts","on":[{"ref":["___texts","code"]},"=",{"ref":["$projection","code"]}]},"___localized":{"type":"cds.Association","target":"sap.common.Languages.texts","on":[{"ref":["___localized","code"]},"=",{"ref":["$projection","code"]},"and",{"ref":["___localized","locale"]},"=",{"ref":["$user","locale"]}]}}}},"elements":{"name":{"@title":"{i18n>Name}","type":"cds.String","length":255,"@Core.Computed":true,"@cds.persistence.name":"NAME"},"descr":{"@title":"{i18n>Description}","type":"cds.String","length":1000,"@Core.Computed":true,"@cds.persistence.name":"DESCR"},"code":{"@Common.Text":{"=":"name"},"@title":"{i18n>LanguageCode}","key":true,"type":"cds.String","length":14,"@cds.persistence.name":"CODE"},"texts":{"type":"cds.Composition","cardinality":{"max":"*"},"target":"sap.common.Languages.texts","on":[{"ref":["texts","code"]},"=",{"ref":["code"]}],"@cds.persistence.name":"TEXTS"},"localized":{"type":"cds.Association","target":"sap.common.Languages.texts","on":[{"ref":["localized","code"]},"=",{"ref":["code"]},"and",{"ref":["localized","locale"]},"=",{"ref":["$user","locale"]}],"@cds.persistence.name":"LOCALIZED"}},"@cds.persistence.skip":"if-unused","@cds.persistence.name":"LOCALIZED_SAP_COMMON_LANGUAGES"},"localized.sap.common.Currencies":{"@odata.draft.enabled":false,"kind":"entity","query":{"SELECT":{"from":{"join":"left","args":[{"ref":["sap.common.Currencies"],"as":"L_0"},{"ref":["sap.common.Currencies.texts"],"as":"localized_1"}],"on":[{"ref":["localized_1","code"]},"=",{"ref":["L_0","code"]},"and",{"ref":["localized_1","locale"]},"=",{"ref":["$user","locale"]}]},"columns":[{"func":"coalesce","args":[{"ref":["localized_1","name"]},{"ref":["L_0","name"]}],"as":"name"},{"func":"coalesce","args":[{"ref":["localized_1","descr"]},{"ref":["L_0","descr"]}],"as":"descr"},{"ref":["L_0","code"]},{"ref":["L_0","symbol"]},{"ref":["L_0","minorUnit"]},{"ref":["___texts"],"as":"texts"},{"ref":["___localized"],"as":"localized"}],"mixin":{"___texts":{"type":"cds.Composition","cardinality":{"max":"*"},"target":"sap.common.Currencies.texts","on":[{"ref":["___texts","code"]},"=",{"ref":["$projection","code"]}]},"___localized":{"type":"cds.Association","target":"sap.common.Currencies.texts","on":[{"ref":["___localized","code"]},"=",{"ref":["$projection","code"]},"and",{"ref":["___localized","locale"]},"=",{"ref":["$user","locale"]}]}}}},"elements":{"name":{"@title":"{i18n>Name}","type":"cds.String","length":255,"@Core.Computed":true,"@cds.persistence.name":"NAME"},"descr":{"@title":"{i18n>Description}","type":"cds.String","length":1000,"@Core.Computed":true,"@cds.persistence.name":"DESCR"},"code":{"@title":"{i18n>CurrencyCode}","@Common.Text":{"=":"name"},"key":true,"type":"cds.String","length":3,"@cds.persistence.name":"CODE"},"symbol":{"@title":"{i18n>CurrencySymbol}","type":"cds.String","length":5,"@cds.persistence.name":"SYMBOL"},"minorUnit":{"@title":"{i18n>CurrencyMinorUnit}","type":"cds.Int16","@cds.persistence.name":"MINORUNIT"},"texts":{"type":"cds.Composition","cardinality":{"max":"*"},"target":"sap.common.Currencies.texts","on":[{"ref":["texts","code"]},"=",{"ref":["code"]}],"@cds.persistence.name":"TEXTS"},"localized":{"type":"cds.Association","target":"sap.common.Currencies.texts","on":[{"ref":["localized","code"]},"=",{"ref":["code"]},"and",{"ref":["localized","locale"]},"=",{"ref":["$user","locale"]}],"@cds.persistence.name":"LOCALIZED"}},"@cds.persistence.skip":"if-unused","@cds.persistence.name":"LOCALIZED_SAP_COMMON_CURRENCIES"},"localized.my.bookshop.Authors":{"@odata.draft.enabled":false,"kind":"entity","query":{"SELECT":{"from":{"ref":["my.bookshop.Authors"],"as":"L"},"columns":[{"ref":["L","ID"]},{"ref":["L","createdAt"]},{"ref":["L","createdBy"]},{"ref":["L","modifiedAt"]},{"ref":["L","modifiedBy"]},{"ref":["L","name"]},{"ref":["L","dateOfBirth"]},{"ref":["L","dateOfDeath"]},{"ref":["L","placeOfBirth"]},{"ref":["L","placeOfDeath"]},{"ref":["___books"],"as":"books"}],"mixin":{"___books":{"type":"cds.Association","cardinality":{"max":"*"},"target":"localized.my.bookshop.Books","on":[{"ref":["___books","author_ID"]},"=",{"ref":["$projection","ID"]}]}}}},"elements":{"ID":{"@title":"{i18n>ID}","@UI.HiddenFilter":true,"@Core.Computed":true,"key":true,"type":"cds.String","length":36,"@cds.persistence.name":"ID"},"createdAt":{"@cds.on.insert":{"=":"$now"},"@UI.HiddenFilter":true,"@Core.Immutable":true,"@title":"{i18n>CreatedAt}","@readonly":true,"type":"cds.UTCTimestamp","@cds.persistence.name":"CREATEDAT"},"createdBy":{"@cds.on.insert":{"=":"$user"},"@UI.HiddenFilter":true,"@Core.Immutable":true,"@title":"{i18n>CreatedBy}","@readonly":true,"@description":"{i18n>UserID.Description}","type":"cds.String","length":255,"@cds.persistence.name":"CREATEDBY"},"modifiedAt":{"@cds.on.insert":{"=":"$now"},"@cds.on.update":{"=":"$now"},"@UI.HiddenFilter":true,"@title":"{i18n>ChangedAt}","@readonly":true,"type":"cds.UTCTimestamp","@cds.persistence.name":"MODIFIEDAT"},"modifiedBy":{"@cds.on.insert":{"=":"$user"},"@cds.on.update":{"=":"$user"},"@UI.HiddenFilter":true,"@title":"{i18n>ChangedBy}","@readonly":true,"@description":"{i18n>UserID.Description}","type":"cds.String","length":255,"@cds.persistence.name":"MODIFIEDBY"},"name":{"@assert.format":"^\\p{Lu}.*","@title":"{i18n>Name}","type":"cds.String","length":111,"@cds.persistence.name":"NAME"},"dateOfBirth":{"@title":"{i18n>DateOfBirth}","type":"cds.LocalDate","@cds.persistence.name":"DATEOFBIRTH"},"dateOfDeath":{"@title":"{i18n>DateOfDeath}","type":"cds.LocalDate","@cds.persistence.name":"DATEOFDEATH"},"placeOfBirth":{"@title":"{i18n>PlaceOfBirth}","type":"cds.String","length":255,"@cds.persistence.name":"PLACEOFBIRTH"},"placeOfDeath":{"@title":"{i18n>PlaceOfDeath}","type":"cds.String","length":255,"@cds.persistence.name":"PLACEOFDEATH"},"books":{"type":"cds.Association","cardinality":{"max":"*"},"target":"localized.my.bookshop.Books","on":[{"ref":["books","author_ID"]},"=",{"ref":["ID"]}],"@cds.persistence.name":"BOOKS"}},"@cds.persistence.name":"LOCALIZED_MY_BOOKSHOP_AUTHORS"},"localized.AdminService.Books":{"kind":"entity","@odata.draft.enabled":false,"query":{"SELECT":{"from":{"ref":["localized.my.bookshop.Books"],"as":"Books_0"},"columns":[{"ref":["Books_0","ID"]},{"ref":["Books_0","createdAt"]},{"ref":["Books_0","createdBy"]},{"ref":["Books_0","modifiedAt"]},{"ref":["Books_0","modifiedBy"]},{"ref":["Books_0","title"]},{"ref":["Books_0","descr"]},{"ref":["___author"],"as":"author"},{"ref":["Books_0","author_ID"]},{"ref":["___genre"],"as":"genre"},{"ref":["Books_0","genre_ID"]},{"ref":["Books_0","stock"]},{"ref":["Books_0","price"]},{"ref":["___currency"],"as":"currency"},{"ref":["Books_0","currency_code"]},{"ref":["Books_0","rating"]},{"ref":["Books_0","isbn"]},{"ref":["___texts"],"as":"texts"},{"ref":["___localized"],"as":"localized"}],"mixin":{"___author":{"@ValueList.entity":"Authors","@title":"{i18n>Author}","@Common.Text":{"=":"author.name"},"@Common.TextArrangement":{"#":"TextOnly"},"type":"cds.Association","target":"localized.AdminService.Authors","keys":[{"ref":["ID"],"as":"ID","$generatedFieldName":"author_ID"}],"on":[{"ref":["___author","ID"]},"=",{"ref":["$projection","author_ID"]}]},"___genre":{"@title":"{i18n>Genre}","@Common.Text":{"=":"genre.name"},"@Common.TextArrangement":{"#":"TextOnly"},"type":"cds.Association","target":"localized.AdminService.Genres","keys":[{"ref":["ID"],"as":"ID","$generatedFieldName":"genre_ID"}],"on":[{"ref":["___genre","ID"]},"=",{"ref":["$projection","genre_ID"]}]},"___currency":{"@title":"{i18n>Currency}","@description":"{i18n>CurrencyCode.Description}","type":"cds.Association","target":"localized.AdminService.Currencies","keys":[{"ref":["code"],"as":"code","$generatedFieldName":"currency_code"}],"on":[{"ref":["___currency","code"]},"=",{"ref":["$projection","currency_code"]}]},"___texts":{"type":"cds.Composition","cardinality":{"max":"*"},"target":"AdminService.Books.texts","on":[{"ref":["___texts","ID"]},"=",{"ref":["$projection","ID"]}]},"___localized":{"type":"cds.Association","target":"AdminService.Books.texts","on":[{"ref":["___localized","ID"]},"=",{"ref":["$projection","ID"]},"and",{"ref":["___localized","locale"]},"=",{"ref":["$user","locale"]}]}}}},"elements":{"ID":{"@title":"{i18n>ID}","@UI.HiddenFilter":true,"@Core.Computed":true,"key":true,"type":"cds.String","length":36,"@cds.persistence.name":"ID"},"createdAt":{"@cds.on.insert":{"=":"$now"},"@UI.HiddenFilter":true,"@Core.Immutable":true,"@title":"{i18n>CreatedAt}","@readonly":true,"type":"cds.UTCTimestamp","@cds.persistence.name":"CREATEDAT"},"createdBy":{"@cds.on.insert":{"=":"$user"},"@UI.HiddenFilter":true,"@Core.Immutable":true,"@title":"{i18n>CreatedBy}","@readonly":true,"@description":"{i18n>UserID.Description}","type":"cds.String","length":255,"@cds.persistence.name":"CREATEDBY"},"modifiedAt":{"@cds.on.insert":{"=":"$now"},"@cds.on.update":{"=":"$now"},"@UI.HiddenFilter":true,"@title":"{i18n>ChangedAt}","@readonly":true,"type":"cds.UTCTimestamp","@cds.persistence.name":"MODIFIEDAT"},"modifiedBy":{"@cds.on.insert":{"=":"$user"},"@cds.on.update":{"=":"$user"},"@UI.HiddenFilter":true,"@title":"{i18n>ChangedBy}","@readonly":true,"@description":"{i18n>UserID.Description}","type":"cds.String","length":255,"@cds.persistence.name":"MODIFIEDBY"},"title":{"@title":"{i18n>Title}","type":"cds.String","length":111,"@Core.Computed":true,"@cds.persistence.name":"TITLE"},"descr":{"@title":"{i18n>Description}","@UI.MultiLineText":true,"type":"cds.String","length":1111,"@Core.Computed":true,"@cds.persistence.name":"DESCR"},"author":{"@ValueList.entity":"Authors","@title":"{i18n>Author}","@Common.Text":{"=":"author.name"},"@Common.TextArrangement":{"#":"TextOnly"},"type":"cds.Association","target":"localized.AdminService.Authors","keys":[{"ref":["ID"],"as":"ID","$generatedFieldName":"author_ID"}],"on":[{"ref":["author","ID"]},"=",{"ref":["author_ID"]}],"@cds.persistence.name":"AUTHOR"},"author_ID":{"@odata.foreignKey4":"author","type":"cds.String","length":36,"@cds.persistence.name":"AUTHOR_ID"},"genre":{"@title":"{i18n>Genre}","@Common.Text":{"=":"genre.name"},"@Common.TextArrangement":{"#":"TextOnly"},"type":"cds.Association","target":"localized.AdminService.Genres","keys":[{"ref":["ID"],"as":"ID","$generatedFieldName":"genre_ID"}],"on":[{"ref":["genre","ID"]},"=",{"ref":["genre_ID"]}],"@cds.persistence.name":"GENRE"},"genre_ID":{"@odata.foreignKey4":"genre","type":"cds.Integer","@cds.persistence.name":"GENRE_ID"},"stock":{"@title":"{i18n>Stock}","type":"cds.Integer","@cds.persistence.name":"STOCK"},"price":{"@title":"{i18n>Price}","type":"cds.Decimal","precision":9,"scale":2,"@cds.persistence.name":"PRICE"},"currency":{"@title":"{i18n>Currency}","@description":"{i18n>CurrencyCode.Description}","type":"cds.Association","target":"localized.AdminService.Currencies","keys":[{"ref":["code"],"as":"code","$generatedFieldName":"currency_code"}],"on":[{"ref":["currency","code"]},"=",{"ref":["currency_code"]}],"@cds.persistence.name":"CURRENCY"},"currency_code":{"@odata.foreignKey4":"currency","type":"cds.String","length":3,"@cds.persistence.name":"CURRENCY_CODE"},"rating":{"type":"cds.Decimal","precision":2,"scale":1,"@cds.persistence.name":"RATING"},"isbn":{"type":"cds.String","length":40,"@cds.persistence.name":"ISBN"},"texts":{"type":"cds.Composition","cardinality":{"max":"*"},"target":"AdminService.Books.texts","on":[{"ref":["texts","ID"]},"=",{"ref":["ID"]}],"@cds.persistence.name":"TEXTS"},"localized":{"type":"cds.Association","target":"AdminService.Books.texts","on":[{"ref":["localized","ID"]},"=",{"ref":["ID"]},"and",{"ref":["localized","locale"]},"=",{"ref":["$user","locale"]}],"@cds.persistence.name":"LOCALIZED"}},"@cds.persistence.name":"LOCALIZED_ADMINSERVICE_BOOKS"},"localized.AdminService.Languages":{"kind":"entity","@odata.draft.enabled":false,"query":{"SELECT":{"from":{"ref":["localized.sap.common.Languages"],"as":"CommonLanguages_0"},"columns":[{"ref":["CommonLanguages_0","name"]},{"ref":["CommonLanguages_0","descr"]},{"ref":["CommonLanguages_0","code"]},{"ref":["___texts"],"as":"texts"},{"ref":["___localized"],"as":"localized"}],"mixin":{"___texts":{"type":"cds.Composition","cardinality":{"max":"*"},"target":"AdminService.Languages.texts","on":[{"ref":["___texts","code"]},"=",{"ref":["$projection","code"]}]},"___localized":{"type":"cds.Association","target":"AdminService.Languages.texts","on":[{"ref":["___localized","code"]},"=",{"ref":["$projection","code"]},"and",{"ref":["___localized","locale"]},"=",{"ref":["$user","locale"]}]}}}},"elements":{"name":{"@title":"{i18n>Name}","type":"cds.String","length":255,"@Core.Computed":true,"@cds.persistence.name":"NAME"},"descr":{"@title":"{i18n>Description}","type":"cds.String","length":1000,"@Core.Computed":true,"@cds.persistence.name":"DESCR"},"code":{"@Common.Text":{"=":"name"},"@title":"{i18n>LanguageCode}","key":true,"type":"cds.String","length":14,"@cds.persistence.name":"CODE"},"texts":{"type":"cds.Composition","cardinality":{"max":"*"},"target":"AdminService.Languages.texts","on":[{"ref":["texts","code"]},"=",{"ref":["code"]}],"@cds.persistence.name":"TEXTS"},"localized":{"type":"cds.Association","target":"AdminService.Languages.texts","on":[{"ref":["localized","code"]},"=",{"ref":["code"]},"and",{"ref":["localized","locale"]},"=",{"ref":["$user","locale"]}],"@cds.persistence.name":"LOCALIZED"}},"@cds.persistence.skip":"if-unused","@cds.persistence.name":"LOCALIZED_ADMINSERVICE_LANGUAGES"},"localized.CatalogService.Books":{"kind":"entity","@odata.draft.enabled":false,"query":{"SELECT":{"from":{"ref":["localized.my.bookshop.Books"],"as":"Books_0"},"columns":[{"ref":["Books_0","ID"]},{"ref":["Books_0","createdAt"]},{"ref":["Books_0","modifiedAt"]},{"ref":["Books_0","title"]},{"ref":["Books_0","descr"]},{"ref":["___author"],"as":"author"},{"ref":["Books_0","author_ID"]},{"ref":["___genre"],"as":"genre"},{"ref":["Books_0","genre_ID"]},{"ref":["Books_0","stock"]},{"ref":["Books_0","price"]},{"ref":["___currency"],"as":"currency"},{"ref":["Books_0","currency_code"]},{"ref":["Books_0","rating"]},{"ref":["Books_0","isbn"]},{"ref":["___texts"],"as":"texts"},{"ref":["___localized"],"as":"localized"}],"mixin":{"___author":{"@ValueList.entity":"Authors","@title":"{i18n>Author}","@Common.Text":{"=":"author.name"},"@Common.TextArrangement":{"#":"TextOnly"},"type":"cds.Association","target":"localized.CatalogService.Authors","keys":[{"ref":["ID"],"as":"ID","$generatedFieldName":"author_ID"}],"on":[{"ref":["___author","ID"]},"=",{"ref":["$projection","author_ID"]}]},"___genre":{"@title":"{i18n>Genre}","@Common.Text":{"=":"genre.name"},"@Common.TextArrangement":{"#":"TextOnly"},"type":"cds.Association","target":"localized.CatalogService.Genres","keys":[{"ref":["ID"],"as":"ID","$generatedFieldName":"genre_ID"}],"on":[{"ref":["___genre","ID"]},"=",{"ref":["$projection","genre_ID"]}]},"___currency":{"@title":"{i18n>Currency}","@description":"{i18n>CurrencyCode.Description}","type":"cds.Association","target":"localized.CatalogService.Currencies","keys":[{"ref":["code"],"as":"code","$generatedFieldName":"currency_code"}],"on":[{"ref":["___currency","code"]},"=",{"ref":["$projection","currency_code"]}]},"___texts":{"type":"cds.Composition","cardinality":{"max":"*"},"target":"CatalogService.Books.texts","on":[{"ref":["___texts","ID"]},"=",{"ref":["$projection","ID"]}]},"___localized":{"type":"cds.Association","target":"CatalogService.Books.texts","on":[{"ref":["___localized","ID"]},"=",{"ref":["$projection","ID"]},"and",{"ref":["___localized","locale"]},"=",{"ref":["$user","locale"]}]}}}},"elements":{"ID":{"@title":"{i18n>ID}","@UI.HiddenFilter":true,"@Core.Computed":true,"key":true,"type":"cds.String","length":36,"@cds.persistence.name":"ID"},"createdAt":{"@cds.on.insert":{"=":"$now"},"@UI.HiddenFilter":true,"@Core.Immutable":true,"@title":"{i18n>CreatedAt}","@readonly":true,"type":"cds.UTCTimestamp","@cds.persistence.name":"CREATEDAT"},"modifiedAt":{"@cds.on.insert":{"=":"$now"},"@cds.on.update":{"=":"$now"},"@UI.HiddenFilter":true,"@title":"{i18n>ChangedAt}","@readonly":true,"type":"cds.UTCTimestamp","@cds.persistence.name":"MODIFIEDAT"},"title":{"@title":"{i18n>Title}","type":"cds.String","length":111,"@Core.Computed":true,"@cds.persistence.name":"TITLE"},"descr":{"@title":"{i18n>Description}","@UI.MultiLineText":true,"type":"cds.String","length":1111,"@Core.Computed":true,"@cds.persistence.name":"DESCR"},"author":{"@ValueList.entity":"Authors","@title":"{i18n>Author}","@Common.Text":{"=":"author.name"},"@Common.TextArrangement":{"#":"TextOnly"},"type":"cds.Association","target":"localized.CatalogService.Authors","keys":[{"ref":["ID"],"as":"ID","$generatedFieldName":"author_ID"}],"on":[{"ref":["author","ID"]},"=",{"ref":["author_ID"]}],"@cds.persistence.name":"AUTHOR"},"author_ID":{"@odata.foreignKey4":"author","type":"cds.String","length":36,"@cds.persistence.name":"AUTHOR_ID"},"genre":{"@title":"{i18n>Genre}","@Common.Text":{"=":"genre.name"},"@Common.TextArrangement":{"#":"TextOnly"},"type":"cds.Association","target":"localized.CatalogService.Genres","keys":[{"ref":["ID"],"as":"ID","$generatedFieldName":"genre_ID"}],"on":[{"ref":["genre","ID"]},"=",{"ref":["genre_ID"]}],"@cds.persistence.name":"GENRE"},"genre_ID":{"@odata.foreignKey4":"genre","type":"cds.Integer","@cds.persistence.name":"GENRE_ID"},"stock":{"@title":"{i18n>Stock}","type":"cds.Integer","@cds.persistence.name":"STOCK"},"price":{"@Measures.ISOCurrency":{"=":"currency_code"},"@title":"{i18n>Price}","type":"cds.Decimal","precision":9,"scale":2,"@cds.persistence.name":"PRICE"},"currency":{"@title":"{i18n>Currency}","@description":"{i18n>CurrencyCode.Description}","type":"cds.Association","target":"localized.CatalogService.Currencies","keys":[{"ref":["code"],"as":"code","$generatedFieldName":"currency_code"}],"on":[{"ref":["currency","code"]},"=",{"ref":["currency_code"]}],"@cds.persistence.name":"CURRENCY"},"currency_code":{"@odata.foreignKey4":"currency","type":"cds.String","length":3,"@cds.persistence.name":"CURRENCY_CODE"},"rating":{"type":"cds.Decimal","precision":2,"scale":1,"@cds.persistence.name":"RATING"},"isbn":{"type":"cds.String","length":40,"@cds.persistence.name":"ISBN"},"texts":{"type":"cds.Composition","cardinality":{"max":"*"},"target":"CatalogService.Books.texts","on":[{"ref":["texts","ID"]},"=",{"ref":["ID"]}],"@cds.persistence.name":"TEXTS"},"localized":{"type":"cds.Association","target":"CatalogService.Books.texts","on":[{"ref":["localized","ID"]},"=",{"ref":["ID"]},"and",{"ref":["localized","locale"]},"=",{"ref":["$user","locale"]}],"@cds.persistence.name":"LOCALIZED"}},"@cds.persistence.name":"LOCALIZED_CATALOGSERVICE_BOOKS"},"localized.AdminService.Genres":{"kind":"entity","@odata.draft.enabled":false,"query":{"SELECT":{"from":{"ref":["localized.my.bookshop.Genres"],"as":"Genres_0"},"columns":[{"ref":["Genres_0","name"]},{"ref":["Genres_0","descr"]},{"ref":["Genres_0","ID"]},{"ref":["___parent"],"as":"parent"},{"ref":["Genres_0","parent_ID"]},{"ref":["___children"],"as":"children"},{"ref":["___texts"],"as":"texts"},{"ref":["___localized"],"as":"localized"}],"mixin":{"___parent":{"type":"cds.Association","target":"localized.AdminService.Genres","keys":[{"ref":["ID"],"as":"ID","$generatedFieldName":"parent_ID"}],"on":[{"ref":["___parent","ID"]},"=",{"ref":["$projection","parent_ID"]}]},"___children":{"type":"cds.Composition","cardinality":{"max":"*"},"target":"localized.AdminService.Genres","on":[{"ref":["___children","parent_ID"]},"=",{"ref":["$projection","ID"]}]},"___texts":{"type":"cds.Composition","cardinality":{"max":"*"},"target":"AdminService.Genres.texts","on":[{"ref":["___texts","ID"]},"=",{"ref":["$projection","ID"]}]},"___localized":{"type":"cds.Association","target":"AdminService.Genres.texts","on":[{"ref":["___localized","ID"]},"=",{"ref":["$projection","ID"]},"and",{"ref":["___localized","locale"]},"=",{"ref":["$user","locale"]}]}}}},"elements":{"name":{"@title":"{i18n>Genre}","type":"cds.String","length":255,"@Core.Computed":true,"@cds.persistence.name":"NAME"},"descr":{"@title":"{i18n>Description}","type":"cds.String","length":1000,"@Core.Computed":true,"@cds.persistence.name":"DESCR"},"ID":{"@title":"{i18n>ID}","key":true,"type":"cds.Integer","@cds.persistence.name":"ID"},"parent":{"type":"cds.Association","target":"localized.AdminService.Genres","keys":[{"ref":["ID"],"as":"ID","$generatedFieldName":"parent_ID"}],"on":[{"ref":["parent","ID"]},"=",{"ref":["parent_ID"]}],"@cds.persistence.name":"PARENT"},"parent_ID":{"@odata.foreignKey4":"parent","type":"cds.Integer","@cds.persistence.name":"PARENT_ID"},"children":{"type":"cds.Composition","cardinality":{"max":"*"},"target":"localized.AdminService.Genres","on":[{"ref":["children","parent_ID"]},"=",{"ref":["ID"]}],"@cds.persistence.name":"CHILDREN"},"texts":{"type":"cds.Composition","cardinality":{"max":"*"},"target":"AdminService.Genres.texts","on":[{"ref":["texts","ID"]},"=",{"ref":["ID"]}],"@cds.persistence.name":"TEXTS"},"localized":{"type":"cds.Association","target":"AdminService.Genres.texts","on":[{"ref":["localized","ID"]},"=",{"ref":["ID"]},"and",{"ref":["localized","locale"]},"=",{"ref":["$user","locale"]}],"@cds.persistence.name":"LOCALIZED"}},"@cds.persistence.skip":"if-unused","@cds.persistence.name":"LOCALIZED_ADMINSERVICE_GENRES"},"localized.AdminService.Currencies":{"kind":"entity","@odata.draft.enabled":false,"query":{"SELECT":{"from":{"ref":["localized.sap.common.Currencies"],"as":"Currencies_0"},"columns":[{"ref":["Currencies_0","name"]},{"ref":["Currencies_0","descr"]},{"ref":["Currencies_0","code"]},{"ref":["Currencies_0","symbol"]},{"ref":["Currencies_0","minorUnit"]},{"ref":["___texts"],"as":"texts"},{"ref":["___localized"],"as":"localized"}],"mixin":{"___texts":{"type":"cds.Composition","cardinality":{"max":"*"},"target":"AdminService.Currencies.texts","on":[{"ref":["___texts","code"]},"=",{"ref":["$projection","code"]}]},"___localized":{"type":"cds.Association","target":"AdminService.Currencies.texts","on":[{"ref":["___localized","code"]},"=",{"ref":["$projection","code"]},"and",{"ref":["___localized","locale"]},"=",{"ref":["$user","locale"]}]}}}},"elements":{"name":{"@title":"{i18n>Name}","type":"cds.String","length":255,"@Core.Computed":true,"@cds.persistence.name":"NAME"},"descr":{"@title":"{i18n>Description}","type":"cds.String","length":1000,"@Core.Computed":true,"@cds.persistence.name":"DESCR"},"code":{"@title":"{i18n>CurrencyCode}","@Common.Text":{"=":"name"},"key":true,"type":"cds.String","length":3,"@cds.persistence.name":"CODE"},"symbol":{"@title":"{i18n>CurrencySymbol}","type":"cds.String","length":5,"@cds.persistence.name":"SYMBOL"},"minorUnit":{"@title":"{i18n>CurrencyMinorUnit}","type":"cds.Int16","@cds.persistence.name":"MINORUNIT"},"texts":{"type":"cds.Composition","cardinality":{"max":"*"},"target":"AdminService.Currencies.texts","on":[{"ref":["texts","code"]},"=",{"ref":["code"]}],"@cds.persistence.name":"TEXTS"},"localized":{"type":"cds.Association","target":"AdminService.Currencies.texts","on":[{"ref":["localized","code"]},"=",{"ref":["code"]},"and",{"ref":["localized","locale"]},"=",{"ref":["$user","locale"]}],"@cds.persistence.name":"LOCALIZED"}},"@cds.persistence.skip":"if-unused","@cds.persistence.name":"LOCALIZED_ADMINSERVICE_CURRENCIES"},"localized.CatalogService.Genres":{"kind":"entity","@odata.draft.enabled":false,"query":{"SELECT":{"from":{"ref":["localized.my.bookshop.Genres"],"as":"Genres_0"},"columns":[{"ref":["Genres_0","name"]},{"ref":["Genres_0","descr"]},{"ref":["Genres_0","ID"]},{"ref":["___parent"],"as":"parent"},{"ref":["Genres_0","parent_ID"]},{"ref":["___children"],"as":"children"},{"ref":["___texts"],"as":"texts"},{"ref":["___localized"],"as":"localized"}],"mixin":{"___parent":{"type":"cds.Association","target":"localized.CatalogService.Genres","keys":[{"ref":["ID"],"as":"ID","$generatedFieldName":"parent_ID"}],"on":[{"ref":["___parent","ID"]},"=",{"ref":["$projection","parent_ID"]}]},"___children":{"type":"cds.Composition","cardinality":{"max":"*"},"target":"localized.CatalogService.Genres","on":[{"ref":["___children","parent_ID"]},"=",{"ref":["$projection","ID"]}]},"___texts":{"type":"cds.Composition","cardinality":{"max":"*"},"target":"CatalogService.Genres.texts","on":[{"ref":["___texts","ID"]},"=",{"ref":["$projection","ID"]}]},"___localized":{"type":"cds.Association","target":"CatalogService.Genres.texts","on":[{"ref":["___localized","ID"]},"=",{"ref":["$projection","ID"]},"and",{"ref":["___localized","locale"]},"=",{"ref":["$user","locale"]}]}}}},"elements":{"name":{"@title":"{i18n>Genre}","type":"cds.String","length":255,"@Core.Computed":true,"@cds.persistence.name":"NAME"},"descr":{"@title":"{i18n>Description}","type":"cds.String","length":1000,"@Core.Computed":true,"@cds.persistence.name":"DESCR"},"ID":{"@title":"{i18n>ID}","key":true,"type":"cds.Integer","@cds.persistence.name":"ID"},"parent":{"type":"cds.Association","target":"localized.CatalogService.Genres","keys":[{"ref":["ID"],"as":"ID","$generatedFieldName":"parent_ID"}],"on":[{"ref":["parent","ID"]},"=",{"ref":["parent_ID"]}],"@cds.persistence.name":"PARENT"},"parent_ID":{"@odata.foreignKey4":"parent","type":"cds.Integer","@cds.persistence.name":"PARENT_ID"},"children":{"type":"cds.Composition","cardinality":{"max":"*"},"target":"localized.CatalogService.Genres","on":[{"ref":["children","parent_ID"]},"=",{"ref":["ID"]}],"@cds.persistence.name":"CHILDREN"},"texts":{"type":"cds.Composition","cardinality":{"max":"*"},"target":"CatalogService.Genres.texts","on":[{"ref":["texts","ID"]},"=",{"ref":["ID"]}],"@cds.persistence.name":"TEXTS"},"localized":{"type":"cds.Association","target":"CatalogService.Genres.texts","on":[{"ref":["localized","ID"]},"=",{"ref":["ID"]},"and",{"ref":["localized","locale"]},"=",{"ref":["$user","locale"]}],"@cds.persistence.name":"LOCALIZED"}},"@cds.persistence.skip":"if-unused","@cds.persistence.name":"LOCALIZED_CATALOGSERVICE_GENRES"},"localized.CatalogService.Currencies":{"kind":"entity","@odata.draft.enabled":false,"query":{"SELECT":{"from":{"ref":["localized.sap.common.Currencies"],"as":"Currencies_0"},"columns":[{"ref":["Currencies_0","name"]},{"ref":["Currencies_0","descr"]},{"ref":["Currencies_0","code"]},{"ref":["Currencies_0","symbol"]},{"ref":["Currencies_0","minorUnit"]},{"ref":["___texts"],"as":"texts"},{"ref":["___localized"],"as":"localized"}],"mixin":{"___texts":{"type":"cds.Composition","cardinality":{"max":"*"},"target":"CatalogService.Currencies.texts","on":[{"ref":["___texts","code"]},"=",{"ref":["$projection","code"]}]},"___localized":{"type":"cds.Association","target":"CatalogService.Currencies.texts","on":[{"ref":["___localized","code"]},"=",{"ref":["$projection","code"]},"and",{"ref":["___localized","locale"]},"=",{"ref":["$user","locale"]}]}}}},"elements":{"name":{"@title":"{i18n>Name}","type":"cds.String","length":255,"@Core.Computed":true,"@cds.persistence.name":"NAME"},"descr":{"@title":"{i18n>Description}","type":"cds.String","length":1000,"@Core.Computed":true,"@cds.persistence.name":"DESCR"},"code":{"@title":"{i18n>CurrencyCode}","@Common.Text":{"=":"name"},"key":true,"type":"cds.String","length":3,"@cds.persistence.name":"CODE"},"symbol":{"@title":"{i18n>CurrencySymbol}","type":"cds.String","length":5,"@cds.persistence.name":"SYMBOL"},"minorUnit":{"@title":"{i18n>CurrencyMinorUnit}","type":"cds.Int16","@cds.persistence.name":"MINORUNIT"},"texts":{"type":"cds.Composition","cardinality":{"max":"*"},"target":"CatalogService.Currencies.texts","on":[{"ref":["texts","code"]},"=",{"ref":["code"]}],"@cds.persistence.name":"TEXTS"},"localized":{"type":"cds.Association","target":"CatalogService.Currencies.texts","on":[{"ref":["localized","code"]},"=",{"ref":["code"]},"and",{"ref":["localized","locale"]},"=",{"ref":["$user","locale"]}],"@cds.persistence.name":"LOCALIZED"}},"@cds.persistence.skip":"if-unused","@cds.persistence.name":"LOCALIZED_CATALOGSERVICE_CURRENCIES"},"localized.AdminService.Authors":{"kind":"entity","@odata.draft.enabled":false,"query":{"SELECT":{"from":{"ref":["localized.my.bookshop.Authors"],"as":"Authors_0"},"columns":[{"ref":["Authors_0","ID"]},{"ref":["Authors_0","createdAt"]},{"ref":["Authors_0","createdBy"]},{"ref":["Authors_0","modifiedAt"]},{"ref":["Authors_0","modifiedBy"]},{"ref":["Authors_0","name"]},{"ref":["Authors_0","dateOfBirth"]},{"ref":["Authors_0","dateOfDeath"]},{"ref":["Authors_0","placeOfBirth"]},{"ref":["Authors_0","placeOfDeath"]},{"ref":["___books"],"as":"books"}],"mixin":{"___books":{"type":"cds.Association","cardinality":{"max":"*"},"target":"localized.AdminService.Books","on":[{"ref":["___books","author_ID"]},"=",{"ref":["$projection","ID"]}]}}}},"elements":{"ID":{"@title":"{i18n>ID}","@UI.HiddenFilter":true,"@Core.Computed":true,"key":true,"type":"cds.String","length":36,"@cds.persistence.name":"ID"},"createdAt":{"@cds.on.insert":{"=":"$now"},"@UI.HiddenFilter":true,"@Core.Immutable":true,"@title":"{i18n>CreatedAt}","@readonly":true,"type":"cds.UTCTimestamp","@cds.persistence.name":"CREATEDAT"},"createdBy":{"@cds.on.insert":{"=":"$user"},"@UI.HiddenFilter":true,"@Core.Immutable":true,"@title":"{i18n>CreatedBy}","@readonly":true,"@description":"{i18n>UserID.Description}","type":"cds.String","length":255,"@cds.persistence.name":"CREATEDBY"},"modifiedAt":{"@cds.on.insert":{"=":"$now"},"@cds.on.update":{"=":"$now"},"@UI.HiddenFilter":true,"@title":"{i18n>ChangedAt}","@readonly":true,"type":"cds.UTCTimestamp","@cds.persistence.name":"MODIFIEDAT"},"modifiedBy":{"@cds.on.insert":{"=":"$user"},"@cds.on.update":{"=":"$user"},"@UI.HiddenFilter":true,"@title":"{i18n>ChangedBy}","@readonly":true,"@description":"{i18n>UserID.Description}","type":"cds.String","length":255,"@cds.persistence.name":"MODIFIEDBY"},"name":{"@assert.format":"^\\p{Lu}.*","@title":"{i18n>Name}","type":"cds.String","length":111,"@cds.persistence.name":"NAME"},"dateOfBirth":{"@title":"{i18n>DateOfBirth}","type":"cds.LocalDate","@cds.persistence.name":"DATEOFBIRTH"},"dateOfDeath":{"@title":"{i18n>DateOfDeath}","type":"cds.LocalDate","@cds.persistence.name":"DATEOFDEATH"},"placeOfBirth":{"@title":"{i18n>PlaceOfBirth}","type":"cds.String","length":255,"@cds.persistence.name":"PLACEOFBIRTH"},"placeOfDeath":{"@title":"{i18n>PlaceOfDeath}","type":"cds.String","length":255,"@cds.persistence.name":"PLACEOFDEATH"},"books":{"type":"cds.Association","cardinality":{"max":"*"},"target":"localized.AdminService.Books","on":[{"ref":["books","author_ID"]},"=",{"ref":["ID"]}],"@cds.persistence.name":"BOOKS"}},"@cds.persistence.name":"LOCALIZED_ADMINSERVICE_AUTHORS"},"localized.CatalogService.Authors":{"kind":"entity","@odata.draft.enabled":false,"query":{"SELECT":{"from":{"ref":["localized.my.bookshop.Authors"],"as":"Authors_0"},"columns":[{"ref":["Authors_0","ID"]},{"ref":["Authors_0","createdAt"]},{"ref":["Authors_0","createdBy"]},{"ref":["Authors_0","modifiedAt"]},{"ref":["Authors_0","modifiedBy"]},{"ref":["Authors_0","name"]},{"ref":["Authors_0","dateOfBirth"]},{"ref":["Authors_0","dateOfDeath"]},{"ref":["Authors_0","placeOfBirth"]},{"ref":["Authors_0","placeOfDeath"]},{"ref":["___books"],"as":"books"}],"mixin":{"___books":{"type":"cds.Association","cardinality":{"max":"*"},"target":"localized.CatalogService.Books","on":[{"ref":["___books","author_ID"]},"=",{"ref":["$projection","ID"]}]}}}},"elements":{"ID":{"@title":"{i18n>ID}","@UI.HiddenFilter":true,"@Core.Computed":true,"key":true,"type":"cds.String","length":36,"@cds.persistence.name":"ID"},"createdAt":{"@cds.on.insert":{"=":"$now"},"@UI.HiddenFilter":true,"@Core.Immutable":true,"@title":"{i18n>CreatedAt}","@readonly":true,"type":"cds.UTCTimestamp","@cds.persistence.name":"CREATEDAT"},"createdBy":{"@cds.on.insert":{"=":"$user"},"@UI.HiddenFilter":true,"@Core.Immutable":true,"@title":"{i18n>CreatedBy}","@readonly":true,"@description":"{i18n>UserID.Description}","type":"cds.String","length":255,"@cds.persistence.name":"CREATEDBY"},"modifiedAt":{"@cds.on.insert":{"=":"$now"},"@cds.on.update":{"=":"$now"},"@UI.HiddenFilter":true,"@title":"{i18n>ChangedAt}","@readonly":true,"type":"cds.UTCTimestamp","@cds.persistence.name":"MODIFIEDAT"},"modifiedBy":{"@cds.on.insert":{"=":"$user"},"@cds.on.update":{"=":"$user"},"@UI.HiddenFilter":true,"@title":"{i18n>ChangedBy}","@readonly":true,"@description":"{i18n>UserID.Description}","type":"cds.String","length":255,"@cds.persistence.name":"MODIFIEDBY"},"name":{"@assert.format":"^\\p{Lu}.*","@title":"{i18n>Name}","type":"cds.String","length":111,"@cds.persistence.name":"NAME"},"dateOfBirth":{"@title":"{i18n>DateOfBirth}","type":"cds.LocalDate","@cds.persistence.name":"DATEOFBIRTH"},"dateOfDeath":{"@title":"{i18n>DateOfDeath}","type":"cds.LocalDate","@cds.persistence.name":"DATEOFDEATH"},"placeOfBirth":{"@title":"{i18n>PlaceOfBirth}","type":"cds.String","length":255,"@cds.persistence.name":"PLACEOFBIRTH"},"placeOfDeath":{"@title":"{i18n>PlaceOfDeath}","type":"cds.String","length":255,"@cds.persistence.name":"PLACEOFDEATH"},"books":{"type":"cds.Association","cardinality":{"max":"*"},"target":"localized.CatalogService.Books","on":[{"ref":["books","author_ID"]},"=",{"ref":["ID"]}],"@cds.persistence.name":"BOOKS"}},"@cds.persistence.name":"LOCALIZED_CATALOGSERVICE_AUTHORS"},"DRAFT.DraftAdministrativeData":{"kind":"entity","elements":{"DraftUUID":{"type":"cds.String","key":true,"length":36,"@UI.Hidden":true,"@Common.Label":"{i18n>Draft_DraftUUID}","@cds.persistence.name":"DRAFTUUID"},"CreationDateTime":{"type":"cds.UTCTimestamp","@Common.Label":"{i18n>Draft_CreationDateTime}","@cds.persistence.name":"CREATIONDATETIME"},"CreatedByUser":{"type":"cds.String","length":256,"@Common.Label":"{i18n>Draft_CreatedByUser}","@cds.persistence.name":"CREATEDBYUSER"},"DraftIsCreatedByMe":{"type":"cds.Boolean","@UI.Hidden":true,"@Common.Label":"{i18n>Draft_DraftIsCreatedByMe}","@cds.persistence.name":"DRAFTISCREATEDBYME"},"LastChangeDateTime":{"type":"cds.UTCTimestamp","@Common.Label":"{i18n>Draft_LastChangeDateTime}","@cds.persistence.name":"LASTCHANGEDATETIME"},"LastChangedByUser":{"type":"cds.String","length":256,"@Common.Label":"{i18n>Draft_LastChangedByUser}","@cds.persistence.name":"LASTCHANGEDBYUSER"},"InProcessByUser":{"type":"cds.String","length":256,"@Common.Label":"{i18n>Draft_InProcessByUser}","@cds.persistence.name":"INPROCESSBYUSER"},"DraftIsProcessedByMe":{"type":"cds.Boolean","@UI.Hidden":true,"@Common.Label":"{i18n>Draft_DraftIsProcessedByMe}","@cds.persistence.name":"DRAFTISPROCESSEDBYME"}},"@Common.Label":"{i18n>Draft_DraftAdministrativeData}","@cds.persistence.name":"DRAFT_DRAFTADMINISTRATIVEDATA"},"AdminService.DraftAdministrativeData":{"kind":"entity","projection":{"from":{"ref":["DRAFT.DraftAdministrativeData"]},"columns":[{"key":true,"ref":["DraftAdministrativeData","DraftUUID"]},{"ref":["DraftAdministrativeData","CreationDateTime"]},{"ref":["DraftAdministrativeData","CreatedByUser"]},{"ref":["DraftAdministrativeData","DraftIsCreatedByMe"]},{"ref":["DraftAdministrativeData","LastChangeDateTime"]},{"ref":["DraftAdministrativeData","LastChangedByUser"]},{"ref":["DraftAdministrativeData","InProcessByUser"]},{"ref":["DraftAdministrativeData","DraftIsProcessedByMe"]}]},"elements":{"DraftUUID":{"type":"cds.String","key":true,"length":36,"@UI.Hidden":true,"@Common.Label":"{i18n>Draft_DraftUUID}","@cds.persistence.name":"DRAFTUUID"},"CreationDateTime":{"type":"cds.UTCTimestamp","@Common.Label":"{i18n>Draft_CreationDateTime}","@cds.persistence.name":"CREATIONDATETIME"},"CreatedByUser":{"type":"cds.String","length":256,"@Common.Label":"{i18n>Draft_CreatedByUser}","@cds.persistence.name":"CREATEDBYUSER"},"DraftIsCreatedByMe":{"type":"cds.Boolean","@UI.Hidden":true,"@Common.Label":"{i18n>Draft_DraftIsCreatedByMe}","@cds.persistence.name":"DRAFTISCREATEDBYME"},"LastChangeDateTime":{"type":"cds.UTCTimestamp","@Common.Label":"{i18n>Draft_LastChangeDateTime}","@cds.persistence.name":"LASTCHANGEDATETIME"},"LastChangedByUser":{"type":"cds.String","length":256,"@Common.Label":"{i18n>Draft_LastChangedByUser}","@cds.persistence.name":"LASTCHANGEDBYUSER"},"InProcessByUser":{"type":"cds.String","length":256,"@Common.Label":"{i18n>Draft_InProcessByUser}","@cds.persistence.name":"INPROCESSBYUSER"},"DraftIsProcessedByMe":{"type":"cds.Boolean","@UI.Hidden":true,"@Common.Label":"{i18n>Draft_DraftIsProcessedByMe}","@cds.persistence.name":"DRAFTISPROCESSEDBYME"}},"@Common.Label":"{i18n>Draft_DraftAdministrativeData}","@cds.persistence.name":"ADMINSERVICE_DRAFTADMINISTRATIVEDATA"},"AdminService.Books.drafts":{"kind":"entity","elements":{"ID":{"@title":"{i18n>ID}","@UI.HiddenFilter":true,"@Core.Computed":true,"key":true,"type":"cds.String","length":36,"@cds.persistence.name":"ID"},"createdAt":{"@cds.on.insert":{"=":"$now"},"@UI.HiddenFilter":true,"@Core.Immutable":true,"@title":"{i18n>CreatedAt}","@readonly":true,"type":"cds.UTCTimestamp","notNull":false,"@cds.persistence.name":"CREATEDAT"},"createdBy":{"@cds.on.insert":{"=":"$user"},"@UI.HiddenFilter":true,"@Core.Immutable":true,"@title":"{i18n>CreatedBy}","@readonly":true,"@description":"{i18n>UserID.Description}","type":"cds.String","length":255,"notNull":false,"@cds.persistence.name":"CREATEDBY"},"modifiedAt":{"@cds.on.insert":{"=":"$now"},"@cds.on.update":{"=":"$now"},"@UI.HiddenFilter":true,"@title":"{i18n>ChangedAt}","@readonly":true,"type":"cds.UTCTimestamp","notNull":false,"@cds.persistence.name":"MODIFIEDAT"},"modifiedBy":{"@cds.on.insert":{"=":"$user"},"@cds.on.update":{"=":"$user"},"@UI.HiddenFilter":true,"@title":"{i18n>ChangedBy}","@readonly":true,"@description":"{i18n>UserID.Description}","type":"cds.String","length":255,"notNull":false,"@cds.persistence.name":"MODIFIEDBY"},"title":{"@title":"{i18n>Title}","type":"cds.String","length":111,"notNull":false,"@cds.persistence.name":"TITLE"},"descr":{"@title":"{i18n>Description}","@UI.MultiLineText":true,"type":"cds.String","length":1111,"notNull":false,"@cds.persistence.name":"DESCR"},"author":{"@ValueList.entity":"Authors","@title":"{i18n>Author}","@Common.Text":{"=":"author.name"},"@Common.TextArrangement":{"#":"TextOnly"},"type":"cds.Association","target":"AdminService.Authors","keys":[{"ref":["ID"],"as":"ID","$generatedFieldName":"author_ID"}],"on":[{"ref":["author","ID"]},"=",{"ref":["author_ID"]}],"@cds.persistence.name":"AUTHOR"},"author_ID":{"type":"cds.String","length":36,"@odata.foreignKey4":"author","notNull":false,"@cds.persistence.name":"AUTHOR_ID"},"genre":{"@title":"{i18n>Genre}","@Common.Text":{"=":"genre.name"},"@Common.TextArrangement":{"#":"TextOnly"},"type":"cds.Association","target":"AdminService.Genres","keys":[{"ref":["ID"],"as":"ID","$generatedFieldName":"genre_ID"}],"on":[{"ref":["genre","ID"]},"=",{"ref":["genre_ID"]}],"@cds.persistence.name":"GENRE"},"genre_ID":{"type":"cds.Integer","@odata.foreignKey4":"genre","notNull":false,"@cds.persistence.name":"GENRE_ID"},"stock":{"@title":"{i18n>Stock}","type":"cds.Integer","notNull":false,"@cds.persistence.name":"STOCK"},"price":{"@title":"{i18n>Price}","type":"cds.Decimal","precision":9,"scale":2,"notNull":false,"@cds.persistence.name":"PRICE"},"currency":{"@title":"{i18n>Currency}","@description":"{i18n>CurrencyCode.Description}","type":"cds.Association","target":"AdminService.Currencies","keys":[{"ref":["code"],"as":"code","$generatedFieldName":"currency_code"}],"on":[{"ref":["currency","code"]},"=",{"ref":["currency_code"]}],"@cds.persistence.name":"CURRENCY"},"currency_code":{"type":"cds.String","length":3,"@odata.foreignKey4":"currency","notNull":false,"@cds.persistence.name":"CURRENCY_CODE"},"rating":{"type":"cds.Decimal","precision":2,"scale":1,"notNull":false,"@cds.persistence.name":"RATING"},"isbn":{"type":"cds.String","length":40,"notNull":false,"@cds.persistence.name":"ISBN"},"texts":{"type":"cds.Composition","cardinality":{"max":"*"},"target":"AdminService.Books.texts.drafts","on":[{"ref":["texts","ID"]},"=",{"ref":["ID"]}],"@cds.persistence.name":"TEXTS"},"localized":{"type":"cds.Association","target":"AdminService.Books.texts.drafts","on":[{"ref":["localized","ID"]},"=",{"ref":["ID"]},"and",{"ref":["localized","locale"]},"=",{"ref":["$user","locale"]}],"@cds.persistence.name":"LOCALIZED"},"IsActiveEntity":{"type":"cds.Boolean","@cds.persistence.name":"ISACTIVEENTITY"},"HasActiveEntity":{"type":"cds.Boolean","@cds.persistence.name":"HASACTIVEENTITY"},"HasDraftEntity":{"type":"cds.Boolean","@cds.persistence.name":"HASDRAFTENTITY"},"DraftAdministrativeData":{"type":"cds.Association","target":"AdminService.DraftAdministrativeData","keys":[{"ref":["DraftUUID"],"$generatedFieldName":"DraftAdministrativeData_DraftUUID"}],"cardinality":{"max":1},"on":[{"ref":["DraftAdministrativeData","DraftUUID"]},"=",{"ref":["DraftAdministrativeData_DraftUUID"]}],"@cds.persistence.name":"DRAFTADMINISTRATIVEDATA"},"DraftAdministrativeData_DraftUUID":{"type":"cds.String","length":36,"notNull":true,"@odata.foreignKey4":"DraftAdministrativeData","@cds.persistence.name":"DRAFTADMINISTRATIVEDATA_DRAFTUUID"}},"@cds.persistence.name":"ADMINSERVICE_BOOKS_DRAFTS"},"AdminService.Books.texts.drafts":{"kind":"entity","elements":{"ID_texts":{"key":true,"type":"cds.String","length":36,"@cds.persistence.name":"ID_TEXTS"},"locale":{"@ValueList.entity":"Languages","@ValueList.type":{"#":"fixed"},"@title":"{i18n>LanguageCode}","type":"cds.String","length":14,"notNull":false,"@cds.persistence.name":"LOCALE"},"ID":{"@title":"{i18n>ID}","@UI.HiddenFilter":true,"@Core.Computed":true,"type":"cds.String","length":36,"notNull":false,"@cds.persistence.name":"ID"},"title":{"@title":"{i18n>Title}","localized":null,"type":"cds.String","length":111,"notNull":false,"@cds.persistence.name":"TITLE"},"descr":{"@title":"{i18n>Description}","@UI.MultiLineText":true,"localized":null,"type":"cds.String","length":1111,"notNull":false,"@cds.persistence.name":"DESCR"},"IsActiveEntity":{"type":"cds.Boolean","@cds.persistence.name":"ISACTIVEENTITY"},"HasActiveEntity":{"type":"cds.Boolean","@cds.persistence.name":"HASACTIVEENTITY"},"HasDraftEntity":{"type":"cds.Boolean","@cds.persistence.name":"HASDRAFTENTITY"},"DraftAdministrativeData":{"type":"cds.Association","target":"AdminService.DraftAdministrativeData","keys":[{"ref":["DraftUUID"],"$generatedFieldName":"DraftAdministrativeData_DraftUUID"}],"cardinality":{"max":1},"on":[{"ref":["DraftAdministrativeData","DraftUUID"]},"=",{"ref":["DraftAdministrativeData_DraftUUID"]}],"@cds.persistence.name":"DRAFTADMINISTRATIVEDATA"},"DraftAdministrativeData_DraftUUID":{"type":"cds.String","length":36,"notNull":true,"@odata.foreignKey4":"DraftAdministrativeData","@cds.persistence.name":"DRAFTADMINISTRATIVEDATA_DRAFTUUID"}},"@cds.persistence.name":"ADMINSERVICE_BOOKS_TEXTS_DRAFTS"}},"extensions":[{"annotate":"common.Currencies","@Common.SemanticKey":[{"=":"code"}],"@Identification":[{"Value":{"=":"code"}}],"@UI.SelectionFields":[{"=":"name"},{"=":"descr"}],"@UI.LineItem":[{"Value":{"=":"descr"}},{"Value":{"=":"symbol"}},{"Value":{"=":"code"}}],"@UI.HeaderInfo.TypeName":"{i18n>Currency}","@UI.HeaderInfo.TypeNamePlural":"{i18n>Currencies}","@UI.HeaderInfo.Title.Value":{"=":"descr"},"@UI.HeaderInfo.Description.Value":{"=":"code"},"@UI.Facets":[{"$Type":"UI.ReferenceFacet","Label":"{i18n>Details}","Target":"@UI.FieldGroup#Details"},{"$Type":"UI.ReferenceFacet","Label":"{i18n>Extended}","Target":"@UI.FieldGroup#Extended"}],"@UI.FieldGroup#Details.Data":[{"Value":{"=":"name"}},{"Value":{"=":"symbol"}},{"Value":{"=":"code"}},{"Value":{"=":"descr"}}],"@UI.FieldGroup#Extended.Data":[{"Value":{"=":"numcode"}},{"Value":{"=":"minor"}},{"Value":{"=":"exponent"}}],"elements":{"numcode":{"@title":"{i18n>NumCode}"},"minor":{"@title":"{i18n>MinorUnit}"},"exponent":{"@title":"{i18n>Exponent}"}}},{"annotate":"common.Languages","@Common.SemanticKey":[{"=":"code"}],"@Identification":[{"Value":{"=":"code"}}],"@UI.SelectionFields":[{"=":"name"},{"=":"descr"}],"@UI.LineItem":[{"Value":{"=":"code"}},{"Value":{"=":"name"}}],"@UI.HeaderInfo.TypeName":"{i18n>Language}","@UI.HeaderInfo.TypeNamePlural":"{i18n>Languages}","@UI.HeaderInfo.Title.Value":{"=":"name"},"@UI.HeaderInfo.Description.Value":{"=":"descr"},"@UI.Facets":[{"$Type":"UI.ReferenceFacet","Label":"{i18n>Details}","Target":"@UI.FieldGroup#Details"}],"@UI.FieldGroup#Details.Data":[{"Value":{"=":"code"}},{"Value":{"=":"name"}},{"Value":{"=":"descr"}}]}],"meta":{"creator":"CDS Compiler v4.1.2"},"$version":"2.0"} diff --git a/srv/src/main/resources/db/changelog/v2/model.sql b/srv/src/main/resources/db/changelog/v2/model.sql new file mode 100644 index 00000000..9f350bd6 --- /dev/null +++ b/srv/src/main/resources/db/changelog/v2/model.sql @@ -0,0 +1,92 @@ + +DROP VIEW localized_CatalogService_Books; +DROP VIEW localized_AdminService_Books; +DROP VIEW localized_my_bookshop_Books; +DROP VIEW CatalogService_Books; +DROP VIEW AdminService_Books; + +ALTER TABLE my_bookshop_Books ADD isbn VARCHAR(40); + +ALTER TABLE AdminService_Books_drafts ADD isbn VARCHAR(40) NULL; + +CREATE VIEW AdminService_Books AS SELECT + Books_0.ID, + Books_0.createdAt, + Books_0.createdBy, + Books_0.modifiedAt, + Books_0.modifiedBy, + Books_0.title, + Books_0.descr, + Books_0.author_ID, + Books_0.genre_ID, + Books_0.stock, + Books_0.price, + Books_0.currency_code, + Books_0.rating, + Books_0.isbn +FROM my_bookshop_Books AS Books_0; + +CREATE VIEW CatalogService_Books AS SELECT + Books_0.ID, + Books_0.createdAt, + Books_0.modifiedAt, + Books_0.title, + Books_0.descr, + Books_0.author_ID, + Books_0.genre_ID, + Books_0.stock, + Books_0.price, + Books_0.currency_code, + Books_0.rating, + Books_0.isbn +FROM my_bookshop_Books AS Books_0; + +CREATE VIEW localized_my_bookshop_Books AS SELECT + L_0.ID, + L_0.createdAt, + L_0.createdBy, + L_0.modifiedAt, + L_0.modifiedBy, + coalesce(localized_1.title, L_0.title) AS title, + coalesce(localized_1.descr, L_0.descr) AS descr, + L_0.author_ID, + L_0.genre_ID, + L_0.stock, + L_0.price, + L_0.currency_code, + L_0.rating, + L_0.isbn +FROM (my_bookshop_Books AS L_0 LEFT JOIN my_bookshop_Books_texts AS localized_1 ON localized_1.ID = L_0.ID AND localized_1.locale = current_setting('cap.locale')); + +CREATE VIEW localized_AdminService_Books AS SELECT + Books_0.ID, + Books_0.createdAt, + Books_0.createdBy, + Books_0.modifiedAt, + Books_0.modifiedBy, + Books_0.title, + Books_0.descr, + Books_0.author_ID, + Books_0.genre_ID, + Books_0.stock, + Books_0.price, + Books_0.currency_code, + Books_0.rating, + Books_0.isbn +FROM localized_my_bookshop_Books AS Books_0; + +CREATE VIEW localized_CatalogService_Books AS SELECT + Books_0.ID, + Books_0.createdAt, + Books_0.modifiedAt, + Books_0.title, + Books_0.descr, + Books_0.author_ID, + Books_0.genre_ID, + Books_0.stock, + Books_0.price, + Books_0.currency_code, + Books_0.rating, + Books_0.isbn +FROM localized_my_bookshop_Books AS Books_0; + diff --git a/srv/src/main/resources/messages.properties b/srv/src/main/resources/messages.properties deleted file mode 100644 index b0e769b8..00000000 --- a/srv/src/main/resources/messages.properties +++ /dev/null @@ -1,13 +0,0 @@ -quantity.require.minimum = The specified quantity is smaller than 1 -book.require.stock = Not enough books on stock (only {0} left) -book.added.order = Book successfully added to order -book.missing = Book does not exist -orderitem.missing = OrderItem does not exist -order.missing = Order does not exist -order.indraft = Order is currently in draft mode -bupa.missing = No Business Parter for this user available -review.added = Review added -order.exceeds.stock = {0} exceeds stock for book -review.add.forbidden=User not allowed to add more than one review for a given book -book.import.failed = Import of books failed -book.import.invalid.csv = Invalid CSV structure found - Please check its content \ No newline at end of file diff --git a/srv/src/main/resources/messages_de.properties b/srv/src/main/resources/messages_de.properties deleted file mode 100644 index f498bbe0..00000000 --- a/srv/src/main/resources/messages_de.properties +++ /dev/null @@ -1,13 +0,0 @@ -quantity.require.minimum = Die eingetragene Anzahl ist kleiner als 1 -book.require.stock = Nicht genügend Bücher auf Vorrat (nur {0} übrig) -book.added.order = Das Buch wurde der Bestellung erfolgreich hinzugefügt -book.missing = Das Buch existiert nicht -orderitem.missing = Der Bestellungseintrag existiert nicht -order.missing = Die Bestellung existiert nicht -order.indraft = Die Bestellung ist bereits in Bearbeitung -bupa.missing = Kein Business Parter für diesen User verfügbar -review.added = Bewertung hinzugefügt -order.exceeds.stock = {0} ist mehr als für das Buch auf Vorrat übrig ist -review.add.forbidden = Es ist nicht mehr als eine Bewertung pro Buch erlaubt -book.import.failed = Bücher Import fehlgeschlagen -book.import.invalid.csv = Die CSV Datei enthält eine ungültige Struktur - Bitte überprüfen Sie den Inhalt \ No newline at end of file diff --git a/srv/src/main/resources/swagger/index.html b/srv/src/main/resources/swagger/index.html deleted file mode 100644 index c1f76127..00000000 --- a/srv/src/main/resources/swagger/index.html +++ /dev/null @@ -1,93 +0,0 @@ - - - - - - Swagger UI - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - diff --git a/srv/src/test/java/my/bookshop/AdminServiceAddressITestBase.java b/srv/src/test/java/my/bookshop/AdminServiceAddressITestBase.java deleted file mode 100644 index add439a0..00000000 --- a/srv/src/test/java/my/bookshop/AdminServiceAddressITestBase.java +++ /dev/null @@ -1,114 +0,0 @@ -package my.bookshop; - -import java.util.UUID; -import java.util.concurrent.CountDownLatch; -import java.util.concurrent.TimeUnit; - -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.beans.factory.annotation.Qualifier; -import org.springframework.http.HttpHeaders; -import org.springframework.test.web.reactive.server.WebTestClient; - -import com.sap.cds.services.cds.CqnService; -import com.sap.cds.services.changeset.ChangeSetListener; - -import cds.gen.adminservice.Orders; -import cds.gen.api_business_partner.ABusinessPartnerAddress; -import cds.gen.api_business_partner.ApiBusinessPartner_; -import cds.gen.api_business_partner.BusinessPartnerChangedContext; - -public class AdminServiceAddressITestBase { - - private static final String ordersURI = "/api/admin/Orders"; - private static final String orderURI = ordersURI + "(IsActiveEntity=true,ID=%s)"; - private static final String addressesURI = "/api/admin/Addresses"; - private static final String remoteAddressURI = "/api/API_BUSINESS_PARTNER/A_BusinessPartnerAddress(BusinessPartner='%s',AddressID='%s')"; - - @Autowired - private WebTestClient client; - - @Autowired - @Qualifier(ApiBusinessPartner_.CDS_NAME) - private CqnService bupa; - - public void testAddressesValueHelp() { - client.get().uri(addressesURI).headers(this::adminCredentials).exchange() - .expectStatus().isOk() - .expectBody() - .jsonPath("$.['@context']").isEqualTo("$metadata#Addresses") - .jsonPath("$.value[0].ID").isEqualTo("100") - .jsonPath("$.value[0].businessPartner").isEqualTo("10401010") - .jsonPath("$.value[1].ID").isEqualTo("200") - .jsonPath("$.value[1].businessPartner").isEqualTo("10401010") - .jsonPath("$.value[2].ID").isEqualTo("300") - .jsonPath("$.value[2].businessPartner").isEqualTo("10401010"); - } - - public void testOrderWithAddress() throws InterruptedException { - Orders order = Orders.create(); - order.setOrderNo("1337"); - order.setShippingAddressId("100"); - - String id = UUID.randomUUID().toString(); - client.put().uri(String.format(orderURI, id)) - .headers(this::adminCredentials) - .header("Content-Type", "application/json") - .bodyValue(order.toJson()) - .exchange() - .expectStatus().isCreated(); - - client.get().uri(String.format(orderURI, id) + "?$expand=shippingAddress").headers(this::adminCredentials).exchange() - .expectStatus().isOk() - .expectBody() - .jsonPath("$.ID").isEqualTo(id) - .jsonPath("$.OrderNo").isEqualTo(order.getOrderNo()) - .jsonPath("$.shippingAddress.ID").isEqualTo("100") - .jsonPath("$.shippingAddress.businessPartner").isEqualTo("10401010") - .jsonPath("$.shippingAddress.houseNumber").isEqualTo("16"); - - client.get().uri(String.format(orderURI, id) + "/shippingAddress").headers(this::adminCredentials).exchange() - .expectStatus().isOk() - .expectBody() - .jsonPath("$.ID").isEqualTo("100") - .jsonPath("$.businessPartner").isEqualTo("10401010") - .jsonPath("$.houseNumber").isEqualTo("16"); - - // react on remote address update - CountDownLatch latch = new CountDownLatch(1); - bupa.on(BusinessPartnerChangedContext.CDS_NAME, null, (context) -> context.getChangeSetContext().register(new ChangeSetListener(){ - - @Override - public void afterClose(boolean completed) { - latch.countDown(); - } - - })); - - // update remote address - ABusinessPartnerAddress address = ABusinessPartnerAddress.create(); - address.setHouseNumber("17"); - - client.patch().uri(String.format(remoteAddressURI, "10401010", "100")).headers(this::authenticatedCredentials) - .header("Content-Type", "application/json") - .bodyValue(address.toJson()) - .exchange() - .expectStatus().isOk(); - - // wait for remote address update - latch.await(30, TimeUnit.SECONDS); - client.get().uri(String.format(orderURI, id) + "/shippingAddress").headers(this::adminCredentials).exchange() - .expectStatus().isOk() - .expectBody() - .jsonPath("$.ID").isEqualTo("100") - .jsonPath("$.businessPartner").isEqualTo("10401010") - .jsonPath("$.houseNumber").isEqualTo("17"); - } - - private void adminCredentials(HttpHeaders headers) { - headers.setBasicAuth("admin", "admin"); - } - - private void authenticatedCredentials(HttpHeaders headers) { - headers.setBasicAuth("authenticated", ""); - } -} diff --git a/srv/src/test/java/my/bookshop/AdminServiceAddress_default_ITest.java b/srv/src/test/java/my/bookshop/AdminServiceAddress_default_ITest.java deleted file mode 100644 index 099f9d0d..00000000 --- a/srv/src/test/java/my/bookshop/AdminServiceAddress_default_ITest.java +++ /dev/null @@ -1,32 +0,0 @@ -package my.bookshop; - -import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.extension.ExtendWith; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.boot.test.context.SpringBootTest.WebEnvironment; -import org.springframework.test.context.ActiveProfiles; -import org.springframework.test.context.junit.jupiter.SpringExtension; - -/** - * Runs tests defined in {@link AdminServiceAddressITestBase} with the default profile. - * The default profile doesn't create any remote services, so the application behaves as if - * the AdminService and the API_BUSINESS_PARTNER service were provided by the same application. - */ -@ExtendWith(SpringExtension.class) -@ActiveProfiles("default") -@SpringBootTest(webEnvironment = WebEnvironment.RANDOM_PORT) -public class AdminServiceAddress_default_ITest extends AdminServiceAddressITestBase { - - @Test - @Override - public void testAddressesValueHelp() { - super.testAddressesValueHelp(); - } - - @Test - @Override - public void testOrderWithAddress() throws InterruptedException { - super.testOrderWithAddress(); - } - -} diff --git a/srv/src/test/java/my/bookshop/AdminServiceAddress_mocked_ITest.java b/srv/src/test/java/my/bookshop/AdminServiceAddress_mocked_ITest.java deleted file mode 100644 index fb2591f4..00000000 --- a/srv/src/test/java/my/bookshop/AdminServiceAddress_mocked_ITest.java +++ /dev/null @@ -1,33 +0,0 @@ -package my.bookshop; - -import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.extension.ExtendWith; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.boot.test.context.SpringBootTest.WebEnvironment; -import org.springframework.test.context.ActiveProfiles; -import org.springframework.test.context.junit.jupiter.SpringExtension; - -/** - * Runs tests defined in {@link AdminServiceAddressITestBase} with the default and mocked profile. - * The mocked profile creates a remote services for the API_BUSINESS_PARTNER service (which is however mocked by our own application), - * so the application behaves as if the AdminService and the API_BUSINESS_PARTNER service were provided by two different applications. - */ -@ExtendWith(SpringExtension.class) -@ActiveProfiles({"default", "mocked"}) -@SpringBootTest(webEnvironment = WebEnvironment.RANDOM_PORT, - properties = "cds.remote.services.'[API_BUSINESS_PARTNER]'.destination.name=myself-AdminServiceAddressITest") -public class AdminServiceAddress_mocked_ITest extends AdminServiceAddressITestBase { - - @Test - @Override - public void testAddressesValueHelp() { - super.testAddressesValueHelp(); - } - - @Test - @Override - public void testOrderWithAddress() throws InterruptedException { - super.testOrderWithAddress(); - } - -} diff --git a/srv/src/test/java/my/bookshop/AdminServiceTest.java b/srv/src/test/java/my/bookshop/AdminServiceTest.java deleted file mode 100644 index 846b4679..00000000 --- a/srv/src/test/java/my/bookshop/AdminServiceTest.java +++ /dev/null @@ -1,100 +0,0 @@ -package my.bookshop; - -import static cds.gen.adminservice.AdminService_.AUTHORS; -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertThrows; - -import java.math.BigDecimal; -import java.util.Collections; - -import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.extension.ExtendWith; -import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.security.test.context.support.WithMockUser; -import org.springframework.test.context.junit.jupiter.SpringExtension; - -import com.sap.cds.Result; -import com.sap.cds.ql.Insert; -import com.sap.cds.services.ServiceException; -import com.sap.cds.services.draft.DraftService; -import com.sap.cds.services.utils.CdsErrorStatuses; - -import cds.gen.adminservice.AdminService_; -import cds.gen.adminservice.Authors; -import cds.gen.adminservice.OrderItems; -import cds.gen.adminservice.Orders; -import cds.gen.adminservice.Orders_; -import jakarta.annotation.Resource; - -@ExtendWith(SpringExtension.class) -@SpringBootTest -@AutoConfigureMockMvc -public class AdminServiceTest { - - @Resource(name = AdminService_.CDS_NAME) - private DraftService adminService; - - @Test - @WithMockUser(username = "user") - public void testUnauthorizedAccess() { - assertThrows(ServiceException.class, () -> { - adminService.newDraft(Insert.into(AUTHORS).entry(Collections.emptyMap())); - }); - } - - @Test - @WithMockUser(username = "admin") - public void testInvalidAuthorName() { - assertThrows(ServiceException.class, () -> { - Authors author = Authors.create(); - author.setName("little Joey"); - adminService.run(Insert.into(AUTHORS).entry(author)); - }); - } - - @Test - @WithMockUser(username = "admin") - public void testValidAuthorName() { - Authors author = Authors.create(); - author.setName("Big Joey"); - Result result = adminService.run(Insert.into(AUTHORS).entry(author)); - assertEquals(1, result.rowCount()); - } - - @Test - @WithMockUser(username = "admin") - void testCreateOrderWithoutBook() { - Orders order = Orders.create(); - order.setOrderNo("324"); - order.setShippingAddressId("100"); - OrderItems item = OrderItems.create(); - item.setQuantity(1); - item.setAmount(BigDecimal.valueOf(12.12)); - order.setItems(Collections.singletonList(item)); - - // Runtime ensures that book is present in the order item, when it is created. - ServiceException exception = - assertThrows(ServiceException.class, () -> adminService.run(Insert.into(Orders_.class).entry(order))); - assertEquals(CdsErrorStatuses.VALUE_REQUIRED.getCodeString(), exception.getErrorStatus().getCodeString()); - } - - @Test - @WithMockUser(username = "admin") - void testCreateOrderWithNonExistingBook() { - Orders order = Orders.create(); - order.setOrderNo("324"); - order.setShippingAddressId("100"); - OrderItems item = OrderItems.create(); - item.setQuantity(1); - item.setAmount(BigDecimal.valueOf(12.12)); - item.setBookId("4a519e61-3c3a-4bd9-ab12-d7e0c5ddaabb"); - order.setItems(Collections.singletonList(item)); - - // Runtime ensures that book exists when order item is created. - ServiceException exception = - assertThrows(ServiceException.class, () -> adminService.run(Insert.into(Orders_.class).entry(order))); - assertEquals(CdsErrorStatuses.TARGET_ENTITY_MISSING.getCodeString(), exception.getErrorStatus().getCodeString()); - } - -} diff --git a/srv/src/test/java/my/bookshop/CatalogServiceITest.java b/srv/src/test/java/my/bookshop/CatalogServiceITest.java deleted file mode 100644 index 933c7662..00000000 --- a/srv/src/test/java/my/bookshop/CatalogServiceITest.java +++ /dev/null @@ -1,96 +0,0 @@ -package my.bookshop; - -import static cds.gen.catalogservice.CatalogService_.REVIEWS; -import static org.hamcrest.CoreMatchers.containsString; -import static org.hamcrest.CoreMatchers.not; -import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; -import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.post; -import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath; -import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; - -import org.junit.jupiter.api.AfterEach; -import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.extension.ExtendWith; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.http.MediaType; -import org.springframework.security.test.context.support.WithMockUser; -import org.springframework.test.context.junit.jupiter.SpringExtension; -import org.springframework.test.web.servlet.MockMvc; - -import com.sap.cds.ql.Delete; -import com.sap.cds.services.persistence.PersistenceService; - -import cds.gen.catalogservice.Reviews; - -@ExtendWith(SpringExtension.class) -@SpringBootTest -@AutoConfigureMockMvc -public class CatalogServiceITest { - - private static final String booksURI = "/api/browse/Books"; - private static final String addReviewURI = String.format("%s(ID=%s)/CatalogService.addReview", booksURI, "f846b0b9-01d4-4f6d-82a4-d79204f62278"); - - private static final String USER_USER_STRING = "user"; - private static final String ADMIN_USER_STRING = "admin"; - - @Autowired - private MockMvc mockMvc; - - @Autowired - private PersistenceService db; - - @AfterEach - public void cleanup() { - db.run(Delete.from(REVIEWS)); - } - - @Test - public void testDiscountApplied() throws Exception { - mockMvc.perform(get(booksURI + "?$filter=stock gt 200&top=1")) - .andExpect(status().isOk()) - .andExpect(jsonPath("$.value[0].title").value(containsString("11% discount"))); - } - - @Test - public void testDiscountNotApplied() throws Exception { - mockMvc.perform(get(booksURI + "?$filter=stock lt 100&top=1")) - .andExpect(status().isOk()) - .andExpect(jsonPath("$.value[0].title").value(not(containsString("11% discount")))); - } - - @Test - public void testCreateReviewNotAuthenticated() throws Exception { - String payload = createTestReview().toJson(); - mockMvc.perform(post(addReviewURI).contentType(MediaType.APPLICATION_JSON).content(payload)) - .andExpect(status().isUnauthorized()); - } - - @Test - @WithMockUser(USER_USER_STRING) - public void testCreateReviewByUser() throws Exception { - String payload = createTestReview().toJson(); - mockMvc.perform(post(addReviewURI).contentType(MediaType.APPLICATION_JSON).content(payload)) - .andExpect(status().isOk()) - .andExpect(jsonPath("$.createdBy").value(USER_USER_STRING)); - } - - @Test - @WithMockUser(ADMIN_USER_STRING) - public void testCreateReviewByAdmin() throws Exception { - String payload = createTestReview().toJson(); - mockMvc.perform(post(addReviewURI).contentType(MediaType.APPLICATION_JSON).content(payload)) - .andExpect(status().isOk()) - .andExpect(jsonPath("$.createdBy").value(ADMIN_USER_STRING)); - } - - private Reviews createTestReview() { - Reviews review = Reviews.create(); - review.setRating(1); - review.setTitle("title"); - review.setText("text"); - return review; - } - -} diff --git a/srv/src/test/java/my/bookshop/CatalogServiceTest.java b/srv/src/test/java/my/bookshop/CatalogServiceTest.java deleted file mode 100644 index d606db5b..00000000 --- a/srv/src/test/java/my/bookshop/CatalogServiceTest.java +++ /dev/null @@ -1,152 +0,0 @@ -package my.bookshop; - -import static cds.gen.catalogservice.CatalogService_.BOOKS; -import static cds.gen.catalogservice.CatalogService_.REVIEWS; -import static org.junit.jupiter.api.Assertions.assertDoesNotThrow; -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertThrows; - -import java.util.stream.Stream; - -import org.junit.jupiter.api.AfterEach; -import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.extension.ExtendWith; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.beans.factory.annotation.Qualifier; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.security.test.context.support.WithMockUser; -import org.springframework.test.context.junit.jupiter.SpringExtension; - -import com.sap.cds.ql.Delete; -import com.sap.cds.ql.Select; -import com.sap.cds.services.ServiceException; -import com.sap.cds.services.cds.CqnService; -import com.sap.cds.services.persistence.PersistenceService; - -import cds.gen.catalogservice.AddReviewContext; -import cds.gen.catalogservice.CatalogService_; -import cds.gen.catalogservice.Reviews; - -@ExtendWith(SpringExtension.class) -@SpringBootTest -public class CatalogServiceTest { - - @Autowired - @Qualifier(CatalogService_.CDS_NAME) - private CqnService catalogService; - - @Autowired - private PersistenceService db; - - @AfterEach - public void cleanup() { - db.run(Delete.from(REVIEWS)); - } - - @Test - @WithMockUser(username = "user") - public void testCreateReviewHandler() { - Stream bookReviews = Stream.of( - createReview("f846b0b9-01d4-4f6d-82a4-d79204f62278", 1, "quite bad", "disappointing..."), - createReview("aebdfc8a-0dfa-4468-bd36-48aabd65e663", 5, "great read", "just amazing...")); - - bookReviews.forEach(bookReview -> { - AddReviewContext context = addReviewContext(bookReview); - catalogService.emit(context); - - Reviews result = context.getResult(); - - assertEquals(bookReview.getBookId(), result.getBookId()); - assertEquals(bookReview.getRating(), result.getRating()); - assertEquals(bookReview.getTitle(), result.getTitle()); - assertEquals(bookReview.getText(), result.getText()); - }); - } - - @Test - @WithMockUser(username = "user") - public void testAddReviewWithInvalidRating() { - Stream bookReviews = Stream.of( - // lt 1 is invalid - createReview("f846b0b9-01d4-4f6d-82a4-d79204f62278", 0, "quite bad", "disappointing..."), - // gt 5 is invalid - createReview("9b084139-0b1e-43b6-b12a-7b3669d75f02", 6, "great read", "just amazing...")); - - String message = "Valid rating range needs to be within 1 and 5"; - - bookReviews.forEach(bookReview -> { - AddReviewContext context = addReviewContext(bookReview); - assertThrows(ServiceException.class, () -> catalogService.emit(context), message); - }); - } - - @Test - @WithMockUser(username = "user") - public void testAddReviewForNonExistingBook() { - - String nonExistingBookId = "non-existing"; - String exMessage1 = "You have to specify the book to review"; - String exMessage2 = String.format("A book with the specified ID '%s' does not exist", nonExistingBookId); - - Stream testCases = Stream.of( - // no book provided - new BookReviewTestFixture(createReview(null, 1, "quite bad", "disappointing..."), exMessage1), - // invalid book id - new BookReviewTestFixture(createReview(nonExistingBookId, 5, "great read", "just amazing..."), - exMessage2)); - - testCases.forEach(testCase -> { - AddReviewContext context = addReviewContext(testCase.review); - assertThrows(ServiceException.class, () -> catalogService.emit(context), testCase.exceptionMessage); - }); - } - - @Test - @WithMockUser(username = "user") - public void testAddReviewSameBookMoreThanOnceBySameUser() { - - String bookId = "4a519e61-3c3a-4bd9-ab12-d7e0c5329933"; - String anotherBookId = "9b084139-0b1e-43b6-b12a-7b3669d75f02"; - - AddReviewContext firstReview = addReviewContext(createReview(bookId, 1, "quite bad", "disappointing...")); - AddReviewContext secondReview = addReviewContext(createReview(bookId, 5, "great read", "just amazing...")); - AddReviewContext anotherReview = addReviewContext(createReview(anotherBookId, 4, "very good", "entertaining...")); - - assertDoesNotThrow(() -> catalogService.emit(firstReview)); - assertThrows(ServiceException.class, () -> catalogService.emit(secondReview), - "User not allowed to add more than one review for a given book"); - assertDoesNotThrow(() -> catalogService.emit(anotherReview)); - } - - private Reviews createReview(String bookId, Integer rating, String title, String text) { - Reviews review = Reviews.create(); - review.setBookId(bookId); - review.setRating(rating); - review.setTitle(title); - review.setText(text); - return review; - } - - /* - * Holder class for a book review test case. - */ - private class BookReviewTestFixture { - Reviews review; - String exceptionMessage; - - BookReviewTestFixture(Reviews review, String exceptionMessage) { - this.review = review; - this.exceptionMessage = exceptionMessage; - } - } - - private AddReviewContext addReviewContext(Reviews review) { - AddReviewContext context = AddReviewContext.create(); - context.setCqn(Select.from(BOOKS).byId(review.getBookId())); - context.setRating(review.getRating()); - context.setTitle(review.getTitle()); - context.setText(review.getText()); - return context; - } - -} diff --git a/srv/src/test/java/my/bookshop/NotesServiceITest.java b/srv/src/test/java/my/bookshop/NotesServiceITest.java deleted file mode 100644 index 30bf6c45..00000000 --- a/srv/src/test/java/my/bookshop/NotesServiceITest.java +++ /dev/null @@ -1,195 +0,0 @@ -package my.bookshop; - -import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.extension.ExtendWith; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.boot.test.context.SpringBootTest.WebEnvironment; -import org.springframework.http.HttpHeaders; -import org.springframework.test.context.ActiveProfiles; -import org.springframework.test.context.junit.jupiter.SpringExtension; -import org.springframework.test.web.reactive.server.WebTestClient; - -@ExtendWith(SpringExtension.class) -@SpringBootTest(webEnvironment = WebEnvironment.RANDOM_PORT, - properties = "cds.remote.services.'[API_BUSINESS_PARTNER]'.destination.name=myself-NotesServiceITest") -@ActiveProfiles({"default", "mocked"}) -public class NotesServiceITest { - - private static final String notesURI = "/api/notes/Notes"; - private static final String addressesURI = "/api/notes/Addresses"; - - @Autowired - private WebTestClient client; - - @Test - public void testGetNotes() throws Exception { - client.get().uri(notesURI).headers(this::authenticatedCredentials).exchange() - .expectStatus().isOk() - .expectBody() - .jsonPath("$.['@context']").isEqualTo("$metadata#Notes") - .jsonPath("$.value[0].ID").isEqualTo("5efc842c-c70d-4ee2-af1d-81c7d257aff7") - .jsonPath("$.value[0].note").isEqualTo("Ring at building 8") - .jsonPath("$.value[0].address_businessPartner").isEqualTo("1000020") - .jsonPath("$.value[0].address_ID").isEqualTo("500") - .jsonPath("$.value[1].ID").isEqualTo("83e2643b-aecc-47d3-9f85-a8ba14eff07d") - .jsonPath("$.value[1].note").isEqualTo("Packages can be dropped off at the reception") - .jsonPath("$.value[1].address_businessPartner").isEqualTo("10401010") - .jsonPath("$.value[1].address_ID").isEqualTo("100") - .jsonPath("$.value[2].ID").isEqualTo("880147b0-8d2d-4ef8-bb52-ae5ae6002fc5") - .jsonPath("$.value[2].note").isEqualTo("Don't deliver packages after 5pm") - .jsonPath("$.value[2].address_businessPartner").isEqualTo("10401010") - .jsonPath("$.value[2].address_ID").isEqualTo("100"); - } - - @Test - public void testGetAddresses() throws Exception { - client.get().uri(addressesURI + "?$filter=businessPartner eq '10401010'").headers(this::authenticatedCredentials).exchange() - .expectStatus().isOk() - .expectBody() - .jsonPath("$.['@context']").isEqualTo("$metadata#Addresses") - .jsonPath("$.value[0].ID").isEqualTo("100") - .jsonPath("$.value[0].postalCode").isEqualTo("68199") - .jsonPath("$.value[1].ID").isEqualTo("200") - .jsonPath("$.value[1].postalCode").isEqualTo("68789") - .jsonPath("$.value[2].ID").isEqualTo("300") - .jsonPath("$.value[2].postalCode").isEqualTo("14469"); - } - - @Test - public void testGetNoteWithAddress() throws Exception { - client.get().uri(notesURI + "?$expand=address").headers(this::authenticatedCredentials).exchange() - .expectStatus().isOk() - .expectBody() - .jsonPath("$.['@context']").isEqualTo("$metadata#Notes(address())") - .jsonPath("$.value[0].ID").isEqualTo("5efc842c-c70d-4ee2-af1d-81c7d257aff7") - .jsonPath("$.value[0].note").isEqualTo("Ring at building 8") - .jsonPath("$.value[0].address_businessPartner").isEqualTo("1000020") - .jsonPath("$.value[0].address_ID").isEqualTo("500") - .jsonPath("$.value[0].address.businessPartner").isEqualTo("1000020") - .jsonPath("$.value[0].address.ID").isEqualTo("500") - .jsonPath("$.value[0].address.postalCode").isEqualTo("94304") - .jsonPath("$.value[1].ID").isEqualTo("83e2643b-aecc-47d3-9f85-a8ba14eff07d") - .jsonPath("$.value[1].note").isEqualTo("Packages can be dropped off at the reception") - .jsonPath("$.value[1].address_businessPartner").isEqualTo("10401010") - .jsonPath("$.value[1].address_ID").isEqualTo("100") - .jsonPath("$.value[1].address.businessPartner").isEqualTo("10401010") - .jsonPath("$.value[1].address.ID").isEqualTo("100") - .jsonPath("$.value[1].address.postalCode").isEqualTo("68199") - .jsonPath("$.value[2].ID").isEqualTo("880147b0-8d2d-4ef8-bb52-ae5ae6002fc5") - .jsonPath("$.value[2].note").isEqualTo("Don't deliver packages after 5pm") - .jsonPath("$.value[2].address_businessPartner").isEqualTo("10401010") - .jsonPath("$.value[2].address_ID").isEqualTo("100") - .jsonPath("$.value[2].address.businessPartner").isEqualTo("10401010") - .jsonPath("$.value[2].address.ID").isEqualTo("100") - .jsonPath("$.value[2].address.postalCode").isEqualTo("68199"); - } - - @Test - public void testGetSuppliersWithNotes() throws Exception { - client.get().uri(addressesURI + "?$expand=notes($orderby=ID)&$filter=businessPartner eq '10401010'").headers(this::authenticatedCredentials).exchange() - .expectStatus().isOk() - .expectBody() - .jsonPath("$.['@context']").isEqualTo("$metadata#Addresses(notes())") - .jsonPath("$.value[0].ID").isEqualTo("100") - .jsonPath("$.value[0].postalCode").isEqualTo("68199") - .jsonPath("$.value[0].notes[0].ID").isEqualTo("83e2643b-aecc-47d3-9f85-a8ba14eff07d") - .jsonPath("$.value[0].notes[0].note").isEqualTo("Packages can be dropped off at the reception") - .jsonPath("$.value[0].notes[0].address_businessPartner").isEqualTo("10401010") - .jsonPath("$.value[0].notes[0].address_ID").isEqualTo("100") - .jsonPath("$.value[0].notes[1].ID").isEqualTo("880147b0-8d2d-4ef8-bb52-ae5ae6002fc5") - .jsonPath("$.value[0].notes[1].note").isEqualTo("Don't deliver packages after 5pm") - .jsonPath("$.value[0].notes[1].address_businessPartner").isEqualTo("10401010") - .jsonPath("$.value[0].notes[1].address_ID").isEqualTo("100") - .jsonPath("$.value[0].notes[2]").doesNotExist() - .jsonPath("$.value[1].ID").isEqualTo("200") - .jsonPath("$.value[1].postalCode").isEqualTo("68789") - .jsonPath("$.value[2].notes").isEmpty() - .jsonPath("$.value[2].ID").isEqualTo("300") - .jsonPath("$.value[2].postalCode").isEqualTo("14469") - .jsonPath("$.value[2].notes").isEmpty(); - } - - @Test - public void testGetNotesToSupplier() throws Exception { - client.get().uri(notesURI + "(ID=5efc842c-c70d-4ee2-af1d-81c7d257aff7,IsActiveEntity=true)/address").headers(this::authenticatedCredentials).exchange() - .expectStatus().isOk() - .expectBody() - .jsonPath("$.['@context']").isEqualTo("$metadata#Addresses/$entity") - .jsonPath("$.businessPartner").isEqualTo("1000020") - .jsonPath("$.ID").isEqualTo("500") - .jsonPath("$.postalCode").isEqualTo("94304"); - } - - @Test - public void testGetSupplierToNotes() throws Exception { - client.get().uri(addressesURI + "(businessPartner='10401010',ID='100')/notes").headers(this::authenticatedCredentials).exchange() - .expectStatus().isOk() - .expectBody() - .jsonPath("$.value[0].ID").isEqualTo("83e2643b-aecc-47d3-9f85-a8ba14eff07d") - .jsonPath("$.value[0].note").isEqualTo("Packages can be dropped off at the reception") - .jsonPath("$.value[0].address_businessPartner").isEqualTo("10401010") - .jsonPath("$.value[0].address_ID").isEqualTo("100") - .jsonPath("$.value[1].ID").isEqualTo("880147b0-8d2d-4ef8-bb52-ae5ae6002fc5") - .jsonPath("$.value[1].note").isEqualTo("Don't deliver packages after 5pm") - .jsonPath("$.value[1].address_businessPartner").isEqualTo("10401010") - .jsonPath("$.value[1].address_ID").isEqualTo("100") - .jsonPath("$.value[2]").doesNotExist(); - } - - @Test - public void testGetSupplierToSpecificNote() throws Exception { - client.get().uri(addressesURI + "(businessPartner='10401010',ID='100')/notes(ID=83e2643b-aecc-47d3-9f85-a8ba14eff07d,IsActiveEntity=true)") - .headers(this::authenticatedCredentials) - .exchange() - .expectStatus().isOk() - .expectBody() - .jsonPath("$.ID").isEqualTo("83e2643b-aecc-47d3-9f85-a8ba14eff07d") - .jsonPath("$.note").isEqualTo("Packages can be dropped off at the reception") - .jsonPath("$.address_businessPartner").isEqualTo("10401010") - .jsonPath("$.address_ID").isEqualTo("100"); - } - - @Test - public void testGetNotesWithNestedExpands() throws Exception { - client.get().uri(notesURI + "?$select=note&$expand=address($select=postalCode;$expand=notes($select=note))&$top=1").headers(this::authenticatedCredentials).exchange() - .expectStatus().isOk() - .expectBody() - .jsonPath("$.value[0].ID").isEqualTo("5efc842c-c70d-4ee2-af1d-81c7d257aff7") - .jsonPath("$.value[0].note").isEqualTo("Ring at building 8") - .jsonPath("$.value[0].address.businessPartner").isEqualTo("1000020") - .jsonPath("$.value[0].address.ID").isEqualTo("500") - .jsonPath("$.value[0].address.postalCode").isEqualTo("94304") - .jsonPath("$.value[0].address.notes[0].ID").isEqualTo("5efc842c-c70d-4ee2-af1d-81c7d257aff7") - .jsonPath("$.value[0].address.notes[0].note").isEqualTo("Ring at building 8") - .jsonPath("$.value[0].address.notes[1]").doesNotExist() - .jsonPath("$.value[1]").doesNotExist(); - } - - @Test - public void testGetAddressesWithNestedExpands() throws Exception { - client.get().uri(addressesURI + "?$select=postalCode&$expand=notes($select=note;$expand=address($select=postalCode))&$filter=businessPartner eq '1000020'") - .headers(this::authenticatedCredentials) - .exchange() - .expectStatus().isOk() - .expectBody() - .jsonPath("$.value[0].businessPartner").isEqualTo("1000020") - .jsonPath("$.value[0].ID").isEqualTo("400") - .jsonPath("$.value[0].postalCode").isEqualTo("19073") - .jsonPath("$.value[0].notes").isEmpty() - .jsonPath("$.value[1].businessPartner").isEqualTo("1000020") - .jsonPath("$.value[1].ID").isEqualTo("500") - .jsonPath("$.value[1].postalCode").isEqualTo("94304") - .jsonPath("$.value[1].notes[0].ID").isEqualTo("5efc842c-c70d-4ee2-af1d-81c7d257aff7") - .jsonPath("$.value[1].notes[0].note").isEqualTo("Ring at building 8") - .jsonPath("$.value[1].notes[0].address.businessPartner").isEqualTo("1000020") - .jsonPath("$.value[1].notes[0].address.ID").isEqualTo("500") - .jsonPath("$.value[1].notes[0].address.postalCode").isEqualTo("94304") - .jsonPath("$.value[1].notes[1]").doesNotExist() - .jsonPath("$.value[2]").doesNotExist(); - } - - private void authenticatedCredentials(HttpHeaders headers) { - headers.setBasicAuth("authenticated", ""); - } -} diff --git a/srv/src/test/java/my/bookshop/RatingCalculatorTest.java b/srv/src/test/java/my/bookshop/RatingCalculatorTest.java deleted file mode 100644 index 816fe9b7..00000000 --- a/srv/src/test/java/my/bookshop/RatingCalculatorTest.java +++ /dev/null @@ -1,37 +0,0 @@ -package my.bookshop; - -import static org.junit.jupiter.api.Assertions.assertEquals; - -import java.math.BigDecimal; -import java.util.stream.Stream; - -import org.junit.jupiter.api.Test; - -public class RatingCalculatorTest { - - /* - * Holder class for a book rating calculation test case. - */ - private class RatingTestFixture { - Stream ratings; - double expectedAvg; - - RatingTestFixture(Stream ratings, double expectedAvg) { - this.ratings = ratings; - this.expectedAvg = expectedAvg; - } - } - - @Test - public void testGetAvgRating() { - RatingTestFixture f1 = new RatingTestFixture(Stream.of(1.0, 2.0, 3.0, 4.0, 5.0), 3.0); - RatingTestFixture f2 = new RatingTestFixture(Stream.of(1.3, 2.4, 3.5, 4.9, 5.1), 3.4); - RatingTestFixture f3 = new RatingTestFixture(Stream.of(2.1, 4.0, 2.7, 3.8, 4.9), 3.5); - - Stream.of(f1, f2, f3).forEach(f -> { - BigDecimal avgRating = RatingCalculator.getAvgRating(f.ratings); - assertEquals(f.expectedAvg, avgRating.doubleValue()); - }); - } - -} diff --git a/srv/src/test/java/my/bookshop/SimpleIntegrationTest.java b/srv/src/test/java/my/bookshop/SimpleIntegrationTest.java new file mode 100644 index 00000000..7bad395c --- /dev/null +++ b/srv/src/test/java/my/bookshop/SimpleIntegrationTest.java @@ -0,0 +1,37 @@ +package my.bookshop; + + +import org.junit.jupiter.api.Test; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.http.MediaType; +import org.springframework.security.test.context.support.WithMockUser; +import org.springframework.test.web.servlet.MockMvc; + +import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; + +@SpringBootTest +@AutoConfigureMockMvc +class SimpleIntegrationTest { + + @Autowired + MockMvc client; + + @Test + void booksAreReadable() throws Exception { + client.perform(get("/api/browse/Books").accept(MediaType.APPLICATION_JSON)).andExpect(status().isOk()); + } + + @Test + @WithMockUser("admin") + void booksAreManageable() throws Exception { + client.perform(get("/api/admin/Books").accept(MediaType.APPLICATION_JSON)).andExpect(status().isOk()); + } + + @Test + void booksAreProtected() throws Exception { + client.perform(get("/api/admin/Books").accept(MediaType.APPLICATION_JSON)).andExpect(status().isUnauthorized()); + } +} diff --git a/srv/src/test/java/my/bookshop/config/DatabaseConfiguration.java b/srv/src/test/java/my/bookshop/config/DatabaseConfiguration.java new file mode 100644 index 00000000..03403033 --- /dev/null +++ b/srv/src/test/java/my/bookshop/config/DatabaseConfiguration.java @@ -0,0 +1,27 @@ +package my.bookshop.config; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.boot.devtools.restart.RestartScope; +import org.springframework.boot.testcontainers.service.connection.ServiceConnection; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.testcontainers.containers.PostgreSQLContainer; +import org.testcontainers.utility.DockerImageName; + +@Configuration +public class DatabaseConfiguration { + private static final String POSTGRES = "postgres"; + private static final Logger postgresLogger = LoggerFactory.getLogger(POSTGRES); + + @Bean + @ServiceConnection + @RestartScope + PostgreSQLContainer postgresContainer(@Value("${my.bookshop.postgres-image}") String imageName) { + DockerImageName image = DockerImageName.parse(imageName).asCompatibleSubstituteFor(POSTGRES); + return new PostgreSQLContainer<>(image) + .withLogConsumer(outputFrame -> postgresLogger.info(outputFrame.getUtf8StringWithoutLineEnding())); + } + +} diff --git a/srv/src/test/java/my/bookshop/config/TestApplication.java b/srv/src/test/java/my/bookshop/config/TestApplication.java new file mode 100644 index 00000000..ff9d5c02 --- /dev/null +++ b/srv/src/test/java/my/bookshop/config/TestApplication.java @@ -0,0 +1,15 @@ +package my.bookshop.config; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; + +import my.bookshop.Application; + +// Use this Application instead of the main one to run the app from the IDE + +@SpringBootApplication +public class TestApplication { + public static void main(String[] args) { + SpringApplication.from(Application::main).run(args); + } +} diff --git a/srv/src/test/java/my/bookshop/handlers/CatalogServiceHandlerTest.java b/srv/src/test/java/my/bookshop/handlers/CatalogServiceHandlerTest.java deleted file mode 100644 index 6bc2c624..00000000 --- a/srv/src/test/java/my/bookshop/handlers/CatalogServiceHandlerTest.java +++ /dev/null @@ -1,58 +0,0 @@ -package my.bookshop.handlers; - -import static org.junit.jupiter.api.Assertions.assertEquals; - -import java.util.stream.Stream; - -import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.extension.ExtendWith; -import org.mockito.Mock; -import org.mockito.junit.jupiter.MockitoExtension; - -import com.sap.cds.reflect.CdsModel; -import com.sap.cds.services.draft.DraftService; -import com.sap.cds.services.messages.Messages; -import com.sap.cds.services.persistence.PersistenceService; -import com.sap.cds.services.request.FeatureTogglesInfo; - -import cds.gen.catalogservice.Books; -import my.bookshop.RatingCalculator; - -@ExtendWith(MockitoExtension.class) -public class CatalogServiceHandlerTest { - - // mocks are not called since stock is set on the books - @Mock - private PersistenceService db; - - @Mock - private CdsModel model; - - @Mock - private Messages messages; - - @Mock - private FeatureTogglesInfo featureToggles; - - @Mock - private RatingCalculator ratingCalculator; - - @Mock - private DraftService reviewService; - - @Test - public void testDiscountHandler() { - Books book1 = Books.create(); - book1.setTitle("Book 1"); - book1.setStock(10); - Books book2 = Books.create(); - book2.setTitle("Book 2"); - book2.setStock(200); - - CatalogServiceHandler handler = new CatalogServiceHandler(db, reviewService, messages, featureToggles, ratingCalculator, model); - handler.discountBooks(Stream.of(book1, book2)); - - assertEquals("Book 1", book1.getTitle(), "Book 1 was discounted"); - assertEquals("Book 2 -- 11% discount", book2.getTitle(), "Book 2 was not discounted"); - } -} diff --git a/xs-security-mt.json b/xs-security-mt.json deleted file mode 100644 index 984ce269..00000000 --- a/xs-security-mt.json +++ /dev/null @@ -1,78 +0,0 @@ -{ - "xsappname": "bookshop-java-public", - "tenant-mode": "shared", - "scopes": [ - { - "name": "$XSAPPNAME.admin", - "description": "admin" - }, - { - "name": "$XSAPPNAME.expert", - "description": "Expert features in the UI" - }, - { - "name": "$XSAPPNAME.premium-customer", - "description": "Premium customer" - }, - { - "name": "$XSAPPNAME.mtcallback", - "description": "Multi Tenancy Callback Access", - "grant-as-authority-to-apps": [ - "$XSAPPNAME(application,sap-provisioning,tenant-onboarding)" - ] - }, - { - "name": "$XSAPPNAME.mtdeployment", - "description": "Scope to trigger a re-deployment of the database artifacts" - }, - { - "name": "$XSAPPNAME.cds.ExtensionDeveloper", - "description": "Extend CAP applications via extension projects" - } - ], - "authorities-inheritance": false, - "authorities": [ - "$XSAPPNAME.mtdeployment" - ], - "attributes": [ - { - "name": "businessPartner", - "description": "S/4 BusinessPartner ID assigned to the user", - "valueType": "string" - } - ], - "role-templates": [ - { - "name": "admin", - "description": "generated", - "scope-references": [ - "$XSAPPNAME.admin" - ], - "attribute-references": [ - "businessPartner" - ] - }, - { - "name": "Extension_Developer", - "description": "CDS Extension Developer", - "scope-references": [ - "$XSAPPNAME.cds.ExtensionDeveloper" - ], - "attribute-references": [] - }, - { - "name": "expert", - "description": "Expert features in the UI", - "scope-references": [ - "$XSAPPNAME.expert" - ] - }, - { - "name": "premium-customer", - "description": "Premium customer", - "scope-references": [ - "$XSAPPNAME.premium-customer" - ] - } - ] -} diff --git a/xs-security.json b/xs-security.json index 03d9b1d0..ef37a733 100644 --- a/xs-security.json +++ b/xs-security.json @@ -1,5 +1,5 @@ { - "xsappname": "bookshop-java-public", + "xsappname": "bookshop-pg", "tenant-mode": "dedicated", "scopes": [ { @@ -7,22 +7,12 @@ "description": "admin" } ], - "attributes": [ - { - "name": "businessPartner", - "description": "S/4 BusinessPartner ID assigned to the user", - "valueType": "string" - } - ], "role-templates": [ { "name": "admin", "description": "generated", "scope-references": [ "$XSAPPNAME.admin" - ], - "attribute-references": [ - "businessPartner" ] } ]