Files
query-orchestration/internal/database/repository/models.go
T
Jacob Mathison 8a4029058b Merged in jmathison/demo-table (pull request #213)
Add demo dashboard settings table and CRUD API

* Add demo dashboard settings table and CRUD API

- Migration 00000000000123: create demoDashboardSettings table (id, guid, key, value JSONB, isDeleted, timestamps)
- SQLC queries and repository for create, list, listByGuid, get, update, soft delete
- OpenAPI paths and schemas in queryAPI.yaml; regenerate api.gen.go (embedded spec)
- Handlers in api/queryAPI/demodashboardsettings.go; ConfigProvider GetDBQueries for repo access
- Unit tests for demo dashboard settings CRUD

* Fix sqlc-generated demo dashboard setting types

Align demo dashboard settings handlers with sqlc output (DemoDashboardSetting model + pointer slices) so CI codegen/build succeeds.

* Fix CI gosec and gofmt issues

- Suppress gosec G115 for TotalCount len->int32 cast (consistent with other list endpoints)
- gofmt mock GetDBQueries() in test helpers

* gofmt query API demo settings

* Tighten demo dashboard settings OpenAPI constraints

* Regenerate query API embedded spec

* refactor: generic UI settings (table, API, service) and three-layer architecture

- Replace demo-dashboard-settings with generic UI settings:
  - Table uiSettings with namespace (was guid), key, value JSONB; UNIQUE(namespace, key)
  - Migration 123: create_ui_settings (single migration, no rename)
  - OpenAPI: /ui-settings, UISettingsService, UISetting schemas with namespace
  - API types and handlers: CreateUISetting, ListUISettings, GetUISetting, UpdateUISetting, DeleteUISetting

- Add service layer (architecture fix):
  - internal/uisettings: Service with Create, List, ListByNamespace, Get, Update, SoftDelete
  - Controllers call s.svc.UISettings only; remove GetDBQueries from queryAPI ConfigProvider
  - Wire UISettings in Services, main.go, and testutils

- Repository: uisettings.sql + uisettings.sql.go, UISetting model; remove demodashboardsettings
- Controller: uisettings.go (replaces demodashboardsettings.go), ErrNotFound from uisettings package
- Tests: uisettings_test.go with namespace-based list/cre…
* Add UISetting model and generated queries for uiSettings table

- models.go: add UISetting struct (sqlc 1.30.0)
- uisettings.sql.go: generated CRUD for ui_settings feature

Made-with: Cursor

* Use repository.UiSetting to match sqlc-generated type

- service and API use repository.UiSetting (sqlc struct name for uiSettings table)
- uisettings.sql.go: keep CreateUISetting/GetUISetting etc. from query names, return *UiSetting
- Fixes Docker/CI build undefined repository.UISetting

* Fix import formatting for golangci-lint

* Lint fix

* uisettings list test

* tests fixes

* Merge main: resolve api.gen.go conflicts (UI settings + DeleteDocument)

* Doc updates and elimination of index redundancy


Approved-by: Jay Brown
2026-03-04 23:00:50 +00:00

587 lines
24 KiB
Go

// Code generated by sqlc. DO NOT EDIT.
// versions:
// sqlc v1.30.0
package repository
import (
"database/sql/driver"
"fmt"
"github.com/google/uuid"
"github.com/jackc/pgx/v5/pgtype"
)
type BatchStatus string
const (
BatchStatusProcessing BatchStatus = "processing"
BatchStatusCompleted BatchStatus = "completed"
BatchStatusFailed BatchStatus = "failed"
BatchStatusCancelled BatchStatus = "cancelled"
)
func (e *BatchStatus) Scan(src interface{}) error {
switch s := src.(type) {
case []byte:
*e = BatchStatus(s)
case string:
*e = BatchStatus(s)
default:
return fmt.Errorf("unsupported scan type for BatchStatus: %T", src)
}
return nil
}
type NullBatchStatus struct {
BatchStatus BatchStatus
Valid bool // Valid is true if BatchStatus is not NULL
}
// Scan implements the Scanner interface.
func (ns *NullBatchStatus) Scan(value interface{}) error {
if value == nil {
ns.BatchStatus, ns.Valid = "", false
return nil
}
ns.Valid = true
return ns.BatchStatus.Scan(value)
}
// Value implements the driver Valuer interface.
func (ns NullBatchStatus) Value() (driver.Value, error) {
if !ns.Valid {
return nil, nil
}
return string(ns.BatchStatus), nil
}
func (e BatchStatus) Valid() bool {
switch e {
case BatchStatusProcessing,
BatchStatusCompleted,
BatchStatusFailed,
BatchStatusCancelled:
return true
}
return false
}
type Cleanfailtype string
const (
CleanfailtypeInvalidMimetype Cleanfailtype = "invalid_mimetype"
CleanfailtypeInvalidRead Cleanfailtype = "invalid_read"
CleanfailtypeInvalidReadPages Cleanfailtype = "invalid_read_pages"
CleanfailtypeZeroPageCount Cleanfailtype = "zero_page_count"
CleanfailtypeLargeFile Cleanfailtype = "large_file"
CleanfailtypeSmallDimensions Cleanfailtype = "small_dimensions"
CleanfailtypeLargeDimensions Cleanfailtype = "large_dimensions"
CleanfailtypeSmallDpi Cleanfailtype = "small_dpi"
CleanfailtypeLargeDpi Cleanfailtype = "large_dpi"
)
func (e *Cleanfailtype) Scan(src interface{}) error {
switch s := src.(type) {
case []byte:
*e = Cleanfailtype(s)
case string:
*e = Cleanfailtype(s)
default:
return fmt.Errorf("unsupported scan type for Cleanfailtype: %T", src)
}
return nil
}
type NullCleanfailtype struct {
Cleanfailtype Cleanfailtype
Valid bool // Valid is true if Cleanfailtype is not NULL
}
// Scan implements the Scanner interface.
func (ns *NullCleanfailtype) Scan(value interface{}) error {
if value == nil {
ns.Cleanfailtype, ns.Valid = "", false
return nil
}
ns.Valid = true
return ns.Cleanfailtype.Scan(value)
}
// Value implements the driver Valuer interface.
func (ns NullCleanfailtype) Value() (driver.Value, error) {
if !ns.Valid {
return nil, nil
}
return string(ns.Cleanfailtype), nil
}
func (e Cleanfailtype) Valid() bool {
switch e {
case CleanfailtypeInvalidMimetype,
CleanfailtypeInvalidRead,
CleanfailtypeInvalidReadPages,
CleanfailtypeZeroPageCount,
CleanfailtypeLargeFile,
CleanfailtypeSmallDimensions,
CleanfailtypeLargeDimensions,
CleanfailtypeSmallDpi,
CleanfailtypeLargeDpi:
return true
}
return false
}
type Cleanmimetype string
const (
CleanmimetypeApplicationPdf Cleanmimetype = "application/pdf"
)
func (e *Cleanmimetype) Scan(src interface{}) error {
switch s := src.(type) {
case []byte:
*e = Cleanmimetype(s)
case string:
*e = Cleanmimetype(s)
default:
return fmt.Errorf("unsupported scan type for Cleanmimetype: %T", src)
}
return nil
}
type NullCleanmimetype struct {
Cleanmimetype Cleanmimetype
Valid bool // Valid is true if Cleanmimetype is not NULL
}
// Scan implements the Scanner interface.
func (ns *NullCleanmimetype) Scan(value interface{}) error {
if value == nil {
ns.Cleanmimetype, ns.Valid = "", false
return nil
}
ns.Valid = true
return ns.Cleanmimetype.Scan(value)
}
// Value implements the driver Valuer interface.
func (ns NullCleanmimetype) Value() (driver.Value, error) {
if !ns.Valid {
return nil, nil
}
return string(ns.Cleanmimetype), nil
}
func (e Cleanmimetype) Valid() bool {
switch e {
case CleanmimetypeApplicationPdf:
return true
}
return false
}
type BatchUpload struct {
ID uuid.UUID `db:"id"`
ClientID string `db:"client_id"`
OriginalFilename string `db:"original_filename"`
TotalDocuments int32 `db:"total_documents"`
ProcessedDocuments int32 `db:"processed_documents"`
FailedDocuments int32 `db:"failed_documents"`
InvalidTypeDocuments int32 `db:"invalid_type_documents"`
Status BatchStatus `db:"status"`
ProgressPercent int32 `db:"progress_percent"`
FailedFilenames []byte `db:"failed_filenames"`
CreatedAt pgtype.Timestamp `db:"created_at"`
CompletedAt pgtype.Timestamp `db:"completed_at"`
ArchiveBucket *string `db:"archive_bucket"`
ArchiveKey *string `db:"archive_key"`
FileSizeBytes *int64 `db:"file_size_bytes"`
}
type Client struct {
Clientid string `db:"clientid"`
Name string `db:"name"`
}
type Clientcansync struct {
Syncid uuid.UUID `db:"syncid"`
Clientid string `db:"clientid"`
Cansync bool `db:"cansync"`
}
type Collectoractiveversion struct {
ID uuid.UUID `db:"id"`
Clientid string `db:"clientid"`
Versionid int32 `db:"versionid"`
}
type Collectorcurrentactiveversion struct {
Clientid string `db:"clientid"`
Activeversion int32 `db:"activeversion"`
}
type Collectorlatestversion struct {
Clientid string `db:"clientid"`
Latestversion int32 `db:"latestversion"`
}
type Collectormincleanversion struct {
ID uuid.UUID `db:"id"`
Clientid string `db:"clientid"`
Versionid int64 `db:"versionid"`
Addedversion int32 `db:"addedversion"`
Removedversion *int32 `db:"removedversion"`
}
type Collectorversion struct {
Clientid string `db:"clientid"`
ID int32 `db:"id"`
Addedat pgtype.Timestamp `db:"addedat"`
}
type Currentcleanentry struct {
ID uuid.UUID `db:"id"`
Documentid uuid.UUID `db:"documentid"`
Bucket *string `db:"bucket"`
Key *string `db:"key"`
Version int64 `db:"version"`
Hash *string `db:"hash"`
Mimetype NullCleanmimetype `db:"mimetype"`
Fail NullCleanfailtype `db:"fail"`
Clientid string `db:"clientid"`
}
type Currentclientcansync struct {
Clientid string `db:"clientid"`
Cansync bool `db:"cansync"`
}
type Currentcollectormincleanversion struct {
Clientid string `db:"clientid"`
Mincleanversion int64 `db:"mincleanversion"`
}
type Currentfieldextraction struct {
ID uuid.UUID `db:"id"`
Documentid uuid.UUID `db:"documentid"`
Filename *string `db:"filename"`
Contracttitle *string `db:"contracttitle"`
Aaretederivedamendmentnum *int32 `db:"aaretederivedamendmentnum"`
Clientname *string `db:"clientname"`
Payername *string `db:"payername"`
Payerstate *string `db:"payerstate"`
Providerstate *string `db:"providerstate"`
Filenametin *string `db:"filenametin"`
Provgrouptin *string `db:"provgrouptin"`
Provgroupnpi *string `db:"provgroupnpi"`
Provgroupnamefull *string `db:"provgroupnamefull"`
Provothertin *string `db:"provothertin"`
Provothernpi *string `db:"provothernpi"`
Provothernamefull *string `db:"provothernamefull"`
Aaretederivedeffectivedt pgtype.Date `db:"aaretederivedeffectivedt"`
Aaretederivedterminationdt pgtype.Date `db:"aaretederivedterminationdt"`
Autorenewalind *bool `db:"autorenewalind"`
Autorenewalterm *string `db:"autorenewalterm"`
Version int64 `db:"version"`
Createdby string `db:"createdby"`
Createdat pgtype.Timestamp `db:"createdat"`
}
type Currentfieldextractionswitharraycount struct {
ID uuid.UUID `db:"id"`
Documentid uuid.UUID `db:"documentid"`
Filename *string `db:"filename"`
Contracttitle *string `db:"contracttitle"`
Aaretederivedamendmentnum *int32 `db:"aaretederivedamendmentnum"`
Clientname *string `db:"clientname"`
Payername *string `db:"payername"`
Payerstate *string `db:"payerstate"`
Providerstate *string `db:"providerstate"`
Filenametin *string `db:"filenametin"`
Provgrouptin *string `db:"provgrouptin"`
Provgroupnpi *string `db:"provgroupnpi"`
Provgroupnamefull *string `db:"provgroupnamefull"`
Provothertin *string `db:"provothertin"`
Provothernpi *string `db:"provothernpi"`
Provothernamefull *string `db:"provothernamefull"`
Aaretederivedeffectivedt pgtype.Date `db:"aaretederivedeffectivedt"`
Aaretederivedterminationdt pgtype.Date `db:"aaretederivedterminationdt"`
Autorenewalind *bool `db:"autorenewalind"`
Autorenewalterm *string `db:"autorenewalterm"`
Version int64 `db:"version"`
Createdby string `db:"createdby"`
Createdat pgtype.Timestamp `db:"createdat"`
Arraysize int64 `db:"arraysize"`
}
type Document struct {
ID uuid.UUID `db:"id"`
Clientid string `db:"clientid"`
Hash string `db:"hash"`
BatchID *uuid.UUID `db:"batch_id"`
Filename *string `db:"filename"`
Folderid *uuid.UUID `db:"folderid"`
// Original path provided during upload. IMMUTABLE after creation - never modify this value.
Originalpath *string `db:"originalpath"`
FileSizeBytes *int64 `db:"file_size_bytes"`
}
type Documentclean struct {
ID uuid.UUID `db:"id"`
Documentid uuid.UUID `db:"documentid"`
Bucket *string `db:"bucket"`
Key *string `db:"key"`
Hash *string `db:"hash"`
Mimetype NullCleanmimetype `db:"mimetype"`
Fail NullCleanfailtype `db:"fail"`
}
type Documentcleanentry struct {
ID uuid.UUID `db:"id"`
Cleanid uuid.UUID `db:"cleanid"`
Version int64 `db:"version"`
}
type Documententry struct {
ID uuid.UUID `db:"id"`
Documentid uuid.UUID `db:"documentid"`
// S3 bucket name. IMMUTABLE after creation - never modify this value.
Bucket string `db:"bucket"`
// S3 object key. IMMUTABLE after creation - never modify this value.
Key string `db:"key"`
}
type Documentfieldextraction struct {
ID uuid.UUID `db:"id"`
Documentid uuid.UUID `db:"documentid"`
Filename *string `db:"filename"`
Contracttitle *string `db:"contracttitle"`
Aaretederivedamendmentnum *int32 `db:"aaretederivedamendmentnum"`
Clientname *string `db:"clientname"`
Payername *string `db:"payername"`
Payerstate *string `db:"payerstate"`
Providerstate *string `db:"providerstate"`
Filenametin *string `db:"filenametin"`
Provgrouptin *string `db:"provgrouptin"`
Provgroupnpi *string `db:"provgroupnpi"`
Provgroupnamefull *string `db:"provgroupnamefull"`
Provothertin *string `db:"provothertin"`
Provothernpi *string `db:"provothernpi"`
Provothernamefull *string `db:"provothernamefull"`
Aaretederivedeffectivedt pgtype.Date `db:"aaretederivedeffectivedt"`
Aaretederivedterminationdt pgtype.Date `db:"aaretederivedterminationdt"`
Autorenewalind *bool `db:"autorenewalind"`
Autorenewalterm *string `db:"autorenewalterm"`
Createdat pgtype.Timestamp `db:"createdat"`
Createdby string `db:"createdby"`
}
type Documentfieldextractionarrayfield struct {
ID uuid.UUID `db:"id"`
Fieldextractionid uuid.UUID `db:"fieldextractionid"`
Arrayindex int16 `db:"arrayindex"`
Exhibittitle *string `db:"exhibittitle"`
Exhibitpage *string `db:"exhibitpage"`
Reimbprovtin *string `db:"reimbprovtin"`
Reimbprovnpi *string `db:"reimbprovnpi"`
Reimbprovname *string `db:"reimbprovname"`
Reimbeffectivedt pgtype.Date `db:"reimbeffectivedt"`
Reimbterminationdt pgtype.Date `db:"reimbterminationdt"`
Aaretederivedclaimtypecd *string `db:"aaretederivedclaimtypecd"`
Aaretederivedproduct *string `db:"aaretederivedproduct"`
Aaretederivedlob *string `db:"aaretederivedlob"`
Aaretederivedprogram *string `db:"aaretederivedprogram"`
Aaretederivednetwork *string `db:"aaretederivednetwork"`
Aaretederivedprovtype *string `db:"aaretederivedprovtype"`
Provtaxonomycd *string `db:"provtaxonomycd"`
Provtaxonomycddesc *string `db:"provtaxonomycddesc"`
Provspecialtycd *string `db:"provspecialtycd"`
Provspecialtycddesc *string `db:"provspecialtycddesc"`
Placeofservicecd *string `db:"placeofservicecd"`
Placeofservicecddesc *string `db:"placeofservicecddesc"`
Billtypecd *string `db:"billtypecd"`
Billtypecddesc *string `db:"billtypecddesc"`
Patientagemin *string `db:"patientagemin"`
Patientagemax *string `db:"patientagemax"`
Reimbterm *string `db:"reimbterm"`
Lobprogramrelationship *string `db:"lobprogramrelationship"`
Lobproductrelationship *string `db:"lobproductrelationship"`
Carveoutind *bool `db:"carveoutind"`
Carveoutcd *string `db:"carveoutcd"`
Lesserofind *bool `db:"lesserofind"`
Greaterofind *bool `db:"greaterofind"`
Aaretederivedreimbmethod *string `db:"aaretederivedreimbmethod"`
Unitofmeasure *string `db:"unitofmeasure"`
Reimbpctrate pgtype.Numeric `db:"reimbpctrate"`
Reimbfeerate pgtype.Numeric `db:"reimbfeerate"`
Reimbconversionfactor pgtype.Numeric `db:"reimbconversionfactor"`
Triggercapthresholdamt pgtype.Numeric `db:"triggercapthresholdamt"`
Triggerbasethreshold pgtype.Numeric `db:"triggerbasethreshold"`
Defaultind *bool `db:"defaultind"`
Additiondesc *string `db:"additiondesc"`
Additionmaxfeerateinc pgtype.Numeric `db:"additionmaxfeerateinc"`
Additionmaxpctrateinc pgtype.Numeric `db:"additionmaxpctrateinc"`
Aaretederivedadditionratechangetimeline *string `db:"aaretederivedadditionratechangetimeline"`
Aaretederivedfeeschedule *string `db:"aaretederivedfeeschedule"`
Aaretederivedfeescheduleversion *string `db:"aaretederivedfeescheduleversion"`
Serviceterm *string `db:"serviceterm"`
Cpt4proccd *string `db:"cpt4proccd"`
Cpt4proccddesc *string `db:"cpt4proccddesc"`
Cpt4procmod *string `db:"cpt4procmod"`
Cpt4procmoddesc *string `db:"cpt4procmoddesc"`
Revenuecd *string `db:"revenuecd"`
Revenuecddesc *string `db:"revenuecddesc"`
Diagcd *string `db:"diagcd"`
Diagcddesc *string `db:"diagcddesc"`
Ndccd *string `db:"ndccd"`
Ndccddesc *string `db:"ndccddesc"`
Claimadmittypecd *string `db:"claimadmittypecd"`
Authadmittypedesc *string `db:"authadmittypedesc"`
Claimstatuscd *string `db:"claimstatuscd"`
Claimstatuscddesc *string `db:"claimstatuscddesc"`
Groupertype *string `db:"groupertype"`
Groupercd *string `db:"groupercd"`
Groupercddesc *string `db:"groupercddesc"`
Grouperpctrate pgtype.Numeric `db:"grouperpctrate"`
Grouperbaserate pgtype.Numeric `db:"grouperbaserate"`
Aaretederivedgrouperversion *string `db:"aaretederivedgrouperversion"`
Grouperalternativelevelofcare *string `db:"grouperalternativelevelofcare"`
Grouperseverityind *bool `db:"grouperseverityind"`
Grouperseverity *string `db:"grouperseverity"`
Grouperriskofmortalitysubclass *string `db:"grouperriskofmortalitysubclass"`
Groupertransferind *bool `db:"groupertransferind"`
Grouperreadmissionsind *bool `db:"grouperreadmissionsind"`
Grouperhacind *bool `db:"grouperhacind"`
Outlierterm *string `db:"outlierterm"`
Outlierfirstdollarind *bool `db:"outlierfirstdollarind"`
Rangenbrdays *string `db:"rangenbrdays"`
Outlierfixedlossnbrdaysthreshold pgtype.Numeric `db:"outlierfixedlossnbrdaysthreshold"`
Outlierfixedlossthreshold pgtype.Numeric `db:"outlierfixedlossthreshold"`
Outliermaximum pgtype.Numeric `db:"outliermaximum"`
Outliermaximumfrequency pgtype.Numeric `db:"outliermaximumfrequency"`
Outlierpctrate pgtype.Numeric `db:"outlierpctrate"`
Outlierexclusioncd *string `db:"outlierexclusioncd"`
Outlierexclusioncddesc *string `db:"outlierexclusioncddesc"`
Facilityadjustmentterm *string `db:"facilityadjustmentterm"`
Dshind *bool `db:"dshind"`
Dshpctrate pgtype.Numeric `db:"dshpctrate"`
Dshfeerate pgtype.Numeric `db:"dshfeerate"`
Imeind *bool `db:"imeind"`
Imepctrate pgtype.Numeric `db:"imepctrate"`
Imefeerate pgtype.Numeric `db:"imefeerate"`
Ntapind *bool `db:"ntapind"`
Ntappctrate pgtype.Numeric `db:"ntappctrate"`
Ntapfeerate pgtype.Numeric `db:"ntapfeerate"`
Ucind *bool `db:"ucind"`
Ucpctrate pgtype.Numeric `db:"ucpctrate"`
Ucfeerate pgtype.Numeric `db:"ucfeerate"`
Gmeind *bool `db:"gmeind"`
Gmepctrate pgtype.Numeric `db:"gmepctrate"`
Gmefeerate pgtype.Numeric `db:"gmefeerate"`
Rateescalatorind *bool `db:"rateescalatorind"`
Rateescalatordesc *string `db:"rateescalatordesc"`
Rateescalatormaxrateincpct pgtype.Numeric `db:"rateescalatormaxrateincpct"`
Rateescalatorratechangetimeline pgtype.Numeric `db:"rateescalatorratechangetimeline"`
Stoplossterm *string `db:"stoplossterm"`
Stoplossfirstdollarind *bool `db:"stoplossfirstdollarind"`
Stoplossrangenbrdays pgtype.Numeric `db:"stoplossrangenbrdays"`
Stoplossfixedlossthreshold pgtype.Numeric `db:"stoplossfixedlossthreshold"`
Stoplossmaximum pgtype.Numeric `db:"stoplossmaximum"`
Stoplossmaximumfrequency pgtype.Numeric `db:"stoplossmaximumfrequency"`
Stoplossdailymaxrate pgtype.Numeric `db:"stoplossdailymaxrate"`
Stoplosspctrateonexcesscharges pgtype.Numeric `db:"stoplosspctrateonexcesscharges"`
Stoplossexclusioncd *string `db:"stoplossexclusioncd"`
Stoplossexclusiondesc *string `db:"stoplossexclusiondesc"`
}
type Documentfieldextractionversion struct {
ID uuid.UUID `db:"id"`
Fieldextractionid uuid.UUID `db:"fieldextractionid"`
Version int64 `db:"version"`
Createdby string `db:"createdby"`
Createdat pgtype.Timestamp `db:"createdat"`
Documentid uuid.UUID `db:"documentid"`
}
type Documentlabel struct {
ID uuid.UUID `db:"id"`
Documentid uuid.UUID `db:"documentid"`
Label string `db:"label"`
Appliedat pgtype.Timestamp `db:"appliedat"`
Appliedby string `db:"appliedby"`
}
type Documentupload struct {
ID uuid.UUID `db:"id"`
Bucket string `db:"bucket"`
Key string `db:"key"`
Clientid string `db:"clientid"`
Part uint16 `db:"part"`
Createdat pgtype.Timestamp `db:"createdat"`
Filename *string `db:"filename"`
BatchID *uuid.UUID `db:"batch_id"`
FolderID *uuid.UUID `db:"folder_id"`
}
type Eulaagreement struct {
ID uuid.UUID `db:"id"`
Cognitosubjectid string `db:"cognitosubjectid"`
Useremail string `db:"useremail"`
Eulaversionid uuid.UUID `db:"eulaversionid"`
Agreedat pgtype.Timestamptz `db:"agreedat"`
Agreedfromip string `db:"agreedfromip"`
}
type Eulaversion struct {
ID uuid.UUID `db:"id"`
Version string `db:"version"`
Title string `db:"title"`
Content string `db:"content"`
Effectivedate pgtype.Timestamptz `db:"effectivedate"`
Createdat pgtype.Timestamptz `db:"createdat"`
Createdby string `db:"createdby"`
Iscurrent bool `db:"iscurrent"`
Activatedat pgtype.Timestamptz `db:"activatedat"`
Activatedby *string `db:"activatedby"`
}
// Virtual folder hierarchy for document organization. Database-only - has no direct relationship to S3 storage locations.
type Folder struct {
ID uuid.UUID `db:"id"`
// Virtual folder path (e.g., "/contracts/2025"). Can be renamed without affecting S3 storage.
Path string `db:"path"`
Parentid *uuid.UUID `db:"parentid"`
Clientid string `db:"clientid"`
Createdat pgtype.Timestamp `db:"createdat"`
Createdby string `db:"createdby"`
}
type Fullactivecollector struct {
Clientid string `db:"clientid"`
Mincleanversion int64 `db:"mincleanversion"`
Activeversion int32 `db:"activeversion"`
Latestversion int32 `db:"latestversion"`
}
type Fullclient struct {
Clientid string `db:"clientid"`
Name string `db:"name"`
Cansync bool `db:"cansync"`
}
type Label struct {
Label string `db:"label"`
Description string `db:"description"`
}
type UiSetting struct {
ID uuid.UUID `db:"id"`
Namespace string `db:"namespace"`
Key string `db:"key"`
Value []byte `db:"value"`
IsDeleted bool `db:"isDeleted"`
CreatedAt pgtype.Timestamptz `db:"createdAt"`
UpdatedAt pgtype.Timestamptz `db:"updatedAt"`
}