feat: document templates with auto-fill (P1)

This commit is contained in:
m
2026-03-30 11:29:23 +02:00
17 changed files with 1568 additions and 89 deletions

View File

@@ -14,6 +14,19 @@ const (
userRoleKey contextKey = "user_role"
ipKey contextKey = "ip_address"
userAgentKey contextKey = "user_agent"
<<<<<<< HEAD
||||||| 8e65463
||||||| 82878df
userIDKey contextKey = "user_id"
tenantIDKey contextKey = "tenant_id"
=======
userIDKey contextKey = "user_id"
tenantIDKey contextKey = "tenant_id"
userRoleKey contextKey = "user_role"
>>>>>>> mai/pike/p0-role-based
=======
userRoleKey contextKey = "user_role"
>>>>>>> mai/ritchie/p1-document-templates
)
func ContextWithUserID(ctx context.Context, userID uuid.UUID) context.Context {
@@ -33,6 +46,7 @@ func TenantFromContext(ctx context.Context) (uuid.UUID, bool) {
id, ok := ctx.Value(tenantIDKey).(uuid.UUID)
return id, ok
}
<<<<<<< HEAD
func ContextWithUserRole(ctx context.Context, role string) context.Context {
return context.WithValue(ctx, userRoleKey, role)
@@ -42,6 +56,10 @@ func UserRoleFromContext(ctx context.Context) string {
role, _ := ctx.Value(userRoleKey).(string)
return role
}
||||||| 8e65463
<<<<<<< HEAD
=======
>>>>>>> mai/ritchie/p1-document-templates
func ContextWithRequestInfo(ctx context.Context, ip, userAgent string) context.Context {
ctx = context.WithValue(ctx, ipKey, ip)
@@ -62,3 +80,28 @@ func UserAgentFromContext(ctx context.Context) *string {
}
return nil
}
<<<<<<< HEAD
||||||| 8e65463
||||||| 82878df
=======
func ContextWithUserRole(ctx context.Context, role string) context.Context {
return context.WithValue(ctx, userRoleKey, role)
}
func UserRoleFromContext(ctx context.Context) string {
role, _ := ctx.Value(userRoleKey).(string)
return role
}
>>>>>>> mai/pike/p0-role-based
=======
func ContextWithUserRole(ctx context.Context, role string) context.Context {
return context.WithValue(ctx, userRoleKey, role)
}
func UserRoleFromContext(ctx context.Context) string {
role, _ := ctx.Value(userRoleKey).(string)
return role
}
>>>>>>> mai/ritchie/p1-document-templates