feat: implement inventory, product brand, product category, product info, product, role, store, user, and vendor modules with CRUD operations

- Added Create and Update DTOs for Inventory, Product Brand, Product Category, Product Info, Product, Role, Store, User, and Vendor.
- Implemented InventoriesController, ProductBrandsController, ProductCategoriesController, ProductInfoController, ProductsController, RolesController, StoresController, UsersController, and VendorsController with respective CRUD endpoints.
- Developed InventoriesService, ProductBrandsService, ProductCategoriesService, ProductInfoService, ProductsService, RolesService, StoresService, UsersService, and VendorsService to handle business logic.
- Created PrismaModule and PrismaService for database interactions using Prisma with MariaDB adapter.
- Configured application with Swagger for API documentation and added global interceptors for logging and response mapping.
- Established e2e testing setup with Jest for the application.
This commit is contained in:
2025-12-04 21:05:57 +03:30
commit 621e15dd02
98 changed files with 26046 additions and 0 deletions
+22
View File
@@ -0,0 +1,22 @@
import { Test, TestingModule } from '@nestjs/testing';
import { AppController } from './app.controller';
import { AppService } from './app.service';
describe('AppController', () => {
let appController: AppController;
beforeEach(async () => {
const app: TestingModule = await Test.createTestingModule({
controllers: [AppController],
providers: [AppService],
}).compile();
appController = app.get<AppController>(AppController);
});
describe('root', () => {
it('should return "Hello World!"', () => {
expect(appController.getHello()).toBe('Hello World!');
});
});
});
+12
View File
@@ -0,0 +1,12 @@
import { Controller, Get } from '@nestjs/common';
import { AppService } from './app.service';
@Controller()
export class AppController {
constructor(private readonly appService: AppService) {}
@Get()
getHello(): string {
return this.appService.getHello();
}
}
+33
View File
@@ -0,0 +1,33 @@
import { Module } from '@nestjs/common'
import { AppController } from './app.controller'
import { AppService } from './app.service'
import { CustomersModule } from './customers/customers.module'
import { InventoriesModule } from './inventories/inventories.module'
import { PrismaModule } from './prisma/prisma.module'
import { ProductBrandsModule } from './product-brands/product-brands.module'
import { ProductCategoriesModule } from './product-categories/product-categories.module'
import { ProductInfoModule } from './product-info/product-info.module'
import { ProductsModule } from './products/products.module'
import { RolesModule } from './roles/roles.module'
import { StoresModule } from './stores/stores.module'
import { UsersModule } from './users/users.module'
import { VendorsModule } from './vendors/vendors.module'
@Module({
imports: [
PrismaModule,
UsersModule,
RolesModule,
ProductsModule,
ProductInfoModule,
ProductBrandsModule,
ProductCategoriesModule,
VendorsModule,
CustomersModule,
InventoriesModule,
StoresModule,
],
controllers: [AppController],
providers: [AppService],
})
export class AppModule {}
+8
View File
@@ -0,0 +1,8 @@
import { Injectable } from '@nestjs/common';
@Injectable()
export class AppService {
getHello(): string {
return 'Hello World!';
}
}
@@ -0,0 +1,32 @@
import {
CallHandler,
ExecutionContext,
Injectable,
NestInterceptor,
} from '@nestjs/common'
import { Observable, tap } from 'rxjs'
@Injectable()
export class LoggingInterceptor implements NestInterceptor {
intercept(context: ExecutionContext, next: CallHandler): Observable<any> {
const req = context.switchToHttp().getRequest()
const method = req?.method ?? 'UNKNOWN'
const url = req?.url ?? 'UNKNOWN'
const now = Date.now()
console.log(`[Request] ${method} ${url}`)
return next.handle().pipe(
tap({
next: () => {
const ms = Date.now() - now
console.log(`[Response] ${method} ${url} - ${ms}ms`)
},
error: err => {
const ms = Date.now() - now
console.error(`[Error] ${method} ${url} - ${ms}ms`, err?.message ?? err)
},
}),
)
}
}
@@ -0,0 +1,126 @@
import {
CallHandler,
ExecutionContext,
Injectable,
NestInterceptor,
} from '@nestjs/common'
import { Observable } from 'rxjs'
import { map } from 'rxjs/operators'
/**
* ResponseMappingInterceptor
*
* Wraps successful handler results in a consistent response envelope.
* Example output:
* {
* statusCode: 200,
* timestamp: '2025-12-04T19:00:00.000Z',
* path: '/api/v1/users',
* data: { ... }
* }
*/
@Injectable()
export class ResponseMappingInterceptor implements NestInterceptor {
intercept(context: ExecutionContext, next: CallHandler): Observable<any> {
const http = context.switchToHttp()
const response = http.getResponse()
const request = http.getRequest()
return next.handle().pipe(
map(data => {
const statusCode = response?.statusCode ?? 200
// Normalize list/paginated responses into { data, meta }
let payload = data
let meta: any = undefined
// Case: plain array -> treat as list
if (Array.isArray(data)) {
payload = data
meta = {
totalRecords: data.length,
totalPages: 1,
page: 1,
perPage: data.length,
}
} else if (data && typeof data === 'object') {
// Common pagination shapes
// 1) { items: [...], total: N, page, perPage }
if (
Array.isArray((data as any).items) &&
typeof (data as any).total === 'number'
) {
const items = (data as any).items
const total = (data as any).total
const perPage = (data as any).perPage ?? (data as any).limit ?? items.length
const page = (data as any).page ?? 1
payload = items
meta = {
totalRecords: total,
totalPages: Math.max(1, Math.ceil(total / perPage)),
page,
perPage,
}
// 2) Sequelize-like: { rows: [...], count: N }
} else if (
Array.isArray((data as any).rows) &&
typeof (data as any).count === 'number'
) {
const items = (data as any).rows
const total = (data as any).count
const perPage = (data as any).limit ?? (data as any).perPage ?? items.length
const page = (data as any).page ?? 1
payload = items
meta = {
totalRecords: total,
totalPages: Math.max(1, Math.ceil(total / perPage)),
page,
perPage,
}
// 3) { data: [...], total, page, perPage }
} else if (
Array.isArray((data as any).data) &&
typeof (data as any).total === 'number'
) {
const items = (data as any).data
const total = (data as any).total
const perPage = (data as any).perPage ?? (data as any).limit ?? items.length
const page = (data as any).page ?? 1
payload = items
meta = {
totalRecords: total,
totalPages: Math.max(1, Math.ceil(total / perPage)),
page,
perPage,
}
// 4) fallback: object contains items array and optional total
} else if (Array.isArray((data as any).items)) {
const items = (data as any).items
const total =
typeof (data as any).total === 'number' ? (data as any).total : items.length
const perPage = (data as any).perPage ?? (data as any).limit ?? items.length
const page = (data as any).page ?? 1
payload = items
meta = {
totalRecords: total,
totalPages: Math.max(1, Math.ceil(total / perPage)),
page,
perPage,
}
}
}
const envelope: any = {
statusCode,
timestamp: new Date().toISOString(),
path: request?.url ?? '',
data: payload,
}
if (meta) envelope.meta = meta
return envelope
}),
)
}
}
+34
View File
@@ -0,0 +1,34 @@
import { Body, Controller, Delete, Get, Param, Patch, Post } from '@nestjs/common'
import { CustomersService } from './customers.service'
import { CreateCustomerDto } from './dto/create-customer.dto'
import { UpdateCustomerDto } from './dto/update-customer.dto'
@Controller('customers')
export class CustomersController {
constructor(private readonly customersService: CustomersService) {}
@Post()
create(@Body() dto: CreateCustomerDto) {
return this.customersService.create(dto)
}
@Get()
findAll() {
return this.customersService.findAll()
}
@Get(':id')
findOne(@Param('id') id: string) {
return this.customersService.findOne(Number(id))
}
@Patch(':id')
update(@Param('id') id: string, @Body() dto: UpdateCustomerDto) {
return this.customersService.update(Number(id), dto)
}
@Delete(':id')
remove(@Param('id') id: string) {
return this.customersService.remove(Number(id))
}
}
+11
View File
@@ -0,0 +1,11 @@
import { Module } from '@nestjs/common'
import { PrismaModule } from '../prisma/prisma.module'
import { CustomersController } from './customers.controller'
import { CustomersService } from './customers.service'
@Module({
imports: [PrismaModule],
controllers: [CustomersController],
providers: [CustomersService],
})
export class CustomersModule {}
+27
View File
@@ -0,0 +1,27 @@
import { Injectable } from '@nestjs/common'
import { PrismaService } from '../prisma/prisma.service'
@Injectable()
export class CustomersService {
constructor(private prisma: PrismaService) {}
create(data: any) {
return this.prisma.customer.create({ data })
}
findAll() {
return this.prisma.customer.findMany()
}
findOne(id: number) {
return this.prisma.customer.findUnique({ where: { id } })
}
update(id: number, data: any) {
return this.prisma.customer.update({ where: { id }, data })
}
remove(id: number) {
return this.prisma.customer.delete({ where: { id } })
}
}
+10
View File
@@ -0,0 +1,10 @@
export class CreateCustomerDto {
firstName: string
lastName: string
email?: string
mobileNumber?: string
address?: string
city?: string
state?: string
country?: string
}
+11
View File
@@ -0,0 +1,11 @@
export class UpdateCustomerDto {
firstName?: string
lastName?: string
email?: string
mobileNumber?: string
address?: string
city?: string
state?: string
country?: string
isActive?: boolean
}
+69
View File
@@ -0,0 +1,69 @@
/* !!! This is code generated by Prisma. Do not edit directly. !!! */
/* eslint-disable */
// biome-ignore-all lint: generated file
// @ts-nocheck
/*
* This file should be your main import to use Prisma-related types and utilities in a browser.
* Use it to get access to models, enums, and input types.
*
* This file does not contain a `PrismaClient` class, nor several other helpers that are intended as server-side only.
* See `client.ts` for the standard, server-side entry point.
*
* 🟢 You can import this file directly.
*/
import * as Prisma from './internal/prismaNamespaceBrowser.js'
export { Prisma }
export * as $Enums from './enums.js'
export * from './enums.js';
/**
* Model User
*
*/
export type User = Prisma.UserModel
/**
* Model Role
*
*/
export type Role = Prisma.RoleModel
/**
* Model Product
*
*/
export type Product = Prisma.ProductModel
/**
* Model ProductInfo
*
*/
export type ProductInfo = Prisma.ProductInfoModel
/**
* Model ProductBrand
*
*/
export type ProductBrand = Prisma.ProductBrandModel
/**
* Model ProductCategory
*
*/
export type ProductCategory = Prisma.ProductCategoryModel
/**
* Model Vendor
*
*/
export type Vendor = Prisma.VendorModel
/**
* Model Customer
*
*/
export type Customer = Prisma.CustomerModel
/**
* Model Inventory
*
*/
export type Inventory = Prisma.InventoryModel
/**
* Model Store
*
*/
export type Store = Prisma.StoreModel
+89
View File
@@ -0,0 +1,89 @@
/* !!! This is code generated by Prisma. Do not edit directly. !!! */
/* eslint-disable */
// biome-ignore-all lint: generated file
// @ts-nocheck
/*
* This file should be your main import to use Prisma. Through it you get access to all the models, enums, and input types.
* If you're looking for something you can import in the client-side of your application, please refer to the `browser.ts` file instead.
*
* 🟢 You can import this file directly.
*/
import * as process from 'node:process'
import * as path from 'node:path'
import * as runtime from "@prisma/client/runtime/client"
import * as $Enums from "./enums.js"
import * as $Class from "./internal/class.js"
import * as Prisma from "./internal/prismaNamespace.js"
export * as $Enums from './enums.js'
export * from "./enums.js"
/**
* ## Prisma Client
*
* Type-safe database client for TypeScript
* @example
* ```
* const prisma = new PrismaClient()
* // Fetch zero or more Users
* const users = await prisma.user.findMany()
* ```
*
* Read more in our [docs](https://pris.ly/d/client).
*/
export const PrismaClient = $Class.getPrismaClientClass()
export type PrismaClient<LogOpts extends Prisma.LogLevel = never, OmitOpts extends Prisma.PrismaClientOptions["omit"] = Prisma.PrismaClientOptions["omit"], ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = $Class.PrismaClient<LogOpts, OmitOpts, ExtArgs>
export { Prisma }
/**
* Model User
*
*/
export type User = Prisma.UserModel
/**
* Model Role
*
*/
export type Role = Prisma.RoleModel
/**
* Model Product
*
*/
export type Product = Prisma.ProductModel
/**
* Model ProductInfo
*
*/
export type ProductInfo = Prisma.ProductInfoModel
/**
* Model ProductBrand
*
*/
export type ProductBrand = Prisma.ProductBrandModel
/**
* Model ProductCategory
*
*/
export type ProductCategory = Prisma.ProductCategoryModel
/**
* Model Vendor
*
*/
export type Vendor = Prisma.VendorModel
/**
* Model Customer
*
*/
export type Customer = Prisma.CustomerModel
/**
* Model Inventory
*
*/
export type Inventory = Prisma.InventoryModel
/**
* Model Store
*
*/
export type Store = Prisma.StoreModel
+593
View File
@@ -0,0 +1,593 @@
/* !!! This is code generated by Prisma. Do not edit directly. !!! */
/* eslint-disable */
// biome-ignore-all lint: generated file
// @ts-nocheck
/*
* This file exports various common sort, input & filter types that are not directly linked to a particular model.
*
* 🟢 You can import this file directly.
*/
import type * as runtime from "@prisma/client/runtime/client"
import * as $Enums from "./enums.js"
import type * as Prisma from "./internal/prismaNamespace.js"
export type IntFilter<$PrismaModel = never> = {
equals?: number | Prisma.IntFieldRefInput<$PrismaModel>
in?: number[]
notIn?: number[]
lt?: number | Prisma.IntFieldRefInput<$PrismaModel>
lte?: number | Prisma.IntFieldRefInput<$PrismaModel>
gt?: number | Prisma.IntFieldRefInput<$PrismaModel>
gte?: number | Prisma.IntFieldRefInput<$PrismaModel>
not?: Prisma.NestedIntFilter<$PrismaModel> | number
}
export type StringFilter<$PrismaModel = never> = {
equals?: string | Prisma.StringFieldRefInput<$PrismaModel>
in?: string[]
notIn?: string[]
lt?: string | Prisma.StringFieldRefInput<$PrismaModel>
lte?: string | Prisma.StringFieldRefInput<$PrismaModel>
gt?: string | Prisma.StringFieldRefInput<$PrismaModel>
gte?: string | Prisma.StringFieldRefInput<$PrismaModel>
contains?: string | Prisma.StringFieldRefInput<$PrismaModel>
startsWith?: string | Prisma.StringFieldRefInput<$PrismaModel>
endsWith?: string | Prisma.StringFieldRefInput<$PrismaModel>
search?: string
not?: Prisma.NestedStringFilter<$PrismaModel> | string
}
export type IntWithAggregatesFilter<$PrismaModel = never> = {
equals?: number | Prisma.IntFieldRefInput<$PrismaModel>
in?: number[]
notIn?: number[]
lt?: number | Prisma.IntFieldRefInput<$PrismaModel>
lte?: number | Prisma.IntFieldRefInput<$PrismaModel>
gt?: number | Prisma.IntFieldRefInput<$PrismaModel>
gte?: number | Prisma.IntFieldRefInput<$PrismaModel>
not?: Prisma.NestedIntWithAggregatesFilter<$PrismaModel> | number
_count?: Prisma.NestedIntFilter<$PrismaModel>
_avg?: Prisma.NestedFloatFilter<$PrismaModel>
_sum?: Prisma.NestedIntFilter<$PrismaModel>
_min?: Prisma.NestedIntFilter<$PrismaModel>
_max?: Prisma.NestedIntFilter<$PrismaModel>
}
export type StringWithAggregatesFilter<$PrismaModel = never> = {
equals?: string | Prisma.StringFieldRefInput<$PrismaModel>
in?: string[]
notIn?: string[]
lt?: string | Prisma.StringFieldRefInput<$PrismaModel>
lte?: string | Prisma.StringFieldRefInput<$PrismaModel>
gt?: string | Prisma.StringFieldRefInput<$PrismaModel>
gte?: string | Prisma.StringFieldRefInput<$PrismaModel>
contains?: string | Prisma.StringFieldRefInput<$PrismaModel>
startsWith?: string | Prisma.StringFieldRefInput<$PrismaModel>
endsWith?: string | Prisma.StringFieldRefInput<$PrismaModel>
search?: string
not?: Prisma.NestedStringWithAggregatesFilter<$PrismaModel> | string
_count?: Prisma.NestedIntFilter<$PrismaModel>
_min?: Prisma.NestedStringFilter<$PrismaModel>
_max?: Prisma.NestedStringFilter<$PrismaModel>
}
export type StringNullableFilter<$PrismaModel = never> = {
equals?: string | Prisma.StringFieldRefInput<$PrismaModel> | null
in?: string[] | null
notIn?: string[] | null
lt?: string | Prisma.StringFieldRefInput<$PrismaModel>
lte?: string | Prisma.StringFieldRefInput<$PrismaModel>
gt?: string | Prisma.StringFieldRefInput<$PrismaModel>
gte?: string | Prisma.StringFieldRefInput<$PrismaModel>
contains?: string | Prisma.StringFieldRefInput<$PrismaModel>
startsWith?: string | Prisma.StringFieldRefInput<$PrismaModel>
endsWith?: string | Prisma.StringFieldRefInput<$PrismaModel>
search?: string
not?: Prisma.NestedStringNullableFilter<$PrismaModel> | string | null
}
export type JsonNullableFilter<$PrismaModel = never> =
| Prisma.PatchUndefined<
Prisma.Either<Required<JsonNullableFilterBase<$PrismaModel>>, Exclude<keyof Required<JsonNullableFilterBase<$PrismaModel>>, 'path'>>,
Required<JsonNullableFilterBase<$PrismaModel>>
>
| Prisma.OptionalFlat<Omit<Required<JsonNullableFilterBase<$PrismaModel>>, 'path'>>
export type JsonNullableFilterBase<$PrismaModel = never> = {
equals?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> | Prisma.JsonNullValueFilter
path?: string
mode?: Prisma.QueryMode | Prisma.EnumQueryModeFieldRefInput<$PrismaModel>
string_contains?: string | Prisma.StringFieldRefInput<$PrismaModel>
string_starts_with?: string | Prisma.StringFieldRefInput<$PrismaModel>
string_ends_with?: string | Prisma.StringFieldRefInput<$PrismaModel>
array_starts_with?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> | null
array_ends_with?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> | null
array_contains?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> | null
lt?: runtime.InputJsonValue
lte?: runtime.InputJsonValue
gt?: runtime.InputJsonValue
gte?: runtime.InputJsonValue
not?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> | Prisma.JsonNullValueFilter
}
export type DateTimeFilter<$PrismaModel = never> = {
equals?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel>
in?: Date[] | string[]
notIn?: Date[] | string[]
lt?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel>
lte?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel>
gt?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel>
gte?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel>
not?: Prisma.NestedDateTimeFilter<$PrismaModel> | Date | string
}
export type DateTimeNullableFilter<$PrismaModel = never> = {
equals?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> | null
in?: Date[] | string[] | null
notIn?: Date[] | string[] | null
lt?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel>
lte?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel>
gt?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel>
gte?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel>
not?: Prisma.NestedDateTimeNullableFilter<$PrismaModel> | Date | string | null
}
export type SortOrderInput = {
sort: Prisma.SortOrder
nulls?: Prisma.NullsOrder
}
export type StringNullableWithAggregatesFilter<$PrismaModel = never> = {
equals?: string | Prisma.StringFieldRefInput<$PrismaModel> | null
in?: string[] | null
notIn?: string[] | null
lt?: string | Prisma.StringFieldRefInput<$PrismaModel>
lte?: string | Prisma.StringFieldRefInput<$PrismaModel>
gt?: string | Prisma.StringFieldRefInput<$PrismaModel>
gte?: string | Prisma.StringFieldRefInput<$PrismaModel>
contains?: string | Prisma.StringFieldRefInput<$PrismaModel>
startsWith?: string | Prisma.StringFieldRefInput<$PrismaModel>
endsWith?: string | Prisma.StringFieldRefInput<$PrismaModel>
search?: string
not?: Prisma.NestedStringNullableWithAggregatesFilter<$PrismaModel> | string | null
_count?: Prisma.NestedIntNullableFilter<$PrismaModel>
_min?: Prisma.NestedStringNullableFilter<$PrismaModel>
_max?: Prisma.NestedStringNullableFilter<$PrismaModel>
}
export type JsonNullableWithAggregatesFilter<$PrismaModel = never> =
| Prisma.PatchUndefined<
Prisma.Either<Required<JsonNullableWithAggregatesFilterBase<$PrismaModel>>, Exclude<keyof Required<JsonNullableWithAggregatesFilterBase<$PrismaModel>>, 'path'>>,
Required<JsonNullableWithAggregatesFilterBase<$PrismaModel>>
>
| Prisma.OptionalFlat<Omit<Required<JsonNullableWithAggregatesFilterBase<$PrismaModel>>, 'path'>>
export type JsonNullableWithAggregatesFilterBase<$PrismaModel = never> = {
equals?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> | Prisma.JsonNullValueFilter
path?: string
mode?: Prisma.QueryMode | Prisma.EnumQueryModeFieldRefInput<$PrismaModel>
string_contains?: string | Prisma.StringFieldRefInput<$PrismaModel>
string_starts_with?: string | Prisma.StringFieldRefInput<$PrismaModel>
string_ends_with?: string | Prisma.StringFieldRefInput<$PrismaModel>
array_starts_with?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> | null
array_ends_with?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> | null
array_contains?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> | null
lt?: runtime.InputJsonValue
lte?: runtime.InputJsonValue
gt?: runtime.InputJsonValue
gte?: runtime.InputJsonValue
not?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> | Prisma.JsonNullValueFilter
_count?: Prisma.NestedIntNullableFilter<$PrismaModel>
_min?: Prisma.NestedJsonNullableFilter<$PrismaModel>
_max?: Prisma.NestedJsonNullableFilter<$PrismaModel>
}
export type DateTimeWithAggregatesFilter<$PrismaModel = never> = {
equals?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel>
in?: Date[] | string[]
notIn?: Date[] | string[]
lt?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel>
lte?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel>
gt?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel>
gte?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel>
not?: Prisma.NestedDateTimeWithAggregatesFilter<$PrismaModel> | Date | string
_count?: Prisma.NestedIntFilter<$PrismaModel>
_min?: Prisma.NestedDateTimeFilter<$PrismaModel>
_max?: Prisma.NestedDateTimeFilter<$PrismaModel>
}
export type DateTimeNullableWithAggregatesFilter<$PrismaModel = never> = {
equals?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> | null
in?: Date[] | string[] | null
notIn?: Date[] | string[] | null
lt?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel>
lte?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel>
gt?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel>
gte?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel>
not?: Prisma.NestedDateTimeNullableWithAggregatesFilter<$PrismaModel> | Date | string | null
_count?: Prisma.NestedIntNullableFilter<$PrismaModel>
_min?: Prisma.NestedDateTimeNullableFilter<$PrismaModel>
_max?: Prisma.NestedDateTimeNullableFilter<$PrismaModel>
}
export type BigIntNullableFilter<$PrismaModel = never> = {
equals?: bigint | number | Prisma.BigIntFieldRefInput<$PrismaModel> | null
in?: bigint[] | number[] | null
notIn?: bigint[] | number[] | null
lt?: bigint | number | Prisma.BigIntFieldRefInput<$PrismaModel>
lte?: bigint | number | Prisma.BigIntFieldRefInput<$PrismaModel>
gt?: bigint | number | Prisma.BigIntFieldRefInput<$PrismaModel>
gte?: bigint | number | Prisma.BigIntFieldRefInput<$PrismaModel>
not?: Prisma.NestedBigIntNullableFilter<$PrismaModel> | bigint | number | null
}
export type DecimalFilter<$PrismaModel = never> = {
equals?: runtime.Decimal | runtime.DecimalJsLike | number | string | Prisma.DecimalFieldRefInput<$PrismaModel>
in?: runtime.Decimal[] | runtime.DecimalJsLike[] | number[] | string[]
notIn?: runtime.Decimal[] | runtime.DecimalJsLike[] | number[] | string[]
lt?: runtime.Decimal | runtime.DecimalJsLike | number | string | Prisma.DecimalFieldRefInput<$PrismaModel>
lte?: runtime.Decimal | runtime.DecimalJsLike | number | string | Prisma.DecimalFieldRefInput<$PrismaModel>
gt?: runtime.Decimal | runtime.DecimalJsLike | number | string | Prisma.DecimalFieldRefInput<$PrismaModel>
gte?: runtime.Decimal | runtime.DecimalJsLike | number | string | Prisma.DecimalFieldRefInput<$PrismaModel>
not?: Prisma.NestedDecimalFilter<$PrismaModel> | runtime.Decimal | runtime.DecimalJsLike | number | string
}
export type BoolFilter<$PrismaModel = never> = {
equals?: boolean | Prisma.BooleanFieldRefInput<$PrismaModel>
not?: Prisma.NestedBoolFilter<$PrismaModel> | boolean
}
export type BigIntNullableWithAggregatesFilter<$PrismaModel = never> = {
equals?: bigint | number | Prisma.BigIntFieldRefInput<$PrismaModel> | null
in?: bigint[] | number[] | null
notIn?: bigint[] | number[] | null
lt?: bigint | number | Prisma.BigIntFieldRefInput<$PrismaModel>
lte?: bigint | number | Prisma.BigIntFieldRefInput<$PrismaModel>
gt?: bigint | number | Prisma.BigIntFieldRefInput<$PrismaModel>
gte?: bigint | number | Prisma.BigIntFieldRefInput<$PrismaModel>
not?: Prisma.NestedBigIntNullableWithAggregatesFilter<$PrismaModel> | bigint | number | null
_count?: Prisma.NestedIntNullableFilter<$PrismaModel>
_avg?: Prisma.NestedFloatNullableFilter<$PrismaModel>
_sum?: Prisma.NestedBigIntNullableFilter<$PrismaModel>
_min?: Prisma.NestedBigIntNullableFilter<$PrismaModel>
_max?: Prisma.NestedBigIntNullableFilter<$PrismaModel>
}
export type DecimalWithAggregatesFilter<$PrismaModel = never> = {
equals?: runtime.Decimal | runtime.DecimalJsLike | number | string | Prisma.DecimalFieldRefInput<$PrismaModel>
in?: runtime.Decimal[] | runtime.DecimalJsLike[] | number[] | string[]
notIn?: runtime.Decimal[] | runtime.DecimalJsLike[] | number[] | string[]
lt?: runtime.Decimal | runtime.DecimalJsLike | number | string | Prisma.DecimalFieldRefInput<$PrismaModel>
lte?: runtime.Decimal | runtime.DecimalJsLike | number | string | Prisma.DecimalFieldRefInput<$PrismaModel>
gt?: runtime.Decimal | runtime.DecimalJsLike | number | string | Prisma.DecimalFieldRefInput<$PrismaModel>
gte?: runtime.Decimal | runtime.DecimalJsLike | number | string | Prisma.DecimalFieldRefInput<$PrismaModel>
not?: Prisma.NestedDecimalWithAggregatesFilter<$PrismaModel> | runtime.Decimal | runtime.DecimalJsLike | number | string
_count?: Prisma.NestedIntFilter<$PrismaModel>
_avg?: Prisma.NestedDecimalFilter<$PrismaModel>
_sum?: Prisma.NestedDecimalFilter<$PrismaModel>
_min?: Prisma.NestedDecimalFilter<$PrismaModel>
_max?: Prisma.NestedDecimalFilter<$PrismaModel>
}
export type BoolWithAggregatesFilter<$PrismaModel = never> = {
equals?: boolean | Prisma.BooleanFieldRefInput<$PrismaModel>
not?: Prisma.NestedBoolWithAggregatesFilter<$PrismaModel> | boolean
_count?: Prisma.NestedIntFilter<$PrismaModel>
_min?: Prisma.NestedBoolFilter<$PrismaModel>
_max?: Prisma.NestedBoolFilter<$PrismaModel>
}
export type IntNullableFilter<$PrismaModel = never> = {
equals?: number | Prisma.IntFieldRefInput<$PrismaModel> | null
in?: number[] | null
notIn?: number[] | null
lt?: number | Prisma.IntFieldRefInput<$PrismaModel>
lte?: number | Prisma.IntFieldRefInput<$PrismaModel>
gt?: number | Prisma.IntFieldRefInput<$PrismaModel>
gte?: number | Prisma.IntFieldRefInput<$PrismaModel>
not?: Prisma.NestedIntNullableFilter<$PrismaModel> | number | null
}
export type IntNullableWithAggregatesFilter<$PrismaModel = never> = {
equals?: number | Prisma.IntFieldRefInput<$PrismaModel> | null
in?: number[] | null
notIn?: number[] | null
lt?: number | Prisma.IntFieldRefInput<$PrismaModel>
lte?: number | Prisma.IntFieldRefInput<$PrismaModel>
gt?: number | Prisma.IntFieldRefInput<$PrismaModel>
gte?: number | Prisma.IntFieldRefInput<$PrismaModel>
not?: Prisma.NestedIntNullableWithAggregatesFilter<$PrismaModel> | number | null
_count?: Prisma.NestedIntNullableFilter<$PrismaModel>
_avg?: Prisma.NestedFloatNullableFilter<$PrismaModel>
_sum?: Prisma.NestedIntNullableFilter<$PrismaModel>
_min?: Prisma.NestedIntNullableFilter<$PrismaModel>
_max?: Prisma.NestedIntNullableFilter<$PrismaModel>
}
export type NestedIntFilter<$PrismaModel = never> = {
equals?: number | Prisma.IntFieldRefInput<$PrismaModel>
in?: number[]
notIn?: number[]
lt?: number | Prisma.IntFieldRefInput<$PrismaModel>
lte?: number | Prisma.IntFieldRefInput<$PrismaModel>
gt?: number | Prisma.IntFieldRefInput<$PrismaModel>
gte?: number | Prisma.IntFieldRefInput<$PrismaModel>
not?: Prisma.NestedIntFilter<$PrismaModel> | number
}
export type NestedStringFilter<$PrismaModel = never> = {
equals?: string | Prisma.StringFieldRefInput<$PrismaModel>
in?: string[]
notIn?: string[]
lt?: string | Prisma.StringFieldRefInput<$PrismaModel>
lte?: string | Prisma.StringFieldRefInput<$PrismaModel>
gt?: string | Prisma.StringFieldRefInput<$PrismaModel>
gte?: string | Prisma.StringFieldRefInput<$PrismaModel>
contains?: string | Prisma.StringFieldRefInput<$PrismaModel>
startsWith?: string | Prisma.StringFieldRefInput<$PrismaModel>
endsWith?: string | Prisma.StringFieldRefInput<$PrismaModel>
search?: string
not?: Prisma.NestedStringFilter<$PrismaModel> | string
}
export type NestedIntWithAggregatesFilter<$PrismaModel = never> = {
equals?: number | Prisma.IntFieldRefInput<$PrismaModel>
in?: number[]
notIn?: number[]
lt?: number | Prisma.IntFieldRefInput<$PrismaModel>
lte?: number | Prisma.IntFieldRefInput<$PrismaModel>
gt?: number | Prisma.IntFieldRefInput<$PrismaModel>
gte?: number | Prisma.IntFieldRefInput<$PrismaModel>
not?: Prisma.NestedIntWithAggregatesFilter<$PrismaModel> | number
_count?: Prisma.NestedIntFilter<$PrismaModel>
_avg?: Prisma.NestedFloatFilter<$PrismaModel>
_sum?: Prisma.NestedIntFilter<$PrismaModel>
_min?: Prisma.NestedIntFilter<$PrismaModel>
_max?: Prisma.NestedIntFilter<$PrismaModel>
}
export type NestedFloatFilter<$PrismaModel = never> = {
equals?: number | Prisma.FloatFieldRefInput<$PrismaModel>
in?: number[]
notIn?: number[]
lt?: number | Prisma.FloatFieldRefInput<$PrismaModel>
lte?: number | Prisma.FloatFieldRefInput<$PrismaModel>
gt?: number | Prisma.FloatFieldRefInput<$PrismaModel>
gte?: number | Prisma.FloatFieldRefInput<$PrismaModel>
not?: Prisma.NestedFloatFilter<$PrismaModel> | number
}
export type NestedStringWithAggregatesFilter<$PrismaModel = never> = {
equals?: string | Prisma.StringFieldRefInput<$PrismaModel>
in?: string[]
notIn?: string[]
lt?: string | Prisma.StringFieldRefInput<$PrismaModel>
lte?: string | Prisma.StringFieldRefInput<$PrismaModel>
gt?: string | Prisma.StringFieldRefInput<$PrismaModel>
gte?: string | Prisma.StringFieldRefInput<$PrismaModel>
contains?: string | Prisma.StringFieldRefInput<$PrismaModel>
startsWith?: string | Prisma.StringFieldRefInput<$PrismaModel>
endsWith?: string | Prisma.StringFieldRefInput<$PrismaModel>
search?: string
not?: Prisma.NestedStringWithAggregatesFilter<$PrismaModel> | string
_count?: Prisma.NestedIntFilter<$PrismaModel>
_min?: Prisma.NestedStringFilter<$PrismaModel>
_max?: Prisma.NestedStringFilter<$PrismaModel>
}
export type NestedStringNullableFilter<$PrismaModel = never> = {
equals?: string | Prisma.StringFieldRefInput<$PrismaModel> | null
in?: string[] | null
notIn?: string[] | null
lt?: string | Prisma.StringFieldRefInput<$PrismaModel>
lte?: string | Prisma.StringFieldRefInput<$PrismaModel>
gt?: string | Prisma.StringFieldRefInput<$PrismaModel>
gte?: string | Prisma.StringFieldRefInput<$PrismaModel>
contains?: string | Prisma.StringFieldRefInput<$PrismaModel>
startsWith?: string | Prisma.StringFieldRefInput<$PrismaModel>
endsWith?: string | Prisma.StringFieldRefInput<$PrismaModel>
search?: string
not?: Prisma.NestedStringNullableFilter<$PrismaModel> | string | null
}
export type NestedDateTimeFilter<$PrismaModel = never> = {
equals?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel>
in?: Date[] | string[]
notIn?: Date[] | string[]
lt?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel>
lte?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel>
gt?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel>
gte?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel>
not?: Prisma.NestedDateTimeFilter<$PrismaModel> | Date | string
}
export type NestedDateTimeNullableFilter<$PrismaModel = never> = {
equals?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> | null
in?: Date[] | string[] | null
notIn?: Date[] | string[] | null
lt?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel>
lte?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel>
gt?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel>
gte?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel>
not?: Prisma.NestedDateTimeNullableFilter<$PrismaModel> | Date | string | null
}
export type NestedStringNullableWithAggregatesFilter<$PrismaModel = never> = {
equals?: string | Prisma.StringFieldRefInput<$PrismaModel> | null
in?: string[] | null
notIn?: string[] | null
lt?: string | Prisma.StringFieldRefInput<$PrismaModel>
lte?: string | Prisma.StringFieldRefInput<$PrismaModel>
gt?: string | Prisma.StringFieldRefInput<$PrismaModel>
gte?: string | Prisma.StringFieldRefInput<$PrismaModel>
contains?: string | Prisma.StringFieldRefInput<$PrismaModel>
startsWith?: string | Prisma.StringFieldRefInput<$PrismaModel>
endsWith?: string | Prisma.StringFieldRefInput<$PrismaModel>
search?: string
not?: Prisma.NestedStringNullableWithAggregatesFilter<$PrismaModel> | string | null
_count?: Prisma.NestedIntNullableFilter<$PrismaModel>
_min?: Prisma.NestedStringNullableFilter<$PrismaModel>
_max?: Prisma.NestedStringNullableFilter<$PrismaModel>
}
export type NestedIntNullableFilter<$PrismaModel = never> = {
equals?: number | Prisma.IntFieldRefInput<$PrismaModel> | null
in?: number[] | null
notIn?: number[] | null
lt?: number | Prisma.IntFieldRefInput<$PrismaModel>
lte?: number | Prisma.IntFieldRefInput<$PrismaModel>
gt?: number | Prisma.IntFieldRefInput<$PrismaModel>
gte?: number | Prisma.IntFieldRefInput<$PrismaModel>
not?: Prisma.NestedIntNullableFilter<$PrismaModel> | number | null
}
export type NestedJsonNullableFilter<$PrismaModel = never> =
| Prisma.PatchUndefined<
Prisma.Either<Required<NestedJsonNullableFilterBase<$PrismaModel>>, Exclude<keyof Required<NestedJsonNullableFilterBase<$PrismaModel>>, 'path'>>,
Required<NestedJsonNullableFilterBase<$PrismaModel>>
>
| Prisma.OptionalFlat<Omit<Required<NestedJsonNullableFilterBase<$PrismaModel>>, 'path'>>
export type NestedJsonNullableFilterBase<$PrismaModel = never> = {
equals?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> | Prisma.JsonNullValueFilter
path?: string
mode?: Prisma.QueryMode | Prisma.EnumQueryModeFieldRefInput<$PrismaModel>
string_contains?: string | Prisma.StringFieldRefInput<$PrismaModel>
string_starts_with?: string | Prisma.StringFieldRefInput<$PrismaModel>
string_ends_with?: string | Prisma.StringFieldRefInput<$PrismaModel>
array_starts_with?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> | null
array_ends_with?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> | null
array_contains?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> | null
lt?: runtime.InputJsonValue
lte?: runtime.InputJsonValue
gt?: runtime.InputJsonValue
gte?: runtime.InputJsonValue
not?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> | Prisma.JsonNullValueFilter
}
export type NestedDateTimeWithAggregatesFilter<$PrismaModel = never> = {
equals?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel>
in?: Date[] | string[]
notIn?: Date[] | string[]
lt?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel>
lte?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel>
gt?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel>
gte?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel>
not?: Prisma.NestedDateTimeWithAggregatesFilter<$PrismaModel> | Date | string
_count?: Prisma.NestedIntFilter<$PrismaModel>
_min?: Prisma.NestedDateTimeFilter<$PrismaModel>
_max?: Prisma.NestedDateTimeFilter<$PrismaModel>
}
export type NestedDateTimeNullableWithAggregatesFilter<$PrismaModel = never> = {
equals?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> | null
in?: Date[] | string[] | null
notIn?: Date[] | string[] | null
lt?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel>
lte?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel>
gt?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel>
gte?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel>
not?: Prisma.NestedDateTimeNullableWithAggregatesFilter<$PrismaModel> | Date | string | null
_count?: Prisma.NestedIntNullableFilter<$PrismaModel>
_min?: Prisma.NestedDateTimeNullableFilter<$PrismaModel>
_max?: Prisma.NestedDateTimeNullableFilter<$PrismaModel>
}
export type NestedBigIntNullableFilter<$PrismaModel = never> = {
equals?: bigint | number | Prisma.BigIntFieldRefInput<$PrismaModel> | null
in?: bigint[] | number[] | null
notIn?: bigint[] | number[] | null
lt?: bigint | number | Prisma.BigIntFieldRefInput<$PrismaModel>
lte?: bigint | number | Prisma.BigIntFieldRefInput<$PrismaModel>
gt?: bigint | number | Prisma.BigIntFieldRefInput<$PrismaModel>
gte?: bigint | number | Prisma.BigIntFieldRefInput<$PrismaModel>
not?: Prisma.NestedBigIntNullableFilter<$PrismaModel> | bigint | number | null
}
export type NestedDecimalFilter<$PrismaModel = never> = {
equals?: runtime.Decimal | runtime.DecimalJsLike | number | string | Prisma.DecimalFieldRefInput<$PrismaModel>
in?: runtime.Decimal[] | runtime.DecimalJsLike[] | number[] | string[]
notIn?: runtime.Decimal[] | runtime.DecimalJsLike[] | number[] | string[]
lt?: runtime.Decimal | runtime.DecimalJsLike | number | string | Prisma.DecimalFieldRefInput<$PrismaModel>
lte?: runtime.Decimal | runtime.DecimalJsLike | number | string | Prisma.DecimalFieldRefInput<$PrismaModel>
gt?: runtime.Decimal | runtime.DecimalJsLike | number | string | Prisma.DecimalFieldRefInput<$PrismaModel>
gte?: runtime.Decimal | runtime.DecimalJsLike | number | string | Prisma.DecimalFieldRefInput<$PrismaModel>
not?: Prisma.NestedDecimalFilter<$PrismaModel> | runtime.Decimal | runtime.DecimalJsLike | number | string
}
export type NestedBoolFilter<$PrismaModel = never> = {
equals?: boolean | Prisma.BooleanFieldRefInput<$PrismaModel>
not?: Prisma.NestedBoolFilter<$PrismaModel> | boolean
}
export type NestedBigIntNullableWithAggregatesFilter<$PrismaModel = never> = {
equals?: bigint | number | Prisma.BigIntFieldRefInput<$PrismaModel> | null
in?: bigint[] | number[] | null
notIn?: bigint[] | number[] | null
lt?: bigint | number | Prisma.BigIntFieldRefInput<$PrismaModel>
lte?: bigint | number | Prisma.BigIntFieldRefInput<$PrismaModel>
gt?: bigint | number | Prisma.BigIntFieldRefInput<$PrismaModel>
gte?: bigint | number | Prisma.BigIntFieldRefInput<$PrismaModel>
not?: Prisma.NestedBigIntNullableWithAggregatesFilter<$PrismaModel> | bigint | number | null
_count?: Prisma.NestedIntNullableFilter<$PrismaModel>
_avg?: Prisma.NestedFloatNullableFilter<$PrismaModel>
_sum?: Prisma.NestedBigIntNullableFilter<$PrismaModel>
_min?: Prisma.NestedBigIntNullableFilter<$PrismaModel>
_max?: Prisma.NestedBigIntNullableFilter<$PrismaModel>
}
export type NestedFloatNullableFilter<$PrismaModel = never> = {
equals?: number | Prisma.FloatFieldRefInput<$PrismaModel> | null
in?: number[] | null
notIn?: number[] | null
lt?: number | Prisma.FloatFieldRefInput<$PrismaModel>
lte?: number | Prisma.FloatFieldRefInput<$PrismaModel>
gt?: number | Prisma.FloatFieldRefInput<$PrismaModel>
gte?: number | Prisma.FloatFieldRefInput<$PrismaModel>
not?: Prisma.NestedFloatNullableFilter<$PrismaModel> | number | null
}
export type NestedDecimalWithAggregatesFilter<$PrismaModel = never> = {
equals?: runtime.Decimal | runtime.DecimalJsLike | number | string | Prisma.DecimalFieldRefInput<$PrismaModel>
in?: runtime.Decimal[] | runtime.DecimalJsLike[] | number[] | string[]
notIn?: runtime.Decimal[] | runtime.DecimalJsLike[] | number[] | string[]
lt?: runtime.Decimal | runtime.DecimalJsLike | number | string | Prisma.DecimalFieldRefInput<$PrismaModel>
lte?: runtime.Decimal | runtime.DecimalJsLike | number | string | Prisma.DecimalFieldRefInput<$PrismaModel>
gt?: runtime.Decimal | runtime.DecimalJsLike | number | string | Prisma.DecimalFieldRefInput<$PrismaModel>
gte?: runtime.Decimal | runtime.DecimalJsLike | number | string | Prisma.DecimalFieldRefInput<$PrismaModel>
not?: Prisma.NestedDecimalWithAggregatesFilter<$PrismaModel> | runtime.Decimal | runtime.DecimalJsLike | number | string
_count?: Prisma.NestedIntFilter<$PrismaModel>
_avg?: Prisma.NestedDecimalFilter<$PrismaModel>
_sum?: Prisma.NestedDecimalFilter<$PrismaModel>
_min?: Prisma.NestedDecimalFilter<$PrismaModel>
_max?: Prisma.NestedDecimalFilter<$PrismaModel>
}
export type NestedBoolWithAggregatesFilter<$PrismaModel = never> = {
equals?: boolean | Prisma.BooleanFieldRefInput<$PrismaModel>
not?: Prisma.NestedBoolWithAggregatesFilter<$PrismaModel> | boolean
_count?: Prisma.NestedIntFilter<$PrismaModel>
_min?: Prisma.NestedBoolFilter<$PrismaModel>
_max?: Prisma.NestedBoolFilter<$PrismaModel>
}
export type NestedIntNullableWithAggregatesFilter<$PrismaModel = never> = {
equals?: number | Prisma.IntFieldRefInput<$PrismaModel> | null
in?: number[] | null
notIn?: number[] | null
lt?: number | Prisma.IntFieldRefInput<$PrismaModel>
lte?: number | Prisma.IntFieldRefInput<$PrismaModel>
gt?: number | Prisma.IntFieldRefInput<$PrismaModel>
gte?: number | Prisma.IntFieldRefInput<$PrismaModel>
not?: Prisma.NestedIntNullableWithAggregatesFilter<$PrismaModel> | number | null
_count?: Prisma.NestedIntNullableFilter<$PrismaModel>
_avg?: Prisma.NestedFloatNullableFilter<$PrismaModel>
_sum?: Prisma.NestedIntNullableFilter<$PrismaModel>
_min?: Prisma.NestedIntNullableFilter<$PrismaModel>
_max?: Prisma.NestedIntNullableFilter<$PrismaModel>
}
+15
View File
@@ -0,0 +1,15 @@
/* !!! This is code generated by Prisma. Do not edit directly. !!! */
/* eslint-disable */
// biome-ignore-all lint: generated file
// @ts-nocheck
/*
* This file exports all enum related types from the schema.
*
* 🟢 You can import this file directly.
*/
// This file is empty because there are no enums in the schema.
export {}
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,375 @@
/* !!! This is code generated by Prisma. Do not edit directly. !!! */
/* eslint-disable */
// biome-ignore-all lint: generated file
// @ts-nocheck
/*
* WARNING: This is an internal file that is subject to change!
*
* 🛑 Under no circumstances should you import this file directly! 🛑
*
* All exports from this file are wrapped under a `Prisma` namespace object in the browser.ts file.
* While this enables partial backward compatibility, it is not part of the stable public API.
*
* If you are looking for your Models, Enums, and Input Types, please import them from the respective
* model files in the `model` directory!
*/
import * as runtime from "@prisma/client/runtime/index-browser"
export type * from '../models.js'
export type * from './prismaNamespace.js'
export const Decimal = runtime.Decimal
export const NullTypes = {
DbNull: runtime.NullTypes.DbNull as (new (secret: never) => typeof runtime.DbNull),
JsonNull: runtime.NullTypes.JsonNull as (new (secret: never) => typeof runtime.JsonNull),
AnyNull: runtime.NullTypes.AnyNull as (new (secret: never) => typeof runtime.AnyNull),
}
/**
* Helper for filtering JSON entries that have `null` on the database (empty on the db)
*
* @see https://www.prisma.io/docs/concepts/components/prisma-client/working-with-fields/working-with-json-fields#filtering-on-a-json-field
*/
export const DbNull = runtime.DbNull
/**
* Helper for filtering JSON entries that have JSON `null` values (not empty on the db)
*
* @see https://www.prisma.io/docs/concepts/components/prisma-client/working-with-fields/working-with-json-fields#filtering-on-a-json-field
*/
export const JsonNull = runtime.JsonNull
/**
* Helper for filtering JSON entries that are `Prisma.DbNull` or `Prisma.JsonNull`
*
* @see https://www.prisma.io/docs/concepts/components/prisma-client/working-with-fields/working-with-json-fields#filtering-on-a-json-field
*/
export const AnyNull = runtime.AnyNull
export const ModelName = {
User: 'User',
Role: 'Role',
Product: 'Product',
ProductInfo: 'ProductInfo',
ProductBrand: 'ProductBrand',
ProductCategory: 'ProductCategory',
Vendor: 'Vendor',
Customer: 'Customer',
Inventory: 'Inventory',
Store: 'Store'
} as const
export type ModelName = (typeof ModelName)[keyof typeof ModelName]
/*
* Enums
*/
export const TransactionIsolationLevel = {
ReadUncommitted: 'ReadUncommitted',
ReadCommitted: 'ReadCommitted',
RepeatableRead: 'RepeatableRead',
Serializable: 'Serializable'
} as const
export type TransactionIsolationLevel = (typeof TransactionIsolationLevel)[keyof typeof TransactionIsolationLevel]
export const UserScalarFieldEnum = {
id: 'id',
mobileNumber: 'mobileNumber',
password: 'password',
firstName: 'firstName',
lastName: 'lastName',
roleId: 'roleId'
} as const
export type UserScalarFieldEnum = (typeof UserScalarFieldEnum)[keyof typeof UserScalarFieldEnum]
export const RoleScalarFieldEnum = {
id: 'id',
name: 'name',
description: 'description',
permissions: 'permissions',
createdAt: 'createdAt',
updatedAt: 'updatedAt',
deletedAt: 'deletedAt'
} as const
export type RoleScalarFieldEnum = (typeof RoleScalarFieldEnum)[keyof typeof RoleScalarFieldEnum]
export const ProductScalarFieldEnum = {
id: 'id',
name: 'name',
description: 'description',
sku: 'sku',
barcode: 'barcode',
imageUrl: 'imageUrl',
attachmentId: 'attachmentId',
unit: 'unit',
discount: 'discount',
quantity: 'quantity',
alertQuantity: 'alertQuantity',
isActive: 'isActive',
isFeatured: 'isFeatured',
createdAt: 'createdAt',
updatedAt: 'updatedAt',
deletedAt: 'deletedAt',
productInfoId: 'productInfoId'
} as const
export type ProductScalarFieldEnum = (typeof ProductScalarFieldEnum)[keyof typeof ProductScalarFieldEnum]
export const ProductInfoScalarFieldEnum = {
id: 'id',
name: 'name',
description: 'description',
productType: 'productType',
metaData: 'metaData',
createdAt: 'createdAt',
updatedAt: 'updatedAt',
deletedAt: 'deletedAt',
brandId: 'brandId',
categoryId: 'categoryId',
vendorId: 'vendorId'
} as const
export type ProductInfoScalarFieldEnum = (typeof ProductInfoScalarFieldEnum)[keyof typeof ProductInfoScalarFieldEnum]
export const ProductBrandScalarFieldEnum = {
id: 'id',
name: 'name',
description: 'description',
imageUrl: 'imageUrl',
createdAt: 'createdAt',
updatedAt: 'updatedAt',
deletedAt: 'deletedAt'
} as const
export type ProductBrandScalarFieldEnum = (typeof ProductBrandScalarFieldEnum)[keyof typeof ProductBrandScalarFieldEnum]
export const ProductCategoryScalarFieldEnum = {
id: 'id',
name: 'name',
description: 'description',
imageUrl: 'imageUrl',
createdAt: 'createdAt',
updatedAt: 'updatedAt',
deletedAt: 'deletedAt'
} as const
export type ProductCategoryScalarFieldEnum = (typeof ProductCategoryScalarFieldEnum)[keyof typeof ProductCategoryScalarFieldEnum]
export const VendorScalarFieldEnum = {
id: 'id',
firstName: 'firstName',
lastName: 'lastName',
email: 'email',
mobileNumber: 'mobileNumber',
address: 'address',
city: 'city',
state: 'state',
country: 'country',
isActive: 'isActive',
createdAt: 'createdAt',
updatedAt: 'updatedAt',
deletedAt: 'deletedAt'
} as const
export type VendorScalarFieldEnum = (typeof VendorScalarFieldEnum)[keyof typeof VendorScalarFieldEnum]
export const CustomerScalarFieldEnum = {
id: 'id',
firstName: 'firstName',
lastName: 'lastName',
email: 'email',
mobileNumber: 'mobileNumber',
address: 'address',
city: 'city',
state: 'state',
country: 'country',
isActive: 'isActive',
createdAt: 'createdAt',
updatedAt: 'updatedAt',
deletedAt: 'deletedAt'
} as const
export type CustomerScalarFieldEnum = (typeof CustomerScalarFieldEnum)[keyof typeof CustomerScalarFieldEnum]
export const InventoryScalarFieldEnum = {
id: 'id',
name: 'name',
location: 'location',
isActive: 'isActive',
createdAt: 'createdAt',
updatedAt: 'updatedAt'
} as const
export type InventoryScalarFieldEnum = (typeof InventoryScalarFieldEnum)[keyof typeof InventoryScalarFieldEnum]
export const StoreScalarFieldEnum = {
id: 'id',
name: 'name',
location: 'location',
isActive: 'isActive',
createdAt: 'createdAt',
updatedAt: 'updatedAt'
} as const
export type StoreScalarFieldEnum = (typeof StoreScalarFieldEnum)[keyof typeof StoreScalarFieldEnum]
export const SortOrder = {
asc: 'asc',
desc: 'desc'
} as const
export type SortOrder = (typeof SortOrder)[keyof typeof SortOrder]
export const NullableJsonNullValueInput = {
DbNull: 'DbNull',
JsonNull: 'JsonNull'
} as const
export type NullableJsonNullValueInput = (typeof NullableJsonNullValueInput)[keyof typeof NullableJsonNullValueInput]
export const UserOrderByRelevanceFieldEnum = {
mobileNumber: 'mobileNumber',
password: 'password',
firstName: 'firstName',
lastName: 'lastName'
} as const
export type UserOrderByRelevanceFieldEnum = (typeof UserOrderByRelevanceFieldEnum)[keyof typeof UserOrderByRelevanceFieldEnum]
export const JsonNullValueFilter = {
DbNull: 'DbNull',
JsonNull: 'JsonNull',
AnyNull: 'AnyNull'
} as const
export type JsonNullValueFilter = (typeof JsonNullValueFilter)[keyof typeof JsonNullValueFilter]
export const QueryMode = {
default: 'default',
insensitive: 'insensitive'
} as const
export type QueryMode = (typeof QueryMode)[keyof typeof QueryMode]
export const NullsOrder = {
first: 'first',
last: 'last'
} as const
export type NullsOrder = (typeof NullsOrder)[keyof typeof NullsOrder]
export const RoleOrderByRelevanceFieldEnum = {
name: 'name',
description: 'description'
} as const
export type RoleOrderByRelevanceFieldEnum = (typeof RoleOrderByRelevanceFieldEnum)[keyof typeof RoleOrderByRelevanceFieldEnum]
export const ProductOrderByRelevanceFieldEnum = {
name: 'name',
description: 'description',
sku: 'sku',
barcode: 'barcode',
imageUrl: 'imageUrl',
unit: 'unit'
} as const
export type ProductOrderByRelevanceFieldEnum = (typeof ProductOrderByRelevanceFieldEnum)[keyof typeof ProductOrderByRelevanceFieldEnum]
export const ProductInfoOrderByRelevanceFieldEnum = {
name: 'name',
description: 'description',
productType: 'productType'
} as const
export type ProductInfoOrderByRelevanceFieldEnum = (typeof ProductInfoOrderByRelevanceFieldEnum)[keyof typeof ProductInfoOrderByRelevanceFieldEnum]
export const ProductBrandOrderByRelevanceFieldEnum = {
name: 'name',
description: 'description',
imageUrl: 'imageUrl'
} as const
export type ProductBrandOrderByRelevanceFieldEnum = (typeof ProductBrandOrderByRelevanceFieldEnum)[keyof typeof ProductBrandOrderByRelevanceFieldEnum]
export const ProductCategoryOrderByRelevanceFieldEnum = {
name: 'name',
description: 'description',
imageUrl: 'imageUrl'
} as const
export type ProductCategoryOrderByRelevanceFieldEnum = (typeof ProductCategoryOrderByRelevanceFieldEnum)[keyof typeof ProductCategoryOrderByRelevanceFieldEnum]
export const VendorOrderByRelevanceFieldEnum = {
firstName: 'firstName',
lastName: 'lastName',
email: 'email',
mobileNumber: 'mobileNumber',
address: 'address',
city: 'city',
state: 'state',
country: 'country'
} as const
export type VendorOrderByRelevanceFieldEnum = (typeof VendorOrderByRelevanceFieldEnum)[keyof typeof VendorOrderByRelevanceFieldEnum]
export const CustomerOrderByRelevanceFieldEnum = {
firstName: 'firstName',
lastName: 'lastName',
email: 'email',
mobileNumber: 'mobileNumber',
address: 'address',
city: 'city',
state: 'state',
country: 'country'
} as const
export type CustomerOrderByRelevanceFieldEnum = (typeof CustomerOrderByRelevanceFieldEnum)[keyof typeof CustomerOrderByRelevanceFieldEnum]
export const InventoryOrderByRelevanceFieldEnum = {
name: 'name',
location: 'location'
} as const
export type InventoryOrderByRelevanceFieldEnum = (typeof InventoryOrderByRelevanceFieldEnum)[keyof typeof InventoryOrderByRelevanceFieldEnum]
export const StoreOrderByRelevanceFieldEnum = {
name: 'name',
location: 'location'
} as const
export type StoreOrderByRelevanceFieldEnum = (typeof StoreOrderByRelevanceFieldEnum)[keyof typeof StoreOrderByRelevanceFieldEnum]
+21
View File
@@ -0,0 +1,21 @@
/* !!! This is code generated by Prisma. Do not edit directly. !!! */
/* eslint-disable */
// biome-ignore-all lint: generated file
// @ts-nocheck
/*
* This is a barrel export file for all models and their related types.
*
* 🟢 You can import this file directly.
*/
export type * from './models/User.js'
export type * from './models/Role.js'
export type * from './models/Product.js'
export type * from './models/ProductInfo.js'
export type * from './models/ProductBrand.js'
export type * from './models/ProductCategory.js'
export type * from './models/Vendor.js'
export type * from './models/Customer.js'
export type * from './models/Inventory.js'
export type * from './models/Store.js'
export type * from './commonInputTypes.js'
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,4 @@
export class CreateInventoryDto {
name: string
location?: string
}
@@ -0,0 +1,5 @@
export class UpdateInventoryDto {
name?: string
location?: string
isActive?: boolean
}
+34
View File
@@ -0,0 +1,34 @@
import { Body, Controller, Delete, Get, Param, Patch, Post } from '@nestjs/common'
import { CreateInventoryDto } from './dto/create-inventory.dto'
import { UpdateInventoryDto } from './dto/update-inventory.dto'
import { InventoriesService } from './inventories.service'
@Controller('inventories')
export class InventoriesController {
constructor(private readonly inventoriesService: InventoriesService) {}
@Post()
create(@Body() dto: CreateInventoryDto) {
return this.inventoriesService.create(dto)
}
@Get()
findAll() {
return this.inventoriesService.findAll()
}
@Get(':id')
findOne(@Param('id') id: string) {
return this.inventoriesService.findOne(Number(id))
}
@Patch(':id')
update(@Param('id') id: string, @Body() dto: UpdateInventoryDto) {
return this.inventoriesService.update(Number(id), dto)
}
@Delete(':id')
remove(@Param('id') id: string) {
return this.inventoriesService.remove(Number(id))
}
}
+11
View File
@@ -0,0 +1,11 @@
import { Module } from '@nestjs/common'
import { PrismaModule } from '../prisma/prisma.module'
import { InventoriesController } from './inventories.controller'
import { InventoriesService } from './inventories.service'
@Module({
imports: [PrismaModule],
controllers: [InventoriesController],
providers: [InventoriesService],
})
export class InventoriesModule {}
+27
View File
@@ -0,0 +1,27 @@
import { Injectable } from '@nestjs/common'
import { PrismaService } from '../prisma/prisma.service'
@Injectable()
export class InventoriesService {
constructor(private prisma: PrismaService) {}
create(data: any) {
return this.prisma.inventory.create({ data })
}
findAll() {
return this.prisma.inventory.findMany()
}
findOne(id: number) {
return this.prisma.inventory.findUnique({ where: { id } })
}
update(id: number, data: any) {
return this.prisma.inventory.update({ where: { id }, data })
}
remove(id: number) {
return this.prisma.inventory.delete({ where: { id } })
}
}
+17
View File
@@ -0,0 +1,17 @@
import { PrismaMariaDb } from '@prisma/adapter-mariadb'
// import 'dotenv/config'
import { PrismaClient } from '../generated/prisma/client'
console.log('@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@')
console.log(process.env.DATABASE_HOST)
const adapter = new PrismaMariaDb({
host: process.env.DATABASE_HOST,
user: process.env.DATABASE_USER,
password: process.env.DATABASE_PASSWORD,
database: process.env.DATABASE_NAME,
connectionLimit: 5,
})
const prisma = new PrismaClient({ adapter })
export { prisma }
+32
View File
@@ -0,0 +1,32 @@
import { VersioningType } from '@nestjs/common'
import { NestFactory } from '@nestjs/core'
import { DocumentBuilder, SwaggerModule } from '@nestjs/swagger'
import { AppModule } from './app.module'
import { LoggingInterceptor } from './common/interceptors/logging.interceptor'
import { ResponseMappingInterceptor } from './common/interceptors/response-mapping.interceptor'
async function bootstrap() {
const app = await NestFactory.create(AppModule)
const config = new DocumentBuilder()
.setTitle('Pos')
.setDescription('The Pos API description')
.setVersion('1.0')
.addTag('pos')
.build()
const documentFactory = () => SwaggerModule.createDocument(app, config)
SwaggerModule.setup('swagger', app, documentFactory)
// Set API prefix and enable URI versioning so all routes live under /api/v1/*
app.setGlobalPrefix('api')
app.enableVersioning({
type: VersioningType.URI,
defaultVersion: '1',
})
// Register global logging and response mapping interceptors
app.useGlobalInterceptors(new LoggingInterceptor(), new ResponseMappingInterceptor())
await app.listen(process.env.PORT ?? 3000)
}
bootstrap()
+65
View File
@@ -0,0 +1,65 @@
/**
* Prisma 7 config helper.
*
* Purpose: centralize PrismaClient options for Nest and tests.
* This reads environment variables (e.g. PRISMA_ACCELERATE_URL, PRISMA_CLIENT_LOG)
* and returns a valid options object to pass to `new PrismaClient(options)`.
*
* Keep this file small and dependency-free so it can be used in scripts.
*/
const pkg = require('@prisma/adapter-mariadb')
export function getPrismaOptions(): any {
const options: any = {}
// Logging: allow configuring via PRISMA_CLIENT_LOG (comma separated levels)
// default to query/info/warn/error during development
const envLog = process.env.PRISMA_CLIENT_LOG
if (envLog && envLog.trim() !== '') {
const levels = envLog
.split(',')
.map(s => s.trim())
.filter(Boolean)
options.log = levels.map((level: string) => ({ emit: 'stdout', level }))
} else {
options.log = [
{ emit: 'stdout', level: 'query' },
{ emit: 'stdout', level: 'info' },
{ emit: 'stdout', level: 'warn' },
{ emit: 'stdout', level: 'error' },
]
}
// Prisma Accelerate: only add when provided and non-empty (Prisma 7 validation requires non-empty string)
const accel = process.env.PRISMA_ACCELERATE_URL
if (accel && accel.trim() !== '') {
options.accelerateUrl = accel
}
try {
// dynamic require so this file doesn't hard-depend on adapters at compile time
// eslint-disable-next-line @typescript-eslint/no-var-requires
if (pkg) {
// Try common export patterns: default function, module function, or factory named createAdapter/getAdapter
if (typeof pkg === 'function') {
options.adapter = pkg()
} else if (pkg.default && typeof pkg.default === 'function') {
options.adapter = pkg.default()
} else if (pkg.createAdapter && typeof pkg.createAdapter === 'function') {
options.adapter = pkg.createAdapter()
} else if (pkg.getAdapter && typeof pkg.getAdapter === 'function') {
options.adapter = pkg.getAdapter()
}
}
} catch (e) {
// package not found or failed to initialize; try next candidate
}
// Error format (optional)
if (process.env.PRISMA_ERROR_FORMAT) {
options.errorFormat = process.env.PRISMA_ERROR_FORMAT as any
}
return options
}
+9
View File
@@ -0,0 +1,9 @@
import { Global, Module } from '@nestjs/common'
import { PrismaService } from './prisma.service'
@Global()
@Module({
providers: [PrismaService],
exports: [PrismaService],
})
export class PrismaModule {}
+33
View File
@@ -0,0 +1,33 @@
import { Injectable, OnModuleDestroy, OnModuleInit } from '@nestjs/common'
import { PrismaMariaDb } from '@prisma/adapter-mariadb'
import 'dotenv/config'
import { env } from 'prisma/config'
import { PrismaClient } from '../generated/prisma/client'
@Injectable()
export class PrismaService extends PrismaClient implements OnModuleInit, OnModuleDestroy {
constructor() {
const adapter = new PrismaMariaDb({
host: env('DATABASE_HOST'),
user: env('DATABASE_USER'),
password: env('DATABASE_PASSWORD'),
database: env('DATABASE_NAME'),
connectionLimit: 5,
})
super({ adapter })
}
async onModuleInit() {
await this.$connect()
}
async onModuleDestroy() {
await this.$disconnect()
}
// async enableShutdownHooks(app: any) {
// this.$on('beforeExit', async () => {
// await app.close()
// })
// }
}
@@ -0,0 +1,5 @@
export class CreateProductBrandDto {
name: string
description?: string
imageUrl?: string
}
@@ -0,0 +1,5 @@
export class UpdateProductBrandDto {
name?: string
description?: string
imageUrl?: string
}
@@ -0,0 +1,34 @@
import { Body, Controller, Delete, Get, Param, Patch, Post } from '@nestjs/common'
import { CreateProductBrandDto } from './dto/create-product-brand.dto'
import { UpdateProductBrandDto } from './dto/update-product-brand.dto'
import { ProductBrandsService } from './product-brands.service'
@Controller('product-brands')
export class ProductBrandsController {
constructor(private readonly productBrandsService: ProductBrandsService) {}
@Post()
create(@Body() dto: CreateProductBrandDto) {
return this.productBrandsService.create(dto)
}
@Get()
findAll() {
return this.productBrandsService.findAll()
}
@Get(':id')
findOne(@Param('id') id: string) {
return this.productBrandsService.findOne(Number(id))
}
@Patch(':id')
update(@Param('id') id: string, @Body() dto: UpdateProductBrandDto) {
return this.productBrandsService.update(Number(id), dto)
}
@Delete(':id')
remove(@Param('id') id: string) {
return this.productBrandsService.remove(Number(id))
}
}
@@ -0,0 +1,11 @@
import { Module } from '@nestjs/common'
import { PrismaModule } from '../prisma/prisma.module'
import { ProductBrandsController } from './product-brands.controller'
import { ProductBrandsService } from './product-brands.service'
@Module({
imports: [PrismaModule],
controllers: [ProductBrandsController],
providers: [ProductBrandsService],
})
export class ProductBrandsModule {}
@@ -0,0 +1,27 @@
import { Injectable } from '@nestjs/common'
import { PrismaService } from '../prisma/prisma.service'
@Injectable()
export class ProductBrandsService {
constructor(private prisma: PrismaService) {}
create(data: any) {
return this.prisma.productBrand.create({ data })
}
findAll() {
return this.prisma.productBrand.findMany()
}
findOne(id: number) {
return this.prisma.productBrand.findUnique({ where: { id } })
}
update(id: number, data: any) {
return this.prisma.productBrand.update({ where: { id }, data })
}
remove(id: number) {
return this.prisma.productBrand.delete({ where: { id } })
}
}
@@ -0,0 +1,5 @@
export class CreateProductCategoryDto {
name: string
description?: string
imageUrl?: string
}
@@ -0,0 +1,5 @@
export class UpdateProductCategoryDto {
name?: string
description?: string
imageUrl?: string
}
@@ -0,0 +1,34 @@
import { Body, Controller, Delete, Get, Param, Patch, Post } from '@nestjs/common'
import { CreateProductCategoryDto } from './dto/create-product-category.dto'
import { UpdateProductCategoryDto } from './dto/update-product-category.dto'
import { ProductCategoriesService } from './product-categories.service'
@Controller('product-categories')
export class ProductCategoriesController {
constructor(private readonly productCategoriesService: ProductCategoriesService) {}
@Post()
create(@Body() dto: CreateProductCategoryDto) {
return this.productCategoriesService.create(dto)
}
@Get()
findAll() {
return this.productCategoriesService.findAll()
}
@Get(':id')
findOne(@Param('id') id: string) {
return this.productCategoriesService.findOne(Number(id))
}
@Patch(':id')
update(@Param('id') id: string, @Body() dto: UpdateProductCategoryDto) {
return this.productCategoriesService.update(Number(id), dto)
}
@Delete(':id')
remove(@Param('id') id: string) {
return this.productCategoriesService.remove(Number(id))
}
}
@@ -0,0 +1,11 @@
import { Module } from '@nestjs/common'
import { PrismaModule } from '../prisma/prisma.module'
import { ProductCategoriesController } from './product-categories.controller'
import { ProductCategoriesService } from './product-categories.service'
@Module({
imports: [PrismaModule],
controllers: [ProductCategoriesController],
providers: [ProductCategoriesService],
})
export class ProductCategoriesModule {}
@@ -0,0 +1,27 @@
import { Injectable } from '@nestjs/common'
import { PrismaService } from '../prisma/prisma.service'
@Injectable()
export class ProductCategoriesService {
constructor(private prisma: PrismaService) {}
create(data: any) {
return this.prisma.productCategory.create({ data })
}
findAll() {
return this.prisma.productCategory.findMany()
}
findOne(id: number) {
return this.prisma.productCategory.findUnique({ where: { id } })
}
update(id: number, data: any) {
return this.prisma.productCategory.update({ where: { id }, data })
}
remove(id: number) {
return this.prisma.productCategory.delete({ where: { id } })
}
}
@@ -0,0 +1,9 @@
export class CreateProductInfoDto {
name: string
description?: string
productType?: string
metaData?: any
brandId?: number
categoryId?: number
vendorId: number
}
@@ -0,0 +1,9 @@
export class UpdateProductInfoDto {
name?: string
description?: string
productType?: string
metaData?: any
brandId?: number
categoryId?: number
vendorId?: number
}
@@ -0,0 +1,34 @@
import { Body, Controller, Delete, Get, Param, Patch, Post } from '@nestjs/common'
import { CreateProductInfoDto } from './dto/create-product-info.dto'
import { UpdateProductInfoDto } from './dto/update-product-info.dto'
import { ProductInfoService } from './product-info.service'
@Controller('product-info')
export class ProductInfoController {
constructor(private readonly productInfoService: ProductInfoService) {}
@Post()
create(@Body() dto: CreateProductInfoDto) {
return this.productInfoService.create(dto)
}
@Get()
findAll() {
return this.productInfoService.findAll()
}
@Get(':id')
findOne(@Param('id') id: string) {
return this.productInfoService.findOne(Number(id))
}
@Patch(':id')
update(@Param('id') id: string, @Body() dto: UpdateProductInfoDto) {
return this.productInfoService.update(Number(id), dto)
}
@Delete(':id')
remove(@Param('id') id: string) {
return this.productInfoService.remove(Number(id))
}
}
+11
View File
@@ -0,0 +1,11 @@
import { Module } from '@nestjs/common'
import { PrismaModule } from '../prisma/prisma.module'
import { ProductInfoController } from './product-info.controller'
import { ProductInfoService } from './product-info.service'
@Module({
imports: [PrismaModule],
controllers: [ProductInfoController],
providers: [ProductInfoService],
})
export class ProductInfoModule {}
+27
View File
@@ -0,0 +1,27 @@
import { Injectable } from '@nestjs/common'
import { PrismaService } from '../prisma/prisma.service'
@Injectable()
export class ProductInfoService {
constructor(private prisma: PrismaService) {}
create(data: any) {
return this.prisma.productInfo.create({ data })
}
findAll() {
return this.prisma.productInfo.findMany()
}
findOne(id: number) {
return this.prisma.productInfo.findUnique({ where: { id } })
}
update(id: number, data: any) {
return this.prisma.productInfo.update({ where: { id }, data })
}
remove(id: number) {
return this.prisma.productInfo.delete({ where: { id } })
}
}
+15
View File
@@ -0,0 +1,15 @@
export class CreateProductDto {
name: string
description?: string
sku?: string
barcode?: string
imageUrl?: string
attachmentId?: number
unit: string
discount?: number
quantity?: number
alertQuantity?: number
isActive?: boolean
isFeatured?: boolean
productInfoId: number
}
+15
View File
@@ -0,0 +1,15 @@
export class UpdateProductDto {
name?: string
description?: string
sku?: string
barcode?: string
imageUrl?: string
attachmentId?: number
unit?: string
discount?: number
quantity?: number
alertQuantity?: number
isActive?: boolean
isFeatured?: boolean
productInfoId?: number
}
+34
View File
@@ -0,0 +1,34 @@
import { Body, Controller, Delete, Get, Param, Patch, Post } from '@nestjs/common'
import { CreateProductDto } from './dto/create-product.dto'
import { UpdateProductDto } from './dto/update-product.dto'
import { ProductsService } from './products.service'
@Controller('products')
export class ProductsController {
constructor(private readonly productsService: ProductsService) {}
@Post()
create(@Body() dto: CreateProductDto) {
return this.productsService.create(dto)
}
@Get()
findAll() {
return this.productsService.findAll()
}
@Get(':id')
findOne(@Param('id') id: string) {
return this.productsService.findOne(Number(id))
}
@Patch(':id')
update(@Param('id') id: string, @Body() dto: UpdateProductDto) {
return this.productsService.update(Number(id), dto)
}
@Delete(':id')
remove(@Param('id') id: string) {
return this.productsService.remove(Number(id))
}
}
+11
View File
@@ -0,0 +1,11 @@
import { Module } from '@nestjs/common'
import { PrismaModule } from '../prisma/prisma.module'
import { ProductsController } from './products.controller'
import { ProductsService } from './products.service'
@Module({
imports: [PrismaModule],
controllers: [ProductsController],
providers: [ProductsService],
})
export class ProductsModule {}
+27
View File
@@ -0,0 +1,27 @@
import { Injectable } from '@nestjs/common'
import { PrismaService } from '../prisma/prisma.service'
@Injectable()
export class ProductsService {
constructor(private prisma: PrismaService) {}
create(data: any) {
return this.prisma.product.create({ data })
}
findAll() {
return this.prisma.product.findMany()
}
findOne(id: number) {
return this.prisma.product.findUnique({ where: { id } })
}
update(id: number, data: any) {
return this.prisma.product.update({ where: { id }, data })
}
remove(id: number) {
return this.prisma.product.delete({ where: { id } })
}
}
+5
View File
@@ -0,0 +1,5 @@
export class CreateRoleDto {
name: string
description?: string
permissions?: any
}
+5
View File
@@ -0,0 +1,5 @@
export class UpdateRoleDto {
name?: string
description?: string
permissions?: any
}
+34
View File
@@ -0,0 +1,34 @@
import { Body, Controller, Delete, Get, Param, Patch, Post } from '@nestjs/common'
import { CreateRoleDto } from './dto/create-role.dto'
import { UpdateRoleDto } from './dto/update-role.dto'
import { RolesService } from './roles.service'
@Controller('roles')
export class RolesController {
constructor(private readonly rolesService: RolesService) {}
@Post()
create(@Body() dto: CreateRoleDto) {
return this.rolesService.create(dto)
}
@Get()
findAll() {
return this.rolesService.findAll()
}
@Get(':id')
findOne(@Param('id') id: string) {
return this.rolesService.findOne(Number(id))
}
@Patch(':id')
update(@Param('id') id: string, @Body() dto: UpdateRoleDto) {
return this.rolesService.update(Number(id), dto)
}
@Delete(':id')
remove(@Param('id') id: string) {
return this.rolesService.remove(Number(id))
}
}
+11
View File
@@ -0,0 +1,11 @@
import { Module } from '@nestjs/common'
import { PrismaModule } from '../prisma/prisma.module'
import { RolesController } from './roles.controller'
import { RolesService } from './roles.service'
@Module({
imports: [PrismaModule],
controllers: [RolesController],
providers: [RolesService],
})
export class RolesModule {}
+27
View File
@@ -0,0 +1,27 @@
import { Injectable } from '@nestjs/common'
import { PrismaService } from '../prisma/prisma.service'
@Injectable()
export class RolesService {
constructor(private prisma: PrismaService) {}
create(data: any) {
return this.prisma.role.create({ data })
}
findAll() {
return this.prisma.role.findMany()
}
findOne(id: number) {
return this.prisma.role.findUnique({ where: { id } })
}
update(id: number, data: any) {
return this.prisma.role.update({ where: { id }, data })
}
remove(id: number) {
return this.prisma.role.delete({ where: { id } })
}
}
+4
View File
@@ -0,0 +1,4 @@
export class CreateStoreDto {
name: string
location?: string
}
+5
View File
@@ -0,0 +1,5 @@
export class UpdateStoreDto {
name?: string
location?: string
isActive?: boolean
}
+34
View File
@@ -0,0 +1,34 @@
import { Body, Controller, Delete, Get, Param, Patch, Post } from '@nestjs/common'
import { CreateStoreDto } from './dto/create-store.dto'
import { UpdateStoreDto } from './dto/update-store.dto'
import { StoresService } from './stores.service'
@Controller('stores')
export class StoresController {
constructor(private readonly storesService: StoresService) {}
@Post()
create(@Body() dto: CreateStoreDto) {
return this.storesService.create(dto)
}
@Get()
findAll() {
return this.storesService.findAll()
}
@Get(':id')
findOne(@Param('id') id: string) {
return this.storesService.findOne(Number(id))
}
@Patch(':id')
update(@Param('id') id: string, @Body() dto: UpdateStoreDto) {
return this.storesService.update(Number(id), dto)
}
@Delete(':id')
remove(@Param('id') id: string) {
return this.storesService.remove(Number(id))
}
}
+11
View File
@@ -0,0 +1,11 @@
import { Module } from '@nestjs/common'
import { PrismaModule } from '../prisma/prisma.module'
import { StoresController } from './stores.controller'
import { StoresService } from './stores.service'
@Module({
imports: [PrismaModule],
controllers: [StoresController],
providers: [StoresService],
})
export class StoresModule {}
+27
View File
@@ -0,0 +1,27 @@
import { Injectable } from '@nestjs/common'
import { PrismaService } from '../prisma/prisma.service'
@Injectable()
export class StoresService {
constructor(private prisma: PrismaService) {}
create(data: any) {
return this.prisma.store.create({ data })
}
findAll() {
return this.prisma.store.findMany()
}
findOne(id: number) {
return this.prisma.store.findUnique({ where: { id } })
}
update(id: number, data: any) {
return this.prisma.store.update({ where: { id }, data })
}
remove(id: number) {
return this.prisma.store.delete({ where: { id } })
}
}
+7
View File
@@ -0,0 +1,7 @@
export class CreateUserDto {
mobileNumber: string
password: string
firstName: string
lastName: string
roleId: number
}
+8
View File
@@ -0,0 +1,8 @@
export class UpdateUserDto {
mobileNumber?: string
password?: string
firstName?: string
lastName?: string
roleId?: number
isActive?: boolean
}
+34
View File
@@ -0,0 +1,34 @@
import { Body, Controller, Delete, Get, Param, Patch, Post } from '@nestjs/common'
import { CreateUserDto } from './dto/create-user.dto'
import { UpdateUserDto } from './dto/update-user.dto'
import { UsersService } from './users.service'
@Controller('users')
export class UsersController {
constructor(private readonly usersService: UsersService) {}
@Post()
create(@Body() dto: CreateUserDto) {
return this.usersService.create(dto)
}
@Get()
findAll() {
return this.usersService.findAll()
}
@Get(':id')
findOne(@Param('id') id: string) {
return this.usersService.findOne(Number(id))
}
@Patch(':id')
update(@Param('id') id: string, @Body() dto: UpdateUserDto) {
return this.usersService.update(Number(id), dto)
}
@Delete(':id')
remove(@Param('id') id: string) {
return this.usersService.remove(Number(id))
}
}
+11
View File
@@ -0,0 +1,11 @@
import { Module } from '@nestjs/common'
import { PrismaModule } from '../prisma/prisma.module'
import { UsersController } from './users.controller'
import { UsersService } from './users.service'
@Module({
imports: [PrismaModule],
controllers: [UsersController],
providers: [UsersService],
})
export class UsersModule {}
+27
View File
@@ -0,0 +1,27 @@
import { Injectable } from '@nestjs/common'
import { PrismaService } from '../prisma/prisma.service'
@Injectable()
export class UsersService {
constructor(private prisma: PrismaService) {}
create(data: any) {
return this.prisma.user.create({ data })
}
findAll() {
return this.prisma.user.findMany()
}
findOne(id: number) {
return this.prisma.user.findUnique({ where: { id } })
}
update(id: number, data: any) {
return this.prisma.user.update({ where: { id }, data })
}
remove(id: number) {
return this.prisma.user.delete({ where: { id } })
}
}
+10
View File
@@ -0,0 +1,10 @@
export class CreateVendorDto {
firstName: string
lastName: string
email?: string
mobileNumber?: string
address?: string
city?: string
state?: string
country?: string
}
+11
View File
@@ -0,0 +1,11 @@
export class UpdateVendorDto {
firstName?: string
lastName?: string
email?: string
mobileNumber?: string
address?: string
city?: string
state?: string
country?: string
isActive?: boolean
}
+34
View File
@@ -0,0 +1,34 @@
import { Body, Controller, Delete, Get, Param, Patch, Post } from '@nestjs/common'
import { CreateVendorDto } from './dto/create-vendor.dto'
import { UpdateVendorDto } from './dto/update-vendor.dto'
import { VendorsService } from './vendors.service'
@Controller('vendors')
export class VendorsController {
constructor(private readonly vendorsService: VendorsService) {}
@Post()
create(@Body() dto: CreateVendorDto) {
return this.vendorsService.create(dto)
}
@Get()
findAll() {
return this.vendorsService.findAll()
}
@Get(':id')
findOne(@Param('id') id: string) {
return this.vendorsService.findOne(Number(id))
}
@Patch(':id')
update(@Param('id') id: string, @Body() dto: UpdateVendorDto) {
return this.vendorsService.update(Number(id), dto)
}
@Delete(':id')
remove(@Param('id') id: string) {
return this.vendorsService.remove(Number(id))
}
}
+11
View File
@@ -0,0 +1,11 @@
import { Module } from '@nestjs/common'
import { PrismaModule } from '../prisma/prisma.module'
import { VendorsController } from './vendors.controller'
import { VendorsService } from './vendors.service'
@Module({
imports: [PrismaModule],
controllers: [VendorsController],
providers: [VendorsService],
})
export class VendorsModule {}
+27
View File
@@ -0,0 +1,27 @@
import { Injectable } from '@nestjs/common'
import { PrismaService } from '../prisma/prisma.service'
@Injectable()
export class VendorsService {
constructor(private prisma: PrismaService) {}
create(data: any) {
return this.prisma.vendor.create({ data })
}
findAll() {
return this.prisma.vendor.findMany()
}
findOne(id: number) {
return this.prisma.vendor.findUnique({ where: { id } })
}
update(id: number, data: any) {
return this.prisma.vendor.update({ where: { id }, data })
}
remove(id: number) {
return this.prisma.vendor.delete({ where: { id } })
}
}