Verbrauchsausweis Gewerbe

This commit is contained in:
Moritz Utcke
2025-02-02 20:43:45 +07:00
parent 51fb7ad9b6
commit 02b15d85c0
8 changed files with 2984 additions and 27 deletions

View File

@@ -3,6 +3,7 @@ import {
Aufnahme,
BedarfsausweisWohnen,
Benutzer,
Enums,
GebaeudeBilder,
Objekt,
Rechnung,
@@ -120,4 +121,22 @@ export const UUidWithPrefix = z.string().refine((value) => {
}
return false;
})
})
export function getAusweisartFromUUID(uid: string): Enums.Ausweisart | null {
if (!UUidWithPrefix.safeParse(uid).success) {
return null
}
if (uid.startsWith("vaw")) {
return Enums.Ausweisart.VerbrauchsausweisWohnen
} else if (uid.startsWith("vag")) {
return Enums.Ausweisart.VerbrauchsausweisGewerbe
} else if (uid.startsWith("baw")) {
return Enums.Ausweisart.BedarfsausweisWohnen
} else if (uid.startsWith("bag")) {
return Enums.Ausweisart.BedarfsausweisGewerbe
}
return null;
}