B2Bitcoin / beBOP

Marvelous p2p bitcoin-based online sales platform
https://be-bop.io
GNU Affero General Public License v3.0
14 stars 3 forks source link

Manage a EMV-like behavior #380

Open Tirodem opened 1 year ago

Tirodem commented 1 year ago

Context

In order to use the product as retail device, we need to manage to have a EMV-like interaction with a specific device (smartphone, or tablet, but that can be a browser tab on a portable monitor) to display informations & payment QR code customer-side. We need a custom order page, allowed only when logged as admin, and displayable on small screen. Note that every retail feature is Lightning only, or Bitcoin with 0 confirmation setted, considering sellers need fast transactions on a physical store. (And of course "cash" payment as it's done by the seller)

Solution

We have 2 use-case :

Design

Pages should be OK on 320*480px devices (to stick with these kinds of monitors : https://www.amazon.fr/dp/B07DK6CKJJ/ref=pe_27091421_487052621_TE_item & https://www.amazon.fr/dp/B07WSVS1Q1/ref=pe_27091421_487052621_TE_item ) Following design are the complete pages, not just a focus.

Basket in progress

image Should be refresh on every basket update.

Pending order

image Note: on that one, if Bootik has one, we can add Machankura / 8333.mobi bootik phone number or display lightning address

Paid order

image

Waiting for new order

image

coyotte508 commented 11 months ago

461 adds a "sessions" collection.

Each POS seat's _id should be a crypto.randomUUID().

We should add a seatId info to that session when a POS user logs in: when they log in, they need to select the POS Seat they're on in the next page.

The DB's session is updated with that seat.

Then they have an easily accessible link to /admin/pos/{seatId} which opens a new tab with the view for the client.

The POS user can then create carts, etc, and the view for the client will update accordingly.

For real time communication:

That way communication should be instant, there should be no delays.

AdrienBarb commented 11 months ago

Admin can create POS Seat with a login/password. After that, POS Seat can login via the admin form with his credentiels, but what happen if a User and a POS Seat have the same login ?

Should we not have only one Users collection, with a isPos boolean ?

coyotte508 commented 11 months ago

@AdrienBarb we have only one Users collection, with a unique index on login, backupInfo.email & backupInfo.npub. Users also have a roleId, a POS could have the point-of-sale role id

Tirodem commented 11 months ago

"that's my fault" comment : I discussed today with Benderrr and I gave him a greenlight for "isPOS" boolean paraeter in user instead on managing per role for the Luxogood MVP, if that allows to go quicker (Luxogood will launch with only 1 physical shop & 1 POS, so... we have time to check before heavy POS seat management). Nothing to add on the other comments, their still legit.