Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

168 lines
7.2KB

  1. package domain
  2. import (
  3. "encoding/json"
  4. "time"
  5. )
  6. type Template struct {
  7. ID int64 `json:"id"`
  8. Name string `json:"name"`
  9. Description string `json:"description"`
  10. Locale string `json:"locale"`
  11. ThumbnailURL string `json:"thumbnailUrl"`
  12. TemplatePreviewURL string `json:"templatePreviewUrl"`
  13. Type string `json:"type"`
  14. PaletteReady bool `json:"paletteReady"`
  15. RawJSON json.RawMessage `json:"rawTemplateJson"`
  16. IsAITemplate bool `json:"isAiTemplate"`
  17. IsOnboarded bool `json:"isOnboarded"`
  18. ManifestStatus string `json:"manifestStatus"`
  19. LastDiscoveredAt *time.Time `json:"lastDiscoveredAt,omitempty"`
  20. }
  21. type TemplateManifest struct {
  22. ID string `json:"id"`
  23. TemplateID int64 `json:"templateId"`
  24. Version int `json:"version"`
  25. Source string `json:"source"`
  26. LanguageUsedDiscovery string `json:"languageUsedForDiscovery"`
  27. DiscoveryPayloadJSON json.RawMessage `json:"discoveryPayloadJson"`
  28. DiscoveryResponseJSON json.RawMessage `json:"discoveryResponseJson"`
  29. FlattenedManifestJSON json.RawMessage `json:"flattenedManifestJson"`
  30. IsActive bool `json:"isActive"`
  31. CreatedAt time.Time `json:"createdAt"`
  32. UpdatedAt time.Time `json:"updatedAt"`
  33. }
  34. type TemplateField struct {
  35. ID string `json:"id"`
  36. TemplateID int64 `json:"templateId"`
  37. ManifestID string `json:"manifestId"`
  38. Section string `json:"section"`
  39. WebsiteSection string `json:"websiteSection"`
  40. KeyName string `json:"keyName"`
  41. Path string `json:"path"`
  42. FieldKind string `json:"fieldKind"`
  43. SampleValue string `json:"sampleValue"`
  44. IsEnabled bool `json:"isEnabled"`
  45. IsRequiredByUs bool `json:"isRequiredByUs"`
  46. DisplayLabel string `json:"displayLabel"`
  47. DisplayOrder int `json:"displayOrder"`
  48. Notes string `json:"notes"`
  49. }
  50. type SiteBuild struct {
  51. ID string `json:"id"`
  52. TemplateID int64 `json:"templateId"`
  53. ManifestID string `json:"manifestId"`
  54. RequestName string `json:"requestName"`
  55. GlobalDataJSON json.RawMessage `json:"globalDataJson"`
  56. AIDataJSON json.RawMessage `json:"aiDataJson"`
  57. FinalSitesPayload json.RawMessage `json:"finalSitesPayloadJson"`
  58. QCJobID *int64 `json:"qcJobId,omitempty"`
  59. QCSiteID *int64 `json:"qcSiteId,omitempty"`
  60. QCStatus string `json:"qcStatus"`
  61. QCPreviewURL string `json:"qcPreviewUrl"`
  62. QCEditorURL string `json:"qcEditorUrl"`
  63. QCResultJSON json.RawMessage `json:"qcResultJson"`
  64. QCErrorJSON json.RawMessage `json:"qcErrorJson"`
  65. StartedAt *time.Time `json:"startedAt,omitempty"`
  66. FinishedAt *time.Time `json:"finishedAt,omitempty"`
  67. }
  68. type BuildDraft struct {
  69. ID string `json:"id"`
  70. TemplateID int64 `json:"templateId"`
  71. ManifestID string `json:"manifestId"`
  72. Source string `json:"source"`
  73. RequestName string `json:"requestName"`
  74. GlobalDataJSON json.RawMessage `json:"globalDataJson"`
  75. FieldValuesJSON json.RawMessage `json:"fieldValuesJson"`
  76. DraftContextJSON json.RawMessage `json:"draftContextJson"`
  77. SuggestionStateJSON json.RawMessage `json:"suggestionStateJson"`
  78. Status string `json:"status"`
  79. Notes string `json:"notes"`
  80. CreatedAt time.Time `json:"createdAt"`
  81. UpdatedAt time.Time `json:"updatedAt"`
  82. }
  83. const (
  84. DraftSuggestionSourceLLM = "llm"
  85. DraftSuggestionSourceQCLLM = "qc-llm"
  86. DraftSuggestionSourceFallbackRuleBased = "fallback-rule-based"
  87. DraftSuggestionSourceRuleBased = DraftSuggestionSourceFallbackRuleBased
  88. DraftSuggestionStatusSuggested = "suggested"
  89. DraftSuggestionStatusApplied = "applied"
  90. DraftSuggestionStatusDismissed = "dismissed"
  91. )
  92. type DraftSuggestion struct {
  93. FieldPath string `json:"fieldPath"`
  94. Slot string `json:"slot,omitempty"`
  95. Value string `json:"value"`
  96. Reason string `json:"reason,omitempty"`
  97. Source string `json:"source,omitempty"`
  98. Status string `json:"status,omitempty"`
  99. GeneratedAt time.Time `json:"generatedAt,omitempty"`
  100. UpdatedAt time.Time `json:"updatedAt,omitempty"`
  101. }
  102. type DraftSuggestionState struct {
  103. ByFieldPath map[string]DraftSuggestion `json:"byFieldPath,omitempty"`
  104. UpdatedAt time.Time `json:"updatedAt,omitempty"`
  105. }
  106. type DraftStyleProfile struct {
  107. LocaleStyle string `json:"localeStyle,omitempty"`
  108. MarketStyle string `json:"marketStyle,omitempty"`
  109. AddressMode string `json:"addressMode,omitempty"`
  110. ContentTone string `json:"contentTone,omitempty"`
  111. PromptInstructions string `json:"promptInstructions,omitempty"`
  112. }
  113. type PromptBlockConfig struct {
  114. ID string `json:"id"`
  115. Label string `json:"label,omitempty"`
  116. Instruction string `json:"instruction,omitempty"`
  117. Enabled bool `json:"enabled"`
  118. }
  119. type DraftPromptConfig struct {
  120. Blocks []PromptBlockConfig `json:"blocks,omitempty"`
  121. }
  122. type DraftLLMContext struct {
  123. BusinessType string `json:"businessType,omitempty"`
  124. WebsiteURL string `json:"websiteUrl,omitempty"`
  125. WebsiteSummary string `json:"websiteSummary,omitempty"`
  126. StyleProfile DraftStyleProfile `json:"styleProfile,omitempty"`
  127. Prompt DraftPromptConfig `json:"prompt,omitempty"`
  128. }
  129. type DraftContext struct {
  130. IntakeSource string `json:"intakeSource,omitempty"`
  131. LLM DraftLLMContext `json:"llm,omitempty"`
  132. }
  133. type AppSettings struct {
  134. QCBaseURL string `json:"qcBaseUrl"`
  135. QCBearerTokenEncrypted string `json:"qcBearerTokenEncrypted"`
  136. LanguageOutputMode string `json:"languageOutputMode"`
  137. JobPollIntervalSeconds int `json:"jobPollIntervalSeconds"`
  138. JobPollTimeoutSeconds int `json:"jobPollTimeoutSeconds"`
  139. LLMActiveProvider string `json:"llmActiveProvider,omitempty"`
  140. LLMActiveModel string `json:"llmActiveModel,omitempty"`
  141. LLMBaseURL string `json:"llmBaseUrl,omitempty"`
  142. LLMTemperature float64 `json:"llmTemperature,omitempty"`
  143. LLMMaxTokens int `json:"llmMaxTokens,omitempty"`
  144. OpenAIAPIKeyEncrypted string `json:"openAiApiKeyEncrypted,omitempty"`
  145. AnthropicAPIKeyEncrypted string `json:"anthropicApiKeyEncrypted,omitempty"`
  146. GoogleAPIKeyEncrypted string `json:"googleApiKeyEncrypted,omitempty"`
  147. XAIAPIKeyEncrypted string `json:"xaiApiKeyEncrypted,omitempty"`
  148. OllamaAPIKeyEncrypted string `json:"ollamaApiKeyEncrypted,omitempty"`
  149. MasterPrompt string `json:"masterPrompt,omitempty"`
  150. PromptBlocks []PromptBlockConfig `json:"promptBlocks,omitempty"`
  151. }