Commit graph

49 commits

Author SHA1 Message Date
e8ddc4b697 Refactors type hints for clarity
Some checks failed
CI / lint (push) Has been cancelled
/ release (push) Has been cancelled
/ pullrequest (push) Has been cancelled
Updates type hints in `crud.py`, `helpers.py`, and `models.py` for improved readability and maintainability.

Replaces `Merchant | None` with `Optional[Merchant]` and `list[X]` with `List[X]` for consistency with standard Python typing practices.
2025-11-04 00:59:55 +01:00
429522adba Improves Nostr message handling and error logging
Enhances the processing of Nostr messages by adding more robust error handling and logging, providing better insights into potential issues.

Specifically:
- Improves the checks on the websocket connection to log errors and debug information.
- Implements more comprehensive error logging for failed product quantity checks.
- Enhances logging and validation of EVENT messages to prevent potential errors.
- Implements a more robust merchant lookup logic to avoid double processing of events.
- Implements a more lenient time window for direct message subscriptions.
2025-11-04 00:52:36 +01:00
87a4864c49 Merge branch 'improve-ui' into dev-pm 2025-11-04 00:48:47 +01:00
4b65ed411a interactive rebase commit, clean logs 2025-11-04 00:47:43 +01:00
dni ⚡
696cd96288 chore: add uv, add ci, fix some issues (#113)
in preparation of removing secp
2025-10-30 10:11:18 +01:00
39f0153f9b add DEBUG logs 2025-09-03 10:54:07 +02:00
Vlad Stan
0fc26d096f V1 (#106) 2024-11-06 11:50:21 +02:00
dni ⚡
2ce0c98a76 chore: rename websocketUpdater (#99)
* chore: rename `websocketUpdater`
https://github.com/lnbits/lnbits/pull/2377
2024-04-12 12:12:19 +02:00
Vlad Stan
5c83bf8972 Custom shipping cost (#86)
* feat: simple UI for shipping zone per product

* feat: add empty cost

* fix: backwards compatible zones

* feat: finish UI for product shipping cost

* fix: some ui issues

* feat: add per product shipping cost

* feat: show receipt for product

* fix: publish per product shipping cost
2023-09-21 17:29:13 +03:00
Vlad Stan
c073bf55c9 Fix high load (#84)
* chore: testing

* fix: resubscribe when merchant added/removed

* chore: code clean-up

* fix: temp subscribe when new merchant is added

* fix: new customer profile
2023-09-20 09:17:01 +03:00
Vlad Stan
1a3fc62106 feat: add auto-reply on payment (#82) 2023-09-15 10:21:03 +03:00
Vlad Stan
d26ff891ce fix: import after core refactoring 2023-09-13 09:55:40 +03:00
Vlad Stan
889152a80b Fix subscription errors (#81)
* pref: merge filters in one

* chore: load nit

* feat: restore individual order
2023-09-12 15:03:37 +03:00
Vlad Stan
02d9fcfbfd feat: update shipping zone when re-issuing invoice 2023-07-04 17:15:20 +02:00
Vlad Stan
b5aed1224a feat: allow invoice re-issue 2023-07-04 16:20:08 +02:00
Vlad Stan
4539e3a515 refactor: rename now public method 2023-07-04 16:20:08 +02:00
Vlad Stan
93e362530b feat: show failed order error message 2023-07-04 16:20:08 +02:00
Vlad Stan
acc6ed45c5 fix: store failed orders also 2023-07-04 16:20:08 +02:00
Vlad Stan
bb376b43f2 chore: code format 2023-07-04 16:20:08 +02:00
Vlad Stan
9d1cc504a1 chore: code clean-up 2023-07-04 08:40:49 +02:00
Vlad Stan
2b84ebc83b fix: notification for orders 2023-07-04 08:40:49 +02:00
Vlad Stan
21a77d643f feat: activate/deactivate merchant 2023-07-04 08:40:49 +02:00
Vlad Stan
16e15939d3 refactor: prepare for merchant active/disable state 2023-07-04 08:40:49 +02:00
Vlad Stan
51c4147e65 Product delete (#64)
* feat: restore stalls from `nostr` as pending

* feat: stall and prod last update time

* feat: restore products and stalls as `pending`

* feat: show pending stalls

* feat: restore stall

* feat: restore a stall from nostr

* feat: add  blank `Restore Product` button

* fix: handle no talls to restore case

* feat: show restore dialog

* feat: allow query for pending products

* feat: restore products

* chore: code clean-up

* fix: last dm and last order query

* chore: code clean-up

* fix: subscribe for stalls and products on merchant create/restore

* feat: add message type to orders

* feat: simplify messages; code format

* feat: add type to DMs; restore DMs from nostr

* fix: parsing ints

* fix: hide copy button if invoice not present

* fix: do not generate invoice if product not found

* feat: order restore: first version

* refactor: move some logic into `services`

* feat: improve restore UX

* fix: too many calls to customer DMs

* fix: allow `All` customers filter

* fix: ws reconnect on server restart

* fix: query for customer profiles only one

* fix: unread messages per customer per merchant

* fix: disable `user-profile-events`

* fix: customer profile is optional

* fix: get customers after new message debounced

* chore: code clean-up

* feat: auto-create zone

* feat: fixed ID for default zone

* feat: notify order paid
2023-06-30 13:12:56 +03:00
Vlad Stan
f7dd15e775 feat: allow to add test public key 2023-05-04 12:15:45 +03:00
Vlad Stan
e06b9af4c3 fix: do not erase merchant profile 2023-04-19 10:27:47 +03:00
Vlad Stan
62737e7a79 fix: filter and notifications 2023-04-03 15:11:46 +03:00
Vlad Stan
547c477ce6 fix: shipping cost; update UI on new order 2023-04-03 11:57:55 +03:00
Vlad Stan
e04b9dc448 feat: keep track of new messages 2023-03-30 13:58:14 +03:00
Vlad Stan
098cb5adf5 feat: notify new customer 2023-03-30 13:58:14 +03:00
Vlad Stan
a719517b9c feat: show customer names 2023-03-30 13:58:14 +03:00
Vlad Stan
89f46fff35 feat: keep customer profiles up to date 2023-03-30 13:58:14 +03:00
Vlad Stan
c583af3c33 fix: add orders to direct_messages table 2023-03-24 16:55:23 +02:00
Vlad Stan
13150f6360 feat: republish to nostr 2023-03-24 14:52:34 +02:00
Vlad Stan
a293046106 chore: code clean-up 2023-03-17 18:01:34 +02:00
Vlad Stan
482961a2ef chore: code clean-up 2023-03-16 18:34:37 +02:00
Vlad Stan
f6b5034e74 feat: extract nostr_client class 2023-03-16 16:01:14 +02:00
Vlad Stan
9ce316debe fix: catch AssertionErrors 2023-03-16 15:27:07 +02:00
Vlad Stan
18196bf226 feat: do not issue invoice if insufficient products 2023-03-16 15:15:48 +02:00
Vlad Stan
b7dfa22026 feat: update product quantity when invoice paid 2023-03-16 11:59:38 +02:00
Vlad Stan
eb01b3ab34 chore: code format 2023-03-15 22:25:15 +02:00
Vlad Stan
856ad53b7e fix: use merchant id instead of user id 2023-03-15 11:25:52 +02:00
Vlad Stan
90bbc79734 chore: code clean-up 2023-03-14 14:31:30 +02:00
Vlad Stan
3e0b480f0a feat: user merchant_id instead of user_id 2023-03-14 14:31:30 +02:00
Vlad Stan
69dcbcb002 feat: optimize filtering for DMs 2023-03-14 14:31:30 +02:00
Vlad Stan
bf670c3545 refactor: do not go over http to create order 2023-03-14 14:31:30 +02:00
Vlad Stan
7f3438d07f refactor: clean-up tasks.py 2023-03-14 14:31:30 +02:00
Vlad Stan
6c6cd861ce refactor: extract handle_order_paid 2023-03-14 14:31:30 +02:00
Vlad Stan
c0c737378b refactor: extract create_order 2023-03-14 14:31:30 +02:00