forked from votrongdao/FlowX
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPerformanceFlows.cs
More file actions
73 lines (64 loc) · 2.64 KB
/
Copy pathPerformanceFlows.cs
File metadata and controls
73 lines (64 loc) · 2.64 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
using FlowX;
namespace Crm;
/// <summary>The plan tree of a period.</summary>
[Flow("crm.planning.tree", Version = "1.0.0", Profile = ExecutionProfile.Ephemeral, Owner = "crm-platform")]
[FlowDeadline("PT30S")]
[HttpTrigger("POST", "/api/v1/crm/planning/tree")]
public sealed partial class PlanTreeFlow : Flow<ReadPlanTree, PlanTree>
{
/// <inheritdoc />
protected override void Define(IFlowBuilder<ReadPlanTree, PlanTree> flow)
{
ArgumentNullException.ThrowIfNull(flow);
flow
.Step<ReadCrmPlanTree>()
.Return(ctx => ctx.Get<PlanTree>());
}
}
/// <summary>How the people in the caller's organisation are doing.</summary>
[Flow("crm.performance.sales", Version = "1.0.0", Profile = ExecutionProfile.Ephemeral, Owner = "crm-platform")]
[FlowDeadline("PT30S")]
[HttpTrigger("POST", "/api/v1/crm/performance/sales")]
public sealed partial class SalesPerformanceFlow : Flow<ReadSalesPerformance, SalesPerformance>
{
/// <inheritdoc />
protected override void Define(IFlowBuilder<ReadSalesPerformance, SalesPerformance> flow)
{
ArgumentNullException.ThrowIfNull(flow);
flow
.Step<ReadCrmSalesPerformance, ForPerformance>(
ctx => new ForPerformance(ctx.Input.Period, Caller.Subject(ctx.Principal)))
.Return(ctx => ctx.Get<SalesPerformance>());
}
}
/// <summary>How the deals themselves are doing.</summary>
[Flow("crm.performance.deals", Version = "1.0.0", Profile = ExecutionProfile.Ephemeral, Owner = "crm-platform")]
[FlowDeadline("PT30S")]
[HttpTrigger("POST", "/api/v1/crm/performance/deals")]
public sealed partial class DealPerformanceFlow : Flow<ReadDealPerformance, DealPerformance>
{
/// <inheritdoc />
protected override void Define(IFlowBuilder<ReadDealPerformance, DealPerformance> flow)
{
ArgumentNullException.ThrowIfNull(flow);
flow
.Step<ReadCrmDealPerformance>()
.Return(ctx => ctx.Get<DealPerformance>());
}
}
/// <summary>Everything a board looks at, in one request.</summary>
[Flow("crm.board", Version = "1.0.0", Profile = ExecutionProfile.Ephemeral, Owner = "crm-platform")]
[FlowDeadline("PT60S")]
[HttpTrigger("POST", "/api/v1/crm/board")]
public sealed partial class BoardFlow : Flow<ReadBoard, ExecutiveBoard>
{
/// <inheritdoc />
protected override void Define(IFlowBuilder<ReadBoard, ExecutiveBoard> flow)
{
ArgumentNullException.ThrowIfNull(flow);
flow
.Step<ReadExecutiveBoard, ForPerformance>(
ctx => new ForPerformance(ctx.Input.Period, Caller.Subject(ctx.Principal)))
.Return(ctx => ctx.Get<ExecutiveBoard>());
}
}