Created
October 7, 2019 12:33
-
-
Save goldytech/358d9008314864d64f9351e8ed57bcd8 to your computer and use it in GitHub Desktop.
Agreement Life Cycle
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public enum StatusCategory | |
{ | |
Request, | |
InSignature, | |
InAuthoring, | |
InEffect, | |
Terminated, | |
Expired | |
} | |
public enum Status | |
{ | |
Request, | |
ReadyForSignatures, | |
OtherPartyReview, | |
OtherPartySignatures, | |
Activated, | |
BeingAmended, | |
Terminated, | |
Expired, | |
BeingRenewed, | |
InRenewal, | |
Unknown | |
} | |
public enum Transition | |
{ | |
CreateAgreement, | |
GenerateAgreement, | |
SendForReview, | |
SendForSignature, | |
Activate, | |
Amend, | |
Terminate, | |
Expire, | |
Renew, | |
Renewed | |
} | |
public class AgreementLifeCycle | |
{ | |
public static Status GetAgreementStatus(StatusCategory statusCategory, Transition transition) | |
{ | |
return (statusCategory, transition) switch | |
{ | |
(StatusCategory.Request, Transition.CreateAgreement) => Status.Request, | |
(StatusCategory.InSignature, Transition.GenerateAgreement) => Status.ReadyForSignatures, | |
(StatusCategory.InAuthoring, Transition.SendForReview) => Status.OtherPartyReview, | |
(StatusCategory.InSignature, Transition.SendForSignature) => Status.OtherPartySignatures, | |
(StatusCategory.InEffect, Transition.Activate) => Status.Activated, | |
(StatusCategory.InEffect, Transition.Amend) => Status.BeingAmended, | |
(StatusCategory.Terminated, Transition.Terminate) => Status.Terminated, | |
(StatusCategory.Expired, Transition.Expire) => Status.Expired, | |
(StatusCategory.InEffect, Transition.Renew) => Status.BeingRenewed, | |
(StatusCategory.Request, Transition.Renewed) => Status.InRenewal, | |
_ => Status.Unknown | |
}; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment