feat(ebitemp-api): init project + migration from nx (1)
36
apps/docs/.gitignore
vendored
@ -1,36 +0,0 @@
|
|||||||
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
|
|
||||||
|
|
||||||
# dependencies
|
|
||||||
/node_modules
|
|
||||||
/.pnp
|
|
||||||
.pnp.js
|
|
||||||
.yarn/install-state.gz
|
|
||||||
|
|
||||||
# testing
|
|
||||||
/coverage
|
|
||||||
|
|
||||||
# next.js
|
|
||||||
/.next/
|
|
||||||
/out/
|
|
||||||
|
|
||||||
# production
|
|
||||||
/build
|
|
||||||
|
|
||||||
# misc
|
|
||||||
.DS_Store
|
|
||||||
*.pem
|
|
||||||
|
|
||||||
# debug
|
|
||||||
npm-debug.log*
|
|
||||||
yarn-debug.log*
|
|
||||||
yarn-error.log*
|
|
||||||
|
|
||||||
# env files (can opt-in for commiting if needed)
|
|
||||||
.env*
|
|
||||||
|
|
||||||
# vercel
|
|
||||||
.vercel
|
|
||||||
|
|
||||||
# typescript
|
|
||||||
*.tsbuildinfo
|
|
||||||
next-env.d.ts
|
|
@ -1,36 +0,0 @@
|
|||||||
This is a [Next.js](https://nextjs.org) project bootstrapped with [`create-next-app`](https://nextjs.org/docs/app/api-reference/create-next-app).
|
|
||||||
|
|
||||||
## Getting Started
|
|
||||||
|
|
||||||
First, run the development server:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
npm run dev
|
|
||||||
# or
|
|
||||||
yarn dev
|
|
||||||
# or
|
|
||||||
pnpm dev
|
|
||||||
# or
|
|
||||||
bun dev
|
|
||||||
```
|
|
||||||
|
|
||||||
Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.
|
|
||||||
|
|
||||||
You can start editing the page by modifying `app/page.tsx`. The page auto-updates as you edit the file.
|
|
||||||
|
|
||||||
This project uses [`next/font`](https://nextjs.org/docs/app/building-your-application/optimizing/fonts) to automatically optimize and load Inter, a custom Google Font.
|
|
||||||
|
|
||||||
## Learn More
|
|
||||||
|
|
||||||
To learn more about Next.js, take a look at the following resources:
|
|
||||||
|
|
||||||
- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API.
|
|
||||||
- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.
|
|
||||||
|
|
||||||
You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js) - your feedback and contributions are welcome!
|
|
||||||
|
|
||||||
## Deploy on Vercel
|
|
||||||
|
|
||||||
The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js.
|
|
||||||
|
|
||||||
Check out our [Next.js deployment documentation](https://nextjs.org/docs/app/building-your-application/deploying) for more details.
|
|
Before Width: | Height: | Size: 25 KiB |
@ -1,50 +0,0 @@
|
|||||||
:root {
|
|
||||||
--background: #ffffff;
|
|
||||||
--foreground: #171717;
|
|
||||||
}
|
|
||||||
|
|
||||||
@media (prefers-color-scheme: dark) {
|
|
||||||
:root {
|
|
||||||
--background: #0a0a0a;
|
|
||||||
--foreground: #ededed;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
html,
|
|
||||||
body {
|
|
||||||
max-width: 100vw;
|
|
||||||
overflow-x: hidden;
|
|
||||||
}
|
|
||||||
|
|
||||||
body {
|
|
||||||
color: var(--foreground);
|
|
||||||
background: var(--background);
|
|
||||||
}
|
|
||||||
|
|
||||||
* {
|
|
||||||
box-sizing: border-box;
|
|
||||||
padding: 0;
|
|
||||||
margin: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
a {
|
|
||||||
color: inherit;
|
|
||||||
text-decoration: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
.imgDark {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
@media (prefers-color-scheme: dark) {
|
|
||||||
html {
|
|
||||||
color-scheme: dark;
|
|
||||||
}
|
|
||||||
|
|
||||||
.imgLight {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
.imgDark {
|
|
||||||
display: unset;
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,31 +0,0 @@
|
|||||||
import type { Metadata } from "next";
|
|
||||||
import localFont from "next/font/local";
|
|
||||||
import "./globals.css";
|
|
||||||
|
|
||||||
const geistSans = localFont({
|
|
||||||
src: "./fonts/GeistVF.woff",
|
|
||||||
variable: "--font-geist-sans",
|
|
||||||
});
|
|
||||||
const geistMono = localFont({
|
|
||||||
src: "./fonts/GeistMonoVF.woff",
|
|
||||||
variable: "--font-geist-mono",
|
|
||||||
});
|
|
||||||
|
|
||||||
export const metadata: Metadata = {
|
|
||||||
title: "Create Next App",
|
|
||||||
description: "Generated by create next app",
|
|
||||||
};
|
|
||||||
|
|
||||||
export default function RootLayout({
|
|
||||||
children,
|
|
||||||
}: Readonly<{
|
|
||||||
children: React.ReactNode;
|
|
||||||
}>) {
|
|
||||||
return (
|
|
||||||
<html lang="en">
|
|
||||||
<body className={`${geistSans.variable} ${geistMono.variable}`}>
|
|
||||||
{children}
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
);
|
|
||||||
}
|
|
@ -1,188 +0,0 @@
|
|||||||
.page {
|
|
||||||
--gray-rgb: 0, 0, 0;
|
|
||||||
--gray-alpha-200: rgba(var(--gray-rgb), 0.08);
|
|
||||||
--gray-alpha-100: rgba(var(--gray-rgb), 0.05);
|
|
||||||
|
|
||||||
--button-primary-hover: #383838;
|
|
||||||
--button-secondary-hover: #f2f2f2;
|
|
||||||
|
|
||||||
display: grid;
|
|
||||||
grid-template-rows: 20px 1fr 20px;
|
|
||||||
align-items: center;
|
|
||||||
justify-items: center;
|
|
||||||
min-height: 100svh;
|
|
||||||
padding: 80px;
|
|
||||||
gap: 64px;
|
|
||||||
font-synthesis: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
@media (prefers-color-scheme: dark) {
|
|
||||||
.page {
|
|
||||||
--gray-rgb: 255, 255, 255;
|
|
||||||
--gray-alpha-200: rgba(var(--gray-rgb), 0.145);
|
|
||||||
--gray-alpha-100: rgba(var(--gray-rgb), 0.06);
|
|
||||||
|
|
||||||
--button-primary-hover: #ccc;
|
|
||||||
--button-secondary-hover: #1a1a1a;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.main {
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
gap: 32px;
|
|
||||||
grid-row-start: 2;
|
|
||||||
}
|
|
||||||
|
|
||||||
.main ol {
|
|
||||||
font-family: var(--font-geist-mono);
|
|
||||||
padding-left: 0;
|
|
||||||
margin: 0;
|
|
||||||
font-size: 14px;
|
|
||||||
line-height: 24px;
|
|
||||||
letter-spacing: -0.01em;
|
|
||||||
list-style-position: inside;
|
|
||||||
}
|
|
||||||
|
|
||||||
.main li:not(:last-of-type) {
|
|
||||||
margin-bottom: 8px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.main code {
|
|
||||||
font-family: inherit;
|
|
||||||
background: var(--gray-alpha-100);
|
|
||||||
padding: 2px 4px;
|
|
||||||
border-radius: 4px;
|
|
||||||
font-weight: 600;
|
|
||||||
}
|
|
||||||
|
|
||||||
.ctas {
|
|
||||||
display: flex;
|
|
||||||
gap: 16px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.ctas a {
|
|
||||||
appearance: none;
|
|
||||||
border-radius: 128px;
|
|
||||||
height: 48px;
|
|
||||||
padding: 0 20px;
|
|
||||||
border: none;
|
|
||||||
font-family: var(--font-geist-sans);
|
|
||||||
border: 1px solid transparent;
|
|
||||||
transition: background 0.2s, color 0.2s, border-color 0.2s;
|
|
||||||
cursor: pointer;
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
font-size: 16px;
|
|
||||||
line-height: 20px;
|
|
||||||
font-weight: 500;
|
|
||||||
}
|
|
||||||
|
|
||||||
a.primary {
|
|
||||||
background: var(--foreground);
|
|
||||||
color: var(--background);
|
|
||||||
gap: 8px;
|
|
||||||
}
|
|
||||||
|
|
||||||
a.secondary {
|
|
||||||
border-color: var(--gray-alpha-200);
|
|
||||||
min-width: 180px;
|
|
||||||
}
|
|
||||||
|
|
||||||
button.secondary {
|
|
||||||
appearance: none;
|
|
||||||
border-radius: 128px;
|
|
||||||
height: 48px;
|
|
||||||
padding: 0 20px;
|
|
||||||
border: none;
|
|
||||||
font-family: var(--font-geist-sans);
|
|
||||||
border: 1px solid transparent;
|
|
||||||
transition: background 0.2s, color 0.2s, border-color 0.2s;
|
|
||||||
cursor: pointer;
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
font-size: 16px;
|
|
||||||
line-height: 20px;
|
|
||||||
font-weight: 500;
|
|
||||||
background: transparent;
|
|
||||||
border-color: var(--gray-alpha-200);
|
|
||||||
min-width: 180px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.footer {
|
|
||||||
font-family: var(--font-geist-sans);
|
|
||||||
grid-row-start: 3;
|
|
||||||
display: flex;
|
|
||||||
gap: 24px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.footer a {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
gap: 8px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.footer img {
|
|
||||||
flex-shrink: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Enable hover only on non-touch devices */
|
|
||||||
@media (hover: hover) and (pointer: fine) {
|
|
||||||
a.primary:hover {
|
|
||||||
background: var(--button-primary-hover);
|
|
||||||
border-color: transparent;
|
|
||||||
}
|
|
||||||
|
|
||||||
a.secondary:hover {
|
|
||||||
background: var(--button-secondary-hover);
|
|
||||||
border-color: transparent;
|
|
||||||
}
|
|
||||||
|
|
||||||
.footer a:hover {
|
|
||||||
text-decoration: underline;
|
|
||||||
text-underline-offset: 4px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@media (max-width: 600px) {
|
|
||||||
.page {
|
|
||||||
padding: 32px;
|
|
||||||
padding-bottom: 80px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.main {
|
|
||||||
align-items: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
.main ol {
|
|
||||||
text-align: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
.ctas {
|
|
||||||
flex-direction: column;
|
|
||||||
}
|
|
||||||
|
|
||||||
.ctas a {
|
|
||||||
font-size: 14px;
|
|
||||||
height: 40px;
|
|
||||||
padding: 0 16px;
|
|
||||||
}
|
|
||||||
|
|
||||||
a.secondary {
|
|
||||||
min-width: auto;
|
|
||||||
}
|
|
||||||
|
|
||||||
.footer {
|
|
||||||
flex-wrap: wrap;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@media (prefers-color-scheme: dark) {
|
|
||||||
.logo {
|
|
||||||
filter: invert();
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,102 +0,0 @@
|
|||||||
import Image, { type ImageProps } from "next/image";
|
|
||||||
import { Button } from "@repo/ui/button";
|
|
||||||
import styles from "./page.module.css";
|
|
||||||
|
|
||||||
type Props = Omit<ImageProps, "src"> & {
|
|
||||||
srcLight: string;
|
|
||||||
srcDark: string;
|
|
||||||
};
|
|
||||||
|
|
||||||
const ThemeImage = (props: Props) => {
|
|
||||||
const { srcLight, srcDark, ...rest } = props;
|
|
||||||
|
|
||||||
return (
|
|
||||||
<>
|
|
||||||
<Image {...rest} src={srcLight} className="imgLight" />
|
|
||||||
<Image {...rest} src={srcDark} className="imgDark" />
|
|
||||||
</>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
export default function Home() {
|
|
||||||
return (
|
|
||||||
<div className={styles.page}>
|
|
||||||
<main className={styles.main}>
|
|
||||||
<ThemeImage
|
|
||||||
className={styles.logo}
|
|
||||||
srcLight="turborepo-dark.svg"
|
|
||||||
srcDark="turborepo-light.svg"
|
|
||||||
alt="Turborepo logo"
|
|
||||||
width={180}
|
|
||||||
height={38}
|
|
||||||
priority
|
|
||||||
/>
|
|
||||||
<ol>
|
|
||||||
<li>
|
|
||||||
Get started by editing <code>apps/docs/app/page.tsx</code>
|
|
||||||
</li>
|
|
||||||
<li>Save and see your changes instantly.</li>
|
|
||||||
</ol>
|
|
||||||
|
|
||||||
<div className={styles.ctas}>
|
|
||||||
<a
|
|
||||||
className={styles.primary}
|
|
||||||
href="https://vercel.com/new/clone?demo-description=Learn+to+implement+a+monorepo+with+a+two+Next.js+sites+that+has+installed+three+local+packages.&demo-image=%2F%2Fimages.ctfassets.net%2Fe5382hct74si%2F4K8ZISWAzJ8X1504ca0zmC%2F0b21a1c6246add355e55816278ef54bc%2FBasic.png&demo-title=Monorepo+with+Turborepo&demo-url=https%3A%2F%2Fexamples-basic-web.vercel.sh%2F&from=templates&project-name=Monorepo+with+Turborepo&repository-name=monorepo-turborepo&repository-url=https%3A%2F%2Fgithub.com%2Fvercel%2Fturborepo%2Ftree%2Fmain%2Fexamples%2Fbasic&root-directory=apps%2Fdocs&skippable-integrations=1&teamSlug=vercel&utm_source=create-turbo"
|
|
||||||
target="_blank"
|
|
||||||
rel="noopener noreferrer"
|
|
||||||
>
|
|
||||||
<Image
|
|
||||||
className={styles.logo}
|
|
||||||
src="/vercel.svg"
|
|
||||||
alt="Vercel logomark"
|
|
||||||
width={20}
|
|
||||||
height={20}
|
|
||||||
/>
|
|
||||||
Deploy now
|
|
||||||
</a>
|
|
||||||
<a
|
|
||||||
href="https://turbo.build/repo/docs?utm_source"
|
|
||||||
target="_blank"
|
|
||||||
rel="noopener noreferrer"
|
|
||||||
className={styles.secondary}
|
|
||||||
>
|
|
||||||
Read our docs
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
<Button appName="docs" className={styles.secondary}>
|
|
||||||
Open alert
|
|
||||||
</Button>
|
|
||||||
</main>
|
|
||||||
<footer className={styles.footer}>
|
|
||||||
<a
|
|
||||||
href="https://vercel.com/templates?search=turborepo&utm_source=create-next-app&utm_medium=appdir-template&utm_campaign=create-next-app"
|
|
||||||
target="_blank"
|
|
||||||
rel="noopener noreferrer"
|
|
||||||
>
|
|
||||||
<Image
|
|
||||||
aria-hidden
|
|
||||||
src="/window.svg"
|
|
||||||
alt="Window icon"
|
|
||||||
width={16}
|
|
||||||
height={16}
|
|
||||||
/>
|
|
||||||
Examples
|
|
||||||
</a>
|
|
||||||
<a
|
|
||||||
href="https://turbo.build?utm_source=create-turbo"
|
|
||||||
target="_blank"
|
|
||||||
rel="noopener noreferrer"
|
|
||||||
>
|
|
||||||
<Image
|
|
||||||
aria-hidden
|
|
||||||
src="/globe.svg"
|
|
||||||
alt="Globe icon"
|
|
||||||
width={16}
|
|
||||||
height={16}
|
|
||||||
/>
|
|
||||||
Go to turbo.build →
|
|
||||||
</a>
|
|
||||||
</footer>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
}
|
|
@ -1,4 +0,0 @@
|
|||||||
import { nextJsConfig } from "@repo/eslint-config/next-js";
|
|
||||||
|
|
||||||
/** @type {import("eslint").Linter.Config} */
|
|
||||||
export default nextJsConfig;
|
|
@ -1,4 +0,0 @@
|
|||||||
/** @type {import('next').NextConfig} */
|
|
||||||
const nextConfig = {};
|
|
||||||
|
|
||||||
export default nextConfig;
|
|
@ -1,28 +0,0 @@
|
|||||||
{
|
|
||||||
"name": "docs",
|
|
||||||
"version": "0.1.0",
|
|
||||||
"type": "module",
|
|
||||||
"private": true,
|
|
||||||
"scripts": {
|
|
||||||
"dev": "next dev --turbopack --port 3001",
|
|
||||||
"build": "next build",
|
|
||||||
"start": "next start",
|
|
||||||
"lint": "next lint --max-warnings 0",
|
|
||||||
"check-types": "tsc --noEmit"
|
|
||||||
},
|
|
||||||
"dependencies": {
|
|
||||||
"@repo/ui": "workspace:*",
|
|
||||||
"next": "^15.2.1",
|
|
||||||
"react": "^19.0.0",
|
|
||||||
"react-dom": "^19.0.0"
|
|
||||||
},
|
|
||||||
"devDependencies": {
|
|
||||||
"@repo/eslint-config": "workspace:*",
|
|
||||||
"@repo/typescript-config": "workspace:*",
|
|
||||||
"@types/node": "^22.13.10",
|
|
||||||
"@types/react": "19.0.10",
|
|
||||||
"@types/react-dom": "19.0.4",
|
|
||||||
"eslint": "^9.22.0",
|
|
||||||
"typescript": "5.8.2"
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,3 +0,0 @@
|
|||||||
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
||||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M14.5 13.5V6.5V5.41421C14.5 5.149 14.3946 4.89464 14.2071 4.70711L9.79289 0.292893C9.60536 0.105357 9.351 0 9.08579 0H8H3H1.5V1.5V13.5C1.5 14.8807 2.61929 16 4 16H12C13.3807 16 14.5 14.8807 14.5 13.5ZM13 13.5V6.5H9.5H8V5V1.5H3V13.5C3 14.0523 3.44772 14.5 4 14.5H12C12.5523 14.5 13 14.0523 13 13.5ZM9.5 5V2.12132L12.3787 5H9.5ZM5.13 5.00062H4.505V6.25062H5.13H6H6.625V5.00062H6H5.13ZM4.505 8H5.13H11H11.625V9.25H11H5.13H4.505V8ZM5.13 11H4.505V12.25H5.13H11H11.625V11H11H5.13Z" fill="#666666"/>
|
|
||||||
</svg>
|
|
Before Width: | Height: | Size: 645 B |
@ -1,10 +0,0 @@
|
|||||||
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
||||||
<g clip-path="url(#clip0_868_525)">
|
|
||||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M10.268 14.0934C11.9051 13.4838 13.2303 12.2333 13.9384 10.6469C13.1192 10.7941 12.2138 10.9111 11.2469 10.9925C11.0336 12.2005 10.695 13.2621 10.268 14.0934ZM8 16C12.4183 16 16 12.4183 16 8C16 3.58172 12.4183 0 8 0C3.58172 0 0 3.58172 0 8C0 12.4183 3.58172 16 8 16ZM8.48347 14.4823C8.32384 14.494 8.16262 14.5 8 14.5C7.83738 14.5 7.67616 14.494 7.51654 14.4823C7.5132 14.4791 7.50984 14.4759 7.50647 14.4726C7.2415 14.2165 6.94578 13.7854 6.67032 13.1558C6.41594 12.5744 6.19979 11.8714 6.04101 11.0778C6.67605 11.1088 7.33104 11.125 8 11.125C8.66896 11.125 9.32395 11.1088 9.95899 11.0778C9.80021 11.8714 9.58406 12.5744 9.32968 13.1558C9.05422 13.7854 8.7585 14.2165 8.49353 14.4726C8.49016 14.4759 8.4868 14.4791 8.48347 14.4823ZM11.4187 9.72246C12.5137 9.62096 13.5116 9.47245 14.3724 9.28806C14.4561 8.87172 14.5 8.44099 14.5 8C14.5 7.55901 14.4561 7.12828 14.3724 6.71194C13.5116 6.52755 12.5137 6.37904 11.4187 6.27753C11.4719 6.83232 11.5 7.40867 11.5 8C11.5 8.59133 11.4719 9.16768 11.4187 9.72246ZM10.1525 6.18401C10.2157 6.75982 10.25 7.36805 10.25 8C10.25 8.63195 10.2157 9.24018 10.1525 9.81598C9.46123 9.85455 8.7409 9.875 8 9.875C7.25909 9.875 6.53877 9.85455 5.84749 9.81598C5.7843 9.24018 5.75 8.63195 5.75 8C5.75 7.36805 5.7843 6.75982 5.84749 6.18401C6.53877 6.14545 7.25909 6.125 8 6.125C8.74091 6.125 9.46123 6.14545 10.1525 6.18401ZM11.2469 5.00748C12.2138 5.08891 13.1191 5.20593 13.9384 5.35306C13.2303 3.7667 11.9051 2.51622 10.268 1.90662C10.695 2.73788 11.0336 3.79953 11.2469 5.00748ZM8.48347 1.51771C8.4868 1.52089 8.49016 1.52411 8.49353 1.52737C8.7585 1.78353 9.05422 2.21456 9.32968 2.84417C9.58406 3.42562 9.80021 4.12856 9.95899 4.92219C9.32395 4.89118 8.66896 4.875 8 4.875C7.33104 4.875 6.67605 4.89118 6.04101 4.92219C6.19978 4.12856 6.41594 3.42562 6.67032 2.84417C6.94578 2.21456 7.2415 1.78353 7.50647 1.52737C7.50984 1.52411 7.51319 1.52089 7.51653 1.51771C7.67615 1.50597 7.83738 1.5 8 1.5C8.16262 1.5 8.32384 1.50597 8.48347 1.51771ZM5.73202 1.90663C4.0949 2.51622 2.76975 3.7667 2.06159 5.35306C2.88085 5.20593 3.78617 5.08891 4.75309 5.00748C4.96639 3.79953 5.30497 2.73788 5.73202 1.90663ZM4.58133 6.27753C3.48633 6.37904 2.48837 6.52755 1.62761 6.71194C1.54392 7.12828 1.5 7.55901 1.5 8C1.5 8.44099 1.54392 8.87172 1.62761 9.28806C2.48837 9.47245 3.48633 9.62096 4.58133 9.72246C4.52807 9.16768 4.5 8.59133 4.5 8C4.5 7.40867 4.52807 6.83232 4.58133 6.27753ZM4.75309 10.9925C3.78617 10.9111 2.88085 10.7941 2.06159 10.6469C2.76975 12.2333 4.0949 13.4838 5.73202 14.0934C5.30497 13.2621 4.96639 12.2005 4.75309 10.9925Z" fill="#666666"/>
|
|
||||||
</g>
|
|
||||||
<defs>
|
|
||||||
<clipPath id="clip0_868_525">
|
|
||||||
<rect width="16" height="16" fill="white"/>
|
|
||||||
</clipPath>
|
|
||||||
</defs>
|
|
||||||
</svg>
|
|
Before Width: | Height: | Size: 2.8 KiB |
@ -1 +0,0 @@
|
|||||||
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 394 80"><path fill="#000" d="M262 0h68.5v12.7h-27.2v66.6h-13.6V12.7H262V0ZM149 0v12.7H94v20.4h44.3v12.6H94v21h55v12.6H80.5V0h68.7zm34.3 0h-17.8l63.8 79.4h17.9l-32-39.7 32-39.6h-17.9l-23 28.6-23-28.6zm18.3 56.7-9-11-27.1 33.7h17.8l18.3-22.7z"/><path fill="#000" d="M81 79.3 17 0H0v79.3h13.6V17l50.2 62.3H81Zm252.6-.4c-1 0-1.8-.4-2.5-1s-1.1-1.6-1.1-2.6.3-1.8 1-2.5 1.6-1 2.6-1 1.8.3 2.5 1a3.4 3.4 0 0 1 .6 4.3 3.7 3.7 0 0 1-3 1.8zm23.2-33.5h6v23.3c0 2.1-.4 4-1.3 5.5a9.1 9.1 0 0 1-3.8 3.5c-1.6.8-3.5 1.3-5.7 1.3-2 0-3.7-.4-5.3-1s-2.8-1.8-3.7-3.2c-.9-1.3-1.4-3-1.4-5h6c.1.8.3 1.6.7 2.2s1 1.2 1.6 1.5c.7.4 1.5.5 2.4.5 1 0 1.8-.2 2.4-.6a4 4 0 0 0 1.6-1.8c.3-.8.5-1.8.5-3V45.5zm30.9 9.1a4.4 4.4 0 0 0-2-3.3 7.5 7.5 0 0 0-4.3-1.1c-1.3 0-2.4.2-3.3.5-.9.4-1.6 1-2 1.6a3.5 3.5 0 0 0-.3 4c.3.5.7.9 1.3 1.2l1.8 1 2 .5 3.2.8c1.3.3 2.5.7 3.7 1.2a13 13 0 0 1 3.2 1.8 8.1 8.1 0 0 1 3 6.5c0 2-.5 3.7-1.5 5.1a10 10 0 0 1-4.4 3.5c-1.8.8-4.1 1.2-6.8 1.2-2.6 0-4.9-.4-6.8-1.2-2-.8-3.4-2-4.5-3.5a10 10 0 0 1-1.7-5.6h6a5 5 0 0 0 3.5 4.6c1 .4 2.2.6 3.4.6 1.3 0 2.5-.2 3.5-.6 1-.4 1.8-1 2.4-1.7a4 4 0 0 0 .8-2.4c0-.9-.2-1.6-.7-2.2a11 11 0 0 0-2.1-1.4l-3.2-1-3.8-1c-2.8-.7-5-1.7-6.6-3.2a7.2 7.2 0 0 1-2.4-5.7 8 8 0 0 1 1.7-5 10 10 0 0 1 4.3-3.5c2-.8 4-1.2 6.4-1.2 2.3 0 4.4.4 6.2 1.2 1.8.8 3.2 2 4.3 3.4 1 1.4 1.5 3 1.5 5h-5.8z"/></svg>
|
|
Before Width: | Height: | Size: 1.3 KiB |
@ -1,19 +0,0 @@
|
|||||||
<svg width="473" height="76" viewBox="0 0 473 76" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
||||||
<path d="M130.998 30.6565V22.3773H91.0977V30.6565H106.16V58.1875H115.935V30.6565H130.998Z" fill="black"/>
|
|
||||||
<path d="M153.542 58.7362C165.811 58.7362 172.544 52.5018 172.544 42.2275V22.3773H162.768V41.2799C162.768 47.0155 159.776 50.2574 153.542 50.2574C147.307 50.2574 144.315 47.0155 144.315 41.2799V22.3773H134.539V42.2275C134.539 52.5018 141.272 58.7362 153.542 58.7362Z" fill="black"/>
|
|
||||||
<path d="M187.508 46.3173H197.234L204.914 58.1875H216.136L207.458 45.2699C212.346 43.5243 215.338 39.634 215.338 34.3473C215.338 26.6665 209.603 22.3773 200.874 22.3773H177.732V58.1875H187.508V46.3173ZM187.508 38.5867V30.5568H200.376C203.817 30.5568 205.712 32.053 205.712 34.5967C205.712 36.9907 203.817 38.5867 200.376 38.5867H187.508Z" fill="black"/>
|
|
||||||
<path d="M219.887 58.1875H245.472C253.452 58.1875 258.041 54.397 258.041 48.0629C258.041 43.8235 255.348 40.9308 252.156 39.634C254.35 38.5867 257.043 36.0929 257.043 32.1528C257.043 25.8187 252.555 22.3773 244.625 22.3773H219.887V58.1875ZM229.263 36.3922V30.3074H243.627C246.32 30.3074 247.817 31.3548 247.817 33.3498C247.817 35.3448 246.32 36.3922 243.627 36.3922H229.263ZM229.263 43.7238H244.525C247.168 43.7238 248.615 45.0205 248.615 46.9657C248.615 48.9108 247.168 50.2075 244.525 50.2075H229.263V43.7238Z" fill="black"/>
|
|
||||||
<path d="M281.942 21.7788C269.423 21.7788 260.396 29.6092 260.396 40.2824C260.396 50.9557 269.423 58.786 281.942 58.786C294.461 58.786 303.438 50.9557 303.438 40.2824C303.438 29.6092 294.461 21.7788 281.942 21.7788ZM281.942 30.2575C288.525 30.2575 293.463 34.1478 293.463 40.2824C293.463 46.417 288.525 50.3073 281.942 50.3073C275.359 50.3073 270.421 46.417 270.421 40.2824C270.421 34.1478 275.359 30.2575 281.942 30.2575Z" fill="black"/>
|
|
||||||
<path d="M317.526 46.3173H327.251L334.932 58.1875H346.154L337.476 45.2699C342.364 43.5243 345.356 39.634 345.356 34.3473C345.356 26.6665 339.62 22.3773 330.892 22.3773H307.75V58.1875H317.526V46.3173ZM317.526 38.5867V30.5568H330.394C333.835 30.5568 335.73 32.053 335.73 34.5967C335.73 36.9907 333.835 38.5867 330.394 38.5867H317.526Z" fill="black"/>
|
|
||||||
<path d="M349.904 22.3773V58.1875H384.717V49.9083H359.48V44.0729H381.874V35.9932H359.48V30.6565H384.717V22.3773H349.904Z" fill="black"/>
|
|
||||||
<path d="M399.204 46.7662H412.221C420.95 46.7662 426.685 42.5767 426.685 34.5967C426.685 26.5668 420.95 22.3773 412.221 22.3773H389.428V58.1875H399.204V46.7662ZM399.204 38.6365V30.5568H411.673C415.164 30.5568 417.059 32.053 417.059 34.5967C417.059 37.0904 415.164 38.6365 411.673 38.6365H399.204Z" fill="black"/>
|
|
||||||
<path d="M450.948 21.7788C438.43 21.7788 429.402 29.6092 429.402 40.2824C429.402 50.9557 438.43 58.786 450.948 58.786C463.467 58.786 472.444 50.9557 472.444 40.2824C472.444 29.6092 463.467 21.7788 450.948 21.7788ZM450.948 30.2575C457.532 30.2575 462.469 34.1478 462.469 40.2824C462.469 46.417 457.532 50.3073 450.948 50.3073C444.365 50.3073 439.427 46.417 439.427 40.2824C439.427 34.1478 444.365 30.2575 450.948 30.2575Z" fill="black"/>
|
|
||||||
<path d="M38.5017 18.0956C27.2499 18.0956 18.0957 27.2498 18.0957 38.5016C18.0957 49.7534 27.2499 58.9076 38.5017 58.9076C49.7535 58.9076 58.9077 49.7534 58.9077 38.5016C58.9077 27.2498 49.7535 18.0956 38.5017 18.0956ZM38.5017 49.0618C32.6687 49.0618 27.9415 44.3346 27.9415 38.5016C27.9415 32.6686 32.6687 27.9414 38.5017 27.9414C44.3347 27.9414 49.0619 32.6686 49.0619 38.5016C49.0619 44.3346 44.3347 49.0618 38.5017 49.0618Z" fill="black"/>
|
|
||||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M40.2115 14.744V7.125C56.7719 8.0104 69.9275 21.7208 69.9275 38.5016C69.9275 55.2824 56.7719 68.989 40.2115 69.8782V62.2592C52.5539 61.3776 62.3275 51.0644 62.3275 38.5016C62.3275 25.9388 52.5539 15.6256 40.2115 14.744ZM20.5048 54.0815C17.233 50.3043 15.124 45.4935 14.7478 40.2115H7.125C7.5202 47.6025 10.4766 54.3095 15.1088 59.4737L20.501 54.0815H20.5048ZM36.7916 69.8782V62.2592C31.5058 61.883 26.695 59.7778 22.9178 56.5022L17.5256 61.8944C22.6936 66.5304 29.4006 69.483 36.7878 69.8782H36.7916Z" fill="url(#paint0_linear_2028_278)"/>
|
|
||||||
<defs>
|
|
||||||
<linearGradient id="paint0_linear_2028_278" x1="41.443" y1="11.5372" x2="10.5567" y2="42.4236" gradientUnits="userSpaceOnUse">
|
|
||||||
<stop stop-color="#0096FF"/>
|
|
||||||
<stop offset="1" stop-color="#FF1E56"/>
|
|
||||||
</linearGradient>
|
|
||||||
</defs>
|
|
||||||
</svg>
|
|
Before Width: | Height: | Size: 4.2 KiB |
@ -1,19 +0,0 @@
|
|||||||
<svg width="473" height="76" viewBox="0 0 473 76" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
||||||
<path d="M130.998 30.6566V22.3773H91.0977V30.6566H106.16V58.1876H115.935V30.6566H130.998Z" fill="white"/>
|
|
||||||
<path d="M153.542 58.7362C165.811 58.7362 172.544 52.5018 172.544 42.2276V22.3773H162.768V41.2799C162.768 47.0156 159.776 50.2574 153.542 50.2574C147.307 50.2574 144.315 47.0156 144.315 41.2799V22.3773H134.539V42.2276C134.539 52.5018 141.272 58.7362 153.542 58.7362Z" fill="white"/>
|
|
||||||
<path d="M187.508 46.3173H197.234L204.914 58.1876H216.136L207.458 45.2699C212.346 43.5243 215.338 39.6341 215.338 34.3473C215.338 26.6666 209.603 22.3773 200.874 22.3773H177.732V58.1876H187.508V46.3173ZM187.508 38.5867V30.5568H200.376C203.817 30.5568 205.712 32.0531 205.712 34.5967C205.712 36.9907 203.817 38.5867 200.376 38.5867H187.508Z" fill="white"/>
|
|
||||||
<path d="M219.887 58.1876H245.472C253.452 58.1876 258.041 54.3971 258.041 48.0629C258.041 43.8236 255.348 40.9308 252.156 39.6341C254.35 38.5867 257.043 36.0929 257.043 32.1528C257.043 25.8187 252.555 22.3773 244.625 22.3773H219.887V58.1876ZM229.263 36.3922V30.3074H243.627C246.32 30.3074 247.817 31.3548 247.817 33.3498C247.817 35.3448 246.32 36.3922 243.627 36.3922H229.263ZM229.263 43.7238H244.525C247.168 43.7238 248.615 45.0206 248.615 46.9657C248.615 48.9108 247.168 50.2076 244.525 50.2076H229.263V43.7238Z" fill="white"/>
|
|
||||||
<path d="M281.942 21.7788C269.423 21.7788 260.396 29.6092 260.396 40.2824C260.396 50.9557 269.423 58.7861 281.942 58.7861C294.461 58.7861 303.438 50.9557 303.438 40.2824C303.438 29.6092 294.461 21.7788 281.942 21.7788ZM281.942 30.2576C288.525 30.2576 293.463 34.1478 293.463 40.2824C293.463 46.4171 288.525 50.3073 281.942 50.3073C275.359 50.3073 270.421 46.4171 270.421 40.2824C270.421 34.1478 275.359 30.2576 281.942 30.2576Z" fill="white"/>
|
|
||||||
<path d="M317.526 46.3173H327.251L334.932 58.1876H346.154L337.476 45.2699C342.364 43.5243 345.356 39.6341 345.356 34.3473C345.356 26.6666 339.62 22.3773 330.892 22.3773H307.75V58.1876H317.526V46.3173ZM317.526 38.5867V30.5568H330.394C333.835 30.5568 335.73 32.0531 335.73 34.5967C335.73 36.9907 333.835 38.5867 330.394 38.5867H317.526Z" fill="white"/>
|
|
||||||
<path d="M349.904 22.3773V58.1876H384.717V49.9083H359.48V44.0729H381.874V35.9932H359.48V30.6566H384.717V22.3773H349.904Z" fill="white"/>
|
|
||||||
<path d="M399.204 46.7662H412.221C420.95 46.7662 426.685 42.5767 426.685 34.5967C426.685 26.5668 420.95 22.3773 412.221 22.3773H389.428V58.1876H399.204V46.7662ZM399.204 38.6366V30.5568H411.673C415.164 30.5568 417.059 32.0531 417.059 34.5967C417.059 37.0904 415.164 38.6366 411.673 38.6366H399.204Z" fill="white"/>
|
|
||||||
<path d="M450.948 21.7788C438.43 21.7788 429.402 29.6092 429.402 40.2824C429.402 50.9557 438.43 58.7861 450.948 58.7861C463.467 58.7861 472.444 50.9557 472.444 40.2824C472.444 29.6092 463.467 21.7788 450.948 21.7788ZM450.948 30.2576C457.532 30.2576 462.469 34.1478 462.469 40.2824C462.469 46.4171 457.532 50.3073 450.948 50.3073C444.365 50.3073 439.427 46.4171 439.427 40.2824C439.427 34.1478 444.365 30.2576 450.948 30.2576Z" fill="white"/>
|
|
||||||
<path d="M38.5017 18.0956C27.2499 18.0956 18.0957 27.2498 18.0957 38.5016C18.0957 49.7534 27.2499 58.9076 38.5017 58.9076C49.7535 58.9076 58.9077 49.7534 58.9077 38.5016C58.9077 27.2498 49.7535 18.0956 38.5017 18.0956ZM38.5017 49.0618C32.6687 49.0618 27.9415 44.3346 27.9415 38.5016C27.9415 32.6686 32.6687 27.9414 38.5017 27.9414C44.3347 27.9414 49.0619 32.6686 49.0619 38.5016C49.0619 44.3346 44.3347 49.0618 38.5017 49.0618Z" fill="white"/>
|
|
||||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M40.2115 14.744V7.125C56.7719 8.0104 69.9275 21.7208 69.9275 38.5016C69.9275 55.2824 56.7719 68.989 40.2115 69.8782V62.2592C52.5539 61.3776 62.3275 51.0644 62.3275 38.5016C62.3275 25.9388 52.5539 15.6256 40.2115 14.744ZM20.5048 54.0815C17.233 50.3043 15.124 45.4935 14.7478 40.2115H7.125C7.5202 47.6025 10.4766 54.3095 15.1088 59.4737L20.501 54.0815H20.5048ZM36.7916 69.8782V62.2592C31.5058 61.883 26.695 59.7778 22.9178 56.5022L17.5256 61.8944C22.6936 66.5304 29.4006 69.483 36.7878 69.8782H36.7916Z" fill="url(#paint0_linear_2028_477)"/>
|
|
||||||
<defs>
|
|
||||||
<linearGradient id="paint0_linear_2028_477" x1="41.443" y1="11.5372" x2="10.5567" y2="42.4236" gradientUnits="userSpaceOnUse">
|
|
||||||
<stop stop-color="#0096FF"/>
|
|
||||||
<stop offset="1" stop-color="#FF1E56"/>
|
|
||||||
</linearGradient>
|
|
||||||
</defs>
|
|
||||||
</svg>
|
|
Before Width: | Height: | Size: 4.2 KiB |
@ -1,10 +0,0 @@
|
|||||||
<svg width="21" height="20" viewBox="0 0 21 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
||||||
<g clip-path="url(#clip0_977_547)">
|
|
||||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M10.5 3L18.5 17H2.5L10.5 3Z" fill="white"/>
|
|
||||||
</g>
|
|
||||||
<defs>
|
|
||||||
<clipPath id="clip0_977_547">
|
|
||||||
<rect width="16" height="16" fill="white" transform="translate(2.5 2)"/>
|
|
||||||
</clipPath>
|
|
||||||
</defs>
|
|
||||||
</svg>
|
|
Before Width: | Height: | Size: 367 B |
@ -1,3 +0,0 @@
|
|||||||
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
||||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M1.5 2.5H14.5V12.5C14.5 13.0523 14.0523 13.5 13.5 13.5H2.5C1.94772 13.5 1.5 13.0523 1.5 12.5V2.5ZM0 1H1.5H14.5H16V2.5V12.5C16 13.8807 14.8807 15 13.5 15H2.5C1.11929 15 0 13.8807 0 12.5V2.5V1ZM3.75 5.5C4.16421 5.5 4.5 5.16421 4.5 4.75C4.5 4.33579 4.16421 4 3.75 4C3.33579 4 3 4.33579 3 4.75C3 5.16421 3.33579 5.5 3.75 5.5ZM7 4.75C7 5.16421 6.66421 5.5 6.25 5.5C5.83579 5.5 5.5 5.16421 5.5 4.75C5.5 4.33579 5.83579 4 6.25 4C6.66421 4 7 4.33579 7 4.75ZM8.75 5.5C9.16421 5.5 9.5 5.16421 9.5 4.75C9.5 4.33579 9.16421 4 8.75 4C8.33579 4 8 4.33579 8 4.75C8 5.16421 8.33579 5.5 8.75 5.5Z" fill="#666666"/>
|
|
||||||
</svg>
|
|
Before Width: | Height: | Size: 750 B |
@ -1,20 +0,0 @@
|
|||||||
{
|
|
||||||
"extends": "@repo/typescript-config/nextjs.json",
|
|
||||||
"compilerOptions": {
|
|
||||||
"plugins": [
|
|
||||||
{
|
|
||||||
"name": "next"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"include": [
|
|
||||||
"**/*.ts",
|
|
||||||
"**/*.tsx",
|
|
||||||
"next-env.d.ts",
|
|
||||||
"next.config.js",
|
|
||||||
".next/types/**/*.ts"
|
|
||||||
],
|
|
||||||
"exclude": [
|
|
||||||
"node_modules"
|
|
||||||
]
|
|
||||||
}
|
|
5
apps/ebitemp-api/.prettierrc
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
{
|
||||||
|
"printWidth": 120,
|
||||||
|
"singleQuote": true,
|
||||||
|
"trailingComma": "all"
|
||||||
|
}
|
98
apps/ebitemp-api/README.md
Normal file
@ -0,0 +1,98 @@
|
|||||||
|
<p align="center">
|
||||||
|
<a href="http://nestjs.com/" target="blank"><img src="https://nestjs.com/img/logo-small.svg" width="120" alt="Nest Logo" /></a>
|
||||||
|
</p>
|
||||||
|
|
||||||
|
[circleci-image]: https://img.shields.io/circleci/build/github/nestjs/nest/master?token=abc123def456
|
||||||
|
[circleci-url]: https://circleci.com/gh/nestjs/nest
|
||||||
|
|
||||||
|
<p align="center">A progressive <a href="http://nodejs.org" target="_blank">Node.js</a> framework for building efficient and scalable server-side applications.</p>
|
||||||
|
<p align="center">
|
||||||
|
<a href="https://www.npmjs.com/~nestjscore" target="_blank"><img src="https://img.shields.io/npm/v/@nestjs/core.svg" alt="NPM Version" /></a>
|
||||||
|
<a href="https://www.npmjs.com/~nestjscore" target="_blank"><img src="https://img.shields.io/npm/l/@nestjs/core.svg" alt="Package License" /></a>
|
||||||
|
<a href="https://www.npmjs.com/~nestjscore" target="_blank"><img src="https://img.shields.io/npm/dm/@nestjs/common.svg" alt="NPM Downloads" /></a>
|
||||||
|
<a href="https://circleci.com/gh/nestjs/nest" target="_blank"><img src="https://img.shields.io/circleci/build/github/nestjs/nest/master" alt="CircleCI" /></a>
|
||||||
|
<a href="https://discord.gg/G7Qnnhy" target="_blank"><img src="https://img.shields.io/badge/discord-online-brightgreen.svg" alt="Discord"/></a>
|
||||||
|
<a href="https://opencollective.com/nest#backer" target="_blank"><img src="https://opencollective.com/nest/backers/badge.svg" alt="Backers on Open Collective" /></a>
|
||||||
|
<a href="https://opencollective.com/nest#sponsor" target="_blank"><img src="https://opencollective.com/nest/sponsors/badge.svg" alt="Sponsors on Open Collective" /></a>
|
||||||
|
<a href="https://paypal.me/kamilmysliwiec" target="_blank"><img src="https://img.shields.io/badge/Donate-PayPal-ff3f59.svg" alt="Donate us"/></a>
|
||||||
|
<a href="https://opencollective.com/nest#sponsor" target="_blank"><img src="https://img.shields.io/badge/Support%20us-Open%20Collective-41B883.svg" alt="Support us"></a>
|
||||||
|
<a href="https://twitter.com/nestframework" target="_blank"><img src="https://img.shields.io/twitter/follow/nestframework.svg?style=social&label=Follow" alt="Follow us on Twitter"></a>
|
||||||
|
</p>
|
||||||
|
<!--[](https://opencollective.com/nest#backer)
|
||||||
|
[](https://opencollective.com/nest#sponsor)-->
|
||||||
|
|
||||||
|
## Description
|
||||||
|
|
||||||
|
[Nest](https://github.com/nestjs/nest) framework TypeScript starter repository.
|
||||||
|
|
||||||
|
## Project setup
|
||||||
|
|
||||||
|
```bash
|
||||||
|
$ pnpm install
|
||||||
|
```
|
||||||
|
|
||||||
|
## Compile and run the project
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# development
|
||||||
|
$ pnpm run start
|
||||||
|
|
||||||
|
# watch mode
|
||||||
|
$ pnpm run start:dev
|
||||||
|
|
||||||
|
# production mode
|
||||||
|
$ pnpm run start:prod
|
||||||
|
```
|
||||||
|
|
||||||
|
## Run tests
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# unit tests
|
||||||
|
$ pnpm run test
|
||||||
|
|
||||||
|
# e2e tests
|
||||||
|
$ pnpm run test:e2e
|
||||||
|
|
||||||
|
# test coverage
|
||||||
|
$ pnpm run test:cov
|
||||||
|
```
|
||||||
|
|
||||||
|
## Deployment
|
||||||
|
|
||||||
|
When you're ready to deploy your NestJS application to production, there are some key steps you can take to ensure it runs as efficiently as possible. Check out the [deployment documentation](https://docs.nestjs.com/deployment) for more information.
|
||||||
|
|
||||||
|
If you are looking for a cloud-based platform to deploy your NestJS application, check out [Mau](https://mau.nestjs.com), our official platform for deploying NestJS applications on AWS. Mau makes deployment straightforward and fast, requiring just a few simple steps:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
$ pnpm install -g mau
|
||||||
|
$ mau deploy
|
||||||
|
```
|
||||||
|
|
||||||
|
With Mau, you can deploy your application in just a few clicks, allowing you to focus on building features rather than managing infrastructure.
|
||||||
|
|
||||||
|
## Resources
|
||||||
|
|
||||||
|
Check out a few resources that may come in handy when working with NestJS:
|
||||||
|
|
||||||
|
- Visit the [NestJS Documentation](https://docs.nestjs.com) to learn more about the framework.
|
||||||
|
- For questions and support, please visit our [Discord channel](https://discord.gg/G7Qnnhy).
|
||||||
|
- To dive deeper and get more hands-on experience, check out our official video [courses](https://courses.nestjs.com/).
|
||||||
|
- Deploy your application to AWS with the help of [NestJS Mau](https://mau.nestjs.com) in just a few clicks.
|
||||||
|
- Visualize your application graph and interact with the NestJS application in real-time using [NestJS Devtools](https://devtools.nestjs.com).
|
||||||
|
- Need help with your project (part-time to full-time)? Check out our official [enterprise support](https://enterprise.nestjs.com).
|
||||||
|
- To stay in the loop and get updates, follow us on [X](https://x.com/nestframework) and [LinkedIn](https://linkedin.com/company/nestjs).
|
||||||
|
- Looking for a job, or have a job to offer? Check out our official [Jobs board](https://jobs.nestjs.com).
|
||||||
|
|
||||||
|
## Support
|
||||||
|
|
||||||
|
Nest is an MIT-licensed open source project. It can grow thanks to the sponsors and support by the amazing backers. If you'd like to join them, please [read more here](https://docs.nestjs.com/support).
|
||||||
|
|
||||||
|
## Stay in touch
|
||||||
|
|
||||||
|
- Author - [Kamil Myśliwiec](https://twitter.com/kammysliwiec)
|
||||||
|
- Website - [https://nestjs.com](https://nestjs.com/)
|
||||||
|
- Twitter - [@nestframework](https://twitter.com/nestframework)
|
||||||
|
|
||||||
|
## License
|
||||||
|
|
||||||
|
Nest is [MIT licensed](https://github.com/nestjs/nest/blob/master/LICENSE).
|
35
apps/ebitemp-api/eslint.config.mjs
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
// @ts-check
|
||||||
|
import eslint from '@eslint/js';
|
||||||
|
import eslintPluginPrettierRecommended from 'eslint-plugin-prettier/recommended';
|
||||||
|
import globals from 'globals';
|
||||||
|
import tseslint from 'typescript-eslint';
|
||||||
|
|
||||||
|
export default tseslint.config(
|
||||||
|
{
|
||||||
|
ignores: ['eslint.config.mjs'],
|
||||||
|
},
|
||||||
|
eslint.configs.recommended,
|
||||||
|
...tseslint.configs.recommendedTypeChecked,
|
||||||
|
eslintPluginPrettierRecommended,
|
||||||
|
{
|
||||||
|
languageOptions: {
|
||||||
|
globals: {
|
||||||
|
...globals.node,
|
||||||
|
...globals.jest,
|
||||||
|
},
|
||||||
|
ecmaVersion: 5,
|
||||||
|
sourceType: 'module',
|
||||||
|
parserOptions: {
|
||||||
|
projectService: true,
|
||||||
|
tsconfigRootDir: import.meta.dirname,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
rules: {
|
||||||
|
'@typescript-eslint/no-explicit-any': 'off',
|
||||||
|
'@typescript-eslint/no-floating-promises': 'warn',
|
||||||
|
'@typescript-eslint/no-unsafe-argument': 'warn'
|
||||||
|
},
|
||||||
|
},
|
||||||
|
);
|
9
apps/ebitemp-api/nest-cli.json
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
{
|
||||||
|
"$schema": "https://json.schemastore.org/nest-cli",
|
||||||
|
"collection": "@nestjs/schematics",
|
||||||
|
"sourceRoot": "src",
|
||||||
|
"compilerOptions": {
|
||||||
|
"deleteOutDir": true,
|
||||||
|
"plugins": [{ "name": "@nestjs/swagger/plugin", "options": { "introspectComments": true } }]
|
||||||
|
}
|
||||||
|
}
|
107
apps/ebitemp-api/package.json
Normal file
@ -0,0 +1,107 @@
|
|||||||
|
{
|
||||||
|
"name": "ebitemp-api",
|
||||||
|
"private": true,
|
||||||
|
"scripts": {
|
||||||
|
"build": "nest build",
|
||||||
|
"format": "prettier --list-different --write \"src/**/*.ts\" \"test/**/*.ts\"",
|
||||||
|
"dev": "nest start --debug --watch",
|
||||||
|
"start:prod": "node dist/main",
|
||||||
|
"lint": "eslint \"{src,apps,libs,test}/**/*.ts\" --fix",
|
||||||
|
"test": "jest",
|
||||||
|
"test:watch": "jest --watch",
|
||||||
|
"test:cov": "jest --coverage",
|
||||||
|
"test:debug": "node --inspect-brk -r tsconfig-paths/register -r ts-node/register node_modules/.bin/jest --runInBand",
|
||||||
|
"test:e2e": "jest --config ./test/jest-e2e.json"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"@anatine/zod-nestjs": "^2.0.10",
|
||||||
|
"@anatine/zod-openapi": "^2.2.7",
|
||||||
|
"@autotelic/pino-seq-transport": "^0.1.0",
|
||||||
|
"@fastify/send": "^4.0.0",
|
||||||
|
"@fastify/static": "^8.1.0",
|
||||||
|
"@keyv/redis": "^4.2.0",
|
||||||
|
"@nestjs/common": "^11.0.8",
|
||||||
|
"@nestjs/config": "^4.0.0",
|
||||||
|
"@nestjs/core": "^11.0.8",
|
||||||
|
"@nestjs/jwt": "^11.0.0",
|
||||||
|
"@nestjs/passport": "^11.0.5",
|
||||||
|
"@nestjs/platform-express": "^11.0.8",
|
||||||
|
"@nestjs/platform-fastify": "^11.0.8",
|
||||||
|
"@nestjs/schedule": "^5.0.1",
|
||||||
|
"@nestjs/swagger": "^11.0.3",
|
||||||
|
"@nestjs/terminus": "^11.0.0",
|
||||||
|
"@nestjs/typeorm": "^11.0.0",
|
||||||
|
"@stdlib/assert": "^0.3.3",
|
||||||
|
"argon2": "^0.41.1",
|
||||||
|
"async-lock": "^1.4.1",
|
||||||
|
"axios": "^1.7.9",
|
||||||
|
"bcrypt": "^5.1.1",
|
||||||
|
"cacheable": "^1.8.8",
|
||||||
|
"connection-string": "^4.4.0",
|
||||||
|
"cron": "^3.5.0",
|
||||||
|
"dayjs": "^1.11.13",
|
||||||
|
"fastify": "^5.2.1",
|
||||||
|
"flatted": "^3.3.2",
|
||||||
|
"lodash": "^4.17.21",
|
||||||
|
"nestjs-cls": "^5.4.1",
|
||||||
|
"nestjs-paginate": "^11.1.1",
|
||||||
|
"nestjs-pino": "^4.3.0",
|
||||||
|
"openapi3-ts": "^4.4.0",
|
||||||
|
"passport-jwt": "^4.0.1",
|
||||||
|
"passport-local": "^1.0.0",
|
||||||
|
"pino-http": "^10.4.0",
|
||||||
|
"pino-pretty": "^13.0.0",
|
||||||
|
"reflect-metadata": "^0.2.2",
|
||||||
|
"rxjs": "^7.8.1",
|
||||||
|
"tozod": "^3.0.0",
|
||||||
|
"typeorm": "^0.3.20",
|
||||||
|
"typeorm-naming-strategies": "^4.1.0",
|
||||||
|
"typeorm-scoped": "^1.2.0",
|
||||||
|
"typeorm-transactional": "^0.5.0",
|
||||||
|
"zod": "^3.24.1"
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"@repo/eslint-config": "workspace:*",
|
||||||
|
"@repo/typescript-config": "workspace:*",
|
||||||
|
"@nestjs/schematics": "^11.0.0",
|
||||||
|
"@nestjs/testing": "^11.0.1",
|
||||||
|
"@swc/cli": "^0.6.0",
|
||||||
|
"@swc/core": "^1.10.7",
|
||||||
|
"@types/async-lock": "^1.4.2",
|
||||||
|
"@types/bcrypt": "^5.0.2",
|
||||||
|
"@types/express": "^5.0.0",
|
||||||
|
"@types/jest": "^29.5.14",
|
||||||
|
"@types/lodash": "^4.17.15",
|
||||||
|
"@types/node": "^22.10.7",
|
||||||
|
"@types/passport-jwt": "^4.0.1",
|
||||||
|
"@types/supertest": "^6.0.2",
|
||||||
|
"globals": "^16.0.0",
|
||||||
|
"jest": "^29.7.0",
|
||||||
|
"mssql": "^11.0.1",
|
||||||
|
"prettier": "^3.4.2",
|
||||||
|
"source-map-support": "^0.5.21",
|
||||||
|
"supertest": "^7.0.0",
|
||||||
|
"ts-jest": "^29.2.5",
|
||||||
|
"ts-loader": "^9.5.2",
|
||||||
|
"ts-node": "^10.9.2",
|
||||||
|
"tsconfig-paths": "^4.2.0",
|
||||||
|
"typescript": "^5.7.3"
|
||||||
|
},
|
||||||
|
"jest": {
|
||||||
|
"moduleFileExtensions": [
|
||||||
|
"js",
|
||||||
|
"json",
|
||||||
|
"ts"
|
||||||
|
],
|
||||||
|
"rootDir": "src",
|
||||||
|
"testRegex": ".*\\.spec\\.ts$",
|
||||||
|
"transform": {
|
||||||
|
"^.+\\.(t|j)s$": "ts-jest"
|
||||||
|
},
|
||||||
|
"collectCoverageFrom": [
|
||||||
|
"**/*.(t|j)s"
|
||||||
|
],
|
||||||
|
"coverageDirectory": "../coverage",
|
||||||
|
"testEnvironment": "node"
|
||||||
|
}
|
||||||
|
}
|
22
apps/ebitemp-api/src/app.controller.spec.ts
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
import { Test, TestingModule } from '@nestjs/testing';
|
||||||
|
import { AppController } from './app.controller';
|
||||||
|
import { AppService } from './app.service';
|
||||||
|
|
||||||
|
describe('AppController', () => {
|
||||||
|
let appController: AppController;
|
||||||
|
|
||||||
|
beforeEach(async () => {
|
||||||
|
const app: TestingModule = await Test.createTestingModule({
|
||||||
|
controllers: [AppController],
|
||||||
|
providers: [AppService],
|
||||||
|
}).compile();
|
||||||
|
|
||||||
|
appController = app.get<AppController>(AppController);
|
||||||
|
});
|
||||||
|
|
||||||
|
describe('root', () => {
|
||||||
|
it('should return "Hello World!"', () => {
|
||||||
|
expect(appController.getHello()).toBe('Hello World!');
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
12
apps/ebitemp-api/src/app.controller.ts
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
import { Controller, Get } from '@nestjs/common';
|
||||||
|
import { AppService } from './app.service';
|
||||||
|
|
||||||
|
@Controller()
|
||||||
|
export class AppController {
|
||||||
|
constructor(private readonly appService: AppService) {}
|
||||||
|
|
||||||
|
@Get()
|
||||||
|
getHello(): string {
|
||||||
|
return this.appService.getHello();
|
||||||
|
}
|
||||||
|
}
|
37
apps/ebitemp-api/src/app.module.ts
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
import { Module } from '@nestjs/common';
|
||||||
|
import { AppController } from './app.controller';
|
||||||
|
import { AppService } from './app.service';
|
||||||
|
|
||||||
|
import { AppAuthModule } from './modules/auth/auth.module';
|
||||||
|
import { AppClsModule } from './modules/cls/cls.module';
|
||||||
|
import { AppConfigModule } from './modules/config/config.module';
|
||||||
|
import { AppDatabaseModule } from './modules/database/database.module';
|
||||||
|
import { EnumifyModule } from './modules/enumify/enumify.module';
|
||||||
|
import { AppFileTransactionsModule } from './modules/file-transactions/file-transactions.module';
|
||||||
|
import { AppHealthModule } from './modules/health/health.module';
|
||||||
|
import { AppLoggerModule } from './modules/logger/logger.module';
|
||||||
|
import { AppRequestLoggingModule } from './modules/request-logging/request-logging.module';
|
||||||
|
import { AppScheduleModule } from './modules/schedule/schedule.module';
|
||||||
|
import { AppValidationModule } from './modules/validation/validation.module';
|
||||||
|
|
||||||
|
import { AnagraficaModule } from './features/anagrafica/anagrafica.module';
|
||||||
|
|
||||||
|
@Module({
|
||||||
|
imports: [
|
||||||
|
AppConfigModule,
|
||||||
|
AppLoggerModule,
|
||||||
|
AppDatabaseModule,
|
||||||
|
AppClsModule,
|
||||||
|
AppHealthModule,
|
||||||
|
AppFileTransactionsModule,
|
||||||
|
AppScheduleModule,
|
||||||
|
AppValidationModule,
|
||||||
|
AppAuthModule,
|
||||||
|
AppRequestLoggingModule,
|
||||||
|
EnumifyModule,
|
||||||
|
AnagraficaModule,
|
||||||
|
],
|
||||||
|
controllers: [AppController],
|
||||||
|
providers: [AppService],
|
||||||
|
})
|
||||||
|
export class AppModule {}
|
8
apps/ebitemp-api/src/app.service.ts
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
import { Injectable } from '@nestjs/common';
|
||||||
|
|
||||||
|
@Injectable()
|
||||||
|
export class AppService {
|
||||||
|
getHello(): string {
|
||||||
|
return 'Hello World!';
|
||||||
|
}
|
||||||
|
}
|
0
apps/ebitemp-api/src/assets/.git-keep
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
import { Test } from '@nestjs/testing';
|
||||||
|
import { AnagraficaController } from './anagrafica.controller';
|
||||||
|
import { AnagraficaService } from './anagrafica.service';
|
||||||
|
|
||||||
|
describe('AnagraficaController', () => {
|
||||||
|
let controller: AnagraficaController;
|
||||||
|
|
||||||
|
beforeEach(async () => {
|
||||||
|
const module = await Test.createTestingModule({
|
||||||
|
providers: [AnagraficaService],
|
||||||
|
controllers: [AnagraficaController],
|
||||||
|
}).compile();
|
||||||
|
|
||||||
|
controller = module.get(AnagraficaController);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should be defined', () => {
|
||||||
|
expect(controller).toBeTruthy();
|
||||||
|
});
|
||||||
|
});
|
@ -0,0 +1,28 @@
|
|||||||
|
import { Controller, Get, Param, UseInterceptors } from '@nestjs/common';
|
||||||
|
import { ApiBearerAuth, ApiOperation, ApiTags } from '@nestjs/swagger';
|
||||||
|
import { ApiOkPaginatedResponse, ApiPaginationQuery, Paginate, type PaginateQuery } from 'nestjs-paginate';
|
||||||
|
import { SocioEntity } from '../../modules/database/connections/oceano';
|
||||||
|
import { AnagraficaService } from './anagrafica.service';
|
||||||
|
import { RequestLoggerInterceptor } from '../../modules/request-logging/request-logger.interceptor';
|
||||||
|
|
||||||
|
@UseInterceptors(RequestLoggerInterceptor)
|
||||||
|
@ApiBearerAuth()
|
||||||
|
@ApiTags('anagrafica')
|
||||||
|
@Controller('anagrafiche')
|
||||||
|
export class AnagraficaController {
|
||||||
|
constructor(private anagraficaService: AnagraficaService) {}
|
||||||
|
|
||||||
|
@Get()
|
||||||
|
@ApiOperation({ summary: 'Find all Anagrafiche' })
|
||||||
|
@ApiPaginationQuery(AnagraficaService.findPaginateConfig())
|
||||||
|
@ApiOkPaginatedResponse(SocioEntity, AnagraficaService.findPaginateConfig())
|
||||||
|
async getAnagrafiche(@Paginate() query: PaginateQuery) {
|
||||||
|
return this.anagraficaService.getAnagrafiche(query);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Get('id/:id')
|
||||||
|
@ApiOperation({ summary: 'Get one Anagrafica by id' })
|
||||||
|
async getOneAnagraficaById(@Param('id') id: string) {
|
||||||
|
return this.anagraficaService.getOneAnagraficaById(id);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,14 @@
|
|||||||
|
import { Module } from '@nestjs/common';
|
||||||
|
import { TypeOrmModule } from '@nestjs/typeorm';
|
||||||
|
import { SocioEntity } from '../../modules/database/connections/oceano';
|
||||||
|
import { OCEANO_DATASOURCE } from '../../modules/database/connections/oceano/database.constants';
|
||||||
|
import { AnagraficaController } from './anagrafica.controller';
|
||||||
|
import { AnagraficaService } from './anagrafica.service';
|
||||||
|
|
||||||
|
@Module({
|
||||||
|
imports: [TypeOrmModule.forFeature([SocioEntity], OCEANO_DATASOURCE)],
|
||||||
|
controllers: [AnagraficaController],
|
||||||
|
providers: [AnagraficaService],
|
||||||
|
exports: [AnagraficaService],
|
||||||
|
})
|
||||||
|
export class AnagraficaModule {}
|
@ -0,0 +1,18 @@
|
|||||||
|
import { Test } from '@nestjs/testing';
|
||||||
|
import { AnagraficaService } from './anagrafica.service';
|
||||||
|
|
||||||
|
describe('AnagraficaService', () => {
|
||||||
|
let service: AnagraficaService;
|
||||||
|
|
||||||
|
beforeEach(async () => {
|
||||||
|
const module = await Test.createTestingModule({
|
||||||
|
providers: [AnagraficaService],
|
||||||
|
}).compile();
|
||||||
|
|
||||||
|
service = module.get(AnagraficaService);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should be defined', () => {
|
||||||
|
expect(service).toBeTruthy();
|
||||||
|
});
|
||||||
|
});
|
@ -0,0 +1,46 @@
|
|||||||
|
import { Injectable, Logger } from '@nestjs/common';
|
||||||
|
import { InjectRepository } from '@nestjs/typeorm';
|
||||||
|
import { paginate, PaginateConfig, PaginateQuery } from 'nestjs-paginate';
|
||||||
|
import { Repository } from 'typeorm';
|
||||||
|
import { SocioEntity } from '../../modules/database/connections/oceano';
|
||||||
|
import { OCEANO_DATASOURCE } from '../../modules/database/connections/oceano/database.constants';
|
||||||
|
|
||||||
|
@Injectable()
|
||||||
|
export class AnagraficaService {
|
||||||
|
private readonly logger = new Logger(AnagraficaService.name);
|
||||||
|
|
||||||
|
static readonly findPaginateConfig = (): PaginateConfig<SocioEntity> => ({
|
||||||
|
relations: {},
|
||||||
|
sortableColumns: ['codiceSocio', 'idNucleo', 'idPersona'],
|
||||||
|
searchableColumns: [],
|
||||||
|
defaultSortBy: [['codiceSocio', 'ASC']],
|
||||||
|
defaultLimit: 50,
|
||||||
|
maxLimit: -1,
|
||||||
|
filterableColumns: {},
|
||||||
|
relativePath: true,
|
||||||
|
where: {
|
||||||
|
codiceGruppo: '6',
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
constructor(
|
||||||
|
@InjectRepository(SocioEntity, OCEANO_DATASOURCE)
|
||||||
|
private readonly sociRepository: Repository<SocioEntity>,
|
||||||
|
) {}
|
||||||
|
|
||||||
|
async getAnagrafiche(query: PaginateQuery) {
|
||||||
|
const config = AnagraficaService.findPaginateConfig();
|
||||||
|
query.limit ??= -1;
|
||||||
|
|
||||||
|
return await paginate(query, this.sociRepository, config);
|
||||||
|
}
|
||||||
|
|
||||||
|
async getOneAnagraficaById(idAnagrafica: string) {
|
||||||
|
return await this.sociRepository.findOne({
|
||||||
|
where: {
|
||||||
|
...AnagraficaService.findPaginateConfig().where,
|
||||||
|
codiceSocio: idAnagrafica,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
61
apps/ebitemp-api/src/main.ts
Normal file
@ -0,0 +1,61 @@
|
|||||||
|
import { Logger, VersioningType } from '@nestjs/common';
|
||||||
|
import { NestFactory } from '@nestjs/core';
|
||||||
|
import { FastifyAdapter, NestFastifyApplication } from '@nestjs/platform-fastify';
|
||||||
|
import { Logger as PinoLogger } from 'nestjs-pino';
|
||||||
|
|
||||||
|
import { DocumentBuilder, SwaggerDocumentOptions, SwaggerModule } from '@nestjs/swagger';
|
||||||
|
import { flow } from 'lodash';
|
||||||
|
import { AppModule } from './app.module';
|
||||||
|
import { patchPublicDecoratorSupport } from './modules/auth/strategies/jwt/jwt-auth.guard';
|
||||||
|
import { LocalConfig, localConfig } from './modules/config/local.config';
|
||||||
|
import { patchTypeOrm } from './modules/database/utils/typeorm-patch';
|
||||||
|
import { patchNestjsSwagger } from './modules/validation/utils/nestjs-swagger-patches';
|
||||||
|
|
||||||
|
async function bootstrap() {
|
||||||
|
await patchTypeOrm();
|
||||||
|
await patchNestjsSwagger();
|
||||||
|
|
||||||
|
const appOpts = (() => {
|
||||||
|
const loggerOpts = { bufferLogs: true };
|
||||||
|
return {
|
||||||
|
forceCloseConnections: true,
|
||||||
|
...loggerOpts,
|
||||||
|
};
|
||||||
|
})();
|
||||||
|
const app = await NestFactory.create<NestFastifyApplication>(AppModule, new FastifyAdapter(appOpts));
|
||||||
|
app.enableVersioning({
|
||||||
|
type: VersioningType.URI,
|
||||||
|
defaultVersion: '1',
|
||||||
|
});
|
||||||
|
app.enableShutdownHooks();
|
||||||
|
|
||||||
|
const config = app.get<LocalConfig>(localConfig.KEY);
|
||||||
|
const port = config.port || 3000;
|
||||||
|
|
||||||
|
app.useLogger(app.get(PinoLogger));
|
||||||
|
|
||||||
|
const swaggerConfig = new DocumentBuilder().addBearerAuth().build();
|
||||||
|
const swaggerOptions = {
|
||||||
|
operationIdFactory: (controllerKey: string, methodKey: string) => {
|
||||||
|
return `${controllerKey}_${methodKey}`;
|
||||||
|
},
|
||||||
|
} satisfies SwaggerDocumentOptions;
|
||||||
|
const document = flow(
|
||||||
|
() => SwaggerModule.createDocument(app, swaggerConfig, swaggerOptions),
|
||||||
|
patchPublicDecoratorSupport,
|
||||||
|
)();
|
||||||
|
|
||||||
|
SwaggerModule.setup(`docs`, app, document, {
|
||||||
|
swaggerOptions: {
|
||||||
|
operationsSorter: 'alpha',
|
||||||
|
displayOperationId: true,
|
||||||
|
filter: true,
|
||||||
|
persistAuthorization: true,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
await app.listen(port);
|
||||||
|
Logger.log(`🚀 Application is running on: http://localhost:${port}`);
|
||||||
|
}
|
||||||
|
|
||||||
|
void bootstrap();
|
31
apps/ebitemp-api/src/modules/auth/auth.config.ts
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
import { registerAs } from '@nestjs/config';
|
||||||
|
import { z } from 'zod';
|
||||||
|
import coerceRecordTypes from '../config/utils/coerce-record-types';
|
||||||
|
|
||||||
|
export const authSchema = z.object({
|
||||||
|
accessToken: z.object({
|
||||||
|
secret: z.string(),
|
||||||
|
expTimeInSecs: z.number().finite().nonnegative(),
|
||||||
|
}),
|
||||||
|
refreshToken: z.object({
|
||||||
|
secret: z.string(),
|
||||||
|
expTimeInSecs: z.number().finite().nonnegative(),
|
||||||
|
}),
|
||||||
|
});
|
||||||
|
export type AuthConfig = z.infer<typeof authSchema>;
|
||||||
|
|
||||||
|
export const authConfig = registerAs('auth', () => {
|
||||||
|
const env = coerceRecordTypes(process.env);
|
||||||
|
|
||||||
|
const config: AuthConfig = authSchema.strict().parse({
|
||||||
|
accessToken: {
|
||||||
|
secret: env['JWT_ACCESS_TOKEN_SECRET'],
|
||||||
|
expTimeInSecs: env['JWT_ACCESS_TOKEN_EXPIRATION_TIME_IN_SECONDS'],
|
||||||
|
},
|
||||||
|
refreshToken: {
|
||||||
|
secret: env['JWT_REFRESH_TOKEN_SECRET'],
|
||||||
|
expTimeInSecs: env['JWT_REFRESH_TOKEN_EXPIRATION_TIME_IN_SECONDS'],
|
||||||
|
},
|
||||||
|
});
|
||||||
|
return config;
|
||||||
|
});
|
31
apps/ebitemp-api/src/modules/auth/auth.controller.ts
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
import { Body, Controller, HttpCode, HttpStatus, Post, UseGuards } from '@nestjs/common';
|
||||||
|
import { ApiBearerAuth } from '@nestjs/swagger';
|
||||||
|
import { AccountsEntity } from '../database/connections/ebitemp-api/entities';
|
||||||
|
import { LoginDto, LoginResDto } from './auth.dto';
|
||||||
|
import { AuthService } from './auth.service';
|
||||||
|
import { AuthenticatedUser } from './authenticated-user.decorator';
|
||||||
|
import { Public } from './strategies/jwt/jwt-auth.guard';
|
||||||
|
import { JwtRefreshGuard } from './strategies/jwt/jwt-refresh.guard';
|
||||||
|
|
||||||
|
@ApiBearerAuth()
|
||||||
|
@Controller('auth')
|
||||||
|
export class AuthController {
|
||||||
|
constructor(private readonly authService: AuthService) {}
|
||||||
|
|
||||||
|
@HttpCode(HttpStatus.OK)
|
||||||
|
@Public()
|
||||||
|
@Post('login')
|
||||||
|
async logIn(@Body() body: LoginDto): Promise<LoginResDto> {
|
||||||
|
const { username, password } = body;
|
||||||
|
const user = await this.authService.getAuthenticatedUser(username, password);
|
||||||
|
return await this.authService.signJwts(user);
|
||||||
|
}
|
||||||
|
|
||||||
|
@HttpCode(HttpStatus.OK)
|
||||||
|
@UseGuards(JwtRefreshGuard)
|
||||||
|
@Public(true)
|
||||||
|
@Post('refresh')
|
||||||
|
async refresh(@AuthenticatedUser() user: AccountsEntity): Promise<LoginResDto> {
|
||||||
|
return await this.authService.signJwts(user);
|
||||||
|
}
|
||||||
|
}
|
19
apps/ebitemp-api/src/modules/auth/auth.dto.ts
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
import { createZodDto } from '@anatine/zod-nestjs';
|
||||||
|
import { z } from 'zod';
|
||||||
|
import { AccountsEntitySchema } from '../database/connections/ebitemp-api/entities';
|
||||||
|
|
||||||
|
export const loginSchema = z.object({
|
||||||
|
username: AccountsEntitySchema.shape.username,
|
||||||
|
password: z.string().nonempty(),
|
||||||
|
});
|
||||||
|
export type Login = z.infer<typeof loginSchema>;
|
||||||
|
export class LoginDto extends createZodDto(loginSchema) {}
|
||||||
|
|
||||||
|
export const loginResSchema = z.object({
|
||||||
|
accessToken: z.string().jwt(),
|
||||||
|
accessTokenExp: z.string().datetime(),
|
||||||
|
refreshToken: z.string().jwt(),
|
||||||
|
refreshTokenExp: z.string().datetime(),
|
||||||
|
});
|
||||||
|
export type LoginRes = z.infer<typeof loginResSchema>;
|
||||||
|
export class LoginResDto extends createZodDto(loginResSchema) {}
|
36
apps/ebitemp-api/src/modules/auth/auth.module.ts
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
import { Module } from '@nestjs/common';
|
||||||
|
import { APP_GUARD, Reflector } from '@nestjs/core';
|
||||||
|
import { PassportModule } from '@nestjs/passport';
|
||||||
|
import { TypeOrmModule } from '@nestjs/typeorm';
|
||||||
|
import { AccountsEntity } from '../database/connections/ebitemp-api/entities';
|
||||||
|
import { AuthController } from './auth.controller';
|
||||||
|
import { AuthService } from './auth.service';
|
||||||
|
import { JwtAccessTokenAuthStrategy } from './strategies/jwt/jwt-access-token-auth.strategy';
|
||||||
|
import { JwtAccessTokenModule } from './strategies/jwt/jwt-access-token.module';
|
||||||
|
import { JwtAuthGuard } from './strategies/jwt/jwt-auth.guard';
|
||||||
|
import { JwtRefreshTokenAuthStrategy } from './strategies/jwt/jwt-refresh-token-auth.strategy';
|
||||||
|
import { JwtRefreshTokenModule } from './strategies/jwt/jwt-refresh-token.module';
|
||||||
|
import { UsersAuthModule } from './users/users.module';
|
||||||
|
import { EBITEMP_API_DATASOURCE } from '../database/connections/ebitemp-api/database.constants';
|
||||||
|
|
||||||
|
@Module({
|
||||||
|
imports: [
|
||||||
|
TypeOrmModule.forFeature([AccountsEntity], EBITEMP_API_DATASOURCE),
|
||||||
|
JwtAccessTokenModule,
|
||||||
|
JwtRefreshTokenModule,
|
||||||
|
PassportModule,
|
||||||
|
UsersAuthModule,
|
||||||
|
],
|
||||||
|
controllers: [AuthController],
|
||||||
|
providers: [
|
||||||
|
{
|
||||||
|
provide: APP_GUARD,
|
||||||
|
useFactory: (reflector) => new JwtAuthGuard(reflector),
|
||||||
|
inject: [Reflector],
|
||||||
|
},
|
||||||
|
AuthService,
|
||||||
|
JwtAccessTokenAuthStrategy,
|
||||||
|
JwtRefreshTokenAuthStrategy,
|
||||||
|
],
|
||||||
|
})
|
||||||
|
export class AppAuthModule {}
|
75
apps/ebitemp-api/src/modules/auth/auth.service.ts
Normal file
@ -0,0 +1,75 @@
|
|||||||
|
import { Inject, Injectable, Logger, UnauthorizedException } from '@nestjs/common';
|
||||||
|
import { JwtService, JwtSignOptions } from '@nestjs/jwt';
|
||||||
|
import * as bcrypt from 'bcrypt';
|
||||||
|
import dayjs from 'dayjs';
|
||||||
|
import { isEmpty } from 'lodash';
|
||||||
|
import { AccountsEntity } from '../database/connections/ebitemp-api/entities';
|
||||||
|
import { TokenPayload } from './constants/token-payload.interface';
|
||||||
|
import { ACCESS_TOKEN_JWT_SERVICE } from './strategies/jwt/jwt-access-token.module';
|
||||||
|
import { REFRESH_TOKEN_JWT_SERVICE } from './strategies/jwt/jwt-refresh-token.module';
|
||||||
|
import { UsersAuthService } from './users/users-auth.service';
|
||||||
|
|
||||||
|
@Injectable()
|
||||||
|
export class AuthService {
|
||||||
|
private readonly logger = new Logger(AuthService.name);
|
||||||
|
|
||||||
|
constructor(
|
||||||
|
private readonly usersAuthService: UsersAuthService,
|
||||||
|
@Inject(ACCESS_TOKEN_JWT_SERVICE)
|
||||||
|
private readonly accessTokenJwtService: JwtService,
|
||||||
|
@Inject(REFRESH_TOKEN_JWT_SERVICE)
|
||||||
|
private readonly refreshTokenJwtService: JwtService,
|
||||||
|
) {}
|
||||||
|
|
||||||
|
public async signJwts(account: AccountsEntity) {
|
||||||
|
const { token: accessToken, exp: accessTokenExp } = await this.getAccessToken(account);
|
||||||
|
const { token: refreshToken, exp: refreshTokenExp } = await this.getRefreshToken(account);
|
||||||
|
|
||||||
|
return {
|
||||||
|
accessToken: accessToken,
|
||||||
|
accessTokenExp: dayjs.unix(accessTokenExp).toJSON(),
|
||||||
|
refreshToken: refreshToken,
|
||||||
|
refreshTokenExp: dayjs.unix(refreshTokenExp).toJSON(),
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
public async getAccessToken(account: AccountsEntity, options?: JwtSignOptions) {
|
||||||
|
const payload: TokenPayload = {
|
||||||
|
username: account.username,
|
||||||
|
sub: account.id,
|
||||||
|
};
|
||||||
|
const token = await this.accessTokenJwtService.signAsync(payload, options);
|
||||||
|
const exp = this.accessTokenJwtService.decode<{ exp: number }>(token).exp;
|
||||||
|
return { token, exp };
|
||||||
|
}
|
||||||
|
|
||||||
|
public async getRefreshToken(account: AccountsEntity, options?: JwtSignOptions) {
|
||||||
|
const payload: TokenPayload = {
|
||||||
|
username: account.username,
|
||||||
|
sub: account.id,
|
||||||
|
};
|
||||||
|
const token = await this.refreshTokenJwtService.signAsync(payload, options);
|
||||||
|
await this.usersAuthService.setCurrentRefreshTokenHash(account.id, token);
|
||||||
|
const exp = this.refreshTokenJwtService.decode<{ exp: number }>(token).exp;
|
||||||
|
return { token, exp };
|
||||||
|
}
|
||||||
|
|
||||||
|
public async getAuthenticatedUser(username: string, password: string): Promise<AccountsEntity> {
|
||||||
|
try {
|
||||||
|
const account = await this.usersAuthService.getUserByUsername(username);
|
||||||
|
if (!account) throw new UnauthorizedException(`Username not found`);
|
||||||
|
await this.verifyPassword(password, account.password);
|
||||||
|
return account;
|
||||||
|
} catch (error) {
|
||||||
|
throw new UnauthorizedException(`Wrong credentials`);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private async verifyPassword(plainTextPassword: string, hashedPassword: string | null) {
|
||||||
|
const isPasswordMatching =
|
||||||
|
hashedPassword && !isEmpty(hashedPassword) ? await bcrypt.compare(plainTextPassword, hashedPassword) : null;
|
||||||
|
if (!isPasswordMatching) {
|
||||||
|
throw new UnauthorizedException(`Wrong password`);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,8 @@
|
|||||||
|
import { createParamDecorator, ExecutionContext } from '@nestjs/common';
|
||||||
|
import { RequestWithUser } from './constants/request-with-user';
|
||||||
|
|
||||||
|
export const AuthenticatedUser = createParamDecorator((data: unknown, ctx: ExecutionContext) => {
|
||||||
|
const request = ctx.switchToHttp().getRequest<RequestWithUser>();
|
||||||
|
|
||||||
|
return request.user;
|
||||||
|
});
|
@ -0,0 +1,6 @@
|
|||||||
|
import { FastifyRequest } from 'fastify';
|
||||||
|
import { AccountsEntity } from '../../database/connections/ebitemp-api/entities';
|
||||||
|
|
||||||
|
export interface RequestWithUser extends FastifyRequest {
|
||||||
|
user: AccountsEntity;
|
||||||
|
}
|
@ -0,0 +1,6 @@
|
|||||||
|
export interface TokenPayload {
|
||||||
|
username: string;
|
||||||
|
sub: number;
|
||||||
|
iat?: number;
|
||||||
|
exp?: number;
|
||||||
|
}
|
@ -0,0 +1,31 @@
|
|||||||
|
import { Inject, Injectable, UnauthorizedException } from '@nestjs/common';
|
||||||
|
import { PassportStrategy } from '@nestjs/passport';
|
||||||
|
import { FastifyRequest } from 'fastify';
|
||||||
|
import { ClsService } from 'nestjs-cls';
|
||||||
|
import { ExtractJwt, Strategy } from 'passport-jwt';
|
||||||
|
import { AppClsStore } from '../../../cls/cls.interface';
|
||||||
|
import { type AuthConfig, authConfig } from '../../auth.config';
|
||||||
|
import { TokenPayload } from '../../constants/token-payload.interface';
|
||||||
|
import { UsersAuthService } from '../../users/users-auth.service';
|
||||||
|
|
||||||
|
@Injectable()
|
||||||
|
export class JwtAccessTokenAuthStrategy extends PassportStrategy(Strategy, 'jwt-access-token') {
|
||||||
|
constructor(
|
||||||
|
@Inject(authConfig.KEY) authConfig: AuthConfig,
|
||||||
|
private readonly cls: ClsService<AppClsStore>,
|
||||||
|
private readonly userAuthService: UsersAuthService,
|
||||||
|
) {
|
||||||
|
super({
|
||||||
|
jwtFromRequest: ExtractJwt.fromAuthHeaderAsBearerToken(),
|
||||||
|
secretOrKey: authConfig.accessToken.secret,
|
||||||
|
passReqToCallback: true,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
async validate(request: FastifyRequest, payload: TokenPayload) {
|
||||||
|
const account = await this.userAuthService.getUserById(payload.sub);
|
||||||
|
if (!account) throw new UnauthorizedException('Access Token Guard');
|
||||||
|
this.cls.set('account', account);
|
||||||
|
return account;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,30 @@
|
|||||||
|
import { Module } from '@nestjs/common';
|
||||||
|
import { JwtService, JwtModule as NestJwtModule } from '@nestjs/jwt';
|
||||||
|
import { authConfig, AuthConfig } from '../../auth.config';
|
||||||
|
import { ConfigModule } from '@nestjs/config';
|
||||||
|
|
||||||
|
export const ACCESS_TOKEN_JWT_SERVICE = Symbol('ACCESS_TOKEN_JWT_SERVICE');
|
||||||
|
const accessTokenJwtProvider = {
|
||||||
|
provide: ACCESS_TOKEN_JWT_SERVICE,
|
||||||
|
useFactory: (jwtService: JwtService) => jwtService,
|
||||||
|
inject: [JwtService],
|
||||||
|
};
|
||||||
|
|
||||||
|
@Module({
|
||||||
|
imports: [
|
||||||
|
ConfigModule.forFeature(authConfig),
|
||||||
|
NestJwtModule.registerAsync({
|
||||||
|
imports: [...authConfig.asProvider().imports],
|
||||||
|
useFactory: async (authConfig: AuthConfig) => ({
|
||||||
|
secret: authConfig.accessToken.secret,
|
||||||
|
signOptions: {
|
||||||
|
expiresIn: `${authConfig.accessToken.expTimeInSecs}s`,
|
||||||
|
},
|
||||||
|
}),
|
||||||
|
inject: [authConfig.KEY],
|
||||||
|
}),
|
||||||
|
],
|
||||||
|
providers: [accessTokenJwtProvider],
|
||||||
|
exports: [ConfigModule, accessTokenJwtProvider],
|
||||||
|
})
|
||||||
|
export class JwtAccessTokenModule {}
|
@ -0,0 +1,39 @@
|
|||||||
|
import { applyDecorators, ExecutionContext, SetMetadata } from '@nestjs/common';
|
||||||
|
import { Reflector } from '@nestjs/core';
|
||||||
|
import { AuthGuard } from '@nestjs/passport';
|
||||||
|
import { OpenAPIObject } from '@nestjs/swagger';
|
||||||
|
|
||||||
|
export const IS_PUBLIC_KEY = 'isPublic';
|
||||||
|
export const Public = (keepSecurity: boolean = false) => {
|
||||||
|
const decorators = [SetMetadata(IS_PUBLIC_KEY, true)];
|
||||||
|
if (!keepSecurity) decorators.push(SetMetadata('swagger/apiSecurity', ['public']));
|
||||||
|
return applyDecorators(...decorators);
|
||||||
|
};
|
||||||
|
|
||||||
|
export const patchPublicDecoratorSupport = (document: OpenAPIObject) => {
|
||||||
|
Object.values(document.paths).forEach((path: any) => {
|
||||||
|
Object.values(path).forEach((method: any) => {
|
||||||
|
if (Array.isArray(method.security) && method.security.includes('public')) {
|
||||||
|
method.security = [];
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
return document;
|
||||||
|
};
|
||||||
|
|
||||||
|
export class JwtAuthGuard extends AuthGuard('jwt-access-token') {
|
||||||
|
constructor(private reflector: Reflector) {
|
||||||
|
super();
|
||||||
|
}
|
||||||
|
|
||||||
|
canActivate(context: ExecutionContext) {
|
||||||
|
const isPublic = this.reflector.getAllAndOverride<boolean>(IS_PUBLIC_KEY, [
|
||||||
|
context.getHandler(),
|
||||||
|
context.getClass(),
|
||||||
|
]);
|
||||||
|
if (isPublic) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return super.canActivate(context);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,32 @@
|
|||||||
|
import { Inject, Injectable, UnauthorizedException } from '@nestjs/common';
|
||||||
|
import { PassportStrategy } from '@nestjs/passport';
|
||||||
|
import { FastifyRequest } from 'fastify';
|
||||||
|
import { ClsService } from 'nestjs-cls';
|
||||||
|
import { ExtractJwt, Strategy } from 'passport-jwt';
|
||||||
|
import { AppClsStore } from '../../../cls/cls.interface';
|
||||||
|
import { authConfig, type AuthConfig } from '../../auth.config';
|
||||||
|
import { TokenPayload } from '../../constants/token-payload.interface';
|
||||||
|
import { UsersAuthService } from '../../users/users-auth.service';
|
||||||
|
|
||||||
|
@Injectable()
|
||||||
|
export class JwtRefreshTokenAuthStrategy extends PassportStrategy(Strategy, 'jwt-refresh-token') {
|
||||||
|
constructor(
|
||||||
|
@Inject(authConfig.KEY) authConfig: AuthConfig,
|
||||||
|
private readonly cls: ClsService<AppClsStore>,
|
||||||
|
private readonly usersAuthService: UsersAuthService,
|
||||||
|
) {
|
||||||
|
super({
|
||||||
|
jwtFromRequest: ExtractJwt.fromAuthHeaderAsBearerToken(),
|
||||||
|
secretOrKey: authConfig.refreshToken.secret,
|
||||||
|
passReqToCallback: true,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
async validate(request: FastifyRequest, payload: TokenPayload) {
|
||||||
|
const refreshToken = request.headers?.authorization?.replace('Bearer', '')?.trim() ?? '';
|
||||||
|
const account = await this.usersAuthService.getUserByIdAndRefreshTokenPair(payload.sub, refreshToken);
|
||||||
|
if (!account) throw new UnauthorizedException('Refresh Token Guard');
|
||||||
|
this.cls.set('account', account);
|
||||||
|
return account;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,30 @@
|
|||||||
|
import { Module } from '@nestjs/common';
|
||||||
|
import { ConfigModule } from '@nestjs/config';
|
||||||
|
import { JwtService, JwtModule as NestJwtModule } from '@nestjs/jwt';
|
||||||
|
import { authConfig, AuthConfig } from '../../auth.config';
|
||||||
|
|
||||||
|
export const REFRESH_TOKEN_JWT_SERVICE = Symbol('REFRESH_TOKEN_JWT_SERVICE');
|
||||||
|
const refreshTokenJwtProvider = {
|
||||||
|
provide: REFRESH_TOKEN_JWT_SERVICE,
|
||||||
|
useFactory: (jwtService: JwtService) => jwtService,
|
||||||
|
inject: [JwtService],
|
||||||
|
};
|
||||||
|
|
||||||
|
@Module({
|
||||||
|
imports: [
|
||||||
|
ConfigModule.forFeature(authConfig),
|
||||||
|
NestJwtModule.registerAsync({
|
||||||
|
imports: [...authConfig.asProvider().imports],
|
||||||
|
useFactory: async (authConfig: AuthConfig) => ({
|
||||||
|
secret: authConfig.refreshToken.secret,
|
||||||
|
signOptions: {
|
||||||
|
expiresIn: `${authConfig.refreshToken.expTimeInSecs}s`,
|
||||||
|
},
|
||||||
|
}),
|
||||||
|
inject: [authConfig.KEY],
|
||||||
|
}),
|
||||||
|
],
|
||||||
|
providers: [refreshTokenJwtProvider],
|
||||||
|
exports: [ConfigModule, refreshTokenJwtProvider],
|
||||||
|
})
|
||||||
|
export class JwtRefreshTokenModule {}
|
@ -0,0 +1,3 @@
|
|||||||
|
import { AuthGuard } from '@nestjs/passport';
|
||||||
|
|
||||||
|
export class JwtRefreshGuard extends AuthGuard('jwt-refresh-token') {}
|
@ -0,0 +1,43 @@
|
|||||||
|
import { Injectable } from '@nestjs/common';
|
||||||
|
import { InjectRepository } from '@nestjs/typeorm';
|
||||||
|
import * as argon2 from 'argon2';
|
||||||
|
import { Repository } from 'typeorm';
|
||||||
|
import { AccountsEntity } from '../../database/connections/ebitemp-api/entities';
|
||||||
|
import { EBITEMP_API_DATASOURCE } from '../../database/connections/ebitemp-api/database.constants';
|
||||||
|
|
||||||
|
@Injectable()
|
||||||
|
export class UsersAuthService {
|
||||||
|
constructor(
|
||||||
|
@InjectRepository(AccountsEntity, EBITEMP_API_DATASOURCE)
|
||||||
|
private readonly accountsRepository: Repository<AccountsEntity>,
|
||||||
|
) {}
|
||||||
|
|
||||||
|
async getUserById(accountId: number) {
|
||||||
|
return await this.accountsRepository.findOne({
|
||||||
|
relations: { profili: { ruolo: true } },
|
||||||
|
where: { id: accountId },
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
async getUserByUsername(username: string) {
|
||||||
|
return await this.accountsRepository.findOne({
|
||||||
|
relations: { profili: { ruolo: true } },
|
||||||
|
where: { username: username },
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
async getUserByIdAndRefreshTokenPair(accountId: number, refreshToken: string) {
|
||||||
|
const accountById = await this.getUserById(accountId);
|
||||||
|
if (!accountById?.ultimoHashRefreshToken) return null;
|
||||||
|
|
||||||
|
const isRefreshTokenMatching = await argon2.verify(accountById.ultimoHashRefreshToken, refreshToken);
|
||||||
|
return isRefreshTokenMatching ? accountById : null;
|
||||||
|
}
|
||||||
|
|
||||||
|
async setCurrentRefreshTokenHash(accountId: number, refreshToken: string | null) {
|
||||||
|
const hash = refreshToken ? await argon2.hash(refreshToken) : null;
|
||||||
|
await this.accountsRepository.update(accountId, {
|
||||||
|
ultimoHashRefreshToken: hash,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
13
apps/ebitemp-api/src/modules/auth/users/users.module.ts
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
import { Module } from '@nestjs/common';
|
||||||
|
import { TypeOrmModule } from '@nestjs/typeorm';
|
||||||
|
import { UsersAuthService } from './users-auth.service';
|
||||||
|
import { AccountsEntity } from '../../database/connections/ebitemp-api/entities';
|
||||||
|
import { EBITEMP_API_DATASOURCE } from '../../database/connections/ebitemp-api/database.constants';
|
||||||
|
|
||||||
|
@Module({
|
||||||
|
imports: [TypeOrmModule.forFeature([AccountsEntity], EBITEMP_API_DATASOURCE)],
|
||||||
|
controllers: [],
|
||||||
|
providers: [UsersAuthService],
|
||||||
|
exports: [UsersAuthService],
|
||||||
|
})
|
||||||
|
export class UsersAuthModule {}
|
6
apps/ebitemp-api/src/modules/cls/cls.interface.ts
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
import { ClsStore } from 'nestjs-cls';
|
||||||
|
import { AccountsEntity } from '../database/connections/ebitemp-api';
|
||||||
|
|
||||||
|
export interface AppClsStore extends ClsStore {
|
||||||
|
account: AccountsEntity | null;
|
||||||
|
}
|
16
apps/ebitemp-api/src/modules/cls/cls.module.ts
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
import { Module } from '@nestjs/common';
|
||||||
|
import { ClsModule } from 'nestjs-cls';
|
||||||
|
|
||||||
|
@Module({
|
||||||
|
imports: [
|
||||||
|
ClsModule.forRoot({
|
||||||
|
global: true,
|
||||||
|
middleware: {
|
||||||
|
mount: true,
|
||||||
|
},
|
||||||
|
}),
|
||||||
|
],
|
||||||
|
providers: [],
|
||||||
|
exports: [ClsModule],
|
||||||
|
})
|
||||||
|
export class AppClsModule {}
|
14
apps/ebitemp-api/src/modules/config/config.module.ts
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
import { Module } from '@nestjs/common';
|
||||||
|
import { ConfigModule } from '@nestjs/config';
|
||||||
|
import { localConfig } from './local.config';
|
||||||
|
|
||||||
|
@Module({
|
||||||
|
imports: [
|
||||||
|
ConfigModule.forRoot({
|
||||||
|
isGlobal: true,
|
||||||
|
envFilePath: ['.env', '../../.env'],
|
||||||
|
load: [localConfig],
|
||||||
|
}),
|
||||||
|
],
|
||||||
|
})
|
||||||
|
export class AppConfigModule {}
|
19
apps/ebitemp-api/src/modules/config/local.config.ts
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
import coerceRecordTypes from './utils/coerce-record-types';
|
||||||
|
import { registerAs } from '@nestjs/config';
|
||||||
|
import { z } from 'zod';
|
||||||
|
|
||||||
|
export const localSchema = z.object({
|
||||||
|
production: z.boolean(),
|
||||||
|
port: z.number().optional(),
|
||||||
|
});
|
||||||
|
export type LocalConfig = z.infer<typeof localSchema>;
|
||||||
|
|
||||||
|
export const localConfig = registerAs('local', () => {
|
||||||
|
const env = coerceRecordTypes(process.env);
|
||||||
|
|
||||||
|
const config: LocalConfig = localSchema.strict().parse({
|
||||||
|
production: env['PRODUCTION'],
|
||||||
|
port: env['PORT'],
|
||||||
|
});
|
||||||
|
return config;
|
||||||
|
});
|
@ -0,0 +1,11 @@
|
|||||||
|
import { clone, each } from 'lodash';
|
||||||
|
|
||||||
|
export default (raw: Record<string, any>): Record<string, string | number | boolean | undefined> => {
|
||||||
|
raw = clone(raw);
|
||||||
|
return each(raw, (value, key) => {
|
||||||
|
if (value === 'true') raw[key] = true;
|
||||||
|
if (value === 'false') raw[key] = false;
|
||||||
|
if (value === 'null') raw[key] = null;
|
||||||
|
if (!isNaN(Number(value))) raw[key] = Number(value);
|
||||||
|
});
|
||||||
|
};
|
@ -0,0 +1,10 @@
|
|||||||
|
import coerceRecordTypes from '../../../config/utils/coerce-record-types';
|
||||||
|
import { databaseConfigFactory, rawDatabaseSchema } from '../../utils/database-config';
|
||||||
|
|
||||||
|
const env = coerceRecordTypes(process.env);
|
||||||
|
const envParsed = rawDatabaseSchema.strict().parse({
|
||||||
|
connectionString: env['DATABASE_EBITEMPAPI_CONNECTION_STRING'],
|
||||||
|
secure: env['DATABASE_EBITEMPAPI_SECURE'],
|
||||||
|
});
|
||||||
|
|
||||||
|
export const databaseConfig = databaseConfigFactory(envParsed);
|
@ -0,0 +1 @@
|
|||||||
|
export const EBITEMP_API_DATASOURCE = 'EbitempApi';
|
@ -0,0 +1,32 @@
|
|||||||
|
import { Module } from '@nestjs/common';
|
||||||
|
import { ConfigModule } from '@nestjs/config';
|
||||||
|
import { TypeOrmModule } from '@nestjs/typeorm';
|
||||||
|
import { DatabaseConfig } from '../../utils/database-config';
|
||||||
|
import { typeormTransactionalDataSourceFactory } from '../../utils/typeorm-data-source-factory';
|
||||||
|
import { typeormEntitiesFromImport } from '../../utils/typeorm-import-entities';
|
||||||
|
import { typeormModuleOptionsFactory } from '../../utils/typeorm-module-options-factory';
|
||||||
|
import { databaseConfig } from './database.config';
|
||||||
|
import { EBITEMP_API_DATASOURCE } from './database.constants';
|
||||||
|
|
||||||
|
@Module({
|
||||||
|
imports: [
|
||||||
|
ConfigModule.forFeature(databaseConfig),
|
||||||
|
TypeOrmModule.forRootAsync({
|
||||||
|
imports: databaseConfig.asProvider().imports,
|
||||||
|
name: EBITEMP_API_DATASOURCE,
|
||||||
|
dataSourceFactory: typeormTransactionalDataSourceFactory(EBITEMP_API_DATASOURCE),
|
||||||
|
useFactory: async (dbConfig: DatabaseConfig) => {
|
||||||
|
const config = await typeormModuleOptionsFactory(
|
||||||
|
dbConfig,
|
||||||
|
await typeormEntitiesFromImport(await import('./index.js')),
|
||||||
|
EBITEMP_API_DATASOURCE,
|
||||||
|
);
|
||||||
|
return config;
|
||||||
|
},
|
||||||
|
inject: [databaseConfig.KEY],
|
||||||
|
}),
|
||||||
|
],
|
||||||
|
providers: [],
|
||||||
|
exports: [TypeOrmModule],
|
||||||
|
})
|
||||||
|
export class EbitempApiDatabaseModule {}
|
@ -0,0 +1,51 @@
|
|||||||
|
import { toZod } from 'tozod';
|
||||||
|
import { Column, Entity, Index, OneToMany } from 'typeorm';
|
||||||
|
import { z } from 'zod';
|
||||||
|
import { ProfiliEntity, ProfiliEntitySchema } from './profili.entity';
|
||||||
|
|
||||||
|
@Index('pk_accounts', ['id'], { unique: true })
|
||||||
|
@Entity('accounts')
|
||||||
|
export class AccountsEntity {
|
||||||
|
@Column('int', { primary: true, name: 'id' })
|
||||||
|
id!: number;
|
||||||
|
|
||||||
|
@Column('varchar', { name: 'username', unique: true, length: 255 })
|
||||||
|
username!: string;
|
||||||
|
|
||||||
|
@Column('varchar', { name: 'password', nullable: true, length: 255 })
|
||||||
|
password!: string | null;
|
||||||
|
|
||||||
|
@Column('varchar', { name: 'nome', length: 255 })
|
||||||
|
nome!: string;
|
||||||
|
|
||||||
|
@Column('date', { name: 'data_creazione' })
|
||||||
|
dataCreazione!: Date;
|
||||||
|
|
||||||
|
@Column('date', { name: 'data_scadenza', nullable: true })
|
||||||
|
dataScadenza!: Date | null;
|
||||||
|
|
||||||
|
@Column('varchar', {
|
||||||
|
name: 'ultimo_hash_refresh_token',
|
||||||
|
nullable: true,
|
||||||
|
length: 1024,
|
||||||
|
})
|
||||||
|
ultimoHashRefreshToken!: string | null;
|
||||||
|
|
||||||
|
@OneToMany(() => ProfiliEntity, (profiliEntity) => profiliEntity.account)
|
||||||
|
profili!: ProfiliEntity[];
|
||||||
|
|
||||||
|
constructor(init?: Partial<AccountsEntity>) {
|
||||||
|
Object.assign(this, init);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export const AccountsEntitySchema: toZod<AccountsEntity> = z.late.object(() => ({
|
||||||
|
id: z.number().finite(),
|
||||||
|
username: z.string().nonempty(),
|
||||||
|
password: z.string().nonempty().nullable(),
|
||||||
|
nome: z.string().nonempty(),
|
||||||
|
dataCreazione: z.date(),
|
||||||
|
dataScadenza: z.date().nullable(),
|
||||||
|
ultimoHashRefreshToken: z.string().nonempty().nullable(),
|
||||||
|
profili: z.array(ProfiliEntitySchema),
|
||||||
|
}));
|
@ -0,0 +1,25 @@
|
|||||||
|
import { Column, Entity, Index, OneToMany, PrimaryGeneratedColumn } from 'typeorm';
|
||||||
|
import { ApiClientInvocazioniEntity } from './api_client_invocazioni.entity';
|
||||||
|
|
||||||
|
@Index('pk_api_client', ['id'], { unique: true })
|
||||||
|
@Entity('api_client')
|
||||||
|
export class ApiClientEntity {
|
||||||
|
@PrimaryGeneratedColumn({ type: 'int', name: 'id' })
|
||||||
|
id!: number;
|
||||||
|
|
||||||
|
@Column('varchar', { name: 'nome', nullable: true, length: 255 })
|
||||||
|
nome!: string | null;
|
||||||
|
|
||||||
|
@Column('varchar', { name: 'descrizione', nullable: true, length: 255 })
|
||||||
|
descrizione!: string | null;
|
||||||
|
|
||||||
|
@Column('varchar', { name: 'base_url', length: 2000 })
|
||||||
|
baseUrl!: string;
|
||||||
|
|
||||||
|
@OneToMany(() => ApiClientInvocazioniEntity, (apiClientInvocazioniEntity) => apiClientInvocazioniEntity.client)
|
||||||
|
invocazioni!: ApiClientInvocazioniEntity[];
|
||||||
|
|
||||||
|
constructor(init?: Partial<ApiClientEntity>) {
|
||||||
|
Object.assign(this, init);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,41 @@
|
|||||||
|
import { Column, Entity, Index, JoinColumn, ManyToOne, PrimaryGeneratedColumn } from 'typeorm';
|
||||||
|
import { ApiClientEntity } from './api_client.entity';
|
||||||
|
|
||||||
|
@Index('pk_api_client_invocazioni', ['id'], { unique: true })
|
||||||
|
@Entity('api_client_invocazioni')
|
||||||
|
export class ApiClientInvocazioniEntity {
|
||||||
|
@PrimaryGeneratedColumn({ type: 'int', name: 'id' })
|
||||||
|
id!: number;
|
||||||
|
|
||||||
|
@Column('int', { name: 'id_client' })
|
||||||
|
idClient!: number;
|
||||||
|
|
||||||
|
@Column('varchar', { name: 'percorso', length: 2000 })
|
||||||
|
percorso!: string;
|
||||||
|
|
||||||
|
@Column('varchar', { name: 'metodo', length: 7 })
|
||||||
|
metodo!: string;
|
||||||
|
|
||||||
|
@Column('datetime', { name: 'timestamp' })
|
||||||
|
timestamp!: Date;
|
||||||
|
|
||||||
|
@Column('varchar', { name: 'richiesta', nullable: true })
|
||||||
|
richiesta!: string | null;
|
||||||
|
|
||||||
|
@Column('varchar', { name: 'risposta' })
|
||||||
|
risposta!: string;
|
||||||
|
|
||||||
|
@Column('varchar', { name: 'errori', nullable: true })
|
||||||
|
errori!: string | null;
|
||||||
|
|
||||||
|
@Column('bit', { name: 'flag_errore' })
|
||||||
|
flagErrore!: boolean;
|
||||||
|
|
||||||
|
@ManyToOne(() => ApiClientEntity, (apiClientEntity) => apiClientEntity.invocazioni)
|
||||||
|
@JoinColumn([{ name: 'id_client', referencedColumnName: 'id' }])
|
||||||
|
client!: ApiClientEntity;
|
||||||
|
|
||||||
|
constructor(init?: Partial<ApiClientInvocazioniEntity>) {
|
||||||
|
Object.assign(this, init);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,25 @@
|
|||||||
|
import { Column, Entity, Index, OneToMany, PrimaryGeneratedColumn } from 'typeorm';
|
||||||
|
import { ApiEndpointInvocazioniEntity } from './api_endpoint_invocazioni.entity';
|
||||||
|
|
||||||
|
@Index('pk_api_endpoint', ['id'], { unique: true })
|
||||||
|
@Entity('api_endpoint')
|
||||||
|
export class ApiEndpointEntity {
|
||||||
|
@PrimaryGeneratedColumn({ type: 'int', name: 'id' })
|
||||||
|
id!: number;
|
||||||
|
|
||||||
|
@Column('varchar', { name: 'percorso', length: 2000 })
|
||||||
|
percorso!: string;
|
||||||
|
|
||||||
|
@Column('varchar', { name: 'metodo', length: 7 })
|
||||||
|
metodo!: string;
|
||||||
|
|
||||||
|
@OneToMany(
|
||||||
|
() => ApiEndpointInvocazioniEntity,
|
||||||
|
(apiEndpointInvocazioniEntity) => apiEndpointInvocazioniEntity.endpoint,
|
||||||
|
)
|
||||||
|
invocazioni!: ApiEndpointInvocazioniEntity[];
|
||||||
|
|
||||||
|
constructor(init?: Partial<ApiEndpointEntity>) {
|
||||||
|
Object.assign(this, init);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,40 @@
|
|||||||
|
import { Column, Entity, Index, JoinColumn, ManyToOne, PrimaryGeneratedColumn } from 'typeorm';
|
||||||
|
import { AccountsEntity } from './accounts.entity';
|
||||||
|
import { ApiEndpointEntity } from './api_endpoint.entity';
|
||||||
|
|
||||||
|
@Index('pk_api_endpoint_invocazioni', ['id'], { unique: true })
|
||||||
|
@Entity('api_endpoint_invocazioni')
|
||||||
|
export class ApiEndpointInvocazioniEntity {
|
||||||
|
@PrimaryGeneratedColumn({ type: 'int', name: 'id' })
|
||||||
|
id!: number;
|
||||||
|
|
||||||
|
@Column('int', { name: 'id_account' })
|
||||||
|
idAccount!: number;
|
||||||
|
|
||||||
|
@Column('int', { name: 'id_endpoint' })
|
||||||
|
idEndpoint!: number;
|
||||||
|
|
||||||
|
@Column('datetime', { name: 'timestamp' })
|
||||||
|
timestamp!: Date;
|
||||||
|
|
||||||
|
@Column('varchar', { name: 'richiesta' })
|
||||||
|
richiesta!: string;
|
||||||
|
|
||||||
|
@Column('varchar', { name: 'risposta' })
|
||||||
|
risposta!: string;
|
||||||
|
|
||||||
|
@Column('bit', { name: 'flag_errore' })
|
||||||
|
flagErrore!: boolean;
|
||||||
|
|
||||||
|
@ManyToOne(() => ApiEndpointEntity, (apiEndpointEntity) => apiEndpointEntity.invocazioni)
|
||||||
|
@JoinColumn([{ name: 'id_endpoint', referencedColumnName: 'id' }])
|
||||||
|
endpoint!: ApiEndpointEntity;
|
||||||
|
|
||||||
|
@ManyToOne(() => AccountsEntity)
|
||||||
|
@JoinColumn([{ name: 'id_account', referencedColumnName: 'id' }])
|
||||||
|
account!: AccountsEntity;
|
||||||
|
|
||||||
|
constructor(init?: Partial<ApiEndpointInvocazioniEntity>) {
|
||||||
|
Object.assign(this, init);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,8 @@
|
|||||||
|
export * from './accounts.entity';
|
||||||
|
export * from './api_client.entity';
|
||||||
|
export * from './api_client_invocazioni.entity';
|
||||||
|
export * from './api_endpoint.entity';
|
||||||
|
export * from './api_endpoint_invocazioni.entity';
|
||||||
|
export * from './profili.entity';
|
||||||
|
export * from './ruoli.entity';
|
||||||
|
export * from './tipi_jobs.entity';
|
@ -0,0 +1,38 @@
|
|||||||
|
import { Column, Entity, Index, JoinColumn, ManyToOne } from 'typeorm';
|
||||||
|
import { AccountsEntity, AccountsEntitySchema } from './accounts.entity';
|
||||||
|
import { RuoliEntity, RuoliEntitySchema } from './ruoli.entity';
|
||||||
|
import { toZod } from 'tozod';
|
||||||
|
import { z } from 'zod';
|
||||||
|
|
||||||
|
@Index('pk_profili', ['id'], { unique: true })
|
||||||
|
@Entity('profili')
|
||||||
|
export class ProfiliEntity {
|
||||||
|
@Column('int', { primary: true, name: 'id' })
|
||||||
|
id!: number;
|
||||||
|
|
||||||
|
@Column('int', { name: 'id_account', unique: true })
|
||||||
|
idAccount!: number;
|
||||||
|
|
||||||
|
@Column('int', { name: 'id_ruolo', unique: true })
|
||||||
|
idRuolo!: number;
|
||||||
|
|
||||||
|
@ManyToOne(() => AccountsEntity, (accountsEntity) => accountsEntity.profili)
|
||||||
|
@JoinColumn([{ name: 'id_account', referencedColumnName: 'id' }])
|
||||||
|
account!: AccountsEntity;
|
||||||
|
|
||||||
|
@ManyToOne(() => RuoliEntity, (ruoliEntity) => ruoliEntity.profili)
|
||||||
|
@JoinColumn([{ name: 'id_ruolo', referencedColumnName: 'id' }])
|
||||||
|
ruolo!: RuoliEntity;
|
||||||
|
|
||||||
|
constructor(init?: Partial<ProfiliEntity>) {
|
||||||
|
Object.assign(this, init);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export const ProfiliEntitySchema: toZod<ProfiliEntity> = z.late.object(() => ({
|
||||||
|
id: z.number().finite(),
|
||||||
|
idAccount: AccountsEntitySchema.shape.id,
|
||||||
|
idRuolo: RuoliEntitySchema.shape.id,
|
||||||
|
account: AccountsEntitySchema,
|
||||||
|
ruolo: RuoliEntitySchema,
|
||||||
|
}));
|
@ -0,0 +1,31 @@
|
|||||||
|
import { Column, Entity, Index, OneToMany } from 'typeorm';
|
||||||
|
import { ProfiliEntity, ProfiliEntitySchema } from './profili.entity';
|
||||||
|
import { toZod } from 'tozod';
|
||||||
|
import { z } from 'zod';
|
||||||
|
|
||||||
|
@Index('pk_ruoli', ['id'], { unique: true })
|
||||||
|
@Entity('ruoli')
|
||||||
|
export class RuoliEntity {
|
||||||
|
@Column('int', { primary: true, name: 'id' })
|
||||||
|
id!: number;
|
||||||
|
|
||||||
|
@Column('varchar', { name: 'nome', unique: true, length: 255 })
|
||||||
|
nome!: string;
|
||||||
|
|
||||||
|
@Column('varchar', { name: 'descrizione', length: 255 })
|
||||||
|
descrizione!: string;
|
||||||
|
|
||||||
|
@OneToMany(() => ProfiliEntity, (profiliEntity) => profiliEntity.ruolo)
|
||||||
|
profili!: ProfiliEntity[];
|
||||||
|
|
||||||
|
constructor(init?: Partial<RuoliEntity>) {
|
||||||
|
Object.assign(this, init);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export const RuoliEntitySchema: toZod<RuoliEntity> = z.late.object(() => ({
|
||||||
|
id: z.number().finite(),
|
||||||
|
nome: z.string().nonempty(),
|
||||||
|
descrizione: z.string().nonempty(),
|
||||||
|
profili: z.array(ProfiliEntitySchema),
|
||||||
|
}));
|
@ -0,0 +1,45 @@
|
|||||||
|
import { Column, Entity, Index } from 'typeorm';
|
||||||
|
import { Enum, Enumify } from '../../../../enumify/enumify';
|
||||||
|
|
||||||
|
export class InviaMailSeErrori {
|
||||||
|
@Column('bit', { name: 'flag', default: () => '(0)' })
|
||||||
|
flagAttivo!: boolean;
|
||||||
|
|
||||||
|
@Column('varchar', { name: 'oggetto', nullable: true, length: 255 })
|
||||||
|
oggetto!: string | null;
|
||||||
|
|
||||||
|
@Column('varchar', { name: 'destinatari', nullable: true, length: 255 })
|
||||||
|
destinatari!: string | null;
|
||||||
|
|
||||||
|
@Column('varchar', { name: 'cc', nullable: true, length: 255 })
|
||||||
|
cc!: string | null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Index('pk_tipi_jobs', ['id'], { unique: true })
|
||||||
|
@Entity('tipi_jobs')
|
||||||
|
export class TipiJobsEntity extends Enumify {
|
||||||
|
static _ = TipiJobsEntity.closeEnum();
|
||||||
|
|
||||||
|
@Column('int', { primary: true, name: 'id' })
|
||||||
|
declare id: number;
|
||||||
|
|
||||||
|
@Column('varchar', { name: 'nome', length: 50 })
|
||||||
|
declare nome: string;
|
||||||
|
|
||||||
|
@Column('varchar', { name: 'descrizione', nullable: true, length: 255 })
|
||||||
|
descrizione!: string | null;
|
||||||
|
|
||||||
|
@Column(() => InviaMailSeErrori, { prefix: 'invia_mail_se_errori' })
|
||||||
|
inviaMailSeErrori!: InviaMailSeErrori;
|
||||||
|
|
||||||
|
@Column('bit', { name: 'flag_attivo', default: () => '(0)' })
|
||||||
|
flagAttivo!: boolean;
|
||||||
|
|
||||||
|
@Column('varchar', { name: 'pattern_cron', length: 20 })
|
||||||
|
patternCron!: string;
|
||||||
|
|
||||||
|
public constructor(id: number, nome: string, patternCron: string) {
|
||||||
|
super(id, nome);
|
||||||
|
this.patternCron = patternCron;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1 @@
|
|||||||
|
export * from './entities';
|
@ -0,0 +1,10 @@
|
|||||||
|
import coerceRecordTypes from '../../../config/utils/coerce-record-types';
|
||||||
|
import { databaseConfigFactory, rawDatabaseSchema } from '../../utils/database-config';
|
||||||
|
|
||||||
|
const env = coerceRecordTypes(process.env);
|
||||||
|
const envParsed = rawDatabaseSchema.strict().parse({
|
||||||
|
connectionString: env['DATABASE_OCEANO_CONNECTION_STRING'],
|
||||||
|
secure: env['DATABASE_OCEANO_SECURE'],
|
||||||
|
});
|
||||||
|
|
||||||
|
export const databaseConfig = databaseConfigFactory(envParsed);
|
@ -0,0 +1 @@
|
|||||||
|
export const OCEANO_DATASOURCE = 'Oceano';
|
@ -0,0 +1,32 @@
|
|||||||
|
import { Module } from '@nestjs/common';
|
||||||
|
import { ConfigModule } from '@nestjs/config';
|
||||||
|
import { TypeOrmModule } from '@nestjs/typeorm';
|
||||||
|
import { DatabaseConfig } from '../../utils/database-config';
|
||||||
|
import { typeormTransactionalDataSourceFactory } from '../../utils/typeorm-data-source-factory';
|
||||||
|
import { typeormEntitiesFromImport } from '../../utils/typeorm-import-entities';
|
||||||
|
import { typeormModuleOptionsFactory } from '../../utils/typeorm-module-options-factory';
|
||||||
|
import { databaseConfig } from './database.config';
|
||||||
|
import { OCEANO_DATASOURCE } from './database.constants';
|
||||||
|
|
||||||
|
@Module({
|
||||||
|
imports: [
|
||||||
|
ConfigModule.forFeature(databaseConfig),
|
||||||
|
TypeOrmModule.forRootAsync({
|
||||||
|
imports: databaseConfig.asProvider().imports,
|
||||||
|
name: OCEANO_DATASOURCE,
|
||||||
|
dataSourceFactory: typeormTransactionalDataSourceFactory(OCEANO_DATASOURCE),
|
||||||
|
useFactory: async (dbConfig: DatabaseConfig) => {
|
||||||
|
const config = await typeormModuleOptionsFactory(
|
||||||
|
dbConfig,
|
||||||
|
await typeormEntitiesFromImport(await import('./index.js')),
|
||||||
|
OCEANO_DATASOURCE,
|
||||||
|
);
|
||||||
|
return config;
|
||||||
|
},
|
||||||
|
inject: [databaseConfig.KEY],
|
||||||
|
}),
|
||||||
|
],
|
||||||
|
providers: [],
|
||||||
|
exports: [TypeOrmModule],
|
||||||
|
})
|
||||||
|
export class OceanoDatabaseModule {}
|
@ -0,0 +1,20 @@
|
|||||||
|
import { Column, Entity, Index, JoinColumn, ManyToOne } from 'typeorm';
|
||||||
|
import { ApiLuoghiEntity } from './API_Luoghi.entity';
|
||||||
|
|
||||||
|
@Index('nk_API_CAP_Luoghi', ['codice', 'cap'], { unique: true })
|
||||||
|
@Entity('API_CAP_Luoghi')
|
||||||
|
export class ApiCapLuoghiEntity {
|
||||||
|
@Column('varchar', { primary: true, name: 'codice', length: 5 })
|
||||||
|
codice!: string;
|
||||||
|
|
||||||
|
@Column('varchar', { primary: true, name: 'cap', length: 5 })
|
||||||
|
cap!: string;
|
||||||
|
|
||||||
|
@ManyToOne(() => ApiLuoghiEntity)
|
||||||
|
@JoinColumn([{ name: 'codice', referencedColumnName: 'codice' }])
|
||||||
|
luogo!: ApiLuoghiEntity;
|
||||||
|
|
||||||
|
constructor(init?: Partial<ApiCapLuoghiEntity>) {
|
||||||
|
Object.assign(this, init);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,38 @@
|
|||||||
|
import { Column, Entity, Index, OneToMany } from 'typeorm';
|
||||||
|
import { ApiCapLuoghiEntity } from './API_CAP_Luoghi.entity';
|
||||||
|
import { SocioEntity } from './socio.entity';
|
||||||
|
|
||||||
|
@Index('PK_API_Luoghi', ['codice'], { unique: true })
|
||||||
|
@Entity('API_Luoghi')
|
||||||
|
export class ApiLuoghiEntity {
|
||||||
|
@Column('varchar', { primary: true, name: 'codice', length: 5 })
|
||||||
|
codice!: string;
|
||||||
|
|
||||||
|
@Column('nvarchar', { name: 'comune', nullable: true, length: 255 })
|
||||||
|
comune!: string | null;
|
||||||
|
|
||||||
|
@Column('nvarchar', { name: 'sigla_provincia', nullable: true, length: 5 })
|
||||||
|
siglaProvincia!: string | null;
|
||||||
|
|
||||||
|
@Column('nvarchar', { name: 'provincia', nullable: true, length: 255 })
|
||||||
|
provincia!: string | null;
|
||||||
|
|
||||||
|
@Column('nvarchar', { name: 'codice_regione', nullable: true, length: 5 })
|
||||||
|
codiceRegione!: string | null;
|
||||||
|
|
||||||
|
@Column('nvarchar', { name: 'regione', nullable: true, length: 255 })
|
||||||
|
regione!: string | null;
|
||||||
|
|
||||||
|
@Column('nvarchar', { name: 'codice_stato', nullable: true, length: 5 })
|
||||||
|
codiceStato!: string | null;
|
||||||
|
|
||||||
|
@Column('nvarchar', { name: 'stato', nullable: true, length: 255 })
|
||||||
|
stato!: string | null;
|
||||||
|
|
||||||
|
@Column('int', { name: 'flag_attivo', nullable: true })
|
||||||
|
flagAttivo!: number | null;
|
||||||
|
|
||||||
|
constructor(init?: Partial<ApiLuoghiEntity>) {
|
||||||
|
Object.assign(this, init);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,14 @@
|
|||||||
|
import { Column, Entity, PrimaryColumn } from 'typeorm';
|
||||||
|
|
||||||
|
@Entity('API_Luoghi_Estero')
|
||||||
|
export class ApiLuoghiEsteroEntity {
|
||||||
|
@PrimaryColumn('varchar', { name: 'codice', length: 5 })
|
||||||
|
codice!: string;
|
||||||
|
|
||||||
|
@Column('nvarchar', { name: 'codice_stato', length: 5 })
|
||||||
|
codiceStato!: string;
|
||||||
|
|
||||||
|
constructor(init?: Partial<ApiLuoghiEsteroEntity>) {
|
||||||
|
Object.assign(this, init);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,84 @@
|
|||||||
|
import { Column, Entity, Index, JoinColumn, ManyToOne } from 'typeorm';
|
||||||
|
|
||||||
|
@Index('PK_allegati', ['codiceAllegato'], { unique: true })
|
||||||
|
@Entity('allegati')
|
||||||
|
export class AllegatiEntity {
|
||||||
|
@Column('bigint', { primary: true, name: 'codiceAllegato' })
|
||||||
|
codiceAllegato!: string;
|
||||||
|
|
||||||
|
@Column('int', { name: 'tipoOrigine', nullable: true })
|
||||||
|
tipoOrigine!: number | null;
|
||||||
|
|
||||||
|
@Column('bigint', { name: 'codiceOrigine', nullable: true })
|
||||||
|
codiceOrigine!: string | null;
|
||||||
|
|
||||||
|
@Column('nvarchar', {
|
||||||
|
name: 'descrizioneAllegato',
|
||||||
|
nullable: true,
|
||||||
|
length: 255,
|
||||||
|
})
|
||||||
|
descrizioneAllegato!: string | null;
|
||||||
|
|
||||||
|
@Column('nvarchar', { name: 'dataAllegato', nullable: true, length: 10 })
|
||||||
|
dataAllegato!: string | null;
|
||||||
|
|
||||||
|
@Column('nvarchar', {
|
||||||
|
name: 'cartellaAllegato',
|
||||||
|
nullable: true,
|
||||||
|
length: 2048,
|
||||||
|
})
|
||||||
|
cartellaAllegato!: string | null;
|
||||||
|
|
||||||
|
@Column('nvarchar', { name: 'nomeFileAllegato', nullable: true, length: 255 })
|
||||||
|
nomeFileAllegato!: string | null;
|
||||||
|
|
||||||
|
@Column('ntext', { name: 'noteAllegato', nullable: true })
|
||||||
|
noteAllegato!: string | null;
|
||||||
|
|
||||||
|
@Column('bigint', { name: 'utenteCreazione', nullable: true })
|
||||||
|
utenteCreazione!: string | null;
|
||||||
|
|
||||||
|
@Column('nvarchar', { name: 'dataCreazione', nullable: true, length: 10 })
|
||||||
|
dataCreazione!: string | null;
|
||||||
|
|
||||||
|
@Column('nvarchar', { name: 'oraCreazione', nullable: true, length: 8 })
|
||||||
|
oraCreazione!: string | null;
|
||||||
|
|
||||||
|
@Column('bigint', { name: 'utenteModifica', nullable: true })
|
||||||
|
utenteModifica!: string | null;
|
||||||
|
|
||||||
|
@Column('nvarchar', { name: 'dataModifica', nullable: true, length: 10 })
|
||||||
|
dataModifica!: string | null;
|
||||||
|
|
||||||
|
@Column('nvarchar', { name: 'oraModifica', nullable: true, length: 8 })
|
||||||
|
oraModifica!: string | null;
|
||||||
|
|
||||||
|
@Column('int', { name: 'pubblicatoWEB', nullable: true })
|
||||||
|
pubblicatoWeb!: number | null;
|
||||||
|
|
||||||
|
@Column('int', {
|
||||||
|
name: 'trasferitoWEB',
|
||||||
|
nullable: true,
|
||||||
|
default: () => '(0)',
|
||||||
|
})
|
||||||
|
trasferitoWeb!: number | null;
|
||||||
|
|
||||||
|
@Column('nvarchar', {
|
||||||
|
name: 'dataPubblicazione',
|
||||||
|
nullable: true,
|
||||||
|
length: 10,
|
||||||
|
default: () => "''",
|
||||||
|
})
|
||||||
|
dataPubblicazione!: string | null;
|
||||||
|
|
||||||
|
@Column('bigint', {
|
||||||
|
name: 'codiceProtocolloGenerico',
|
||||||
|
nullable: true,
|
||||||
|
default: () => '(0)',
|
||||||
|
})
|
||||||
|
codiceProtocolloGenerico!: string | null;
|
||||||
|
|
||||||
|
constructor(init?: Partial<AllegatiEntity>) {
|
||||||
|
Object.assign(this, init);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,492 @@
|
|||||||
|
import { Column, Entity, Index, JoinColumn, ManyToOne, OneToMany } from 'typeorm';
|
||||||
|
import { EnteEntity } from './ente.entity';
|
||||||
|
import { SocioContrattoEntity } from './socioContratto.entity';
|
||||||
|
|
||||||
|
@Index('PK_contratto', ['codiceContratto'], { unique: true })
|
||||||
|
@Entity('contratto')
|
||||||
|
export class ContrattoEntity {
|
||||||
|
@Column('bigint', { primary: true, name: 'codiceContratto' })
|
||||||
|
codiceContratto!: string;
|
||||||
|
|
||||||
|
@Column('bigint', { name: 'codiceEnte', nullable: true })
|
||||||
|
codiceEnte!: string | null;
|
||||||
|
|
||||||
|
@Column('nvarchar', { name: 'contratto', nullable: true, length: 255 })
|
||||||
|
contratto!: string | null;
|
||||||
|
|
||||||
|
@Column('nvarchar', { name: 'dataContratto', nullable: true, length: 10 })
|
||||||
|
dataContratto!: string | null;
|
||||||
|
|
||||||
|
@Column('int', { name: 'rinnovoAutomatico', nullable: true })
|
||||||
|
rinnovoAutomatico!: number | null;
|
||||||
|
|
||||||
|
@Column('nvarchar', {
|
||||||
|
name: 'dataDecorrenzaContratto',
|
||||||
|
nullable: true,
|
||||||
|
length: 10,
|
||||||
|
})
|
||||||
|
dataDecorrenzaContratto!: string | null;
|
||||||
|
|
||||||
|
@Column('nvarchar', {
|
||||||
|
name: 'codiceEconomicoEsolver',
|
||||||
|
nullable: true,
|
||||||
|
length: 30,
|
||||||
|
})
|
||||||
|
codiceEconomicoEsolver!: string | null;
|
||||||
|
|
||||||
|
@Column('nvarchar', {
|
||||||
|
name: 'codicePatrimonialeEsolver',
|
||||||
|
nullable: true,
|
||||||
|
length: 30,
|
||||||
|
})
|
||||||
|
codicePatrimonialeEsolver!: string | null;
|
||||||
|
|
||||||
|
@Column('int', { name: 'iscrizioneFamiliariObbligatoria', nullable: true })
|
||||||
|
iscrizioneFamiliariObbligatoria!: number | null;
|
||||||
|
|
||||||
|
@Column('int', {
|
||||||
|
name: 'inizioDecorrenzaNuoveAdesioniAderenti',
|
||||||
|
nullable: true,
|
||||||
|
})
|
||||||
|
inizioDecorrenzaNuoveAdesioniAderenti!: number | null;
|
||||||
|
|
||||||
|
@Column('int', {
|
||||||
|
name: 'inizioDecorrenzaNuoveAdesioniFamiliari',
|
||||||
|
nullable: true,
|
||||||
|
})
|
||||||
|
inizioDecorrenzaNuoveAdesioniFamiliari!: number | null;
|
||||||
|
|
||||||
|
@Column('int', { name: 'cessazioneInfraAnnuale', nullable: true })
|
||||||
|
cessazioneInfraAnnuale!: number | null;
|
||||||
|
|
||||||
|
@Column('int', { name: 'numeroGiorniRimborso', nullable: true })
|
||||||
|
numeroGiorniRimborso!: number | null;
|
||||||
|
|
||||||
|
@Column('int', { name: 'rimborsoPersona', nullable: true })
|
||||||
|
rimborsoPersona!: number | null;
|
||||||
|
|
||||||
|
@Column('int', { name: 'rimborsoFax', nullable: true })
|
||||||
|
rimborsoFax!: number | null;
|
||||||
|
|
||||||
|
@Column('int', { name: 'rimborsoEmail', nullable: true })
|
||||||
|
rimborsoEmail!: number | null;
|
||||||
|
|
||||||
|
@Column('int', { name: 'rimborsoPosta', nullable: true })
|
||||||
|
rimborsoPosta!: number | null;
|
||||||
|
|
||||||
|
@Column('int', { name: 'rimborsoWeb', nullable: true })
|
||||||
|
rimborsoWeb!: number | null;
|
||||||
|
|
||||||
|
@Column('bigint', { name: 'utentecreazione', nullable: true })
|
||||||
|
utentecreazione!: string | null;
|
||||||
|
|
||||||
|
@Column('nvarchar', { name: 'dataCreazione', nullable: true, length: 10 })
|
||||||
|
dataCreazione!: string | null;
|
||||||
|
|
||||||
|
@Column('nvarchar', { name: 'oraCreazione', nullable: true, length: 8 })
|
||||||
|
oraCreazione!: string | null;
|
||||||
|
|
||||||
|
@Column('bigint', { name: 'utenteModifica', nullable: true })
|
||||||
|
utenteModifica!: string | null;
|
||||||
|
|
||||||
|
@Column('nvarchar', { name: 'dataModifica', nullable: true, length: 10 })
|
||||||
|
dataModifica!: string | null;
|
||||||
|
|
||||||
|
@Column('nvarchar', { name: 'oraModifica', nullable: true, length: 8 })
|
||||||
|
oraModifica!: string | null;
|
||||||
|
|
||||||
|
@Column('ntext', { name: 'noteContratto', nullable: true })
|
||||||
|
noteContratto!: string | null;
|
||||||
|
|
||||||
|
@Column('int', { name: 'versamentiTerzi', nullable: true })
|
||||||
|
versamentiTerzi!: number | null;
|
||||||
|
|
||||||
|
@Column('int', { name: 'ignoraControlloPagamenti', nullable: true })
|
||||||
|
ignoraControlloPagamenti!: number | null;
|
||||||
|
|
||||||
|
@Column('int', { name: 'anniRinnovo', nullable: true })
|
||||||
|
anniRinnovo!: number | null;
|
||||||
|
|
||||||
|
@Column('bigint', { name: 'codiceRivenditore', nullable: true })
|
||||||
|
codiceRivenditore!: string | null;
|
||||||
|
|
||||||
|
@Column('int', {
|
||||||
|
name: 'inizioDecorrenzaNuoveAdesioniNascita',
|
||||||
|
nullable: true,
|
||||||
|
})
|
||||||
|
inizioDecorrenzaNuoveAdesioniNascita!: number | null;
|
||||||
|
|
||||||
|
@Column('int', { name: 'numeroGiorniNascita', nullable: true })
|
||||||
|
numeroGiorniNascita!: number | null;
|
||||||
|
|
||||||
|
@Column('int', { name: 'mesiEsclusionePatologieAderenti', nullable: true })
|
||||||
|
mesiEsclusionePatologieAderenti!: number | null;
|
||||||
|
|
||||||
|
@Column('int', { name: 'mesiEsclusionePatologieFamiliari', nullable: true })
|
||||||
|
mesiEsclusionePatologieFamiliari!: number | null;
|
||||||
|
|
||||||
|
@Column('int', { name: 'coperturaPreesistenzeAderenti', nullable: true })
|
||||||
|
coperturaPreesistenzeAderenti!: number | null;
|
||||||
|
|
||||||
|
@Column('int', { name: 'coperturaPreesistenzeFamiliari', nullable: true })
|
||||||
|
coperturaPreesistenzeFamiliari!: number | null;
|
||||||
|
|
||||||
|
@Column('int', { name: 'adesioniFdaIndividuali', nullable: true })
|
||||||
|
adesioniFdaIndividuali!: number | null;
|
||||||
|
|
||||||
|
@Column('nvarchar', {
|
||||||
|
name: 'dataAssunzioneAderenti',
|
||||||
|
nullable: true,
|
||||||
|
length: 10,
|
||||||
|
})
|
||||||
|
dataAssunzioneAderenti!: string | null;
|
||||||
|
|
||||||
|
@Column('int', { name: 'associazioniIndividuali', nullable: true })
|
||||||
|
associazioniIndividuali!: number | null;
|
||||||
|
|
||||||
|
@Column('bigint', { name: 'categoria', nullable: true })
|
||||||
|
categoria!: string | null;
|
||||||
|
|
||||||
|
@Column('nvarchar', { name: 'email', nullable: true, length: 80 })
|
||||||
|
email!: string | null;
|
||||||
|
|
||||||
|
@Column('nvarchar', { name: 'fax', nullable: true, length: 80 })
|
||||||
|
fax!: string | null;
|
||||||
|
|
||||||
|
@Column('nvarchar', { name: 'telefono', nullable: true, length: 80 })
|
||||||
|
telefono!: string | null;
|
||||||
|
|
||||||
|
@Column('nvarchar', { name: 'sitoWeb', nullable: true, length: 80 })
|
||||||
|
sitoWeb!: string | null;
|
||||||
|
|
||||||
|
@Column('nvarchar', { name: 'riferimento', nullable: true, length: 80 })
|
||||||
|
riferimento!: string | null;
|
||||||
|
|
||||||
|
@Column('int', { name: 'comunicazioniFax', nullable: true })
|
||||||
|
comunicazioniFax!: number | null;
|
||||||
|
|
||||||
|
@Column('int', { name: 'comunicazioniEmail', nullable: true })
|
||||||
|
comunicazioniEmail!: number | null;
|
||||||
|
|
||||||
|
@Column('int', { name: 'comunicazioniSito', nullable: true })
|
||||||
|
comunicazioniSito!: number | null;
|
||||||
|
|
||||||
|
@Column('int', { name: 'comunicazioniPosta', nullable: true })
|
||||||
|
comunicazioniPosta!: number | null;
|
||||||
|
|
||||||
|
@Column('int', { name: 'gestionePreventiviWEB', nullable: true })
|
||||||
|
gestionePreventiviWeb!: number | null;
|
||||||
|
|
||||||
|
@Column('nvarchar', {
|
||||||
|
name: 'codiceDocumentoWEB',
|
||||||
|
nullable: true,
|
||||||
|
length: 80,
|
||||||
|
})
|
||||||
|
codiceDocumentoWeb!: string | null;
|
||||||
|
|
||||||
|
@Column('int', { name: 'numeroGiorniEffettuareRimborsi', nullable: true })
|
||||||
|
numeroGiorniEffettuareRimborsi!: number | null;
|
||||||
|
|
||||||
|
@Column('int', { name: 'numeroGiorniIntegrazioneDocumenti', nullable: true })
|
||||||
|
numeroGiorniIntegrazioneDocumenti!: number | null;
|
||||||
|
|
||||||
|
@Column('int', { name: 'gestioneIndividuali', nullable: true })
|
||||||
|
gestioneIndividuali!: number | null;
|
||||||
|
|
||||||
|
@Column('int', { name: 'fondoPluriaziendale', nullable: true })
|
||||||
|
fondoPluriaziendale!: number | null;
|
||||||
|
|
||||||
|
@Column('nvarchar', { name: 'emailCertificata', nullable: true, length: 80 })
|
||||||
|
emailCertificata!: string | null;
|
||||||
|
|
||||||
|
@Column('int', { name: 'comunicazioniEmailCertificata', nullable: true })
|
||||||
|
comunicazioniEmailCertificata!: number | null;
|
||||||
|
|
||||||
|
@Column('nvarchar', {
|
||||||
|
name: 'dataAssunzioneFamiliari',
|
||||||
|
nullable: true,
|
||||||
|
length: 10,
|
||||||
|
})
|
||||||
|
dataAssunzioneFamiliari!: string | null;
|
||||||
|
|
||||||
|
@Column('int', {
|
||||||
|
name: 'coperturaPreesistenzeAderentiNuoveAssunzioni',
|
||||||
|
nullable: true,
|
||||||
|
})
|
||||||
|
coperturaPreesistenzeAderentiNuoveAssunzioni!: number | null;
|
||||||
|
|
||||||
|
@Column('int', {
|
||||||
|
name: 'coperturaPreesistenzeFamiliariNuoveAssunzioni',
|
||||||
|
nullable: true,
|
||||||
|
})
|
||||||
|
coperturaPreesistenzeFamiliariNuoveAssunzioni!: number | null;
|
||||||
|
|
||||||
|
@Column('int', { name: 'noCessazioneAutomaticaFineAnno', nullable: true })
|
||||||
|
noCessazioneAutomaticaFineAnno!: number | null;
|
||||||
|
|
||||||
|
@Column('int', { name: 'contrattoRateSemestrali', nullable: true })
|
||||||
|
contrattoRateSemestrali!: number | null;
|
||||||
|
|
||||||
|
@Column('decimal', {
|
||||||
|
name: 'moraRitardoPagamenti',
|
||||||
|
nullable: true,
|
||||||
|
precision: 18,
|
||||||
|
scale: 2,
|
||||||
|
})
|
||||||
|
moraRitardoPagamenti!: number | null;
|
||||||
|
|
||||||
|
@Column('decimal', {
|
||||||
|
name: 'quotaRichiestaFondo',
|
||||||
|
nullable: true,
|
||||||
|
precision: 18,
|
||||||
|
scale: 2,
|
||||||
|
})
|
||||||
|
quotaRichiestaFondo!: number | null;
|
||||||
|
|
||||||
|
@Column('int', { name: 'percQuotaRichiestaFondo', nullable: true })
|
||||||
|
percQuotaRichiestaFondo!: number | null;
|
||||||
|
|
||||||
|
@Column('int', { name: 'scontoIndividuali', nullable: true })
|
||||||
|
scontoIndividuali!: number | null;
|
||||||
|
|
||||||
|
@Column('int', {
|
||||||
|
name: 'modalitaCalcoloDatiContributiviIndividuali',
|
||||||
|
nullable: true,
|
||||||
|
})
|
||||||
|
modalitaCalcoloDatiContributiviIndividuali!: number | null;
|
||||||
|
|
||||||
|
@Column('bigint', { name: 'codiceFiguraContratto', nullable: true })
|
||||||
|
codiceFiguraContratto!: string | null;
|
||||||
|
|
||||||
|
@Column('nvarchar', {
|
||||||
|
name: 'nomeModelloTesserini',
|
||||||
|
nullable: true,
|
||||||
|
length: 255,
|
||||||
|
})
|
||||||
|
nomeModelloTesserini!: string | null;
|
||||||
|
|
||||||
|
@Column('nvarchar', {
|
||||||
|
name: 'nomeModelloLettera',
|
||||||
|
nullable: true,
|
||||||
|
length: 255,
|
||||||
|
})
|
||||||
|
nomeModelloLettera!: string | null;
|
||||||
|
|
||||||
|
@Column('int', { name: 'ignoraControlloPagamentiTitolare', nullable: true })
|
||||||
|
ignoraControlloPagamentiTitolare!: number | null;
|
||||||
|
|
||||||
|
@Column('int', { name: 'ignoraControlloPagamentiAzienda', nullable: true })
|
||||||
|
ignoraControlloPagamentiAzienda!: number | null;
|
||||||
|
|
||||||
|
@Column('bigint', { name: 'codicePromoter', nullable: true })
|
||||||
|
codicePromoter!: string | null;
|
||||||
|
|
||||||
|
@Column('bigint', { name: 'codiceOriginePromoter', nullable: true })
|
||||||
|
codiceOriginePromoter!: string | null;
|
||||||
|
|
||||||
|
@Column('int', { name: 'fornituraTesserino', nullable: true })
|
||||||
|
fornituraTesserino!: number | null;
|
||||||
|
|
||||||
|
@Column('nvarchar', {
|
||||||
|
name: 'dataChiusuraContratto',
|
||||||
|
nullable: true,
|
||||||
|
length: 10,
|
||||||
|
})
|
||||||
|
dataChiusuraContratto!: string | null;
|
||||||
|
|
||||||
|
@Column('nvarchar', {
|
||||||
|
name: 'nomeModelloLetteraRID',
|
||||||
|
nullable: true,
|
||||||
|
length: 255,
|
||||||
|
})
|
||||||
|
nomeModelloLetteraRid!: string | null;
|
||||||
|
|
||||||
|
@Column('nvarchar', {
|
||||||
|
name: 'nomeModelloLetteraAdesione',
|
||||||
|
nullable: true,
|
||||||
|
length: 255,
|
||||||
|
})
|
||||||
|
nomeModelloLetteraAdesione!: string | null;
|
||||||
|
|
||||||
|
@Column('nvarchar', {
|
||||||
|
name: 'nomeModelloLetteraAdeguamenti',
|
||||||
|
nullable: true,
|
||||||
|
length: 255,
|
||||||
|
})
|
||||||
|
nomeModelloLetteraAdeguamenti!: string | null;
|
||||||
|
|
||||||
|
@Column('int', { name: 'coopersalute', nullable: true })
|
||||||
|
coopersalute!: number | null;
|
||||||
|
|
||||||
|
@Column('int', { name: 'forzaEstensioneTolleranza', nullable: true })
|
||||||
|
forzaEstensioneTolleranza!: number | null;
|
||||||
|
|
||||||
|
@Column('int', { name: 'giorniEstensioneTolleranza', nullable: true })
|
||||||
|
giorniEstensioneTolleranza!: number | null;
|
||||||
|
|
||||||
|
@Column('nvarchar', {
|
||||||
|
name: 'nomeModelloLetteraSollecito',
|
||||||
|
nullable: true,
|
||||||
|
length: 255,
|
||||||
|
})
|
||||||
|
nomeModelloLetteraSollecito!: string | null;
|
||||||
|
|
||||||
|
@Column('nvarchar', {
|
||||||
|
name: 'nomeModelloLetteraSollecito2',
|
||||||
|
nullable: true,
|
||||||
|
length: 255,
|
||||||
|
})
|
||||||
|
nomeModelloLetteraSollecito2!: string | null;
|
||||||
|
|
||||||
|
@Column('nvarchar', {
|
||||||
|
name: 'nomeModelloLetteraNeonato',
|
||||||
|
nullable: true,
|
||||||
|
length: 255,
|
||||||
|
})
|
||||||
|
nomeModelloLetteraNeonato!: string | null;
|
||||||
|
|
||||||
|
@Column('int', { name: 'comunicazioniViaEmail', nullable: true })
|
||||||
|
comunicazioniViaEmail!: number | null;
|
||||||
|
|
||||||
|
@Column('int', {
|
||||||
|
name: 'modalitaCalcoloQuotaAssociativaFondo',
|
||||||
|
default: () => '(0)',
|
||||||
|
})
|
||||||
|
modalitaCalcoloQuotaAssociativaFondo!: number;
|
||||||
|
|
||||||
|
@Column('int', {
|
||||||
|
name: 'modalitaCalcoloQuotaAssociativaNumeroFondo',
|
||||||
|
default: () => '(0)',
|
||||||
|
})
|
||||||
|
modalitaCalcoloQuotaAssociativaNumeroFondo!: number;
|
||||||
|
|
||||||
|
@Column('int', { name: 'quotaAssociativaFondo', default: () => '(0)' })
|
||||||
|
quotaAssociativaFondo!: number;
|
||||||
|
|
||||||
|
@Column('int', { name: 'tipoAnamnesi', default: () => '(1)' })
|
||||||
|
tipoAnamnesi!: number;
|
||||||
|
|
||||||
|
@Column('int', { name: 'primoCheck', default: () => '(1)' })
|
||||||
|
primoCheck!: number;
|
||||||
|
|
||||||
|
@Column('int', { name: 'secondoCheck', default: () => '(1)' })
|
||||||
|
secondoCheck!: number;
|
||||||
|
|
||||||
|
@Column('ntext', { name: 'testoPrimoCheck', default: () => "''" })
|
||||||
|
testoPrimoCheck!: string;
|
||||||
|
|
||||||
|
@Column('ntext', { name: 'testoSecondoCheck', default: () => "''" })
|
||||||
|
testoSecondoCheck!: string;
|
||||||
|
|
||||||
|
@Column('int', { name: 'calcolaQuotaWEB', default: () => '(1)' })
|
||||||
|
calcolaQuotaWeb!: number;
|
||||||
|
|
||||||
|
@Column('int', { name: 'verificaEsistenzaOnline', default: () => '(1)' })
|
||||||
|
verificaEsistenzaOnline!: number;
|
||||||
|
|
||||||
|
@Column('int', { name: 'titolareGiaAssociato', default: () => '(1)' })
|
||||||
|
titolareGiaAssociato!: number;
|
||||||
|
|
||||||
|
@Column('ntext', {
|
||||||
|
name: 'intestazionePrimaPaginaAdesione',
|
||||||
|
default: () => "''",
|
||||||
|
})
|
||||||
|
intestazionePrimaPaginaAdesione!: string;
|
||||||
|
|
||||||
|
@Column('ntext', {
|
||||||
|
name: 'intestazioneUltimaPaginaAdesione',
|
||||||
|
default: () => "''",
|
||||||
|
})
|
||||||
|
intestazioneUltimaPaginaAdesione!: string;
|
||||||
|
|
||||||
|
@Column('int', { name: 'importaComeAssociati', default: () => '(1)' })
|
||||||
|
importaComeAssociati!: number;
|
||||||
|
|
||||||
|
@Column('int', { name: 'importazioneAutomatica', default: () => '(1)' })
|
||||||
|
importazioneAutomatica!: number;
|
||||||
|
|
||||||
|
@Column('int', { name: 'stampaModuloAdesione', default: () => '(1)' })
|
||||||
|
stampaModuloAdesione!: number;
|
||||||
|
|
||||||
|
@Column('int', { name: 'terzoCheck', default: () => '(1)' })
|
||||||
|
terzoCheck!: number;
|
||||||
|
|
||||||
|
@Column('ntext', { name: 'testoTerzoCheck', default: () => "''" })
|
||||||
|
testoTerzoCheck!: string;
|
||||||
|
|
||||||
|
@Column('ntext', { name: 'testoEmailPreventivo', default: () => "''" })
|
||||||
|
testoEmailPreventivo!: string;
|
||||||
|
|
||||||
|
@Column('ntext', { name: 'testoEmailAdesione', default: () => "''" })
|
||||||
|
testoEmailAdesione!: string;
|
||||||
|
|
||||||
|
@Column('ntext', { name: 'oggettoEmailPreventivo', default: () => "''" })
|
||||||
|
oggettoEmailPreventivo!: string;
|
||||||
|
|
||||||
|
@Column('ntext', { name: 'oggettoEmailAdesione', default: () => "''" })
|
||||||
|
oggettoEmailAdesione!: string;
|
||||||
|
|
||||||
|
@Column('nvarchar', {
|
||||||
|
name: 'nomeModelloLetteraStampaAdesione',
|
||||||
|
length: 255,
|
||||||
|
default: () => "''",
|
||||||
|
})
|
||||||
|
nomeModelloLetteraStampaAdesione!: string;
|
||||||
|
|
||||||
|
@Column('ntext', {
|
||||||
|
name: 'oggettoSecondaNotificaScadenzaPreventivo',
|
||||||
|
default: () => "''",
|
||||||
|
})
|
||||||
|
oggettoSecondaNotificaScadenzaPreventivo!: string;
|
||||||
|
|
||||||
|
@Column('ntext', {
|
||||||
|
name: 'oggettoPrimaNotificaScadenzaPreventivo',
|
||||||
|
default: () => "''",
|
||||||
|
})
|
||||||
|
oggettoPrimaNotificaScadenzaPreventivo!: string;
|
||||||
|
|
||||||
|
@Column('ntext', {
|
||||||
|
name: 'testoSecondaNotificaScadenzaPreventivo',
|
||||||
|
default: () => "''",
|
||||||
|
})
|
||||||
|
testoSecondaNotificaScadenzaPreventivo!: string;
|
||||||
|
|
||||||
|
@Column('ntext', {
|
||||||
|
name: 'testoPrimaNotificaScadenzaPreventivo',
|
||||||
|
default: () => "''",
|
||||||
|
})
|
||||||
|
testoPrimaNotificaScadenzaPreventivo!: string;
|
||||||
|
|
||||||
|
@Column('bigint', { name: 'codiceBancaContributi', default: () => '(0)' })
|
||||||
|
codiceBancaContributi!: string;
|
||||||
|
|
||||||
|
@Column('bigint', { name: 'codiceBancaRimborsi', default: () => '(0)' })
|
||||||
|
codiceBancaRimborsi!: string;
|
||||||
|
|
||||||
|
@Column('ntext', {
|
||||||
|
name: 'testataCertificazione',
|
||||||
|
nullable: true,
|
||||||
|
default: () => "''",
|
||||||
|
})
|
||||||
|
testataCertificazione!: string | null;
|
||||||
|
|
||||||
|
@Column('ntext', { name: 'codaCertificazione', default: () => "''" })
|
||||||
|
codaCertificazione!: string;
|
||||||
|
|
||||||
|
@Column('ntext', { name: 'testataRiepilogoRimborsi', default: () => "''" })
|
||||||
|
testataRiepilogoRimborsi!: string;
|
||||||
|
|
||||||
|
@Column('int', { name: 'adesioneInfraAnnuale', default: () => '(0)' })
|
||||||
|
adesioneInfraAnnuale!: number;
|
||||||
|
|
||||||
|
@ManyToOne(() => EnteEntity, (enteEntity) => enteEntity.contratti)
|
||||||
|
@JoinColumn([{ name: 'codiceEnte', referencedColumnName: 'codiceEnte' }])
|
||||||
|
ente!: EnteEntity;
|
||||||
|
|
||||||
|
@OneToMany(() => SocioContrattoEntity, (socioContrattoEntity) => socioContrattoEntity.contratto)
|
||||||
|
socioContratto!: SocioContrattoEntity[];
|
||||||
|
|
||||||
|
constructor(init?: Partial<ContrattoEntity>) {
|
||||||
|
Object.assign(this, init);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,87 @@
|
|||||||
|
import { Column, Entity, Index, JoinColumn, ManyToOne, OneToMany } from 'typeorm';
|
||||||
|
import { ContrattoEntity } from './contratto.entity';
|
||||||
|
import { GruppoEntity } from './gruppo.entity';
|
||||||
|
|
||||||
|
@Index('PK_ent', ['codiceEnte'], { unique: true })
|
||||||
|
@Entity('ente')
|
||||||
|
export class EnteEntity {
|
||||||
|
@Column('bigint', { primary: true, name: 'codiceEnte' })
|
||||||
|
codiceEnte!: string;
|
||||||
|
|
||||||
|
@Column('nvarchar', { name: 'ragioneSociale', nullable: true, length: 255 })
|
||||||
|
ragioneSociale!: string | null;
|
||||||
|
|
||||||
|
@Column('nvarchar', { name: 'partitaIva', nullable: true, length: 25 })
|
||||||
|
partitaIva!: string | null;
|
||||||
|
|
||||||
|
@Column('nvarchar', { name: 'codiceFiscale', nullable: true, length: 25 })
|
||||||
|
codiceFiscale!: string | null;
|
||||||
|
|
||||||
|
@Column('ntext', { name: 'noteEnte', nullable: true })
|
||||||
|
noteEnte!: string | null;
|
||||||
|
|
||||||
|
@Column('nvarchar', {
|
||||||
|
name: 'codiceDivisioneEsolver',
|
||||||
|
nullable: true,
|
||||||
|
length: 25,
|
||||||
|
})
|
||||||
|
codiceDivisioneEsolver!: string | null;
|
||||||
|
|
||||||
|
@Column('int', { name: 'enteAttivo', nullable: true })
|
||||||
|
enteAttivo!: number | null;
|
||||||
|
|
||||||
|
@Column('nvarchar', { name: 'indirizzoEnte', nullable: true, length: 80 })
|
||||||
|
indirizzoEnte!: string | null;
|
||||||
|
|
||||||
|
@Column('nvarchar', { name: 'numeroCivicoEnte', nullable: true, length: 80 })
|
||||||
|
numeroCivicoEnte!: string | null;
|
||||||
|
|
||||||
|
@Column('nvarchar', { name: 'capEnte', nullable: true, length: 10 })
|
||||||
|
capEnte!: string | null;
|
||||||
|
|
||||||
|
@Column('nvarchar', { name: 'localitaEnte', nullable: true, length: 80 })
|
||||||
|
localitaEnte!: string | null;
|
||||||
|
|
||||||
|
@Column('bigint', { name: 'utenteCreazione', nullable: true })
|
||||||
|
utenteCreazione!: string | null;
|
||||||
|
|
||||||
|
@Column('nvarchar', { name: 'dataCreazione', nullable: true, length: 10 })
|
||||||
|
dataCreazione!: string | null;
|
||||||
|
|
||||||
|
@Column('nvarchar', { name: 'oraCreazione', nullable: true, length: 8 })
|
||||||
|
oraCreazione!: string | null;
|
||||||
|
|
||||||
|
@Column('bigint', { name: 'utenteModifica', nullable: true })
|
||||||
|
utenteModifica!: string | null;
|
||||||
|
|
||||||
|
@Column('nvarchar', { name: 'dataModifica', nullable: true, length: 10 })
|
||||||
|
dataModifica!: string | null;
|
||||||
|
|
||||||
|
@Column('nvarchar', { name: 'oraModifica', nullable: true, length: 8 })
|
||||||
|
oraModifica!: string | null;
|
||||||
|
|
||||||
|
@Column('bigint', { name: 'codiceGruppo', nullable: true })
|
||||||
|
codiceGruppo!: string | null;
|
||||||
|
|
||||||
|
@Column('bigint', { name: 'statoEnte', nullable: true })
|
||||||
|
statoEnte!: string | null;
|
||||||
|
|
||||||
|
@Column('bigint', { name: 'provinciaEnte', nullable: true })
|
||||||
|
provinciaEnte!: string | null;
|
||||||
|
|
||||||
|
@Column('int', { name: 'inOsservazione', nullable: true })
|
||||||
|
inOsservazione!: number | null;
|
||||||
|
|
||||||
|
@Column('nvarchar', { name: 'sitoInternet', nullable: true, length: 255 })
|
||||||
|
sitoInternet!: string | null;
|
||||||
|
|
||||||
|
@ManyToOne(() => GruppoEntity, (gruppoEntity) => gruppoEntity.enti)
|
||||||
|
gruppo!: ContrattoEntity;
|
||||||
|
|
||||||
|
@OneToMany(() => ContrattoEntity, (contrattoEntity) => contrattoEntity.ente)
|
||||||
|
contratti!: ContrattoEntity[];
|
||||||
|
|
||||||
|
constructor(init?: Partial<EnteEntity>) {
|
||||||
|
Object.assign(this, init);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,158 @@
|
|||||||
|
import { Column, Entity, Index, JoinColumn, ManyToOne, OneToMany } from 'typeorm';
|
||||||
|
import { SocioFormeAssistenzaEntity } from './socioFormeAssistenza.entity';
|
||||||
|
|
||||||
|
@Index('PK_formeAssistenza', ['codiceFda'], { unique: true })
|
||||||
|
@Entity('formeAssistenza')
|
||||||
|
export class FormeAssistenzaEntity {
|
||||||
|
@Column('bigint', { name: 'codiceGruppo' })
|
||||||
|
codiceGruppo!: string;
|
||||||
|
|
||||||
|
@Column('bigint', { primary: true, name: 'codiceFda' })
|
||||||
|
codiceFda!: string;
|
||||||
|
|
||||||
|
@Column('nvarchar', { name: 'descrizioneFda', nullable: true, length: 80 })
|
||||||
|
descrizioneFda!: string | null;
|
||||||
|
|
||||||
|
@Column('int', { name: 'attivaFda', nullable: true })
|
||||||
|
attivaFda!: number | null;
|
||||||
|
|
||||||
|
@Column('int', { name: 'fornituraTesserino', nullable: true })
|
||||||
|
fornituraTesserino!: number | null;
|
||||||
|
|
||||||
|
@Column('ntext', { name: 'noteFda', nullable: true })
|
||||||
|
noteFda!: string | null;
|
||||||
|
|
||||||
|
@Column('bigint', { name: 'utenteCreazione', nullable: true })
|
||||||
|
utenteCreazione!: string | null;
|
||||||
|
|
||||||
|
@Column('nvarchar', { name: 'dataCreazione', nullable: true, length: 10 })
|
||||||
|
dataCreazione!: string | null;
|
||||||
|
|
||||||
|
@Column('nvarchar', { name: 'oraCreazione', nullable: true, length: 8 })
|
||||||
|
oraCreazione!: string | null;
|
||||||
|
|
||||||
|
@Column('bigint', { name: 'utenteModifica', nullable: true })
|
||||||
|
utenteModifica!: string | null;
|
||||||
|
|
||||||
|
@Column('nvarchar', { name: 'dataModifica', nullable: true, length: 10 })
|
||||||
|
dataModifica!: string | null;
|
||||||
|
|
||||||
|
@Column('nvarchar', { name: 'oraModifica', nullable: true, length: 8 })
|
||||||
|
oraModifica!: string | null;
|
||||||
|
|
||||||
|
@Column('int', { name: 'attivaDiretta', nullable: true })
|
||||||
|
attivaDiretta!: number | null;
|
||||||
|
|
||||||
|
@Column('int', { name: 'attivaIndiretta', nullable: true })
|
||||||
|
attivaIndiretta!: number | null;
|
||||||
|
|
||||||
|
@Column('int', { name: 'anniAdesione', nullable: true })
|
||||||
|
anniAdesione!: number | null;
|
||||||
|
|
||||||
|
@Column('int', { name: 'gestionePreventivo', nullable: true })
|
||||||
|
gestionePreventivo!: number | null;
|
||||||
|
|
||||||
|
@Column('int', { name: 'interoNucleoFamiliare', nullable: true })
|
||||||
|
interoNucleoFamiliare!: number | null;
|
||||||
|
|
||||||
|
@Column('int', { name: 'escludeDocRimborsi', nullable: true })
|
||||||
|
escludeDocRimborsi!: number | null;
|
||||||
|
|
||||||
|
@Column('int', { name: 'struttureDirettaIncluse', nullable: true })
|
||||||
|
struttureDirettaIncluse!: number | null;
|
||||||
|
|
||||||
|
@Column('int', { name: 'struttureIndirettaIncluse', nullable: true })
|
||||||
|
struttureIndirettaIncluse!: number | null;
|
||||||
|
|
||||||
|
@Column('int', { name: 'categorieDirettaIncluse', nullable: true })
|
||||||
|
categorieDirettaIncluse!: number | null;
|
||||||
|
|
||||||
|
@Column('int', { name: 'categorieIndirettaIncluse', nullable: true })
|
||||||
|
categorieIndirettaIncluse!: number | null;
|
||||||
|
|
||||||
|
@Column('nvarchar', {
|
||||||
|
name: 'descrizioneTesserino',
|
||||||
|
nullable: true,
|
||||||
|
length: 80,
|
||||||
|
})
|
||||||
|
descrizioneTesserino!: string | null;
|
||||||
|
|
||||||
|
@Column('bigint', { name: 'codiceFdaOrigine', nullable: true })
|
||||||
|
codiceFdaOrigine!: string | null;
|
||||||
|
|
||||||
|
@Column('nvarchar', {
|
||||||
|
name: 'dataInizioValidita',
|
||||||
|
nullable: true,
|
||||||
|
length: 10,
|
||||||
|
})
|
||||||
|
dataInizioValidita!: string | null;
|
||||||
|
|
||||||
|
@Column('nvarchar', { name: 'dataFineValidita', nullable: true, length: 10 })
|
||||||
|
dataFineValidita!: string | null;
|
||||||
|
|
||||||
|
@Column('int', { name: 'limiteMassimoAssistenza', nullable: true })
|
||||||
|
limiteMassimoAssistenza!: number | null;
|
||||||
|
|
||||||
|
@Column('int', { name: 'limiteMinimoAssistenza', nullable: true })
|
||||||
|
limiteMinimoAssistenza!: number | null;
|
||||||
|
|
||||||
|
@Column('int', { name: 'limiteEtaAderentiDa', nullable: true })
|
||||||
|
limiteEtaAderentiDa!: number | null;
|
||||||
|
|
||||||
|
@Column('int', { name: 'limiteEtaFamiliariDa', nullable: true })
|
||||||
|
limiteEtaFamiliariDa!: number | null;
|
||||||
|
|
||||||
|
@Column('int', { name: 'limiteEtaAderentiA', nullable: true })
|
||||||
|
limiteEtaAderentiA!: number | null;
|
||||||
|
|
||||||
|
@Column('int', { name: 'limiteEtaFamiliariA', nullable: true })
|
||||||
|
limiteEtaFamiliariA!: number | null;
|
||||||
|
|
||||||
|
@Column('nvarchar', {
|
||||||
|
name: 'descrizioneLettera',
|
||||||
|
nullable: true,
|
||||||
|
length: 80,
|
||||||
|
})
|
||||||
|
descrizioneLettera!: string | null;
|
||||||
|
|
||||||
|
@Column('int', { name: 'fdaOpzionale', nullable: true })
|
||||||
|
fdaOpzionale!: number | null;
|
||||||
|
|
||||||
|
@Column('int', { name: 'giorniCarenzaTesserino', nullable: true })
|
||||||
|
giorniCarenzaTesserino!: number | null;
|
||||||
|
|
||||||
|
@Column('ntext', { name: 'informazioni', nullable: true })
|
||||||
|
informazioni!: string | null;
|
||||||
|
|
||||||
|
@Column('nvarchar', {
|
||||||
|
name: 'denominazioneRegolamento',
|
||||||
|
nullable: true,
|
||||||
|
length: 1024,
|
||||||
|
default: () => "''",
|
||||||
|
})
|
||||||
|
denominazioneRegolamento!: string | null;
|
||||||
|
|
||||||
|
@Column('nvarchar', {
|
||||||
|
name: 'dataMassimaAdesione',
|
||||||
|
nullable: true,
|
||||||
|
length: 10,
|
||||||
|
default: () => "'9998-12-31'",
|
||||||
|
})
|
||||||
|
dataMassimaAdesione!: string | null;
|
||||||
|
|
||||||
|
@Column('int', { name: 'prioritaWeb', default: () => '(0)' })
|
||||||
|
prioritaWeb!: number;
|
||||||
|
|
||||||
|
@Column('int', { name: 'attivaDirettaAreaRiservata', default: () => '(0)' })
|
||||||
|
attivaDirettaAreaRiservata!: number;
|
||||||
|
|
||||||
|
@OneToMany(
|
||||||
|
() => SocioFormeAssistenzaEntity,
|
||||||
|
(socioFormeAssistenzaEntity) => socioFormeAssistenzaEntity.formaAssistenza,
|
||||||
|
)
|
||||||
|
socioFormeAssistenza!: SocioFormeAssistenzaEntity[];
|
||||||
|
|
||||||
|
constructor(init?: Partial<FormeAssistenzaEntity>) {
|
||||||
|
Object.assign(this, init);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,658 @@
|
|||||||
|
import { Column, Entity, Index, OneToMany } from 'typeorm';
|
||||||
|
import { EnteEntity } from './ente.entity';
|
||||||
|
|
||||||
|
@Index('PK_gruppo', ['codiceGruppo'], { unique: true })
|
||||||
|
@Entity('gruppo')
|
||||||
|
export class GruppoEntity {
|
||||||
|
@Column('bigint', { primary: true, name: 'codiceGruppo' })
|
||||||
|
codiceGruppo!: string;
|
||||||
|
|
||||||
|
@Column('nvarchar', { name: 'gruppo', nullable: true, length: 80 })
|
||||||
|
gruppo!: string | null;
|
||||||
|
|
||||||
|
@Column('nvarchar', {
|
||||||
|
name: 'descrizioneGruppo',
|
||||||
|
nullable: true,
|
||||||
|
length: 255,
|
||||||
|
})
|
||||||
|
descrizioneGruppo!: string | null;
|
||||||
|
|
||||||
|
@Column('ntext', { name: 'noteGruppo', nullable: true })
|
||||||
|
noteGruppo!: string | null;
|
||||||
|
|
||||||
|
@Column('nvarchar', { name: 'referenteGruppo', nullable: true, length: 80 })
|
||||||
|
referenteGruppo!: string | null;
|
||||||
|
|
||||||
|
@Column('nvarchar', { name: 'telefonoReferente', nullable: true, length: 80 })
|
||||||
|
telefonoReferente!: string | null;
|
||||||
|
|
||||||
|
@Column('nvarchar', {
|
||||||
|
name: 'cellulareReferente',
|
||||||
|
nullable: true,
|
||||||
|
length: 80,
|
||||||
|
})
|
||||||
|
cellulareReferente!: string | null;
|
||||||
|
|
||||||
|
@Column('nvarchar', { name: 'emailReferente', nullable: true, length: 80 })
|
||||||
|
emailReferente!: string | null;
|
||||||
|
|
||||||
|
@Column('nvarchar', { name: 'indirizzoGruppo', nullable: true, length: 80 })
|
||||||
|
indirizzoGruppo!: string | null;
|
||||||
|
|
||||||
|
@Column('nvarchar', {
|
||||||
|
name: 'numeroCivicoGruppo',
|
||||||
|
nullable: true,
|
||||||
|
length: 80,
|
||||||
|
})
|
||||||
|
numeroCivicoGruppo!: string | null;
|
||||||
|
|
||||||
|
@Column('nvarchar', { name: 'capGruppo', nullable: true, length: 10 })
|
||||||
|
capGruppo!: string | null;
|
||||||
|
|
||||||
|
@Column('nvarchar', { name: 'localitaGruppo', nullable: true, length: 80 })
|
||||||
|
localitaGruppo!: string | null;
|
||||||
|
|
||||||
|
@Column('nvarchar', { name: 'telefono1Gruppo', nullable: true, length: 80 })
|
||||||
|
telefono1Gruppo!: string | null;
|
||||||
|
|
||||||
|
@Column('nvarchar', { name: 'telefono2Gruppo', nullable: true, length: 80 })
|
||||||
|
telefono2Gruppo!: string | null;
|
||||||
|
|
||||||
|
@Column('nvarchar', { name: 'faxGruppo', nullable: true, length: 80 })
|
||||||
|
faxGruppo!: string | null;
|
||||||
|
|
||||||
|
@Column('nvarchar', { name: 'emailGruppo', nullable: true, length: 80 })
|
||||||
|
emailGruppo!: string | null;
|
||||||
|
|
||||||
|
@Column('nvarchar', { name: 'sitoWebGruppo', nullable: true, length: 80 })
|
||||||
|
sitoWebGruppo!: string | null;
|
||||||
|
|
||||||
|
@Column('int', { name: 'gruppoAttivo', nullable: true })
|
||||||
|
gruppoAttivo!: number | null;
|
||||||
|
|
||||||
|
@Column('int', { name: 'esolverAttivo', nullable: true })
|
||||||
|
esolverAttivo!: number | null;
|
||||||
|
|
||||||
|
@Column('nvarchar', { name: 'serverEsolver', nullable: true, length: 80 })
|
||||||
|
serverEsolver!: string | null;
|
||||||
|
|
||||||
|
@Column('nvarchar', { name: 'databaseEsolver', nullable: true, length: 80 })
|
||||||
|
databaseEsolver!: string | null;
|
||||||
|
|
||||||
|
@Column('nvarchar', { name: 'usernameEsolver', nullable: true, length: 80 })
|
||||||
|
usernameEsolver!: string | null;
|
||||||
|
|
||||||
|
@Column('nvarchar', { name: 'passwordEsolver', nullable: true, length: 80 })
|
||||||
|
passwordEsolver!: string | null;
|
||||||
|
|
||||||
|
@Column('nvarchar', { name: 'gruppoEsolver', nullable: true, length: 80 })
|
||||||
|
gruppoEsolver!: string | null;
|
||||||
|
|
||||||
|
@Column('image', { name: 'logoGruppo', nullable: true })
|
||||||
|
logoGruppo!: Buffer | null;
|
||||||
|
|
||||||
|
@Column('bigint', { name: 'utenteCreazione', nullable: true })
|
||||||
|
utenteCreazione!: string | null;
|
||||||
|
|
||||||
|
@Column('nvarchar', { name: 'dataCreazione', nullable: true, length: 10 })
|
||||||
|
dataCreazione!: string | null;
|
||||||
|
|
||||||
|
@Column('nvarchar', { name: 'oraCreazione', nullable: true, length: 8 })
|
||||||
|
oraCreazione!: string | null;
|
||||||
|
|
||||||
|
@Column('bigint', { name: 'utenteModifica', nullable: true })
|
||||||
|
utenteModifica!: string | null;
|
||||||
|
|
||||||
|
@Column('nvarchar', { name: 'dataModifica', nullable: true, length: 10 })
|
||||||
|
dataModifica!: string | null;
|
||||||
|
|
||||||
|
@Column('nvarchar', { name: 'oraModifica', nullable: true, length: 8 })
|
||||||
|
oraModifica!: string | null;
|
||||||
|
|
||||||
|
@Column('nvarchar', { name: 'direttivaReport', nullable: true, length: 512 })
|
||||||
|
direttivaReport!: string | null;
|
||||||
|
|
||||||
|
@Column('nvarchar', {
|
||||||
|
name: 'direttivaReportPers',
|
||||||
|
nullable: true,
|
||||||
|
length: 512,
|
||||||
|
})
|
||||||
|
direttivaReportPers!: string | null;
|
||||||
|
|
||||||
|
@Column('bigint', { name: 'statoGruppo', nullable: true })
|
||||||
|
statoGruppo!: string | null;
|
||||||
|
|
||||||
|
@Column('bigint', { name: 'provinciaGruppo', nullable: true })
|
||||||
|
provinciaGruppo!: string | null;
|
||||||
|
|
||||||
|
@Column('int', { name: 'fondo', nullable: true })
|
||||||
|
fondo!: number | null;
|
||||||
|
|
||||||
|
@Column('decimal', {
|
||||||
|
name: 'tassaIscrizione',
|
||||||
|
nullable: true,
|
||||||
|
precision: 18,
|
||||||
|
scale: 2,
|
||||||
|
})
|
||||||
|
tassaIscrizione!: number | null;
|
||||||
|
|
||||||
|
@Column('nvarchar', { name: 'codiceFiscale', nullable: true, length: 80 })
|
||||||
|
codiceFiscale!: string | null;
|
||||||
|
|
||||||
|
@Column('nvarchar', { name: 'serverFTP', nullable: true, length: 200 })
|
||||||
|
serverFtp!: string | null;
|
||||||
|
|
||||||
|
@Column('nvarchar', { name: 'usernameFTP', nullable: true, length: 200 })
|
||||||
|
usernameFtp!: string | null;
|
||||||
|
|
||||||
|
@Column('nvarchar', { name: 'passwordFTP', nullable: true, length: 200 })
|
||||||
|
passwordFtp!: string | null;
|
||||||
|
|
||||||
|
@Column('decimal', {
|
||||||
|
name: 'massimalePresaCarico',
|
||||||
|
nullable: true,
|
||||||
|
precision: 18,
|
||||||
|
scale: 2,
|
||||||
|
})
|
||||||
|
massimalePresaCarico!: number | null;
|
||||||
|
|
||||||
|
@Column('nvarchar', { name: 'elencoLivello1', nullable: true, length: 80 })
|
||||||
|
elencoLivello1!: string | null;
|
||||||
|
|
||||||
|
@Column('ntext', { name: 'testoEmailPreventivo', nullable: true })
|
||||||
|
testoEmailPreventivo!: string | null;
|
||||||
|
|
||||||
|
@Column('nvarchar', {
|
||||||
|
name: 'emailPreventivoMittente',
|
||||||
|
nullable: true,
|
||||||
|
length: 80,
|
||||||
|
})
|
||||||
|
emailPreventivoMittente!: string | null;
|
||||||
|
|
||||||
|
@Column('nvarchar', {
|
||||||
|
name: 'emailPreventivoNotifica',
|
||||||
|
nullable: true,
|
||||||
|
length: 80,
|
||||||
|
})
|
||||||
|
emailPreventivoNotifica!: string | null;
|
||||||
|
|
||||||
|
@Column('nvarchar', {
|
||||||
|
name: 'desPreventivoMittente',
|
||||||
|
nullable: true,
|
||||||
|
length: 80,
|
||||||
|
})
|
||||||
|
desPreventivoMittente!: string | null;
|
||||||
|
|
||||||
|
@Column('nvarchar', {
|
||||||
|
name: 'desPreventivoNotifica',
|
||||||
|
nullable: true,
|
||||||
|
length: 80,
|
||||||
|
})
|
||||||
|
desPreventivoNotifica!: string | null;
|
||||||
|
|
||||||
|
@Column('bigint', { name: 'codiceContrattoIndividuali', nullable: true })
|
||||||
|
codiceContrattoIndividuali!: string | null;
|
||||||
|
|
||||||
|
@Column('nvarchar', {
|
||||||
|
name: 'codiceAziendaBollettini',
|
||||||
|
nullable: true,
|
||||||
|
length: 80,
|
||||||
|
})
|
||||||
|
codiceAziendaBollettini!: string | null;
|
||||||
|
|
||||||
|
@Column('nvarchar', { name: 'rigaTesserino1', nullable: true, length: 80 })
|
||||||
|
rigaTesserino1!: string | null;
|
||||||
|
|
||||||
|
@Column('nvarchar', { name: 'rigaTesserino2', nullable: true, length: 80 })
|
||||||
|
rigaTesserino2!: string | null;
|
||||||
|
|
||||||
|
@Column('nvarchar', { name: 'rigaTesserino3', nullable: true, length: 80 })
|
||||||
|
rigaTesserino3!: string | null;
|
||||||
|
|
||||||
|
@Column('nvarchar', {
|
||||||
|
name: 'cartellaCondivisa',
|
||||||
|
nullable: true,
|
||||||
|
length: 512,
|
||||||
|
})
|
||||||
|
cartellaCondivisa!: string | null;
|
||||||
|
|
||||||
|
@Column('nvarchar', { name: 'serverSMTP', nullable: true, length: 80 })
|
||||||
|
serverSmtp!: string | null;
|
||||||
|
|
||||||
|
@Column('nvarchar', { name: 'usernameSMTP', nullable: true, length: 80 })
|
||||||
|
usernameSmtp!: string | null;
|
||||||
|
|
||||||
|
@Column('nvarchar', { name: 'passwordSMTP', nullable: true, length: 80 })
|
||||||
|
passwordSmtp!: string | null;
|
||||||
|
|
||||||
|
@Column('nvarchar', { name: 'emailIBAN', nullable: true, length: 255 })
|
||||||
|
emailIban!: string | null;
|
||||||
|
|
||||||
|
@Column('nvarchar', { name: 'emailFatture', nullable: true, length: 255 })
|
||||||
|
emailFatture!: string | null;
|
||||||
|
|
||||||
|
@Column('nvarchar', { name: 'emailRA', nullable: true, length: 255 })
|
||||||
|
emailRa!: string | null;
|
||||||
|
|
||||||
|
@Column('nvarchar', {
|
||||||
|
name: 'emailAreaRiservataSoci',
|
||||||
|
nullable: true,
|
||||||
|
length: 80,
|
||||||
|
default: () => "''",
|
||||||
|
})
|
||||||
|
emailAreaRiservataSoci!: string | null;
|
||||||
|
|
||||||
|
@Column('nvarchar', {
|
||||||
|
name: 'desAreaRiservataSoci',
|
||||||
|
nullable: true,
|
||||||
|
length: 80,
|
||||||
|
default: () => "''",
|
||||||
|
})
|
||||||
|
desAreaRiservataSoci!: string | null;
|
||||||
|
|
||||||
|
@Column('nvarchar', {
|
||||||
|
name: 'usernameSMS',
|
||||||
|
nullable: true,
|
||||||
|
length: 255,
|
||||||
|
default: () => "''",
|
||||||
|
})
|
||||||
|
usernameSms!: string | null;
|
||||||
|
|
||||||
|
@Column('nvarchar', {
|
||||||
|
name: 'passwordSMS',
|
||||||
|
nullable: true,
|
||||||
|
length: 255,
|
||||||
|
default: () => "''",
|
||||||
|
})
|
||||||
|
passwordSms!: string | null;
|
||||||
|
|
||||||
|
@Column('nvarchar', {
|
||||||
|
name: 'mittenteSMS',
|
||||||
|
nullable: true,
|
||||||
|
length: 255,
|
||||||
|
default: () => "''",
|
||||||
|
})
|
||||||
|
mittenteSms!: string | null;
|
||||||
|
|
||||||
|
@Column('nvarchar', { name: 'sitoWebDati', length: 255, default: () => "''" })
|
||||||
|
sitoWebDati!: string;
|
||||||
|
|
||||||
|
@Column('nvarchar', {
|
||||||
|
name: 'identificativoCreditore',
|
||||||
|
length: 35,
|
||||||
|
default: () => "''",
|
||||||
|
})
|
||||||
|
identificativoCreditore!: string;
|
||||||
|
|
||||||
|
@Column('nvarchar', {
|
||||||
|
name: 'SMSProtocollo',
|
||||||
|
nullable: true,
|
||||||
|
length: 200,
|
||||||
|
default: () => "''",
|
||||||
|
})
|
||||||
|
smsProtocollo!: string | null;
|
||||||
|
|
||||||
|
@Column('nvarchar', {
|
||||||
|
name: 'oggettoEmailBonifico',
|
||||||
|
nullable: true,
|
||||||
|
length: 200,
|
||||||
|
default: () => "''",
|
||||||
|
})
|
||||||
|
oggettoEmailBonifico!: string | null;
|
||||||
|
|
||||||
|
@Column('ntext', {
|
||||||
|
name: 'emailBonifico',
|
||||||
|
nullable: true,
|
||||||
|
default: () => "''",
|
||||||
|
})
|
||||||
|
emailBonifico!: string | null;
|
||||||
|
|
||||||
|
@Column('ntext', {
|
||||||
|
name: 'emailAssegno',
|
||||||
|
nullable: true,
|
||||||
|
default: () => "''",
|
||||||
|
})
|
||||||
|
emailAssegno!: string | null;
|
||||||
|
|
||||||
|
@Column('nvarchar', {
|
||||||
|
name: 'oggettoEmailAssegno',
|
||||||
|
nullable: true,
|
||||||
|
length: 200,
|
||||||
|
default: () => "''",
|
||||||
|
})
|
||||||
|
oggettoEmailAssegno!: string | null;
|
||||||
|
|
||||||
|
@Column('nvarchar', {
|
||||||
|
name: 'SMSRimborsoBonifico',
|
||||||
|
nullable: true,
|
||||||
|
length: 200,
|
||||||
|
default: () => "''",
|
||||||
|
})
|
||||||
|
smsRimborsoBonifico!: string | null;
|
||||||
|
|
||||||
|
@Column('nvarchar', {
|
||||||
|
name: 'SMSRimborsoAssegno',
|
||||||
|
nullable: true,
|
||||||
|
length: 200,
|
||||||
|
default: () => "''",
|
||||||
|
})
|
||||||
|
smsRimborsoAssegno!: string | null;
|
||||||
|
|
||||||
|
@Column('nvarchar', { name: 'emailPIC', nullable: true, length: 255 })
|
||||||
|
emailPic!: string | null;
|
||||||
|
|
||||||
|
@Column('nvarchar', { name: 'stelline', length: 10, default: () => "''" })
|
||||||
|
stelline!: string;
|
||||||
|
|
||||||
|
@Column('nvarchar', { name: 'mittentePIC', length: 400, default: () => "''" })
|
||||||
|
mittentePic!: string;
|
||||||
|
|
||||||
|
@Column('ntext', { name: 'oggettoPIC', default: () => "''" })
|
||||||
|
oggettoPic!: string;
|
||||||
|
|
||||||
|
@Column('ntext', { name: 'messaggioPIC', default: () => "''" })
|
||||||
|
messaggioPic!: string;
|
||||||
|
|
||||||
|
@Column('nvarchar', {
|
||||||
|
name: 'nomeSupportoContrattoPosta',
|
||||||
|
nullable: true,
|
||||||
|
length: 80,
|
||||||
|
default: () => "''",
|
||||||
|
})
|
||||||
|
nomeSupportoContrattoPosta!: string | null;
|
||||||
|
|
||||||
|
@Column('nvarchar', {
|
||||||
|
name: 'codiceContrattoPosta',
|
||||||
|
nullable: true,
|
||||||
|
length: 80,
|
||||||
|
default: () => "''",
|
||||||
|
})
|
||||||
|
codiceContrattoPosta!: string | null;
|
||||||
|
|
||||||
|
@Column('nvarchar', {
|
||||||
|
name: 'passwordContrattoPosta',
|
||||||
|
nullable: true,
|
||||||
|
length: 80,
|
||||||
|
default: () => "''",
|
||||||
|
})
|
||||||
|
passwordContrattoPosta!: string | null;
|
||||||
|
|
||||||
|
@Column('bigint', {
|
||||||
|
name: 'codiceSpedizione',
|
||||||
|
nullable: true,
|
||||||
|
default: () => '(0)',
|
||||||
|
})
|
||||||
|
codiceSpedizione!: string | null;
|
||||||
|
|
||||||
|
@Column('nvarchar', {
|
||||||
|
name: 'oggettoEmailBonificoDomiciliato',
|
||||||
|
nullable: true,
|
||||||
|
length: 200,
|
||||||
|
default: () => "''",
|
||||||
|
})
|
||||||
|
oggettoEmailBonificoDomiciliato!: string | null;
|
||||||
|
|
||||||
|
@Column('ntext', {
|
||||||
|
name: 'emailBonificoDomiciliato',
|
||||||
|
nullable: true,
|
||||||
|
default: () => "''",
|
||||||
|
})
|
||||||
|
emailBonificoDomiciliato!: string | null;
|
||||||
|
|
||||||
|
@Column('nvarchar', {
|
||||||
|
name: 'SMSRimborsoBonificoDomiciliato',
|
||||||
|
nullable: true,
|
||||||
|
length: 200,
|
||||||
|
default: () => "''",
|
||||||
|
})
|
||||||
|
smsRimborsoBonificoDomiciliato!: string | null;
|
||||||
|
|
||||||
|
@Column('int', { name: 'notifichePush', default: () => '(0)' })
|
||||||
|
notifichePush!: number;
|
||||||
|
|
||||||
|
@Column('int', { name: 'controlloCodiceFiscale', default: () => '(-1)' })
|
||||||
|
controlloCodiceFiscale!: number;
|
||||||
|
|
||||||
|
@Column('ntext', { name: 'emailSuperamentoPIC', default: () => "''" })
|
||||||
|
emailSuperamentoPic!: string;
|
||||||
|
|
||||||
|
@Column('nvarchar', {
|
||||||
|
name: 'SMSProtocolloNotificaEsplicita',
|
||||||
|
length: 200,
|
||||||
|
default: () => "''",
|
||||||
|
})
|
||||||
|
smsProtocolloNotificaEsplicita!: string;
|
||||||
|
|
||||||
|
@Column('nvarchar', {
|
||||||
|
name: 'mittenteSportello',
|
||||||
|
length: 200,
|
||||||
|
default: () => "''",
|
||||||
|
})
|
||||||
|
mittenteSportello!: string;
|
||||||
|
|
||||||
|
@Column('nvarchar', {
|
||||||
|
name: 'oggettoEmailBonificoDomiciliatoSportello',
|
||||||
|
length: 200,
|
||||||
|
default: () => "''",
|
||||||
|
})
|
||||||
|
oggettoEmailBonificoDomiciliatoSportello!: string;
|
||||||
|
|
||||||
|
@Column('ntext', {
|
||||||
|
name: 'emailBonificoDomiciliatoSportello',
|
||||||
|
default: () => "''",
|
||||||
|
})
|
||||||
|
emailBonificoDomiciliatoSportello!: string;
|
||||||
|
|
||||||
|
@Column('nvarchar', {
|
||||||
|
name: 'oggettoEmailBonificoSportello',
|
||||||
|
length: 200,
|
||||||
|
default: () => "''",
|
||||||
|
})
|
||||||
|
oggettoEmailBonificoSportello!: string;
|
||||||
|
|
||||||
|
@Column('ntext', { name: 'emailBonificoSportello', default: () => "''" })
|
||||||
|
emailBonificoSportello!: string;
|
||||||
|
|
||||||
|
@Column('nvarchar', {
|
||||||
|
name: 'oggettoEmailSospensioneSportello',
|
||||||
|
length: 200,
|
||||||
|
default: () => "''",
|
||||||
|
})
|
||||||
|
oggettoEmailSospensioneSportello!: string;
|
||||||
|
|
||||||
|
@Column('ntext', { name: 'emailSospensioneSportello', default: () => "''" })
|
||||||
|
emailSospensioneSportello!: string;
|
||||||
|
|
||||||
|
@Column('nvarchar', {
|
||||||
|
name: 'oggettoEmailRespingimentoSportello',
|
||||||
|
length: 200,
|
||||||
|
default: () => "''",
|
||||||
|
})
|
||||||
|
oggettoEmailRespingimentoSportello!: string;
|
||||||
|
|
||||||
|
@Column('ntext', { name: 'emailRespingimentoSportello', default: () => "''" })
|
||||||
|
emailRespingimentoSportello!: string;
|
||||||
|
|
||||||
|
@Column('nvarchar', {
|
||||||
|
name: 'oggettoEmailSospensione',
|
||||||
|
length: 200,
|
||||||
|
default: () => "''",
|
||||||
|
})
|
||||||
|
oggettoEmailSospensione!: string;
|
||||||
|
|
||||||
|
@Column('ntext', { name: 'emailSospensione', default: () => "''" })
|
||||||
|
emailSospensione!: string;
|
||||||
|
|
||||||
|
@Column('nvarchar', {
|
||||||
|
name: 'oggettoEmailRespingimento',
|
||||||
|
length: 200,
|
||||||
|
default: () => "''",
|
||||||
|
})
|
||||||
|
oggettoEmailRespingimento!: string;
|
||||||
|
|
||||||
|
@Column('ntext', { name: 'emailRespingimento', default: () => "''" })
|
||||||
|
emailRespingimento!: string;
|
||||||
|
|
||||||
|
@Column('nvarchar', {
|
||||||
|
name: 'mittentePICdisdetta',
|
||||||
|
nullable: true,
|
||||||
|
length: 400,
|
||||||
|
})
|
||||||
|
mittentePiCdisdetta!: string | null;
|
||||||
|
|
||||||
|
@Column('ntext', { name: 'oggettoPICdisdetta', nullable: true })
|
||||||
|
oggettoPiCdisdetta!: string | null;
|
||||||
|
|
||||||
|
@Column('ntext', { name: 'messaggioPICdisdetta', nullable: true })
|
||||||
|
messaggioPiCdisdetta!: string | null;
|
||||||
|
|
||||||
|
@Column('int', { name: 'modalitaMassimaleBonifico', default: () => '(0)' })
|
||||||
|
modalitaMassimaleBonifico!: number;
|
||||||
|
|
||||||
|
@Column('nvarchar', { name: 'portaSMTP', length: 10, default: () => "''" })
|
||||||
|
portaSmtp!: string;
|
||||||
|
|
||||||
|
@Column('int', { name: 'useSSL', default: () => '(0)' })
|
||||||
|
useSsl!: number;
|
||||||
|
|
||||||
|
@Column('nvarchar', {
|
||||||
|
name: 'serverSMTPSpot',
|
||||||
|
length: 200,
|
||||||
|
default: () => "''",
|
||||||
|
})
|
||||||
|
serverSmtpSpot!: string;
|
||||||
|
|
||||||
|
@Column('nvarchar', {
|
||||||
|
name: 'usernameSMTPSpot',
|
||||||
|
length: 200,
|
||||||
|
default: () => "''",
|
||||||
|
})
|
||||||
|
usernameSmtpSpot!: string;
|
||||||
|
|
||||||
|
@Column('nvarchar', {
|
||||||
|
name: 'passwordSMTPSpot',
|
||||||
|
length: 200,
|
||||||
|
default: () => "''",
|
||||||
|
})
|
||||||
|
passwordSmtpSpot!: string;
|
||||||
|
|
||||||
|
@Column('nvarchar', {
|
||||||
|
name: 'portaSMTPSpot',
|
||||||
|
length: 10,
|
||||||
|
default: () => "''",
|
||||||
|
})
|
||||||
|
portaSmtpSpot!: string;
|
||||||
|
|
||||||
|
@Column('int', { name: 'useSSLSpot', default: () => '(0)' })
|
||||||
|
useSslSpot!: number;
|
||||||
|
|
||||||
|
@Column('nvarchar', {
|
||||||
|
name: 'cartellaPubblicazioneLocale',
|
||||||
|
length: 512,
|
||||||
|
default: () => "''",
|
||||||
|
})
|
||||||
|
cartellaPubblicazioneLocale!: string;
|
||||||
|
|
||||||
|
@Column('int', { name: 'portaFTP', default: () => '(0)' })
|
||||||
|
portaFtp!: number;
|
||||||
|
|
||||||
|
@Column('nvarchar', {
|
||||||
|
name: 'cartellaAllegatiFTP',
|
||||||
|
length: 200,
|
||||||
|
default: () => "''",
|
||||||
|
})
|
||||||
|
cartellaAllegatiFtp!: string;
|
||||||
|
|
||||||
|
@Column('nvarchar', {
|
||||||
|
name: 'mittentiEmailNotificaEmissioneRimborsoSocio',
|
||||||
|
nullable: true,
|
||||||
|
length: 80,
|
||||||
|
})
|
||||||
|
mittentiEmailNotificaEmissioneRimborsoSocio!: string | null;
|
||||||
|
|
||||||
|
@Column('nvarchar', {
|
||||||
|
name: 'mittentiEmailInvioAllegatiPraticaSocio',
|
||||||
|
nullable: true,
|
||||||
|
length: 80,
|
||||||
|
})
|
||||||
|
mittentiEmailInvioAllegatiPraticaSocio!: string | null;
|
||||||
|
|
||||||
|
@Column('nvarchar', {
|
||||||
|
name: 'mittentiEmailRichiestaDatiBancariSocio',
|
||||||
|
nullable: true,
|
||||||
|
length: 80,
|
||||||
|
})
|
||||||
|
mittentiEmailRichiestaDatiBancariSocio!: string | null;
|
||||||
|
|
||||||
|
@Column('nvarchar', {
|
||||||
|
name: 'mittentiEmailLettereRichiestaContributiRinnoviIndividuali',
|
||||||
|
nullable: true,
|
||||||
|
length: 80,
|
||||||
|
})
|
||||||
|
mittentiEmailLettereRichiestaContributiRinnoviIndividuali!: string | null;
|
||||||
|
|
||||||
|
@Column('nvarchar', {
|
||||||
|
name: 'mittentiEmailLettereSoci',
|
||||||
|
nullable: true,
|
||||||
|
length: 80,
|
||||||
|
})
|
||||||
|
mittentiEmailLettereSoci!: string | null;
|
||||||
|
|
||||||
|
@Column('nvarchar', {
|
||||||
|
name: 'mittentiEmailLettereStrutture',
|
||||||
|
nullable: true,
|
||||||
|
length: 80,
|
||||||
|
})
|
||||||
|
mittentiEmailLettereStrutture!: string | null;
|
||||||
|
|
||||||
|
@Column('nvarchar', {
|
||||||
|
name: 'mittentiEmailLettereContratti',
|
||||||
|
nullable: true,
|
||||||
|
length: 80,
|
||||||
|
})
|
||||||
|
mittentiEmailLettereContratti!: string | null;
|
||||||
|
|
||||||
|
@Column('nvarchar', {
|
||||||
|
name: 'emailNotificaCodiciFiscaliDoppiMittente',
|
||||||
|
nullable: true,
|
||||||
|
length: 80,
|
||||||
|
})
|
||||||
|
emailNotificaCodiciFiscaliDoppiMittente!: string | null;
|
||||||
|
|
||||||
|
@Column('nvarchar', {
|
||||||
|
name: 'emailNotificaCodiciFiscaliDoppiDestinatari',
|
||||||
|
nullable: true,
|
||||||
|
length: 80,
|
||||||
|
})
|
||||||
|
emailNotificaCodiciFiscaliDoppiDestinatari!: string | null;
|
||||||
|
|
||||||
|
@Column('nvarchar', {
|
||||||
|
name: 'emailNotificaCodiciFiscaliDoppiCc',
|
||||||
|
nullable: true,
|
||||||
|
length: 200,
|
||||||
|
})
|
||||||
|
emailNotificaCodiciFiscaliDoppiCc!: string | null;
|
||||||
|
|
||||||
|
@Column('nvarchar', {
|
||||||
|
name: 'oggettoEmailRichiestaDatiBancari',
|
||||||
|
length: 200,
|
||||||
|
default: () => "''",
|
||||||
|
})
|
||||||
|
oggettoEmailRichiestaDatiBancari!: string;
|
||||||
|
|
||||||
|
@Column('ntext', { name: 'emailRichiestaDatiBancari', default: () => "''" })
|
||||||
|
emailRichiestaDatiBancari!: string;
|
||||||
|
|
||||||
|
@Column('int', {
|
||||||
|
name: 'flagAllegaModuloIbanEmailRichiestaDatiBancari',
|
||||||
|
nullable: true,
|
||||||
|
})
|
||||||
|
flagAllegaModuloIbanEmailRichiestaDatiBancari!: number | null;
|
||||||
|
|
||||||
|
@OneToMany(() => EnteEntity, (enteEntity) => enteEntity.gruppo)
|
||||||
|
enti!: EnteEntity[];
|
||||||
|
|
||||||
|
constructor(init?: Partial<GruppoEntity>) {
|
||||||
|
Object.assign(this, init);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,13 @@
|
|||||||
|
export * from './API_CAP_Luoghi.entity';
|
||||||
|
export * from './API_Luoghi.entity';
|
||||||
|
export * from './API_Luoghi_Estero.entity';
|
||||||
|
export * from './allegati.entity';
|
||||||
|
export * from './contratto.entity';
|
||||||
|
export * from './ente.entity';
|
||||||
|
export * from './formeAssistenza.entity';
|
||||||
|
export * from './gruppo.entity';
|
||||||
|
export * from './missioni.entity';
|
||||||
|
export * from './socio.entity';
|
||||||
|
export * from './socioContratto.entity';
|
||||||
|
export * from './socioFormeAssistenza.entity';
|
||||||
|
export * from './sportelli.entity';
|
@ -0,0 +1,53 @@
|
|||||||
|
import { Column, Entity, Index } from 'typeorm';
|
||||||
|
|
||||||
|
@Index(
|
||||||
|
'PK_Missioni_Data',
|
||||||
|
[
|
||||||
|
'codiceFiscale',
|
||||||
|
'tipoDocumento',
|
||||||
|
'idMissione',
|
||||||
|
'idLettera',
|
||||||
|
'idPratica',
|
||||||
|
'idAgenzia',
|
||||||
|
'dataInizio',
|
||||||
|
'dataFine',
|
||||||
|
'tipoContratto',
|
||||||
|
],
|
||||||
|
{ unique: true },
|
||||||
|
)
|
||||||
|
@Entity('missioni')
|
||||||
|
export class MissioniEntity {
|
||||||
|
@Column('nvarchar', { primary: true, name: 'codiceFiscale', length: 20 })
|
||||||
|
codiceFiscale!: string;
|
||||||
|
|
||||||
|
@Column('bigint', { primary: true, name: 'tipoDocumento' })
|
||||||
|
tipoDocumento!: string;
|
||||||
|
|
||||||
|
@Column('bigint', { primary: true, name: 'idMissione' })
|
||||||
|
idMissione!: string;
|
||||||
|
|
||||||
|
@Column('bigint', { primary: true, name: 'idLettera' })
|
||||||
|
idLettera!: string;
|
||||||
|
|
||||||
|
@Column('bigint', { primary: true, name: 'idPratica' })
|
||||||
|
idPratica!: string;
|
||||||
|
|
||||||
|
@Column('bigint', { primary: true, name: 'idAgenzia' })
|
||||||
|
idAgenzia!: string;
|
||||||
|
|
||||||
|
@Column('nvarchar', { primary: true, name: 'dataInizio', length: 10 })
|
||||||
|
dataInizio!: string;
|
||||||
|
|
||||||
|
@Column('nvarchar', { primary: true, name: 'dataFine', length: 10 })
|
||||||
|
dataFine!: string;
|
||||||
|
|
||||||
|
@Column('nvarchar', { primary: true, name: 'tipoContratto', length: 20 })
|
||||||
|
tipoContratto!: string;
|
||||||
|
|
||||||
|
@Column('bigint', { name: 'progressivoRecord', default: () => '(0)' })
|
||||||
|
progressivoRecord!: string;
|
||||||
|
|
||||||
|
constructor(init?: Partial<MissioniEntity>) {
|
||||||
|
Object.assign(this, init);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,651 @@
|
|||||||
|
import { Column, Entity, Index, JoinColumn, ManyToOne, OneToMany } from 'typeorm';
|
||||||
|
import { ApiLuoghiEntity } from './API_Luoghi.entity';
|
||||||
|
import { GruppoEntity } from './gruppo.entity';
|
||||||
|
import { SocioContrattoEntity } from './socioContratto.entity';
|
||||||
|
import { SocioFormeAssistenzaEntity } from './socioFormeAssistenza.entity';
|
||||||
|
|
||||||
|
@Index('PK_socio', ['codiceSocio'], { unique: true })
|
||||||
|
@Entity('socio')
|
||||||
|
export class SocioEntity {
|
||||||
|
@Column('bigint', { name: 'codiceGruppo', nullable: true })
|
||||||
|
codiceGruppo!: string | null;
|
||||||
|
|
||||||
|
@Column('bigint', { primary: true, name: 'codiceSocio' })
|
||||||
|
codiceSocio!: string;
|
||||||
|
|
||||||
|
@Column('bigint', { name: 'matricolaSocio', nullable: true })
|
||||||
|
matricolaSocio!: string | null;
|
||||||
|
|
||||||
|
@Column('nvarchar', { name: 'cognome', nullable: true, length: 80 })
|
||||||
|
cognome!: string | null;
|
||||||
|
|
||||||
|
@Column('nvarchar', { name: 'nome', nullable: true, length: 80 })
|
||||||
|
nome!: string | null;
|
||||||
|
|
||||||
|
@Column('nvarchar', { name: 'dataNascita', nullable: true, length: 10 })
|
||||||
|
dataNascita!: string | null;
|
||||||
|
|
||||||
|
@Column('nvarchar', { name: 'codiceFiscale', nullable: true, length: 20 })
|
||||||
|
codiceFiscale!: string | null;
|
||||||
|
|
||||||
|
@Column('bigint', { name: 'codiceContrattoOld', nullable: true })
|
||||||
|
codiceContrattoOld!: string | null;
|
||||||
|
|
||||||
|
@Column('bigint', { name: 'socio.codiceFiguraContrattoOld', nullable: true })
|
||||||
|
socioCodiceFiguraContrattoOld!: string | null;
|
||||||
|
|
||||||
|
@Column('bigint', { name: 'codiceRivenditore', nullable: true })
|
||||||
|
codiceRivenditore!: string | null;
|
||||||
|
|
||||||
|
@Column('bigint', { name: 'utenteCreazione', nullable: true })
|
||||||
|
utenteCreazione!: string | null;
|
||||||
|
|
||||||
|
@Column('nvarchar', { name: 'dataCreazione', nullable: true, length: 10 })
|
||||||
|
dataCreazione!: string | null;
|
||||||
|
|
||||||
|
@Column('nvarchar', { name: 'oraCreazione', nullable: true, length: 8 })
|
||||||
|
oraCreazione!: string | null;
|
||||||
|
|
||||||
|
@Column('bigint', { name: 'utenteModifica', nullable: true })
|
||||||
|
utenteModifica!: string | null;
|
||||||
|
|
||||||
|
@Column('nvarchar', { name: 'dataModifica', nullable: true, length: 10 })
|
||||||
|
dataModifica!: string | null;
|
||||||
|
|
||||||
|
@Column('nvarchar', { name: 'oraModifica', nullable: true, length: 8 })
|
||||||
|
oraModifica!: string | null;
|
||||||
|
|
||||||
|
@Column('nvarchar', {
|
||||||
|
name: 'residenzaIndirizzo',
|
||||||
|
nullable: true,
|
||||||
|
length: 80,
|
||||||
|
})
|
||||||
|
residenzaIndirizzo!: string | null;
|
||||||
|
|
||||||
|
@Column('nvarchar', {
|
||||||
|
name: 'residenzaNumeroCivico',
|
||||||
|
nullable: true,
|
||||||
|
length: 80,
|
||||||
|
})
|
||||||
|
residenzaNumeroCivico!: string | null;
|
||||||
|
|
||||||
|
@Column('nvarchar', { name: 'residenzaLocalita', nullable: true, length: 80 })
|
||||||
|
residenzaLocalita!: string | null;
|
||||||
|
|
||||||
|
@Column('nvarchar', { name: 'residenzaCAP', nullable: true, length: 10 })
|
||||||
|
residenzaCap!: string | null;
|
||||||
|
|
||||||
|
@Column('bigint', { name: 'residenzaProvincia', nullable: true })
|
||||||
|
residenzaProvincia!: string | null;
|
||||||
|
|
||||||
|
@Column('bigint', { name: 'residenzaStato', nullable: true })
|
||||||
|
residenzaStato!: string | null;
|
||||||
|
|
||||||
|
@Column('nvarchar', {
|
||||||
|
name: 'domicilioIndirizzo',
|
||||||
|
nullable: true,
|
||||||
|
length: 80,
|
||||||
|
})
|
||||||
|
domicilioIndirizzo!: string | null;
|
||||||
|
|
||||||
|
@Column('nvarchar', {
|
||||||
|
name: 'domicilioNumeroCivico',
|
||||||
|
nullable: true,
|
||||||
|
length: 80,
|
||||||
|
})
|
||||||
|
domicilioNumeroCivico!: string | null;
|
||||||
|
|
||||||
|
@Column('nvarchar', { name: 'domicilioLocalita', nullable: true, length: 80 })
|
||||||
|
domicilioLocalita!: string | null;
|
||||||
|
|
||||||
|
@Column('nvarchar', { name: 'domicilioCAP', nullable: true, length: 10 })
|
||||||
|
domicilioCap!: string | null;
|
||||||
|
|
||||||
|
@Column('bigint', { name: 'domicilioProvincia', nullable: true })
|
||||||
|
domicilioProvincia!: string | null;
|
||||||
|
|
||||||
|
@Column('bigint', { name: 'domicilioStato', nullable: true })
|
||||||
|
domicilioStato!: string | null;
|
||||||
|
|
||||||
|
@Column('nvarchar', { name: 'nascitaLocalita', nullable: true, length: 80 })
|
||||||
|
nascitaLocalita!: string | null;
|
||||||
|
|
||||||
|
@Column('nvarchar', { name: 'nascitaCAP', nullable: true, length: 10 })
|
||||||
|
nascitaCap!: string | null;
|
||||||
|
|
||||||
|
@Column('bigint', { name: 'nascitaProvincia', nullable: true })
|
||||||
|
nascitaProvincia!: string | null;
|
||||||
|
|
||||||
|
@Column('bigint', { name: 'nascitaStato', nullable: true })
|
||||||
|
nascitaStato!: string | null;
|
||||||
|
|
||||||
|
@Column('nvarchar', { name: 'telefono', nullable: true, length: 80 })
|
||||||
|
telefono!: string | null;
|
||||||
|
|
||||||
|
@Column('nvarchar', { name: 'cellulare', nullable: true, length: 80 })
|
||||||
|
cellulare!: string | null;
|
||||||
|
|
||||||
|
@Column('nvarchar', { name: 'email', nullable: true, length: 80 })
|
||||||
|
email!: string | null;
|
||||||
|
|
||||||
|
@Column('bigint', { name: 'codiceSesso', nullable: true })
|
||||||
|
codiceSesso!: string | null;
|
||||||
|
|
||||||
|
@Column('bigint', { name: 'codiceStatoCivile', nullable: true })
|
||||||
|
codiceStatoCivile!: string | null;
|
||||||
|
|
||||||
|
@Column('bigint', { name: 'codiceProfessione', nullable: true })
|
||||||
|
codiceProfessione!: string | null;
|
||||||
|
|
||||||
|
@Column('int', { name: 'consensoComunicazioneDati', nullable: true })
|
||||||
|
consensoComunicazioneDati!: number | null;
|
||||||
|
|
||||||
|
@Column('int', { name: 'consensoDiffusioneDati', nullable: true })
|
||||||
|
consensoDiffusioneDati!: number | null;
|
||||||
|
|
||||||
|
@Column('int', { name: 'riassicurato', nullable: true })
|
||||||
|
riassicurato!: number | null;
|
||||||
|
|
||||||
|
@Column('nvarchar', { name: 'fax', nullable: true, length: 80 })
|
||||||
|
fax!: string | null;
|
||||||
|
|
||||||
|
@Column('nvarchar', { name: 'dataIscrizione', nullable: true, length: 10 })
|
||||||
|
dataIscrizione!: string | null;
|
||||||
|
|
||||||
|
@Column('nvarchar', {
|
||||||
|
name: 'dataRichiestaRecesso',
|
||||||
|
nullable: true,
|
||||||
|
length: 10,
|
||||||
|
})
|
||||||
|
dataRichiestaRecesso!: string | null;
|
||||||
|
|
||||||
|
@Column('nvarchar', { name: 'dataRecesso', nullable: true, length: 10 })
|
||||||
|
dataRecesso!: string | null;
|
||||||
|
|
||||||
|
@Column('int', { name: 'recessoAnnoSolareSuccessivo', nullable: true })
|
||||||
|
recessoAnnoSolareSuccessivo!: number | null;
|
||||||
|
|
||||||
|
@Column('int', { name: 'capofamiglia', nullable: true })
|
||||||
|
flagCapofamiglia!: number | null;
|
||||||
|
|
||||||
|
@Column('bigint', { name: 'livelloFamiliare', nullable: true })
|
||||||
|
livelloFamiliare!: string | null;
|
||||||
|
|
||||||
|
@Column('bigint', { name: 'codiceCapofamiglia', nullable: true })
|
||||||
|
codiceCapofamiglia!: string | null;
|
||||||
|
|
||||||
|
@Column('nvarchar', { name: 'codicePaese', nullable: true, length: 50 })
|
||||||
|
codicePaese!: string | null;
|
||||||
|
|
||||||
|
@Column('nvarchar', { name: 'codiceCIN', nullable: true, length: 50 })
|
||||||
|
codiceCin!: string | null;
|
||||||
|
|
||||||
|
@Column('nvarchar', { name: 'checkDigitCIN', nullable: true, length: 50 })
|
||||||
|
checkDigitCin!: string | null;
|
||||||
|
|
||||||
|
@Column('nvarchar', { name: 'rifBancaEstero', nullable: true, length: 50 })
|
||||||
|
rifBancaEstero!: string | null;
|
||||||
|
|
||||||
|
@Column('nvarchar', { name: 'contoCorrente', nullable: true, length: 50 })
|
||||||
|
contoCorrente!: string | null;
|
||||||
|
|
||||||
|
@Column('nvarchar', { name: 'codiceBIC', nullable: true, length: 50 })
|
||||||
|
codiceBic!: string | null;
|
||||||
|
|
||||||
|
@Column('nvarchar', { name: 'codiceIBAN', nullable: true, length: 50 })
|
||||||
|
codiceIban!: string | null;
|
||||||
|
|
||||||
|
@Column('nvarchar', { name: 'codiceABI', nullable: true, length: 50 })
|
||||||
|
codiceAbi!: string | null;
|
||||||
|
|
||||||
|
@Column('nvarchar', { name: 'codiceCAB', nullable: true, length: 10 })
|
||||||
|
codiceCab!: string | null;
|
||||||
|
|
||||||
|
@Column('nvarchar', { name: 'dataDecesso', nullable: true, length: 10 })
|
||||||
|
dataDecesso!: string | null;
|
||||||
|
|
||||||
|
@Column('int', { name: 'modalitaSuddivisioneContributi', nullable: true })
|
||||||
|
modalitaSuddivisioneContributi!: number | null;
|
||||||
|
|
||||||
|
@Column('nvarchar', { name: 'dataEsclusione', nullable: true, length: 10 })
|
||||||
|
dataEsclusione!: string | null;
|
||||||
|
|
||||||
|
@Column('bigint', { name: 'codiceMotivoEsclusione', nullable: true })
|
||||||
|
codiceMotivoEsclusione!: string | null;
|
||||||
|
|
||||||
|
@Column('ntext', { name: 'noteEsclusione', nullable: true })
|
||||||
|
noteEsclusione!: string | null;
|
||||||
|
|
||||||
|
@Column('nvarchar', { name: 'usernameWEB', nullable: true, length: 80 })
|
||||||
|
usernameWeb!: string | null;
|
||||||
|
|
||||||
|
@Column('nvarchar', { name: 'passwordWEB', nullable: true, length: 80 })
|
||||||
|
passwordWeb!: string | null;
|
||||||
|
|
||||||
|
@Column('int', { name: 'consensoNucleoFamiliare', nullable: true })
|
||||||
|
consensoNucleoFamiliare!: number | null;
|
||||||
|
|
||||||
|
@Column('int', { name: 'webAccessoDisabilitato', nullable: true })
|
||||||
|
webAccessoDisabilitato!: number | null;
|
||||||
|
|
||||||
|
@Column('int', { name: 'webModificaDati', nullable: true })
|
||||||
|
webModificaDati!: number | null;
|
||||||
|
|
||||||
|
@Column('int', { name: 'webInfo', nullable: true })
|
||||||
|
webInfo!: number | null;
|
||||||
|
|
||||||
|
@Column('int', { name: 'webStrutture', nullable: true })
|
||||||
|
webStrutture!: number | null;
|
||||||
|
|
||||||
|
@Column('int', { name: 'webPratiche', nullable: true })
|
||||||
|
webPratiche!: number | null;
|
||||||
|
|
||||||
|
@Column('int', { name: 'webCertificazione', nullable: true })
|
||||||
|
webCertificazione!: number | null;
|
||||||
|
|
||||||
|
@Column('int', { name: 'webRimborsiBase', nullable: true })
|
||||||
|
webRimborsiBase!: number | null;
|
||||||
|
|
||||||
|
@Column('int', { name: 'webRimborsiAvanzato', nullable: true })
|
||||||
|
webRimborsiAvanzato!: number | null;
|
||||||
|
|
||||||
|
@Column('int', { name: 'webRichiestaPresaCarico', nullable: true })
|
||||||
|
webRichiestaPresaCarico!: number | null;
|
||||||
|
|
||||||
|
@Column('int', { name: 'webServizioCup', nullable: true })
|
||||||
|
webServizioCup!: number | null;
|
||||||
|
|
||||||
|
@Column('int', { name: 'webEmailUsername', nullable: true })
|
||||||
|
webEmailUsername!: number | null;
|
||||||
|
|
||||||
|
@Column('bigint', { name: 'categoria1', nullable: true })
|
||||||
|
categoria1!: string | null;
|
||||||
|
|
||||||
|
@Column('bigint', { name: 'categoria2', nullable: true })
|
||||||
|
categoria2!: string | null;
|
||||||
|
|
||||||
|
@Column('bigint', { name: 'categoria3', nullable: true })
|
||||||
|
categoria3!: string | null;
|
||||||
|
|
||||||
|
@Column('bigint', { name: 'categoria4', nullable: true })
|
||||||
|
categoria4!: string | null;
|
||||||
|
|
||||||
|
@Column('bigint', { name: 'categoria5', nullable: true })
|
||||||
|
categoria5!: string | null;
|
||||||
|
|
||||||
|
@Column('int', { name: 'socioEsterno', nullable: true })
|
||||||
|
socioEsterno!: number | null;
|
||||||
|
|
||||||
|
@Column('bigint', { name: 'codiceMutua', nullable: true })
|
||||||
|
codiceMutua!: string | null;
|
||||||
|
|
||||||
|
@Column('nvarchar', {
|
||||||
|
name: 'dataInizioValidita',
|
||||||
|
nullable: true,
|
||||||
|
length: 10,
|
||||||
|
})
|
||||||
|
dataInizioValidita!: string | null;
|
||||||
|
|
||||||
|
@Column('nvarchar', { name: 'dataFineValidita', nullable: true, length: 10 })
|
||||||
|
dataFineValidita!: string | null;
|
||||||
|
|
||||||
|
@Column('bigint', { name: 'idAssiBase', nullable: true })
|
||||||
|
idAssiBase!: string | null;
|
||||||
|
|
||||||
|
@Column('nvarchar', {
|
||||||
|
name: 'protezioniAssiBase',
|
||||||
|
nullable: true,
|
||||||
|
length: 80,
|
||||||
|
})
|
||||||
|
protezioniAssiBase!: string | null;
|
||||||
|
|
||||||
|
@Column('nvarchar', { name: 'gruppoAssiBase', nullable: true, length: 80 })
|
||||||
|
gruppoAssiBase!: string | null;
|
||||||
|
|
||||||
|
@Column('ntext', { name: 'noteAnagrafica', nullable: true })
|
||||||
|
noteAnagrafica!: string | null;
|
||||||
|
|
||||||
|
@Column('bigint', { name: 'tipoSocio', nullable: true })
|
||||||
|
tipoSocio!: string | null;
|
||||||
|
|
||||||
|
@Column('int', { name: 'stampatoLibroSoci', default: () => '(0)' })
|
||||||
|
stampatoLibroSoci!: number;
|
||||||
|
|
||||||
|
@Column('nvarchar', {
|
||||||
|
name: 'dataStampaLibroSoci',
|
||||||
|
nullable: true,
|
||||||
|
length: 10,
|
||||||
|
})
|
||||||
|
dataStampaLibroSoci!: string | null;
|
||||||
|
|
||||||
|
@Column('int', { name: 'codiceModalitaPagamentoRimborsi', nullable: true })
|
||||||
|
codiceModalitaPagamentoRimborsi!: number | null;
|
||||||
|
|
||||||
|
@Column('int', { name: 'codiceModalitaVersamentoContributi', nullable: true })
|
||||||
|
codiceModalitaVersamentoContributi!: number | null;
|
||||||
|
|
||||||
|
@Column('nvarchar', { name: 'dataAssunzione', nullable: true, length: 10 })
|
||||||
|
dataAssunzione!: string | null;
|
||||||
|
|
||||||
|
@Column('bigint', { name: 'codiceMotivoRecesso', nullable: true })
|
||||||
|
codiceMotivoRecesso!: string | null;
|
||||||
|
|
||||||
|
@Column('int', { name: 'codiceCanaleComunicazione', nullable: true })
|
||||||
|
codiceCanaleComunicazione!: number | null;
|
||||||
|
|
||||||
|
@Column('nvarchar', { name: 'dataRegistrazione', nullable: true, length: 10 })
|
||||||
|
dataRegistrazione!: string | null;
|
||||||
|
|
||||||
|
@Column('ntext', { name: 'noteAnamnesi', nullable: true })
|
||||||
|
noteAnamnesi!: string | null;
|
||||||
|
|
||||||
|
@Column('bigint', {
|
||||||
|
name: 'codiceModalitacessazioneContributiInfrannuale',
|
||||||
|
nullable: true,
|
||||||
|
})
|
||||||
|
codiceModalitacessazioneContributiInfrannuale!: string | null;
|
||||||
|
|
||||||
|
@Column('int', {
|
||||||
|
name: 'forzaCodiceModalitacessazioneContributiInfrannuale',
|
||||||
|
nullable: true,
|
||||||
|
})
|
||||||
|
forzaCodiceModalitacessazioneContributiInfrannuale!: number | null;
|
||||||
|
|
||||||
|
@Column('nvarchar', {
|
||||||
|
name: 'matricolaAziendale',
|
||||||
|
nullable: true,
|
||||||
|
length: 80,
|
||||||
|
})
|
||||||
|
matricolaAziendale!: string | null;
|
||||||
|
|
||||||
|
@Column('int', { name: 'coniugeCarico', nullable: true })
|
||||||
|
coniugeCarico!: number | null;
|
||||||
|
|
||||||
|
@Column('ntext', { name: 'noteProtezioni', nullable: true })
|
||||||
|
noteProtezioni!: string | null;
|
||||||
|
|
||||||
|
@Column('bigint', { name: 'idNucleo', nullable: true })
|
||||||
|
idNucleo!: string | null;
|
||||||
|
|
||||||
|
@Column('bigint', { name: 'idSocio', nullable: true })
|
||||||
|
idSocio!: string | null;
|
||||||
|
|
||||||
|
@Column('bigint', { name: 'idLibroSoci', nullable: true })
|
||||||
|
idLibroSoci!: string | null;
|
||||||
|
|
||||||
|
@Column('bigint', { name: 'idPersona', nullable: true })
|
||||||
|
idPersona!: string | null;
|
||||||
|
|
||||||
|
@Column('bigint', { name: 'codicePromoter', nullable: true })
|
||||||
|
codicePromoter!: string | null;
|
||||||
|
|
||||||
|
@Column('bigint', { name: 'originePromoter', nullable: true })
|
||||||
|
originePromoter!: string | null;
|
||||||
|
|
||||||
|
@Column('bigint', { name: 'livelloFamiliareAnagrafica', nullable: true })
|
||||||
|
livelloFamiliareAnagrafica!: string | null;
|
||||||
|
|
||||||
|
@Column('bigint', { name: 'codiceCapoFamigliaAnagrafica', nullable: true })
|
||||||
|
codiceCapoFamigliaAnagrafica!: string | null;
|
||||||
|
|
||||||
|
@Column('int', { name: 'codiceModalitaVersamentoRID', nullable: true })
|
||||||
|
codiceModalitaVersamentoRid!: number | null;
|
||||||
|
|
||||||
|
@Column('nvarchar', {
|
||||||
|
name: 'dataPossibileAmmissione',
|
||||||
|
nullable: true,
|
||||||
|
length: 10,
|
||||||
|
})
|
||||||
|
dataPossibileAmmissione!: string | null;
|
||||||
|
|
||||||
|
@Column('nvarchar', { name: 'banca', nullable: true, length: 255 })
|
||||||
|
banca!: string | null;
|
||||||
|
|
||||||
|
@Column('nvarchar', { name: 'agenziaBanca', nullable: true, length: 255 })
|
||||||
|
agenziaBanca!: string | null;
|
||||||
|
|
||||||
|
@Column('nvarchar', { name: 'intestazioneCC', nullable: true, length: 255 })
|
||||||
|
intestazioneCc!: string | null;
|
||||||
|
|
||||||
|
@Column('nvarchar', {
|
||||||
|
name: 'dataRicezioneRichiestaRecesso',
|
||||||
|
nullable: true,
|
||||||
|
length: 10,
|
||||||
|
})
|
||||||
|
dataRicezioneRichiestaRecesso!: string | null;
|
||||||
|
|
||||||
|
@Column('nvarchar', { name: 'dataUscitaNucleo', nullable: true, length: 10 })
|
||||||
|
dataUscitaNucleo!: string | null;
|
||||||
|
|
||||||
|
@Column('int', { name: 'datiBancariDaAggiornare', nullable: true })
|
||||||
|
datiBancariDaAggiornare!: number | null;
|
||||||
|
|
||||||
|
@Column('nvarchar', { name: 'telefono2', nullable: true, length: 80 })
|
||||||
|
telefono2!: string | null;
|
||||||
|
|
||||||
|
@Column('nvarchar', {
|
||||||
|
name: 'dataModificaIban',
|
||||||
|
nullable: true,
|
||||||
|
length: 10,
|
||||||
|
default: () => "''",
|
||||||
|
})
|
||||||
|
dataModificaIban!: string | null;
|
||||||
|
|
||||||
|
@Column('int', {
|
||||||
|
name: 'richiestoIBAN',
|
||||||
|
nullable: true,
|
||||||
|
default: () => '(0)',
|
||||||
|
})
|
||||||
|
richiestoIban!: number | null;
|
||||||
|
|
||||||
|
@Column('nvarchar', {
|
||||||
|
name: 'dataRichiestaIBAN',
|
||||||
|
nullable: true,
|
||||||
|
length: 10,
|
||||||
|
default: () => "''",
|
||||||
|
})
|
||||||
|
dataRichiestaIban!: string | null;
|
||||||
|
|
||||||
|
@Column('int', { name: 'comunicazioniViaEmail', nullable: true })
|
||||||
|
comunicazioniViaEmail!: number | null;
|
||||||
|
|
||||||
|
@Column('int', { name: 'esitoUltimaValidazione', nullable: true })
|
||||||
|
esitoUltimaValidazione!: number | null;
|
||||||
|
|
||||||
|
@Column('nvarchar', {
|
||||||
|
name: 'dataOraUltimaValidazione',
|
||||||
|
nullable: true,
|
||||||
|
length: 50,
|
||||||
|
})
|
||||||
|
dataOraUltimaValidazione!: string | null;
|
||||||
|
|
||||||
|
@Column('ntext', { name: 'noteUltimaValidazione', nullable: true })
|
||||||
|
noteUltimaValidazione!: string | null;
|
||||||
|
|
||||||
|
@Column('int', { name: 'stampareLibroSoci', default: () => '(0)' })
|
||||||
|
stampareLibroSoci!: number;
|
||||||
|
|
||||||
|
@Column('nvarchar', {
|
||||||
|
name: 'dataStampaCessazioneLibroSoci',
|
||||||
|
nullable: true,
|
||||||
|
length: 10,
|
||||||
|
default: () => "'9998-12-31'",
|
||||||
|
})
|
||||||
|
dataStampaCessazioneLibroSoci!: string | null;
|
||||||
|
|
||||||
|
@Column('int', {
|
||||||
|
name: 'stampataCessazioneLibroSoci',
|
||||||
|
nullable: true,
|
||||||
|
default: () => '(0)',
|
||||||
|
})
|
||||||
|
stampataCessazioneLibroSoci!: number | null;
|
||||||
|
|
||||||
|
@Column('int', { name: 'adesioneWeb', default: () => '(0)' })
|
||||||
|
adesioneWeb!: number;
|
||||||
|
|
||||||
|
@Column('int', { name: 'preeesistenzaContratto', default: () => '(0)' })
|
||||||
|
preeesistenzaContratto!: number;
|
||||||
|
|
||||||
|
@Column('int', { name: 'preeesistenzaInclusa', default: () => '(0)' })
|
||||||
|
preeesistenzaInclusa!: number;
|
||||||
|
|
||||||
|
@Column('nvarchar', { name: 'IBANRid', length: 50, default: () => "''" })
|
||||||
|
ibanRid!: string;
|
||||||
|
|
||||||
|
@Column('nvarchar', {
|
||||||
|
name: 'intestatarioContoRid',
|
||||||
|
length: 255,
|
||||||
|
default: () => "''",
|
||||||
|
})
|
||||||
|
intestatarioContoRid!: string;
|
||||||
|
|
||||||
|
@Column('nvarchar', {
|
||||||
|
name: 'dataMandato',
|
||||||
|
length: 10,
|
||||||
|
default: () => "'9998-12-31'",
|
||||||
|
})
|
||||||
|
dataMandato!: string;
|
||||||
|
|
||||||
|
@Column('nvarchar', { name: 'idMandato', length: 10, default: () => "''" })
|
||||||
|
idMandato!: string;
|
||||||
|
|
||||||
|
@Column('nvarchar', { name: 'codiceSWIFT', length: 80, default: () => "''" })
|
||||||
|
codiceSwift!: string;
|
||||||
|
|
||||||
|
@Column('decimal', {
|
||||||
|
name: 'percentualeFamiliareACarico',
|
||||||
|
precision: 18,
|
||||||
|
scale: 2,
|
||||||
|
default: () => '(0)',
|
||||||
|
})
|
||||||
|
percentualeFamiliareACarico!: number;
|
||||||
|
|
||||||
|
@Column('int', { name: 'familiareMultiplo', default: () => '(0)' })
|
||||||
|
familiareMultiplo!: number;
|
||||||
|
|
||||||
|
@Column('nvarchar', {
|
||||||
|
name: 'origineAggiornamento',
|
||||||
|
length: 20,
|
||||||
|
default: () => "''",
|
||||||
|
})
|
||||||
|
origineAggiornamento!: string;
|
||||||
|
|
||||||
|
@Column('int', { name: 'consensoNewsletter', default: () => '(0)' })
|
||||||
|
consensoNewsletter!: number;
|
||||||
|
|
||||||
|
@Column('int', {
|
||||||
|
name: 'flagRichiestaVariazioneAnagrafica',
|
||||||
|
default: () => '(0)',
|
||||||
|
})
|
||||||
|
flagRichiestaVariazioneAnagrafica!: number;
|
||||||
|
|
||||||
|
@Column('int', { name: 'flagPresenzaMorositaPrestiti', default: () => '(0)' })
|
||||||
|
flagPresenzaMorositaPrestiti!: number;
|
||||||
|
|
||||||
|
@Column('int', { name: 'flagBloccoAmministrativo', default: () => '(0)' })
|
||||||
|
flagBloccoAmministrativo!: number;
|
||||||
|
|
||||||
|
@Column('int', { name: 'codiceTitoloStudio', default: () => '(0)' })
|
||||||
|
codiceTitoloStudio!: number;
|
||||||
|
|
||||||
|
@Column('varchar', {
|
||||||
|
name: 'codiceLuogoDomicilio',
|
||||||
|
nullable: true,
|
||||||
|
length: 5,
|
||||||
|
})
|
||||||
|
codiceLuogoDomicilio!: string | null;
|
||||||
|
|
||||||
|
@Column('varchar', { name: 'codiceLuogoNascita', nullable: true, length: 5 })
|
||||||
|
codiceLuogoNascita!: string | null;
|
||||||
|
|
||||||
|
@Column('varchar', {
|
||||||
|
name: 'codiceLuogoResidenza',
|
||||||
|
nullable: true,
|
||||||
|
length: 5,
|
||||||
|
})
|
||||||
|
codiceLuogoResidenza!: string | null;
|
||||||
|
|
||||||
|
@Column('nvarchar', { name: 'domicilioFrazione', nullable: true, length: 80 })
|
||||||
|
domicilioFrazione!: string | null;
|
||||||
|
|
||||||
|
@Column('nvarchar', { name: 'nascitaFrazione', nullable: true, length: 80 })
|
||||||
|
nascitaFrazione!: string | null;
|
||||||
|
|
||||||
|
@Column('nvarchar', { name: 'residenzaFrazione', nullable: true, length: 80 })
|
||||||
|
residenzaFrazione!: string | null;
|
||||||
|
|
||||||
|
@Column('varchar', { name: 'codicePartner', nullable: true, length: 255 })
|
||||||
|
codicePartner!: string | null;
|
||||||
|
|
||||||
|
@Column('varchar', {
|
||||||
|
name: 'documentoIdentitaCodice',
|
||||||
|
nullable: true,
|
||||||
|
length: 100,
|
||||||
|
})
|
||||||
|
documentoIdentitaCodice!: string | null;
|
||||||
|
|
||||||
|
@Column('varchar', {
|
||||||
|
name: 'documentoIdentitaDataEmissione',
|
||||||
|
nullable: true,
|
||||||
|
length: 10,
|
||||||
|
})
|
||||||
|
documentoIdentitaDataEmissione!: string | null;
|
||||||
|
|
||||||
|
@Column('varchar', {
|
||||||
|
name: 'documentoIdentitaDataScadenza',
|
||||||
|
nullable: true,
|
||||||
|
length: 10,
|
||||||
|
})
|
||||||
|
documentoIdentitaDataScadenza!: string | null;
|
||||||
|
|
||||||
|
@Column('varchar', {
|
||||||
|
name: 'documentoIdentitaEnteRilascio',
|
||||||
|
nullable: true,
|
||||||
|
length: 100,
|
||||||
|
})
|
||||||
|
documentoIdentitaEnteRilascio!: string | null;
|
||||||
|
|
||||||
|
@Column('varchar', {
|
||||||
|
name: 'documentoIdentitaComuneRilascio',
|
||||||
|
nullable: true,
|
||||||
|
length: 5,
|
||||||
|
})
|
||||||
|
documentoIdentitaCodiceLuogoComuneRilascio!: string | null;
|
||||||
|
|
||||||
|
@ManyToOne(() => SocioEntity, (socioEntity) => socioEntity.familiari)
|
||||||
|
@JoinColumn([{ name: 'codiceCapofamiglia', referencedColumnName: 'codiceSocio' }])
|
||||||
|
capofamiglia!: SocioEntity;
|
||||||
|
|
||||||
|
@OneToMany(() => SocioEntity, (socioEntity) => socioEntity.capofamiglia)
|
||||||
|
familiari!: SocioEntity[];
|
||||||
|
|
||||||
|
@ManyToOne(() => GruppoEntity)
|
||||||
|
@JoinColumn([{ name: 'codiceGruppo', referencedColumnName: 'codiceGruppo' }])
|
||||||
|
gruppo!: GruppoEntity;
|
||||||
|
|
||||||
|
@ManyToOne(() => ApiLuoghiEntity)
|
||||||
|
@JoinColumn([{ name: 'codiceLuogoNascita', referencedColumnName: 'codice' }])
|
||||||
|
luogoNascita!: ApiLuoghiEntity;
|
||||||
|
|
||||||
|
@ManyToOne(() => ApiLuoghiEntity)
|
||||||
|
@JoinColumn([{ name: 'codiceLuogoResidenza', referencedColumnName: 'codice' }])
|
||||||
|
luogoResidenza!: ApiLuoghiEntity;
|
||||||
|
|
||||||
|
@ManyToOne(() => ApiLuoghiEntity)
|
||||||
|
@JoinColumn([{ name: 'codiceLuogoDomicilio', referencedColumnName: 'codice' }])
|
||||||
|
luogoDomicilio!: ApiLuoghiEntity;
|
||||||
|
|
||||||
|
@ManyToOne(() => ApiLuoghiEntity)
|
||||||
|
@JoinColumn([{ name: 'documentoIdentitaComuneRilascio', referencedColumnName: 'codice' }])
|
||||||
|
documentoIdentitaComuneRilascio!: ApiLuoghiEntity;
|
||||||
|
|
||||||
|
@OneToMany(() => SocioContrattoEntity, (socioContrattoEntity) => socioContrattoEntity.socio)
|
||||||
|
socioContratto!: SocioContrattoEntity[];
|
||||||
|
|
||||||
|
@OneToMany(() => SocioFormeAssistenzaEntity, (socioFormeAssistenzaEntity) => socioFormeAssistenzaEntity.socio)
|
||||||
|
socioFormeAssistenzas!: SocioFormeAssistenzaEntity[];
|
||||||
|
|
||||||
|
constructor(init?: Partial<SocioEntity>) {
|
||||||
|
Object.assign(this, init);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,50 @@
|
|||||||
|
import { Column, Entity, Index, JoinColumn, ManyToOne } from 'typeorm';
|
||||||
|
import { ContrattoEntity } from './contratto.entity';
|
||||||
|
import { SocioEntity } from './socio.entity';
|
||||||
|
|
||||||
|
@Index(
|
||||||
|
'PK_socioContratto',
|
||||||
|
['codiceSocio', 'codiceCapofamiglia', 'codiceContratto', 'dataInizio', 'dataFine', 'codiceFiguraContratto'],
|
||||||
|
{ unique: true },
|
||||||
|
)
|
||||||
|
@Entity('socioContratto')
|
||||||
|
export class SocioContrattoEntity {
|
||||||
|
@Column('bigint', { primary: true, name: 'codiceSocio' })
|
||||||
|
codiceSocio!: string;
|
||||||
|
|
||||||
|
@Column('bigint', { primary: true, name: 'codiceCapofamiglia' })
|
||||||
|
codiceCapofamiglia!: string;
|
||||||
|
|
||||||
|
@Column('nvarchar', { primary: true, name: 'dataInizio', length: 10 })
|
||||||
|
dataInizio!: string;
|
||||||
|
|
||||||
|
@Column('nvarchar', { primary: true, name: 'dataFine', length: 10 })
|
||||||
|
dataFine!: string;
|
||||||
|
|
||||||
|
@Column('bigint', { primary: true, name: 'codiceContratto' })
|
||||||
|
codiceContratto!: string;
|
||||||
|
|
||||||
|
@Column('nvarchar', { name: 'contratto', length: 400 })
|
||||||
|
nomeContratto!: string;
|
||||||
|
|
||||||
|
@Column('bigint', { primary: true, name: 'codiceFiguraContratto' })
|
||||||
|
codiceFiguraContratto!: string;
|
||||||
|
|
||||||
|
@Column('nvarchar', { name: 'figuraContratto', length: 400 })
|
||||||
|
figuraContratto!: string;
|
||||||
|
|
||||||
|
@Column('nvarchar', { name: 'note', length: 400 })
|
||||||
|
note!: string;
|
||||||
|
|
||||||
|
@ManyToOne(() => SocioEntity, (socioEntity) => socioEntity.socioContratto)
|
||||||
|
@JoinColumn([{ name: 'codiceSocio', referencedColumnName: 'codiceSocio' }])
|
||||||
|
socio!: SocioEntity;
|
||||||
|
|
||||||
|
@ManyToOne(() => ContrattoEntity, (contrattoEntity) => contrattoEntity.socioContratto)
|
||||||
|
@JoinColumn([{ name: 'codiceContratto', referencedColumnName: 'codiceContratto' }])
|
||||||
|
contratto!: ContrattoEntity;
|
||||||
|
|
||||||
|
constructor(init?: Partial<SocioContrattoEntity>) {
|
||||||
|
Object.assign(this, init);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,46 @@
|
|||||||
|
import { Column, Entity, Index, JoinColumn, ManyToOne } from 'typeorm';
|
||||||
|
import { FormeAssistenzaEntity } from './formeAssistenza.entity';
|
||||||
|
import { SocioEntity } from './socio.entity';
|
||||||
|
|
||||||
|
@Index('PK_socioFormeAssistenza', ['codiceSocio', 'codiceFdA', 'dataInizio', 'dataFine', 'titolare'], { unique: true })
|
||||||
|
@Entity('socioFormeAssistenza')
|
||||||
|
export class SocioFormeAssistenzaEntity {
|
||||||
|
@Column('bigint', { primary: true, name: 'codiceSocio' })
|
||||||
|
codiceSocio!: string;
|
||||||
|
|
||||||
|
@Column('bigint', { primary: true, name: 'codiceFdA' })
|
||||||
|
codiceFdA!: string;
|
||||||
|
|
||||||
|
@Column('nvarchar', { primary: true, name: 'dataInizio', length: 10 })
|
||||||
|
dataInizio!: string;
|
||||||
|
|
||||||
|
@Column('nvarchar', { primary: true, name: 'dataFine', length: 10 })
|
||||||
|
dataFine!: string;
|
||||||
|
|
||||||
|
@Column('int', { primary: true, name: 'titolare' })
|
||||||
|
titolare!: number;
|
||||||
|
|
||||||
|
@Column('bigint', { name: 'codiceContratto', nullable: true })
|
||||||
|
codiceContratto!: string | null;
|
||||||
|
|
||||||
|
@Column('bigint', { name: 'codiceFiguraContratto', nullable: true })
|
||||||
|
codiceFiguraContratto!: string | null;
|
||||||
|
|
||||||
|
@Column('int', { name: 'forzaEtaContributi', nullable: true })
|
||||||
|
forzaEtaContributi!: number | null;
|
||||||
|
|
||||||
|
@Column('nvarchar', { name: 'dataRicezione', nullable: true, length: 10 })
|
||||||
|
dataRicezione!: string | null;
|
||||||
|
|
||||||
|
@ManyToOne(() => FormeAssistenzaEntity, (formeAssistenzaEntity) => formeAssistenzaEntity.socioFormeAssistenza)
|
||||||
|
@JoinColumn([{ name: 'codiceFdA', referencedColumnName: 'codiceFda' }])
|
||||||
|
formaAssistenza!: FormeAssistenzaEntity;
|
||||||
|
|
||||||
|
@ManyToOne(() => SocioEntity, (socioEntity) => socioEntity.socioFormeAssistenzas)
|
||||||
|
@JoinColumn([{ name: 'codiceSocio', referencedColumnName: 'codiceSocio' }])
|
||||||
|
socio!: SocioEntity;
|
||||||
|
|
||||||
|
constructor(init?: Partial<SocioFormeAssistenzaEntity>) {
|
||||||
|
Object.assign(this, init);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,30 @@
|
|||||||
|
import { Column, Entity, Index } from 'typeorm';
|
||||||
|
|
||||||
|
@Index('PK_sportelli', ['codiceSportello'], { unique: true })
|
||||||
|
@Entity('sportelli')
|
||||||
|
export class SportelliEntity {
|
||||||
|
@Column('nvarchar', { primary: true, name: 'codiceSportello', length: 255 })
|
||||||
|
codiceSportello!: string;
|
||||||
|
|
||||||
|
@Column('nvarchar', { name: 'denominazione', length: 255 })
|
||||||
|
denominazione!: string;
|
||||||
|
|
||||||
|
@Column('nvarchar', { name: 'email', length: 255 })
|
||||||
|
email!: string;
|
||||||
|
|
||||||
|
@Column('nvarchar', { name: 'password', length: 255 })
|
||||||
|
password!: string;
|
||||||
|
|
||||||
|
@Column('nvarchar', { name: 'indirizzo', length: 200, default: () => "''" })
|
||||||
|
indirizzo!: string;
|
||||||
|
|
||||||
|
@Column('nvarchar', { name: 'citta', length: 200, default: () => "''" })
|
||||||
|
citta!: string;
|
||||||
|
|
||||||
|
@Column('nvarchar', { name: 'provincia', length: 2, default: () => "''" })
|
||||||
|
provincia!: string;
|
||||||
|
|
||||||
|
constructor(init?: Partial<SportelliEntity>) {
|
||||||
|
Object.assign(this, init);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1 @@
|
|||||||
|
export * from './entities';
|
@ -0,0 +1 @@
|
|||||||
|
export const APP_DATASOURCES = Symbol('APP_DATASOURCES');
|
20
apps/ebitemp-api/src/modules/database/database.module.ts
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
import { Global, Module } from '@nestjs/common';
|
||||||
|
import { EbitempApiDatabaseModule } from './connections/ebitemp-api/database.module';
|
||||||
|
import { OceanoDatabaseModule } from './connections/oceano/database.module';
|
||||||
|
import { APP_DATASOURCES } from './database.constants';
|
||||||
|
import { dataSources } from './utils/typeorm-data-source-factory';
|
||||||
|
|
||||||
|
const dataSourcesProvider = {
|
||||||
|
provide: APP_DATASOURCES,
|
||||||
|
useValue: dataSources,
|
||||||
|
};
|
||||||
|
|
||||||
|
const databaseModules = [EbitempApiDatabaseModule, OceanoDatabaseModule];
|
||||||
|
|
||||||
|
@Global()
|
||||||
|
@Module({
|
||||||
|
imports: [...databaseModules],
|
||||||
|
providers: [dataSourcesProvider],
|
||||||
|
exports: [dataSourcesProvider, ...databaseModules],
|
||||||
|
})
|
||||||
|
export class AppDatabaseModule {}
|
@ -0,0 +1,58 @@
|
|||||||
|
import { registerAs } from '@nestjs/config';
|
||||||
|
import { ConnectionString } from 'connection-string';
|
||||||
|
import { first } from 'lodash';
|
||||||
|
import { z } from 'zod';
|
||||||
|
|
||||||
|
export const databaseSchema = z.object({
|
||||||
|
connectionString: z.string(),
|
||||||
|
type: z.enum([
|
||||||
|
'mysql',
|
||||||
|
'postgres',
|
||||||
|
'cockroachdb',
|
||||||
|
'sap',
|
||||||
|
'mariadb',
|
||||||
|
'sqlite',
|
||||||
|
'cordova',
|
||||||
|
'react-native',
|
||||||
|
'nativescript',
|
||||||
|
'sqljs',
|
||||||
|
'oracle',
|
||||||
|
'mssql',
|
||||||
|
'mongodb',
|
||||||
|
'aurora-mysql',
|
||||||
|
'aurora-postgres',
|
||||||
|
'expo',
|
||||||
|
'better-sqlite3',
|
||||||
|
'capacitor',
|
||||||
|
'spanner',
|
||||||
|
]),
|
||||||
|
host: z.string(),
|
||||||
|
port: z.number().optional(),
|
||||||
|
username: z.string(),
|
||||||
|
password: z.string(),
|
||||||
|
database: z.string(),
|
||||||
|
secure: z.boolean(),
|
||||||
|
});
|
||||||
|
export type DatabaseConfig = z.TypeOf<typeof databaseSchema>;
|
||||||
|
|
||||||
|
export const rawDatabaseSchema = z.object({
|
||||||
|
connectionString: z.string(),
|
||||||
|
secure: z.boolean().default(true),
|
||||||
|
});
|
||||||
|
export type RawDatabaseConfigSchema = z.TypeOf<typeof rawDatabaseSchema>;
|
||||||
|
|
||||||
|
export const databaseConfigFactory = (opts: RawDatabaseConfigSchema) =>
|
||||||
|
registerAs('database', () => {
|
||||||
|
const connectionString = new ConnectionString(opts.connectionString);
|
||||||
|
const config: DatabaseConfig = databaseSchema.strict().parse({
|
||||||
|
connectionString: connectionString.toString(),
|
||||||
|
type: connectionString.protocol,
|
||||||
|
host: first(connectionString.hosts)?.name,
|
||||||
|
port: first(connectionString.hosts)?.port,
|
||||||
|
username: connectionString.user,
|
||||||
|
password: connectionString.password,
|
||||||
|
database: first(connectionString.path),
|
||||||
|
secure: opts.secure,
|
||||||
|
});
|
||||||
|
return config;
|
||||||
|
});
|
@ -0,0 +1,19 @@
|
|||||||
|
import { DataSource, DataSourceOptions } from 'typeorm';
|
||||||
|
|
||||||
|
export const dataSources: DataSource[] = [];
|
||||||
|
|
||||||
|
export const typeormDataSourceFactory = (dataSources: DataSource[]) => async (options?: DataSourceOptions) => {
|
||||||
|
const dataSource = await new DataSource(options!).initialize();
|
||||||
|
dataSources.push(dataSource);
|
||||||
|
return dataSource;
|
||||||
|
};
|
||||||
|
|
||||||
|
export const typeormTransactionalDataSourceFactory = (name?: string) => async (options?: DataSourceOptions) => {
|
||||||
|
const tt = await import('typeorm-transactional');
|
||||||
|
const dataSource = tt.addTransactionalDataSource({
|
||||||
|
name: name,
|
||||||
|
dataSource: new DataSource(options!),
|
||||||
|
});
|
||||||
|
dataSources.push(dataSource);
|
||||||
|
return dataSource;
|
||||||
|
};
|
@ -0,0 +1,5 @@
|
|||||||
|
export const typeormEntitiesFromImport = async <T extends object>(entities: T) => {
|
||||||
|
return (Object.keys(entities) as Array<keyof typeof entities>).map(
|
||||||
|
(entity: keyof typeof entities) => entities[entity],
|
||||||
|
);
|
||||||
|
};
|
@ -0,0 +1,26 @@
|
|||||||
|
import { TypeOrmModuleOptions } from '@nestjs/typeorm';
|
||||||
|
import { SnakeNamingStrategy } from 'typeorm-naming-strategies';
|
||||||
|
import { DatabaseConfig } from './database-config';
|
||||||
|
|
||||||
|
export const typeormModuleOptionsFactory = async (
|
||||||
|
databaseConfig: DatabaseConfig,
|
||||||
|
entities: any[],
|
||||||
|
name?: string,
|
||||||
|
): Promise<TypeOrmModuleOptions> => {
|
||||||
|
return {
|
||||||
|
name: name,
|
||||||
|
type: databaseConfig.type as any,
|
||||||
|
host: databaseConfig.host,
|
||||||
|
port: databaseConfig.port,
|
||||||
|
username: databaseConfig.username,
|
||||||
|
password: databaseConfig.password,
|
||||||
|
database: databaseConfig.database,
|
||||||
|
entities: entities,
|
||||||
|
synchronize: false,
|
||||||
|
logging: process.env['NODE_ENV'] !== 'production',
|
||||||
|
namingStrategy: new SnakeNamingStrategy(),
|
||||||
|
options: {
|
||||||
|
...(!databaseConfig.secure ? { trustServerCertificate: true } : {}),
|
||||||
|
},
|
||||||
|
};
|
||||||
|
};
|
@ -0,0 +1,4 @@
|
|||||||
|
export async function patchTypeOrm() {
|
||||||
|
(await import('typeorm-transactional')).initializeTransactionalContext();
|
||||||
|
(await import('typeorm-scoped')).patchSelectQueryBuilder();
|
||||||
|
}
|
@ -0,0 +1,105 @@
|
|||||||
|
import { Inject, Injectable, OnApplicationBootstrap } from '@nestjs/common';
|
||||||
|
import { differenceBy, get } from 'lodash';
|
||||||
|
import { DataSource, QueryFailedError } from 'typeorm';
|
||||||
|
import { APP_DATASOURCES } from '../database/database.constants';
|
||||||
|
import { Enumify, registeredEnums } from './enumify';
|
||||||
|
import { type EnumifyConfig, enumifyConfig } from './enumify.config';
|
||||||
|
|
||||||
|
@Injectable()
|
||||||
|
export class EnumifyUpdateFromDatabaseService implements OnApplicationBootstrap {
|
||||||
|
constructor(
|
||||||
|
@Inject(APP_DATASOURCES) private readonly datasources: DataSource[],
|
||||||
|
@Inject(enumifyConfig.KEY) private readonly config: EnumifyConfig,
|
||||||
|
) {}
|
||||||
|
|
||||||
|
async onApplicationBootstrap() {
|
||||||
|
try {
|
||||||
|
const enumUpdateFromDbOnStart = this.config.shouldUpdateEnumFromDbOnStartup;
|
||||||
|
if (!enumUpdateFromDbOnStart) return;
|
||||||
|
|
||||||
|
const errors: string[] = [];
|
||||||
|
|
||||||
|
for (const dataSource of this.datasources) {
|
||||||
|
const logging = dataSource.options.logging;
|
||||||
|
dataSource.setOptions({ logging: false });
|
||||||
|
for (const _registeredEnum of get(registeredEnums, dataSource.name, [])) {
|
||||||
|
const registeredEnum = _registeredEnum;
|
||||||
|
|
||||||
|
const repo = dataSource.getRepository(registeredEnum);
|
||||||
|
|
||||||
|
const enumValues = registeredEnum.enumValues;
|
||||||
|
let dbValues: Enumify[];
|
||||||
|
try {
|
||||||
|
dbValues = await repo.find();
|
||||||
|
} catch (err) {
|
||||||
|
if (
|
||||||
|
err instanceof QueryFailedError &&
|
||||||
|
err.message === `Error: Invalid object name '${repo.metadata.tableName}'.`
|
||||||
|
) {
|
||||||
|
errors.push(
|
||||||
|
`[${dataSource.name}] ${registeredEnum.name}: Table present in code but missing on database: ${enumValues}`,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
if (err instanceof QueryFailedError && err.message.startsWith('Error: Invalid column name')) {
|
||||||
|
errors.push(`[${dataSource.name}] ${registeredEnum.name}: [${repo.metadata.tableName}] ${err.message}`);
|
||||||
|
}
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
const differenceByDbValues = differenceBy(dbValues, enumValues, (x) => (x.id, x.nome));
|
||||||
|
const differenceByEnumValues = differenceBy(enumValues, dbValues, (x) => (x.id, x.nome));
|
||||||
|
if (differenceByDbValues.length > 0) {
|
||||||
|
errors.push(
|
||||||
|
`[${dataSource.name}] ${
|
||||||
|
registeredEnum.name
|
||||||
|
}: Values present on database but missing in code: ${differenceBy(
|
||||||
|
dbValues,
|
||||||
|
enumValues,
|
||||||
|
(x) => (x.id, x.nome),
|
||||||
|
)}`,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
if (differenceByEnumValues.length > 0) {
|
||||||
|
errors.push(
|
||||||
|
`[${dataSource.name}] ${
|
||||||
|
registeredEnum.name
|
||||||
|
}: Values present in code but missing in database: ${differenceBy(
|
||||||
|
enumValues,
|
||||||
|
dbValues,
|
||||||
|
(x) => (x.id, x.nome),
|
||||||
|
)}`,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
for (const dbValue of dbValues) {
|
||||||
|
const valueOfByName = registeredEnum.fromKey(dbValue.nome!);
|
||||||
|
const keyOfByCode = registeredEnum.fromValue(dbValue.id!);
|
||||||
|
if (valueOfByName != null && dbValue.id != valueOfByName?.id) {
|
||||||
|
errors.push(
|
||||||
|
`[${dataSource.name}] ${registeredEnum.name}: Different values between database (${dbValue.id}, ${dbValue.nome}) and code (${valueOfByName.id}, ${valueOfByName.nome})`,
|
||||||
|
);
|
||||||
|
} else if (keyOfByCode != null && dbValue.nome != keyOfByCode?.nome) {
|
||||||
|
errors.push(
|
||||||
|
`[${dataSource.name}] ${registeredEnum.name}: Different values between database (${dbValue.id}, ${dbValue.nome}) and code (${keyOfByCode.id}, ${keyOfByCode.nome})`,
|
||||||
|
);
|
||||||
|
} else if (valueOfByName != null || keyOfByCode != null) {
|
||||||
|
const enumValue = (valueOfByName ?? keyOfByCode)!;
|
||||||
|
Object.assign(enumValue, dbValue);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
dataSource.setOptions({ logging: logging });
|
||||||
|
}
|
||||||
|
|
||||||
|
if (errors.length > 0) {
|
||||||
|
throw new Error(errors.join('\n\t* '));
|
||||||
|
}
|
||||||
|
} catch (err) {
|
||||||
|
if (err instanceof Error) {
|
||||||
|
console.warn(err.message, EnumifyUpdateFromDatabaseService.name);
|
||||||
|
} else {
|
||||||
|
throw err;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
17
apps/ebitemp-api/src/modules/enumify/enumify.config.ts
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
import coerceRecordTypes from '../config/utils/coerce-record-types';
|
||||||
|
import { registerAs } from '@nestjs/config';
|
||||||
|
import { z } from 'zod';
|
||||||
|
|
||||||
|
export const enumifySchema = z.object({
|
||||||
|
shouldUpdateEnumFromDbOnStartup: z.boolean().default(true),
|
||||||
|
});
|
||||||
|
export type EnumifyConfig = z.infer<typeof enumifySchema>;
|
||||||
|
|
||||||
|
export const enumifyConfig = registerAs('enumify', () => {
|
||||||
|
const env = coerceRecordTypes(process.env);
|
||||||
|
|
||||||
|
const config: EnumifyConfig = enumifySchema.strict().parse({
|
||||||
|
shouldUpdateEnumFromDbOnStartup: env['ENUM_UPDATE_FROM_DB_ON_START'],
|
||||||
|
});
|
||||||
|
return config;
|
||||||
|
});
|
12
apps/ebitemp-api/src/modules/enumify/enumify.module.ts
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
import { Module, Global } from '@nestjs/common';
|
||||||
|
import { EnumifyUpdateFromDatabaseService } from './enumify-update-from-database.service';
|
||||||
|
import { ConfigModule } from '@nestjs/config';
|
||||||
|
import { enumifyConfig } from './enumify.config';
|
||||||
|
|
||||||
|
@Global()
|
||||||
|
@Module({
|
||||||
|
imports: [ConfigModule.forFeature(enumifyConfig)],
|
||||||
|
providers: [EnumifyUpdateFromDatabaseService],
|
||||||
|
exports: [EnumifyUpdateFromDatabaseService],
|
||||||
|
})
|
||||||
|
export class EnumifyModule {}
|
74
apps/ebitemp-api/src/modules/enumify/enumify.ts
Normal file
@ -0,0 +1,74 @@
|
|||||||
|
// Based on https://github.com/rauschma/enumify
|
||||||
|
// Original license: MIT License - Copyright (c) 2020 Axel Rauschmayer
|
||||||
|
|
||||||
|
export const registeredEnums: Record<string, (typeof Enumify)[]> = {};
|
||||||
|
export function Enum(schema: string) {
|
||||||
|
return function (target: typeof Enumify) {
|
||||||
|
registeredEnums[schema] ??= [];
|
||||||
|
registeredEnums[schema].push(target);
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
export class Enumify {
|
||||||
|
static enumKeys: Array<string>;
|
||||||
|
static enumValues: Array<Enumify>;
|
||||||
|
|
||||||
|
public readonly id?: number;
|
||||||
|
public readonly nome?: string;
|
||||||
|
|
||||||
|
static closeEnum() {
|
||||||
|
const enumKeys: Array<string> = [];
|
||||||
|
const enumValues: Array<Enumify> = [];
|
||||||
|
|
||||||
|
for (const [key, value] of Object.entries(this)) {
|
||||||
|
value.nome ??= key;
|
||||||
|
value.id ??= enumValues.length;
|
||||||
|
|
||||||
|
if (value.id == null || value.id === '') {
|
||||||
|
throw new Error(`${this.name}.id`);
|
||||||
|
}
|
||||||
|
if (value.nome == null || value.nome === '') {
|
||||||
|
throw new Error(`${this.name}.nome`);
|
||||||
|
}
|
||||||
|
|
||||||
|
enumKeys.push(value.nome);
|
||||||
|
enumValues.push(value);
|
||||||
|
}
|
||||||
|
this.enumKeys = enumKeys;
|
||||||
|
this.enumValues = enumValues;
|
||||||
|
}
|
||||||
|
|
||||||
|
static fromKey(key: string): undefined | Enumify {
|
||||||
|
if (this.enumKeys == undefined) {
|
||||||
|
throw new Error(`Did you forget to call static _ = ${this.name}.closeEnum() after setup?`);
|
||||||
|
}
|
||||||
|
|
||||||
|
const index = this.enumKeys.findIndex((enumKey) => enumKey.toUpperCase() === key.toString().toUpperCase());
|
||||||
|
if (index >= 0) {
|
||||||
|
return this.enumValues[index];
|
||||||
|
}
|
||||||
|
return undefined;
|
||||||
|
}
|
||||||
|
|
||||||
|
static fromValue(value: number): undefined | Enumify {
|
||||||
|
if (this.enumValues == undefined) {
|
||||||
|
throw new Error(`Did you forget to call static _ = ${this.name}.closeEnum() after setup?`);
|
||||||
|
}
|
||||||
|
|
||||||
|
const index = this.enumValues.map((x) => x.id).indexOf(value);
|
||||||
|
if (index >= 0) {
|
||||||
|
const key = this.enumKeys[index];
|
||||||
|
return this.fromKey(key!);
|
||||||
|
}
|
||||||
|
return undefined;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected constructor(id?: number, nome?: string) {
|
||||||
|
this.id = id;
|
||||||
|
this.nome = nome;
|
||||||
|
}
|
||||||
|
|
||||||
|
toString() {
|
||||||
|
return `(${this.id}, ${this.nome})`;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,118 @@
|
|||||||
|
import { Logger } from '@nestjs/common';
|
||||||
|
import fs from 'node:fs';
|
||||||
|
import { randomUUID } from 'node:crypto';
|
||||||
|
import path from 'node:path';
|
||||||
|
import { FileTransactionsService } from './file-transactions.service';
|
||||||
|
import { copyFilesToFolderOrFail, deleteFiles, renameFiles, renameFilesOrFail } from './file-utils';
|
||||||
|
import dayjs from 'dayjs';
|
||||||
|
|
||||||
|
export class FileTransaction {
|
||||||
|
public static readonly TO_ADD_SUFFIX = 'toAdd';
|
||||||
|
public static readonly TO_DELETE_SUFFIX = 'toDelete';
|
||||||
|
|
||||||
|
private readonly manager: FileTransactionsService;
|
||||||
|
private readonly logger: Logger;
|
||||||
|
|
||||||
|
public readonly transactionId: string;
|
||||||
|
private readonly ts: Date;
|
||||||
|
public readonly filesToAdd: { src: string; dest: string }[];
|
||||||
|
public readonly filesToDelete: string[];
|
||||||
|
|
||||||
|
constructor(
|
||||||
|
manager: FileTransactionsService,
|
||||||
|
opts: Partial<{
|
||||||
|
transactionId: string;
|
||||||
|
filesToAdd: { src: string; dest: string }[];
|
||||||
|
filesToDelete: string[];
|
||||||
|
logger: Logger;
|
||||||
|
}>,
|
||||||
|
) {
|
||||||
|
this.manager = manager;
|
||||||
|
this.logger = opts.logger ?? new Logger(FileTransaction.name);
|
||||||
|
this.filesToAdd = opts.filesToAdd ?? [];
|
||||||
|
this.filesToDelete = opts.filesToDelete ?? [];
|
||||||
|
this.transactionId = opts.transactionId ?? (randomUUID().split('-').pop() as string);
|
||||||
|
this.ts = new Date();
|
||||||
|
}
|
||||||
|
|
||||||
|
async addFile(src: string, dest: string) {
|
||||||
|
const destFolderName = path.dirname(dest);
|
||||||
|
const destFileName = path.basename(dest);
|
||||||
|
const destFileNameWithSuffix = `${destFileName}.${this.transactionId}.${FileTransaction.TO_ADD_SUFFIX}`;
|
||||||
|
const destFilePathWithSuffix = path.join(destFolderName, destFileNameWithSuffix);
|
||||||
|
|
||||||
|
this.logger.log(
|
||||||
|
`Adding file '${destFilePathWithSuffix}' in fileTransaction '${
|
||||||
|
this.transactionId
|
||||||
|
}' (started at ${dayjs(this.ts).format('YYYY-MM-DD HH:mm:ss')})`,
|
||||||
|
);
|
||||||
|
this.filesToAdd.push({ src: src, dest: destFilePathWithSuffix });
|
||||||
|
|
||||||
|
if (fs.existsSync(dest)) {
|
||||||
|
await this.deleteFile(dest);
|
||||||
|
}
|
||||||
|
|
||||||
|
await copyFilesToFolderOrFail(this.logger, destFolderName, {
|
||||||
|
srcpath: src,
|
||||||
|
name: destFileNameWithSuffix,
|
||||||
|
});
|
||||||
|
await deleteFiles(this.logger, src);
|
||||||
|
this.manager.persist(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
async deleteFile(src: string) {
|
||||||
|
const destFolderName = path.dirname(src);
|
||||||
|
const destFileName = path.basename(src);
|
||||||
|
const destFileNameWithSuffix = `${destFileName}.${this.transactionId}.${FileTransaction.TO_DELETE_SUFFIX}`;
|
||||||
|
const destFilePathWithSuffix = path.join(destFolderName, destFileNameWithSuffix);
|
||||||
|
|
||||||
|
this.logger.log(
|
||||||
|
`Deleting file '${destFilePathWithSuffix}' in fileTransaction '${
|
||||||
|
this.transactionId
|
||||||
|
}' (started at ${dayjs(this.ts).format('YYYY-MM-DD HH:mm:ss')})`,
|
||||||
|
);
|
||||||
|
this.filesToDelete.push(destFilePathWithSuffix);
|
||||||
|
await renameFilesOrFail(this.logger, { src, dest: destFilePathWithSuffix });
|
||||||
|
this.manager.persist(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
async commitTransaction() {
|
||||||
|
this.logger.log(
|
||||||
|
`Committing fileTransaction '${this.transactionId}' (started at ${dayjs(this.ts).format('YYYY-MM-DD HH:mm:ss')})`,
|
||||||
|
);
|
||||||
|
await renameFiles(
|
||||||
|
this.logger,
|
||||||
|
...this.filesToAdd.map((fileToAdd) => ({
|
||||||
|
src: fileToAdd.dest,
|
||||||
|
dest: fileToAdd.dest.replace(`.${this.transactionId}.${FileTransaction.TO_ADD_SUFFIX}`, ''),
|
||||||
|
})),
|
||||||
|
);
|
||||||
|
await deleteFiles(this.logger, ...this.filesToDelete);
|
||||||
|
this.manager.unregister(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
async rollbackTransaction() {
|
||||||
|
this.logger.log(
|
||||||
|
`Rollbacking fileTransaction '${this.transactionId}' (started at ${dayjs(this.ts).format(
|
||||||
|
'YYYY-MM-DD HH:mm:ss',
|
||||||
|
)})`,
|
||||||
|
);
|
||||||
|
|
||||||
|
await renameFiles(
|
||||||
|
this.logger,
|
||||||
|
...this.filesToAdd.map((fileToMove) => ({
|
||||||
|
src: fileToMove.dest,
|
||||||
|
dest: fileToMove.src,
|
||||||
|
})),
|
||||||
|
);
|
||||||
|
|
||||||
|
await renameFiles(
|
||||||
|
this.logger,
|
||||||
|
...this.filesToDelete.map((fileToRestore) => ({
|
||||||
|
src: fileToRestore,
|
||||||
|
dest: fileToRestore.replace(`.${this.transactionId}.${FileTransaction.TO_DELETE_SUFFIX}`, ''),
|
||||||
|
})),
|
||||||
|
);
|
||||||
|
this.manager.unregister(this);
|
||||||
|
}
|
||||||
|
}
|