-
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.
[ORG-91] Set status in applications (#97)
* application model and orm * migration * update tests
- Loading branch information
Showing
12 changed files
with
79 additions
and
11 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
17 changes: 16 additions & 1 deletion
17
organizator_api/app/applications/domain/models/application.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 |
---|---|---|
@@ -1,16 +1,31 @@ | ||
import uuid | ||
from dataclasses import dataclass | ||
from datetime import datetime | ||
from typing import Optional | ||
from enum import Enum | ||
|
||
from app.events.domain.models.event import Event | ||
from app.users.domain.models.user import User | ||
|
||
|
||
class ApplicationStatus(Enum): | ||
PENDING = "Under review" | ||
INVITED = "Invited" | ||
CONFIRMED = "Confirmed" | ||
CANCELLED = "Cancelled" | ||
INVALID = "Invalid" | ||
REJECTED = "Rejected" | ||
WAIT_LIST = "Wait list" | ||
|
||
@classmethod | ||
def choices(cls) -> tuple[tuple[str, str], ...]: | ||
return tuple((i.name, i.value) for i in cls) | ||
|
||
|
||
@dataclass | ||
class Application: | ||
id: uuid.UUID | ||
user: User | ||
event: Event | ||
status: ApplicationStatus | ||
created_at: datetime | ||
updated_at: datetime |
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
29 changes: 29 additions & 0 deletions
29
organizator_api/app/migrations/0015_ormeventapplication_status.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,29 @@ | ||
# Generated by Django 4.2.7 on 2024-01-11 18:44 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
dependencies = [ | ||
("app", "0014_alter_ormevent_age_restrictions_and_more"), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name="ormeventapplication", | ||
name="status", | ||
field=models.CharField( | ||
choices=[ | ||
("PENDING", "Under review"), | ||
("INVITED", "Invited"), | ||
("CONFIRMED", "Confirmed"), | ||
("CANCELLED", "Cancelled"), | ||
("INVALID", "Invalid"), | ||
("REJECTED", "Rejected"), | ||
("WAIT_LIST", "Wait list"), | ||
], | ||
default="PENDING", | ||
max_length=255, | ||
), | ||
), | ||
] |
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
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