~sircmpwn/names.sr.ht

ref: 7d85145ed46ad9647cb8abd17b9d32717ec4644a names.sr.ht/names/types/gtld_specific.py -rw-r--r-- 25.9 KiB
7d85145eDrew DeVault Refine database schema throughout 1 year, 10 months ago
                                                                                
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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
import enum
import sqlalchemy as sa
import sqlalchemy_utils as sau
from sqlalchemy.ext.declarative import declared_attr
from srht.database import Base
# TODO: how to handle logic validating which things are required

class ExtraDataMixin:
    id = sa.Column(sa.Integer, primary_key=True)
    created = sa.Column(sa.DateTime, nullable=False)
    updated = sa.Column(sa.DateTime, nullable=False)

    @declared_attr
    def user_id(cls):
        return sa.Column(sa.Integer, sa.ForeignKey('user.id'))

    @declared_attr
    def user(cls):
        return sa.orm.relationship('User')

# Common to many TLDs
class RegistrantType(enum.Enum):
    individual = "individual"
    """Individual"""
    organization = "organization"
    """Organization"""

class RegistrantTypeMixin:
    registrant_type = sa.Column(
            sau.ChoiceType(RegistrantType), nullable=False)
    """The entity type of registrant."""

class IdCardNumberMixin:
    id_card_number = sa.Column(sa.Unicode)
    """The number of the individual's identity card."""

class RegistrationNumberMixin:
    registration_number = sa.Column(sa.Unicode)
    """The business number of the organization."""

class VatNumberMixin:
    registrant_vat_id = sa.Column(sa.Unicode)
    """Value Added Tax registration number."""

### .aero
class AeroExtraData(Base, ExtraDataMixin):
    """
    Registration of .AERO domains is restricted to members of the aviation
    community such as airlines, airports, and qualifying companies and
    individuals.

    To prove that they meet the requirements, registrants must provide an
    Eligibility and Name Selection (ENS) ID and password, which can be obtained
    by applying to the registry through [nic.aero][nic.aero].

    [nic.aero]: http://www.nic.aero/registration/manage_your_aero_id/apply
    """
    __tablename__ = "extra_data_aero"
    aero_ens_id = sa.Column(sa.Unicode, nullable=False)
    """Eligibility and Name Selection (ENS) identifier"""
    aero_ens_password = sa.Column(sa.Unicode, nullable=False)
    """Eligibility and Name Selection (ENS) password"""

### .au
class AuEligibilityType(enum.Enum):
    charity = "Charity"
    club = "Club"
    incorporated_association = "Incorporated Association"
    nonprofit_organization = "Non-profit Organization"
    trade_union = "Trade Union"
    company = "Company"
    partnership = "Partnership"
    pending_tm_owner = "Pending TM Owner"
    registered_business = "Registered Business"
    sole_trader = "Sole Trader"
    trademark_owner = "Trademark Owner"
    citizen_resident = "Citizen/Resident"

    def valid_for(tld):
        asn_org = [
            AuEligibilityType.charity,
            AuEligibilityType.club,
            AuEligibilityType.incorporated_association,
            AuEligibilityType.nonprofit_organization,
            AuEligibilityType.trade_union,
        ]
        com_net = [
            AuEligibilityType.company,
            AuEligibilityType.partnership,
            AuEligibilityType.pending_tm_owner,
            AuEligibilityType.registered_business,
            AuEligibilityType.sole_trader,
            AuEligibilityType.trademark_owner,
        ]
        return {
            ".asn.au": asn_org,
            ".org.au": asn_org,
            ".com.au": com_net,
            ".net.au": com_net,
            ".id.au": [AuEligibilityType.citizen_resident],
        }.get(tld)

