Commit 9c424b0f authored by Benjamin Jöckel's avatar Benjamin Jöckel
Browse files

feat: add ES annotations

parent 55b52486
Loading
Loading
Loading
Loading
+18 −0
Original line number Diff line number Diff line
@@ -29,3 +29,21 @@ To generate a documentation for the routes use the following command.
```shell
node --require ts-node/register src/cli.ts routes PATH/TO/ROUTES.md
```

### Annotations

Annotations are used to add additional informations to fields, which are used to autogenerate mappings from the core objects. 
External dependencies can not be covered by the annotations. Documentation about some of the annotations can be found in: [typedoc](https://typedoc.org/guides/doccomments/)

| annotation        | description                               | parameters    |
|-------------------|-------------------------------------------|---------------|
| `@aggregatable`   | used for generating of aggregations of the field if the core schema is used to put data into a database/key-value store |               |
| `@float`          | number field is interpreted as float      |               |
| `@indexable`      | marks the type as indexable if the core schema is used to put data into a database/key-value store|               |
| `@integer`        | number field is interpreted as integer    |               |
| `@keyword`        | string field is interpreted as keyword    |               |
| `@sortable`       | field is sortable if the core schema is used to put data into a database/key-value store | sort method to be used: ducet, price, distance |
| `@text`           | string field is interpreted as text       |               |
| `@validatable`    | marks the type as validatable if the core schema is used to put data into a database/key-value store |               |

+18 −0
Original line number Diff line number Diff line
@@ -54,22 +54,29 @@ export enum SCThingType {
export interface SCThingWithoutReferences {
  /**
   * Alternate names of the thing
   * 
   * @keyword
   */
  alternateNames?: string[];
  /**
   * Description of the thing
   *
   * @minLength 1
   * @text
   */
  description?: string;
  /**
   * URL of an image of the thing
   * 
   * @keyword
   */
  image?: string;
  /**
   * Name of the thing
   *
   * @minLength 1
   * @sortable ducet
   * @text
   */
  name: string;
  /**
@@ -80,6 +87,9 @@ export interface SCThingWithoutReferences {
  translations?: SCTranslations<SCThingTranslatableProperties>;
  /**
   * Type of the thing
   * 
   * @sortable ducet
   * @aggregatable
   */
  type: SCThingType;
  /**
@@ -143,6 +153,8 @@ export interface SCThingRemoteOrigin extends SCThingOrigin {

  /**
   * Name of the origin
   * 
   * @text
   */
  name: string;

@@ -200,10 +212,14 @@ export interface SCThingUserOrigin extends SCThingOrigin {
export interface SCThingTranslatableProperties {
  /**
   * Translation of the description of the thing
   * 
   * @text
   */
  description?: string;
  /**
   * Translation of the name of the thing
   * 
   * @text
   */
  name?: string;
  /**
@@ -218,6 +234,8 @@ export interface SCThingTranslatableProperties {
export interface SCThingTranslatablePropertyOrigin {
  /**
   * Translation of the name of the origin
   * 
   * @text
   */
  name: string;
}
+1 −0
Original line number Diff line number Diff line
@@ -43,6 +43,7 @@ export class SCThingTranslator {
  private metaClasses: typeof SCClasses;

  /** 
   * 
   * @constructor
   * @example
   * // returns translator instance for german
+4 −0
Original line number Diff line number Diff line
@@ -28,12 +28,16 @@ export interface SCAcademicDegreeWithoutReferences
  /**
   * The achievable academic degree with academic field specification
   * (eg. Master of Science)
   * 
   * @keyword
   */
  academicDegreewithField: string;

  /**
   * The achievable academic degree with academic field specification
   * shorted (eg. M.Sc.).
   * 
   * @keyword
   */
  academicDegreewithFieldShort: string;
}
+3 −0
Original line number Diff line number Diff line
@@ -23,6 +23,9 @@ export interface SCAcademicTermWithoutReferences
  extends SCThingWithoutReferences {
  /**
   * Short name of the academic term, using the given pattern
   * 
   * @aggregatable
   * @keyword
   */
  acronym: string;

Loading