Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014aRnCGqELxoix5TfpX8Ejf
487 lines
17 KiB
Go
487 lines
17 KiB
Go
package migrations
|
|
|
|
import (
|
|
"context"
|
|
"database/sql"
|
|
"errors"
|
|
"fmt"
|
|
"strings"
|
|
"testing"
|
|
"time"
|
|
|
|
"github.com/golang-migrate/migrate/v4"
|
|
"github.com/golang-migrate/migrate/v4/database/postgres"
|
|
"github.com/golang-migrate/migrate/v4/source/iofs"
|
|
_ "github.com/jackc/pgx/v5/stdlib" // pgx stdlib driver for database/sql
|
|
tcpostgres "github.com/testcontainers/testcontainers-go/modules/postgres"
|
|
)
|
|
|
|
// startPostgres spins a fresh postgres:16-alpine container and returns its
|
|
// DSN + a cleanup func. Skips the test if Docker is unreachable.
|
|
func startPostgres(t *testing.T) (string, func()) {
|
|
t.Helper()
|
|
ctx, cancel := context.WithTimeout(context.Background(), 90*time.Second)
|
|
defer cancel()
|
|
|
|
pgc, err := tcpostgres.Run(ctx,
|
|
"postgres:16-alpine",
|
|
tcpostgres.WithDatabase("tenant_registry_test"),
|
|
tcpostgres.WithUsername("test"),
|
|
tcpostgres.WithPassword("test"),
|
|
tcpostgres.BasicWaitStrategies(),
|
|
)
|
|
if err != nil {
|
|
t.Skipf("skipping: docker unreachable (%v)", err)
|
|
}
|
|
|
|
dsn, err := pgc.ConnectionString(ctx, "sslmode=disable")
|
|
if err != nil {
|
|
_ = pgc.Terminate(context.Background())
|
|
t.Fatalf("dsn: %v", err)
|
|
}
|
|
cleanup := func() {
|
|
c, cancel := context.WithTimeout(context.Background(), 30*time.Second)
|
|
defer cancel()
|
|
_ = pgc.Terminate(c)
|
|
}
|
|
return dsn, cleanup
|
|
}
|
|
|
|
func newMigrator(t *testing.T, dsn string) *migrate.Migrate {
|
|
t.Helper()
|
|
src, err := iofs.New(FS, ".")
|
|
if err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
db, err := sql.Open("pgx", dsn)
|
|
if err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
driver, err := postgres.WithInstance(db, &postgres.Config{})
|
|
if err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
m, err := migrate.NewWithInstance("iofs", src, "postgres", driver)
|
|
if err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
t.Cleanup(func() {
|
|
_, _ = m.Close()
|
|
_ = db.Close()
|
|
})
|
|
return m
|
|
}
|
|
|
|
func TestMigrate_upDownRoundTrip(t *testing.T) {
|
|
if testing.Short() {
|
|
t.Skip("skipping integration test under -short")
|
|
}
|
|
dsn, stop := startPostgres(t)
|
|
defer stop()
|
|
|
|
m := newMigrator(t, dsn)
|
|
|
|
if err := m.Up(); err != nil && !errors.Is(err, migrate.ErrNoChange) {
|
|
t.Fatalf("up: %v", err)
|
|
}
|
|
|
|
// Schema assertions — every table the spec requires must exist.
|
|
db, err := sql.Open("pgx", dsn)
|
|
if err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
defer func() { _ = db.Close() }()
|
|
|
|
wantTables := []string{
|
|
"tenants",
|
|
"tenant_projects",
|
|
"tenant_products",
|
|
"tenant_idp_config",
|
|
"api_keys",
|
|
"audit_log",
|
|
"products",
|
|
"managed_services",
|
|
"role_datasets",
|
|
"role_dataset_revisions",
|
|
}
|
|
for _, table := range wantTables {
|
|
var exists bool
|
|
err := db.QueryRow(
|
|
"SELECT EXISTS (SELECT 1 FROM information_schema.tables WHERE table_schema='public' AND table_name=$1)",
|
|
table,
|
|
).Scan(&exists)
|
|
if err != nil {
|
|
t.Fatalf("query for table %s: %v", table, err)
|
|
}
|
|
if !exists {
|
|
t.Errorf("table %s missing after migrate up", table)
|
|
}
|
|
}
|
|
|
|
// Column assertions for later migrations (0007: licences.llm_key_id; 0008: documents; 0009: mail_outbox; 0010: projects; 0011: trial_offers; 0012: managed_services; 0024: role_datasets).
|
|
for _, c := range [][2]string{{"licences", "llm_key_id"}, {"documents", "object_key"}, {"documents", "published_at"}, {"mail_outbox", "idempotency_key"}, {"projects", "kind"}, {"document_projects", "project_id"}, {"documents", "own_document"}, {"trial_offers", "terms_sha256"}, {"trial_offers", "trial_expires_at"}, {"managed_services", "instance_id"}, {"managed_services", "notes"}, {"role_datasets", "catalogue_version"}, {"role_dataset_revisions", "changed_by"}} {
|
|
var exists bool
|
|
err := db.QueryRow(
|
|
"SELECT EXISTS (SELECT 1 FROM information_schema.columns WHERE table_schema='public' AND table_name=$1 AND column_name=$2)",
|
|
c[0], c[1],
|
|
).Scan(&exists)
|
|
if err != nil {
|
|
t.Fatalf("query for column %s.%s: %v", c[0], c[1], err)
|
|
}
|
|
if !exists {
|
|
t.Errorf("column %s.%s missing after migrate up", c[0], c[1])
|
|
}
|
|
}
|
|
|
|
// 0011: the offer snapshot cannot change, the state can.
|
|
var offerID string
|
|
if err := db.QueryRow(`INSERT INTO trial_offers (company_name, street, postcode, city, country, first_name, last_name, email,
|
|
terms_document_id, terms_version, terms_sha256, notice_version, flow_version, terms_accepted, offered_at,
|
|
verify_token_hash, verify_expires_at)
|
|
VALUES ('Firma', 'Str. 1', '78224', 'Singen', 'DE', 'A', 'B', 'a@b.de', 'trial-terms', '1.0', $1,
|
|
'246c-2026-10-01', 'trial-flow-1', true, now(), 'h1', now() + interval '72 hours') RETURNING id::text`,
|
|
"f7b2635fc26f58acc2686ed1e3d96d4aef878fe2cd313bc3dc233c86d8d79906").Scan(&offerID); err != nil {
|
|
t.Fatalf("insert offer: %v", err)
|
|
}
|
|
if _, err := db.Exec(`UPDATE trial_offers SET email = 'x@y.de' WHERE id = $1::uuid`, offerID); err == nil {
|
|
t.Error("changing the offer snapshot was allowed")
|
|
}
|
|
if _, err := db.Exec(`UPDATE trial_offers SET terms_sha256 = $2 WHERE id = $1::uuid`, offerID, strings.Repeat("0", 64)); err == nil {
|
|
t.Error("changing the accepted terms was allowed")
|
|
}
|
|
if _, err := db.Exec(`UPDATE trial_offers SET state = 'verified', verified_at = now() WHERE id = $1::uuid`, offerID); err != nil {
|
|
t.Errorf("state update refused: %v", err)
|
|
}
|
|
if _, err := db.Exec(`INSERT INTO trial_offers (company_name, street, postcode, city, country, first_name, last_name, email,
|
|
terms_document_id, terms_version, terms_sha256, notice_version, flow_version, terms_accepted, offered_at,
|
|
verify_token_hash, verify_expires_at)
|
|
VALUES ('F', 'S', '1', 'C', 'DE', 'A', 'B', 'c@d.de', 'trial-terms', '1.0', $1, 'n', 'f', false, now(), 'h2', now())`,
|
|
strings.Repeat("a", 64)); err == nil {
|
|
t.Error("an offer without accepted terms was stored")
|
|
}
|
|
|
|
// Enum assertions.
|
|
wantEnums := map[string][]string{
|
|
// 0002 appends the ladder values; enum values are never removed (down is a no-op).
|
|
"tenant_status": {"demo", "trial", "active", "frozen", "archived", "warning", "restricted", "halted"},
|
|
"tenant_kind": {"customer", "demo"},
|
|
"idp_kind": {"oidc", "saml"},
|
|
"tenant_project_status": {"active", "archived"},
|
|
}
|
|
for enum, values := range wantEnums {
|
|
rows, err := db.Query(
|
|
"SELECT e.enumlabel FROM pg_type t JOIN pg_enum e ON t.oid = e.enumtypid WHERE t.typname = $1 ORDER BY e.enumsortorder",
|
|
enum,
|
|
)
|
|
if err != nil {
|
|
t.Fatalf("query enum %s: %v", enum, err)
|
|
}
|
|
var got []string
|
|
for rows.Next() {
|
|
var v string
|
|
if err := rows.Scan(&v); err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
got = append(got, v)
|
|
}
|
|
_ = rows.Close()
|
|
if fmt.Sprint(got) != fmt.Sprint(values) {
|
|
t.Errorf("enum %s = %v, want %v", enum, got, values)
|
|
}
|
|
}
|
|
|
|
// Round-trip: down all, then up again — must succeed without leftover state.
|
|
if err := m.Down(); err != nil && !errors.Is(err, migrate.ErrNoChange) {
|
|
t.Fatalf("down: %v", err)
|
|
}
|
|
var afterDown int
|
|
err = db.QueryRow(
|
|
"SELECT COUNT(*) FROM information_schema.tables WHERE table_schema='public' AND table_name = ANY($1)",
|
|
wantTables,
|
|
).Scan(&afterDown)
|
|
if err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
if afterDown != 0 {
|
|
t.Errorf("after down: %d tables still present, want 0", afterDown)
|
|
}
|
|
|
|
if err := m.Up(); err != nil && !errors.Is(err, migrate.ErrNoChange) {
|
|
t.Fatalf("up after down: %v", err)
|
|
}
|
|
}
|
|
|
|
// TestSeed_canInsertAndQuery is the lightweight happy-path: insert a tenant,
|
|
// give it a project + a product + an api_key + an audit record, query back.
|
|
// Catches schema-level mistakes (NOT NULL, FK direction, enum cast) that
|
|
// table-existence checks miss.
|
|
func TestSeed_canInsertAndQuery(t *testing.T) {
|
|
if testing.Short() {
|
|
t.Skip("skipping integration test under -short")
|
|
}
|
|
dsn, stop := startPostgres(t)
|
|
defer stop()
|
|
|
|
m := newMigrator(t, dsn)
|
|
if err := m.Up(); err != nil && !errors.Is(err, migrate.ErrNoChange) {
|
|
t.Fatalf("up: %v", err)
|
|
}
|
|
|
|
db, err := sql.Open("pgx", dsn)
|
|
if err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
defer func() { _ = db.Close() }()
|
|
ctx := context.Background()
|
|
|
|
var tid string
|
|
err = db.QueryRowContext(ctx,
|
|
`INSERT INTO tenants (slug, name, plan, status, kind)
|
|
VALUES ($1, $2, 'professional', 'active', 'customer')
|
|
RETURNING id`,
|
|
"acme", "Acme Inc.").Scan(&tid)
|
|
if err != nil {
|
|
t.Fatalf("insert tenant: %v", err)
|
|
}
|
|
|
|
if _, err := db.ExecContext(ctx,
|
|
`INSERT INTO tenant_projects (tenant_id, name, slug) VALUES ($1, $2, $3)`,
|
|
tid, "Production", "prod"); err != nil {
|
|
t.Fatalf("insert project: %v", err)
|
|
}
|
|
if _, err := db.ExecContext(ctx,
|
|
`INSERT INTO tenant_products (tenant_id, product, config) VALUES ($1, 'certifai', '{"max_seats":10}'::jsonb)`,
|
|
tid); err != nil {
|
|
t.Fatalf("insert product: %v", err)
|
|
}
|
|
if _, err := db.ExecContext(ctx,
|
|
`INSERT INTO api_keys (tenant_id, name, hash, prefix, scopes)
|
|
VALUES ($1, 'ci-bot', 'argon2-hash', 'bp_12345', ARRAY['certifai:read'])`,
|
|
tid); err != nil {
|
|
t.Fatalf("insert api_key: %v", err)
|
|
}
|
|
if _, err := db.ExecContext(ctx,
|
|
`INSERT INTO audit_log (tenant_id, action, actor_id, actor_name, metadata)
|
|
VALUES ($1, 'tenant.created', 'sys', 'system', '{"source":"test"}'::jsonb)`,
|
|
tid); err != nil {
|
|
t.Fatalf("insert audit: %v", err)
|
|
}
|
|
|
|
// Round-trip read.
|
|
var slug, status string
|
|
err = db.QueryRowContext(ctx, `SELECT slug, status::text FROM tenants WHERE id = $1`, tid).Scan(&slug, &status)
|
|
if err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
if slug != "acme" || status != "active" {
|
|
t.Errorf("tenant readback: slug=%q status=%q", slug, status)
|
|
}
|
|
|
|
// 0012: one row per (tenant, kind, url); kind and status are checked.
|
|
insMS := `INSERT INTO managed_services (tenant_id, kind, name, url, sku, status) VALUES ($1, $2, 'Git', $3, 'INF-GIT-CLD-STD', $4)`
|
|
if _, err := db.ExecContext(ctx, insMS, tid, "git", "https://git.k-00001.example", "active"); err != nil {
|
|
t.Fatalf("insert managed service: %v", err)
|
|
}
|
|
if _, err := db.ExecContext(ctx, insMS, tid, "git", "https://git.k-00001.example", "active"); err == nil {
|
|
t.Error("duplicate (tenant, kind, url) was stored")
|
|
}
|
|
if _, err := db.ExecContext(ctx, insMS, tid, "svn", "https://svn.k-00001.example", "active"); err == nil {
|
|
t.Error("unknown kind was stored")
|
|
}
|
|
if _, err := db.ExecContext(ctx, insMS, tid, "git", "https://git2.k-00001.example", "paused"); err == nil {
|
|
t.Error("unknown status was stored")
|
|
}
|
|
// 0013: kind ci-runner; several runners may serve one Git instance.
|
|
insRunner := `INSERT INTO managed_services (tenant_id, kind, name, url, sku) VALUES ($1, 'ci-runner', 'Runner', $2, 'INF-CI-CLD-STD')`
|
|
for i := 0; i < 2; i++ {
|
|
if _, err := db.ExecContext(ctx, insRunner, tid, "https://git.k-00001.example"); err != nil {
|
|
t.Fatalf("insert runner %d: %v", i+1, err)
|
|
}
|
|
}
|
|
|
|
// FK cascade — delete tenant, projects/products/keys/audit_log handling.
|
|
if _, err := db.ExecContext(ctx, `DELETE FROM tenants WHERE id = $1`, tid); err != nil {
|
|
t.Fatalf("delete tenant: %v", err)
|
|
}
|
|
var nServices int
|
|
_ = db.QueryRowContext(ctx, `SELECT COUNT(*) FROM managed_services WHERE tenant_id = $1`, tid).Scan(&nServices)
|
|
if nServices != 0 {
|
|
t.Errorf("FK cascade incomplete: managed_services=%d", nServices)
|
|
}
|
|
var nProjects, nProducts, nKeys int
|
|
_ = db.QueryRowContext(ctx, `SELECT COUNT(*) FROM tenant_projects WHERE tenant_id = $1`, tid).Scan(&nProjects)
|
|
_ = db.QueryRowContext(ctx, `SELECT COUNT(*) FROM tenant_products WHERE tenant_id = $1`, tid).Scan(&nProducts)
|
|
_ = db.QueryRowContext(ctx, `SELECT COUNT(*) FROM api_keys WHERE tenant_id = $1`, tid).Scan(&nKeys)
|
|
if nProjects != 0 || nProducts != 0 || nKeys != 0 {
|
|
t.Errorf("FK cascade incomplete: projects=%d products=%d keys=%d", nProjects, nProducts, nKeys)
|
|
}
|
|
|
|
// audit_log uses ON DELETE SET NULL — tenant_id becomes NULL but row stays
|
|
var nAudit, nAuditNullTenant int
|
|
_ = db.QueryRowContext(ctx, `SELECT COUNT(*) FROM audit_log`).Scan(&nAudit)
|
|
_ = db.QueryRowContext(ctx, `SELECT COUNT(*) FROM audit_log WHERE tenant_id IS NULL`).Scan(&nAuditNullTenant)
|
|
if nAudit != 1 || nAuditNullTenant != 1 {
|
|
t.Errorf("audit_log SET NULL: total=%d null=%d, want 1/1", nAudit, nAuditNullTenant)
|
|
}
|
|
}
|
|
|
|
func TestSlugConstraint(t *testing.T) {
|
|
if testing.Short() {
|
|
t.Skip("skipping integration test under -short")
|
|
}
|
|
dsn, stop := startPostgres(t)
|
|
defer stop()
|
|
|
|
m := newMigrator(t, dsn)
|
|
if err := m.Up(); err != nil && !errors.Is(err, migrate.ErrNoChange) {
|
|
t.Fatalf("up: %v", err)
|
|
}
|
|
|
|
db, err := sql.Open("pgx", dsn)
|
|
if err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
defer func() { _ = db.Close() }()
|
|
|
|
cases := []struct {
|
|
slug string
|
|
wantErr bool
|
|
}{
|
|
{"acme", false},
|
|
{"a-c-m-e", false},
|
|
{"a1b2c3", false},
|
|
{"a", true}, // too short
|
|
{"-acme", true}, // leading dash
|
|
{"acme-", true}, // trailing dash
|
|
{"AcMe", true}, // uppercase
|
|
{"a_b", true}, // underscore
|
|
}
|
|
for _, c := range cases {
|
|
_, err := db.Exec(`INSERT INTO tenants (slug, name) VALUES ($1, 'X')`, c.slug)
|
|
gotErr := err != nil
|
|
if gotErr != c.wantErr {
|
|
t.Errorf("slug %q: gotErr=%v wantErr=%v (err=%v)", c.slug, gotErr, c.wantErr, err)
|
|
}
|
|
}
|
|
}
|
|
|
|
// 0019 ends the product trials of workspaces on trial with that trial, and
|
|
// leaves everything else alone.
|
|
func TestMigrate_0019AlignsTrialEntitlements(t *testing.T) {
|
|
if testing.Short() {
|
|
t.Skip("skipping integration test under -short")
|
|
}
|
|
dsn, stop := startPostgres(t)
|
|
defer stop()
|
|
m := newMigrator(t, dsn)
|
|
if err := m.Migrate(18); err != nil {
|
|
t.Fatalf("up to 18: %v", err)
|
|
}
|
|
db, err := sql.Open("pgx", dsn)
|
|
if err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
defer func() { _ = db.Close() }()
|
|
|
|
tenant := func(slug, status, trialEnd string) string {
|
|
var id string
|
|
if err := db.QueryRow(`INSERT INTO tenants (slug, name, status, trial_ends_at)
|
|
VALUES ($1, 'X', $2, NOW() + $3::interval) RETURNING id`, slug, status, trialEnd).Scan(&id); err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
return id
|
|
}
|
|
product := func(tenantID, key, source, expires string) {
|
|
if _, err := db.Exec(`INSERT INTO tenant_products (tenant_id, product, enabled, config, expires_at)
|
|
VALUES ($1, $2, FALSE, jsonb_build_object('source', $3::text), NOW() + $4::interval)`, tenantID, key, source, expires); err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
}
|
|
short := tenant("trial-short", "trial", "14 days")
|
|
product(short, "pruefwerk", "trial", "-1 hour") // expired before the trial: aligned
|
|
product(short, "firmwerk", "erp", "-1 hour") // booked: untouched
|
|
longer := tenant("trial-longer", "trial", "3 days")
|
|
product(longer, "pruefwerk", "trial", "10 days") // ends later: untouched
|
|
paying := tenant("paying", "active", "14 days")
|
|
product(paying, "pruefwerk", "trial", "-1 hour") // not on trial: untouched
|
|
|
|
if err := m.Up(); err != nil && !errors.Is(err, migrate.ErrNoChange) {
|
|
t.Fatalf("up: %v", err)
|
|
}
|
|
aligned := func(tenantID, key string) bool {
|
|
var ok bool
|
|
if err := db.QueryRow(`SELECT tp.enabled AND tp.expires_at = t.trial_ends_at
|
|
FROM tenant_products tp JOIN tenants t ON t.id = tp.tenant_id
|
|
WHERE tp.tenant_id = $1 AND tp.product = $2`, tenantID, key).Scan(&ok); err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
return ok
|
|
}
|
|
if !aligned(short, "pruefwerk") {
|
|
t.Error("the trial product of a workspace on trial was not aligned")
|
|
}
|
|
for _, c := range []struct{ id, key string }{{short, "firmwerk"}, {longer, "pruefwerk"}, {paying, "pruefwerk"}} {
|
|
if aligned(c.id, c.key) {
|
|
t.Errorf("%s/%s changed", c.id, c.key)
|
|
}
|
|
}
|
|
var audited int
|
|
if err := db.QueryRow(`SELECT COUNT(*) FROM audit_log WHERE action = 'entitlement.trial_aligned' AND tenant_id = $1`, short).Scan(&audited); err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
if audited != 1 {
|
|
t.Errorf("audit rows: %d", audited)
|
|
}
|
|
}
|
|
|
|
func TestMigrate_0023MovesOwnDocumentsIntoTheStore(t *testing.T) {
|
|
if testing.Short() {
|
|
t.Skip("skipping integration test under -short")
|
|
}
|
|
dsn, stop := startPostgres(t)
|
|
defer stop()
|
|
m := newMigrator(t, dsn)
|
|
if err := m.Migrate(22); err != nil {
|
|
t.Fatalf("up to 22: %v", err)
|
|
}
|
|
db, err := sql.Open("pgx", dsn)
|
|
if err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
defer func() { _ = db.Close() }()
|
|
var tid string
|
|
if err := db.QueryRow(`INSERT INTO tenants (slug, name) VALUES ('muster', 'Muster Modellbau GmbH') RETURNING id`).Scan(&tid); err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
doc := func(title string, own bool, area any) string {
|
|
var id string
|
|
if err := db.QueryRow(`INSERT INTO documents (tenant_id, title, filename, content_type, size_bytes, sha256, object_key, status, own_document, area)
|
|
VALUES ($1, $2, $2 || '.pdf', 'application/pdf', 1, 'x', 'k/' || $2, 'published', $3, $4) RETURNING id`, tid, title, own, area).Scan(&id); err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
return id
|
|
}
|
|
own := doc("Datenblatt Lok 100", true, nil) // own document of Unterlagen: moves
|
|
delivery := doc("Prüfbericht", false, nil) // BreakPilot's delivery: stays
|
|
public := doc("Handbuch", true, "product_public") // already in the store: stays
|
|
areaOf := func(id string) string {
|
|
var a sql.NullString
|
|
if err := db.QueryRow(`SELECT area FROM documents WHERE id = $1`, id).Scan(&a); err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
return a.String
|
|
}
|
|
if err := m.Migrate(23); err != nil {
|
|
t.Fatalf("up to 23: %v", err)
|
|
}
|
|
if got := [3]string{areaOf(own), areaOf(delivery), areaOf(public)}; got != [3]string{"internal", "", "product_public"} {
|
|
t.Errorf("after up: %v", got)
|
|
}
|
|
if err := m.Migrate(22); err != nil {
|
|
t.Fatalf("down to 22: %v", err)
|
|
}
|
|
if got := [3]string{areaOf(own), areaOf(delivery), areaOf(public)}; got != [3]string{"", "", "product_public"} {
|
|
t.Errorf("after down: %v", got)
|
|
}
|
|
}
|