Feat settings cascade (#3)
Co-authored-by: Jeffrey Smith <jasafpro@gmail.com> Co-committed-by: Jeffrey Smith <jasafpro@gmail.com>
This commit was merged in pull request #3.
This commit is contained in:
@@ -83,6 +83,17 @@ type PackageStore interface {
|
||||
|
||||
// SetPackageSettings stores admin-configured package-level settings.
|
||||
SetPackageSettings(ctx context.Context, id string, settings json.RawMessage) error
|
||||
|
||||
// ── Team-level settings (v0.2.0) ─────────────────
|
||||
|
||||
// GetTeamSettings returns team-scoped overrides for a package.
|
||||
GetTeamSettings(ctx context.Context, pkgID, teamID string) (json.RawMessage, error)
|
||||
|
||||
// SetTeamSettings upserts team-scoped overrides for a package.
|
||||
SetTeamSettings(ctx context.Context, pkgID, teamID string, settings json.RawMessage) error
|
||||
|
||||
// DeleteTeamSettings removes team-scoped overrides, reverting to global defaults.
|
||||
DeleteTeamSettings(ctx context.Context, pkgID, teamID string) error
|
||||
}
|
||||
|
||||
// PackageRegistration is a row from the packages table.
|
||||
@@ -123,3 +134,11 @@ type PackageUserSettings struct {
|
||||
Settings json.RawMessage `json:"settings" db:"settings"`
|
||||
IsEnabled bool `json:"is_enabled" db:"is_enabled"`
|
||||
}
|
||||
|
||||
// PackageTeamSettings stores team-scoped overrides for a package (v0.2.0).
|
||||
type PackageTeamSettings struct {
|
||||
PackageID string `json:"package_id" db:"package_id"`
|
||||
TeamID string `json:"team_id" db:"team_id"`
|
||||
Settings json.RawMessage `json:"settings" db:"settings"`
|
||||
UpdatedAt string `json:"updated_at" db:"updated_at"`
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user