Removing opening info for read and update, puting in another resource
This commit is contained in:
@@ -21,8 +21,7 @@ class AccountBaseId(AccountBase):
|
||||
path: str = Field(index=True)
|
||||
|
||||
class AccountRead(AccountBaseId):
|
||||
opening_date: date = Field()
|
||||
opening_balance: Decimal = Field(decimal_places=2, default=0)
|
||||
pass
|
||||
|
||||
class BaseAccountWrite(AccountBase):
|
||||
path: SkipJsonSchema[str] = Field(default="")
|
||||
@@ -39,11 +38,10 @@ class AccountWrite(BaseAccountWrite):
|
||||
}
|
||||
}
|
||||
})
|
||||
opening_date: date = Field()
|
||||
opening_balance: MonetaryAmount = Field()
|
||||
|
||||
class AccountCreate(AccountWrite):
|
||||
pass
|
||||
opening_date: date = Field()
|
||||
opening_balance: MonetaryAmount = Field()
|
||||
|
||||
class AccountUpdate(AccountWrite):
|
||||
pass
|
||||
@@ -63,11 +61,9 @@ class CategoryWrite(BaseAccountWrite):
|
||||
}
|
||||
})
|
||||
|
||||
class CategoryCreate(CategoryWrite):
|
||||
opening_date: SkipJsonSchema[date] = Field(default=date(1970, 1, 1))
|
||||
opening_balance: SkipJsonSchema[Decimal] = Field(default=0)
|
||||
|
||||
class CategoryCreate(CategoryWrite):
|
||||
pass
|
||||
|
||||
class CategoryUpdate(CategoryWrite):
|
||||
pass
|
||||
|
||||
Reference in New Issue
Block a user