forked from yvv/decision
v3 : dixième relecture — mention « sur invitation », noms attendus protégés
- Tout auteur venu par invitation porte « sur invitation » à côté de son nom (propositions, révisions, signalements) : un nom pris avant l'arrivée de son titulaire Ğ1, ou une lettre sosie, ne passe pas pour un membre de la toile. - Un lien d'équipe refuse aussi le nom qu'une invitation attend encore. Boucle : 68 tests Rust, svelte-check, 9 vitest, e2e 13/13. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -210,6 +210,9 @@ pub struct ProposalRow {
|
||||
pub label: Option<String>,
|
||||
pub author_id: Option<String>,
|
||||
pub author_name: Option<String>,
|
||||
/// The author came by invitation, not with a Ğ1 key: shown next to the name,
|
||||
/// so a name taken ahead of its owner, or a look-alike, does not pass for them.
|
||||
pub author_invited: Option<bool>,
|
||||
pub revision: i64,
|
||||
pub created_at: String,
|
||||
pub updated_at: String,
|
||||
@@ -220,7 +223,7 @@ pub struct ProposalRow {
|
||||
|
||||
pub const PROPOSAL_SELECT: &str =
|
||||
"SELECT p.id, p.unit_id, p.kind, p.inertia_target, p.title, p.body, p.status, p.origin,
|
||||
p.label, p.author_id, i.display_name AS author_name, p.revision, p.created_at, p.updated_at, p.submitted_at,
|
||||
p.label, p.author_id, i.display_name AS author_name, i.kind = 'invite' AS author_invited, p.revision, p.created_at, p.updated_at, p.submitted_at,
|
||||
p.entered_at, p.confirmed_at
|
||||
FROM proposals p LEFT JOIN identities i ON i.id = p.author_id";
|
||||
|
||||
@@ -466,7 +469,9 @@ fn proposal_json(
|
||||
json!({
|
||||
"id": p.id, "unitId": p.unit_id, "kind": kind, "inertiaTarget": target,
|
||||
"title": p.title, "body": p.body, "status": p.status, "origin": p.origin, "label": p.label,
|
||||
"author": p.author_id.as_ref().map(|id| json!({ "id": id, "name": p.author_name })),
|
||||
"author": p.author_id.as_ref().map(|id| json!({
|
||||
"id": id, "name": p.author_name, "invited": p.author_invited.unwrap_or(false),
|
||||
})),
|
||||
"mine": p.author_id.as_deref() == Some(me),
|
||||
"revision": p.revision, "createdAt": p.created_at, "updatedAt": p.updated_at,
|
||||
"submittedAt": p.submitted_at, "enteredAt": p.entered_at, "confirmedAt": p.confirmed_at,
|
||||
|
||||
Reference in New Issue
Block a user