Initial commit
This commit is contained in:
@@ -0,0 +1,50 @@
|
||||
package db
|
||||
|
||||
// Entities
|
||||
|
||||
type Utente struct {
|
||||
ID string
|
||||
Username string
|
||||
Permissions []string
|
||||
}
|
||||
|
||||
type Stanza struct {
|
||||
ID string
|
||||
Posti []string
|
||||
}
|
||||
|
||||
// Actions
|
||||
|
||||
type AzioneBase struct {
|
||||
Tipo string
|
||||
}
|
||||
|
||||
type AzioneStanza struct {
|
||||
AzioneBase
|
||||
UserID string
|
||||
StanzaID string
|
||||
}
|
||||
|
||||
type AzioneOccupaPosto struct {
|
||||
AzioneStanza
|
||||
PostoID string
|
||||
}
|
||||
|
||||
type AzioneLiberaPosto struct {
|
||||
AzioneStanza
|
||||
PostoID string
|
||||
}
|
||||
|
||||
// Database Interfaces
|
||||
|
||||
type Store interface {
|
||||
// Entities
|
||||
|
||||
GetUtente(userID string) *Utente
|
||||
GetStanza(stanzaID string) *Stanza
|
||||
|
||||
// Available Seats
|
||||
|
||||
GetPostiOccupati(stanzaID string) []string
|
||||
GetPostiLiberi(stanzaID string) []string
|
||||
}
|
||||
Reference in New Issue
Block a user