You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

157 lines
6.3KB

  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. DraftSuggestionSourceFallbackRuleBased = "fallback-rule-based"
  86. DraftSuggestionSourceRuleBased = DraftSuggestionSourceFallbackRuleBased
  87. DraftSuggestionStatusSuggested = "suggested"
  88. DraftSuggestionStatusApplied = "applied"
  89. DraftSuggestionStatusDismissed = "dismissed"
  90. )
  91. type DraftSuggestion struct {
  92. FieldPath string `json:"fieldPath"`
  93. Slot string `json:"slot,omitempty"`
  94. Value string `json:"value"`
  95. Reason string `json:"reason,omitempty"`
  96. Source string `json:"source,omitempty"`
  97. Status string `json:"status,omitempty"`
  98. GeneratedAt time.Time `json:"generatedAt,omitempty"`
  99. UpdatedAt time.Time `json:"updatedAt,omitempty"`
  100. }
  101. type DraftSuggestionState struct {
  102. ByFieldPath map[string]DraftSuggestion `json:"byFieldPath,omitempty"`
  103. UpdatedAt time.Time `json:"updatedAt,omitempty"`
  104. }
  105. type DraftStyleProfile struct {
  106. LocaleStyle string `json:"localeStyle,omitempty"`
  107. MarketStyle string `json:"marketStyle,omitempty"`
  108. AddressMode string `json:"addressMode,omitempty"`
  109. ContentTone string `json:"contentTone,omitempty"`
  110. PromptInstructions string `json:"promptInstructions,omitempty"`
  111. }
  112. type PromptBlockConfig struct {
  113. ID string `json:"id"`
  114. Label string `json:"label,omitempty"`
  115. Instruction string `json:"instruction,omitempty"`
  116. Enabled bool `json:"enabled"`
  117. }
  118. type DraftPromptConfig struct {
  119. Blocks []PromptBlockConfig `json:"blocks,omitempty"`
  120. }
  121. type DraftLLMContext struct {
  122. BusinessType string `json:"businessType,omitempty"`
  123. WebsiteURL string `json:"websiteUrl,omitempty"`
  124. WebsiteSummary string `json:"websiteSummary,omitempty"`
  125. StyleProfile DraftStyleProfile `json:"styleProfile,omitempty"`
  126. Prompt DraftPromptConfig `json:"prompt,omitempty"`
  127. }
  128. type DraftContext struct {
  129. IntakeSource string `json:"intakeSource,omitempty"`
  130. LLM DraftLLMContext `json:"llm,omitempty"`
  131. }
  132. type AppSettings struct {
  133. QCBaseURL string `json:"qcBaseUrl"`
  134. QCBearerTokenEncrypted string `json:"qcBearerTokenEncrypted"`
  135. LanguageOutputMode string `json:"languageOutputMode"`
  136. JobPollIntervalSeconds int `json:"jobPollIntervalSeconds"`
  137. JobPollTimeoutSeconds int `json:"jobPollTimeoutSeconds"`
  138. MasterPrompt string `json:"masterPrompt,omitempty"`
  139. PromptBlocks []PromptBlockConfig `json:"promptBlocks,omitempty"`
  140. }