mirror of
https://gitlab.com/openstapps/openstapps.git
synced 2026-01-07 14:02:48 +00:00
refactor: moved default price into SCPriceGroup
This commit is contained in:
@@ -20,10 +20,13 @@ import {SCISO8601Date} from '../types/Time';
|
||||
import {SCInPlace} from './../types/Places';
|
||||
|
||||
/**
|
||||
* A map from group name to price
|
||||
* Default price without distinction
|
||||
*/
|
||||
export interface SCPriceGroup {
|
||||
[s: string]: number | undefined;
|
||||
/**
|
||||
* Default price of the thing
|
||||
*/
|
||||
default: number;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -82,15 +85,10 @@ export interface SCThingThatCanBeOfferedOffer<T extends SCPriceGroup>
|
||||
*/
|
||||
availabilityStarts?: SCISO8601Date;
|
||||
|
||||
/**
|
||||
* Default price of the thing
|
||||
*/
|
||||
price: number;
|
||||
|
||||
/**
|
||||
* List of prices that are distinct for specific groups
|
||||
*/
|
||||
prices?: T;
|
||||
prices: T;
|
||||
|
||||
/**
|
||||
* Provider of an offer
|
||||
|
||||
@@ -32,7 +32,7 @@ export interface SCSportCoursePriceGroup extends SCAcademicPriceGroup {
|
||||
/**
|
||||
* Price for alumnis
|
||||
*/
|
||||
alumni: number;
|
||||
alumni?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
77
test/resources/DateSeries.3.json
Normal file
77
test/resources/DateSeries.3.json
Normal file
@@ -0,0 +1,77 @@
|
||||
{
|
||||
"errorNames": [],
|
||||
"instance": {
|
||||
"type": "date series",
|
||||
"uid": "540862f3-ea30-5b8f-8678-56b4dc217140",
|
||||
"name": "Dance course for beginners",
|
||||
"duration": "PT8H",
|
||||
"inPlace": {
|
||||
"geo": {
|
||||
"point": {
|
||||
"type": "Point",
|
||||
"coordinates": [
|
||||
13.3266207,
|
||||
52.5144409
|
||||
]
|
||||
}
|
||||
},
|
||||
"type": "room",
|
||||
"categories": [
|
||||
"student union"
|
||||
],
|
||||
"uid": "540862f3-ea30-5b8f-8678-56b4dc217140",
|
||||
"name": "EMH 225",
|
||||
"floor": "2",
|
||||
"origin": {
|
||||
"indexed": "2018-09-11T12:30:00Z",
|
||||
"name": "Dummy",
|
||||
"type": "remote"
|
||||
}
|
||||
},
|
||||
"frequency": "once",
|
||||
"dates": [
|
||||
"2016-04-12T11:00:00+00:00"
|
||||
],
|
||||
"event": {
|
||||
"type": "academic event",
|
||||
"uid": "540862f3-ea30-5b8f-8678-56b4dc217140",
|
||||
"name": "Dance course for beginners",
|
||||
"categories": [
|
||||
"special"
|
||||
],
|
||||
"origin": {
|
||||
"indexed": "2018-09-11T12:30:00Z",
|
||||
"name": "Dummy",
|
||||
"type": "remote"
|
||||
}
|
||||
},
|
||||
"origin": {
|
||||
"indexed": "2018-09-11T12:30:00Z",
|
||||
"name": "Dummy",
|
||||
"type": "remote"
|
||||
},
|
||||
"offers": [
|
||||
{
|
||||
"availability": "in stock",
|
||||
"availabilityStarts": "2017-01-30T00:00:00.000Z",
|
||||
"availabilityEnds": "2017-01-30T23:59:59.999Z",
|
||||
"prices": {
|
||||
"default": 6.5,
|
||||
"student": 5,
|
||||
"alumni": 5
|
||||
},
|
||||
"provider": {
|
||||
"name": "Studentenwerk",
|
||||
"origin": {
|
||||
"indexed": "2018-09-11T12:30:00Z",
|
||||
"name": "Dummy",
|
||||
"type": "remote"
|
||||
},
|
||||
"type": "organization",
|
||||
"uid": "3b9b3df6-3a7a-58cc-922f-c7335c002634"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"schema": "SCDateSeries"
|
||||
}
|
||||
@@ -21,10 +21,11 @@
|
||||
"availability": "in stock",
|
||||
"availabilityStarts": "2017-01-30T00:00:00.000Z",
|
||||
"availabilityEnds": "2017-01-30T23:59:59.999Z",
|
||||
"price": 2.85,
|
||||
"prices": {
|
||||
"default": 4.85,
|
||||
"student": 2.85,
|
||||
"employee": 2.85
|
||||
"employee": 3.85,
|
||||
"guest": 4.85
|
||||
},
|
||||
"provider": {
|
||||
"name": "Studentenwerk",
|
||||
|
||||
@@ -9,10 +9,10 @@
|
||||
],
|
||||
"offers": [
|
||||
{
|
||||
"price": 2.45,
|
||||
"prices": {
|
||||
"default": 3.45,
|
||||
"student": 2.45,
|
||||
"employee": 2.45
|
||||
"employee": 3.45
|
||||
},
|
||||
"provider": {
|
||||
"name": "Studentenwerk",
|
||||
|
||||
@@ -41,10 +41,10 @@
|
||||
}
|
||||
},
|
||||
"prices": {
|
||||
"default": 6.5,
|
||||
"student": 4.9,
|
||||
"employee": 6.5
|
||||
},
|
||||
"price": 6.5,
|
||||
"provider": {
|
||||
"name": "Studentenwerk",
|
||||
"origin": {
|
||||
|
||||
Reference in New Issue
Block a user