From 5b49bd599681efced0ded01d113054b76579d303 Mon Sep 17 00:00:00 2001 From: PrincipalSpears Date: Mon, 20 Feb 2023 18:55:51 -0600 Subject: [PATCH] half way through spec writing --- spec/buildchart.sh | 1 + spec/flowchart.gv | 121 +++++++++++++++++++++++++++++++++++++++++++++ spec/spec.txt | 7 +++ 3 files changed, 129 insertions(+) create mode 100755 spec/buildchart.sh create mode 100644 spec/flowchart.gv create mode 100644 spec/spec.txt diff --git a/spec/buildchart.sh b/spec/buildchart.sh new file mode 100755 index 0000000..4040a12 --- /dev/null +++ b/spec/buildchart.sh @@ -0,0 +1 @@ +dot -T png *.gv |feh - diff --git a/spec/flowchart.gv b/spec/flowchart.gv new file mode 100644 index 0000000..cdcc79b --- /dev/null +++ b/spec/flowchart.gv @@ -0,0 +1,121 @@ +digraph G { +overlap=false +nodesep=2 + +subgraph client { +label = "Client"; +node[color=red]; +"Customer" +"Freelancer" +} + +subgraph endpoints { +label = "API Endpoints"; +node[color=turquoise] +"/" +"/customer/$freelancer/template/$templateName" +"/customer/$freelancer/template/$templateName/request" + +"/freelancer/$freelancer/inbox" +"/freelancer/$freelancer/requests/$requestID" +"/freelancer/$freelancer/requests/$requestID/accept" +"/freelancer/$freelancer/requests/$requestID/decline" + +"/freelancer/$freelancer/invoice" + +"/freelancer/login" +} + +subgraph backend { +label = "Backend"; +node[color=blue] +"HTML Assembler" [shape=rectangle] +"Oauth2 Authorization Server" +StripeSetup +BTCPayServerSetUp +} + +subgraph foreign { +node[color=yellow] +label = "Foreign APIs"; +Stripe +} + + +subgraph selfhosted { +node[color=orange] +label = "Self-Hosted software"; +"Email Server" +BTCPayServer +} + +subgraph filesystem { +node[color=black] +label = "Filesystem"; +"Freelancer Data" +"HTML Templates" +"request database" +} + +//Customer Interface +////GET +"Customer" -> {"/" "/customer/$freelancer/template/$templateName"} [label="GET Request"] +////POST +"Customer" -> {"/customer/$freelancer/template/$templateName/request"} [label = "POST Request"] + +//Freelancer Interface +"Freelancer" -> {"/freelancer/$freelancer/inbox" "/freelancer/$freelancer/requests/$requestID/accept" "/freelancer/$freelancer/requests/$requestID/decline"} [label="GET Request"] + +//Customer Interface Assembly +"HTML Templates" -> "HTML Assembler" [label="HTML Templates to use"] +{"/" "/customer/$freelancer/template/$templateName"} -> "HTML Assembler" [label="Location being requested"] +"HTML Assembler" -> {"/" "/customer/$freelancer/template/$templateName"} [label = "HTML"] + +//Freelancer Interface Assembly +{"/freelancer/$freelancer/inbox" "/freelancer/$freelancer/requests/$requestID"} -> "HTML Assembler" [label="Location being requested"] +"HTML Assembler" -> {"/freelancer/$freelancer/inbox" "/freelancer/$freelancer/requests/$requestID"} [label = "HTML"] + +////HTML Assembler must get data from the request database +"request database" -> "HTML Assembler" [label = "$freelancer's inbox data"] + +//Populating with Freelancer Data +"Freelancer Data" -> "HTML Assembler" [label = "List of vendors"] +"Freelancer Data" -> "/customer/$freelancer/template/$templateName" [label = "Commission Templates"] + +//Template System +"/customer/$freelancer/template/$templateName/request" -> {"request database"} [label = "Notifying $freelancer of new commission request\nThis will also store a $requestID, a $customerEmailAddress, and a $requestMessage"] +"request database" -> "/freelancer/$freelancer/requests/$requestID" [label = "stored $requestID's $customerEmailAddress, $requestMessage, and $templateName, and $currencyPreference"] +"/freelancer/$freelancer/requests/$requestID/accept" -> {"StripeSetup" "BTCPayServerSetUp"} [label = "Depending on $currencyPreference, send $customerEmailAddress, $requestMessage, and $templateName"] +"/freelancer/$freelancer/requests/$requestID/decline" -> "Email Server" [label = "Declining letter"] +{"Email Server"} -> Customer [label = "Email containing decline for job"] + +//Invoice System + +Freelancer -> "/freelancer/$freelancer/invoice" [label = "POST Request"] +"/freelancer/$freelancer/invoice" -> {"StripeSetup" "BTCPayServerSetUp"} [label = "Depending on $currencyPreference, send $customerEmailAddress, $requestMessage, and $templateName"] + +//Log in +Freelancer -> "/freelancer/login" +"/freelancer/login" -> "Oauth2 Authorization Server" [label = "POST Request"] +"Oauth2 Authorization Server" -> "Freelancer" [label = "Authorization Token"] + +//TODO: add settings for asking for percentages of payment up front or at delivery +//This feature should be a slider basically, allowing 100% up front to 100% on deliver and everything inbetween + + +//Payment verification +StripeSetup -> Stripe [label = "API request"] +BTCPayServerSetUp -> BTCPayServer [label = "API request"] +{Stripe BTCPayServer} -> Customer [label = "Email containing invoice data"] +//Should hook up to BTCpay and stripe and query them to see if an invoice has been paid or not +//likely will need a database of some sorts for this +//Once paid, the freelancer should be notified that it was paid and will be told to start working + +//Delivery + +////Since most of this stuff will consist of files, should have the ability for freelancers to deliver via files +////If doing pay-on-deliver, then paying should instantly release the file. Otherwise, files should be delivered ASAP +////Files should be collected ideally via Email, but other delivery mechanisms will work too (i.e via discord) +////Maybe do an in-app delivery mechanism? However, this would require an account. + +} diff --git a/spec/spec.txt b/spec/spec.txt new file mode 100644 index 0000000..7523672 --- /dev/null +++ b/spec/spec.txt @@ -0,0 +1,7 @@ +Vendors will be stored ideally in a file, or on a DB if necessary +Vendors will provide contact information to set up a commission and the terms of it (Ideally email will have primacy here) + Vendors can set up "template commissions". These template commissions can just be a link easily embedable anywhere for requesting a quote + Quote requests will require an email address, a name, and a description. + If approved, an email of an invoice will be sent to the requester + If denied, an email will be sent to the requester + If in flux (more info needed perhaps), an email with further elaboration should be sent by the freelancer