diff --git a/apps/maestri-edu-admin/.dockerignore b/apps/maestri-edu-admin/.dockerignore
new file mode 100644
index 0000000..1194b4f
--- /dev/null
+++ b/apps/maestri-edu-admin/.dockerignore
@@ -0,0 +1,7 @@
+.dockerignore
+docker-compose.yml
+Dockerfile
+build/
+node_modules
+.env
+.gitignore
diff --git a/apps/maestri-edu-admin/.env b/apps/maestri-edu-admin/.env
new file mode 100644
index 0000000..4eef91c
--- /dev/null
+++ b/apps/maestri-edu-admin/.env
@@ -0,0 +1,2 @@
+PORT=3001
+REACT_APP_SERVER_URL=http://localhost:3000
\ No newline at end of file
diff --git a/apps/maestri-edu-admin/.gitignore b/apps/maestri-edu-admin/.gitignore
new file mode 100644
index 0000000..590b2e0
--- /dev/null
+++ b/apps/maestri-edu-admin/.gitignore
@@ -0,0 +1,23 @@
+# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
+
+# dependencies
+/node_modules
+/.pnp
+.pnp.js
+
+# testing
+/coverage
+
+# production
+/build
+
+# misc
+.DS_Store
+.env.local
+.env.development.local
+.env.test.local
+.env.production.local
+
+npm-debug.log*
+yarn-debug.log*
+yarn-error.log*
diff --git a/apps/maestri-edu-admin/Dockerfile b/apps/maestri-edu-admin/Dockerfile
new file mode 100644
index 0000000..0911e21
--- /dev/null
+++ b/apps/maestri-edu-admin/Dockerfile
@@ -0,0 +1,51 @@
+# multi-stage: base (build)
+FROM node:18.13.0-slim AS base
+
+# instantiate environment variable
+ARG REACT_APP_SERVER_URL=http://localhost:3000
+
+# set the environment variable that points to the server
+ENV REACT_APP_SERVER_URL=$REACT_APP_SERVER_URL
+
+# create directory where the application will be built
+WORKDIR /app
+
+# copy over the dependency manifests, both the package.json
+# and the package-lock.json are copied over
+COPY package*.json ./
+
+# installs packages and their dependencies
+RUN npm install
+
+# copy over the code base
+COPY . .
+
+# create the bundle of the application
+RUN npm run build
+
+# multi-stage: production (runtime)
+FROM nginx:1.22-alpine AS production
+
+# copy over the bundled code from the build stage
+COPY --from=base /app/build /usr/share/nginx/html
+COPY --from=base /app/configuration/nginx.conf /etc/nginx/conf.d/default.conf
+
+# create a new process indication file
+RUN touch /var/run/nginx.pid
+
+# change ownership of nginx related directories and files
+RUN chown -R nginx:nginx /var/run/nginx.pid \
+ /usr/share/nginx/html \
+ /var/cache/nginx \
+ /var/log/nginx \
+ /etc/nginx/conf.d
+
+# set user to the created non-privileged user
+USER nginx
+
+# expose a specific port on the docker container
+ENV PORT=3001
+EXPOSE ${PORT}
+
+# start the server using the previously build application
+ENTRYPOINT [ "nginx", "-g", "daemon off;" ]
diff --git a/apps/maestri-edu-admin/README.md b/apps/maestri-edu-admin/README.md
new file mode 100644
index 0000000..cc7c387
--- /dev/null
+++ b/apps/maestri-edu-admin/README.md
@@ -0,0 +1,47 @@
+
+
+
+
+
+
+# Introduction
+
+This service was generated with Amplication. It serves as the client-side for the generated server component. The client-side consist of a React application with ready-made forms for creating and editing the different data models of the application. It is pre-conffigured to work with the server and comes with the boilerplate and foundation for the client - i.e., routing, navigation, authentication, permissions, menu, breadcrumbs, error handling and much more. Additional information about the admin component and the architecture around it, can be found on the [documentation](https://docs.amplication.com/guides/getting-started) site. This side of the generated project was bootstrapped with [create-react-app](https://github.com/facebook/create-react-app) and built with [react-admin](https://marmelab.com/react-admin/).
+
+
+
+
+
+
+# Getting started
+
+## Step 1: Configuration
+
+Configuration for the client component can be provided through the use of environment variables. These can be passed to the application via the use of the `.env` file in the base directory of the generated service. Below a table can be found which show the different variables that can be passed. These values are provided default values after generation, change them to the desired values.
+
+| Variable | Description | Value |
+| -------------------- | ------------------------------------------------ | ------------------------------ |
+| PORT | the port on which to run the client | 3001 |
+| REACT_APP_SERVER_URL | the url on which the server component is running | http://localhost:[server-port] |
+
+> **Note**
+> Amplication generates default values and stores them under the .env file. It is advised to use some form of secrets manager/vault solution when using in production.
+
+
+## Step 2: Scripts
+
+After configuration of the client the next step would be to run the application. Before running the client side of the component, make sure that the different pre-requisites are met - i.e., npm, docker. Make sure that the server-side of the application is running.
+
+```sh
+# installation of the dependencies
+$ npm install
+
+# starts the application in development mode - available by default under http://localhost:3001 with a pre-configured user with the username "admin" and password "admin"
+$ npm run start
+
+# builds the application in production mode - available under 'build'
+$ npm run build
+
+# removes the single build dependency from the project
+$ npm run eject
+```
diff --git a/apps/maestri-edu-admin/configuration/nginx.conf b/apps/maestri-edu-admin/configuration/nginx.conf
new file mode 100644
index 0000000..c907b5c
--- /dev/null
+++ b/apps/maestri-edu-admin/configuration/nginx.conf
@@ -0,0 +1,11 @@
+server_tokens off;
+
+server {
+ listen 3001;
+ server_name localhost;
+ location / {
+ root /usr/share/nginx/html;
+ index index.html index.htm;
+ try_files $uri /index.html;
+ }
+}
\ No newline at end of file
diff --git a/apps/maestri-edu-admin/package.json b/apps/maestri-edu-admin/package.json
new file mode 100644
index 0000000..4765114
--- /dev/null
+++ b/apps/maestri-edu-admin/package.json
@@ -0,0 +1,60 @@
+{
+ "name": "@maestri-edu/admin",
+ "private": true,
+ "dependencies": {
+ "@apollo/client": "3.6.9",
+ "@material-ui/core": "4.12.4",
+ "graphql": "15.6.1",
+ "lodash": "4.17.21",
+ "pluralize": "8.0.0",
+ "ra-data-graphql-amplication": "0.0.14",
+ "react": "16.14.0",
+ "react-admin": "3.19.12",
+ "react-dom": "16.14.0",
+ "react-scripts": "5.0.0",
+ "sass": "^1.39.0",
+ "web-vitals": "1.1.2"
+ },
+ "overrides": {
+ "react-scripts": {
+ "@svgr/webpack": "6.5.1"
+ }
+ },
+ "scripts": {
+ "start": "react-scripts start",
+ "build": "react-scripts build",
+ "test": "react-scripts test",
+ "eject": "react-scripts eject",
+ "package:container": "docker build ."
+ },
+ "eslintConfig": {
+ "extends": [
+ "react-app",
+ "react-app/jest"
+ ]
+ },
+ "browserslist": {
+ "production": [
+ ">0.2%",
+ "not dead",
+ "not op_mini all"
+ ],
+ "development": [
+ "last 1 chrome version",
+ "last 1 firefox version",
+ "last 1 safari version"
+ ]
+ },
+ "devDependencies": {
+ "@testing-library/jest-dom": "5.14.1",
+ "@testing-library/react": "11.2.7",
+ "@testing-library/user-event": "13.2.0",
+ "@types/jest": "26.0.16",
+ "@types/lodash": "4.14.178",
+ "@types/node": "12.20.16",
+ "@types/react": "16.14.11",
+ "@types/react-dom": "17.0.0",
+ "type-fest": "0.13.1",
+ "typescript": "4.3.5"
+ }
+}
\ No newline at end of file
diff --git a/apps/maestri-edu-admin/public/favicon.ico b/apps/maestri-edu-admin/public/favicon.ico
new file mode 100644
index 0000000..fcbdcf2
Binary files /dev/null and b/apps/maestri-edu-admin/public/favicon.ico differ
diff --git a/apps/maestri-edu-admin/public/index.html b/apps/maestri-edu-admin/public/index.html
new file mode 100644
index 0000000..059f733
--- /dev/null
+++ b/apps/maestri-edu-admin/public/index.html
@@ -0,0 +1,40 @@
+
+
+
+
+
+
+
+
+
+
+
+
+ MaestriEdu
+
+
+ You need to enable JavaScript to run this app.
+
+
+
+
diff --git a/apps/maestri-edu-admin/public/logo192.png b/apps/maestri-edu-admin/public/logo192.png
new file mode 100644
index 0000000..1918ff2
Binary files /dev/null and b/apps/maestri-edu-admin/public/logo192.png differ
diff --git a/apps/maestri-edu-admin/public/logo512.png b/apps/maestri-edu-admin/public/logo512.png
new file mode 100644
index 0000000..7e7dc74
Binary files /dev/null and b/apps/maestri-edu-admin/public/logo512.png differ
diff --git a/apps/maestri-edu-admin/public/manifest.json b/apps/maestri-edu-admin/public/manifest.json
new file mode 100644
index 0000000..cbd3799
--- /dev/null
+++ b/apps/maestri-edu-admin/public/manifest.json
@@ -0,0 +1,25 @@
+{
+ "short_name": "MaestriEdu",
+ "name": "MaestriEdu",
+ "icons": [
+ {
+ "src": "favicon.ico",
+ "sizes": "64x64 32x32 24x24 16x16",
+ "type": "image/x-icon"
+ },
+ {
+ "src": "logo192.png",
+ "type": "image/png",
+ "sizes": "192x192"
+ },
+ {
+ "src": "logo512.png",
+ "type": "image/png",
+ "sizes": "512x512"
+ }
+ ],
+ "start_url": ".",
+ "display": "standalone",
+ "theme_color": "#000000",
+ "background_color": "#ffffff"
+}
\ No newline at end of file
diff --git a/apps/maestri-edu-admin/public/robots.txt b/apps/maestri-edu-admin/public/robots.txt
new file mode 100644
index 0000000..e9e57dc
--- /dev/null
+++ b/apps/maestri-edu-admin/public/robots.txt
@@ -0,0 +1,3 @@
+# https://www.robotstxt.org/robotstxt.html
+User-agent: *
+Disallow:
diff --git a/apps/maestri-edu-admin/src/App.scss b/apps/maestri-edu-admin/src/App.scss
new file mode 100644
index 0000000..4c1cbb0
--- /dev/null
+++ b/apps/maestri-edu-admin/src/App.scss
@@ -0,0 +1,59 @@
+// .App {
+// .MuiAppBar-colorSecondary {
+// background-color: black;
+
+// .RaAppBar-menuButton-13 {
+// background-color: yellow;
+// }
+// }
+
+// .MuiDrawer-paper {
+// background-color: red;
+
+// .MuiListItemIcon-root {
+// color: white;
+// }
+// }
+
+// .MuiButton-textPrimary {
+// background-color: purple;
+// margin: 0 0.5rem;
+// color: white;
+// padding: 0.5rem 1rem;
+
+// &:hover {
+// background-color: blue;
+// }
+// }
+
+// .MuiTableRow-head {
+// .MuiTableCell-head {
+// background-color: black;
+// color: white;
+// }
+
+// .MuiTableSortLabel-root {
+// &:hover {
+// color: red;
+
+// .MuiTableSortLabel-icon {
+// color: red !important;
+// }
+// }
+// .MuiTableSortLabel-icon {
+// color: white !important;
+// }
+// }
+// .MuiTableSortLabel-active {
+// color: green;
+
+// .MuiTableSortLabel-icon {
+// color: green !important;
+// }
+// }
+// }
+
+// .MuiFormLabel-root {
+// color: magenta;
+// }
+// }
diff --git a/apps/maestri-edu-admin/src/App.tsx b/apps/maestri-edu-admin/src/App.tsx
new file mode 100644
index 0000000..827c0fb
--- /dev/null
+++ b/apps/maestri-edu-admin/src/App.tsx
@@ -0,0 +1,160 @@
+import React, { useEffect, useState } from "react";
+import { Admin, DataProvider, Resource } from "react-admin";
+import buildGraphQLProvider from "./data-provider/graphqlDataProvider";
+import { theme } from "./theme/theme";
+import Login from "./Login";
+import "./App.scss";
+import Dashboard from "./pages/Dashboard";
+import { DadosEscolaresList } from "./dadosEscolares/DadosEscolaresList";
+import { DadosEscolaresCreate } from "./dadosEscolares/DadosEscolaresCreate";
+import { DadosEscolaresEdit } from "./dadosEscolares/DadosEscolaresEdit";
+import { DadosEscolaresShow } from "./dadosEscolares/DadosEscolaresShow";
+import { PerfilList } from "./perfil/PerfilList";
+import { PerfilCreate } from "./perfil/PerfilCreate";
+import { PerfilEdit } from "./perfil/PerfilEdit";
+import { PerfilShow } from "./perfil/PerfilShow";
+import { EnderecoList } from "./endereco/EnderecoList";
+import { EnderecoCreate } from "./endereco/EnderecoCreate";
+import { EnderecoEdit } from "./endereco/EnderecoEdit";
+import { EnderecoShow } from "./endereco/EnderecoShow";
+import { ContratoList } from "./contrato/ContratoList";
+import { ContratoCreate } from "./contrato/ContratoCreate";
+import { ContratoEdit } from "./contrato/ContratoEdit";
+import { ContratoShow } from "./contrato/ContratoShow";
+import { DocumentoList } from "./documento/DocumentoList";
+import { DocumentoCreate } from "./documento/DocumentoCreate";
+import { DocumentoEdit } from "./documento/DocumentoEdit";
+import { DocumentoShow } from "./documento/DocumentoShow";
+import { CursoList } from "./curso/CursoList";
+import { CursoCreate } from "./curso/CursoCreate";
+import { CursoEdit } from "./curso/CursoEdit";
+import { CursoShow } from "./curso/CursoShow";
+import { ClassificacaoList } from "./classificacao/ClassificacaoList";
+import { ClassificacaoCreate } from "./classificacao/ClassificacaoCreate";
+import { ClassificacaoEdit } from "./classificacao/ClassificacaoEdit";
+import { ClassificacaoShow } from "./classificacao/ClassificacaoShow";
+import { BankingList } from "./banking/BankingList";
+import { BankingCreate } from "./banking/BankingCreate";
+import { BankingEdit } from "./banking/BankingEdit";
+import { BankingShow } from "./banking/BankingShow";
+import { MatriculaList } from "./matricula/MatriculaList";
+import { MatriculaCreate } from "./matricula/MatriculaCreate";
+import { MatriculaEdit } from "./matricula/MatriculaEdit";
+import { MatriculaShow } from "./matricula/MatriculaShow";
+import { ParcelaList } from "./parcela/ParcelaList";
+import { ParcelaCreate } from "./parcela/ParcelaCreate";
+import { ParcelaEdit } from "./parcela/ParcelaEdit";
+import { ParcelaShow } from "./parcela/ParcelaShow";
+import { CobrancaList } from "./cobranca/CobrancaList";
+import { CobrancaCreate } from "./cobranca/CobrancaCreate";
+import { CobrancaEdit } from "./cobranca/CobrancaEdit";
+import { CobrancaShow } from "./cobranca/CobrancaShow";
+import { jwtAuthProvider } from "./auth-provider/ra-auth-jwt";
+
+const App = (): React.ReactElement => {
+ const [dataProvider, setDataProvider] = useState(null);
+ useEffect(() => {
+ buildGraphQLProvider
+ .then((provider: any) => {
+ setDataProvider(() => provider);
+ })
+ .catch((error: any) => {
+ console.log(error);
+ });
+ }, []);
+ if (!dataProvider) {
+ return Loading
;
+ }
+ return (
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ );
+};
+
+export default App;
diff --git a/apps/maestri-edu-admin/src/Components/Pagination.tsx b/apps/maestri-edu-admin/src/Components/Pagination.tsx
new file mode 100644
index 0000000..2de2ebf
--- /dev/null
+++ b/apps/maestri-edu-admin/src/Components/Pagination.tsx
@@ -0,0 +1,10 @@
+import React from "react";
+import { Pagination as RAPagination, PaginationProps } from "react-admin";
+
+const PAGINATION_OPTIONS = [10, 25, 50, 100, 200];
+
+const Pagination = (props: PaginationProps) => (
+
+);
+
+export default Pagination;
diff --git a/apps/maestri-edu-admin/src/Login.tsx b/apps/maestri-edu-admin/src/Login.tsx
new file mode 100644
index 0000000..f7ec8ed
--- /dev/null
+++ b/apps/maestri-edu-admin/src/Login.tsx
@@ -0,0 +1,117 @@
+import * as React from "react";
+import { useState } from "react";
+import { useLogin, useNotify, Notification, defaultTheme } from "react-admin";
+import { ThemeProvider } from "@material-ui/styles";
+import { createTheme } from "@material-ui/core/styles";
+import { Button } from "@material-ui/core";
+import "./login.scss";
+
+const CLASS_NAME = "login-page";
+
+const Login = ({ theme }: any) => {
+ const [username, setUsername] = useState("");
+ const [password, setPassword] = useState("");
+ const login = useLogin();
+ const notify = useNotify();
+ const BASE_URI = process.env.REACT_APP_SERVER_URL;
+ const submit = (e: any) => {
+ e.preventDefault();
+ login({ username, password }).catch(() =>
+ notify("Invalid username or password")
+ );
+ };
+
+ return (
+
+
+
+
+
+
Connect via GraphQL
+
+ Connect to the server using GraphQL API with a complete and
+ understandable description of the data in your API
+
+
+ Continue
+
+
+
+
+
Admin UI
+
+ Sign in to a React-Admin client with ready-made forms for creating
+ and editing all the data models of your application
+
+
+
+
+
+
Connect via REST API
+
+ Connect to the server using REST API with a built-in Swagger
+ documentation
+
+
+ Continue
+
+
+
+
+
+
+
+
+ );
+};
+
+export default Login;
diff --git a/apps/maestri-edu-admin/src/api/banking/Banking.ts b/apps/maestri-edu-admin/src/api/banking/Banking.ts
new file mode 100644
index 0000000..3bc5ce2
--- /dev/null
+++ b/apps/maestri-edu-admin/src/api/banking/Banking.ts
@@ -0,0 +1,11 @@
+import { Decimal } from "decimal.js";
+
+export type Banking = {
+ createdAt: Date;
+ descricaoi: string | null;
+ id: string;
+ idConvenio: string | null;
+ movimentaO: Decimal | null;
+ status: boolean;
+ updatedAt: Date;
+};
diff --git a/apps/maestri-edu-admin/src/api/banking/BankingCountArgs.ts b/apps/maestri-edu-admin/src/api/banking/BankingCountArgs.ts
new file mode 100644
index 0000000..002d40b
--- /dev/null
+++ b/apps/maestri-edu-admin/src/api/banking/BankingCountArgs.ts
@@ -0,0 +1,5 @@
+import { BankingWhereInput } from "./BankingWhereInput";
+
+export type BankingCountArgs = {
+ where?: BankingWhereInput;
+};
diff --git a/apps/maestri-edu-admin/src/api/banking/BankingCreateInput.ts b/apps/maestri-edu-admin/src/api/banking/BankingCreateInput.ts
new file mode 100644
index 0000000..c848f7e
--- /dev/null
+++ b/apps/maestri-edu-admin/src/api/banking/BankingCreateInput.ts
@@ -0,0 +1,8 @@
+import { Decimal } from "decimal.js";
+
+export type BankingCreateInput = {
+ descricaoi?: string | null;
+ idConvenio?: string | null;
+ movimentaO?: Decimal | null;
+ status: boolean;
+};
diff --git a/apps/maestri-edu-admin/src/api/banking/BankingFindManyArgs.ts b/apps/maestri-edu-admin/src/api/banking/BankingFindManyArgs.ts
new file mode 100644
index 0000000..bc152da
--- /dev/null
+++ b/apps/maestri-edu-admin/src/api/banking/BankingFindManyArgs.ts
@@ -0,0 +1,9 @@
+import { BankingWhereInput } from "./BankingWhereInput";
+import { BankingOrderByInput } from "./BankingOrderByInput";
+
+export type BankingFindManyArgs = {
+ where?: BankingWhereInput;
+ orderBy?: Array;
+ skip?: number;
+ take?: number;
+};
diff --git a/apps/maestri-edu-admin/src/api/banking/BankingFindUniqueArgs.ts b/apps/maestri-edu-admin/src/api/banking/BankingFindUniqueArgs.ts
new file mode 100644
index 0000000..c3cbefe
--- /dev/null
+++ b/apps/maestri-edu-admin/src/api/banking/BankingFindUniqueArgs.ts
@@ -0,0 +1,5 @@
+import { BankingWhereUniqueInput } from "./BankingWhereUniqueInput";
+
+export type BankingFindUniqueArgs = {
+ where: BankingWhereUniqueInput;
+};
diff --git a/apps/maestri-edu-admin/src/api/banking/BankingListRelationFilter.ts b/apps/maestri-edu-admin/src/api/banking/BankingListRelationFilter.ts
new file mode 100644
index 0000000..85edcec
--- /dev/null
+++ b/apps/maestri-edu-admin/src/api/banking/BankingListRelationFilter.ts
@@ -0,0 +1,7 @@
+import { BankingWhereInput } from "./BankingWhereInput";
+
+export type BankingListRelationFilter = {
+ every?: BankingWhereInput;
+ some?: BankingWhereInput;
+ none?: BankingWhereInput;
+};
diff --git a/apps/maestri-edu-admin/src/api/banking/BankingOrderByInput.ts b/apps/maestri-edu-admin/src/api/banking/BankingOrderByInput.ts
new file mode 100644
index 0000000..71a7456
--- /dev/null
+++ b/apps/maestri-edu-admin/src/api/banking/BankingOrderByInput.ts
@@ -0,0 +1,11 @@
+import { SortOrder } from "../../util/SortOrder";
+
+export type BankingOrderByInput = {
+ createdAt?: SortOrder;
+ descricaoi?: SortOrder;
+ id?: SortOrder;
+ idConvenio?: SortOrder;
+ movimentaO?: SortOrder;
+ status?: SortOrder;
+ updatedAt?: SortOrder;
+};
diff --git a/apps/maestri-edu-admin/src/api/banking/BankingUpdateInput.ts b/apps/maestri-edu-admin/src/api/banking/BankingUpdateInput.ts
new file mode 100644
index 0000000..b15a107
--- /dev/null
+++ b/apps/maestri-edu-admin/src/api/banking/BankingUpdateInput.ts
@@ -0,0 +1,8 @@
+import { Decimal } from "decimal.js";
+
+export type BankingUpdateInput = {
+ descricaoi?: string | null;
+ idConvenio?: string | null;
+ movimentaO?: Decimal | null;
+ status?: boolean;
+};
diff --git a/apps/maestri-edu-admin/src/api/banking/BankingWhereInput.ts b/apps/maestri-edu-admin/src/api/banking/BankingWhereInput.ts
new file mode 100644
index 0000000..865e7e9
--- /dev/null
+++ b/apps/maestri-edu-admin/src/api/banking/BankingWhereInput.ts
@@ -0,0 +1,12 @@
+import { StringNullableFilter } from "../../util/StringNullableFilter";
+import { StringFilter } from "../../util/StringFilter";
+import { DecimalNullableFilter } from "../../util/DecimalNullableFilter";
+import { BooleanFilter } from "../../util/BooleanFilter";
+
+export type BankingWhereInput = {
+ descricaoi?: StringNullableFilter;
+ id?: StringFilter;
+ idConvenio?: StringNullableFilter;
+ movimentaO?: DecimalNullableFilter;
+ status?: BooleanFilter;
+};
diff --git a/apps/maestri-edu-admin/src/api/banking/BankingWhereUniqueInput.ts b/apps/maestri-edu-admin/src/api/banking/BankingWhereUniqueInput.ts
new file mode 100644
index 0000000..4547d29
--- /dev/null
+++ b/apps/maestri-edu-admin/src/api/banking/BankingWhereUniqueInput.ts
@@ -0,0 +1,3 @@
+export type BankingWhereUniqueInput = {
+ id: string;
+};
diff --git a/apps/maestri-edu-admin/src/api/banking/CreateBankingArgs.ts b/apps/maestri-edu-admin/src/api/banking/CreateBankingArgs.ts
new file mode 100644
index 0000000..915adfa
--- /dev/null
+++ b/apps/maestri-edu-admin/src/api/banking/CreateBankingArgs.ts
@@ -0,0 +1,5 @@
+import { BankingCreateInput } from "./BankingCreateInput";
+
+export type CreateBankingArgs = {
+ data: BankingCreateInput;
+};
diff --git a/apps/maestri-edu-admin/src/api/banking/DeleteBankingArgs.ts b/apps/maestri-edu-admin/src/api/banking/DeleteBankingArgs.ts
new file mode 100644
index 0000000..ede26b2
--- /dev/null
+++ b/apps/maestri-edu-admin/src/api/banking/DeleteBankingArgs.ts
@@ -0,0 +1,5 @@
+import { BankingWhereUniqueInput } from "./BankingWhereUniqueInput";
+
+export type DeleteBankingArgs = {
+ where: BankingWhereUniqueInput;
+};
diff --git a/apps/maestri-edu-admin/src/api/banking/UpdateBankingArgs.ts b/apps/maestri-edu-admin/src/api/banking/UpdateBankingArgs.ts
new file mode 100644
index 0000000..616b75a
--- /dev/null
+++ b/apps/maestri-edu-admin/src/api/banking/UpdateBankingArgs.ts
@@ -0,0 +1,7 @@
+import { BankingWhereUniqueInput } from "./BankingWhereUniqueInput";
+import { BankingUpdateInput } from "./BankingUpdateInput";
+
+export type UpdateBankingArgs = {
+ where: BankingWhereUniqueInput;
+ data: BankingUpdateInput;
+};
diff --git a/apps/maestri-edu-admin/src/api/classificacao/Classificacao.ts b/apps/maestri-edu-admin/src/api/classificacao/Classificacao.ts
new file mode 100644
index 0000000..0f3a135
--- /dev/null
+++ b/apps/maestri-edu-admin/src/api/classificacao/Classificacao.ts
@@ -0,0 +1,5 @@
+export type Classificacao = {
+ createdAt: Date;
+ id: string;
+ updatedAt: Date;
+};
diff --git a/apps/maestri-edu-admin/src/api/classificacao/ClassificacaoCountArgs.ts b/apps/maestri-edu-admin/src/api/classificacao/ClassificacaoCountArgs.ts
new file mode 100644
index 0000000..a58baea
--- /dev/null
+++ b/apps/maestri-edu-admin/src/api/classificacao/ClassificacaoCountArgs.ts
@@ -0,0 +1,5 @@
+import { ClassificacaoWhereInput } from "./ClassificacaoWhereInput";
+
+export type ClassificacaoCountArgs = {
+ where?: ClassificacaoWhereInput;
+};
diff --git a/apps/maestri-edu-admin/src/api/classificacao/ClassificacaoCreateInput.ts b/apps/maestri-edu-admin/src/api/classificacao/ClassificacaoCreateInput.ts
new file mode 100644
index 0000000..159d8b3
--- /dev/null
+++ b/apps/maestri-edu-admin/src/api/classificacao/ClassificacaoCreateInput.ts
@@ -0,0 +1 @@
+export type ClassificacaoCreateInput = {};
diff --git a/apps/maestri-edu-admin/src/api/classificacao/ClassificacaoFindManyArgs.ts b/apps/maestri-edu-admin/src/api/classificacao/ClassificacaoFindManyArgs.ts
new file mode 100644
index 0000000..bb2d272
--- /dev/null
+++ b/apps/maestri-edu-admin/src/api/classificacao/ClassificacaoFindManyArgs.ts
@@ -0,0 +1,9 @@
+import { ClassificacaoWhereInput } from "./ClassificacaoWhereInput";
+import { ClassificacaoOrderByInput } from "./ClassificacaoOrderByInput";
+
+export type ClassificacaoFindManyArgs = {
+ where?: ClassificacaoWhereInput;
+ orderBy?: Array;
+ skip?: number;
+ take?: number;
+};
diff --git a/apps/maestri-edu-admin/src/api/classificacao/ClassificacaoFindUniqueArgs.ts b/apps/maestri-edu-admin/src/api/classificacao/ClassificacaoFindUniqueArgs.ts
new file mode 100644
index 0000000..d6938c7
--- /dev/null
+++ b/apps/maestri-edu-admin/src/api/classificacao/ClassificacaoFindUniqueArgs.ts
@@ -0,0 +1,5 @@
+import { ClassificacaoWhereUniqueInput } from "./ClassificacaoWhereUniqueInput";
+
+export type ClassificacaoFindUniqueArgs = {
+ where: ClassificacaoWhereUniqueInput;
+};
diff --git a/apps/maestri-edu-admin/src/api/classificacao/ClassificacaoListRelationFilter.ts b/apps/maestri-edu-admin/src/api/classificacao/ClassificacaoListRelationFilter.ts
new file mode 100644
index 0000000..73ace61
--- /dev/null
+++ b/apps/maestri-edu-admin/src/api/classificacao/ClassificacaoListRelationFilter.ts
@@ -0,0 +1,7 @@
+import { ClassificacaoWhereInput } from "./ClassificacaoWhereInput";
+
+export type ClassificacaoListRelationFilter = {
+ every?: ClassificacaoWhereInput;
+ some?: ClassificacaoWhereInput;
+ none?: ClassificacaoWhereInput;
+};
diff --git a/apps/maestri-edu-admin/src/api/classificacao/ClassificacaoOrderByInput.ts b/apps/maestri-edu-admin/src/api/classificacao/ClassificacaoOrderByInput.ts
new file mode 100644
index 0000000..edf8226
--- /dev/null
+++ b/apps/maestri-edu-admin/src/api/classificacao/ClassificacaoOrderByInput.ts
@@ -0,0 +1,7 @@
+import { SortOrder } from "../../util/SortOrder";
+
+export type ClassificacaoOrderByInput = {
+ createdAt?: SortOrder;
+ id?: SortOrder;
+ updatedAt?: SortOrder;
+};
diff --git a/apps/maestri-edu-admin/src/api/classificacao/ClassificacaoUpdateInput.ts b/apps/maestri-edu-admin/src/api/classificacao/ClassificacaoUpdateInput.ts
new file mode 100644
index 0000000..466e61f
--- /dev/null
+++ b/apps/maestri-edu-admin/src/api/classificacao/ClassificacaoUpdateInput.ts
@@ -0,0 +1 @@
+export type ClassificacaoUpdateInput = {};
diff --git a/apps/maestri-edu-admin/src/api/classificacao/ClassificacaoWhereInput.ts b/apps/maestri-edu-admin/src/api/classificacao/ClassificacaoWhereInput.ts
new file mode 100644
index 0000000..b555ba8
--- /dev/null
+++ b/apps/maestri-edu-admin/src/api/classificacao/ClassificacaoWhereInput.ts
@@ -0,0 +1,5 @@
+import { StringFilter } from "../../util/StringFilter";
+
+export type ClassificacaoWhereInput = {
+ id?: StringFilter;
+};
diff --git a/apps/maestri-edu-admin/src/api/classificacao/ClassificacaoWhereUniqueInput.ts b/apps/maestri-edu-admin/src/api/classificacao/ClassificacaoWhereUniqueInput.ts
new file mode 100644
index 0000000..f7ba40f
--- /dev/null
+++ b/apps/maestri-edu-admin/src/api/classificacao/ClassificacaoWhereUniqueInput.ts
@@ -0,0 +1,3 @@
+export type ClassificacaoWhereUniqueInput = {
+ id: string;
+};
diff --git a/apps/maestri-edu-admin/src/api/classificacao/DeleteClassificacaoArgs.ts b/apps/maestri-edu-admin/src/api/classificacao/DeleteClassificacaoArgs.ts
new file mode 100644
index 0000000..5e36dd3
--- /dev/null
+++ b/apps/maestri-edu-admin/src/api/classificacao/DeleteClassificacaoArgs.ts
@@ -0,0 +1,5 @@
+import { ClassificacaoWhereUniqueInput } from "./ClassificacaoWhereUniqueInput";
+
+export type DeleteClassificacaoArgs = {
+ where: ClassificacaoWhereUniqueInput;
+};
diff --git a/apps/maestri-edu-admin/src/api/cobranca/Cobranca.ts b/apps/maestri-edu-admin/src/api/cobranca/Cobranca.ts
new file mode 100644
index 0000000..ba13628
--- /dev/null
+++ b/apps/maestri-edu-admin/src/api/cobranca/Cobranca.ts
@@ -0,0 +1,5 @@
+export type Cobranca = {
+ createdAt: Date;
+ id: string;
+ updatedAt: Date;
+};
diff --git a/apps/maestri-edu-admin/src/api/cobranca/CobrancaCountArgs.ts b/apps/maestri-edu-admin/src/api/cobranca/CobrancaCountArgs.ts
new file mode 100644
index 0000000..8141360
--- /dev/null
+++ b/apps/maestri-edu-admin/src/api/cobranca/CobrancaCountArgs.ts
@@ -0,0 +1,5 @@
+import { CobrancaWhereInput } from "./CobrancaWhereInput";
+
+export type CobrancaCountArgs = {
+ where?: CobrancaWhereInput;
+};
diff --git a/apps/maestri-edu-admin/src/api/cobranca/CobrancaCreateInput.ts b/apps/maestri-edu-admin/src/api/cobranca/CobrancaCreateInput.ts
new file mode 100644
index 0000000..32c5ea7
--- /dev/null
+++ b/apps/maestri-edu-admin/src/api/cobranca/CobrancaCreateInput.ts
@@ -0,0 +1 @@
+export type CobrancaCreateInput = {};
diff --git a/apps/maestri-edu-admin/src/api/cobranca/CobrancaFindManyArgs.ts b/apps/maestri-edu-admin/src/api/cobranca/CobrancaFindManyArgs.ts
new file mode 100644
index 0000000..7c7eda0
--- /dev/null
+++ b/apps/maestri-edu-admin/src/api/cobranca/CobrancaFindManyArgs.ts
@@ -0,0 +1,9 @@
+import { CobrancaWhereInput } from "./CobrancaWhereInput";
+import { CobrancaOrderByInput } from "./CobrancaOrderByInput";
+
+export type CobrancaFindManyArgs = {
+ where?: CobrancaWhereInput;
+ orderBy?: Array;
+ skip?: number;
+ take?: number;
+};
diff --git a/apps/maestri-edu-admin/src/api/cobranca/CobrancaFindUniqueArgs.ts b/apps/maestri-edu-admin/src/api/cobranca/CobrancaFindUniqueArgs.ts
new file mode 100644
index 0000000..1cf0957
--- /dev/null
+++ b/apps/maestri-edu-admin/src/api/cobranca/CobrancaFindUniqueArgs.ts
@@ -0,0 +1,5 @@
+import { CobrancaWhereUniqueInput } from "./CobrancaWhereUniqueInput";
+
+export type CobrancaFindUniqueArgs = {
+ where: CobrancaWhereUniqueInput;
+};
diff --git a/apps/maestri-edu-admin/src/api/cobranca/CobrancaListRelationFilter.ts b/apps/maestri-edu-admin/src/api/cobranca/CobrancaListRelationFilter.ts
new file mode 100644
index 0000000..3bb7523
--- /dev/null
+++ b/apps/maestri-edu-admin/src/api/cobranca/CobrancaListRelationFilter.ts
@@ -0,0 +1,7 @@
+import { CobrancaWhereInput } from "./CobrancaWhereInput";
+
+export type CobrancaListRelationFilter = {
+ every?: CobrancaWhereInput;
+ some?: CobrancaWhereInput;
+ none?: CobrancaWhereInput;
+};
diff --git a/apps/maestri-edu-admin/src/api/cobranca/CobrancaOrderByInput.ts b/apps/maestri-edu-admin/src/api/cobranca/CobrancaOrderByInput.ts
new file mode 100644
index 0000000..f41ca57
--- /dev/null
+++ b/apps/maestri-edu-admin/src/api/cobranca/CobrancaOrderByInput.ts
@@ -0,0 +1,7 @@
+import { SortOrder } from "../../util/SortOrder";
+
+export type CobrancaOrderByInput = {
+ createdAt?: SortOrder;
+ id?: SortOrder;
+ updatedAt?: SortOrder;
+};
diff --git a/apps/maestri-edu-admin/src/api/cobranca/CobrancaUpdateInput.ts b/apps/maestri-edu-admin/src/api/cobranca/CobrancaUpdateInput.ts
new file mode 100644
index 0000000..617f48d
--- /dev/null
+++ b/apps/maestri-edu-admin/src/api/cobranca/CobrancaUpdateInput.ts
@@ -0,0 +1 @@
+export type CobrancaUpdateInput = {};
diff --git a/apps/maestri-edu-admin/src/api/cobranca/CobrancaWhereInput.ts b/apps/maestri-edu-admin/src/api/cobranca/CobrancaWhereInput.ts
new file mode 100644
index 0000000..fcae672
--- /dev/null
+++ b/apps/maestri-edu-admin/src/api/cobranca/CobrancaWhereInput.ts
@@ -0,0 +1,5 @@
+import { StringFilter } from "../../util/StringFilter";
+
+export type CobrancaWhereInput = {
+ id?: StringFilter;
+};
diff --git a/apps/maestri-edu-admin/src/api/cobranca/CobrancaWhereUniqueInput.ts b/apps/maestri-edu-admin/src/api/cobranca/CobrancaWhereUniqueInput.ts
new file mode 100644
index 0000000..d25ddd8
--- /dev/null
+++ b/apps/maestri-edu-admin/src/api/cobranca/CobrancaWhereUniqueInput.ts
@@ -0,0 +1,3 @@
+export type CobrancaWhereUniqueInput = {
+ id: string;
+};
diff --git a/apps/maestri-edu-admin/src/api/cobranca/DeleteCobrancaArgs.ts b/apps/maestri-edu-admin/src/api/cobranca/DeleteCobrancaArgs.ts
new file mode 100644
index 0000000..4a5f533
--- /dev/null
+++ b/apps/maestri-edu-admin/src/api/cobranca/DeleteCobrancaArgs.ts
@@ -0,0 +1,5 @@
+import { CobrancaWhereUniqueInput } from "./CobrancaWhereUniqueInput";
+
+export type DeleteCobrancaArgs = {
+ where: CobrancaWhereUniqueInput;
+};
diff --git a/apps/maestri-edu-admin/src/api/contrato/Contrato.ts b/apps/maestri-edu-admin/src/api/contrato/Contrato.ts
new file mode 100644
index 0000000..907d9b8
--- /dev/null
+++ b/apps/maestri-edu-admin/src/api/contrato/Contrato.ts
@@ -0,0 +1,6 @@
+export type Contrato = {
+ createdAt: Date;
+ id: string;
+ perfilReferencia: string | null;
+ updatedAt: Date;
+};
diff --git a/apps/maestri-edu-admin/src/api/contrato/ContratoCountArgs.ts b/apps/maestri-edu-admin/src/api/contrato/ContratoCountArgs.ts
new file mode 100644
index 0000000..93949ff
--- /dev/null
+++ b/apps/maestri-edu-admin/src/api/contrato/ContratoCountArgs.ts
@@ -0,0 +1,5 @@
+import { ContratoWhereInput } from "./ContratoWhereInput";
+
+export type ContratoCountArgs = {
+ where?: ContratoWhereInput;
+};
diff --git a/apps/maestri-edu-admin/src/api/contrato/ContratoCreateInput.ts b/apps/maestri-edu-admin/src/api/contrato/ContratoCreateInput.ts
new file mode 100644
index 0000000..c602775
--- /dev/null
+++ b/apps/maestri-edu-admin/src/api/contrato/ContratoCreateInput.ts
@@ -0,0 +1,3 @@
+export type ContratoCreateInput = {
+ perfilReferencia?: string | null;
+};
diff --git a/apps/maestri-edu-admin/src/api/contrato/ContratoFindManyArgs.ts b/apps/maestri-edu-admin/src/api/contrato/ContratoFindManyArgs.ts
new file mode 100644
index 0000000..0052588
--- /dev/null
+++ b/apps/maestri-edu-admin/src/api/contrato/ContratoFindManyArgs.ts
@@ -0,0 +1,9 @@
+import { ContratoWhereInput } from "./ContratoWhereInput";
+import { ContratoOrderByInput } from "./ContratoOrderByInput";
+
+export type ContratoFindManyArgs = {
+ where?: ContratoWhereInput;
+ orderBy?: Array;
+ skip?: number;
+ take?: number;
+};
diff --git a/apps/maestri-edu-admin/src/api/contrato/ContratoFindUniqueArgs.ts b/apps/maestri-edu-admin/src/api/contrato/ContratoFindUniqueArgs.ts
new file mode 100644
index 0000000..32a8ec7
--- /dev/null
+++ b/apps/maestri-edu-admin/src/api/contrato/ContratoFindUniqueArgs.ts
@@ -0,0 +1,5 @@
+import { ContratoWhereUniqueInput } from "./ContratoWhereUniqueInput";
+
+export type ContratoFindUniqueArgs = {
+ where: ContratoWhereUniqueInput;
+};
diff --git a/apps/maestri-edu-admin/src/api/contrato/ContratoListRelationFilter.ts b/apps/maestri-edu-admin/src/api/contrato/ContratoListRelationFilter.ts
new file mode 100644
index 0000000..ab8980f
--- /dev/null
+++ b/apps/maestri-edu-admin/src/api/contrato/ContratoListRelationFilter.ts
@@ -0,0 +1,7 @@
+import { ContratoWhereInput } from "./ContratoWhereInput";
+
+export type ContratoListRelationFilter = {
+ every?: ContratoWhereInput;
+ some?: ContratoWhereInput;
+ none?: ContratoWhereInput;
+};
diff --git a/apps/maestri-edu-admin/src/api/contrato/ContratoOrderByInput.ts b/apps/maestri-edu-admin/src/api/contrato/ContratoOrderByInput.ts
new file mode 100644
index 0000000..154c62a
--- /dev/null
+++ b/apps/maestri-edu-admin/src/api/contrato/ContratoOrderByInput.ts
@@ -0,0 +1,8 @@
+import { SortOrder } from "../../util/SortOrder";
+
+export type ContratoOrderByInput = {
+ createdAt?: SortOrder;
+ id?: SortOrder;
+ perfilReferencia?: SortOrder;
+ updatedAt?: SortOrder;
+};
diff --git a/apps/maestri-edu-admin/src/api/contrato/ContratoUpdateInput.ts b/apps/maestri-edu-admin/src/api/contrato/ContratoUpdateInput.ts
new file mode 100644
index 0000000..07f8ba1
--- /dev/null
+++ b/apps/maestri-edu-admin/src/api/contrato/ContratoUpdateInput.ts
@@ -0,0 +1,3 @@
+export type ContratoUpdateInput = {
+ perfilReferencia?: string | null;
+};
diff --git a/apps/maestri-edu-admin/src/api/contrato/ContratoWhereInput.ts b/apps/maestri-edu-admin/src/api/contrato/ContratoWhereInput.ts
new file mode 100644
index 0000000..6e8d7d2
--- /dev/null
+++ b/apps/maestri-edu-admin/src/api/contrato/ContratoWhereInput.ts
@@ -0,0 +1,7 @@
+import { StringFilter } from "../../util/StringFilter";
+import { StringNullableFilter } from "../../util/StringNullableFilter";
+
+export type ContratoWhereInput = {
+ id?: StringFilter;
+ perfilReferencia?: StringNullableFilter;
+};
diff --git a/apps/maestri-edu-admin/src/api/contrato/ContratoWhereUniqueInput.ts b/apps/maestri-edu-admin/src/api/contrato/ContratoWhereUniqueInput.ts
new file mode 100644
index 0000000..04a410f
--- /dev/null
+++ b/apps/maestri-edu-admin/src/api/contrato/ContratoWhereUniqueInput.ts
@@ -0,0 +1,3 @@
+export type ContratoWhereUniqueInput = {
+ id: string;
+};
diff --git a/apps/maestri-edu-admin/src/api/contrato/CreateContratoArgs.ts b/apps/maestri-edu-admin/src/api/contrato/CreateContratoArgs.ts
new file mode 100644
index 0000000..3ba38c6
--- /dev/null
+++ b/apps/maestri-edu-admin/src/api/contrato/CreateContratoArgs.ts
@@ -0,0 +1,5 @@
+import { ContratoCreateInput } from "./ContratoCreateInput";
+
+export type CreateContratoArgs = {
+ data: ContratoCreateInput;
+};
diff --git a/apps/maestri-edu-admin/src/api/contrato/DeleteContratoArgs.ts b/apps/maestri-edu-admin/src/api/contrato/DeleteContratoArgs.ts
new file mode 100644
index 0000000..0bd79eb
--- /dev/null
+++ b/apps/maestri-edu-admin/src/api/contrato/DeleteContratoArgs.ts
@@ -0,0 +1,5 @@
+import { ContratoWhereUniqueInput } from "./ContratoWhereUniqueInput";
+
+export type DeleteContratoArgs = {
+ where: ContratoWhereUniqueInput;
+};
diff --git a/apps/maestri-edu-admin/src/api/contrato/UpdateContratoArgs.ts b/apps/maestri-edu-admin/src/api/contrato/UpdateContratoArgs.ts
new file mode 100644
index 0000000..ce1e649
--- /dev/null
+++ b/apps/maestri-edu-admin/src/api/contrato/UpdateContratoArgs.ts
@@ -0,0 +1,7 @@
+import { ContratoWhereUniqueInput } from "./ContratoWhereUniqueInput";
+import { ContratoUpdateInput } from "./ContratoUpdateInput";
+
+export type UpdateContratoArgs = {
+ where: ContratoWhereUniqueInput;
+ data: ContratoUpdateInput;
+};
diff --git a/apps/maestri-edu-admin/src/api/curso/CreateCursoArgs.ts b/apps/maestri-edu-admin/src/api/curso/CreateCursoArgs.ts
new file mode 100644
index 0000000..6306842
--- /dev/null
+++ b/apps/maestri-edu-admin/src/api/curso/CreateCursoArgs.ts
@@ -0,0 +1,5 @@
+import { CursoCreateInput } from "./CursoCreateInput";
+
+export type CreateCursoArgs = {
+ data: CursoCreateInput;
+};
diff --git a/apps/maestri-edu-admin/src/api/curso/Curso.ts b/apps/maestri-edu-admin/src/api/curso/Curso.ts
new file mode 100644
index 0000000..f822a2b
--- /dev/null
+++ b/apps/maestri-edu-admin/src/api/curso/Curso.ts
@@ -0,0 +1,8 @@
+import { Matricula } from "../matricula/Matricula";
+
+export type Curso = {
+ createdAt: Date;
+ id: string;
+ matriculas?: Array;
+ updatedAt: Date;
+};
diff --git a/apps/maestri-edu-admin/src/api/curso/CursoCountArgs.ts b/apps/maestri-edu-admin/src/api/curso/CursoCountArgs.ts
new file mode 100644
index 0000000..2bc62fe
--- /dev/null
+++ b/apps/maestri-edu-admin/src/api/curso/CursoCountArgs.ts
@@ -0,0 +1,5 @@
+import { CursoWhereInput } from "./CursoWhereInput";
+
+export type CursoCountArgs = {
+ where?: CursoWhereInput;
+};
diff --git a/apps/maestri-edu-admin/src/api/curso/CursoCreateInput.ts b/apps/maestri-edu-admin/src/api/curso/CursoCreateInput.ts
new file mode 100644
index 0000000..0ecb3c1
--- /dev/null
+++ b/apps/maestri-edu-admin/src/api/curso/CursoCreateInput.ts
@@ -0,0 +1,5 @@
+import { MatriculaCreateNestedManyWithoutCursosInput } from "./MatriculaCreateNestedManyWithoutCursosInput";
+
+export type CursoCreateInput = {
+ matriculas?: MatriculaCreateNestedManyWithoutCursosInput;
+};
diff --git a/apps/maestri-edu-admin/src/api/curso/CursoFindManyArgs.ts b/apps/maestri-edu-admin/src/api/curso/CursoFindManyArgs.ts
new file mode 100644
index 0000000..6e9034c
--- /dev/null
+++ b/apps/maestri-edu-admin/src/api/curso/CursoFindManyArgs.ts
@@ -0,0 +1,9 @@
+import { CursoWhereInput } from "./CursoWhereInput";
+import { CursoOrderByInput } from "./CursoOrderByInput";
+
+export type CursoFindManyArgs = {
+ where?: CursoWhereInput;
+ orderBy?: Array;
+ skip?: number;
+ take?: number;
+};
diff --git a/apps/maestri-edu-admin/src/api/curso/CursoFindUniqueArgs.ts b/apps/maestri-edu-admin/src/api/curso/CursoFindUniqueArgs.ts
new file mode 100644
index 0000000..d5d1027
--- /dev/null
+++ b/apps/maestri-edu-admin/src/api/curso/CursoFindUniqueArgs.ts
@@ -0,0 +1,5 @@
+import { CursoWhereUniqueInput } from "./CursoWhereUniqueInput";
+
+export type CursoFindUniqueArgs = {
+ where: CursoWhereUniqueInput;
+};
diff --git a/apps/maestri-edu-admin/src/api/curso/CursoListRelationFilter.ts b/apps/maestri-edu-admin/src/api/curso/CursoListRelationFilter.ts
new file mode 100644
index 0000000..199977f
--- /dev/null
+++ b/apps/maestri-edu-admin/src/api/curso/CursoListRelationFilter.ts
@@ -0,0 +1,7 @@
+import { CursoWhereInput } from "./CursoWhereInput";
+
+export type CursoListRelationFilter = {
+ every?: CursoWhereInput;
+ some?: CursoWhereInput;
+ none?: CursoWhereInput;
+};
diff --git a/apps/maestri-edu-admin/src/api/curso/CursoOrderByInput.ts b/apps/maestri-edu-admin/src/api/curso/CursoOrderByInput.ts
new file mode 100644
index 0000000..384a705
--- /dev/null
+++ b/apps/maestri-edu-admin/src/api/curso/CursoOrderByInput.ts
@@ -0,0 +1,7 @@
+import { SortOrder } from "../../util/SortOrder";
+
+export type CursoOrderByInput = {
+ createdAt?: SortOrder;
+ id?: SortOrder;
+ updatedAt?: SortOrder;
+};
diff --git a/apps/maestri-edu-admin/src/api/curso/CursoUpdateInput.ts b/apps/maestri-edu-admin/src/api/curso/CursoUpdateInput.ts
new file mode 100644
index 0000000..7cc9970
--- /dev/null
+++ b/apps/maestri-edu-admin/src/api/curso/CursoUpdateInput.ts
@@ -0,0 +1,5 @@
+import { MatriculaUpdateManyWithoutCursosInput } from "./MatriculaUpdateManyWithoutCursosInput";
+
+export type CursoUpdateInput = {
+ matriculas?: MatriculaUpdateManyWithoutCursosInput;
+};
diff --git a/apps/maestri-edu-admin/src/api/curso/CursoWhereInput.ts b/apps/maestri-edu-admin/src/api/curso/CursoWhereInput.ts
new file mode 100644
index 0000000..5caa34c
--- /dev/null
+++ b/apps/maestri-edu-admin/src/api/curso/CursoWhereInput.ts
@@ -0,0 +1,7 @@
+import { StringFilter } from "../../util/StringFilter";
+import { MatriculaListRelationFilter } from "../matricula/MatriculaListRelationFilter";
+
+export type CursoWhereInput = {
+ id?: StringFilter;
+ matriculas?: MatriculaListRelationFilter;
+};
diff --git a/apps/maestri-edu-admin/src/api/curso/CursoWhereUniqueInput.ts b/apps/maestri-edu-admin/src/api/curso/CursoWhereUniqueInput.ts
new file mode 100644
index 0000000..55ecd03
--- /dev/null
+++ b/apps/maestri-edu-admin/src/api/curso/CursoWhereUniqueInput.ts
@@ -0,0 +1,3 @@
+export type CursoWhereUniqueInput = {
+ id: string;
+};
diff --git a/apps/maestri-edu-admin/src/api/curso/DeleteCursoArgs.ts b/apps/maestri-edu-admin/src/api/curso/DeleteCursoArgs.ts
new file mode 100644
index 0000000..fd46814
--- /dev/null
+++ b/apps/maestri-edu-admin/src/api/curso/DeleteCursoArgs.ts
@@ -0,0 +1,5 @@
+import { CursoWhereUniqueInput } from "./CursoWhereUniqueInput";
+
+export type DeleteCursoArgs = {
+ where: CursoWhereUniqueInput;
+};
diff --git a/apps/maestri-edu-admin/src/api/curso/MatriculaCreateNestedManyWithoutCursosInput.ts b/apps/maestri-edu-admin/src/api/curso/MatriculaCreateNestedManyWithoutCursosInput.ts
new file mode 100644
index 0000000..959109a
--- /dev/null
+++ b/apps/maestri-edu-admin/src/api/curso/MatriculaCreateNestedManyWithoutCursosInput.ts
@@ -0,0 +1,5 @@
+import { MatriculaWhereUniqueInput } from "../matricula/MatriculaWhereUniqueInput";
+
+export type MatriculaCreateNestedManyWithoutCursosInput = {
+ connect?: Array;
+};
diff --git a/apps/maestri-edu-admin/src/api/curso/MatriculaUpdateManyWithoutCursosInput.ts b/apps/maestri-edu-admin/src/api/curso/MatriculaUpdateManyWithoutCursosInput.ts
new file mode 100644
index 0000000..cc7400e
--- /dev/null
+++ b/apps/maestri-edu-admin/src/api/curso/MatriculaUpdateManyWithoutCursosInput.ts
@@ -0,0 +1,7 @@
+import { MatriculaWhereUniqueInput } from "../matricula/MatriculaWhereUniqueInput";
+
+export type MatriculaUpdateManyWithoutCursosInput = {
+ connect?: Array;
+ disconnect?: Array;
+ set?: Array;
+};
diff --git a/apps/maestri-edu-admin/src/api/curso/UpdateCursoArgs.ts b/apps/maestri-edu-admin/src/api/curso/UpdateCursoArgs.ts
new file mode 100644
index 0000000..70ee288
--- /dev/null
+++ b/apps/maestri-edu-admin/src/api/curso/UpdateCursoArgs.ts
@@ -0,0 +1,7 @@
+import { CursoWhereUniqueInput } from "./CursoWhereUniqueInput";
+import { CursoUpdateInput } from "./CursoUpdateInput";
+
+export type UpdateCursoArgs = {
+ where: CursoWhereUniqueInput;
+ data: CursoUpdateInput;
+};
diff --git a/apps/maestri-edu-admin/src/api/dadosEscolares/CreateDadosEscolaresArgs.ts b/apps/maestri-edu-admin/src/api/dadosEscolares/CreateDadosEscolaresArgs.ts
new file mode 100644
index 0000000..bc09eee
--- /dev/null
+++ b/apps/maestri-edu-admin/src/api/dadosEscolares/CreateDadosEscolaresArgs.ts
@@ -0,0 +1,5 @@
+import { DadosEscolaresCreateInput } from "./DadosEscolaresCreateInput";
+
+export type CreateDadosEscolaresArgs = {
+ data: DadosEscolaresCreateInput;
+};
diff --git a/apps/maestri-edu-admin/src/api/dadosEscolares/DadosEscolares.ts b/apps/maestri-edu-admin/src/api/dadosEscolares/DadosEscolares.ts
new file mode 100644
index 0000000..b0fbde1
--- /dev/null
+++ b/apps/maestri-edu-admin/src/api/dadosEscolares/DadosEscolares.ts
@@ -0,0 +1,6 @@
+export type DadosEscolares = {
+ createdAt: Date;
+ id: string;
+ perfilReferencia: string | null;
+ updatedAt: Date;
+};
diff --git a/apps/maestri-edu-admin/src/api/dadosEscolares/DadosEscolaresCountArgs.ts b/apps/maestri-edu-admin/src/api/dadosEscolares/DadosEscolaresCountArgs.ts
new file mode 100644
index 0000000..c125cb0
--- /dev/null
+++ b/apps/maestri-edu-admin/src/api/dadosEscolares/DadosEscolaresCountArgs.ts
@@ -0,0 +1,5 @@
+import { DadosEscolaresWhereInput } from "./DadosEscolaresWhereInput";
+
+export type DadosEscolaresCountArgs = {
+ where?: DadosEscolaresWhereInput;
+};
diff --git a/apps/maestri-edu-admin/src/api/dadosEscolares/DadosEscolaresCreateInput.ts b/apps/maestri-edu-admin/src/api/dadosEscolares/DadosEscolaresCreateInput.ts
new file mode 100644
index 0000000..717b95e
--- /dev/null
+++ b/apps/maestri-edu-admin/src/api/dadosEscolares/DadosEscolaresCreateInput.ts
@@ -0,0 +1,3 @@
+export type DadosEscolaresCreateInput = {
+ perfilReferencia?: string | null;
+};
diff --git a/apps/maestri-edu-admin/src/api/dadosEscolares/DadosEscolaresFindManyArgs.ts b/apps/maestri-edu-admin/src/api/dadosEscolares/DadosEscolaresFindManyArgs.ts
new file mode 100644
index 0000000..4b18379
--- /dev/null
+++ b/apps/maestri-edu-admin/src/api/dadosEscolares/DadosEscolaresFindManyArgs.ts
@@ -0,0 +1,9 @@
+import { DadosEscolaresWhereInput } from "./DadosEscolaresWhereInput";
+import { DadosEscolaresOrderByInput } from "./DadosEscolaresOrderByInput";
+
+export type DadosEscolaresFindManyArgs = {
+ where?: DadosEscolaresWhereInput;
+ orderBy?: Array;
+ skip?: number;
+ take?: number;
+};
diff --git a/apps/maestri-edu-admin/src/api/dadosEscolares/DadosEscolaresFindUniqueArgs.ts b/apps/maestri-edu-admin/src/api/dadosEscolares/DadosEscolaresFindUniqueArgs.ts
new file mode 100644
index 0000000..31fc3dd
--- /dev/null
+++ b/apps/maestri-edu-admin/src/api/dadosEscolares/DadosEscolaresFindUniqueArgs.ts
@@ -0,0 +1,5 @@
+import { DadosEscolaresWhereUniqueInput } from "./DadosEscolaresWhereUniqueInput";
+
+export type DadosEscolaresFindUniqueArgs = {
+ where: DadosEscolaresWhereUniqueInput;
+};
diff --git a/apps/maestri-edu-admin/src/api/dadosEscolares/DadosEscolaresListRelationFilter.ts b/apps/maestri-edu-admin/src/api/dadosEscolares/DadosEscolaresListRelationFilter.ts
new file mode 100644
index 0000000..536c1eb
--- /dev/null
+++ b/apps/maestri-edu-admin/src/api/dadosEscolares/DadosEscolaresListRelationFilter.ts
@@ -0,0 +1,7 @@
+import { DadosEscolaresWhereInput } from "./DadosEscolaresWhereInput";
+
+export type DadosEscolaresListRelationFilter = {
+ every?: DadosEscolaresWhereInput;
+ some?: DadosEscolaresWhereInput;
+ none?: DadosEscolaresWhereInput;
+};
diff --git a/apps/maestri-edu-admin/src/api/dadosEscolares/DadosEscolaresOrderByInput.ts b/apps/maestri-edu-admin/src/api/dadosEscolares/DadosEscolaresOrderByInput.ts
new file mode 100644
index 0000000..3c0a4bb
--- /dev/null
+++ b/apps/maestri-edu-admin/src/api/dadosEscolares/DadosEscolaresOrderByInput.ts
@@ -0,0 +1,8 @@
+import { SortOrder } from "../../util/SortOrder";
+
+export type DadosEscolaresOrderByInput = {
+ createdAt?: SortOrder;
+ id?: SortOrder;
+ perfilReferencia?: SortOrder;
+ updatedAt?: SortOrder;
+};
diff --git a/apps/maestri-edu-admin/src/api/dadosEscolares/DadosEscolaresUpdateInput.ts b/apps/maestri-edu-admin/src/api/dadosEscolares/DadosEscolaresUpdateInput.ts
new file mode 100644
index 0000000..8dfd8bd
--- /dev/null
+++ b/apps/maestri-edu-admin/src/api/dadosEscolares/DadosEscolaresUpdateInput.ts
@@ -0,0 +1,3 @@
+export type DadosEscolaresUpdateInput = {
+ perfilReferencia?: string | null;
+};
diff --git a/apps/maestri-edu-admin/src/api/dadosEscolares/DadosEscolaresWhereInput.ts b/apps/maestri-edu-admin/src/api/dadosEscolares/DadosEscolaresWhereInput.ts
new file mode 100644
index 0000000..7bae6f8
--- /dev/null
+++ b/apps/maestri-edu-admin/src/api/dadosEscolares/DadosEscolaresWhereInput.ts
@@ -0,0 +1,7 @@
+import { StringFilter } from "../../util/StringFilter";
+import { StringNullableFilter } from "../../util/StringNullableFilter";
+
+export type DadosEscolaresWhereInput = {
+ id?: StringFilter;
+ perfilReferencia?: StringNullableFilter;
+};
diff --git a/apps/maestri-edu-admin/src/api/dadosEscolares/DadosEscolaresWhereUniqueInput.ts b/apps/maestri-edu-admin/src/api/dadosEscolares/DadosEscolaresWhereUniqueInput.ts
new file mode 100644
index 0000000..feebb58
--- /dev/null
+++ b/apps/maestri-edu-admin/src/api/dadosEscolares/DadosEscolaresWhereUniqueInput.ts
@@ -0,0 +1,3 @@
+export type DadosEscolaresWhereUniqueInput = {
+ id: string;
+};
diff --git a/apps/maestri-edu-admin/src/api/dadosEscolares/DeleteDadosEscolaresArgs.ts b/apps/maestri-edu-admin/src/api/dadosEscolares/DeleteDadosEscolaresArgs.ts
new file mode 100644
index 0000000..8498903
--- /dev/null
+++ b/apps/maestri-edu-admin/src/api/dadosEscolares/DeleteDadosEscolaresArgs.ts
@@ -0,0 +1,5 @@
+import { DadosEscolaresWhereUniqueInput } from "./DadosEscolaresWhereUniqueInput";
+
+export type DeleteDadosEscolaresArgs = {
+ where: DadosEscolaresWhereUniqueInput;
+};
diff --git a/apps/maestri-edu-admin/src/api/dadosEscolares/UpdateDadosEscolaresArgs.ts b/apps/maestri-edu-admin/src/api/dadosEscolares/UpdateDadosEscolaresArgs.ts
new file mode 100644
index 0000000..002fae3
--- /dev/null
+++ b/apps/maestri-edu-admin/src/api/dadosEscolares/UpdateDadosEscolaresArgs.ts
@@ -0,0 +1,7 @@
+import { DadosEscolaresWhereUniqueInput } from "./DadosEscolaresWhereUniqueInput";
+import { DadosEscolaresUpdateInput } from "./DadosEscolaresUpdateInput";
+
+export type UpdateDadosEscolaresArgs = {
+ where: DadosEscolaresWhereUniqueInput;
+ data: DadosEscolaresUpdateInput;
+};
diff --git a/apps/maestri-edu-admin/src/api/documento/CreateDocumentoArgs.ts b/apps/maestri-edu-admin/src/api/documento/CreateDocumentoArgs.ts
new file mode 100644
index 0000000..650686d
--- /dev/null
+++ b/apps/maestri-edu-admin/src/api/documento/CreateDocumentoArgs.ts
@@ -0,0 +1,5 @@
+import { DocumentoCreateInput } from "./DocumentoCreateInput";
+
+export type CreateDocumentoArgs = {
+ data: DocumentoCreateInput;
+};
diff --git a/apps/maestri-edu-admin/src/api/documento/DeleteDocumentoArgs.ts b/apps/maestri-edu-admin/src/api/documento/DeleteDocumentoArgs.ts
new file mode 100644
index 0000000..1ef977e
--- /dev/null
+++ b/apps/maestri-edu-admin/src/api/documento/DeleteDocumentoArgs.ts
@@ -0,0 +1,5 @@
+import { DocumentoWhereUniqueInput } from "./DocumentoWhereUniqueInput";
+
+export type DeleteDocumentoArgs = {
+ where: DocumentoWhereUniqueInput;
+};
diff --git a/apps/maestri-edu-admin/src/api/documento/Documento.ts b/apps/maestri-edu-admin/src/api/documento/Documento.ts
new file mode 100644
index 0000000..2afc7af
--- /dev/null
+++ b/apps/maestri-edu-admin/src/api/documento/Documento.ts
@@ -0,0 +1,6 @@
+export type Documento = {
+ createdAt: Date;
+ id: string;
+ perfilReferencia: string | null;
+ updatedAt: Date;
+};
diff --git a/apps/maestri-edu-admin/src/api/documento/DocumentoCountArgs.ts b/apps/maestri-edu-admin/src/api/documento/DocumentoCountArgs.ts
new file mode 100644
index 0000000..aed7ff0
--- /dev/null
+++ b/apps/maestri-edu-admin/src/api/documento/DocumentoCountArgs.ts
@@ -0,0 +1,5 @@
+import { DocumentoWhereInput } from "./DocumentoWhereInput";
+
+export type DocumentoCountArgs = {
+ where?: DocumentoWhereInput;
+};
diff --git a/apps/maestri-edu-admin/src/api/documento/DocumentoCreateInput.ts b/apps/maestri-edu-admin/src/api/documento/DocumentoCreateInput.ts
new file mode 100644
index 0000000..5c47278
--- /dev/null
+++ b/apps/maestri-edu-admin/src/api/documento/DocumentoCreateInput.ts
@@ -0,0 +1,3 @@
+export type DocumentoCreateInput = {
+ perfilReferencia?: string | null;
+};
diff --git a/apps/maestri-edu-admin/src/api/documento/DocumentoFindManyArgs.ts b/apps/maestri-edu-admin/src/api/documento/DocumentoFindManyArgs.ts
new file mode 100644
index 0000000..d4f905e
--- /dev/null
+++ b/apps/maestri-edu-admin/src/api/documento/DocumentoFindManyArgs.ts
@@ -0,0 +1,9 @@
+import { DocumentoWhereInput } from "./DocumentoWhereInput";
+import { DocumentoOrderByInput } from "./DocumentoOrderByInput";
+
+export type DocumentoFindManyArgs = {
+ where?: DocumentoWhereInput;
+ orderBy?: Array;
+ skip?: number;
+ take?: number;
+};
diff --git a/apps/maestri-edu-admin/src/api/documento/DocumentoFindUniqueArgs.ts b/apps/maestri-edu-admin/src/api/documento/DocumentoFindUniqueArgs.ts
new file mode 100644
index 0000000..f6bd1a4
--- /dev/null
+++ b/apps/maestri-edu-admin/src/api/documento/DocumentoFindUniqueArgs.ts
@@ -0,0 +1,5 @@
+import { DocumentoWhereUniqueInput } from "./DocumentoWhereUniqueInput";
+
+export type DocumentoFindUniqueArgs = {
+ where: DocumentoWhereUniqueInput;
+};
diff --git a/apps/maestri-edu-admin/src/api/documento/DocumentoListRelationFilter.ts b/apps/maestri-edu-admin/src/api/documento/DocumentoListRelationFilter.ts
new file mode 100644
index 0000000..c0e6431
--- /dev/null
+++ b/apps/maestri-edu-admin/src/api/documento/DocumentoListRelationFilter.ts
@@ -0,0 +1,7 @@
+import { DocumentoWhereInput } from "./DocumentoWhereInput";
+
+export type DocumentoListRelationFilter = {
+ every?: DocumentoWhereInput;
+ some?: DocumentoWhereInput;
+ none?: DocumentoWhereInput;
+};
diff --git a/apps/maestri-edu-admin/src/api/documento/DocumentoOrderByInput.ts b/apps/maestri-edu-admin/src/api/documento/DocumentoOrderByInput.ts
new file mode 100644
index 0000000..bc7e5e8
--- /dev/null
+++ b/apps/maestri-edu-admin/src/api/documento/DocumentoOrderByInput.ts
@@ -0,0 +1,8 @@
+import { SortOrder } from "../../util/SortOrder";
+
+export type DocumentoOrderByInput = {
+ createdAt?: SortOrder;
+ id?: SortOrder;
+ perfilReferencia?: SortOrder;
+ updatedAt?: SortOrder;
+};
diff --git a/apps/maestri-edu-admin/src/api/documento/DocumentoUpdateInput.ts b/apps/maestri-edu-admin/src/api/documento/DocumentoUpdateInput.ts
new file mode 100644
index 0000000..fa54df9
--- /dev/null
+++ b/apps/maestri-edu-admin/src/api/documento/DocumentoUpdateInput.ts
@@ -0,0 +1,3 @@
+export type DocumentoUpdateInput = {
+ perfilReferencia?: string | null;
+};
diff --git a/apps/maestri-edu-admin/src/api/documento/DocumentoWhereInput.ts b/apps/maestri-edu-admin/src/api/documento/DocumentoWhereInput.ts
new file mode 100644
index 0000000..35bf7b1
--- /dev/null
+++ b/apps/maestri-edu-admin/src/api/documento/DocumentoWhereInput.ts
@@ -0,0 +1,7 @@
+import { StringFilter } from "../../util/StringFilter";
+import { StringNullableFilter } from "../../util/StringNullableFilter";
+
+export type DocumentoWhereInput = {
+ id?: StringFilter;
+ perfilReferencia?: StringNullableFilter;
+};
diff --git a/apps/maestri-edu-admin/src/api/documento/DocumentoWhereUniqueInput.ts b/apps/maestri-edu-admin/src/api/documento/DocumentoWhereUniqueInput.ts
new file mode 100644
index 0000000..63109b8
--- /dev/null
+++ b/apps/maestri-edu-admin/src/api/documento/DocumentoWhereUniqueInput.ts
@@ -0,0 +1,3 @@
+export type DocumentoWhereUniqueInput = {
+ id: string;
+};
diff --git a/apps/maestri-edu-admin/src/api/documento/UpdateDocumentoArgs.ts b/apps/maestri-edu-admin/src/api/documento/UpdateDocumentoArgs.ts
new file mode 100644
index 0000000..844e301
--- /dev/null
+++ b/apps/maestri-edu-admin/src/api/documento/UpdateDocumentoArgs.ts
@@ -0,0 +1,7 @@
+import { DocumentoWhereUniqueInput } from "./DocumentoWhereUniqueInput";
+import { DocumentoUpdateInput } from "./DocumentoUpdateInput";
+
+export type UpdateDocumentoArgs = {
+ where: DocumentoWhereUniqueInput;
+ data: DocumentoUpdateInput;
+};
diff --git a/apps/maestri-edu-admin/src/api/endereco/CreateEnderecoArgs.ts b/apps/maestri-edu-admin/src/api/endereco/CreateEnderecoArgs.ts
new file mode 100644
index 0000000..fa44abf
--- /dev/null
+++ b/apps/maestri-edu-admin/src/api/endereco/CreateEnderecoArgs.ts
@@ -0,0 +1,5 @@
+import { EnderecoCreateInput } from "./EnderecoCreateInput";
+
+export type CreateEnderecoArgs = {
+ data: EnderecoCreateInput;
+};
diff --git a/apps/maestri-edu-admin/src/api/endereco/DeleteEnderecoArgs.ts b/apps/maestri-edu-admin/src/api/endereco/DeleteEnderecoArgs.ts
new file mode 100644
index 0000000..0776ee3
--- /dev/null
+++ b/apps/maestri-edu-admin/src/api/endereco/DeleteEnderecoArgs.ts
@@ -0,0 +1,5 @@
+import { EnderecoWhereUniqueInput } from "./EnderecoWhereUniqueInput";
+
+export type DeleteEnderecoArgs = {
+ where: EnderecoWhereUniqueInput;
+};
diff --git a/apps/maestri-edu-admin/src/api/endereco/Endereco.ts b/apps/maestri-edu-admin/src/api/endereco/Endereco.ts
new file mode 100644
index 0000000..002fa2a
--- /dev/null
+++ b/apps/maestri-edu-admin/src/api/endereco/Endereco.ts
@@ -0,0 +1,6 @@
+export type Endereco = {
+ createdAt: Date;
+ id: string;
+ perfilReferencia: string | null;
+ updatedAt: Date;
+};
diff --git a/apps/maestri-edu-admin/src/api/endereco/EnderecoCountArgs.ts b/apps/maestri-edu-admin/src/api/endereco/EnderecoCountArgs.ts
new file mode 100644
index 0000000..433b7ec
--- /dev/null
+++ b/apps/maestri-edu-admin/src/api/endereco/EnderecoCountArgs.ts
@@ -0,0 +1,5 @@
+import { EnderecoWhereInput } from "./EnderecoWhereInput";
+
+export type EnderecoCountArgs = {
+ where?: EnderecoWhereInput;
+};
diff --git a/apps/maestri-edu-admin/src/api/endereco/EnderecoCreateInput.ts b/apps/maestri-edu-admin/src/api/endereco/EnderecoCreateInput.ts
new file mode 100644
index 0000000..f00f233
--- /dev/null
+++ b/apps/maestri-edu-admin/src/api/endereco/EnderecoCreateInput.ts
@@ -0,0 +1,3 @@
+export type EnderecoCreateInput = {
+ perfilReferencia?: string | null;
+};
diff --git a/apps/maestri-edu-admin/src/api/endereco/EnderecoFindManyArgs.ts b/apps/maestri-edu-admin/src/api/endereco/EnderecoFindManyArgs.ts
new file mode 100644
index 0000000..123434d
--- /dev/null
+++ b/apps/maestri-edu-admin/src/api/endereco/EnderecoFindManyArgs.ts
@@ -0,0 +1,9 @@
+import { EnderecoWhereInput } from "./EnderecoWhereInput";
+import { EnderecoOrderByInput } from "./EnderecoOrderByInput";
+
+export type EnderecoFindManyArgs = {
+ where?: EnderecoWhereInput;
+ orderBy?: Array;
+ skip?: number;
+ take?: number;
+};
diff --git a/apps/maestri-edu-admin/src/api/endereco/EnderecoFindUniqueArgs.ts b/apps/maestri-edu-admin/src/api/endereco/EnderecoFindUniqueArgs.ts
new file mode 100644
index 0000000..2c5d70d
--- /dev/null
+++ b/apps/maestri-edu-admin/src/api/endereco/EnderecoFindUniqueArgs.ts
@@ -0,0 +1,5 @@
+import { EnderecoWhereUniqueInput } from "./EnderecoWhereUniqueInput";
+
+export type EnderecoFindUniqueArgs = {
+ where: EnderecoWhereUniqueInput;
+};
diff --git a/apps/maestri-edu-admin/src/api/endereco/EnderecoListRelationFilter.ts b/apps/maestri-edu-admin/src/api/endereco/EnderecoListRelationFilter.ts
new file mode 100644
index 0000000..d34129d
--- /dev/null
+++ b/apps/maestri-edu-admin/src/api/endereco/EnderecoListRelationFilter.ts
@@ -0,0 +1,7 @@
+import { EnderecoWhereInput } from "./EnderecoWhereInput";
+
+export type EnderecoListRelationFilter = {
+ every?: EnderecoWhereInput;
+ some?: EnderecoWhereInput;
+ none?: EnderecoWhereInput;
+};
diff --git a/apps/maestri-edu-admin/src/api/endereco/EnderecoOrderByInput.ts b/apps/maestri-edu-admin/src/api/endereco/EnderecoOrderByInput.ts
new file mode 100644
index 0000000..211248c
--- /dev/null
+++ b/apps/maestri-edu-admin/src/api/endereco/EnderecoOrderByInput.ts
@@ -0,0 +1,8 @@
+import { SortOrder } from "../../util/SortOrder";
+
+export type EnderecoOrderByInput = {
+ createdAt?: SortOrder;
+ id?: SortOrder;
+ perfilReferencia?: SortOrder;
+ updatedAt?: SortOrder;
+};
diff --git a/apps/maestri-edu-admin/src/api/endereco/EnderecoUpdateInput.ts b/apps/maestri-edu-admin/src/api/endereco/EnderecoUpdateInput.ts
new file mode 100644
index 0000000..4e946b1
--- /dev/null
+++ b/apps/maestri-edu-admin/src/api/endereco/EnderecoUpdateInput.ts
@@ -0,0 +1,3 @@
+export type EnderecoUpdateInput = {
+ perfilReferencia?: string | null;
+};
diff --git a/apps/maestri-edu-admin/src/api/endereco/EnderecoWhereInput.ts b/apps/maestri-edu-admin/src/api/endereco/EnderecoWhereInput.ts
new file mode 100644
index 0000000..cbf7eb9
--- /dev/null
+++ b/apps/maestri-edu-admin/src/api/endereco/EnderecoWhereInput.ts
@@ -0,0 +1,7 @@
+import { StringFilter } from "../../util/StringFilter";
+import { StringNullableFilter } from "../../util/StringNullableFilter";
+
+export type EnderecoWhereInput = {
+ id?: StringFilter;
+ perfilReferencia?: StringNullableFilter;
+};
diff --git a/apps/maestri-edu-admin/src/api/endereco/EnderecoWhereUniqueInput.ts b/apps/maestri-edu-admin/src/api/endereco/EnderecoWhereUniqueInput.ts
new file mode 100644
index 0000000..b80fae3
--- /dev/null
+++ b/apps/maestri-edu-admin/src/api/endereco/EnderecoWhereUniqueInput.ts
@@ -0,0 +1,3 @@
+export type EnderecoWhereUniqueInput = {
+ id: string;
+};
diff --git a/apps/maestri-edu-admin/src/api/endereco/UpdateEnderecoArgs.ts b/apps/maestri-edu-admin/src/api/endereco/UpdateEnderecoArgs.ts
new file mode 100644
index 0000000..41284a4
--- /dev/null
+++ b/apps/maestri-edu-admin/src/api/endereco/UpdateEnderecoArgs.ts
@@ -0,0 +1,7 @@
+import { EnderecoWhereUniqueInput } from "./EnderecoWhereUniqueInput";
+import { EnderecoUpdateInput } from "./EnderecoUpdateInput";
+
+export type UpdateEnderecoArgs = {
+ where: EnderecoWhereUniqueInput;
+ data: EnderecoUpdateInput;
+};
diff --git a/apps/maestri-edu-admin/src/api/matricula/CreateMatriculaArgs.ts b/apps/maestri-edu-admin/src/api/matricula/CreateMatriculaArgs.ts
new file mode 100644
index 0000000..e37d3f2
--- /dev/null
+++ b/apps/maestri-edu-admin/src/api/matricula/CreateMatriculaArgs.ts
@@ -0,0 +1,5 @@
+import { MatriculaCreateInput } from "./MatriculaCreateInput";
+
+export type CreateMatriculaArgs = {
+ data: MatriculaCreateInput;
+};
diff --git a/apps/maestri-edu-admin/src/api/matricula/DeleteMatriculaArgs.ts b/apps/maestri-edu-admin/src/api/matricula/DeleteMatriculaArgs.ts
new file mode 100644
index 0000000..a7d946a
--- /dev/null
+++ b/apps/maestri-edu-admin/src/api/matricula/DeleteMatriculaArgs.ts
@@ -0,0 +1,5 @@
+import { MatriculaWhereUniqueInput } from "./MatriculaWhereUniqueInput";
+
+export type DeleteMatriculaArgs = {
+ where: MatriculaWhereUniqueInput;
+};
diff --git a/apps/maestri-edu-admin/src/api/matricula/EnumMatriculaStatus.ts b/apps/maestri-edu-admin/src/api/matricula/EnumMatriculaStatus.ts
new file mode 100644
index 0000000..a53edcb
--- /dev/null
+++ b/apps/maestri-edu-admin/src/api/matricula/EnumMatriculaStatus.ts
@@ -0,0 +1,3 @@
+export enum EnumMatriculaStatus {
+ Option_1 = "Option1",
+}
diff --git a/apps/maestri-edu-admin/src/api/matricula/EnumMatriculaStatusMatricula.ts b/apps/maestri-edu-admin/src/api/matricula/EnumMatriculaStatusMatricula.ts
new file mode 100644
index 0000000..56324c6
--- /dev/null
+++ b/apps/maestri-edu-admin/src/api/matricula/EnumMatriculaStatusMatricula.ts
@@ -0,0 +1,3 @@
+export enum EnumMatriculaStatusMatricula {
+ Option_1 = "Option1",
+}
diff --git a/apps/maestri-edu-admin/src/api/matricula/Matricula.ts b/apps/maestri-edu-admin/src/api/matricula/Matricula.ts
new file mode 100644
index 0000000..5a4c0b3
--- /dev/null
+++ b/apps/maestri-edu-admin/src/api/matricula/Matricula.ts
@@ -0,0 +1,25 @@
+import { Curso } from "../curso/Curso";
+
+export type Matricula = {
+ aluno: string | null;
+ alunoId: string | null;
+ alunoReferencia: string | null;
+ classificacaoReferencia: string | null;
+ createdAt: Date;
+ curso?: Curso | null;
+ cursoReferencia: string | null;
+ id: string;
+ numeroParcelas: number | null;
+ parcelaAdimplente: string | null;
+ parcelaAdimplenteId: string | null;
+ parcelaAdimplenteReferencia: string | null;
+ promotor: string | null;
+ promotorId: string | null;
+ promotorReferencia: string | null;
+ status?: "Option1" | null;
+ statusMatricula?: "Option1" | null;
+ taxaMatricula: string | null;
+ taxaMatriculaId: string | null;
+ taxaMatriculaReferencia: string | null;
+ updatedAt: Date;
+};
diff --git a/apps/maestri-edu-admin/src/api/matricula/MatriculaCountArgs.ts b/apps/maestri-edu-admin/src/api/matricula/MatriculaCountArgs.ts
new file mode 100644
index 0000000..918a098
--- /dev/null
+++ b/apps/maestri-edu-admin/src/api/matricula/MatriculaCountArgs.ts
@@ -0,0 +1,5 @@
+import { MatriculaWhereInput } from "./MatriculaWhereInput";
+
+export type MatriculaCountArgs = {
+ where?: MatriculaWhereInput;
+};
diff --git a/apps/maestri-edu-admin/src/api/matricula/MatriculaCreateInput.ts b/apps/maestri-edu-admin/src/api/matricula/MatriculaCreateInput.ts
new file mode 100644
index 0000000..76febc8
--- /dev/null
+++ b/apps/maestri-edu-admin/src/api/matricula/MatriculaCreateInput.ts
@@ -0,0 +1,22 @@
+import { CursoWhereUniqueInput } from "../curso/CursoWhereUniqueInput";
+
+export type MatriculaCreateInput = {
+ aluno?: string | null;
+ alunoId?: string | null;
+ alunoReferencia?: string | null;
+ classificacaoReferencia?: string | null;
+ curso?: CursoWhereUniqueInput | null;
+ cursoReferencia?: string | null;
+ numeroParcelas?: number | null;
+ parcelaAdimplente?: string | null;
+ parcelaAdimplenteId?: string | null;
+ parcelaAdimplenteReferencia?: string | null;
+ promotor?: string | null;
+ promotorId?: string | null;
+ promotorReferencia?: string | null;
+ status?: "Option1" | null;
+ statusMatricula?: "Option1" | null;
+ taxaMatricula?: string | null;
+ taxaMatriculaId?: string | null;
+ taxaMatriculaReferencia?: string | null;
+};
diff --git a/apps/maestri-edu-admin/src/api/matricula/MatriculaFindManyArgs.ts b/apps/maestri-edu-admin/src/api/matricula/MatriculaFindManyArgs.ts
new file mode 100644
index 0000000..2b824d2
--- /dev/null
+++ b/apps/maestri-edu-admin/src/api/matricula/MatriculaFindManyArgs.ts
@@ -0,0 +1,9 @@
+import { MatriculaWhereInput } from "./MatriculaWhereInput";
+import { MatriculaOrderByInput } from "./MatriculaOrderByInput";
+
+export type MatriculaFindManyArgs = {
+ where?: MatriculaWhereInput;
+ orderBy?: Array;
+ skip?: number;
+ take?: number;
+};
diff --git a/apps/maestri-edu-admin/src/api/matricula/MatriculaFindUniqueArgs.ts b/apps/maestri-edu-admin/src/api/matricula/MatriculaFindUniqueArgs.ts
new file mode 100644
index 0000000..f0a5ff0
--- /dev/null
+++ b/apps/maestri-edu-admin/src/api/matricula/MatriculaFindUniqueArgs.ts
@@ -0,0 +1,5 @@
+import { MatriculaWhereUniqueInput } from "./MatriculaWhereUniqueInput";
+
+export type MatriculaFindUniqueArgs = {
+ where: MatriculaWhereUniqueInput;
+};
diff --git a/apps/maestri-edu-admin/src/api/matricula/MatriculaListRelationFilter.ts b/apps/maestri-edu-admin/src/api/matricula/MatriculaListRelationFilter.ts
new file mode 100644
index 0000000..0923735
--- /dev/null
+++ b/apps/maestri-edu-admin/src/api/matricula/MatriculaListRelationFilter.ts
@@ -0,0 +1,7 @@
+import { MatriculaWhereInput } from "./MatriculaWhereInput";
+
+export type MatriculaListRelationFilter = {
+ every?: MatriculaWhereInput;
+ some?: MatriculaWhereInput;
+ none?: MatriculaWhereInput;
+};
diff --git a/apps/maestri-edu-admin/src/api/matricula/MatriculaOrderByInput.ts b/apps/maestri-edu-admin/src/api/matricula/MatriculaOrderByInput.ts
new file mode 100644
index 0000000..279986c
--- /dev/null
+++ b/apps/maestri-edu-admin/src/api/matricula/MatriculaOrderByInput.ts
@@ -0,0 +1,25 @@
+import { SortOrder } from "../../util/SortOrder";
+
+export type MatriculaOrderByInput = {
+ aluno?: SortOrder;
+ alunoId?: SortOrder;
+ alunoReferencia?: SortOrder;
+ classificacaoReferencia?: SortOrder;
+ createdAt?: SortOrder;
+ cursoId?: SortOrder;
+ cursoReferencia?: SortOrder;
+ id?: SortOrder;
+ numeroParcelas?: SortOrder;
+ parcelaAdimplente?: SortOrder;
+ parcelaAdimplenteId?: SortOrder;
+ parcelaAdimplenteReferencia?: SortOrder;
+ promotor?: SortOrder;
+ promotorId?: SortOrder;
+ promotorReferencia?: SortOrder;
+ status?: SortOrder;
+ statusMatricula?: SortOrder;
+ taxaMatricula?: SortOrder;
+ taxaMatriculaId?: SortOrder;
+ taxaMatriculaReferencia?: SortOrder;
+ updatedAt?: SortOrder;
+};
diff --git a/apps/maestri-edu-admin/src/api/matricula/MatriculaUpdateInput.ts b/apps/maestri-edu-admin/src/api/matricula/MatriculaUpdateInput.ts
new file mode 100644
index 0000000..8eb3cca
--- /dev/null
+++ b/apps/maestri-edu-admin/src/api/matricula/MatriculaUpdateInput.ts
@@ -0,0 +1,22 @@
+import { CursoWhereUniqueInput } from "../curso/CursoWhereUniqueInput";
+
+export type MatriculaUpdateInput = {
+ aluno?: string | null;
+ alunoId?: string | null;
+ alunoReferencia?: string | null;
+ classificacaoReferencia?: string | null;
+ curso?: CursoWhereUniqueInput | null;
+ cursoReferencia?: string | null;
+ numeroParcelas?: number | null;
+ parcelaAdimplente?: string | null;
+ parcelaAdimplenteId?: string | null;
+ parcelaAdimplenteReferencia?: string | null;
+ promotor?: string | null;
+ promotorId?: string | null;
+ promotorReferencia?: string | null;
+ status?: "Option1" | null;
+ statusMatricula?: "Option1" | null;
+ taxaMatricula?: string | null;
+ taxaMatriculaId?: string | null;
+ taxaMatriculaReferencia?: string | null;
+};
diff --git a/apps/maestri-edu-admin/src/api/matricula/MatriculaWhereInput.ts b/apps/maestri-edu-admin/src/api/matricula/MatriculaWhereInput.ts
new file mode 100644
index 0000000..e22b772
--- /dev/null
+++ b/apps/maestri-edu-admin/src/api/matricula/MatriculaWhereInput.ts
@@ -0,0 +1,26 @@
+import { StringNullableFilter } from "../../util/StringNullableFilter";
+import { CursoWhereUniqueInput } from "../curso/CursoWhereUniqueInput";
+import { StringFilter } from "../../util/StringFilter";
+import { IntNullableFilter } from "../../util/IntNullableFilter";
+
+export type MatriculaWhereInput = {
+ aluno?: StringNullableFilter;
+ alunoId?: StringNullableFilter;
+ alunoReferencia?: StringNullableFilter;
+ classificacaoReferencia?: StringNullableFilter;
+ curso?: CursoWhereUniqueInput;
+ cursoReferencia?: StringNullableFilter;
+ id?: StringFilter;
+ numeroParcelas?: IntNullableFilter;
+ parcelaAdimplente?: StringNullableFilter;
+ parcelaAdimplenteId?: StringNullableFilter;
+ parcelaAdimplenteReferencia?: StringNullableFilter;
+ promotor?: StringNullableFilter;
+ promotorId?: StringNullableFilter;
+ promotorReferencia?: StringNullableFilter;
+ status?: "Option1";
+ statusMatricula?: "Option1";
+ taxaMatricula?: StringNullableFilter;
+ taxaMatriculaId?: StringNullableFilter;
+ taxaMatriculaReferencia?: StringNullableFilter;
+};
diff --git a/apps/maestri-edu-admin/src/api/matricula/MatriculaWhereUniqueInput.ts b/apps/maestri-edu-admin/src/api/matricula/MatriculaWhereUniqueInput.ts
new file mode 100644
index 0000000..f657f2b
--- /dev/null
+++ b/apps/maestri-edu-admin/src/api/matricula/MatriculaWhereUniqueInput.ts
@@ -0,0 +1,3 @@
+export type MatriculaWhereUniqueInput = {
+ id: string;
+};
diff --git a/apps/maestri-edu-admin/src/api/matricula/UpdateMatriculaArgs.ts b/apps/maestri-edu-admin/src/api/matricula/UpdateMatriculaArgs.ts
new file mode 100644
index 0000000..af2849e
--- /dev/null
+++ b/apps/maestri-edu-admin/src/api/matricula/UpdateMatriculaArgs.ts
@@ -0,0 +1,7 @@
+import { MatriculaWhereUniqueInput } from "./MatriculaWhereUniqueInput";
+import { MatriculaUpdateInput } from "./MatriculaUpdateInput";
+
+export type UpdateMatriculaArgs = {
+ where: MatriculaWhereUniqueInput;
+ data: MatriculaUpdateInput;
+};
diff --git a/apps/maestri-edu-admin/src/api/parcela/DeleteParcelaArgs.ts b/apps/maestri-edu-admin/src/api/parcela/DeleteParcelaArgs.ts
new file mode 100644
index 0000000..f901ba3
--- /dev/null
+++ b/apps/maestri-edu-admin/src/api/parcela/DeleteParcelaArgs.ts
@@ -0,0 +1,5 @@
+import { ParcelaWhereUniqueInput } from "./ParcelaWhereUniqueInput";
+
+export type DeleteParcelaArgs = {
+ where: ParcelaWhereUniqueInput;
+};
diff --git a/apps/maestri-edu-admin/src/api/parcela/Parcela.ts b/apps/maestri-edu-admin/src/api/parcela/Parcela.ts
new file mode 100644
index 0000000..aa9cd3b
--- /dev/null
+++ b/apps/maestri-edu-admin/src/api/parcela/Parcela.ts
@@ -0,0 +1,5 @@
+export type Parcela = {
+ createdAt: Date;
+ id: string;
+ updatedAt: Date;
+};
diff --git a/apps/maestri-edu-admin/src/api/parcela/ParcelaCountArgs.ts b/apps/maestri-edu-admin/src/api/parcela/ParcelaCountArgs.ts
new file mode 100644
index 0000000..993232b
--- /dev/null
+++ b/apps/maestri-edu-admin/src/api/parcela/ParcelaCountArgs.ts
@@ -0,0 +1,5 @@
+import { ParcelaWhereInput } from "./ParcelaWhereInput";
+
+export type ParcelaCountArgs = {
+ where?: ParcelaWhereInput;
+};
diff --git a/apps/maestri-edu-admin/src/api/parcela/ParcelaCreateInput.ts b/apps/maestri-edu-admin/src/api/parcela/ParcelaCreateInput.ts
new file mode 100644
index 0000000..c3ee004
--- /dev/null
+++ b/apps/maestri-edu-admin/src/api/parcela/ParcelaCreateInput.ts
@@ -0,0 +1 @@
+export type ParcelaCreateInput = {};
diff --git a/apps/maestri-edu-admin/src/api/parcela/ParcelaFindManyArgs.ts b/apps/maestri-edu-admin/src/api/parcela/ParcelaFindManyArgs.ts
new file mode 100644
index 0000000..b7862c6
--- /dev/null
+++ b/apps/maestri-edu-admin/src/api/parcela/ParcelaFindManyArgs.ts
@@ -0,0 +1,9 @@
+import { ParcelaWhereInput } from "./ParcelaWhereInput";
+import { ParcelaOrderByInput } from "./ParcelaOrderByInput";
+
+export type ParcelaFindManyArgs = {
+ where?: ParcelaWhereInput;
+ orderBy?: Array;
+ skip?: number;
+ take?: number;
+};
diff --git a/apps/maestri-edu-admin/src/api/parcela/ParcelaFindUniqueArgs.ts b/apps/maestri-edu-admin/src/api/parcela/ParcelaFindUniqueArgs.ts
new file mode 100644
index 0000000..8c503a8
--- /dev/null
+++ b/apps/maestri-edu-admin/src/api/parcela/ParcelaFindUniqueArgs.ts
@@ -0,0 +1,5 @@
+import { ParcelaWhereUniqueInput } from "./ParcelaWhereUniqueInput";
+
+export type ParcelaFindUniqueArgs = {
+ where: ParcelaWhereUniqueInput;
+};
diff --git a/apps/maestri-edu-admin/src/api/parcela/ParcelaListRelationFilter.ts b/apps/maestri-edu-admin/src/api/parcela/ParcelaListRelationFilter.ts
new file mode 100644
index 0000000..06bc65e
--- /dev/null
+++ b/apps/maestri-edu-admin/src/api/parcela/ParcelaListRelationFilter.ts
@@ -0,0 +1,7 @@
+import { ParcelaWhereInput } from "./ParcelaWhereInput";
+
+export type ParcelaListRelationFilter = {
+ every?: ParcelaWhereInput;
+ some?: ParcelaWhereInput;
+ none?: ParcelaWhereInput;
+};
diff --git a/apps/maestri-edu-admin/src/api/parcela/ParcelaOrderByInput.ts b/apps/maestri-edu-admin/src/api/parcela/ParcelaOrderByInput.ts
new file mode 100644
index 0000000..d63e0f8
--- /dev/null
+++ b/apps/maestri-edu-admin/src/api/parcela/ParcelaOrderByInput.ts
@@ -0,0 +1,7 @@
+import { SortOrder } from "../../util/SortOrder";
+
+export type ParcelaOrderByInput = {
+ createdAt?: SortOrder;
+ id?: SortOrder;
+ updatedAt?: SortOrder;
+};
diff --git a/apps/maestri-edu-admin/src/api/parcela/ParcelaUpdateInput.ts b/apps/maestri-edu-admin/src/api/parcela/ParcelaUpdateInput.ts
new file mode 100644
index 0000000..978f36f
--- /dev/null
+++ b/apps/maestri-edu-admin/src/api/parcela/ParcelaUpdateInput.ts
@@ -0,0 +1 @@
+export type ParcelaUpdateInput = {};
diff --git a/apps/maestri-edu-admin/src/api/parcela/ParcelaWhereInput.ts b/apps/maestri-edu-admin/src/api/parcela/ParcelaWhereInput.ts
new file mode 100644
index 0000000..53e4699
--- /dev/null
+++ b/apps/maestri-edu-admin/src/api/parcela/ParcelaWhereInput.ts
@@ -0,0 +1,5 @@
+import { StringFilter } from "../../util/StringFilter";
+
+export type ParcelaWhereInput = {
+ id?: StringFilter;
+};
diff --git a/apps/maestri-edu-admin/src/api/parcela/ParcelaWhereUniqueInput.ts b/apps/maestri-edu-admin/src/api/parcela/ParcelaWhereUniqueInput.ts
new file mode 100644
index 0000000..994c5b9
--- /dev/null
+++ b/apps/maestri-edu-admin/src/api/parcela/ParcelaWhereUniqueInput.ts
@@ -0,0 +1,3 @@
+export type ParcelaWhereUniqueInput = {
+ id: string;
+};
diff --git a/apps/maestri-edu-admin/src/api/perfil/CreatePerfilArgs.ts b/apps/maestri-edu-admin/src/api/perfil/CreatePerfilArgs.ts
new file mode 100644
index 0000000..b45ad4f
--- /dev/null
+++ b/apps/maestri-edu-admin/src/api/perfil/CreatePerfilArgs.ts
@@ -0,0 +1,5 @@
+import { PerfilCreateInput } from "./PerfilCreateInput";
+
+export type CreatePerfilArgs = {
+ data: PerfilCreateInput;
+};
diff --git a/apps/maestri-edu-admin/src/api/perfil/DeletePerfilArgs.ts b/apps/maestri-edu-admin/src/api/perfil/DeletePerfilArgs.ts
new file mode 100644
index 0000000..55e5866
--- /dev/null
+++ b/apps/maestri-edu-admin/src/api/perfil/DeletePerfilArgs.ts
@@ -0,0 +1,5 @@
+import { PerfilWhereUniqueInput } from "./PerfilWhereUniqueInput";
+
+export type DeletePerfilArgs = {
+ where: PerfilWhereUniqueInput;
+};
diff --git a/apps/maestri-edu-admin/src/api/perfil/Perfil.ts b/apps/maestri-edu-admin/src/api/perfil/Perfil.ts
new file mode 100644
index 0000000..3c7e5af
--- /dev/null
+++ b/apps/maestri-edu-admin/src/api/perfil/Perfil.ts
@@ -0,0 +1,7 @@
+export type Perfil = {
+ cpf: string | null;
+ createdAt: Date;
+ id: string;
+ numeroCelular: string | null;
+ updatedAt: Date;
+};
diff --git a/apps/maestri-edu-admin/src/api/perfil/PerfilCountArgs.ts b/apps/maestri-edu-admin/src/api/perfil/PerfilCountArgs.ts
new file mode 100644
index 0000000..c052d25
--- /dev/null
+++ b/apps/maestri-edu-admin/src/api/perfil/PerfilCountArgs.ts
@@ -0,0 +1,5 @@
+import { PerfilWhereInput } from "./PerfilWhereInput";
+
+export type PerfilCountArgs = {
+ where?: PerfilWhereInput;
+};
diff --git a/apps/maestri-edu-admin/src/api/perfil/PerfilCreateInput.ts b/apps/maestri-edu-admin/src/api/perfil/PerfilCreateInput.ts
new file mode 100644
index 0000000..850bc9a
--- /dev/null
+++ b/apps/maestri-edu-admin/src/api/perfil/PerfilCreateInput.ts
@@ -0,0 +1,4 @@
+export type PerfilCreateInput = {
+ cpf?: string | null;
+ numeroCelular?: string | null;
+};
diff --git a/apps/maestri-edu-admin/src/api/perfil/PerfilFindManyArgs.ts b/apps/maestri-edu-admin/src/api/perfil/PerfilFindManyArgs.ts
new file mode 100644
index 0000000..82714f4
--- /dev/null
+++ b/apps/maestri-edu-admin/src/api/perfil/PerfilFindManyArgs.ts
@@ -0,0 +1,9 @@
+import { PerfilWhereInput } from "./PerfilWhereInput";
+import { PerfilOrderByInput } from "./PerfilOrderByInput";
+
+export type PerfilFindManyArgs = {
+ where?: PerfilWhereInput;
+ orderBy?: Array;
+ skip?: number;
+ take?: number;
+};
diff --git a/apps/maestri-edu-admin/src/api/perfil/PerfilFindUniqueArgs.ts b/apps/maestri-edu-admin/src/api/perfil/PerfilFindUniqueArgs.ts
new file mode 100644
index 0000000..d7e23f2
--- /dev/null
+++ b/apps/maestri-edu-admin/src/api/perfil/PerfilFindUniqueArgs.ts
@@ -0,0 +1,5 @@
+import { PerfilWhereUniqueInput } from "./PerfilWhereUniqueInput";
+
+export type PerfilFindUniqueArgs = {
+ where: PerfilWhereUniqueInput;
+};
diff --git a/apps/maestri-edu-admin/src/api/perfil/PerfilListRelationFilter.ts b/apps/maestri-edu-admin/src/api/perfil/PerfilListRelationFilter.ts
new file mode 100644
index 0000000..b1bb528
--- /dev/null
+++ b/apps/maestri-edu-admin/src/api/perfil/PerfilListRelationFilter.ts
@@ -0,0 +1,7 @@
+import { PerfilWhereInput } from "./PerfilWhereInput";
+
+export type PerfilListRelationFilter = {
+ every?: PerfilWhereInput;
+ some?: PerfilWhereInput;
+ none?: PerfilWhereInput;
+};
diff --git a/apps/maestri-edu-admin/src/api/perfil/PerfilOrderByInput.ts b/apps/maestri-edu-admin/src/api/perfil/PerfilOrderByInput.ts
new file mode 100644
index 0000000..6428eba
--- /dev/null
+++ b/apps/maestri-edu-admin/src/api/perfil/PerfilOrderByInput.ts
@@ -0,0 +1,9 @@
+import { SortOrder } from "../../util/SortOrder";
+
+export type PerfilOrderByInput = {
+ cpf?: SortOrder;
+ createdAt?: SortOrder;
+ id?: SortOrder;
+ numeroCelular?: SortOrder;
+ updatedAt?: SortOrder;
+};
diff --git a/apps/maestri-edu-admin/src/api/perfil/PerfilUpdateInput.ts b/apps/maestri-edu-admin/src/api/perfil/PerfilUpdateInput.ts
new file mode 100644
index 0000000..92ba0f7
--- /dev/null
+++ b/apps/maestri-edu-admin/src/api/perfil/PerfilUpdateInput.ts
@@ -0,0 +1,4 @@
+export type PerfilUpdateInput = {
+ cpf?: string | null;
+ numeroCelular?: string | null;
+};
diff --git a/apps/maestri-edu-admin/src/api/perfil/PerfilWhereInput.ts b/apps/maestri-edu-admin/src/api/perfil/PerfilWhereInput.ts
new file mode 100644
index 0000000..bdbabae
--- /dev/null
+++ b/apps/maestri-edu-admin/src/api/perfil/PerfilWhereInput.ts
@@ -0,0 +1,8 @@
+import { StringNullableFilter } from "../../util/StringNullableFilter";
+import { StringFilter } from "../../util/StringFilter";
+
+export type PerfilWhereInput = {
+ cpf?: StringNullableFilter;
+ id?: StringFilter;
+ numeroCelular?: StringNullableFilter;
+};
diff --git a/apps/maestri-edu-admin/src/api/perfil/PerfilWhereUniqueInput.ts b/apps/maestri-edu-admin/src/api/perfil/PerfilWhereUniqueInput.ts
new file mode 100644
index 0000000..784c52d
--- /dev/null
+++ b/apps/maestri-edu-admin/src/api/perfil/PerfilWhereUniqueInput.ts
@@ -0,0 +1,3 @@
+export type PerfilWhereUniqueInput = {
+ id: string;
+};
diff --git a/apps/maestri-edu-admin/src/api/perfil/UpdatePerfilArgs.ts b/apps/maestri-edu-admin/src/api/perfil/UpdatePerfilArgs.ts
new file mode 100644
index 0000000..fb6dd2d
--- /dev/null
+++ b/apps/maestri-edu-admin/src/api/perfil/UpdatePerfilArgs.ts
@@ -0,0 +1,7 @@
+import { PerfilWhereUniqueInput } from "./PerfilWhereUniqueInput";
+import { PerfilUpdateInput } from "./PerfilUpdateInput";
+
+export type UpdatePerfilArgs = {
+ where: PerfilWhereUniqueInput;
+ data: PerfilUpdateInput;
+};
diff --git a/apps/maestri-edu-admin/src/auth-provider/ra-auth-http.ts b/apps/maestri-edu-admin/src/auth-provider/ra-auth-http.ts
new file mode 100644
index 0000000..c6eeba8
--- /dev/null
+++ b/apps/maestri-edu-admin/src/auth-provider/ra-auth-http.ts
@@ -0,0 +1,78 @@
+import { gql } from "@apollo/client/core";
+import { AuthProvider } from "react-admin";
+import {
+ CREDENTIALS_LOCAL_STORAGE_ITEM,
+ USER_DATA_LOCAL_STORAGE_ITEM,
+} from "../constants";
+import { Credentials, LoginMutateResult } from "../types";
+import { apolloClient } from "../data-provider/graphqlDataProvider";
+
+const LOGIN = gql`
+ mutation login($username: String!, $password: String!) {
+ login(credentials: { username: $username, password: $password }) {
+ username
+ roles
+ }
+ }
+`;
+
+export const httpAuthProvider: AuthProvider = {
+ login: async (credentials: Credentials) => {
+ const userData = await apolloClient.mutate({
+ mutation: LOGIN,
+ variables: {
+ ...credentials,
+ },
+ });
+
+ if (userData && userData.data?.login.username) {
+ localStorage.setItem(
+ CREDENTIALS_LOCAL_STORAGE_ITEM,
+ createBasicAuthorizationHeader(
+ credentials.username,
+ credentials.password
+ )
+ );
+ localStorage.setItem(
+ USER_DATA_LOCAL_STORAGE_ITEM,
+ JSON.stringify(userData.data)
+ );
+ return Promise.resolve();
+ }
+ return Promise.reject();
+ },
+ logout: () => {
+ localStorage.removeItem(CREDENTIALS_LOCAL_STORAGE_ITEM);
+ return Promise.resolve();
+ },
+ checkError: ({ status }: any) => {
+ if (status === 401 || status === 403) {
+ localStorage.removeItem(CREDENTIALS_LOCAL_STORAGE_ITEM);
+ return Promise.reject();
+ }
+ return Promise.resolve();
+ },
+ checkAuth: () => {
+ return localStorage.getItem(CREDENTIALS_LOCAL_STORAGE_ITEM)
+ ? Promise.resolve()
+ : Promise.reject();
+ },
+ getPermissions: () => Promise.reject("Unknown method"),
+ getIdentity: () => {
+ const str = localStorage.getItem(USER_DATA_LOCAL_STORAGE_ITEM);
+ const userData: LoginMutateResult = JSON.parse(str || "");
+
+ return Promise.resolve({
+ id: userData.login.username,
+ fullName: userData.login.username,
+ avatar: undefined,
+ });
+ },
+};
+
+function createBasicAuthorizationHeader(
+ username: string,
+ password: string
+): string {
+ return `Basic ${btoa(`${username}:${password}`)}`;
+}
diff --git a/apps/maestri-edu-admin/src/auth-provider/ra-auth-jwt.ts b/apps/maestri-edu-admin/src/auth-provider/ra-auth-jwt.ts
new file mode 100644
index 0000000..c8bcafc
--- /dev/null
+++ b/apps/maestri-edu-admin/src/auth-provider/ra-auth-jwt.ts
@@ -0,0 +1,72 @@
+import { gql } from "@apollo/client/core";
+import { AuthProvider } from "react-admin";
+import {
+ CREDENTIALS_LOCAL_STORAGE_ITEM,
+ USER_DATA_LOCAL_STORAGE_ITEM,
+} from "../constants";
+import { Credentials, LoginMutateResult } from "../types";
+import { apolloClient } from "../data-provider/graphqlDataProvider";
+
+const LOGIN = gql`
+ mutation login($username: String!, $password: String!) {
+ login(credentials: { username: $username, password: $password }) {
+ username
+ accessToken
+ }
+ }
+`;
+
+export const jwtAuthProvider: AuthProvider = {
+ login: async (credentials: Credentials) => {
+ const userData = await apolloClient.mutate({
+ mutation: LOGIN,
+ variables: {
+ ...credentials,
+ },
+ });
+
+ if (userData && userData.data?.login.username) {
+ localStorage.setItem(
+ CREDENTIALS_LOCAL_STORAGE_ITEM,
+ createBearerAuthorizationHeader(userData.data.login?.accessToken)
+ );
+ localStorage.setItem(
+ USER_DATA_LOCAL_STORAGE_ITEM,
+ JSON.stringify(userData.data)
+ );
+ return Promise.resolve();
+ }
+ return Promise.reject();
+ },
+ logout: () => {
+ localStorage.removeItem(CREDENTIALS_LOCAL_STORAGE_ITEM);
+ return Promise.resolve();
+ },
+ checkError: ({ status }: any) => {
+ if (status === 401 || status === 403) {
+ localStorage.removeItem(CREDENTIALS_LOCAL_STORAGE_ITEM);
+ return Promise.reject();
+ }
+ return Promise.resolve();
+ },
+ checkAuth: () => {
+ return localStorage.getItem(CREDENTIALS_LOCAL_STORAGE_ITEM)
+ ? Promise.resolve()
+ : Promise.reject();
+ },
+ getPermissions: () => Promise.reject("Unknown method"),
+ getIdentity: () => {
+ const str = localStorage.getItem(USER_DATA_LOCAL_STORAGE_ITEM);
+ const userData: LoginMutateResult = JSON.parse(str || "");
+
+ return Promise.resolve({
+ id: userData.login.username,
+ fullName: userData.login.username,
+ avatar: undefined,
+ });
+ },
+};
+
+export function createBearerAuthorizationHeader(accessToken: string) {
+ return `Bearer ${accessToken}`;
+}
diff --git a/apps/maestri-edu-admin/src/auth.ts b/apps/maestri-edu-admin/src/auth.ts
new file mode 100644
index 0000000..498b026
--- /dev/null
+++ b/apps/maestri-edu-admin/src/auth.ts
@@ -0,0 +1,34 @@
+import { EventEmitter } from "events";
+import { CREDENTIALS_LOCAL_STORAGE_ITEM } from "./constants";
+import { Credentials } from "./types";
+
+const eventEmitter = new EventEmitter();
+
+export function isAuthenticated(): boolean {
+ return Boolean(getCredentials());
+}
+
+export function listen(listener: (authenticated: boolean) => void): void {
+ eventEmitter.on("change", () => {
+ listener(isAuthenticated());
+ });
+}
+
+export function setCredentials(credentials: Credentials) {
+ localStorage.setItem(
+ CREDENTIALS_LOCAL_STORAGE_ITEM,
+ JSON.stringify(credentials)
+ );
+}
+
+export function getCredentials(): Credentials | null {
+ const raw = localStorage.getItem(CREDENTIALS_LOCAL_STORAGE_ITEM);
+ if (raw === null) {
+ return null;
+ }
+ return JSON.parse(raw);
+}
+
+export function removeCredentials(): void {
+ localStorage.removeItem(CREDENTIALS_LOCAL_STORAGE_ITEM);
+}
diff --git a/apps/maestri-edu-admin/src/banking/BankingCreate.tsx b/apps/maestri-edu-admin/src/banking/BankingCreate.tsx
new file mode 100644
index 0000000..d91bdce
--- /dev/null
+++ b/apps/maestri-edu-admin/src/banking/BankingCreate.tsx
@@ -0,0 +1,22 @@
+import * as React from "react";
+import {
+ Create,
+ SimpleForm,
+ CreateProps,
+ TextInput,
+ NumberInput,
+ BooleanInput,
+} from "react-admin";
+
+export const BankingCreate = (props: CreateProps): React.ReactElement => {
+ return (
+
+
+
+
+
+
+
+
+ );
+};
diff --git a/apps/maestri-edu-admin/src/banking/BankingEdit.tsx b/apps/maestri-edu-admin/src/banking/BankingEdit.tsx
new file mode 100644
index 0000000..21fdbee
--- /dev/null
+++ b/apps/maestri-edu-admin/src/banking/BankingEdit.tsx
@@ -0,0 +1,22 @@
+import * as React from "react";
+import {
+ Edit,
+ SimpleForm,
+ EditProps,
+ TextInput,
+ NumberInput,
+ BooleanInput,
+} from "react-admin";
+
+export const BankingEdit = (props: EditProps): React.ReactElement => {
+ return (
+
+
+
+
+
+
+
+
+ );
+};
diff --git a/apps/maestri-edu-admin/src/banking/BankingList.tsx b/apps/maestri-edu-admin/src/banking/BankingList.tsx
new file mode 100644
index 0000000..abaf2de
--- /dev/null
+++ b/apps/maestri-edu-admin/src/banking/BankingList.tsx
@@ -0,0 +1,32 @@
+import * as React from "react";
+import {
+ List,
+ Datagrid,
+ ListProps,
+ DateField,
+ TextField,
+ BooleanField,
+} from "react-admin";
+import Pagination from "../Components/Pagination";
+
+export const BankingList = (props: ListProps): React.ReactElement => {
+ return (
+
}
+ >
+
+
+
+
+
+
+
+
+
+
+ );
+};
diff --git a/apps/maestri-edu-admin/src/banking/BankingShow.tsx b/apps/maestri-edu-admin/src/banking/BankingShow.tsx
new file mode 100644
index 0000000..caf5aa1
--- /dev/null
+++ b/apps/maestri-edu-admin/src/banking/BankingShow.tsx
@@ -0,0 +1,25 @@
+import * as React from "react";
+import {
+ Show,
+ SimpleShowLayout,
+ ShowProps,
+ DateField,
+ TextField,
+ BooleanField,
+} from "react-admin";
+
+export const BankingShow = (props: ShowProps): React.ReactElement => {
+ return (
+
+
+
+
+
+
+
+
+
+
+
+ );
+};
diff --git a/apps/maestri-edu-admin/src/banking/BankingTitle.ts b/apps/maestri-edu-admin/src/banking/BankingTitle.ts
new file mode 100644
index 0000000..3c6d240
--- /dev/null
+++ b/apps/maestri-edu-admin/src/banking/BankingTitle.ts
@@ -0,0 +1,7 @@
+import { Banking as TBanking } from "../api/banking/Banking";
+
+export const BANKING_TITLE_FIELD = "descricaoi";
+
+export const BankingTitle = (record: TBanking): string => {
+ return record.descricaoi?.toString() || String(record.id);
+};
diff --git a/apps/maestri-edu-admin/src/classificacao/ClassificacaoCreate.tsx b/apps/maestri-edu-admin/src/classificacao/ClassificacaoCreate.tsx
new file mode 100644
index 0000000..da30d85
--- /dev/null
+++ b/apps/maestri-edu-admin/src/classificacao/ClassificacaoCreate.tsx
@@ -0,0 +1,12 @@
+import * as React from "react";
+import { Create, SimpleForm, CreateProps } from "react-admin";
+
+export const ClassificacaoCreate = (props: CreateProps): React.ReactElement => {
+ return (
+
+
+
+
+
+ );
+};
diff --git a/apps/maestri-edu-admin/src/classificacao/ClassificacaoEdit.tsx b/apps/maestri-edu-admin/src/classificacao/ClassificacaoEdit.tsx
new file mode 100644
index 0000000..44dfb28
--- /dev/null
+++ b/apps/maestri-edu-admin/src/classificacao/ClassificacaoEdit.tsx
@@ -0,0 +1,12 @@
+import * as React from "react";
+import { Edit, SimpleForm, EditProps } from "react-admin";
+
+export const ClassificacaoEdit = (props: EditProps): React.ReactElement => {
+ return (
+
+
+
+
+
+ );
+};
diff --git a/apps/maestri-edu-admin/src/classificacao/ClassificacaoList.tsx b/apps/maestri-edu-admin/src/classificacao/ClassificacaoList.tsx
new file mode 100644
index 0000000..a9397d0
--- /dev/null
+++ b/apps/maestri-edu-admin/src/classificacao/ClassificacaoList.tsx
@@ -0,0 +1,21 @@
+import * as React from "react";
+import { List, Datagrid, ListProps, DateField, TextField } from "react-admin";
+import Pagination from "../Components/Pagination";
+
+export const ClassificacaoList = (props: ListProps): React.ReactElement => {
+ return (
+
}
+ >
+
+
+
+
+
+
+ );
+};
diff --git a/apps/maestri-edu-admin/src/classificacao/ClassificacaoShow.tsx b/apps/maestri-edu-admin/src/classificacao/ClassificacaoShow.tsx
new file mode 100644
index 0000000..4c77c23
--- /dev/null
+++ b/apps/maestri-edu-admin/src/classificacao/ClassificacaoShow.tsx
@@ -0,0 +1,20 @@
+import * as React from "react";
+import {
+ Show,
+ SimpleShowLayout,
+ ShowProps,
+ DateField,
+ TextField,
+} from "react-admin";
+
+export const ClassificacaoShow = (props: ShowProps): React.ReactElement => {
+ return (
+
+
+
+
+
+
+
+ );
+};
diff --git a/apps/maestri-edu-admin/src/classificacao/ClassificacaoTitle.ts b/apps/maestri-edu-admin/src/classificacao/ClassificacaoTitle.ts
new file mode 100644
index 0000000..6c34efb
--- /dev/null
+++ b/apps/maestri-edu-admin/src/classificacao/ClassificacaoTitle.ts
@@ -0,0 +1,7 @@
+import { Classificacao as TClassificacao } from "../api/classificacao/Classificacao";
+
+export const CLASSIFICACAO_TITLE_FIELD = "id";
+
+export const ClassificacaoTitle = (record: TClassificacao): string => {
+ return record.id?.toString() || String(record.id);
+};
diff --git a/apps/maestri-edu-admin/src/cobranca/CobrancaCreate.tsx b/apps/maestri-edu-admin/src/cobranca/CobrancaCreate.tsx
new file mode 100644
index 0000000..32d4e03
--- /dev/null
+++ b/apps/maestri-edu-admin/src/cobranca/CobrancaCreate.tsx
@@ -0,0 +1,12 @@
+import * as React from "react";
+import { Create, SimpleForm, CreateProps } from "react-admin";
+
+export const CobrancaCreate = (props: CreateProps): React.ReactElement => {
+ return (
+
+
+
+
+
+ );
+};
diff --git a/apps/maestri-edu-admin/src/cobranca/CobrancaEdit.tsx b/apps/maestri-edu-admin/src/cobranca/CobrancaEdit.tsx
new file mode 100644
index 0000000..5feee36
--- /dev/null
+++ b/apps/maestri-edu-admin/src/cobranca/CobrancaEdit.tsx
@@ -0,0 +1,12 @@
+import * as React from "react";
+import { Edit, SimpleForm, EditProps } from "react-admin";
+
+export const CobrancaEdit = (props: EditProps): React.ReactElement => {
+ return (
+
+
+
+
+
+ );
+};
diff --git a/apps/maestri-edu-admin/src/cobranca/CobrancaList.tsx b/apps/maestri-edu-admin/src/cobranca/CobrancaList.tsx
new file mode 100644
index 0000000..d444ba7
--- /dev/null
+++ b/apps/maestri-edu-admin/src/cobranca/CobrancaList.tsx
@@ -0,0 +1,21 @@
+import * as React from "react";
+import { List, Datagrid, ListProps, DateField, TextField } from "react-admin";
+import Pagination from "../Components/Pagination";
+
+export const CobrancaList = (props: ListProps): React.ReactElement => {
+ return (
+
}
+ >
+
+
+
+
+
+
+ );
+};
diff --git a/apps/maestri-edu-admin/src/cobranca/CobrancaShow.tsx b/apps/maestri-edu-admin/src/cobranca/CobrancaShow.tsx
new file mode 100644
index 0000000..82d8811
--- /dev/null
+++ b/apps/maestri-edu-admin/src/cobranca/CobrancaShow.tsx
@@ -0,0 +1,20 @@
+import * as React from "react";
+import {
+ Show,
+ SimpleShowLayout,
+ ShowProps,
+ DateField,
+ TextField,
+} from "react-admin";
+
+export const CobrancaShow = (props: ShowProps): React.ReactElement => {
+ return (
+
+
+
+
+
+
+
+ );
+};
diff --git a/apps/maestri-edu-admin/src/cobranca/CobrancaTitle.ts b/apps/maestri-edu-admin/src/cobranca/CobrancaTitle.ts
new file mode 100644
index 0000000..80c2f91
--- /dev/null
+++ b/apps/maestri-edu-admin/src/cobranca/CobrancaTitle.ts
@@ -0,0 +1,7 @@
+import { Cobranca as TCobranca } from "../api/cobranca/Cobranca";
+
+export const COBRANCA_TITLE_FIELD = "id";
+
+export const CobrancaTitle = (record: TCobranca): string => {
+ return record.id?.toString() || String(record.id);
+};
diff --git a/apps/maestri-edu-admin/src/constants.ts b/apps/maestri-edu-admin/src/constants.ts
new file mode 100644
index 0000000..4b3ca4b
--- /dev/null
+++ b/apps/maestri-edu-admin/src/constants.ts
@@ -0,0 +1,2 @@
+export const CREDENTIALS_LOCAL_STORAGE_ITEM = "credentials";
+export const USER_DATA_LOCAL_STORAGE_ITEM = "userData";
diff --git a/apps/maestri-edu-admin/src/contrato/ContratoCreate.tsx b/apps/maestri-edu-admin/src/contrato/ContratoCreate.tsx
new file mode 100644
index 0000000..7a0fbc8
--- /dev/null
+++ b/apps/maestri-edu-admin/src/contrato/ContratoCreate.tsx
@@ -0,0 +1,12 @@
+import * as React from "react";
+import { Create, SimpleForm, CreateProps, TextInput } from "react-admin";
+
+export const ContratoCreate = (props: CreateProps): React.ReactElement => {
+ return (
+
+
+
+
+
+ );
+};
diff --git a/apps/maestri-edu-admin/src/contrato/ContratoEdit.tsx b/apps/maestri-edu-admin/src/contrato/ContratoEdit.tsx
new file mode 100644
index 0000000..3f99bab
--- /dev/null
+++ b/apps/maestri-edu-admin/src/contrato/ContratoEdit.tsx
@@ -0,0 +1,12 @@
+import * as React from "react";
+import { Edit, SimpleForm, EditProps, TextInput } from "react-admin";
+
+export const ContratoEdit = (props: EditProps): React.ReactElement => {
+ return (
+
+
+
+
+
+ );
+};
diff --git a/apps/maestri-edu-admin/src/contrato/ContratoList.tsx b/apps/maestri-edu-admin/src/contrato/ContratoList.tsx
new file mode 100644
index 0000000..c705045
--- /dev/null
+++ b/apps/maestri-edu-admin/src/contrato/ContratoList.tsx
@@ -0,0 +1,22 @@
+import * as React from "react";
+import { List, Datagrid, ListProps, DateField, TextField } from "react-admin";
+import Pagination from "../Components/Pagination";
+
+export const ContratoList = (props: ListProps): React.ReactElement => {
+ return (
+
}
+ >
+
+
+
+
+
+
+
+ );
+};
diff --git a/apps/maestri-edu-admin/src/contrato/ContratoShow.tsx b/apps/maestri-edu-admin/src/contrato/ContratoShow.tsx
new file mode 100644
index 0000000..ab705f7
--- /dev/null
+++ b/apps/maestri-edu-admin/src/contrato/ContratoShow.tsx
@@ -0,0 +1,21 @@
+import * as React from "react";
+import {
+ Show,
+ SimpleShowLayout,
+ ShowProps,
+ DateField,
+ TextField,
+} from "react-admin";
+
+export const ContratoShow = (props: ShowProps): React.ReactElement => {
+ return (
+
+
+
+
+
+
+
+
+ );
+};
diff --git a/apps/maestri-edu-admin/src/contrato/ContratoTitle.ts b/apps/maestri-edu-admin/src/contrato/ContratoTitle.ts
new file mode 100644
index 0000000..78f6db3
--- /dev/null
+++ b/apps/maestri-edu-admin/src/contrato/ContratoTitle.ts
@@ -0,0 +1,7 @@
+import { Contrato as TContrato } from "../api/contrato/Contrato";
+
+export const CONTRATO_TITLE_FIELD = "perfilReferencia";
+
+export const ContratoTitle = (record: TContrato): string => {
+ return record.perfilReferencia?.toString() || String(record.id);
+};
diff --git a/apps/maestri-edu-admin/src/curso/CursoCreate.tsx b/apps/maestri-edu-admin/src/curso/CursoCreate.tsx
new file mode 100644
index 0000000..2589f91
--- /dev/null
+++ b/apps/maestri-edu-admin/src/curso/CursoCreate.tsx
@@ -0,0 +1,26 @@
+import * as React from "react";
+import {
+ Create,
+ SimpleForm,
+ CreateProps,
+ ReferenceArrayInput,
+ SelectArrayInput,
+} from "react-admin";
+import { MatriculaTitle } from "../matricula/MatriculaTitle";
+
+export const CursoCreate = (props: CreateProps): React.ReactElement => {
+ return (
+
+
+ value && value.map((v: any) => ({ id: v }))}
+ format={(value: any) => value && value.map((v: any) => v.id)}
+ >
+
+
+
+
+ );
+};
diff --git a/apps/maestri-edu-admin/src/curso/CursoEdit.tsx b/apps/maestri-edu-admin/src/curso/CursoEdit.tsx
new file mode 100644
index 0000000..fbdb7c3
--- /dev/null
+++ b/apps/maestri-edu-admin/src/curso/CursoEdit.tsx
@@ -0,0 +1,26 @@
+import * as React from "react";
+import {
+ Edit,
+ SimpleForm,
+ EditProps,
+ ReferenceArrayInput,
+ SelectArrayInput,
+} from "react-admin";
+import { MatriculaTitle } from "../matricula/MatriculaTitle";
+
+export const CursoEdit = (props: EditProps): React.ReactElement => {
+ return (
+
+
+ value && value.map((v: any) => ({ id: v }))}
+ format={(value: any) => value && value.map((v: any) => v.id)}
+ >
+
+
+
+
+ );
+};
diff --git a/apps/maestri-edu-admin/src/curso/CursoList.tsx b/apps/maestri-edu-admin/src/curso/CursoList.tsx
new file mode 100644
index 0000000..05cdfbd
--- /dev/null
+++ b/apps/maestri-edu-admin/src/curso/CursoList.tsx
@@ -0,0 +1,21 @@
+import * as React from "react";
+import { List, Datagrid, ListProps, DateField, TextField } from "react-admin";
+import Pagination from "../Components/Pagination";
+
+export const CursoList = (props: ListProps): React.ReactElement => {
+ return (
+
}
+ >
+
+
+
+
+
+
+ );
+};
diff --git a/apps/maestri-edu-admin/src/curso/CursoShow.tsx b/apps/maestri-edu-admin/src/curso/CursoShow.tsx
new file mode 100644
index 0000000..6eef646
--- /dev/null
+++ b/apps/maestri-edu-admin/src/curso/CursoShow.tsx
@@ -0,0 +1,69 @@
+import * as React from "react";
+
+import {
+ Show,
+ SimpleShowLayout,
+ ShowProps,
+ DateField,
+ TextField,
+ ReferenceManyField,
+ Datagrid,
+ ReferenceField,
+} from "react-admin";
+
+import { CURSO_TITLE_FIELD } from "./CursoTitle";
+
+export const CursoShow = (props: ShowProps): React.ReactElement => {
+ return (
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ );
+};
diff --git a/apps/maestri-edu-admin/src/curso/CursoTitle.ts b/apps/maestri-edu-admin/src/curso/CursoTitle.ts
new file mode 100644
index 0000000..3ecea7a
--- /dev/null
+++ b/apps/maestri-edu-admin/src/curso/CursoTitle.ts
@@ -0,0 +1,7 @@
+import { Curso as TCurso } from "../api/curso/Curso";
+
+export const CURSO_TITLE_FIELD = "id";
+
+export const CursoTitle = (record: TCurso): string => {
+ return record.id?.toString() || String(record.id);
+};
diff --git a/apps/maestri-edu-admin/src/dadosEscolares/DadosEscolaresCreate.tsx b/apps/maestri-edu-admin/src/dadosEscolares/DadosEscolaresCreate.tsx
new file mode 100644
index 0000000..336ad57
--- /dev/null
+++ b/apps/maestri-edu-admin/src/dadosEscolares/DadosEscolaresCreate.tsx
@@ -0,0 +1,14 @@
+import * as React from "react";
+import { Create, SimpleForm, CreateProps, TextInput } from "react-admin";
+
+export const DadosEscolaresCreate = (
+ props: CreateProps
+): React.ReactElement => {
+ return (
+
+
+
+
+
+ );
+};
diff --git a/apps/maestri-edu-admin/src/dadosEscolares/DadosEscolaresEdit.tsx b/apps/maestri-edu-admin/src/dadosEscolares/DadosEscolaresEdit.tsx
new file mode 100644
index 0000000..24a6c5c
--- /dev/null
+++ b/apps/maestri-edu-admin/src/dadosEscolares/DadosEscolaresEdit.tsx
@@ -0,0 +1,12 @@
+import * as React from "react";
+import { Edit, SimpleForm, EditProps, TextInput } from "react-admin";
+
+export const DadosEscolaresEdit = (props: EditProps): React.ReactElement => {
+ return (
+
+
+
+
+
+ );
+};
diff --git a/apps/maestri-edu-admin/src/dadosEscolares/DadosEscolaresList.tsx b/apps/maestri-edu-admin/src/dadosEscolares/DadosEscolaresList.tsx
new file mode 100644
index 0000000..a9630fd
--- /dev/null
+++ b/apps/maestri-edu-admin/src/dadosEscolares/DadosEscolaresList.tsx
@@ -0,0 +1,22 @@
+import * as React from "react";
+import { List, Datagrid, ListProps, DateField, TextField } from "react-admin";
+import Pagination from "../Components/Pagination";
+
+export const DadosEscolaresList = (props: ListProps): React.ReactElement => {
+ return (
+
}
+ >
+
+
+
+
+
+
+
+ );
+};
diff --git a/apps/maestri-edu-admin/src/dadosEscolares/DadosEscolaresShow.tsx b/apps/maestri-edu-admin/src/dadosEscolares/DadosEscolaresShow.tsx
new file mode 100644
index 0000000..2497993
--- /dev/null
+++ b/apps/maestri-edu-admin/src/dadosEscolares/DadosEscolaresShow.tsx
@@ -0,0 +1,21 @@
+import * as React from "react";
+import {
+ Show,
+ SimpleShowLayout,
+ ShowProps,
+ DateField,
+ TextField,
+} from "react-admin";
+
+export const DadosEscolaresShow = (props: ShowProps): React.ReactElement => {
+ return (
+
+
+
+
+
+
+
+
+ );
+};
diff --git a/apps/maestri-edu-admin/src/dadosEscolares/DadosEscolaresTitle.ts b/apps/maestri-edu-admin/src/dadosEscolares/DadosEscolaresTitle.ts
new file mode 100644
index 0000000..e46c267
--- /dev/null
+++ b/apps/maestri-edu-admin/src/dadosEscolares/DadosEscolaresTitle.ts
@@ -0,0 +1,7 @@
+import { DadosEscolares as TDadosEscolares } from "../api/dadosEscolares/DadosEscolares";
+
+export const DADOSESCOLARES_TITLE_FIELD = "perfilReferencia";
+
+export const DadosEscolaresTitle = (record: TDadosEscolares): string => {
+ return record.perfilReferencia?.toString() || String(record.id);
+};
diff --git a/apps/maestri-edu-admin/src/data-provider/graphqlDataProvider.ts b/apps/maestri-edu-admin/src/data-provider/graphqlDataProvider.ts
new file mode 100644
index 0000000..3ec4466
--- /dev/null
+++ b/apps/maestri-edu-admin/src/data-provider/graphqlDataProvider.ts
@@ -0,0 +1,28 @@
+import buildGraphQLProvider from "ra-data-graphql-amplication";
+import { ApolloClient, InMemoryCache, createHttpLink } from "@apollo/client";
+import { setContext } from "@apollo/client/link/context";
+import { CREDENTIALS_LOCAL_STORAGE_ITEM } from "../constants";
+
+const httpLink = createHttpLink({
+ uri: `${process.env.REACT_APP_SERVER_URL}/graphql`,
+});
+
+// eslint-disable-next-line @typescript-eslint/naming-convention
+const authLink = setContext((_, { headers }) => {
+ const token = localStorage.getItem(CREDENTIALS_LOCAL_STORAGE_ITEM);
+ return {
+ headers: {
+ ...headers,
+ authorization: token ? token : "",
+ },
+ };
+});
+
+export const apolloClient = new ApolloClient({
+ cache: new InMemoryCache(),
+ link: authLink.concat(httpLink),
+});
+
+export default buildGraphQLProvider({
+ client: apolloClient,
+});
diff --git a/apps/maestri-edu-admin/src/documento/DocumentoCreate.tsx b/apps/maestri-edu-admin/src/documento/DocumentoCreate.tsx
new file mode 100644
index 0000000..69449d9
--- /dev/null
+++ b/apps/maestri-edu-admin/src/documento/DocumentoCreate.tsx
@@ -0,0 +1,12 @@
+import * as React from "react";
+import { Create, SimpleForm, CreateProps, TextInput } from "react-admin";
+
+export const DocumentoCreate = (props: CreateProps): React.ReactElement => {
+ return (
+
+
+
+
+
+ );
+};
diff --git a/apps/maestri-edu-admin/src/documento/DocumentoEdit.tsx b/apps/maestri-edu-admin/src/documento/DocumentoEdit.tsx
new file mode 100644
index 0000000..d871c8a
--- /dev/null
+++ b/apps/maestri-edu-admin/src/documento/DocumentoEdit.tsx
@@ -0,0 +1,12 @@
+import * as React from "react";
+import { Edit, SimpleForm, EditProps, TextInput } from "react-admin";
+
+export const DocumentoEdit = (props: EditProps): React.ReactElement => {
+ return (
+
+
+
+
+
+ );
+};
diff --git a/apps/maestri-edu-admin/src/documento/DocumentoList.tsx b/apps/maestri-edu-admin/src/documento/DocumentoList.tsx
new file mode 100644
index 0000000..dbd6cc3
--- /dev/null
+++ b/apps/maestri-edu-admin/src/documento/DocumentoList.tsx
@@ -0,0 +1,22 @@
+import * as React from "react";
+import { List, Datagrid, ListProps, DateField, TextField } from "react-admin";
+import Pagination from "../Components/Pagination";
+
+export const DocumentoList = (props: ListProps): React.ReactElement => {
+ return (
+
}
+ >
+
+
+
+
+
+
+
+ );
+};
diff --git a/apps/maestri-edu-admin/src/documento/DocumentoShow.tsx b/apps/maestri-edu-admin/src/documento/DocumentoShow.tsx
new file mode 100644
index 0000000..43e737a
--- /dev/null
+++ b/apps/maestri-edu-admin/src/documento/DocumentoShow.tsx
@@ -0,0 +1,21 @@
+import * as React from "react";
+import {
+ Show,
+ SimpleShowLayout,
+ ShowProps,
+ DateField,
+ TextField,
+} from "react-admin";
+
+export const DocumentoShow = (props: ShowProps): React.ReactElement => {
+ return (
+
+
+
+
+
+
+
+
+ );
+};
diff --git a/apps/maestri-edu-admin/src/documento/DocumentoTitle.ts b/apps/maestri-edu-admin/src/documento/DocumentoTitle.ts
new file mode 100644
index 0000000..e9c3c09
--- /dev/null
+++ b/apps/maestri-edu-admin/src/documento/DocumentoTitle.ts
@@ -0,0 +1,7 @@
+import { Documento as TDocumento } from "../api/documento/Documento";
+
+export const DOCUMENTO_TITLE_FIELD = "perfilReferencia";
+
+export const DocumentoTitle = (record: TDocumento): string => {
+ return record.perfilReferencia?.toString() || String(record.id);
+};
diff --git a/apps/maestri-edu-admin/src/endereco/EnderecoCreate.tsx b/apps/maestri-edu-admin/src/endereco/EnderecoCreate.tsx
new file mode 100644
index 0000000..91ac772
--- /dev/null
+++ b/apps/maestri-edu-admin/src/endereco/EnderecoCreate.tsx
@@ -0,0 +1,12 @@
+import * as React from "react";
+import { Create, SimpleForm, CreateProps, TextInput } from "react-admin";
+
+export const EnderecoCreate = (props: CreateProps): React.ReactElement => {
+ return (
+
+
+
+
+
+ );
+};
diff --git a/apps/maestri-edu-admin/src/endereco/EnderecoEdit.tsx b/apps/maestri-edu-admin/src/endereco/EnderecoEdit.tsx
new file mode 100644
index 0000000..1d9c636
--- /dev/null
+++ b/apps/maestri-edu-admin/src/endereco/EnderecoEdit.tsx
@@ -0,0 +1,12 @@
+import * as React from "react";
+import { Edit, SimpleForm, EditProps, TextInput } from "react-admin";
+
+export const EnderecoEdit = (props: EditProps): React.ReactElement => {
+ return (
+
+
+
+
+
+ );
+};
diff --git a/apps/maestri-edu-admin/src/endereco/EnderecoList.tsx b/apps/maestri-edu-admin/src/endereco/EnderecoList.tsx
new file mode 100644
index 0000000..2c0f7ff
--- /dev/null
+++ b/apps/maestri-edu-admin/src/endereco/EnderecoList.tsx
@@ -0,0 +1,22 @@
+import * as React from "react";
+import { List, Datagrid, ListProps, DateField, TextField } from "react-admin";
+import Pagination from "../Components/Pagination";
+
+export const EnderecoList = (props: ListProps): React.ReactElement => {
+ return (
+
}
+ >
+
+
+
+
+
+
+
+ );
+};
diff --git a/apps/maestri-edu-admin/src/endereco/EnderecoShow.tsx b/apps/maestri-edu-admin/src/endereco/EnderecoShow.tsx
new file mode 100644
index 0000000..3a35207
--- /dev/null
+++ b/apps/maestri-edu-admin/src/endereco/EnderecoShow.tsx
@@ -0,0 +1,21 @@
+import * as React from "react";
+import {
+ Show,
+ SimpleShowLayout,
+ ShowProps,
+ DateField,
+ TextField,
+} from "react-admin";
+
+export const EnderecoShow = (props: ShowProps): React.ReactElement => {
+ return (
+
+
+
+
+
+
+
+
+ );
+};
diff --git a/apps/maestri-edu-admin/src/endereco/EnderecoTitle.ts b/apps/maestri-edu-admin/src/endereco/EnderecoTitle.ts
new file mode 100644
index 0000000..dbbd8ee
--- /dev/null
+++ b/apps/maestri-edu-admin/src/endereco/EnderecoTitle.ts
@@ -0,0 +1,7 @@
+import { Endereco as TEndereco } from "../api/endereco/Endereco";
+
+export const ENDERECO_TITLE_FIELD = "perfilReferencia";
+
+export const EnderecoTitle = (record: TEndereco): string => {
+ return record.perfilReferencia?.toString() || String(record.id);
+};
diff --git a/apps/maestri-edu-admin/src/index.css b/apps/maestri-edu-admin/src/index.css
new file mode 100644
index 0000000..8686848
--- /dev/null
+++ b/apps/maestri-edu-admin/src/index.css
@@ -0,0 +1,26 @@
+body {
+ margin: 0;
+ font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen",
+ "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue",
+ sans-serif;
+ -webkit-font-smoothing: antialiased;
+ -moz-osx-font-smoothing: grayscale;
+}
+
+#root {
+ height: 100vh;
+}
+
+code {
+ font-family: source-code-pro, Menlo, Monaco, Consolas, "Courier New",
+ monospace;
+}
+
+.amp-breadcrumbs {
+ padding: var(--default-spacing);
+}
+
+.entity-id {
+ color: var(--primary);
+ text-decoration: underline;
+}
diff --git a/apps/maestri-edu-admin/src/index.tsx b/apps/maestri-edu-admin/src/index.tsx
new file mode 100644
index 0000000..2da129c
--- /dev/null
+++ b/apps/maestri-edu-admin/src/index.tsx
@@ -0,0 +1,18 @@
+import React from "react";
+import ReactDOM from "react-dom";
+import "./index.css";
+
+import App from "./App";
+import reportWebVitals from "./reportWebVitals";
+
+ReactDOM.render(
+
+
+ ,
+ document.getElementById("root")
+);
+
+// If you want to start measuring performance in your app, pass a function
+// to log results (for example: reportWebVitals(console.log))
+// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals
+reportWebVitals();
diff --git a/apps/maestri-edu-admin/src/login.scss b/apps/maestri-edu-admin/src/login.scss
new file mode 100644
index 0000000..667d8d2
--- /dev/null
+++ b/apps/maestri-edu-admin/src/login.scss
@@ -0,0 +1,119 @@
+:root {
+ --surface: #15192c; /*dark: black100 */
+ --white: #15192c; /*dark: black100 */
+
+ --black100: #ffffff; /*dark: white */
+ --black90: #b7bac7; /*dark: black10 */
+ --black80: #a3a8b8; /*dark: black20 */
+ --black60: #80869d; /*dark: black30 */
+ --black40: #686f8c; /*dark: black40 */
+ --black30: #515873; /*dark: black50 */
+ --black20: #444b66; /*dark: black60 */
+ --black10: #373d57; /*dark: black70 */
+ --black5: #2c3249; /*dark: black80 */
+ --black2: #22273c; /*dark: black90 */
+
+ --primary: #7950ed;
+}
+
+.login-page {
+ height: 100vh;
+ width: 100%;
+ background-color: var(--surface);
+ color: var(--black100);
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ flex-direction: column;
+
+ &__wrapper {
+ display: flex;
+ align-items: stretch;
+ justify-content: center;
+ flex-direction: row;
+ }
+
+ &__box {
+ text-align: center;
+ width: 340px;
+ background-color: var(--black2);
+ border-radius: var(--small-border-radius);
+ margin: 1rem;
+ padding: 1rem;
+ border: 1px solid var(--black10);
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+ justify-content: stretch;
+
+ h2 {
+ font-size: 18px;
+ }
+ img {
+ width: 48px;
+ }
+
+ &__message {
+ color: var(--black80);
+ font-size: 14px;
+ line-height: 22px;
+ }
+
+ button,
+ .MuiButton-contained {
+ box-sizing: border-box;
+ background-color: var(--primary);
+ width: 300px;
+ margin-top: 0.5rem;
+ margin-bottom: 1rem;
+ margin-top: auto;
+ &:hover,
+ &:active,
+ &:focus {
+ background-color: var(--primary);
+ }
+ }
+ }
+
+ form {
+ display: flex;
+ flex-direction: column;
+ justify-content: space-between;
+ align-items: center;
+ margin-top: 2rem;
+
+ label {
+ span {
+ display: block;
+ text-align: left;
+ font-size: 12px;
+ color: var(--black60);
+ }
+ }
+
+ input {
+ box-sizing: border-box;
+ background-color: var(--white);
+ border: 1px solid var(--black10);
+ padding: 0.5rem;
+ margin-bottom: 1rem;
+ outline: none;
+ border-radius: var(--small-border-radius);
+ width: 300px;
+ color: var(--black100);
+ &:hover,
+ &:active,
+ &:focus {
+ border: 1px solid var(--black100);
+ }
+ }
+ }
+
+ &__read-more {
+ color: var(--black80);
+ a {
+ color: var(--black100);
+ text-decoration: none;
+ }
+ }
+}
diff --git a/apps/maestri-edu-admin/src/matricula/MatriculaCreate.tsx b/apps/maestri-edu-admin/src/matricula/MatriculaCreate.tsx
new file mode 100644
index 0000000..99305ec
--- /dev/null
+++ b/apps/maestri-edu-admin/src/matricula/MatriculaCreate.tsx
@@ -0,0 +1,65 @@
+import * as React from "react";
+
+import {
+ Create,
+ SimpleForm,
+ CreateProps,
+ TextInput,
+ ReferenceInput,
+ SelectInput,
+ NumberInput,
+} from "react-admin";
+
+import { CursoTitle } from "../curso/CursoTitle";
+
+export const MatriculaCreate = (props: CreateProps): React.ReactElement => {
+ return (
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ );
+};
diff --git a/apps/maestri-edu-admin/src/matricula/MatriculaEdit.tsx b/apps/maestri-edu-admin/src/matricula/MatriculaEdit.tsx
new file mode 100644
index 0000000..6c35457
--- /dev/null
+++ b/apps/maestri-edu-admin/src/matricula/MatriculaEdit.tsx
@@ -0,0 +1,65 @@
+import * as React from "react";
+
+import {
+ Edit,
+ SimpleForm,
+ EditProps,
+ TextInput,
+ ReferenceInput,
+ SelectInput,
+ NumberInput,
+} from "react-admin";
+
+import { CursoTitle } from "../curso/CursoTitle";
+
+export const MatriculaEdit = (props: EditProps): React.ReactElement => {
+ return (
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ );
+};
diff --git a/apps/maestri-edu-admin/src/matricula/MatriculaList.tsx b/apps/maestri-edu-admin/src/matricula/MatriculaList.tsx
new file mode 100644
index 0000000..1ee41eb
--- /dev/null
+++ b/apps/maestri-edu-admin/src/matricula/MatriculaList.tsx
@@ -0,0 +1,58 @@
+import * as React from "react";
+import {
+ List,
+ Datagrid,
+ ListProps,
+ TextField,
+ DateField,
+ ReferenceField,
+} from "react-admin";
+import Pagination from "../Components/Pagination";
+import { CURSO_TITLE_FIELD } from "../curso/CursoTitle";
+
+export const MatriculaList = (props: ListProps): React.ReactElement => {
+ return (
+
}
+ >
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ );
+};
diff --git a/apps/maestri-edu-admin/src/matricula/MatriculaShow.tsx b/apps/maestri-edu-admin/src/matricula/MatriculaShow.tsx
new file mode 100644
index 0000000..49010a8
--- /dev/null
+++ b/apps/maestri-edu-admin/src/matricula/MatriculaShow.tsx
@@ -0,0 +1,51 @@
+import * as React from "react";
+import {
+ Show,
+ SimpleShowLayout,
+ ShowProps,
+ TextField,
+ DateField,
+ ReferenceField,
+} from "react-admin";
+import { CURSO_TITLE_FIELD } from "../curso/CursoTitle";
+
+export const MatriculaShow = (props: ShowProps): React.ReactElement => {
+ return (
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ );
+};
diff --git a/apps/maestri-edu-admin/src/matricula/MatriculaTitle.ts b/apps/maestri-edu-admin/src/matricula/MatriculaTitle.ts
new file mode 100644
index 0000000..b01a8d2
--- /dev/null
+++ b/apps/maestri-edu-admin/src/matricula/MatriculaTitle.ts
@@ -0,0 +1,7 @@
+import { Matricula as TMatricula } from "../api/matricula/Matricula";
+
+export const MATRICULA_TITLE_FIELD = "aluno";
+
+export const MatriculaTitle = (record: TMatricula): string => {
+ return record.aluno?.toString() || String(record.id);
+};
diff --git a/apps/maestri-edu-admin/src/pages/Dashboard.tsx b/apps/maestri-edu-admin/src/pages/Dashboard.tsx
new file mode 100644
index 0000000..39c4d18
--- /dev/null
+++ b/apps/maestri-edu-admin/src/pages/Dashboard.tsx
@@ -0,0 +1,12 @@
+import * as React from "react";
+import Card from "@material-ui/core/Card";
+import CardContent from "@material-ui/core/CardContent";
+import { Title } from "react-admin";
+const Dashboard = () => (
+
+
+ Welcome
+
+);
+
+export default Dashboard;
diff --git a/apps/maestri-edu-admin/src/parcela/ParcelaCreate.tsx b/apps/maestri-edu-admin/src/parcela/ParcelaCreate.tsx
new file mode 100644
index 0000000..943f8a9
--- /dev/null
+++ b/apps/maestri-edu-admin/src/parcela/ParcelaCreate.tsx
@@ -0,0 +1,12 @@
+import * as React from "react";
+import { Create, SimpleForm, CreateProps } from "react-admin";
+
+export const ParcelaCreate = (props: CreateProps): React.ReactElement => {
+ return (
+
+
+
+
+
+ );
+};
diff --git a/apps/maestri-edu-admin/src/parcela/ParcelaEdit.tsx b/apps/maestri-edu-admin/src/parcela/ParcelaEdit.tsx
new file mode 100644
index 0000000..e216958
--- /dev/null
+++ b/apps/maestri-edu-admin/src/parcela/ParcelaEdit.tsx
@@ -0,0 +1,12 @@
+import * as React from "react";
+import { Edit, SimpleForm, EditProps } from "react-admin";
+
+export const ParcelaEdit = (props: EditProps): React.ReactElement => {
+ return (
+
+
+
+
+
+ );
+};
diff --git a/apps/maestri-edu-admin/src/parcela/ParcelaList.tsx b/apps/maestri-edu-admin/src/parcela/ParcelaList.tsx
new file mode 100644
index 0000000..29c4cff
--- /dev/null
+++ b/apps/maestri-edu-admin/src/parcela/ParcelaList.tsx
@@ -0,0 +1,21 @@
+import * as React from "react";
+import { List, Datagrid, ListProps, DateField, TextField } from "react-admin";
+import Pagination from "../Components/Pagination";
+
+export const ParcelaList = (props: ListProps): React.ReactElement => {
+ return (
+
}
+ >
+
+
+
+
+
+
+ );
+};
diff --git a/apps/maestri-edu-admin/src/parcela/ParcelaShow.tsx b/apps/maestri-edu-admin/src/parcela/ParcelaShow.tsx
new file mode 100644
index 0000000..48100a1
--- /dev/null
+++ b/apps/maestri-edu-admin/src/parcela/ParcelaShow.tsx
@@ -0,0 +1,20 @@
+import * as React from "react";
+import {
+ Show,
+ SimpleShowLayout,
+ ShowProps,
+ DateField,
+ TextField,
+} from "react-admin";
+
+export const ParcelaShow = (props: ShowProps): React.ReactElement => {
+ return (
+
+
+
+
+
+
+
+ );
+};
diff --git a/apps/maestri-edu-admin/src/parcela/ParcelaTitle.ts b/apps/maestri-edu-admin/src/parcela/ParcelaTitle.ts
new file mode 100644
index 0000000..9ba8be3
--- /dev/null
+++ b/apps/maestri-edu-admin/src/parcela/ParcelaTitle.ts
@@ -0,0 +1,7 @@
+import { Parcela as TParcela } from "../api/parcela/Parcela";
+
+export const PARCELA_TITLE_FIELD = "id";
+
+export const ParcelaTitle = (record: TParcela): string => {
+ return record.id?.toString() || String(record.id);
+};
diff --git a/apps/maestri-edu-admin/src/perfil/PerfilCreate.tsx b/apps/maestri-edu-admin/src/perfil/PerfilCreate.tsx
new file mode 100644
index 0000000..22831db
--- /dev/null
+++ b/apps/maestri-edu-admin/src/perfil/PerfilCreate.tsx
@@ -0,0 +1,13 @@
+import * as React from "react";
+import { Create, SimpleForm, CreateProps, TextInput } from "react-admin";
+
+export const PerfilCreate = (props: CreateProps): React.ReactElement => {
+ return (
+
+
+
+
+
+
+ );
+};
diff --git a/apps/maestri-edu-admin/src/perfil/PerfilEdit.tsx b/apps/maestri-edu-admin/src/perfil/PerfilEdit.tsx
new file mode 100644
index 0000000..e3c5073
--- /dev/null
+++ b/apps/maestri-edu-admin/src/perfil/PerfilEdit.tsx
@@ -0,0 +1,13 @@
+import * as React from "react";
+import { Edit, SimpleForm, EditProps, TextInput } from "react-admin";
+
+export const PerfilEdit = (props: EditProps): React.ReactElement => {
+ return (
+
+
+
+
+
+
+ );
+};
diff --git a/apps/maestri-edu-admin/src/perfil/PerfilList.tsx b/apps/maestri-edu-admin/src/perfil/PerfilList.tsx
new file mode 100644
index 0000000..3190118
--- /dev/null
+++ b/apps/maestri-edu-admin/src/perfil/PerfilList.tsx
@@ -0,0 +1,23 @@
+import * as React from "react";
+import { List, Datagrid, ListProps, TextField, DateField } from "react-admin";
+import Pagination from "../Components/Pagination";
+
+export const PerfilList = (props: ListProps): React.ReactElement => {
+ return (
+
}
+ >
+
+
+
+
+
+
+
+
+ );
+};
diff --git a/apps/maestri-edu-admin/src/perfil/PerfilShow.tsx b/apps/maestri-edu-admin/src/perfil/PerfilShow.tsx
new file mode 100644
index 0000000..ee7e05f
--- /dev/null
+++ b/apps/maestri-edu-admin/src/perfil/PerfilShow.tsx
@@ -0,0 +1,22 @@
+import * as React from "react";
+import {
+ Show,
+ SimpleShowLayout,
+ ShowProps,
+ TextField,
+ DateField,
+} from "react-admin";
+
+export const PerfilShow = (props: ShowProps): React.ReactElement => {
+ return (
+
+
+
+
+
+
+
+
+
+ );
+};
diff --git a/apps/maestri-edu-admin/src/perfil/PerfilTitle.ts b/apps/maestri-edu-admin/src/perfil/PerfilTitle.ts
new file mode 100644
index 0000000..6add30f
--- /dev/null
+++ b/apps/maestri-edu-admin/src/perfil/PerfilTitle.ts
@@ -0,0 +1,7 @@
+import { Perfil as TPerfil } from "../api/perfil/Perfil";
+
+export const PERFIL_TITLE_FIELD = "cpf";
+
+export const PerfilTitle = (record: TPerfil): string => {
+ return record.cpf?.toString() || String(record.id);
+};
diff --git a/apps/maestri-edu-admin/src/reportWebVitals.ts b/apps/maestri-edu-admin/src/reportWebVitals.ts
new file mode 100644
index 0000000..821a6cd
--- /dev/null
+++ b/apps/maestri-edu-admin/src/reportWebVitals.ts
@@ -0,0 +1,17 @@
+import { ReportHandler } from "web-vitals";
+
+const reportWebVitals = (onPerfEntry?: ReportHandler): void => {
+ if (onPerfEntry && onPerfEntry instanceof Function) {
+ void import("web-vitals").then(
+ ({ getCLS, getFID, getFCP, getLCP, getTTFB }) => {
+ getCLS(onPerfEntry);
+ getFID(onPerfEntry);
+ getFCP(onPerfEntry);
+ getLCP(onPerfEntry);
+ getTTFB(onPerfEntry);
+ }
+ );
+ }
+};
+
+export default reportWebVitals;
diff --git a/apps/maestri-edu-admin/src/setupTests.ts b/apps/maestri-edu-admin/src/setupTests.ts
new file mode 100644
index 0000000..1dd407a
--- /dev/null
+++ b/apps/maestri-edu-admin/src/setupTests.ts
@@ -0,0 +1,5 @@
+// jest-dom adds custom jest matchers for asserting on DOM nodes.
+// allows you to do things like:
+// expect(element).toHaveTextContent(/react/i)
+// learn more: https://github.com/testing-library/jest-dom
+import "@testing-library/jest-dom";
diff --git a/apps/maestri-edu-admin/src/theme/theme.ts b/apps/maestri-edu-admin/src/theme/theme.ts
new file mode 100644
index 0000000..56a1153
--- /dev/null
+++ b/apps/maestri-edu-admin/src/theme/theme.ts
@@ -0,0 +1,33 @@
+import { defaultTheme } from "react-admin";
+import { createTheme, ThemeOptions } from "@material-ui/core/styles";
+import { merge } from "lodash";
+import createPalette from "@material-ui/core/styles/createPalette";
+
+const palette = createPalette(
+ merge({}, defaultTheme.palette, {
+ primary: {
+ main: "#20a4f3",
+ },
+ secondary: {
+ main: "#7950ed",
+ },
+ error: {
+ main: "#e93c51",
+ },
+ warning: {
+ main: "#f6aa50",
+ },
+ info: {
+ main: "#144bc1",
+ },
+ success: {
+ main: "#31c587",
+ },
+ })
+);
+
+const themeOptions: ThemeOptions = {
+ palette,
+};
+
+export const theme = createTheme(merge({}, defaultTheme, themeOptions));
diff --git a/apps/maestri-edu-admin/src/types.ts b/apps/maestri-edu-admin/src/types.ts
new file mode 100644
index 0000000..45a457d
--- /dev/null
+++ b/apps/maestri-edu-admin/src/types.ts
@@ -0,0 +1,13 @@
+import { JsonValue } from "type-fest";
+
+export type Credentials = {
+ username: string;
+ password: string;
+};
+export type LoginMutateResult = {
+ login: {
+ username: string;
+ accessToken: string;
+ };
+};
+export type InputJsonValue = Omit;
diff --git a/apps/maestri-edu-admin/src/user/EnumRoles.ts b/apps/maestri-edu-admin/src/user/EnumRoles.ts
new file mode 100644
index 0000000..3df7048
--- /dev/null
+++ b/apps/maestri-edu-admin/src/user/EnumRoles.ts
@@ -0,0 +1,3 @@
+export enum EnumRoles {
+ User = "user",
+}
diff --git a/apps/maestri-edu-admin/src/user/RolesOptions.ts b/apps/maestri-edu-admin/src/user/RolesOptions.ts
new file mode 100644
index 0000000..5e30fe9
--- /dev/null
+++ b/apps/maestri-edu-admin/src/user/RolesOptions.ts
@@ -0,0 +1,11 @@
+import { ROLES } from "./roles";
+
+declare interface Role {
+ name: string;
+ displayName: string;
+}
+
+export const ROLES_OPTIONS = ROLES.map((role: Role) => ({
+ value: role.name,
+ label: role.displayName,
+}));
diff --git a/apps/maestri-edu-admin/src/user/roles.ts b/apps/maestri-edu-admin/src/user/roles.ts
new file mode 100644
index 0000000..732870a
--- /dev/null
+++ b/apps/maestri-edu-admin/src/user/roles.ts
@@ -0,0 +1,6 @@
+export const ROLES = [
+ {
+ name: "user",
+ displayName: "User",
+ },
+];
diff --git a/apps/maestri-edu-admin/src/util/BooleanFilter.ts b/apps/maestri-edu-admin/src/util/BooleanFilter.ts
new file mode 100644
index 0000000..a142d58
--- /dev/null
+++ b/apps/maestri-edu-admin/src/util/BooleanFilter.ts
@@ -0,0 +1,4 @@
+export class BooleanFilter {
+ equals?: boolean;
+ not?: boolean;
+}
diff --git a/apps/maestri-edu-admin/src/util/BooleanNullableFilter.ts b/apps/maestri-edu-admin/src/util/BooleanNullableFilter.ts
new file mode 100644
index 0000000..b94aefc
--- /dev/null
+++ b/apps/maestri-edu-admin/src/util/BooleanNullableFilter.ts
@@ -0,0 +1,4 @@
+export class BooleanNullableFilter {
+ equals?: boolean | null;
+ not?: boolean | null;
+}
diff --git a/apps/maestri-edu-admin/src/util/DateTimeFilter.ts b/apps/maestri-edu-admin/src/util/DateTimeFilter.ts
new file mode 100644
index 0000000..cd8d213
--- /dev/null
+++ b/apps/maestri-edu-admin/src/util/DateTimeFilter.ts
@@ -0,0 +1,10 @@
+export class DateTimeFilter {
+ equals?: Date;
+ not?: Date;
+ in?: Date[];
+ notIn?: Date[];
+ lt?: Date;
+ lte?: Date;
+ gt?: Date;
+ gte?: Date;
+}
diff --git a/apps/maestri-edu-admin/src/util/DateTimeNullableFilter.ts b/apps/maestri-edu-admin/src/util/DateTimeNullableFilter.ts
new file mode 100644
index 0000000..2f9c7b3
--- /dev/null
+++ b/apps/maestri-edu-admin/src/util/DateTimeNullableFilter.ts
@@ -0,0 +1,10 @@
+export class DateTimeNullableFilter {
+ equals?: Date | null;
+ in?: Date[] | null;
+ notIn?: Date[] | null;
+ lt?: Date;
+ lte?: Date;
+ gt?: Date;
+ gte?: Date;
+ not?: Date;
+}
diff --git a/apps/maestri-edu-admin/src/util/DecimalFilter.ts b/apps/maestri-edu-admin/src/util/DecimalFilter.ts
new file mode 100644
index 0000000..51dc504
--- /dev/null
+++ b/apps/maestri-edu-admin/src/util/DecimalFilter.ts
@@ -0,0 +1,10 @@
+export class DecimalFilter {
+ equals?: number;
+ in?: number[];
+ notIn?: number[];
+ lt?: number;
+ lte?: number;
+ gt?: number;
+ gte?: number;
+ not?: number;
+}
diff --git a/apps/maestri-edu-admin/src/util/DecimalNullableFilter.ts b/apps/maestri-edu-admin/src/util/DecimalNullableFilter.ts
new file mode 100644
index 0000000..243bcd8
--- /dev/null
+++ b/apps/maestri-edu-admin/src/util/DecimalNullableFilter.ts
@@ -0,0 +1,10 @@
+export class DecimalNullableFilter {
+ equals?: number | null;
+ in?: number[] | null;
+ notIn?: number[] | null;
+ lt?: number;
+ lte?: number;
+ gt?: number;
+ gte?: number;
+ not?: number;
+}
diff --git a/apps/maestri-edu-admin/src/util/FloatFilter.ts b/apps/maestri-edu-admin/src/util/FloatFilter.ts
new file mode 100644
index 0000000..62aeb14
--- /dev/null
+++ b/apps/maestri-edu-admin/src/util/FloatFilter.ts
@@ -0,0 +1,10 @@
+export class FloatFilter {
+ equals?: number;
+ in?: number[];
+ notIn?: number[];
+ lt?: number;
+ lte?: number;
+ gt?: number;
+ gte?: number;
+ not?: number;
+}
diff --git a/apps/maestri-edu-admin/src/util/FloatNullableFilter.ts b/apps/maestri-edu-admin/src/util/FloatNullableFilter.ts
new file mode 100644
index 0000000..d7bb163
--- /dev/null
+++ b/apps/maestri-edu-admin/src/util/FloatNullableFilter.ts
@@ -0,0 +1,10 @@
+export class FloatNullableFilter {
+ equals?: number | null;
+ in?: number[] | null;
+ notIn?: number[] | null;
+ lt?: number;
+ lte?: number;
+ gt?: number;
+ gte?: number;
+ not?: number;
+}
diff --git a/apps/maestri-edu-admin/src/util/IntFilter.ts b/apps/maestri-edu-admin/src/util/IntFilter.ts
new file mode 100644
index 0000000..3dc0221
--- /dev/null
+++ b/apps/maestri-edu-admin/src/util/IntFilter.ts
@@ -0,0 +1,10 @@
+export class IntFilter {
+ equals?: number;
+ in?: number[];
+ notIn?: number[];
+ lt?: number;
+ lte?: number;
+ gt?: number;
+ gte?: number;
+ not?: number;
+}
diff --git a/apps/maestri-edu-admin/src/util/IntNullableFilter.ts b/apps/maestri-edu-admin/src/util/IntNullableFilter.ts
new file mode 100644
index 0000000..2107cae
--- /dev/null
+++ b/apps/maestri-edu-admin/src/util/IntNullableFilter.ts
@@ -0,0 +1,10 @@
+export class IntNullableFilter {
+ equals?: number | null;
+ in?: number[] | null;
+ notIn?: number[] | null;
+ lt?: number;
+ lte?: number;
+ gt?: number;
+ gte?: number;
+ not?: number;
+}
diff --git a/apps/maestri-edu-admin/src/util/JsonFilter.ts b/apps/maestri-edu-admin/src/util/JsonFilter.ts
new file mode 100644
index 0000000..cc44763
--- /dev/null
+++ b/apps/maestri-edu-admin/src/util/JsonFilter.ts
@@ -0,0 +1,5 @@
+import { InputJsonValue } from "../types";
+export class JsonFilter {
+ equals?: InputJsonValue;
+ not?: InputJsonValue;
+}
diff --git a/apps/maestri-edu-admin/src/util/JsonNullableFilter.ts b/apps/maestri-edu-admin/src/util/JsonNullableFilter.ts
new file mode 100644
index 0000000..e6d1506
--- /dev/null
+++ b/apps/maestri-edu-admin/src/util/JsonNullableFilter.ts
@@ -0,0 +1,5 @@
+import { JsonValue } from "type-fest";
+export class JsonNullableFilter {
+ equals?: JsonValue | null;
+ not?: JsonValue | null;
+}
diff --git a/apps/maestri-edu-admin/src/util/MetaQueryPayload.ts b/apps/maestri-edu-admin/src/util/MetaQueryPayload.ts
new file mode 100644
index 0000000..bc3175b
--- /dev/null
+++ b/apps/maestri-edu-admin/src/util/MetaQueryPayload.ts
@@ -0,0 +1,3 @@
+export class MetaQueryPayload {
+ count!: number;
+}
diff --git a/apps/maestri-edu-admin/src/util/QueryMode.ts b/apps/maestri-edu-admin/src/util/QueryMode.ts
new file mode 100644
index 0000000..8a2164e
--- /dev/null
+++ b/apps/maestri-edu-admin/src/util/QueryMode.ts
@@ -0,0 +1,4 @@
+export enum QueryMode {
+ Default = "default",
+ Insensitive = "insensitive",
+}
diff --git a/apps/maestri-edu-admin/src/util/SortOrder.ts b/apps/maestri-edu-admin/src/util/SortOrder.ts
new file mode 100644
index 0000000..a5bcdb6
--- /dev/null
+++ b/apps/maestri-edu-admin/src/util/SortOrder.ts
@@ -0,0 +1,4 @@
+export enum SortOrder {
+ Asc = "asc",
+ Desc = "desc",
+}
diff --git a/apps/maestri-edu-admin/src/util/StringFilter.ts b/apps/maestri-edu-admin/src/util/StringFilter.ts
new file mode 100644
index 0000000..c2e26c5
--- /dev/null
+++ b/apps/maestri-edu-admin/src/util/StringFilter.ts
@@ -0,0 +1,16 @@
+import { QueryMode } from "./QueryMode";
+
+export class StringFilter {
+ equals?: string;
+ in?: string[];
+ notIn?: string[];
+ lt?: string;
+ lte?: string;
+ gt?: string;
+ gte?: string;
+ contains?: string;
+ startsWith?: string;
+ endsWith?: string;
+ mode?: QueryMode;
+ not?: string;
+}
diff --git a/apps/maestri-edu-admin/src/util/StringNullableFilter.ts b/apps/maestri-edu-admin/src/util/StringNullableFilter.ts
new file mode 100644
index 0000000..e1e37ec
--- /dev/null
+++ b/apps/maestri-edu-admin/src/util/StringNullableFilter.ts
@@ -0,0 +1,15 @@
+import { QueryMode } from "./QueryMode";
+export class StringNullableFilter {
+ equals?: string | null;
+ in?: string[] | null;
+ notIn?: string[] | null;
+ lt?: string;
+ lte?: string;
+ gt?: string;
+ gte?: string;
+ contains?: string;
+ startsWith?: string;
+ endsWith?: string;
+ mode?: QueryMode;
+ not?: string;
+}
diff --git a/apps/maestri-edu-admin/tsconfig.json b/apps/maestri-edu-admin/tsconfig.json
new file mode 100644
index 0000000..31cc780
--- /dev/null
+++ b/apps/maestri-edu-admin/tsconfig.json
@@ -0,0 +1,21 @@
+{
+ "compilerOptions": {
+ "target": "es5",
+ "lib": ["dom", "dom.iterable", "esnext"],
+ "allowJs": true,
+ "skipLibCheck": true,
+ "esModuleInterop": true,
+ "allowSyntheticDefaultImports": true,
+ "forceConsistentCasingInFileNames": true,
+ "noFallthroughCasesInSwitch": true,
+ "module": "esnext",
+ "moduleResolution": "node",
+ "resolveJsonModule": true,
+ "isolatedModules": true,
+ "noEmit": true,
+ "jsx": "react-jsx",
+ "strict": true
+ },
+ "include": ["src"],
+ "exclude": ["./node_modules"]
+}
diff --git a/apps/maestri-edu-server/.dockerignore b/apps/maestri-edu-server/.dockerignore
new file mode 100644
index 0000000..cb5c30b
--- /dev/null
+++ b/apps/maestri-edu-server/.dockerignore
@@ -0,0 +1,8 @@
+.dockerignore
+docker-compose.yml
+Dockerfile
+dist/
+node_modules
+.env
+.gitignore
+.prettierignore
\ No newline at end of file
diff --git a/apps/maestri-edu-server/.env b/apps/maestri-edu-server/.env
new file mode 100644
index 0000000..38d0abe
--- /dev/null
+++ b/apps/maestri-edu-server/.env
@@ -0,0 +1,8 @@
+BCRYPT_SALT=10
+COMPOSE_PROJECT_NAME=amp_cm0138a5z2uiz11a3hsevvv5m
+DB_NAME=my-db
+DB_PASSWORD=admin
+DB_PORT=5432
+DB_URL=postgres://admin:admin@localhost:5432/my-db
+DB_USER=admin
+PORT=3000
\ No newline at end of file
diff --git a/apps/maestri-edu-server/.gitignore b/apps/maestri-edu-server/.gitignore
new file mode 100644
index 0000000..08c9980
--- /dev/null
+++ b/apps/maestri-edu-server/.gitignore
@@ -0,0 +1,5 @@
+# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
+
+/node_modules
+/dist
+.DS_Store
diff --git a/apps/maestri-edu-server/.prettierignore b/apps/maestri-edu-server/.prettierignore
new file mode 100644
index 0000000..e48f355
--- /dev/null
+++ b/apps/maestri-edu-server/.prettierignore
@@ -0,0 +1,5 @@
+node_modules/
+dist/
+prisma/migrations/
+package-lock.json
+coverage/
\ No newline at end of file
diff --git a/apps/maestri-edu-server/Dockerfile b/apps/maestri-edu-server/Dockerfile
new file mode 100644
index 0000000..80dd8d3
--- /dev/null
+++ b/apps/maestri-edu-server/Dockerfile
@@ -0,0 +1,68 @@
+# multi-stage: base (build)
+FROM node:18.13.0 AS base
+
+# create directory where the application will be built
+WORKDIR /app
+
+# copy over the dependency manifests, both the package.json
+# and the package-lock.json are copied over
+COPY package*.json ./
+
+# installs packages and their dependencies
+RUN npm install
+
+# copy over the prisma schema
+COPY prisma/schema.prisma ./prisma/
+
+# generate the prisma client based on the schema
+RUN npm run prisma:generate
+
+# copy over the code base
+COPY . .
+
+# create the bundle of the application
+RUN npm run build
+
+# multi-stage: production (runtime)
+FROM node:18.13.0-slim AS production
+
+# create arguments of builds time variables
+ARG user=amplication
+ARG group=${user}
+ARG uid=1001
+ARG gid=$uid
+
+# [temporary] work around to be able to run prisma
+RUN apt-get update -y && apt-get install -y openssl
+
+# create directory where the application will be executed from
+WORKDIR /app
+
+# add the user and group
+RUN groupadd --gid ${gid} ${user}
+RUN useradd --uid ${uid} --gid ${gid} -m ${user}
+
+# copy over the bundled code from the build stage
+COPY --from=base /app/node_modules/ ./node_modules
+COPY --from=base /app/package.json ./package.json
+COPY --from=base /app/dist ./dist
+COPY --from=base /app/prisma ./prisma
+COPY --from=base /app/scripts ./scripts
+COPY --from=base /app/src ./src
+COPY --from=base /app/tsconfig* ./
+
+# change ownership of the workspace directory
+RUN chown -R ${uid}:${gid} /app/
+
+# get rid of the development dependencies
+RUN npm install --production
+
+# set user to the created non-privileged user
+USER ${user}
+
+# expose a specific port on the docker container
+ENV PORT=3000
+EXPOSE ${PORT}
+
+# start the server using the previously build application
+CMD [ "node", "./dist/main.js" ]
diff --git a/apps/maestri-edu-server/README.md b/apps/maestri-edu-server/README.md
new file mode 100644
index 0000000..bca0445
--- /dev/null
+++ b/apps/maestri-edu-server/README.md
@@ -0,0 +1,64 @@
+
+
+
+
+
+
+# Introduction
+
+This service was generated with Amplication. The server-side of the generated project. This component provides the different backend services - i.e., REST API, GraphQL API, authentication, authorization, logging, data validation and the connection to the database. Additional information about the server component and the architecture around it, can be found on the [documentation](https://docs.amplication.com/guides/getting-started) site.
+
+# Getting started
+
+## Step 1: Configuration
+
+Configuration for the server component can be provided through the use of environment variables. These can be passed to the application via the use of the `.env` file in the base directory of the generated service. Below a table can be found which show the different variables that can be passed - these are the variables which exist by default, through the use of plugins additional integrations could require additional values. These values are provided default values after generation, change them to the desired values.
+
+| Variable | Description | Value |
+| -------------------- | -------------------------------------------- | ------------------------------------------------------------------- |
+| BCRYPT_SALT | the string used for hashing | [random-string] |
+| COMPOSE_PROJECT_NAME | the identifier of the service plus prefix | amp_[service-identifier] |
+| PORT | the port on which to run the server | 3000 |
+| DB_URL | the connection url for the database | [db-provider]://[username]:[password]@localhost:[db-port]/[db-name] |
+| DB_PORT | the port used by the database instance | [db-provider-port] |
+| DB_USER | the username used to connect to the database | [username] |
+| DB_PASSWORD | the password used to connect to the database | [password] |
+| DB_NAME | the name of the database | [service-name] / [project-name] |
+| JWT_SECRET_KEY | the secret used to sign the json-web token | [secret] |
+| JWT_EXPIRATION | the expiration time for the json-web token | 2d |
+
+> **Note**
+> Amplication generates default values and stores them under the .env file. It is advised to use some form of secrets manager/vault solution when using in production.
+
+## Step 2.1: Scripts - pre-requisites
+
+After configuration of the server the next step would be to run the application. Before running the server side of the component, make sure that the different pre-requisites are met - i.e., node.js [^16.x], npm, docker. After the setup of the pre-requisites the server component can be started.
+
+```sh
+# installation of the dependencies
+$ npm install
+
+# generate the prisma client
+$ npm run prisma:generate
+```
+
+## Step 2.2: Scripts - local development
+
+```sh
+# start the database where the server component will connect to
+$ npm run docker:dev
+
+# initialize the database
+$ npm run db:init
+
+# start the server component
+$ npm run start
+```
+By default, your app comes with one user with the username "admin" and password "admin".
+
+## Step 2.2: Scripts - container based development
+
+```shell
+# start the server component as a docker container
+$ npm run compose:up
+```
diff --git a/apps/maestri-edu-server/docker-compose.dev.yml b/apps/maestri-edu-server/docker-compose.dev.yml
new file mode 100644
index 0000000..8d7c358
--- /dev/null
+++ b/apps/maestri-edu-server/docker-compose.dev.yml
@@ -0,0 +1,13 @@
+version: "3"
+services:
+ db:
+ image: postgres:12
+ ports:
+ - ${DB_PORT}:5432
+ environment:
+ POSTGRES_USER: ${DB_USER}
+ POSTGRES_PASSWORD: ${DB_PASSWORD}
+ volumes:
+ - postgres:/var/lib/postgresql/data
+volumes:
+ postgres: ~
diff --git a/apps/maestri-edu-server/docker-compose.yml b/apps/maestri-edu-server/docker-compose.yml
new file mode 100644
index 0000000..ef3a7a5
--- /dev/null
+++ b/apps/maestri-edu-server/docker-compose.yml
@@ -0,0 +1,47 @@
+version: "3"
+services:
+ server:
+ build:
+ context: .
+ args:
+ NPM_LOG_LEVEL: notice
+ ports:
+ - ${PORT}:3000
+ environment:
+ BCRYPT_SALT: ${BCRYPT_SALT}
+ DB_URL: postgres://${DB_USER}:${DB_PASSWORD}@db:5432/${DB_NAME}
+ depends_on:
+ - migrate
+ restart: on-failure
+ migrate:
+ build:
+ context: .
+ args:
+ NPM_LOG_LEVEL: notice
+ command: npm run db:init
+ working_dir: /app/server
+ environment:
+ BCRYPT_SALT: ${BCRYPT_SALT}
+ DB_URL: postgres://${DB_USER}:${DB_PASSWORD}@db:5432/${DB_NAME}
+ depends_on:
+ db:
+ condition: service_healthy
+ db:
+ image: postgres:12
+ ports:
+ - ${DB_PORT}:5432
+ environment:
+ POSTGRES_USER: ${DB_USER}
+ POSTGRES_PASSWORD: ${DB_PASSWORD}
+ POSTGRES_DB: ${DB_NAME}
+ volumes:
+ - postgres:/var/lib/postgresql/data
+ healthcheck:
+ test:
+ - CMD-SHELL
+ - pg_isready -d $${POSTGRES_DB} -U $${POSTGRES_USER}
+ timeout: 45s
+ interval: 10s
+ retries: 10
+volumes:
+ postgres: ~
diff --git a/apps/maestri-edu-server/nest-cli.json b/apps/maestri-edu-server/nest-cli.json
new file mode 100644
index 0000000..b7b60ae
--- /dev/null
+++ b/apps/maestri-edu-server/nest-cli.json
@@ -0,0 +1,10 @@
+{
+ "sourceRoot": "src",
+ "compilerOptions": {
+ "assets": [
+ {
+ "include": "swagger/**/*"
+ }
+ ]
+ }
+}
diff --git a/apps/maestri-edu-server/package.json b/apps/maestri-edu-server/package.json
new file mode 100644
index 0000000..528e684
--- /dev/null
+++ b/apps/maestri-edu-server/package.json
@@ -0,0 +1,77 @@
+{
+ "name": "@maestri-edu/server",
+ "private": true,
+ "scripts": {
+ "start": "nest start",
+ "start:watch": "nest start --watch",
+ "start:debug": "nest start --debug --watch",
+ "build": "nest build",
+ "test": "jest",
+ "seed": "ts-node scripts/seed.ts",
+ "db:migrate-save": "prisma migrate dev",
+ "db:migrate-up": "prisma migrate deploy",
+ "db:clean": "prisma migrate reset",
+ "db:init": "run-s \"db:migrate-save -- --name 'initial version'\" db:migrate-up seed",
+ "prisma:generate": "prisma generate",
+ "docker:dev": "docker-compose -f docker-compose.dev.yml up -d",
+ "package:container": "docker build .",
+ "compose:up": "docker-compose up -d",
+ "compose:down": "docker-compose down --volumes"
+ },
+ "dependencies": {
+ "@apollo/server": "^4.9.4",
+ "@nestjs/apollo": "12.0.9",
+ "@nestjs/common": "10.2.7",
+ "@nestjs/config": "3.1.1",
+ "@nestjs/core": "10.2.7",
+ "@nestjs/graphql": "12.0.9",
+ "@nestjs/jwt": "^10.1.1",
+ "@nestjs/passport": "^10.0.2",
+ "@nestjs/platform-express": "10.2.7",
+ "@nestjs/serve-static": "4.0.0",
+ "@nestjs/swagger": "7.1.13",
+ "@prisma/client": "^5.4.2",
+ "@types/bcrypt": "5.0.0",
+ "bcrypt": "5.1.1",
+ "class-transformer": "0.5.1",
+ "class-validator": "0.14.0",
+ "decimal.js": "10.4.3",
+ "dotenv": "16.3.1",
+ "graphql": "^16.8.1",
+ "graphql-type-json": "0.3.2",
+ "npm-run-all": "4.1.5",
+ "passport": "0.6.0",
+ "passport-http": "0.3.0",
+ "passport-jwt": "4.0.1",
+ "reflect-metadata": "0.1.13",
+ "ts-node": "10.9.2",
+ "type-fest": "2.19.0",
+ "validator": "13.11.0"
+ },
+ "devDependencies": {
+ "@nestjs/cli": "^10.1.18",
+ "@nestjs/testing": "^10.2.7",
+ "@types/express": "^4.17.19",
+ "@types/graphql-type-json": "0.3.3",
+ "@types/jest": "^29.5.5",
+ "@types/normalize-path": "3.0.0",
+ "@types/passport-http": "0.3.9",
+ "@types/passport-jwt": "3.0.10",
+ "@types/supertest": "^2.0.14",
+ "@types/validator": "^13.11.2",
+ "jest": "^29.7.0",
+ "jest-mock-extended": "^3.0.5",
+ "prisma": "^5.4.2",
+ "supertest": "^6.3.3",
+ "ts-jest": "^29.1.1",
+ "typescript": "^5.4.3"
+ },
+ "jest": {
+ "preset": "ts-jest",
+ "testEnvironment": "node",
+ "moduleNameMapper": {
+ "@app/custom-validators": "/src/validators"
+ },
+ "modulePathIgnorePatterns": ["/dist/"]
+ }
+}
diff --git a/apps/maestri-edu-server/prisma/schema.prisma b/apps/maestri-edu-server/prisma/schema.prisma
new file mode 100644
index 0000000..2b1a9cb
--- /dev/null
+++ b/apps/maestri-edu-server/prisma/schema.prisma
@@ -0,0 +1,112 @@
+datasource db {
+ provider = "postgresql"
+ url = env("DB_URL")
+}
+
+generator client {
+ provider = "prisma-client-js"
+}
+
+model DadosEscolares {
+ createdAt DateTime @default(now())
+ id String @id @default(cuid())
+ perfilReferencia String?
+ updatedAt DateTime @updatedAt
+}
+
+model Perfil {
+ cpf String?
+ createdAt DateTime @default(now())
+ id String @id @default(cuid())
+ numeroCelular String?
+ updatedAt DateTime @updatedAt
+}
+
+model Endereco {
+ createdAt DateTime @default(now())
+ id String @id @default(cuid())
+ perfilReferencia String?
+ updatedAt DateTime @updatedAt
+}
+
+model Contrato {
+ createdAt DateTime @default(now())
+ id String @id @default(cuid())
+ perfilReferencia String?
+ updatedAt DateTime @updatedAt
+}
+
+model Documento {
+ createdAt DateTime @default(now())
+ id String @id @default(cuid())
+ perfilReferencia String?
+ updatedAt DateTime @updatedAt
+}
+
+model Curso {
+ createdAt DateTime @default(now())
+ id String @id @default(cuid())
+ matriculas Matricula[]
+ updatedAt DateTime @updatedAt
+}
+
+model Classificacao {
+ createdAt DateTime @default(now())
+ id String @id @default(cuid())
+ updatedAt DateTime @updatedAt
+}
+
+model Banking {
+ createdAt DateTime @default(now())
+ descricaoi String?
+ id String @id @default(cuid())
+ idConvenio String? @unique
+ movimentaO Decimal?
+ status Boolean
+ updatedAt DateTime @updatedAt
+}
+
+model Matricula {
+ aluno String?
+ alunoId String?
+ alunoReferencia String?
+ classificacaoReferencia String?
+ createdAt DateTime @default(now())
+ curso Curso? @relation(fields: [cursoId], references: [id])
+ cursoId String?
+ cursoReferencia String?
+ id String @id @default(cuid())
+ numeroParcelas Int?
+ parcelaAdimplente String?
+ parcelaAdimplenteId String?
+ parcelaAdimplenteReferencia String?
+ promotor String?
+ promotorId String?
+ promotorReferencia String?
+ status EnumMatriculaStatus?
+ statusMatricula EnumMatriculaStatusMatricula?
+ taxaMatricula String?
+ taxaMatriculaId String?
+ taxaMatriculaReferencia String?
+ updatedAt DateTime @updatedAt
+}
+
+model Parcela {
+ createdAt DateTime @default(now())
+ id String @id @default(cuid())
+ updatedAt DateTime @updatedAt
+}
+
+model Cobranca {
+ createdAt DateTime @default(now())
+ id String @id @default(cuid())
+ updatedAt DateTime @updatedAt
+}
+
+enum EnumMatriculaStatus {
+ Option1
+}
+
+enum EnumMatriculaStatusMatricula {
+ Option1
+}
diff --git a/apps/maestri-edu-server/scripts/customSeed.ts b/apps/maestri-edu-server/scripts/customSeed.ts
new file mode 100644
index 0000000..26ccaf4
--- /dev/null
+++ b/apps/maestri-edu-server/scripts/customSeed.ts
@@ -0,0 +1,7 @@
+import { PrismaClient } from "@prisma/client";
+
+export async function customSeed() {
+ const client = new PrismaClient();
+
+ client.$disconnect();
+}
diff --git a/apps/maestri-edu-server/scripts/seed.ts b/apps/maestri-edu-server/scripts/seed.ts
new file mode 100644
index 0000000..04cee65
--- /dev/null
+++ b/apps/maestri-edu-server/scripts/seed.ts
@@ -0,0 +1,25 @@
+import * as dotenv from "dotenv";
+import { PrismaClient } from "@prisma/client";
+import { customSeed } from "./customSeed";
+
+if (require.main === module) {
+ dotenv.config();
+
+ const { BCRYPT_SALT } = process.env;
+
+ if (!BCRYPT_SALT) {
+ throw new Error("BCRYPT_SALT environment variable must be defined");
+ }
+}
+
+async function seed() {
+ console.info("Seeding database...");
+
+ const client = new PrismaClient();
+ void client.$disconnect();
+
+ console.info("Seeding database with custom seed...");
+ customSeed();
+
+ console.info("Seeded database successfully");
+}
diff --git a/apps/maestri-edu-server/src/app.module.ts b/apps/maestri-edu-server/src/app.module.ts
new file mode 100644
index 0000000..eb6c1ad
--- /dev/null
+++ b/apps/maestri-edu-server/src/app.module.ts
@@ -0,0 +1,61 @@
+import { Module } from "@nestjs/common";
+import { DadosEscolaresModule } from "./dadosEscolares/dadosEscolares.module";
+import { PerfilModule } from "./perfil/perfil.module";
+import { EnderecoModule } from "./endereco/endereco.module";
+import { ContratoModule } from "./contrato/contrato.module";
+import { DocumentoModule } from "./documento/documento.module";
+import { CursoModule } from "./curso/curso.module";
+import { ClassificacaoModule } from "./classificacao/classificacao.module";
+import { BankingModule } from "./banking/banking.module";
+import { MatriculaModule } from "./matricula/matricula.module";
+import { ParcelaModule } from "./parcela/parcela.module";
+import { CobrancaModule } from "./cobranca/cobranca.module";
+import { HealthModule } from "./health/health.module";
+import { PrismaModule } from "./prisma/prisma.module";
+import { SecretsManagerModule } from "./providers/secrets/secretsManager.module";
+import { ServeStaticModule } from "@nestjs/serve-static";
+import { ServeStaticOptionsService } from "./serveStaticOptions.service";
+import { ConfigModule, ConfigService } from "@nestjs/config";
+import { GraphQLModule } from "@nestjs/graphql";
+import { ApolloDriver, ApolloDriverConfig } from "@nestjs/apollo";
+
+@Module({
+ controllers: [],
+ imports: [
+ DadosEscolaresModule,
+ PerfilModule,
+ EnderecoModule,
+ ContratoModule,
+ DocumentoModule,
+ CursoModule,
+ ClassificacaoModule,
+ BankingModule,
+ MatriculaModule,
+ ParcelaModule,
+ CobrancaModule,
+ HealthModule,
+ PrismaModule,
+ SecretsManagerModule,
+ ConfigModule.forRoot({ isGlobal: true }),
+ ServeStaticModule.forRootAsync({
+ useClass: ServeStaticOptionsService,
+ }),
+ GraphQLModule.forRootAsync({
+ driver: ApolloDriver,
+ useFactory: (configService: ConfigService) => {
+ const playground = configService.get("GRAPHQL_PLAYGROUND");
+ const introspection = configService.get("GRAPHQL_INTROSPECTION");
+ return {
+ autoSchemaFile: "schema.graphql",
+ sortSchema: true,
+ playground,
+ introspection: playground || introspection,
+ };
+ },
+ inject: [ConfigService],
+ imports: [ConfigModule],
+ }),
+ ],
+ providers: [],
+})
+export class AppModule {}
diff --git a/apps/maestri-edu-server/src/banking/banking.controller.ts b/apps/maestri-edu-server/src/banking/banking.controller.ts
new file mode 100644
index 0000000..55832e6
--- /dev/null
+++ b/apps/maestri-edu-server/src/banking/banking.controller.ts
@@ -0,0 +1,12 @@
+import * as common from "@nestjs/common";
+import * as swagger from "@nestjs/swagger";
+import { BankingService } from "./banking.service";
+import { BankingControllerBase } from "./base/banking.controller.base";
+
+@swagger.ApiTags("bankings")
+@common.Controller("bankings")
+export class BankingController extends BankingControllerBase {
+ constructor(protected readonly service: BankingService) {
+ super(service);
+ }
+}
diff --git a/apps/maestri-edu-server/src/banking/banking.module.ts b/apps/maestri-edu-server/src/banking/banking.module.ts
new file mode 100644
index 0000000..d2c4679
--- /dev/null
+++ b/apps/maestri-edu-server/src/banking/banking.module.ts
@@ -0,0 +1,13 @@
+import { Module } from "@nestjs/common";
+import { BankingModuleBase } from "./base/banking.module.base";
+import { BankingService } from "./banking.service";
+import { BankingController } from "./banking.controller";
+import { BankingResolver } from "./banking.resolver";
+
+@Module({
+ imports: [BankingModuleBase],
+ controllers: [BankingController],
+ providers: [BankingService, BankingResolver],
+ exports: [BankingService],
+})
+export class BankingModule {}
diff --git a/apps/maestri-edu-server/src/banking/banking.resolver.ts b/apps/maestri-edu-server/src/banking/banking.resolver.ts
new file mode 100644
index 0000000..ea0e0dc
--- /dev/null
+++ b/apps/maestri-edu-server/src/banking/banking.resolver.ts
@@ -0,0 +1,11 @@
+import * as graphql from "@nestjs/graphql";
+import { BankingResolverBase } from "./base/banking.resolver.base";
+import { Banking } from "./base/Banking";
+import { BankingService } from "./banking.service";
+
+@graphql.Resolver(() => Banking)
+export class BankingResolver extends BankingResolverBase {
+ constructor(protected readonly service: BankingService) {
+ super(service);
+ }
+}
diff --git a/apps/maestri-edu-server/src/banking/banking.service.ts b/apps/maestri-edu-server/src/banking/banking.service.ts
new file mode 100644
index 0000000..a0aff2e
--- /dev/null
+++ b/apps/maestri-edu-server/src/banking/banking.service.ts
@@ -0,0 +1,10 @@
+import { Injectable } from "@nestjs/common";
+import { PrismaService } from "../prisma/prisma.service";
+import { BankingServiceBase } from "./base/banking.service.base";
+
+@Injectable()
+export class BankingService extends BankingServiceBase {
+ constructor(protected readonly prisma: PrismaService) {
+ super(prisma);
+ }
+}
diff --git a/apps/maestri-edu-server/src/banking/base/Banking.ts b/apps/maestri-edu-server/src/banking/base/Banking.ts
new file mode 100644
index 0000000..bc213fc
--- /dev/null
+++ b/apps/maestri-edu-server/src/banking/base/Banking.ts
@@ -0,0 +1,97 @@
+/*
+------------------------------------------------------------------------------
+This code was generated by Amplication.
+
+Changes to this file will be lost if the code is regenerated.
+
+There are other ways to to customize your code, see this doc to learn more
+https://docs.amplication.com/how-to/custom-code
+
+------------------------------------------------------------------------------
+ */
+import { ObjectType, Field, Float } from "@nestjs/graphql";
+import { ApiProperty } from "@nestjs/swagger";
+import {
+ IsDate,
+ IsString,
+ MaxLength,
+ IsOptional,
+ IsNumber,
+ Max,
+ IsBoolean,
+} from "class-validator";
+import { Type } from "class-transformer";
+import { Decimal } from "decimal.js";
+
+@ObjectType()
+class Banking {
+ @ApiProperty({
+ required: true,
+ })
+ @IsDate()
+ @Type(() => Date)
+ @Field(() => Date)
+ createdAt!: Date;
+
+ @ApiProperty({
+ required: false,
+ type: String,
+ })
+ @IsString()
+ @MaxLength(1000)
+ @IsOptional()
+ @Field(() => String, {
+ nullable: true,
+ })
+ descricaoi!: string | null;
+
+ @ApiProperty({
+ required: true,
+ type: String,
+ })
+ @IsString()
+ @Field(() => String)
+ id!: string;
+
+ @ApiProperty({
+ required: false,
+ type: String,
+ })
+ @IsString()
+ @MaxLength(256)
+ @IsOptional()
+ @Field(() => String, {
+ nullable: true,
+ })
+ idConvenio!: string | null;
+
+ @ApiProperty({
+ required: false,
+ type: Number,
+ })
+ @IsNumber()
+ @Max(99999999999)
+ @IsOptional()
+ @Field(() => Float, {
+ nullable: true,
+ })
+ movimentaO!: Decimal | null;
+
+ @ApiProperty({
+ required: true,
+ type: Boolean,
+ })
+ @IsBoolean()
+ @Field(() => Boolean)
+ status!: boolean;
+
+ @ApiProperty({
+ required: true,
+ })
+ @IsDate()
+ @Type(() => Date)
+ @Field(() => Date)
+ updatedAt!: Date;
+}
+
+export { Banking as Banking };
diff --git a/apps/maestri-edu-server/src/banking/base/BankingCountArgs.ts b/apps/maestri-edu-server/src/banking/base/BankingCountArgs.ts
new file mode 100644
index 0000000..03ca9aa
--- /dev/null
+++ b/apps/maestri-edu-server/src/banking/base/BankingCountArgs.ts
@@ -0,0 +1,28 @@
+/*
+------------------------------------------------------------------------------
+This code was generated by Amplication.
+
+Changes to this file will be lost if the code is regenerated.
+
+There are other ways to to customize your code, see this doc to learn more
+https://docs.amplication.com/how-to/custom-code
+
+------------------------------------------------------------------------------
+ */
+import { ArgsType, Field } from "@nestjs/graphql";
+import { ApiProperty } from "@nestjs/swagger";
+import { BankingWhereInput } from "./BankingWhereInput";
+import { Type } from "class-transformer";
+
+@ArgsType()
+class BankingCountArgs {
+ @ApiProperty({
+ required: false,
+ type: () => BankingWhereInput,
+ })
+ @Field(() => BankingWhereInput, { nullable: true })
+ @Type(() => BankingWhereInput)
+ where?: BankingWhereInput;
+}
+
+export { BankingCountArgs as BankingCountArgs };
diff --git a/apps/maestri-edu-server/src/banking/base/BankingCreateInput.ts b/apps/maestri-edu-server/src/banking/base/BankingCreateInput.ts
new file mode 100644
index 0000000..c733885
--- /dev/null
+++ b/apps/maestri-edu-server/src/banking/base/BankingCreateInput.ts
@@ -0,0 +1,71 @@
+/*
+------------------------------------------------------------------------------
+This code was generated by Amplication.
+
+Changes to this file will be lost if the code is regenerated.
+
+There are other ways to to customize your code, see this doc to learn more
+https://docs.amplication.com/how-to/custom-code
+
+------------------------------------------------------------------------------
+ */
+import { InputType, Field, Float } from "@nestjs/graphql";
+import { ApiProperty } from "@nestjs/swagger";
+import {
+ IsString,
+ MaxLength,
+ IsOptional,
+ IsNumber,
+ Max,
+ IsBoolean,
+} from "class-validator";
+import { Decimal } from "decimal.js";
+
+@InputType()
+class BankingCreateInput {
+ @ApiProperty({
+ required: false,
+ type: String,
+ })
+ @IsString()
+ @MaxLength(1000)
+ @IsOptional()
+ @Field(() => String, {
+ nullable: true,
+ })
+ descricaoi?: string | null;
+
+ @ApiProperty({
+ required: false,
+ type: String,
+ })
+ @IsString()
+ @MaxLength(256)
+ @IsOptional()
+ @Field(() => String, {
+ nullable: true,
+ })
+ idConvenio?: string | null;
+
+ @ApiProperty({
+ required: false,
+ type: Number,
+ })
+ @IsNumber()
+ @Max(99999999999)
+ @IsOptional()
+ @Field(() => Float, {
+ nullable: true,
+ })
+ movimentaO?: Decimal | null;
+
+ @ApiProperty({
+ required: true,
+ type: Boolean,
+ })
+ @IsBoolean()
+ @Field(() => Boolean)
+ status!: boolean;
+}
+
+export { BankingCreateInput as BankingCreateInput };
diff --git a/apps/maestri-edu-server/src/banking/base/BankingFindManyArgs.ts b/apps/maestri-edu-server/src/banking/base/BankingFindManyArgs.ts
new file mode 100644
index 0000000..f445a31
--- /dev/null
+++ b/apps/maestri-edu-server/src/banking/base/BankingFindManyArgs.ts
@@ -0,0 +1,62 @@
+/*
+------------------------------------------------------------------------------
+This code was generated by Amplication.
+
+Changes to this file will be lost if the code is regenerated.
+
+There are other ways to to customize your code, see this doc to learn more
+https://docs.amplication.com/how-to/custom-code
+
+------------------------------------------------------------------------------
+ */
+import { ArgsType, Field } from "@nestjs/graphql";
+import { ApiProperty } from "@nestjs/swagger";
+import { BankingWhereInput } from "./BankingWhereInput";
+import { IsOptional, ValidateNested, IsInt } from "class-validator";
+import { Type } from "class-transformer";
+import { BankingOrderByInput } from "./BankingOrderByInput";
+
+@ArgsType()
+class BankingFindManyArgs {
+ @ApiProperty({
+ required: false,
+ type: () => BankingWhereInput,
+ })
+ @IsOptional()
+ @ValidateNested()
+ @Field(() => BankingWhereInput, { nullable: true })
+ @Type(() => BankingWhereInput)
+ where?: BankingWhereInput;
+
+ @ApiProperty({
+ required: false,
+ type: [BankingOrderByInput],
+ })
+ @IsOptional()
+ @ValidateNested({ each: true })
+ @Field(() => [BankingOrderByInput], { nullable: true })
+ @Type(() => BankingOrderByInput)
+ orderBy?: Array;
+
+ @ApiProperty({
+ required: false,
+ type: Number,
+ })
+ @IsOptional()
+ @IsInt()
+ @Field(() => Number, { nullable: true })
+ @Type(() => Number)
+ skip?: number;
+
+ @ApiProperty({
+ required: false,
+ type: Number,
+ })
+ @IsOptional()
+ @IsInt()
+ @Field(() => Number, { nullable: true })
+ @Type(() => Number)
+ take?: number;
+}
+
+export { BankingFindManyArgs as BankingFindManyArgs };
diff --git a/apps/maestri-edu-server/src/banking/base/BankingFindUniqueArgs.ts b/apps/maestri-edu-server/src/banking/base/BankingFindUniqueArgs.ts
new file mode 100644
index 0000000..1d76d33
--- /dev/null
+++ b/apps/maestri-edu-server/src/banking/base/BankingFindUniqueArgs.ts
@@ -0,0 +1,30 @@
+/*
+------------------------------------------------------------------------------
+This code was generated by Amplication.
+
+Changes to this file will be lost if the code is regenerated.
+
+There are other ways to to customize your code, see this doc to learn more
+https://docs.amplication.com/how-to/custom-code
+
+------------------------------------------------------------------------------
+ */
+import { ArgsType, Field } from "@nestjs/graphql";
+import { ApiProperty } from "@nestjs/swagger";
+import { BankingWhereUniqueInput } from "./BankingWhereUniqueInput";
+import { ValidateNested } from "class-validator";
+import { Type } from "class-transformer";
+
+@ArgsType()
+class BankingFindUniqueArgs {
+ @ApiProperty({
+ required: true,
+ type: () => BankingWhereUniqueInput,
+ })
+ @ValidateNested()
+ @Type(() => BankingWhereUniqueInput)
+ @Field(() => BankingWhereUniqueInput, { nullable: false })
+ where!: BankingWhereUniqueInput;
+}
+
+export { BankingFindUniqueArgs as BankingFindUniqueArgs };
diff --git a/apps/maestri-edu-server/src/banking/base/BankingListRelationFilter.ts b/apps/maestri-edu-server/src/banking/base/BankingListRelationFilter.ts
new file mode 100644
index 0000000..735a7ec
--- /dev/null
+++ b/apps/maestri-edu-server/src/banking/base/BankingListRelationFilter.ts
@@ -0,0 +1,56 @@
+/*
+------------------------------------------------------------------------------
+This code was generated by Amplication.
+
+Changes to this file will be lost if the code is regenerated.
+
+There are other ways to to customize your code, see this doc to learn more
+https://docs.amplication.com/how-to/custom-code
+
+------------------------------------------------------------------------------
+ */
+import { InputType, Field } from "@nestjs/graphql";
+import { ApiProperty } from "@nestjs/swagger";
+import { BankingWhereInput } from "./BankingWhereInput";
+import { ValidateNested, IsOptional } from "class-validator";
+import { Type } from "class-transformer";
+
+@InputType()
+class BankingListRelationFilter {
+ @ApiProperty({
+ required: false,
+ type: () => BankingWhereInput,
+ })
+ @ValidateNested()
+ @Type(() => BankingWhereInput)
+ @IsOptional()
+ @Field(() => BankingWhereInput, {
+ nullable: true,
+ })
+ every?: BankingWhereInput;
+
+ @ApiProperty({
+ required: false,
+ type: () => BankingWhereInput,
+ })
+ @ValidateNested()
+ @Type(() => BankingWhereInput)
+ @IsOptional()
+ @Field(() => BankingWhereInput, {
+ nullable: true,
+ })
+ some?: BankingWhereInput;
+
+ @ApiProperty({
+ required: false,
+ type: () => BankingWhereInput,
+ })
+ @ValidateNested()
+ @Type(() => BankingWhereInput)
+ @IsOptional()
+ @Field(() => BankingWhereInput, {
+ nullable: true,
+ })
+ none?: BankingWhereInput;
+}
+export { BankingListRelationFilter as BankingListRelationFilter };
diff --git a/apps/maestri-edu-server/src/banking/base/BankingOrderByInput.ts b/apps/maestri-edu-server/src/banking/base/BankingOrderByInput.ts
new file mode 100644
index 0000000..604aca3
--- /dev/null
+++ b/apps/maestri-edu-server/src/banking/base/BankingOrderByInput.ts
@@ -0,0 +1,100 @@
+/*
+------------------------------------------------------------------------------
+This code was generated by Amplication.
+
+Changes to this file will be lost if the code is regenerated.
+
+There are other ways to to customize your code, see this doc to learn more
+https://docs.amplication.com/how-to/custom-code
+
+------------------------------------------------------------------------------
+ */
+import { InputType, Field } from "@nestjs/graphql";
+import { ApiProperty } from "@nestjs/swagger";
+import { IsOptional, IsEnum } from "class-validator";
+import { SortOrder } from "../../util/SortOrder";
+
+@InputType({
+ isAbstract: true,
+ description: undefined,
+})
+class BankingOrderByInput {
+ @ApiProperty({
+ required: false,
+ enum: ["asc", "desc"],
+ })
+ @IsOptional()
+ @IsEnum(SortOrder)
+ @Field(() => SortOrder, {
+ nullable: true,
+ })
+ createdAt?: SortOrder;
+
+ @ApiProperty({
+ required: false,
+ enum: ["asc", "desc"],
+ })
+ @IsOptional()
+ @IsEnum(SortOrder)
+ @Field(() => SortOrder, {
+ nullable: true,
+ })
+ descricaoi?: SortOrder;
+
+ @ApiProperty({
+ required: false,
+ enum: ["asc", "desc"],
+ })
+ @IsOptional()
+ @IsEnum(SortOrder)
+ @Field(() => SortOrder, {
+ nullable: true,
+ })
+ id?: SortOrder;
+
+ @ApiProperty({
+ required: false,
+ enum: ["asc", "desc"],
+ })
+ @IsOptional()
+ @IsEnum(SortOrder)
+ @Field(() => SortOrder, {
+ nullable: true,
+ })
+ idConvenio?: SortOrder;
+
+ @ApiProperty({
+ required: false,
+ enum: ["asc", "desc"],
+ })
+ @IsOptional()
+ @IsEnum(SortOrder)
+ @Field(() => SortOrder, {
+ nullable: true,
+ })
+ movimentaO?: SortOrder;
+
+ @ApiProperty({
+ required: false,
+ enum: ["asc", "desc"],
+ })
+ @IsOptional()
+ @IsEnum(SortOrder)
+ @Field(() => SortOrder, {
+ nullable: true,
+ })
+ status?: SortOrder;
+
+ @ApiProperty({
+ required: false,
+ enum: ["asc", "desc"],
+ })
+ @IsOptional()
+ @IsEnum(SortOrder)
+ @Field(() => SortOrder, {
+ nullable: true,
+ })
+ updatedAt?: SortOrder;
+}
+
+export { BankingOrderByInput as BankingOrderByInput };
diff --git a/apps/maestri-edu-server/src/banking/base/BankingUpdateInput.ts b/apps/maestri-edu-server/src/banking/base/BankingUpdateInput.ts
new file mode 100644
index 0000000..be34345
--- /dev/null
+++ b/apps/maestri-edu-server/src/banking/base/BankingUpdateInput.ts
@@ -0,0 +1,74 @@
+/*
+------------------------------------------------------------------------------
+This code was generated by Amplication.
+
+Changes to this file will be lost if the code is regenerated.
+
+There are other ways to to customize your code, see this doc to learn more
+https://docs.amplication.com/how-to/custom-code
+
+------------------------------------------------------------------------------
+ */
+import { InputType, Field, Float } from "@nestjs/graphql";
+import { ApiProperty } from "@nestjs/swagger";
+import {
+ IsString,
+ MaxLength,
+ IsOptional,
+ IsNumber,
+ Max,
+ IsBoolean,
+} from "class-validator";
+import { Decimal } from "decimal.js";
+
+@InputType()
+class BankingUpdateInput {
+ @ApiProperty({
+ required: false,
+ type: String,
+ })
+ @IsString()
+ @MaxLength(1000)
+ @IsOptional()
+ @Field(() => String, {
+ nullable: true,
+ })
+ descricaoi?: string | null;
+
+ @ApiProperty({
+ required: false,
+ type: String,
+ })
+ @IsString()
+ @MaxLength(256)
+ @IsOptional()
+ @Field(() => String, {
+ nullable: true,
+ })
+ idConvenio?: string | null;
+
+ @ApiProperty({
+ required: false,
+ type: Number,
+ })
+ @IsNumber()
+ @Max(99999999999)
+ @IsOptional()
+ @Field(() => Float, {
+ nullable: true,
+ })
+ movimentaO?: Decimal | null;
+
+ @ApiProperty({
+ required: false,
+ type: Boolean,
+ })
+ @IsBoolean()
+ @IsOptional()
+ @Field(() => Boolean, {
+ nullable: true,
+ })
+ status?: boolean;
+}
+
+export { BankingUpdateInput as BankingUpdateInput };
diff --git a/apps/maestri-edu-server/src/banking/base/BankingWhereInput.ts b/apps/maestri-edu-server/src/banking/base/BankingWhereInput.ts
new file mode 100644
index 0000000..bf552dc
--- /dev/null
+++ b/apps/maestri-edu-server/src/banking/base/BankingWhereInput.ts
@@ -0,0 +1,79 @@
+/*
+------------------------------------------------------------------------------
+This code was generated by Amplication.
+
+Changes to this file will be lost if the code is regenerated.
+
+There are other ways to to customize your code, see this doc to learn more
+https://docs.amplication.com/how-to/custom-code
+
+------------------------------------------------------------------------------
+ */
+import { InputType, Field } from "@nestjs/graphql";
+import { ApiProperty } from "@nestjs/swagger";
+import { StringNullableFilter } from "../../util/StringNullableFilter";
+import { Type } from "class-transformer";
+import { IsOptional } from "class-validator";
+import { StringFilter } from "../../util/StringFilter";
+import { DecimalNullableFilter } from "../../util/DecimalNullableFilter";
+import { BooleanFilter } from "../../util/BooleanFilter";
+
+@InputType()
+class BankingWhereInput {
+ @ApiProperty({
+ required: false,
+ type: StringNullableFilter,
+ })
+ @Type(() => StringNullableFilter)
+ @IsOptional()
+ @Field(() => StringNullableFilter, {
+ nullable: true,
+ })
+ descricaoi?: StringNullableFilter;
+
+ @ApiProperty({
+ required: false,
+ type: StringFilter,
+ })
+ @Type(() => StringFilter)
+ @IsOptional()
+ @Field(() => StringFilter, {
+ nullable: true,
+ })
+ id?: StringFilter;
+
+ @ApiProperty({
+ required: false,
+ type: StringNullableFilter,
+ })
+ @Type(() => StringNullableFilter)
+ @IsOptional()
+ @Field(() => StringNullableFilter, {
+ nullable: true,
+ })
+ idConvenio?: StringNullableFilter;
+
+ @ApiProperty({
+ required: false,
+ type: DecimalNullableFilter,
+ })
+ @Type(() => DecimalNullableFilter)
+ @IsOptional()
+ @Field(() => DecimalNullableFilter, {
+ nullable: true,
+ })
+ movimentaO?: DecimalNullableFilter;
+
+ @ApiProperty({
+ required: false,
+ type: BooleanFilter,
+ })
+ @Type(() => BooleanFilter)
+ @IsOptional()
+ @Field(() => BooleanFilter, {
+ nullable: true,
+ })
+ status?: BooleanFilter;
+}
+
+export { BankingWhereInput as BankingWhereInput };
diff --git a/apps/maestri-edu-server/src/banking/base/BankingWhereUniqueInput.ts b/apps/maestri-edu-server/src/banking/base/BankingWhereUniqueInput.ts
new file mode 100644
index 0000000..2a6f541
--- /dev/null
+++ b/apps/maestri-edu-server/src/banking/base/BankingWhereUniqueInput.ts
@@ -0,0 +1,27 @@
+/*
+------------------------------------------------------------------------------
+This code was generated by Amplication.
+
+Changes to this file will be lost if the code is regenerated.
+
+There are other ways to to customize your code, see this doc to learn more
+https://docs.amplication.com/how-to/custom-code
+
+------------------------------------------------------------------------------
+ */
+import { InputType, Field } from "@nestjs/graphql";
+import { ApiProperty } from "@nestjs/swagger";
+import { IsString } from "class-validator";
+
+@InputType()
+class BankingWhereUniqueInput {
+ @ApiProperty({
+ required: true,
+ type: String,
+ })
+ @IsString()
+ @Field(() => String)
+ id!: string;
+}
+
+export { BankingWhereUniqueInput as BankingWhereUniqueInput };
diff --git a/apps/maestri-edu-server/src/banking/base/CreateBankingArgs.ts b/apps/maestri-edu-server/src/banking/base/CreateBankingArgs.ts
new file mode 100644
index 0000000..23d05f2
--- /dev/null
+++ b/apps/maestri-edu-server/src/banking/base/CreateBankingArgs.ts
@@ -0,0 +1,30 @@
+/*
+------------------------------------------------------------------------------
+This code was generated by Amplication.
+
+Changes to this file will be lost if the code is regenerated.
+
+There are other ways to to customize your code, see this doc to learn more
+https://docs.amplication.com/how-to/custom-code
+
+------------------------------------------------------------------------------
+ */
+import { ArgsType, Field } from "@nestjs/graphql";
+import { ApiProperty } from "@nestjs/swagger";
+import { BankingCreateInput } from "./BankingCreateInput";
+import { ValidateNested } from "class-validator";
+import { Type } from "class-transformer";
+
+@ArgsType()
+class CreateBankingArgs {
+ @ApiProperty({
+ required: true,
+ type: () => BankingCreateInput,
+ })
+ @ValidateNested()
+ @Type(() => BankingCreateInput)
+ @Field(() => BankingCreateInput, { nullable: false })
+ data!: BankingCreateInput;
+}
+
+export { CreateBankingArgs as CreateBankingArgs };
diff --git a/apps/maestri-edu-server/src/banking/base/DeleteBankingArgs.ts b/apps/maestri-edu-server/src/banking/base/DeleteBankingArgs.ts
new file mode 100644
index 0000000..61091bf
--- /dev/null
+++ b/apps/maestri-edu-server/src/banking/base/DeleteBankingArgs.ts
@@ -0,0 +1,30 @@
+/*
+------------------------------------------------------------------------------
+This code was generated by Amplication.
+
+Changes to this file will be lost if the code is regenerated.
+
+There are other ways to to customize your code, see this doc to learn more
+https://docs.amplication.com/how-to/custom-code
+
+------------------------------------------------------------------------------
+ */
+import { ArgsType, Field } from "@nestjs/graphql";
+import { ApiProperty } from "@nestjs/swagger";
+import { BankingWhereUniqueInput } from "./BankingWhereUniqueInput";
+import { ValidateNested } from "class-validator";
+import { Type } from "class-transformer";
+
+@ArgsType()
+class DeleteBankingArgs {
+ @ApiProperty({
+ required: true,
+ type: () => BankingWhereUniqueInput,
+ })
+ @ValidateNested()
+ @Type(() => BankingWhereUniqueInput)
+ @Field(() => BankingWhereUniqueInput, { nullable: false })
+ where!: BankingWhereUniqueInput;
+}
+
+export { DeleteBankingArgs as DeleteBankingArgs };
diff --git a/apps/maestri-edu-server/src/banking/base/UpdateBankingArgs.ts b/apps/maestri-edu-server/src/banking/base/UpdateBankingArgs.ts
new file mode 100644
index 0000000..ddbd26a
--- /dev/null
+++ b/apps/maestri-edu-server/src/banking/base/UpdateBankingArgs.ts
@@ -0,0 +1,40 @@
+/*
+------------------------------------------------------------------------------
+This code was generated by Amplication.
+
+Changes to this file will be lost if the code is regenerated.
+
+There are other ways to to customize your code, see this doc to learn more
+https://docs.amplication.com/how-to/custom-code
+
+------------------------------------------------------------------------------
+ */
+import { ArgsType, Field } from "@nestjs/graphql";
+import { ApiProperty } from "@nestjs/swagger";
+import { BankingWhereUniqueInput } from "./BankingWhereUniqueInput";
+import { ValidateNested } from "class-validator";
+import { Type } from "class-transformer";
+import { BankingUpdateInput } from "./BankingUpdateInput";
+
+@ArgsType()
+class UpdateBankingArgs {
+ @ApiProperty({
+ required: true,
+ type: () => BankingWhereUniqueInput,
+ })
+ @ValidateNested()
+ @Type(() => BankingWhereUniqueInput)
+ @Field(() => BankingWhereUniqueInput, { nullable: false })
+ where!: BankingWhereUniqueInput;
+
+ @ApiProperty({
+ required: true,
+ type: () => BankingUpdateInput,
+ })
+ @ValidateNested()
+ @Type(() => BankingUpdateInput)
+ @Field(() => BankingUpdateInput, { nullable: false })
+ data!: BankingUpdateInput;
+}
+
+export { UpdateBankingArgs as UpdateBankingArgs };
diff --git a/apps/maestri-edu-server/src/banking/base/banking.controller.base.spec.ts b/apps/maestri-edu-server/src/banking/base/banking.controller.base.spec.ts
new file mode 100644
index 0000000..c3c8214
--- /dev/null
+++ b/apps/maestri-edu-server/src/banking/base/banking.controller.base.spec.ts
@@ -0,0 +1,206 @@
+import { Test } from "@nestjs/testing";
+import {
+ INestApplication,
+ HttpStatus,
+ ExecutionContext,
+ CallHandler,
+} from "@nestjs/common";
+import request from "supertest";
+import { ACGuard } from "nest-access-control";
+import { DefaultAuthGuard } from "../../auth/defaultAuth.guard";
+import { ACLModule } from "../../auth/acl.module";
+import { AclFilterResponseInterceptor } from "../../interceptors/aclFilterResponse.interceptor";
+import { AclValidateRequestInterceptor } from "../../interceptors/aclValidateRequest.interceptor";
+import { map } from "rxjs";
+import { BankingController } from "../banking.controller";
+import { BankingService } from "../banking.service";
+
+const nonExistingId = "nonExistingId";
+const existingId = "existingId";
+const CREATE_INPUT = {
+ createdAt: new Date(),
+ descricaoi: "exampleDescricaoi",
+ id: "exampleId",
+ idConvenio: "exampleIdConvenio",
+ movimentaO: 42.424242424,
+ status: "true",
+ updatedAt: new Date(),
+};
+const CREATE_RESULT = {
+ createdAt: new Date(),
+ descricaoi: "exampleDescricaoi",
+ id: "exampleId",
+ idConvenio: "exampleIdConvenio",
+ movimentaO: 42.424242424,
+ status: "true",
+ updatedAt: new Date(),
+};
+const FIND_MANY_RESULT = [
+ {
+ createdAt: new Date(),
+ descricaoi: "exampleDescricaoi",
+ id: "exampleId",
+ idConvenio: "exampleIdConvenio",
+ movimentaO: 42.424242424,
+ status: "true",
+ updatedAt: new Date(),
+ },
+];
+const FIND_ONE_RESULT = {
+ createdAt: new Date(),
+ descricaoi: "exampleDescricaoi",
+ id: "exampleId",
+ idConvenio: "exampleIdConvenio",
+ movimentaO: 42.424242424,
+ status: "true",
+ updatedAt: new Date(),
+};
+
+const service = {
+ createBanking() {
+ return CREATE_RESULT;
+ },
+ bankings: () => FIND_MANY_RESULT,
+ banking: ({ where }: { where: { id: string } }) => {
+ switch (where.id) {
+ case existingId:
+ return FIND_ONE_RESULT;
+ case nonExistingId:
+ return null;
+ }
+ },
+};
+
+const basicAuthGuard = {
+ canActivate: (context: ExecutionContext) => {
+ const argumentHost = context.switchToHttp();
+ const request = argumentHost.getRequest();
+ request.user = {
+ roles: ["user"],
+ };
+ return true;
+ },
+};
+
+const acGuard = {
+ canActivate: () => {
+ return true;
+ },
+};
+
+const aclFilterResponseInterceptor = {
+ intercept: (context: ExecutionContext, next: CallHandler) => {
+ return next.handle().pipe(
+ map((data) => {
+ return data;
+ })
+ );
+ },
+};
+const aclValidateRequestInterceptor = {
+ intercept: (context: ExecutionContext, next: CallHandler) => {
+ return next.handle();
+ },
+};
+
+describe("Banking", () => {
+ let app: INestApplication;
+
+ beforeAll(async () => {
+ const moduleRef = await Test.createTestingModule({
+ providers: [
+ {
+ provide: BankingService,
+ useValue: service,
+ },
+ ],
+ controllers: [BankingController],
+ imports: [ACLModule],
+ })
+ .overrideGuard(DefaultAuthGuard)
+ .useValue(basicAuthGuard)
+ .overrideGuard(ACGuard)
+ .useValue(acGuard)
+ .overrideInterceptor(AclFilterResponseInterceptor)
+ .useValue(aclFilterResponseInterceptor)
+ .overrideInterceptor(AclValidateRequestInterceptor)
+ .useValue(aclValidateRequestInterceptor)
+ .compile();
+
+ app = moduleRef.createNestApplication();
+ await app.init();
+ });
+
+ test("POST /bankings", async () => {
+ await request(app.getHttpServer())
+ .post("/bankings")
+ .send(CREATE_INPUT)
+ .expect(HttpStatus.CREATED)
+ .expect({
+ ...CREATE_RESULT,
+ createdAt: CREATE_RESULT.createdAt.toISOString(),
+ updatedAt: CREATE_RESULT.updatedAt.toISOString(),
+ });
+ });
+
+ test("GET /bankings", async () => {
+ await request(app.getHttpServer())
+ .get("/bankings")
+ .expect(HttpStatus.OK)
+ .expect([
+ {
+ ...FIND_MANY_RESULT[0],
+ createdAt: FIND_MANY_RESULT[0].createdAt.toISOString(),
+ updatedAt: FIND_MANY_RESULT[0].updatedAt.toISOString(),
+ },
+ ]);
+ });
+
+ test("GET /bankings/:id non existing", async () => {
+ await request(app.getHttpServer())
+ .get(`${"/bankings"}/${nonExistingId}`)
+ .expect(HttpStatus.NOT_FOUND)
+ .expect({
+ statusCode: HttpStatus.NOT_FOUND,
+ message: `No resource was found for {"${"id"}":"${nonExistingId}"}`,
+ error: "Not Found",
+ });
+ });
+
+ test("GET /bankings/:id existing", async () => {
+ await request(app.getHttpServer())
+ .get(`${"/bankings"}/${existingId}`)
+ .expect(HttpStatus.OK)
+ .expect({
+ ...FIND_ONE_RESULT,
+ createdAt: FIND_ONE_RESULT.createdAt.toISOString(),
+ updatedAt: FIND_ONE_RESULT.updatedAt.toISOString(),
+ });
+ });
+
+ test("POST /bankings existing resource", async () => {
+ const agent = request(app.getHttpServer());
+ await agent
+ .post("/bankings")
+ .send(CREATE_INPUT)
+ .expect(HttpStatus.CREATED)
+ .expect({
+ ...CREATE_RESULT,
+ createdAt: CREATE_RESULT.createdAt.toISOString(),
+ updatedAt: CREATE_RESULT.updatedAt.toISOString(),
+ })
+ .then(function () {
+ agent
+ .post("/bankings")
+ .send(CREATE_INPUT)
+ .expect(HttpStatus.CONFLICT)
+ .expect({
+ statusCode: HttpStatus.CONFLICT,
+ });
+ });
+ });
+
+ afterAll(async () => {
+ await app.close();
+ });
+});
diff --git a/apps/maestri-edu-server/src/banking/base/banking.controller.base.ts b/apps/maestri-edu-server/src/banking/base/banking.controller.base.ts
new file mode 100644
index 0000000..e05d04f
--- /dev/null
+++ b/apps/maestri-edu-server/src/banking/base/banking.controller.base.ts
@@ -0,0 +1,151 @@
+/*
+------------------------------------------------------------------------------
+This code was generated by Amplication.
+
+Changes to this file will be lost if the code is regenerated.
+
+There are other ways to to customize your code, see this doc to learn more
+https://docs.amplication.com/how-to/custom-code
+
+------------------------------------------------------------------------------
+ */
+import * as common from "@nestjs/common";
+import * as swagger from "@nestjs/swagger";
+import { isRecordNotFoundError } from "../../prisma.util";
+import * as errors from "../../errors";
+import { Request } from "express";
+import { plainToClass } from "class-transformer";
+import { ApiNestedQuery } from "../../decorators/api-nested-query.decorator";
+import { BankingService } from "../banking.service";
+import { BankingCreateInput } from "./BankingCreateInput";
+import { Banking } from "./Banking";
+import { BankingFindManyArgs } from "./BankingFindManyArgs";
+import { BankingWhereUniqueInput } from "./BankingWhereUniqueInput";
+import { BankingUpdateInput } from "./BankingUpdateInput";
+
+export class BankingControllerBase {
+ constructor(protected readonly service: BankingService) {}
+ @common.Post()
+ @swagger.ApiCreatedResponse({ type: Banking })
+ async createBanking(
+ @common.Body() data: BankingCreateInput
+ ): Promise {
+ return await this.service.createBanking({
+ data: data,
+ select: {
+ createdAt: true,
+ descricaoi: true,
+ id: true,
+ idConvenio: true,
+ movimentaO: true,
+ status: true,
+ updatedAt: true,
+ },
+ });
+ }
+
+ @common.Get()
+ @swagger.ApiOkResponse({ type: [Banking] })
+ @ApiNestedQuery(BankingFindManyArgs)
+ async bankings(@common.Req() request: Request): Promise {
+ const args = plainToClass(BankingFindManyArgs, request.query);
+ return this.service.bankings({
+ ...args,
+ select: {
+ createdAt: true,
+ descricaoi: true,
+ id: true,
+ idConvenio: true,
+ movimentaO: true,
+ status: true,
+ updatedAt: true,
+ },
+ });
+ }
+
+ @common.Get("/:id")
+ @swagger.ApiOkResponse({ type: Banking })
+ @swagger.ApiNotFoundResponse({ type: errors.NotFoundException })
+ async banking(
+ @common.Param() params: BankingWhereUniqueInput
+ ): Promise {
+ const result = await this.service.banking({
+ where: params,
+ select: {
+ createdAt: true,
+ descricaoi: true,
+ id: true,
+ idConvenio: true,
+ movimentaO: true,
+ status: true,
+ updatedAt: true,
+ },
+ });
+ if (result === null) {
+ throw new errors.NotFoundException(
+ `No resource was found for ${JSON.stringify(params)}`
+ );
+ }
+ return result;
+ }
+
+ @common.Patch("/:id")
+ @swagger.ApiOkResponse({ type: Banking })
+ @swagger.ApiNotFoundResponse({ type: errors.NotFoundException })
+ async updateBanking(
+ @common.Param() params: BankingWhereUniqueInput,
+ @common.Body() data: BankingUpdateInput
+ ): Promise {
+ try {
+ return await this.service.updateBanking({
+ where: params,
+ data: data,
+ select: {
+ createdAt: true,
+ descricaoi: true,
+ id: true,
+ idConvenio: true,
+ movimentaO: true,
+ status: true,
+ updatedAt: true,
+ },
+ });
+ } catch (error) {
+ if (isRecordNotFoundError(error)) {
+ throw new errors.NotFoundException(
+ `No resource was found for ${JSON.stringify(params)}`
+ );
+ }
+ throw error;
+ }
+ }
+
+ @common.Delete("/:id")
+ @swagger.ApiOkResponse({ type: Banking })
+ @swagger.ApiNotFoundResponse({ type: errors.NotFoundException })
+ async deleteBanking(
+ @common.Param() params: BankingWhereUniqueInput
+ ): Promise {
+ try {
+ return await this.service.deleteBanking({
+ where: params,
+ select: {
+ createdAt: true,
+ descricaoi: true,
+ id: true,
+ idConvenio: true,
+ movimentaO: true,
+ status: true,
+ updatedAt: true,
+ },
+ });
+ } catch (error) {
+ if (isRecordNotFoundError(error)) {
+ throw new errors.NotFoundException(
+ `No resource was found for ${JSON.stringify(params)}`
+ );
+ }
+ throw error;
+ }
+ }
+}
diff --git a/apps/maestri-edu-server/src/banking/base/banking.module.base.ts b/apps/maestri-edu-server/src/banking/base/banking.module.base.ts
new file mode 100644
index 0000000..de74744
--- /dev/null
+++ b/apps/maestri-edu-server/src/banking/base/banking.module.base.ts
@@ -0,0 +1,18 @@
+/*
+------------------------------------------------------------------------------
+This code was generated by Amplication.
+
+Changes to this file will be lost if the code is regenerated.
+
+There are other ways to to customize your code, see this doc to learn more
+https://docs.amplication.com/how-to/custom-code
+
+------------------------------------------------------------------------------
+ */
+import { Module } from "@nestjs/common";
+
+@Module({
+ imports: [],
+ exports: [],
+})
+export class BankingModuleBase {}
diff --git a/apps/maestri-edu-server/src/banking/base/banking.resolver.base.ts b/apps/maestri-edu-server/src/banking/base/banking.resolver.base.ts
new file mode 100644
index 0000000..7323245
--- /dev/null
+++ b/apps/maestri-edu-server/src/banking/base/banking.resolver.base.ts
@@ -0,0 +1,99 @@
+/*
+------------------------------------------------------------------------------
+This code was generated by Amplication.
+
+Changes to this file will be lost if the code is regenerated.
+
+There are other ways to to customize your code, see this doc to learn more
+https://docs.amplication.com/how-to/custom-code
+
+------------------------------------------------------------------------------
+ */
+import * as graphql from "@nestjs/graphql";
+import { GraphQLError } from "graphql";
+import { isRecordNotFoundError } from "../../prisma.util";
+import { MetaQueryPayload } from "../../util/MetaQueryPayload";
+import { Banking } from "./Banking";
+import { BankingCountArgs } from "./BankingCountArgs";
+import { BankingFindManyArgs } from "./BankingFindManyArgs";
+import { BankingFindUniqueArgs } from "./BankingFindUniqueArgs";
+import { CreateBankingArgs } from "./CreateBankingArgs";
+import { UpdateBankingArgs } from "./UpdateBankingArgs";
+import { DeleteBankingArgs } from "./DeleteBankingArgs";
+import { BankingService } from "../banking.service";
+@graphql.Resolver(() => Banking)
+export class BankingResolverBase {
+ constructor(protected readonly service: BankingService) {}
+
+ async _bankingsMeta(
+ @graphql.Args() args: BankingCountArgs
+ ): Promise {
+ const result = await this.service.count(args);
+ return {
+ count: result,
+ };
+ }
+
+ @graphql.Query(() => [Banking])
+ async bankings(
+ @graphql.Args() args: BankingFindManyArgs
+ ): Promise {
+ return this.service.bankings(args);
+ }
+
+ @graphql.Query(() => Banking, { nullable: true })
+ async banking(
+ @graphql.Args() args: BankingFindUniqueArgs
+ ): Promise {
+ const result = await this.service.banking(args);
+ if (result === null) {
+ return null;
+ }
+ return result;
+ }
+
+ @graphql.Mutation(() => Banking)
+ async createBanking(
+ @graphql.Args() args: CreateBankingArgs
+ ): Promise {
+ return await this.service.createBanking({
+ ...args,
+ data: args.data,
+ });
+ }
+
+ @graphql.Mutation(() => Banking)
+ async updateBanking(
+ @graphql.Args() args: UpdateBankingArgs
+ ): Promise {
+ try {
+ return await this.service.updateBanking({
+ ...args,
+ data: args.data,
+ });
+ } catch (error) {
+ if (isRecordNotFoundError(error)) {
+ throw new GraphQLError(
+ `No resource was found for ${JSON.stringify(args.where)}`
+ );
+ }
+ throw error;
+ }
+ }
+
+ @graphql.Mutation(() => Banking)
+ async deleteBanking(
+ @graphql.Args() args: DeleteBankingArgs
+ ): Promise {
+ try {
+ return await this.service.deleteBanking(args);
+ } catch (error) {
+ if (isRecordNotFoundError(error)) {
+ throw new GraphQLError(
+ `No resource was found for ${JSON.stringify(args.where)}`
+ );
+ }
+ throw error;
+ }
+ }
+}
diff --git a/apps/maestri-edu-server/src/banking/base/banking.service.base.ts b/apps/maestri-edu-server/src/banking/base/banking.service.base.ts
new file mode 100644
index 0000000..d17aeb4
--- /dev/null
+++ b/apps/maestri-edu-server/src/banking/base/banking.service.base.ts
@@ -0,0 +1,39 @@
+/*
+------------------------------------------------------------------------------
+This code was generated by Amplication.
+
+Changes to this file will be lost if the code is regenerated.
+
+There are other ways to to customize your code, see this doc to learn more
+https://docs.amplication.com/how-to/custom-code
+
+------------------------------------------------------------------------------
+ */
+import { PrismaService } from "../../prisma/prisma.service";
+import { Prisma, Banking as PrismaBanking } from "@prisma/client";
+
+export class BankingServiceBase {
+ constructor(protected readonly prisma: PrismaService) {}
+
+ async count(args: Omit): Promise {
+ return this.prisma.banking.count(args);
+ }
+
+ async bankings(args: Prisma.BankingFindManyArgs): Promise {
+ return this.prisma.banking.findMany(args);
+ }
+ async banking(
+ args: Prisma.BankingFindUniqueArgs
+ ): Promise {
+ return this.prisma.banking.findUnique(args);
+ }
+ async createBanking(args: Prisma.BankingCreateArgs): Promise {
+ return this.prisma.banking.create(args);
+ }
+ async updateBanking(args: Prisma.BankingUpdateArgs): Promise {
+ return this.prisma.banking.update(args);
+ }
+ async deleteBanking(args: Prisma.BankingDeleteArgs): Promise {
+ return this.prisma.banking.delete(args);
+ }
+}
diff --git a/apps/maestri-edu-server/src/classificacao/base/Classificacao.ts b/apps/maestri-edu-server/src/classificacao/base/Classificacao.ts
new file mode 100644
index 0000000..67533bf
--- /dev/null
+++ b/apps/maestri-edu-server/src/classificacao/base/Classificacao.ts
@@ -0,0 +1,44 @@
+/*
+------------------------------------------------------------------------------
+This code was generated by Amplication.
+
+Changes to this file will be lost if the code is regenerated.
+
+There are other ways to to customize your code, see this doc to learn more
+https://docs.amplication.com/how-to/custom-code
+
+------------------------------------------------------------------------------
+ */
+import { ObjectType, Field } from "@nestjs/graphql";
+import { ApiProperty } from "@nestjs/swagger";
+import { IsDate, IsString } from "class-validator";
+import { Type } from "class-transformer";
+
+@ObjectType()
+class Classificacao {
+ @ApiProperty({
+ required: true,
+ })
+ @IsDate()
+ @Type(() => Date)
+ @Field(() => Date)
+ createdAt!: Date;
+
+ @ApiProperty({
+ required: true,
+ type: String,
+ })
+ @IsString()
+ @Field(() => String)
+ id!: string;
+
+ @ApiProperty({
+ required: true,
+ })
+ @IsDate()
+ @Type(() => Date)
+ @Field(() => Date)
+ updatedAt!: Date;
+}
+
+export { Classificacao as Classificacao };
diff --git a/apps/maestri-edu-server/src/classificacao/base/ClassificacaoCountArgs.ts b/apps/maestri-edu-server/src/classificacao/base/ClassificacaoCountArgs.ts
new file mode 100644
index 0000000..bf2d78a
--- /dev/null
+++ b/apps/maestri-edu-server/src/classificacao/base/ClassificacaoCountArgs.ts
@@ -0,0 +1,28 @@
+/*
+------------------------------------------------------------------------------
+This code was generated by Amplication.
+
+Changes to this file will be lost if the code is regenerated.
+
+There are other ways to to customize your code, see this doc to learn more
+https://docs.amplication.com/how-to/custom-code
+
+------------------------------------------------------------------------------
+ */
+import { ArgsType, Field } from "@nestjs/graphql";
+import { ApiProperty } from "@nestjs/swagger";
+import { ClassificacaoWhereInput } from "./ClassificacaoWhereInput";
+import { Type } from "class-transformer";
+
+@ArgsType()
+class ClassificacaoCountArgs {
+ @ApiProperty({
+ required: false,
+ type: () => ClassificacaoWhereInput,
+ })
+ @Field(() => ClassificacaoWhereInput, { nullable: true })
+ @Type(() => ClassificacaoWhereInput)
+ where?: ClassificacaoWhereInput;
+}
+
+export { ClassificacaoCountArgs as ClassificacaoCountArgs };
diff --git a/apps/maestri-edu-server/src/classificacao/base/ClassificacaoCreateInput.ts b/apps/maestri-edu-server/src/classificacao/base/ClassificacaoCreateInput.ts
new file mode 100644
index 0000000..8e13dd8
--- /dev/null
+++ b/apps/maestri-edu-server/src/classificacao/base/ClassificacaoCreateInput.ts
@@ -0,0 +1,13 @@
+/*
+------------------------------------------------------------------------------
+This code was generated by Amplication.
+
+Changes to this file will be lost if the code is regenerated.
+
+There are other ways to to customize your code, see this doc to learn more
+https://docs.amplication.com/how-to/custom-code
+
+------------------------------------------------------------------------------
+ */
+class ClassificacaoCreateInput {}
+export { ClassificacaoCreateInput as ClassificacaoCreateInput };
diff --git a/apps/maestri-edu-server/src/classificacao/base/ClassificacaoFindManyArgs.ts b/apps/maestri-edu-server/src/classificacao/base/ClassificacaoFindManyArgs.ts
new file mode 100644
index 0000000..92d5e04
--- /dev/null
+++ b/apps/maestri-edu-server/src/classificacao/base/ClassificacaoFindManyArgs.ts
@@ -0,0 +1,62 @@
+/*
+------------------------------------------------------------------------------
+This code was generated by Amplication.
+
+Changes to this file will be lost if the code is regenerated.
+
+There are other ways to to customize your code, see this doc to learn more
+https://docs.amplication.com/how-to/custom-code
+
+------------------------------------------------------------------------------
+ */
+import { ArgsType, Field } from "@nestjs/graphql";
+import { ApiProperty } from "@nestjs/swagger";
+import { ClassificacaoWhereInput } from "./ClassificacaoWhereInput";
+import { IsOptional, ValidateNested, IsInt } from "class-validator";
+import { Type } from "class-transformer";
+import { ClassificacaoOrderByInput } from "./ClassificacaoOrderByInput";
+
+@ArgsType()
+class ClassificacaoFindManyArgs {
+ @ApiProperty({
+ required: false,
+ type: () => ClassificacaoWhereInput,
+ })
+ @IsOptional()
+ @ValidateNested()
+ @Field(() => ClassificacaoWhereInput, { nullable: true })
+ @Type(() => ClassificacaoWhereInput)
+ where?: ClassificacaoWhereInput;
+
+ @ApiProperty({
+ required: false,
+ type: [ClassificacaoOrderByInput],
+ })
+ @IsOptional()
+ @ValidateNested({ each: true })
+ @Field(() => [ClassificacaoOrderByInput], { nullable: true })
+ @Type(() => ClassificacaoOrderByInput)
+ orderBy?: Array;
+
+ @ApiProperty({
+ required: false,
+ type: Number,
+ })
+ @IsOptional()
+ @IsInt()
+ @Field(() => Number, { nullable: true })
+ @Type(() => Number)
+ skip?: number;
+
+ @ApiProperty({
+ required: false,
+ type: Number,
+ })
+ @IsOptional()
+ @IsInt()
+ @Field(() => Number, { nullable: true })
+ @Type(() => Number)
+ take?: number;
+}
+
+export { ClassificacaoFindManyArgs as ClassificacaoFindManyArgs };
diff --git a/apps/maestri-edu-server/src/classificacao/base/ClassificacaoFindUniqueArgs.ts b/apps/maestri-edu-server/src/classificacao/base/ClassificacaoFindUniqueArgs.ts
new file mode 100644
index 0000000..f2fb4bb
--- /dev/null
+++ b/apps/maestri-edu-server/src/classificacao/base/ClassificacaoFindUniqueArgs.ts
@@ -0,0 +1,30 @@
+/*
+------------------------------------------------------------------------------
+This code was generated by Amplication.
+
+Changes to this file will be lost if the code is regenerated.
+
+There are other ways to to customize your code, see this doc to learn more
+https://docs.amplication.com/how-to/custom-code
+
+------------------------------------------------------------------------------
+ */
+import { ArgsType, Field } from "@nestjs/graphql";
+import { ApiProperty } from "@nestjs/swagger";
+import { ClassificacaoWhereUniqueInput } from "./ClassificacaoWhereUniqueInput";
+import { ValidateNested } from "class-validator";
+import { Type } from "class-transformer";
+
+@ArgsType()
+class ClassificacaoFindUniqueArgs {
+ @ApiProperty({
+ required: true,
+ type: () => ClassificacaoWhereUniqueInput,
+ })
+ @ValidateNested()
+ @Type(() => ClassificacaoWhereUniqueInput)
+ @Field(() => ClassificacaoWhereUniqueInput, { nullable: false })
+ where!: ClassificacaoWhereUniqueInput;
+}
+
+export { ClassificacaoFindUniqueArgs as ClassificacaoFindUniqueArgs };
diff --git a/apps/maestri-edu-server/src/classificacao/base/ClassificacaoListRelationFilter.ts b/apps/maestri-edu-server/src/classificacao/base/ClassificacaoListRelationFilter.ts
new file mode 100644
index 0000000..36e1bd3
--- /dev/null
+++ b/apps/maestri-edu-server/src/classificacao/base/ClassificacaoListRelationFilter.ts
@@ -0,0 +1,56 @@
+/*
+------------------------------------------------------------------------------
+This code was generated by Amplication.
+
+Changes to this file will be lost if the code is regenerated.
+
+There are other ways to to customize your code, see this doc to learn more
+https://docs.amplication.com/how-to/custom-code
+
+------------------------------------------------------------------------------
+ */
+import { InputType, Field } from "@nestjs/graphql";
+import { ApiProperty } from "@nestjs/swagger";
+import { ClassificacaoWhereInput } from "./ClassificacaoWhereInput";
+import { ValidateNested, IsOptional } from "class-validator";
+import { Type } from "class-transformer";
+
+@InputType()
+class ClassificacaoListRelationFilter {
+ @ApiProperty({
+ required: false,
+ type: () => ClassificacaoWhereInput,
+ })
+ @ValidateNested()
+ @Type(() => ClassificacaoWhereInput)
+ @IsOptional()
+ @Field(() => ClassificacaoWhereInput, {
+ nullable: true,
+ })
+ every?: ClassificacaoWhereInput;
+
+ @ApiProperty({
+ required: false,
+ type: () => ClassificacaoWhereInput,
+ })
+ @ValidateNested()
+ @Type(() => ClassificacaoWhereInput)
+ @IsOptional()
+ @Field(() => ClassificacaoWhereInput, {
+ nullable: true,
+ })
+ some?: ClassificacaoWhereInput;
+
+ @ApiProperty({
+ required: false,
+ type: () => ClassificacaoWhereInput,
+ })
+ @ValidateNested()
+ @Type(() => ClassificacaoWhereInput)
+ @IsOptional()
+ @Field(() => ClassificacaoWhereInput, {
+ nullable: true,
+ })
+ none?: ClassificacaoWhereInput;
+}
+export { ClassificacaoListRelationFilter as ClassificacaoListRelationFilter };
diff --git a/apps/maestri-edu-server/src/classificacao/base/ClassificacaoOrderByInput.ts b/apps/maestri-edu-server/src/classificacao/base/ClassificacaoOrderByInput.ts
new file mode 100644
index 0000000..88fa7aa
--- /dev/null
+++ b/apps/maestri-edu-server/src/classificacao/base/ClassificacaoOrderByInput.ts
@@ -0,0 +1,56 @@
+/*
+------------------------------------------------------------------------------
+This code was generated by Amplication.
+
+Changes to this file will be lost if the code is regenerated.
+
+There are other ways to to customize your code, see this doc to learn more
+https://docs.amplication.com/how-to/custom-code
+
+------------------------------------------------------------------------------
+ */
+import { InputType, Field } from "@nestjs/graphql";
+import { ApiProperty } from "@nestjs/swagger";
+import { IsOptional, IsEnum } from "class-validator";
+import { SortOrder } from "../../util/SortOrder";
+
+@InputType({
+ isAbstract: true,
+ description: undefined,
+})
+class ClassificacaoOrderByInput {
+ @ApiProperty({
+ required: false,
+ enum: ["asc", "desc"],
+ })
+ @IsOptional()
+ @IsEnum(SortOrder)
+ @Field(() => SortOrder, {
+ nullable: true,
+ })
+ createdAt?: SortOrder;
+
+ @ApiProperty({
+ required: false,
+ enum: ["asc", "desc"],
+ })
+ @IsOptional()
+ @IsEnum(SortOrder)
+ @Field(() => SortOrder, {
+ nullable: true,
+ })
+ id?: SortOrder;
+
+ @ApiProperty({
+ required: false,
+ enum: ["asc", "desc"],
+ })
+ @IsOptional()
+ @IsEnum(SortOrder)
+ @Field(() => SortOrder, {
+ nullable: true,
+ })
+ updatedAt?: SortOrder;
+}
+
+export { ClassificacaoOrderByInput as ClassificacaoOrderByInput };
diff --git a/apps/maestri-edu-server/src/classificacao/base/ClassificacaoUpdateInput.ts b/apps/maestri-edu-server/src/classificacao/base/ClassificacaoUpdateInput.ts
new file mode 100644
index 0000000..633ca7d
--- /dev/null
+++ b/apps/maestri-edu-server/src/classificacao/base/ClassificacaoUpdateInput.ts
@@ -0,0 +1,13 @@
+/*
+------------------------------------------------------------------------------
+This code was generated by Amplication.
+
+Changes to this file will be lost if the code is regenerated.
+
+There are other ways to to customize your code, see this doc to learn more
+https://docs.amplication.com/how-to/custom-code
+
+------------------------------------------------------------------------------
+ */
+class ClassificacaoUpdateInput {}
+export { ClassificacaoUpdateInput as ClassificacaoUpdateInput };
diff --git a/apps/maestri-edu-server/src/classificacao/base/ClassificacaoWhereInput.ts b/apps/maestri-edu-server/src/classificacao/base/ClassificacaoWhereInput.ts
new file mode 100644
index 0000000..a49200f
--- /dev/null
+++ b/apps/maestri-edu-server/src/classificacao/base/ClassificacaoWhereInput.ts
@@ -0,0 +1,32 @@
+/*
+------------------------------------------------------------------------------
+This code was generated by Amplication.
+
+Changes to this file will be lost if the code is regenerated.
+
+There are other ways to to customize your code, see this doc to learn more
+https://docs.amplication.com/how-to/custom-code
+
+------------------------------------------------------------------------------
+ */
+import { InputType, Field } from "@nestjs/graphql";
+import { ApiProperty } from "@nestjs/swagger";
+import { StringFilter } from "../../util/StringFilter";
+import { Type } from "class-transformer";
+import { IsOptional } from "class-validator";
+
+@InputType()
+class ClassificacaoWhereInput {
+ @ApiProperty({
+ required: false,
+ type: StringFilter,
+ })
+ @Type(() => StringFilter)
+ @IsOptional()
+ @Field(() => StringFilter, {
+ nullable: true,
+ })
+ id?: StringFilter;
+}
+
+export { ClassificacaoWhereInput as ClassificacaoWhereInput };
diff --git a/apps/maestri-edu-server/src/classificacao/base/ClassificacaoWhereUniqueInput.ts b/apps/maestri-edu-server/src/classificacao/base/ClassificacaoWhereUniqueInput.ts
new file mode 100644
index 0000000..e6b97c8
--- /dev/null
+++ b/apps/maestri-edu-server/src/classificacao/base/ClassificacaoWhereUniqueInput.ts
@@ -0,0 +1,27 @@
+/*
+------------------------------------------------------------------------------
+This code was generated by Amplication.
+
+Changes to this file will be lost if the code is regenerated.
+
+There are other ways to to customize your code, see this doc to learn more
+https://docs.amplication.com/how-to/custom-code
+
+------------------------------------------------------------------------------
+ */
+import { InputType, Field } from "@nestjs/graphql";
+import { ApiProperty } from "@nestjs/swagger";
+import { IsString } from "class-validator";
+
+@InputType()
+class ClassificacaoWhereUniqueInput {
+ @ApiProperty({
+ required: true,
+ type: String,
+ })
+ @IsString()
+ @Field(() => String)
+ id!: string;
+}
+
+export { ClassificacaoWhereUniqueInput as ClassificacaoWhereUniqueInput };
diff --git a/apps/maestri-edu-server/src/classificacao/base/DeleteClassificacaoArgs.ts b/apps/maestri-edu-server/src/classificacao/base/DeleteClassificacaoArgs.ts
new file mode 100644
index 0000000..edd4f76
--- /dev/null
+++ b/apps/maestri-edu-server/src/classificacao/base/DeleteClassificacaoArgs.ts
@@ -0,0 +1,30 @@
+/*
+------------------------------------------------------------------------------
+This code was generated by Amplication.
+
+Changes to this file will be lost if the code is regenerated.
+
+There are other ways to to customize your code, see this doc to learn more
+https://docs.amplication.com/how-to/custom-code
+
+------------------------------------------------------------------------------
+ */
+import { ArgsType, Field } from "@nestjs/graphql";
+import { ApiProperty } from "@nestjs/swagger";
+import { ClassificacaoWhereUniqueInput } from "./ClassificacaoWhereUniqueInput";
+import { ValidateNested } from "class-validator";
+import { Type } from "class-transformer";
+
+@ArgsType()
+class DeleteClassificacaoArgs {
+ @ApiProperty({
+ required: true,
+ type: () => ClassificacaoWhereUniqueInput,
+ })
+ @ValidateNested()
+ @Type(() => ClassificacaoWhereUniqueInput)
+ @Field(() => ClassificacaoWhereUniqueInput, { nullable: false })
+ where!: ClassificacaoWhereUniqueInput;
+}
+
+export { DeleteClassificacaoArgs as DeleteClassificacaoArgs };
diff --git a/apps/maestri-edu-server/src/classificacao/base/classificacao.controller.base.spec.ts b/apps/maestri-edu-server/src/classificacao/base/classificacao.controller.base.spec.ts
new file mode 100644
index 0000000..6ccabcc
--- /dev/null
+++ b/apps/maestri-edu-server/src/classificacao/base/classificacao.controller.base.spec.ts
@@ -0,0 +1,190 @@
+import { Test } from "@nestjs/testing";
+import {
+ INestApplication,
+ HttpStatus,
+ ExecutionContext,
+ CallHandler,
+} from "@nestjs/common";
+import request from "supertest";
+import { ACGuard } from "nest-access-control";
+import { DefaultAuthGuard } from "../../auth/defaultAuth.guard";
+import { ACLModule } from "../../auth/acl.module";
+import { AclFilterResponseInterceptor } from "../../interceptors/aclFilterResponse.interceptor";
+import { AclValidateRequestInterceptor } from "../../interceptors/aclValidateRequest.interceptor";
+import { map } from "rxjs";
+import { ClassificacaoController } from "../classificacao.controller";
+import { ClassificacaoService } from "../classificacao.service";
+
+const nonExistingId = "nonExistingId";
+const existingId = "existingId";
+const CREATE_INPUT = {
+ createdAt: new Date(),
+ id: "exampleId",
+ updatedAt: new Date(),
+};
+const CREATE_RESULT = {
+ createdAt: new Date(),
+ id: "exampleId",
+ updatedAt: new Date(),
+};
+const FIND_MANY_RESULT = [
+ {
+ createdAt: new Date(),
+ id: "exampleId",
+ updatedAt: new Date(),
+ },
+];
+const FIND_ONE_RESULT = {
+ createdAt: new Date(),
+ id: "exampleId",
+ updatedAt: new Date(),
+};
+
+const service = {
+ createClassificacao() {
+ return CREATE_RESULT;
+ },
+ classificacaos: () => FIND_MANY_RESULT,
+ classificacao: ({ where }: { where: { id: string } }) => {
+ switch (where.id) {
+ case existingId:
+ return FIND_ONE_RESULT;
+ case nonExistingId:
+ return null;
+ }
+ },
+};
+
+const basicAuthGuard = {
+ canActivate: (context: ExecutionContext) => {
+ const argumentHost = context.switchToHttp();
+ const request = argumentHost.getRequest();
+ request.user = {
+ roles: ["user"],
+ };
+ return true;
+ },
+};
+
+const acGuard = {
+ canActivate: () => {
+ return true;
+ },
+};
+
+const aclFilterResponseInterceptor = {
+ intercept: (context: ExecutionContext, next: CallHandler) => {
+ return next.handle().pipe(
+ map((data) => {
+ return data;
+ })
+ );
+ },
+};
+const aclValidateRequestInterceptor = {
+ intercept: (context: ExecutionContext, next: CallHandler) => {
+ return next.handle();
+ },
+};
+
+describe("Classificacao", () => {
+ let app: INestApplication;
+
+ beforeAll(async () => {
+ const moduleRef = await Test.createTestingModule({
+ providers: [
+ {
+ provide: ClassificacaoService,
+ useValue: service,
+ },
+ ],
+ controllers: [ClassificacaoController],
+ imports: [ACLModule],
+ })
+ .overrideGuard(DefaultAuthGuard)
+ .useValue(basicAuthGuard)
+ .overrideGuard(ACGuard)
+ .useValue(acGuard)
+ .overrideInterceptor(AclFilterResponseInterceptor)
+ .useValue(aclFilterResponseInterceptor)
+ .overrideInterceptor(AclValidateRequestInterceptor)
+ .useValue(aclValidateRequestInterceptor)
+ .compile();
+
+ app = moduleRef.createNestApplication();
+ await app.init();
+ });
+
+ test("POST /classificacaos", async () => {
+ await request(app.getHttpServer())
+ .post("/classificacaos")
+ .send(CREATE_INPUT)
+ .expect(HttpStatus.CREATED)
+ .expect({
+ ...CREATE_RESULT,
+ createdAt: CREATE_RESULT.createdAt.toISOString(),
+ updatedAt: CREATE_RESULT.updatedAt.toISOString(),
+ });
+ });
+
+ test("GET /classificacaos", async () => {
+ await request(app.getHttpServer())
+ .get("/classificacaos")
+ .expect(HttpStatus.OK)
+ .expect([
+ {
+ ...FIND_MANY_RESULT[0],
+ createdAt: FIND_MANY_RESULT[0].createdAt.toISOString(),
+ updatedAt: FIND_MANY_RESULT[0].updatedAt.toISOString(),
+ },
+ ]);
+ });
+
+ test("GET /classificacaos/:id non existing", async () => {
+ await request(app.getHttpServer())
+ .get(`${"/classificacaos"}/${nonExistingId}`)
+ .expect(HttpStatus.NOT_FOUND)
+ .expect({
+ statusCode: HttpStatus.NOT_FOUND,
+ message: `No resource was found for {"${"id"}":"${nonExistingId}"}`,
+ error: "Not Found",
+ });
+ });
+
+ test("GET /classificacaos/:id existing", async () => {
+ await request(app.getHttpServer())
+ .get(`${"/classificacaos"}/${existingId}`)
+ .expect(HttpStatus.OK)
+ .expect({
+ ...FIND_ONE_RESULT,
+ createdAt: FIND_ONE_RESULT.createdAt.toISOString(),
+ updatedAt: FIND_ONE_RESULT.updatedAt.toISOString(),
+ });
+ });
+
+ test("POST /classificacaos existing resource", async () => {
+ const agent = request(app.getHttpServer());
+ await agent
+ .post("/classificacaos")
+ .send(CREATE_INPUT)
+ .expect(HttpStatus.CREATED)
+ .expect({
+ ...CREATE_RESULT,
+ createdAt: CREATE_RESULT.createdAt.toISOString(),
+ updatedAt: CREATE_RESULT.updatedAt.toISOString(),
+ })
+ .then(function () {
+ agent
+ .post("/classificacaos")
+ .send(CREATE_INPUT)
+ .expect(HttpStatus.CONFLICT)
+ .expect({
+ statusCode: HttpStatus.CONFLICT,
+ });
+ });
+ });
+
+ afterAll(async () => {
+ await app.close();
+ });
+});
diff --git a/apps/maestri-edu-server/src/classificacao/base/classificacao.controller.base.ts b/apps/maestri-edu-server/src/classificacao/base/classificacao.controller.base.ts
new file mode 100644
index 0000000..49bf3c4
--- /dev/null
+++ b/apps/maestri-edu-server/src/classificacao/base/classificacao.controller.base.ts
@@ -0,0 +1,133 @@
+/*
+------------------------------------------------------------------------------
+This code was generated by Amplication.
+
+Changes to this file will be lost if the code is regenerated.
+
+There are other ways to to customize your code, see this doc to learn more
+https://docs.amplication.com/how-to/custom-code
+
+------------------------------------------------------------------------------
+ */
+import * as common from "@nestjs/common";
+import * as swagger from "@nestjs/swagger";
+import { isRecordNotFoundError } from "../../prisma.util";
+import * as errors from "../../errors";
+import { Request } from "express";
+import { plainToClass } from "class-transformer";
+import { ApiNestedQuery } from "../../decorators/api-nested-query.decorator";
+import { ClassificacaoService } from "../classificacao.service";
+import { ClassificacaoCreateInput } from "./ClassificacaoCreateInput";
+import { Classificacao } from "./Classificacao";
+import { ClassificacaoFindManyArgs } from "./ClassificacaoFindManyArgs";
+import { ClassificacaoWhereUniqueInput } from "./ClassificacaoWhereUniqueInput";
+import { ClassificacaoUpdateInput } from "./ClassificacaoUpdateInput";
+
+export class ClassificacaoControllerBase {
+ constructor(protected readonly service: ClassificacaoService) {}
+ @common.Post()
+ @swagger.ApiCreatedResponse({ type: Classificacao })
+ async createClassificacao(
+ @common.Body() data: ClassificacaoCreateInput
+ ): Promise {
+ return await this.service.createClassificacao({
+ data: data,
+ select: {
+ createdAt: true,
+ id: true,
+ updatedAt: true,
+ },
+ });
+ }
+
+ @common.Get()
+ @swagger.ApiOkResponse({ type: [Classificacao] })
+ @ApiNestedQuery(ClassificacaoFindManyArgs)
+ async classificacaos(
+ @common.Req() request: Request
+ ): Promise {
+ const args = plainToClass(ClassificacaoFindManyArgs, request.query);
+ return this.service.classificacaos({
+ ...args,
+ select: {
+ createdAt: true,
+ id: true,
+ updatedAt: true,
+ },
+ });
+ }
+
+ @common.Get("/:id")
+ @swagger.ApiOkResponse({ type: Classificacao })
+ @swagger.ApiNotFoundResponse({ type: errors.NotFoundException })
+ async classificacao(
+ @common.Param() params: ClassificacaoWhereUniqueInput
+ ): Promise {
+ const result = await this.service.classificacao({
+ where: params,
+ select: {
+ createdAt: true,
+ id: true,
+ updatedAt: true,
+ },
+ });
+ if (result === null) {
+ throw new errors.NotFoundException(
+ `No resource was found for ${JSON.stringify(params)}`
+ );
+ }
+ return result;
+ }
+
+ @common.Patch("/:id")
+ @swagger.ApiOkResponse({ type: Classificacao })
+ @swagger.ApiNotFoundResponse({ type: errors.NotFoundException })
+ async updateClassificacao(
+ @common.Param() params: ClassificacaoWhereUniqueInput,
+ @common.Body() data: ClassificacaoUpdateInput
+ ): Promise {
+ try {
+ return await this.service.updateClassificacao({
+ where: params,
+ data: data,
+ select: {
+ createdAt: true,
+ id: true,
+ updatedAt: true,
+ },
+ });
+ } catch (error) {
+ if (isRecordNotFoundError(error)) {
+ throw new errors.NotFoundException(
+ `No resource was found for ${JSON.stringify(params)}`
+ );
+ }
+ throw error;
+ }
+ }
+
+ @common.Delete("/:id")
+ @swagger.ApiOkResponse({ type: Classificacao })
+ @swagger.ApiNotFoundResponse({ type: errors.NotFoundException })
+ async deleteClassificacao(
+ @common.Param() params: ClassificacaoWhereUniqueInput
+ ): Promise {
+ try {
+ return await this.service.deleteClassificacao({
+ where: params,
+ select: {
+ createdAt: true,
+ id: true,
+ updatedAt: true,
+ },
+ });
+ } catch (error) {
+ if (isRecordNotFoundError(error)) {
+ throw new errors.NotFoundException(
+ `No resource was found for ${JSON.stringify(params)}`
+ );
+ }
+ throw error;
+ }
+ }
+}
diff --git a/apps/maestri-edu-server/src/classificacao/base/classificacao.module.base.ts b/apps/maestri-edu-server/src/classificacao/base/classificacao.module.base.ts
new file mode 100644
index 0000000..39fc47a
--- /dev/null
+++ b/apps/maestri-edu-server/src/classificacao/base/classificacao.module.base.ts
@@ -0,0 +1,18 @@
+/*
+------------------------------------------------------------------------------
+This code was generated by Amplication.
+
+Changes to this file will be lost if the code is regenerated.
+
+There are other ways to to customize your code, see this doc to learn more
+https://docs.amplication.com/how-to/custom-code
+
+------------------------------------------------------------------------------
+ */
+import { Module } from "@nestjs/common";
+
+@Module({
+ imports: [],
+ exports: [],
+})
+export class ClassificacaoModuleBase {}
diff --git a/apps/maestri-edu-server/src/classificacao/base/classificacao.resolver.base.ts b/apps/maestri-edu-server/src/classificacao/base/classificacao.resolver.base.ts
new file mode 100644
index 0000000..5d9b0aa
--- /dev/null
+++ b/apps/maestri-edu-server/src/classificacao/base/classificacao.resolver.base.ts
@@ -0,0 +1,68 @@
+/*
+------------------------------------------------------------------------------
+This code was generated by Amplication.
+
+Changes to this file will be lost if the code is regenerated.
+
+There are other ways to to customize your code, see this doc to learn more
+https://docs.amplication.com/how-to/custom-code
+
+------------------------------------------------------------------------------
+ */
+import * as graphql from "@nestjs/graphql";
+import { GraphQLError } from "graphql";
+import { isRecordNotFoundError } from "../../prisma.util";
+import { MetaQueryPayload } from "../../util/MetaQueryPayload";
+import { Classificacao } from "./Classificacao";
+import { ClassificacaoCountArgs } from "./ClassificacaoCountArgs";
+import { ClassificacaoFindManyArgs } from "./ClassificacaoFindManyArgs";
+import { ClassificacaoFindUniqueArgs } from "./ClassificacaoFindUniqueArgs";
+import { DeleteClassificacaoArgs } from "./DeleteClassificacaoArgs";
+import { ClassificacaoService } from "../classificacao.service";
+@graphql.Resolver(() => Classificacao)
+export class ClassificacaoResolverBase {
+ constructor(protected readonly service: ClassificacaoService) {}
+
+ async _classificacaosMeta(
+ @graphql.Args() args: ClassificacaoCountArgs
+ ): Promise {
+ const result = await this.service.count(args);
+ return {
+ count: result,
+ };
+ }
+
+ @graphql.Query(() => [Classificacao])
+ async classificacaos(
+ @graphql.Args() args: ClassificacaoFindManyArgs
+ ): Promise {
+ return this.service.classificacaos(args);
+ }
+
+ @graphql.Query(() => Classificacao, { nullable: true })
+ async classificacao(
+ @graphql.Args() args: ClassificacaoFindUniqueArgs
+ ): Promise {
+ const result = await this.service.classificacao(args);
+ if (result === null) {
+ return null;
+ }
+ return result;
+ }
+
+ @graphql.Mutation(() => Classificacao)
+ async deleteClassificacao(
+ @graphql.Args() args: DeleteClassificacaoArgs
+ ): Promise {
+ try {
+ return await this.service.deleteClassificacao(args);
+ } catch (error) {
+ if (isRecordNotFoundError(error)) {
+ throw new GraphQLError(
+ `No resource was found for ${JSON.stringify(args.where)}`
+ );
+ }
+ throw error;
+ }
+ }
+}
diff --git a/apps/maestri-edu-server/src/classificacao/base/classificacao.service.base.ts b/apps/maestri-edu-server/src/classificacao/base/classificacao.service.base.ts
new file mode 100644
index 0000000..16a0c95
--- /dev/null
+++ b/apps/maestri-edu-server/src/classificacao/base/classificacao.service.base.ts
@@ -0,0 +1,49 @@
+/*
+------------------------------------------------------------------------------
+This code was generated by Amplication.
+
+Changes to this file will be lost if the code is regenerated.
+
+There are other ways to to customize your code, see this doc to learn more
+https://docs.amplication.com/how-to/custom-code
+
+------------------------------------------------------------------------------
+ */
+import { PrismaService } from "../../prisma/prisma.service";
+import { Prisma, Classificacao as PrismaClassificacao } from "@prisma/client";
+
+export class ClassificacaoServiceBase {
+ constructor(protected readonly prisma: PrismaService) {}
+
+ async count(
+ args: Omit
+ ): Promise {
+ return this.prisma.classificacao.count(args);
+ }
+
+ async classificacaos(
+ args: Prisma.ClassificacaoFindManyArgs
+ ): Promise {
+ return this.prisma.classificacao.findMany(args);
+ }
+ async classificacao(
+ args: Prisma.ClassificacaoFindUniqueArgs
+ ): Promise {
+ return this.prisma.classificacao.findUnique(args);
+ }
+ async createClassificacao(
+ args: Prisma.ClassificacaoCreateArgs
+ ): Promise {
+ return this.prisma.classificacao.create(args);
+ }
+ async updateClassificacao(
+ args: Prisma.ClassificacaoUpdateArgs
+ ): Promise {
+ return this.prisma.classificacao.update(args);
+ }
+ async deleteClassificacao(
+ args: Prisma.ClassificacaoDeleteArgs
+ ): Promise {
+ return this.prisma.classificacao.delete(args);
+ }
+}
diff --git a/apps/maestri-edu-server/src/classificacao/classificacao.controller.ts b/apps/maestri-edu-server/src/classificacao/classificacao.controller.ts
new file mode 100644
index 0000000..f0ac4b9
--- /dev/null
+++ b/apps/maestri-edu-server/src/classificacao/classificacao.controller.ts
@@ -0,0 +1,12 @@
+import * as common from "@nestjs/common";
+import * as swagger from "@nestjs/swagger";
+import { ClassificacaoService } from "./classificacao.service";
+import { ClassificacaoControllerBase } from "./base/classificacao.controller.base";
+
+@swagger.ApiTags("classificacaos")
+@common.Controller("classificacaos")
+export class ClassificacaoController extends ClassificacaoControllerBase {
+ constructor(protected readonly service: ClassificacaoService) {
+ super(service);
+ }
+}
diff --git a/apps/maestri-edu-server/src/classificacao/classificacao.module.ts b/apps/maestri-edu-server/src/classificacao/classificacao.module.ts
new file mode 100644
index 0000000..4a04f99
--- /dev/null
+++ b/apps/maestri-edu-server/src/classificacao/classificacao.module.ts
@@ -0,0 +1,13 @@
+import { Module } from "@nestjs/common";
+import { ClassificacaoModuleBase } from "./base/classificacao.module.base";
+import { ClassificacaoService } from "./classificacao.service";
+import { ClassificacaoController } from "./classificacao.controller";
+import { ClassificacaoResolver } from "./classificacao.resolver";
+
+@Module({
+ imports: [ClassificacaoModuleBase],
+ controllers: [ClassificacaoController],
+ providers: [ClassificacaoService, ClassificacaoResolver],
+ exports: [ClassificacaoService],
+})
+export class ClassificacaoModule {}
diff --git a/apps/maestri-edu-server/src/classificacao/classificacao.resolver.ts b/apps/maestri-edu-server/src/classificacao/classificacao.resolver.ts
new file mode 100644
index 0000000..3777a56
--- /dev/null
+++ b/apps/maestri-edu-server/src/classificacao/classificacao.resolver.ts
@@ -0,0 +1,11 @@
+import * as graphql from "@nestjs/graphql";
+import { ClassificacaoResolverBase } from "./base/classificacao.resolver.base";
+import { Classificacao } from "./base/Classificacao";
+import { ClassificacaoService } from "./classificacao.service";
+
+@graphql.Resolver(() => Classificacao)
+export class ClassificacaoResolver extends ClassificacaoResolverBase {
+ constructor(protected readonly service: ClassificacaoService) {
+ super(service);
+ }
+}
diff --git a/apps/maestri-edu-server/src/classificacao/classificacao.service.ts b/apps/maestri-edu-server/src/classificacao/classificacao.service.ts
new file mode 100644
index 0000000..f744c99
--- /dev/null
+++ b/apps/maestri-edu-server/src/classificacao/classificacao.service.ts
@@ -0,0 +1,10 @@
+import { Injectable } from "@nestjs/common";
+import { PrismaService } from "../prisma/prisma.service";
+import { ClassificacaoServiceBase } from "./base/classificacao.service.base";
+
+@Injectable()
+export class ClassificacaoService extends ClassificacaoServiceBase {
+ constructor(protected readonly prisma: PrismaService) {
+ super(prisma);
+ }
+}
diff --git a/apps/maestri-edu-server/src/cobranca/base/Cobranca.ts b/apps/maestri-edu-server/src/cobranca/base/Cobranca.ts
new file mode 100644
index 0000000..347b3ca
--- /dev/null
+++ b/apps/maestri-edu-server/src/cobranca/base/Cobranca.ts
@@ -0,0 +1,44 @@
+/*
+------------------------------------------------------------------------------
+This code was generated by Amplication.
+
+Changes to this file will be lost if the code is regenerated.
+
+There are other ways to to customize your code, see this doc to learn more
+https://docs.amplication.com/how-to/custom-code
+
+------------------------------------------------------------------------------
+ */
+import { ObjectType, Field } from "@nestjs/graphql";
+import { ApiProperty } from "@nestjs/swagger";
+import { IsDate, IsString } from "class-validator";
+import { Type } from "class-transformer";
+
+@ObjectType()
+class Cobranca {
+ @ApiProperty({
+ required: true,
+ })
+ @IsDate()
+ @Type(() => Date)
+ @Field(() => Date)
+ createdAt!: Date;
+
+ @ApiProperty({
+ required: true,
+ type: String,
+ })
+ @IsString()
+ @Field(() => String)
+ id!: string;
+
+ @ApiProperty({
+ required: true,
+ })
+ @IsDate()
+ @Type(() => Date)
+ @Field(() => Date)
+ updatedAt!: Date;
+}
+
+export { Cobranca as Cobranca };
diff --git a/apps/maestri-edu-server/src/cobranca/base/CobrancaCountArgs.ts b/apps/maestri-edu-server/src/cobranca/base/CobrancaCountArgs.ts
new file mode 100644
index 0000000..6de4fb4
--- /dev/null
+++ b/apps/maestri-edu-server/src/cobranca/base/CobrancaCountArgs.ts
@@ -0,0 +1,28 @@
+/*
+------------------------------------------------------------------------------
+This code was generated by Amplication.
+
+Changes to this file will be lost if the code is regenerated.
+
+There are other ways to to customize your code, see this doc to learn more
+https://docs.amplication.com/how-to/custom-code
+
+------------------------------------------------------------------------------
+ */
+import { ArgsType, Field } from "@nestjs/graphql";
+import { ApiProperty } from "@nestjs/swagger";
+import { CobrancaWhereInput } from "./CobrancaWhereInput";
+import { Type } from "class-transformer";
+
+@ArgsType()
+class CobrancaCountArgs {
+ @ApiProperty({
+ required: false,
+ type: () => CobrancaWhereInput,
+ })
+ @Field(() => CobrancaWhereInput, { nullable: true })
+ @Type(() => CobrancaWhereInput)
+ where?: CobrancaWhereInput;
+}
+
+export { CobrancaCountArgs as CobrancaCountArgs };
diff --git a/apps/maestri-edu-server/src/cobranca/base/CobrancaCreateInput.ts b/apps/maestri-edu-server/src/cobranca/base/CobrancaCreateInput.ts
new file mode 100644
index 0000000..b0ae6b3
--- /dev/null
+++ b/apps/maestri-edu-server/src/cobranca/base/CobrancaCreateInput.ts
@@ -0,0 +1,13 @@
+/*
+------------------------------------------------------------------------------
+This code was generated by Amplication.
+
+Changes to this file will be lost if the code is regenerated.
+
+There are other ways to to customize your code, see this doc to learn more
+https://docs.amplication.com/how-to/custom-code
+
+------------------------------------------------------------------------------
+ */
+class CobrancaCreateInput {}
+export { CobrancaCreateInput as CobrancaCreateInput };
diff --git a/apps/maestri-edu-server/src/cobranca/base/CobrancaFindManyArgs.ts b/apps/maestri-edu-server/src/cobranca/base/CobrancaFindManyArgs.ts
new file mode 100644
index 0000000..267adf4
--- /dev/null
+++ b/apps/maestri-edu-server/src/cobranca/base/CobrancaFindManyArgs.ts
@@ -0,0 +1,62 @@
+/*
+------------------------------------------------------------------------------
+This code was generated by Amplication.
+
+Changes to this file will be lost if the code is regenerated.
+
+There are other ways to to customize your code, see this doc to learn more
+https://docs.amplication.com/how-to/custom-code
+
+------------------------------------------------------------------------------
+ */
+import { ArgsType, Field } from "@nestjs/graphql";
+import { ApiProperty } from "@nestjs/swagger";
+import { CobrancaWhereInput } from "./CobrancaWhereInput";
+import { IsOptional, ValidateNested, IsInt } from "class-validator";
+import { Type } from "class-transformer";
+import { CobrancaOrderByInput } from "./CobrancaOrderByInput";
+
+@ArgsType()
+class CobrancaFindManyArgs {
+ @ApiProperty({
+ required: false,
+ type: () => CobrancaWhereInput,
+ })
+ @IsOptional()
+ @ValidateNested()
+ @Field(() => CobrancaWhereInput, { nullable: true })
+ @Type(() => CobrancaWhereInput)
+ where?: CobrancaWhereInput;
+
+ @ApiProperty({
+ required: false,
+ type: [CobrancaOrderByInput],
+ })
+ @IsOptional()
+ @ValidateNested({ each: true })
+ @Field(() => [CobrancaOrderByInput], { nullable: true })
+ @Type(() => CobrancaOrderByInput)
+ orderBy?: Array;
+
+ @ApiProperty({
+ required: false,
+ type: Number,
+ })
+ @IsOptional()
+ @IsInt()
+ @Field(() => Number, { nullable: true })
+ @Type(() => Number)
+ skip?: number;
+
+ @ApiProperty({
+ required: false,
+ type: Number,
+ })
+ @IsOptional()
+ @IsInt()
+ @Field(() => Number, { nullable: true })
+ @Type(() => Number)
+ take?: number;
+}
+
+export { CobrancaFindManyArgs as CobrancaFindManyArgs };
diff --git a/apps/maestri-edu-server/src/cobranca/base/CobrancaFindUniqueArgs.ts b/apps/maestri-edu-server/src/cobranca/base/CobrancaFindUniqueArgs.ts
new file mode 100644
index 0000000..384f96b
--- /dev/null
+++ b/apps/maestri-edu-server/src/cobranca/base/CobrancaFindUniqueArgs.ts
@@ -0,0 +1,30 @@
+/*
+------------------------------------------------------------------------------
+This code was generated by Amplication.
+
+Changes to this file will be lost if the code is regenerated.
+
+There are other ways to to customize your code, see this doc to learn more
+https://docs.amplication.com/how-to/custom-code
+
+------------------------------------------------------------------------------
+ */
+import { ArgsType, Field } from "@nestjs/graphql";
+import { ApiProperty } from "@nestjs/swagger";
+import { CobrancaWhereUniqueInput } from "./CobrancaWhereUniqueInput";
+import { ValidateNested } from "class-validator";
+import { Type } from "class-transformer";
+
+@ArgsType()
+class CobrancaFindUniqueArgs {
+ @ApiProperty({
+ required: true,
+ type: () => CobrancaWhereUniqueInput,
+ })
+ @ValidateNested()
+ @Type(() => CobrancaWhereUniqueInput)
+ @Field(() => CobrancaWhereUniqueInput, { nullable: false })
+ where!: CobrancaWhereUniqueInput;
+}
+
+export { CobrancaFindUniqueArgs as CobrancaFindUniqueArgs };
diff --git a/apps/maestri-edu-server/src/cobranca/base/CobrancaListRelationFilter.ts b/apps/maestri-edu-server/src/cobranca/base/CobrancaListRelationFilter.ts
new file mode 100644
index 0000000..314ad7e
--- /dev/null
+++ b/apps/maestri-edu-server/src/cobranca/base/CobrancaListRelationFilter.ts
@@ -0,0 +1,56 @@
+/*
+------------------------------------------------------------------------------
+This code was generated by Amplication.
+
+Changes to this file will be lost if the code is regenerated.
+
+There are other ways to to customize your code, see this doc to learn more
+https://docs.amplication.com/how-to/custom-code
+
+------------------------------------------------------------------------------
+ */
+import { InputType, Field } from "@nestjs/graphql";
+import { ApiProperty } from "@nestjs/swagger";
+import { CobrancaWhereInput } from "./CobrancaWhereInput";
+import { ValidateNested, IsOptional } from "class-validator";
+import { Type } from "class-transformer";
+
+@InputType()
+class CobrancaListRelationFilter {
+ @ApiProperty({
+ required: false,
+ type: () => CobrancaWhereInput,
+ })
+ @ValidateNested()
+ @Type(() => CobrancaWhereInput)
+ @IsOptional()
+ @Field(() => CobrancaWhereInput, {
+ nullable: true,
+ })
+ every?: CobrancaWhereInput;
+
+ @ApiProperty({
+ required: false,
+ type: () => CobrancaWhereInput,
+ })
+ @ValidateNested()
+ @Type(() => CobrancaWhereInput)
+ @IsOptional()
+ @Field(() => CobrancaWhereInput, {
+ nullable: true,
+ })
+ some?: CobrancaWhereInput;
+
+ @ApiProperty({
+ required: false,
+ type: () => CobrancaWhereInput,
+ })
+ @ValidateNested()
+ @Type(() => CobrancaWhereInput)
+ @IsOptional()
+ @Field(() => CobrancaWhereInput, {
+ nullable: true,
+ })
+ none?: CobrancaWhereInput;
+}
+export { CobrancaListRelationFilter as CobrancaListRelationFilter };
diff --git a/apps/maestri-edu-server/src/cobranca/base/CobrancaOrderByInput.ts b/apps/maestri-edu-server/src/cobranca/base/CobrancaOrderByInput.ts
new file mode 100644
index 0000000..1b7aeb6
--- /dev/null
+++ b/apps/maestri-edu-server/src/cobranca/base/CobrancaOrderByInput.ts
@@ -0,0 +1,56 @@
+/*
+------------------------------------------------------------------------------
+This code was generated by Amplication.
+
+Changes to this file will be lost if the code is regenerated.
+
+There are other ways to to customize your code, see this doc to learn more
+https://docs.amplication.com/how-to/custom-code
+
+------------------------------------------------------------------------------
+ */
+import { InputType, Field } from "@nestjs/graphql";
+import { ApiProperty } from "@nestjs/swagger";
+import { IsOptional, IsEnum } from "class-validator";
+import { SortOrder } from "../../util/SortOrder";
+
+@InputType({
+ isAbstract: true,
+ description: undefined,
+})
+class CobrancaOrderByInput {
+ @ApiProperty({
+ required: false,
+ enum: ["asc", "desc"],
+ })
+ @IsOptional()
+ @IsEnum(SortOrder)
+ @Field(() => SortOrder, {
+ nullable: true,
+ })
+ createdAt?: SortOrder;
+
+ @ApiProperty({
+ required: false,
+ enum: ["asc", "desc"],
+ })
+ @IsOptional()
+ @IsEnum(SortOrder)
+ @Field(() => SortOrder, {
+ nullable: true,
+ })
+ id?: SortOrder;
+
+ @ApiProperty({
+ required: false,
+ enum: ["asc", "desc"],
+ })
+ @IsOptional()
+ @IsEnum(SortOrder)
+ @Field(() => SortOrder, {
+ nullable: true,
+ })
+ updatedAt?: SortOrder;
+}
+
+export { CobrancaOrderByInput as CobrancaOrderByInput };
diff --git a/apps/maestri-edu-server/src/cobranca/base/CobrancaUpdateInput.ts b/apps/maestri-edu-server/src/cobranca/base/CobrancaUpdateInput.ts
new file mode 100644
index 0000000..3e91b4a
--- /dev/null
+++ b/apps/maestri-edu-server/src/cobranca/base/CobrancaUpdateInput.ts
@@ -0,0 +1,13 @@
+/*
+------------------------------------------------------------------------------
+This code was generated by Amplication.
+
+Changes to this file will be lost if the code is regenerated.
+
+There are other ways to to customize your code, see this doc to learn more
+https://docs.amplication.com/how-to/custom-code
+
+------------------------------------------------------------------------------
+ */
+class CobrancaUpdateInput {}
+export { CobrancaUpdateInput as CobrancaUpdateInput };
diff --git a/apps/maestri-edu-server/src/cobranca/base/CobrancaWhereInput.ts b/apps/maestri-edu-server/src/cobranca/base/CobrancaWhereInput.ts
new file mode 100644
index 0000000..bcc20c7
--- /dev/null
+++ b/apps/maestri-edu-server/src/cobranca/base/CobrancaWhereInput.ts
@@ -0,0 +1,32 @@
+/*
+------------------------------------------------------------------------------
+This code was generated by Amplication.
+
+Changes to this file will be lost if the code is regenerated.
+
+There are other ways to to customize your code, see this doc to learn more
+https://docs.amplication.com/how-to/custom-code
+
+------------------------------------------------------------------------------
+ */
+import { InputType, Field } from "@nestjs/graphql";
+import { ApiProperty } from "@nestjs/swagger";
+import { StringFilter } from "../../util/StringFilter";
+import { Type } from "class-transformer";
+import { IsOptional } from "class-validator";
+
+@InputType()
+class CobrancaWhereInput {
+ @ApiProperty({
+ required: false,
+ type: StringFilter,
+ })
+ @Type(() => StringFilter)
+ @IsOptional()
+ @Field(() => StringFilter, {
+ nullable: true,
+ })
+ id?: StringFilter;
+}
+
+export { CobrancaWhereInput as CobrancaWhereInput };
diff --git a/apps/maestri-edu-server/src/cobranca/base/CobrancaWhereUniqueInput.ts b/apps/maestri-edu-server/src/cobranca/base/CobrancaWhereUniqueInput.ts
new file mode 100644
index 0000000..2c516b9
--- /dev/null
+++ b/apps/maestri-edu-server/src/cobranca/base/CobrancaWhereUniqueInput.ts
@@ -0,0 +1,27 @@
+/*
+------------------------------------------------------------------------------
+This code was generated by Amplication.
+
+Changes to this file will be lost if the code is regenerated.
+
+There are other ways to to customize your code, see this doc to learn more
+https://docs.amplication.com/how-to/custom-code
+
+------------------------------------------------------------------------------
+ */
+import { InputType, Field } from "@nestjs/graphql";
+import { ApiProperty } from "@nestjs/swagger";
+import { IsString } from "class-validator";
+
+@InputType()
+class CobrancaWhereUniqueInput {
+ @ApiProperty({
+ required: true,
+ type: String,
+ })
+ @IsString()
+ @Field(() => String)
+ id!: string;
+}
+
+export { CobrancaWhereUniqueInput as CobrancaWhereUniqueInput };
diff --git a/apps/maestri-edu-server/src/cobranca/base/DeleteCobrancaArgs.ts b/apps/maestri-edu-server/src/cobranca/base/DeleteCobrancaArgs.ts
new file mode 100644
index 0000000..cee70b8
--- /dev/null
+++ b/apps/maestri-edu-server/src/cobranca/base/DeleteCobrancaArgs.ts
@@ -0,0 +1,30 @@
+/*
+------------------------------------------------------------------------------
+This code was generated by Amplication.
+
+Changes to this file will be lost if the code is regenerated.
+
+There are other ways to to customize your code, see this doc to learn more
+https://docs.amplication.com/how-to/custom-code
+
+------------------------------------------------------------------------------
+ */
+import { ArgsType, Field } from "@nestjs/graphql";
+import { ApiProperty } from "@nestjs/swagger";
+import { CobrancaWhereUniqueInput } from "./CobrancaWhereUniqueInput";
+import { ValidateNested } from "class-validator";
+import { Type } from "class-transformer";
+
+@ArgsType()
+class DeleteCobrancaArgs {
+ @ApiProperty({
+ required: true,
+ type: () => CobrancaWhereUniqueInput,
+ })
+ @ValidateNested()
+ @Type(() => CobrancaWhereUniqueInput)
+ @Field(() => CobrancaWhereUniqueInput, { nullable: false })
+ where!: CobrancaWhereUniqueInput;
+}
+
+export { DeleteCobrancaArgs as DeleteCobrancaArgs };
diff --git a/apps/maestri-edu-server/src/cobranca/base/cobranca.controller.base.spec.ts b/apps/maestri-edu-server/src/cobranca/base/cobranca.controller.base.spec.ts
new file mode 100644
index 0000000..0ba245f
--- /dev/null
+++ b/apps/maestri-edu-server/src/cobranca/base/cobranca.controller.base.spec.ts
@@ -0,0 +1,190 @@
+import { Test } from "@nestjs/testing";
+import {
+ INestApplication,
+ HttpStatus,
+ ExecutionContext,
+ CallHandler,
+} from "@nestjs/common";
+import request from "supertest";
+import { ACGuard } from "nest-access-control";
+import { DefaultAuthGuard } from "../../auth/defaultAuth.guard";
+import { ACLModule } from "../../auth/acl.module";
+import { AclFilterResponseInterceptor } from "../../interceptors/aclFilterResponse.interceptor";
+import { AclValidateRequestInterceptor } from "../../interceptors/aclValidateRequest.interceptor";
+import { map } from "rxjs";
+import { CobrancaController } from "../cobranca.controller";
+import { CobrancaService } from "../cobranca.service";
+
+const nonExistingId = "nonExistingId";
+const existingId = "existingId";
+const CREATE_INPUT = {
+ createdAt: new Date(),
+ id: "exampleId",
+ updatedAt: new Date(),
+};
+const CREATE_RESULT = {
+ createdAt: new Date(),
+ id: "exampleId",
+ updatedAt: new Date(),
+};
+const FIND_MANY_RESULT = [
+ {
+ createdAt: new Date(),
+ id: "exampleId",
+ updatedAt: new Date(),
+ },
+];
+const FIND_ONE_RESULT = {
+ createdAt: new Date(),
+ id: "exampleId",
+ updatedAt: new Date(),
+};
+
+const service = {
+ createCobranca() {
+ return CREATE_RESULT;
+ },
+ cobrancas: () => FIND_MANY_RESULT,
+ cobranca: ({ where }: { where: { id: string } }) => {
+ switch (where.id) {
+ case existingId:
+ return FIND_ONE_RESULT;
+ case nonExistingId:
+ return null;
+ }
+ },
+};
+
+const basicAuthGuard = {
+ canActivate: (context: ExecutionContext) => {
+ const argumentHost = context.switchToHttp();
+ const request = argumentHost.getRequest();
+ request.user = {
+ roles: ["user"],
+ };
+ return true;
+ },
+};
+
+const acGuard = {
+ canActivate: () => {
+ return true;
+ },
+};
+
+const aclFilterResponseInterceptor = {
+ intercept: (context: ExecutionContext, next: CallHandler) => {
+ return next.handle().pipe(
+ map((data) => {
+ return data;
+ })
+ );
+ },
+};
+const aclValidateRequestInterceptor = {
+ intercept: (context: ExecutionContext, next: CallHandler) => {
+ return next.handle();
+ },
+};
+
+describe("Cobranca", () => {
+ let app: INestApplication;
+
+ beforeAll(async () => {
+ const moduleRef = await Test.createTestingModule({
+ providers: [
+ {
+ provide: CobrancaService,
+ useValue: service,
+ },
+ ],
+ controllers: [CobrancaController],
+ imports: [ACLModule],
+ })
+ .overrideGuard(DefaultAuthGuard)
+ .useValue(basicAuthGuard)
+ .overrideGuard(ACGuard)
+ .useValue(acGuard)
+ .overrideInterceptor(AclFilterResponseInterceptor)
+ .useValue(aclFilterResponseInterceptor)
+ .overrideInterceptor(AclValidateRequestInterceptor)
+ .useValue(aclValidateRequestInterceptor)
+ .compile();
+
+ app = moduleRef.createNestApplication();
+ await app.init();
+ });
+
+ test("POST /cobrancas", async () => {
+ await request(app.getHttpServer())
+ .post("/cobrancas")
+ .send(CREATE_INPUT)
+ .expect(HttpStatus.CREATED)
+ .expect({
+ ...CREATE_RESULT,
+ createdAt: CREATE_RESULT.createdAt.toISOString(),
+ updatedAt: CREATE_RESULT.updatedAt.toISOString(),
+ });
+ });
+
+ test("GET /cobrancas", async () => {
+ await request(app.getHttpServer())
+ .get("/cobrancas")
+ .expect(HttpStatus.OK)
+ .expect([
+ {
+ ...FIND_MANY_RESULT[0],
+ createdAt: FIND_MANY_RESULT[0].createdAt.toISOString(),
+ updatedAt: FIND_MANY_RESULT[0].updatedAt.toISOString(),
+ },
+ ]);
+ });
+
+ test("GET /cobrancas/:id non existing", async () => {
+ await request(app.getHttpServer())
+ .get(`${"/cobrancas"}/${nonExistingId}`)
+ .expect(HttpStatus.NOT_FOUND)
+ .expect({
+ statusCode: HttpStatus.NOT_FOUND,
+ message: `No resource was found for {"${"id"}":"${nonExistingId}"}`,
+ error: "Not Found",
+ });
+ });
+
+ test("GET /cobrancas/:id existing", async () => {
+ await request(app.getHttpServer())
+ .get(`${"/cobrancas"}/${existingId}`)
+ .expect(HttpStatus.OK)
+ .expect({
+ ...FIND_ONE_RESULT,
+ createdAt: FIND_ONE_RESULT.createdAt.toISOString(),
+ updatedAt: FIND_ONE_RESULT.updatedAt.toISOString(),
+ });
+ });
+
+ test("POST /cobrancas existing resource", async () => {
+ const agent = request(app.getHttpServer());
+ await agent
+ .post("/cobrancas")
+ .send(CREATE_INPUT)
+ .expect(HttpStatus.CREATED)
+ .expect({
+ ...CREATE_RESULT,
+ createdAt: CREATE_RESULT.createdAt.toISOString(),
+ updatedAt: CREATE_RESULT.updatedAt.toISOString(),
+ })
+ .then(function () {
+ agent
+ .post("/cobrancas")
+ .send(CREATE_INPUT)
+ .expect(HttpStatus.CONFLICT)
+ .expect({
+ statusCode: HttpStatus.CONFLICT,
+ });
+ });
+ });
+
+ afterAll(async () => {
+ await app.close();
+ });
+});
diff --git a/apps/maestri-edu-server/src/cobranca/base/cobranca.controller.base.ts b/apps/maestri-edu-server/src/cobranca/base/cobranca.controller.base.ts
new file mode 100644
index 0000000..c09a89c
--- /dev/null
+++ b/apps/maestri-edu-server/src/cobranca/base/cobranca.controller.base.ts
@@ -0,0 +1,131 @@
+/*
+------------------------------------------------------------------------------
+This code was generated by Amplication.
+
+Changes to this file will be lost if the code is regenerated.
+
+There are other ways to to customize your code, see this doc to learn more
+https://docs.amplication.com/how-to/custom-code
+
+------------------------------------------------------------------------------
+ */
+import * as common from "@nestjs/common";
+import * as swagger from "@nestjs/swagger";
+import { isRecordNotFoundError } from "../../prisma.util";
+import * as errors from "../../errors";
+import { Request } from "express";
+import { plainToClass } from "class-transformer";
+import { ApiNestedQuery } from "../../decorators/api-nested-query.decorator";
+import { CobrancaService } from "../cobranca.service";
+import { CobrancaCreateInput } from "./CobrancaCreateInput";
+import { Cobranca } from "./Cobranca";
+import { CobrancaFindManyArgs } from "./CobrancaFindManyArgs";
+import { CobrancaWhereUniqueInput } from "./CobrancaWhereUniqueInput";
+import { CobrancaUpdateInput } from "./CobrancaUpdateInput";
+
+export class CobrancaControllerBase {
+ constructor(protected readonly service: CobrancaService) {}
+ @common.Post()
+ @swagger.ApiCreatedResponse({ type: Cobranca })
+ async createCobranca(
+ @common.Body() data: CobrancaCreateInput
+ ): Promise {
+ return await this.service.createCobranca({
+ data: data,
+ select: {
+ createdAt: true,
+ id: true,
+ updatedAt: true,
+ },
+ });
+ }
+
+ @common.Get()
+ @swagger.ApiOkResponse({ type: [Cobranca] })
+ @ApiNestedQuery(CobrancaFindManyArgs)
+ async cobrancas(@common.Req() request: Request): Promise {
+ const args = plainToClass(CobrancaFindManyArgs, request.query);
+ return this.service.cobrancas({
+ ...args,
+ select: {
+ createdAt: true,
+ id: true,
+ updatedAt: true,
+ },
+ });
+ }
+
+ @common.Get("/:id")
+ @swagger.ApiOkResponse({ type: Cobranca })
+ @swagger.ApiNotFoundResponse({ type: errors.NotFoundException })
+ async cobranca(
+ @common.Param() params: CobrancaWhereUniqueInput
+ ): Promise {
+ const result = await this.service.cobranca({
+ where: params,
+ select: {
+ createdAt: true,
+ id: true,
+ updatedAt: true,
+ },
+ });
+ if (result === null) {
+ throw new errors.NotFoundException(
+ `No resource was found for ${JSON.stringify(params)}`
+ );
+ }
+ return result;
+ }
+
+ @common.Patch("/:id")
+ @swagger.ApiOkResponse({ type: Cobranca })
+ @swagger.ApiNotFoundResponse({ type: errors.NotFoundException })
+ async updateCobranca(
+ @common.Param() params: CobrancaWhereUniqueInput,
+ @common.Body() data: CobrancaUpdateInput
+ ): Promise {
+ try {
+ return await this.service.updateCobranca({
+ where: params,
+ data: data,
+ select: {
+ createdAt: true,
+ id: true,
+ updatedAt: true,
+ },
+ });
+ } catch (error) {
+ if (isRecordNotFoundError(error)) {
+ throw new errors.NotFoundException(
+ `No resource was found for ${JSON.stringify(params)}`
+ );
+ }
+ throw error;
+ }
+ }
+
+ @common.Delete("/:id")
+ @swagger.ApiOkResponse({ type: Cobranca })
+ @swagger.ApiNotFoundResponse({ type: errors.NotFoundException })
+ async deleteCobranca(
+ @common.Param() params: CobrancaWhereUniqueInput
+ ): Promise {
+ try {
+ return await this.service.deleteCobranca({
+ where: params,
+ select: {
+ createdAt: true,
+ id: true,
+ updatedAt: true,
+ },
+ });
+ } catch (error) {
+ if (isRecordNotFoundError(error)) {
+ throw new errors.NotFoundException(
+ `No resource was found for ${JSON.stringify(params)}`
+ );
+ }
+ throw error;
+ }
+ }
+}
diff --git a/apps/maestri-edu-server/src/cobranca/base/cobranca.module.base.ts b/apps/maestri-edu-server/src/cobranca/base/cobranca.module.base.ts
new file mode 100644
index 0000000..fea8ff0
--- /dev/null
+++ b/apps/maestri-edu-server/src/cobranca/base/cobranca.module.base.ts
@@ -0,0 +1,18 @@
+/*
+------------------------------------------------------------------------------
+This code was generated by Amplication.
+
+Changes to this file will be lost if the code is regenerated.
+
+There are other ways to to customize your code, see this doc to learn more
+https://docs.amplication.com/how-to/custom-code
+
+------------------------------------------------------------------------------
+ */
+import { Module } from "@nestjs/common";
+
+@Module({
+ imports: [],
+ exports: [],
+})
+export class CobrancaModuleBase {}
diff --git a/apps/maestri-edu-server/src/cobranca/base/cobranca.resolver.base.ts b/apps/maestri-edu-server/src/cobranca/base/cobranca.resolver.base.ts
new file mode 100644
index 0000000..7407a79
--- /dev/null
+++ b/apps/maestri-edu-server/src/cobranca/base/cobranca.resolver.base.ts
@@ -0,0 +1,68 @@
+/*
+------------------------------------------------------------------------------
+This code was generated by Amplication.
+
+Changes to this file will be lost if the code is regenerated.
+
+There are other ways to to customize your code, see this doc to learn more
+https://docs.amplication.com/how-to/custom-code
+
+------------------------------------------------------------------------------
+ */
+import * as graphql from "@nestjs/graphql";
+import { GraphQLError } from "graphql";
+import { isRecordNotFoundError } from "../../prisma.util";
+import { MetaQueryPayload } from "../../util/MetaQueryPayload";
+import { Cobranca } from "./Cobranca";
+import { CobrancaCountArgs } from "./CobrancaCountArgs";
+import { CobrancaFindManyArgs } from "./CobrancaFindManyArgs";
+import { CobrancaFindUniqueArgs } from "./CobrancaFindUniqueArgs";
+import { DeleteCobrancaArgs } from "./DeleteCobrancaArgs";
+import { CobrancaService } from "../cobranca.service";
+@graphql.Resolver(() => Cobranca)
+export class CobrancaResolverBase {
+ constructor(protected readonly service: CobrancaService) {}
+
+ async _cobrancasMeta(
+ @graphql.Args() args: CobrancaCountArgs
+ ): Promise {
+ const result = await this.service.count(args);
+ return {
+ count: result,
+ };
+ }
+
+ @graphql.Query(() => [Cobranca])
+ async cobrancas(
+ @graphql.Args() args: CobrancaFindManyArgs
+ ): Promise {
+ return this.service.cobrancas(args);
+ }
+
+ @graphql.Query(() => Cobranca, { nullable: true })
+ async cobranca(
+ @graphql.Args() args: CobrancaFindUniqueArgs
+ ): Promise {
+ const result = await this.service.cobranca(args);
+ if (result === null) {
+ return null;
+ }
+ return result;
+ }
+
+ @graphql.Mutation(() => Cobranca)
+ async deleteCobranca(
+ @graphql.Args() args: DeleteCobrancaArgs
+ ): Promise {
+ try {
+ return await this.service.deleteCobranca(args);
+ } catch (error) {
+ if (isRecordNotFoundError(error)) {
+ throw new GraphQLError(
+ `No resource was found for ${JSON.stringify(args.where)}`
+ );
+ }
+ throw error;
+ }
+ }
+}
diff --git a/apps/maestri-edu-server/src/cobranca/base/cobranca.service.base.ts b/apps/maestri-edu-server/src/cobranca/base/cobranca.service.base.ts
new file mode 100644
index 0000000..c1fb6e5
--- /dev/null
+++ b/apps/maestri-edu-server/src/cobranca/base/cobranca.service.base.ts
@@ -0,0 +1,47 @@
+/*
+------------------------------------------------------------------------------
+This code was generated by Amplication.
+
+Changes to this file will be lost if the code is regenerated.
+
+There are other ways to to customize your code, see this doc to learn more
+https://docs.amplication.com/how-to/custom-code
+
+------------------------------------------------------------------------------
+ */
+import { PrismaService } from "../../prisma/prisma.service";
+import { Prisma, Cobranca as PrismaCobranca } from "@prisma/client";
+
+export class CobrancaServiceBase {
+ constructor(protected readonly prisma: PrismaService) {}
+
+ async count(args: Omit): Promise {
+ return this.prisma.cobranca.count(args);
+ }
+
+ async cobrancas(
+ args: Prisma.CobrancaFindManyArgs
+ ): Promise {
+ return this.prisma.cobranca.findMany(args);
+ }
+ async cobranca(
+ args: Prisma.CobrancaFindUniqueArgs
+ ): Promise {
+ return this.prisma.cobranca.findUnique(args);
+ }
+ async createCobranca(
+ args: Prisma.CobrancaCreateArgs
+ ): Promise {
+ return this.prisma.cobranca.create(args);
+ }
+ async updateCobranca(
+ args: Prisma.CobrancaUpdateArgs
+ ): Promise {
+ return this.prisma.cobranca.update(args);
+ }
+ async deleteCobranca(
+ args: Prisma.CobrancaDeleteArgs
+ ): Promise {
+ return this.prisma.cobranca.delete(args);
+ }
+}
diff --git a/apps/maestri-edu-server/src/cobranca/cobranca.controller.ts b/apps/maestri-edu-server/src/cobranca/cobranca.controller.ts
new file mode 100644
index 0000000..b2a0d94
--- /dev/null
+++ b/apps/maestri-edu-server/src/cobranca/cobranca.controller.ts
@@ -0,0 +1,12 @@
+import * as common from "@nestjs/common";
+import * as swagger from "@nestjs/swagger";
+import { CobrancaService } from "./cobranca.service";
+import { CobrancaControllerBase } from "./base/cobranca.controller.base";
+
+@swagger.ApiTags("cobrancas")
+@common.Controller("cobrancas")
+export class CobrancaController extends CobrancaControllerBase {
+ constructor(protected readonly service: CobrancaService) {
+ super(service);
+ }
+}
diff --git a/apps/maestri-edu-server/src/cobranca/cobranca.module.ts b/apps/maestri-edu-server/src/cobranca/cobranca.module.ts
new file mode 100644
index 0000000..17e9a72
--- /dev/null
+++ b/apps/maestri-edu-server/src/cobranca/cobranca.module.ts
@@ -0,0 +1,13 @@
+import { Module } from "@nestjs/common";
+import { CobrancaModuleBase } from "./base/cobranca.module.base";
+import { CobrancaService } from "./cobranca.service";
+import { CobrancaController } from "./cobranca.controller";
+import { CobrancaResolver } from "./cobranca.resolver";
+
+@Module({
+ imports: [CobrancaModuleBase],
+ controllers: [CobrancaController],
+ providers: [CobrancaService, CobrancaResolver],
+ exports: [CobrancaService],
+})
+export class CobrancaModule {}
diff --git a/apps/maestri-edu-server/src/cobranca/cobranca.resolver.ts b/apps/maestri-edu-server/src/cobranca/cobranca.resolver.ts
new file mode 100644
index 0000000..53a07c8
--- /dev/null
+++ b/apps/maestri-edu-server/src/cobranca/cobranca.resolver.ts
@@ -0,0 +1,11 @@
+import * as graphql from "@nestjs/graphql";
+import { CobrancaResolverBase } from "./base/cobranca.resolver.base";
+import { Cobranca } from "./base/Cobranca";
+import { CobrancaService } from "./cobranca.service";
+
+@graphql.Resolver(() => Cobranca)
+export class CobrancaResolver extends CobrancaResolverBase {
+ constructor(protected readonly service: CobrancaService) {
+ super(service);
+ }
+}
diff --git a/apps/maestri-edu-server/src/cobranca/cobranca.service.ts b/apps/maestri-edu-server/src/cobranca/cobranca.service.ts
new file mode 100644
index 0000000..c4018ed
--- /dev/null
+++ b/apps/maestri-edu-server/src/cobranca/cobranca.service.ts
@@ -0,0 +1,10 @@
+import { Injectable } from "@nestjs/common";
+import { PrismaService } from "../prisma/prisma.service";
+import { CobrancaServiceBase } from "./base/cobranca.service.base";
+
+@Injectable()
+export class CobrancaService extends CobrancaServiceBase {
+ constructor(protected readonly prisma: PrismaService) {
+ super(prisma);
+ }
+}
diff --git a/apps/maestri-edu-server/src/connectMicroservices.ts b/apps/maestri-edu-server/src/connectMicroservices.ts
new file mode 100644
index 0000000..068fa5f
--- /dev/null
+++ b/apps/maestri-edu-server/src/connectMicroservices.ts
@@ -0,0 +1,6 @@
+import { INestApplication } from "@nestjs/common";
+import { ConfigService } from "@nestjs/config";
+
+export async function connectMicroservices(app: INestApplication) {
+ const configService = app.get(ConfigService);
+}
diff --git a/apps/maestri-edu-server/src/contrato/base/Contrato.ts b/apps/maestri-edu-server/src/contrato/base/Contrato.ts
new file mode 100644
index 0000000..3c86aa7
--- /dev/null
+++ b/apps/maestri-edu-server/src/contrato/base/Contrato.ts
@@ -0,0 +1,56 @@
+/*
+------------------------------------------------------------------------------
+This code was generated by Amplication.
+
+Changes to this file will be lost if the code is regenerated.
+
+There are other ways to to customize your code, see this doc to learn more
+https://docs.amplication.com/how-to/custom-code
+
+------------------------------------------------------------------------------
+ */
+import { ObjectType, Field } from "@nestjs/graphql";
+import { ApiProperty } from "@nestjs/swagger";
+import { IsDate, IsString, MaxLength, IsOptional } from "class-validator";
+import { Type } from "class-transformer";
+
+@ObjectType()
+class Contrato {
+ @ApiProperty({
+ required: true,
+ })
+ @IsDate()
+ @Type(() => Date)
+ @Field(() => Date)
+ createdAt!: Date;
+
+ @ApiProperty({
+ required: true,
+ type: String,
+ })
+ @IsString()
+ @Field(() => String)
+ id!: string;
+
+ @ApiProperty({
+ required: false,
+ type: String,
+ })
+ @IsString()
+ @MaxLength(1000)
+ @IsOptional()
+ @Field(() => String, {
+ nullable: true,
+ })
+ perfilReferencia!: string | null;
+
+ @ApiProperty({
+ required: true,
+ })
+ @IsDate()
+ @Type(() => Date)
+ @Field(() => Date)
+ updatedAt!: Date;
+}
+
+export { Contrato as Contrato };
diff --git a/apps/maestri-edu-server/src/contrato/base/ContratoCountArgs.ts b/apps/maestri-edu-server/src/contrato/base/ContratoCountArgs.ts
new file mode 100644
index 0000000..e40ad71
--- /dev/null
+++ b/apps/maestri-edu-server/src/contrato/base/ContratoCountArgs.ts
@@ -0,0 +1,28 @@
+/*
+------------------------------------------------------------------------------
+This code was generated by Amplication.
+
+Changes to this file will be lost if the code is regenerated.
+
+There are other ways to to customize your code, see this doc to learn more
+https://docs.amplication.com/how-to/custom-code
+
+------------------------------------------------------------------------------
+ */
+import { ArgsType, Field } from "@nestjs/graphql";
+import { ApiProperty } from "@nestjs/swagger";
+import { ContratoWhereInput } from "./ContratoWhereInput";
+import { Type } from "class-transformer";
+
+@ArgsType()
+class ContratoCountArgs {
+ @ApiProperty({
+ required: false,
+ type: () => ContratoWhereInput,
+ })
+ @Field(() => ContratoWhereInput, { nullable: true })
+ @Type(() => ContratoWhereInput)
+ where?: ContratoWhereInput;
+}
+
+export { ContratoCountArgs as ContratoCountArgs };
diff --git a/apps/maestri-edu-server/src/contrato/base/ContratoCreateInput.ts b/apps/maestri-edu-server/src/contrato/base/ContratoCreateInput.ts
new file mode 100644
index 0000000..9fdede9
--- /dev/null
+++ b/apps/maestri-edu-server/src/contrato/base/ContratoCreateInput.ts
@@ -0,0 +1,31 @@
+/*
+------------------------------------------------------------------------------
+This code was generated by Amplication.
+
+Changes to this file will be lost if the code is regenerated.
+
+There are other ways to to customize your code, see this doc to learn more
+https://docs.amplication.com/how-to/custom-code
+
+------------------------------------------------------------------------------
+ */
+import { InputType, Field } from "@nestjs/graphql";
+import { ApiProperty } from "@nestjs/swagger";
+import { IsString, MaxLength, IsOptional } from "class-validator";
+
+@InputType()
+class ContratoCreateInput {
+ @ApiProperty({
+ required: false,
+ type: String,
+ })
+ @IsString()
+ @MaxLength(1000)
+ @IsOptional()
+ @Field(() => String, {
+ nullable: true,
+ })
+ perfilReferencia?: string | null;
+}
+
+export { ContratoCreateInput as ContratoCreateInput };
diff --git a/apps/maestri-edu-server/src/contrato/base/ContratoFindManyArgs.ts b/apps/maestri-edu-server/src/contrato/base/ContratoFindManyArgs.ts
new file mode 100644
index 0000000..023822f
--- /dev/null
+++ b/apps/maestri-edu-server/src/contrato/base/ContratoFindManyArgs.ts
@@ -0,0 +1,62 @@
+/*
+------------------------------------------------------------------------------
+This code was generated by Amplication.
+
+Changes to this file will be lost if the code is regenerated.
+
+There are other ways to to customize your code, see this doc to learn more
+https://docs.amplication.com/how-to/custom-code
+
+------------------------------------------------------------------------------
+ */
+import { ArgsType, Field } from "@nestjs/graphql";
+import { ApiProperty } from "@nestjs/swagger";
+import { ContratoWhereInput } from "./ContratoWhereInput";
+import { IsOptional, ValidateNested, IsInt } from "class-validator";
+import { Type } from "class-transformer";
+import { ContratoOrderByInput } from "./ContratoOrderByInput";
+
+@ArgsType()
+class ContratoFindManyArgs {
+ @ApiProperty({
+ required: false,
+ type: () => ContratoWhereInput,
+ })
+ @IsOptional()
+ @ValidateNested()
+ @Field(() => ContratoWhereInput, { nullable: true })
+ @Type(() => ContratoWhereInput)
+ where?: ContratoWhereInput;
+
+ @ApiProperty({
+ required: false,
+ type: [ContratoOrderByInput],
+ })
+ @IsOptional()
+ @ValidateNested({ each: true })
+ @Field(() => [ContratoOrderByInput], { nullable: true })
+ @Type(() => ContratoOrderByInput)
+ orderBy?: Array;
+
+ @ApiProperty({
+ required: false,
+ type: Number,
+ })
+ @IsOptional()
+ @IsInt()
+ @Field(() => Number, { nullable: true })
+ @Type(() => Number)
+ skip?: number;
+
+ @ApiProperty({
+ required: false,
+ type: Number,
+ })
+ @IsOptional()
+ @IsInt()
+ @Field(() => Number, { nullable: true })
+ @Type(() => Number)
+ take?: number;
+}
+
+export { ContratoFindManyArgs as ContratoFindManyArgs };
diff --git a/apps/maestri-edu-server/src/contrato/base/ContratoFindUniqueArgs.ts b/apps/maestri-edu-server/src/contrato/base/ContratoFindUniqueArgs.ts
new file mode 100644
index 0000000..985156a
--- /dev/null
+++ b/apps/maestri-edu-server/src/contrato/base/ContratoFindUniqueArgs.ts
@@ -0,0 +1,30 @@
+/*
+------------------------------------------------------------------------------
+This code was generated by Amplication.
+
+Changes to this file will be lost if the code is regenerated.
+
+There are other ways to to customize your code, see this doc to learn more
+https://docs.amplication.com/how-to/custom-code
+
+------------------------------------------------------------------------------
+ */
+import { ArgsType, Field } from "@nestjs/graphql";
+import { ApiProperty } from "@nestjs/swagger";
+import { ContratoWhereUniqueInput } from "./ContratoWhereUniqueInput";
+import { ValidateNested } from "class-validator";
+import { Type } from "class-transformer";
+
+@ArgsType()
+class ContratoFindUniqueArgs {
+ @ApiProperty({
+ required: true,
+ type: () => ContratoWhereUniqueInput,
+ })
+ @ValidateNested()
+ @Type(() => ContratoWhereUniqueInput)
+ @Field(() => ContratoWhereUniqueInput, { nullable: false })
+ where!: ContratoWhereUniqueInput;
+}
+
+export { ContratoFindUniqueArgs as ContratoFindUniqueArgs };
diff --git a/apps/maestri-edu-server/src/contrato/base/ContratoListRelationFilter.ts b/apps/maestri-edu-server/src/contrato/base/ContratoListRelationFilter.ts
new file mode 100644
index 0000000..15aa7ea
--- /dev/null
+++ b/apps/maestri-edu-server/src/contrato/base/ContratoListRelationFilter.ts
@@ -0,0 +1,56 @@
+/*
+------------------------------------------------------------------------------
+This code was generated by Amplication.
+
+Changes to this file will be lost if the code is regenerated.
+
+There are other ways to to customize your code, see this doc to learn more
+https://docs.amplication.com/how-to/custom-code
+
+------------------------------------------------------------------------------
+ */
+import { InputType, Field } from "@nestjs/graphql";
+import { ApiProperty } from "@nestjs/swagger";
+import { ContratoWhereInput } from "./ContratoWhereInput";
+import { ValidateNested, IsOptional } from "class-validator";
+import { Type } from "class-transformer";
+
+@InputType()
+class ContratoListRelationFilter {
+ @ApiProperty({
+ required: false,
+ type: () => ContratoWhereInput,
+ })
+ @ValidateNested()
+ @Type(() => ContratoWhereInput)
+ @IsOptional()
+ @Field(() => ContratoWhereInput, {
+ nullable: true,
+ })
+ every?: ContratoWhereInput;
+
+ @ApiProperty({
+ required: false,
+ type: () => ContratoWhereInput,
+ })
+ @ValidateNested()
+ @Type(() => ContratoWhereInput)
+ @IsOptional()
+ @Field(() => ContratoWhereInput, {
+ nullable: true,
+ })
+ some?: ContratoWhereInput;
+
+ @ApiProperty({
+ required: false,
+ type: () => ContratoWhereInput,
+ })
+ @ValidateNested()
+ @Type(() => ContratoWhereInput)
+ @IsOptional()
+ @Field(() => ContratoWhereInput, {
+ nullable: true,
+ })
+ none?: ContratoWhereInput;
+}
+export { ContratoListRelationFilter as ContratoListRelationFilter };
diff --git a/apps/maestri-edu-server/src/contrato/base/ContratoOrderByInput.ts b/apps/maestri-edu-server/src/contrato/base/ContratoOrderByInput.ts
new file mode 100644
index 0000000..90dcec2
--- /dev/null
+++ b/apps/maestri-edu-server/src/contrato/base/ContratoOrderByInput.ts
@@ -0,0 +1,67 @@
+/*
+------------------------------------------------------------------------------
+This code was generated by Amplication.
+
+Changes to this file will be lost if the code is regenerated.
+
+There are other ways to to customize your code, see this doc to learn more
+https://docs.amplication.com/how-to/custom-code
+
+------------------------------------------------------------------------------
+ */
+import { InputType, Field } from "@nestjs/graphql";
+import { ApiProperty } from "@nestjs/swagger";
+import { IsOptional, IsEnum } from "class-validator";
+import { SortOrder } from "../../util/SortOrder";
+
+@InputType({
+ isAbstract: true,
+ description: undefined,
+})
+class ContratoOrderByInput {
+ @ApiProperty({
+ required: false,
+ enum: ["asc", "desc"],
+ })
+ @IsOptional()
+ @IsEnum(SortOrder)
+ @Field(() => SortOrder, {
+ nullable: true,
+ })
+ createdAt?: SortOrder;
+
+ @ApiProperty({
+ required: false,
+ enum: ["asc", "desc"],
+ })
+ @IsOptional()
+ @IsEnum(SortOrder)
+ @Field(() => SortOrder, {
+ nullable: true,
+ })
+ id?: SortOrder;
+
+ @ApiProperty({
+ required: false,
+ enum: ["asc", "desc"],
+ })
+ @IsOptional()
+ @IsEnum(SortOrder)
+ @Field(() => SortOrder, {
+ nullable: true,
+ })
+ perfilReferencia?: SortOrder;
+
+ @ApiProperty({
+ required: false,
+ enum: ["asc", "desc"],
+ })
+ @IsOptional()
+ @IsEnum(SortOrder)
+ @Field(() => SortOrder, {
+ nullable: true,
+ })
+ updatedAt?: SortOrder;
+}
+
+export { ContratoOrderByInput as ContratoOrderByInput };
diff --git a/apps/maestri-edu-server/src/contrato/base/ContratoUpdateInput.ts b/apps/maestri-edu-server/src/contrato/base/ContratoUpdateInput.ts
new file mode 100644
index 0000000..e349009
--- /dev/null
+++ b/apps/maestri-edu-server/src/contrato/base/ContratoUpdateInput.ts
@@ -0,0 +1,31 @@
+/*
+------------------------------------------------------------------------------
+This code was generated by Amplication.
+
+Changes to this file will be lost if the code is regenerated.
+
+There are other ways to to customize your code, see this doc to learn more
+https://docs.amplication.com/how-to/custom-code
+
+------------------------------------------------------------------------------
+ */
+import { InputType, Field } from "@nestjs/graphql";
+import { ApiProperty } from "@nestjs/swagger";
+import { IsString, MaxLength, IsOptional } from "class-validator";
+
+@InputType()
+class ContratoUpdateInput {
+ @ApiProperty({
+ required: false,
+ type: String,
+ })
+ @IsString()
+ @MaxLength(1000)
+ @IsOptional()
+ @Field(() => String, {
+ nullable: true,
+ })
+ perfilReferencia?: string | null;
+}
+
+export { ContratoUpdateInput as ContratoUpdateInput };
diff --git a/apps/maestri-edu-server/src/contrato/base/ContratoWhereInput.ts b/apps/maestri-edu-server/src/contrato/base/ContratoWhereInput.ts
new file mode 100644
index 0000000..3cddbe1
--- /dev/null
+++ b/apps/maestri-edu-server/src/contrato/base/ContratoWhereInput.ts
@@ -0,0 +1,44 @@
+/*
+------------------------------------------------------------------------------
+This code was generated by Amplication.
+
+Changes to this file will be lost if the code is regenerated.
+
+There are other ways to to customize your code, see this doc to learn more
+https://docs.amplication.com/how-to/custom-code
+
+------------------------------------------------------------------------------
+ */
+import { InputType, Field } from "@nestjs/graphql";
+import { ApiProperty } from "@nestjs/swagger";
+import { StringFilter } from "../../util/StringFilter";
+import { Type } from "class-transformer";
+import { IsOptional } from "class-validator";
+import { StringNullableFilter } from "../../util/StringNullableFilter";
+
+@InputType()
+class ContratoWhereInput {
+ @ApiProperty({
+ required: false,
+ type: StringFilter,
+ })
+ @Type(() => StringFilter)
+ @IsOptional()
+ @Field(() => StringFilter, {
+ nullable: true,
+ })
+ id?: StringFilter;
+
+ @ApiProperty({
+ required: false,
+ type: StringNullableFilter,
+ })
+ @Type(() => StringNullableFilter)
+ @IsOptional()
+ @Field(() => StringNullableFilter, {
+ nullable: true,
+ })
+ perfilReferencia?: StringNullableFilter;
+}
+
+export { ContratoWhereInput as ContratoWhereInput };
diff --git a/apps/maestri-edu-server/src/contrato/base/ContratoWhereUniqueInput.ts b/apps/maestri-edu-server/src/contrato/base/ContratoWhereUniqueInput.ts
new file mode 100644
index 0000000..8ae4b80
--- /dev/null
+++ b/apps/maestri-edu-server/src/contrato/base/ContratoWhereUniqueInput.ts
@@ -0,0 +1,27 @@
+/*
+------------------------------------------------------------------------------
+This code was generated by Amplication.
+
+Changes to this file will be lost if the code is regenerated.
+
+There are other ways to to customize your code, see this doc to learn more
+https://docs.amplication.com/how-to/custom-code
+
+------------------------------------------------------------------------------
+ */
+import { InputType, Field } from "@nestjs/graphql";
+import { ApiProperty } from "@nestjs/swagger";
+import { IsString } from "class-validator";
+
+@InputType()
+class ContratoWhereUniqueInput {
+ @ApiProperty({
+ required: true,
+ type: String,
+ })
+ @IsString()
+ @Field(() => String)
+ id!: string;
+}
+
+export { ContratoWhereUniqueInput as ContratoWhereUniqueInput };
diff --git a/apps/maestri-edu-server/src/contrato/base/CreateContratoArgs.ts b/apps/maestri-edu-server/src/contrato/base/CreateContratoArgs.ts
new file mode 100644
index 0000000..8da52f7
--- /dev/null
+++ b/apps/maestri-edu-server/src/contrato/base/CreateContratoArgs.ts
@@ -0,0 +1,30 @@
+/*
+------------------------------------------------------------------------------
+This code was generated by Amplication.
+
+Changes to this file will be lost if the code is regenerated.
+
+There are other ways to to customize your code, see this doc to learn more
+https://docs.amplication.com/how-to/custom-code
+
+------------------------------------------------------------------------------
+ */
+import { ArgsType, Field } from "@nestjs/graphql";
+import { ApiProperty } from "@nestjs/swagger";
+import { ContratoCreateInput } from "./ContratoCreateInput";
+import { ValidateNested } from "class-validator";
+import { Type } from "class-transformer";
+
+@ArgsType()
+class CreateContratoArgs {
+ @ApiProperty({
+ required: true,
+ type: () => ContratoCreateInput,
+ })
+ @ValidateNested()
+ @Type(() => ContratoCreateInput)
+ @Field(() => ContratoCreateInput, { nullable: false })
+ data!: ContratoCreateInput;
+}
+
+export { CreateContratoArgs as CreateContratoArgs };
diff --git a/apps/maestri-edu-server/src/contrato/base/DeleteContratoArgs.ts b/apps/maestri-edu-server/src/contrato/base/DeleteContratoArgs.ts
new file mode 100644
index 0000000..50384ac
--- /dev/null
+++ b/apps/maestri-edu-server/src/contrato/base/DeleteContratoArgs.ts
@@ -0,0 +1,30 @@
+/*
+------------------------------------------------------------------------------
+This code was generated by Amplication.
+
+Changes to this file will be lost if the code is regenerated.
+
+There are other ways to to customize your code, see this doc to learn more
+https://docs.amplication.com/how-to/custom-code
+
+------------------------------------------------------------------------------
+ */
+import { ArgsType, Field } from "@nestjs/graphql";
+import { ApiProperty } from "@nestjs/swagger";
+import { ContratoWhereUniqueInput } from "./ContratoWhereUniqueInput";
+import { ValidateNested } from "class-validator";
+import { Type } from "class-transformer";
+
+@ArgsType()
+class DeleteContratoArgs {
+ @ApiProperty({
+ required: true,
+ type: () => ContratoWhereUniqueInput,
+ })
+ @ValidateNested()
+ @Type(() => ContratoWhereUniqueInput)
+ @Field(() => ContratoWhereUniqueInput, { nullable: false })
+ where!: ContratoWhereUniqueInput;
+}
+
+export { DeleteContratoArgs as DeleteContratoArgs };
diff --git a/apps/maestri-edu-server/src/contrato/base/UpdateContratoArgs.ts b/apps/maestri-edu-server/src/contrato/base/UpdateContratoArgs.ts
new file mode 100644
index 0000000..468b8ca
--- /dev/null
+++ b/apps/maestri-edu-server/src/contrato/base/UpdateContratoArgs.ts
@@ -0,0 +1,40 @@
+/*
+------------------------------------------------------------------------------
+This code was generated by Amplication.
+
+Changes to this file will be lost if the code is regenerated.
+
+There are other ways to to customize your code, see this doc to learn more
+https://docs.amplication.com/how-to/custom-code
+
+------------------------------------------------------------------------------
+ */
+import { ArgsType, Field } from "@nestjs/graphql";
+import { ApiProperty } from "@nestjs/swagger";
+import { ContratoWhereUniqueInput } from "./ContratoWhereUniqueInput";
+import { ValidateNested } from "class-validator";
+import { Type } from "class-transformer";
+import { ContratoUpdateInput } from "./ContratoUpdateInput";
+
+@ArgsType()
+class UpdateContratoArgs {
+ @ApiProperty({
+ required: true,
+ type: () => ContratoWhereUniqueInput,
+ })
+ @ValidateNested()
+ @Type(() => ContratoWhereUniqueInput)
+ @Field(() => ContratoWhereUniqueInput, { nullable: false })
+ where!: ContratoWhereUniqueInput;
+
+ @ApiProperty({
+ required: true,
+ type: () => ContratoUpdateInput,
+ })
+ @ValidateNested()
+ @Type(() => ContratoUpdateInput)
+ @Field(() => ContratoUpdateInput, { nullable: false })
+ data!: ContratoUpdateInput;
+}
+
+export { UpdateContratoArgs as UpdateContratoArgs };
diff --git a/apps/maestri-edu-server/src/contrato/base/contrato.controller.base.spec.ts b/apps/maestri-edu-server/src/contrato/base/contrato.controller.base.spec.ts
new file mode 100644
index 0000000..16dd3ee
--- /dev/null
+++ b/apps/maestri-edu-server/src/contrato/base/contrato.controller.base.spec.ts
@@ -0,0 +1,194 @@
+import { Test } from "@nestjs/testing";
+import {
+ INestApplication,
+ HttpStatus,
+ ExecutionContext,
+ CallHandler,
+} from "@nestjs/common";
+import request from "supertest";
+import { ACGuard } from "nest-access-control";
+import { DefaultAuthGuard } from "../../auth/defaultAuth.guard";
+import { ACLModule } from "../../auth/acl.module";
+import { AclFilterResponseInterceptor } from "../../interceptors/aclFilterResponse.interceptor";
+import { AclValidateRequestInterceptor } from "../../interceptors/aclValidateRequest.interceptor";
+import { map } from "rxjs";
+import { ContratoController } from "../contrato.controller";
+import { ContratoService } from "../contrato.service";
+
+const nonExistingId = "nonExistingId";
+const existingId = "existingId";
+const CREATE_INPUT = {
+ createdAt: new Date(),
+ id: "exampleId",
+ perfilReferencia: "examplePerfilReferencia",
+ updatedAt: new Date(),
+};
+const CREATE_RESULT = {
+ createdAt: new Date(),
+ id: "exampleId",
+ perfilReferencia: "examplePerfilReferencia",
+ updatedAt: new Date(),
+};
+const FIND_MANY_RESULT = [
+ {
+ createdAt: new Date(),
+ id: "exampleId",
+ perfilReferencia: "examplePerfilReferencia",
+ updatedAt: new Date(),
+ },
+];
+const FIND_ONE_RESULT = {
+ createdAt: new Date(),
+ id: "exampleId",
+ perfilReferencia: "examplePerfilReferencia",
+ updatedAt: new Date(),
+};
+
+const service = {
+ createContrato() {
+ return CREATE_RESULT;
+ },
+ contratoes: () => FIND_MANY_RESULT,
+ contrato: ({ where }: { where: { id: string } }) => {
+ switch (where.id) {
+ case existingId:
+ return FIND_ONE_RESULT;
+ case nonExistingId:
+ return null;
+ }
+ },
+};
+
+const basicAuthGuard = {
+ canActivate: (context: ExecutionContext) => {
+ const argumentHost = context.switchToHttp();
+ const request = argumentHost.getRequest();
+ request.user = {
+ roles: ["user"],
+ };
+ return true;
+ },
+};
+
+const acGuard = {
+ canActivate: () => {
+ return true;
+ },
+};
+
+const aclFilterResponseInterceptor = {
+ intercept: (context: ExecutionContext, next: CallHandler) => {
+ return next.handle().pipe(
+ map((data) => {
+ return data;
+ })
+ );
+ },
+};
+const aclValidateRequestInterceptor = {
+ intercept: (context: ExecutionContext, next: CallHandler) => {
+ return next.handle();
+ },
+};
+
+describe("Contrato", () => {
+ let app: INestApplication;
+
+ beforeAll(async () => {
+ const moduleRef = await Test.createTestingModule({
+ providers: [
+ {
+ provide: ContratoService,
+ useValue: service,
+ },
+ ],
+ controllers: [ContratoController],
+ imports: [ACLModule],
+ })
+ .overrideGuard(DefaultAuthGuard)
+ .useValue(basicAuthGuard)
+ .overrideGuard(ACGuard)
+ .useValue(acGuard)
+ .overrideInterceptor(AclFilterResponseInterceptor)
+ .useValue(aclFilterResponseInterceptor)
+ .overrideInterceptor(AclValidateRequestInterceptor)
+ .useValue(aclValidateRequestInterceptor)
+ .compile();
+
+ app = moduleRef.createNestApplication();
+ await app.init();
+ });
+
+ test("POST /contratoes", async () => {
+ await request(app.getHttpServer())
+ .post("/contratoes")
+ .send(CREATE_INPUT)
+ .expect(HttpStatus.CREATED)
+ .expect({
+ ...CREATE_RESULT,
+ createdAt: CREATE_RESULT.createdAt.toISOString(),
+ updatedAt: CREATE_RESULT.updatedAt.toISOString(),
+ });
+ });
+
+ test("GET /contratoes", async () => {
+ await request(app.getHttpServer())
+ .get("/contratoes")
+ .expect(HttpStatus.OK)
+ .expect([
+ {
+ ...FIND_MANY_RESULT[0],
+ createdAt: FIND_MANY_RESULT[0].createdAt.toISOString(),
+ updatedAt: FIND_MANY_RESULT[0].updatedAt.toISOString(),
+ },
+ ]);
+ });
+
+ test("GET /contratoes/:id non existing", async () => {
+ await request(app.getHttpServer())
+ .get(`${"/contratoes"}/${nonExistingId}`)
+ .expect(HttpStatus.NOT_FOUND)
+ .expect({
+ statusCode: HttpStatus.NOT_FOUND,
+ message: `No resource was found for {"${"id"}":"${nonExistingId}"}`,
+ error: "Not Found",
+ });
+ });
+
+ test("GET /contratoes/:id existing", async () => {
+ await request(app.getHttpServer())
+ .get(`${"/contratoes"}/${existingId}`)
+ .expect(HttpStatus.OK)
+ .expect({
+ ...FIND_ONE_RESULT,
+ createdAt: FIND_ONE_RESULT.createdAt.toISOString(),
+ updatedAt: FIND_ONE_RESULT.updatedAt.toISOString(),
+ });
+ });
+
+ test("POST /contratoes existing resource", async () => {
+ const agent = request(app.getHttpServer());
+ await agent
+ .post("/contratoes")
+ .send(CREATE_INPUT)
+ .expect(HttpStatus.CREATED)
+ .expect({
+ ...CREATE_RESULT,
+ createdAt: CREATE_RESULT.createdAt.toISOString(),
+ updatedAt: CREATE_RESULT.updatedAt.toISOString(),
+ })
+ .then(function () {
+ agent
+ .post("/contratoes")
+ .send(CREATE_INPUT)
+ .expect(HttpStatus.CONFLICT)
+ .expect({
+ statusCode: HttpStatus.CONFLICT,
+ });
+ });
+ });
+
+ afterAll(async () => {
+ await app.close();
+ });
+});
diff --git a/apps/maestri-edu-server/src/contrato/base/contrato.controller.base.ts b/apps/maestri-edu-server/src/contrato/base/contrato.controller.base.ts
new file mode 100644
index 0000000..83596de
--- /dev/null
+++ b/apps/maestri-edu-server/src/contrato/base/contrato.controller.base.ts
@@ -0,0 +1,136 @@
+/*
+------------------------------------------------------------------------------
+This code was generated by Amplication.
+
+Changes to this file will be lost if the code is regenerated.
+
+There are other ways to to customize your code, see this doc to learn more
+https://docs.amplication.com/how-to/custom-code
+
+------------------------------------------------------------------------------
+ */
+import * as common from "@nestjs/common";
+import * as swagger from "@nestjs/swagger";
+import { isRecordNotFoundError } from "../../prisma.util";
+import * as errors from "../../errors";
+import { Request } from "express";
+import { plainToClass } from "class-transformer";
+import { ApiNestedQuery } from "../../decorators/api-nested-query.decorator";
+import { ContratoService } from "../contrato.service";
+import { ContratoCreateInput } from "./ContratoCreateInput";
+import { Contrato } from "./Contrato";
+import { ContratoFindManyArgs } from "./ContratoFindManyArgs";
+import { ContratoWhereUniqueInput } from "./ContratoWhereUniqueInput";
+import { ContratoUpdateInput } from "./ContratoUpdateInput";
+
+export class ContratoControllerBase {
+ constructor(protected readonly service: ContratoService) {}
+ @common.Post()
+ @swagger.ApiCreatedResponse({ type: Contrato })
+ async createContrato(
+ @common.Body() data: ContratoCreateInput
+ ): Promise {
+ return await this.service.createContrato({
+ data: data,
+ select: {
+ createdAt: true,
+ id: true,
+ perfilReferencia: true,
+ updatedAt: true,
+ },
+ });
+ }
+
+ @common.Get()
+ @swagger.ApiOkResponse({ type: [Contrato] })
+ @ApiNestedQuery(ContratoFindManyArgs)
+ async contratoes(@common.Req() request: Request): Promise {
+ const args = plainToClass(ContratoFindManyArgs, request.query);
+ return this.service.contratoes({
+ ...args,
+ select: {
+ createdAt: true,
+ id: true,
+ perfilReferencia: true,
+ updatedAt: true,
+ },
+ });
+ }
+
+ @common.Get("/:id")
+ @swagger.ApiOkResponse({ type: Contrato })
+ @swagger.ApiNotFoundResponse({ type: errors.NotFoundException })
+ async contrato(
+ @common.Param() params: ContratoWhereUniqueInput
+ ): Promise {
+ const result = await this.service.contrato({
+ where: params,
+ select: {
+ createdAt: true,
+ id: true,
+ perfilReferencia: true,
+ updatedAt: true,
+ },
+ });
+ if (result === null) {
+ throw new errors.NotFoundException(
+ `No resource was found for ${JSON.stringify(params)}`
+ );
+ }
+ return result;
+ }
+
+ @common.Patch("/:id")
+ @swagger.ApiOkResponse({ type: Contrato })
+ @swagger.ApiNotFoundResponse({ type: errors.NotFoundException })
+ async updateContrato(
+ @common.Param() params: ContratoWhereUniqueInput,
+ @common.Body() data: ContratoUpdateInput
+ ): Promise {
+ try {
+ return await this.service.updateContrato({
+ where: params,
+ data: data,
+ select: {
+ createdAt: true,
+ id: true,
+ perfilReferencia: true,
+ updatedAt: true,
+ },
+ });
+ } catch (error) {
+ if (isRecordNotFoundError(error)) {
+ throw new errors.NotFoundException(
+ `No resource was found for ${JSON.stringify(params)}`
+ );
+ }
+ throw error;
+ }
+ }
+
+ @common.Delete("/:id")
+ @swagger.ApiOkResponse({ type: Contrato })
+ @swagger.ApiNotFoundResponse({ type: errors.NotFoundException })
+ async deleteContrato(
+ @common.Param() params: ContratoWhereUniqueInput
+ ): Promise {
+ try {
+ return await this.service.deleteContrato({
+ where: params,
+ select: {
+ createdAt: true,
+ id: true,
+ perfilReferencia: true,
+ updatedAt: true,
+ },
+ });
+ } catch (error) {
+ if (isRecordNotFoundError(error)) {
+ throw new errors.NotFoundException(
+ `No resource was found for ${JSON.stringify(params)}`
+ );
+ }
+ throw error;
+ }
+ }
+}
diff --git a/apps/maestri-edu-server/src/contrato/base/contrato.module.base.ts b/apps/maestri-edu-server/src/contrato/base/contrato.module.base.ts
new file mode 100644
index 0000000..9057633
--- /dev/null
+++ b/apps/maestri-edu-server/src/contrato/base/contrato.module.base.ts
@@ -0,0 +1,18 @@
+/*
+------------------------------------------------------------------------------
+This code was generated by Amplication.
+
+Changes to this file will be lost if the code is regenerated.
+
+There are other ways to to customize your code, see this doc to learn more
+https://docs.amplication.com/how-to/custom-code
+
+------------------------------------------------------------------------------
+ */
+import { Module } from "@nestjs/common";
+
+@Module({
+ imports: [],
+ exports: [],
+})
+export class ContratoModuleBase {}
diff --git a/apps/maestri-edu-server/src/contrato/base/contrato.resolver.base.ts b/apps/maestri-edu-server/src/contrato/base/contrato.resolver.base.ts
new file mode 100644
index 0000000..68b9e79
--- /dev/null
+++ b/apps/maestri-edu-server/src/contrato/base/contrato.resolver.base.ts
@@ -0,0 +1,99 @@
+/*
+------------------------------------------------------------------------------
+This code was generated by Amplication.
+
+Changes to this file will be lost if the code is regenerated.
+
+There are other ways to to customize your code, see this doc to learn more
+https://docs.amplication.com/how-to/custom-code
+
+------------------------------------------------------------------------------
+ */
+import * as graphql from "@nestjs/graphql";
+import { GraphQLError } from "graphql";
+import { isRecordNotFoundError } from "../../prisma.util";
+import { MetaQueryPayload } from "../../util/MetaQueryPayload";
+import { Contrato } from "./Contrato";
+import { ContratoCountArgs } from "./ContratoCountArgs";
+import { ContratoFindManyArgs } from "./ContratoFindManyArgs";
+import { ContratoFindUniqueArgs } from "./ContratoFindUniqueArgs";
+import { CreateContratoArgs } from "./CreateContratoArgs";
+import { UpdateContratoArgs } from "./UpdateContratoArgs";
+import { DeleteContratoArgs } from "./DeleteContratoArgs";
+import { ContratoService } from "../contrato.service";
+@graphql.Resolver(() => Contrato)
+export class ContratoResolverBase {
+ constructor(protected readonly service: ContratoService) {}
+
+ async _contratoesMeta(
+ @graphql.Args() args: ContratoCountArgs
+ ): Promise {
+ const result = await this.service.count(args);
+ return {
+ count: result,
+ };
+ }
+
+ @graphql.Query(() => [Contrato])
+ async contratoes(
+ @graphql.Args() args: ContratoFindManyArgs
+ ): Promise {
+ return this.service.contratoes(args);
+ }
+
+ @graphql.Query(() => Contrato, { nullable: true })
+ async contrato(
+ @graphql.Args() args: ContratoFindUniqueArgs
+ ): Promise {
+ const result = await this.service.contrato(args);
+ if (result === null) {
+ return null;
+ }
+ return result;
+ }
+
+ @graphql.Mutation(() => Contrato)
+ async createContrato(
+ @graphql.Args() args: CreateContratoArgs
+ ): Promise {
+ return await this.service.createContrato({
+ ...args,
+ data: args.data,
+ });
+ }
+
+ @graphql.Mutation(() => Contrato)
+ async updateContrato(
+ @graphql.Args() args: UpdateContratoArgs
+ ): Promise {
+ try {
+ return await this.service.updateContrato({
+ ...args,
+ data: args.data,
+ });
+ } catch (error) {
+ if (isRecordNotFoundError(error)) {
+ throw new GraphQLError(
+ `No resource was found for ${JSON.stringify(args.where)}`
+ );
+ }
+ throw error;
+ }
+ }
+
+ @graphql.Mutation(() => Contrato)
+ async deleteContrato(
+ @graphql.Args() args: DeleteContratoArgs
+ ): Promise {
+ try {
+ return await this.service.deleteContrato(args);
+ } catch (error) {
+ if (isRecordNotFoundError(error)) {
+ throw new GraphQLError(
+ `No resource was found for ${JSON.stringify(args.where)}`
+ );
+ }
+ throw error;
+ }
+ }
+}
diff --git a/apps/maestri-edu-server/src/contrato/base/contrato.service.base.ts b/apps/maestri-edu-server/src/contrato/base/contrato.service.base.ts
new file mode 100644
index 0000000..c6da454
--- /dev/null
+++ b/apps/maestri-edu-server/src/contrato/base/contrato.service.base.ts
@@ -0,0 +1,47 @@
+/*
+------------------------------------------------------------------------------
+This code was generated by Amplication.
+
+Changes to this file will be lost if the code is regenerated.
+
+There are other ways to to customize your code, see this doc to learn more
+https://docs.amplication.com/how-to/custom-code
+
+------------------------------------------------------------------------------
+ */
+import { PrismaService } from "../../prisma/prisma.service";
+import { Prisma, Contrato as PrismaContrato } from "@prisma/client";
+
+export class ContratoServiceBase {
+ constructor(protected readonly prisma: PrismaService) {}
+
+ async count(args: Omit): Promise {
+ return this.prisma.contrato.count(args);
+ }
+
+ async contratoes(
+ args: Prisma.ContratoFindManyArgs
+ ): Promise {
+ return this.prisma.contrato.findMany(args);
+ }
+ async contrato(
+ args: Prisma.ContratoFindUniqueArgs
+ ): Promise {
+ return this.prisma.contrato.findUnique(args);
+ }
+ async createContrato(
+ args: Prisma.ContratoCreateArgs
+ ): Promise {
+ return this.prisma.contrato.create(args);
+ }
+ async updateContrato(
+ args: Prisma.ContratoUpdateArgs
+ ): Promise {
+ return this.prisma.contrato.update(args);
+ }
+ async deleteContrato(
+ args: Prisma.ContratoDeleteArgs
+ ): Promise {
+ return this.prisma.contrato.delete(args);
+ }
+}
diff --git a/apps/maestri-edu-server/src/contrato/contrato.controller.ts b/apps/maestri-edu-server/src/contrato/contrato.controller.ts
new file mode 100644
index 0000000..a040f97
--- /dev/null
+++ b/apps/maestri-edu-server/src/contrato/contrato.controller.ts
@@ -0,0 +1,12 @@
+import * as common from "@nestjs/common";
+import * as swagger from "@nestjs/swagger";
+import { ContratoService } from "./contrato.service";
+import { ContratoControllerBase } from "./base/contrato.controller.base";
+
+@swagger.ApiTags("contratoes")
+@common.Controller("contratoes")
+export class ContratoController extends ContratoControllerBase {
+ constructor(protected readonly service: ContratoService) {
+ super(service);
+ }
+}
diff --git a/apps/maestri-edu-server/src/contrato/contrato.module.ts b/apps/maestri-edu-server/src/contrato/contrato.module.ts
new file mode 100644
index 0000000..3276bb7
--- /dev/null
+++ b/apps/maestri-edu-server/src/contrato/contrato.module.ts
@@ -0,0 +1,13 @@
+import { Module } from "@nestjs/common";
+import { ContratoModuleBase } from "./base/contrato.module.base";
+import { ContratoService } from "./contrato.service";
+import { ContratoController } from "./contrato.controller";
+import { ContratoResolver } from "./contrato.resolver";
+
+@Module({
+ imports: [ContratoModuleBase],
+ controllers: [ContratoController],
+ providers: [ContratoService, ContratoResolver],
+ exports: [ContratoService],
+})
+export class ContratoModule {}
diff --git a/apps/maestri-edu-server/src/contrato/contrato.resolver.ts b/apps/maestri-edu-server/src/contrato/contrato.resolver.ts
new file mode 100644
index 0000000..17dba32
--- /dev/null
+++ b/apps/maestri-edu-server/src/contrato/contrato.resolver.ts
@@ -0,0 +1,11 @@
+import * as graphql from "@nestjs/graphql";
+import { ContratoResolverBase } from "./base/contrato.resolver.base";
+import { Contrato } from "./base/Contrato";
+import { ContratoService } from "./contrato.service";
+
+@graphql.Resolver(() => Contrato)
+export class ContratoResolver extends ContratoResolverBase {
+ constructor(protected readonly service: ContratoService) {
+ super(service);
+ }
+}
diff --git a/apps/maestri-edu-server/src/contrato/contrato.service.ts b/apps/maestri-edu-server/src/contrato/contrato.service.ts
new file mode 100644
index 0000000..7cec7e1
--- /dev/null
+++ b/apps/maestri-edu-server/src/contrato/contrato.service.ts
@@ -0,0 +1,10 @@
+import { Injectable } from "@nestjs/common";
+import { PrismaService } from "../prisma/prisma.service";
+import { ContratoServiceBase } from "./base/contrato.service.base";
+
+@Injectable()
+export class ContratoService extends ContratoServiceBase {
+ constructor(protected readonly prisma: PrismaService) {
+ super(prisma);
+ }
+}
diff --git a/apps/maestri-edu-server/src/curso/base/CreateCursoArgs.ts b/apps/maestri-edu-server/src/curso/base/CreateCursoArgs.ts
new file mode 100644
index 0000000..f382904
--- /dev/null
+++ b/apps/maestri-edu-server/src/curso/base/CreateCursoArgs.ts
@@ -0,0 +1,30 @@
+/*
+------------------------------------------------------------------------------
+This code was generated by Amplication.
+
+Changes to this file will be lost if the code is regenerated.
+
+There are other ways to to customize your code, see this doc to learn more
+https://docs.amplication.com/how-to/custom-code
+
+------------------------------------------------------------------------------
+ */
+import { ArgsType, Field } from "@nestjs/graphql";
+import { ApiProperty } from "@nestjs/swagger";
+import { CursoCreateInput } from "./CursoCreateInput";
+import { ValidateNested } from "class-validator";
+import { Type } from "class-transformer";
+
+@ArgsType()
+class CreateCursoArgs {
+ @ApiProperty({
+ required: true,
+ type: () => CursoCreateInput,
+ })
+ @ValidateNested()
+ @Type(() => CursoCreateInput)
+ @Field(() => CursoCreateInput, { nullable: false })
+ data!: CursoCreateInput;
+}
+
+export { CreateCursoArgs as CreateCursoArgs };
diff --git a/apps/maestri-edu-server/src/curso/base/Curso.ts b/apps/maestri-edu-server/src/curso/base/Curso.ts
new file mode 100644
index 0000000..6e196dc
--- /dev/null
+++ b/apps/maestri-edu-server/src/curso/base/Curso.ts
@@ -0,0 +1,54 @@
+/*
+------------------------------------------------------------------------------
+This code was generated by Amplication.
+
+Changes to this file will be lost if the code is regenerated.
+
+There are other ways to to customize your code, see this doc to learn more
+https://docs.amplication.com/how-to/custom-code
+
+------------------------------------------------------------------------------
+ */
+import { ObjectType, Field } from "@nestjs/graphql";
+import { ApiProperty } from "@nestjs/swagger";
+import { IsDate, IsString, ValidateNested, IsOptional } from "class-validator";
+import { Type } from "class-transformer";
+import { Matricula } from "../../matricula/base/Matricula";
+
+@ObjectType()
+class Curso {
+ @ApiProperty({
+ required: true,
+ })
+ @IsDate()
+ @Type(() => Date)
+ @Field(() => Date)
+ createdAt!: Date;
+
+ @ApiProperty({
+ required: true,
+ type: String,
+ })
+ @IsString()
+ @Field(() => String)
+ id!: string;
+
+ @ApiProperty({
+ required: false,
+ type: () => [Matricula],
+ })
+ @ValidateNested()
+ @Type(() => Matricula)
+ @IsOptional()
+ matriculas?: Array;
+
+ @ApiProperty({
+ required: true,
+ })
+ @IsDate()
+ @Type(() => Date)
+ @Field(() => Date)
+ updatedAt!: Date;
+}
+
+export { Curso as Curso };
diff --git a/apps/maestri-edu-server/src/curso/base/CursoCountArgs.ts b/apps/maestri-edu-server/src/curso/base/CursoCountArgs.ts
new file mode 100644
index 0000000..d018cc9
--- /dev/null
+++ b/apps/maestri-edu-server/src/curso/base/CursoCountArgs.ts
@@ -0,0 +1,28 @@
+/*
+------------------------------------------------------------------------------
+This code was generated by Amplication.
+
+Changes to this file will be lost if the code is regenerated.
+
+There are other ways to to customize your code, see this doc to learn more
+https://docs.amplication.com/how-to/custom-code
+
+------------------------------------------------------------------------------
+ */
+import { ArgsType, Field } from "@nestjs/graphql";
+import { ApiProperty } from "@nestjs/swagger";
+import { CursoWhereInput } from "./CursoWhereInput";
+import { Type } from "class-transformer";
+
+@ArgsType()
+class CursoCountArgs {
+ @ApiProperty({
+ required: false,
+ type: () => CursoWhereInput,
+ })
+ @Field(() => CursoWhereInput, { nullable: true })
+ @Type(() => CursoWhereInput)
+ where?: CursoWhereInput;
+}
+
+export { CursoCountArgs as CursoCountArgs };
diff --git a/apps/maestri-edu-server/src/curso/base/CursoCreateInput.ts b/apps/maestri-edu-server/src/curso/base/CursoCreateInput.ts
new file mode 100644
index 0000000..75ab0b7
--- /dev/null
+++ b/apps/maestri-edu-server/src/curso/base/CursoCreateInput.ts
@@ -0,0 +1,33 @@
+/*
+------------------------------------------------------------------------------
+This code was generated by Amplication.
+
+Changes to this file will be lost if the code is regenerated.
+
+There are other ways to to customize your code, see this doc to learn more
+https://docs.amplication.com/how-to/custom-code
+
+------------------------------------------------------------------------------
+ */
+import { InputType, Field } from "@nestjs/graphql";
+import { ApiProperty } from "@nestjs/swagger";
+import { MatriculaCreateNestedManyWithoutCursosInput } from "./MatriculaCreateNestedManyWithoutCursosInput";
+import { ValidateNested, IsOptional } from "class-validator";
+import { Type } from "class-transformer";
+
+@InputType()
+class CursoCreateInput {
+ @ApiProperty({
+ required: false,
+ type: () => MatriculaCreateNestedManyWithoutCursosInput,
+ })
+ @ValidateNested()
+ @Type(() => MatriculaCreateNestedManyWithoutCursosInput)
+ @IsOptional()
+ @Field(() => MatriculaCreateNestedManyWithoutCursosInput, {
+ nullable: true,
+ })
+ matriculas?: MatriculaCreateNestedManyWithoutCursosInput;
+}
+
+export { CursoCreateInput as CursoCreateInput };
diff --git a/apps/maestri-edu-server/src/curso/base/CursoFindManyArgs.ts b/apps/maestri-edu-server/src/curso/base/CursoFindManyArgs.ts
new file mode 100644
index 0000000..9cf6609
--- /dev/null
+++ b/apps/maestri-edu-server/src/curso/base/CursoFindManyArgs.ts
@@ -0,0 +1,62 @@
+/*
+------------------------------------------------------------------------------
+This code was generated by Amplication.
+
+Changes to this file will be lost if the code is regenerated.
+
+There are other ways to to customize your code, see this doc to learn more
+https://docs.amplication.com/how-to/custom-code
+
+------------------------------------------------------------------------------
+ */
+import { ArgsType, Field } from "@nestjs/graphql";
+import { ApiProperty } from "@nestjs/swagger";
+import { CursoWhereInput } from "./CursoWhereInput";
+import { IsOptional, ValidateNested, IsInt } from "class-validator";
+import { Type } from "class-transformer";
+import { CursoOrderByInput } from "./CursoOrderByInput";
+
+@ArgsType()
+class CursoFindManyArgs {
+ @ApiProperty({
+ required: false,
+ type: () => CursoWhereInput,
+ })
+ @IsOptional()
+ @ValidateNested()
+ @Field(() => CursoWhereInput, { nullable: true })
+ @Type(() => CursoWhereInput)
+ where?: CursoWhereInput;
+
+ @ApiProperty({
+ required: false,
+ type: [CursoOrderByInput],
+ })
+ @IsOptional()
+ @ValidateNested({ each: true })
+ @Field(() => [CursoOrderByInput], { nullable: true })
+ @Type(() => CursoOrderByInput)
+ orderBy?: Array;
+
+ @ApiProperty({
+ required: false,
+ type: Number,
+ })
+ @IsOptional()
+ @IsInt()
+ @Field(() => Number, { nullable: true })
+ @Type(() => Number)
+ skip?: number;
+
+ @ApiProperty({
+ required: false,
+ type: Number,
+ })
+ @IsOptional()
+ @IsInt()
+ @Field(() => Number, { nullable: true })
+ @Type(() => Number)
+ take?: number;
+}
+
+export { CursoFindManyArgs as CursoFindManyArgs };
diff --git a/apps/maestri-edu-server/src/curso/base/CursoFindUniqueArgs.ts b/apps/maestri-edu-server/src/curso/base/CursoFindUniqueArgs.ts
new file mode 100644
index 0000000..b0ffe2f
--- /dev/null
+++ b/apps/maestri-edu-server/src/curso/base/CursoFindUniqueArgs.ts
@@ -0,0 +1,30 @@
+/*
+------------------------------------------------------------------------------
+This code was generated by Amplication.
+
+Changes to this file will be lost if the code is regenerated.
+
+There are other ways to to customize your code, see this doc to learn more
+https://docs.amplication.com/how-to/custom-code
+
+------------------------------------------------------------------------------
+ */
+import { ArgsType, Field } from "@nestjs/graphql";
+import { ApiProperty } from "@nestjs/swagger";
+import { CursoWhereUniqueInput } from "./CursoWhereUniqueInput";
+import { ValidateNested } from "class-validator";
+import { Type } from "class-transformer";
+
+@ArgsType()
+class CursoFindUniqueArgs {
+ @ApiProperty({
+ required: true,
+ type: () => CursoWhereUniqueInput,
+ })
+ @ValidateNested()
+ @Type(() => CursoWhereUniqueInput)
+ @Field(() => CursoWhereUniqueInput, { nullable: false })
+ where!: CursoWhereUniqueInput;
+}
+
+export { CursoFindUniqueArgs as CursoFindUniqueArgs };
diff --git a/apps/maestri-edu-server/src/curso/base/CursoListRelationFilter.ts b/apps/maestri-edu-server/src/curso/base/CursoListRelationFilter.ts
new file mode 100644
index 0000000..9a38078
--- /dev/null
+++ b/apps/maestri-edu-server/src/curso/base/CursoListRelationFilter.ts
@@ -0,0 +1,56 @@
+/*
+------------------------------------------------------------------------------
+This code was generated by Amplication.
+
+Changes to this file will be lost if the code is regenerated.
+
+There are other ways to to customize your code, see this doc to learn more
+https://docs.amplication.com/how-to/custom-code
+
+------------------------------------------------------------------------------
+ */
+import { InputType, Field } from "@nestjs/graphql";
+import { ApiProperty } from "@nestjs/swagger";
+import { CursoWhereInput } from "./CursoWhereInput";
+import { ValidateNested, IsOptional } from "class-validator";
+import { Type } from "class-transformer";
+
+@InputType()
+class CursoListRelationFilter {
+ @ApiProperty({
+ required: false,
+ type: () => CursoWhereInput,
+ })
+ @ValidateNested()
+ @Type(() => CursoWhereInput)
+ @IsOptional()
+ @Field(() => CursoWhereInput, {
+ nullable: true,
+ })
+ every?: CursoWhereInput;
+
+ @ApiProperty({
+ required: false,
+ type: () => CursoWhereInput,
+ })
+ @ValidateNested()
+ @Type(() => CursoWhereInput)
+ @IsOptional()
+ @Field(() => CursoWhereInput, {
+ nullable: true,
+ })
+ some?: CursoWhereInput;
+
+ @ApiProperty({
+ required: false,
+ type: () => CursoWhereInput,
+ })
+ @ValidateNested()
+ @Type(() => CursoWhereInput)
+ @IsOptional()
+ @Field(() => CursoWhereInput, {
+ nullable: true,
+ })
+ none?: CursoWhereInput;
+}
+export { CursoListRelationFilter as CursoListRelationFilter };
diff --git a/apps/maestri-edu-server/src/curso/base/CursoOrderByInput.ts b/apps/maestri-edu-server/src/curso/base/CursoOrderByInput.ts
new file mode 100644
index 0000000..b470236
--- /dev/null
+++ b/apps/maestri-edu-server/src/curso/base/CursoOrderByInput.ts
@@ -0,0 +1,56 @@
+/*
+------------------------------------------------------------------------------
+This code was generated by Amplication.
+
+Changes to this file will be lost if the code is regenerated.
+
+There are other ways to to customize your code, see this doc to learn more
+https://docs.amplication.com/how-to/custom-code
+
+------------------------------------------------------------------------------
+ */
+import { InputType, Field } from "@nestjs/graphql";
+import { ApiProperty } from "@nestjs/swagger";
+import { IsOptional, IsEnum } from "class-validator";
+import { SortOrder } from "../../util/SortOrder";
+
+@InputType({
+ isAbstract: true,
+ description: undefined,
+})
+class CursoOrderByInput {
+ @ApiProperty({
+ required: false,
+ enum: ["asc", "desc"],
+ })
+ @IsOptional()
+ @IsEnum(SortOrder)
+ @Field(() => SortOrder, {
+ nullable: true,
+ })
+ createdAt?: SortOrder;
+
+ @ApiProperty({
+ required: false,
+ enum: ["asc", "desc"],
+ })
+ @IsOptional()
+ @IsEnum(SortOrder)
+ @Field(() => SortOrder, {
+ nullable: true,
+ })
+ id?: SortOrder;
+
+ @ApiProperty({
+ required: false,
+ enum: ["asc", "desc"],
+ })
+ @IsOptional()
+ @IsEnum(SortOrder)
+ @Field(() => SortOrder, {
+ nullable: true,
+ })
+ updatedAt?: SortOrder;
+}
+
+export { CursoOrderByInput as CursoOrderByInput };
diff --git a/apps/maestri-edu-server/src/curso/base/CursoUpdateInput.ts b/apps/maestri-edu-server/src/curso/base/CursoUpdateInput.ts
new file mode 100644
index 0000000..4616abb
--- /dev/null
+++ b/apps/maestri-edu-server/src/curso/base/CursoUpdateInput.ts
@@ -0,0 +1,33 @@
+/*
+------------------------------------------------------------------------------
+This code was generated by Amplication.
+
+Changes to this file will be lost if the code is regenerated.
+
+There are other ways to to customize your code, see this doc to learn more
+https://docs.amplication.com/how-to/custom-code
+
+------------------------------------------------------------------------------
+ */
+import { InputType, Field } from "@nestjs/graphql";
+import { ApiProperty } from "@nestjs/swagger";
+import { MatriculaUpdateManyWithoutCursosInput } from "./MatriculaUpdateManyWithoutCursosInput";
+import { ValidateNested, IsOptional } from "class-validator";
+import { Type } from "class-transformer";
+
+@InputType()
+class CursoUpdateInput {
+ @ApiProperty({
+ required: false,
+ type: () => MatriculaUpdateManyWithoutCursosInput,
+ })
+ @ValidateNested()
+ @Type(() => MatriculaUpdateManyWithoutCursosInput)
+ @IsOptional()
+ @Field(() => MatriculaUpdateManyWithoutCursosInput, {
+ nullable: true,
+ })
+ matriculas?: MatriculaUpdateManyWithoutCursosInput;
+}
+
+export { CursoUpdateInput as CursoUpdateInput };
diff --git a/apps/maestri-edu-server/src/curso/base/CursoWhereInput.ts b/apps/maestri-edu-server/src/curso/base/CursoWhereInput.ts
new file mode 100644
index 0000000..e7daf92
--- /dev/null
+++ b/apps/maestri-edu-server/src/curso/base/CursoWhereInput.ts
@@ -0,0 +1,45 @@
+/*
+------------------------------------------------------------------------------
+This code was generated by Amplication.
+
+Changes to this file will be lost if the code is regenerated.
+
+There are other ways to to customize your code, see this doc to learn more
+https://docs.amplication.com/how-to/custom-code
+
+------------------------------------------------------------------------------
+ */
+import { InputType, Field } from "@nestjs/graphql";
+import { ApiProperty } from "@nestjs/swagger";
+import { StringFilter } from "../../util/StringFilter";
+import { Type } from "class-transformer";
+import { IsOptional, ValidateNested } from "class-validator";
+import { MatriculaListRelationFilter } from "../../matricula/base/MatriculaListRelationFilter";
+
+@InputType()
+class CursoWhereInput {
+ @ApiProperty({
+ required: false,
+ type: StringFilter,
+ })
+ @Type(() => StringFilter)
+ @IsOptional()
+ @Field(() => StringFilter, {
+ nullable: true,
+ })
+ id?: StringFilter;
+
+ @ApiProperty({
+ required: false,
+ type: () => MatriculaListRelationFilter,
+ })
+ @ValidateNested()
+ @Type(() => MatriculaListRelationFilter)
+ @IsOptional()
+ @Field(() => MatriculaListRelationFilter, {
+ nullable: true,
+ })
+ matriculas?: MatriculaListRelationFilter;
+}
+
+export { CursoWhereInput as CursoWhereInput };
diff --git a/apps/maestri-edu-server/src/curso/base/CursoWhereUniqueInput.ts b/apps/maestri-edu-server/src/curso/base/CursoWhereUniqueInput.ts
new file mode 100644
index 0000000..aec8208
--- /dev/null
+++ b/apps/maestri-edu-server/src/curso/base/CursoWhereUniqueInput.ts
@@ -0,0 +1,27 @@
+/*
+------------------------------------------------------------------------------
+This code was generated by Amplication.
+
+Changes to this file will be lost if the code is regenerated.
+
+There are other ways to to customize your code, see this doc to learn more
+https://docs.amplication.com/how-to/custom-code
+
+------------------------------------------------------------------------------
+ */
+import { InputType, Field } from "@nestjs/graphql";
+import { ApiProperty } from "@nestjs/swagger";
+import { IsString } from "class-validator";
+
+@InputType()
+class CursoWhereUniqueInput {
+ @ApiProperty({
+ required: true,
+ type: String,
+ })
+ @IsString()
+ @Field(() => String)
+ id!: string;
+}
+
+export { CursoWhereUniqueInput as CursoWhereUniqueInput };
diff --git a/apps/maestri-edu-server/src/curso/base/DeleteCursoArgs.ts b/apps/maestri-edu-server/src/curso/base/DeleteCursoArgs.ts
new file mode 100644
index 0000000..d7c8270
--- /dev/null
+++ b/apps/maestri-edu-server/src/curso/base/DeleteCursoArgs.ts
@@ -0,0 +1,30 @@
+/*
+------------------------------------------------------------------------------
+This code was generated by Amplication.
+
+Changes to this file will be lost if the code is regenerated.
+
+There are other ways to to customize your code, see this doc to learn more
+https://docs.amplication.com/how-to/custom-code
+
+------------------------------------------------------------------------------
+ */
+import { ArgsType, Field } from "@nestjs/graphql";
+import { ApiProperty } from "@nestjs/swagger";
+import { CursoWhereUniqueInput } from "./CursoWhereUniqueInput";
+import { ValidateNested } from "class-validator";
+import { Type } from "class-transformer";
+
+@ArgsType()
+class DeleteCursoArgs {
+ @ApiProperty({
+ required: true,
+ type: () => CursoWhereUniqueInput,
+ })
+ @ValidateNested()
+ @Type(() => CursoWhereUniqueInput)
+ @Field(() => CursoWhereUniqueInput, { nullable: false })
+ where!: CursoWhereUniqueInput;
+}
+
+export { DeleteCursoArgs as DeleteCursoArgs };
diff --git a/apps/maestri-edu-server/src/curso/base/MatriculaCreateNestedManyWithoutCursosInput.ts b/apps/maestri-edu-server/src/curso/base/MatriculaCreateNestedManyWithoutCursosInput.ts
new file mode 100644
index 0000000..508bc8c
--- /dev/null
+++ b/apps/maestri-edu-server/src/curso/base/MatriculaCreateNestedManyWithoutCursosInput.ts
@@ -0,0 +1,28 @@
+/*
+------------------------------------------------------------------------------
+This code was generated by Amplication.
+
+Changes to this file will be lost if the code is regenerated.
+
+There are other ways to to customize your code, see this doc to learn more
+https://docs.amplication.com/how-to/custom-code
+
+------------------------------------------------------------------------------
+ */
+import { InputType, Field } from "@nestjs/graphql";
+import { MatriculaWhereUniqueInput } from "../../matricula/base/MatriculaWhereUniqueInput";
+import { ApiProperty } from "@nestjs/swagger";
+
+@InputType()
+class MatriculaCreateNestedManyWithoutCursosInput {
+ @Field(() => [MatriculaWhereUniqueInput], {
+ nullable: true,
+ })
+ @ApiProperty({
+ required: false,
+ type: () => [MatriculaWhereUniqueInput],
+ })
+ connect?: Array;
+}
+
+export { MatriculaCreateNestedManyWithoutCursosInput as MatriculaCreateNestedManyWithoutCursosInput };
diff --git a/apps/maestri-edu-server/src/curso/base/MatriculaUpdateManyWithoutCursosInput.ts b/apps/maestri-edu-server/src/curso/base/MatriculaUpdateManyWithoutCursosInput.ts
new file mode 100644
index 0000000..bc6f9b3
--- /dev/null
+++ b/apps/maestri-edu-server/src/curso/base/MatriculaUpdateManyWithoutCursosInput.ts
@@ -0,0 +1,46 @@
+/*
+------------------------------------------------------------------------------
+This code was generated by Amplication.
+
+Changes to this file will be lost if the code is regenerated.
+
+There are other ways to to customize your code, see this doc to learn more
+https://docs.amplication.com/how-to/custom-code
+
+------------------------------------------------------------------------------
+ */
+import { InputType, Field } from "@nestjs/graphql";
+import { MatriculaWhereUniqueInput } from "../../matricula/base/MatriculaWhereUniqueInput";
+import { ApiProperty } from "@nestjs/swagger";
+
+@InputType()
+class MatriculaUpdateManyWithoutCursosInput {
+ @Field(() => [MatriculaWhereUniqueInput], {
+ nullable: true,
+ })
+ @ApiProperty({
+ required: false,
+ type: () => [MatriculaWhereUniqueInput],
+ })
+ connect?: Array;
+
+ @Field(() => [MatriculaWhereUniqueInput], {
+ nullable: true,
+ })
+ @ApiProperty({
+ required: false,
+ type: () => [MatriculaWhereUniqueInput],
+ })
+ disconnect?: Array;
+
+ @Field(() => [MatriculaWhereUniqueInput], {
+ nullable: true,
+ })
+ @ApiProperty({
+ required: false,
+ type: () => [MatriculaWhereUniqueInput],
+ })
+ set?: Array;
+}
+
+export { MatriculaUpdateManyWithoutCursosInput as MatriculaUpdateManyWithoutCursosInput };
diff --git a/apps/maestri-edu-server/src/curso/base/UpdateCursoArgs.ts b/apps/maestri-edu-server/src/curso/base/UpdateCursoArgs.ts
new file mode 100644
index 0000000..ad48b8f
--- /dev/null
+++ b/apps/maestri-edu-server/src/curso/base/UpdateCursoArgs.ts
@@ -0,0 +1,40 @@
+/*
+------------------------------------------------------------------------------
+This code was generated by Amplication.
+
+Changes to this file will be lost if the code is regenerated.
+
+There are other ways to to customize your code, see this doc to learn more
+https://docs.amplication.com/how-to/custom-code
+
+------------------------------------------------------------------------------
+ */
+import { ArgsType, Field } from "@nestjs/graphql";
+import { ApiProperty } from "@nestjs/swagger";
+import { CursoWhereUniqueInput } from "./CursoWhereUniqueInput";
+import { ValidateNested } from "class-validator";
+import { Type } from "class-transformer";
+import { CursoUpdateInput } from "./CursoUpdateInput";
+
+@ArgsType()
+class UpdateCursoArgs {
+ @ApiProperty({
+ required: true,
+ type: () => CursoWhereUniqueInput,
+ })
+ @ValidateNested()
+ @Type(() => CursoWhereUniqueInput)
+ @Field(() => CursoWhereUniqueInput, { nullable: false })
+ where!: CursoWhereUniqueInput;
+
+ @ApiProperty({
+ required: true,
+ type: () => CursoUpdateInput,
+ })
+ @ValidateNested()
+ @Type(() => CursoUpdateInput)
+ @Field(() => CursoUpdateInput, { nullable: false })
+ data!: CursoUpdateInput;
+}
+
+export { UpdateCursoArgs as UpdateCursoArgs };
diff --git a/apps/maestri-edu-server/src/curso/base/curso.controller.base.spec.ts b/apps/maestri-edu-server/src/curso/base/curso.controller.base.spec.ts
new file mode 100644
index 0000000..e843f45
--- /dev/null
+++ b/apps/maestri-edu-server/src/curso/base/curso.controller.base.spec.ts
@@ -0,0 +1,190 @@
+import { Test } from "@nestjs/testing";
+import {
+ INestApplication,
+ HttpStatus,
+ ExecutionContext,
+ CallHandler,
+} from "@nestjs/common";
+import request from "supertest";
+import { ACGuard } from "nest-access-control";
+import { DefaultAuthGuard } from "../../auth/defaultAuth.guard";
+import { ACLModule } from "../../auth/acl.module";
+import { AclFilterResponseInterceptor } from "../../interceptors/aclFilterResponse.interceptor";
+import { AclValidateRequestInterceptor } from "../../interceptors/aclValidateRequest.interceptor";
+import { map } from "rxjs";
+import { CursoController } from "../curso.controller";
+import { CursoService } from "../curso.service";
+
+const nonExistingId = "nonExistingId";
+const existingId = "existingId";
+const CREATE_INPUT = {
+ createdAt: new Date(),
+ id: "exampleId",
+ updatedAt: new Date(),
+};
+const CREATE_RESULT = {
+ createdAt: new Date(),
+ id: "exampleId",
+ updatedAt: new Date(),
+};
+const FIND_MANY_RESULT = [
+ {
+ createdAt: new Date(),
+ id: "exampleId",
+ updatedAt: new Date(),
+ },
+];
+const FIND_ONE_RESULT = {
+ createdAt: new Date(),
+ id: "exampleId",
+ updatedAt: new Date(),
+};
+
+const service = {
+ createCurso() {
+ return CREATE_RESULT;
+ },
+ cursos: () => FIND_MANY_RESULT,
+ curso: ({ where }: { where: { id: string } }) => {
+ switch (where.id) {
+ case existingId:
+ return FIND_ONE_RESULT;
+ case nonExistingId:
+ return null;
+ }
+ },
+};
+
+const basicAuthGuard = {
+ canActivate: (context: ExecutionContext) => {
+ const argumentHost = context.switchToHttp();
+ const request = argumentHost.getRequest();
+ request.user = {
+ roles: ["user"],
+ };
+ return true;
+ },
+};
+
+const acGuard = {
+ canActivate: () => {
+ return true;
+ },
+};
+
+const aclFilterResponseInterceptor = {
+ intercept: (context: ExecutionContext, next: CallHandler) => {
+ return next.handle().pipe(
+ map((data) => {
+ return data;
+ })
+ );
+ },
+};
+const aclValidateRequestInterceptor = {
+ intercept: (context: ExecutionContext, next: CallHandler) => {
+ return next.handle();
+ },
+};
+
+describe("Curso", () => {
+ let app: INestApplication;
+
+ beforeAll(async () => {
+ const moduleRef = await Test.createTestingModule({
+ providers: [
+ {
+ provide: CursoService,
+ useValue: service,
+ },
+ ],
+ controllers: [CursoController],
+ imports: [ACLModule],
+ })
+ .overrideGuard(DefaultAuthGuard)
+ .useValue(basicAuthGuard)
+ .overrideGuard(ACGuard)
+ .useValue(acGuard)
+ .overrideInterceptor(AclFilterResponseInterceptor)
+ .useValue(aclFilterResponseInterceptor)
+ .overrideInterceptor(AclValidateRequestInterceptor)
+ .useValue(aclValidateRequestInterceptor)
+ .compile();
+
+ app = moduleRef.createNestApplication();
+ await app.init();
+ });
+
+ test("POST /cursos", async () => {
+ await request(app.getHttpServer())
+ .post("/cursos")
+ .send(CREATE_INPUT)
+ .expect(HttpStatus.CREATED)
+ .expect({
+ ...CREATE_RESULT,
+ createdAt: CREATE_RESULT.createdAt.toISOString(),
+ updatedAt: CREATE_RESULT.updatedAt.toISOString(),
+ });
+ });
+
+ test("GET /cursos", async () => {
+ await request(app.getHttpServer())
+ .get("/cursos")
+ .expect(HttpStatus.OK)
+ .expect([
+ {
+ ...FIND_MANY_RESULT[0],
+ createdAt: FIND_MANY_RESULT[0].createdAt.toISOString(),
+ updatedAt: FIND_MANY_RESULT[0].updatedAt.toISOString(),
+ },
+ ]);
+ });
+
+ test("GET /cursos/:id non existing", async () => {
+ await request(app.getHttpServer())
+ .get(`${"/cursos"}/${nonExistingId}`)
+ .expect(HttpStatus.NOT_FOUND)
+ .expect({
+ statusCode: HttpStatus.NOT_FOUND,
+ message: `No resource was found for {"${"id"}":"${nonExistingId}"}`,
+ error: "Not Found",
+ });
+ });
+
+ test("GET /cursos/:id existing", async () => {
+ await request(app.getHttpServer())
+ .get(`${"/cursos"}/${existingId}`)
+ .expect(HttpStatus.OK)
+ .expect({
+ ...FIND_ONE_RESULT,
+ createdAt: FIND_ONE_RESULT.createdAt.toISOString(),
+ updatedAt: FIND_ONE_RESULT.updatedAt.toISOString(),
+ });
+ });
+
+ test("POST /cursos existing resource", async () => {
+ const agent = request(app.getHttpServer());
+ await agent
+ .post("/cursos")
+ .send(CREATE_INPUT)
+ .expect(HttpStatus.CREATED)
+ .expect({
+ ...CREATE_RESULT,
+ createdAt: CREATE_RESULT.createdAt.toISOString(),
+ updatedAt: CREATE_RESULT.updatedAt.toISOString(),
+ })
+ .then(function () {
+ agent
+ .post("/cursos")
+ .send(CREATE_INPUT)
+ .expect(HttpStatus.CONFLICT)
+ .expect({
+ statusCode: HttpStatus.CONFLICT,
+ });
+ });
+ });
+
+ afterAll(async () => {
+ await app.close();
+ });
+});
diff --git a/apps/maestri-edu-server/src/curso/base/curso.controller.base.ts b/apps/maestri-edu-server/src/curso/base/curso.controller.base.ts
new file mode 100644
index 0000000..111538a
--- /dev/null
+++ b/apps/maestri-edu-server/src/curso/base/curso.controller.base.ts
@@ -0,0 +1,230 @@
+/*
+------------------------------------------------------------------------------
+This code was generated by Amplication.
+
+Changes to this file will be lost if the code is regenerated.
+
+There are other ways to to customize your code, see this doc to learn more
+https://docs.amplication.com/how-to/custom-code
+
+------------------------------------------------------------------------------
+ */
+import * as common from "@nestjs/common";
+import * as swagger from "@nestjs/swagger";
+import { isRecordNotFoundError } from "../../prisma.util";
+import * as errors from "../../errors";
+import { Request } from "express";
+import { plainToClass } from "class-transformer";
+import { ApiNestedQuery } from "../../decorators/api-nested-query.decorator";
+import { CursoService } from "../curso.service";
+import { CursoCreateInput } from "./CursoCreateInput";
+import { Curso } from "./Curso";
+import { CursoFindManyArgs } from "./CursoFindManyArgs";
+import { CursoWhereUniqueInput } from "./CursoWhereUniqueInput";
+import { CursoUpdateInput } from "./CursoUpdateInput";
+import { MatriculaFindManyArgs } from "../../matricula/base/MatriculaFindManyArgs";
+import { Matricula } from "../../matricula/base/Matricula";
+import { MatriculaWhereUniqueInput } from "../../matricula/base/MatriculaWhereUniqueInput";
+
+export class CursoControllerBase {
+ constructor(protected readonly service: CursoService) {}
+ @common.Post()
+ @swagger.ApiCreatedResponse({ type: Curso })
+ async createCurso(@common.Body() data: CursoCreateInput): Promise {
+ return await this.service.createCurso({
+ data: data,
+ select: {
+ createdAt: true,
+ id: true,
+ updatedAt: true,
+ },
+ });
+ }
+
+ @common.Get()
+ @swagger.ApiOkResponse({ type: [Curso] })
+ @ApiNestedQuery(CursoFindManyArgs)
+ async cursos(@common.Req() request: Request): Promise {
+ const args = plainToClass(CursoFindManyArgs, request.query);
+ return this.service.cursos({
+ ...args,
+ select: {
+ createdAt: true,
+ id: true,
+ updatedAt: true,
+ },
+ });
+ }
+
+ @common.Get("/:id")
+ @swagger.ApiOkResponse({ type: Curso })
+ @swagger.ApiNotFoundResponse({ type: errors.NotFoundException })
+ async curso(
+ @common.Param() params: CursoWhereUniqueInput
+ ): Promise {
+ const result = await this.service.curso({
+ where: params,
+ select: {
+ createdAt: true,
+ id: true,
+ updatedAt: true,
+ },
+ });
+ if (result === null) {
+ throw new errors.NotFoundException(
+ `No resource was found for ${JSON.stringify(params)}`
+ );
+ }
+ return result;
+ }
+
+ @common.Patch("/:id")
+ @swagger.ApiOkResponse({ type: Curso })
+ @swagger.ApiNotFoundResponse({ type: errors.NotFoundException })
+ async updateCurso(
+ @common.Param() params: CursoWhereUniqueInput,
+ @common.Body() data: CursoUpdateInput
+ ): Promise {
+ try {
+ return await this.service.updateCurso({
+ where: params,
+ data: data,
+ select: {
+ createdAt: true,
+ id: true,
+ updatedAt: true,
+ },
+ });
+ } catch (error) {
+ if (isRecordNotFoundError(error)) {
+ throw new errors.NotFoundException(
+ `No resource was found for ${JSON.stringify(params)}`
+ );
+ }
+ throw error;
+ }
+ }
+
+ @common.Delete("/:id")
+ @swagger.ApiOkResponse({ type: Curso })
+ @swagger.ApiNotFoundResponse({ type: errors.NotFoundException })
+ async deleteCurso(
+ @common.Param() params: CursoWhereUniqueInput
+ ): Promise {
+ try {
+ return await this.service.deleteCurso({
+ where: params,
+ select: {
+ createdAt: true,
+ id: true,
+ updatedAt: true,
+ },
+ });
+ } catch (error) {
+ if (isRecordNotFoundError(error)) {
+ throw new errors.NotFoundException(
+ `No resource was found for ${JSON.stringify(params)}`
+ );
+ }
+ throw error;
+ }
+ }
+
+ @common.Get("/:id/matriculas")
+ @ApiNestedQuery(MatriculaFindManyArgs)
+ async findMatriculas(
+ @common.Req() request: Request,
+ @common.Param() params: CursoWhereUniqueInput
+ ): Promise {
+ const query = plainToClass(MatriculaFindManyArgs, request.query);
+ const results = await this.service.findMatriculas(params.id, {
+ ...query,
+ select: {
+ aluno: true,
+ alunoId: true,
+ alunoReferencia: true,
+ classificacaoReferencia: true,
+ createdAt: true,
+
+ curso: {
+ select: {
+ id: true,
+ },
+ },
+
+ cursoReferencia: true,
+ id: true,
+ numeroParcelas: true,
+ parcelaAdimplente: true,
+ parcelaAdimplenteId: true,
+ parcelaAdimplenteReferencia: true,
+ promotor: true,
+ promotorId: true,
+ promotorReferencia: true,
+ status: true,
+ statusMatricula: true,
+ taxaMatricula: true,
+ taxaMatriculaId: true,
+ taxaMatriculaReferencia: true,
+ updatedAt: true,
+ },
+ });
+ if (results === null) {
+ throw new errors.NotFoundException(
+ `No resource was found for ${JSON.stringify(params)}`
+ );
+ }
+ return results;
+ }
+
+ @common.Post("/:id/matriculas")
+ async connectMatriculas(
+ @common.Param() params: CursoWhereUniqueInput,
+ @common.Body() body: MatriculaWhereUniqueInput[]
+ ): Promise {
+ const data = {
+ matriculas: {
+ connect: body,
+ },
+ };
+ await this.service.updateCurso({
+ where: params,
+ data,
+ select: { id: true },
+ });
+ }
+
+ @common.Patch("/:id/matriculas")
+ async updateMatriculas(
+ @common.Param() params: CursoWhereUniqueInput,
+ @common.Body() body: MatriculaWhereUniqueInput[]
+ ): Promise {
+ const data = {
+ matriculas: {
+ set: body,
+ },
+ };
+ await this.service.updateCurso({
+ where: params,
+ data,
+ select: { id: true },
+ });
+ }
+
+ @common.Delete("/:id/matriculas")
+ async disconnectMatriculas(
+ @common.Param() params: CursoWhereUniqueInput,
+ @common.Body() body: MatriculaWhereUniqueInput[]
+ ): Promise {
+ const data = {
+ matriculas: {
+ disconnect: body,
+ },
+ };
+ await this.service.updateCurso({
+ where: params,
+ data,
+ select: { id: true },
+ });
+ }
+}
diff --git a/apps/maestri-edu-server/src/curso/base/curso.module.base.ts b/apps/maestri-edu-server/src/curso/base/curso.module.base.ts
new file mode 100644
index 0000000..d953663
--- /dev/null
+++ b/apps/maestri-edu-server/src/curso/base/curso.module.base.ts
@@ -0,0 +1,18 @@
+/*
+------------------------------------------------------------------------------
+This code was generated by Amplication.
+
+Changes to this file will be lost if the code is regenerated.
+
+There are other ways to to customize your code, see this doc to learn more
+https://docs.amplication.com/how-to/custom-code
+
+------------------------------------------------------------------------------
+ */
+import { Module } from "@nestjs/common";
+
+@Module({
+ imports: [],
+ exports: [],
+})
+export class CursoModuleBase {}
diff --git a/apps/maestri-edu-server/src/curso/base/curso.resolver.base.ts b/apps/maestri-edu-server/src/curso/base/curso.resolver.base.ts
new file mode 100644
index 0000000..650016e
--- /dev/null
+++ b/apps/maestri-edu-server/src/curso/base/curso.resolver.base.ts
@@ -0,0 +1,111 @@
+/*
+------------------------------------------------------------------------------
+This code was generated by Amplication.
+
+Changes to this file will be lost if the code is regenerated.
+
+There are other ways to to customize your code, see this doc to learn more
+https://docs.amplication.com/how-to/custom-code
+
+------------------------------------------------------------------------------
+ */
+import * as graphql from "@nestjs/graphql";
+import { GraphQLError } from "graphql";
+import { isRecordNotFoundError } from "../../prisma.util";
+import { MetaQueryPayload } from "../../util/MetaQueryPayload";
+import { Curso } from "./Curso";
+import { CursoCountArgs } from "./CursoCountArgs";
+import { CursoFindManyArgs } from "./CursoFindManyArgs";
+import { CursoFindUniqueArgs } from "./CursoFindUniqueArgs";
+import { CreateCursoArgs } from "./CreateCursoArgs";
+import { UpdateCursoArgs } from "./UpdateCursoArgs";
+import { DeleteCursoArgs } from "./DeleteCursoArgs";
+import { MatriculaFindManyArgs } from "../../matricula/base/MatriculaFindManyArgs";
+import { Matricula } from "../../matricula/base/Matricula";
+import { CursoService } from "../curso.service";
+@graphql.Resolver(() => Curso)
+export class CursoResolverBase {
+ constructor(protected readonly service: CursoService) {}
+
+ async _cursosMeta(
+ @graphql.Args() args: CursoCountArgs
+ ): Promise {
+ const result = await this.service.count(args);
+ return {
+ count: result,
+ };
+ }
+
+ @graphql.Query(() => [Curso])
+ async cursos(@graphql.Args() args: CursoFindManyArgs): Promise {
+ return this.service.cursos(args);
+ }
+
+ @graphql.Query(() => Curso, { nullable: true })
+ async curso(
+ @graphql.Args() args: CursoFindUniqueArgs
+ ): Promise {
+ const result = await this.service.curso(args);
+ if (result === null) {
+ return null;
+ }
+ return result;
+ }
+
+ @graphql.Mutation(() => Curso)
+ async createCurso(@graphql.Args() args: CreateCursoArgs): Promise {
+ return await this.service.createCurso({
+ ...args,
+ data: args.data,
+ });
+ }
+
+ @graphql.Mutation(() => Curso)
+ async updateCurso(
+ @graphql.Args() args: UpdateCursoArgs
+ ): Promise {
+ try {
+ return await this.service.updateCurso({
+ ...args,
+ data: args.data,
+ });
+ } catch (error) {
+ if (isRecordNotFoundError(error)) {
+ throw new GraphQLError(
+ `No resource was found for ${JSON.stringify(args.where)}`
+ );
+ }
+ throw error;
+ }
+ }
+
+ @graphql.Mutation(() => Curso)
+ async deleteCurso(
+ @graphql.Args() args: DeleteCursoArgs
+ ): Promise {
+ try {
+ return await this.service.deleteCurso(args);
+ } catch (error) {
+ if (isRecordNotFoundError(error)) {
+ throw new GraphQLError(
+ `No resource was found for ${JSON.stringify(args.where)}`
+ );
+ }
+ throw error;
+ }
+ }
+
+ @graphql.ResolveField(() => [Matricula], { name: "matriculas" })
+ async findMatriculas(
+ @graphql.Parent() parent: Curso,
+ @graphql.Args() args: MatriculaFindManyArgs
+ ): Promise {
+ const results = await this.service.findMatriculas(parent.id, args);
+
+ if (!results) {
+ return [];
+ }
+
+ return results;
+ }
+}
diff --git a/apps/maestri-edu-server/src/curso/base/curso.service.base.ts b/apps/maestri-edu-server/src/curso/base/curso.service.base.ts
new file mode 100644
index 0000000..9812b4c
--- /dev/null
+++ b/apps/maestri-edu-server/src/curso/base/curso.service.base.ts
@@ -0,0 +1,52 @@
+/*
+------------------------------------------------------------------------------
+This code was generated by Amplication.
+
+Changes to this file will be lost if the code is regenerated.
+
+There are other ways to to customize your code, see this doc to learn more
+https://docs.amplication.com/how-to/custom-code
+
+------------------------------------------------------------------------------
+ */
+import { PrismaService } from "../../prisma/prisma.service";
+import {
+ Prisma,
+ Curso as PrismaCurso,
+ Matricula as PrismaMatricula,
+} from "@prisma/client";
+
+export class CursoServiceBase {
+ constructor(protected readonly prisma: PrismaService) {}
+
+ async count(args: Omit): Promise {
+ return this.prisma.curso.count(args);
+ }
+
+ async cursos(args: Prisma.CursoFindManyArgs): Promise {
+ return this.prisma.curso.findMany(args);
+ }
+ async curso(args: Prisma.CursoFindUniqueArgs): Promise {
+ return this.prisma.curso.findUnique(args);
+ }
+ async createCurso(args: Prisma.CursoCreateArgs): Promise {
+ return this.prisma.curso.create(args);
+ }
+ async updateCurso(args: Prisma.CursoUpdateArgs): Promise {
+ return this.prisma.curso.update(args);
+ }
+ async deleteCurso(args: Prisma.CursoDeleteArgs): Promise {
+ return this.prisma.curso.delete(args);
+ }
+
+ async findMatriculas(
+ parentId: string,
+ args: Prisma.MatriculaFindManyArgs
+ ): Promise {
+ return this.prisma.curso
+ .findUniqueOrThrow({
+ where: { id: parentId },
+ })
+ .matriculas(args);
+ }
+}
diff --git a/apps/maestri-edu-server/src/curso/curso.controller.ts b/apps/maestri-edu-server/src/curso/curso.controller.ts
new file mode 100644
index 0000000..470421f
--- /dev/null
+++ b/apps/maestri-edu-server/src/curso/curso.controller.ts
@@ -0,0 +1,12 @@
+import * as common from "@nestjs/common";
+import * as swagger from "@nestjs/swagger";
+import { CursoService } from "./curso.service";
+import { CursoControllerBase } from "./base/curso.controller.base";
+
+@swagger.ApiTags("cursos")
+@common.Controller("cursos")
+export class CursoController extends CursoControllerBase {
+ constructor(protected readonly service: CursoService) {
+ super(service);
+ }
+}
diff --git a/apps/maestri-edu-server/src/curso/curso.module.ts b/apps/maestri-edu-server/src/curso/curso.module.ts
new file mode 100644
index 0000000..3d25812
--- /dev/null
+++ b/apps/maestri-edu-server/src/curso/curso.module.ts
@@ -0,0 +1,13 @@
+import { Module } from "@nestjs/common";
+import { CursoModuleBase } from "./base/curso.module.base";
+import { CursoService } from "./curso.service";
+import { CursoController } from "./curso.controller";
+import { CursoResolver } from "./curso.resolver";
+
+@Module({
+ imports: [CursoModuleBase],
+ controllers: [CursoController],
+ providers: [CursoService, CursoResolver],
+ exports: [CursoService],
+})
+export class CursoModule {}
diff --git a/apps/maestri-edu-server/src/curso/curso.resolver.ts b/apps/maestri-edu-server/src/curso/curso.resolver.ts
new file mode 100644
index 0000000..8bccbaf
--- /dev/null
+++ b/apps/maestri-edu-server/src/curso/curso.resolver.ts
@@ -0,0 +1,11 @@
+import * as graphql from "@nestjs/graphql";
+import { CursoResolverBase } from "./base/curso.resolver.base";
+import { Curso } from "./base/Curso";
+import { CursoService } from "./curso.service";
+
+@graphql.Resolver(() => Curso)
+export class CursoResolver extends CursoResolverBase {
+ constructor(protected readonly service: CursoService) {
+ super(service);
+ }
+}
diff --git a/apps/maestri-edu-server/src/curso/curso.service.ts b/apps/maestri-edu-server/src/curso/curso.service.ts
new file mode 100644
index 0000000..bf6b659
--- /dev/null
+++ b/apps/maestri-edu-server/src/curso/curso.service.ts
@@ -0,0 +1,10 @@
+import { Injectable } from "@nestjs/common";
+import { PrismaService } from "../prisma/prisma.service";
+import { CursoServiceBase } from "./base/curso.service.base";
+
+@Injectable()
+export class CursoService extends CursoServiceBase {
+ constructor(protected readonly prisma: PrismaService) {
+ super(prisma);
+ }
+}
diff --git a/apps/maestri-edu-server/src/dadosEscolares/base/CreateDadosEscolaresArgs.ts b/apps/maestri-edu-server/src/dadosEscolares/base/CreateDadosEscolaresArgs.ts
new file mode 100644
index 0000000..735e067
--- /dev/null
+++ b/apps/maestri-edu-server/src/dadosEscolares/base/CreateDadosEscolaresArgs.ts
@@ -0,0 +1,30 @@
+/*
+------------------------------------------------------------------------------
+This code was generated by Amplication.
+
+Changes to this file will be lost if the code is regenerated.
+
+There are other ways to to customize your code, see this doc to learn more
+https://docs.amplication.com/how-to/custom-code
+
+------------------------------------------------------------------------------
+ */
+import { ArgsType, Field } from "@nestjs/graphql";
+import { ApiProperty } from "@nestjs/swagger";
+import { DadosEscolaresCreateInput } from "./DadosEscolaresCreateInput";
+import { ValidateNested } from "class-validator";
+import { Type } from "class-transformer";
+
+@ArgsType()
+class CreateDadosEscolaresArgs {
+ @ApiProperty({
+ required: true,
+ type: () => DadosEscolaresCreateInput,
+ })
+ @ValidateNested()
+ @Type(() => DadosEscolaresCreateInput)
+ @Field(() => DadosEscolaresCreateInput, { nullable: false })
+ data!: DadosEscolaresCreateInput;
+}
+
+export { CreateDadosEscolaresArgs as CreateDadosEscolaresArgs };
diff --git a/apps/maestri-edu-server/src/dadosEscolares/base/DadosEscolares.ts b/apps/maestri-edu-server/src/dadosEscolares/base/DadosEscolares.ts
new file mode 100644
index 0000000..ea141ad
--- /dev/null
+++ b/apps/maestri-edu-server/src/dadosEscolares/base/DadosEscolares.ts
@@ -0,0 +1,56 @@
+/*
+------------------------------------------------------------------------------
+This code was generated by Amplication.
+
+Changes to this file will be lost if the code is regenerated.
+
+There are other ways to to customize your code, see this doc to learn more
+https://docs.amplication.com/how-to/custom-code
+
+------------------------------------------------------------------------------
+ */
+import { ObjectType, Field } from "@nestjs/graphql";
+import { ApiProperty } from "@nestjs/swagger";
+import { IsDate, IsString, MaxLength, IsOptional } from "class-validator";
+import { Type } from "class-transformer";
+
+@ObjectType()
+class DadosEscolares {
+ @ApiProperty({
+ required: true,
+ })
+ @IsDate()
+ @Type(() => Date)
+ @Field(() => Date)
+ createdAt!: Date;
+
+ @ApiProperty({
+ required: true,
+ type: String,
+ })
+ @IsString()
+ @Field(() => String)
+ id!: string;
+
+ @ApiProperty({
+ required: false,
+ type: String,
+ })
+ @IsString()
+ @MaxLength(1000)
+ @IsOptional()
+ @Field(() => String, {
+ nullable: true,
+ })
+ perfilReferencia!: string | null;
+
+ @ApiProperty({
+ required: true,
+ })
+ @IsDate()
+ @Type(() => Date)
+ @Field(() => Date)
+ updatedAt!: Date;
+}
+
+export { DadosEscolares as DadosEscolares };
diff --git a/apps/maestri-edu-server/src/dadosEscolares/base/DadosEscolaresCountArgs.ts b/apps/maestri-edu-server/src/dadosEscolares/base/DadosEscolaresCountArgs.ts
new file mode 100644
index 0000000..7b4c16d
--- /dev/null
+++ b/apps/maestri-edu-server/src/dadosEscolares/base/DadosEscolaresCountArgs.ts
@@ -0,0 +1,28 @@
+/*
+------------------------------------------------------------------------------
+This code was generated by Amplication.
+
+Changes to this file will be lost if the code is regenerated.
+
+There are other ways to to customize your code, see this doc to learn more
+https://docs.amplication.com/how-to/custom-code
+
+------------------------------------------------------------------------------
+ */
+import { ArgsType, Field } from "@nestjs/graphql";
+import { ApiProperty } from "@nestjs/swagger";
+import { DadosEscolaresWhereInput } from "./DadosEscolaresWhereInput";
+import { Type } from "class-transformer";
+
+@ArgsType()
+class DadosEscolaresCountArgs {
+ @ApiProperty({
+ required: false,
+ type: () => DadosEscolaresWhereInput,
+ })
+ @Field(() => DadosEscolaresWhereInput, { nullable: true })
+ @Type(() => DadosEscolaresWhereInput)
+ where?: DadosEscolaresWhereInput;
+}
+
+export { DadosEscolaresCountArgs as DadosEscolaresCountArgs };
diff --git a/apps/maestri-edu-server/src/dadosEscolares/base/DadosEscolaresCreateInput.ts b/apps/maestri-edu-server/src/dadosEscolares/base/DadosEscolaresCreateInput.ts
new file mode 100644
index 0000000..063ba12
--- /dev/null
+++ b/apps/maestri-edu-server/src/dadosEscolares/base/DadosEscolaresCreateInput.ts
@@ -0,0 +1,31 @@
+/*
+------------------------------------------------------------------------------
+This code was generated by Amplication.
+
+Changes to this file will be lost if the code is regenerated.
+
+There are other ways to to customize your code, see this doc to learn more
+https://docs.amplication.com/how-to/custom-code
+
+------------------------------------------------------------------------------
+ */
+import { InputType, Field } from "@nestjs/graphql";
+import { ApiProperty } from "@nestjs/swagger";
+import { IsString, MaxLength, IsOptional } from "class-validator";
+
+@InputType()
+class DadosEscolaresCreateInput {
+ @ApiProperty({
+ required: false,
+ type: String,
+ })
+ @IsString()
+ @MaxLength(1000)
+ @IsOptional()
+ @Field(() => String, {
+ nullable: true,
+ })
+ perfilReferencia?: string | null;
+}
+
+export { DadosEscolaresCreateInput as DadosEscolaresCreateInput };
diff --git a/apps/maestri-edu-server/src/dadosEscolares/base/DadosEscolaresFindManyArgs.ts b/apps/maestri-edu-server/src/dadosEscolares/base/DadosEscolaresFindManyArgs.ts
new file mode 100644
index 0000000..8541b3d
--- /dev/null
+++ b/apps/maestri-edu-server/src/dadosEscolares/base/DadosEscolaresFindManyArgs.ts
@@ -0,0 +1,62 @@
+/*
+------------------------------------------------------------------------------
+This code was generated by Amplication.
+
+Changes to this file will be lost if the code is regenerated.
+
+There are other ways to to customize your code, see this doc to learn more
+https://docs.amplication.com/how-to/custom-code
+
+------------------------------------------------------------------------------
+ */
+import { ArgsType, Field } from "@nestjs/graphql";
+import { ApiProperty } from "@nestjs/swagger";
+import { DadosEscolaresWhereInput } from "./DadosEscolaresWhereInput";
+import { IsOptional, ValidateNested, IsInt } from "class-validator";
+import { Type } from "class-transformer";
+import { DadosEscolaresOrderByInput } from "./DadosEscolaresOrderByInput";
+
+@ArgsType()
+class DadosEscolaresFindManyArgs {
+ @ApiProperty({
+ required: false,
+ type: () => DadosEscolaresWhereInput,
+ })
+ @IsOptional()
+ @ValidateNested()
+ @Field(() => DadosEscolaresWhereInput, { nullable: true })
+ @Type(() => DadosEscolaresWhereInput)
+ where?: DadosEscolaresWhereInput;
+
+ @ApiProperty({
+ required: false,
+ type: [DadosEscolaresOrderByInput],
+ })
+ @IsOptional()
+ @ValidateNested({ each: true })
+ @Field(() => [DadosEscolaresOrderByInput], { nullable: true })
+ @Type(() => DadosEscolaresOrderByInput)
+ orderBy?: Array;
+
+ @ApiProperty({
+ required: false,
+ type: Number,
+ })
+ @IsOptional()
+ @IsInt()
+ @Field(() => Number, { nullable: true })
+ @Type(() => Number)
+ skip?: number;
+
+ @ApiProperty({
+ required: false,
+ type: Number,
+ })
+ @IsOptional()
+ @IsInt()
+ @Field(() => Number, { nullable: true })
+ @Type(() => Number)
+ take?: number;
+}
+
+export { DadosEscolaresFindManyArgs as DadosEscolaresFindManyArgs };
diff --git a/apps/maestri-edu-server/src/dadosEscolares/base/DadosEscolaresFindUniqueArgs.ts b/apps/maestri-edu-server/src/dadosEscolares/base/DadosEscolaresFindUniqueArgs.ts
new file mode 100644
index 0000000..02269a8
--- /dev/null
+++ b/apps/maestri-edu-server/src/dadosEscolares/base/DadosEscolaresFindUniqueArgs.ts
@@ -0,0 +1,30 @@
+/*
+------------------------------------------------------------------------------
+This code was generated by Amplication.
+
+Changes to this file will be lost if the code is regenerated.
+
+There are other ways to to customize your code, see this doc to learn more
+https://docs.amplication.com/how-to/custom-code
+
+------------------------------------------------------------------------------
+ */
+import { ArgsType, Field } from "@nestjs/graphql";
+import { ApiProperty } from "@nestjs/swagger";
+import { DadosEscolaresWhereUniqueInput } from "./DadosEscolaresWhereUniqueInput";
+import { ValidateNested } from "class-validator";
+import { Type } from "class-transformer";
+
+@ArgsType()
+class DadosEscolaresFindUniqueArgs {
+ @ApiProperty({
+ required: true,
+ type: () => DadosEscolaresWhereUniqueInput,
+ })
+ @ValidateNested()
+ @Type(() => DadosEscolaresWhereUniqueInput)
+ @Field(() => DadosEscolaresWhereUniqueInput, { nullable: false })
+ where!: DadosEscolaresWhereUniqueInput;
+}
+
+export { DadosEscolaresFindUniqueArgs as DadosEscolaresFindUniqueArgs };
diff --git a/apps/maestri-edu-server/src/dadosEscolares/base/DadosEscolaresListRelationFilter.ts b/apps/maestri-edu-server/src/dadosEscolares/base/DadosEscolaresListRelationFilter.ts
new file mode 100644
index 0000000..9900b40
--- /dev/null
+++ b/apps/maestri-edu-server/src/dadosEscolares/base/DadosEscolaresListRelationFilter.ts
@@ -0,0 +1,56 @@
+/*
+------------------------------------------------------------------------------
+This code was generated by Amplication.
+
+Changes to this file will be lost if the code is regenerated.
+
+There are other ways to to customize your code, see this doc to learn more
+https://docs.amplication.com/how-to/custom-code
+
+------------------------------------------------------------------------------
+ */
+import { InputType, Field } from "@nestjs/graphql";
+import { ApiProperty } from "@nestjs/swagger";
+import { DadosEscolaresWhereInput } from "./DadosEscolaresWhereInput";
+import { ValidateNested, IsOptional } from "class-validator";
+import { Type } from "class-transformer";
+
+@InputType()
+class DadosEscolaresListRelationFilter {
+ @ApiProperty({
+ required: false,
+ type: () => DadosEscolaresWhereInput,
+ })
+ @ValidateNested()
+ @Type(() => DadosEscolaresWhereInput)
+ @IsOptional()
+ @Field(() => DadosEscolaresWhereInput, {
+ nullable: true,
+ })
+ every?: DadosEscolaresWhereInput;
+
+ @ApiProperty({
+ required: false,
+ type: () => DadosEscolaresWhereInput,
+ })
+ @ValidateNested()
+ @Type(() => DadosEscolaresWhereInput)
+ @IsOptional()
+ @Field(() => DadosEscolaresWhereInput, {
+ nullable: true,
+ })
+ some?: DadosEscolaresWhereInput;
+
+ @ApiProperty({
+ required: false,
+ type: () => DadosEscolaresWhereInput,
+ })
+ @ValidateNested()
+ @Type(() => DadosEscolaresWhereInput)
+ @IsOptional()
+ @Field(() => DadosEscolaresWhereInput, {
+ nullable: true,
+ })
+ none?: DadosEscolaresWhereInput;
+}
+export { DadosEscolaresListRelationFilter as DadosEscolaresListRelationFilter };
diff --git a/apps/maestri-edu-server/src/dadosEscolares/base/DadosEscolaresOrderByInput.ts b/apps/maestri-edu-server/src/dadosEscolares/base/DadosEscolaresOrderByInput.ts
new file mode 100644
index 0000000..fe89bf4
--- /dev/null
+++ b/apps/maestri-edu-server/src/dadosEscolares/base/DadosEscolaresOrderByInput.ts
@@ -0,0 +1,67 @@
+/*
+------------------------------------------------------------------------------
+This code was generated by Amplication.
+
+Changes to this file will be lost if the code is regenerated.
+
+There are other ways to to customize your code, see this doc to learn more
+https://docs.amplication.com/how-to/custom-code
+
+------------------------------------------------------------------------------
+ */
+import { InputType, Field } from "@nestjs/graphql";
+import { ApiProperty } from "@nestjs/swagger";
+import { IsOptional, IsEnum } from "class-validator";
+import { SortOrder } from "../../util/SortOrder";
+
+@InputType({
+ isAbstract: true,
+ description: undefined,
+})
+class DadosEscolaresOrderByInput {
+ @ApiProperty({
+ required: false,
+ enum: ["asc", "desc"],
+ })
+ @IsOptional()
+ @IsEnum(SortOrder)
+ @Field(() => SortOrder, {
+ nullable: true,
+ })
+ createdAt?: SortOrder;
+
+ @ApiProperty({
+ required: false,
+ enum: ["asc", "desc"],
+ })
+ @IsOptional()
+ @IsEnum(SortOrder)
+ @Field(() => SortOrder, {
+ nullable: true,
+ })
+ id?: SortOrder;
+
+ @ApiProperty({
+ required: false,
+ enum: ["asc", "desc"],
+ })
+ @IsOptional()
+ @IsEnum(SortOrder)
+ @Field(() => SortOrder, {
+ nullable: true,
+ })
+ perfilReferencia?: SortOrder;
+
+ @ApiProperty({
+ required: false,
+ enum: ["asc", "desc"],
+ })
+ @IsOptional()
+ @IsEnum(SortOrder)
+ @Field(() => SortOrder, {
+ nullable: true,
+ })
+ updatedAt?: SortOrder;
+}
+
+export { DadosEscolaresOrderByInput as DadosEscolaresOrderByInput };
diff --git a/apps/maestri-edu-server/src/dadosEscolares/base/DadosEscolaresUpdateInput.ts b/apps/maestri-edu-server/src/dadosEscolares/base/DadosEscolaresUpdateInput.ts
new file mode 100644
index 0000000..d14ab35
--- /dev/null
+++ b/apps/maestri-edu-server/src/dadosEscolares/base/DadosEscolaresUpdateInput.ts
@@ -0,0 +1,31 @@
+/*
+------------------------------------------------------------------------------
+This code was generated by Amplication.
+
+Changes to this file will be lost if the code is regenerated.
+
+There are other ways to to customize your code, see this doc to learn more
+https://docs.amplication.com/how-to/custom-code
+
+------------------------------------------------------------------------------
+ */
+import { InputType, Field } from "@nestjs/graphql";
+import { ApiProperty } from "@nestjs/swagger";
+import { IsString, MaxLength, IsOptional } from "class-validator";
+
+@InputType()
+class DadosEscolaresUpdateInput {
+ @ApiProperty({
+ required: false,
+ type: String,
+ })
+ @IsString()
+ @MaxLength(1000)
+ @IsOptional()
+ @Field(() => String, {
+ nullable: true,
+ })
+ perfilReferencia?: string | null;
+}
+
+export { DadosEscolaresUpdateInput as DadosEscolaresUpdateInput };
diff --git a/apps/maestri-edu-server/src/dadosEscolares/base/DadosEscolaresWhereInput.ts b/apps/maestri-edu-server/src/dadosEscolares/base/DadosEscolaresWhereInput.ts
new file mode 100644
index 0000000..6e7917b
--- /dev/null
+++ b/apps/maestri-edu-server/src/dadosEscolares/base/DadosEscolaresWhereInput.ts
@@ -0,0 +1,44 @@
+/*
+------------------------------------------------------------------------------
+This code was generated by Amplication.
+
+Changes to this file will be lost if the code is regenerated.
+
+There are other ways to to customize your code, see this doc to learn more
+https://docs.amplication.com/how-to/custom-code
+
+------------------------------------------------------------------------------
+ */
+import { InputType, Field } from "@nestjs/graphql";
+import { ApiProperty } from "@nestjs/swagger";
+import { StringFilter } from "../../util/StringFilter";
+import { Type } from "class-transformer";
+import { IsOptional } from "class-validator";
+import { StringNullableFilter } from "../../util/StringNullableFilter";
+
+@InputType()
+class DadosEscolaresWhereInput {
+ @ApiProperty({
+ required: false,
+ type: StringFilter,
+ })
+ @Type(() => StringFilter)
+ @IsOptional()
+ @Field(() => StringFilter, {
+ nullable: true,
+ })
+ id?: StringFilter;
+
+ @ApiProperty({
+ required: false,
+ type: StringNullableFilter,
+ })
+ @Type(() => StringNullableFilter)
+ @IsOptional()
+ @Field(() => StringNullableFilter, {
+ nullable: true,
+ })
+ perfilReferencia?: StringNullableFilter;
+}
+
+export { DadosEscolaresWhereInput as DadosEscolaresWhereInput };
diff --git a/apps/maestri-edu-server/src/dadosEscolares/base/DadosEscolaresWhereUniqueInput.ts b/apps/maestri-edu-server/src/dadosEscolares/base/DadosEscolaresWhereUniqueInput.ts
new file mode 100644
index 0000000..1bb1402
--- /dev/null
+++ b/apps/maestri-edu-server/src/dadosEscolares/base/DadosEscolaresWhereUniqueInput.ts
@@ -0,0 +1,27 @@
+/*
+------------------------------------------------------------------------------
+This code was generated by Amplication.
+
+Changes to this file will be lost if the code is regenerated.
+
+There are other ways to to customize your code, see this doc to learn more
+https://docs.amplication.com/how-to/custom-code
+
+------------------------------------------------------------------------------
+ */
+import { InputType, Field } from "@nestjs/graphql";
+import { ApiProperty } from "@nestjs/swagger";
+import { IsString } from "class-validator";
+
+@InputType()
+class DadosEscolaresWhereUniqueInput {
+ @ApiProperty({
+ required: true,
+ type: String,
+ })
+ @IsString()
+ @Field(() => String)
+ id!: string;
+}
+
+export { DadosEscolaresWhereUniqueInput as DadosEscolaresWhereUniqueInput };
diff --git a/apps/maestri-edu-server/src/dadosEscolares/base/DeleteDadosEscolaresArgs.ts b/apps/maestri-edu-server/src/dadosEscolares/base/DeleteDadosEscolaresArgs.ts
new file mode 100644
index 0000000..ba6a7be
--- /dev/null
+++ b/apps/maestri-edu-server/src/dadosEscolares/base/DeleteDadosEscolaresArgs.ts
@@ -0,0 +1,30 @@
+/*
+------------------------------------------------------------------------------
+This code was generated by Amplication.
+
+Changes to this file will be lost if the code is regenerated.
+
+There are other ways to to customize your code, see this doc to learn more
+https://docs.amplication.com/how-to/custom-code
+
+------------------------------------------------------------------------------
+ */
+import { ArgsType, Field } from "@nestjs/graphql";
+import { ApiProperty } from "@nestjs/swagger";
+import { DadosEscolaresWhereUniqueInput } from "./DadosEscolaresWhereUniqueInput";
+import { ValidateNested } from "class-validator";
+import { Type } from "class-transformer";
+
+@ArgsType()
+class DeleteDadosEscolaresArgs {
+ @ApiProperty({
+ required: true,
+ type: () => DadosEscolaresWhereUniqueInput,
+ })
+ @ValidateNested()
+ @Type(() => DadosEscolaresWhereUniqueInput)
+ @Field(() => DadosEscolaresWhereUniqueInput, { nullable: false })
+ where!: DadosEscolaresWhereUniqueInput;
+}
+
+export { DeleteDadosEscolaresArgs as DeleteDadosEscolaresArgs };
diff --git a/apps/maestri-edu-server/src/dadosEscolares/base/UpdateDadosEscolaresArgs.ts b/apps/maestri-edu-server/src/dadosEscolares/base/UpdateDadosEscolaresArgs.ts
new file mode 100644
index 0000000..8c3f586
--- /dev/null
+++ b/apps/maestri-edu-server/src/dadosEscolares/base/UpdateDadosEscolaresArgs.ts
@@ -0,0 +1,40 @@
+/*
+------------------------------------------------------------------------------
+This code was generated by Amplication.
+
+Changes to this file will be lost if the code is regenerated.
+
+There are other ways to to customize your code, see this doc to learn more
+https://docs.amplication.com/how-to/custom-code
+
+------------------------------------------------------------------------------
+ */
+import { ArgsType, Field } from "@nestjs/graphql";
+import { ApiProperty } from "@nestjs/swagger";
+import { DadosEscolaresWhereUniqueInput } from "./DadosEscolaresWhereUniqueInput";
+import { ValidateNested } from "class-validator";
+import { Type } from "class-transformer";
+import { DadosEscolaresUpdateInput } from "./DadosEscolaresUpdateInput";
+
+@ArgsType()
+class UpdateDadosEscolaresArgs {
+ @ApiProperty({
+ required: true,
+ type: () => DadosEscolaresWhereUniqueInput,
+ })
+ @ValidateNested()
+ @Type(() => DadosEscolaresWhereUniqueInput)
+ @Field(() => DadosEscolaresWhereUniqueInput, { nullable: false })
+ where!: DadosEscolaresWhereUniqueInput;
+
+ @ApiProperty({
+ required: true,
+ type: () => DadosEscolaresUpdateInput,
+ })
+ @ValidateNested()
+ @Type(() => DadosEscolaresUpdateInput)
+ @Field(() => DadosEscolaresUpdateInput, { nullable: false })
+ data!: DadosEscolaresUpdateInput;
+}
+
+export { UpdateDadosEscolaresArgs as UpdateDadosEscolaresArgs };
diff --git a/apps/maestri-edu-server/src/dadosEscolares/base/dadosEscolares.controller.base.spec.ts b/apps/maestri-edu-server/src/dadosEscolares/base/dadosEscolares.controller.base.spec.ts
new file mode 100644
index 0000000..243274b
--- /dev/null
+++ b/apps/maestri-edu-server/src/dadosEscolares/base/dadosEscolares.controller.base.spec.ts
@@ -0,0 +1,194 @@
+import { Test } from "@nestjs/testing";
+import {
+ INestApplication,
+ HttpStatus,
+ ExecutionContext,
+ CallHandler,
+} from "@nestjs/common";
+import request from "supertest";
+import { ACGuard } from "nest-access-control";
+import { DefaultAuthGuard } from "../../auth/defaultAuth.guard";
+import { ACLModule } from "../../auth/acl.module";
+import { AclFilterResponseInterceptor } from "../../interceptors/aclFilterResponse.interceptor";
+import { AclValidateRequestInterceptor } from "../../interceptors/aclValidateRequest.interceptor";
+import { map } from "rxjs";
+import { DadosEscolaresController } from "../dadosEscolares.controller";
+import { DadosEscolaresService } from "../dadosEscolares.service";
+
+const nonExistingId = "nonExistingId";
+const existingId = "existingId";
+const CREATE_INPUT = {
+ createdAt: new Date(),
+ id: "exampleId",
+ perfilReferencia: "examplePerfilReferencia",
+ updatedAt: new Date(),
+};
+const CREATE_RESULT = {
+ createdAt: new Date(),
+ id: "exampleId",
+ perfilReferencia: "examplePerfilReferencia",
+ updatedAt: new Date(),
+};
+const FIND_MANY_RESULT = [
+ {
+ createdAt: new Date(),
+ id: "exampleId",
+ perfilReferencia: "examplePerfilReferencia",
+ updatedAt: new Date(),
+ },
+];
+const FIND_ONE_RESULT = {
+ createdAt: new Date(),
+ id: "exampleId",
+ perfilReferencia: "examplePerfilReferencia",
+ updatedAt: new Date(),
+};
+
+const service = {
+ createDadosEscolares() {
+ return CREATE_RESULT;
+ },
+ dadosEscolaresItems: () => FIND_MANY_RESULT,
+ dadosEscolares: ({ where }: { where: { id: string } }) => {
+ switch (where.id) {
+ case existingId:
+ return FIND_ONE_RESULT;
+ case nonExistingId:
+ return null;
+ }
+ },
+};
+
+const basicAuthGuard = {
+ canActivate: (context: ExecutionContext) => {
+ const argumentHost = context.switchToHttp();
+ const request = argumentHost.getRequest();
+ request.user = {
+ roles: ["user"],
+ };
+ return true;
+ },
+};
+
+const acGuard = {
+ canActivate: () => {
+ return true;
+ },
+};
+
+const aclFilterResponseInterceptor = {
+ intercept: (context: ExecutionContext, next: CallHandler) => {
+ return next.handle().pipe(
+ map((data) => {
+ return data;
+ })
+ );
+ },
+};
+const aclValidateRequestInterceptor = {
+ intercept: (context: ExecutionContext, next: CallHandler) => {
+ return next.handle();
+ },
+};
+
+describe("DadosEscolares", () => {
+ let app: INestApplication;
+
+ beforeAll(async () => {
+ const moduleRef = await Test.createTestingModule({
+ providers: [
+ {
+ provide: DadosEscolaresService,
+ useValue: service,
+ },
+ ],
+ controllers: [DadosEscolaresController],
+ imports: [ACLModule],
+ })
+ .overrideGuard(DefaultAuthGuard)
+ .useValue(basicAuthGuard)
+ .overrideGuard(ACGuard)
+ .useValue(acGuard)
+ .overrideInterceptor(AclFilterResponseInterceptor)
+ .useValue(aclFilterResponseInterceptor)
+ .overrideInterceptor(AclValidateRequestInterceptor)
+ .useValue(aclValidateRequestInterceptor)
+ .compile();
+
+ app = moduleRef.createNestApplication();
+ await app.init();
+ });
+
+ test("POST /dadosEscolares", async () => {
+ await request(app.getHttpServer())
+ .post("/dadosEscolares")
+ .send(CREATE_INPUT)
+ .expect(HttpStatus.CREATED)
+ .expect({
+ ...CREATE_RESULT,
+ createdAt: CREATE_RESULT.createdAt.toISOString(),
+ updatedAt: CREATE_RESULT.updatedAt.toISOString(),
+ });
+ });
+
+ test("GET /dadosEscolares", async () => {
+ await request(app.getHttpServer())
+ .get("/dadosEscolares")
+ .expect(HttpStatus.OK)
+ .expect([
+ {
+ ...FIND_MANY_RESULT[0],
+ createdAt: FIND_MANY_RESULT[0].createdAt.toISOString(),
+ updatedAt: FIND_MANY_RESULT[0].updatedAt.toISOString(),
+ },
+ ]);
+ });
+
+ test("GET /dadosEscolares/:id non existing", async () => {
+ await request(app.getHttpServer())
+ .get(`${"/dadosEscolares"}/${nonExistingId}`)
+ .expect(HttpStatus.NOT_FOUND)
+ .expect({
+ statusCode: HttpStatus.NOT_FOUND,
+ message: `No resource was found for {"${"id"}":"${nonExistingId}"}`,
+ error: "Not Found",
+ });
+ });
+
+ test("GET /dadosEscolares/:id existing", async () => {
+ await request(app.getHttpServer())
+ .get(`${"/dadosEscolares"}/${existingId}`)
+ .expect(HttpStatus.OK)
+ .expect({
+ ...FIND_ONE_RESULT,
+ createdAt: FIND_ONE_RESULT.createdAt.toISOString(),
+ updatedAt: FIND_ONE_RESULT.updatedAt.toISOString(),
+ });
+ });
+
+ test("POST /dadosEscolares existing resource", async () => {
+ const agent = request(app.getHttpServer());
+ await agent
+ .post("/dadosEscolares")
+ .send(CREATE_INPUT)
+ .expect(HttpStatus.CREATED)
+ .expect({
+ ...CREATE_RESULT,
+ createdAt: CREATE_RESULT.createdAt.toISOString(),
+ updatedAt: CREATE_RESULT.updatedAt.toISOString(),
+ })
+ .then(function () {
+ agent
+ .post("/dadosEscolares")
+ .send(CREATE_INPUT)
+ .expect(HttpStatus.CONFLICT)
+ .expect({
+ statusCode: HttpStatus.CONFLICT,
+ });
+ });
+ });
+
+ afterAll(async () => {
+ await app.close();
+ });
+});
diff --git a/apps/maestri-edu-server/src/dadosEscolares/base/dadosEscolares.controller.base.ts b/apps/maestri-edu-server/src/dadosEscolares/base/dadosEscolares.controller.base.ts
new file mode 100644
index 0000000..cfe8393
--- /dev/null
+++ b/apps/maestri-edu-server/src/dadosEscolares/base/dadosEscolares.controller.base.ts
@@ -0,0 +1,138 @@
+/*
+------------------------------------------------------------------------------
+This code was generated by Amplication.
+
+Changes to this file will be lost if the code is regenerated.
+
+There are other ways to to customize your code, see this doc to learn more
+https://docs.amplication.com/how-to/custom-code
+
+------------------------------------------------------------------------------
+ */
+import * as common from "@nestjs/common";
+import * as swagger from "@nestjs/swagger";
+import { isRecordNotFoundError } from "../../prisma.util";
+import * as errors from "../../errors";
+import { Request } from "express";
+import { plainToClass } from "class-transformer";
+import { ApiNestedQuery } from "../../decorators/api-nested-query.decorator";
+import { DadosEscolaresService } from "../dadosEscolares.service";
+import { DadosEscolaresCreateInput } from "./DadosEscolaresCreateInput";
+import { DadosEscolares } from "./DadosEscolares";
+import { DadosEscolaresFindManyArgs } from "./DadosEscolaresFindManyArgs";
+import { DadosEscolaresWhereUniqueInput } from "./DadosEscolaresWhereUniqueInput";
+import { DadosEscolaresUpdateInput } from "./DadosEscolaresUpdateInput";
+
+export class DadosEscolaresControllerBase {
+ constructor(protected readonly service: DadosEscolaresService) {}
+ @common.Post()
+ @swagger.ApiCreatedResponse({ type: DadosEscolares })
+ async createDadosEscolares(
+ @common.Body() data: DadosEscolaresCreateInput
+ ): Promise {
+ return await this.service.createDadosEscolares({
+ data: data,
+ select: {
+ createdAt: true,
+ id: true,
+ perfilReferencia: true,
+ updatedAt: true,
+ },
+ });
+ }
+
+ @common.Get()
+ @swagger.ApiOkResponse({ type: [DadosEscolares] })
+ @ApiNestedQuery(DadosEscolaresFindManyArgs)
+ async dadosEscolaresItems(
+ @common.Req() request: Request
+ ): Promise {
+ const args = plainToClass(DadosEscolaresFindManyArgs, request.query);
+ return this.service.dadosEscolaresItems({
+ ...args,
+ select: {
+ createdAt: true,
+ id: true,
+ perfilReferencia: true,
+ updatedAt: true,
+ },
+ });
+ }
+
+ @common.Get("/:id")
+ @swagger.ApiOkResponse({ type: DadosEscolares })
+ @swagger.ApiNotFoundResponse({ type: errors.NotFoundException })
+ async dadosEscolares(
+ @common.Param() params: DadosEscolaresWhereUniqueInput
+ ): Promise {
+ const result = await this.service.dadosEscolares({
+ where: params,
+ select: {
+ createdAt: true,
+ id: true,
+ perfilReferencia: true,
+ updatedAt: true,
+ },
+ });
+ if (result === null) {
+ throw new errors.NotFoundException(
+ `No resource was found for ${JSON.stringify(params)}`
+ );
+ }
+ return result;
+ }
+
+ @common.Patch("/:id")
+ @swagger.ApiOkResponse({ type: DadosEscolares })
+ @swagger.ApiNotFoundResponse({ type: errors.NotFoundException })
+ async updateDadosEscolares(
+ @common.Param() params: DadosEscolaresWhereUniqueInput,
+ @common.Body() data: DadosEscolaresUpdateInput
+ ): Promise {
+ try {
+ return await this.service.updateDadosEscolares({
+ where: params,
+ data: data,
+ select: {
+ createdAt: true,
+ id: true,
+ perfilReferencia: true,
+ updatedAt: true,
+ },
+ });
+ } catch (error) {
+ if (isRecordNotFoundError(error)) {
+ throw new errors.NotFoundException(
+ `No resource was found for ${JSON.stringify(params)}`
+ );
+ }
+ throw error;
+ }
+ }
+
+ @common.Delete("/:id")
+ @swagger.ApiOkResponse({ type: DadosEscolares })
+ @swagger.ApiNotFoundResponse({ type: errors.NotFoundException })
+ async deleteDadosEscolares(
+ @common.Param() params: DadosEscolaresWhereUniqueInput
+ ): Promise {
+ try {
+ return await this.service.deleteDadosEscolares({
+ where: params,
+ select: {
+ createdAt: true,
+ id: true,
+ perfilReferencia: true,
+ updatedAt: true,
+ },
+ });
+ } catch (error) {
+ if (isRecordNotFoundError(error)) {
+ throw new errors.NotFoundException(
+ `No resource was found for ${JSON.stringify(params)}`
+ );
+ }
+ throw error;
+ }
+ }
+}
diff --git a/apps/maestri-edu-server/src/dadosEscolares/base/dadosEscolares.module.base.ts b/apps/maestri-edu-server/src/dadosEscolares/base/dadosEscolares.module.base.ts
new file mode 100644
index 0000000..9116538
--- /dev/null
+++ b/apps/maestri-edu-server/src/dadosEscolares/base/dadosEscolares.module.base.ts
@@ -0,0 +1,18 @@
+/*
+------------------------------------------------------------------------------
+This code was generated by Amplication.
+
+Changes to this file will be lost if the code is regenerated.
+
+There are other ways to to customize your code, see this doc to learn more
+https://docs.amplication.com/how-to/custom-code
+
+------------------------------------------------------------------------------
+ */
+import { Module } from "@nestjs/common";
+
+@Module({
+ imports: [],
+ exports: [],
+})
+export class DadosEscolaresModuleBase {}
diff --git a/apps/maestri-edu-server/src/dadosEscolares/base/dadosEscolares.resolver.base.ts b/apps/maestri-edu-server/src/dadosEscolares/base/dadosEscolares.resolver.base.ts
new file mode 100644
index 0000000..e73eccc
--- /dev/null
+++ b/apps/maestri-edu-server/src/dadosEscolares/base/dadosEscolares.resolver.base.ts
@@ -0,0 +1,99 @@
+/*
+------------------------------------------------------------------------------
+This code was generated by Amplication.
+
+Changes to this file will be lost if the code is regenerated.
+
+There are other ways to to customize your code, see this doc to learn more
+https://docs.amplication.com/how-to/custom-code
+
+------------------------------------------------------------------------------
+ */
+import * as graphql from "@nestjs/graphql";
+import { GraphQLError } from "graphql";
+import { isRecordNotFoundError } from "../../prisma.util";
+import { MetaQueryPayload } from "../../util/MetaQueryPayload";
+import { DadosEscolares } from "./DadosEscolares";
+import { DadosEscolaresCountArgs } from "./DadosEscolaresCountArgs";
+import { DadosEscolaresFindManyArgs } from "./DadosEscolaresFindManyArgs";
+import { DadosEscolaresFindUniqueArgs } from "./DadosEscolaresFindUniqueArgs";
+import { CreateDadosEscolaresArgs } from "./CreateDadosEscolaresArgs";
+import { UpdateDadosEscolaresArgs } from "./UpdateDadosEscolaresArgs";
+import { DeleteDadosEscolaresArgs } from "./DeleteDadosEscolaresArgs";
+import { DadosEscolaresService } from "../dadosEscolares.service";
+@graphql.Resolver(() => DadosEscolares)
+export class DadosEscolaresResolverBase {
+ constructor(protected readonly service: DadosEscolaresService) {}
+
+ async _dadosEscolaresItemsMeta(
+ @graphql.Args() args: DadosEscolaresCountArgs
+ ): Promise {
+ const result = await this.service.count(args);
+ return {
+ count: result,
+ };
+ }
+
+ @graphql.Query(() => [DadosEscolares])
+ async dadosEscolaresItems(
+ @graphql.Args() args: DadosEscolaresFindManyArgs
+ ): Promise {
+ return this.service.dadosEscolaresItems(args);
+ }
+
+ @graphql.Query(() => DadosEscolares, { nullable: true })
+ async dadosEscolares(
+ @graphql.Args() args: DadosEscolaresFindUniqueArgs
+ ): Promise {
+ const result = await this.service.dadosEscolares(args);
+ if (result === null) {
+ return null;
+ }
+ return result;
+ }
+
+ @graphql.Mutation(() => DadosEscolares)
+ async createDadosEscolares(
+ @graphql.Args() args: CreateDadosEscolaresArgs
+ ): Promise {
+ return await this.service.createDadosEscolares({
+ ...args,
+ data: args.data,
+ });
+ }
+
+ @graphql.Mutation(() => DadosEscolares)
+ async updateDadosEscolares(
+ @graphql.Args() args: UpdateDadosEscolaresArgs
+ ): Promise {
+ try {
+ return await this.service.updateDadosEscolares({
+ ...args,
+ data: args.data,
+ });
+ } catch (error) {
+ if (isRecordNotFoundError(error)) {
+ throw new GraphQLError(
+ `No resource was found for ${JSON.stringify(args.where)}`
+ );
+ }
+ throw error;
+ }
+ }
+
+ @graphql.Mutation(() => DadosEscolares)
+ async deleteDadosEscolares(
+ @graphql.Args() args: DeleteDadosEscolaresArgs
+ ): Promise {
+ try {
+ return await this.service.deleteDadosEscolares(args);
+ } catch (error) {
+ if (isRecordNotFoundError(error)) {
+ throw new GraphQLError(
+ `No resource was found for ${JSON.stringify(args.where)}`
+ );
+ }
+ throw error;
+ }
+ }
+}
diff --git a/apps/maestri-edu-server/src/dadosEscolares/base/dadosEscolares.service.base.ts b/apps/maestri-edu-server/src/dadosEscolares/base/dadosEscolares.service.base.ts
new file mode 100644
index 0000000..4d42519
--- /dev/null
+++ b/apps/maestri-edu-server/src/dadosEscolares/base/dadosEscolares.service.base.ts
@@ -0,0 +1,49 @@
+/*
+------------------------------------------------------------------------------
+This code was generated by Amplication.
+
+Changes to this file will be lost if the code is regenerated.
+
+There are other ways to to customize your code, see this doc to learn more
+https://docs.amplication.com/how-to/custom-code
+
+------------------------------------------------------------------------------
+ */
+import { PrismaService } from "../../prisma/prisma.service";
+import { Prisma, DadosEscolares as PrismaDadosEscolares } from "@prisma/client";
+
+export class DadosEscolaresServiceBase {
+ constructor(protected readonly prisma: PrismaService) {}
+
+ async count(
+ args: Omit
+ ): Promise {
+ return this.prisma.dadosEscolares.count(args);
+ }
+
+ async dadosEscolaresItems(
+ args: Prisma.DadosEscolaresFindManyArgs
+ ): Promise {
+ return this.prisma.dadosEscolares.findMany(args);
+ }
+ async dadosEscolares(
+ args: Prisma.DadosEscolaresFindUniqueArgs
+ ): Promise {
+ return this.prisma.dadosEscolares.findUnique(args);
+ }
+ async createDadosEscolares(
+ args: Prisma.DadosEscolaresCreateArgs
+ ): Promise {
+ return this.prisma.dadosEscolares.create(args);
+ }
+ async updateDadosEscolares(
+ args: Prisma.DadosEscolaresUpdateArgs
+ ): Promise {
+ return this.prisma.dadosEscolares.update(args);
+ }
+ async deleteDadosEscolares(
+ args: Prisma.DadosEscolaresDeleteArgs
+ ): Promise {
+ return this.prisma.dadosEscolares.delete(args);
+ }
+}
diff --git a/apps/maestri-edu-server/src/dadosEscolares/dadosEscolares.controller.ts b/apps/maestri-edu-server/src/dadosEscolares/dadosEscolares.controller.ts
new file mode 100644
index 0000000..b4b762d
--- /dev/null
+++ b/apps/maestri-edu-server/src/dadosEscolares/dadosEscolares.controller.ts
@@ -0,0 +1,12 @@
+import * as common from "@nestjs/common";
+import * as swagger from "@nestjs/swagger";
+import { DadosEscolaresService } from "./dadosEscolares.service";
+import { DadosEscolaresControllerBase } from "./base/dadosEscolares.controller.base";
+
+@swagger.ApiTags("dadosEscolares")
+@common.Controller("dadosEscolares")
+export class DadosEscolaresController extends DadosEscolaresControllerBase {
+ constructor(protected readonly service: DadosEscolaresService) {
+ super(service);
+ }
+}
diff --git a/apps/maestri-edu-server/src/dadosEscolares/dadosEscolares.module.ts b/apps/maestri-edu-server/src/dadosEscolares/dadosEscolares.module.ts
new file mode 100644
index 0000000..001c01b
--- /dev/null
+++ b/apps/maestri-edu-server/src/dadosEscolares/dadosEscolares.module.ts
@@ -0,0 +1,13 @@
+import { Module } from "@nestjs/common";
+import { DadosEscolaresModuleBase } from "./base/dadosEscolares.module.base";
+import { DadosEscolaresService } from "./dadosEscolares.service";
+import { DadosEscolaresController } from "./dadosEscolares.controller";
+import { DadosEscolaresResolver } from "./dadosEscolares.resolver";
+
+@Module({
+ imports: [DadosEscolaresModuleBase],
+ controllers: [DadosEscolaresController],
+ providers: [DadosEscolaresService, DadosEscolaresResolver],
+ exports: [DadosEscolaresService],
+})
+export class DadosEscolaresModule {}
diff --git a/apps/maestri-edu-server/src/dadosEscolares/dadosEscolares.resolver.ts b/apps/maestri-edu-server/src/dadosEscolares/dadosEscolares.resolver.ts
new file mode 100644
index 0000000..fbe43bf
--- /dev/null
+++ b/apps/maestri-edu-server/src/dadosEscolares/dadosEscolares.resolver.ts
@@ -0,0 +1,11 @@
+import * as graphql from "@nestjs/graphql";
+import { DadosEscolaresResolverBase } from "./base/dadosEscolares.resolver.base";
+import { DadosEscolares } from "./base/DadosEscolares";
+import { DadosEscolaresService } from "./dadosEscolares.service";
+
+@graphql.Resolver(() => DadosEscolares)
+export class DadosEscolaresResolver extends DadosEscolaresResolverBase {
+ constructor(protected readonly service: DadosEscolaresService) {
+ super(service);
+ }
+}
diff --git a/apps/maestri-edu-server/src/dadosEscolares/dadosEscolares.service.ts b/apps/maestri-edu-server/src/dadosEscolares/dadosEscolares.service.ts
new file mode 100644
index 0000000..fce4646
--- /dev/null
+++ b/apps/maestri-edu-server/src/dadosEscolares/dadosEscolares.service.ts
@@ -0,0 +1,10 @@
+import { Injectable } from "@nestjs/common";
+import { PrismaService } from "../prisma/prisma.service";
+import { DadosEscolaresServiceBase } from "./base/dadosEscolares.service.base";
+
+@Injectable()
+export class DadosEscolaresService extends DadosEscolaresServiceBase {
+ constructor(protected readonly prisma: PrismaService) {
+ super(prisma);
+ }
+}
diff --git a/apps/maestri-edu-server/src/decorators/api-nested-query.decorator.ts b/apps/maestri-edu-server/src/decorators/api-nested-query.decorator.ts
new file mode 100644
index 0000000..9fd5ba3
--- /dev/null
+++ b/apps/maestri-edu-server/src/decorators/api-nested-query.decorator.ts
@@ -0,0 +1,80 @@
+import { applyDecorators } from "@nestjs/common";
+import {
+ ApiExtraModels,
+ ApiQuery,
+ ApiQueryOptions,
+ getSchemaPath,
+} from "@nestjs/swagger";
+import "reflect-metadata";
+
+const generateApiQueryObject = (
+ prop: any,
+ propType: any,
+ required: boolean,
+ isArray: boolean
+): ApiQueryOptions => {
+ if (propType === Number) {
+ return {
+ required,
+ name: prop,
+ style: "deepObject",
+ explode: true,
+ type: "number",
+ isArray,
+ };
+ } else if (propType === String) {
+ return {
+ required,
+ name: prop,
+ style: "deepObject",
+ explode: true,
+ type: "string",
+ isArray,
+ };
+ } else {
+ return {
+ required,
+ name: prop,
+ style: "deepObject",
+ explode: true,
+ type: "object",
+ isArray,
+ schema: {
+ $ref: getSchemaPath(propType),
+ },
+ };
+ }
+};
+
+// eslint-disable-next-line @typescript-eslint/ban-types,@typescript-eslint/explicit-module-boundary-types,@typescript-eslint/naming-convention
+export function ApiNestedQuery(query: Function) {
+ const constructor = query.prototype;
+ const properties = Reflect.getMetadata(
+ "swagger/apiModelPropertiesArray",
+ constructor
+ ).map((prop: any) => prop.slice(1));
+
+ const decorators = properties
+ .map((property: any) => {
+ const { required, isArray } = Reflect.getMetadata(
+ "swagger/apiModelProperties",
+ constructor,
+ property
+ );
+ const propertyType = Reflect.getMetadata(
+ "design:type",
+ constructor,
+ property
+ );
+ const typedQuery = generateApiQueryObject(
+ property,
+ propertyType,
+ required,
+ isArray
+ );
+ return [ApiExtraModels(propertyType), ApiQuery(typedQuery)];
+ })
+ .flat();
+
+ return applyDecorators(...decorators);
+}
diff --git a/apps/maestri-edu-server/src/decorators/public.decorator.ts b/apps/maestri-edu-server/src/decorators/public.decorator.ts
new file mode 100644
index 0000000..9eab4e0
--- /dev/null
+++ b/apps/maestri-edu-server/src/decorators/public.decorator.ts
@@ -0,0 +1,10 @@
+import { applyDecorators, SetMetadata } from "@nestjs/common";
+
+export const IS_PUBLIC_KEY = "isPublic";
+
+const PublicAuthMiddleware = SetMetadata(IS_PUBLIC_KEY, true);
+const PublicAuthSwagger = SetMetadata("swagger/apiSecurity", ["isPublic"]);
+
+// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
+export const Public = () =>
+ applyDecorators(PublicAuthMiddleware, PublicAuthSwagger);
diff --git a/apps/maestri-edu-server/src/documento/base/CreateDocumentoArgs.ts b/apps/maestri-edu-server/src/documento/base/CreateDocumentoArgs.ts
new file mode 100644
index 0000000..77a3be3
--- /dev/null
+++ b/apps/maestri-edu-server/src/documento/base/CreateDocumentoArgs.ts
@@ -0,0 +1,30 @@
+/*
+------------------------------------------------------------------------------
+This code was generated by Amplication.
+
+Changes to this file will be lost if the code is regenerated.
+
+There are other ways to to customize your code, see this doc to learn more
+https://docs.amplication.com/how-to/custom-code
+
+------------------------------------------------------------------------------
+ */
+import { ArgsType, Field } from "@nestjs/graphql";
+import { ApiProperty } from "@nestjs/swagger";
+import { DocumentoCreateInput } from "./DocumentoCreateInput";
+import { ValidateNested } from "class-validator";
+import { Type } from "class-transformer";
+
+@ArgsType()
+class CreateDocumentoArgs {
+ @ApiProperty({
+ required: true,
+ type: () => DocumentoCreateInput,
+ })
+ @ValidateNested()
+ @Type(() => DocumentoCreateInput)
+ @Field(() => DocumentoCreateInput, { nullable: false })
+ data!: DocumentoCreateInput;
+}
+
+export { CreateDocumentoArgs as CreateDocumentoArgs };
diff --git a/apps/maestri-edu-server/src/documento/base/DeleteDocumentoArgs.ts b/apps/maestri-edu-server/src/documento/base/DeleteDocumentoArgs.ts
new file mode 100644
index 0000000..171deac
--- /dev/null
+++ b/apps/maestri-edu-server/src/documento/base/DeleteDocumentoArgs.ts
@@ -0,0 +1,30 @@
+/*
+------------------------------------------------------------------------------
+This code was generated by Amplication.
+
+Changes to this file will be lost if the code is regenerated.
+
+There are other ways to to customize your code, see this doc to learn more
+https://docs.amplication.com/how-to/custom-code
+
+------------------------------------------------------------------------------
+ */
+import { ArgsType, Field } from "@nestjs/graphql";
+import { ApiProperty } from "@nestjs/swagger";
+import { DocumentoWhereUniqueInput } from "./DocumentoWhereUniqueInput";
+import { ValidateNested } from "class-validator";
+import { Type } from "class-transformer";
+
+@ArgsType()
+class DeleteDocumentoArgs {
+ @ApiProperty({
+ required: true,
+ type: () => DocumentoWhereUniqueInput,
+ })
+ @ValidateNested()
+ @Type(() => DocumentoWhereUniqueInput)
+ @Field(() => DocumentoWhereUniqueInput, { nullable: false })
+ where!: DocumentoWhereUniqueInput;
+}
+
+export { DeleteDocumentoArgs as DeleteDocumentoArgs };
diff --git a/apps/maestri-edu-server/src/documento/base/Documento.ts b/apps/maestri-edu-server/src/documento/base/Documento.ts
new file mode 100644
index 0000000..07e8748
--- /dev/null
+++ b/apps/maestri-edu-server/src/documento/base/Documento.ts
@@ -0,0 +1,56 @@
+/*
+------------------------------------------------------------------------------
+This code was generated by Amplication.
+
+Changes to this file will be lost if the code is regenerated.
+
+There are other ways to to customize your code, see this doc to learn more
+https://docs.amplication.com/how-to/custom-code
+
+------------------------------------------------------------------------------
+ */
+import { ObjectType, Field } from "@nestjs/graphql";
+import { ApiProperty } from "@nestjs/swagger";
+import { IsDate, IsString, MaxLength, IsOptional } from "class-validator";
+import { Type } from "class-transformer";
+
+@ObjectType()
+class Documento {
+ @ApiProperty({
+ required: true,
+ })
+ @IsDate()
+ @Type(() => Date)
+ @Field(() => Date)
+ createdAt!: Date;
+
+ @ApiProperty({
+ required: true,
+ type: String,
+ })
+ @IsString()
+ @Field(() => String)
+ id!: string;
+
+ @ApiProperty({
+ required: false,
+ type: String,
+ })
+ @IsString()
+ @MaxLength(1000)
+ @IsOptional()
+ @Field(() => String, {
+ nullable: true,
+ })
+ perfilReferencia!: string | null;
+
+ @ApiProperty({
+ required: true,
+ })
+ @IsDate()
+ @Type(() => Date)
+ @Field(() => Date)
+ updatedAt!: Date;
+}
+
+export { Documento as Documento };
diff --git a/apps/maestri-edu-server/src/documento/base/DocumentoCountArgs.ts b/apps/maestri-edu-server/src/documento/base/DocumentoCountArgs.ts
new file mode 100644
index 0000000..c1d01c6
--- /dev/null
+++ b/apps/maestri-edu-server/src/documento/base/DocumentoCountArgs.ts
@@ -0,0 +1,28 @@
+/*
+------------------------------------------------------------------------------
+This code was generated by Amplication.
+
+Changes to this file will be lost if the code is regenerated.
+
+There are other ways to to customize your code, see this doc to learn more
+https://docs.amplication.com/how-to/custom-code
+
+------------------------------------------------------------------------------
+ */
+import { ArgsType, Field } from "@nestjs/graphql";
+import { ApiProperty } from "@nestjs/swagger";
+import { DocumentoWhereInput } from "./DocumentoWhereInput";
+import { Type } from "class-transformer";
+
+@ArgsType()
+class DocumentoCountArgs {
+ @ApiProperty({
+ required: false,
+ type: () => DocumentoWhereInput,
+ })
+ @Field(() => DocumentoWhereInput, { nullable: true })
+ @Type(() => DocumentoWhereInput)
+ where?: DocumentoWhereInput;
+}
+
+export { DocumentoCountArgs as DocumentoCountArgs };
diff --git a/apps/maestri-edu-server/src/documento/base/DocumentoCreateInput.ts b/apps/maestri-edu-server/src/documento/base/DocumentoCreateInput.ts
new file mode 100644
index 0000000..5bc4d4f
--- /dev/null
+++ b/apps/maestri-edu-server/src/documento/base/DocumentoCreateInput.ts
@@ -0,0 +1,31 @@
+/*
+------------------------------------------------------------------------------
+This code was generated by Amplication.
+
+Changes to this file will be lost if the code is regenerated.
+
+There are other ways to to customize your code, see this doc to learn more
+https://docs.amplication.com/how-to/custom-code
+
+------------------------------------------------------------------------------
+ */
+import { InputType, Field } from "@nestjs/graphql";
+import { ApiProperty } from "@nestjs/swagger";
+import { IsString, MaxLength, IsOptional } from "class-validator";
+
+@InputType()
+class DocumentoCreateInput {
+ @ApiProperty({
+ required: false,
+ type: String,
+ })
+ @IsString()
+ @MaxLength(1000)
+ @IsOptional()
+ @Field(() => String, {
+ nullable: true,
+ })
+ perfilReferencia?: string | null;
+}
+
+export { DocumentoCreateInput as DocumentoCreateInput };
diff --git a/apps/maestri-edu-server/src/documento/base/DocumentoFindManyArgs.ts b/apps/maestri-edu-server/src/documento/base/DocumentoFindManyArgs.ts
new file mode 100644
index 0000000..d96528a
--- /dev/null
+++ b/apps/maestri-edu-server/src/documento/base/DocumentoFindManyArgs.ts
@@ -0,0 +1,62 @@
+/*
+------------------------------------------------------------------------------
+This code was generated by Amplication.
+
+Changes to this file will be lost if the code is regenerated.
+
+There are other ways to to customize your code, see this doc to learn more
+https://docs.amplication.com/how-to/custom-code
+
+------------------------------------------------------------------------------
+ */
+import { ArgsType, Field } from "@nestjs/graphql";
+import { ApiProperty } from "@nestjs/swagger";
+import { DocumentoWhereInput } from "./DocumentoWhereInput";
+import { IsOptional, ValidateNested, IsInt } from "class-validator";
+import { Type } from "class-transformer";
+import { DocumentoOrderByInput } from "./DocumentoOrderByInput";
+
+@ArgsType()
+class DocumentoFindManyArgs {
+ @ApiProperty({
+ required: false,
+ type: () => DocumentoWhereInput,
+ })
+ @IsOptional()
+ @ValidateNested()
+ @Field(() => DocumentoWhereInput, { nullable: true })
+ @Type(() => DocumentoWhereInput)
+ where?: DocumentoWhereInput;
+
+ @ApiProperty({
+ required: false,
+ type: [DocumentoOrderByInput],
+ })
+ @IsOptional()
+ @ValidateNested({ each: true })
+ @Field(() => [DocumentoOrderByInput], { nullable: true })
+ @Type(() => DocumentoOrderByInput)
+ orderBy?: Array;
+
+ @ApiProperty({
+ required: false,
+ type: Number,
+ })
+ @IsOptional()
+ @IsInt()
+ @Field(() => Number, { nullable: true })
+ @Type(() => Number)
+ skip?: number;
+
+ @ApiProperty({
+ required: false,
+ type: Number,
+ })
+ @IsOptional()
+ @IsInt()
+ @Field(() => Number, { nullable: true })
+ @Type(() => Number)
+ take?: number;
+}
+
+export { DocumentoFindManyArgs as DocumentoFindManyArgs };
diff --git a/apps/maestri-edu-server/src/documento/base/DocumentoFindUniqueArgs.ts b/apps/maestri-edu-server/src/documento/base/DocumentoFindUniqueArgs.ts
new file mode 100644
index 0000000..45edb56
--- /dev/null
+++ b/apps/maestri-edu-server/src/documento/base/DocumentoFindUniqueArgs.ts
@@ -0,0 +1,30 @@
+/*
+------------------------------------------------------------------------------
+This code was generated by Amplication.
+
+Changes to this file will be lost if the code is regenerated.
+
+There are other ways to to customize your code, see this doc to learn more
+https://docs.amplication.com/how-to/custom-code
+
+------------------------------------------------------------------------------
+ */
+import { ArgsType, Field } from "@nestjs/graphql";
+import { ApiProperty } from "@nestjs/swagger";
+import { DocumentoWhereUniqueInput } from "./DocumentoWhereUniqueInput";
+import { ValidateNested } from "class-validator";
+import { Type } from "class-transformer";
+
+@ArgsType()
+class DocumentoFindUniqueArgs {
+ @ApiProperty({
+ required: true,
+ type: () => DocumentoWhereUniqueInput,
+ })
+ @ValidateNested()
+ @Type(() => DocumentoWhereUniqueInput)
+ @Field(() => DocumentoWhereUniqueInput, { nullable: false })
+ where!: DocumentoWhereUniqueInput;
+}
+
+export { DocumentoFindUniqueArgs as DocumentoFindUniqueArgs };
diff --git a/apps/maestri-edu-server/src/documento/base/DocumentoListRelationFilter.ts b/apps/maestri-edu-server/src/documento/base/DocumentoListRelationFilter.ts
new file mode 100644
index 0000000..e74b655
--- /dev/null
+++ b/apps/maestri-edu-server/src/documento/base/DocumentoListRelationFilter.ts
@@ -0,0 +1,56 @@
+/*
+------------------------------------------------------------------------------
+This code was generated by Amplication.
+
+Changes to this file will be lost if the code is regenerated.
+
+There are other ways to to customize your code, see this doc to learn more
+https://docs.amplication.com/how-to/custom-code
+
+------------------------------------------------------------------------------
+ */
+import { InputType, Field } from "@nestjs/graphql";
+import { ApiProperty } from "@nestjs/swagger";
+import { DocumentoWhereInput } from "./DocumentoWhereInput";
+import { ValidateNested, IsOptional } from "class-validator";
+import { Type } from "class-transformer";
+
+@InputType()
+class DocumentoListRelationFilter {
+ @ApiProperty({
+ required: false,
+ type: () => DocumentoWhereInput,
+ })
+ @ValidateNested()
+ @Type(() => DocumentoWhereInput)
+ @IsOptional()
+ @Field(() => DocumentoWhereInput, {
+ nullable: true,
+ })
+ every?: DocumentoWhereInput;
+
+ @ApiProperty({
+ required: false,
+ type: () => DocumentoWhereInput,
+ })
+ @ValidateNested()
+ @Type(() => DocumentoWhereInput)
+ @IsOptional()
+ @Field(() => DocumentoWhereInput, {
+ nullable: true,
+ })
+ some?: DocumentoWhereInput;
+
+ @ApiProperty({
+ required: false,
+ type: () => DocumentoWhereInput,
+ })
+ @ValidateNested()
+ @Type(() => DocumentoWhereInput)
+ @IsOptional()
+ @Field(() => DocumentoWhereInput, {
+ nullable: true,
+ })
+ none?: DocumentoWhereInput;
+}
+export { DocumentoListRelationFilter as DocumentoListRelationFilter };
diff --git a/apps/maestri-edu-server/src/documento/base/DocumentoOrderByInput.ts b/apps/maestri-edu-server/src/documento/base/DocumentoOrderByInput.ts
new file mode 100644
index 0000000..de9b994
--- /dev/null
+++ b/apps/maestri-edu-server/src/documento/base/DocumentoOrderByInput.ts
@@ -0,0 +1,67 @@
+/*
+------------------------------------------------------------------------------
+This code was generated by Amplication.
+
+Changes to this file will be lost if the code is regenerated.
+
+There are other ways to to customize your code, see this doc to learn more
+https://docs.amplication.com/how-to/custom-code
+
+------------------------------------------------------------------------------
+ */
+import { InputType, Field } from "@nestjs/graphql";
+import { ApiProperty } from "@nestjs/swagger";
+import { IsOptional, IsEnum } from "class-validator";
+import { SortOrder } from "../../util/SortOrder";
+
+@InputType({
+ isAbstract: true,
+ description: undefined,
+})
+class DocumentoOrderByInput {
+ @ApiProperty({
+ required: false,
+ enum: ["asc", "desc"],
+ })
+ @IsOptional()
+ @IsEnum(SortOrder)
+ @Field(() => SortOrder, {
+ nullable: true,
+ })
+ createdAt?: SortOrder;
+
+ @ApiProperty({
+ required: false,
+ enum: ["asc", "desc"],
+ })
+ @IsOptional()
+ @IsEnum(SortOrder)
+ @Field(() => SortOrder, {
+ nullable: true,
+ })
+ id?: SortOrder;
+
+ @ApiProperty({
+ required: false,
+ enum: ["asc", "desc"],
+ })
+ @IsOptional()
+ @IsEnum(SortOrder)
+ @Field(() => SortOrder, {
+ nullable: true,
+ })
+ perfilReferencia?: SortOrder;
+
+ @ApiProperty({
+ required: false,
+ enum: ["asc", "desc"],
+ })
+ @IsOptional()
+ @IsEnum(SortOrder)
+ @Field(() => SortOrder, {
+ nullable: true,
+ })
+ updatedAt?: SortOrder;
+}
+
+export { DocumentoOrderByInput as DocumentoOrderByInput };
diff --git a/apps/maestri-edu-server/src/documento/base/DocumentoUpdateInput.ts b/apps/maestri-edu-server/src/documento/base/DocumentoUpdateInput.ts
new file mode 100644
index 0000000..a2af68d
--- /dev/null
+++ b/apps/maestri-edu-server/src/documento/base/DocumentoUpdateInput.ts
@@ -0,0 +1,31 @@
+/*
+------------------------------------------------------------------------------
+This code was generated by Amplication.
+
+Changes to this file will be lost if the code is regenerated.
+
+There are other ways to to customize your code, see this doc to learn more
+https://docs.amplication.com/how-to/custom-code
+
+------------------------------------------------------------------------------
+ */
+import { InputType, Field } from "@nestjs/graphql";
+import { ApiProperty } from "@nestjs/swagger";
+import { IsString, MaxLength, IsOptional } from "class-validator";
+
+@InputType()
+class DocumentoUpdateInput {
+ @ApiProperty({
+ required: false,
+ type: String,
+ })
+ @IsString()
+ @MaxLength(1000)
+ @IsOptional()
+ @Field(() => String, {
+ nullable: true,
+ })
+ perfilReferencia?: string | null;
+}
+
+export { DocumentoUpdateInput as DocumentoUpdateInput };
diff --git a/apps/maestri-edu-server/src/documento/base/DocumentoWhereInput.ts b/apps/maestri-edu-server/src/documento/base/DocumentoWhereInput.ts
new file mode 100644
index 0000000..86c71c4
--- /dev/null
+++ b/apps/maestri-edu-server/src/documento/base/DocumentoWhereInput.ts
@@ -0,0 +1,44 @@
+/*
+------------------------------------------------------------------------------
+This code was generated by Amplication.
+
+Changes to this file will be lost if the code is regenerated.
+
+There are other ways to to customize your code, see this doc to learn more
+https://docs.amplication.com/how-to/custom-code
+
+------------------------------------------------------------------------------
+ */
+import { InputType, Field } from "@nestjs/graphql";
+import { ApiProperty } from "@nestjs/swagger";
+import { StringFilter } from "../../util/StringFilter";
+import { Type } from "class-transformer";
+import { IsOptional } from "class-validator";
+import { StringNullableFilter } from "../../util/StringNullableFilter";
+
+@InputType()
+class DocumentoWhereInput {
+ @ApiProperty({
+ required: false,
+ type: StringFilter,
+ })
+ @Type(() => StringFilter)
+ @IsOptional()
+ @Field(() => StringFilter, {
+ nullable: true,
+ })
+ id?: StringFilter;
+
+ @ApiProperty({
+ required: false,
+ type: StringNullableFilter,
+ })
+ @Type(() => StringNullableFilter)
+ @IsOptional()
+ @Field(() => StringNullableFilter, {
+ nullable: true,
+ })
+ perfilReferencia?: StringNullableFilter;
+}
+
+export { DocumentoWhereInput as DocumentoWhereInput };
diff --git a/apps/maestri-edu-server/src/documento/base/DocumentoWhereUniqueInput.ts b/apps/maestri-edu-server/src/documento/base/DocumentoWhereUniqueInput.ts
new file mode 100644
index 0000000..b5e8458
--- /dev/null
+++ b/apps/maestri-edu-server/src/documento/base/DocumentoWhereUniqueInput.ts
@@ -0,0 +1,27 @@
+/*
+------------------------------------------------------------------------------
+This code was generated by Amplication.
+
+Changes to this file will be lost if the code is regenerated.
+
+There are other ways to to customize your code, see this doc to learn more
+https://docs.amplication.com/how-to/custom-code
+
+------------------------------------------------------------------------------
+ */
+import { InputType, Field } from "@nestjs/graphql";
+import { ApiProperty } from "@nestjs/swagger";
+import { IsString } from "class-validator";
+
+@InputType()
+class DocumentoWhereUniqueInput {
+ @ApiProperty({
+ required: true,
+ type: String,
+ })
+ @IsString()
+ @Field(() => String)
+ id!: string;
+}
+
+export { DocumentoWhereUniqueInput as DocumentoWhereUniqueInput };
diff --git a/apps/maestri-edu-server/src/documento/base/UpdateDocumentoArgs.ts b/apps/maestri-edu-server/src/documento/base/UpdateDocumentoArgs.ts
new file mode 100644
index 0000000..6397a76
--- /dev/null
+++ b/apps/maestri-edu-server/src/documento/base/UpdateDocumentoArgs.ts
@@ -0,0 +1,40 @@
+/*
+------------------------------------------------------------------------------
+This code was generated by Amplication.
+
+Changes to this file will be lost if the code is regenerated.
+
+There are other ways to to customize your code, see this doc to learn more
+https://docs.amplication.com/how-to/custom-code
+
+------------------------------------------------------------------------------
+ */
+import { ArgsType, Field } from "@nestjs/graphql";
+import { ApiProperty } from "@nestjs/swagger";
+import { DocumentoWhereUniqueInput } from "./DocumentoWhereUniqueInput";
+import { ValidateNested } from "class-validator";
+import { Type } from "class-transformer";
+import { DocumentoUpdateInput } from "./DocumentoUpdateInput";
+
+@ArgsType()
+class UpdateDocumentoArgs {
+ @ApiProperty({
+ required: true,
+ type: () => DocumentoWhereUniqueInput,
+ })
+ @ValidateNested()
+ @Type(() => DocumentoWhereUniqueInput)
+ @Field(() => DocumentoWhereUniqueInput, { nullable: false })
+ where!: DocumentoWhereUniqueInput;
+
+ @ApiProperty({
+ required: true,
+ type: () => DocumentoUpdateInput,
+ })
+ @ValidateNested()
+ @Type(() => DocumentoUpdateInput)
+ @Field(() => DocumentoUpdateInput, { nullable: false })
+ data!: DocumentoUpdateInput;
+}
+
+export { UpdateDocumentoArgs as UpdateDocumentoArgs };
diff --git a/apps/maestri-edu-server/src/documento/base/documento.controller.base.spec.ts b/apps/maestri-edu-server/src/documento/base/documento.controller.base.spec.ts
new file mode 100644
index 0000000..62ca9bc
--- /dev/null
+++ b/apps/maestri-edu-server/src/documento/base/documento.controller.base.spec.ts
@@ -0,0 +1,194 @@
+import { Test } from "@nestjs/testing";
+import {
+ INestApplication,
+ HttpStatus,
+ ExecutionContext,
+ CallHandler,
+} from "@nestjs/common";
+import request from "supertest";
+import { ACGuard } from "nest-access-control";
+import { DefaultAuthGuard } from "../../auth/defaultAuth.guard";
+import { ACLModule } from "../../auth/acl.module";
+import { AclFilterResponseInterceptor } from "../../interceptors/aclFilterResponse.interceptor";
+import { AclValidateRequestInterceptor } from "../../interceptors/aclValidateRequest.interceptor";
+import { map } from "rxjs";
+import { DocumentoController } from "../documento.controller";
+import { DocumentoService } from "../documento.service";
+
+const nonExistingId = "nonExistingId";
+const existingId = "existingId";
+const CREATE_INPUT = {
+ createdAt: new Date(),
+ id: "exampleId",
+ perfilReferencia: "examplePerfilReferencia",
+ updatedAt: new Date(),
+};
+const CREATE_RESULT = {
+ createdAt: new Date(),
+ id: "exampleId",
+ perfilReferencia: "examplePerfilReferencia",
+ updatedAt: new Date(),
+};
+const FIND_MANY_RESULT = [
+ {
+ createdAt: new Date(),
+ id: "exampleId",
+ perfilReferencia: "examplePerfilReferencia",
+ updatedAt: new Date(),
+ },
+];
+const FIND_ONE_RESULT = {
+ createdAt: new Date(),
+ id: "exampleId",
+ perfilReferencia: "examplePerfilReferencia",
+ updatedAt: new Date(),
+};
+
+const service = {
+ createDocumento() {
+ return CREATE_RESULT;
+ },
+ documentos: () => FIND_MANY_RESULT,
+ documento: ({ where }: { where: { id: string } }) => {
+ switch (where.id) {
+ case existingId:
+ return FIND_ONE_RESULT;
+ case nonExistingId:
+ return null;
+ }
+ },
+};
+
+const basicAuthGuard = {
+ canActivate: (context: ExecutionContext) => {
+ const argumentHost = context.switchToHttp();
+ const request = argumentHost.getRequest();
+ request.user = {
+ roles: ["user"],
+ };
+ return true;
+ },
+};
+
+const acGuard = {
+ canActivate: () => {
+ return true;
+ },
+};
+
+const aclFilterResponseInterceptor = {
+ intercept: (context: ExecutionContext, next: CallHandler) => {
+ return next.handle().pipe(
+ map((data) => {
+ return data;
+ })
+ );
+ },
+};
+const aclValidateRequestInterceptor = {
+ intercept: (context: ExecutionContext, next: CallHandler) => {
+ return next.handle();
+ },
+};
+
+describe("Documento", () => {
+ let app: INestApplication;
+
+ beforeAll(async () => {
+ const moduleRef = await Test.createTestingModule({
+ providers: [
+ {
+ provide: DocumentoService,
+ useValue: service,
+ },
+ ],
+ controllers: [DocumentoController],
+ imports: [ACLModule],
+ })
+ .overrideGuard(DefaultAuthGuard)
+ .useValue(basicAuthGuard)
+ .overrideGuard(ACGuard)
+ .useValue(acGuard)
+ .overrideInterceptor(AclFilterResponseInterceptor)
+ .useValue(aclFilterResponseInterceptor)
+ .overrideInterceptor(AclValidateRequestInterceptor)
+ .useValue(aclValidateRequestInterceptor)
+ .compile();
+
+ app = moduleRef.createNestApplication();
+ await app.init();
+ });
+
+ test("POST /documentos", async () => {
+ await request(app.getHttpServer())
+ .post("/documentos")
+ .send(CREATE_INPUT)
+ .expect(HttpStatus.CREATED)
+ .expect({
+ ...CREATE_RESULT,
+ createdAt: CREATE_RESULT.createdAt.toISOString(),
+ updatedAt: CREATE_RESULT.updatedAt.toISOString(),
+ });
+ });
+
+ test("GET /documentos", async () => {
+ await request(app.getHttpServer())
+ .get("/documentos")
+ .expect(HttpStatus.OK)
+ .expect([
+ {
+ ...FIND_MANY_RESULT[0],
+ createdAt: FIND_MANY_RESULT[0].createdAt.toISOString(),
+ updatedAt: FIND_MANY_RESULT[0].updatedAt.toISOString(),
+ },
+ ]);
+ });
+
+ test("GET /documentos/:id non existing", async () => {
+ await request(app.getHttpServer())
+ .get(`${"/documentos"}/${nonExistingId}`)
+ .expect(HttpStatus.NOT_FOUND)
+ .expect({
+ statusCode: HttpStatus.NOT_FOUND,
+ message: `No resource was found for {"${"id"}":"${nonExistingId}"}`,
+ error: "Not Found",
+ });
+ });
+
+ test("GET /documentos/:id existing", async () => {
+ await request(app.getHttpServer())
+ .get(`${"/documentos"}/${existingId}`)
+ .expect(HttpStatus.OK)
+ .expect({
+ ...FIND_ONE_RESULT,
+ createdAt: FIND_ONE_RESULT.createdAt.toISOString(),
+ updatedAt: FIND_ONE_RESULT.updatedAt.toISOString(),
+ });
+ });
+
+ test("POST /documentos existing resource", async () => {
+ const agent = request(app.getHttpServer());
+ await agent
+ .post("/documentos")
+ .send(CREATE_INPUT)
+ .expect(HttpStatus.CREATED)
+ .expect({
+ ...CREATE_RESULT,
+ createdAt: CREATE_RESULT.createdAt.toISOString(),
+ updatedAt: CREATE_RESULT.updatedAt.toISOString(),
+ })
+ .then(function () {
+ agent
+ .post("/documentos")
+ .send(CREATE_INPUT)
+ .expect(HttpStatus.CONFLICT)
+ .expect({
+ statusCode: HttpStatus.CONFLICT,
+ });
+ });
+ });
+
+ afterAll(async () => {
+ await app.close();
+ });
+});
diff --git a/apps/maestri-edu-server/src/documento/base/documento.controller.base.ts b/apps/maestri-edu-server/src/documento/base/documento.controller.base.ts
new file mode 100644
index 0000000..68bfe1c
--- /dev/null
+++ b/apps/maestri-edu-server/src/documento/base/documento.controller.base.ts
@@ -0,0 +1,136 @@
+/*
+------------------------------------------------------------------------------
+This code was generated by Amplication.
+
+Changes to this file will be lost if the code is regenerated.
+
+There are other ways to to customize your code, see this doc to learn more
+https://docs.amplication.com/how-to/custom-code
+
+------------------------------------------------------------------------------
+ */
+import * as common from "@nestjs/common";
+import * as swagger from "@nestjs/swagger";
+import { isRecordNotFoundError } from "../../prisma.util";
+import * as errors from "../../errors";
+import { Request } from "express";
+import { plainToClass } from "class-transformer";
+import { ApiNestedQuery } from "../../decorators/api-nested-query.decorator";
+import { DocumentoService } from "../documento.service";
+import { DocumentoCreateInput } from "./DocumentoCreateInput";
+import { Documento } from "./Documento";
+import { DocumentoFindManyArgs } from "./DocumentoFindManyArgs";
+import { DocumentoWhereUniqueInput } from "./DocumentoWhereUniqueInput";
+import { DocumentoUpdateInput } from "./DocumentoUpdateInput";
+
+export class DocumentoControllerBase {
+ constructor(protected readonly service: DocumentoService) {}
+ @common.Post()
+ @swagger.ApiCreatedResponse({ type: Documento })
+ async createDocumento(
+ @common.Body() data: DocumentoCreateInput
+ ): Promise {
+ return await this.service.createDocumento({
+ data: data,
+ select: {
+ createdAt: true,
+ id: true,
+ perfilReferencia: true,
+ updatedAt: true,
+ },
+ });
+ }
+
+ @common.Get()
+ @swagger.ApiOkResponse({ type: [Documento] })
+ @ApiNestedQuery(DocumentoFindManyArgs)
+ async documentos(@common.Req() request: Request): Promise {
+ const args = plainToClass(DocumentoFindManyArgs, request.query);
+ return this.service.documentos({
+ ...args,
+ select: {
+ createdAt: true,
+ id: true,
+ perfilReferencia: true,
+ updatedAt: true,
+ },
+ });
+ }
+
+ @common.Get("/:id")
+ @swagger.ApiOkResponse({ type: Documento })
+ @swagger.ApiNotFoundResponse({ type: errors.NotFoundException })
+ async documento(
+ @common.Param() params: DocumentoWhereUniqueInput
+ ): Promise {
+ const result = await this.service.documento({
+ where: params,
+ select: {
+ createdAt: true,
+ id: true,
+ perfilReferencia: true,
+ updatedAt: true,
+ },
+ });
+ if (result === null) {
+ throw new errors.NotFoundException(
+ `No resource was found for ${JSON.stringify(params)}`
+ );
+ }
+ return result;
+ }
+
+ @common.Patch("/:id")
+ @swagger.ApiOkResponse({ type: Documento })
+ @swagger.ApiNotFoundResponse({ type: errors.NotFoundException })
+ async updateDocumento(
+ @common.Param() params: DocumentoWhereUniqueInput,
+ @common.Body() data: DocumentoUpdateInput
+ ): Promise {
+ try {
+ return await this.service.updateDocumento({
+ where: params,
+ data: data,
+ select: {
+ createdAt: true,
+ id: true,
+ perfilReferencia: true,
+ updatedAt: true,
+ },
+ });
+ } catch (error) {
+ if (isRecordNotFoundError(error)) {
+ throw new errors.NotFoundException(
+ `No resource was found for ${JSON.stringify(params)}`
+ );
+ }
+ throw error;
+ }
+ }
+
+ @common.Delete("/:id")
+ @swagger.ApiOkResponse({ type: Documento })
+ @swagger.ApiNotFoundResponse({ type: errors.NotFoundException })
+ async deleteDocumento(
+ @common.Param() params: DocumentoWhereUniqueInput
+ ): Promise {
+ try {
+ return await this.service.deleteDocumento({
+ where: params,
+ select: {
+ createdAt: true,
+ id: true,
+ perfilReferencia: true,
+ updatedAt: true,
+ },
+ });
+ } catch (error) {
+ if (isRecordNotFoundError(error)) {
+ throw new errors.NotFoundException(
+ `No resource was found for ${JSON.stringify(params)}`
+ );
+ }
+ throw error;
+ }
+ }
+}
diff --git a/apps/maestri-edu-server/src/documento/base/documento.module.base.ts b/apps/maestri-edu-server/src/documento/base/documento.module.base.ts
new file mode 100644
index 0000000..07c92a9
--- /dev/null
+++ b/apps/maestri-edu-server/src/documento/base/documento.module.base.ts
@@ -0,0 +1,18 @@
+/*
+------------------------------------------------------------------------------
+This code was generated by Amplication.
+
+Changes to this file will be lost if the code is regenerated.
+
+There are other ways to to customize your code, see this doc to learn more
+https://docs.amplication.com/how-to/custom-code
+
+------------------------------------------------------------------------------
+ */
+import { Module } from "@nestjs/common";
+
+@Module({
+ imports: [],
+ exports: [],
+})
+export class DocumentoModuleBase {}
diff --git a/apps/maestri-edu-server/src/documento/base/documento.resolver.base.ts b/apps/maestri-edu-server/src/documento/base/documento.resolver.base.ts
new file mode 100644
index 0000000..acfa785
--- /dev/null
+++ b/apps/maestri-edu-server/src/documento/base/documento.resolver.base.ts
@@ -0,0 +1,99 @@
+/*
+------------------------------------------------------------------------------
+This code was generated by Amplication.
+
+Changes to this file will be lost if the code is regenerated.
+
+There are other ways to to customize your code, see this doc to learn more
+https://docs.amplication.com/how-to/custom-code
+
+------------------------------------------------------------------------------
+ */
+import * as graphql from "@nestjs/graphql";
+import { GraphQLError } from "graphql";
+import { isRecordNotFoundError } from "../../prisma.util";
+import { MetaQueryPayload } from "../../util/MetaQueryPayload";
+import { Documento } from "./Documento";
+import { DocumentoCountArgs } from "./DocumentoCountArgs";
+import { DocumentoFindManyArgs } from "./DocumentoFindManyArgs";
+import { DocumentoFindUniqueArgs } from "./DocumentoFindUniqueArgs";
+import { CreateDocumentoArgs } from "./CreateDocumentoArgs";
+import { UpdateDocumentoArgs } from "./UpdateDocumentoArgs";
+import { DeleteDocumentoArgs } from "./DeleteDocumentoArgs";
+import { DocumentoService } from "../documento.service";
+@graphql.Resolver(() => Documento)
+export class DocumentoResolverBase {
+ constructor(protected readonly service: DocumentoService) {}
+
+ async _documentosMeta(
+ @graphql.Args() args: DocumentoCountArgs
+ ): Promise {
+ const result = await this.service.count(args);
+ return {
+ count: result,
+ };
+ }
+
+ @graphql.Query(() => [Documento])
+ async documentos(
+ @graphql.Args() args: DocumentoFindManyArgs
+ ): Promise {
+ return this.service.documentos(args);
+ }
+
+ @graphql.Query(() => Documento, { nullable: true })
+ async documento(
+ @graphql.Args() args: DocumentoFindUniqueArgs
+ ): Promise {
+ const result = await this.service.documento(args);
+ if (result === null) {
+ return null;
+ }
+ return result;
+ }
+
+ @graphql.Mutation(() => Documento)
+ async createDocumento(
+ @graphql.Args() args: CreateDocumentoArgs
+ ): Promise {
+ return await this.service.createDocumento({
+ ...args,
+ data: args.data,
+ });
+ }
+
+ @graphql.Mutation(() => Documento)
+ async updateDocumento(
+ @graphql.Args() args: UpdateDocumentoArgs
+ ): Promise {
+ try {
+ return await this.service.updateDocumento({
+ ...args,
+ data: args.data,
+ });
+ } catch (error) {
+ if (isRecordNotFoundError(error)) {
+ throw new GraphQLError(
+ `No resource was found for ${JSON.stringify(args.where)}`
+ );
+ }
+ throw error;
+ }
+ }
+
+ @graphql.Mutation(() => Documento)
+ async deleteDocumento(
+ @graphql.Args() args: DeleteDocumentoArgs
+ ): Promise {
+ try {
+ return await this.service.deleteDocumento(args);
+ } catch (error) {
+ if (isRecordNotFoundError(error)) {
+ throw new GraphQLError(
+ `No resource was found for ${JSON.stringify(args.where)}`
+ );
+ }
+ throw error;
+ }
+ }
+}
diff --git a/apps/maestri-edu-server/src/documento/base/documento.service.base.ts b/apps/maestri-edu-server/src/documento/base/documento.service.base.ts
new file mode 100644
index 0000000..1d395a3
--- /dev/null
+++ b/apps/maestri-edu-server/src/documento/base/documento.service.base.ts
@@ -0,0 +1,49 @@
+/*
+------------------------------------------------------------------------------
+This code was generated by Amplication.
+
+Changes to this file will be lost if the code is regenerated.
+
+There are other ways to to customize your code, see this doc to learn more
+https://docs.amplication.com/how-to/custom-code
+
+------------------------------------------------------------------------------
+ */
+import { PrismaService } from "../../prisma/prisma.service";
+import { Prisma, Documento as PrismaDocumento } from "@prisma/client";
+
+export class DocumentoServiceBase {
+ constructor(protected readonly prisma: PrismaService) {}
+
+ async count(
+ args: Omit
+ ): Promise {
+ return this.prisma.documento.count(args);
+ }
+
+ async documentos(
+ args: Prisma.DocumentoFindManyArgs
+ ): Promise {
+ return this.prisma.documento.findMany(args);
+ }
+ async documento(
+ args: Prisma.DocumentoFindUniqueArgs
+ ): Promise {
+ return this.prisma.documento.findUnique(args);
+ }
+ async createDocumento(
+ args: Prisma.DocumentoCreateArgs
+ ): Promise {
+ return this.prisma.documento.create(args);
+ }
+ async updateDocumento(
+ args: Prisma.DocumentoUpdateArgs
+ ): Promise {
+ return this.prisma.documento.update(args);
+ }
+ async deleteDocumento(
+ args: Prisma.DocumentoDeleteArgs
+ ): Promise {
+ return this.prisma.documento.delete(args);
+ }
+}
diff --git a/apps/maestri-edu-server/src/documento/documento.controller.ts b/apps/maestri-edu-server/src/documento/documento.controller.ts
new file mode 100644
index 0000000..8ac2dce
--- /dev/null
+++ b/apps/maestri-edu-server/src/documento/documento.controller.ts
@@ -0,0 +1,12 @@
+import * as common from "@nestjs/common";
+import * as swagger from "@nestjs/swagger";
+import { DocumentoService } from "./documento.service";
+import { DocumentoControllerBase } from "./base/documento.controller.base";
+
+@swagger.ApiTags("documentos")
+@common.Controller("documentos")
+export class DocumentoController extends DocumentoControllerBase {
+ constructor(protected readonly service: DocumentoService) {
+ super(service);
+ }
+}
diff --git a/apps/maestri-edu-server/src/documento/documento.module.ts b/apps/maestri-edu-server/src/documento/documento.module.ts
new file mode 100644
index 0000000..16ae8d4
--- /dev/null
+++ b/apps/maestri-edu-server/src/documento/documento.module.ts
@@ -0,0 +1,13 @@
+import { Module } from "@nestjs/common";
+import { DocumentoModuleBase } from "./base/documento.module.base";
+import { DocumentoService } from "./documento.service";
+import { DocumentoController } from "./documento.controller";
+import { DocumentoResolver } from "./documento.resolver";
+
+@Module({
+ imports: [DocumentoModuleBase],
+ controllers: [DocumentoController],
+ providers: [DocumentoService, DocumentoResolver],
+ exports: [DocumentoService],
+})
+export class DocumentoModule {}
diff --git a/apps/maestri-edu-server/src/documento/documento.resolver.ts b/apps/maestri-edu-server/src/documento/documento.resolver.ts
new file mode 100644
index 0000000..a133a27
--- /dev/null
+++ b/apps/maestri-edu-server/src/documento/documento.resolver.ts
@@ -0,0 +1,11 @@
+import * as graphql from "@nestjs/graphql";
+import { DocumentoResolverBase } from "./base/documento.resolver.base";
+import { Documento } from "./base/Documento";
+import { DocumentoService } from "./documento.service";
+
+@graphql.Resolver(() => Documento)
+export class DocumentoResolver extends DocumentoResolverBase {
+ constructor(protected readonly service: DocumentoService) {
+ super(service);
+ }
+}
diff --git a/apps/maestri-edu-server/src/documento/documento.service.ts b/apps/maestri-edu-server/src/documento/documento.service.ts
new file mode 100644
index 0000000..1471f73
--- /dev/null
+++ b/apps/maestri-edu-server/src/documento/documento.service.ts
@@ -0,0 +1,10 @@
+import { Injectable } from "@nestjs/common";
+import { PrismaService } from "../prisma/prisma.service";
+import { DocumentoServiceBase } from "./base/documento.service.base";
+
+@Injectable()
+export class DocumentoService extends DocumentoServiceBase {
+ constructor(protected readonly prisma: PrismaService) {
+ super(prisma);
+ }
+}
diff --git a/apps/maestri-edu-server/src/endereco/base/CreateEnderecoArgs.ts b/apps/maestri-edu-server/src/endereco/base/CreateEnderecoArgs.ts
new file mode 100644
index 0000000..8e81f67
--- /dev/null
+++ b/apps/maestri-edu-server/src/endereco/base/CreateEnderecoArgs.ts
@@ -0,0 +1,30 @@
+/*
+------------------------------------------------------------------------------
+This code was generated by Amplication.
+
+Changes to this file will be lost if the code is regenerated.
+
+There are other ways to to customize your code, see this doc to learn more
+https://docs.amplication.com/how-to/custom-code
+
+------------------------------------------------------------------------------
+ */
+import { ArgsType, Field } from "@nestjs/graphql";
+import { ApiProperty } from "@nestjs/swagger";
+import { EnderecoCreateInput } from "./EnderecoCreateInput";
+import { ValidateNested } from "class-validator";
+import { Type } from "class-transformer";
+
+@ArgsType()
+class CreateEnderecoArgs {
+ @ApiProperty({
+ required: true,
+ type: () => EnderecoCreateInput,
+ })
+ @ValidateNested()
+ @Type(() => EnderecoCreateInput)
+ @Field(() => EnderecoCreateInput, { nullable: false })
+ data!: EnderecoCreateInput;
+}
+
+export { CreateEnderecoArgs as CreateEnderecoArgs };
diff --git a/apps/maestri-edu-server/src/endereco/base/DeleteEnderecoArgs.ts b/apps/maestri-edu-server/src/endereco/base/DeleteEnderecoArgs.ts
new file mode 100644
index 0000000..3be8642
--- /dev/null
+++ b/apps/maestri-edu-server/src/endereco/base/DeleteEnderecoArgs.ts
@@ -0,0 +1,30 @@
+/*
+------------------------------------------------------------------------------
+This code was generated by Amplication.
+
+Changes to this file will be lost if the code is regenerated.
+
+There are other ways to to customize your code, see this doc to learn more
+https://docs.amplication.com/how-to/custom-code
+
+------------------------------------------------------------------------------
+ */
+import { ArgsType, Field } from "@nestjs/graphql";
+import { ApiProperty } from "@nestjs/swagger";
+import { EnderecoWhereUniqueInput } from "./EnderecoWhereUniqueInput";
+import { ValidateNested } from "class-validator";
+import { Type } from "class-transformer";
+
+@ArgsType()
+class DeleteEnderecoArgs {
+ @ApiProperty({
+ required: true,
+ type: () => EnderecoWhereUniqueInput,
+ })
+ @ValidateNested()
+ @Type(() => EnderecoWhereUniqueInput)
+ @Field(() => EnderecoWhereUniqueInput, { nullable: false })
+ where!: EnderecoWhereUniqueInput;
+}
+
+export { DeleteEnderecoArgs as DeleteEnderecoArgs };
diff --git a/apps/maestri-edu-server/src/endereco/base/Endereco.ts b/apps/maestri-edu-server/src/endereco/base/Endereco.ts
new file mode 100644
index 0000000..9035586
--- /dev/null
+++ b/apps/maestri-edu-server/src/endereco/base/Endereco.ts
@@ -0,0 +1,56 @@
+/*
+------------------------------------------------------------------------------
+This code was generated by Amplication.
+
+Changes to this file will be lost if the code is regenerated.
+
+There are other ways to to customize your code, see this doc to learn more
+https://docs.amplication.com/how-to/custom-code
+
+------------------------------------------------------------------------------
+ */
+import { ObjectType, Field } from "@nestjs/graphql";
+import { ApiProperty } from "@nestjs/swagger";
+import { IsDate, IsString, MaxLength, IsOptional } from "class-validator";
+import { Type } from "class-transformer";
+
+@ObjectType()
+class Endereco {
+ @ApiProperty({
+ required: true,
+ })
+ @IsDate()
+ @Type(() => Date)
+ @Field(() => Date)
+ createdAt!: Date;
+
+ @ApiProperty({
+ required: true,
+ type: String,
+ })
+ @IsString()
+ @Field(() => String)
+ id!: string;
+
+ @ApiProperty({
+ required: false,
+ type: String,
+ })
+ @IsString()
+ @MaxLength(1000)
+ @IsOptional()
+ @Field(() => String, {
+ nullable: true,
+ })
+ perfilReferencia!: string | null;
+
+ @ApiProperty({
+ required: true,
+ })
+ @IsDate()
+ @Type(() => Date)
+ @Field(() => Date)
+ updatedAt!: Date;
+}
+
+export { Endereco as Endereco };
diff --git a/apps/maestri-edu-server/src/endereco/base/EnderecoCountArgs.ts b/apps/maestri-edu-server/src/endereco/base/EnderecoCountArgs.ts
new file mode 100644
index 0000000..69fa86e
--- /dev/null
+++ b/apps/maestri-edu-server/src/endereco/base/EnderecoCountArgs.ts
@@ -0,0 +1,28 @@
+/*
+------------------------------------------------------------------------------
+This code was generated by Amplication.
+
+Changes to this file will be lost if the code is regenerated.
+
+There are other ways to to customize your code, see this doc to learn more
+https://docs.amplication.com/how-to/custom-code
+
+------------------------------------------------------------------------------
+ */
+import { ArgsType, Field } from "@nestjs/graphql";
+import { ApiProperty } from "@nestjs/swagger";
+import { EnderecoWhereInput } from "./EnderecoWhereInput";
+import { Type } from "class-transformer";
+
+@ArgsType()
+class EnderecoCountArgs {
+ @ApiProperty({
+ required: false,
+ type: () => EnderecoWhereInput,
+ })
+ @Field(() => EnderecoWhereInput, { nullable: true })
+ @Type(() => EnderecoWhereInput)
+ where?: EnderecoWhereInput;
+}
+
+export { EnderecoCountArgs as EnderecoCountArgs };
diff --git a/apps/maestri-edu-server/src/endereco/base/EnderecoCreateInput.ts b/apps/maestri-edu-server/src/endereco/base/EnderecoCreateInput.ts
new file mode 100644
index 0000000..16bb3f1
--- /dev/null
+++ b/apps/maestri-edu-server/src/endereco/base/EnderecoCreateInput.ts
@@ -0,0 +1,31 @@
+/*
+------------------------------------------------------------------------------
+This code was generated by Amplication.
+
+Changes to this file will be lost if the code is regenerated.
+
+There are other ways to to customize your code, see this doc to learn more
+https://docs.amplication.com/how-to/custom-code
+
+------------------------------------------------------------------------------
+ */
+import { InputType, Field } from "@nestjs/graphql";
+import { ApiProperty } from "@nestjs/swagger";
+import { IsString, MaxLength, IsOptional } from "class-validator";
+
+@InputType()
+class EnderecoCreateInput {
+ @ApiProperty({
+ required: false,
+ type: String,
+ })
+ @IsString()
+ @MaxLength(1000)
+ @IsOptional()
+ @Field(() => String, {
+ nullable: true,
+ })
+ perfilReferencia?: string | null;
+}
+
+export { EnderecoCreateInput as EnderecoCreateInput };
diff --git a/apps/maestri-edu-server/src/endereco/base/EnderecoFindManyArgs.ts b/apps/maestri-edu-server/src/endereco/base/EnderecoFindManyArgs.ts
new file mode 100644
index 0000000..70f7c20
--- /dev/null
+++ b/apps/maestri-edu-server/src/endereco/base/EnderecoFindManyArgs.ts
@@ -0,0 +1,62 @@
+/*
+------------------------------------------------------------------------------
+This code was generated by Amplication.
+
+Changes to this file will be lost if the code is regenerated.
+
+There are other ways to to customize your code, see this doc to learn more
+https://docs.amplication.com/how-to/custom-code
+
+------------------------------------------------------------------------------
+ */
+import { ArgsType, Field } from "@nestjs/graphql";
+import { ApiProperty } from "@nestjs/swagger";
+import { EnderecoWhereInput } from "./EnderecoWhereInput";
+import { IsOptional, ValidateNested, IsInt } from "class-validator";
+import { Type } from "class-transformer";
+import { EnderecoOrderByInput } from "./EnderecoOrderByInput";
+
+@ArgsType()
+class EnderecoFindManyArgs {
+ @ApiProperty({
+ required: false,
+ type: () => EnderecoWhereInput,
+ })
+ @IsOptional()
+ @ValidateNested()
+ @Field(() => EnderecoWhereInput, { nullable: true })
+ @Type(() => EnderecoWhereInput)
+ where?: EnderecoWhereInput;
+
+ @ApiProperty({
+ required: false,
+ type: [EnderecoOrderByInput],
+ })
+ @IsOptional()
+ @ValidateNested({ each: true })
+ @Field(() => [EnderecoOrderByInput], { nullable: true })
+ @Type(() => EnderecoOrderByInput)
+ orderBy?: Array;
+
+ @ApiProperty({
+ required: false,
+ type: Number,
+ })
+ @IsOptional()
+ @IsInt()
+ @Field(() => Number, { nullable: true })
+ @Type(() => Number)
+ skip?: number;
+
+ @ApiProperty({
+ required: false,
+ type: Number,
+ })
+ @IsOptional()
+ @IsInt()
+ @Field(() => Number, { nullable: true })
+ @Type(() => Number)
+ take?: number;
+}
+
+export { EnderecoFindManyArgs as EnderecoFindManyArgs };
diff --git a/apps/maestri-edu-server/src/endereco/base/EnderecoFindUniqueArgs.ts b/apps/maestri-edu-server/src/endereco/base/EnderecoFindUniqueArgs.ts
new file mode 100644
index 0000000..df78a86
--- /dev/null
+++ b/apps/maestri-edu-server/src/endereco/base/EnderecoFindUniqueArgs.ts
@@ -0,0 +1,30 @@
+/*
+------------------------------------------------------------------------------
+This code was generated by Amplication.
+
+Changes to this file will be lost if the code is regenerated.
+
+There are other ways to to customize your code, see this doc to learn more
+https://docs.amplication.com/how-to/custom-code
+
+------------------------------------------------------------------------------
+ */
+import { ArgsType, Field } from "@nestjs/graphql";
+import { ApiProperty } from "@nestjs/swagger";
+import { EnderecoWhereUniqueInput } from "./EnderecoWhereUniqueInput";
+import { ValidateNested } from "class-validator";
+import { Type } from "class-transformer";
+
+@ArgsType()
+class EnderecoFindUniqueArgs {
+ @ApiProperty({
+ required: true,
+ type: () => EnderecoWhereUniqueInput,
+ })
+ @ValidateNested()
+ @Type(() => EnderecoWhereUniqueInput)
+ @Field(() => EnderecoWhereUniqueInput, { nullable: false })
+ where!: EnderecoWhereUniqueInput;
+}
+
+export { EnderecoFindUniqueArgs as EnderecoFindUniqueArgs };
diff --git a/apps/maestri-edu-server/src/endereco/base/EnderecoListRelationFilter.ts b/apps/maestri-edu-server/src/endereco/base/EnderecoListRelationFilter.ts
new file mode 100644
index 0000000..ab7458d
--- /dev/null
+++ b/apps/maestri-edu-server/src/endereco/base/EnderecoListRelationFilter.ts
@@ -0,0 +1,56 @@
+/*
+------------------------------------------------------------------------------
+This code was generated by Amplication.
+
+Changes to this file will be lost if the code is regenerated.
+
+There are other ways to to customize your code, see this doc to learn more
+https://docs.amplication.com/how-to/custom-code
+
+------------------------------------------------------------------------------
+ */
+import { InputType, Field } from "@nestjs/graphql";
+import { ApiProperty } from "@nestjs/swagger";
+import { EnderecoWhereInput } from "./EnderecoWhereInput";
+import { ValidateNested, IsOptional } from "class-validator";
+import { Type } from "class-transformer";
+
+@InputType()
+class EnderecoListRelationFilter {
+ @ApiProperty({
+ required: false,
+ type: () => EnderecoWhereInput,
+ })
+ @ValidateNested()
+ @Type(() => EnderecoWhereInput)
+ @IsOptional()
+ @Field(() => EnderecoWhereInput, {
+ nullable: true,
+ })
+ every?: EnderecoWhereInput;
+
+ @ApiProperty({
+ required: false,
+ type: () => EnderecoWhereInput,
+ })
+ @ValidateNested()
+ @Type(() => EnderecoWhereInput)
+ @IsOptional()
+ @Field(() => EnderecoWhereInput, {
+ nullable: true,
+ })
+ some?: EnderecoWhereInput;
+
+ @ApiProperty({
+ required: false,
+ type: () => EnderecoWhereInput,
+ })
+ @ValidateNested()
+ @Type(() => EnderecoWhereInput)
+ @IsOptional()
+ @Field(() => EnderecoWhereInput, {
+ nullable: true,
+ })
+ none?: EnderecoWhereInput;
+}
+export { EnderecoListRelationFilter as EnderecoListRelationFilter };
diff --git a/apps/maestri-edu-server/src/endereco/base/EnderecoOrderByInput.ts b/apps/maestri-edu-server/src/endereco/base/EnderecoOrderByInput.ts
new file mode 100644
index 0000000..2683016
--- /dev/null
+++ b/apps/maestri-edu-server/src/endereco/base/EnderecoOrderByInput.ts
@@ -0,0 +1,67 @@
+/*
+------------------------------------------------------------------------------
+This code was generated by Amplication.
+
+Changes to this file will be lost if the code is regenerated.
+
+There are other ways to to customize your code, see this doc to learn more
+https://docs.amplication.com/how-to/custom-code
+
+------------------------------------------------------------------------------
+ */
+import { InputType, Field } from "@nestjs/graphql";
+import { ApiProperty } from "@nestjs/swagger";
+import { IsOptional, IsEnum } from "class-validator";
+import { SortOrder } from "../../util/SortOrder";
+
+@InputType({
+ isAbstract: true,
+ description: undefined,
+})
+class EnderecoOrderByInput {
+ @ApiProperty({
+ required: false,
+ enum: ["asc", "desc"],
+ })
+ @IsOptional()
+ @IsEnum(SortOrder)
+ @Field(() => SortOrder, {
+ nullable: true,
+ })
+ createdAt?: SortOrder;
+
+ @ApiProperty({
+ required: false,
+ enum: ["asc", "desc"],
+ })
+ @IsOptional()
+ @IsEnum(SortOrder)
+ @Field(() => SortOrder, {
+ nullable: true,
+ })
+ id?: SortOrder;
+
+ @ApiProperty({
+ required: false,
+ enum: ["asc", "desc"],
+ })
+ @IsOptional()
+ @IsEnum(SortOrder)
+ @Field(() => SortOrder, {
+ nullable: true,
+ })
+ perfilReferencia?: SortOrder;
+
+ @ApiProperty({
+ required: false,
+ enum: ["asc", "desc"],
+ })
+ @IsOptional()
+ @IsEnum(SortOrder)
+ @Field(() => SortOrder, {
+ nullable: true,
+ })
+ updatedAt?: SortOrder;
+}
+
+export { EnderecoOrderByInput as EnderecoOrderByInput };
diff --git a/apps/maestri-edu-server/src/endereco/base/EnderecoUpdateInput.ts b/apps/maestri-edu-server/src/endereco/base/EnderecoUpdateInput.ts
new file mode 100644
index 0000000..fea8baf
--- /dev/null
+++ b/apps/maestri-edu-server/src/endereco/base/EnderecoUpdateInput.ts
@@ -0,0 +1,31 @@
+/*
+------------------------------------------------------------------------------
+This code was generated by Amplication.
+
+Changes to this file will be lost if the code is regenerated.
+
+There are other ways to to customize your code, see this doc to learn more
+https://docs.amplication.com/how-to/custom-code
+
+------------------------------------------------------------------------------
+ */
+import { InputType, Field } from "@nestjs/graphql";
+import { ApiProperty } from "@nestjs/swagger";
+import { IsString, MaxLength, IsOptional } from "class-validator";
+
+@InputType()
+class EnderecoUpdateInput {
+ @ApiProperty({
+ required: false,
+ type: String,
+ })
+ @IsString()
+ @MaxLength(1000)
+ @IsOptional()
+ @Field(() => String, {
+ nullable: true,
+ })
+ perfilReferencia?: string | null;
+}
+
+export { EnderecoUpdateInput as EnderecoUpdateInput };
diff --git a/apps/maestri-edu-server/src/endereco/base/EnderecoWhereInput.ts b/apps/maestri-edu-server/src/endereco/base/EnderecoWhereInput.ts
new file mode 100644
index 0000000..90a3f84
--- /dev/null
+++ b/apps/maestri-edu-server/src/endereco/base/EnderecoWhereInput.ts
@@ -0,0 +1,44 @@
+/*
+------------------------------------------------------------------------------
+This code was generated by Amplication.
+
+Changes to this file will be lost if the code is regenerated.
+
+There are other ways to to customize your code, see this doc to learn more
+https://docs.amplication.com/how-to/custom-code
+
+------------------------------------------------------------------------------
+ */
+import { InputType, Field } from "@nestjs/graphql";
+import { ApiProperty } from "@nestjs/swagger";
+import { StringFilter } from "../../util/StringFilter";
+import { Type } from "class-transformer";
+import { IsOptional } from "class-validator";
+import { StringNullableFilter } from "../../util/StringNullableFilter";
+
+@InputType()
+class EnderecoWhereInput {
+ @ApiProperty({
+ required: false,
+ type: StringFilter,
+ })
+ @Type(() => StringFilter)
+ @IsOptional()
+ @Field(() => StringFilter, {
+ nullable: true,
+ })
+ id?: StringFilter;
+
+ @ApiProperty({
+ required: false,
+ type: StringNullableFilter,
+ })
+ @Type(() => StringNullableFilter)
+ @IsOptional()
+ @Field(() => StringNullableFilter, {
+ nullable: true,
+ })
+ perfilReferencia?: StringNullableFilter;
+}
+
+export { EnderecoWhereInput as EnderecoWhereInput };
diff --git a/apps/maestri-edu-server/src/endereco/base/EnderecoWhereUniqueInput.ts b/apps/maestri-edu-server/src/endereco/base/EnderecoWhereUniqueInput.ts
new file mode 100644
index 0000000..bf5b326
--- /dev/null
+++ b/apps/maestri-edu-server/src/endereco/base/EnderecoWhereUniqueInput.ts
@@ -0,0 +1,27 @@
+/*
+------------------------------------------------------------------------------
+This code was generated by Amplication.
+
+Changes to this file will be lost if the code is regenerated.
+
+There are other ways to to customize your code, see this doc to learn more
+https://docs.amplication.com/how-to/custom-code
+
+------------------------------------------------------------------------------
+ */
+import { InputType, Field } from "@nestjs/graphql";
+import { ApiProperty } from "@nestjs/swagger";
+import { IsString } from "class-validator";
+
+@InputType()
+class EnderecoWhereUniqueInput {
+ @ApiProperty({
+ required: true,
+ type: String,
+ })
+ @IsString()
+ @Field(() => String)
+ id!: string;
+}
+
+export { EnderecoWhereUniqueInput as EnderecoWhereUniqueInput };
diff --git a/apps/maestri-edu-server/src/endereco/base/UpdateEnderecoArgs.ts b/apps/maestri-edu-server/src/endereco/base/UpdateEnderecoArgs.ts
new file mode 100644
index 0000000..730626c
--- /dev/null
+++ b/apps/maestri-edu-server/src/endereco/base/UpdateEnderecoArgs.ts
@@ -0,0 +1,40 @@
+/*
+------------------------------------------------------------------------------
+This code was generated by Amplication.
+
+Changes to this file will be lost if the code is regenerated.
+
+There are other ways to to customize your code, see this doc to learn more
+https://docs.amplication.com/how-to/custom-code
+
+------------------------------------------------------------------------------
+ */
+import { ArgsType, Field } from "@nestjs/graphql";
+import { ApiProperty } from "@nestjs/swagger";
+import { EnderecoWhereUniqueInput } from "./EnderecoWhereUniqueInput";
+import { ValidateNested } from "class-validator";
+import { Type } from "class-transformer";
+import { EnderecoUpdateInput } from "./EnderecoUpdateInput";
+
+@ArgsType()
+class UpdateEnderecoArgs {
+ @ApiProperty({
+ required: true,
+ type: () => EnderecoWhereUniqueInput,
+ })
+ @ValidateNested()
+ @Type(() => EnderecoWhereUniqueInput)
+ @Field(() => EnderecoWhereUniqueInput, { nullable: false })
+ where!: EnderecoWhereUniqueInput;
+
+ @ApiProperty({
+ required: true,
+ type: () => EnderecoUpdateInput,
+ })
+ @ValidateNested()
+ @Type(() => EnderecoUpdateInput)
+ @Field(() => EnderecoUpdateInput, { nullable: false })
+ data!: EnderecoUpdateInput;
+}
+
+export { UpdateEnderecoArgs as UpdateEnderecoArgs };
diff --git a/apps/maestri-edu-server/src/endereco/base/endereco.controller.base.spec.ts b/apps/maestri-edu-server/src/endereco/base/endereco.controller.base.spec.ts
new file mode 100644
index 0000000..7eec55a
--- /dev/null
+++ b/apps/maestri-edu-server/src/endereco/base/endereco.controller.base.spec.ts
@@ -0,0 +1,194 @@
+import { Test } from "@nestjs/testing";
+import {
+ INestApplication,
+ HttpStatus,
+ ExecutionContext,
+ CallHandler,
+} from "@nestjs/common";
+import request from "supertest";
+import { ACGuard } from "nest-access-control";
+import { DefaultAuthGuard } from "../../auth/defaultAuth.guard";
+import { ACLModule } from "../../auth/acl.module";
+import { AclFilterResponseInterceptor } from "../../interceptors/aclFilterResponse.interceptor";
+import { AclValidateRequestInterceptor } from "../../interceptors/aclValidateRequest.interceptor";
+import { map } from "rxjs";
+import { EnderecoController } from "../endereco.controller";
+import { EnderecoService } from "../endereco.service";
+
+const nonExistingId = "nonExistingId";
+const existingId = "existingId";
+const CREATE_INPUT = {
+ createdAt: new Date(),
+ id: "exampleId",
+ perfilReferencia: "examplePerfilReferencia",
+ updatedAt: new Date(),
+};
+const CREATE_RESULT = {
+ createdAt: new Date(),
+ id: "exampleId",
+ perfilReferencia: "examplePerfilReferencia",
+ updatedAt: new Date(),
+};
+const FIND_MANY_RESULT = [
+ {
+ createdAt: new Date(),
+ id: "exampleId",
+ perfilReferencia: "examplePerfilReferencia",
+ updatedAt: new Date(),
+ },
+];
+const FIND_ONE_RESULT = {
+ createdAt: new Date(),
+ id: "exampleId",
+ perfilReferencia: "examplePerfilReferencia",
+ updatedAt: new Date(),
+};
+
+const service = {
+ createEndereco() {
+ return CREATE_RESULT;
+ },
+ enderecos: () => FIND_MANY_RESULT,
+ endereco: ({ where }: { where: { id: string } }) => {
+ switch (where.id) {
+ case existingId:
+ return FIND_ONE_RESULT;
+ case nonExistingId:
+ return null;
+ }
+ },
+};
+
+const basicAuthGuard = {
+ canActivate: (context: ExecutionContext) => {
+ const argumentHost = context.switchToHttp();
+ const request = argumentHost.getRequest();
+ request.user = {
+ roles: ["user"],
+ };
+ return true;
+ },
+};
+
+const acGuard = {
+ canActivate: () => {
+ return true;
+ },
+};
+
+const aclFilterResponseInterceptor = {
+ intercept: (context: ExecutionContext, next: CallHandler) => {
+ return next.handle().pipe(
+ map((data) => {
+ return data;
+ })
+ );
+ },
+};
+const aclValidateRequestInterceptor = {
+ intercept: (context: ExecutionContext, next: CallHandler) => {
+ return next.handle();
+ },
+};
+
+describe("Endereco", () => {
+ let app: INestApplication;
+
+ beforeAll(async () => {
+ const moduleRef = await Test.createTestingModule({
+ providers: [
+ {
+ provide: EnderecoService,
+ useValue: service,
+ },
+ ],
+ controllers: [EnderecoController],
+ imports: [ACLModule],
+ })
+ .overrideGuard(DefaultAuthGuard)
+ .useValue(basicAuthGuard)
+ .overrideGuard(ACGuard)
+ .useValue(acGuard)
+ .overrideInterceptor(AclFilterResponseInterceptor)
+ .useValue(aclFilterResponseInterceptor)
+ .overrideInterceptor(AclValidateRequestInterceptor)
+ .useValue(aclValidateRequestInterceptor)
+ .compile();
+
+ app = moduleRef.createNestApplication();
+ await app.init();
+ });
+
+ test("POST /enderecos", async () => {
+ await request(app.getHttpServer())
+ .post("/enderecos")
+ .send(CREATE_INPUT)
+ .expect(HttpStatus.CREATED)
+ .expect({
+ ...CREATE_RESULT,
+ createdAt: CREATE_RESULT.createdAt.toISOString(),
+ updatedAt: CREATE_RESULT.updatedAt.toISOString(),
+ });
+ });
+
+ test("GET /enderecos", async () => {
+ await request(app.getHttpServer())
+ .get("/enderecos")
+ .expect(HttpStatus.OK)
+ .expect([
+ {
+ ...FIND_MANY_RESULT[0],
+ createdAt: FIND_MANY_RESULT[0].createdAt.toISOString(),
+ updatedAt: FIND_MANY_RESULT[0].updatedAt.toISOString(),
+ },
+ ]);
+ });
+
+ test("GET /enderecos/:id non existing", async () => {
+ await request(app.getHttpServer())
+ .get(`${"/enderecos"}/${nonExistingId}`)
+ .expect(HttpStatus.NOT_FOUND)
+ .expect({
+ statusCode: HttpStatus.NOT_FOUND,
+ message: `No resource was found for {"${"id"}":"${nonExistingId}"}`,
+ error: "Not Found",
+ });
+ });
+
+ test("GET /enderecos/:id existing", async () => {
+ await request(app.getHttpServer())
+ .get(`${"/enderecos"}/${existingId}`)
+ .expect(HttpStatus.OK)
+ .expect({
+ ...FIND_ONE_RESULT,
+ createdAt: FIND_ONE_RESULT.createdAt.toISOString(),
+ updatedAt: FIND_ONE_RESULT.updatedAt.toISOString(),
+ });
+ });
+
+ test("POST /enderecos existing resource", async () => {
+ const agent = request(app.getHttpServer());
+ await agent
+ .post("/enderecos")
+ .send(CREATE_INPUT)
+ .expect(HttpStatus.CREATED)
+ .expect({
+ ...CREATE_RESULT,
+ createdAt: CREATE_RESULT.createdAt.toISOString(),
+ updatedAt: CREATE_RESULT.updatedAt.toISOString(),
+ })
+ .then(function () {
+ agent
+ .post("/enderecos")
+ .send(CREATE_INPUT)
+ .expect(HttpStatus.CONFLICT)
+ .expect({
+ statusCode: HttpStatus.CONFLICT,
+ });
+ });
+ });
+
+ afterAll(async () => {
+ await app.close();
+ });
+});
diff --git a/apps/maestri-edu-server/src/endereco/base/endereco.controller.base.ts b/apps/maestri-edu-server/src/endereco/base/endereco.controller.base.ts
new file mode 100644
index 0000000..2679d39
--- /dev/null
+++ b/apps/maestri-edu-server/src/endereco/base/endereco.controller.base.ts
@@ -0,0 +1,136 @@
+/*
+------------------------------------------------------------------------------
+This code was generated by Amplication.
+
+Changes to this file will be lost if the code is regenerated.
+
+There are other ways to to customize your code, see this doc to learn more
+https://docs.amplication.com/how-to/custom-code
+
+------------------------------------------------------------------------------
+ */
+import * as common from "@nestjs/common";
+import * as swagger from "@nestjs/swagger";
+import { isRecordNotFoundError } from "../../prisma.util";
+import * as errors from "../../errors";
+import { Request } from "express";
+import { plainToClass } from "class-transformer";
+import { ApiNestedQuery } from "../../decorators/api-nested-query.decorator";
+import { EnderecoService } from "../endereco.service";
+import { EnderecoCreateInput } from "./EnderecoCreateInput";
+import { Endereco } from "./Endereco";
+import { EnderecoFindManyArgs } from "./EnderecoFindManyArgs";
+import { EnderecoWhereUniqueInput } from "./EnderecoWhereUniqueInput";
+import { EnderecoUpdateInput } from "./EnderecoUpdateInput";
+
+export class EnderecoControllerBase {
+ constructor(protected readonly service: EnderecoService) {}
+ @common.Post()
+ @swagger.ApiCreatedResponse({ type: Endereco })
+ async createEndereco(
+ @common.Body() data: EnderecoCreateInput
+ ): Promise {
+ return await this.service.createEndereco({
+ data: data,
+ select: {
+ createdAt: true,
+ id: true,
+ perfilReferencia: true,
+ updatedAt: true,
+ },
+ });
+ }
+
+ @common.Get()
+ @swagger.ApiOkResponse({ type: [Endereco] })
+ @ApiNestedQuery(EnderecoFindManyArgs)
+ async enderecos(@common.Req() request: Request): Promise {
+ const args = plainToClass(EnderecoFindManyArgs, request.query);
+ return this.service.enderecos({
+ ...args,
+ select: {
+ createdAt: true,
+ id: true,
+ perfilReferencia: true,
+ updatedAt: true,
+ },
+ });
+ }
+
+ @common.Get("/:id")
+ @swagger.ApiOkResponse({ type: Endereco })
+ @swagger.ApiNotFoundResponse({ type: errors.NotFoundException })
+ async endereco(
+ @common.Param() params: EnderecoWhereUniqueInput
+ ): Promise {
+ const result = await this.service.endereco({
+ where: params,
+ select: {
+ createdAt: true,
+ id: true,
+ perfilReferencia: true,
+ updatedAt: true,
+ },
+ });
+ if (result === null) {
+ throw new errors.NotFoundException(
+ `No resource was found for ${JSON.stringify(params)}`
+ );
+ }
+ return result;
+ }
+
+ @common.Patch("/:id")
+ @swagger.ApiOkResponse({ type: Endereco })
+ @swagger.ApiNotFoundResponse({ type: errors.NotFoundException })
+ async updateEndereco(
+ @common.Param() params: EnderecoWhereUniqueInput,
+ @common.Body() data: EnderecoUpdateInput
+ ): Promise {
+ try {
+ return await this.service.updateEndereco({
+ where: params,
+ data: data,
+ select: {
+ createdAt: true,
+ id: true,
+ perfilReferencia: true,
+ updatedAt: true,
+ },
+ });
+ } catch (error) {
+ if (isRecordNotFoundError(error)) {
+ throw new errors.NotFoundException(
+ `No resource was found for ${JSON.stringify(params)}`
+ );
+ }
+ throw error;
+ }
+ }
+
+ @common.Delete("/:id")
+ @swagger.ApiOkResponse({ type: Endereco })
+ @swagger.ApiNotFoundResponse({ type: errors.NotFoundException })
+ async deleteEndereco(
+ @common.Param() params: EnderecoWhereUniqueInput
+ ): Promise {
+ try {
+ return await this.service.deleteEndereco({
+ where: params,
+ select: {
+ createdAt: true,
+ id: true,
+ perfilReferencia: true,
+ updatedAt: true,
+ },
+ });
+ } catch (error) {
+ if (isRecordNotFoundError(error)) {
+ throw new errors.NotFoundException(
+ `No resource was found for ${JSON.stringify(params)}`
+ );
+ }
+ throw error;
+ }
+ }
+}
diff --git a/apps/maestri-edu-server/src/endereco/base/endereco.module.base.ts b/apps/maestri-edu-server/src/endereco/base/endereco.module.base.ts
new file mode 100644
index 0000000..1eaae1f
--- /dev/null
+++ b/apps/maestri-edu-server/src/endereco/base/endereco.module.base.ts
@@ -0,0 +1,18 @@
+/*
+------------------------------------------------------------------------------
+This code was generated by Amplication.
+
+Changes to this file will be lost if the code is regenerated.
+
+There are other ways to to customize your code, see this doc to learn more
+https://docs.amplication.com/how-to/custom-code
+
+------------------------------------------------------------------------------
+ */
+import { Module } from "@nestjs/common";
+
+@Module({
+ imports: [],
+ exports: [],
+})
+export class EnderecoModuleBase {}
diff --git a/apps/maestri-edu-server/src/endereco/base/endereco.resolver.base.ts b/apps/maestri-edu-server/src/endereco/base/endereco.resolver.base.ts
new file mode 100644
index 0000000..c34b517
--- /dev/null
+++ b/apps/maestri-edu-server/src/endereco/base/endereco.resolver.base.ts
@@ -0,0 +1,99 @@
+/*
+------------------------------------------------------------------------------
+This code was generated by Amplication.
+
+Changes to this file will be lost if the code is regenerated.
+
+There are other ways to to customize your code, see this doc to learn more
+https://docs.amplication.com/how-to/custom-code
+
+------------------------------------------------------------------------------
+ */
+import * as graphql from "@nestjs/graphql";
+import { GraphQLError } from "graphql";
+import { isRecordNotFoundError } from "../../prisma.util";
+import { MetaQueryPayload } from "../../util/MetaQueryPayload";
+import { Endereco } from "./Endereco";
+import { EnderecoCountArgs } from "./EnderecoCountArgs";
+import { EnderecoFindManyArgs } from "./EnderecoFindManyArgs";
+import { EnderecoFindUniqueArgs } from "./EnderecoFindUniqueArgs";
+import { CreateEnderecoArgs } from "./CreateEnderecoArgs";
+import { UpdateEnderecoArgs } from "./UpdateEnderecoArgs";
+import { DeleteEnderecoArgs } from "./DeleteEnderecoArgs";
+import { EnderecoService } from "../endereco.service";
+@graphql.Resolver(() => Endereco)
+export class EnderecoResolverBase {
+ constructor(protected readonly service: EnderecoService) {}
+
+ async _enderecosMeta(
+ @graphql.Args() args: EnderecoCountArgs
+ ): Promise {
+ const result = await this.service.count(args);
+ return {
+ count: result,
+ };
+ }
+
+ @graphql.Query(() => [Endereco])
+ async enderecos(
+ @graphql.Args() args: EnderecoFindManyArgs
+ ): Promise {
+ return this.service.enderecos(args);
+ }
+
+ @graphql.Query(() => Endereco, { nullable: true })
+ async endereco(
+ @graphql.Args() args: EnderecoFindUniqueArgs
+ ): Promise {
+ const result = await this.service.endereco(args);
+ if (result === null) {
+ return null;
+ }
+ return result;
+ }
+
+ @graphql.Mutation(() => Endereco)
+ async createEndereco(
+ @graphql.Args() args: CreateEnderecoArgs
+ ): Promise {
+ return await this.service.createEndereco({
+ ...args,
+ data: args.data,
+ });
+ }
+
+ @graphql.Mutation(() => Endereco)
+ async updateEndereco(
+ @graphql.Args() args: UpdateEnderecoArgs
+ ): Promise {
+ try {
+ return await this.service.updateEndereco({
+ ...args,
+ data: args.data,
+ });
+ } catch (error) {
+ if (isRecordNotFoundError(error)) {
+ throw new GraphQLError(
+ `No resource was found for ${JSON.stringify(args.where)}`
+ );
+ }
+ throw error;
+ }
+ }
+
+ @graphql.Mutation(() => Endereco)
+ async deleteEndereco(
+ @graphql.Args() args: DeleteEnderecoArgs
+ ): Promise {
+ try {
+ return await this.service.deleteEndereco(args);
+ } catch (error) {
+ if (isRecordNotFoundError(error)) {
+ throw new GraphQLError(
+ `No resource was found for ${JSON.stringify(args.where)}`
+ );
+ }
+ throw error;
+ }
+ }
+}
diff --git a/apps/maestri-edu-server/src/endereco/base/endereco.service.base.ts b/apps/maestri-edu-server/src/endereco/base/endereco.service.base.ts
new file mode 100644
index 0000000..d8d638f
--- /dev/null
+++ b/apps/maestri-edu-server/src/endereco/base/endereco.service.base.ts
@@ -0,0 +1,47 @@
+/*
+------------------------------------------------------------------------------
+This code was generated by Amplication.
+
+Changes to this file will be lost if the code is regenerated.
+
+There are other ways to to customize your code, see this doc to learn more
+https://docs.amplication.com/how-to/custom-code
+
+------------------------------------------------------------------------------
+ */
+import { PrismaService } from "../../prisma/prisma.service";
+import { Prisma, Endereco as PrismaEndereco } from "@prisma/client";
+
+export class EnderecoServiceBase {
+ constructor(protected readonly prisma: PrismaService) {}
+
+ async count(args: Omit): Promise {
+ return this.prisma.endereco.count(args);
+ }
+
+ async enderecos(
+ args: Prisma.EnderecoFindManyArgs
+ ): Promise {
+ return this.prisma.endereco.findMany(args);
+ }
+ async endereco(
+ args: Prisma.EnderecoFindUniqueArgs
+ ): Promise {
+ return this.prisma.endereco.findUnique(args);
+ }
+ async createEndereco(
+ args: Prisma.EnderecoCreateArgs
+ ): Promise {
+ return this.prisma.endereco.create(args);
+ }
+ async updateEndereco(
+ args: Prisma.EnderecoUpdateArgs
+ ): Promise {
+ return this.prisma.endereco.update(args);
+ }
+ async deleteEndereco(
+ args: Prisma.EnderecoDeleteArgs
+ ): Promise {
+ return this.prisma.endereco.delete(args);
+ }
+}
diff --git a/apps/maestri-edu-server/src/endereco/endereco.controller.ts b/apps/maestri-edu-server/src/endereco/endereco.controller.ts
new file mode 100644
index 0000000..4529371
--- /dev/null
+++ b/apps/maestri-edu-server/src/endereco/endereco.controller.ts
@@ -0,0 +1,12 @@
+import * as common from "@nestjs/common";
+import * as swagger from "@nestjs/swagger";
+import { EnderecoService } from "./endereco.service";
+import { EnderecoControllerBase } from "./base/endereco.controller.base";
+
+@swagger.ApiTags("enderecos")
+@common.Controller("enderecos")
+export class EnderecoController extends EnderecoControllerBase {
+ constructor(protected readonly service: EnderecoService) {
+ super(service);
+ }
+}
diff --git a/apps/maestri-edu-server/src/endereco/endereco.module.ts b/apps/maestri-edu-server/src/endereco/endereco.module.ts
new file mode 100644
index 0000000..1ffef9d
--- /dev/null
+++ b/apps/maestri-edu-server/src/endereco/endereco.module.ts
@@ -0,0 +1,13 @@
+import { Module } from "@nestjs/common";
+import { EnderecoModuleBase } from "./base/endereco.module.base";
+import { EnderecoService } from "./endereco.service";
+import { EnderecoController } from "./endereco.controller";
+import { EnderecoResolver } from "./endereco.resolver";
+
+@Module({
+ imports: [EnderecoModuleBase],
+ controllers: [EnderecoController],
+ providers: [EnderecoService, EnderecoResolver],
+ exports: [EnderecoService],
+})
+export class EnderecoModule {}
diff --git a/apps/maestri-edu-server/src/endereco/endereco.resolver.ts b/apps/maestri-edu-server/src/endereco/endereco.resolver.ts
new file mode 100644
index 0000000..e6ab18d
--- /dev/null
+++ b/apps/maestri-edu-server/src/endereco/endereco.resolver.ts
@@ -0,0 +1,11 @@
+import * as graphql from "@nestjs/graphql";
+import { EnderecoResolverBase } from "./base/endereco.resolver.base";
+import { Endereco } from "./base/Endereco";
+import { EnderecoService } from "./endereco.service";
+
+@graphql.Resolver(() => Endereco)
+export class EnderecoResolver extends EnderecoResolverBase {
+ constructor(protected readonly service: EnderecoService) {
+ super(service);
+ }
+}
diff --git a/apps/maestri-edu-server/src/endereco/endereco.service.ts b/apps/maestri-edu-server/src/endereco/endereco.service.ts
new file mode 100644
index 0000000..55e8ad4
--- /dev/null
+++ b/apps/maestri-edu-server/src/endereco/endereco.service.ts
@@ -0,0 +1,10 @@
+import { Injectable } from "@nestjs/common";
+import { PrismaService } from "../prisma/prisma.service";
+import { EnderecoServiceBase } from "./base/endereco.service.base";
+
+@Injectable()
+export class EnderecoService extends EnderecoServiceBase {
+ constructor(protected readonly prisma: PrismaService) {
+ super(prisma);
+ }
+}
diff --git a/apps/maestri-edu-server/src/errors.ts b/apps/maestri-edu-server/src/errors.ts
new file mode 100644
index 0000000..bd1aa6d
--- /dev/null
+++ b/apps/maestri-edu-server/src/errors.ts
@@ -0,0 +1,16 @@
+import * as common from "@nestjs/common";
+import { ApiProperty } from "@nestjs/swagger";
+
+export class ForbiddenException extends common.ForbiddenException {
+ @ApiProperty()
+ statusCode!: number;
+ @ApiProperty()
+ message!: string;
+}
+
+export class NotFoundException extends common.NotFoundException {
+ @ApiProperty()
+ statusCode!: number;
+ @ApiProperty()
+ message!: string;
+}
diff --git a/apps/maestri-edu-server/src/filters/HttpExceptions.filter.ts b/apps/maestri-edu-server/src/filters/HttpExceptions.filter.ts
new file mode 100644
index 0000000..f5eda8e
--- /dev/null
+++ b/apps/maestri-edu-server/src/filters/HttpExceptions.filter.ts
@@ -0,0 +1,89 @@
+import {
+ ArgumentsHost,
+ Catch,
+ HttpException,
+ HttpServer,
+ HttpStatus,
+} from "@nestjs/common";
+import { BaseExceptionFilter } from "@nestjs/core";
+import { Prisma } from "@prisma/client";
+import { Response } from "express";
+
+export type ErrorCodesStatusMapping = {
+ [key: string]: number;
+};
+
+/**
+ * {@link PrismaClientExceptionFilter} handling {@link Prisma.PrismaClientKnownRequestError} exceptions.
+ */
+@Catch(Prisma?.PrismaClientKnownRequestError)
+export class HttpExceptionFilter extends BaseExceptionFilter {
+ /**
+ * default error codes mapping
+ *
+ * Error codes definition for Prisma Client (Query Engine)
+ * @see https://www.prisma.io/docs/reference/api-reference/error-reference#prisma-client-query-engine
+ */
+ private errorCodesStatusMapping: ErrorCodesStatusMapping = {
+ P2000: HttpStatus.BAD_REQUEST,
+ P2002: HttpStatus.CONFLICT,
+ P2025: HttpStatus.NOT_FOUND,
+ };
+
+ /**
+ * @param applicationRef
+ */
+ // eslint-disable-next-line @typescript-eslint/no-useless-constructor
+ constructor(applicationRef?: HttpServer) {
+ super(applicationRef);
+ }
+
+ /**
+ * @param exception
+ * @param host
+ * @returns
+ */
+ // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
+ catch(exception: Prisma.PrismaClientKnownRequestError, host: ArgumentsHost) {
+ const statusCode = this.errorCodesStatusMapping[exception.code];
+ let message;
+ if (host.getType() === "http") {
+ // for http requests (REST)
+ // Todo : Add all other exception types and also add mapping
+ const ctx = host.switchToHttp();
+ const response = ctx.getResponse();
+ if (exception.code === "P2002") {
+ // Handling Unique Key Constraint Violation Error
+ const fields = (exception.meta as { target: string[] }).target;
+ message = `Another record with the requested (${fields.join(
+ ", "
+ )}) already exists`;
+ } else {
+ message =
+ `[${exception.code}]: ` +
+ this.exceptionShortMessage(exception.message);
+ }
+ if (!Object.keys(this.errorCodesStatusMapping).includes(exception.code)) {
+ return super.catch(exception, host);
+ }
+ const errorResponse = {
+ message: message,
+ statusCode: statusCode,
+ };
+ response.status(statusCode).send(errorResponse);
+ }
+ return new HttpException({ statusCode, message }, statusCode);
+ }
+
+ /**
+ * @param exception
+ * @returns short message for the exception
+ */
+ exceptionShortMessage(message: string): string {
+ const shortMessage = message.substring(message.indexOf("→"));
+ return shortMessage
+ .substring(shortMessage.indexOf("\n"))
+ .replace(/\n/g, "")
+ .trim();
+ }
+}
diff --git a/apps/maestri-edu-server/src/health/base/health.controller.base.ts b/apps/maestri-edu-server/src/health/base/health.controller.base.ts
new file mode 100644
index 0000000..afd9e0d
--- /dev/null
+++ b/apps/maestri-edu-server/src/health/base/health.controller.base.ts
@@ -0,0 +1,19 @@
+import { Get, HttpStatus, Res } from "@nestjs/common";
+import { Response } from "express";
+import { HealthService } from "../health.service";
+
+export class HealthControllerBase {
+ constructor(protected readonly healthService: HealthService) {}
+ @Get("live")
+ healthLive(@Res() response: Response): Response {
+ return response.status(HttpStatus.NO_CONTENT).send();
+ }
+ @Get("ready")
+ async healthReady(@Res() response: Response): Promise> {
+ const dbConnection = await this.healthService.isDbReady();
+ if (!dbConnection) {
+ return response.status(HttpStatus.NOT_FOUND).send();
+ }
+ return response.status(HttpStatus.NO_CONTENT).send();
+ }
+}
diff --git a/apps/maestri-edu-server/src/health/base/health.service.base.ts b/apps/maestri-edu-server/src/health/base/health.service.base.ts
new file mode 100644
index 0000000..49a93a5
--- /dev/null
+++ b/apps/maestri-edu-server/src/health/base/health.service.base.ts
@@ -0,0 +1,15 @@
+import { Injectable } from "@nestjs/common";
+import { PrismaService } from "../../prisma/prisma.service";
+
+@Injectable()
+export class HealthServiceBase {
+ constructor(protected readonly prisma: PrismaService) {}
+ async isDbReady(): Promise {
+ try {
+ await this.prisma.$queryRaw`SELECT 1`;
+ return true;
+ } catch (error) {
+ return false;
+ }
+ }
+}
diff --git a/apps/maestri-edu-server/src/health/health.controller.ts b/apps/maestri-edu-server/src/health/health.controller.ts
new file mode 100644
index 0000000..ff484e7
--- /dev/null
+++ b/apps/maestri-edu-server/src/health/health.controller.ts
@@ -0,0 +1,10 @@
+import { Controller } from "@nestjs/common";
+import { HealthControllerBase } from "./base/health.controller.base";
+import { HealthService } from "./health.service";
+
+@Controller("_health")
+export class HealthController extends HealthControllerBase {
+ constructor(protected readonly healthService: HealthService) {
+ super(healthService);
+ }
+}
diff --git a/apps/maestri-edu-server/src/health/health.module.ts b/apps/maestri-edu-server/src/health/health.module.ts
new file mode 100644
index 0000000..39eff7f
--- /dev/null
+++ b/apps/maestri-edu-server/src/health/health.module.ts
@@ -0,0 +1,10 @@
+import { Module } from "@nestjs/common";
+import { HealthController } from "./health.controller";
+import { HealthService } from "./health.service";
+
+@Module({
+ controllers: [HealthController],
+ providers: [HealthService],
+ exports: [HealthService],
+})
+export class HealthModule {}
diff --git a/apps/maestri-edu-server/src/health/health.service.ts b/apps/maestri-edu-server/src/health/health.service.ts
new file mode 100644
index 0000000..44d9343
--- /dev/null
+++ b/apps/maestri-edu-server/src/health/health.service.ts
@@ -0,0 +1,10 @@
+import { Injectable } from "@nestjs/common";
+import { PrismaService } from "../prisma/prisma.service";
+import { HealthServiceBase } from "./base/health.service.base";
+
+@Injectable()
+export class HealthService extends HealthServiceBase {
+ constructor(protected readonly prisma: PrismaService) {
+ super(prisma);
+ }
+}
diff --git a/apps/maestri-edu-server/src/main.ts b/apps/maestri-edu-server/src/main.ts
new file mode 100644
index 0000000..474eead
--- /dev/null
+++ b/apps/maestri-edu-server/src/main.ts
@@ -0,0 +1,53 @@
+import { ValidationPipe } from "@nestjs/common";
+import { HttpAdapterHost, NestFactory } from "@nestjs/core";
+import { OpenAPIObject, SwaggerModule } from "@nestjs/swagger";
+import { HttpExceptionFilter } from "./filters/HttpExceptions.filter";
+import { AppModule } from "./app.module";
+import { connectMicroservices } from "./connectMicroservices";
+import {
+ swaggerPath,
+ swaggerDocumentOptions,
+ swaggerSetupOptions,
+} from "./swagger";
+
+const { PORT = 3000 } = process.env;
+
+async function main() {
+ const app = await NestFactory.create(AppModule, { cors: true });
+
+ app.setGlobalPrefix("api");
+ app.useGlobalPipes(
+ new ValidationPipe({
+ transform: true,
+ forbidUnknownValues: false,
+ })
+ );
+
+ const document = SwaggerModule.createDocument(app, swaggerDocumentOptions);
+
+ /** check if there is Public decorator for each path (action) and its method (findMany / findOne) on each controller */
+ Object.values((document as OpenAPIObject).paths).forEach((path: any) => {
+ Object.values(path).forEach((method: any) => {
+ if (
+ Array.isArray(method.security) &&
+ method.security.includes("isPublic")
+ ) {
+ method.security = [];
+ }
+ });
+ });
+
+ await connectMicroservices(app);
+ await app.startAllMicroservices();
+
+ SwaggerModule.setup(swaggerPath, app, document, swaggerSetupOptions);
+
+ const { httpAdapter } = app.get(HttpAdapterHost);
+ app.useGlobalFilters(new HttpExceptionFilter(httpAdapter));
+
+ void app.listen(PORT);
+
+ return app;
+}
+
+module.exports = main();
diff --git a/apps/maestri-edu-server/src/matricula/base/CreateMatriculaArgs.ts b/apps/maestri-edu-server/src/matricula/base/CreateMatriculaArgs.ts
new file mode 100644
index 0000000..7072c5e
--- /dev/null
+++ b/apps/maestri-edu-server/src/matricula/base/CreateMatriculaArgs.ts
@@ -0,0 +1,30 @@
+/*
+------------------------------------------------------------------------------
+This code was generated by Amplication.
+
+Changes to this file will be lost if the code is regenerated.
+
+There are other ways to to customize your code, see this doc to learn more
+https://docs.amplication.com/how-to/custom-code
+
+------------------------------------------------------------------------------
+ */
+import { ArgsType, Field } from "@nestjs/graphql";
+import { ApiProperty } from "@nestjs/swagger";
+import { MatriculaCreateInput } from "./MatriculaCreateInput";
+import { ValidateNested } from "class-validator";
+import { Type } from "class-transformer";
+
+@ArgsType()
+class CreateMatriculaArgs {
+ @ApiProperty({
+ required: true,
+ type: () => MatriculaCreateInput,
+ })
+ @ValidateNested()
+ @Type(() => MatriculaCreateInput)
+ @Field(() => MatriculaCreateInput, { nullable: false })
+ data!: MatriculaCreateInput;
+}
+
+export { CreateMatriculaArgs as CreateMatriculaArgs };
diff --git a/apps/maestri-edu-server/src/matricula/base/DeleteMatriculaArgs.ts b/apps/maestri-edu-server/src/matricula/base/DeleteMatriculaArgs.ts
new file mode 100644
index 0000000..c00c6d3
--- /dev/null
+++ b/apps/maestri-edu-server/src/matricula/base/DeleteMatriculaArgs.ts
@@ -0,0 +1,30 @@
+/*
+------------------------------------------------------------------------------
+This code was generated by Amplication.
+
+Changes to this file will be lost if the code is regenerated.
+
+There are other ways to to customize your code, see this doc to learn more
+https://docs.amplication.com/how-to/custom-code
+
+------------------------------------------------------------------------------
+ */
+import { ArgsType, Field } from "@nestjs/graphql";
+import { ApiProperty } from "@nestjs/swagger";
+import { MatriculaWhereUniqueInput } from "./MatriculaWhereUniqueInput";
+import { ValidateNested } from "class-validator";
+import { Type } from "class-transformer";
+
+@ArgsType()
+class DeleteMatriculaArgs {
+ @ApiProperty({
+ required: true,
+ type: () => MatriculaWhereUniqueInput,
+ })
+ @ValidateNested()
+ @Type(() => MatriculaWhereUniqueInput)
+ @Field(() => MatriculaWhereUniqueInput, { nullable: false })
+ where!: MatriculaWhereUniqueInput;
+}
+
+export { DeleteMatriculaArgs as DeleteMatriculaArgs };
diff --git a/apps/maestri-edu-server/src/matricula/base/EnumMatriculaStatus.ts b/apps/maestri-edu-server/src/matricula/base/EnumMatriculaStatus.ts
new file mode 100644
index 0000000..40bb99a
--- /dev/null
+++ b/apps/maestri-edu-server/src/matricula/base/EnumMatriculaStatus.ts
@@ -0,0 +1,20 @@
+/*
+------------------------------------------------------------------------------
+This code was generated by Amplication.
+
+Changes to this file will be lost if the code is regenerated.
+
+There are other ways to to customize your code, see this doc to learn more
+https://docs.amplication.com/how-to/custom-code
+
+------------------------------------------------------------------------------
+ */
+import { registerEnumType } from "@nestjs/graphql";
+
+export enum EnumMatriculaStatus {
+ Option_1 = "Option1",
+}
+
+registerEnumType(EnumMatriculaStatus, {
+ name: "EnumMatriculaStatus",
+});
diff --git a/apps/maestri-edu-server/src/matricula/base/EnumMatriculaStatusMatricula.ts b/apps/maestri-edu-server/src/matricula/base/EnumMatriculaStatusMatricula.ts
new file mode 100644
index 0000000..1c63475
--- /dev/null
+++ b/apps/maestri-edu-server/src/matricula/base/EnumMatriculaStatusMatricula.ts
@@ -0,0 +1,20 @@
+/*
+------------------------------------------------------------------------------
+This code was generated by Amplication.
+
+Changes to this file will be lost if the code is regenerated.
+
+There are other ways to to customize your code, see this doc to learn more
+https://docs.amplication.com/how-to/custom-code
+
+------------------------------------------------------------------------------
+ */
+import { registerEnumType } from "@nestjs/graphql";
+
+export enum EnumMatriculaStatusMatricula {
+ Option_1 = "Option1",
+}
+
+registerEnumType(EnumMatriculaStatusMatricula, {
+ name: "EnumMatriculaStatusMatricula",
+});
diff --git a/apps/maestri-edu-server/src/matricula/base/Matricula.ts b/apps/maestri-edu-server/src/matricula/base/Matricula.ts
new file mode 100644
index 0000000..74833f2
--- /dev/null
+++ b/apps/maestri-edu-server/src/matricula/base/Matricula.ts
@@ -0,0 +1,271 @@
+/*
+------------------------------------------------------------------------------
+This code was generated by Amplication.
+
+Changes to this file will be lost if the code is regenerated.
+
+There are other ways to to customize your code, see this doc to learn more
+https://docs.amplication.com/how-to/custom-code
+
+------------------------------------------------------------------------------
+ */
+import { ObjectType, Field } from "@nestjs/graphql";
+import { ApiProperty } from "@nestjs/swagger";
+
+import {
+ IsString,
+ MaxLength,
+ IsOptional,
+ IsDate,
+ ValidateNested,
+ IsInt,
+ Min,
+ Max,
+ IsEnum,
+} from "class-validator";
+
+import { Type } from "class-transformer";
+import { Curso } from "../../curso/base/Curso";
+import { EnumMatriculaStatus } from "./EnumMatriculaStatus";
+import { EnumMatriculaStatusMatricula } from "./EnumMatriculaStatusMatricula";
+
+@ObjectType()
+class Matricula {
+ @ApiProperty({
+ required: false,
+ type: String,
+ })
+ @IsString()
+ @MaxLength(1000)
+ @IsOptional()
+ @Field(() => String, {
+ nullable: true,
+ })
+ aluno!: string | null;
+
+ @ApiProperty({
+ required: false,
+ type: String,
+ })
+ @IsString()
+ @MaxLength(1000)
+ @IsOptional()
+ @Field(() => String, {
+ nullable: true,
+ })
+ alunoId!: string | null;
+
+ @ApiProperty({
+ required: false,
+ type: String,
+ })
+ @IsString()
+ @MaxLength(1000)
+ @IsOptional()
+ @Field(() => String, {
+ nullable: true,
+ })
+ alunoReferencia!: string | null;
+
+ @ApiProperty({
+ required: false,
+ type: String,
+ })
+ @IsString()
+ @MaxLength(1000)
+ @IsOptional()
+ @Field(() => String, {
+ nullable: true,
+ })
+ classificacaoReferencia!: string | null;
+
+ @ApiProperty({
+ required: true,
+ })
+ @IsDate()
+ @Type(() => Date)
+ @Field(() => Date)
+ createdAt!: Date;
+
+ @ApiProperty({
+ required: false,
+ type: () => Curso,
+ })
+ @ValidateNested()
+ @Type(() => Curso)
+ @IsOptional()
+ curso?: Curso | null;
+
+ @ApiProperty({
+ required: false,
+ type: String,
+ })
+ @IsString()
+ @MaxLength(1000)
+ @IsOptional()
+ @Field(() => String, {
+ nullable: true,
+ })
+ cursoReferencia!: string | null;
+
+ @ApiProperty({
+ required: true,
+ type: String,
+ })
+ @IsString()
+ @Field(() => String)
+ id!: string;
+
+ @ApiProperty({
+ required: false,
+ type: Number,
+ })
+ @IsInt()
+ @Min(-999999999)
+ @Max(999999999)
+ @IsOptional()
+ @Field(() => Number, {
+ nullable: true,
+ })
+ numeroParcelas!: number | null;
+
+ @ApiProperty({
+ required: false,
+ type: String,
+ })
+ @IsString()
+ @MaxLength(1000)
+ @IsOptional()
+ @Field(() => String, {
+ nullable: true,
+ })
+ parcelaAdimplente!: string | null;
+
+ @ApiProperty({
+ required: false,
+ type: String,
+ })
+ @IsString()
+ @MaxLength(1000)
+ @IsOptional()
+ @Field(() => String, {
+ nullable: true,
+ })
+ parcelaAdimplenteId!: string | null;
+
+ @ApiProperty({
+ required: false,
+ type: String,
+ })
+ @IsString()
+ @MaxLength(1000)
+ @IsOptional()
+ @Field(() => String, {
+ nullable: true,
+ })
+ parcelaAdimplenteReferencia!: string | null;
+
+ @ApiProperty({
+ required: false,
+ type: String,
+ })
+ @IsString()
+ @MaxLength(1000)
+ @IsOptional()
+ @Field(() => String, {
+ nullable: true,
+ })
+ promotor!: string | null;
+
+ @ApiProperty({
+ required: false,
+ type: String,
+ })
+ @IsString()
+ @MaxLength(1000)
+ @IsOptional()
+ @Field(() => String, {
+ nullable: true,
+ })
+ promotorId!: string | null;
+
+ @ApiProperty({
+ required: false,
+ type: String,
+ })
+ @IsString()
+ @MaxLength(1000)
+ @IsOptional()
+ @Field(() => String, {
+ nullable: true,
+ })
+ promotorReferencia!: string | null;
+
+ @ApiProperty({
+ required: false,
+ enum: EnumMatriculaStatus,
+ })
+ @IsEnum(EnumMatriculaStatus)
+ @IsOptional()
+ @Field(() => EnumMatriculaStatus, {
+ nullable: true,
+ })
+ status?: "Option1" | null;
+
+ @ApiProperty({
+ required: false,
+ enum: EnumMatriculaStatusMatricula,
+ })
+ @IsEnum(EnumMatriculaStatusMatricula)
+ @IsOptional()
+ @Field(() => EnumMatriculaStatusMatricula, {
+ nullable: true,
+ })
+ statusMatricula?: "Option1" | null;
+
+ @ApiProperty({
+ required: false,
+ type: String,
+ })
+ @IsString()
+ @MaxLength(1000)
+ @IsOptional()
+ @Field(() => String, {
+ nullable: true,
+ })
+ taxaMatricula!: string | null;
+
+ @ApiProperty({
+ required: false,
+ type: String,
+ })
+ @IsString()
+ @MaxLength(1000)
+ @IsOptional()
+ @Field(() => String, {
+ nullable: true,
+ })
+ taxaMatriculaId!: string | null;
+
+ @ApiProperty({
+ required: false,
+ type: String,
+ })
+ @IsString()
+ @MaxLength(1000)
+ @IsOptional()
+ @Field(() => String, {
+ nullable: true,
+ })
+ taxaMatriculaReferencia!: string | null;
+
+ @ApiProperty({
+ required: true,
+ })
+ @IsDate()
+ @Type(() => Date)
+ @Field(() => Date)
+ updatedAt!: Date;
+}
+
+export { Matricula as Matricula };
diff --git a/apps/maestri-edu-server/src/matricula/base/MatriculaCountArgs.ts b/apps/maestri-edu-server/src/matricula/base/MatriculaCountArgs.ts
new file mode 100644
index 0000000..fe8dd59
--- /dev/null
+++ b/apps/maestri-edu-server/src/matricula/base/MatriculaCountArgs.ts
@@ -0,0 +1,28 @@
+/*
+------------------------------------------------------------------------------
+This code was generated by Amplication.
+
+Changes to this file will be lost if the code is regenerated.
+
+There are other ways to to customize your code, see this doc to learn more
+https://docs.amplication.com/how-to/custom-code
+
+------------------------------------------------------------------------------
+ */
+import { ArgsType, Field } from "@nestjs/graphql";
+import { ApiProperty } from "@nestjs/swagger";
+import { MatriculaWhereInput } from "./MatriculaWhereInput";
+import { Type } from "class-transformer";
+
+@ArgsType()
+class MatriculaCountArgs {
+ @ApiProperty({
+ required: false,
+ type: () => MatriculaWhereInput,
+ })
+ @Field(() => MatriculaWhereInput, { nullable: true })
+ @Type(() => MatriculaWhereInput)
+ where?: MatriculaWhereInput;
+}
+
+export { MatriculaCountArgs as MatriculaCountArgs };
diff --git a/apps/maestri-edu-server/src/matricula/base/MatriculaCreateInput.ts b/apps/maestri-edu-server/src/matricula/base/MatriculaCreateInput.ts
new file mode 100644
index 0000000..b9cc1f9
--- /dev/null
+++ b/apps/maestri-edu-server/src/matricula/base/MatriculaCreateInput.ts
@@ -0,0 +1,247 @@
+/*
+------------------------------------------------------------------------------
+This code was generated by Amplication.
+
+Changes to this file will be lost if the code is regenerated.
+
+There are other ways to to customize your code, see this doc to learn more
+https://docs.amplication.com/how-to/custom-code
+
+------------------------------------------------------------------------------
+ */
+import { InputType, Field } from "@nestjs/graphql";
+import { ApiProperty } from "@nestjs/swagger";
+import {
+ IsString,
+ MaxLength,
+ IsOptional,
+ ValidateNested,
+ IsInt,
+ Min,
+ Max,
+ IsEnum,
+} from "class-validator";
+import { CursoWhereUniqueInput } from "../../curso/base/CursoWhereUniqueInput";
+import { Type } from "class-transformer";
+import { EnumMatriculaStatus } from "./EnumMatriculaStatus";
+import { EnumMatriculaStatusMatricula } from "./EnumMatriculaStatusMatricula";
+
+@InputType()
+class MatriculaCreateInput {
+ @ApiProperty({
+ required: false,
+ type: String,
+ })
+ @IsString()
+ @MaxLength(1000)
+ @IsOptional()
+ @Field(() => String, {
+ nullable: true,
+ })
+ aluno?: string | null;
+
+ @ApiProperty({
+ required: false,
+ type: String,
+ })
+ @IsString()
+ @MaxLength(1000)
+ @IsOptional()
+ @Field(() => String, {
+ nullable: true,
+ })
+ alunoId?: string | null;
+
+ @ApiProperty({
+ required: false,
+ type: String,
+ })
+ @IsString()
+ @MaxLength(1000)
+ @IsOptional()
+ @Field(() => String, {
+ nullable: true,
+ })
+ alunoReferencia?: string | null;
+
+ @ApiProperty({
+ required: false,
+ type: String,
+ })
+ @IsString()
+ @MaxLength(1000)
+ @IsOptional()
+ @Field(() => String, {
+ nullable: true,
+ })
+ classificacaoReferencia?: string | null;
+
+ @ApiProperty({
+ required: false,
+ type: () => CursoWhereUniqueInput,
+ })
+ @ValidateNested()
+ @Type(() => CursoWhereUniqueInput)
+ @IsOptional()
+ @Field(() => CursoWhereUniqueInput, {
+ nullable: true,
+ })
+ curso?: CursoWhereUniqueInput | null;
+
+ @ApiProperty({
+ required: false,
+ type: String,
+ })
+ @IsString()
+ @MaxLength(1000)
+ @IsOptional()
+ @Field(() => String, {
+ nullable: true,
+ })
+ cursoReferencia?: string | null;
+
+ @ApiProperty({
+ required: false,
+ type: Number,
+ })
+ @IsInt()
+ @Min(-999999999)
+ @Max(999999999)
+ @IsOptional()
+ @Field(() => Number, {
+ nullable: true,
+ })
+ numeroParcelas?: number | null;
+
+ @ApiProperty({
+ required: false,
+ type: String,
+ })
+ @IsString()
+ @MaxLength(1000)
+ @IsOptional()
+ @Field(() => String, {
+ nullable: true,
+ })
+ parcelaAdimplente?: string | null;
+
+ @ApiProperty({
+ required: false,
+ type: String,
+ })
+ @IsString()
+ @MaxLength(1000)
+ @IsOptional()
+ @Field(() => String, {
+ nullable: true,
+ })
+ parcelaAdimplenteId?: string | null;
+
+ @ApiProperty({
+ required: false,
+ type: String,
+ })
+ @IsString()
+ @MaxLength(1000)
+ @IsOptional()
+ @Field(() => String, {
+ nullable: true,
+ })
+ parcelaAdimplenteReferencia?: string | null;
+
+ @ApiProperty({
+ required: false,
+ type: String,
+ })
+ @IsString()
+ @MaxLength(1000)
+ @IsOptional()
+ @Field(() => String, {
+ nullable: true,
+ })
+ promotor?: string | null;
+
+ @ApiProperty({
+ required: false,
+ type: String,
+ })
+ @IsString()
+ @MaxLength(1000)
+ @IsOptional()
+ @Field(() => String, {
+ nullable: true,
+ })
+ promotorId?: string | null;
+
+ @ApiProperty({
+ required: false,
+ type: String,
+ })
+ @IsString()
+ @MaxLength(1000)
+ @IsOptional()
+ @Field(() => String, {
+ nullable: true,
+ })
+ promotorReferencia?: string | null;
+
+ @ApiProperty({
+ required: false,
+ enum: EnumMatriculaStatus,
+ })
+ @IsEnum(EnumMatriculaStatus)
+ @IsOptional()
+ @Field(() => EnumMatriculaStatus, {
+ nullable: true,
+ })
+ status?: "Option1" | null;
+
+ @ApiProperty({
+ required: false,
+ enum: EnumMatriculaStatusMatricula,
+ })
+ @IsEnum(EnumMatriculaStatusMatricula)
+ @IsOptional()
+ @Field(() => EnumMatriculaStatusMatricula, {
+ nullable: true,
+ })
+ statusMatricula?: "Option1" | null;
+
+ @ApiProperty({
+ required: false,
+ type: String,
+ })
+ @IsString()
+ @MaxLength(1000)
+ @IsOptional()
+ @Field(() => String, {
+ nullable: true,
+ })
+ taxaMatricula?: string | null;
+
+ @ApiProperty({
+ required: false,
+ type: String,
+ })
+ @IsString()
+ @MaxLength(1000)
+ @IsOptional()
+ @Field(() => String, {
+ nullable: true,
+ })
+ taxaMatriculaId?: string | null;
+
+ @ApiProperty({
+ required: false,
+ type: String,
+ })
+ @IsString()
+ @MaxLength(1000)
+ @IsOptional()
+ @Field(() => String, {
+ nullable: true,
+ })
+ taxaMatriculaReferencia?: string | null;
+}
+
+export { MatriculaCreateInput as MatriculaCreateInput };
diff --git a/apps/maestri-edu-server/src/matricula/base/MatriculaFindManyArgs.ts b/apps/maestri-edu-server/src/matricula/base/MatriculaFindManyArgs.ts
new file mode 100644
index 0000000..fd66fe9
--- /dev/null
+++ b/apps/maestri-edu-server/src/matricula/base/MatriculaFindManyArgs.ts
@@ -0,0 +1,62 @@
+/*
+------------------------------------------------------------------------------
+This code was generated by Amplication.
+
+Changes to this file will be lost if the code is regenerated.
+
+There are other ways to to customize your code, see this doc to learn more
+https://docs.amplication.com/how-to/custom-code
+
+------------------------------------------------------------------------------
+ */
+import { ArgsType, Field } from "@nestjs/graphql";
+import { ApiProperty } from "@nestjs/swagger";
+import { MatriculaWhereInput } from "./MatriculaWhereInput";
+import { IsOptional, ValidateNested, IsInt } from "class-validator";
+import { Type } from "class-transformer";
+import { MatriculaOrderByInput } from "./MatriculaOrderByInput";
+
+@ArgsType()
+class MatriculaFindManyArgs {
+ @ApiProperty({
+ required: false,
+ type: () => MatriculaWhereInput,
+ })
+ @IsOptional()
+ @ValidateNested()
+ @Field(() => MatriculaWhereInput, { nullable: true })
+ @Type(() => MatriculaWhereInput)
+ where?: MatriculaWhereInput;
+
+ @ApiProperty({
+ required: false,
+ type: [MatriculaOrderByInput],
+ })
+ @IsOptional()
+ @ValidateNested({ each: true })
+ @Field(() => [MatriculaOrderByInput], { nullable: true })
+ @Type(() => MatriculaOrderByInput)
+ orderBy?: Array;
+
+ @ApiProperty({
+ required: false,
+ type: Number,
+ })
+ @IsOptional()
+ @IsInt()
+ @Field(() => Number, { nullable: true })
+ @Type(() => Number)
+ skip?: number;
+
+ @ApiProperty({
+ required: false,
+ type: Number,
+ })
+ @IsOptional()
+ @IsInt()
+ @Field(() => Number, { nullable: true })
+ @Type(() => Number)
+ take?: number;
+}
+
+export { MatriculaFindManyArgs as MatriculaFindManyArgs };
diff --git a/apps/maestri-edu-server/src/matricula/base/MatriculaFindUniqueArgs.ts b/apps/maestri-edu-server/src/matricula/base/MatriculaFindUniqueArgs.ts
new file mode 100644
index 0000000..acfab5b
--- /dev/null
+++ b/apps/maestri-edu-server/src/matricula/base/MatriculaFindUniqueArgs.ts
@@ -0,0 +1,30 @@
+/*
+------------------------------------------------------------------------------
+This code was generated by Amplication.
+
+Changes to this file will be lost if the code is regenerated.
+
+There are other ways to to customize your code, see this doc to learn more
+https://docs.amplication.com/how-to/custom-code
+
+------------------------------------------------------------------------------
+ */
+import { ArgsType, Field } from "@nestjs/graphql";
+import { ApiProperty } from "@nestjs/swagger";
+import { MatriculaWhereUniqueInput } from "./MatriculaWhereUniqueInput";
+import { ValidateNested } from "class-validator";
+import { Type } from "class-transformer";
+
+@ArgsType()
+class MatriculaFindUniqueArgs {
+ @ApiProperty({
+ required: true,
+ type: () => MatriculaWhereUniqueInput,
+ })
+ @ValidateNested()
+ @Type(() => MatriculaWhereUniqueInput)
+ @Field(() => MatriculaWhereUniqueInput, { nullable: false })
+ where!: MatriculaWhereUniqueInput;
+}
+
+export { MatriculaFindUniqueArgs as MatriculaFindUniqueArgs };
diff --git a/apps/maestri-edu-server/src/matricula/base/MatriculaListRelationFilter.ts b/apps/maestri-edu-server/src/matricula/base/MatriculaListRelationFilter.ts
new file mode 100644
index 0000000..2e635d0
--- /dev/null
+++ b/apps/maestri-edu-server/src/matricula/base/MatriculaListRelationFilter.ts
@@ -0,0 +1,56 @@
+/*
+------------------------------------------------------------------------------
+This code was generated by Amplication.
+
+Changes to this file will be lost if the code is regenerated.
+
+There are other ways to to customize your code, see this doc to learn more
+https://docs.amplication.com/how-to/custom-code
+
+------------------------------------------------------------------------------
+ */
+import { InputType, Field } from "@nestjs/graphql";
+import { ApiProperty } from "@nestjs/swagger";
+import { MatriculaWhereInput } from "./MatriculaWhereInput";
+import { ValidateNested, IsOptional } from "class-validator";
+import { Type } from "class-transformer";
+
+@InputType()
+class MatriculaListRelationFilter {
+ @ApiProperty({
+ required: false,
+ type: () => MatriculaWhereInput,
+ })
+ @ValidateNested()
+ @Type(() => MatriculaWhereInput)
+ @IsOptional()
+ @Field(() => MatriculaWhereInput, {
+ nullable: true,
+ })
+ every?: MatriculaWhereInput;
+
+ @ApiProperty({
+ required: false,
+ type: () => MatriculaWhereInput,
+ })
+ @ValidateNested()
+ @Type(() => MatriculaWhereInput)
+ @IsOptional()
+ @Field(() => MatriculaWhereInput, {
+ nullable: true,
+ })
+ some?: MatriculaWhereInput;
+
+ @ApiProperty({
+ required: false,
+ type: () => MatriculaWhereInput,
+ })
+ @ValidateNested()
+ @Type(() => MatriculaWhereInput)
+ @IsOptional()
+ @Field(() => MatriculaWhereInput, {
+ nullable: true,
+ })
+ none?: MatriculaWhereInput;
+}
+export { MatriculaListRelationFilter as MatriculaListRelationFilter };
diff --git a/apps/maestri-edu-server/src/matricula/base/MatriculaOrderByInput.ts b/apps/maestri-edu-server/src/matricula/base/MatriculaOrderByInput.ts
new file mode 100644
index 0000000..321a501
--- /dev/null
+++ b/apps/maestri-edu-server/src/matricula/base/MatriculaOrderByInput.ts
@@ -0,0 +1,254 @@
+/*
+------------------------------------------------------------------------------
+This code was generated by Amplication.
+
+Changes to this file will be lost if the code is regenerated.
+
+There are other ways to to customize your code, see this doc to learn more
+https://docs.amplication.com/how-to/custom-code
+
+------------------------------------------------------------------------------
+ */
+import { InputType, Field } from "@nestjs/graphql";
+import { ApiProperty } from "@nestjs/swagger";
+import { IsOptional, IsEnum } from "class-validator";
+import { SortOrder } from "../../util/SortOrder";
+
+@InputType({
+ isAbstract: true,
+ description: undefined,
+})
+class MatriculaOrderByInput {
+ @ApiProperty({
+ required: false,
+ enum: ["asc", "desc"],
+ })
+ @IsOptional()
+ @IsEnum(SortOrder)
+ @Field(() => SortOrder, {
+ nullable: true,
+ })
+ aluno?: SortOrder;
+
+ @ApiProperty({
+ required: false,
+ enum: ["asc", "desc"],
+ })
+ @IsOptional()
+ @IsEnum(SortOrder)
+ @Field(() => SortOrder, {
+ nullable: true,
+ })
+ alunoId?: SortOrder;
+
+ @ApiProperty({
+ required: false,
+ enum: ["asc", "desc"],
+ })
+ @IsOptional()
+ @IsEnum(SortOrder)
+ @Field(() => SortOrder, {
+ nullable: true,
+ })
+ alunoReferencia?: SortOrder;
+
+ @ApiProperty({
+ required: false,
+ enum: ["asc", "desc"],
+ })
+ @IsOptional()
+ @IsEnum(SortOrder)
+ @Field(() => SortOrder, {
+ nullable: true,
+ })
+ classificacaoReferencia?: SortOrder;
+
+ @ApiProperty({
+ required: false,
+ enum: ["asc", "desc"],
+ })
+ @IsOptional()
+ @IsEnum(SortOrder)
+ @Field(() => SortOrder, {
+ nullable: true,
+ })
+ createdAt?: SortOrder;
+
+ @ApiProperty({
+ required: false,
+ enum: ["asc", "desc"],
+ })
+ @IsOptional()
+ @IsEnum(SortOrder)
+ @Field(() => SortOrder, {
+ nullable: true,
+ })
+ cursoId?: SortOrder;
+
+ @ApiProperty({
+ required: false,
+ enum: ["asc", "desc"],
+ })
+ @IsOptional()
+ @IsEnum(SortOrder)
+ @Field(() => SortOrder, {
+ nullable: true,
+ })
+ cursoReferencia?: SortOrder;
+
+ @ApiProperty({
+ required: false,
+ enum: ["asc", "desc"],
+ })
+ @IsOptional()
+ @IsEnum(SortOrder)
+ @Field(() => SortOrder, {
+ nullable: true,
+ })
+ id?: SortOrder;
+
+ @ApiProperty({
+ required: false,
+ enum: ["asc", "desc"],
+ })
+ @IsOptional()
+ @IsEnum(SortOrder)
+ @Field(() => SortOrder, {
+ nullable: true,
+ })
+ numeroParcelas?: SortOrder;
+
+ @ApiProperty({
+ required: false,
+ enum: ["asc", "desc"],
+ })
+ @IsOptional()
+ @IsEnum(SortOrder)
+ @Field(() => SortOrder, {
+ nullable: true,
+ })
+ parcelaAdimplente?: SortOrder;
+
+ @ApiProperty({
+ required: false,
+ enum: ["asc", "desc"],
+ })
+ @IsOptional()
+ @IsEnum(SortOrder)
+ @Field(() => SortOrder, {
+ nullable: true,
+ })
+ parcelaAdimplenteId?: SortOrder;
+
+ @ApiProperty({
+ required: false,
+ enum: ["asc", "desc"],
+ })
+ @IsOptional()
+ @IsEnum(SortOrder)
+ @Field(() => SortOrder, {
+ nullable: true,
+ })
+ parcelaAdimplenteReferencia?: SortOrder;
+
+ @ApiProperty({
+ required: false,
+ enum: ["asc", "desc"],
+ })
+ @IsOptional()
+ @IsEnum(SortOrder)
+ @Field(() => SortOrder, {
+ nullable: true,
+ })
+ promotor?: SortOrder;
+
+ @ApiProperty({
+ required: false,
+ enum: ["asc", "desc"],
+ })
+ @IsOptional()
+ @IsEnum(SortOrder)
+ @Field(() => SortOrder, {
+ nullable: true,
+ })
+ promotorId?: SortOrder;
+
+ @ApiProperty({
+ required: false,
+ enum: ["asc", "desc"],
+ })
+ @IsOptional()
+ @IsEnum(SortOrder)
+ @Field(() => SortOrder, {
+ nullable: true,
+ })
+ promotorReferencia?: SortOrder;
+
+ @ApiProperty({
+ required: false,
+ enum: ["asc", "desc"],
+ })
+ @IsOptional()
+ @IsEnum(SortOrder)
+ @Field(() => SortOrder, {
+ nullable: true,
+ })
+ status?: SortOrder;
+
+ @ApiProperty({
+ required: false,
+ enum: ["asc", "desc"],
+ })
+ @IsOptional()
+ @IsEnum(SortOrder)
+ @Field(() => SortOrder, {
+ nullable: true,
+ })
+ statusMatricula?: SortOrder;
+
+ @ApiProperty({
+ required: false,
+ enum: ["asc", "desc"],
+ })
+ @IsOptional()
+ @IsEnum(SortOrder)
+ @Field(() => SortOrder, {
+ nullable: true,
+ })
+ taxaMatricula?: SortOrder;
+
+ @ApiProperty({
+ required: false,
+ enum: ["asc", "desc"],
+ })
+ @IsOptional()
+ @IsEnum(SortOrder)
+ @Field(() => SortOrder, {
+ nullable: true,
+ })
+ taxaMatriculaId?: SortOrder;
+
+ @ApiProperty({
+ required: false,
+ enum: ["asc", "desc"],
+ })
+ @IsOptional()
+ @IsEnum(SortOrder)
+ @Field(() => SortOrder, {
+ nullable: true,
+ })
+ taxaMatriculaReferencia?: SortOrder;
+
+ @ApiProperty({
+ required: false,
+ enum: ["asc", "desc"],
+ })
+ @IsOptional()
+ @IsEnum(SortOrder)
+ @Field(() => SortOrder, {
+ nullable: true,
+ })
+ updatedAt?: SortOrder;
+}
+
+export { MatriculaOrderByInput as MatriculaOrderByInput };
diff --git a/apps/maestri-edu-server/src/matricula/base/MatriculaUpdateInput.ts b/apps/maestri-edu-server/src/matricula/base/MatriculaUpdateInput.ts
new file mode 100644
index 0000000..08e4c0d
--- /dev/null
+++ b/apps/maestri-edu-server/src/matricula/base/MatriculaUpdateInput.ts
@@ -0,0 +1,247 @@
+/*
+------------------------------------------------------------------------------
+This code was generated by Amplication.
+
+Changes to this file will be lost if the code is regenerated.
+
+There are other ways to to customize your code, see this doc to learn more
+https://docs.amplication.com/how-to/custom-code
+
+------------------------------------------------------------------------------
+ */
+import { InputType, Field } from "@nestjs/graphql";
+import { ApiProperty } from "@nestjs/swagger";
+import {
+ IsString,
+ MaxLength,
+ IsOptional,
+ ValidateNested,
+ IsInt,
+ Min,
+ Max,
+ IsEnum,
+} from "class-validator";
+import { CursoWhereUniqueInput } from "../../curso/base/CursoWhereUniqueInput";
+import { Type } from "class-transformer";
+import { EnumMatriculaStatus } from "./EnumMatriculaStatus";
+import { EnumMatriculaStatusMatricula } from "./EnumMatriculaStatusMatricula";
+
+@InputType()
+class MatriculaUpdateInput {
+ @ApiProperty({
+ required: false,
+ type: String,
+ })
+ @IsString()
+ @MaxLength(1000)
+ @IsOptional()
+ @Field(() => String, {
+ nullable: true,
+ })
+ aluno?: string | null;
+
+ @ApiProperty({
+ required: false,
+ type: String,
+ })
+ @IsString()
+ @MaxLength(1000)
+ @IsOptional()
+ @Field(() => String, {
+ nullable: true,
+ })
+ alunoId?: string | null;
+
+ @ApiProperty({
+ required: false,
+ type: String,
+ })
+ @IsString()
+ @MaxLength(1000)
+ @IsOptional()
+ @Field(() => String, {
+ nullable: true,
+ })
+ alunoReferencia?: string | null;
+
+ @ApiProperty({
+ required: false,
+ type: String,
+ })
+ @IsString()
+ @MaxLength(1000)
+ @IsOptional()
+ @Field(() => String, {
+ nullable: true,
+ })
+ classificacaoReferencia?: string | null;
+
+ @ApiProperty({
+ required: false,
+ type: () => CursoWhereUniqueInput,
+ })
+ @ValidateNested()
+ @Type(() => CursoWhereUniqueInput)
+ @IsOptional()
+ @Field(() => CursoWhereUniqueInput, {
+ nullable: true,
+ })
+ curso?: CursoWhereUniqueInput | null;
+
+ @ApiProperty({
+ required: false,
+ type: String,
+ })
+ @IsString()
+ @MaxLength(1000)
+ @IsOptional()
+ @Field(() => String, {
+ nullable: true,
+ })
+ cursoReferencia?: string | null;
+
+ @ApiProperty({
+ required: false,
+ type: Number,
+ })
+ @IsInt()
+ @Min(-999999999)
+ @Max(999999999)
+ @IsOptional()
+ @Field(() => Number, {
+ nullable: true,
+ })
+ numeroParcelas?: number | null;
+
+ @ApiProperty({
+ required: false,
+ type: String,
+ })
+ @IsString()
+ @MaxLength(1000)
+ @IsOptional()
+ @Field(() => String, {
+ nullable: true,
+ })
+ parcelaAdimplente?: string | null;
+
+ @ApiProperty({
+ required: false,
+ type: String,
+ })
+ @IsString()
+ @MaxLength(1000)
+ @IsOptional()
+ @Field(() => String, {
+ nullable: true,
+ })
+ parcelaAdimplenteId?: string | null;
+
+ @ApiProperty({
+ required: false,
+ type: String,
+ })
+ @IsString()
+ @MaxLength(1000)
+ @IsOptional()
+ @Field(() => String, {
+ nullable: true,
+ })
+ parcelaAdimplenteReferencia?: string | null;
+
+ @ApiProperty({
+ required: false,
+ type: String,
+ })
+ @IsString()
+ @MaxLength(1000)
+ @IsOptional()
+ @Field(() => String, {
+ nullable: true,
+ })
+ promotor?: string | null;
+
+ @ApiProperty({
+ required: false,
+ type: String,
+ })
+ @IsString()
+ @MaxLength(1000)
+ @IsOptional()
+ @Field(() => String, {
+ nullable: true,
+ })
+ promotorId?: string | null;
+
+ @ApiProperty({
+ required: false,
+ type: String,
+ })
+ @IsString()
+ @MaxLength(1000)
+ @IsOptional()
+ @Field(() => String, {
+ nullable: true,
+ })
+ promotorReferencia?: string | null;
+
+ @ApiProperty({
+ required: false,
+ enum: EnumMatriculaStatus,
+ })
+ @IsEnum(EnumMatriculaStatus)
+ @IsOptional()
+ @Field(() => EnumMatriculaStatus, {
+ nullable: true,
+ })
+ status?: "Option1" | null;
+
+ @ApiProperty({
+ required: false,
+ enum: EnumMatriculaStatusMatricula,
+ })
+ @IsEnum(EnumMatriculaStatusMatricula)
+ @IsOptional()
+ @Field(() => EnumMatriculaStatusMatricula, {
+ nullable: true,
+ })
+ statusMatricula?: "Option1" | null;
+
+ @ApiProperty({
+ required: false,
+ type: String,
+ })
+ @IsString()
+ @MaxLength(1000)
+ @IsOptional()
+ @Field(() => String, {
+ nullable: true,
+ })
+ taxaMatricula?: string | null;
+
+ @ApiProperty({
+ required: false,
+ type: String,
+ })
+ @IsString()
+ @MaxLength(1000)
+ @IsOptional()
+ @Field(() => String, {
+ nullable: true,
+ })
+ taxaMatriculaId?: string | null;
+
+ @ApiProperty({
+ required: false,
+ type: String,
+ })
+ @IsString()
+ @MaxLength(1000)
+ @IsOptional()
+ @Field(() => String, {
+ nullable: true,
+ })
+ taxaMatriculaReferencia?: string | null;
+}
+
+export { MatriculaUpdateInput as MatriculaUpdateInput };
diff --git a/apps/maestri-edu-server/src/matricula/base/MatriculaWhereInput.ts b/apps/maestri-edu-server/src/matricula/base/MatriculaWhereInput.ts
new file mode 100644
index 0000000..cdde0a5
--- /dev/null
+++ b/apps/maestri-edu-server/src/matricula/base/MatriculaWhereInput.ts
@@ -0,0 +1,236 @@
+/*
+------------------------------------------------------------------------------
+This code was generated by Amplication.
+
+Changes to this file will be lost if the code is regenerated.
+
+There are other ways to to customize your code, see this doc to learn more
+https://docs.amplication.com/how-to/custom-code
+
+------------------------------------------------------------------------------
+ */
+import { InputType, Field } from "@nestjs/graphql";
+import { ApiProperty } from "@nestjs/swagger";
+import { StringNullableFilter } from "../../util/StringNullableFilter";
+import { Type } from "class-transformer";
+import { IsOptional, ValidateNested, IsEnum } from "class-validator";
+import { CursoWhereUniqueInput } from "../../curso/base/CursoWhereUniqueInput";
+import { StringFilter } from "../../util/StringFilter";
+import { IntNullableFilter } from "../../util/IntNullableFilter";
+import { EnumMatriculaStatus } from "./EnumMatriculaStatus";
+import { EnumMatriculaStatusMatricula } from "./EnumMatriculaStatusMatricula";
+
+@InputType()
+class MatriculaWhereInput {
+ @ApiProperty({
+ required: false,
+ type: StringNullableFilter,
+ })
+ @Type(() => StringNullableFilter)
+ @IsOptional()
+ @Field(() => StringNullableFilter, {
+ nullable: true,
+ })
+ aluno?: StringNullableFilter;
+
+ @ApiProperty({
+ required: false,
+ type: StringNullableFilter,
+ })
+ @Type(() => StringNullableFilter)
+ @IsOptional()
+ @Field(() => StringNullableFilter, {
+ nullable: true,
+ })
+ alunoId?: StringNullableFilter;
+
+ @ApiProperty({
+ required: false,
+ type: StringNullableFilter,
+ })
+ @Type(() => StringNullableFilter)
+ @IsOptional()
+ @Field(() => StringNullableFilter, {
+ nullable: true,
+ })
+ alunoReferencia?: StringNullableFilter;
+
+ @ApiProperty({
+ required: false,
+ type: StringNullableFilter,
+ })
+ @Type(() => StringNullableFilter)
+ @IsOptional()
+ @Field(() => StringNullableFilter, {
+ nullable: true,
+ })
+ classificacaoReferencia?: StringNullableFilter;
+
+ @ApiProperty({
+ required: false,
+ type: () => CursoWhereUniqueInput,
+ })
+ @ValidateNested()
+ @Type(() => CursoWhereUniqueInput)
+ @IsOptional()
+ @Field(() => CursoWhereUniqueInput, {
+ nullable: true,
+ })
+ curso?: CursoWhereUniqueInput;
+
+ @ApiProperty({
+ required: false,
+ type: StringNullableFilter,
+ })
+ @Type(() => StringNullableFilter)
+ @IsOptional()
+ @Field(() => StringNullableFilter, {
+ nullable: true,
+ })
+ cursoReferencia?: StringNullableFilter;
+
+ @ApiProperty({
+ required: false,
+ type: StringFilter,
+ })
+ @Type(() => StringFilter)
+ @IsOptional()
+ @Field(() => StringFilter, {
+ nullable: true,
+ })
+ id?: StringFilter;
+
+ @ApiProperty({
+ required: false,
+ type: IntNullableFilter,
+ })
+ @Type(() => IntNullableFilter)
+ @IsOptional()
+ @Field(() => IntNullableFilter, {
+ nullable: true,
+ })
+ numeroParcelas?: IntNullableFilter;
+
+ @ApiProperty({
+ required: false,
+ type: StringNullableFilter,
+ })
+ @Type(() => StringNullableFilter)
+ @IsOptional()
+ @Field(() => StringNullableFilter, {
+ nullable: true,
+ })
+ parcelaAdimplente?: StringNullableFilter;
+
+ @ApiProperty({
+ required: false,
+ type: StringNullableFilter,
+ })
+ @Type(() => StringNullableFilter)
+ @IsOptional()
+ @Field(() => StringNullableFilter, {
+ nullable: true,
+ })
+ parcelaAdimplenteId?: StringNullableFilter;
+
+ @ApiProperty({
+ required: false,
+ type: StringNullableFilter,
+ })
+ @Type(() => StringNullableFilter)
+ @IsOptional()
+ @Field(() => StringNullableFilter, {
+ nullable: true,
+ })
+ parcelaAdimplenteReferencia?: StringNullableFilter;
+
+ @ApiProperty({
+ required: false,
+ type: StringNullableFilter,
+ })
+ @Type(() => StringNullableFilter)
+ @IsOptional()
+ @Field(() => StringNullableFilter, {
+ nullable: true,
+ })
+ promotor?: StringNullableFilter;
+
+ @ApiProperty({
+ required: false,
+ type: StringNullableFilter,
+ })
+ @Type(() => StringNullableFilter)
+ @IsOptional()
+ @Field(() => StringNullableFilter, {
+ nullable: true,
+ })
+ promotorId?: StringNullableFilter;
+
+ @ApiProperty({
+ required: false,
+ type: StringNullableFilter,
+ })
+ @Type(() => StringNullableFilter)
+ @IsOptional()
+ @Field(() => StringNullableFilter, {
+ nullable: true,
+ })
+ promotorReferencia?: StringNullableFilter;
+
+ @ApiProperty({
+ required: false,
+ enum: EnumMatriculaStatus,
+ })
+ @IsEnum(EnumMatriculaStatus)
+ @IsOptional()
+ @Field(() => EnumMatriculaStatus, {
+ nullable: true,
+ })
+ status?: "Option1";
+
+ @ApiProperty({
+ required: false,
+ enum: EnumMatriculaStatusMatricula,
+ })
+ @IsEnum(EnumMatriculaStatusMatricula)
+ @IsOptional()
+ @Field(() => EnumMatriculaStatusMatricula, {
+ nullable: true,
+ })
+ statusMatricula?: "Option1";
+
+ @ApiProperty({
+ required: false,
+ type: StringNullableFilter,
+ })
+ @Type(() => StringNullableFilter)
+ @IsOptional()
+ @Field(() => StringNullableFilter, {
+ nullable: true,
+ })
+ taxaMatricula?: StringNullableFilter;
+
+ @ApiProperty({
+ required: false,
+ type: StringNullableFilter,
+ })
+ @Type(() => StringNullableFilter)
+ @IsOptional()
+ @Field(() => StringNullableFilter, {
+ nullable: true,
+ })
+ taxaMatriculaId?: StringNullableFilter;
+
+ @ApiProperty({
+ required: false,
+ type: StringNullableFilter,
+ })
+ @Type(() => StringNullableFilter)
+ @IsOptional()
+ @Field(() => StringNullableFilter, {
+ nullable: true,
+ })
+ taxaMatriculaReferencia?: StringNullableFilter;
+}
+
+export { MatriculaWhereInput as MatriculaWhereInput };
diff --git a/apps/maestri-edu-server/src/matricula/base/MatriculaWhereUniqueInput.ts b/apps/maestri-edu-server/src/matricula/base/MatriculaWhereUniqueInput.ts
new file mode 100644
index 0000000..30b0fab
--- /dev/null
+++ b/apps/maestri-edu-server/src/matricula/base/MatriculaWhereUniqueInput.ts
@@ -0,0 +1,27 @@
+/*
+------------------------------------------------------------------------------
+This code was generated by Amplication.
+
+Changes to this file will be lost if the code is regenerated.
+
+There are other ways to to customize your code, see this doc to learn more
+https://docs.amplication.com/how-to/custom-code
+
+------------------------------------------------------------------------------
+ */
+import { InputType, Field } from "@nestjs/graphql";
+import { ApiProperty } from "@nestjs/swagger";
+import { IsString } from "class-validator";
+
+@InputType()
+class MatriculaWhereUniqueInput {
+ @ApiProperty({
+ required: true,
+ type: String,
+ })
+ @IsString()
+ @Field(() => String)
+ id!: string;
+}
+
+export { MatriculaWhereUniqueInput as MatriculaWhereUniqueInput };
diff --git a/apps/maestri-edu-server/src/matricula/base/UpdateMatriculaArgs.ts b/apps/maestri-edu-server/src/matricula/base/UpdateMatriculaArgs.ts
new file mode 100644
index 0000000..c699a1a
--- /dev/null
+++ b/apps/maestri-edu-server/src/matricula/base/UpdateMatriculaArgs.ts
@@ -0,0 +1,40 @@
+/*
+------------------------------------------------------------------------------
+This code was generated by Amplication.
+
+Changes to this file will be lost if the code is regenerated.
+
+There are other ways to to customize your code, see this doc to learn more
+https://docs.amplication.com/how-to/custom-code
+
+------------------------------------------------------------------------------
+ */
+import { ArgsType, Field } from "@nestjs/graphql";
+import { ApiProperty } from "@nestjs/swagger";
+import { MatriculaWhereUniqueInput } from "./MatriculaWhereUniqueInput";
+import { ValidateNested } from "class-validator";
+import { Type } from "class-transformer";
+import { MatriculaUpdateInput } from "./MatriculaUpdateInput";
+
+@ArgsType()
+class UpdateMatriculaArgs {
+ @ApiProperty({
+ required: true,
+ type: () => MatriculaWhereUniqueInput,
+ })
+ @ValidateNested()
+ @Type(() => MatriculaWhereUniqueInput)
+ @Field(() => MatriculaWhereUniqueInput, { nullable: false })
+ where!: MatriculaWhereUniqueInput;
+
+ @ApiProperty({
+ required: true,
+ type: () => MatriculaUpdateInput,
+ })
+ @ValidateNested()
+ @Type(() => MatriculaUpdateInput)
+ @Field(() => MatriculaUpdateInput, { nullable: false })
+ data!: MatriculaUpdateInput;
+}
+
+export { UpdateMatriculaArgs as UpdateMatriculaArgs };
diff --git a/apps/maestri-edu-server/src/matricula/base/matricula.controller.base.spec.ts b/apps/maestri-edu-server/src/matricula/base/matricula.controller.base.spec.ts
new file mode 100644
index 0000000..adb6133
--- /dev/null
+++ b/apps/maestri-edu-server/src/matricula/base/matricula.controller.base.spec.ts
@@ -0,0 +1,250 @@
+import { Test } from "@nestjs/testing";
+import {
+ INestApplication,
+ HttpStatus,
+ ExecutionContext,
+ CallHandler,
+} from "@nestjs/common";
+import request from "supertest";
+import { ACGuard } from "nest-access-control";
+import { DefaultAuthGuard } from "../../auth/defaultAuth.guard";
+import { ACLModule } from "../../auth/acl.module";
+import { AclFilterResponseInterceptor } from "../../interceptors/aclFilterResponse.interceptor";
+import { AclValidateRequestInterceptor } from "../../interceptors/aclValidateRequest.interceptor";
+import { map } from "rxjs";
+import { MatriculaController } from "../matricula.controller";
+import { MatriculaService } from "../matricula.service";
+
+const nonExistingId = "nonExistingId";
+const existingId = "existingId";
+const CREATE_INPUT = {
+ aluno: "exampleAluno",
+ alunoId: "exampleAlunoId",
+ alunoReferencia: "exampleAlunoReferencia",
+ classificacaoReferencia: "exampleClassificacaoReferencia",
+ createdAt: new Date(),
+ cursoReferencia: "exampleCursoReferencia",
+ id: "exampleId",
+ numeroParcelas: 42,
+ parcelaAdimplente: "exampleParcelaAdimplente",
+ parcelaAdimplenteId: "exampleParcelaAdimplenteId",
+ parcelaAdimplenteReferencia: "exampleParcelaAdimplenteReferencia",
+ promotor: "examplePromotor",
+ promotorId: "examplePromotorId",
+ promotorReferencia: "examplePromotorReferencia",
+ taxaMatricula: "exampleTaxaMatricula",
+ taxaMatriculaId: "exampleTaxaMatriculaId",
+ taxaMatriculaReferencia: "exampleTaxaMatriculaReferencia",
+ updatedAt: new Date(),
+};
+const CREATE_RESULT = {
+ aluno: "exampleAluno",
+ alunoId: "exampleAlunoId",
+ alunoReferencia: "exampleAlunoReferencia",
+ classificacaoReferencia: "exampleClassificacaoReferencia",
+ createdAt: new Date(),
+ cursoReferencia: "exampleCursoReferencia",
+ id: "exampleId",
+ numeroParcelas: 42,
+ parcelaAdimplente: "exampleParcelaAdimplente",
+ parcelaAdimplenteId: "exampleParcelaAdimplenteId",
+ parcelaAdimplenteReferencia: "exampleParcelaAdimplenteReferencia",
+ promotor: "examplePromotor",
+ promotorId: "examplePromotorId",
+ promotorReferencia: "examplePromotorReferencia",
+ taxaMatricula: "exampleTaxaMatricula",
+ taxaMatriculaId: "exampleTaxaMatriculaId",
+ taxaMatriculaReferencia: "exampleTaxaMatriculaReferencia",
+ updatedAt: new Date(),
+};
+const FIND_MANY_RESULT = [
+ {
+ aluno: "exampleAluno",
+ alunoId: "exampleAlunoId",
+ alunoReferencia: "exampleAlunoReferencia",
+ classificacaoReferencia: "exampleClassificacaoReferencia",
+ createdAt: new Date(),
+ cursoReferencia: "exampleCursoReferencia",
+ id: "exampleId",
+ numeroParcelas: 42,
+ parcelaAdimplente: "exampleParcelaAdimplente",
+ parcelaAdimplenteId: "exampleParcelaAdimplenteId",
+ parcelaAdimplenteReferencia: "exampleParcelaAdimplenteReferencia",
+ promotor: "examplePromotor",
+ promotorId: "examplePromotorId",
+ promotorReferencia: "examplePromotorReferencia",
+ taxaMatricula: "exampleTaxaMatricula",
+ taxaMatriculaId: "exampleTaxaMatriculaId",
+ taxaMatriculaReferencia: "exampleTaxaMatriculaReferencia",
+ updatedAt: new Date(),
+ },
+];
+const FIND_ONE_RESULT = {
+ aluno: "exampleAluno",
+ alunoId: "exampleAlunoId",
+ alunoReferencia: "exampleAlunoReferencia",
+ classificacaoReferencia: "exampleClassificacaoReferencia",
+ createdAt: new Date(),
+ cursoReferencia: "exampleCursoReferencia",
+ id: "exampleId",
+ numeroParcelas: 42,
+ parcelaAdimplente: "exampleParcelaAdimplente",
+ parcelaAdimplenteId: "exampleParcelaAdimplenteId",
+ parcelaAdimplenteReferencia: "exampleParcelaAdimplenteReferencia",
+ promotor: "examplePromotor",
+ promotorId: "examplePromotorId",
+ promotorReferencia: "examplePromotorReferencia",
+ taxaMatricula: "exampleTaxaMatricula",
+ taxaMatriculaId: "exampleTaxaMatriculaId",
+ taxaMatriculaReferencia: "exampleTaxaMatriculaReferencia",
+ updatedAt: new Date(),
+};
+
+const service = {
+ createMatricula() {
+ return CREATE_RESULT;
+ },
+ matriculas: () => FIND_MANY_RESULT,
+ matricula: ({ where }: { where: { id: string } }) => {
+ switch (where.id) {
+ case existingId:
+ return FIND_ONE_RESULT;
+ case nonExistingId:
+ return null;
+ }
+ },
+};
+
+const basicAuthGuard = {
+ canActivate: (context: ExecutionContext) => {
+ const argumentHost = context.switchToHttp();
+ const request = argumentHost.getRequest();
+ request.user = {
+ roles: ["user"],
+ };
+ return true;
+ },
+};
+
+const acGuard = {
+ canActivate: () => {
+ return true;
+ },
+};
+
+const aclFilterResponseInterceptor = {
+ intercept: (context: ExecutionContext, next: CallHandler) => {
+ return next.handle().pipe(
+ map((data) => {
+ return data;
+ })
+ );
+ },
+};
+const aclValidateRequestInterceptor = {
+ intercept: (context: ExecutionContext, next: CallHandler) => {
+ return next.handle();
+ },
+};
+
+describe("Matricula", () => {
+ let app: INestApplication;
+
+ beforeAll(async () => {
+ const moduleRef = await Test.createTestingModule({
+ providers: [
+ {
+ provide: MatriculaService,
+ useValue: service,
+ },
+ ],
+ controllers: [MatriculaController],
+ imports: [ACLModule],
+ })
+ .overrideGuard(DefaultAuthGuard)
+ .useValue(basicAuthGuard)
+ .overrideGuard(ACGuard)
+ .useValue(acGuard)
+ .overrideInterceptor(AclFilterResponseInterceptor)
+ .useValue(aclFilterResponseInterceptor)
+ .overrideInterceptor(AclValidateRequestInterceptor)
+ .useValue(aclValidateRequestInterceptor)
+ .compile();
+
+ app = moduleRef.createNestApplication();
+ await app.init();
+ });
+
+ test("POST /matriculas", async () => {
+ await request(app.getHttpServer())
+ .post("/matriculas")
+ .send(CREATE_INPUT)
+ .expect(HttpStatus.CREATED)
+ .expect({
+ ...CREATE_RESULT,
+ createdAt: CREATE_RESULT.createdAt.toISOString(),
+ updatedAt: CREATE_RESULT.updatedAt.toISOString(),
+ });
+ });
+
+ test("GET /matriculas", async () => {
+ await request(app.getHttpServer())
+ .get("/matriculas")
+ .expect(HttpStatus.OK)
+ .expect([
+ {
+ ...FIND_MANY_RESULT[0],
+ createdAt: FIND_MANY_RESULT[0].createdAt.toISOString(),
+ updatedAt: FIND_MANY_RESULT[0].updatedAt.toISOString(),
+ },
+ ]);
+ });
+
+ test("GET /matriculas/:id non existing", async () => {
+ await request(app.getHttpServer())
+ .get(`${"/matriculas"}/${nonExistingId}`)
+ .expect(HttpStatus.NOT_FOUND)
+ .expect({
+ statusCode: HttpStatus.NOT_FOUND,
+ message: `No resource was found for {"${"id"}":"${nonExistingId}"}`,
+ error: "Not Found",
+ });
+ });
+
+ test("GET /matriculas/:id existing", async () => {
+ await request(app.getHttpServer())
+ .get(`${"/matriculas"}/${existingId}`)
+ .expect(HttpStatus.OK)
+ .expect({
+ ...FIND_ONE_RESULT,
+ createdAt: FIND_ONE_RESULT.createdAt.toISOString(),
+ updatedAt: FIND_ONE_RESULT.updatedAt.toISOString(),
+ });
+ });
+
+ test("POST /matriculas existing resource", async () => {
+ const agent = request(app.getHttpServer());
+ await agent
+ .post("/matriculas")
+ .send(CREATE_INPUT)
+ .expect(HttpStatus.CREATED)
+ .expect({
+ ...CREATE_RESULT,
+ createdAt: CREATE_RESULT.createdAt.toISOString(),
+ updatedAt: CREATE_RESULT.updatedAt.toISOString(),
+ })
+ .then(function () {
+ agent
+ .post("/matriculas")
+ .send(CREATE_INPUT)
+ .expect(HttpStatus.CONFLICT)
+ .expect({
+ statusCode: HttpStatus.CONFLICT,
+ });
+ });
+ });
+
+ afterAll(async () => {
+ await app.close();
+ });
+});
diff --git a/apps/maestri-edu-server/src/matricula/base/matricula.controller.base.ts b/apps/maestri-edu-server/src/matricula/base/matricula.controller.base.ts
new file mode 100644
index 0000000..869aa05
--- /dev/null
+++ b/apps/maestri-edu-server/src/matricula/base/matricula.controller.base.ts
@@ -0,0 +1,267 @@
+/*
+------------------------------------------------------------------------------
+This code was generated by Amplication.
+
+Changes to this file will be lost if the code is regenerated.
+
+There are other ways to to customize your code, see this doc to learn more
+https://docs.amplication.com/how-to/custom-code
+
+------------------------------------------------------------------------------
+ */
+import * as common from "@nestjs/common";
+import * as swagger from "@nestjs/swagger";
+import { isRecordNotFoundError } from "../../prisma.util";
+import * as errors from "../../errors";
+import { Request } from "express";
+import { plainToClass } from "class-transformer";
+import { ApiNestedQuery } from "../../decorators/api-nested-query.decorator";
+import { MatriculaService } from "../matricula.service";
+import { MatriculaCreateInput } from "./MatriculaCreateInput";
+import { Matricula } from "./Matricula";
+import { MatriculaFindManyArgs } from "./MatriculaFindManyArgs";
+import { MatriculaWhereUniqueInput } from "./MatriculaWhereUniqueInput";
+import { MatriculaUpdateInput } from "./MatriculaUpdateInput";
+
+export class MatriculaControllerBase {
+ constructor(protected readonly service: MatriculaService) {}
+ @common.Post()
+ @swagger.ApiCreatedResponse({ type: Matricula })
+ async createMatricula(
+ @common.Body() data: MatriculaCreateInput
+ ): Promise {
+ return await this.service.createMatricula({
+ data: {
+ ...data,
+
+ curso: data.curso
+ ? {
+ connect: data.curso,
+ }
+ : undefined,
+ },
+ select: {
+ aluno: true,
+ alunoId: true,
+ alunoReferencia: true,
+ classificacaoReferencia: true,
+ createdAt: true,
+
+ curso: {
+ select: {
+ id: true,
+ },
+ },
+
+ cursoReferencia: true,
+ id: true,
+ numeroParcelas: true,
+ parcelaAdimplente: true,
+ parcelaAdimplenteId: true,
+ parcelaAdimplenteReferencia: true,
+ promotor: true,
+ promotorId: true,
+ promotorReferencia: true,
+ status: true,
+ statusMatricula: true,
+ taxaMatricula: true,
+ taxaMatriculaId: true,
+ taxaMatriculaReferencia: true,
+ updatedAt: true,
+ },
+ });
+ }
+
+ @common.Get()
+ @swagger.ApiOkResponse({ type: [Matricula] })
+ @ApiNestedQuery(MatriculaFindManyArgs)
+ async matriculas(@common.Req() request: Request): Promise {
+ const args = plainToClass(MatriculaFindManyArgs, request.query);
+ return this.service.matriculas({
+ ...args,
+ select: {
+ aluno: true,
+ alunoId: true,
+ alunoReferencia: true,
+ classificacaoReferencia: true,
+ createdAt: true,
+
+ curso: {
+ select: {
+ id: true,
+ },
+ },
+
+ cursoReferencia: true,
+ id: true,
+ numeroParcelas: true,
+ parcelaAdimplente: true,
+ parcelaAdimplenteId: true,
+ parcelaAdimplenteReferencia: true,
+ promotor: true,
+ promotorId: true,
+ promotorReferencia: true,
+ status: true,
+ statusMatricula: true,
+ taxaMatricula: true,
+ taxaMatriculaId: true,
+ taxaMatriculaReferencia: true,
+ updatedAt: true,
+ },
+ });
+ }
+
+ @common.Get("/:id")
+ @swagger.ApiOkResponse({ type: Matricula })
+ @swagger.ApiNotFoundResponse({ type: errors.NotFoundException })
+ async matricula(
+ @common.Param() params: MatriculaWhereUniqueInput
+ ): Promise {
+ const result = await this.service.matricula({
+ where: params,
+ select: {
+ aluno: true,
+ alunoId: true,
+ alunoReferencia: true,
+ classificacaoReferencia: true,
+ createdAt: true,
+
+ curso: {
+ select: {
+ id: true,
+ },
+ },
+
+ cursoReferencia: true,
+ id: true,
+ numeroParcelas: true,
+ parcelaAdimplente: true,
+ parcelaAdimplenteId: true,
+ parcelaAdimplenteReferencia: true,
+ promotor: true,
+ promotorId: true,
+ promotorReferencia: true,
+ status: true,
+ statusMatricula: true,
+ taxaMatricula: true,
+ taxaMatriculaId: true,
+ taxaMatriculaReferencia: true,
+ updatedAt: true,
+ },
+ });
+ if (result === null) {
+ throw new errors.NotFoundException(
+ `No resource was found for ${JSON.stringify(params)}`
+ );
+ }
+ return result;
+ }
+
+ @common.Patch("/:id")
+ @swagger.ApiOkResponse({ type: Matricula })
+ @swagger.ApiNotFoundResponse({ type: errors.NotFoundException })
+ async updateMatricula(
+ @common.Param() params: MatriculaWhereUniqueInput,
+ @common.Body() data: MatriculaUpdateInput
+ ): Promise {
+ try {
+ return await this.service.updateMatricula({
+ where: params,
+ data: {
+ ...data,
+
+ curso: data.curso
+ ? {
+ connect: data.curso,
+ }
+ : undefined,
+ },
+ select: {
+ aluno: true,
+ alunoId: true,
+ alunoReferencia: true,
+ classificacaoReferencia: true,
+ createdAt: true,
+
+ curso: {
+ select: {
+ id: true,
+ },
+ },
+
+ cursoReferencia: true,
+ id: true,
+ numeroParcelas: true,
+ parcelaAdimplente: true,
+ parcelaAdimplenteId: true,
+ parcelaAdimplenteReferencia: true,
+ promotor: true,
+ promotorId: true,
+ promotorReferencia: true,
+ status: true,
+ statusMatricula: true,
+ taxaMatricula: true,
+ taxaMatriculaId: true,
+ taxaMatriculaReferencia: true,
+ updatedAt: true,
+ },
+ });
+ } catch (error) {
+ if (isRecordNotFoundError(error)) {
+ throw new errors.NotFoundException(
+ `No resource was found for ${JSON.stringify(params)}`
+ );
+ }
+ throw error;
+ }
+ }
+
+ @common.Delete("/:id")
+ @swagger.ApiOkResponse({ type: Matricula })
+ @swagger.ApiNotFoundResponse({ type: errors.NotFoundException })
+ async deleteMatricula(
+ @common.Param() params: MatriculaWhereUniqueInput
+ ): Promise {
+ try {
+ return await this.service.deleteMatricula({
+ where: params,
+ select: {
+ aluno: true,
+ alunoId: true,
+ alunoReferencia: true,
+ classificacaoReferencia: true,
+ createdAt: true,
+
+ curso: {
+ select: {
+ id: true,
+ },
+ },
+
+ cursoReferencia: true,
+ id: true,
+ numeroParcelas: true,
+ parcelaAdimplente: true,
+ parcelaAdimplenteId: true,
+ parcelaAdimplenteReferencia: true,
+ promotor: true,
+ promotorId: true,
+ promotorReferencia: true,
+ status: true,
+ statusMatricula: true,
+ taxaMatricula: true,
+ taxaMatriculaId: true,
+ taxaMatriculaReferencia: true,
+ updatedAt: true,
+ },
+ });
+ } catch (error) {
+ if (isRecordNotFoundError(error)) {
+ throw new errors.NotFoundException(
+ `No resource was found for ${JSON.stringify(params)}`
+ );
+ }
+ throw error;
+ }
+ }
+}
diff --git a/apps/maestri-edu-server/src/matricula/base/matricula.module.base.ts b/apps/maestri-edu-server/src/matricula/base/matricula.module.base.ts
new file mode 100644
index 0000000..6347391
--- /dev/null
+++ b/apps/maestri-edu-server/src/matricula/base/matricula.module.base.ts
@@ -0,0 +1,18 @@
+/*
+------------------------------------------------------------------------------
+This code was generated by Amplication.
+
+Changes to this file will be lost if the code is regenerated.
+
+There are other ways to to customize your code, see this doc to learn more
+https://docs.amplication.com/how-to/custom-code
+
+------------------------------------------------------------------------------
+ */
+import { Module } from "@nestjs/common";
+
+@Module({
+ imports: [],
+ exports: [],
+})
+export class MatriculaModuleBase {}
diff --git a/apps/maestri-edu-server/src/matricula/base/matricula.resolver.base.ts b/apps/maestri-edu-server/src/matricula/base/matricula.resolver.base.ts
new file mode 100644
index 0000000..610a399
--- /dev/null
+++ b/apps/maestri-edu-server/src/matricula/base/matricula.resolver.base.ts
@@ -0,0 +1,129 @@
+/*
+------------------------------------------------------------------------------
+This code was generated by Amplication.
+
+Changes to this file will be lost if the code is regenerated.
+
+There are other ways to to customize your code, see this doc to learn more
+https://docs.amplication.com/how-to/custom-code
+
+------------------------------------------------------------------------------
+ */
+import * as graphql from "@nestjs/graphql";
+import { GraphQLError } from "graphql";
+import { isRecordNotFoundError } from "../../prisma.util";
+import { MetaQueryPayload } from "../../util/MetaQueryPayload";
+import { Matricula } from "./Matricula";
+import { MatriculaCountArgs } from "./MatriculaCountArgs";
+import { MatriculaFindManyArgs } from "./MatriculaFindManyArgs";
+import { MatriculaFindUniqueArgs } from "./MatriculaFindUniqueArgs";
+import { CreateMatriculaArgs } from "./CreateMatriculaArgs";
+import { UpdateMatriculaArgs } from "./UpdateMatriculaArgs";
+import { DeleteMatriculaArgs } from "./DeleteMatriculaArgs";
+import { Curso } from "../../curso/base/Curso";
+import { MatriculaService } from "../matricula.service";
+@graphql.Resolver(() => Matricula)
+export class MatriculaResolverBase {
+ constructor(protected readonly service: MatriculaService) {}
+
+ async _matriculasMeta(
+ @graphql.Args() args: MatriculaCountArgs
+ ): Promise {
+ const result = await this.service.count(args);
+ return {
+ count: result,
+ };
+ }
+
+ @graphql.Query(() => [Matricula])
+ async matriculas(
+ @graphql.Args() args: MatriculaFindManyArgs
+ ): Promise {
+ return this.service.matriculas(args);
+ }
+
+ @graphql.Query(() => Matricula, { nullable: true })
+ async matricula(
+ @graphql.Args() args: MatriculaFindUniqueArgs
+ ): Promise {
+ const result = await this.service.matricula(args);
+ if (result === null) {
+ return null;
+ }
+ return result;
+ }
+
+ @graphql.Mutation(() => Matricula)
+ async createMatricula(
+ @graphql.Args() args: CreateMatriculaArgs
+ ): Promise {
+ return await this.service.createMatricula({
+ ...args,
+ data: {
+ ...args.data,
+
+ curso: args.data.curso
+ ? {
+ connect: args.data.curso,
+ }
+ : undefined,
+ },
+ });
+ }
+
+ @graphql.Mutation(() => Matricula)
+ async updateMatricula(
+ @graphql.Args() args: UpdateMatriculaArgs
+ ): Promise {
+ try {
+ return await this.service.updateMatricula({
+ ...args,
+ data: {
+ ...args.data,
+
+ curso: args.data.curso
+ ? {
+ connect: args.data.curso,
+ }
+ : undefined,
+ },
+ });
+ } catch (error) {
+ if (isRecordNotFoundError(error)) {
+ throw new GraphQLError(
+ `No resource was found for ${JSON.stringify(args.where)}`
+ );
+ }
+ throw error;
+ }
+ }
+
+ @graphql.Mutation(() => Matricula)
+ async deleteMatricula(
+ @graphql.Args() args: DeleteMatriculaArgs
+ ): Promise {
+ try {
+ return await this.service.deleteMatricula(args);
+ } catch (error) {
+ if (isRecordNotFoundError(error)) {
+ throw new GraphQLError(
+ `No resource was found for ${JSON.stringify(args.where)}`
+ );
+ }
+ throw error;
+ }
+ }
+
+ @graphql.ResolveField(() => Curso, {
+ nullable: true,
+ name: "curso",
+ })
+ async getCurso(@graphql.Parent() parent: Matricula): Promise {
+ const result = await this.service.getCurso(parent.id);
+
+ if (!result) {
+ return null;
+ }
+ return result;
+ }
+}
diff --git a/apps/maestri-edu-server/src/matricula/base/matricula.service.base.ts b/apps/maestri-edu-server/src/matricula/base/matricula.service.base.ts
new file mode 100644
index 0000000..d01c50e
--- /dev/null
+++ b/apps/maestri-edu-server/src/matricula/base/matricula.service.base.ts
@@ -0,0 +1,61 @@
+/*
+------------------------------------------------------------------------------
+This code was generated by Amplication.
+
+Changes to this file will be lost if the code is regenerated.
+
+There are other ways to to customize your code, see this doc to learn more
+https://docs.amplication.com/how-to/custom-code
+
+------------------------------------------------------------------------------
+ */
+import { PrismaService } from "../../prisma/prisma.service";
+import {
+ Prisma,
+ Matricula as PrismaMatricula,
+ Curso as PrismaCurso,
+} from "@prisma/client";
+
+export class MatriculaServiceBase {
+ constructor(protected readonly prisma: PrismaService) {}
+
+ async count(
+ args: Omit
+ ): Promise {
+ return this.prisma.matricula.count(args);
+ }
+
+ async matriculas(
+ args: Prisma.MatriculaFindManyArgs
+ ): Promise {
+ return this.prisma.matricula.findMany(args);
+ }
+ async matricula(
+ args: Prisma.MatriculaFindUniqueArgs
+ ): Promise {
+ return this.prisma.matricula.findUnique(args);
+ }
+ async createMatricula(
+ args: Prisma.MatriculaCreateArgs
+ ): Promise {
+ return this.prisma.matricula.create(args);
+ }
+ async updateMatricula(
+ args: Prisma.MatriculaUpdateArgs
+ ): Promise {
+ return this.prisma.matricula.update(args);
+ }
+ async deleteMatricula(
+ args: Prisma.MatriculaDeleteArgs
+ ): Promise {
+ return this.prisma.matricula.delete(args);
+ }
+
+ async getCurso(parentId: string): Promise {
+ return this.prisma.matricula
+ .findUnique({
+ where: { id: parentId },
+ })
+ .curso();
+ }
+}
diff --git a/apps/maestri-edu-server/src/matricula/matricula.controller.ts b/apps/maestri-edu-server/src/matricula/matricula.controller.ts
new file mode 100644
index 0000000..8c9b4c7
--- /dev/null
+++ b/apps/maestri-edu-server/src/matricula/matricula.controller.ts
@@ -0,0 +1,12 @@
+import * as common from "@nestjs/common";
+import * as swagger from "@nestjs/swagger";
+import { MatriculaService } from "./matricula.service";
+import { MatriculaControllerBase } from "./base/matricula.controller.base";
+
+@swagger.ApiTags("matriculas")
+@common.Controller("matriculas")
+export class MatriculaController extends MatriculaControllerBase {
+ constructor(protected readonly service: MatriculaService) {
+ super(service);
+ }
+}
diff --git a/apps/maestri-edu-server/src/matricula/matricula.module.ts b/apps/maestri-edu-server/src/matricula/matricula.module.ts
new file mode 100644
index 0000000..5829784
--- /dev/null
+++ b/apps/maestri-edu-server/src/matricula/matricula.module.ts
@@ -0,0 +1,13 @@
+import { Module } from "@nestjs/common";
+import { MatriculaModuleBase } from "./base/matricula.module.base";
+import { MatriculaService } from "./matricula.service";
+import { MatriculaController } from "./matricula.controller";
+import { MatriculaResolver } from "./matricula.resolver";
+
+@Module({
+ imports: [MatriculaModuleBase],
+ controllers: [MatriculaController],
+ providers: [MatriculaService, MatriculaResolver],
+ exports: [MatriculaService],
+})
+export class MatriculaModule {}
diff --git a/apps/maestri-edu-server/src/matricula/matricula.resolver.ts b/apps/maestri-edu-server/src/matricula/matricula.resolver.ts
new file mode 100644
index 0000000..0708e16
--- /dev/null
+++ b/apps/maestri-edu-server/src/matricula/matricula.resolver.ts
@@ -0,0 +1,11 @@
+import * as graphql from "@nestjs/graphql";
+import { MatriculaResolverBase } from "./base/matricula.resolver.base";
+import { Matricula } from "./base/Matricula";
+import { MatriculaService } from "./matricula.service";
+
+@graphql.Resolver(() => Matricula)
+export class MatriculaResolver extends MatriculaResolverBase {
+ constructor(protected readonly service: MatriculaService) {
+ super(service);
+ }
+}
diff --git a/apps/maestri-edu-server/src/matricula/matricula.service.ts b/apps/maestri-edu-server/src/matricula/matricula.service.ts
new file mode 100644
index 0000000..3332d02
--- /dev/null
+++ b/apps/maestri-edu-server/src/matricula/matricula.service.ts
@@ -0,0 +1,10 @@
+import { Injectable } from "@nestjs/common";
+import { PrismaService } from "../prisma/prisma.service";
+import { MatriculaServiceBase } from "./base/matricula.service.base";
+
+@Injectable()
+export class MatriculaService extends MatriculaServiceBase {
+ constructor(protected readonly prisma: PrismaService) {
+ super(prisma);
+ }
+}
diff --git a/apps/maestri-edu-server/src/parcela/base/DeleteParcelaArgs.ts b/apps/maestri-edu-server/src/parcela/base/DeleteParcelaArgs.ts
new file mode 100644
index 0000000..d3c8531
--- /dev/null
+++ b/apps/maestri-edu-server/src/parcela/base/DeleteParcelaArgs.ts
@@ -0,0 +1,30 @@
+/*
+------------------------------------------------------------------------------
+This code was generated by Amplication.
+
+Changes to this file will be lost if the code is regenerated.
+
+There are other ways to to customize your code, see this doc to learn more
+https://docs.amplication.com/how-to/custom-code
+
+------------------------------------------------------------------------------
+ */
+import { ArgsType, Field } from "@nestjs/graphql";
+import { ApiProperty } from "@nestjs/swagger";
+import { ParcelaWhereUniqueInput } from "./ParcelaWhereUniqueInput";
+import { ValidateNested } from "class-validator";
+import { Type } from "class-transformer";
+
+@ArgsType()
+class DeleteParcelaArgs {
+ @ApiProperty({
+ required: true,
+ type: () => ParcelaWhereUniqueInput,
+ })
+ @ValidateNested()
+ @Type(() => ParcelaWhereUniqueInput)
+ @Field(() => ParcelaWhereUniqueInput, { nullable: false })
+ where!: ParcelaWhereUniqueInput;
+}
+
+export { DeleteParcelaArgs as DeleteParcelaArgs };
diff --git a/apps/maestri-edu-server/src/parcela/base/Parcela.ts b/apps/maestri-edu-server/src/parcela/base/Parcela.ts
new file mode 100644
index 0000000..6a329f8
--- /dev/null
+++ b/apps/maestri-edu-server/src/parcela/base/Parcela.ts
@@ -0,0 +1,44 @@
+/*
+------------------------------------------------------------------------------
+This code was generated by Amplication.
+
+Changes to this file will be lost if the code is regenerated.
+
+There are other ways to to customize your code, see this doc to learn more
+https://docs.amplication.com/how-to/custom-code
+
+------------------------------------------------------------------------------
+ */
+import { ObjectType, Field } from "@nestjs/graphql";
+import { ApiProperty } from "@nestjs/swagger";
+import { IsDate, IsString } from "class-validator";
+import { Type } from "class-transformer";
+
+@ObjectType()
+class Parcela {
+ @ApiProperty({
+ required: true,
+ })
+ @IsDate()
+ @Type(() => Date)
+ @Field(() => Date)
+ createdAt!: Date;
+
+ @ApiProperty({
+ required: true,
+ type: String,
+ })
+ @IsString()
+ @Field(() => String)
+ id!: string;
+
+ @ApiProperty({
+ required: true,
+ })
+ @IsDate()
+ @Type(() => Date)
+ @Field(() => Date)
+ updatedAt!: Date;
+}
+
+export { Parcela as Parcela };
diff --git a/apps/maestri-edu-server/src/parcela/base/ParcelaCountArgs.ts b/apps/maestri-edu-server/src/parcela/base/ParcelaCountArgs.ts
new file mode 100644
index 0000000..3bc5298
--- /dev/null
+++ b/apps/maestri-edu-server/src/parcela/base/ParcelaCountArgs.ts
@@ -0,0 +1,28 @@
+/*
+------------------------------------------------------------------------------
+This code was generated by Amplication.
+
+Changes to this file will be lost if the code is regenerated.
+
+There are other ways to to customize your code, see this doc to learn more
+https://docs.amplication.com/how-to/custom-code
+
+------------------------------------------------------------------------------
+ */
+import { ArgsType, Field } from "@nestjs/graphql";
+import { ApiProperty } from "@nestjs/swagger";
+import { ParcelaWhereInput } from "./ParcelaWhereInput";
+import { Type } from "class-transformer";
+
+@ArgsType()
+class ParcelaCountArgs {
+ @ApiProperty({
+ required: false,
+ type: () => ParcelaWhereInput,
+ })
+ @Field(() => ParcelaWhereInput, { nullable: true })
+ @Type(() => ParcelaWhereInput)
+ where?: ParcelaWhereInput;
+}
+
+export { ParcelaCountArgs as ParcelaCountArgs };
diff --git a/apps/maestri-edu-server/src/parcela/base/ParcelaCreateInput.ts b/apps/maestri-edu-server/src/parcela/base/ParcelaCreateInput.ts
new file mode 100644
index 0000000..93e1757
--- /dev/null
+++ b/apps/maestri-edu-server/src/parcela/base/ParcelaCreateInput.ts
@@ -0,0 +1,13 @@
+/*
+------------------------------------------------------------------------------
+This code was generated by Amplication.
+
+Changes to this file will be lost if the code is regenerated.
+
+There are other ways to to customize your code, see this doc to learn more
+https://docs.amplication.com/how-to/custom-code
+
+------------------------------------------------------------------------------
+ */
+class ParcelaCreateInput {}
+export { ParcelaCreateInput as ParcelaCreateInput };
diff --git a/apps/maestri-edu-server/src/parcela/base/ParcelaFindManyArgs.ts b/apps/maestri-edu-server/src/parcela/base/ParcelaFindManyArgs.ts
new file mode 100644
index 0000000..6973b78
--- /dev/null
+++ b/apps/maestri-edu-server/src/parcela/base/ParcelaFindManyArgs.ts
@@ -0,0 +1,62 @@
+/*
+------------------------------------------------------------------------------
+This code was generated by Amplication.
+
+Changes to this file will be lost if the code is regenerated.
+
+There are other ways to to customize your code, see this doc to learn more
+https://docs.amplication.com/how-to/custom-code
+
+------------------------------------------------------------------------------
+ */
+import { ArgsType, Field } from "@nestjs/graphql";
+import { ApiProperty } from "@nestjs/swagger";
+import { ParcelaWhereInput } from "./ParcelaWhereInput";
+import { IsOptional, ValidateNested, IsInt } from "class-validator";
+import { Type } from "class-transformer";
+import { ParcelaOrderByInput } from "./ParcelaOrderByInput";
+
+@ArgsType()
+class ParcelaFindManyArgs {
+ @ApiProperty({
+ required: false,
+ type: () => ParcelaWhereInput,
+ })
+ @IsOptional()
+ @ValidateNested()
+ @Field(() => ParcelaWhereInput, { nullable: true })
+ @Type(() => ParcelaWhereInput)
+ where?: ParcelaWhereInput;
+
+ @ApiProperty({
+ required: false,
+ type: [ParcelaOrderByInput],
+ })
+ @IsOptional()
+ @ValidateNested({ each: true })
+ @Field(() => [ParcelaOrderByInput], { nullable: true })
+ @Type(() => ParcelaOrderByInput)
+ orderBy?: Array;
+
+ @ApiProperty({
+ required: false,
+ type: Number,
+ })
+ @IsOptional()
+ @IsInt()
+ @Field(() => Number, { nullable: true })
+ @Type(() => Number)
+ skip?: number;
+
+ @ApiProperty({
+ required: false,
+ type: Number,
+ })
+ @IsOptional()
+ @IsInt()
+ @Field(() => Number, { nullable: true })
+ @Type(() => Number)
+ take?: number;
+}
+
+export { ParcelaFindManyArgs as ParcelaFindManyArgs };
diff --git a/apps/maestri-edu-server/src/parcela/base/ParcelaFindUniqueArgs.ts b/apps/maestri-edu-server/src/parcela/base/ParcelaFindUniqueArgs.ts
new file mode 100644
index 0000000..64f86d6
--- /dev/null
+++ b/apps/maestri-edu-server/src/parcela/base/ParcelaFindUniqueArgs.ts
@@ -0,0 +1,30 @@
+/*
+------------------------------------------------------------------------------
+This code was generated by Amplication.
+
+Changes to this file will be lost if the code is regenerated.
+
+There are other ways to to customize your code, see this doc to learn more
+https://docs.amplication.com/how-to/custom-code
+
+------------------------------------------------------------------------------
+ */
+import { ArgsType, Field } from "@nestjs/graphql";
+import { ApiProperty } from "@nestjs/swagger";
+import { ParcelaWhereUniqueInput } from "./ParcelaWhereUniqueInput";
+import { ValidateNested } from "class-validator";
+import { Type } from "class-transformer";
+
+@ArgsType()
+class ParcelaFindUniqueArgs {
+ @ApiProperty({
+ required: true,
+ type: () => ParcelaWhereUniqueInput,
+ })
+ @ValidateNested()
+ @Type(() => ParcelaWhereUniqueInput)
+ @Field(() => ParcelaWhereUniqueInput, { nullable: false })
+ where!: ParcelaWhereUniqueInput;
+}
+
+export { ParcelaFindUniqueArgs as ParcelaFindUniqueArgs };
diff --git a/apps/maestri-edu-server/src/parcela/base/ParcelaListRelationFilter.ts b/apps/maestri-edu-server/src/parcela/base/ParcelaListRelationFilter.ts
new file mode 100644
index 0000000..9401c5d
--- /dev/null
+++ b/apps/maestri-edu-server/src/parcela/base/ParcelaListRelationFilter.ts
@@ -0,0 +1,56 @@
+/*
+------------------------------------------------------------------------------
+This code was generated by Amplication.
+
+Changes to this file will be lost if the code is regenerated.
+
+There are other ways to to customize your code, see this doc to learn more
+https://docs.amplication.com/how-to/custom-code
+
+------------------------------------------------------------------------------
+ */
+import { InputType, Field } from "@nestjs/graphql";
+import { ApiProperty } from "@nestjs/swagger";
+import { ParcelaWhereInput } from "./ParcelaWhereInput";
+import { ValidateNested, IsOptional } from "class-validator";
+import { Type } from "class-transformer";
+
+@InputType()
+class ParcelaListRelationFilter {
+ @ApiProperty({
+ required: false,
+ type: () => ParcelaWhereInput,
+ })
+ @ValidateNested()
+ @Type(() => ParcelaWhereInput)
+ @IsOptional()
+ @Field(() => ParcelaWhereInput, {
+ nullable: true,
+ })
+ every?: ParcelaWhereInput;
+
+ @ApiProperty({
+ required: false,
+ type: () => ParcelaWhereInput,
+ })
+ @ValidateNested()
+ @Type(() => ParcelaWhereInput)
+ @IsOptional()
+ @Field(() => ParcelaWhereInput, {
+ nullable: true,
+ })
+ some?: ParcelaWhereInput;
+
+ @ApiProperty({
+ required: false,
+ type: () => ParcelaWhereInput,
+ })
+ @ValidateNested()
+ @Type(() => ParcelaWhereInput)
+ @IsOptional()
+ @Field(() => ParcelaWhereInput, {
+ nullable: true,
+ })
+ none?: ParcelaWhereInput;
+}
+export { ParcelaListRelationFilter as ParcelaListRelationFilter };
diff --git a/apps/maestri-edu-server/src/parcela/base/ParcelaOrderByInput.ts b/apps/maestri-edu-server/src/parcela/base/ParcelaOrderByInput.ts
new file mode 100644
index 0000000..15ef7c5
--- /dev/null
+++ b/apps/maestri-edu-server/src/parcela/base/ParcelaOrderByInput.ts
@@ -0,0 +1,56 @@
+/*
+------------------------------------------------------------------------------
+This code was generated by Amplication.
+
+Changes to this file will be lost if the code is regenerated.
+
+There are other ways to to customize your code, see this doc to learn more
+https://docs.amplication.com/how-to/custom-code
+
+------------------------------------------------------------------------------
+ */
+import { InputType, Field } from "@nestjs/graphql";
+import { ApiProperty } from "@nestjs/swagger";
+import { IsOptional, IsEnum } from "class-validator";
+import { SortOrder } from "../../util/SortOrder";
+
+@InputType({
+ isAbstract: true,
+ description: undefined,
+})
+class ParcelaOrderByInput {
+ @ApiProperty({
+ required: false,
+ enum: ["asc", "desc"],
+ })
+ @IsOptional()
+ @IsEnum(SortOrder)
+ @Field(() => SortOrder, {
+ nullable: true,
+ })
+ createdAt?: SortOrder;
+
+ @ApiProperty({
+ required: false,
+ enum: ["asc", "desc"],
+ })
+ @IsOptional()
+ @IsEnum(SortOrder)
+ @Field(() => SortOrder, {
+ nullable: true,
+ })
+ id?: SortOrder;
+
+ @ApiProperty({
+ required: false,
+ enum: ["asc", "desc"],
+ })
+ @IsOptional()
+ @IsEnum(SortOrder)
+ @Field(() => SortOrder, {
+ nullable: true,
+ })
+ updatedAt?: SortOrder;
+}
+
+export { ParcelaOrderByInput as ParcelaOrderByInput };
diff --git a/apps/maestri-edu-server/src/parcela/base/ParcelaUpdateInput.ts b/apps/maestri-edu-server/src/parcela/base/ParcelaUpdateInput.ts
new file mode 100644
index 0000000..f23299c
--- /dev/null
+++ b/apps/maestri-edu-server/src/parcela/base/ParcelaUpdateInput.ts
@@ -0,0 +1,13 @@
+/*
+------------------------------------------------------------------------------
+This code was generated by Amplication.
+
+Changes to this file will be lost if the code is regenerated.
+
+There are other ways to to customize your code, see this doc to learn more
+https://docs.amplication.com/how-to/custom-code
+
+------------------------------------------------------------------------------
+ */
+class ParcelaUpdateInput {}
+export { ParcelaUpdateInput as ParcelaUpdateInput };
diff --git a/apps/maestri-edu-server/src/parcela/base/ParcelaWhereInput.ts b/apps/maestri-edu-server/src/parcela/base/ParcelaWhereInput.ts
new file mode 100644
index 0000000..a0436e5
--- /dev/null
+++ b/apps/maestri-edu-server/src/parcela/base/ParcelaWhereInput.ts
@@ -0,0 +1,32 @@
+/*
+------------------------------------------------------------------------------
+This code was generated by Amplication.
+
+Changes to this file will be lost if the code is regenerated.
+
+There are other ways to to customize your code, see this doc to learn more
+https://docs.amplication.com/how-to/custom-code
+
+------------------------------------------------------------------------------
+ */
+import { InputType, Field } from "@nestjs/graphql";
+import { ApiProperty } from "@nestjs/swagger";
+import { StringFilter } from "../../util/StringFilter";
+import { Type } from "class-transformer";
+import { IsOptional } from "class-validator";
+
+@InputType()
+class ParcelaWhereInput {
+ @ApiProperty({
+ required: false,
+ type: StringFilter,
+ })
+ @Type(() => StringFilter)
+ @IsOptional()
+ @Field(() => StringFilter, {
+ nullable: true,
+ })
+ id?: StringFilter;
+}
+
+export { ParcelaWhereInput as ParcelaWhereInput };
diff --git a/apps/maestri-edu-server/src/parcela/base/ParcelaWhereUniqueInput.ts b/apps/maestri-edu-server/src/parcela/base/ParcelaWhereUniqueInput.ts
new file mode 100644
index 0000000..9bff4a2
--- /dev/null
+++ b/apps/maestri-edu-server/src/parcela/base/ParcelaWhereUniqueInput.ts
@@ -0,0 +1,27 @@
+/*
+------------------------------------------------------------------------------
+This code was generated by Amplication.
+
+Changes to this file will be lost if the code is regenerated.
+
+There are other ways to to customize your code, see this doc to learn more
+https://docs.amplication.com/how-to/custom-code
+
+------------------------------------------------------------------------------
+ */
+import { InputType, Field } from "@nestjs/graphql";
+import { ApiProperty } from "@nestjs/swagger";
+import { IsString } from "class-validator";
+
+@InputType()
+class ParcelaWhereUniqueInput {
+ @ApiProperty({
+ required: true,
+ type: String,
+ })
+ @IsString()
+ @Field(() => String)
+ id!: string;
+}
+
+export { ParcelaWhereUniqueInput as ParcelaWhereUniqueInput };
diff --git a/apps/maestri-edu-server/src/parcela/base/parcela.controller.base.spec.ts b/apps/maestri-edu-server/src/parcela/base/parcela.controller.base.spec.ts
new file mode 100644
index 0000000..71597c7
--- /dev/null
+++ b/apps/maestri-edu-server/src/parcela/base/parcela.controller.base.spec.ts
@@ -0,0 +1,190 @@
+import { Test } from "@nestjs/testing";
+import {
+ INestApplication,
+ HttpStatus,
+ ExecutionContext,
+ CallHandler,
+} from "@nestjs/common";
+import request from "supertest";
+import { ACGuard } from "nest-access-control";
+import { DefaultAuthGuard } from "../../auth/defaultAuth.guard";
+import { ACLModule } from "../../auth/acl.module";
+import { AclFilterResponseInterceptor } from "../../interceptors/aclFilterResponse.interceptor";
+import { AclValidateRequestInterceptor } from "../../interceptors/aclValidateRequest.interceptor";
+import { map } from "rxjs";
+import { ParcelaController } from "../parcela.controller";
+import { ParcelaService } from "../parcela.service";
+
+const nonExistingId = "nonExistingId";
+const existingId = "existingId";
+const CREATE_INPUT = {
+ createdAt: new Date(),
+ id: "exampleId",
+ updatedAt: new Date(),
+};
+const CREATE_RESULT = {
+ createdAt: new Date(),
+ id: "exampleId",
+ updatedAt: new Date(),
+};
+const FIND_MANY_RESULT = [
+ {
+ createdAt: new Date(),
+ id: "exampleId",
+ updatedAt: new Date(),
+ },
+];
+const FIND_ONE_RESULT = {
+ createdAt: new Date(),
+ id: "exampleId",
+ updatedAt: new Date(),
+};
+
+const service = {
+ createParcela() {
+ return CREATE_RESULT;
+ },
+ parcelas: () => FIND_MANY_RESULT,
+ parcela: ({ where }: { where: { id: string } }) => {
+ switch (where.id) {
+ case existingId:
+ return FIND_ONE_RESULT;
+ case nonExistingId:
+ return null;
+ }
+ },
+};
+
+const basicAuthGuard = {
+ canActivate: (context: ExecutionContext) => {
+ const argumentHost = context.switchToHttp();
+ const request = argumentHost.getRequest();
+ request.user = {
+ roles: ["user"],
+ };
+ return true;
+ },
+};
+
+const acGuard = {
+ canActivate: () => {
+ return true;
+ },
+};
+
+const aclFilterResponseInterceptor = {
+ intercept: (context: ExecutionContext, next: CallHandler) => {
+ return next.handle().pipe(
+ map((data) => {
+ return data;
+ })
+ );
+ },
+};
+const aclValidateRequestInterceptor = {
+ intercept: (context: ExecutionContext, next: CallHandler) => {
+ return next.handle();
+ },
+};
+
+describe("Parcela", () => {
+ let app: INestApplication;
+
+ beforeAll(async () => {
+ const moduleRef = await Test.createTestingModule({
+ providers: [
+ {
+ provide: ParcelaService,
+ useValue: service,
+ },
+ ],
+ controllers: [ParcelaController],
+ imports: [ACLModule],
+ })
+ .overrideGuard(DefaultAuthGuard)
+ .useValue(basicAuthGuard)
+ .overrideGuard(ACGuard)
+ .useValue(acGuard)
+ .overrideInterceptor(AclFilterResponseInterceptor)
+ .useValue(aclFilterResponseInterceptor)
+ .overrideInterceptor(AclValidateRequestInterceptor)
+ .useValue(aclValidateRequestInterceptor)
+ .compile();
+
+ app = moduleRef.createNestApplication();
+ await app.init();
+ });
+
+ test("POST /parcelas", async () => {
+ await request(app.getHttpServer())
+ .post("/parcelas")
+ .send(CREATE_INPUT)
+ .expect(HttpStatus.CREATED)
+ .expect({
+ ...CREATE_RESULT,
+ createdAt: CREATE_RESULT.createdAt.toISOString(),
+ updatedAt: CREATE_RESULT.updatedAt.toISOString(),
+ });
+ });
+
+ test("GET /parcelas", async () => {
+ await request(app.getHttpServer())
+ .get("/parcelas")
+ .expect(HttpStatus.OK)
+ .expect([
+ {
+ ...FIND_MANY_RESULT[0],
+ createdAt: FIND_MANY_RESULT[0].createdAt.toISOString(),
+ updatedAt: FIND_MANY_RESULT[0].updatedAt.toISOString(),
+ },
+ ]);
+ });
+
+ test("GET /parcelas/:id non existing", async () => {
+ await request(app.getHttpServer())
+ .get(`${"/parcelas"}/${nonExistingId}`)
+ .expect(HttpStatus.NOT_FOUND)
+ .expect({
+ statusCode: HttpStatus.NOT_FOUND,
+ message: `No resource was found for {"${"id"}":"${nonExistingId}"}`,
+ error: "Not Found",
+ });
+ });
+
+ test("GET /parcelas/:id existing", async () => {
+ await request(app.getHttpServer())
+ .get(`${"/parcelas"}/${existingId}`)
+ .expect(HttpStatus.OK)
+ .expect({
+ ...FIND_ONE_RESULT,
+ createdAt: FIND_ONE_RESULT.createdAt.toISOString(),
+ updatedAt: FIND_ONE_RESULT.updatedAt.toISOString(),
+ });
+ });
+
+ test("POST /parcelas existing resource", async () => {
+ const agent = request(app.getHttpServer());
+ await agent
+ .post("/parcelas")
+ .send(CREATE_INPUT)
+ .expect(HttpStatus.CREATED)
+ .expect({
+ ...CREATE_RESULT,
+ createdAt: CREATE_RESULT.createdAt.toISOString(),
+ updatedAt: CREATE_RESULT.updatedAt.toISOString(),
+ })
+ .then(function () {
+ agent
+ .post("/parcelas")
+ .send(CREATE_INPUT)
+ .expect(HttpStatus.CONFLICT)
+ .expect({
+ statusCode: HttpStatus.CONFLICT,
+ });
+ });
+ });
+
+ afterAll(async () => {
+ await app.close();
+ });
+});
diff --git a/apps/maestri-edu-server/src/parcela/base/parcela.controller.base.ts b/apps/maestri-edu-server/src/parcela/base/parcela.controller.base.ts
new file mode 100644
index 0000000..0bb1f3b
--- /dev/null
+++ b/apps/maestri-edu-server/src/parcela/base/parcela.controller.base.ts
@@ -0,0 +1,131 @@
+/*
+------------------------------------------------------------------------------
+This code was generated by Amplication.
+
+Changes to this file will be lost if the code is regenerated.
+
+There are other ways to to customize your code, see this doc to learn more
+https://docs.amplication.com/how-to/custom-code
+
+------------------------------------------------------------------------------
+ */
+import * as common from "@nestjs/common";
+import * as swagger from "@nestjs/swagger";
+import { isRecordNotFoundError } from "../../prisma.util";
+import * as errors from "../../errors";
+import { Request } from "express";
+import { plainToClass } from "class-transformer";
+import { ApiNestedQuery } from "../../decorators/api-nested-query.decorator";
+import { ParcelaService } from "../parcela.service";
+import { ParcelaCreateInput } from "./ParcelaCreateInput";
+import { Parcela } from "./Parcela";
+import { ParcelaFindManyArgs } from "./ParcelaFindManyArgs";
+import { ParcelaWhereUniqueInput } from "./ParcelaWhereUniqueInput";
+import { ParcelaUpdateInput } from "./ParcelaUpdateInput";
+
+export class ParcelaControllerBase {
+ constructor(protected readonly service: ParcelaService) {}
+ @common.Post()
+ @swagger.ApiCreatedResponse({ type: Parcela })
+ async createParcela(
+ @common.Body() data: ParcelaCreateInput
+ ): Promise {
+ return await this.service.createParcela({
+ data: data,
+ select: {
+ createdAt: true,
+ id: true,
+ updatedAt: true,
+ },
+ });
+ }
+
+ @common.Get()
+ @swagger.ApiOkResponse({ type: [Parcela] })
+ @ApiNestedQuery(ParcelaFindManyArgs)
+ async parcelas(@common.Req() request: Request): Promise {
+ const args = plainToClass(ParcelaFindManyArgs, request.query);
+ return this.service.parcelas({
+ ...args,
+ select: {
+ createdAt: true,
+ id: true,
+ updatedAt: true,
+ },
+ });
+ }
+
+ @common.Get("/:id")
+ @swagger.ApiOkResponse({ type: Parcela })
+ @swagger.ApiNotFoundResponse({ type: errors.NotFoundException })
+ async parcela(
+ @common.Param() params: ParcelaWhereUniqueInput
+ ): Promise {
+ const result = await this.service.parcela({
+ where: params,
+ select: {
+ createdAt: true,
+ id: true,
+ updatedAt: true,
+ },
+ });
+ if (result === null) {
+ throw new errors.NotFoundException(
+ `No resource was found for ${JSON.stringify(params)}`
+ );
+ }
+ return result;
+ }
+
+ @common.Patch("/:id")
+ @swagger.ApiOkResponse({ type: Parcela })
+ @swagger.ApiNotFoundResponse({ type: errors.NotFoundException })
+ async updateParcela(
+ @common.Param() params: ParcelaWhereUniqueInput,
+ @common.Body() data: ParcelaUpdateInput
+ ): Promise {
+ try {
+ return await this.service.updateParcela({
+ where: params,
+ data: data,
+ select: {
+ createdAt: true,
+ id: true,
+ updatedAt: true,
+ },
+ });
+ } catch (error) {
+ if (isRecordNotFoundError(error)) {
+ throw new errors.NotFoundException(
+ `No resource was found for ${JSON.stringify(params)}`
+ );
+ }
+ throw error;
+ }
+ }
+
+ @common.Delete("/:id")
+ @swagger.ApiOkResponse({ type: Parcela })
+ @swagger.ApiNotFoundResponse({ type: errors.NotFoundException })
+ async deleteParcela(
+ @common.Param() params: ParcelaWhereUniqueInput
+ ): Promise {
+ try {
+ return await this.service.deleteParcela({
+ where: params,
+ select: {
+ createdAt: true,
+ id: true,
+ updatedAt: true,
+ },
+ });
+ } catch (error) {
+ if (isRecordNotFoundError(error)) {
+ throw new errors.NotFoundException(
+ `No resource was found for ${JSON.stringify(params)}`
+ );
+ }
+ throw error;
+ }
+ }
+}
diff --git a/apps/maestri-edu-server/src/parcela/base/parcela.module.base.ts b/apps/maestri-edu-server/src/parcela/base/parcela.module.base.ts
new file mode 100644
index 0000000..89a3e33
--- /dev/null
+++ b/apps/maestri-edu-server/src/parcela/base/parcela.module.base.ts
@@ -0,0 +1,18 @@
+/*
+------------------------------------------------------------------------------
+This code was generated by Amplication.
+
+Changes to this file will be lost if the code is regenerated.
+
+There are other ways to to customize your code, see this doc to learn more
+https://docs.amplication.com/how-to/custom-code
+
+------------------------------------------------------------------------------
+ */
+import { Module } from "@nestjs/common";
+
+@Module({
+ imports: [],
+ exports: [],
+})
+export class ParcelaModuleBase {}
diff --git a/apps/maestri-edu-server/src/parcela/base/parcela.resolver.base.ts b/apps/maestri-edu-server/src/parcela/base/parcela.resolver.base.ts
new file mode 100644
index 0000000..15ea6e4
--- /dev/null
+++ b/apps/maestri-edu-server/src/parcela/base/parcela.resolver.base.ts
@@ -0,0 +1,68 @@
+/*
+------------------------------------------------------------------------------
+This code was generated by Amplication.
+
+Changes to this file will be lost if the code is regenerated.
+
+There are other ways to to customize your code, see this doc to learn more
+https://docs.amplication.com/how-to/custom-code
+
+------------------------------------------------------------------------------
+ */
+import * as graphql from "@nestjs/graphql";
+import { GraphQLError } from "graphql";
+import { isRecordNotFoundError } from "../../prisma.util";
+import { MetaQueryPayload } from "../../util/MetaQueryPayload";
+import { Parcela } from "./Parcela";
+import { ParcelaCountArgs } from "./ParcelaCountArgs";
+import { ParcelaFindManyArgs } from "./ParcelaFindManyArgs";
+import { ParcelaFindUniqueArgs } from "./ParcelaFindUniqueArgs";
+import { DeleteParcelaArgs } from "./DeleteParcelaArgs";
+import { ParcelaService } from "../parcela.service";
+@graphql.Resolver(() => Parcela)
+export class ParcelaResolverBase {
+ constructor(protected readonly service: ParcelaService) {}
+
+ async _parcelasMeta(
+ @graphql.Args() args: ParcelaCountArgs
+ ): Promise {
+ const result = await this.service.count(args);
+ return {
+ count: result,
+ };
+ }
+
+ @graphql.Query(() => [Parcela])
+ async parcelas(
+ @graphql.Args() args: ParcelaFindManyArgs
+ ): Promise {
+ return this.service.parcelas(args);
+ }
+
+ @graphql.Query(() => Parcela, { nullable: true })
+ async parcela(
+ @graphql.Args() args: ParcelaFindUniqueArgs
+ ): Promise {
+ const result = await this.service.parcela(args);
+ if (result === null) {
+ return null;
+ }
+ return result;
+ }
+
+ @graphql.Mutation(() => Parcela)
+ async deleteParcela(
+ @graphql.Args() args: DeleteParcelaArgs
+ ): Promise {
+ try {
+ return await this.service.deleteParcela(args);
+ } catch (error) {
+ if (isRecordNotFoundError(error)) {
+ throw new GraphQLError(
+ `No resource was found for ${JSON.stringify(args.where)}`
+ );
+ }
+ throw error;
+ }
+ }
+}
diff --git a/apps/maestri-edu-server/src/parcela/base/parcela.service.base.ts b/apps/maestri-edu-server/src/parcela/base/parcela.service.base.ts
new file mode 100644
index 0000000..ff72354
--- /dev/null
+++ b/apps/maestri-edu-server/src/parcela/base/parcela.service.base.ts
@@ -0,0 +1,39 @@
+/*
+------------------------------------------------------------------------------
+This code was generated by Amplication.
+
+Changes to this file will be lost if the code is regenerated.
+
+There are other ways to to customize your code, see this doc to learn more
+https://docs.amplication.com/how-to/custom-code
+
+------------------------------------------------------------------------------
+ */
+import { PrismaService } from "../../prisma/prisma.service";
+import { Prisma, Parcela as PrismaParcela } from "@prisma/client";
+
+export class ParcelaServiceBase {
+ constructor(protected readonly prisma: PrismaService) {}
+
+ async count(args: Omit): Promise {
+ return this.prisma.parcela.count(args);
+ }
+
+ async parcelas(args: Prisma.ParcelaFindManyArgs): Promise {
+ return this.prisma.parcela.findMany(args);
+ }
+ async parcela(
+ args: Prisma.ParcelaFindUniqueArgs
+ ): Promise {
+ return this.prisma.parcela.findUnique(args);
+ }
+ async createParcela(args: Prisma.ParcelaCreateArgs): Promise {
+ return this.prisma.parcela.create(args);
+ }
+ async updateParcela(args: Prisma.ParcelaUpdateArgs): Promise {
+ return this.prisma.parcela.update(args);
+ }
+ async deleteParcela(args: Prisma.ParcelaDeleteArgs): Promise {
+ return this.prisma.parcela.delete(args);
+ }
+}
diff --git a/apps/maestri-edu-server/src/parcela/parcela.controller.ts b/apps/maestri-edu-server/src/parcela/parcela.controller.ts
new file mode 100644
index 0000000..9cf29cf
--- /dev/null
+++ b/apps/maestri-edu-server/src/parcela/parcela.controller.ts
@@ -0,0 +1,12 @@
+import * as common from "@nestjs/common";
+import * as swagger from "@nestjs/swagger";
+import { ParcelaService } from "./parcela.service";
+import { ParcelaControllerBase } from "./base/parcela.controller.base";
+
+@swagger.ApiTags("parcelas")
+@common.Controller("parcelas")
+export class ParcelaController extends ParcelaControllerBase {
+ constructor(protected readonly service: ParcelaService) {
+ super(service);
+ }
+}
diff --git a/apps/maestri-edu-server/src/parcela/parcela.module.ts b/apps/maestri-edu-server/src/parcela/parcela.module.ts
new file mode 100644
index 0000000..8a53552
--- /dev/null
+++ b/apps/maestri-edu-server/src/parcela/parcela.module.ts
@@ -0,0 +1,13 @@
+import { Module } from "@nestjs/common";
+import { ParcelaModuleBase } from "./base/parcela.module.base";
+import { ParcelaService } from "./parcela.service";
+import { ParcelaController } from "./parcela.controller";
+import { ParcelaResolver } from "./parcela.resolver";
+
+@Module({
+ imports: [ParcelaModuleBase],
+ controllers: [ParcelaController],
+ providers: [ParcelaService, ParcelaResolver],
+ exports: [ParcelaService],
+})
+export class ParcelaModule {}
diff --git a/apps/maestri-edu-server/src/parcela/parcela.resolver.ts b/apps/maestri-edu-server/src/parcela/parcela.resolver.ts
new file mode 100644
index 0000000..d1d296f
--- /dev/null
+++ b/apps/maestri-edu-server/src/parcela/parcela.resolver.ts
@@ -0,0 +1,11 @@
+import * as graphql from "@nestjs/graphql";
+import { ParcelaResolverBase } from "./base/parcela.resolver.base";
+import { Parcela } from "./base/Parcela";
+import { ParcelaService } from "./parcela.service";
+
+@graphql.Resolver(() => Parcela)
+export class ParcelaResolver extends ParcelaResolverBase {
+ constructor(protected readonly service: ParcelaService) {
+ super(service);
+ }
+}
diff --git a/apps/maestri-edu-server/src/parcela/parcela.service.ts b/apps/maestri-edu-server/src/parcela/parcela.service.ts
new file mode 100644
index 0000000..a55046c
--- /dev/null
+++ b/apps/maestri-edu-server/src/parcela/parcela.service.ts
@@ -0,0 +1,10 @@
+import { Injectable } from "@nestjs/common";
+import { PrismaService } from "../prisma/prisma.service";
+import { ParcelaServiceBase } from "./base/parcela.service.base";
+
+@Injectable()
+export class ParcelaService extends ParcelaServiceBase {
+ constructor(protected readonly prisma: PrismaService) {
+ super(prisma);
+ }
+}
diff --git a/apps/maestri-edu-server/src/perfil/base/CreatePerfilArgs.ts b/apps/maestri-edu-server/src/perfil/base/CreatePerfilArgs.ts
new file mode 100644
index 0000000..69c44fa
--- /dev/null
+++ b/apps/maestri-edu-server/src/perfil/base/CreatePerfilArgs.ts
@@ -0,0 +1,30 @@
+/*
+------------------------------------------------------------------------------
+This code was generated by Amplication.
+
+Changes to this file will be lost if the code is regenerated.
+
+There are other ways to to customize your code, see this doc to learn more
+https://docs.amplication.com/how-to/custom-code
+
+------------------------------------------------------------------------------
+ */
+import { ArgsType, Field } from "@nestjs/graphql";
+import { ApiProperty } from "@nestjs/swagger";
+import { PerfilCreateInput } from "./PerfilCreateInput";
+import { ValidateNested } from "class-validator";
+import { Type } from "class-transformer";
+
+@ArgsType()
+class CreatePerfilArgs {
+ @ApiProperty({
+ required: true,
+ type: () => PerfilCreateInput,
+ })
+ @ValidateNested()
+ @Type(() => PerfilCreateInput)
+ @Field(() => PerfilCreateInput, { nullable: false })
+ data!: PerfilCreateInput;
+}
+
+export { CreatePerfilArgs as CreatePerfilArgs };
diff --git a/apps/maestri-edu-server/src/perfil/base/DeletePerfilArgs.ts b/apps/maestri-edu-server/src/perfil/base/DeletePerfilArgs.ts
new file mode 100644
index 0000000..53c98bd
--- /dev/null
+++ b/apps/maestri-edu-server/src/perfil/base/DeletePerfilArgs.ts
@@ -0,0 +1,30 @@
+/*
+------------------------------------------------------------------------------
+This code was generated by Amplication.
+
+Changes to this file will be lost if the code is regenerated.
+
+There are other ways to to customize your code, see this doc to learn more
+https://docs.amplication.com/how-to/custom-code
+
+------------------------------------------------------------------------------
+ */
+import { ArgsType, Field } from "@nestjs/graphql";
+import { ApiProperty } from "@nestjs/swagger";
+import { PerfilWhereUniqueInput } from "./PerfilWhereUniqueInput";
+import { ValidateNested } from "class-validator";
+import { Type } from "class-transformer";
+
+@ArgsType()
+class DeletePerfilArgs {
+ @ApiProperty({
+ required: true,
+ type: () => PerfilWhereUniqueInput,
+ })
+ @ValidateNested()
+ @Type(() => PerfilWhereUniqueInput)
+ @Field(() => PerfilWhereUniqueInput, { nullable: false })
+ where!: PerfilWhereUniqueInput;
+}
+
+export { DeletePerfilArgs as DeletePerfilArgs };
diff --git a/apps/maestri-edu-server/src/perfil/base/Perfil.ts b/apps/maestri-edu-server/src/perfil/base/Perfil.ts
new file mode 100644
index 0000000..83307be
--- /dev/null
+++ b/apps/maestri-edu-server/src/perfil/base/Perfil.ts
@@ -0,0 +1,68 @@
+/*
+------------------------------------------------------------------------------
+This code was generated by Amplication.
+
+Changes to this file will be lost if the code is regenerated.
+
+There are other ways to to customize your code, see this doc to learn more
+https://docs.amplication.com/how-to/custom-code
+
+------------------------------------------------------------------------------
+ */
+import { ObjectType, Field } from "@nestjs/graphql";
+import { ApiProperty } from "@nestjs/swagger";
+import { IsString, MaxLength, IsOptional, IsDate } from "class-validator";
+import { Type } from "class-transformer";
+
+@ObjectType()
+class Perfil {
+ @ApiProperty({
+ required: false,
+ type: String,
+ })
+ @IsString()
+ @MaxLength(1000)
+ @IsOptional()
+ @Field(() => String, {
+ nullable: true,
+ })
+ cpf!: string | null;
+
+ @ApiProperty({
+ required: true,
+ })
+ @IsDate()
+ @Type(() => Date)
+ @Field(() => Date)
+ createdAt!: Date;
+
+ @ApiProperty({
+ required: true,
+ type: String,
+ })
+ @IsString()
+ @Field(() => String)
+ id!: string;
+
+ @ApiProperty({
+ required: false,
+ type: String,
+ })
+ @IsString()
+ @MaxLength(1000)
+ @IsOptional()
+ @Field(() => String, {
+ nullable: true,
+ })
+ numeroCelular!: string | null;
+
+ @ApiProperty({
+ required: true,
+ })
+ @IsDate()
+ @Type(() => Date)
+ @Field(() => Date)
+ updatedAt!: Date;
+}
+
+export { Perfil as Perfil };
diff --git a/apps/maestri-edu-server/src/perfil/base/PerfilCountArgs.ts b/apps/maestri-edu-server/src/perfil/base/PerfilCountArgs.ts
new file mode 100644
index 0000000..b6f357b
--- /dev/null
+++ b/apps/maestri-edu-server/src/perfil/base/PerfilCountArgs.ts
@@ -0,0 +1,28 @@
+/*
+------------------------------------------------------------------------------
+This code was generated by Amplication.
+
+Changes to this file will be lost if the code is regenerated.
+
+There are other ways to to customize your code, see this doc to learn more
+https://docs.amplication.com/how-to/custom-code
+
+------------------------------------------------------------------------------
+ */
+import { ArgsType, Field } from "@nestjs/graphql";
+import { ApiProperty } from "@nestjs/swagger";
+import { PerfilWhereInput } from "./PerfilWhereInput";
+import { Type } from "class-transformer";
+
+@ArgsType()
+class PerfilCountArgs {
+ @ApiProperty({
+ required: false,
+ type: () => PerfilWhereInput,
+ })
+ @Field(() => PerfilWhereInput, { nullable: true })
+ @Type(() => PerfilWhereInput)
+ where?: PerfilWhereInput;
+}
+
+export { PerfilCountArgs as PerfilCountArgs };
diff --git a/apps/maestri-edu-server/src/perfil/base/PerfilCreateInput.ts b/apps/maestri-edu-server/src/perfil/base/PerfilCreateInput.ts
new file mode 100644
index 0000000..bb88c0e
--- /dev/null
+++ b/apps/maestri-edu-server/src/perfil/base/PerfilCreateInput.ts
@@ -0,0 +1,43 @@
+/*
+------------------------------------------------------------------------------
+This code was generated by Amplication.
+
+Changes to this file will be lost if the code is regenerated.
+
+There are other ways to to customize your code, see this doc to learn more
+https://docs.amplication.com/how-to/custom-code
+
+------------------------------------------------------------------------------
+ */
+import { InputType, Field } from "@nestjs/graphql";
+import { ApiProperty } from "@nestjs/swagger";
+import { IsString, MaxLength, IsOptional } from "class-validator";
+
+@InputType()
+class PerfilCreateInput {
+ @ApiProperty({
+ required: false,
+ type: String,
+ })
+ @IsString()
+ @MaxLength(1000)
+ @IsOptional()
+ @Field(() => String, {
+ nullable: true,
+ })
+ cpf?: string | null;
+
+ @ApiProperty({
+ required: false,
+ type: String,
+ })
+ @IsString()
+ @MaxLength(1000)
+ @IsOptional()
+ @Field(() => String, {
+ nullable: true,
+ })
+ numeroCelular?: string | null;
+}
+
+export { PerfilCreateInput as PerfilCreateInput };
diff --git a/apps/maestri-edu-server/src/perfil/base/PerfilFindManyArgs.ts b/apps/maestri-edu-server/src/perfil/base/PerfilFindManyArgs.ts
new file mode 100644
index 0000000..2277033
--- /dev/null
+++ b/apps/maestri-edu-server/src/perfil/base/PerfilFindManyArgs.ts
@@ -0,0 +1,62 @@
+/*
+------------------------------------------------------------------------------
+This code was generated by Amplication.
+
+Changes to this file will be lost if the code is regenerated.
+
+There are other ways to to customize your code, see this doc to learn more
+https://docs.amplication.com/how-to/custom-code
+
+------------------------------------------------------------------------------
+ */
+import { ArgsType, Field } from "@nestjs/graphql";
+import { ApiProperty } from "@nestjs/swagger";
+import { PerfilWhereInput } from "./PerfilWhereInput";
+import { IsOptional, ValidateNested, IsInt } from "class-validator";
+import { Type } from "class-transformer";
+import { PerfilOrderByInput } from "./PerfilOrderByInput";
+
+@ArgsType()
+class PerfilFindManyArgs {
+ @ApiProperty({
+ required: false,
+ type: () => PerfilWhereInput,
+ })
+ @IsOptional()
+ @ValidateNested()
+ @Field(() => PerfilWhereInput, { nullable: true })
+ @Type(() => PerfilWhereInput)
+ where?: PerfilWhereInput;
+
+ @ApiProperty({
+ required: false,
+ type: [PerfilOrderByInput],
+ })
+ @IsOptional()
+ @ValidateNested({ each: true })
+ @Field(() => [PerfilOrderByInput], { nullable: true })
+ @Type(() => PerfilOrderByInput)
+ orderBy?: Array;
+
+ @ApiProperty({
+ required: false,
+ type: Number,
+ })
+ @IsOptional()
+ @IsInt()
+ @Field(() => Number, { nullable: true })
+ @Type(() => Number)
+ skip?: number;
+
+ @ApiProperty({
+ required: false,
+ type: Number,
+ })
+ @IsOptional()
+ @IsInt()
+ @Field(() => Number, { nullable: true })
+ @Type(() => Number)
+ take?: number;
+}
+
+export { PerfilFindManyArgs as PerfilFindManyArgs };
diff --git a/apps/maestri-edu-server/src/perfil/base/PerfilFindUniqueArgs.ts b/apps/maestri-edu-server/src/perfil/base/PerfilFindUniqueArgs.ts
new file mode 100644
index 0000000..31f7054
--- /dev/null
+++ b/apps/maestri-edu-server/src/perfil/base/PerfilFindUniqueArgs.ts
@@ -0,0 +1,30 @@
+/*
+------------------------------------------------------------------------------
+This code was generated by Amplication.
+
+Changes to this file will be lost if the code is regenerated.
+
+There are other ways to to customize your code, see this doc to learn more
+https://docs.amplication.com/how-to/custom-code
+
+------------------------------------------------------------------------------
+ */
+import { ArgsType, Field } from "@nestjs/graphql";
+import { ApiProperty } from "@nestjs/swagger";
+import { PerfilWhereUniqueInput } from "./PerfilWhereUniqueInput";
+import { ValidateNested } from "class-validator";
+import { Type } from "class-transformer";
+
+@ArgsType()
+class PerfilFindUniqueArgs {
+ @ApiProperty({
+ required: true,
+ type: () => PerfilWhereUniqueInput,
+ })
+ @ValidateNested()
+ @Type(() => PerfilWhereUniqueInput)
+ @Field(() => PerfilWhereUniqueInput, { nullable: false })
+ where!: PerfilWhereUniqueInput;
+}
+
+export { PerfilFindUniqueArgs as PerfilFindUniqueArgs };
diff --git a/apps/maestri-edu-server/src/perfil/base/PerfilListRelationFilter.ts b/apps/maestri-edu-server/src/perfil/base/PerfilListRelationFilter.ts
new file mode 100644
index 0000000..62d0837
--- /dev/null
+++ b/apps/maestri-edu-server/src/perfil/base/PerfilListRelationFilter.ts
@@ -0,0 +1,56 @@
+/*
+------------------------------------------------------------------------------
+This code was generated by Amplication.
+
+Changes to this file will be lost if the code is regenerated.
+
+There are other ways to to customize your code, see this doc to learn more
+https://docs.amplication.com/how-to/custom-code
+
+------------------------------------------------------------------------------
+ */
+import { InputType, Field } from "@nestjs/graphql";
+import { ApiProperty } from "@nestjs/swagger";
+import { PerfilWhereInput } from "./PerfilWhereInput";
+import { ValidateNested, IsOptional } from "class-validator";
+import { Type } from "class-transformer";
+
+@InputType()
+class PerfilListRelationFilter {
+ @ApiProperty({
+ required: false,
+ type: () => PerfilWhereInput,
+ })
+ @ValidateNested()
+ @Type(() => PerfilWhereInput)
+ @IsOptional()
+ @Field(() => PerfilWhereInput, {
+ nullable: true,
+ })
+ every?: PerfilWhereInput;
+
+ @ApiProperty({
+ required: false,
+ type: () => PerfilWhereInput,
+ })
+ @ValidateNested()
+ @Type(() => PerfilWhereInput)
+ @IsOptional()
+ @Field(() => PerfilWhereInput, {
+ nullable: true,
+ })
+ some?: PerfilWhereInput;
+
+ @ApiProperty({
+ required: false,
+ type: () => PerfilWhereInput,
+ })
+ @ValidateNested()
+ @Type(() => PerfilWhereInput)
+ @IsOptional()
+ @Field(() => PerfilWhereInput, {
+ nullable: true,
+ })
+ none?: PerfilWhereInput;
+}
+export { PerfilListRelationFilter as PerfilListRelationFilter };
diff --git a/apps/maestri-edu-server/src/perfil/base/PerfilOrderByInput.ts b/apps/maestri-edu-server/src/perfil/base/PerfilOrderByInput.ts
new file mode 100644
index 0000000..a4886fe
--- /dev/null
+++ b/apps/maestri-edu-server/src/perfil/base/PerfilOrderByInput.ts
@@ -0,0 +1,78 @@
+/*
+------------------------------------------------------------------------------
+This code was generated by Amplication.
+
+Changes to this file will be lost if the code is regenerated.
+
+There are other ways to to customize your code, see this doc to learn more
+https://docs.amplication.com/how-to/custom-code
+
+------------------------------------------------------------------------------
+ */
+import { InputType, Field } from "@nestjs/graphql";
+import { ApiProperty } from "@nestjs/swagger";
+import { IsOptional, IsEnum } from "class-validator";
+import { SortOrder } from "../../util/SortOrder";
+
+@InputType({
+ isAbstract: true,
+ description: undefined,
+})
+class PerfilOrderByInput {
+ @ApiProperty({
+ required: false,
+ enum: ["asc", "desc"],
+ })
+ @IsOptional()
+ @IsEnum(SortOrder)
+ @Field(() => SortOrder, {
+ nullable: true,
+ })
+ cpf?: SortOrder;
+
+ @ApiProperty({
+ required: false,
+ enum: ["asc", "desc"],
+ })
+ @IsOptional()
+ @IsEnum(SortOrder)
+ @Field(() => SortOrder, {
+ nullable: true,
+ })
+ createdAt?: SortOrder;
+
+ @ApiProperty({
+ required: false,
+ enum: ["asc", "desc"],
+ })
+ @IsOptional()
+ @IsEnum(SortOrder)
+ @Field(() => SortOrder, {
+ nullable: true,
+ })
+ id?: SortOrder;
+
+ @ApiProperty({
+ required: false,
+ enum: ["asc", "desc"],
+ })
+ @IsOptional()
+ @IsEnum(SortOrder)
+ @Field(() => SortOrder, {
+ nullable: true,
+ })
+ numeroCelular?: SortOrder;
+
+ @ApiProperty({
+ required: false,
+ enum: ["asc", "desc"],
+ })
+ @IsOptional()
+ @IsEnum(SortOrder)
+ @Field(() => SortOrder, {
+ nullable: true,
+ })
+ updatedAt?: SortOrder;
+}
+
+export { PerfilOrderByInput as PerfilOrderByInput };
diff --git a/apps/maestri-edu-server/src/perfil/base/PerfilUpdateInput.ts b/apps/maestri-edu-server/src/perfil/base/PerfilUpdateInput.ts
new file mode 100644
index 0000000..bca0231
--- /dev/null
+++ b/apps/maestri-edu-server/src/perfil/base/PerfilUpdateInput.ts
@@ -0,0 +1,43 @@
+/*
+------------------------------------------------------------------------------
+This code was generated by Amplication.
+
+Changes to this file will be lost if the code is regenerated.
+
+There are other ways to to customize your code, see this doc to learn more
+https://docs.amplication.com/how-to/custom-code
+
+------------------------------------------------------------------------------
+ */
+import { InputType, Field } from "@nestjs/graphql";
+import { ApiProperty } from "@nestjs/swagger";
+import { IsString, MaxLength, IsOptional } from "class-validator";
+
+@InputType()
+class PerfilUpdateInput {
+ @ApiProperty({
+ required: false,
+ type: String,
+ })
+ @IsString()
+ @MaxLength(1000)
+ @IsOptional()
+ @Field(() => String, {
+ nullable: true,
+ })
+ cpf?: string | null;
+
+ @ApiProperty({
+ required: false,
+ type: String,
+ })
+ @IsString()
+ @MaxLength(1000)
+ @IsOptional()
+ @Field(() => String, {
+ nullable: true,
+ })
+ numeroCelular?: string | null;
+}
+
+export { PerfilUpdateInput as PerfilUpdateInput };
diff --git a/apps/maestri-edu-server/src/perfil/base/PerfilWhereInput.ts b/apps/maestri-edu-server/src/perfil/base/PerfilWhereInput.ts
new file mode 100644
index 0000000..9b6d30c
--- /dev/null
+++ b/apps/maestri-edu-server/src/perfil/base/PerfilWhereInput.ts
@@ -0,0 +1,55 @@
+/*
+------------------------------------------------------------------------------
+This code was generated by Amplication.
+
+Changes to this file will be lost if the code is regenerated.
+
+There are other ways to to customize your code, see this doc to learn more
+https://docs.amplication.com/how-to/custom-code
+
+------------------------------------------------------------------------------
+ */
+import { InputType, Field } from "@nestjs/graphql";
+import { ApiProperty } from "@nestjs/swagger";
+import { StringNullableFilter } from "../../util/StringNullableFilter";
+import { Type } from "class-transformer";
+import { IsOptional } from "class-validator";
+import { StringFilter } from "../../util/StringFilter";
+
+@InputType()
+class PerfilWhereInput {
+ @ApiProperty({
+ required: false,
+ type: StringNullableFilter,
+ })
+ @Type(() => StringNullableFilter)
+ @IsOptional()
+ @Field(() => StringNullableFilter, {
+ nullable: true,
+ })
+ cpf?: StringNullableFilter;
+
+ @ApiProperty({
+ required: false,
+ type: StringFilter,
+ })
+ @Type(() => StringFilter)
+ @IsOptional()
+ @Field(() => StringFilter, {
+ nullable: true,
+ })
+ id?: StringFilter;
+
+ @ApiProperty({
+ required: false,
+ type: StringNullableFilter,
+ })
+ @Type(() => StringNullableFilter)
+ @IsOptional()
+ @Field(() => StringNullableFilter, {
+ nullable: true,
+ })
+ numeroCelular?: StringNullableFilter;
+}
+
+export { PerfilWhereInput as PerfilWhereInput };
diff --git a/apps/maestri-edu-server/src/perfil/base/PerfilWhereUniqueInput.ts b/apps/maestri-edu-server/src/perfil/base/PerfilWhereUniqueInput.ts
new file mode 100644
index 0000000..31ac150
--- /dev/null
+++ b/apps/maestri-edu-server/src/perfil/base/PerfilWhereUniqueInput.ts
@@ -0,0 +1,27 @@
+/*
+------------------------------------------------------------------------------
+This code was generated by Amplication.
+
+Changes to this file will be lost if the code is regenerated.
+
+There are other ways to to customize your code, see this doc to learn more
+https://docs.amplication.com/how-to/custom-code
+
+------------------------------------------------------------------------------
+ */
+import { InputType, Field } from "@nestjs/graphql";
+import { ApiProperty } from "@nestjs/swagger";
+import { IsString } from "class-validator";
+
+@InputType()
+class PerfilWhereUniqueInput {
+ @ApiProperty({
+ required: true,
+ type: String,
+ })
+ @IsString()
+ @Field(() => String)
+ id!: string;
+}
+
+export { PerfilWhereUniqueInput as PerfilWhereUniqueInput };
diff --git a/apps/maestri-edu-server/src/perfil/base/UpdatePerfilArgs.ts b/apps/maestri-edu-server/src/perfil/base/UpdatePerfilArgs.ts
new file mode 100644
index 0000000..f359fbf
--- /dev/null
+++ b/apps/maestri-edu-server/src/perfil/base/UpdatePerfilArgs.ts
@@ -0,0 +1,40 @@
+/*
+------------------------------------------------------------------------------
+This code was generated by Amplication.
+
+Changes to this file will be lost if the code is regenerated.
+
+There are other ways to to customize your code, see this doc to learn more
+https://docs.amplication.com/how-to/custom-code
+
+------------------------------------------------------------------------------
+ */
+import { ArgsType, Field } from "@nestjs/graphql";
+import { ApiProperty } from "@nestjs/swagger";
+import { PerfilWhereUniqueInput } from "./PerfilWhereUniqueInput";
+import { ValidateNested } from "class-validator";
+import { Type } from "class-transformer";
+import { PerfilUpdateInput } from "./PerfilUpdateInput";
+
+@ArgsType()
+class UpdatePerfilArgs {
+ @ApiProperty({
+ required: true,
+ type: () => PerfilWhereUniqueInput,
+ })
+ @ValidateNested()
+ @Type(() => PerfilWhereUniqueInput)
+ @Field(() => PerfilWhereUniqueInput, { nullable: false })
+ where!: PerfilWhereUniqueInput;
+
+ @ApiProperty({
+ required: true,
+ type: () => PerfilUpdateInput,
+ })
+ @ValidateNested()
+ @Type(() => PerfilUpdateInput)
+ @Field(() => PerfilUpdateInput, { nullable: false })
+ data!: PerfilUpdateInput;
+}
+
+export { UpdatePerfilArgs as UpdatePerfilArgs };
diff --git a/apps/maestri-edu-server/src/perfil/base/perfil.controller.base.spec.ts b/apps/maestri-edu-server/src/perfil/base/perfil.controller.base.spec.ts
new file mode 100644
index 0000000..c2e5913
--- /dev/null
+++ b/apps/maestri-edu-server/src/perfil/base/perfil.controller.base.spec.ts
@@ -0,0 +1,198 @@
+import { Test } from "@nestjs/testing";
+import {
+ INestApplication,
+ HttpStatus,
+ ExecutionContext,
+ CallHandler,
+} from "@nestjs/common";
+import request from "supertest";
+import { ACGuard } from "nest-access-control";
+import { DefaultAuthGuard } from "../../auth/defaultAuth.guard";
+import { ACLModule } from "../../auth/acl.module";
+import { AclFilterResponseInterceptor } from "../../interceptors/aclFilterResponse.interceptor";
+import { AclValidateRequestInterceptor } from "../../interceptors/aclValidateRequest.interceptor";
+import { map } from "rxjs";
+import { PerfilController } from "../perfil.controller";
+import { PerfilService } from "../perfil.service";
+
+const nonExistingId = "nonExistingId";
+const existingId = "existingId";
+const CREATE_INPUT = {
+ cpf: "exampleCpf",
+ createdAt: new Date(),
+ id: "exampleId",
+ numeroCelular: "exampleNumeroCelular",
+ updatedAt: new Date(),
+};
+const CREATE_RESULT = {
+ cpf: "exampleCpf",
+ createdAt: new Date(),
+ id: "exampleId",
+ numeroCelular: "exampleNumeroCelular",
+ updatedAt: new Date(),
+};
+const FIND_MANY_RESULT = [
+ {
+ cpf: "exampleCpf",
+ createdAt: new Date(),
+ id: "exampleId",
+ numeroCelular: "exampleNumeroCelular",
+ updatedAt: new Date(),
+ },
+];
+const FIND_ONE_RESULT = {
+ cpf: "exampleCpf",
+ createdAt: new Date(),
+ id: "exampleId",
+ numeroCelular: "exampleNumeroCelular",
+ updatedAt: new Date(),
+};
+
+const service = {
+ createPerfil() {
+ return CREATE_RESULT;
+ },
+ perfils: () => FIND_MANY_RESULT,
+ perfil: ({ where }: { where: { id: string } }) => {
+ switch (where.id) {
+ case existingId:
+ return FIND_ONE_RESULT;
+ case nonExistingId:
+ return null;
+ }
+ },
+};
+
+const basicAuthGuard = {
+ canActivate: (context: ExecutionContext) => {
+ const argumentHost = context.switchToHttp();
+ const request = argumentHost.getRequest();
+ request.user = {
+ roles: ["user"],
+ };
+ return true;
+ },
+};
+
+const acGuard = {
+ canActivate: () => {
+ return true;
+ },
+};
+
+const aclFilterResponseInterceptor = {
+ intercept: (context: ExecutionContext, next: CallHandler) => {
+ return next.handle().pipe(
+ map((data) => {
+ return data;
+ })
+ );
+ },
+};
+const aclValidateRequestInterceptor = {
+ intercept: (context: ExecutionContext, next: CallHandler) => {
+ return next.handle();
+ },
+};
+
+describe("Perfil", () => {
+ let app: INestApplication;
+
+ beforeAll(async () => {
+ const moduleRef = await Test.createTestingModule({
+ providers: [
+ {
+ provide: PerfilService,
+ useValue: service,
+ },
+ ],
+ controllers: [PerfilController],
+ imports: [ACLModule],
+ })
+ .overrideGuard(DefaultAuthGuard)
+ .useValue(basicAuthGuard)
+ .overrideGuard(ACGuard)
+ .useValue(acGuard)
+ .overrideInterceptor(AclFilterResponseInterceptor)
+ .useValue(aclFilterResponseInterceptor)
+ .overrideInterceptor(AclValidateRequestInterceptor)
+ .useValue(aclValidateRequestInterceptor)
+ .compile();
+
+ app = moduleRef.createNestApplication();
+ await app.init();
+ });
+
+ test("POST /perfils", async () => {
+ await request(app.getHttpServer())
+ .post("/perfils")
+ .send(CREATE_INPUT)
+ .expect(HttpStatus.CREATED)
+ .expect({
+ ...CREATE_RESULT,
+ createdAt: CREATE_RESULT.createdAt.toISOString(),
+ updatedAt: CREATE_RESULT.updatedAt.toISOString(),
+ });
+ });
+
+ test("GET /perfils", async () => {
+ await request(app.getHttpServer())
+ .get("/perfils")
+ .expect(HttpStatus.OK)
+ .expect([
+ {
+ ...FIND_MANY_RESULT[0],
+ createdAt: FIND_MANY_RESULT[0].createdAt.toISOString(),
+ updatedAt: FIND_MANY_RESULT[0].updatedAt.toISOString(),
+ },
+ ]);
+ });
+
+ test("GET /perfils/:id non existing", async () => {
+ await request(app.getHttpServer())
+ .get(`${"/perfils"}/${nonExistingId}`)
+ .expect(HttpStatus.NOT_FOUND)
+ .expect({
+ statusCode: HttpStatus.NOT_FOUND,
+ message: `No resource was found for {"${"id"}":"${nonExistingId}"}`,
+ error: "Not Found",
+ });
+ });
+
+ test("GET /perfils/:id existing", async () => {
+ await request(app.getHttpServer())
+ .get(`${"/perfils"}/${existingId}`)
+ .expect(HttpStatus.OK)
+ .expect({
+ ...FIND_ONE_RESULT,
+ createdAt: FIND_ONE_RESULT.createdAt.toISOString(),
+ updatedAt: FIND_ONE_RESULT.updatedAt.toISOString(),
+ });
+ });
+
+ test("POST /perfils existing resource", async () => {
+ const agent = request(app.getHttpServer());
+ await agent
+ .post("/perfils")
+ .send(CREATE_INPUT)
+ .expect(HttpStatus.CREATED)
+ .expect({
+ ...CREATE_RESULT,
+ createdAt: CREATE_RESULT.createdAt.toISOString(),
+ updatedAt: CREATE_RESULT.updatedAt.toISOString(),
+ })
+ .then(function () {
+ agent
+ .post("/perfils")
+ .send(CREATE_INPUT)
+ .expect(HttpStatus.CONFLICT)
+ .expect({
+ statusCode: HttpStatus.CONFLICT,
+ });
+ });
+ });
+
+ afterAll(async () => {
+ await app.close();
+ });
+});
diff --git a/apps/maestri-edu-server/src/perfil/base/perfil.controller.base.ts b/apps/maestri-edu-server/src/perfil/base/perfil.controller.base.ts
new file mode 100644
index 0000000..fe00575
--- /dev/null
+++ b/apps/maestri-edu-server/src/perfil/base/perfil.controller.base.ts
@@ -0,0 +1,139 @@
+/*
+------------------------------------------------------------------------------
+This code was generated by Amplication.
+
+Changes to this file will be lost if the code is regenerated.
+
+There are other ways to to customize your code, see this doc to learn more
+https://docs.amplication.com/how-to/custom-code
+
+------------------------------------------------------------------------------
+ */
+import * as common from "@nestjs/common";
+import * as swagger from "@nestjs/swagger";
+import { isRecordNotFoundError } from "../../prisma.util";
+import * as errors from "../../errors";
+import { Request } from "express";
+import { plainToClass } from "class-transformer";
+import { ApiNestedQuery } from "../../decorators/api-nested-query.decorator";
+import { PerfilService } from "../perfil.service";
+import { PerfilCreateInput } from "./PerfilCreateInput";
+import { Perfil } from "./Perfil";
+import { PerfilFindManyArgs } from "./PerfilFindManyArgs";
+import { PerfilWhereUniqueInput } from "./PerfilWhereUniqueInput";
+import { PerfilUpdateInput } from "./PerfilUpdateInput";
+
+export class PerfilControllerBase {
+ constructor(protected readonly service: PerfilService) {}
+ @common.Post()
+ @swagger.ApiCreatedResponse({ type: Perfil })
+ async createPerfil(@common.Body() data: PerfilCreateInput): Promise {
+ return await this.service.createPerfil({
+ data: data,
+ select: {
+ cpf: true,
+ createdAt: true,
+ id: true,
+ numeroCelular: true,
+ updatedAt: true,
+ },
+ });
+ }
+
+ @common.Get()
+ @swagger.ApiOkResponse({ type: [Perfil] })
+ @ApiNestedQuery(PerfilFindManyArgs)
+ async perfils(@common.Req() request: Request): Promise {
+ const args = plainToClass(PerfilFindManyArgs, request.query);
+ return this.service.perfils({
+ ...args,
+ select: {
+ cpf: true,
+ createdAt: true,
+ id: true,
+ numeroCelular: true,
+ updatedAt: true,
+ },
+ });
+ }
+
+ @common.Get("/:id")
+ @swagger.ApiOkResponse({ type: Perfil })
+ @swagger.ApiNotFoundResponse({ type: errors.NotFoundException })
+ async perfil(
+ @common.Param() params: PerfilWhereUniqueInput
+ ): Promise {
+ const result = await this.service.perfil({
+ where: params,
+ select: {
+ cpf: true,
+ createdAt: true,
+ id: true,
+ numeroCelular: true,
+ updatedAt: true,
+ },
+ });
+ if (result === null) {
+ throw new errors.NotFoundException(
+ `No resource was found for ${JSON.stringify(params)}`
+ );
+ }
+ return result;
+ }
+
+ @common.Patch("/:id")
+ @swagger.ApiOkResponse({ type: Perfil })
+ @swagger.ApiNotFoundResponse({ type: errors.NotFoundException })
+ async updatePerfil(
+ @common.Param() params: PerfilWhereUniqueInput,
+ @common.Body() data: PerfilUpdateInput
+ ): Promise {
+ try {
+ return await this.service.updatePerfil({
+ where: params,
+ data: data,
+ select: {
+ cpf: true,
+ createdAt: true,
+ id: true,
+ numeroCelular: true,
+ updatedAt: true,
+ },
+ });
+ } catch (error) {
+ if (isRecordNotFoundError(error)) {
+ throw new errors.NotFoundException(
+ `No resource was found for ${JSON.stringify(params)}`
+ );
+ }
+ throw error;
+ }
+ }
+
+ @common.Delete("/:id")
+ @swagger.ApiOkResponse({ type: Perfil })
+ @swagger.ApiNotFoundResponse({ type: errors.NotFoundException })
+ async deletePerfil(
+ @common.Param() params: PerfilWhereUniqueInput
+ ): Promise {
+ try {
+ return await this.service.deletePerfil({
+ where: params,
+ select: {
+ cpf: true,
+ createdAt: true,
+ id: true,
+ numeroCelular: true,
+ updatedAt: true,
+ },
+ });
+ } catch (error) {
+ if (isRecordNotFoundError(error)) {
+ throw new errors.NotFoundException(
+ `No resource was found for ${JSON.stringify(params)}`
+ );
+ }
+ throw error;
+ }
+ }
+}
diff --git a/apps/maestri-edu-server/src/perfil/base/perfil.module.base.ts b/apps/maestri-edu-server/src/perfil/base/perfil.module.base.ts
new file mode 100644
index 0000000..3a0ffea
--- /dev/null
+++ b/apps/maestri-edu-server/src/perfil/base/perfil.module.base.ts
@@ -0,0 +1,18 @@
+/*
+------------------------------------------------------------------------------
+This code was generated by Amplication.
+
+Changes to this file will be lost if the code is regenerated.
+
+There are other ways to to customize your code, see this doc to learn more
+https://docs.amplication.com/how-to/custom-code
+
+------------------------------------------------------------------------------
+ */
+import { Module } from "@nestjs/common";
+
+@Module({
+ imports: [],
+ exports: [],
+})
+export class PerfilModuleBase {}
diff --git a/apps/maestri-edu-server/src/perfil/base/perfil.resolver.base.ts b/apps/maestri-edu-server/src/perfil/base/perfil.resolver.base.ts
new file mode 100644
index 0000000..a5360d3
--- /dev/null
+++ b/apps/maestri-edu-server/src/perfil/base/perfil.resolver.base.ts
@@ -0,0 +1,95 @@
+/*
+------------------------------------------------------------------------------
+This code was generated by Amplication.
+
+Changes to this file will be lost if the code is regenerated.
+
+There are other ways to to customize your code, see this doc to learn more
+https://docs.amplication.com/how-to/custom-code
+
+------------------------------------------------------------------------------
+ */
+import * as graphql from "@nestjs/graphql";
+import { GraphQLError } from "graphql";
+import { isRecordNotFoundError } from "../../prisma.util";
+import { MetaQueryPayload } from "../../util/MetaQueryPayload";
+import { Perfil } from "./Perfil";
+import { PerfilCountArgs } from "./PerfilCountArgs";
+import { PerfilFindManyArgs } from "./PerfilFindManyArgs";
+import { PerfilFindUniqueArgs } from "./PerfilFindUniqueArgs";
+import { CreatePerfilArgs } from "./CreatePerfilArgs";
+import { UpdatePerfilArgs } from "./UpdatePerfilArgs";
+import { DeletePerfilArgs } from "./DeletePerfilArgs";
+import { PerfilService } from "../perfil.service";
+@graphql.Resolver(() => Perfil)
+export class PerfilResolverBase {
+ constructor(protected readonly service: PerfilService) {}
+
+ async _perfilsMeta(
+ @graphql.Args() args: PerfilCountArgs
+ ): Promise {
+ const result = await this.service.count(args);
+ return {
+ count: result,
+ };
+ }
+
+ @graphql.Query(() => [Perfil])
+ async perfils(@graphql.Args() args: PerfilFindManyArgs): Promise {
+ return this.service.perfils(args);
+ }
+
+ @graphql.Query(() => Perfil, { nullable: true })
+ async perfil(
+ @graphql.Args() args: PerfilFindUniqueArgs
+ ): Promise {
+ const result = await this.service.perfil(args);
+ if (result === null) {
+ return null;
+ }
+ return result;
+ }
+
+ @graphql.Mutation(() => Perfil)
+ async createPerfil(@graphql.Args() args: CreatePerfilArgs): Promise {
+ return await this.service.createPerfil({
+ ...args,
+ data: args.data,
+ });
+ }
+
+ @graphql.Mutation(() => Perfil)
+ async updatePerfil(
+ @graphql.Args() args: UpdatePerfilArgs
+ ): Promise {
+ try {
+ return await this.service.updatePerfil({
+ ...args,
+ data: args.data,
+ });
+ } catch (error) {
+ if (isRecordNotFoundError(error)) {
+ throw new GraphQLError(
+ `No resource was found for ${JSON.stringify(args.where)}`
+ );
+ }
+ throw error;
+ }
+ }
+
+ @graphql.Mutation(() => Perfil)
+ async deletePerfil(
+ @graphql.Args() args: DeletePerfilArgs
+ ): Promise {
+ try {
+ return await this.service.deletePerfil(args);
+ } catch (error) {
+ if (isRecordNotFoundError(error)) {
+ throw new GraphQLError(
+ `No resource was found for ${JSON.stringify(args.where)}`
+ );
+ }
+ throw error;
+ }
+ }
+}
diff --git a/apps/maestri-edu-server/src/perfil/base/perfil.service.base.ts b/apps/maestri-edu-server/src/perfil/base/perfil.service.base.ts
new file mode 100644
index 0000000..e86240c
--- /dev/null
+++ b/apps/maestri-edu-server/src/perfil/base/perfil.service.base.ts
@@ -0,0 +1,39 @@
+/*
+------------------------------------------------------------------------------
+This code was generated by Amplication.
+
+Changes to this file will be lost if the code is regenerated.
+
+There are other ways to to customize your code, see this doc to learn more
+https://docs.amplication.com/how-to/custom-code
+
+------------------------------------------------------------------------------
+ */
+import { PrismaService } from "../../prisma/prisma.service";
+import { Prisma, Perfil as PrismaPerfil } from "@prisma/client";
+
+export class PerfilServiceBase {
+ constructor(protected readonly prisma: PrismaService) {}
+
+ async count(args: Omit): Promise {
+ return this.prisma.perfil.count(args);
+ }
+
+ async perfils(args: Prisma.PerfilFindManyArgs): Promise {
+ return this.prisma.perfil.findMany(args);
+ }
+ async perfil(
+ args: Prisma.PerfilFindUniqueArgs
+ ): Promise {
+ return this.prisma.perfil.findUnique(args);
+ }
+ async createPerfil(args: Prisma.PerfilCreateArgs): Promise {
+ return this.prisma.perfil.create(args);
+ }
+ async updatePerfil(args: Prisma.PerfilUpdateArgs): Promise {
+ return this.prisma.perfil.update(args);
+ }
+ async deletePerfil(args: Prisma.PerfilDeleteArgs): Promise {
+ return this.prisma.perfil.delete(args);
+ }
+}
diff --git a/apps/maestri-edu-server/src/perfil/perfil.controller.ts b/apps/maestri-edu-server/src/perfil/perfil.controller.ts
new file mode 100644
index 0000000..742d856
--- /dev/null
+++ b/apps/maestri-edu-server/src/perfil/perfil.controller.ts
@@ -0,0 +1,12 @@
+import * as common from "@nestjs/common";
+import * as swagger from "@nestjs/swagger";
+import { PerfilService } from "./perfil.service";
+import { PerfilControllerBase } from "./base/perfil.controller.base";
+
+@swagger.ApiTags("perfils")
+@common.Controller("perfils")
+export class PerfilController extends PerfilControllerBase {
+ constructor(protected readonly service: PerfilService) {
+ super(service);
+ }
+}
diff --git a/apps/maestri-edu-server/src/perfil/perfil.module.ts b/apps/maestri-edu-server/src/perfil/perfil.module.ts
new file mode 100644
index 0000000..1391e1f
--- /dev/null
+++ b/apps/maestri-edu-server/src/perfil/perfil.module.ts
@@ -0,0 +1,13 @@
+import { Module } from "@nestjs/common";
+import { PerfilModuleBase } from "./base/perfil.module.base";
+import { PerfilService } from "./perfil.service";
+import { PerfilController } from "./perfil.controller";
+import { PerfilResolver } from "./perfil.resolver";
+
+@Module({
+ imports: [PerfilModuleBase],
+ controllers: [PerfilController],
+ providers: [PerfilService, PerfilResolver],
+ exports: [PerfilService],
+})
+export class PerfilModule {}
diff --git a/apps/maestri-edu-server/src/perfil/perfil.resolver.ts b/apps/maestri-edu-server/src/perfil/perfil.resolver.ts
new file mode 100644
index 0000000..bd01351
--- /dev/null
+++ b/apps/maestri-edu-server/src/perfil/perfil.resolver.ts
@@ -0,0 +1,11 @@
+import * as graphql from "@nestjs/graphql";
+import { PerfilResolverBase } from "./base/perfil.resolver.base";
+import { Perfil } from "./base/Perfil";
+import { PerfilService } from "./perfil.service";
+
+@graphql.Resolver(() => Perfil)
+export class PerfilResolver extends PerfilResolverBase {
+ constructor(protected readonly service: PerfilService) {
+ super(service);
+ }
+}
diff --git a/apps/maestri-edu-server/src/perfil/perfil.service.ts b/apps/maestri-edu-server/src/perfil/perfil.service.ts
new file mode 100644
index 0000000..5affe37
--- /dev/null
+++ b/apps/maestri-edu-server/src/perfil/perfil.service.ts
@@ -0,0 +1,10 @@
+import { Injectable } from "@nestjs/common";
+import { PrismaService } from "../prisma/prisma.service";
+import { PerfilServiceBase } from "./base/perfil.service.base";
+
+@Injectable()
+export class PerfilService extends PerfilServiceBase {
+ constructor(protected readonly prisma: PrismaService) {
+ super(prisma);
+ }
+}
diff --git a/apps/maestri-edu-server/src/prisma.util.spec.ts b/apps/maestri-edu-server/src/prisma.util.spec.ts
new file mode 100644
index 0000000..0aa308e
--- /dev/null
+++ b/apps/maestri-edu-server/src/prisma.util.spec.ts
@@ -0,0 +1,23 @@
+import {
+ isRecordNotFoundError,
+ PRISMA_QUERY_INTERPRETATION_ERROR,
+} from "./prisma.util";
+
+describe("isRecordNotFoundError", () => {
+ test("returns true for record not found error", () => {
+ expect(
+ isRecordNotFoundError(
+ Object.assign(
+ new Error(`Error occurred during query execution:
+ InterpretationError("Error for binding '0': RecordNotFound("Record to update not found.")")`),
+ {
+ code: PRISMA_QUERY_INTERPRETATION_ERROR,
+ }
+ )
+ )
+ ).toBe(true);
+ });
+ test("returns false for any other error", () => {
+ expect(isRecordNotFoundError(new Error())).toBe(false);
+ });
+});
diff --git a/apps/maestri-edu-server/src/prisma.util.ts b/apps/maestri-edu-server/src/prisma.util.ts
new file mode 100644
index 0000000..029b98a
--- /dev/null
+++ b/apps/maestri-edu-server/src/prisma.util.ts
@@ -0,0 +1,29 @@
+export const PRISMA_QUERY_INTERPRETATION_ERROR = "P2016";
+export const PRISMA_RECORD_NOT_FOUND = "RecordNotFound";
+
+export function isRecordNotFoundError(error: any): boolean {
+ return (
+ error instanceof Error &&
+ "code" in error &&
+ error.code === PRISMA_QUERY_INTERPRETATION_ERROR &&
+ error.message.includes(PRISMA_RECORD_NOT_FOUND)
+ );
+}
+
+export async function transformStringFieldUpdateInput<
+ T extends undefined | string | { set?: string }
+>(input: T, transform: (input: string) => Promise): Promise {
+ if (typeof input === "object" && typeof input?.set === "string") {
+ return { set: await transform(input.set) } as T;
+ }
+ if (typeof input === "object") {
+ if (typeof input.set === "string") {
+ return { set: await transform(input.set) } as T;
+ }
+ return input;
+ }
+ if (typeof input === "string") {
+ return (await transform(input)) as T;
+ }
+ return input;
+}
diff --git a/apps/maestri-edu-server/src/prisma/prisma.module.ts b/apps/maestri-edu-server/src/prisma/prisma.module.ts
new file mode 100644
index 0000000..1edbf95
--- /dev/null
+++ b/apps/maestri-edu-server/src/prisma/prisma.module.ts
@@ -0,0 +1,9 @@
+import { Global, Module } from "@nestjs/common";
+import { PrismaService } from "./prisma.service";
+
+@Global()
+@Module({
+ providers: [PrismaService],
+ exports: [PrismaService],
+})
+export class PrismaModule {}
diff --git a/apps/maestri-edu-server/src/prisma/prisma.service.ts b/apps/maestri-edu-server/src/prisma/prisma.service.ts
new file mode 100644
index 0000000..79ea4fa
--- /dev/null
+++ b/apps/maestri-edu-server/src/prisma/prisma.service.ts
@@ -0,0 +1,9 @@
+import { Injectable, OnModuleInit, INestApplication } from "@nestjs/common";
+import { PrismaClient } from "@prisma/client";
+
+@Injectable()
+export class PrismaService extends PrismaClient implements OnModuleInit {
+ async onModuleInit() {
+ await this.$connect();
+ }
+}
diff --git a/apps/maestri-edu-server/src/providers/secrets/base/secretsManager.service.base.spec.ts b/apps/maestri-edu-server/src/providers/secrets/base/secretsManager.service.base.spec.ts
new file mode 100644
index 0000000..f161172
--- /dev/null
+++ b/apps/maestri-edu-server/src/providers/secrets/base/secretsManager.service.base.spec.ts
@@ -0,0 +1,41 @@
+import { ConfigService } from "@nestjs/config";
+import { mock } from "jest-mock-extended";
+import { SecretsManagerServiceBase } from "./secretsManager.service.base";
+import { EnumSecretsNameKey } from "../secretsNameKey.enum";
+
+describe("Testing the secrets manager base class", () => {
+ const SECRET_KEY = "SECRET_KEY";
+ const SECRET_VALUE = "SECRET_VALUE";
+ const configService = mock();
+ const secretsManagerServiceBase = new SecretsManagerServiceBase(
+ configService
+ );
+ beforeEach(() => {
+ configService.get.mockClear();
+ });
+ it("should return value from env", async () => {
+ //ARRANGE
+ configService.get.mockReturnValue(SECRET_VALUE);
+ //ACT
+ const result = await secretsManagerServiceBase.getSecret(
+ SECRET_KEY as unknown as EnumSecretsNameKey
+ );
+ //ASSERT
+ expect(result).toBe(SECRET_VALUE);
+ });
+ it("should return null for unknown keys", async () => {
+ //ARRANGE
+ configService.get.mockReturnValue(undefined);
+ //ACT
+ const result = await secretsManagerServiceBase.getSecret(
+ SECRET_KEY as unknown as EnumSecretsNameKey
+ );
+ //ASSERT
+ expect(result).toBeNull();
+ });
+ it("should throw an exception if getting null key", () => {
+ return expect(
+ secretsManagerServiceBase.getSecret(null as unknown as EnumSecretsNameKey)
+ ).rejects.toThrow();
+ });
+});
diff --git a/apps/maestri-edu-server/src/providers/secrets/base/secretsManager.service.base.ts b/apps/maestri-edu-server/src/providers/secrets/base/secretsManager.service.base.ts
new file mode 100644
index 0000000..340818c
--- /dev/null
+++ b/apps/maestri-edu-server/src/providers/secrets/base/secretsManager.service.base.ts
@@ -0,0 +1,17 @@
+import { ConfigService } from "@nestjs/config";
+import { EnumSecretsNameKey } from "../secretsNameKey.enum";
+
+export interface ISecretsManager {
+ getSecret: (key: EnumSecretsNameKey) => Promise;
+}
+
+export class SecretsManagerServiceBase implements ISecretsManager {
+ constructor(protected readonly configService: ConfigService) {}
+ async getSecret(key: EnumSecretsNameKey): Promise {
+ const value = this.configService.get(key.toString());
+ if (value) {
+ return value;
+ }
+ return null;
+ }
+}
diff --git a/apps/maestri-edu-server/src/providers/secrets/secretsManager.module.ts b/apps/maestri-edu-server/src/providers/secrets/secretsManager.module.ts
new file mode 100644
index 0000000..3a621e4
--- /dev/null
+++ b/apps/maestri-edu-server/src/providers/secrets/secretsManager.module.ts
@@ -0,0 +1,8 @@
+import { Module } from "@nestjs/common";
+import { SecretsManagerService } from "./secretsManager.service";
+
+@Module({
+ providers: [SecretsManagerService],
+ exports: [SecretsManagerService],
+})
+export class SecretsManagerModule {}
diff --git a/apps/maestri-edu-server/src/providers/secrets/secretsManager.service.ts b/apps/maestri-edu-server/src/providers/secrets/secretsManager.service.ts
new file mode 100644
index 0000000..89907c3
--- /dev/null
+++ b/apps/maestri-edu-server/src/providers/secrets/secretsManager.service.ts
@@ -0,0 +1,10 @@
+import { Injectable } from "@nestjs/common";
+import { ConfigService } from "@nestjs/config";
+import { SecretsManagerServiceBase } from "./base/secretsManager.service.base";
+
+@Injectable()
+export class SecretsManagerService extends SecretsManagerServiceBase {
+ constructor(protected readonly configService: ConfigService) {
+ super(configService);
+ }
+}
diff --git a/apps/maestri-edu-server/src/providers/secrets/secretsNameKey.enum.ts b/apps/maestri-edu-server/src/providers/secrets/secretsNameKey.enum.ts
new file mode 100644
index 0000000..e225d65
--- /dev/null
+++ b/apps/maestri-edu-server/src/providers/secrets/secretsNameKey.enum.ts
@@ -0,0 +1 @@
+export enum EnumSecretsNameKey {}
\ No newline at end of file
diff --git a/apps/maestri-edu-server/src/serveStaticOptions.service.ts b/apps/maestri-edu-server/src/serveStaticOptions.service.ts
new file mode 100644
index 0000000..390248b
--- /dev/null
+++ b/apps/maestri-edu-server/src/serveStaticOptions.service.ts
@@ -0,0 +1,39 @@
+import * as path from "path";
+import { Injectable, Logger } from "@nestjs/common";
+import { ConfigService } from "@nestjs/config";
+import {
+ ServeStaticModuleOptions,
+ ServeStaticModuleOptionsFactory,
+} from "@nestjs/serve-static";
+
+const SERVE_STATIC_ROOT_PATH_VAR = "SERVE_STATIC_ROOT_PATH";
+const DEFAULT_STATIC_MODULE_OPTIONS_LIST: ServeStaticModuleOptions[] = [
+ {
+ serveRoot: "/swagger",
+ rootPath: path.join(__dirname, "swagger"),
+ },
+];
+
+@Injectable()
+export class ServeStaticOptionsService
+ implements ServeStaticModuleOptionsFactory
+{
+ private readonly logger = new Logger(ServeStaticOptionsService.name);
+
+ constructor(private readonly configService: ConfigService) {}
+
+ createLoggerOptions(): ServeStaticModuleOptions[] {
+ const serveStaticRootPath = this.configService.get(
+ SERVE_STATIC_ROOT_PATH_VAR
+ );
+ if (serveStaticRootPath) {
+ const resolvedPath = path.resolve(serveStaticRootPath);
+ this.logger.log(`Serving static files from ${resolvedPath}`);
+ return [
+ ...DEFAULT_STATIC_MODULE_OPTIONS_LIST,
+ { rootPath: resolvedPath, exclude: ["/api*", "/graphql"] },
+ ];
+ }
+ return DEFAULT_STATIC_MODULE_OPTIONS_LIST;
+ }
+}
diff --git a/apps/maestri-edu-server/src/swagger.ts b/apps/maestri-edu-server/src/swagger.ts
new file mode 100644
index 0000000..7fa466c
--- /dev/null
+++ b/apps/maestri-edu-server/src/swagger.ts
@@ -0,0 +1,20 @@
+import { DocumentBuilder, SwaggerCustomOptions } from "@nestjs/swagger";
+
+export const swaggerPath = "api";
+
+export const swaggerDocumentOptions = new DocumentBuilder()
+ .setTitle("MaestriEdu")
+ .setDescription(
+ '\n\n## Congratulations! Your service resource is ready.\n \nPlease note that all endpoints are secured with JWT Bearer authentication.\nBy default, your service resource comes with one user with the username "admin" and password "admin".\nLearn more in [our docs](https://docs.amplication.com)'
+ )
+ .addBearerAuth()
+ .build();
+
+export const swaggerSetupOptions: SwaggerCustomOptions = {
+ swaggerOptions: {
+ persistAuthorization: true,
+ },
+ customCssUrl: "../swagger/swagger.css",
+ customfavIcon: "../swagger/favicon.png",
+ customSiteTitle: "MaestriEdu",
+};
diff --git a/apps/maestri-edu-server/src/swagger/favicon.png b/apps/maestri-edu-server/src/swagger/favicon.png
new file mode 100644
index 0000000..a79882d
Binary files /dev/null and b/apps/maestri-edu-server/src/swagger/favicon.png differ
diff --git a/apps/maestri-edu-server/src/swagger/logo-amplication-white.svg b/apps/maestri-edu-server/src/swagger/logo-amplication-white.svg
new file mode 100644
index 0000000..0054cd4
--- /dev/null
+++ b/apps/maestri-edu-server/src/swagger/logo-amplication-white.svg
@@ -0,0 +1,15 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/apps/maestri-edu-server/src/swagger/swagger.css b/apps/maestri-edu-server/src/swagger/swagger.css
new file mode 100644
index 0000000..b7c4037
--- /dev/null
+++ b/apps/maestri-edu-server/src/swagger/swagger.css
@@ -0,0 +1,321 @@
+html,
+body {
+ background-color: #f4f4f7;
+}
+
+body {
+ margin: auto;
+ line-height: 1.6;
+ font-family: "Poppins", -apple-system, BlinkMacSystemFont, "Segoe UI",
+ "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans",
+ "Helvetica Neue", sans-serif;
+ color: #121242;
+}
+
+.swagger-ui {
+ font-family: "Poppins", -apple-system, BlinkMacSystemFont, "Segoe UI",
+ "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans",
+ "Helvetica Neue", sans-serif;
+}
+
+.swagger-ui button,
+.swagger-ui input,
+.swagger-ui optgroup,
+.swagger-ui select,
+.swagger-ui textarea,
+.swagger-ui .parameter__name,
+.swagger-ui .parameters-col_name > *,
+.swagger-ui label {
+ font-family: "Poppins", -apple-system, BlinkMacSystemFont, "Segoe UI",
+ "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans",
+ "Helvetica Neue", sans-serif;
+ font-weight: normal;
+ font-size: 12px;
+ outline: none;
+}
+
+.swagger-ui textarea {
+ border: 1px solid #d0d0d9;
+ min-height: 100px;
+}
+
+.swagger-ui input[type="email"],
+.swagger-ui input[type="file"],
+.swagger-ui input[type="password"],
+.swagger-ui input[type="search"],
+.swagger-ui input[type="text"],
+.swagger-ui textarea {
+ border-radius: 3px;
+}
+
+.swagger-ui input[disabled],
+.swagger-ui select[disabled],
+.swagger-ui textarea[disabled] {
+ background: #f4f4f7;
+ color: #b8b8c6;
+}
+
+.swagger-ui .btn {
+ font-family: "Poppins", -apple-system, BlinkMacSystemFont, "Segoe UI",
+ "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans",
+ "Helvetica Neue", sans-serif;
+ font-weight: 500;
+ box-shadow: none;
+ border: 1px solid #d0d0d9;
+ height: 28px;
+ border-radius: 14px;
+ background-color: #fff;
+ color: #7950ed;
+}
+
+.swagger-ui .btn:hover {
+ box-shadow: none;
+}
+
+/* topbar */
+
+.swagger-ui .topbar {
+ background-color: #7950ed;
+ height: 80px;
+ padding: 0;
+ display: flex;
+ flex-direction: row;
+ align-items: center;
+ justify-content: flex-start;
+}
+
+.swagger-ui .topbar-wrapper a {
+ display: block;
+ width: 206px;
+ height: 35px;
+ background-image: url("logo-amplication-white.svg");
+ background-repeat: no-repeat;
+ background-size: contain;
+}
+
+.swagger-ui .topbar-wrapper svg,
+.swagger-ui .topbar-wrapper img {
+ display: none;
+}
+
+/* title */
+.swagger-ui .info {
+ margin: 0;
+}
+
+.swagger-ui .info .title {
+ font-family: "Poppins", -apple-system, BlinkMacSystemFont, "Segoe UI",
+ "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans",
+ "Helvetica Neue", sans-serif;
+ font-size: 32px;
+ font-weight: 600;
+}
+
+.swagger-ui .information-container {
+ padding-top: 50px;
+ padding-bottom: 20px;
+ position: relative;
+}
+
+.swagger-ui .info .title small.version-stamp {
+ display: none;
+}
+
+.swagger-ui .info .title small {
+ background-color: #a787ff;
+}
+
+.swagger-ui .info .description p {
+ max-width: 1000px;
+ margin: 0;
+}
+
+.swagger-ui .info .description p,
+.swagger-ui .info .description a {
+ font-size: 1rem;
+}
+
+.swagger-ui .information-container section {
+ position: relative;
+}
+
+.swagger-ui .scheme-container {
+ box-shadow: none;
+ background-color: transparent;
+ position: relative;
+ margin: 0;
+ margin-top: 20px;
+ margin-bottom: 20px;
+ padding: 0;
+}
+
+.swagger-ui .scheme-container .auth-wrapper {
+ justify-content: flex-start;
+}
+
+.swagger-ui .btn.authorize {
+ box-shadow: none;
+ border: 1px solid #d0d0d9;
+ height: 40px;
+ border-radius: 20px;
+ background-color: #fff;
+ color: #7950ed;
+}
+
+.swagger-ui .btn.authorize svg {
+ fill: #7950ed;
+}
+
+/* content */
+
+.swagger-ui .opblock-tag {
+ font-family: "Poppins", -apple-system, BlinkMacSystemFont, "Segoe UI",
+ "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans",
+ "Helvetica Neue", sans-serif;
+ font-size: 28px;
+ font-weight: 600;
+}
+
+.swagger-ui .opblock.is-open .opblock-summary {
+ border-color: #e7e7ec !important;
+ border-bottom: none;
+}
+
+.swagger-ui .opblock .opblock-section-header {
+ background-color: #fff;
+ border: none;
+ border-top: 1px solid #e7e7ec;
+ border-bottom: 1px solid #e7e7ec;
+ box-shadow: none;
+}
+
+.swagger-ui .opblock .tab-header .tab-item.active h4 span:after {
+ display: none;
+}
+
+.swagger-ui .opblock.opblock-post {
+ border: 1px solid #e7e7ec;
+ background: #f9f9fa;
+ box-shadow: none;
+ color: #fff;
+}
+
+.swagger-ui .opblock.opblock-post:hover,
+.swagger-ui .opblock.opblock-post.is-open {
+ border-color: #31c587;
+}
+
+.swagger-ui .opblock.opblock-post .opblock-summary-method {
+ background-color: #31c587;
+}
+
+.swagger-ui .opblock.opblock-get {
+ border: 1px solid #e7e7ec;
+ background: #f9f9fa;
+ box-shadow: none;
+}
+.swagger-ui .opblock.opblock-get:hover,
+.swagger-ui .opblock.opblock-get.is-open {
+ border-color: #20a4f3;
+}
+.swagger-ui .opblock.opblock-get .opblock-summary-method {
+ background-color: #20a4f3;
+}
+
+.swagger-ui .opblock.opblock-delete {
+ border: 1px solid #e7e7ec;
+ background: #f9f9fa;
+ box-shadow: none;
+}
+.swagger-ui .opblock.opblock-delete:hover,
+.swagger-ui .opblock.opblock-delete.is-open {
+ border-color: #e93c51;
+}
+.swagger-ui .opblock.opblock-delete .opblock-summary-method {
+ background-color: #e93c51;
+}
+
+.swagger-ui .opblock.opblock-patch {
+ border: 1px solid #e7e7ec;
+ background: #f9f9fa;
+ box-shadow: none;
+}
+.swagger-ui .opblock.opblock-patch:hover,
+.swagger-ui .opblock.opblock-patch.is-open {
+ border-color: #41cadd;
+}
+.swagger-ui .opblock.opblock-patch .opblock-summary-method {
+ background-color: #41cadd;
+}
+
+.swagger-ui .opblock-body pre {
+ background-color: #121242 !important;
+}
+
+.swagger-ui select,
+.swagger-ui .response-control-media-type--accept-controller select {
+ border: 1px solid #d0d0d9;
+ box-shadow: none;
+ outline: none;
+}
+
+/* models */
+
+.swagger-ui section.models {
+ background-color: #fff;
+ border: 1px solid #e7e7ec;
+}
+
+.swagger-ui section.models.is-open h4 {
+ border-bottom: 1px solid #e7e7ec;
+}
+
+.swagger-ui section.models .model-container,
+.swagger-ui section.models .model-container:hover {
+ background-color: #f4f4f7;
+ color: #121242;
+}
+
+.swagger-ui .model-title {
+ font-family: "Poppins", -apple-system, BlinkMacSystemFont, "Segoe UI",
+ "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans",
+ "Helvetica Neue", sans-serif;
+ font-weight: normal;
+ font-size: 15px;
+ color: #121242;
+}
+
+/* modal */
+
+.swagger-ui .dialog-ux .modal-ux-header h3,
+.swagger-ui .dialog-ux .modal-ux-content h4,
+.swagger-ui .dialog-ux .modal-ux-content h4 code {
+ font-family: "Poppins", -apple-system, BlinkMacSystemFont, "Segoe UI",
+ "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans",
+ "Helvetica Neue", sans-serif;
+ font-weight: normal;
+ font-size: 15px;
+ color: #121242;
+}
+
+.swagger-ui .dialog-ux .modal-ux-content .btn.authorize {
+ height: 28px;
+ border-radius: 14px;
+}
+
+.swagger-ui .auth-btn-wrapper {
+ display: flex;
+ flex-direction: row-reverse;
+ align-items: center;
+ justify-content: flex-start;
+}
+
+.swagger-ui .auth-btn-wrapper .btn-done {
+ border: none;
+ color: #121242;
+ margin-right: 0;
+}
+
+.swagger-ui .authorization__btn {
+ fill: #414168;
+}
diff --git a/apps/maestri-edu-server/src/tests/health/health.service.spec.ts b/apps/maestri-edu-server/src/tests/health/health.service.spec.ts
new file mode 100644
index 0000000..4b191f1
--- /dev/null
+++ b/apps/maestri-edu-server/src/tests/health/health.service.spec.ts
@@ -0,0 +1,36 @@
+import { mock } from "jest-mock-extended";
+import { PrismaService } from "../../prisma/prisma.service";
+import { HealthServiceBase } from "../../health/base/health.service.base";
+
+describe("Testing the HealthServiceBase", () => {
+ //ARRANGE
+ let prismaService: PrismaService;
+ let healthServiceBase: HealthServiceBase;
+
+ describe("Testing the isDbReady function in HealthServiceBase class", () => {
+ beforeEach(() => {
+ prismaService = mock();
+ healthServiceBase = new HealthServiceBase(prismaService);
+ });
+ it("should return true if allow connection to db", async () => {
+ //ARRANGE
+ (prismaService.$queryRaw as jest.Mock).mockReturnValue(
+ Promise.resolve(true)
+ );
+ //ACT
+ const response = await healthServiceBase.isDbReady();
+ //ASSERT
+ expect(response).toBe(true);
+ });
+ it("should return false if db is not available", async () => {
+ //ARRANGE
+ (prismaService.$queryRaw as jest.Mock).mockReturnValue(
+ Promise.reject(false)
+ );
+ //ACT
+ const response = await healthServiceBase.isDbReady();
+ //ASSERT
+ expect(response).toBe(false);
+ });
+ });
+});
diff --git a/apps/maestri-edu-server/src/types.ts b/apps/maestri-edu-server/src/types.ts
new file mode 100644
index 0000000..f762a5d
--- /dev/null
+++ b/apps/maestri-edu-server/src/types.ts
@@ -0,0 +1,3 @@
+import type { JsonValue } from "type-fest";
+
+export type InputJsonValue = Omit;
diff --git a/apps/maestri-edu-server/src/util/BooleanFilter.ts b/apps/maestri-edu-server/src/util/BooleanFilter.ts
new file mode 100644
index 0000000..75f4e34
--- /dev/null
+++ b/apps/maestri-edu-server/src/util/BooleanFilter.ts
@@ -0,0 +1,32 @@
+import { Field, InputType } from "@nestjs/graphql";
+import { ApiProperty } from "@nestjs/swagger";
+import { IsOptional } from "class-validator";
+import { Type } from "class-transformer";
+
+@InputType({
+ isAbstract: true,
+ description: undefined,
+})
+export class BooleanFilter {
+ @ApiProperty({
+ required: false,
+ type: Boolean,
+ })
+ @IsOptional()
+ @Field(() => Boolean, {
+ nullable: true,
+ })
+ @Type(() => Boolean)
+ equals?: boolean;
+
+ @ApiProperty({
+ required: false,
+ type: Boolean,
+ })
+ @IsOptional()
+ @Field(() => Boolean, {
+ nullable: true,
+ })
+ @Type(() => Boolean)
+ not?: boolean;
+}
diff --git a/apps/maestri-edu-server/src/util/BooleanNullableFilter.ts b/apps/maestri-edu-server/src/util/BooleanNullableFilter.ts
new file mode 100644
index 0000000..9f48ac1
--- /dev/null
+++ b/apps/maestri-edu-server/src/util/BooleanNullableFilter.ts
@@ -0,0 +1,31 @@
+import { Field, InputType } from "@nestjs/graphql";
+import { ApiProperty } from "@nestjs/swagger";
+import { IsOptional } from "class-validator";
+import { Type } from "class-transformer";
+@InputType({
+ isAbstract: true,
+ description: undefined,
+})
+export class BooleanNullableFilter {
+ @ApiProperty({
+ required: false,
+ type: Boolean,
+ })
+ @IsOptional()
+ @Field(() => Boolean, {
+ nullable: true,
+ })
+ @Type(() => Boolean)
+ equals?: boolean | null;
+
+ @ApiProperty({
+ required: false,
+ type: Boolean,
+ })
+ @IsOptional()
+ @Field(() => Boolean, {
+ nullable: true,
+ })
+ @Type(() => Boolean)
+ not?: boolean | null;
+}
diff --git a/apps/maestri-edu-server/src/util/DateTimeFilter.ts b/apps/maestri-edu-server/src/util/DateTimeFilter.ts
new file mode 100644
index 0000000..d2b6dfb
--- /dev/null
+++ b/apps/maestri-edu-server/src/util/DateTimeFilter.ts
@@ -0,0 +1,97 @@
+import { Field, InputType } from "@nestjs/graphql";
+import { ApiProperty } from "@nestjs/swagger";
+import { IsOptional } from "class-validator";
+import { Type } from "class-transformer";
+@InputType({
+ isAbstract: true,
+ description: undefined,
+})
+export class DateTimeFilter {
+ @ApiProperty({
+ required: false,
+ type: Date,
+ })
+ @IsOptional()
+ @Field(() => Date, {
+ nullable: true,
+ })
+ @Type(() => Date)
+ equals?: Date;
+
+ @ApiProperty({
+ required: false,
+ type: Date,
+ })
+ @IsOptional()
+ @Field(() => Date, {
+ nullable: true,
+ })
+ @Type(() => Date)
+ not?: Date;
+
+ @ApiProperty({
+ required: false,
+ type: [Date],
+ })
+ @IsOptional()
+ @Field(() => [Date], {
+ nullable: true,
+ })
+ @Type(() => Date)
+ in?: Date[];
+
+ @ApiProperty({
+ required: false,
+ type: [Date],
+ })
+ @IsOptional()
+ @Field(() => [Date], {
+ nullable: true,
+ })
+ @Type(() => Date)
+ notIn?: Date[];
+
+ @ApiProperty({
+ required: false,
+ type: Date,
+ })
+ @IsOptional()
+ @Field(() => Date, {
+ nullable: true,
+ })
+ @Type(() => Date)
+ lt?: Date;
+
+ @ApiProperty({
+ required: false,
+ type: Date,
+ })
+ @IsOptional()
+ @Field(() => Date, {
+ nullable: true,
+ })
+ @Type(() => Date)
+ lte?: Date;
+
+ @ApiProperty({
+ required: false,
+ type: Date,
+ })
+ @IsOptional()
+ @Field(() => Date, {
+ nullable: true,
+ })
+ @Type(() => Date)
+ gt?: Date;
+
+ @ApiProperty({
+ required: false,
+ type: Date,
+ })
+ @IsOptional()
+ @Field(() => Date, {
+ nullable: true,
+ })
+ @Type(() => Date)
+ gte?: Date;
+}
diff --git a/apps/maestri-edu-server/src/util/DateTimeNullableFilter.ts b/apps/maestri-edu-server/src/util/DateTimeNullableFilter.ts
new file mode 100644
index 0000000..ccc00a5
--- /dev/null
+++ b/apps/maestri-edu-server/src/util/DateTimeNullableFilter.ts
@@ -0,0 +1,97 @@
+import { Field, InputType } from "@nestjs/graphql";
+import { ApiProperty } from "@nestjs/swagger";
+import { IsOptional } from "class-validator";
+import { Type } from "class-transformer";
+@InputType({
+ isAbstract: true,
+ description: undefined,
+})
+export class DateTimeNullableFilter {
+ @ApiProperty({
+ required: false,
+ type: Date,
+ })
+ @IsOptional()
+ @Field(() => Date, {
+ nullable: true,
+ })
+ @Type(() => Date)
+ equals?: Date | null;
+
+ @ApiProperty({
+ required: false,
+ type: [Date],
+ })
+ @IsOptional()
+ @Field(() => [Date], {
+ nullable: true,
+ })
+ @Type(() => Date)
+ in?: Date[] | null;
+
+ @ApiProperty({
+ required: false,
+ type: [Date],
+ })
+ @IsOptional()
+ @Field(() => [Date], {
+ nullable: true,
+ })
+ @Type(() => Date)
+ notIn?: Date[] | null;
+
+ @ApiProperty({
+ required: false,
+ type: Date,
+ })
+ @IsOptional()
+ @Field(() => Date, {
+ nullable: true,
+ })
+ @Type(() => Date)
+ lt?: Date;
+
+ @ApiProperty({
+ required: false,
+ type: Date,
+ })
+ @IsOptional()
+ @Field(() => Date, {
+ nullable: true,
+ })
+ @Type(() => Date)
+ lte?: Date;
+
+ @ApiProperty({
+ required: false,
+ type: Date,
+ })
+ @IsOptional()
+ @Field(() => Date, {
+ nullable: true,
+ })
+ @Type(() => Date)
+ gt?: Date;
+
+ @ApiProperty({
+ required: false,
+ type: Date,
+ })
+ @IsOptional()
+ @Field(() => Date, {
+ nullable: true,
+ })
+ @Type(() => Date)
+ gte?: Date;
+
+ @ApiProperty({
+ required: false,
+ type: Date,
+ })
+ @IsOptional()
+ @Field(() => Date, {
+ nullable: true,
+ })
+ @Type(() => Date)
+ not?: Date;
+}
diff --git a/apps/maestri-edu-server/src/util/DecimalFilter.ts b/apps/maestri-edu-server/src/util/DecimalFilter.ts
new file mode 100644
index 0000000..b45bc85
--- /dev/null
+++ b/apps/maestri-edu-server/src/util/DecimalFilter.ts
@@ -0,0 +1,99 @@
+import { Field, InputType, Float } from "@nestjs/graphql";
+import { ApiProperty } from "@nestjs/swagger";
+import { IsOptional } from "class-validator";
+import { Type } from "class-transformer";
+import { Decimal } from "decimal.js";
+
+@InputType({
+ isAbstract: true,
+ description: undefined,
+})
+export class DecimalFilter {
+ @ApiProperty({
+ required: false,
+ type: Number,
+ })
+ @IsOptional()
+ @Field(() => Float, {
+ nullable: true,
+ })
+ @Type(() => Number)
+ equals?: Decimal;
+
+ @ApiProperty({
+ required: false,
+ type: Number,
+ })
+ @IsOptional()
+ @Field(() => [Float], {
+ nullable: true,
+ })
+ @Type(() => Number)
+ in?: Decimal[];
+
+ @ApiProperty({
+ required: false,
+ type: [Number],
+ })
+ @IsOptional()
+ @Field(() => [Float], {
+ nullable: true,
+ })
+ @Type(() => Number)
+ notIn?: Decimal[];
+
+ @ApiProperty({
+ required: false,
+ type: Number,
+ })
+ @IsOptional()
+ @Field(() => Float, {
+ nullable: true,
+ })
+ @Type(() => Number)
+ lt?: Decimal;
+
+ @ApiProperty({
+ required: false,
+ type: Number,
+ })
+ @IsOptional()
+ @Field(() => Float, {
+ nullable: true,
+ })
+ @Type(() => Number)
+ lte?: Decimal;
+
+ @ApiProperty({
+ required: false,
+ type: Number,
+ })
+ @IsOptional()
+ @Field(() => Float, {
+ nullable: true,
+ })
+ @Type(() => Number)
+ gt?: Decimal;
+
+ @ApiProperty({
+ required: false,
+ type: Number,
+ })
+ @IsOptional()
+ @Field(() => Float, {
+ nullable: true,
+ })
+ @Type(() => Number)
+ gte?: Decimal;
+
+ @ApiProperty({
+ required: false,
+ type: Number,
+ })
+ @IsOptional()
+ @Field(() => Float, {
+ nullable: true,
+ })
+ @Type(() => Number)
+ not?: Decimal;
+}
diff --git a/apps/maestri-edu-server/src/util/DecimalNullableFilter.ts b/apps/maestri-edu-server/src/util/DecimalNullableFilter.ts
new file mode 100644
index 0000000..085fab9
--- /dev/null
+++ b/apps/maestri-edu-server/src/util/DecimalNullableFilter.ts
@@ -0,0 +1,99 @@
+import { Field, InputType } from "@nestjs/graphql";
+import { ApiProperty } from "@nestjs/swagger";
+import { IsOptional } from "class-validator";
+import { Type } from "class-transformer";
+import { Decimal } from "decimal.js";
+
+@InputType({
+ isAbstract: true,
+ description: undefined,
+})
+export class DecimalNullableFilter {
+ @ApiProperty({
+ required: false,
+ type: Decimal,
+ })
+ @IsOptional()
+ @Field(() => Number, {
+ nullable: true,
+ })
+ @Type(() => Decimal)
+ equals?: Decimal | null;
+
+ @ApiProperty({
+ required: false,
+ type: [Decimal],
+ })
+ @IsOptional()
+ @Field(() => [Number], {
+ nullable: true,
+ })
+ @Type(() => Number)
+ in?: Decimal[] | null;
+
+ @ApiProperty({
+ required: false,
+ type: [Decimal],
+ })
+ @IsOptional()
+ @Field(() => [Number], {
+ nullable: true,
+ })
+ @Type(() => Decimal)
+ notIn?: Decimal[] | null;
+
+ @ApiProperty({
+ required: false,
+ type: Decimal,
+ })
+ @IsOptional()
+ @Field(() => Number, {
+ nullable: true,
+ })
+ @Type(() => Decimal)
+ lt?: Decimal;
+
+ @ApiProperty({
+ required: false,
+ type: Decimal,
+ })
+ @IsOptional()
+ @Field(() => Number, {
+ nullable: true,
+ })
+ @Type(() => Decimal)
+ lte?: Decimal;
+
+ @ApiProperty({
+ required: false,
+ type: Decimal,
+ })
+ @IsOptional()
+ @Field(() => Number, {
+ nullable: true,
+ })
+ @Type(() => Decimal)
+ gt?: Decimal;
+
+ @ApiProperty({
+ required: false,
+ type: Decimal,
+ })
+ @IsOptional()
+ @Field(() => Number, {
+ nullable: true,
+ })
+ @Type(() => Decimal)
+ gte?: Decimal;
+
+ @ApiProperty({
+ required: false,
+ type: Decimal,
+ })
+ @IsOptional()
+ @Field(() => Number, {
+ nullable: true,
+ })
+ @Type(() => Decimal)
+ not?: Decimal;
+}
diff --git a/apps/maestri-edu-server/src/util/FloatFilter.ts b/apps/maestri-edu-server/src/util/FloatFilter.ts
new file mode 100644
index 0000000..a3266d2
--- /dev/null
+++ b/apps/maestri-edu-server/src/util/FloatFilter.ts
@@ -0,0 +1,98 @@
+import { Field, InputType, Float } from "@nestjs/graphql";
+import { ApiProperty } from "@nestjs/swagger";
+import { IsOptional } from "class-validator";
+import { Type } from "class-transformer";
+
+@InputType({
+ isAbstract: true,
+ description: undefined,
+})
+export class FloatFilter {
+ @ApiProperty({
+ required: false,
+ type: Number,
+ })
+ @IsOptional()
+ @Field(() => Float, {
+ nullable: true,
+ })
+ @Type(() => Number)
+ equals?: number;
+
+ @ApiProperty({
+ required: false,
+ type: Number,
+ })
+ @IsOptional()
+ @Field(() => [Float], {
+ nullable: true,
+ })
+ @Type(() => Number)
+ in?: number[];
+
+ @ApiProperty({
+ required: false,
+ type: [Number],
+ })
+ @IsOptional()
+ @Field(() => [Float], {
+ nullable: true,
+ })
+ @Type(() => Number)
+ notIn?: number[];
+
+ @ApiProperty({
+ required: false,
+ type: Number,
+ })
+ @IsOptional()
+ @Field(() => Float, {
+ nullable: true,
+ })
+ @Type(() => Number)
+ lt?: number;
+
+ @ApiProperty({
+ required: false,
+ type: Number,
+ })
+ @IsOptional()
+ @Field(() => Float, {
+ nullable: true,
+ })
+ @Type(() => Number)
+ lte?: number;
+
+ @ApiProperty({
+ required: false,
+ type: Number,
+ })
+ @IsOptional()
+ @Field(() => Float, {
+ nullable: true,
+ })
+ @Type(() => Number)
+ gt?: number;
+
+ @ApiProperty({
+ required: false,
+ type: Number,
+ })
+ @IsOptional()
+ @Field(() => Float, {
+ nullable: true,
+ })
+ @Type(() => Number)
+ gte?: number;
+
+ @ApiProperty({
+ required: false,
+ type: Number,
+ })
+ @IsOptional()
+ @Field(() => Float, {
+ nullable: true,
+ })
+ @Type(() => Number)
+ not?: number;
+}
diff --git a/apps/maestri-edu-server/src/util/FloatNullableFilter.ts b/apps/maestri-edu-server/src/util/FloatNullableFilter.ts
new file mode 100644
index 0000000..feb0fc5
--- /dev/null
+++ b/apps/maestri-edu-server/src/util/FloatNullableFilter.ts
@@ -0,0 +1,98 @@
+import { Field, InputType, Float } from "@nestjs/graphql";
+import { ApiProperty } from "@nestjs/swagger";
+import { IsOptional } from "class-validator";
+import { Type } from "class-transformer";
+
+@InputType({
+ isAbstract: true,
+ description: undefined,
+})
+export class FloatNullableFilter {
+ @ApiProperty({
+ required: false,
+ type: Number,
+ })
+ @IsOptional()
+ @Field(() => Float, {
+ nullable: true,
+ })
+ @Type(() => Number)
+ equals?: number | null;
+
+ @ApiProperty({
+ required: false,
+ type: [Number],
+ })
+ @IsOptional()
+ @Field(() => [Float], {
+ nullable: true,
+ })
+ @Type(() => Number)
+ in?: number[] | null;
+
+ @ApiProperty({
+ required: false,
+ type: [Number],
+ })
+ @IsOptional()
+ @Field(() => [Float], {
+ nullable: true,
+ })
+ @Type(() => Number)
+ notIn?: number[] | null;
+
+ @ApiProperty({
+ required: false,
+ type: Number,
+ })
+ @IsOptional()
+ @Field(() => Float, {
+ nullable: true,
+ })
+ @Type(() => Number)
+ lt?: number;
+
+ @ApiProperty({
+ required: false,
+ type: Number,
+ })
+ @IsOptional()
+ @Field(() => Float, {
+ nullable: true,
+ })
+ @Type(() => Number)
+ lte?: number;
+
+ @ApiProperty({
+ required: false,
+ type: Number,
+ })
+ @IsOptional()
+ @Field(() => Float, {
+ nullable: true,
+ })
+ @Type(() => Number)
+ gt?: number;
+
+ @ApiProperty({
+ required: false,
+ type: Number,
+ })
+ @IsOptional()
+ @Field(() => Float, {
+ nullable: true,
+ })
+ @Type(() => Number)
+ gte?: number;
+
+ @ApiProperty({
+ required: false,
+ type: Number,
+ })
+ @IsOptional()
+ @Field(() => Float, {
+ nullable: true,
+ })
+ @Type(() => Number)
+ not?: number;
+}
diff --git a/apps/maestri-edu-server/src/util/IntFilter.ts b/apps/maestri-edu-server/src/util/IntFilter.ts
new file mode 100644
index 0000000..f6880e7
--- /dev/null
+++ b/apps/maestri-edu-server/src/util/IntFilter.ts
@@ -0,0 +1,98 @@
+import { Field, InputType, Int } from "@nestjs/graphql";
+import { ApiProperty } from "@nestjs/swagger";
+import { IsOptional } from "class-validator";
+import { Type } from "class-transformer";
+
+@InputType({
+ isAbstract: true,
+ description: undefined,
+})
+export class IntFilter {
+ @ApiProperty({
+ required: false,
+ type: Number,
+ })
+ @IsOptional()
+ @Field(() => Int, {
+ nullable: true,
+ })
+ @Type(() => Number)
+ equals?: number;
+
+ @ApiProperty({
+ required: false,
+ type: [Number],
+ })
+ @IsOptional()
+ @Field(() => [Int], {
+ nullable: true,
+ })
+ @Type(() => Number)
+ in?: number[];
+
+ @ApiProperty({
+ required: false,
+ type: [Number],
+ })
+ @IsOptional()
+ @Field(() => [Int], {
+ nullable: true,
+ })
+ @Type(() => Number)
+ notIn?: number[];
+
+ @ApiProperty({
+ required: false,
+ type: Number,
+ })
+ @IsOptional()
+ @Field(() => Int, {
+ nullable: true,
+ })
+ @Type(() => Number)
+ lt?: number;
+
+ @ApiProperty({
+ required: false,
+ type: Number,
+ })
+ @IsOptional()
+ @Field(() => Int, {
+ nullable: true,
+ })
+ @Type(() => Number)
+ lte?: number;
+
+ @ApiProperty({
+ required: false,
+ type: Number,
+ })
+ @IsOptional()
+ @Field(() => Int, {
+ nullable: true,
+ })
+ @Type(() => Number)
+ gt?: number;
+
+ @ApiProperty({
+ required: false,
+ type: Number,
+ })
+ @IsOptional()
+ @Field(() => Int, {
+ nullable: true,
+ })
+ @Type(() => Number)
+ gte?: number;
+
+ @ApiProperty({
+ required: false,
+ type: Number,
+ })
+ @IsOptional()
+ @Field(() => Int, {
+ nullable: true,
+ })
+ @Type(() => Number)
+ not?: number;
+}
diff --git a/apps/maestri-edu-server/src/util/IntNullableFilter.ts b/apps/maestri-edu-server/src/util/IntNullableFilter.ts
new file mode 100644
index 0000000..e3b71a3
--- /dev/null
+++ b/apps/maestri-edu-server/src/util/IntNullableFilter.ts
@@ -0,0 +1,98 @@
+import { Field, InputType, Int } from "@nestjs/graphql";
+import { ApiProperty } from "@nestjs/swagger";
+import { IsOptional } from "class-validator";
+import { Type } from "class-transformer";
+
+@InputType({
+ isAbstract: true,
+ description: undefined,
+})
+export class IntNullableFilter {
+ @ApiProperty({
+ required: false,
+ type: Number,
+ })
+ @IsOptional()
+ @Field(() => Int, {
+ nullable: true,
+ })
+ @Type(() => Number)
+ equals?: number | null;
+
+ @ApiProperty({
+ required: false,
+ type: [Number],
+ })
+ @IsOptional()
+ @Field(() => [Int], {
+ nullable: true,
+ })
+ @Type(() => Number)
+ in?: number[] | null;
+
+ @ApiProperty({
+ required: false,
+ type: [Number],
+ })
+ @IsOptional()
+ @Field(() => [Int], {
+ nullable: true,
+ })
+ @Type(() => Number)
+ notIn?: number[] | null;
+
+ @ApiProperty({
+ required: false,
+ type: Number,
+ })
+ @IsOptional()
+ @Field(() => Int, {
+ nullable: true,
+ })
+ @Type(() => Number)
+ lt?: number;
+
+ @ApiProperty({
+ required: false,
+ type: Number,
+ })
+ @IsOptional()
+ @Field(() => Int, {
+ nullable: true,
+ })
+ @Type(() => Number)
+ lte?: number;
+
+ @ApiProperty({
+ required: false,
+ type: Number,
+ })
+ @IsOptional()
+ @Field(() => Int, {
+ nullable: true,
+ })
+ @Type(() => Number)
+ gt?: number;
+
+ @ApiProperty({
+ required: false,
+ type: Number,
+ })
+ @IsOptional()
+ @Field(() => Int, {
+ nullable: true,
+ })
+ @Type(() => Number)
+ gte?: number;
+
+ @ApiProperty({
+ required: false,
+ type: Number,
+ })
+ @IsOptional()
+ @Field(() => Int, {
+ nullable: true,
+ })
+ @Type(() => Number)
+ not?: number;
+}
diff --git a/apps/maestri-edu-server/src/util/JsonFilter.ts b/apps/maestri-edu-server/src/util/JsonFilter.ts
new file mode 100644
index 0000000..7040b74
--- /dev/null
+++ b/apps/maestri-edu-server/src/util/JsonFilter.ts
@@ -0,0 +1,31 @@
+import { Field, InputType } from "@nestjs/graphql";
+import { ApiProperty } from "@nestjs/swagger";
+import { IsOptional } from "class-validator";
+import { GraphQLJSONObject } from "graphql-type-json";
+import { InputJsonValue } from "../types";
+
+@InputType({
+ isAbstract: true,
+ description: undefined,
+})
+export class JsonFilter {
+ @ApiProperty({
+ required: false,
+ type: GraphQLJSONObject,
+ })
+ @IsOptional()
+ @Field(() => GraphQLJSONObject, {
+ nullable: true,
+ })
+ equals?: InputJsonValue;
+
+ @ApiProperty({
+ required: false,
+ type: GraphQLJSONObject,
+ })
+ @IsOptional()
+ @Field(() => GraphQLJSONObject, {
+ nullable: true,
+ })
+ not?: InputJsonValue;
+}
diff --git a/apps/maestri-edu-server/src/util/JsonNullableFilter.ts b/apps/maestri-edu-server/src/util/JsonNullableFilter.ts
new file mode 100644
index 0000000..3381d52
--- /dev/null
+++ b/apps/maestri-edu-server/src/util/JsonNullableFilter.ts
@@ -0,0 +1,31 @@
+import type { JsonValue } from "type-fest";
+import { Field, InputType } from "@nestjs/graphql";
+import { ApiProperty } from "@nestjs/swagger";
+import { IsOptional } from "class-validator";
+import { GraphQLJSONObject } from "graphql-type-json";
+
+@InputType({
+ isAbstract: true,
+ description: undefined,
+})
+export class JsonNullableFilter {
+ @ApiProperty({
+ required: false,
+ type: GraphQLJSONObject,
+ })
+ @IsOptional()
+ @Field(() => GraphQLJSONObject, {
+ nullable: true,
+ })
+ equals?: JsonValue;
+
+ @ApiProperty({
+ required: false,
+ type: GraphQLJSONObject,
+ })
+ @IsOptional()
+ @Field(() => GraphQLJSONObject, {
+ nullable: true,
+ })
+ not?: JsonValue;
+}
diff --git a/apps/maestri-edu-server/src/util/MetaQueryPayload.ts b/apps/maestri-edu-server/src/util/MetaQueryPayload.ts
new file mode 100644
index 0000000..fc30531
--- /dev/null
+++ b/apps/maestri-edu-server/src/util/MetaQueryPayload.ts
@@ -0,0 +1,13 @@
+import { ObjectType, Field } from "@nestjs/graphql";
+import { ApiProperty } from "@nestjs/swagger";
+
+@ObjectType()
+class MetaQueryPayload {
+ @ApiProperty({
+ required: true,
+ type: [Number],
+ })
+ @Field(() => Number)
+ count!: number;
+}
+export { MetaQueryPayload };
diff --git a/apps/maestri-edu-server/src/util/QueryMode.ts b/apps/maestri-edu-server/src/util/QueryMode.ts
new file mode 100644
index 0000000..f9b1653
--- /dev/null
+++ b/apps/maestri-edu-server/src/util/QueryMode.ts
@@ -0,0 +1,10 @@
+import { registerEnumType } from "@nestjs/graphql";
+
+export enum QueryMode {
+ Default = "default",
+ Insensitive = "insensitive",
+}
+registerEnumType(QueryMode, {
+ name: "QueryMode",
+ description: undefined,
+});
diff --git a/apps/maestri-edu-server/src/util/SortOrder.ts b/apps/maestri-edu-server/src/util/SortOrder.ts
new file mode 100644
index 0000000..d4108e6
--- /dev/null
+++ b/apps/maestri-edu-server/src/util/SortOrder.ts
@@ -0,0 +1,10 @@
+import { registerEnumType } from "@nestjs/graphql";
+
+export enum SortOrder {
+ Asc = "asc",
+ Desc = "desc",
+}
+registerEnumType(SortOrder, {
+ name: "SortOrder",
+ description: undefined,
+});
diff --git a/apps/maestri-edu-server/src/util/StringFilter.ts b/apps/maestri-edu-server/src/util/StringFilter.ts
new file mode 100644
index 0000000..80b573d
--- /dev/null
+++ b/apps/maestri-edu-server/src/util/StringFilter.ts
@@ -0,0 +1,141 @@
+import { Field, InputType } from "@nestjs/graphql";
+import { QueryMode } from "./QueryMode";
+import { ApiProperty } from "@nestjs/swagger";
+import { IsOptional } from "class-validator";
+import { Type } from "class-transformer";
+
+@InputType({
+ isAbstract: true,
+})
+export class StringFilter {
+ @ApiProperty({
+ required: false,
+ type: String,
+ })
+ @IsOptional()
+ @Field(() => String, {
+ nullable: true,
+ })
+ @Type(() => String)
+ equals?: string;
+
+ @ApiProperty({
+ required: false,
+ type: [String],
+ })
+ @IsOptional()
+ @Field(() => [String], {
+ nullable: true,
+ })
+ @Type(() => String)
+ in?: string[];
+
+ @ApiProperty({
+ required: false,
+ type: [String],
+ })
+ @IsOptional()
+ @Field(() => [String], {
+ nullable: true,
+ })
+ @Type(() => String)
+ notIn?: string[];
+
+ @ApiProperty({
+ required: false,
+ type: String,
+ })
+ @IsOptional()
+ @Field(() => String, {
+ nullable: true,
+ })
+ @Type(() => String)
+ lt?: string;
+
+ @ApiProperty({
+ required: false,
+ type: String,
+ })
+ @IsOptional()
+ @Field(() => String, {
+ nullable: true,
+ })
+ @Type(() => String)
+ lte?: string;
+
+ @ApiProperty({
+ required: false,
+ type: String,
+ })
+ @IsOptional()
+ @Field(() => String, {
+ nullable: true,
+ })
+ @Type(() => String)
+ gt?: string;
+
+ @ApiProperty({
+ required: false,
+ type: String,
+ })
+ @IsOptional()
+ @Field(() => String, {
+ nullable: true,
+ })
+ @Type(() => String)
+ gte?: string;
+
+ @ApiProperty({
+ required: false,
+ type: String,
+ })
+ @IsOptional()
+ @Field(() => String, {
+ nullable: true,
+ })
+ @Type(() => String)
+ contains?: string;
+
+ @ApiProperty({
+ required: false,
+ type: String,
+ })
+ @IsOptional()
+ @Field(() => String, {
+ nullable: true,
+ })
+ @Type(() => String)
+ startsWith?: string;
+
+ @ApiProperty({
+ required: false,
+ type: String,
+ })
+ @IsOptional()
+ @Field(() => String, {
+ nullable: true,
+ })
+ @Type(() => String)
+ endsWith?: string;
+
+ @ApiProperty({
+ required: false,
+ enum: ["Default", "Insensitive"],
+ })
+ @IsOptional()
+ @Field(() => QueryMode, {
+ nullable: true,
+ })
+ mode?: QueryMode;
+
+ @ApiProperty({
+ required: false,
+ type: String,
+ })
+ @IsOptional()
+ @Field(() => String, {
+ nullable: true,
+ })
+ @Type(() => String)
+ not?: string;
+}
diff --git a/apps/maestri-edu-server/src/util/StringNullableFilter.ts b/apps/maestri-edu-server/src/util/StringNullableFilter.ts
new file mode 100644
index 0000000..01b399c
--- /dev/null
+++ b/apps/maestri-edu-server/src/util/StringNullableFilter.ts
@@ -0,0 +1,141 @@
+import { Field, InputType } from "@nestjs/graphql";
+import { QueryMode } from "./QueryMode";
+import { ApiProperty } from "@nestjs/swagger";
+import { IsOptional } from "class-validator";
+import { Type } from "class-transformer";
+
+@InputType({
+ isAbstract: true,
+})
+export class StringNullableFilter {
+ @ApiProperty({
+ required: false,
+ type: String,
+ })
+ @IsOptional()
+ @Field(() => String, {
+ nullable: true,
+ })
+ @Type(() => String)
+ equals?: string | null;
+
+ @ApiProperty({
+ required: false,
+ type: [String],
+ })
+ @IsOptional()
+ @Field(() => [String], {
+ nullable: true,
+ })
+ @Type(() => String)
+ in?: string[] | null;
+
+ @ApiProperty({
+ required: false,
+ type: [String],
+ })
+ @IsOptional()
+ @Field(() => [String], {
+ nullable: true,
+ })
+ @Type(() => String)
+ notIn?: string[] | null;
+
+ @ApiProperty({
+ required: false,
+ type: String,
+ })
+ @IsOptional()
+ @Field(() => String, {
+ nullable: true,
+ })
+ @Type(() => String)
+ lt?: string;
+
+ @ApiProperty({
+ required: false,
+ type: String,
+ })
+ @IsOptional()
+ @Field(() => String, {
+ nullable: true,
+ })
+ @Type(() => String)
+ lte?: string;
+
+ @ApiProperty({
+ required: false,
+ type: String,
+ })
+ @IsOptional()
+ @Field(() => String, {
+ nullable: true,
+ })
+ @Type(() => String)
+ gt?: string;
+
+ @ApiProperty({
+ required: false,
+ type: String,
+ })
+ @IsOptional()
+ @Field(() => String, {
+ nullable: true,
+ })
+ @Type(() => String)
+ gte?: string;
+
+ @ApiProperty({
+ required: false,
+ type: String,
+ })
+ @IsOptional()
+ @Field(() => String, {
+ nullable: true,
+ })
+ @Type(() => String)
+ contains?: string;
+
+ @ApiProperty({
+ required: false,
+ type: String,
+ })
+ @IsOptional()
+ @Field(() => String, {
+ nullable: true,
+ })
+ @Type(() => String)
+ startsWith?: string;
+
+ @ApiProperty({
+ required: false,
+ type: String,
+ })
+ @IsOptional()
+ @Field(() => String, {
+ nullable: true,
+ })
+ @Type(() => String)
+ endsWith?: string;
+
+ @ApiProperty({
+ required: false,
+ enum: ["Default", "Insensitive"],
+ })
+ @IsOptional()
+ @Field(() => QueryMode, {
+ nullable: true,
+ })
+ mode?: QueryMode;
+
+ @ApiProperty({
+ required: false,
+ type: String,
+ })
+ @IsOptional()
+ @Field(() => String, {
+ nullable: true,
+ })
+ @Type(() => String)
+ not?: string;
+}
diff --git a/apps/maestri-edu-server/src/validators/index.ts b/apps/maestri-edu-server/src/validators/index.ts
new file mode 100644
index 0000000..7f62d84
--- /dev/null
+++ b/apps/maestri-edu-server/src/validators/index.ts
@@ -0,0 +1 @@
+export * from "./is-json-value-validator";
diff --git a/apps/maestri-edu-server/src/validators/is-json-value-validator.spec.ts b/apps/maestri-edu-server/src/validators/is-json-value-validator.spec.ts
new file mode 100644
index 0000000..5a77824
--- /dev/null
+++ b/apps/maestri-edu-server/src/validators/is-json-value-validator.spec.ts
@@ -0,0 +1,44 @@
+import { validate, ValidationError } from "class-validator";
+import { IsJSONValue } from "./is-json-value-validator";
+
+class TestClass {
+ @IsJSONValue()
+ jsonProperty: unknown;
+}
+
+describe("IsJSONValue", () => {
+ it("should validate a valid JSON string", async () => {
+ const testObj = new TestClass();
+ testObj.jsonProperty = '{"name": "John", "age": 30}';
+ const errors: ValidationError[] = await validate(testObj);
+ expect(errors.length).toBe(0);
+ });
+
+ it("should not validate an invalid JSON string", async () => {
+ const testObj = new TestClass();
+ testObj.jsonProperty = '{name: "John", age: 30}';
+ const errors: ValidationError[] = await validate(testObj);
+ expect(errors.length).toBe(1);
+ });
+
+ it("should not validate an invalid JSON string", async () => {
+ const testObj = new TestClass();
+ testObj.jsonProperty = "John";
+ const errors: ValidationError[] = await validate(testObj);
+ expect(errors.length).toBe(1);
+ });
+
+ it("should validate a valid JSON object", async () => {
+ const testObj = new TestClass();
+ testObj.jsonProperty = { name: "John", age: 30 };
+ const errors: ValidationError[] = await validate(testObj);
+ expect(errors.length).toBe(0);
+ });
+
+ it("should validate a valid JSON array", async () => {
+ const testObj = new TestClass();
+ testObj.jsonProperty = ["John", "30"];
+ const errors: ValidationError[] = await validate(testObj);
+ expect(errors.length).toBe(0);
+ });
+});
diff --git a/apps/maestri-edu-server/src/validators/is-json-value-validator.ts b/apps/maestri-edu-server/src/validators/is-json-value-validator.ts
new file mode 100644
index 0000000..1002540
--- /dev/null
+++ b/apps/maestri-edu-server/src/validators/is-json-value-validator.ts
@@ -0,0 +1,29 @@
+import {
+ ValidationArguments,
+ registerDecorator,
+ ValidationOptions,
+} from "class-validator";
+import isJSONValidator from "validator/lib/isJSON";
+
+export function IsJSONValue(validationOptions?: ValidationOptions) {
+ return function (object: Record, propertyName: string) {
+ registerDecorator({
+ name: "IsJSONValue",
+ target: object.constructor,
+ propertyName: propertyName,
+ options: validationOptions,
+ validator: {
+ validate(value: any, args: ValidationArguments) {
+ if (typeof value === "string") {
+ return isJSONValidator(value);
+ }
+
+ return isJSONValidator(JSON.stringify(value));
+ },
+ defaultMessage(args: ValidationArguments): string {
+ return `${args.property} must be a valid json`;
+ },
+ },
+ });
+ };
+}
diff --git a/apps/maestri-edu-server/tsconfig.build.json b/apps/maestri-edu-server/tsconfig.build.json
new file mode 100644
index 0000000..e579401
--- /dev/null
+++ b/apps/maestri-edu-server/tsconfig.build.json
@@ -0,0 +1,4 @@
+{
+ "extends": "./tsconfig.json",
+ "exclude": ["node_modules", "prisma", "test", "dist", "**/*spec.ts", "admin"]
+}
diff --git a/apps/maestri-edu-server/tsconfig.json b/apps/maestri-edu-server/tsconfig.json
new file mode 100644
index 0000000..707e8cd
--- /dev/null
+++ b/apps/maestri-edu-server/tsconfig.json
@@ -0,0 +1,21 @@
+{
+ "compilerOptions": {
+ "baseUrl": "./",
+ "module": "commonjs",
+ "declaration": false,
+ "removeComments": true,
+ "emitDecoratorMetadata": true,
+ "experimentalDecorators": true,
+ "target": "es2022",
+ "lib": ["es2023"],
+ "sourceMap": true,
+ "outDir": "./dist",
+ "incremental": true,
+ "esModuleInterop": true,
+ "allowSyntheticDefaultImports": true,
+ "resolveJsonModule": true,
+ "skipLibCheck": true,
+ "strict": true
+ },
+ "include": ["src"]
+}