feat: add deposit edit and delete for pending deposits
Add PUT /api/v1/dca/deposits/{id} endpoint to update amount, currency,
and notes on pending deposits. Add DELETE endpoint to remove deposits
not yet inserted into the machine. Both endpoints reject confirmed
deposits. Frontend now shows edit/delete buttons only for pending rows.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
6eb076d5f6
commit
28241e70c3
5 changed files with 121 additions and 3 deletions
12
models.py
12
models.py
|
|
@ -60,6 +60,18 @@ class DcaDeposit(BaseModel):
|
|||
confirmed_at: Optional[datetime]
|
||||
|
||||
|
||||
class UpdateDepositData(BaseModel):
|
||||
amount: Optional[float] = None
|
||||
currency: Optional[str] = None
|
||||
notes: Optional[str] = None
|
||||
|
||||
@validator('amount')
|
||||
def round_amount_to_cents(cls, v):
|
||||
if v is not None:
|
||||
return round(float(v), 2)
|
||||
return v
|
||||
|
||||
|
||||
class UpdateDepositStatusData(BaseModel):
|
||||
status: str
|
||||
notes: Optional[str] = None
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue