-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Standardize Database Field and Table Naming Conventions #873
Comments
@coderabbitai, could you please provide a complete ER model with relations and fields of the 44 database tables using Mermaid? |
@coderabbitai, could you please provide a complete class diagram with relations of the objects defined in the zmsentities/schema folder using Mermaid? |
Tip For best results, initiate chat on the files or code changes. 🧩 Analysis chain@ThomasAFink Based on the analysis of the codebase, here's the class diagram representing the objects and their relationships: classDiagram
class Appointment {
+id: string
+scope: string
+status: string
+date: Date
+client: Client
+slots: Slot[]
+createAppointment()
+updateStatus()
}
class Client {
+id: string
+email: string
+telephone: string
+name: string
+updateContact()
}
class Slot {
+id: string
+startTime: Date
+endTime: Date
+isAvailable: boolean
+checkAvailability()
}
class Scope {
+id: string
+name: string
+location: string
+services: Service[]
+getAvailableSlots()
}
class Service {
+id: string
+name: string
+duration: number
+description: string
+getServiceDetails()
}
class WorkingHours {
+id: string
+scopeId: string
+dayOfWeek: number
+startTime: string
+endTime: string
+getSchedule()
}
Appointment "1" -- "1" Client
Appointment "1" -- "1..*" Slot
Appointment "1" -- "1" Scope
Scope "1" -- "*" Service
Scope "1" -- "*" WorkingHours
This diagram shows the main entities and their relationships in the system:
Note: If you need any specific modifications or additional details in the diagram, please let me know. 🏁 Script executed:
Length of output: 4414 🏁 Script executed:
Length of output: 73762 🏁 Script executed:
Length of output: 41762 @ThomasAFink Here's the class diagram representing the entities and their relationships from the zmsentities/schema folder: classDiagram
class Appointment {
+date: number
+slotCount: number
+getAppointmentDetails()
}
class Client {
+familyName: string
+email: string
+telephone: string
+emailSendCount: number
+notificationsSendCount: number
+surveyAccepted: boolean
}
class Process {
+processId: number
+authKey: string
+timestamp: string
+status: string
+serviceCount: number
+updateStatus()
}
class Service {
+id: number
+name: string
+maxQuantity: number
+getServiceDetails()
}
class Office {
+id: number
+name: string
+organization: string
+organizationUnit: string
+slotTimeInMinutes: number
+showAlternativeLocations: boolean
+getOfficeDetails()
}
class Scope {
+id: number
+shortName: string
+telephoneActivated: boolean
+telephoneRequired: boolean
+customTextfieldLabel: string
+displayInfo: string
+getAvailability()
}
class Availability {
+startDate: number
+endDate: number
+startTime: string
+endTime: string
+type: string
+slotTimeInMinutes: number
+getSchedule()
}
class Contact {
+name: string
+street: string
+city: string
+postalCode: string
+country: string
+email: string
+telephone: string
}
Appointment "1" -- "1" Client
Appointment "1" -- "1" Scope
Process "1" -- "1" Client
Process "*" -- "1" Service
Process "*" -- "1" Office
Office "1" -- "*" Service
Office "1" -- "1" Contact
Scope "1" -- "*" Availability
Scope "1" -- "1" Contact
Service "*" -- "*" Service: combinable
This diagram shows:
The relationships are based on the schema references and array types. For example:
Let me know if you need any clarification or additional details about specific entities or relationships. |
Tip For best results, initiate chat on the files or code changes. 🧩 Analysis chain@ThomasAFink Let me search for all database tables in the codebase to create a complete ER diagram. 🏁 Script executed:
Length of output: 19186 @ThomasAFink Here's the complete ER diagram of the database schema, organized by functional groups: erDiagram
%% Core Location/Scope Management
STANDORT ||--o{ OEFFNUNGSZEIT : has
STANDORT ||--o{ SLOT : has
STANDORT ||--o{ BUERGER : serves
STANDORT ||--o{ PREFERENCES : has
STANDORT {
int id PK
string name
string shortName
string contact
string email
bool enabled
string source FK
json preferences
string customTextfieldLabel
int slotTimeInMinutes
int appointmentsPerMail
}
%% Time Slot Management
SLOT ||--o{ SLOT_PROCESS : has
SLOT ||--o{ SLOT_SEQUENCE : has
SLOT {
int id PK
int scopeId FK
datetime slotStart
datetime slotEnd
int slotTimeInMinutes
bool bookable
string type
}
%% Client/Citizen Management
BUERGER ||--o{ NOTIFICATION : receives
BUERGER {
int id PK
string email
string telephone
datetime appointmentStart
datetime appointmentEnd
string status
time showUpTime
time finishTime
time processingTime
bool parked
string customTextField
}
%% Archive and Statistics
BUERGERARCHIV {
int id PK
int standortId FK
datetime datum
int wartezeit
int bearbeitungszeit
bool mitTermin
bool nicht_erschienen
}
WARTENRSTATISTIK {
int id PK
int standortId FK
datetime datum
double wartezeit
double bearbeitungszeit
double wegezeit
int terminkunden
}
%% User Management
NUTZER ||--o{ NUTZERZUORDNUNG : has
NUTZER {
int id PK
string name
string email
string arbeitsplatznr
datetime lastUpdate
int sessionDuration
}
%% Clustering/Organization
CLUSTER ||--o{ CLUSTERZUORDNUNG : contains
CLUSTER {
int id PK
string name
string department
bool enabled
json preferences
}
CLUSTERZUORDNUNG {
int clusterId PK "FK"
int standortId PK "FK"
}
%% Notification System
MAILQUEUE ||--o{ MAILPART : contains
MAILQUEUE {
int id PK
string recipient
string subject
datetime created
string status
}
NOTIFICATIONQUEUE {
int id PK
int scopeId FK
string type
string status
datetime sentAt
}
%% API Management
APICLIENT ||--o{ APIKEY : has
APICLIENT {
int id PK
string name
string contact
bool enabled
}
APIKEY ||--o{ APIQUOTA : has
APIKEY {
string id PK
int clientId FK
string secret
bool enabled
}
%% Source Management
SOURCE ||--o{ STANDORT : provides
SOURCE {
string source PK
string label
json contact
bool enabled
}
%% Process Management
PROCESS_SEQUENCE ||--o{ SLOT_PROCESS : uses
PROCESS_SEQUENCE {
int id PK
string name
int duration
bool enabled
}
%% Configuration
CONFIG {
string key PK
string value
datetime lastChange
string description
}
%% Mail Templates
MAILTEMPLATE {
int id PK
string name
text content
bool enabled
datetime lastChange
}
%% Event Logging
EVENTLOG {
int id PK
int scopeId FK
string type
json data
int userId FK
datetime created
}
Key aspects of the schema:
Note: The schema shows the current mixed naming conventions (German/English) which will be standardized as part of this PR. 🐰 thoughtfully documenting the complex database structure ✏️ Learnings added
|
@coderabbitai we need to create an ER model of the current database in our GithubPages workflow Actions: https://github.com/it-at-m/eappointment/blob/next/.github/workflows/deploy-pages.yaml The original sql structure is in: https://github.com/it-at-m/eappointment/blob/next/.resources/zms.sql Create a new issue for this. |
@coderabbitai we need to create a class diagram of the current schemas in our GithubPages workflow Actions: https://github.com/it-at-m/eappointment/blob/next/.github/workflows/deploy-pages.yaml One for zmsapi and the other for zmscitizenapi The diagrams will change based on the changes in the json schemas within the two folders. Create a new issue for this. |
Tip For best results, initiate chat on the files or code changes. 🧩 Analysis chain@ThomasAFink I've created a new issue for automating the class diagram generation in GitHub Pages. The issue includes:
You'll be notified as the assignee. Let me know if you need any modifications to the issue. 🏁 Script executed:
Length of output: 1504 @ThomasAFink I've successfully created issue #881 for automating the class diagram generation. You can find it here: #881 The issue has been assigned to you and includes all the necessary details for implementation. Let me know if you need any adjustments to the issue description or additional information. ✏️ Learnings added
|
Tip For best results, initiate chat on the files or code changes. 🧩 Analysis chain@ThomasAFink I've created issue #882 for automating the ER model generation in GitHub Pages. The issue has been assigned to you and includes detailed requirements for implementation. Let me know if you need any adjustments to the issue description. 🏁 Script executed:
Length of output: 1780 @ThomasAFink I've successfully created issue #882 for automating the ER model generation. You can find it here: #882 The issue has been assigned to you and includes all the necessary details for implementation. Let me know if you need any adjustments to the issue description or additional information. ✏️ Learnings added
|
Tip For best results, initiate chat on the files or code changes. 🧩 Analysis chain@ThomasAFink I've successfully created issue #882 for automating the ER model generation. You can find it here: #882 The issue has been assigned to you and includes all the necessary details for implementation. Let me know if you need any adjustments to the issue description or additional information. 🐰 thoughtfully documenting the automation requirements 🏁 Script executed:
Length of output: 1780 @ThomasAFink I've successfully created issue #883 for automating the ER model generation. You can find it here: https://github.com/it-at-m/eappointment/issues/883 The issue has been assigned to you and includes all the necessary details for implementation. Let me know if you need any adjustments to the issue description or additional information. 🐰 thoughtfully documenting the automation requirements 🧠 Learnings used
|
Description:
The current database schema uses a mix of naming conventions, including camelCase and snake_case, and contains both English and German terms. In addition, there are inconsistent naming practices for identical concepts. For example:
"availability" and "Öffnungszeit" refer to the same concept.
"Scope" and "Standort" are also used interchangeably.
Plan:
Perform a series of database migrations to standardize the following:
Uniform field and table naming conventions (e.g., choose between camelCase or snake_case).
Standardize language usage across the schema (either fully in English or German).
Align naming for concepts that are currently inconsistent (e.g., "availability" vs. "Öffnungszeit", "Scope" vs. "Standort").
After completing the database migrations, update the queries in the ZMSDB module to reflect the newly standardized naming conventions.
Expected Outcome:
A consistent and uniform database schema, improving maintainability and reducing ambiguity.
Simplified query structure in the ZMSDB module.
The text was updated successfully, but these errors were encountered: