convert to and from database type (#1410)

* create db event type

* dont use it yet

* convert to and from database type

* type needed in one place in client

* use flatMap to filter out unknow stuff

* leave revision in save file

* move to utils

* make test

* destructur entry

* simple test

* throw in rundownToDatabaseRundown

* clerify comment

* Refactor: avoid shadowing the rundown variable in rundownCache (#1409)


---------

Co-authored-by: Carlos Valente <34649812+cpvalente@users.noreply.github.com>

* rename to DAO

* add simple edit test

* only the generate function clears the state state

* strict guard for custom fields

* fix small strict issues

* ensure deep copy

* safely set isStale

* todo is done

* small type error

* these functions can work on DAO entries

* only reat rundown as DAO on initial load and the cast immediately and esure all fields are present

* eslint comment

Co-authored-by: Carlos Valente <34649812+cpvalente@users.noreply.github.com>

* fix spelling

Co-authored-by: Carlos Valente <34649812+cpvalente@users.noreply.github.com>

* fix spelling

Co-authored-by: Carlos Valente <34649812+cpvalente@users.noreply.github.com>

* comment not needed

* setIsStale

* remove DAO

* clean up commits

* remove unneeded async/await

* revert test

---------

Co-authored-by: Carlos Valente <34649812+cpvalente@users.noreply.github.com>
This commit is contained in:
Alex Christoffer Rasmussen
2025-01-05 14:35:58 +01:00
committed by GitHub
parent 1b62ed5f2d
commit 533f9798e8
12 changed files with 195 additions and 130 deletions
+14
View File
@@ -20,6 +20,7 @@ export const demoDb: DatabaseModel = {
skip: false,
colour: '',
revision: 0,
delay: 0,
timeWarning: 500000,
timeDanger: 100000,
custom: {
@@ -45,6 +46,7 @@ export const demoDb: DatabaseModel = {
skip: false,
colour: '',
revision: 0,
delay: 0,
timeWarning: 500000,
timeDanger: 100000,
custom: {
@@ -70,6 +72,7 @@ export const demoDb: DatabaseModel = {
skip: false,
colour: '',
revision: 0,
delay: 0,
timeWarning: 500000,
timeDanger: 100000,
custom: {
@@ -95,6 +98,7 @@ export const demoDb: DatabaseModel = {
skip: false,
colour: '',
revision: 0,
delay: 0,
timeWarning: 500000,
timeDanger: 100000,
custom: {
@@ -120,6 +124,7 @@ export const demoDb: DatabaseModel = {
skip: false,
colour: '',
revision: 0,
delay: 0,
timeWarning: 500000,
timeDanger: 100000,
custom: {
@@ -150,6 +155,7 @@ export const demoDb: DatabaseModel = {
skip: false,
colour: '',
revision: 0,
delay: 0,
timeWarning: 500000,
timeDanger: 100000,
custom: {
@@ -175,6 +181,7 @@ export const demoDb: DatabaseModel = {
skip: false,
colour: '',
revision: 0,
delay: 0,
timeWarning: 500000,
timeDanger: 100000,
custom: {
@@ -200,6 +207,7 @@ export const demoDb: DatabaseModel = {
skip: false,
colour: '',
revision: 0,
delay: 0,
timeWarning: 500000,
timeDanger: 100000,
custom: {
@@ -225,6 +233,7 @@ export const demoDb: DatabaseModel = {
skip: false,
colour: '',
revision: 0,
delay: 0,
timeWarning: 500000,
timeDanger: 100000,
custom: {
@@ -250,6 +259,7 @@ export const demoDb: DatabaseModel = {
skip: false,
colour: '',
revision: 0,
delay: 0,
timeWarning: 500000,
timeDanger: 100000,
custom: {
@@ -280,6 +290,7 @@ export const demoDb: DatabaseModel = {
skip: false,
colour: '',
revision: 0,
delay: 0,
timeWarning: 500000,
timeDanger: 100000,
custom: {
@@ -305,6 +316,7 @@ export const demoDb: DatabaseModel = {
skip: false,
colour: '',
revision: 0,
delay: 0,
timeWarning: 500000,
timeDanger: 100000,
custom: {
@@ -330,6 +342,7 @@ export const demoDb: DatabaseModel = {
skip: false,
colour: '',
revision: 0,
delay: 0,
timeWarning: 500000,
timeDanger: 100000,
custom: {
@@ -355,6 +368,7 @@ export const demoDb: DatabaseModel = {
skip: false,
colour: '',
revision: 0,
delay: 0,
timeWarning: 500000,
timeDanger: 100000,
custom: {