Commit 623ed613 authored by krlwlfrt's avatar krlwlfrt
Browse files

fix: resolve issues with things that can be offered

Fixes #41
parent fd994e2c
Loading
Loading
Loading
Loading
+13 −8
Original line number Diff line number Diff line
/*
 * Copyright (C) 2018-2019 StApps
 * Copyright (C) 2018, 2019 StApps
 * This program is free software: you can redistribute it and/or modify it
 * under the terms of the GNU General Public License as published by the Free
 * Software Foundation, version 3.
@@ -16,8 +16,8 @@ import {SCThing, SCThingTranslatableProperties} from '../Thing';
import {SCOrganizationWithoutReferences} from '../things/Organization';
import {SCPersonWithoutReferences} from '../things/Person';
import {SCTranslations} from '../types/i18n';
import {SCInPlace} from '../types/Places';
import {SCISO8601Date} from '../types/Time';
import {SCInPlace} from './../types/Places';

/**
 * Default price without distinction
@@ -50,7 +50,17 @@ export interface SCAcademicPriceGroup extends SCPriceGroup {
}

/**
 * A thing without references that has a price tag
 * A thing without references that can be offered
 */
export interface SCThingThatCanBeOfferedWithoutReferences extends SCThing {
  /**
   * Translations of a thing that can be offered
   */
  translations?: SCTranslations<SCThingThatCanBeOfferedTranslatableProperties>;
}

/**
 * A thing that can be offered
 */
export interface SCThingThatCanBeOffered<T extends SCPriceGroup>
  extends SCThing {
@@ -58,11 +68,6 @@ export interface SCThingThatCanBeOffered<T extends SCPriceGroup>
   * List of offers for that thing
   */
  offers?: Array<SCThingThatCanBeOfferedOffer<T>>;

  /**
   * Translations of a thing that can be offered
   */
  translations?: SCTranslations<SCThingThatCanBeOfferedTranslatableProperties>;
}

/**
+29 −21
Original line number Diff line number Diff line
/*
 * Copyright (C) 2018 StApps
 * Copyright (C) 2018, 2019 StApps
 * This program is free software: you can redistribute it and/or modify it
 * under the terms of the GNU General Public License as published by the Free
 * Software Foundation, version 3.
@@ -13,9 +13,12 @@
 * this program. If not, see <https://www.gnu.org/licenses/>.
 */
import {SCAcademicDegree, SCAcademicDegreeMeta} from '../base/AcademicDegree';
import {SCAcademicPriceGroup,
import {
  SCAcademicPriceGroup,
  SCThingThatCanBeOffered,
        SCThingThatCanBeOfferedTranslatableProperties} from '../base/ThingThatCanBeOffered';
  SCThingThatCanBeOfferedTranslatableProperties,
  SCThingThatCanBeOfferedWithoutReferences,
} from '../base/ThingThatCanBeOffered';
import {SCThingMeta, SCThingType} from '../Thing';
import {SCLanguage, SCMetaTranslations, SCTranslations} from '../types/i18n';
import {SCDateSeriesWithoutReferences} from './DateSeries';
@@ -24,9 +27,8 @@ import {SCOrganization} from './Organization';
/**
 * A course of studies without references
 */