class AuEligibilityIdType(enum.Enum):
    abn = "ABN"
    act_bn = "ACT BN"
    nsw_bn = "NSW BN"
    nt_bn = "NT BN"
    other = "OTHER"
    qld_bn = "QLD BN"
    sa_bn = "SA BN"
    tas_bn = "TAS BN"
    tm = "TM"
    wa_bn = "WA BN"

    def valid_for(eligibility_type: AuEligibilityType):
        """Returns a list of valid ID types for a given eligibility type."""
        bns = [
            AuEligibilityIdType.act_bn,
            AuEligibilityIdType.nsw_bn,
            AuEligibilityIdType.nt_bn,
            AuEligibilityIdType.qld_bn,
            AuEligibilityIdType.sa_bn,
            AuEligibilityIdType.tas_bn,
            AuEligibilityIdType.wa_bn,
        ]
        return {
            AuEligibilityType.charity: [AuEligibilityIdType.abn],
            AuEligibilityType.club: [AuEligibilityIdType.abn],
            AuEligibilityType.incorporated_association: bns,
            AuEligibilityType.nonprofit_organization: bns +
                [AuEligibilityIdType.other],
            AuEligibilityType.trade_union: [AuEligibilityIdType.other],
            AuEligibilityType.sole_trader: [AuEligibilityIdType.abn],
            AuEligibilityType.trademark_owner: [AuEligibilityIdType.tm],
            AuEligibilityType.pending_trademark_owner: [AuEligibilityIdType.tm],
            AuEligibilityType.partnership: [AuEligibilityIdType.abn],
        }.get(eligibility_type)

class AuPolicyReason(enum.Enum):
    exact_match = 1
    """
    The name exactly matches the acronym or abbreviation of the registrant's
    company or trading name, organization or association name, or trademark.
    """
    closely_connected = 2
    """
    The name is connected closely and substantially to the registrant.
    """

class AuRegistrantIdType(enum.Enum):
    acn = "ACN"
    """Australian Company Number (ACN)"""
    abn = "ABN"
    """Australian Business Number (ABN)"""

class AuExtraData(Base, ExtraDataMixin):
    __tablename__ = "extra_data_au"
    # optional for .id.au unless egibility type is also specified:
    eligibility_id = sa.Column(sa.Unicode())
    """
    The identifier of the eligibility document.

    **Important**: This number will be verified, and if you submit an incorrect
    number, the registration will fail.
    """

    eligibility_id_type = sa.Column(sau.ChoiceType(AuEligibilityIdType))
    """
    The type of eligibility ID specified.
    """

    eligibility_name = sa.Column(sa.Unicode)
    """The name on the eligibility ID document."""

    eligibility_type = sa.Column(
            sau.ChoiceType(AuEligibilityType), nullable=False)
    """The reason that the registrant is eligible for the domain."""

    policy_reason = sa.Column(sau.ChoiceType(AuPolicyReason), nullable=False)
    """The reason this name is applicable to the registrant."""

    registrant_id  = sa.Column(sa.Unicode)
    """
    The registrant's ACN or ABN ID.

    **Important**: This number will be verified, and if you submit an incorrect
    number, the registration will fail.
    """

    registrant_id_type = sa.Column(
            sau.ChoiceType(AuRegistrantIdType), nullable=False)

    registrant_name = sa.Column(sa.Unicode)
    """
    The legal entity such as a company, incorporated association, government
    agency or individual person. Cannot be a registered business name or
    trademark.
    """

### .cl
class ClExtraData(Base,
        ExtraDataMixin,
        RegistrantTypeMixin,
        IdCardNumberMixin,
        VatNumberMixin):
    __tablename__ = "extra_data_cl"

### .pt
### .com.ar
### .com.pt
class PtExtraData(Base,
        ExtraDataMixin,
        RegistrantTypeMixin,
        IdCardNumberMixin):
    __tablename__ = "extra_data_pt"

    tax_number = sa.Column(sa.Unicode, nullable=False)
    """The number used for tax purposes."""

### .com.br
class ComBrExtraData(Base, ExtraDataMixin):
    __tablename__ = "extra_data_com_br"

    br_register_number = sa.Column(sa.Unicode, nullable=False)
    """
    The Brazilian legal identifier.

    For organizations, this is the SNPJ (Business Identifier/Cadastro Nacional
    de Pessoa Juridica). For individuals, this is the CPF (Individual Tax
    Number/Cadastro de Pessoa Fisica).
    """

### .coop
class CoopExtraData(Base, ExtraDataMixin):
    """
    Registration of .COOP domains is restricted to cooperatives and related
    organizations.
    """
    __tablename__ = "extra_data_coop"

    # TODO: We need to figure out how to obtain one of these
    coop_verification_code = sa.Column(sa.Unicode, nullable=False)
    """
    The coop verification code (CVC) is issued by dotCoop, and proves that the
    registrant is eligible to register the domain name.
    """

### .es
class EsIdType(enum.Enum):
    other = "other"
    nie = "NIE"
    nif = "NIF"

class EsExtraData(Base, ExtraDataMixin):
    """
    Registration of a .es domain requires validation by identification number
    (in most cases an NIF or NIF number).
    """
    __tablename__ = "extra_data_es"

    es_id_type = sa.Column(sau.ChoiceType(EsIdType), nullable=False)
    """ID Type"""

    es_id_number = sa.Column(sa.Unicode) # required if NIE or NIF
    """ID Number"""

### .eu
class EuCitizenship(enum.Enum):
    AT = "AT"
    BE = "BE"
    BG = "BG"
    CY = "CY"
    CZ = "CZ"
    DE = "DE"
    DK = "DK"
    EE = "EE"
    ES = "ES"
    FI = "FI"
    FR = "FR"
    GB = "GB"
    GR = "GR"
    HR = "HR"
    HU = "HU"
    IE = "IE"
    IT = "IT"
    LT = "LT"
    LU = "LU"
    LV = "LV"
    MT = "MT"
    NL = "NL"
    PL = "PL"
    PT = "PT"
    RO = "RO"
    SE = "SE"
    SI = "SI"
    SK = "SK"

class EuExtraData(Base, ExtraDataMixin):
    """Registration of .eu domains is limited to EU citizens only."""
    __tablename__ = "extra_data_eu"

    country_of_citizenship = sa.Column(
            sau.ChoiceType(EuCitizenship), nullable=False)
    """Country of citizenship"""

### .de
class DeExtraData(Base, ExtraDataMixin, RegistrantTypeMixin):
    __tablename__ = "extra_data_de"

### .dk
class DkExtraData(Base,
        ExtraDataMixin,
        RegistrantTypeMixin,
        VatNumberMixin):
    __tablename__ = "extra_data_dk"

### .fi
### .my
### .sg
class FiMySgExtraData(Base,
        ExtraDataMixin,
        RegistrantTypeMixin,
        IdCardNumberMixin,
        RegistrationNumberMixin):
    __tablename__ = "extra_data_fimysg"

### .fr
class FrExtraData(Base,
        ExtraDataMixin,
        RegistrantTypeMixin,
        VatNumberMixin):
    """
    .FR domains are available to any individuals and organizations located in
    the European Union, Switzerland, Norway, Iceland, or Liechtenstein.
    Individuals must reside within one of the qualifying countries;
    organizations must have their registered or main office located in a
    qualifying country; therefore, when registering or transferring .FR
    domains, you must provide additional residency information.
    """
    __tablename__ = "extra_data_fr"

    siren_siret = sa.Column(sa.Unicode)
    """
    The 9 digit SIREN code or the 14 digit SIRET code that is used to identify
    the business for tax reasons. Optional, but recommended for organizations
    located in France.
    """

    trademark_number = sa.Column(sa.Unicode)
    """
    The organization's trademark registration number,if applicable. Optional,
    but recommended for organizations located in France.
    """

### .hk
class HkExtraData(Base,
        ExtraDataMixin,
        RegistrantTypeMixin,
        IdCardNumberMixin,
        RegistrationNumberMixin):
    __tablename__ = "extra_data_hk"

    date_of_birth = sa.Column(sa.DateTime) # required if individual
    """The registrant's date of birth."""

### .hu
### .co.hu
class HuExtraData(Base,
        ExtraDataMixin,
        RegistrantTypeMixin,
        IdCardNumberMixin,
        VatNumberMixin):
    __tablename__ = "extra_data_hu"

### .it
class ItEntityType(enum.Enum):
    italian_and_foreign_national_persons = 1
    """Italians and Italian foreign nationals"""
    companies_or_sole_proprietorships = 2
    """Companies or sole proprietorships"""
    freelance_workers_or_professionals = 3
    """Freelance workers or professionals"""
    non_profits = 4
    """Non-profit organizations"""
    public_organizations = 5
    """Public organizations"""
    other_subjects = 6
    """Other subjects"""
    foreigners = 7
    """
    Foreigners in any category not including Italians or Italian foreign
    nationals
    """

