feat: model base price #18

Merged
addison merged 7 commits from 003-000-model-base-price into main 2026-07-23 05:27:21 -04:00
Collaborator

Spec 3.0

Changes

  • Added migration in backend to add price_cents to model.
  • Added functionality in backend to add, edit and get price_cents.
  • Added functionality in frontend to add model's price and in building added functionality to set model price or custom price.

Testing

  • Make sure you have updated code running locally.
  • Navigate to models and add a model.
  • You must see base price field in dialog.
  • Add model with name and base price.
  • Now navigate to buildings.
  • Add building and select model we just added,
  • Now in newly added building details, under work order section, price must be reflected from model we just added.
  • Now edit work order, Model must have a select field for pricing.
  • Selected value must be 'Model Price', now select 'Custom Price' option from select options.
  • Now price must be set to 0, try saving it, you must encounter error "Price must be greater than $0 for a custom price."
  • Now enter valid price and save.
  • Click on print button, print screen also must reflect same value.
## Spec 3.0 ## Changes - Added migration in backend to add `price_cents` to model. - Added functionality in backend to add, edit and get `price_cents`. - Added functionality in frontend to add model's price and in building added functionality to set model price or custom price. ## Testing - [x] Make sure you have updated code running locally. - [x] Navigate to models and add a model. - [x] You must see base price field in dialog. - [x] Add model with name and base price. - [x] Now navigate to buildings. - [x] Add building and select model we just added, - [x] Now in newly added building details, under work order section, price must be reflected from model we just added. - [x] Now edit work order, Model must have a select field for pricing. - [x] Selected value must be 'Model Price', now select 'Custom Price' option from select options. - [x] Now price must be set to 0, try saving it, you must encounter error "Price must be greater than $0 for a custom price." - [x] Now enter valid price and save. - [x] Click on print button, print screen also must reflect same value.
feat: added model price in backend and added functionality to set and use that in frontend
All checks were successful
PR Validation / validate (pull_request) Successful in 3m58s
aa059b9704
talha requested review from addison 2026-07-21 12:56:36 -04:00
Owner

Please mention the spec and mark it as in-progress (if more work remains to be completed in future PRs) or completed.

Please mention the spec and mark it as in-progress (if more work remains to be completed in future PRs) or completed.
Owner

Please use checklist with - [ ] for the testing section so I can check it off as I go.

Please use checklist with `- [ ]` for the testing section so I can check it off as I go.
Owner

I added some more API test coverage.

Also added TestModelUpdateOmittingPricePreservesExistingPrice to show one edge case that is not correctly handled.

I added some more API test coverage. Also added `TestModelUpdateOmittingPricePreservesExistingPrice` to show one edge case that is not correctly handled.
Amp-Thread-ID: https://ampcode.com/threads/T-019f8652-5feb-769e-a0b6-e2bc10ccb029

Co-authored-by: Addison Emig <[email protected]>
test(api): expose omitted model price reset
Some checks failed
PR Validation / validate (pull_request) Failing after 2m14s
44f846752e
Amp-Thread-ID: https://ampcode.com/threads/T-019f8652-5feb-769e-a0b6-e2bc10ccb029

Co-authored-by: Addison Emig <[email protected]>
addison requested changes 2026-07-21 16:59:07 -04:00
Dismissed
addison left a comment

See above comments

See above comments
addison changed title from feat: added model price in backend and added functionality to set and use that in frontend to feat: model base price 2026-07-21 16:59:21 -04:00
addison changed title from feat: model base price to WIP: feat: model base price 2026-07-21 16:59:24 -04:00
fix: overridden unmarshal json for model and used custom update for updating model
All checks were successful
PR Validation / validate (pull_request) Successful in 11m51s
66509309b7
talha changed title from WIP: feat: model base price to feat: model base price 2026-07-22 10:45:26 -04:00
test(api): expose null model price acceptance
Some checks failed
PR Validation / validate (pull_request) Failing after 2m7s
7de5484f5e
Amp-Thread-ID: https://ampcode.com/threads/T-019f8ae8-75e6-76de-a536-30f89b4cf418

Co-authored-by: Addison Emig <[email protected]>
fix: added null handling in validate
All checks were successful
PR Validation / validate (pull_request) Successful in 3m47s
107d0cab18
talha requested review from addison 2026-07-23 03:14:45 -04:00
fix: wording
All checks were successful
PR Validation / validate (pull_request) Successful in 3m38s
6155d24ee0
Owner

Nice work!!

Nice work!!
addison approved these changes 2026-07-23 05:27:16 -04:00
addison referenced this pull request from a commit 2026-07-23 05:27:22 -04:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
3 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
kwila/shed-ledger!18
No description provided.