diff --git a/.dockerignore b/.dockerignore new file mode 100755 index 0000000..ec0905d --- /dev/null +++ b/.dockerignore @@ -0,0 +1,3 @@ +node_modules/ +.svelte-kit +.idea diff --git a/.gitignore b/.gitignore new file mode 100755 index 0000000..feeb650 --- /dev/null +++ b/.gitignore @@ -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 \ No newline at end of file diff --git a/.npmrc b/.npmrc new file mode 100755 index 0000000..0c05da4 --- /dev/null +++ b/.npmrc @@ -0,0 +1,2 @@ +engine-strict=true +resolution-mode=highest diff --git a/Dockerfile b/Dockerfile index 5d1853a..e58a0db 100755 --- a/Dockerfile +++ b/Dockerfile @@ -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 diff --git a/Dockerfile.prod b/Dockerfile.prod index c11b39e..74a3b17 100755 --- a/Dockerfile.prod +++ b/Dockerfile.prod @@ -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/ diff --git a/src/lib/types/types.ts b/src/lib/types/types.ts index 31871e2..4a5087e 100644 --- a/src/lib/types/types.ts +++ b/src/lib/types/types.ts @@ -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; + } \ No newline at end of file diff --git a/src/routes/+layout.svelte b/src/routes/+layout.svelte index 6845ec3..cc40ee5 100755 --- a/src/routes/+layout.svelte +++ b/src/routes/+layout.svelte @@ -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"]; } }); @@ -49,13 +48,13 @@