class ItExtraData(Base, ExtraDataMixin):
    __tablename__ = "extra_data_it"
    entity_type = sa.Column(sau.ChoiceType(ItEntityType))
    """The legal entity type of registrant"""

    nationality_code = sa.Column(sa.Unicode(2))
    """
    The 2-digit ISO 3166-1 code that identifies the Registrant's nationality.
    """

    reg_code = sa.Column(sa.Unicode(16))
    """
    An identifying number, usually the VAT or Codice Fiscale (numeric tax
    code). The value that you need to enter depends on the entity type of the
    registrant.

    - Italian citizens must enter their Codice Fiscale.\*
    - Italian companies, freelancers, and other subjects must enter their 11
      digit VAT number or tax identification number.
    - Italian non-profit organizations must enter their VAT number or tax
      identification number; however, if they do not have one, they can enter
      n.a.
    - Non Italian entities other than persons (organizations, freelancers,
      companies, etc.) may enter their VAT number or n.a.

    \* Non Italians not living in Italy can enter n.a.
    """

### .jobs
class JobsExtraData(Base, ExtraDataMixin):
    """
    Registration of .JOBS domains is restricted to those who are involved in
    Human Resource management. To be eligible, registrants must be a member of
    the Society for Human Resource Management (SHRM) or involved in HR
    practices that meet any of the following criteria:

    - Possess salaried-level human resource management experience.
    - Are certified by the Human Resource Certification Institute.
    - Are supportive of the SHRM Code of Ethical and Professional Standards in
      Human Resource Management, as amended from time to time.

    Consequently, when registering a .JOBS domain, registrants must complete
    some additional information. For more information on the restrictions and
    policies regarding .JOBS registrations, see
    [policy.jobs](http://www.policy.jobs/).
    """
    __tablename__ = "extra_data_jobs"

    jobs_admin_type = sa.Column(sa.Boolean, nullable=False)
    """Is the registrant and the admin contact the same person?"""

    jobs_association_member = sa.Column(sa.Boolean, nullable=False)
    """Is the registrant a member of SHRM?"""

    jobs_industry_type = sa.Column(sa.Unicode)
    """The type of industry your business is in."""

    jobs_title = sa.Column(sa.Unicode)
    """The registrant's job title."""

    jobs_website = sa.Column(sa.Unicode, nullable=False)
    """The URL for the registrant's company website."""

