Template recommendation implemented

This commit is contained in:
adilallo
2026-04-29 19:24:50 -06:00
parent c4c74ecdb4
commit a4f0c4bf27
20 changed files with 899 additions and 82 deletions
+21
View File
@@ -111,3 +111,24 @@ model MethodFacet {
@@index([section])
@@index([group, value, matches])
}
/// Template-level recommendation matrix (Template Composition, cols GY). Canonical
/// JSON in `data/templates/templateFacet.json`; rebuilt at seed like
/// `MethodFacet`. One row per `(templateSlug, group, value)` where the matrix
/// marks a fit (✓). `GET /api/templates?facet.*` joins these rows to user facets.
/// See `docs/guides/template-recommendation-matrix.md` (parallel to `MethodFacet` §7).
model TemplateFacet {
id String @id @default(cuid())
/// `RuleTemplate.slug` (e.g. `consensus`, `do-ocracy`).
templateSlug String
/// `size` | `orgType` | `scale` | `maturity` — same as `MethodFacet.group`.
group String
/// Canonical facet value id, e.g. `workersCoop`, `local`.
value String
/// `true` iff the JSON marks a fit; seed only writes `true` rows.
matches Boolean
@@unique([templateSlug, group, value])
@@index([templateSlug])
@@index([group, value, matches])
}