-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from aahnik/feat/event-registrations
Dynamic event registrations with custom form fields and payment options
- Loading branch information
Showing
18 changed files
with
1,167 additions
and
349 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
{ | ||
"files.associations": { | ||
"*.html": "jinja-html" | ||
} | ||
"*.html": "django-html" | ||
}, | ||
"python.languageServer": "None" | ||
} |
19 changes: 19 additions & 0 deletions
19
src/donations/migrations/0002_alter_donationtier_visible.py
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# Generated by Django 4.2.1 on 2024-12-27 19:11 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
dependencies = [ | ||
("donations", "0001_initial"), | ||
] | ||
|
||
operations = [ | ||
migrations.AlterField( | ||
model_name="donationtier", | ||
name="visible", | ||
field=models.BooleanField( | ||
default=False, verbose_name="Show on Donations Page ?" | ||
), | ||
), | ||
] |
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
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
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
109 changes: 109 additions & 0 deletions
109
src/haps/migrations/0005_event_login_required_event_registration_fee_and_more.py
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,109 @@ | ||
# Generated by Django 4.2.1 on 2024-12-27 19:11 | ||
|
||
from django.conf import settings | ||
from django.db import migrations, models | ||
import django.db.models.deletion | ||
|
||
|
||
class Migration(migrations.Migration): | ||
dependencies = [ | ||
migrations.swappable_dependency(settings.AUTH_USER_MODEL), | ||
("haps", "0004_event_content"), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name="event", | ||
name="login_required", | ||
field=models.BooleanField( | ||
default=True, verbose_name="Login required for registration?" | ||
), | ||
), | ||
migrations.AddField( | ||
model_name="event", | ||
name="registration_fee", | ||
field=models.PositiveIntegerField( | ||
blank=True, help_text="Leave blank for free registration", null=True | ||
), | ||
), | ||
migrations.AddField( | ||
model_name="eventregistration", | ||
name="amount", | ||
field=models.PositiveIntegerField(blank=True, null=True), | ||
), | ||
migrations.AddField( | ||
model_name="eventregistration", | ||
name="form_responses", | ||
field=models.JSONField(default=dict), | ||
), | ||
migrations.AddField( | ||
model_name="eventregistration", | ||
name="order_id", | ||
field=models.CharField(blank=True, max_length=100, null=True), | ||
), | ||
migrations.AddField( | ||
model_name="eventregistration", | ||
name="payment_status", | ||
field=models.CharField( | ||
choices=[ | ||
("pending", "Pending"), | ||
("success", "Success"), | ||
("failure", "Failure"), | ||
], | ||
default="pending", | ||
max_length=10, | ||
), | ||
), | ||
migrations.AlterField( | ||
model_name="eventregistration", | ||
name="user", | ||
field=models.ForeignKey( | ||
blank=True, | ||
null=True, | ||
on_delete=django.db.models.deletion.CASCADE, | ||
to=settings.AUTH_USER_MODEL, | ||
), | ||
), | ||
migrations.CreateModel( | ||
name="EventFormField", | ||
fields=[ | ||
( | ||
"id", | ||
models.BigAutoField( | ||
auto_created=True, | ||
primary_key=True, | ||
serialize=False, | ||
verbose_name="ID", | ||
), | ||
), | ||
("field_label", models.CharField(max_length=100)), | ||
( | ||
"field_type", | ||
models.CharField( | ||
choices=[ | ||
("text", "Text Input"), | ||
("number", "Number Input"), | ||
("email", "Email Input"), | ||
("textarea", "Text Area"), | ||
], | ||
max_length=20, | ||
), | ||
), | ||
("required", models.BooleanField(default=True)), | ||
("order", models.PositiveIntegerField(default=0)), | ||
("help_text", models.CharField(blank=True, max_length=200)), | ||
( | ||
"event", | ||
models.ForeignKey( | ||
on_delete=django.db.models.deletion.CASCADE, | ||
related_name="form_fields", | ||
to="haps.event", | ||
), | ||
), | ||
], | ||
options={ | ||
"ordering": ["order"], | ||
"unique_together": {("event", "field_label")}, | ||
}, | ||
), | ||
] |
32 changes: 32 additions & 0 deletions
32
src/haps/migrations/0006_eventregistration_client_txn_id_and_more.py
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# Generated by Django 4.2.1 on 2024-12-29 19:34 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
dependencies = [ | ||
("haps", "0005_event_login_required_event_registration_fee_and_more"), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name="eventregistration", | ||
name="client_txn_id", | ||
field=models.CharField( | ||
blank=True, db_index=True, max_length=128, null=True, unique=True | ||
), | ||
), | ||
migrations.AddField( | ||
model_name="eventregistration", | ||
name="payment_data", | ||
field=models.JSONField( | ||
default=dict, | ||
help_text="\n Stores payment-related data from UPI gateway including:\n - customer_vpa: Customer's UPI ID\n - upi_txn_id: UPI transaction ID\n - status: Detailed payment status\n - remark: Payment remarks/failure reason\n - txnAt: Transaction timestamp\n - merchant: Merchant details (name, upi_id)\n - udf1, udf2, udf3: User defined fields\n - redirect_url: Payment redirect URL\n - createdAt: Order creation time\n ", | ||
), | ||
), | ||
migrations.AddField( | ||
model_name="eventregistration", | ||
name="payment_date_time", | ||
field=models.DateTimeField(blank=True, null=True), | ||
), | ||
] |
Oops, something went wrong.