Initiatives: define internal datatype Initiative (#1417)

This commit is contained in:
Robin van Boven 2019-12-23 00:43:36 +01:00 committed by GitHub
parent 1b0eb483ce
commit 8f32912270
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 30 additions and 0 deletions

View File

@ -0,0 +1,30 @@
// @flow
import {type NodeAddressT} from "../../core/graph";
export type URL = string;
/**
* An intermediate representation of an Initiative.
*
* This makes the assumption a Champion cannot fail in championing.
* Instead of a success status, they should be removed if unsuccessful.
*
* There is also no timestamp for completion or each edge.
* It should be inferred from the node timestamps instead.
* We can support accurate edge timestamps by interpreting wiki histories.
* However the additional complexity and requirements put on the tracker
* don't seem worthwhile right now.
* Especially because cred can flow even before bounties are released.
* See https://discourse.sourcecred.io/t/write-the-initiatives-plugin/269/6
*/
export type Initiative = {|
+title: string,
+timestampMs: number,
+completed: boolean,
+tracker: NodeAddressT,
+dependencies: $ReadOnlyArray<URL>,
+references: $ReadOnlyArray<URL>,
+contributions: $ReadOnlyArray<URL>,
+champions: $ReadOnlyArray<URL>,
|};