28 lines
504 B
Go
28 lines
504 B
Go
package services
|
|
|
|
import (
|
|
"errors"
|
|
"fmt"
|
|
|
|
"github.com/google/uuid"
|
|
)
|
|
|
|
var (
|
|
ErrAppRepo = errors.New("AppRepo")
|
|
ErrApplicationNotFound = fmt.Errorf("%w: application not found", ErrAppRepo)
|
|
)
|
|
|
|
type Application struct {
|
|
ID uuid.UUID
|
|
Name string
|
|
State string
|
|
}
|
|
|
|
type AppRepo interface {
|
|
IsRegistered(name string) bool
|
|
PendingApprovalCount() int
|
|
GetApp(name string) (Application, error)
|
|
StartAppRegistration(name string) uuid.UUID
|
|
ApproveApp(id uuid.UUID) (Application, error)
|
|
}
|