This commit is contained in:
2025-08-22 19:19:16 -04:00
parent df567983c1
commit 93831d4fad
36 changed files with 22412 additions and 29 deletions

View File

@ -48,8 +48,8 @@ func (r *ApplicationRepository) Create(ctx context.Context, app *domain.Applicat
pq.Array(typeStrings),
app.CallbackURL,
app.HMACKey,
app.TokenRenewalDuration.Nanoseconds(),
app.MaxTokenDuration.Nanoseconds(),
app.TokenRenewalDuration.Duration.Nanoseconds(),
app.MaxTokenDuration.Duration.Nanoseconds(),
string(app.Owner.Type),
app.Owner.Name,
app.Owner.Owner,
@ -118,8 +118,8 @@ func (r *ApplicationRepository) GetByID(ctx context.Context, appID string) (*dom
}
// Convert nanoseconds to duration
app.TokenRenewalDuration = time.Duration(tokenRenewalNanos)
app.MaxTokenDuration = time.Duration(maxTokenNanos)
app.TokenRenewalDuration = domain.Duration{Duration: time.Duration(tokenRenewalNanos)}
app.MaxTokenDuration = domain.Duration{Duration: time.Duration(maxTokenNanos)}
// Convert owner type
app.Owner.Type = domain.OwnerType(ownerType)
@ -180,8 +180,8 @@ func (r *ApplicationRepository) List(ctx context.Context, limit, offset int) ([]
}
// Convert nanoseconds to duration
app.TokenRenewalDuration = time.Duration(tokenRenewalNanos)
app.MaxTokenDuration = time.Duration(maxTokenNanos)
app.TokenRenewalDuration = domain.Duration{Duration: time.Duration(tokenRenewalNanos)}
app.MaxTokenDuration = domain.Duration{Duration: time.Duration(maxTokenNanos)}
// Convert owner type
app.Owner.Type = domain.OwnerType(ownerType)
@ -233,13 +233,13 @@ func (r *ApplicationRepository) Update(ctx context.Context, appID string, update
if updates.TokenRenewalDuration != nil {
setParts = append(setParts, fmt.Sprintf("token_renewal_duration = $%d", argIndex))
args = append(args, updates.TokenRenewalDuration.Nanoseconds())
args = append(args, updates.TokenRenewalDuration.Duration.Nanoseconds())
argIndex++
}
if updates.MaxTokenDuration != nil {
setParts = append(setParts, fmt.Sprintf("max_token_duration = $%d", argIndex))
args = append(args, updates.MaxTokenDuration.Nanoseconds())
args = append(args, updates.MaxTokenDuration.Duration.Nanoseconds())
argIndex++
}