As discussed with @NicolasDorier on Mattermost: Right now only store owners can access the app data, which doesn't contain sensitive info or something beyond what one would see as a regular customer. The app would need a way to access the data for roles other than `Owner` as well, e.g. `Employee`.
* App: Add events which the app subscribes to
Various events, which are relevant for the app to react to changes made on the server.
* Refactor events
* Do not extend NewBlockEvent
* Refactoring events
* Add store role events
* Refactoring: Rename StoreUserEvent
* Fix: Subscribe to UserEvent.Invited
---------
Co-authored-by: nicolas.dorier <nicolas.dorier@gmail.com>
* Greenfield: Improve store users API
- Adds an endpoint to update store users (before they had to be removed ad re-added)
- Checks for the existance of a user and responds with 404 in that case (fixes#6423)
- Allows retrieval of user by user id or email for add and update (consistent with the other endpoints)
- Improves the API docs for the store users endpoints
* Swagger: Reuse UserIdOrEmail parameter component
* Add details to store user data
* Histograms: Add Lightning data and API endpoints
Ported over from the mobile-working-branch.
Adds histogram data for Lightning and exposes the wallet/lightning histogram data via the API. It also add a dashboard graph for the Lightning balance.
Caveat: The Lightning histogram is calculated by using the current channel balance and going backwards through as much invoices and transactions as we have. The "start" of the LN graph data might not be accurate though. That's because we don't track (and not even have) the LN onchain data. It is calculated by using the current channel balance and going backwards through as much invoices and transactions as we have. So the historic graph data for LN is basically a best effort of trying to reconstruct it with what we have: The LN channel transactions.
* More timeframes
* Refactoring: Remove redundant WalletHistogram types
* Remove store property from dashboard tile view models
* JS error fixes
* Refactoring: Move AppItem to Client lib and use the class for item list
This makes it available for the app, which would otherwise have to replicate the model. Also uses the proper class for the item/perk list of the app models.
* Remove unused app item payment methods property
* Do not ignore nullable values in JSON
* Revert to use Newtonsoft types
* Add updated image upload support on Crowdfund plugin
* Refactor crowdfund image upload fix
* update crowdfund url for greenfield api
* Resolve integration test assertion
* Remove superfluous and unused command argument
* Fix missing validation error
* Minor API controller update
* Property and usage fixes
* Fix test after merge
---------
Co-authored-by: Dennis Reimann <mail@dennisreimann.de>
Validates missing and duplicate IDs on the edit actions and when creating/updating apps via the API.
Fails gracefully by excluding existing items without ID or with duplicate ID for the rest of the cases.
Fixes#6227.
* Store Branding: Apply brand color to backend as well
Closes#5990.
* Add adjustments for different theme scenarios
* Add description text
* Make it optional to apply the brand color to the backend
* Toggle color fixes
* Fix divisibility in invoice details of lightning amounts
This PR will show 11 decimal in the invoice details for BTC amount
of lightning payment methods.
It also hacks around the fact that some
lightning clients don't create the requested amount of sats, which
resulted in over or under payments. (Blink not supporting msats, and
strike)
Now, In that case, a payment method fee (which can be negative) called tweak fee
will be added to the prompt.
We are also hiding this tweak fee from the user in the checkout page in
order to not disturb the UI with inconsequential fee of 0.000000001 sats.
* Only show 8 digits in checkout, even if amount is 11 digits
* Greenfield: Add file endpoints and upload
- Endpoints for server files
- File upload using `multipart/form-data`
Closes#6074.
Can also be tested using cURL:
- `curl --location 'https://localhost:14142/api/v1/files' --header 'Authorization: token MY_API_TOKEN' --form 'file=@"LOCAL_FILEPATH"'`
- `curl --location 'https://localhost:14142/api/v1/users/me/picture' --header 'Authorization: token MY_API_TOKEN' --form 'file=@"LOCAL_FILEPATH"'`
* Revert UnresolvedUri changes
* Add upload for store logo
* Rename filter to storeid for consistency with other filters
* Greenfield: Add storeId to notification
* Cleanups
* Greenfield: Allow filtering notifications by store id
* Greenfield: Refactor app endpoints
- Do not change unset data
- Clean up difference between request (template) and data (items/perks)
- Add missing properties (form id and custom tip percentage)
- Update docs
* Revert ToSettings changes in GreenfieldAppsController
* User: Add name and image URL
More personalization options, prerequisite for btcpayserver/app#3.
Additionally:
- Remove ambigious and read-only username from manage view.
- Improve email verification conditions and display.
- Greenfield: Update current user. Prerequisite for btcpayserver/app#13.
* Refactor UpdateCurrentUser
* Replace new columns by UserBlob
* Update email check and add test case for mailbox addresses
---------
Co-authored-by: nicolas.dorier <nicolas.dorier@gmail.com>
* Allow overrides on all methods
* Add non-returning SendHttpRequest methods
* Use SendHttpRequest consistently
* Use file-scoped namespace
* Rates: Set default null value for currencyPair
* Ensure it works with instances which have BTCPAY_ROOTPATH set
* Remove deprecated CSS options
Closes#5945.
* Greenfield: Add brandColor to store APIs
Closes#5946.
* Migrate file IDs to URLs
Closes#5953.
* Greenfield: Add CSS and logo URL to store settings API
Closes#5945.
* Add migration test
* Store and Server branding can reference file's via fileid:ID
* Add PaymentSoundUrl to Store API
---------
Co-authored-by: nicolas.dorier <nicolas.dorier@gmail.com>