-
Notifications
You must be signed in to change notification settings - Fork 2
/
attorney_decisions.go
49 lines (39 loc) · 1.44 KB
/
attorney_decisions.go
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
package actor
//go:generate enumerator -type AttorneysAct -linecomment -empty
type AttorneysAct uint8
const (
// Jointly indicates attorneys or replacement attorneys should act jointly
Jointly AttorneysAct = iota + 1 // jointly
// JointlyAndSeverally indicates attorneys or replacement attorneys should act
// jointly and severally
JointlyAndSeverally // jointly-and-severally
// JointlyForSomeSeverallyForOthers indicates attorneys or replacement
// attorneys should act jointly for some decisions, and jointly and severally
// for other decisions
JointlyForSomeSeverallyForOthers // jointly-for-some-severally-for-others
)
// AttorneyDecisions contains details about how an attorney or replacement attorney should act, provided by the applicant
type AttorneyDecisions struct {
// How attorneys should make decisions
How AttorneysAct
// Details on how attorneys should make decisions if acting jointly for some decisions, and jointly and severally for other decisions
Details string
}
func MakeAttorneyDecisions(existing AttorneyDecisions, how AttorneysAct, details string) AttorneyDecisions {
if existing.How == how {
if how == JointlyForSomeSeverallyForOthers {
existing.Details = details
}
return existing
}
if how != JointlyForSomeSeverallyForOthers {
return AttorneyDecisions{How: how}
}
return AttorneyDecisions{
How: how,
Details: details,
}
}
func (d AttorneyDecisions) IsComplete() bool {
return !d.How.Empty()
}