Data models - WApp-Solutions/team-manager GitHub Wiki

Here we want to describe the needed data models:

Entities

  • member (as base entity)
  • refereeMember (extends member)
  • firefighterMember (extends member)
  • groups
  • event
  • user (for authentication and authorization)

ENUMs

  • gender ENUM
  • clothingSizes ENUM
  • clothingSizeMeasures ENUM

Further techniques

  • audit-log / metadata

member

The member entity represents a real person and is a unique dataset. For different purposes we'll have to create a basic data model for members and the possibility to enhance further attributes for special use-cases and scenarios. For example when using the solution in different contexts e.g. for soccer, choir or fire departments.

  • id: String (unique, can be generated from firebase while pushing a new dataset)
  • name: String
  • firstname: String
  • birthdate: String
  • gender: ENUM
  • street: String
  • city: String
  • mobile: String
  • phone: String
  • mail: String
  • active: Boolean
  • pictureUrl: String
  • telegramId: String/number
  • userId: String (user-id will be the unique id generated from firebase authentication)
  • metadata: ENUM

gender ENUM

  • male: string
  • female: string
  • neutral: string

Validations for member

Todo: Further clarification is needed which fields/attributes are needed to be validated in the solution for consistency.

  • birthdate: ISO Date String, Format: 2021-02-05T12:34:56
  • mail: is a valid mail-address with @sign and domain ending ([email protected])

refereeMember (extends member)

  • league: string
  • club: string
  • region: string

firefighterMember (extends member)

  • rank: string
  • clothingSizes: ENUM
  • documents: Map
  • driversLicense: driversLicense
  • membership: membership
  • promotions: Map
  • functions: Map
  • trainings: Map
  • respiratory: Map

clothingSizes ENUM

  • gloves: number
  • shirt: clothingSizeMeasures ENUM
  • shoes: number
  • trousers: number

clothingSizeMeasures ENUM

  • XXS: string
  • XS: string
  • S: string
  • M: string
  • L: string
  • XL: string
  • XXL: string
  • XXXL: string

driversLicense

  • classB: boolean
  • classC: boolean
  • classFire: boolean // special class for fire dept. vehicles until 7,49t
  • lastCheck: string

membership

  • entryDate: string
  • currentMembership: currentMembership ENUM
  • activeEntryDate: string (can be empty)
  • activeLeftDate: string (can be empty)
  • bambiniEntryDate: string (can be empty)
  • bambiniLeftDate: string (can be empty)
  • youthEntryDate: string (can be empty)
  • youthLeftDate: string (can be empty)

currentMembership ENUM

  • active: string
  • bambini: string
  • youth: string

promotion

  • date: string
  • rank: rank ENUM

rank ENUM (tbd. will vary in each state; tbd. cover all genders)

  • BAMBINIMITGLIED: string
  • JUGENDFEUERWEHRMITGLIED: string
  • FEUERWEHRMANNANWAERTER: string
  • FEUERWEHRMANN: string
  • OBERFEUERWEHRMANN: string
  • HAUPTFEUERWEHRMANN: string
  • LOESCHMEISTER: string
  • OBERLOESCHMEISTER: string
  • HAUPTLOESCHMEISTER: string
  • BRANDMEISTER: string
  • OBERBRANDMEISTER: string
  • HAUPTBRANDMEISTER: string

function

  • date: string
  • title: string
  • end: string

training

  • begin: string
  • end: string
  • duration: number
  • documentUrl: string
  • location: string
  • title: string || trainingTitleKey
  • customTitle: true (title provided by user, not a known training from a list)
  • success: boolean (default: true)

respiratoryActivities

  • type: respiratoryActivityType ENUM
  • successful: boolean
  • date: string
  • expiryDate: string
  • remarks: string
  • roentgen: boolean
  • age: number
  • location: string
  • responsible: string
  • csa: boolean
  • operationType: operationType ENUM

respiratoryActivityType ENUM

  • G26.3 Untersuchung
  • Atemschutzübungsstrecke
  • Einsatzmäßige Bedingungen

operationType ENUM

  • BRAND: string
  • GEFAEHRLICHE_GUETER: string

groups

Groups are representing a collection of members which can be grouped together and be assigned to an event. Groups can organize various constellations of members to manage them collectively.

  • id: String (unique, can be generated from firebase while pushing a new dataset)
  • name: String
  • description: String
  • members: Map
  • owner/administrators: Map (owners or administrators - terminology tbd - also have to be part of members)
  • metadata: ENUM

members and administrators

  • members: key-value pairs key: memberId, value: true

event

An event can be anything that happens on a given date and has a defined start- and configurable end-date. For a simplified handling of people assignments to an event, groups can be added to it. The members will implicitly be added to the event as they are part of the groups.

  • id: String (unique, can be generated from firebase while pushing a new dataset)
  • title: String
  • description: String
  • begin: String
  • end: String
  • groups: Map
  • host: String
  • metadata: ENUM

metadata ENUM

For better auditing and transparency some metadata will be added to the entities to keep track of the following information.

  • createdAt: String
  • createdBy: String
  • updatedAt: String
  • updatedBy: String
⚠️ **GitHub.com Fallback** ⚠️