Add some missing files from previous commits
This commit is contained in:
parent
fc56c1406a
commit
ee76dddf2f
3 changed files with 122 additions and 0 deletions
22
platform/session.go
Normal file
22
platform/session.go
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
package platform
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
)
|
||||
|
||||
type session struct {
|
||||
Impersonating *User
|
||||
NotificationCounts notificationCounts
|
||||
}
|
||||
|
||||
func SessionCurrent(ctx context.Context, user User) (*session, error) {
|
||||
counts, err := NotificationCountsForUser(ctx, user)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("get notifications: %w", err)
|
||||
}
|
||||
return &session{
|
||||
Impersonating: nil,
|
||||
NotificationCounts: *counts,
|
||||
}, nil
|
||||
}
|
||||
6
platform/types/service_area.go
Normal file
6
platform/types/service_area.go
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
package types
|
||||
|
||||
type ServiceArea struct {
|
||||
Min Location `json:"min"`
|
||||
Max Location `json:"max"`
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue