github.com/kyma-incubator/compass/components/director@v0.0.0-20230623144113-d764f56ff805/internal/domain/application/entity.go (about) 1 package application 2 3 import ( 4 "database/sql" 5 "time" 6 7 "github.com/kyma-incubator/compass/components/director/internal/repo" 8 ) 9 10 // Entity missing godoc 11 type Entity struct { 12 ApplicationTemplateID sql.NullString `db:"app_template_id"` 13 Name string `db:"name"` 14 ProviderName sql.NullString `db:"provider_name"` 15 Description sql.NullString `db:"description"` 16 StatusCondition string `db:"status_condition"` 17 StatusTimestamp time.Time `db:"status_timestamp"` 18 HealthCheckURL sql.NullString `db:"healthcheck_url"` 19 IntegrationSystemID sql.NullString `db:"integration_system_id"` 20 BaseURL sql.NullString `db:"base_url"` 21 ApplicationNamespace sql.NullString `db:"application_namespace"` 22 SystemNumber sql.NullString `db:"system_number"` 23 LocalTenantID sql.NullString `db:"local_tenant_id"` 24 OrdLabels sql.NullString `db:"labels"` 25 CorrelationIDs sql.NullString `db:"correlation_ids"` 26 SystemStatus sql.NullString `db:"system_status"` 27 TenantBusinessTypeID sql.NullString `db:"tenant_business_type_id"` 28 29 Tags sql.NullString `db:"tags"` 30 DocumentationLabels sql.NullString `db:"documentation_labels"` 31 *repo.BaseEntity 32 } 33 34 // EntityCollection missing godoc 35 type EntityCollection []Entity 36 37 // Len missing godoc 38 func (a EntityCollection) Len() int { 39 return len(a) 40 } 41 42 // DecorateWithTenantID decorates the entity with the given tenant ID. 43 func (e *Entity) DecorateWithTenantID(tenant string) interface{} { 44 return struct { 45 *Entity 46 TenantID string `db:"tenant_id"` 47 }{ 48 Entity: e, 49 TenantID: tenant, 50 } 51 }