Added bills upload & list

This commit is contained in:
Patrick Fic
2022-05-03 17:30:24 -07:00
parent 8d851c52b2
commit b7be304520
14 changed files with 226 additions and 6081 deletions

View File

@@ -0,0 +1,7 @@
import path from "path";
export default function (file: Express.Multer.File) {
return `${file.originalname}-${Math.floor(Date.now() / 1000)}${path.extname(
file.originalname
)}`;
}

View File

@@ -0,0 +1,6 @@
interface MediaFile {
src: string;
thumb: string;
}
export default MediaFile;

13
util/pathGenerators.ts Normal file
View File

@@ -0,0 +1,13 @@
import path from "path";
import { FolderPaths } from "./serverInit";
export function PathToRoFolder(ro_number: string) {
return path.join(FolderPaths.Jobs, ro_number);
}
export function PathToRoBillsFolder(ro_number: string) {
return path.join(FolderPaths.Jobs, ro_number, FolderPaths.BillsSubDir);
}
export function PathToVendorBillsFile(vendor: string) {
return path.join(FolderPaths.Vendors, vendor);
}

View File

@@ -16,6 +16,7 @@ export const FolderPaths = {
Jobs: path.join(RootDirectory, JobsFolder),
Vendors: path.join(RootDirectory, VendorsFolder),
ThumbsSubDir: "/thumbs",
BillsSubDir: "/bills",
StaticPath: "/static",
JobsFolder,
VendorsFolder,