fix: adjust model to remove references from things without references

Fixes #69
This commit is contained in:
Karl-Philipp Wulfert
2019-05-14 17:57:10 +02:00
parent da0507ee34
commit ca72c20bd0
36 changed files with 585 additions and 400 deletions

View File

@@ -12,7 +12,7 @@
* You should have received a copy of the GNU General Public License along with
* this program. If not, see <https://www.gnu.org/licenses/>.
*/
import {SCThing, SCThingTranslatableProperties} from '../Thing';
import {SCThing, SCThingTranslatableProperties, SCThingWithoutReferences} from '../Thing';
import {SCOrganizationWithoutReferences} from '../things/Organization';
import {SCPersonWithoutReferences} from '../things/Person';
import {SCTranslations} from '../types/i18n';
@@ -32,7 +32,8 @@ export interface SCPriceGroup {
/**
* Price distinctions for academic context
*/
export interface SCAcademicPriceGroup extends SCPriceGroup {
export interface SCAcademicPriceGroup
extends SCPriceGroup {
/**
* Price for employees
*/
@@ -52,7 +53,8 @@ export interface SCAcademicPriceGroup extends SCPriceGroup {
/**
* A thing without references that can be offered
*/
export interface SCThingThatCanBeOfferedWithoutReferences extends SCThing {
export interface SCThingThatCanBeOfferedWithoutReferences
extends SCThingWithoutReferences {
/**
* Translations of a thing that can be offered
*/
@@ -63,11 +65,16 @@ export interface SCThingThatCanBeOfferedWithoutReferences extends SCThing {
* A thing that can be offered
*/
export interface SCThingThatCanBeOffered<T extends SCPriceGroup>
extends SCThing {
extends SCThing, SCThingThatCanBeOfferedWithoutReferences {
/**
* List of offers for that thing
*/
offers?: Array<SCThingThatCanBeOfferedOffer<T>>;
/**
* Translations of a thing that can be offered
*/
translations?: SCTranslations<SCThingThatCanBeOfferedTranslatableProperties>;
}
/**