mirror of
https://github.com/we-promise/sure.git
synced 2026-04-19 03:54:08 +00:00
feat: add valuations API endpoints for managing account reconciliations (#745)
* feat: add valuations API endpoints for managing account reconciliations * refactor: formatting * fix: make account extraction clearer * feat: validation and error handling improvements * feat: transaction * feat: error handling * Add API documentation LLM context * Make it easier for people * feat: transaction in creation * feat: add OpenAPI spec for Valuations API * fix: update notes validation to check for key presence * Prevent double render * All other docs use `apiKeyAuth` * More `apiKeyAuth` * Remove testing assertions from API doc specs * fix: correct valuation entry references --------- Signed-off-by: Juan José Mata <juanjo.mata@gmail.com> Co-authored-by: Juan José Mata <juanjo.mata@gmail.com>
This commit is contained in:
19
app/views/api/v1/valuations/_valuation.json.jbuilder
Normal file
19
app/views/api/v1/valuations/_valuation.json.jbuilder
Normal file
@@ -0,0 +1,19 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
json.id valuation.entry.id
|
||||
json.date valuation.entry.date
|
||||
json.amount valuation.entry.amount_money.format
|
||||
json.currency valuation.entry.currency
|
||||
json.notes valuation.entry.notes
|
||||
json.kind valuation.kind
|
||||
|
||||
# Account information
|
||||
json.account do
|
||||
json.id valuation.entry.account.id
|
||||
json.name valuation.entry.account.name
|
||||
json.account_type valuation.entry.account.accountable_type.underscore
|
||||
end
|
||||
|
||||
# Additional metadata
|
||||
json.created_at valuation.created_at.iso8601
|
||||
json.updated_at valuation.updated_at.iso8601
|
||||
3
app/views/api/v1/valuations/show.json.jbuilder
Normal file
3
app/views/api/v1/valuations/show.json.jbuilder
Normal file
@@ -0,0 +1,3 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
json.partial! "valuation", valuation: @valuation
|
||||
Reference in New Issue
Block a user