### .law
### .abogado
class LawJurisdictionCountry(enum.Enum):
    AD = "AD"
    AE = "AE"
    AF = "AF"
    AG = "AG"
    AI = "AI"
    AL = "AL"
    AM = "AM"
    AN = "AN"
    AO = "AO"
    AQ = "AQ"
    AR = "AR"
    AS = "AS"
    AT = "AT"
    AU = "AU"
    AW = "AW"
    AX = "AX"
    AZ = "AZ"
    BA = "BA"
    BB = "BB"
    BD = "BD"
    BE = "BE"
    BF = "BF"
    BG = "BG"
    BH = "BH"
    BI = "BI"
    BJ = "BJ"
    BL = "BL"
    BM = "BM"
    BN = "BN"
    BO = "BO"
    BQ = "BQ"
    BR = "BR"
    BS = "BS"
    BT = "BT"
    BV = "BV"
    BW = "BW"
    BX = "BX"
    BY = "BY"
    BZ = "BZ"
    CA = "CA"
    CC = "CC"
    CD = "CD"
    CF = "CF"
    CG = "CG"
    CH = "CH"
    CI = "CI"
    CK = "CK"
    CL = "CL"
    CM = "CM"
    CN = "CN"
    CO = "CO"
    CR = "CR"
    CU = "CU"
    CV = "CV"
    CW = "CW"
    CX = "CX"
    CY = "CY"
    CZ = "CZ"
    DE = "DE"
    DJ = "DJ"
    DK = "DK"
    DM = "DM"
    DO = "DO"
    DZ = "DZ"
    EC = "EC"
    EE = "EE"
    EG = "EG"
    EH = "EH"
    ER = "ER"
    ES = "ES"
    ET = "ET"
    EU = "EU"
    FI = "FI"
    FJ = "FJ"
    FK = "FK"
    FM = "FM"
    FO = "FO"
    FR = "FR"
    GA = "GA"
    GB = "GB"
    GD = "GD"
    GE = "GE"
    GF = "GF"
    GG = "GG"
    GH = "GH"
    GI = "GI"
    GL = "GL"
    GM = "GM"
    GN = "GN"
    GP = "GP"
    GQ = "GQ"
    GR = "GR"
    GS = "GS"
    GT = "GT"
    GU = "GU"
    GW = "GW"
    GY = "GY"
    HK = "HK"
    HM = "HM"
    HN = "HN"
    HR = "HR"
    HT = "HT"
    HU = "HU"
    ID = "ID"
    IE = "IE"
    IL = "IL"
    IM = "IM"
    IN = "IN"
    IO = "IO"
    IQ = "IQ"
    IR = "IR"
    IS = "IS"
    IT = "IT"
    JE = "JE"
    JM = "JM"
    JO = "JO"
    JP = "JP"
    KE = "KE"
    KG = "KG"
    KH = "KH"
    KI = "KI"
    KM = "KM"
    KN = "KN"
    KP = "KP"
    KR = "KR"
    KW = "KW"
    KY = "KY"
    KZ = "KZ"
    LA = "LA"
    LB = "LB"
    LC = "LC"
    LI = "LI"
    LK = "LK"
    LR = "LR"
    LS = "LS"
    LT = "LT"
    LU = "LU"
    LV = "LV"
    LY = "LY"
    MA = "MA"
    MC = "MC"
    MD = "MD"
    ME = "ME"
    MG = "MG"
    MH = "MH"
    MK = "MK"
    ML = "ML"
    MM = "MM"
    MN = "MN"
    MO = "MO"
    MP = "MP"
    MQ = "MQ"
    MR = "MR"
    MS = "MS"
    MT = "MT"
    MU = "MU"
    MV = "MV"
    MW = "MW"
    MX = "MX"
    MY = "MY"
    MZ = "MZ"
    NA = "NA"
    NC = "NC"
    NE = "NE"
    NF = "NF"
    NG = "NG"
    NI = "NI"
    NL = "NL"
    NO = "NO"
    NP = "NP"
    NR = "NR"
    NU = "NU"
    NZ = "NZ"
    OM = "OM"
    OT = "OT"
    PA = "PA"
    PE = "PE"
    PF = "PF"
    PG = "PG"
    PH = "PH"
    PK = "PK"
    PL = "PL"
    PM = "PM"
    PN = "PN"
    PR = "PR"
    PS = "PS"
    PT = "PT"
    PW = "PW"
    PY = "PY"
    QA = "QA"
    RE = "RE"
    RO = "RO"
    RS = "RS"
    RU = "RU"
    RW = "RW"
    SA = "SA"
    SB = "SB"
    SC = "SC"
    SD = "SD"
    SE = "SE"
    SG = "SG"
    SH = "SH"
    SI = "SI"
    SJ = "SJ"
    SK = "SK"
    SL = "SL"
    SM = "SM"
    SN = "SN"
    SO = "SO"
    SR = "SR"
    SS = "SS"
    ST = "ST"
    SV = "SV"
    SX = "SX"
    SY = "SY"
    SZ = "SZ"
    TC = "TC"
    TD = "TD"
    TF = "TF"
    TG = "TG"
    TH = "TH"
    TJ = "TJ"
    TK = "TK"
    TL = "TL"
    TM = "TM"
    TN = "TN"
    TO = "TO"
    TR = "TR"
    TT = "TT"
    TV = "TV"
    TW = "TW"
    TZ = "TZ"
    UA = "UA"
    UG = "UG"
    UK = "UK"
    UM = "UM"
    US = "US"
    UY = "UY"
    UZ = "UZ"
    VA = "VA"
    VC = "VC"
    VE = "VE"
    VG = "VG"
    VI = "VI"
    VN = "VN"
    VU = "VU"
    WF = "WF"
    WS = "WS"
    YE = "YE"
    YT = "YT"
    ZA = "ZA"
    ZM = "ZM"
    ZR = "ZR"
    ZW = "ZW"

class LawExtraData(Base, ExtraDataMixin):
    """
    Registration of .law and .abogado domains is limited to registrants who are
    accredited lawyers.
    """
    __tablename__ = "extra_data_law"

    qli_accreditation_id = sa.Column(sa.Unicode, nullable=False)
    """Qualified Lawyer's Accreditation ID"""

    qli_accreditation_body = sa.Column(sa.Unicode, nullable=False)
    """Qualified Lawyer's Accreditation Body"""

    qli_jurisdiction_country = sa.Column(
            sau.ChoiceType(LawJurisdictionCountry),
            nullable=False)
    """Accreditation Jurisdiction Country"""

    qli_jurisdiction_state = sa.Column(sa.Unicode)
    """Accreditation Jurisdiction State/Province"""

    qli_accreditation_year = sa.Column(sa.Integer, nullable=False) # 4 digits
    """Qualified Lawyer's Accreditation Year"""

### .lv
### .com.lv
class LvExtraData(Base,
        ExtraDataMixin,
        RegistrantTypeMixin,
        IdCardNumberMixin,
        RegistrationNumberMixin,
        VatNumberMixin):
    __tablename__ = "extra_data_lv"

### .mx
### .com.mx
### .co.za
class MxExtraData(Base, ExtraDataMixin, RegistrantTypeMixin):
    __tablename__ = "extra_data_mx"

### .no
class NoExtraData(Base, ExtraDataMixin, RegistrationNumberMixin):
    __tablename__ = "extra_data_no"

### .nyc
class NycExtraData(Base, ExtraDataMixin, RegistrantTypeMixin):
    __tablename__ = "extra_data_nyc"

### .pm
### .re
### .tf
### .wf
### .yt
class PmExtraData(Base,
        ExtraDataMixin,
        RegistrantTypeMixin,
        RegistrationNumberMixin,
        VatNumberMixin):
    __tablename__ = "extra_data_pm"

    trademark_number = sa.Column(sa.Unicode)
    """
    The number assigned to the organization’s pending or registered trademark.
    Optional, but recommended for organizations.
    """

### .pro
class ProExtraData(Base, ExtraDataMixin):
    """
    In order to register a .PRO domain name, the registrant must belong to an
    accredited profession.
    """
    __tablename__ = "extra_data_pro"

    authority = sa.Column(sa.Unicode)
    """
    The name of the authority from which the registrant receives their
    professional credentials.
    """

    authority_website = sa.Column(sa.Unicode)
    """
    The URL to an online resource for the authority, preferably, a member
    search directory.
    """

    license_number = sa.Column(sa.Unicode)
    """The license number of the registrant's credentials, if applicable."""

    profession = sa.Column(sa.Unicode, nullable=False)
    """The stated profession of the registrant."""

### .ro
### .com.ro
class RoExtraData(Base,
        ExtraDataMixin,
        RegistrantTypeMixin,
        IdCardNumberMixin,
        RegistrationNumberMixin,
        VatNumberMixin):
    __tablename__ = "extra_data_ro"

### .ru
class RuExtraData(Base,
        ExtraDataMixin,
        RegistrantTypeMixin,
        IdCardNumberMixin):
    __tablename__ = "extra_data_ru"

    date_of_birth = sa.Column(sa.DateTime) # required if individual
    """The registrant's date of birth."""

    id_card_authority = sa.Column(sa.Unicode) # required if individual
    """Name of the ID card issuing authority."""

    id_card_issue_date = sa.Column(sa.DateTime) # required if individual
    """Name of the ID card issuance date."""

    place_of_birth = sa.Column(sa.Unicode) # required if individual
    """The city in which the individual was born."""

### .se
### .nu
class SeExtraData(Base,
        ExtraDataMixin,
        RegistrantTypeMixin,
        IdCardNumberMixin,
        RegistrationNumberMixin,
        VatNumberMixin):
    __tablename__ = "extra_data_se"

### .travel
class TravelExtraData(Base, ExtraDataMixin):
    """
    In order to register a .TRAVEL domain name, the registrant must be a
    participant in the travel and tourism industry, and they must have a Unique
    Identifying Number (UIN).
    """
    __tablename__ = "extra_data_travel"

    travel_uin = sa.Column(sa.Unicode, nullable=False)
    """
    The Unique Identifying Number that proves the registrant is a participant
    in the travel and tourism industry
    """

### .uk
class UkRegistrantType(enum.Enum):
    CRC = "CRC"
    """UK Corporation by Royal Charter"""
    FCORP = "FCORP"
    """Non-UK Corporation"""
    FIND = "FIND"
    """Foreign Individual"""
    FOTHER = "FOTHER"
    """Non-UK Entity that does not fit another category"""
    GOV = "GOV"
    """UK Government Body"""
    IND = "IND"
    """Individual"""
    IP = "IP"
    """UK Industrial/Provident Registered Company"""
    LLP = "LLP"
    """UK Limited Liability Partnership"""
    LTD = "LTD"
    """UK Limited Company"""
    OTHER = "OTHER"
    """UK Entity that does not fit another category"""
    PLC = "PLC"
    """UK Public Limited Company"""
    PTNR = "PTNR"
    """UK Partnership"""
    RCHAR = "RCHAR"
    """UK Registered Charity"""
    SCH = "SCH"
    """UK School"""
    STAT = "STAT"
    """UK Statutory Body"""
    STRA = "STRA"
    """UK Sole Trader"""

    def requires_registration_number():
        return [
            UkRegistrantType.LTD,
            UkRegistrantType.PLC,
            UkRegistrantType.LLP,
            UkRegistrantType.IP,
            UkRegistrantType.SCH,
            UkRegistrantType.RCHAR,
        ]

    def requires_trading_name():
        return [
            UkRegistrantType.LTD,
            UkRegistrantType.PLC,
            UkRegistrantType.LLP,
            UkRegistrantType.IP,
            UkRegistrantType.RCHAR,
            UkRegistrantType.FCORP,
            UkRegistrantType.OTHER,
            UkRegistrantType.FOTHER,
            UkRegistrantType.STRA,
        ]

class UkExtraData(Base,
        ExtraDataMixin,
        RegistrationNumberMixin):
    __tablename__ = "extra_data_uk"

    registrant_type = sa.Column(
            sau.ChoiceType(UkRegistrantType), nullable=False)
    """Registrant type"""

    trading_name = sa.Column(sa.Unicode)
    """The trading name of the organization."""

### .us
class UsAppPurpose(enum.Enum):
    """A description of the domain's application purpose"""
    for_profit_business = "P1"
    """Business use for profit"""
    non_profit_organization = "P2"
    """
    Non-profit business, club, association, religious organization, and so on
    """
    personal_use = "P3"
    """Personal use"""
    education = "P4"
    """Education purposes"""
    government = "P5"
    """Government purposes"""

class UsNexusCategory(enum.Enum):
    """A description of the domain's nexus category"""
    us_citizen = "C11"
    """A citizen of the U.S. or any of its territories."""
    permanent_resident = "C12"
    """A permanent resident of the U.S. or any of its territories."""
    incorporated_organization = "C21"
    """An organization incorporated within the U.S."""
    regularly_active_entity = "C31"
    """An entity that regularly engages in lawful activities in the U.S."""
    domestic_office_entity = "C32"
    """An entity that has an office or other facility in the U.S."""

class UsExtraData(Base, ExtraDataMixin):
    __tablename__ = "extra_data_us"

    app_purpose = sa.Column(sau.ChoiceType(UsAppPurpose), nullable=False)
    """A description of the domain's application purpose"""

    category = sa.Column(sau.ChoiceType(UsNexusCategory), nullable=False)
    """A description of the domain's nexus category"""

    validator = sa.Column(sau.CountryType) # required for C31 or C32
    """The domain owner's country of citizenship."""

### .xxx
class XxxExtraData(Base, ExtraDataMixin):
    """
    .XXX domains are available to those within the adult entertainment industry
    who are members of the Sponsored Community (SC).
    """
    __tablename__ = "extra_data_xxx"

    icm_membership_id = sa.Column(sa.Unicode)
    """
    The ID number that was provided when the registrant successfully completed
    the XXX Sponsored Community validation process. If this value is not
    submitted with the domain registration, the registry will contact the
    registrant with instructions on how to become a member of the Sponsored
    Community.

    If you submit this value, you do not need to fill in the remaining fields.
    """

    ipr_email = sa.Column(sa.Unicode)
    """
    The email address to which all communications from the registry will be
    addressed.
    """

    ipr_name = sa.Column(sa.Unicode)
    """
    The name (in the format "firstname lastname") to which all communications
    from the registry will be addressed.
    """

    ipr_non_resolver = sa.Column(sa.Boolean)
    """If selected, this domain will not resolve. You probably don't want this."""