export interface SCCourseOfStudiesWithoutReferences extends
                 SCAcademicDegree,
                 SCThingThatCanBeOffered<SCAcademicPriceGroup> {
export interface SCCourseOfStudiesWithoutReferences extends SCAcademicDegree,
  SCThingThatCanBeOfferedWithoutReferences {
  /**
   * The main language in which the course of studies
   * is beeing offered
@@ -64,7 +66,8 @@ export interface SCCourseOfStudiesWithoutReferences extends
 *
 * @validatable
 */
export interface SCCourseOfStudies extends SCCourseOfStudiesWithoutReferences {
export interface SCCourseOfStudies extends SCCourseOfStudiesWithoutReferences,
  SCThingThatCanBeOffered<SCAcademicPriceGroup> {
  /**
   * The department that manages the course of studies
   */
@@ -81,6 +84,11 @@ export interface SCCourseOfStudies extends SCCourseOfStudiesWithoutReferences {
   */
  startDates?: SCDateSeriesWithoutReferences[];

  /**
   * Translated fields of a dish
   */
  translations?: SCTranslations<SCCourseOfStudiesTranslatableProperties>;

  /**
   * Type of the course of studies
   */
@@ -136,13 +144,13 @@ export class SCCourseOfStudiesMeta extends SCThingMeta implements SCMetaTranslat
/**
 * Types of (german) course of studies modes
 */
export type SCCourseOfStudiesMode = 'combination' |
                                    'dual' |
                                    'double-degree' |
                                    'standard' ;
export type SCCourseOfStudiesMode = 'combination'
  | 'dual'
  | 'double-degree'
  | 'standard' ;

/**
 * Types of (german) course of studies time modes
 */
export type SCCourseOfStudiesTimeMode = 'fulltime' |
                                        'parttime' ;
export type SCCourseOfStudiesTimeMode = 'fulltime'
  | 'parttime' ;
+11 −9
Original line number Diff line number Diff line
/*
 * Copyright (C) 2018 StApps
 * Copyright (C) 2018, 2019 StApps
 * This program is free software: you can redistribute it and/or modify it
 * under the terms of the GNU General Public License as published by the Free
 * Software Foundation, version 3.
@@ -17,6 +17,7 @@ import {
  SCAcademicPriceGroup,
  SCThingThatCanBeOffered,
  SCThingThatCanBeOfferedTranslatableProperties,
  SCThingThatCanBeOfferedWithoutReferences,
} from '../base/ThingThatCanBeOffered';
import {SCThingMeta, SCThingType} from '../Thing';
import {SCMetaTranslations, SCTranslations} from '../types/i18n';
@@ -38,8 +39,7 @@ export interface SCSportCoursePriceGroup extends SCAcademicPriceGroup {
/**
 * A date without references
 */
export interface SCDateSeriesWithoutReferences
  extends SCThingThatCanBeOffered<SCSportCoursePriceGroup> {
export interface SCDateSeriesWithoutReferences extends SCThingThatCanBeOfferedWithoutReferences {
  /**
   * Dates of the date series that are initially planned to be held
   */
@@ -76,7 +76,9 @@ export interface SCDateSeriesWithoutReferences
 *
 * @validatable
 */
export interface SCDateSeries extends SCDateSeriesWithoutReferences, SCThingInPlace {
export interface SCDateSeries extends SCDateSeriesWithoutReferences,
  SCThingInPlace,
  SCThingThatCanBeOffered<SCSportCoursePriceGroup> {
  /**
   * Event to which the date series belongs
   */
+15 −17
Original line number Diff line number Diff line
/*
 * Copyright (C) 2018-2019 StApps
 * Copyright (C) 2018, 2019 StApps
 * This program is free software: you can redistribute it and/or modify it
 * under the terms of the GNU General Public License as published by the Free
 * Software Foundation, version 3.
@@ -16,6 +16,7 @@ import {
  SCAcademicPriceGroup,
  SCThingThatCanBeOffered,
  SCThingThatCanBeOfferedTranslatableProperties,
  SCThingThatCanBeOfferedWithoutReferences,
} from '../base/ThingThatCanBeOffered';
import {
  SCThingWithCategoriesSpecificValues,
@@ -29,12 +30,8 @@ import {SCMetaTranslations, SCTranslations} from '../types/i18n';
/**
 * A dish without references
 */
export interface SCDishWithoutReferences
  extends SCThingWithCategoriesWithoutReferences<
      SCDishCategories,
      SCThingWithCategoriesSpecificValues
    >,
    SCThingThatCanBeOffered<SCAcademicPriceGroup> {
export interface SCDishWithoutReferences extends SCThingThatCanBeOfferedWithoutReferences,
  SCThingWithCategoriesWithoutReferences<SCDishCategories, SCThingWithCategoriesSpecificValues> {
  /**
   * Additives of the dish
   */
@@ -71,7 +68,8 @@ export interface SCDishWithoutReferences
 *
 * @validatable
 */
export interface SCDish extends SCDishWithoutReferences {
export interface SCDish extends SCDishWithoutReferences,
  SCThingThatCanBeOffered<SCAcademicPriceGroup> {
  /**
   * Dishes ("Beilagen") that are served with the dish (if only certain supplement dishes can be taken with a dish)
   */