Add user-facing income/revenue submission endpoint #9
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Currently, revenue entries can only be created via
POST /castle/api/v1/entries/revenuewhich requiresadmin_key(from therequire_admin_keydecorator). Regular users cannot submit income/revenue entries.We need a user-facing income submission endpoint that mirrors the existing expense submission flow — users submit with
invoice_key, the entry gets a!(pending) flag, and an admin approves or rejects it.Proposed Endpoint
Auth:
require_invoice_key(same as expense submission)Request model (similar to
ExpenseEntry):Behavior:
SUBMIT_INCOMEpermission type, or reuseSUBMIT_EXPENSE)!(pending) flagAssets:*(e.g.,Assets:Cash,Assets:Bank), CreditIncome:*Context
The standalone Castle accounting app (frontend) is being built to allow team members to record both expenses AND income. The expense flow works today, but income submission is blocked because the endpoint requires admin privileges.
The goal is for organizations where multiple people receive income on behalf of the entity — they should be able to log it for approval, just like expenses.
Permission Considerations
SUBMIT_INCOMEpermission type alongsideSUBMIT_EXPENSESUBMIT_EXPENSEfor both (rename toSUBMIT_ENTRY?)Let's do it! This will be an essential feature.