|
@@ -29,15 +29,13 @@ export interface MessageSchemaService extends CRUD {
|
|
|
/* collection of method signatures*/
|
|
|
}
|
|
|
|
|
|
-export interface MessageSchemaDataModel {
|
|
|
- schemaId: string // identifier
|
|
|
- schemaName: string // unique legible name
|
|
|
- schemaDef: string // jason description of schema
|
|
|
- schemaType: messageSchemaType // one of selection
|
|
|
- isConcrete: boolean // whether is consumable message
|
|
|
+export class MessageSchemaDataModel {
|
|
|
+ schemaId!: string // identifier
|
|
|
+ schemaName!: string // unique legible name
|
|
|
+ schemaDef!: string // jason description of schema
|
|
|
+ schemaType!: messageSchemaType // one of selection
|
|
|
}
|
|
|
|
|
|
-
|
|
|
export interface MessageSchema {
|
|
|
/* Descsription steriotype for all Fis messages.
|
|
|
Has reference to message schema described as interfaces.
|
|
@@ -51,47 +49,64 @@ export interface MessageSchema {
|
|
|
messageSchemaService: MessageSchemaService
|
|
|
}
|
|
|
|
|
|
-export interface MessageSchemaCompositeAssociation {
|
|
|
-/* Associated nodes of a composite schema.
|
|
|
- Note association is one directional */
|
|
|
- compositeMessageSchema: MessageSchema
|
|
|
- compositeEntries: Array <MessageSchema>[]
|
|
|
- /* associated to schema */
|
|
|
-}
|
|
|
+export class MessageSchemaCompositeAssociation {
|
|
|
+/* Associated nodes of a composite schema.*/
|
|
|
+ messageSchema: MessageSchema
|
|
|
+ compositeEntries: Array <MessageSchema>[]
|
|
|
|
|
|
+ constructor (messageSchema: MessageSchema, compositeEntries: Array <MessageSchema>[]) {
|
|
|
+ this.messageSchema = messageSchema
|
|
|
+ this.compositeEntries = compositeEntries
|
|
|
+ }
|
|
|
+
|
|
|
+ /* validate:
|
|
|
+ - Note association is one directional
|
|
|
+ - duplicate association not allowed
|
|
|
+ - messageSchema is the container of composite entries */
|
|
|
+}
|
|
|
+
|
|
|
+/* ======= the following section to be filed as:
|
|
|
+ src/common/grouping/ ============ */
|
|
|
+
|
|
|
+export class GroupDataModel {
|
|
|
+/* Grouping of any entity. */
|
|
|
+ groupId! : string // unique value
|
|
|
+ groupName! : string // unique value
|
|
|
+ groupShortName! : string // can be duplicated
|
|
|
+}
|
|
|
+
|
|
|
+export class GroupChildDataModel {
|
|
|
+ childrenList! : Array<GroupDataModel>[]
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+export class MessageSchemaGrouping {}
|
|
|
+
|
|
|
export class MessageSchemaImpl implements MessageSchema {
|
|
|
|
|
|
messageSchemaDataModel: MessageSchemaDataModel
|
|
|
+ messageSchemaService: MessageSchemaService
|
|
|
|
|
|
- constructor (messageSchemaDataModel: MessageSchemaDataModel) {
|
|
|
+ constructor (messageSchemaDataModel: MessageSchemaDataModel,
|
|
|
+ messageSchemaService: MessageSchemaService
|
|
|
+ ) {
|
|
|
this.messageSchemaDataModel = messageSchemaDataModel
|
|
|
+ this.messageSchemaService = messageSchemaService
|
|
|
}
|
|
|
- /* validation:
|
|
|
+ /* base validation:
|
|
|
- if schemaId is not provided by creator, then self generate
|
|
|
- schemaDef should be a valid schema (call api to check)
|
|
|
- value changed should emit value changed event to be
|
|
|
- handled by for example version logging
|
|
|
- */
|
|
|
-}
|
|
|
-
|
|
|
-export class MessageSchemaElement extends MessageSchemaImpl {
|
|
|
-/* fundamental unit of a schema by which composite schema is constructed */
|
|
|
-
|
|
|
- messageSchemaElementDataModel: MessageSchemaDataModel
|
|
|
|
|
|
- constructor (messageSchemaElementDataModel: MessageSchemaDataModel) {
|
|
|
- super (messageSchemaElementDataModel)
|
|
|
- this.messageSchemaElementDataModel = messageSchemaElementDataModel
|
|
|
- }
|
|
|
-
|
|
|
- /* validation:
|
|
|
+ element validation:
|
|
|
- schema definition should not contain other schema
|
|
|
- -
|
|
|
*/
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
+
|
|
|
/* this section of the code to be saved in file
|
|
|
src/common/services/ */
|
|
|
|
|
@@ -103,7 +118,26 @@ export interface CRUD {
|
|
|
delete<T>(): null
|
|
|
}
|
|
|
|
|
|
-
|
|
|
+/* this section to be saved to src/common/exceptions/ */
|
|
|
+type ErrorSeverity = "RECOVERABLE" | "IRRECOVERABLE"
|
|
|
+
|
|
|
+export class FisErrorDataModel {
|
|
|
+ errorSeverity! : "RECOVERABLE" | "IRRECOVERABLE"
|
|
|
+ errorMessage! : string
|
|
|
+ errorSourceId! : string
|
|
|
+ errorSource! : string
|
|
|
+}
|
|
|
+
|
|
|
+export class FisError extends Error {
|
|
|
+/* extend error class to track error details */
|
|
|
+
|
|
|
+ errorDataModel : FisErrorDataModel
|
|
|
+ constructor (errorDataModel : FisErrorDataModel) {
|
|
|
+ super()
|
|
|
+ this.errorDataModel = errorDataModel}
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
|
|
|
export interface ActorCommands {
|
|
|
/* base actor commands*/
|