added payment info to activities
This commit is contained in:
parent
8c9d6bc6ef
commit
337d27425e
@ -1,6 +1,8 @@
|
||||
from typing import Annotated, Self
|
||||
|
||||
from .communication import CommunicationModel
|
||||
from .submodels import ActivityPaymentInfo
|
||||
|
||||
|
||||
class ActivityModel(CommunicationModel):
|
||||
category: Annotated[
|
||||
@ -11,12 +13,14 @@ class ActivityModel(CommunicationModel):
|
||||
start_time: datetime
|
||||
end_time: datetime
|
||||
|
||||
payment_info: ActivityPaymentInfo | None = None
|
||||
|
||||
|
||||
#signuplist: GroupRef | None = None
|
||||
# TODO: implement signup list (huge modular system)
|
||||
|
||||
# TODO: see Felt 'activiteiten' DB schema. Things like:
|
||||
# costs, payment method, email, target group, maximal attendees ....
|
||||
# email, target group, maximal attendees ....
|
||||
|
||||
@model_validator(mode='after')
|
||||
def check_end_after_start(self) -> Self:
|
||||
|
||||
10
src/fiber_package/events/submodels.py
Normal file
10
src/fiber_package/events/submodels.py
Normal file
@ -0,0 +1,10 @@
|
||||
from decimal import Decimal
|
||||
from typing import Annotated
|
||||
|
||||
from pydantic import BaseModel, Field
|
||||
|
||||
class ActivityPaymentInfo(BaseModel):
|
||||
contribution: Annotated[Decimal, Field(decimal_places=2, ge=0)]
|
||||
nnv_contribution: Annotated[Decimal | None, Field(None, decimal_places=2, ge=0)] = None
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user