@@ -22,29 +22,61 @@ import uk.gov.hmrc.govukfrontend.views.viewmodels.checkboxes.CheckboxItem
2222import uk .gov .hmrc .govukfrontend .views .viewmodels .content .Text
2323import viewmodels .govuk .checkbox .*
2424
25- sealed trait PurchaserTypeOfCompany
25+ sealed trait PurchaserTypeOfCompany {
26+ def order : Int
27+ }
2628
2729object PurchaserTypeOfCompany extends Enumerable .Implicits {
2830
29- case object Bank extends WithName (" bank" ) with PurchaserTypeOfCompany
30- case object BuildingAssociation extends WithName (" buildingAssociation" ) with PurchaserTypeOfCompany
31- case object CentralGovernment extends WithName (" centralGovernment" ) with PurchaserTypeOfCompany
32- case object IndividualOther extends WithName (" individualOther" ) with PurchaserTypeOfCompany
33- case object InsuranceAssurance extends WithName (" insuranceAssurance" ) with PurchaserTypeOfCompany
34- case object LocalAuthority extends WithName (" localAuthority" ) with PurchaserTypeOfCompany
35- case object Partnership extends WithName (" partnership" ) with PurchaserTypeOfCompany
36- case object PropertyCompany extends WithName (" propertyCompany" ) with PurchaserTypeOfCompany
37- case object PublicCorporation extends WithName (" publicCorporation" ) with PurchaserTypeOfCompany
38- case object OtherCompany extends WithName (" otherCompany" ) with PurchaserTypeOfCompany
39- case object OtherFinancialInstitute extends WithName (" otherFinancialInstitute" ) with PurchaserTypeOfCompany
40- case object OtherIncludingCharity extends WithName (" otherIncludingCharity" ) with PurchaserTypeOfCompany
41- case object SuperannuationOrPensionFund extends WithName (" superannuationOrPensionFund" ) with PurchaserTypeOfCompany
42- case object UnincorporatedBuilder extends WithName (" unincorporatedBuilder" ) with PurchaserTypeOfCompany
43- case object UnincorporatedSoleTrader extends WithName (" unincorporatedSoleTrader" ) with PurchaserTypeOfCompany
31+ case object UnincorporatedBuilder extends WithName (" unincorporatedBuilder" ) with PurchaserTypeOfCompany {
32+ val order = 1
33+ }
34+ case object UnincorporatedSoleTrader extends WithName (" unincorporatedSoleTrader" ) with PurchaserTypeOfCompany {
35+ val order = 2
36+ }
37+ case object IndividualOther extends WithName (" individualOther" ) with PurchaserTypeOfCompany {
38+ val order = 3
39+ }
40+ case object Partnership extends WithName (" partnership" ) with PurchaserTypeOfCompany {
41+ val order = 4
42+ }
43+ case object LocalAuthority extends WithName (" localAuthority" ) with PurchaserTypeOfCompany {
44+ val order = 5
45+ }
46+ case object CentralGovernment extends WithName (" centralGovernment" ) with PurchaserTypeOfCompany {
47+ val order = 6
48+ }
49+ case object PublicCorporation extends WithName (" publicCorporation" ) with PurchaserTypeOfCompany {
50+ val order = 7
51+ }
52+ case object PropertyCompany extends WithName (" propertyCompany" ) with PurchaserTypeOfCompany {
53+ val order = 8
54+ }
55+ case object Bank extends WithName (" bank" ) with PurchaserTypeOfCompany {
56+ val order = 9
57+ }
58+ case object BuildingSociety extends WithName (" buildingSociety" ) with PurchaserTypeOfCompany {
59+ val order = 10
60+ }
61+ case object InsuranceAssurance extends WithName (" insuranceAssurance" ) with PurchaserTypeOfCompany {
62+ val order = 11
63+ }
64+ case object SuperannuationOrPensionFund extends WithName (" superannuationOrPensionFund" ) with PurchaserTypeOfCompany {
65+ val order = 12
66+ }
67+ case object OtherFinancialInstitute extends WithName (" otherFinancialInstitute" ) with PurchaserTypeOfCompany {
68+ val order = 13
69+ }
70+ case object OtherCompany extends WithName (" otherCompany" ) with PurchaserTypeOfCompany {
71+ val order = 14
72+ }
73+ case object OtherIncludingCharity extends WithName (" otherIncludingCharity" ) with PurchaserTypeOfCompany {
74+ val order = 15
75+ }
4476
4577 val values : Seq [PurchaserTypeOfCompany ] = Seq (
4678 Bank ,
47- BuildingAssociation ,
79+ BuildingSociety ,
4880 CentralGovernment ,
4981 IndividualOther ,
5082 InsuranceAssurance ,
@@ -58,7 +90,7 @@ object PurchaserTypeOfCompany extends Enumerable.Implicits {
5890 SuperannuationOrPensionFund ,
5991 UnincorporatedBuilder ,
6092 UnincorporatedSoleTrader
61- )
93+ ).sortBy(_.order)
6294
6395 def checkboxItems (implicit messages : Messages ): Seq [CheckboxItem ] =
6496 values.zipWithIndex.map {
0 commit comments