Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow product creation from whitelisted npub nostr message #171

Open
Tirodem opened this issue Jun 14, 2023 · 1 comment
Open

Allow product creation from whitelisted npub nostr message #171

Tirodem opened this issue Jun 14, 2023 · 1 comment

Comments

@Tirodem
Copy link
Contributor

Tirodem commented Jun 14, 2023

following #168

Context

  • When my Bootik A is linked to a Bootik B with the link "Whitelisted & OK discovery - X%" or "Whitelisted & OK association", I can duplicate a product from Bootik B catalog (from the product URL) to add to my own Bootik A catalog.

#UI

  • Create a "Add product from Crossbootik" CTA on /admin/product
    image
  • Create a "Add product from Crossbootik" form
    image
    • either "Association (Multibootik) product" or "Discovery (Metabootik) product" checkbox is needed ; 0 = form error on submit ; both = form error on submit
  • Add a "Curation" block on product page displaying the text from "Crossbootik's additional note" value
    image
  • On /admin/product , display crossbootiks products on a specific zone
    image
  • On /admin/product , display crossbootik products requests on a specific zone
    image

Use case

Product creation (Bootik A's side)

  • When I add a product from Crossbootik :
    • create an entry on database on crossbootik product table with "pending" statuts
    • send a product data notification through nostR to origin Bootik (Bootik B) with product URL and mode (Discovery-Metabootik / Association-Multibootik)

Error Management

  • When I add a product from Crossbootik, if source Bootik is not whitelisted, raise error on form "You can only add crossbootik products from whitelisted bootik"
  • When I add a product from Crossbootik with "Association (Multibootik) product" option checked, if I don't have the link "Whitelisted & OK association" with origin Bootik, raise error on form "You have no association (multibootik) with this product's owner"
  • When I add a product from Crossbootik with "Discovery (Metabootik) product" option checked, if I don't have the link "Whitelisted & OK discovery - X%" with origin Bootik, raise error on form "You have no association (multibootik) with this product's owner"

Product request (Bootik B's side)

  • When my Bootik receives a product data notification through nostR :
    • if mode = Discovery-Metabootik and bootiks have the link "Whitelisted & OK discovery - X%" : send product datas back
    • if mode = Association-Multibootik and bootiks have the link "Whitelisted & OK association" : send product datas back
    • in any other case : send "You're not allowed to catch my products"

Product request response proces (Bootik A's side)

  • When my Bootik receives product datas through nostR :
    • if product matches an entry on database on crossbootik product table with "pending" statuts :
      • if mode = Discovery-Metabootik and bootiks have the link "Whitelisted & OK discovery - X%" : create product from these datas (link product image from the original bootik)
      • if mode = Association-Multibootik and bootiks have the link "Whitelisted & OK association" : create product from these datas (link product image from the original bootik)
      • if mode = Discovery-Metabootik and bootiks don't have the link "Whitelisted & OK discovery - X%" : display "declined (origin Bootik is not opened to Discovery)" on /admin/product
      • if mode = Association-Multibootik and bootiks don't have the link "Whitelisted & OK association" : display "declined (no association link)" on /admin/product
        • these last 2 cases are not supposed to happen and are covered earlier in error management but in case of changing datas & flows between the nostr requests & responses I rather be prudent and have multiple security layer)
    • if product doesn't matches an entry on database on crossbootik product table with "pending" statuts : answer "Thanks but no thanks"
  • When my Bootik doesn't receive product datas through nostR 24h after request : display "timeout (pending since 24 hours)" on /admin/product
  • When the crossbootik product is created on my Bootik, displayed it on a specific category ("Crossbootik products (validated)") on /admin/product
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants