feat: вфыв
This commit is contained in:
55
schemas/payment_record.py
Normal file
55
schemas/payment_record.py
Normal file
@@ -0,0 +1,55 @@
|
||||
import datetime
|
||||
from typing import List
|
||||
|
||||
from schemas.base import BaseSchema, PaginationInfoSchema, OkMessageSchema
|
||||
from schemas.payroll import PayrollSchemeSchema
|
||||
from schemas.user import UserSchema
|
||||
|
||||
|
||||
# region Entities
|
||||
class PaymentRecordSchemaBase(BaseSchema):
|
||||
start_date: datetime.date
|
||||
end_date: datetime.date
|
||||
|
||||
work_units: int
|
||||
user: UserSchema
|
||||
|
||||
|
||||
class PaymentRecordCreateSchema(PaymentRecordSchemaBase):
|
||||
pass
|
||||
|
||||
|
||||
class PaymentRecordGetSchema(PaymentRecordSchemaBase):
|
||||
id: int
|
||||
created_by_user: UserSchema
|
||||
payroll_scheme: PayrollSchemeSchema
|
||||
amount: int
|
||||
created_at: datetime.datetime
|
||||
|
||||
|
||||
# endregion
|
||||
|
||||
# region Requests
|
||||
class CreatePaymentRecordRequest(BaseSchema):
|
||||
data: PaymentRecordCreateSchema
|
||||
|
||||
|
||||
class DeletePaymentRecordRequest(BaseSchema):
|
||||
payment_record_id: int
|
||||
|
||||
|
||||
# endregion
|
||||
|
||||
# region Responses
|
||||
class GetPaymentRecordsResponse(BaseSchema):
|
||||
payment_records: List[PaymentRecordGetSchema]
|
||||
pagination_info: PaginationInfoSchema
|
||||
|
||||
|
||||
class CreatePaymentRecordResponse(OkMessageSchema):
|
||||
pass
|
||||
|
||||
|
||||
class DeletePaymentRecordResponse(OkMessageSchema):
|
||||
pass
|
||||
# endregion
|
||||
Reference in New Issue
Block a user