Compare commits
5 commits
fb51c3cd4f
...
e5325917b2
| Author | SHA1 | Date | |
|---|---|---|---|
| e5325917b2 | |||
| 83a1710b46 | |||
| f72516ee4a | |||
| d9ba9c84eb | |||
| eabd115f58 |
13 changed files with 80 additions and 57 deletions
6
.env
6
.env
|
|
@ -1,7 +1,5 @@
|
|||
VITE_BACKEND=http://localhost:4320/api/
|
||||
# VITE_BACKEND=https://ocboapps.davaocity.gov.ph/esign-server/api/
|
||||
# VITE_BACKEND=http://192.168.7.163/server/api/
|
||||
# VITE_BACKEND_=http://192.168.7.165/server/api/
|
||||
# VITE_BACKEND=http://localhost:4320/api/
|
||||
VITE_BACKEND=https://ocboapps.davaocity.gov.ph/esign-server/api/
|
||||
|
||||
VITE_PESO=₱
|
||||
VITE_PUBLICIP=58.69.136.59
|
||||
|
|
@ -9,4 +9,4 @@ RUN pnpm build
|
|||
FROM nginx:alpine AS runtime
|
||||
COPY ./nginx/nginx.conf /etc/nginx/nginx.conf
|
||||
COPY --from=build /app/dist /usr/share/nginx/html
|
||||
EXPOSE 8080
|
||||
EXPOSE 8089
|
||||
|
|
@ -35,9 +35,9 @@ require (
|
|||
github.com/ugorji/go/codec v1.3.1 // indirect
|
||||
go.uber.org/mock v0.6.0 // indirect
|
||||
golang.org/x/arch v0.24.0 // indirect
|
||||
golang.org/x/crypto v0.47.0 // indirect
|
||||
golang.org/x/net v0.49.0 // indirect
|
||||
golang.org/x/crypto v0.48.0 // indirect
|
||||
golang.org/x/net v0.50.0 // indirect
|
||||
golang.org/x/sys v0.41.0 // indirect
|
||||
golang.org/x/text v0.33.0 // indirect
|
||||
golang.org/x/text v0.34.0 // indirect
|
||||
google.golang.org/protobuf v1.36.11 // indirect
|
||||
)
|
||||
|
|
|
|||
|
|
@ -82,8 +82,12 @@ golang.org/x/arch v0.24.0 h1:qlJ3M9upxvFfwRM51tTg3Yl+8CP9vCC1E7vlFpgv99Y=
|
|||
golang.org/x/arch v0.24.0/go.mod h1:dNHoOeKiyja7GTvF9NJS1l3Z2yntpQNzgrjh1cU103A=
|
||||
golang.org/x/crypto v0.47.0 h1:V6e3FRj+n4dbpw86FJ8Fv7XVOql7TEwpHapKoMJ/GO8=
|
||||
golang.org/x/crypto v0.47.0/go.mod h1:ff3Y9VzzKbwSSEzWqJsJVBnWmRwRSHt/6Op5n9bQc4A=
|
||||
golang.org/x/crypto v0.48.0 h1:/VRzVqiRSggnhY7gNRxPauEQ5Drw9haKdM0jqfcCFts=
|
||||
golang.org/x/crypto v0.48.0/go.mod h1:r0kV5h3qnFPlQnBSrULhlsRfryS2pmewsg+XfMgkVos=
|
||||
golang.org/x/net v0.49.0 h1:eeHFmOGUTtaaPSGNmjBKpbng9MulQsJURQUAfUwY++o=
|
||||
golang.org/x/net v0.49.0/go.mod h1:/ysNB2EvaqvesRkuLAyjI1ycPZlQHM3q01F02UY/MV8=
|
||||
golang.org/x/net v0.50.0 h1:ucWh9eiCGyDR3vtzso0WMQinm2Dnt8cFMuQa9K33J60=
|
||||
golang.org/x/net v0.50.0/go.mod h1:UgoSli3F/pBgdJBHCTc+tp3gmrU4XswgGRgtnwWTfyM=
|
||||
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.40.0 h1:DBZZqJ2Rkml6QMQsZywtnjnnGvHza6BTfYFWY9kjEWQ=
|
||||
golang.org/x/sys v0.40.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks=
|
||||
|
|
@ -91,6 +95,8 @@ golang.org/x/sys v0.41.0 h1:Ivj+2Cp/ylzLiEU89QhWblYnOE9zerudt9Ftecq2C6k=
|
|||
golang.org/x/sys v0.41.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks=
|
||||
golang.org/x/text v0.33.0 h1:B3njUFyqtHDUI5jMn1YIr5B0IE2U0qck04r6d4KPAxE=
|
||||
golang.org/x/text v0.33.0/go.mod h1:LuMebE6+rBincTi9+xWTY8TztLzKHc/9C1uBCG27+q8=
|
||||
golang.org/x/text v0.34.0 h1:oL/Qq0Kdaqxa1KbNeMKwQq0reLCCaFtqu2eNuSeNHbk=
|
||||
golang.org/x/text v0.34.0/go.mod h1:homfLqTYRFyVYemLBFl5GgL/DWEiH5wcsQ5gSh1yziA=
|
||||
google.golang.org/protobuf v1.36.11 h1:fV6ZwhNocDyBLK0dj+fg8ektcVegBBuEolpbTQyBNVE=
|
||||
google.golang.org/protobuf v1.36.11/go.mod h1:HTf+CrKn2C3g5S8VImy6tdcUvCska2kB7j23XfzDpco=
|
||||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ import (
|
|||
"log"
|
||||
"net/http"
|
||||
"os"
|
||||
"time"
|
||||
|
||||
"ocbo-esign-backend/connections"
|
||||
"ocbo-esign-backend/middleware"
|
||||
|
|
@ -448,8 +449,15 @@ func connect() {
|
|||
"result": result,
|
||||
})
|
||||
|
||||
}
|
||||
case "get-datetime":
|
||||
now := time.Now()
|
||||
formattedDateTime := now.Format(time.RFC3339)
|
||||
|
||||
c.JSON(http.StatusOK, gin.H{
|
||||
"result": formattedDateTime,
|
||||
})
|
||||
|
||||
}
|
||||
})
|
||||
|
||||
router.GET("/api/:method/:data/fetch-data", func(c *gin.Context) {
|
||||
|
|
@ -1410,6 +1418,7 @@ func connect() {
|
|||
c.JSON(http.StatusOK, gin.H{
|
||||
"result": result,
|
||||
})
|
||||
|
||||
}
|
||||
})
|
||||
|
||||
|
|
@ -1493,35 +1502,35 @@ func connect() {
|
|||
|
||||
case "get-infoapproval-electrical":
|
||||
var result2, result3, result4 string
|
||||
array := []string{}
|
||||
array2 := []string{}
|
||||
array3 := []string{}
|
||||
array4 := []string{}
|
||||
|
||||
results, err := db.Query(`SELECT IF(c.firstName IS NULL OR c.firstName = '', c.lastName, CONCAT(c.firstName, ' ', IF(c.middleInitial IS NULL OR c.middleInitial = '', '', CONCAT(c.middleInitial, '. ')), c.lastName)) AS result, DATE_FORMAT(et.date_signed, '%M') AS result2, DATE_FORMAT(et.date_signed, '%e') AS result3, DATE_FORMAT(et.date_signed, '%Y') AS result4
|
||||
FROM electrical e JOIN customer c ON e.customerid = c.customerid JOIN esign_transactions et ON e.electricalNo = et.referenceNo WHERE e.electricalNo = ? AND et.esignid = ?`, data, data2)
|
||||
err := db.QueryRow(`SELECT IF(c.firstName IS NULL OR c.firstName = '', c.lastName, CONCAT(c.firstName, ' ', IF(c.middleInitial IS NULL OR c.middleInitial = '', '', CONCAT(c.middleInitial, '. ')), c.lastName)) AS result, DATE_FORMAT(et.date_signed, '%M') AS result2, DATE_FORMAT(et.date_signed, '%e') AS result3, DATE_FORMAT(et.date_signed, '%Y') AS result4
|
||||
FROM electrical e JOIN customer c ON e.customerid = c.customerid JOIN esign_transactions et ON e.electricalNo = et.referenceNo WHERE e.electricalNo = ? AND et.esignid = ?`, data, data2).Scan(&result, &result2, &result3, &result4)
|
||||
if err != nil {
|
||||
c.AbortWithError(http.StatusBadRequest, err)
|
||||
c.String(http.StatusBadRequest, err.Error())
|
||||
return
|
||||
}
|
||||
for results.Next() {
|
||||
err = results.Scan(&result, &result2, &result3, &result4)
|
||||
if err != nil {
|
||||
c.AbortWithError(http.StatusBadRequest, err)
|
||||
c.String(http.StatusBadRequest, err.Error())
|
||||
return
|
||||
}
|
||||
array = append(array, result)
|
||||
array2 = append(array2, result2)
|
||||
array3 = append(array3, result3)
|
||||
array4 = append(array4, result4)
|
||||
c.JSON(http.StatusOK, gin.H{
|
||||
"result": result,
|
||||
"result2": result2,
|
||||
"result3": result3,
|
||||
"result4": result4,
|
||||
})
|
||||
|
||||
case "get-infoprinted-electrical":
|
||||
var result2, result3 string
|
||||
|
||||
err := db.QueryRow(`SELECT DATE_FORMAT(et.date_signed, '%M') AS result, DATE_FORMAT(et.date_signed, '%e') AS result2, DATE_FORMAT(et.date_signed, '%Y') AS result3
|
||||
FROM electrical e JOIN customer c ON e.customerid = c.customerid JOIN esign_transactions et ON e.electricalNo = et.referenceNo WHERE e.electricalNo = ? AND et.esignid <> ?`, data, data2).Scan(&result, &result2, &result3)
|
||||
if err != nil {
|
||||
c.AbortWithError(http.StatusBadRequest, err)
|
||||
c.String(http.StatusBadRequest, err.Error())
|
||||
return
|
||||
}
|
||||
c.JSON(http.StatusOK, gin.H{
|
||||
"result": array,
|
||||
"result2": array2,
|
||||
"result3": array3,
|
||||
"result4": array4,
|
||||
"result": result,
|
||||
"result2": result2,
|
||||
"result3": result3,
|
||||
})
|
||||
}
|
||||
})
|
||||
|
|
|
|||
|
|
@ -6,4 +6,4 @@ services:
|
|||
context: .
|
||||
dockerfile: Dockerfile
|
||||
ports:
|
||||
- 8080:8080
|
||||
- 8089:8080
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@
|
|||
"@biomejs/biome": "^2.3.14",
|
||||
"@nanostores/solid": "^1.1.1",
|
||||
"@types/crypto-js": "^4.2.2",
|
||||
"@types/node": "^24.10.12",
|
||||
"@types/node": "^24.10.13",
|
||||
"sass-embedded": "^1.97.3",
|
||||
"typescript": "~5.8.3",
|
||||
"vite": "^7.3.1",
|
||||
|
|
|
|||
28
pnpm-lock.yaml
generated
28
pnpm-lock.yaml
generated
|
|
@ -82,8 +82,8 @@ importers:
|
|||
specifier: ^4.2.2
|
||||
version: 4.2.2
|
||||
'@types/node':
|
||||
specifier: ^24.10.12
|
||||
version: 24.10.12
|
||||
specifier: ^24.10.13
|
||||
version: 24.10.13
|
||||
sass-embedded:
|
||||
specifier: ^1.97.3
|
||||
version: 1.97.3
|
||||
|
|
@ -92,13 +92,13 @@ importers:
|
|||
version: 5.8.3
|
||||
vite:
|
||||
specifier: ^7.3.1
|
||||
version: 7.3.1(@types/node@24.10.12)(sass-embedded@1.97.3)(sass@1.97.3)
|
||||
version: 7.3.1(@types/node@24.10.13)(sass-embedded@1.97.3)(sass@1.97.3)
|
||||
vite-plugin-compression2:
|
||||
specifier: ^2.4.0
|
||||
version: 2.4.0(rollup@4.52.1)
|
||||
vite-plugin-solid:
|
||||
specifier: ^2.11.10
|
||||
version: 2.11.10(solid-js@1.9.11)(vite@7.3.1(@types/node@24.10.12)(sass-embedded@1.97.3)(sass@1.97.3))
|
||||
version: 2.11.10(solid-js@1.9.11)(vite@7.3.1(@types/node@24.10.13)(sass-embedded@1.97.3)(sass@1.97.3))
|
||||
|
||||
packages:
|
||||
|
||||
|
|
@ -1076,8 +1076,8 @@ packages:
|
|||
'@types/node@16.9.1':
|
||||
resolution: {integrity: sha512-QpLcX9ZSsq3YYUUnD3nFDY8H7wctAhQj/TFKL8Ya8v5fMm3CFXxo8zStsLAl780ltoYoo1WvKUVGBQK+1ifr7g==}
|
||||
|
||||
'@types/node@24.10.12':
|
||||
resolution: {integrity: sha512-68e+T28EbdmLSTkPgs3+UacC6rzmqrcWFPQs1C8mwJhI/r5Uxr0yEuQotczNRROd1gq30NGxee+fo0rSIxpyAw==}
|
||||
'@types/node@24.10.13':
|
||||
resolution: {integrity: sha512-oH72nZRfDv9lADUBSo104Aq7gPHpQZc4BTx38r9xf9pg5LfP6EzSyH2n7qFmmxRQXh7YlUXODcYsg6PuTDSxGg==}
|
||||
|
||||
'@types/pako@2.0.4':
|
||||
resolution: {integrity: sha512-VWDCbrLeVXJM9fihYodcLiIv0ku+AlOa/TQ1SvYOaBuyrSKgEcro95LJyIsJ4vSo6BXIxOKxiJAat04CmST9Fw==}
|
||||
|
|
@ -2750,7 +2750,7 @@ snapshots:
|
|||
|
||||
'@types/node@16.9.1': {}
|
||||
|
||||
'@types/node@24.10.12':
|
||||
'@types/node@24.10.13':
|
||||
dependencies:
|
||||
undici-types: 7.16.0
|
||||
|
||||
|
|
@ -3504,7 +3504,7 @@ snapshots:
|
|||
transitivePeerDependencies:
|
||||
- rollup
|
||||
|
||||
vite-plugin-solid@2.11.10(solid-js@1.9.11)(vite@7.3.1(@types/node@24.10.12)(sass-embedded@1.97.3)(sass@1.97.3)):
|
||||
vite-plugin-solid@2.11.10(solid-js@1.9.11)(vite@7.3.1(@types/node@24.10.13)(sass-embedded@1.97.3)(sass@1.97.3)):
|
||||
dependencies:
|
||||
'@babel/core': 7.28.4
|
||||
'@types/babel__core': 7.20.5
|
||||
|
|
@ -3512,12 +3512,12 @@ snapshots:
|
|||
merge-anything: 5.1.7
|
||||
solid-js: 1.9.11
|
||||
solid-refresh: 0.6.3(solid-js@1.9.11)
|
||||
vite: 7.3.1(@types/node@24.10.12)(sass-embedded@1.97.3)(sass@1.97.3)
|
||||
vitefu: 1.1.1(vite@7.3.1(@types/node@24.10.12)(sass-embedded@1.97.3)(sass@1.97.3))
|
||||
vite: 7.3.1(@types/node@24.10.13)(sass-embedded@1.97.3)(sass@1.97.3)
|
||||
vitefu: 1.1.1(vite@7.3.1(@types/node@24.10.13)(sass-embedded@1.97.3)(sass@1.97.3))
|
||||
transitivePeerDependencies:
|
||||
- supports-color
|
||||
|
||||
vite@7.3.1(@types/node@24.10.12)(sass-embedded@1.97.3)(sass@1.97.3):
|
||||
vite@7.3.1(@types/node@24.10.13)(sass-embedded@1.97.3)(sass@1.97.3):
|
||||
dependencies:
|
||||
esbuild: 0.27.2
|
||||
fdir: 6.5.0(picomatch@4.0.3)
|
||||
|
|
@ -3526,14 +3526,14 @@ snapshots:
|
|||
rollup: 4.52.1
|
||||
tinyglobby: 0.2.15
|
||||
optionalDependencies:
|
||||
'@types/node': 24.10.12
|
||||
'@types/node': 24.10.13
|
||||
fsevents: 2.3.3
|
||||
sass: 1.97.3
|
||||
sass-embedded: 1.97.3
|
||||
|
||||
vitefu@1.1.1(vite@7.3.1(@types/node@24.10.12)(sass-embedded@1.97.3)(sass@1.97.3)):
|
||||
vitefu@1.1.1(vite@7.3.1(@types/node@24.10.13)(sass-embedded@1.97.3)(sass@1.97.3)):
|
||||
optionalDependencies:
|
||||
vite: 7.3.1(@types/node@24.10.12)(sass-embedded@1.97.3)(sass@1.97.3)
|
||||
vite: 7.3.1(@types/node@24.10.13)(sass-embedded@1.97.3)(sass@1.97.3)
|
||||
|
||||
webworkify@1.5.0: {}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
[Unit]
|
||||
Description=FWT
|
||||
Description=OCBO e-Sign
|
||||
|
||||
[Container]
|
||||
ContainerName=fwt
|
||||
Image=localhost/fwt
|
||||
PublishPort=8080:8080
|
||||
ContainerName=esign
|
||||
Image=localhost/esign_e-sign
|
||||
PublishPort=8089:8080
|
||||
|
||||
[Service]
|
||||
Restart=always
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ import {
|
|||
_type,
|
||||
_units,
|
||||
} from '../../stores/pdfinfo.ts';
|
||||
import { checkConnection, createPdfElectrical, createPdfOccupancy, getApi, getApiMulti, postApi, statusPopsApi, voidPopsApi, saveNewName, saveNewPassword, securePassword } from '../../utils/functions/index.ts';
|
||||
import { checkConnection, createPdfElectrical, createPdfOccupancy, getApi, getApiMulti, postApi, statusPopsApi, voidPopsApi, saveNewName, saveNewPassword, securePassword, getDateTime } from '../../utils/functions/index.ts';
|
||||
import './Assessor.sass';
|
||||
import { FaSolidUserGear } from 'solid-icons/fa'
|
||||
|
||||
|
|
@ -399,7 +399,7 @@ export default () => {
|
|||
}
|
||||
|
||||
const setNewStatus = async (division: string, status: string, tag: string, tagword: string, approved: number) => {
|
||||
const today = new Date()
|
||||
const today = await getDateTime()
|
||||
const formattedDate = dayjs(today).format('YYYY-MM-DD HH:mm:ss')
|
||||
const statusid = parseInt(applicationId().toString(), 10)
|
||||
|
||||
|
|
@ -449,7 +449,7 @@ export default () => {
|
|||
|
||||
const postTransaction = async (application: string) => {
|
||||
const id = await geteSignId(employeeId())
|
||||
const today = new Date()
|
||||
const today = await getDateTime()
|
||||
const formatedDate = dayjs(today).format('YYYY-MM-DD HH:mm:ss')
|
||||
|
||||
await postApi('post-esigntransaction', {
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ import { FiLogOut } from 'solid-icons/fi'
|
|||
import { VsRefresh } from 'solid-icons/vs'
|
||||
import { createSignal, onMount, createEffect } from 'solid-js'
|
||||
import { Box, Button, Clickable, Column, Link, Logo, Modal, ModalButton, Padding, Page, Row, Input } from '../../components/'
|
||||
import { checkConnection, getApi, getApiMulti, postApi, saveNewName, saveNewPassword, securePassword } from '../../utils/functions'
|
||||
import { checkConnection, getApi, getApiMulti, getDateTime, postApi, saveNewName, saveNewPassword, securePassword } from '../../utils/functions'
|
||||
import { FaSolidUserGear } from 'solid-icons/fa'
|
||||
import { Show } from 'solid-js/web'
|
||||
import './Main.sass'
|
||||
|
|
@ -182,7 +182,8 @@ export default () => {
|
|||
}
|
||||
|
||||
const setNewStatus = async (division: string, status: string, tag: string, tagword: string, approved: number) => {
|
||||
const today = new Date()
|
||||
// const today = new Date()
|
||||
const today = await getDateTime()
|
||||
const formattedDate = dayjs(today).format('YYYY-MM-DD HH:mm:ss')
|
||||
const statusid = parseInt(applicationId().toString())
|
||||
|
||||
|
|
@ -193,6 +194,8 @@ export default () => {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
const updateOp = async (division: string) => {
|
||||
if (division === 'electrical') {
|
||||
return await postApi('update-opapproved-electrical', { data: parseInt(applicationId().toString()) })
|
||||
|
|
@ -221,7 +224,7 @@ export default () => {
|
|||
const boList = response.result8
|
||||
const codeList = response.result9
|
||||
|
||||
const today = new Date()
|
||||
const today = await getDateTime()
|
||||
const formattedDate = dayjs(today).format('YYYY-MM-DD')
|
||||
const formattedDatewithTime = dayjs(today).format('YYYY-MM-DD HH:mm:ss')
|
||||
|
||||
|
|
@ -295,7 +298,7 @@ export default () => {
|
|||
|
||||
const postTransaction = async () => {
|
||||
const id = await geteSignId()
|
||||
const today = new Date()
|
||||
const today = await getDateTime()
|
||||
const formatedDate = dayjs(today).format('YYYY-MM-DD HH:mm:ss')
|
||||
|
||||
await postApi('post-esigntransaction', { data: parseInt(id), data2: approvedApplication(), data3: formatedDate })
|
||||
|
|
|
|||
6
src/utils/functions/getDateTime.ts
Normal file
6
src/utils/functions/getDateTime.ts
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
import getApi from "./getApi.ts"
|
||||
|
||||
export default async () => {
|
||||
const response = await getApi('get-datetime')
|
||||
return response.result
|
||||
}
|
||||
|
|
@ -9,3 +9,4 @@ export { default as voidPopsApi } from './voidPopsApi.ts';
|
|||
export { default as securePassword } from './securePassword.ts';
|
||||
export { default as saveNewName } from './saveNewName.ts';
|
||||
export { default as saveNewPassword } from './saveNewPassword.ts';
|
||||
export { default as getDateTime } from './getDateTime.ts';
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue