Updated variables

This commit is contained in:
2024-06-20 10:43:30 -04:00
parent 048e552f7b
commit 158937dfea
12 changed files with 366 additions and 57 deletions

3
.dockerignore Executable file
View File

@@ -0,0 +1,3 @@
node_modules/
.svelte-kit
.idea

19
.gitignore vendored Executable file
View File

@@ -0,0 +1,19 @@
.DS_Store
node_modules
package-lock.json
/build
/.svelte-kit
/package
.env
.env.*
!.env.example
vite.config.js.timestamp-*
vite.config.ts.timestamp-*
/.idea/.gitignore
/.idea/auburnoil_frontend.iml
/.idea/misc.xml
/.idea/modules.xml
/.idea/inspectionProfiles/profiles_settings.xml
/.idea/inspectionProfiles/Project_Default.xml
/.idea/vcs.xml
*.pyc

2
.npmrc Executable file
View File

@@ -0,0 +1,2 @@
engine-strict=true
resolution-mode=highest

View File

@@ -1,6 +1,6 @@
FROM node:latest
ENV PUBLIC_BASE_URL=http://localhost:4056
ENV PUBLIC_BASE_URL=http://localhost:5170
RUN mkdir -p /app

View File

@@ -1,5 +1,7 @@
FROM node:20.11.1 AS builder
ENV PUBLIC_BASE_URL=https://api.auburnoil.com
WORKDIR /app
COPY package*.json .
RUN npm ci
@@ -8,6 +10,7 @@ RUN npm run build
RUN npm prune --production
FROM node:20.11.1
WORKDIR /app
COPY --from=builder /app/build build/
COPY --from=builder /app/node_modules node_modules/

View File

@@ -2,12 +2,96 @@
export type oilprice = {
ok: boolean
price_for_employee: string;
todays_price: string;
}
export type company = {
ok: boolean
name: string;
telephone: string;
company_name: string;
company_phone_number: string;
}
export type deliverytype = {
ok: boolean
id: number;
customer_id: string;
customer_name: string;
customer_address: string;
customer_town: string;
customer_state: number;
customer_zip: string;
gallons_ordered: number;
customer_asked_for_fill: number;
gallons_delivered: string;
customer_filled: number;
delivery_status: number;
when_ordered: string;
when_delivered: string;
expected_delivery_date: string;
automatic: number;
oil_id: number;
supplier_price: string;
customer_price: string;
customer_temperature: string;
dispatcher_notes: string;
prime: number;
same_day: number;
payment_type: number;
payment_card_id: number;
driver_employee_id: number;
driver_first_name: string;
driver_last_name: string;
}
export type customertype = {
ok: boolean
id: number;
user_id: number;
customer_first_name: string;
customer_last_name: string;
customer_town: string;
customer_address: string;
customer_state: number;
customer_zip: string;
customer_apt: string;
customer_home_type: number;
customer_phone_number: string;
account_number: string;
}
export type pastdeliverytype = {
ok: boolean
id: number;
customer_id: string;
customer_name: string;
customer_address: string;
customer_town: string;
customer_state: number;
customer_zip: string;
gallons_ordered: number;
customer_asked_for_fill: number;
gallons_delivered: string;
customer_filled: number;
delivery_status: number;
when_ordered: string;
when_delivered: string;
expected_delivery_date: string;
automatic: number;
oil_id: number;
supplier_price: string;
customer_price: string;
customer_temperature: string;
dispatcher_notes: string;
prime: number;
same_day: number;
payment_type: number;
payment_card_id: number;
driver_employee_id: number;
driver_first_name: string;
driver_last_name: string;
}

View File

@@ -9,10 +9,10 @@
let price_of_oil: string = '';
let company_name: string = '';
let tel_number: string = '';
let company_phone_number: string = '';
onMount(async () => {
await fetch(PUBLIC_BASE_URL + "/info/price/oil", {
await fetch(PUBLIC_BASE_URL + "/info/price/today", {
method: "get",
credentials: "include",
headers: {
@@ -23,8 +23,7 @@
.then((result) => (oil_price_data = result));
if (oil_price_data["ok"] == true) {
console.log("here")
price_of_oil = oil_price_data["price_for_employee"];
price_of_oil = oil_price_data["todays_price"];
}
});
@@ -40,8 +39,8 @@
.then((result) => (company_data = result));
if (company_data["ok"] == true) {
company_name = company_data["name"];
tel_number = company_data["telephone"];
company_name = company_data["company_name"];
company_phone_number = company_data["company_phone_number"];
}
});
</script>
@@ -49,13 +48,13 @@
<div class="grid grid-cols-12 bg-white overflow-hidden">
<div class="col-span-12 md:col-span-3 text-3xl p-10 text-base-100 font-bold invisible md:visible h-0 md:h-auto">
<div class="text-center pt-5">Call Today</div>
<div class="text-center">{tel_number}</div>
<div class="text-center">{company_phone_number}</div>
</div>
<div class="col-span-12 md:col-span-6 md:p-10 text-center font-bold ">
<div class="flex justify-center">
<div class="md:flex md:justify-center pb-5 md:pb-0 gap-5">
<a
class="normal-case text-8xl text-white bg-primary"
class="normal-case text-8xl text-primary"
href="/"
>
Auburn
@@ -68,7 +67,7 @@
</a>
</div>
<a
class="normal-case text-3xl text-primary text-primary"
class="normal-case text-3xl text-primary "
href="/">Oil thats good for your system</a
>
</div>
@@ -78,7 +77,7 @@
class=" col-span-12 md:col-span-3 md:p-10 text-3xl text-base-100 font-bold"
>
<div class="text-center pt-5">Todays Price</div>
<div class="text-center">{price_of_oil}</div>
<div class="text-center">${price_of_oil}</div>
</div>
</div>
@@ -107,6 +106,7 @@
tabindex="0"
class="menu menu-sm dropdown-content mt-3 z-[1] p-2 shadow bg-white rounded-box w-52 font-bold text-blue-800 "
>
<li><a class="text-2xl py-2 hover:bg-base-100" href="/">Home</a></li>
<li><a class="text-2xl py-2 hover:bg-base-100" href="/delivery">Oil Delivery</a></li>
<li><a class="text-2xl py-2 hover:bg-base-100" href="/servicearea">Delivery Area</a></li>
<li><a class="text-2xl py-2 hover:bg-base-100" href="/about">About Us</a></li>
@@ -117,6 +117,7 @@
</div>
<div class="navbar-center hidden lg:flex text-white">
<ul class="menu menu-horizontal px-1 text-xl">
<li><a href="/">Home</a></li>
<li><a href="/delivery">Oil Delivery</a></li>
<li><a href="/servicearea">Delivery Area</a></li>
<li><a href="/about">About Us</a></li>
@@ -133,7 +134,7 @@
<div class="grid grid-cols-12 bg-secondary py-10 w-full">
<div
class="col-span-12 md:col-span-4 text-center text-white text-bold text-6xl"
class="col-span-12 md:col-span-4 text-center text-white text-bold text-6xl "
>
<div class="flex justify-center pt-5">
<div class=" text-white px-1">Auburn</div>
@@ -141,15 +142,15 @@
</div>
</div>
<div
class="col-span-12 md:col-span-4 text-center text-bold text-xl text-white"
class="col-span-12 md:col-span-4 text-center text-bold text-xl text-white pb-10"
>
<div class="">{tel_number}</div>
<div class="">{company_phone_number}</div>
<div class="">Worcester Ma</div>
<div class="">Mon - Fri 8:00 am - 5:00 pm</div>
<div class="">Sat Closed | Sun Closed</div>
</div>
<div class="col-span-4 text-center"></div>
<div class="col-span-12 h-auto bg-primary text-white w-full">
<div class="col-span-12 h-auto bg-primary text-white w-full ">
<div class=" mx-auto max-w-7xl p-5">
<div class="text-xl font-bold text-center">
© 2023 by Rocket Services LLC - Auburn, MA | All Rights Reserved

View File

@@ -7,12 +7,14 @@
export let company_data: company;
export let oil_price_data: oilprice;
let price_of_oil: string = '';
let company_name: string = '';
let tel_number: string = '';
let company_phone_number: string = '';
onMount(async () => {
await fetch(PUBLIC_BASE_URL + "/info/price/oil", {
await fetch(PUBLIC_BASE_URL + "/info/price/today", {
method: "get",
credentials: "include",
headers: {
@@ -23,7 +25,7 @@
.then((result) => (oil_price_data = result));
if (oil_price_data["ok"] == true) {
price_of_oil = oil_price_data["price"];
price_of_oil = oil_price_data["todays_price"];
}
});
onMount(async () => {
@@ -38,8 +40,8 @@
.then((result) => (company_data = result));
if (company_data["ok"] == true) {
company_name = company_data["name"];
tel_number = company_data["telephone"];
company_name = company_data["company_name"];
company_phone_number = company_data["company_phone_number"];
}
});
</script>
@@ -52,7 +54,7 @@
<div class="mx-auto p-10">
<div class="mx-auto pb-5 text-5xl text-center">Order Now</div>
<div class="mx-auto text-5xl text-center">
{tel_number}
{company_phone_number}
</div>
<div class="grid grid-cols-12 gap-5 px-5 text-center mt-10">
@@ -70,13 +72,15 @@
<div class="col-span-12 lg:col-span-3 bg-base-100 p-10">
<div class="text-4xl mb-3">Phone Support</div>
<div class="text-lg">
We dont cut our product with products. Our Oil is pure #2 heating oil.
Real live person on the phone when you call.
</div>
</div>
<div class="col-span-12 lg:col-span-3 bg-base-100 p-10">
<div class="text-4xl mb-3">Top Quality Oil</div>
<div class="text-lg">
We dont cut our product with products. Our Oil is pure #2 heating oil.
We dont cut our product with biodiesel. We use the best available
natural oil-12
</div>
</div>
<div class="col-span-12 lg:col-span-2"></div>

View File

@@ -2,17 +2,17 @@
import "../../app.postcss";
import { onMount } from "svelte";
import { PUBLIC_BASE_URL } from "$env/static/public";
import type { company, oilprice } from '$lib/types/types'
import type { company, oilprice } from "$lib/types/types";
export let company_data: company;
export let oil_price_data: oilprice;
let price_of_oil: string = '';
let company_name: string = '';
let tel_number: string = '';
let price_of_oil: string = "";
let company_name: string = "";
let company_phone_number: string = "";
onMount(async () => {
await fetch(PUBLIC_BASE_URL + "/info/price/oil", {
await fetch(PUBLIC_BASE_URL + "/info/price/today", {
method: "get",
credentials: "include",
headers: {
@@ -23,7 +23,7 @@
.then((result) => (oil_price_data = result));
if (oil_price_data["ok"] == true) {
price_of_oil = oil_price_data["price"];
price_of_oil = oil_price_data["todays_price"];
}
});
onMount(async () => {
@@ -38,8 +38,8 @@
.then((result) => (company_data = result));
if (company_data["ok"] == true) {
company_name = company_data["name"];
tel_number = company_data["telephone"];
company_name = company_data["company_name"];
company_phone_number = company_data["company_phone_number"];
}
});
</script>
@@ -52,10 +52,10 @@
</div>
</div>
<div class="max-w-7xl mx-auto px-10">
<div class="grid grid-cols-2">
<div class="col-span-1 p-5">
<div class="text-2xl font-bold text-primary">Contact Good Oil</div>
<div class="mb-20 text-xl">Phone: {tel_number}</div>
<div class="grid grid-cols-2 gap-5">
<div class="col-span-2 md:col-span-1">
<div class="text-2xl font-bold text-primary">Contact Us</div>
<div class="mb-20 text-xl">Phone: {company_phone_number}</div>
<div class="mb-10">
<div class="font-bold text-2xl text-primary max-w-7xl mx-auto">
@@ -84,8 +84,8 @@
<div class="text-xl">Sunday: Closed</div>
</div>
</div>
<div class="col-span-1">
<img class=" w-auto" src="/images/contact.png" alt="" />
<div class="col-span-2 md:col-span-1">
<img class="w-auto" src="/images/contact.png" alt="" />
</div>
</div>
</div>

View File

@@ -2,10 +2,10 @@
import "../../app.postcss";
import { onMount } from "svelte";
import { PUBLIC_BASE_URL } from "$env/static/public";
import type { company, oilprice } from '$lib/types/types'
import type { company } from '$lib/types/types'
export let company_data: company;
export let oil_price_data: oilprice;
let company_name: string = '';
let tel_number: string = '';
@@ -22,8 +22,8 @@
.then((result) => (company_data = result));
if (company_data["ok"] == true) {
company_name = company_data["name"];
tel_number = company_data["telephone"];
company_name = company_data["company_name"];
tel_number = company_data["company_phone_number"];
}
});
@@ -32,6 +32,7 @@
<div class="bg-secondary px-10">
<div
class="max-w-7xl justify-center py-5 mx-auto font-bold text-2xl text-white"
>
Heating Oil Delivery
</div>
@@ -45,6 +46,7 @@
<div class="col-span-12 font-bold text-2xl my-10">
We know it can be tough to order oil. We make it simple!
</div>
<div class="col-span-12 font-bold text-xl text-primary">
Worcester County
@@ -54,6 +56,7 @@
<ul>Prime - 25$</ul>
<ul>Same Day - 150$</ul>
</div>
<div class="col-span-12 font-bold mt-10 text-xl text-primary">
Payments Methods
@@ -62,29 +65,41 @@
<ul>Cash on Delivery (C.O.D)</ul>
<ul>Credit Card</ul>
<ul>Money Order</ul>
</div>
<div class="col-span-12 mx-auto py-10">
<img class=" h-20 w-auto" src="/images/creditcards.png" alt="">
</div>
<div class="col-span-12 mb-10">
<ul>
<div class="flex gap-5">
<img class=" p-0 m-0 h-10 w-5" src="/images/flame.png" alt="" />
<ul>
<div class="col-span-12 font-bold mt-10 text-xl text-primary">
How to Order Oil
</div>
<div class="flex gap-5">
<div class="flex gap-5">
<li class=" font-bold">
<li class=" font-bold">
1.) Call {tel_number} to place an order.
</li>
</div>
<div class="flex gap-5">
<div class="flex gap-5">
<li class=" font-bold">
<li class=" font-bold">
2.) Give your name, address, fill location, and phone number.
</li>
</div>
<div class="flex gap-5">
<li class=" font-bold">
3.) Decide if you want a fill or specific gallons
</li>
</div>
<div class="flex gap-5">
<li class=" font-bold">
4.) Pay with Credit Card or pay the driver cash
</li>
</div>
</ul>
</div>
<div class="col-span-12 mx-auto py-10">
<img class=" h-20 w-auto" src="/images/creditcards.png" alt="">
</div>
</div>
</div>

View File

@@ -73,7 +73,7 @@
</div>
<div class="col-span-12 py-5 ">
<div class="flex justify-center items-center md:h-auto ">
<img class="" src="/images/map.png">
<img class="" src="/images/map.png" alt="">
</div>
</div>
</div>

View File

@@ -0,0 +1,178 @@
<!-- <script lang="ts">
import "../../../app.postcss";
import { onMount } from "svelte";
import { PUBLIC_BASE_URL } from "$env/static/public";
import type {
deliverytype,
customertype,
} from "$lib/types/types";
export let delivery_data: deliverytype;
export let customer_data: customertype;
let datatickets: any[] = [];
let user_id: string = "";
let dispatcher_notes: string = '';
onMount(async () => {
await fetch(PUBLIC_BASE_URL + "/delivery/" + data.ticketid, {
method: "get",
credentials: "include",
headers: {
"Content-Type": "application/json",
},
})
.then((response) => response.json())
.then((result) => (delivery_data = result));
if (delivery_data["ok"] == true) {
let dispatcher_notes = delivery_data["dispatcher_notes"];
delivery_data.payment_type = delivery_data["payment_type"];
delivery_data.customer_address = delivery_data["customer_address"];
delivery_data.customer_town = delivery_data["customer_town"];
delivery_data.customer_state = delivery_data["customer_state"];
delivery_data.customer_zip = delivery_data["customer_zip"];
delivery_data.when_ordered = delivery_data["when_ordered"];
delivery_data.when_delivered = delivery_data["when_delivered"];
delivery_data.gallons_delivered = delivery_data["gallons_delivered"];
delivery_data.expected_delivery_date = delivery_data["expected_delivery_date"];
delivery_data.customer_price = delivery_data["customer_price"];
delivery_data.driver_employee_id = delivery_data["driver_employee_id"];
user_id = delivery_data["customer_id"];
console.log("going ...")
fetchCustomer(delivery_data["customer_id"]);
fetchData(delivery_data["customer_id"]);
}
});
// user info
async function fetchCustomer(user_id:string) {
console.log("fetching customer");
console.log(PUBLIC_BASE_URL + "/customer/" + user_id,)
const response = await fetch(PUBLIC_BASE_URL + "/customer/" + user_id, {
method: "get",
credentials: "include",
headers: {
"Content-Type": "application/json",
},
})
const customer_data = await response.json();
console.log("poop")
};
// past deliveries
async function fetchData(user_id:string) {
const response = await fetch(PUBLIC_BASE_URL + "/delivery/past/" + user_id, {
method: "get",
credentials: "include",
headers: {
"Content-Type": "application/json",
},
})
const jsonData = await response.json();
datatickets = jsonData;
}
</script>
<template>
{dispatcher_notes}
<div class="absolute" id="page">
<div class="p-10 max-w-5xl bg-white text-black">
<div class="grid grid-cols-12">
<div class="col-span-9">
<div class="grid grid-cols-12 pb-10">
<div class="col-span-2">#2 Heating</div>
<div class="col-span-2"></div>
<div class="col-span-2">0</div>
<div class="col-span-2">275</div>
<div class="col-span-2">
{customer_data.customer_phone_number}
</div>
</div>
<div class="grid grid-cols-12 pl-5 pb-10">
<div class="col-span-8">
{customer_data.customer_first_name}
{customer_data.customer_last_name}
</div>
<div class="col-span-4">
{customer_data.account_number}
</div>
<div class="col-span-12">
{customer_data.customer_address}
{customer_data.customer_apt}
</div>
<div class="col-span-3">
<div class="grid grid-cols-12">
<div class="col-span-5">
{delivery_data.customer_town}
</div>
<div class="col-span-3">
{delivery_data.customer_state}
</div>
<div class="col-span-4">
{delivery_data.customer_zip}
</div>
</div>
</div>
</div>
<div class="grid grid-cols-12 pl-5 pb-10">
<div class="col-span-12 pb-5">
{delivery_data.dispatcher_notes}
</div>
{#if delivery_data.payment_type == 0}
<div class="col-span-12">CASH</div>
{:else if delivery_data.payment_type == 1}
<div class="col-span-12">Credit Card</div>
{:else if delivery_data.payment_type == 2}
<div class="col-span-12">Credit Card/Cash</div>
{:else}{/if}
</div>
<div class="grid grid-cols-12">
{#each datatickets as item}
<div class="col-span-6 flex">
<div>
{item.when_delivered} - {item.gallons_delivered}
</div>
</div>
{/each}
</div>
</div>
<div class="col-span-3">
<div class="grid grid-cols-12">
<div class="col-span-12 h-7">
{delivery_data.when_ordered}
</div>
<div class="col-span-12 h-7">
{delivery_data.expected_delivery_date}
</div>
<div class="col-span-12 h-7"></div>
<div class="col-span-12 h-7">
{delivery_data.customer_price}
</div>
<div class="col-span-12 h-7">
{delivery_data.when_ordered}
</div>
<div class="col-span-12 h-7"></div>
<div class="col-span-12 h-7"></div>
<div class="col-span-12 h-7">
{delivery_data.driver_employee_id}
</div>
</div>
</div>
</div>
</div>
</div>
</template> -->