~sircmpwn/names.sr.ht

ref: 7d85145ed46ad9647cb8abd17b9d32717ec4644a names.sr.ht/names/types/contact.py -rw-r--r-- 1.2 KiB
7d85145eDrew DeVault Refine database schema throughout 1 year, 11 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
import enum
import sqlalchemy as sa
from srht.database import Base

class DomainContact(Base):
    __tablename__ = 'domain_contact'
    id = sa.Column(sa.Integer, primary_key=True)
    created = sa.Column(sa.DateTime, nullable=False)
    updated = sa.Column(sa.DateTime, nullable=False)
    user_id = sa.Column(sa.Integer, sa.ForeignKey('user.id'), nullable=False)
    note = sa.Column(sa.Unicode)

    # https://domains.opensrs.guide/docs/domain-contacts
    first_name = sa.Column(sa.Unicode(64), nullable=False)
    last_name = sa.Column(sa.Unicode(64), nullable=False)
    org_name = sa.Column(sa.Unicode(64), nullable=False)
    address1 = sa.Column(sa.Unicode(64), nullable=False)
    address2 = sa.Column(sa.Unicode(64))
    address3 = sa.Column(sa.Unicode(64))
    city = sa.Column(sa.Unicode(64), nullable=False)
    state = sa.Column(sa.Unicode(32)) # Required if country in [CA, US]
    postal_code = sa.Column(sa.Unicode(16), nullable=False)
    country = sa.Column(sa.Unicode(2), nullable=False)
    phone = sa.Column(sa.Unicode(20), nullable=False)
    fax = sa.Column(sa.Unicode(20))
    email = sa.Column(sa.Unicode(128), nullable=False)
    # Required for only some kinds of domains:
    lang = sa.Column(sa.Unicode(2))
    vat = sa.Column(sa.Unicode(16))