mirror of
https://gitlab.com/openstapps/openstapps.git
synced 2026-01-11 12:12:55 +00:00
Compare commits
14 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d2e0069dc2 | ||
|
|
9c6972af78 | ||
|
|
56b03aa0b9 | ||
|
|
b517837671 | ||
|
|
6f03ede8bf | ||
|
|
952207ace1 | ||
|
|
3d9d28c60c | ||
|
|
913c5691da | ||
|
|
03cdbc6f9b | ||
|
|
9f886a8968 | ||
|
|
e80afe2c93 | ||
|
|
6b10cc86d8 | ||
|
|
1aedd6332f | ||
|
|
790c8bbc3f |
21
CHANGELOG.md
21
CHANGELOG.md
@@ -1,3 +1,24 @@
|
|||||||
|
# [0.45.0](https://gitlab.com/openstapps/core/compare/v0.44.0...v0.45.0) (2021-04-26)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# [0.44.0](https://gitlab.com/openstapps/core/compare/v0.43.0...v0.44.0) (2021-04-12)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* add support for multiple values in the value filter ([913c569](https://gitlab.com/openstapps/core/commit/913c5691da46ad2591fe14bcf7286f12b29ab5ee))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# [0.43.0](https://gitlab.com/openstapps/core/compare/v0.42.0...v0.43.0) (2021-04-07)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# [0.42.0](https://gitlab.com/openstapps/core/compare/v0.41.0...v0.42.0) (2021-02-16)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# [0.41.0](https://gitlab.com/openstapps/core/compare/v0.40.0...v0.41.0) (2021-02-08)
|
# [0.41.0](https://gitlab.com/openstapps/core/compare/v0.40.0...v0.41.0) (2021-02-08)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
757
package-lock.json
generated
757
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
18
package.json
18
package.json
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@openstapps/core",
|
"name": "@openstapps/core",
|
||||||
"version": "0.42.0",
|
"version": "0.46.0",
|
||||||
"description": "StAppsCore - Generalized model of data",
|
"description": "StAppsCore - Generalized model of data",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"Model",
|
"Model",
|
||||||
@@ -43,28 +43,28 @@
|
|||||||
"Wieland Schöbl"
|
"Wieland Schöbl"
|
||||||
],
|
],
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@openstapps/core-tools": "0.17.0",
|
"@openstapps/core-tools": "0.19.0",
|
||||||
"@types/geojson": "1.0.6",
|
"@types/geojson": "1.0.6",
|
||||||
"@types/json-patch": "0.0.30",
|
"@types/json-patch": "0.0.30",
|
||||||
"@types/json-schema": "7.0.7",
|
"@types/json-schema": "7.0.7",
|
||||||
"@types/node": "10.17.44",
|
"@types/node": "14.14.37",
|
||||||
"fast-clone": "1.5.13",
|
"fast-clone": "1.5.13",
|
||||||
"fast-deep-equal": "3.1.3",
|
"fast-deep-equal": "3.1.3",
|
||||||
"http-status-codes": "2.1.4",
|
"http-status-codes": "2.1.4",
|
||||||
"json-patch": "0.7.0",
|
"json-patch": "0.7.0",
|
||||||
"json-schema": "0.2.5",
|
"json-schema": "0.3.0",
|
||||||
"ts-optchain": "0.1.8"
|
"ts-optchain": "0.1.8"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@openstapps/configuration": "0.25.0",
|
"@openstapps/configuration": "0.27.0",
|
||||||
"@openstapps/logger": "0.5.0",
|
"@openstapps/logger": "0.6.0",
|
||||||
"@testdeck/mocha": "0.1.2",
|
"@testdeck/mocha": "0.1.2",
|
||||||
"@types/chai": "4.2.15",
|
"@types/chai": "4.2.16",
|
||||||
"@types/rimraf": "3.0.0",
|
"@types/rimraf": "3.0.0",
|
||||||
"chai": "4.3.0",
|
"chai": "4.3.4",
|
||||||
"conditional-type-checks": "1.0.5",
|
"conditional-type-checks": "1.0.5",
|
||||||
"conventional-changelog-cli": "2.1.1",
|
"conventional-changelog-cli": "2.1.1",
|
||||||
"mocha": "8.3.0",
|
"mocha": "8.3.2",
|
||||||
"nyc": "15.1.0",
|
"nyc": "15.1.0",
|
||||||
"rimraf": "3.0.2",
|
"rimraf": "3.0.2",
|
||||||
"source-map-support": "0.5.19",
|
"source-map-support": "0.5.19",
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2019 StApps
|
* Copyright (C) 2019-2021 StApps
|
||||||
* This program is free software: you can redistribute it and/or modify it
|
* 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
|
* under the terms of the GNU General Public License as published by the Free
|
||||||
* Software Foundation, version 3.
|
* Software Foundation, version 3.
|
||||||
@@ -33,17 +33,17 @@ export interface SCSearchAvailabilityFilter extends SCSearchAbstractFilter<SCAva
|
|||||||
*/
|
*/
|
||||||
export interface SCAvailabilityFilterArguments extends SCSearchAbstractFilterArguments {
|
export interface SCAvailabilityFilterArguments extends SCSearchAbstractFilterArguments {
|
||||||
/**
|
/**
|
||||||
* Field which marks the start of the availability
|
* Field which marks availability range
|
||||||
*/
|
*/
|
||||||
fromField: SCThingsField;
|
field: SCThingsField;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Time to check. Defaults to 'now'
|
* If set, the provided time will apply to the full hour, day, week, etc.
|
||||||
*/
|
*/
|
||||||
time?: SCISO8601Date | 'now';
|
scope?: 's' | 'm' | 'H' | 'd' | 'w' | 'M' | 'y';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Field which marks the end of the availability
|
* Time to check. Defaults current time if not set
|
||||||
*/
|
*/
|
||||||
toField: SCThingsField;
|
time?: SCISO8601Date;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2020 StApps
|
* Copyright (C) 2020-2021 StApps
|
||||||
* This program is free software: you can redistribute it and/or modify it
|
* 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
|
* under the terms of the GNU General Public License as published by the Free
|
||||||
* Software Foundation, version 3.
|
* Software Foundation, version 3.
|
||||||
@@ -85,6 +85,15 @@ export interface SCRangeFilterArguments<T> extends SCSearchAbstractFilterArgumen
|
|||||||
* Field where the filter will be applied
|
* Field where the filter will be applied
|
||||||
*/
|
*/
|
||||||
field: SCThingsField;
|
field: SCThingsField;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Relation when searching on other range fields
|
||||||
|
*
|
||||||
|
* Intersects (Default): Both search and field range intersect
|
||||||
|
* Within: Search range is within the field range
|
||||||
|
* Contains: Search range contains the field range
|
||||||
|
*/
|
||||||
|
relation?: 'intersects' | 'within' | 'contains';
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface Bounds<T> {
|
export interface Bounds<T> {
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ export interface SCValueFilterArguments extends SCSearchAbstractFilterArguments
|
|||||||
field: SCThingsField;
|
field: SCThingsField;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Value to filter. Value has to match the field exactly.
|
* Value to filter. One or more values has to match the field exactly.
|
||||||
*/
|
*/
|
||||||
value: string;
|
value: string | string[];
|
||||||
}
|
}
|
||||||
|
|||||||
64
src/things/abstract/range.ts
Normal file
64
src/things/abstract/range.ts
Normal file
@@ -0,0 +1,64 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2021 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.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||||
|
* more details.
|
||||||
|
*
|
||||||
|
* 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 {SCISO8601Date} from '../../general/time';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Date Range
|
||||||
|
*
|
||||||
|
* CAUTION: Changing the name requires changes in the core-tools premaps
|
||||||
|
*/
|
||||||
|
export type SCISO8601DateRange = SCRange<SCISO8601Date>;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Generic range type
|
||||||
|
*/
|
||||||
|
export type SCRange<T> = {
|
||||||
|
/**
|
||||||
|
* Greater than value
|
||||||
|
*/
|
||||||
|
gt?: never;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Greater or equal to value
|
||||||
|
*/
|
||||||
|
gte?: T;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Greater than value
|
||||||
|
*/
|
||||||
|
lt?: never;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Greater or equal to value
|
||||||
|
*/
|
||||||
|
lte?: T;
|
||||||
|
} | {
|
||||||
|
// tslint:disable:completed-docs
|
||||||
|
gt?: T;
|
||||||
|
gte?: never;
|
||||||
|
lt?: T;
|
||||||
|
lte?: never;
|
||||||
|
} | {
|
||||||
|
gt?: T;
|
||||||
|
gte?: never;
|
||||||
|
lt?: never;
|
||||||
|
lte?: T;
|
||||||
|
} | {
|
||||||
|
gt?: never;
|
||||||
|
gte?: T;
|
||||||
|
lt?: T;
|
||||||
|
lte?: never;
|
||||||
|
// tslint:enable:completed-docs
|
||||||
|
};
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2019 StApps
|
* Copyright (C) 2019-2021 StApps
|
||||||
* This program is free software: you can redistribute it and/or modify it
|
* 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
|
* under the terms of the GNU General Public License as published by the Free
|
||||||
* Software Foundation, version 3.
|
* Software Foundation, version 3.
|
||||||
@@ -13,10 +13,10 @@
|
|||||||
* this program. If not, see <https://www.gnu.org/licenses/>.
|
* this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
import {SCMetaTranslations, SCTranslations} from '../../general/i18n';
|
import {SCMetaTranslations, SCTranslations} from '../../general/i18n';
|
||||||
import {SCISO8601Date} from '../../general/time';
|
|
||||||
import {SCOrganizationWithoutReferences} from '../organization';
|
import {SCOrganizationWithoutReferences} from '../organization';
|
||||||
import {SCPersonWithoutReferences} from '../person';
|
import {SCPersonWithoutReferences} from '../person';
|
||||||
import {SCInPlace} from './place';
|
import {SCInPlace} from './place';
|
||||||
|
import {SCISO8601DateRange} from './range';
|
||||||
import {SCThing, SCThingMeta, SCThingTranslatableProperties, SCThingWithoutReferences} from './thing';
|
import {SCThing, SCThingMeta, SCThingTranslatableProperties, SCThingWithoutReferences} from './thing';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -100,14 +100,9 @@ export interface SCThingThatCanBeOfferedOffer<T extends SCPriceGroup>
|
|||||||
availability: SCThingThatCanBeOfferedAvailability;
|
availability: SCThingThatCanBeOfferedAvailability;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The time when the thing becomes unavailable as an SCISO8601Date formatted string.
|
* The time when the thing is available.
|
||||||
*/
|
*/
|
||||||
availabilityEnds?: SCISO8601Date;
|
availabilityRange?: SCISO8601DateRange;
|
||||||
|
|
||||||
/**
|
|
||||||
* The time when the thing becomes available as an SCISO8601Date formatted string.
|
|
||||||
*/
|
|
||||||
availabilityStarts?: SCISO8601Date;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* List of prices that are distinct for specific groups
|
* List of prices that are distinct for specific groups
|
||||||
|
|||||||
@@ -33,6 +33,7 @@ export interface SCCatalogWithoutReferences
|
|||||||
*
|
*
|
||||||
* Needed for keeping order in catalog inheritance array.
|
* Needed for keeping order in catalog inheritance array.
|
||||||
*
|
*
|
||||||
|
* @filterable
|
||||||
* @integer
|
* @integer
|
||||||
*/
|
*/
|
||||||
level: number;
|
level: number;
|
||||||
|
|||||||
@@ -43,8 +43,10 @@
|
|||||||
"offers": [
|
"offers": [
|
||||||
{
|
{
|
||||||
"availability": "in stock",
|
"availability": "in stock",
|
||||||
"availabilityStarts": "2017-01-30T00:00:00.000Z",
|
"availabilityRange": {
|
||||||
"availabilityEnds": "2017-01-30T23:59:59.999Z",
|
"gte": "2017-01-30T00:00:00.000Z",
|
||||||
|
"lte": "2017-01-30T23:59:59.999Z"
|
||||||
|
},
|
||||||
"prices": {
|
"prices": {
|
||||||
"default": 6.5,
|
"default": 6.5,
|
||||||
"student": 5,
|
"student": 5,
|
||||||
|
|||||||
@@ -19,8 +19,10 @@
|
|||||||
"offers": [
|
"offers": [
|
||||||
{
|
{
|
||||||
"availability": "in stock",
|
"availability": "in stock",
|
||||||
"availabilityStarts": "2017-01-30T00:00:00.000Z",
|
"availabilityRange": {
|
||||||
"availabilityEnds": "2017-01-30T23:59:59.999Z",
|
"gte": "2017-01-30T00:00:00.000Z",
|
||||||
|
"lte": "2017-01-30T23:59:59.999Z"
|
||||||
|
},
|
||||||
"prices": {
|
"prices": {
|
||||||
"default": 4.85,
|
"default": 4.85,
|
||||||
"student": 2.85,
|
"student": 2.85,
|
||||||
|
|||||||
@@ -20,8 +20,10 @@
|
|||||||
"uid": "3b9b3df6-3a7a-58cc-922f-c7335c002634"
|
"uid": "3b9b3df6-3a7a-58cc-922f-c7335c002634"
|
||||||
},
|
},
|
||||||
"availability": "in stock",
|
"availability": "in stock",
|
||||||
"availabilityStarts": "2017-01-30T00:00:00.000Z",
|
"availabilityRange": {
|
||||||
"availabilityEnds": "2017-01-30T23:59:59.999Z",
|
"gte": "2017-01-30T00:00:00.000Z",
|
||||||
|
"lte": "2017-01-30T23:59:59.999Z"
|
||||||
|
},
|
||||||
"inPlace": {
|
"inPlace": {
|
||||||
"geo": {
|
"geo": {
|
||||||
"point": {
|
"point": {
|
||||||
|
|||||||
@@ -11,9 +11,11 @@
|
|||||||
],
|
],
|
||||||
"offers": [
|
"offers": [
|
||||||
{
|
{
|
||||||
"availabilityEnds": "2017-03-27T23:59:59.000Z",
|
|
||||||
"availabilityStarts": "2017-03-27T00:00:00.000Z",
|
|
||||||
"availability": "in stock",
|
"availability": "in stock",
|
||||||
|
"availabilityRange": {
|
||||||
|
"gte": "2017-03-27T00:00:00.000Z",
|
||||||
|
"lte": "2017-03-27T23:59:59.000Z"
|
||||||
|
},
|
||||||
"inPlace": {
|
"inPlace": {
|
||||||
"type": "room",
|
"type": "room",
|
||||||
"name": "Cafeteria LEVEL",
|
"name": "Cafeteria LEVEL",
|
||||||
|
|||||||
@@ -22,8 +22,8 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"arguments": {
|
"arguments": {
|
||||||
"fromField": "availabilityStarts",
|
"scope": "d",
|
||||||
"toField": "availabilityEnds",
|
"field": "availabilityRange",
|
||||||
"time": "2018-01-15T04:13:00+00:00"
|
"time": "2018-01-15T04:13:00+00:00"
|
||||||
},
|
},
|
||||||
"type": "availability"
|
"type": "availability"
|
||||||
|
|||||||
Reference in New Issue
Block a user