feat: add certification thing

This commit is contained in:
Thea Schöbl
2023-05-15 13:38:11 +00:00
parent b21dc75964
commit fd63fb764f
68 changed files with 6776 additions and 24439 deletions

View File

@@ -6,7 +6,7 @@ Please see the appropriate general group contributing guides in [project-managem
Following semantic versioning patches to the core should not break existing usage.
### API
### API
Every minor and major version of the core needs a corresponding version of the [API](https://openstapps.gitlab.io/api) to be used in the app and connectors.
@@ -33,15 +33,17 @@ App and connectors should be updated regularly to new releases of the core but n
Adding new types requires changes at multiple locations for it to work correctly
### Required changes
* Add your SCThing and SCThingWithoutReferences to `src/things/your-thing-name.ts` and make them extend `SCThingWithoutReferences` and `SCThing` respectively
* Add your SCThingMeta to `src/things/your-thing-name.ts` and make it extend `SCThingMeta`
* Add your SCThingMeta to `SCClasses` in `src/meta.ts`
* Add your SCThing to `SCThingsWithoutDiff` in `src/meta.ts`
* Add your SCThingWithoutReferences to `SCAssociatedThingWithoutReferences` in `src/meta.ts`
* Add your SCThing to `SCAssociatedThing` in `src/meta.ts`
* Add your SCThing to the `SCThingType` enum in `src/things/abstract/thing.ts`
* Add an example file for your SCThing in `test/resources/YourThingName.json`
* Add the following lines for your SCThing in `test/type.spec.ts`:
- Add your SCThing and SCThingWithoutReferences to `src/things/your-thing-name.ts` and make them extend `SCThingWithoutReferences` and `SCThing` respectively
- Add your SCThingMeta to `src/things/your-thing-name.ts` and make it extend `SCThingMeta`
- Add your SCThingMeta to `SCClasses` in `src/meta.ts`
- Add your SCThing to `SCThingsWithoutDiff` in `src/meta.ts`
- Add your SCThingWithoutReferences to `SCAssociatedThingWithoutReferences` in `src/meta.ts`
- Add your SCThing to `SCAssociatedThing` in `src/meta.ts`
- Add your SCThing to the `SCThingType` enum in `src/things/abstract/thing.ts`
- Add an example file for your SCThing in `test/resources/YourThingName.json`
- Add the following lines for your SCThing in `test/type.spec.ts`:
```typescript
/**
* Types of properties of SCYourThingName
@@ -57,9 +59,9 @@ assert<Extends<SCYourThingName, SCThing>>(true);
## Additional coding style
### Extract inline type definitions
### Extract inline type definitions
For consistency and correct functionality of `core-tools` we need well-defined type assignments.
For consistency and correct functionality of `core-tools` we need well-defined type assignments.
Type assignments shall always be primitive types, classes, interfaces, enums or unions. Not allowed are inline type-definitions. Those shall be refactored accordingly:
@@ -83,16 +85,16 @@ If you come around a map-like-type use `SCMap<T>`.
```typescript
// Use this:
interface AnyClass{
inventory: SCMap<number>;
interface AnyClass {
inventory: SCMap<number>;
}
// Instead of:
interface AnyClass{
inventory?: Array<{ key: string, value: number }>;
interface AnyClass {
inventory?: Array<{key: string; value: number}>;
}
// or instead of
interface AnyClass{
inventory?: { [key: string]: number };
interface AnyClass {
inventory?: {[key: string]: number};
}
```
```