Skip to content

Commit e1a9061

Browse files
authored
feat: add billing info mandatory field to event model (#6269)
1 parent f2773e5 commit e1a9061

File tree

3 files changed

+35
-0
lines changed

3 files changed

+35
-0
lines changed

app/api/schema/events.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ def validate_timezone(self, data, original_data):
8282
revenue = fields.Float(dump_only=True)
8383
paypal_email = fields.Str(allow_none=True)
8484
is_tax_enabled = fields.Bool(default=False)
85+
is_billing_info_mandatory = fields.Bool(default=False)
8586
is_donation_enabled = fields.Bool(default=False)
8687
can_pay_by_paypal = fields.Bool(default=False)
8788
can_pay_by_stripe = fields.Bool(default=False)

app/models/event.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ class Event(SoftDeletionModel):
9898
payment_currency = db.Column(db.String)
9999
paypal_email = db.Column(db.String)
100100
is_tax_enabled = db.Column(db.Boolean, default=False)
101+
is_billing_info_mandatory = db.Column(db.Boolean, default=False)
101102
can_pay_by_paypal = db.Column(db.Boolean, default=False)
102103
can_pay_by_stripe = db.Column(db.Boolean, default=False)
103104
can_pay_by_cheque = db.Column(db.Boolean, default=False)
@@ -235,6 +236,7 @@ def __init__(self,
235236
discount_code_id=None,
236237
onsite_details=None,
237238
is_tax_enabled=None,
239+
is_billing_info_mandatory=False,
238240
is_sponsors_enabled=None,
239241
stripe_authorization=None,
240242
tax=None,
@@ -301,6 +303,7 @@ def __init__(self,
301303
self.discount_code_id = discount_code_id
302304
self.created_at = datetime.now(pytz.utc)
303305
self.is_tax_enabled = is_tax_enabled
306+
self.is_billing_info_mandatory = is_billing_info_mandatory
304307
self.is_sponsors_enabled = is_sponsors_enabled
305308
self.stripe_authorization = stripe_authorization
306309
self.tax = tax
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
"""empty message
2+
3+
Revision ID: 2504915ffd08
4+
Revises: 96bca587b3ca
5+
Create Date: 2019-07-30 08:48:30.947153
6+
7+
"""
8+
9+
from alembic import op
10+
import sqlalchemy as sa
11+
import sqlalchemy_utils
12+
13+
14+
# revision identifiers, used by Alembic.
15+
revision = '2504915ffd08'
16+
down_revision = '96bca587b3ca'
17+
18+
19+
def upgrade():
20+
# ### commands auto generated by Alembic - please adjust! ###
21+
op.add_column('events', sa.Column('is_billing_info_mandatory', sa.Boolean(), server_default='False'
22+
, nullable=False))
23+
op.add_column('events_version', sa.Column('is_billing_info_mandatory', sa.Boolean(), server_default='False',
24+
autoincrement=False, nullable=False))
25+
26+
27+
def downgrade():
28+
# ### commands auto generated by Alembic - please adjust! ###
29+
op.drop_column('events_version', 'is_billing_info_mandatory')
30+
op.drop_column('events', 'is_billing_info_mandatory')
31+
# ### end Alembic commands ###

0 commit comments

Comments
 (0)