Template for customer request @MichaelYick give it a look over if this setup is proper

Table modification for aditional details in spec
This commit is contained in:
Tina_Azure
2023-04-06 01:26:45 +02:00
parent a4ec9199ae
commit caca7139cb
3 changed files with 81 additions and 1 deletions

View File

@ -4,7 +4,9 @@ sudo -u postgres createdb --owner=cavecomm cavecomm 'contains all the informatio
sudo -u postgres psql -c "GRANT ALL PRIVILEGES ON DATABASE cavecomm TO cavecomm;" sudo -u postgres psql -c "GRANT ALL PRIVILEGES ON DATABASE cavecomm TO cavecomm;"
sudo -u postgres psql -c "CREATE TABLE requests( sudo -u postgres psql -c "CREATE TABLE requests(
id INT PRIMARY KEY GENERATED ALWAYS AS IDENTITY, id INT PRIMARY KEY GENERATED ALWAYS AS IDENTITY,
customerName text,
customerEmailAddress text, customerEmailAddress text,
customerContactDetails text,
freelancerID INT, freelancerID INT,
templateID INT, templateID INT,
currencyPreference varchar(6), currencyPreference varchar(6),
@ -15,7 +17,8 @@ sudo -u postgres psql -c "CREATE TABLE requests(
upFrontInvoiceID text, upFrontInvoiceID text,
onDeliverInvoiceID text, onDeliverInvoiceID text,
upFrontPaid boolean, upFrontPaid boolean,
onDeliverPaid boolean onDeliverPaid boolean,
completed boolean
); );
" cavecomm " cavecomm

View File

@ -50,6 +50,29 @@ $onDeliverInvoiceID - the ID of the invoice (for contacting BTCPayServer or Stri
$upFrontPaid - A boolean representation of if the up-front Payment has been paid. $upFrontPaid - A boolean representation of if the up-front Payment has been paid.
$onDeliverPaid - A boolean representation of if the on-Deliver Payment has been paid. $onDeliverPaid - A boolean representation of if the on-Deliver Payment has been paid.
modified Table structure
$id
$customerName - name of customer
$customerEmailAddress
$customerContactDetails - extra details about contact or alternative contact options like discord
$freelancerID - id referencing freelancer
$templateID - id referencing template
$currencyPreference
$priceUpFront
$priceOnDeliver
$requestDescription
$accepted boolean
$upFrontInvoiceID
$onDeliverInvoiceID
$upFrontPaid
$onDeliverPaid
$completed - marker to set if the request has been completed
## email delivery
email is sent via email server given by the admin, while the software functions as a client to it.
# Interface # Interface
+++ Datatransfer inbetween pages is performed with POST +++ Datatransfer inbetween pages is performed with POST

View File

@ -0,0 +1,54 @@
<!DOCTYPE html>
<html>
<head>
<style>
table {
font-family: arial, sans-serif;
border-collapse: collapse;
width: 100%;
}
td, th {
border: 1px solid #dddddd;
text-align: left;
padding: 8px;
}
tr:nth-child(even) {
background-color: #dddddd;
}
</style>
</head>
<body>
<h2>Freelancer: {{freelancername}}</h2>
<h3>Template: {{templatename}}</h3>
<br>
<form action="/customer/{{freelancername}}/template/{{templatename}}/request/fulfilment" method="post">
<label for="customername">Name:</label> <input type="text" id="customername" name="customername" value=""><br>
<label for="email">E-Mail:</label> <input type="email" id="email" name="email" value=""><br>
<label for="customercontactdetails">Additional Contact Details: </label> <input type="text" id="customercontactdetails" name="customercontactdetails" value=""><br>
<label for="requestdescription">Request Description:</label><br>
<textarea type="text" id="requestdescription" name="requestdescription"></textarea><br>
<button type="submit" name="templateID" value="{{templateid}}" class="button">Request this Template</button>
</form>
<br>
<div>Payment Information:</div>
<div>
Currency: {{currencypreference}}<br>
Price: {{pricetotal}} - Upfront: {{priceupfront}} - On Delivery: {{priceondeliver}}
</div><br>
<form action="/customer/{{freelancername}}/template/{{templatename}}" method="post">
<button type="submit" name="templateID" value="{{templateid}}" class="button">Return to template page</button>
</form>
<br>
<form action="/" method="post">
<button type="submit" class="button">Return to freelancer selection</button>
</form>
</body>
</html>