Compare commits
36 Commits
758bb03a26
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
| 636daca703 | |||
| 9bf294a1f3 | |||
| 839f6de691 | |||
| 826041b07a | |||
| f87e5b9d8e | |||
| 652177862d | |||
| ac2e7f5dab | |||
| f94a108948 | |||
| d51b677f26 | |||
| 9170d8cd5a | |||
| 5f70b95589 | |||
| d2bd576277 | |||
| 23bfe1ecbe | |||
| 47a27fb54f | |||
| f61100bf25 | |||
| 25e589551b | |||
| 5ce560ce97 | |||
| b2d8fdc8a0 | |||
| c11166b365 | |||
| 7ae027633b | |||
| a975f9d02a | |||
| cd3492d625 | |||
| 816c5ebb50 | |||
| 4836ee4d01 | |||
| ea6f1bfdd0 | |||
| b53b7d3ed3 | |||
| 6f65123816 | |||
| 2c97b7302d | |||
| 2dc9480170 | |||
| 9aa12184a1 | |||
| 1d47fb1a1d | |||
| fc27b9d616 | |||
| 98099e97e7 | |||
| d526f6ed2c | |||
| 62b659246f | |||
| c5c522f69c |
@@ -16,6 +16,11 @@ PORT="5002"
|
||||
DB_ROOT_PASSWORD="root_password"
|
||||
NODE_ENV="production"
|
||||
|
||||
REDIS_HOST="redis"
|
||||
REDIS_PORT="6379"
|
||||
REDIS_DB="0"
|
||||
REDIS_PASSWORD=""
|
||||
|
||||
|
||||
|
||||
ARVANCLOUD_ENDPOINT=https://s3.ir-thr-at1.arvanstorage.com
|
||||
|
||||
Vendored
+2
-2
@@ -11,7 +11,6 @@
|
||||
"[typescript]": {
|
||||
"editor.defaultFormatter": "esbenp.prettier-vscode"
|
||||
},
|
||||
"editor.formatOnSave": true,
|
||||
"cSpell.words": [
|
||||
"ARVANCLOUD",
|
||||
"autoincrement",
|
||||
@@ -27,5 +26,6 @@
|
||||
"setm",
|
||||
"spro",
|
||||
"sstid"
|
||||
]
|
||||
],
|
||||
"editor.formatOnSave": true
|
||||
}
|
||||
|
||||
@@ -1,104 +1,182 @@
|
||||
# AGENT.md
|
||||
# AGENTS.md
|
||||
|
||||
Operational guide for AI/coding agents working in `consumer_api`.
|
||||
## Stack
|
||||
|
||||
## Scope
|
||||
- Applies to the whole repository.
|
||||
- Stack: NestJS + Prisma + TypeScript.
|
||||
- NestJS
|
||||
- Prisma
|
||||
- TypeScript
|
||||
- pnpm
|
||||
- RTK enabled
|
||||
|
||||
## Primary Goals
|
||||
- Deliver minimal, safe, and focused changes.
|
||||
- Preserve existing API behavior unless explicitly requested.
|
||||
- Keep Prisma schema/data operations forward-safe.
|
||||
---
|
||||
|
||||
## Project Conventions
|
||||
- Keep module layering consistent: `controller -> service -> prisma/shared service`.
|
||||
- Reuse shared services for cross-module business logic (for example, sales invoice create flow).
|
||||
- Keep DTO validation at API boundaries; avoid unchecked `any` in new code.
|
||||
- Keep response shaping aligned with existing `ResponseMapper` usage.
|
||||
- Prefer explicit Prisma `select`/`include` to control payload shape.
|
||||
# Core Rules
|
||||
|
||||
## Sales Invoice / TSP Rules
|
||||
- `originalSend`, `correctionSend`, and `revoke` flows should be consistent and auditable.
|
||||
- For correction/revoke creation, prepare data from the related invoice when required.
|
||||
- Persist attempt records with clear status transitions (`QUEUED` -> final status).
|
||||
- Store request/response payloads for traceability.
|
||||
- Avoid changing fiscal/tax status semantics without explicit approval.
|
||||
- Keep changes minimal.
|
||||
- Do not touch unrelated files.
|
||||
- Prefer existing patterns over new abstractions.
|
||||
- Preserve API behavior unless requested otherwise.
|
||||
- Prefer forward Prisma migrations.
|
||||
- Never edit applied migrations in shared environments.
|
||||
|
||||
## Prisma and Migration Safety
|
||||
- Treat committed migrations as immutable history.
|
||||
- Prefer forward migrations; avoid destructive resets unless explicitly requested.
|
||||
- For data-affecting changes:
|
||||
- use transactions,
|
||||
- verify expected row scope,
|
||||
- keep logic idempotent where possible.
|
||||
---
|
||||
|
||||
## Editing Principles
|
||||
- Do not modify unrelated files.
|
||||
- Do not revert user changes unless asked.
|
||||
- Keep functions cohesive; extract shared logic when duplication appears.
|
||||
- Remove debug leftovers (`console.log`, dead code) before finishing unless explicitly needed.
|
||||
# EXECUTION RULES
|
||||
|
||||
## Validation Checklist (before handoff)
|
||||
1. Read target module/service/DTO end-to-end before edits.
|
||||
2. Apply minimal patch with consistent naming.
|
||||
3. Run typecheck: `pnpm -s tsc --noEmit`.
|
||||
4. If behavior changed, run targeted checks/tests where possible.
|
||||
5. Summarize changed files and behavior impact clearly.
|
||||
- Keep responses short.
|
||||
- Do not narrate thoughts.
|
||||
- Do not explain obvious steps.
|
||||
- Do not create plans for simple tasks.
|
||||
- Prefer implementation over exploration.
|
||||
|
||||
## Useful Commands
|
||||
- Typecheck: `pnpm -s tsc --noEmit`
|
||||
- Migration status: `pnpm prisma migrate status`
|
||||
- Create migration: `pnpm prisma migrate dev --name <name>`
|
||||
- Deploy migrations: `pnpm prisma migrate deploy`
|
||||
Avoid:
|
||||
|
||||
## Communication Style
|
||||
- Be concise and implementation-focused.
|
||||
- Call out assumptions/risk before risky steps.
|
||||
- Provide practical next actions after task completion.
|
||||
- “I think…”
|
||||
- “Let me check…”
|
||||
- “I should inspect…”
|
||||
- “I’m going to…”
|
||||
|
||||
## Do / Don't (Repo-Specific)
|
||||
---
|
||||
|
||||
### Do
|
||||
- Do derive correction/revoke invoice creation data from `relatedInvoice` when the flow requires historical consistency.
|
||||
- Do keep TSP attempt lifecycle explicit (`QUEUED`, then update with provider result and timestamps).
|
||||
- Do use shared invoice-creation service instead of duplicating create logic across modules.
|
||||
- Do normalize numeric DB values (`Decimal`) with `Number(...)` before DTO/payload composition.
|
||||
- Do keep Prisma queries tight with `select`/`include` only for fields you actually use.
|
||||
# RTK Rules
|
||||
|
||||
### Don't
|
||||
- Don't pass undefined/out-of-scope variables in TSP flows (common regressions: `invoice_id`, `attemptId`, `pos_id` mismatches).
|
||||
- Don't leave placeholder query blocks (for example empty `select: {}`) in production code.
|
||||
- Don't mix method semantics (`send` vs `originalSend`) across services without verifying signatures.
|
||||
- Don't leave debug logs (`console.log`) in critical invoice/tax paths unless explicitly requested.
|
||||
- Don't change invoice type semantics (`ORIGINAL`, `CORRECTION`, `REVOKE`) implicitly.
|
||||
Always prefer RTK commands.
|
||||
|
||||
### Common Pitfalls To Recheck
|
||||
- Incorrect relation field names (`tax_id` on wrong model, missing relation selects).
|
||||
- Building payloads from the wrong invoice (must match the expected new/ref invoice in each flow).
|
||||
- Creating attempts without persisting request payload and final response payload.
|
||||
- Mismatch between DTO shapes and shared service input contracts.
|
||||
Use:
|
||||
|
||||
## Thread Notes (May 2026)
|
||||
- Shared sale-invoice creation was introduced and must be injected/exported correctly in consuming modules (example failure: `UnknownDependenciesException` for `SharedSaleInvoiceCreateService`).
|
||||
- In `SalesInvoiceTspService.revoke`, prepare all creation/update data from `relatedInvoice` (no external `dataToUpdate` argument expected).
|
||||
- Prisma client is generated to `src/generated/prisma` via:
|
||||
- `provider = "prisma-client"`
|
||||
- `output = "../../src/generated/prisma"`
|
||||
- `moduleFormat = "cjs"`
|
||||
- Docker/runtime must include generated Prisma artifacts and `@prisma/client` runtime; missing `@prisma/client/runtime/client` indicates build/copy/install mismatch.
|
||||
- Seeder commands that use `tsx` require dev dependencies/runtime tools; if running in slim production container, use a dedicated seed target/container or run seed from build/dev image.
|
||||
- `pnpm` invocation in containers should use executable form (`pnpm ...`), not `node /app/pnpm`.
|
||||
- Added SQL/Prisma error normalization utility: `src/common/utils/prisma-error.util.ts`; prefer mapping duplicate/constraint DB errors to domain-friendly messages.
|
||||
- Partner-module list endpoints were standardized toward `ResponseMapper.paginate` where pagination response contract is expected.
|
||||
- For heavy license provisioning (100+), request path should not synchronously insert all licenses; queue/background + batching is required.
|
||||
- `rtk ls`
|
||||
- `rtk grep`
|
||||
- `rtk smart`
|
||||
- `rtk read`
|
||||
- `rtk git diff`
|
||||
- `rtk git status`
|
||||
|
||||
## Migration Drift Playbook (Prisma/MySQL)
|
||||
- If Prisma reports `modified after applied`, never edit an already-applied migration in-place for shared environments; create a new forward migration instead.
|
||||
- If migration history and DB drift mismatch:
|
||||
1. Verify local migration folders are complete and ordered.
|
||||
2. Check `_prisma_migrations` for missing/applied names.
|
||||
3. Use `prisma migrate resolve` only to reconcile history state, then apply a forward fix migration.
|
||||
- Duplicate FK error seen in this repo: `sales_invoices_ref_id_fkey` (MySQL 1826). Recheck migration SQL for repeated `ADD CONSTRAINT` statements before rerun.
|
||||
- Drift that repeatedly showed in this project: missing FK/unique on `sale_invoice_tsp_attempts.invoice_id`. Validate both schema and migration SQL produce the same final state.
|
||||
- `prisma migrate status` may show up-to-date while `migrate dev` still detects drift (shadow DB/application history issue); treat `migrate dev` output as source of truth for fixing local history.
|
||||
Avoid raw:
|
||||
|
||||
- `cat`
|
||||
- `grep`
|
||||
- `rg`
|
||||
- `git diff`
|
||||
- recursive repository scans
|
||||
|
||||
---
|
||||
|
||||
# Reading Strategy
|
||||
|
||||
1. `rtk grep`
|
||||
2. `rtk smart`
|
||||
3. `rtk read`
|
||||
|
||||
Rules:
|
||||
|
||||
- Read only necessary files.
|
||||
- Do not read sibling files unless needed.
|
||||
- Do not reread unchanged files.
|
||||
- Stop searching once target location is found.
|
||||
- Edit quickly after locating target.
|
||||
|
||||
Avoid:
|
||||
|
||||
- opening entire modules
|
||||
- multi-file chained reads
|
||||
- large diff dumps
|
||||
- exploratory scans
|
||||
|
||||
---
|
||||
|
||||
# Forbidden Paths
|
||||
|
||||
Do not inspect unless required:
|
||||
|
||||
- `node_modules/`
|
||||
- `dist/`
|
||||
- `coverage/`
|
||||
- `.prisma/`
|
||||
- `prisma/migrations/`
|
||||
|
||||
---
|
||||
|
||||
# Prisma Rules
|
||||
|
||||
- Use transactions for multi-step writes.
|
||||
- Prefer explicit `select/include`.
|
||||
- Normalize `Decimal` values with `Number(...)`.
|
||||
- Keep migrations forward-safe.
|
||||
- Use:
|
||||
- `pnpm prisma migrate dev --name <name>` for new local migrations
|
||||
- `pnpm prisma migrate deploy` for applying existing migrations
|
||||
|
||||
---
|
||||
|
||||
# NestJS Rules
|
||||
|
||||
- Keep layering:
|
||||
- controller
|
||||
- service
|
||||
- prisma/shared service
|
||||
|
||||
- Reuse shared services.
|
||||
- Keep DTO validation strict.
|
||||
- Avoid `any`.
|
||||
|
||||
---
|
||||
|
||||
# Validation
|
||||
|
||||
Typecheck before handoff:
|
||||
|
||||
```bash
|
||||
pnpm -s tsc --noEmit
|
||||
```
|
||||
|
||||
# INVESTIGATION LIMITS
|
||||
|
||||
For localized fixes:
|
||||
|
||||
- maximum 3 file reads before first edit
|
||||
- maximum 1 related-file read unless required
|
||||
- maximum 5 total file reads before implementation
|
||||
|
||||
Stop searching once the target service, controller, DTO, schema, or repository method is identified.
|
||||
|
||||
# TARGETED READ RULES
|
||||
|
||||
Do not read files larger than 300 lines unless required.
|
||||
|
||||
For known symbols:
|
||||
|
||||
1. rtk grep
|
||||
2. rtk smart
|
||||
3. read only the relevant section
|
||||
|
||||
Avoid opening entire services, modules, or controllers for localized changes.
|
||||
|
||||
Prefer symbol-level inspection.
|
||||
|
||||
# REVIEW MODE
|
||||
|
||||
During reviews:
|
||||
|
||||
- inspect changed files only
|
||||
- avoid repository-wide searches
|
||||
- avoid architecture exploration
|
||||
- avoid reading unrelated modules
|
||||
|
||||
Review only code affected by the diff.
|
||||
|
||||
# HARD TOKEN LIMITS
|
||||
|
||||
For localized fixes:
|
||||
|
||||
- Never read more than 5 files before the first edit.
|
||||
- Never read a file larger than 300 lines unless the target symbol cannot be isolated.
|
||||
- Never open an entire service, controller, or module when a symbol-level read is possible.
|
||||
- Never reread a file already summarized by `rtk smart` unless implementation details are required.
|
||||
|
||||
When a file exceeds 300 lines:
|
||||
|
||||
1. rtk grep
|
||||
2. rtk smart
|
||||
3. read only the required section
|
||||
|
||||
Avoid full-file reads.
|
||||
|
||||
@@ -25,6 +25,24 @@ services:
|
||||
networks:
|
||||
- psp_consumer_network
|
||||
|
||||
redis:
|
||||
image: redis:7-alpine
|
||||
platform: ${DOCKER_PLATFORM:-linux/amd64}
|
||||
container_name: psp_consumer_api_redis
|
||||
restart: unless-stopped
|
||||
command: redis-server --appendonly yes
|
||||
ports:
|
||||
- "${REDIS_PORT:-6379}:6379"
|
||||
volumes:
|
||||
- redis_data:/data
|
||||
healthcheck:
|
||||
test: ["CMD", "redis-cli", "ping"]
|
||||
interval: 15s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
networks:
|
||||
- psp_consumer_network
|
||||
|
||||
api:
|
||||
platform: ${DOCKER_PLATFORM:-linux/amd64}
|
||||
build:
|
||||
@@ -51,6 +69,8 @@ services:
|
||||
depends_on:
|
||||
database:
|
||||
condition: service_healthy
|
||||
redis:
|
||||
condition: service_healthy
|
||||
environment:
|
||||
NODE_ENV: ${NODE_ENV:-production}
|
||||
PORT: ${PORT}
|
||||
@@ -65,6 +85,10 @@ services:
|
||||
JWT_EXPIRES_IN: ${JWT_EXPIRES_IN}
|
||||
CORS_ORIGINS: ${CORS_ORIGINS:-http://localhost:5000,http://127.0.0.1:5000}
|
||||
OTP_STATIC_CODE: ${OTP_STATIC_CODE} # From .env
|
||||
REDIS_HOST: ${REDIS_HOST:-redis}
|
||||
REDIS_PORT: ${REDIS_PORT:-6379}
|
||||
REDIS_DB: ${REDIS_DB:-0}
|
||||
REDIS_PASSWORD: ${REDIS_PASSWORD:-}
|
||||
ports:
|
||||
- "${PORT:-5002}:5002"
|
||||
read_only: true
|
||||
@@ -135,6 +159,8 @@ services:
|
||||
volumes:
|
||||
db_data:
|
||||
driver: local
|
||||
redis_data:
|
||||
driver: local
|
||||
|
||||
networks:
|
||||
psp_consumer_network:
|
||||
|
||||
+5
-2
@@ -8,8 +8,8 @@
|
||||
"@nestjs/jwt": "^11.0.2",
|
||||
"@nestjs/platform-express": "^11.1.19",
|
||||
"@nestjs/swagger": "^11.3.2",
|
||||
"@prisma/client": "^7.7.0",
|
||||
"@prisma/adapter-mariadb": "^7.7.0",
|
||||
"@prisma/client": "^7.7.0",
|
||||
"@types/bcrypt": "^6.0.0",
|
||||
"@types/multer": "^2.1.0",
|
||||
"bcrypt": "^6.0.0",
|
||||
@@ -18,6 +18,7 @@
|
||||
"cookie-parser": "^1.4.7",
|
||||
"dayjs": "^1.11.20",
|
||||
"dotenv": "^17.4.2",
|
||||
"ioredis": "^5.8.2",
|
||||
"jalaliday": "^3.1.1",
|
||||
"jsonwebtoken": "^9.0.3",
|
||||
"multer": "^2.1.1",
|
||||
@@ -44,6 +45,7 @@
|
||||
"eslint-plugin-prettier": "^5.5.5",
|
||||
"globals": "^16.5.0",
|
||||
"jest": "^30.3.0",
|
||||
"plop": "^4.0.5",
|
||||
"prettier": "^3.8.3",
|
||||
"prettier-plugin-prisma": "^5.0.0",
|
||||
"source-map-support": "^0.5.21",
|
||||
@@ -81,9 +83,10 @@
|
||||
"db:reset": "tsx scripts/dump-triggers.ts && npx prisma migrate reset --force",
|
||||
"dump-triggers": "tsx scripts/dump-triggers.ts",
|
||||
"format": "prettier --write \"src/**/*.ts\" \"test/**/*.ts\"",
|
||||
"generate": "plop",
|
||||
"generate:permissions": "tsx scripts/generate-permissions.ts",
|
||||
"seed:sku": "tsx scripts/seedStockKeepingUnits.ts",
|
||||
"lint": "eslint \"{src,apps,libs,test}/**/*.ts\" --fix",
|
||||
"seed:sku": "tsx scripts/seedStockKeepingUnits.ts",
|
||||
"start": "nest start",
|
||||
"start:debug": "nest start --debug --watch",
|
||||
"start:dev": "nest start --watch",
|
||||
|
||||
@@ -0,0 +1,46 @@
|
||||
import {
|
||||
Body,
|
||||
Controller,
|
||||
Delete,
|
||||
Get,
|
||||
Param,
|
||||
Patch,
|
||||
Post,
|
||||
} from '@nestjs/common';
|
||||
import { {{pascalCase name}}Service } from './{{kebabCase name}}.service';
|
||||
import { Create{{pascalCase name}}Dto } from './dto/create-{{kebabCase name}}.dto';
|
||||
import { Update{{pascalCase name}}Dto } from './dto/update-{{kebabCase name}}.dto';
|
||||
|
||||
@Controller('{{kebabCase name}}')
|
||||
export class {{pascalCase name}}Controller {
|
||||
constructor(private readonly service: {{pascalCase name}}Service) {}
|
||||
|
||||
|
||||
@Get()
|
||||
findAll() {
|
||||
return this.service.findAll();
|
||||
}
|
||||
|
||||
@Get(':id')
|
||||
findOne(@Param('id') id: string) {
|
||||
return this.service.findOne(id);
|
||||
}
|
||||
|
||||
@Post()
|
||||
create(@Body() dto: Create{{pascalCase name}}Dto) {
|
||||
return this.service.create(dto);
|
||||
}
|
||||
|
||||
@Patch(':id')
|
||||
update(
|
||||
@Param('id') id: string,
|
||||
@Body() dto: Update{{pascalCase name}}Dto,
|
||||
) {
|
||||
return this.service.update(id, dto);
|
||||
}
|
||||
|
||||
@Delete(':id')
|
||||
remove(@Param('id') id: string) {
|
||||
return this.service.remove(id);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
import { IsString, IsNumber, IsBoolean, IsEmail } from 'class-validator';
|
||||
|
||||
export class Create{{pascalCase name}}Dto {
|
||||
{{#each parsedFields}}
|
||||
@{{validator}}()
|
||||
{{name}}: {{type}};
|
||||
|
||||
{{/each}}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
import { Module } from '@nestjs/common';
|
||||
import { {{pascalCase name}}Service } from './{{kebabCase name}}.service';
|
||||
import { {{pascalCase name}}Controller } from './{{kebabCase name}}.controller';
|
||||
import { PrismaService } from '{{prismaImportPath modulePath name}}';
|
||||
|
||||
@Module({
|
||||
controllers: [{{pascalCase name}}Controller],
|
||||
providers: [{{pascalCase name}}Service, PrismaService],
|
||||
})
|
||||
export class {{pascalCase name}}Module {}
|
||||
@@ -0,0 +1,63 @@
|
||||
import { Injectable } from '@nestjs/common';
|
||||
import { PrismaService } from '@/prisma/prisma.service';
|
||||
import { ResponseMapper } from '@/common/response/response-mapper'
|
||||
import { Create{{pascalCase name}}Dto } from './dto/create-{{kebabCase name}}.dto';
|
||||
import { Update{{pascalCase name}}Dto } from './dto/update-{{kebabCase name}}.dto';
|
||||
|
||||
@Injectable()
|
||||
export class {{pascalCase name}}Service {
|
||||
constructor(private readonly prisma: PrismaService) {}
|
||||
|
||||
private readonly summarySelect = {
|
||||
id: true,
|
||||
}
|
||||
|
||||
private readonly select = {
|
||||
...this.summarySelect,
|
||||
}
|
||||
|
||||
private readonly where = () => ({})
|
||||
|
||||
|
||||
async findAll() {
|
||||
const items = await this.prisma.{{camelCase name}}.findMany({
|
||||
where: this.where(),
|
||||
select: this.summarySelect,
|
||||
});
|
||||
return ResponseMapper.list(items)
|
||||
}
|
||||
|
||||
async findOne(id: string) {
|
||||
const item = this.prisma.{{camelCase name}}.findUnique({
|
||||
where: {...this.where(), id },
|
||||
select: this.select,
|
||||
});
|
||||
|
||||
return ResponseMapper.single(item)
|
||||
}
|
||||
|
||||
async create(createDto: Create{{pascalCase name}}Dto) {
|
||||
const item = this.prisma.{{camelCase name}}.create({
|
||||
data: createDto,
|
||||
select: this.select,
|
||||
});
|
||||
|
||||
return ResponseMapper.create(item)
|
||||
}
|
||||
|
||||
async update(id: string, updateDto: Update{{pascalCase name}}Dto) {
|
||||
const item = this.prisma.{{camelCase name}}.update({
|
||||
where: { id },
|
||||
data: updateDto,
|
||||
select: this.select,
|
||||
});
|
||||
|
||||
return ResponseMapper.update(item)
|
||||
}
|
||||
|
||||
async remove(id: string) {
|
||||
return this.prisma.{{camelCase name}}.delete({
|
||||
where: { id },
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
import { PartialType } from '@nestjs/swagger'
|
||||
import { Create{{pascalCase name}}Dto } from './create-{{kebabCase name}}.dto';
|
||||
|
||||
export class Update{{pascalCase name}}Dto extends PartialType(Create{{pascalCase name}}Dto) {}
|
||||
+125
@@ -0,0 +1,125 @@
|
||||
const path = require('path')
|
||||
|
||||
module.exports = function (plop) {
|
||||
// -------------------------
|
||||
// Case helpers
|
||||
// -------------------------
|
||||
const toKebab = str =>
|
||||
str
|
||||
.replace(/([a-z])([A-Z])/g, '$1-$2')
|
||||
.replace(/\s+/g, '-')
|
||||
.toLowerCase()
|
||||
|
||||
const toPascal = str =>
|
||||
str
|
||||
.split(/[-_\s]+/)
|
||||
.map(part => part.charAt(0).toUpperCase() + part.slice(1))
|
||||
.join('')
|
||||
|
||||
const toCamel = str => {
|
||||
const pascal = toPascal(str)
|
||||
return pascal.charAt(0).toLowerCase() + pascal.slice(1)
|
||||
}
|
||||
|
||||
plop.setHelper('kebabCase', toKebab)
|
||||
plop.setHelper('pascalCase', toPascal)
|
||||
plop.setHelper('camelCase', toCamel)
|
||||
|
||||
// -------------------------
|
||||
// Dynamic relative import helper
|
||||
// -------------------------
|
||||
plop.setHelper('prismaImportPath', (modulePath, name) => {
|
||||
return '@/prisma/prisma.service'
|
||||
})
|
||||
|
||||
// -------------------------
|
||||
// Generator
|
||||
// -------------------------
|
||||
plop.setGenerator('resource', {
|
||||
description: 'Generate Nested NestJS Prisma Resource',
|
||||
prompts: [
|
||||
{
|
||||
type: 'input',
|
||||
name: 'name',
|
||||
message: 'Module name (e.g. user, blog-post):',
|
||||
},
|
||||
{
|
||||
type: 'input',
|
||||
name: 'modulePath',
|
||||
message: 'Nested path inside modules (e.g. admin/users) — leave empty for root:',
|
||||
default: '',
|
||||
},
|
||||
{
|
||||
type: 'input',
|
||||
name: 'fields',
|
||||
message:
|
||||
'DTO fields (comma-separated, e.g. name:string,email:email,age:number,isActive:boolean):',
|
||||
},
|
||||
],
|
||||
actions(data) {
|
||||
// sanitize path
|
||||
data.modulePath = data.modulePath.replace(/^\/+|\/+$/g, '')
|
||||
|
||||
// Parse fields
|
||||
const rawFields = data.fields || ''
|
||||
data.parsedFields = rawFields
|
||||
.split(',')
|
||||
.filter(Boolean)
|
||||
.map(field => {
|
||||
const [name, type] = field.split(':').map(v => v.trim())
|
||||
|
||||
let validator = 'IsString'
|
||||
let finalType = 'string'
|
||||
|
||||
if (type === 'number') {
|
||||
validator = 'IsNumber'
|
||||
finalType = 'number'
|
||||
}
|
||||
|
||||
if (type === 'boolean') {
|
||||
validator = 'IsBoolean'
|
||||
finalType = 'boolean'
|
||||
}
|
||||
|
||||
if (type === 'email') {
|
||||
validator = 'IsEmail'
|
||||
finalType = 'string'
|
||||
}
|
||||
|
||||
return { name, validator, type: finalType }
|
||||
})
|
||||
|
||||
const basePath = data.modulePath
|
||||
? `src/modules/${data.modulePath}/{{kebabCase name}}`
|
||||
: `src/modules/{{kebabCase name}}`
|
||||
|
||||
return [
|
||||
{
|
||||
type: 'add',
|
||||
path: `${basePath}/{{kebabCase name}}.module.ts`,
|
||||
templateFile: 'plop-templates/module.hbs',
|
||||
},
|
||||
{
|
||||
type: 'add',
|
||||
path: `${basePath}/{{kebabCase name}}.service.ts`,
|
||||
templateFile: 'plop-templates/service.hbs',
|
||||
},
|
||||
{
|
||||
type: 'add',
|
||||
path: `${basePath}/{{kebabCase name}}.controller.ts`,
|
||||
templateFile: 'plop-templates/controller.hbs',
|
||||
},
|
||||
{
|
||||
type: 'add',
|
||||
path: `${basePath}/dto/create-{{kebabCase name}}.dto.ts`,
|
||||
templateFile: 'plop-templates/create-dto.hbs',
|
||||
},
|
||||
{
|
||||
type: 'add',
|
||||
path: `${basePath}/dto/update-{{kebabCase name}}.dto.ts`,
|
||||
templateFile: 'plop-templates/update-dto.hbs',
|
||||
},
|
||||
]
|
||||
},
|
||||
})
|
||||
}
|
||||
Generated
+559
-62
File diff suppressed because it is too large
Load Diff
+86
-52
@@ -7,6 +7,7 @@ CREATE TABLE `admin_accounts` (
|
||||
`account_id` VARCHAR(191) NOT NULL,
|
||||
|
||||
UNIQUE INDEX `admin_accounts_account_id_key`(`account_id`),
|
||||
INDEX `admin_accounts_admin_id_fkey`(`admin_id`),
|
||||
PRIMARY KEY (`id`)
|
||||
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
|
||||
|
||||
@@ -275,28 +276,18 @@ CREATE TABLE `providers` (
|
||||
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
|
||||
|
||||
-- CreateTable
|
||||
CREATE TABLE `consumer_devices` (
|
||||
`uuid` VARCHAR(255) NOT NULL,
|
||||
`app_version` VARCHAR(20) NOT NULL,
|
||||
`build_number` VARCHAR(20) NOT NULL,
|
||||
`platform` VARCHAR(100) NOT NULL,
|
||||
`brand` VARCHAR(100) NOT NULL,
|
||||
`model` VARCHAR(100) NOT NULL,
|
||||
`device` VARCHAR(100) NOT NULL,
|
||||
`publisher` ENUM('DIRECT', 'CAFE_BAZAR', 'MAYKET') NOT NULL,
|
||||
`os_version` VARCHAR(20) NOT NULL,
|
||||
`sdk_version` VARCHAR(20) NOT NULL,
|
||||
`release_number` VARCHAR(20) NOT NULL,
|
||||
`user_agent` VARCHAR(100) NULL,
|
||||
`browser_name` VARCHAR(100) NULL,
|
||||
`fcm_token` VARCHAR(100) NULL,
|
||||
CREATE TABLE `consumer_account_device` (
|
||||
`id` VARCHAR(191) NOT NULL,
|
||||
`device_id` VARCHAR(191) NOT NULL,
|
||||
`device_name` VARCHAR(191) NULL,
|
||||
`created_at` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
|
||||
`updated_at` TIMESTAMP(0) NOT NULL,
|
||||
`consumer_id` VARCHAR(191) NOT NULL,
|
||||
`consumer_account_id` VARCHAR(191) NOT NULL,
|
||||
|
||||
UNIQUE INDEX `consumer_devices_uuid_key`(`uuid`),
|
||||
INDEX `consumer_devices_consumer_id_fkey`(`consumer_id`),
|
||||
PRIMARY KEY (`uuid`)
|
||||
UNIQUE INDEX `consumer_account_device_device_id_key`(`device_id`),
|
||||
UNIQUE INDEX `consumer_account_device_consumer_account_id_key`(`consumer_account_id`),
|
||||
INDEX `consumer_account_device_consumer_account_id_idx`(`consumer_account_id`),
|
||||
PRIMARY KEY (`id`)
|
||||
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
|
||||
|
||||
-- CreateTable
|
||||
@@ -325,6 +316,7 @@ CREATE TABLE `consumer_accounts` (
|
||||
`account_id` VARCHAR(191) NOT NULL,
|
||||
|
||||
UNIQUE INDEX `consumer_accounts_account_id_key`(`account_id`),
|
||||
INDEX `consumer_accounts_consumer_id_fkey`(`consumer_id`),
|
||||
PRIMARY KEY (`id`)
|
||||
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
|
||||
|
||||
@@ -381,6 +373,8 @@ CREATE TABLE `business_activities` (
|
||||
`guild_id` VARCHAR(191) NOT NULL,
|
||||
`consumer_id` VARCHAR(191) NOT NULL,
|
||||
|
||||
INDEX `business_activities_consumer_id_fkey`(`consumer_id`),
|
||||
INDEX `business_activities_guild_id_fkey`(`guild_id`),
|
||||
UNIQUE INDEX `business_activities_economic_code_consumer_id_key`(`economic_code`, `consumer_id`),
|
||||
PRIMARY KEY (`id`)
|
||||
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
|
||||
@@ -395,6 +389,7 @@ CREATE TABLE `complexes` (
|
||||
`updated_at` TIMESTAMP(0) NOT NULL,
|
||||
`business_activity_id` VARCHAR(191) NOT NULL,
|
||||
|
||||
INDEX `complexes_business_activity_id_fkey`(`business_activity_id`),
|
||||
PRIMARY KEY (`id`)
|
||||
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
|
||||
|
||||
@@ -415,9 +410,23 @@ CREATE TABLE `poses` (
|
||||
|
||||
UNIQUE INDEX `poses_serial_number_key`(`serial_number`),
|
||||
UNIQUE INDEX `poses_account_id_key`(`account_id`),
|
||||
INDEX `poses_complex_id_fkey`(`complex_id`),
|
||||
INDEX `poses_device_id_fkey`(`device_id`),
|
||||
INDEX `poses_provider_id_fkey`(`provider_id`),
|
||||
PRIMARY KEY (`id`)
|
||||
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
|
||||
|
||||
-- CreateTable
|
||||
CREATE TABLE `consumer_account_good_favorites` (
|
||||
`created_at` DATETIME(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3),
|
||||
`consumer_account_id` VARCHAR(191) NOT NULL,
|
||||
`good_id` VARCHAR(191) NOT NULL,
|
||||
|
||||
INDEX `consumer_account_good_favorites_good_id_idx`(`good_id`),
|
||||
INDEX `consumer_account_good_favorites_consumer_account_id_idx`(`consumer_account_id`),
|
||||
PRIMARY KEY (`consumer_account_id`, `good_id`)
|
||||
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
|
||||
|
||||
-- CreateTable
|
||||
CREATE TABLE `goods` (
|
||||
`id` VARCHAR(191) NOT NULL,
|
||||
@@ -427,7 +436,7 @@ CREATE TABLE `goods` (
|
||||
`description` TEXT NULL,
|
||||
`local_sku` VARCHAR(100) NULL,
|
||||
`barcode` VARCHAR(100) NULL,
|
||||
`base_sale_price` DECIMAL(15, 0) NULL DEFAULT 0.00,
|
||||
`base_sale_price` DECIMAL(15, 0) NULL DEFAULT 0,
|
||||
`image_url` VARCHAR(255) NULL,
|
||||
`created_at` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
|
||||
`updated_at` TIMESTAMP(0) NOT NULL,
|
||||
@@ -440,6 +449,9 @@ CREATE TABLE `goods` (
|
||||
UNIQUE INDEX `goods_local_sku_key`(`local_sku`),
|
||||
UNIQUE INDEX `goods_barcode_key`(`barcode`),
|
||||
INDEX `goods_category_id_idx`(`category_id`),
|
||||
INDEX `goods_business_activity_id_fkey`(`business_activity_id`),
|
||||
INDEX `goods_measure_unit_id_fkey`(`measure_unit_id`),
|
||||
INDEX `goods_sku_id_fkey`(`sku_id`),
|
||||
PRIMARY KEY (`id`)
|
||||
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
|
||||
|
||||
@@ -456,6 +468,8 @@ CREATE TABLE `good_categories` (
|
||||
`updated_at` TIMESTAMP(0) NOT NULL,
|
||||
`deleted_at` TIMESTAMP(0) NULL,
|
||||
|
||||
INDEX `good_categories_complex_id_fkey`(`complex_id`),
|
||||
INDEX `good_categories_guild_id_fkey`(`guild_id`),
|
||||
PRIMARY KEY (`id`)
|
||||
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
|
||||
|
||||
@@ -489,7 +503,6 @@ CREATE TABLE `stock_keeping_units` (
|
||||
`code` VARCHAR(191) NOT NULL,
|
||||
`name` VARCHAR(191) NOT NULL,
|
||||
`VAT` DECIMAL(5, 2) NOT NULL,
|
||||
`type` ENUM('GOLD') NOT NULL,
|
||||
`is_public` BOOLEAN NOT NULL DEFAULT true,
|
||||
`is_domestic` BOOLEAN NOT NULL DEFAULT false,
|
||||
`guild_id` VARCHAR(191) NOT NULL,
|
||||
@@ -498,6 +511,7 @@ CREATE TABLE `stock_keeping_units` (
|
||||
|
||||
UNIQUE INDEX `stock_keeping_units_code_key`(`code`),
|
||||
INDEX `stock_keeping_units_code_idx`(`code`),
|
||||
INDEX `stock_keeping_units_guild_id_fkey`(`guild_id`),
|
||||
PRIMARY KEY (`id`)
|
||||
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
|
||||
|
||||
@@ -571,12 +585,18 @@ CREATE TABLE `sales_invoices` (
|
||||
`customer_id` VARCHAR(191) NULL,
|
||||
`consumer_account_id` VARCHAR(191) NOT NULL,
|
||||
`pos_id` VARCHAR(191) NOT NULL,
|
||||
`settlement_type` ENUM('CASH', 'CREDIT', 'MIXED') NOT NULL,
|
||||
`discount_amount` DECIMAL(15, 2) NULL,
|
||||
`tax_amount` DECIMAL(15, 2) NULL,
|
||||
|
||||
UNIQUE INDEX `sales_invoices_code_key`(`code`),
|
||||
UNIQUE INDEX `sales_invoices_tax_id_key`(`tax_id`),
|
||||
UNIQUE INDEX `sales_invoices_ref_id_key`(`ref_id`),
|
||||
INDEX `sales_invoices_ref_id_idx`(`ref_id`),
|
||||
INDEX `sales_invoices_tax_id_idx`(`tax_id`),
|
||||
INDEX `sales_invoices_consumer_account_id_fkey`(`consumer_account_id`),
|
||||
INDEX `sales_invoices_customer_id_fkey`(`customer_id`),
|
||||
INDEX `sales_invoices_pos_id_fkey`(`pos_id`),
|
||||
UNIQUE INDEX `sales_invoices_invoice_number_pos_id_key`(`invoice_number`, `pos_id`),
|
||||
PRIMARY KEY (`id`)
|
||||
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
|
||||
@@ -599,8 +619,12 @@ CREATE TABLE `sales_invoice_items` (
|
||||
`invoice_id` VARCHAR(191) NOT NULL,
|
||||
`good_id` VARCHAR(191) NOT NULL,
|
||||
`service_id` VARCHAR(191) NULL,
|
||||
`discount_amount` DECIMAL(15, 2) NULL,
|
||||
`tax_amount` DECIMAL(15, 2) NULL,
|
||||
|
||||
INDEX `sales_invoice_items_invoice_id_good_id_idx`(`invoice_id`, `good_id`),
|
||||
INDEX `sales_invoice_items_good_id_fkey`(`good_id`),
|
||||
INDEX `sales_invoice_items_service_id_fkey`(`service_id`),
|
||||
PRIMARY KEY (`id`)
|
||||
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
|
||||
|
||||
@@ -608,16 +632,19 @@ CREATE TABLE `sales_invoice_items` (
|
||||
CREATE TABLE `sale_invoice_tsp_attempts` (
|
||||
`id` VARCHAR(191) NOT NULL,
|
||||
`attempt_no` INTEGER NOT NULL,
|
||||
`status` ENUM('SUCCESS', 'FAILURE', 'NOT_SEND', 'QUEUED') NOT NULL,
|
||||
`request_payload` JSON NULL,
|
||||
`response_payload` JSON NULL,
|
||||
`status` ENUM('NOT_SEND', 'QUEUED', 'FISCAL_QUEUED', 'SEND_FAILURE', 'SUCCESS', 'FAILURE') NOT NULL,
|
||||
`message` TEXT NOT NULL,
|
||||
`sent_at` TIMESTAMP(0) NULL,
|
||||
`received_at` TIMESTAMP(0) NULL,
|
||||
`created_at` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
|
||||
`invoice_id` VARCHAR(191) NOT NULL,
|
||||
`provider_request_payload` JSON NOT NULL,
|
||||
`raw_request_payload` JSON NOT NULL,
|
||||
`error_message` TEXT NULL,
|
||||
`fiscal_warnings` JSON NULL,
|
||||
`provider_response` JSON NULL,
|
||||
`validation_errors` JSON NULL,
|
||||
|
||||
UNIQUE INDEX `sale_invoice_tsp_attempts_invoice_id_key`(`invoice_id`),
|
||||
INDEX `sale_invoice_tsp_attempts_status_idx`(`status`),
|
||||
INDEX `sale_invoice_tsp_attempts_invoice_id_idx`(`invoice_id`),
|
||||
UNIQUE INDEX `sale_invoice_tsp_attempts_invoice_id_attempt_no_key`(`invoice_id`, `attempt_no`),
|
||||
@@ -666,7 +693,7 @@ CREATE TABLE `services` (
|
||||
`updated_at` TIMESTAMP(0) NOT NULL,
|
||||
`deleted_at` TIMESTAMP(0) NULL,
|
||||
`category_id` VARCHAR(191) NULL,
|
||||
`base_sale_price` DECIMAL(15, 0) NOT NULL DEFAULT 0.00,
|
||||
`base_sale_price` DECIMAL(15, 0) NOT NULL DEFAULT 0,
|
||||
`account_id` VARCHAR(191) NOT NULL,
|
||||
`complex_id` VARCHAR(191) NOT NULL,
|
||||
|
||||
@@ -693,10 +720,10 @@ CREATE TABLE `service_categories` (
|
||||
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
|
||||
|
||||
-- AddForeignKey
|
||||
ALTER TABLE `admin_accounts` ADD CONSTRAINT `admin_accounts_admin_id_fkey` FOREIGN KEY (`admin_id`) REFERENCES `admins`(`id`) ON DELETE RESTRICT ON UPDATE CASCADE;
|
||||
ALTER TABLE `admin_accounts` ADD CONSTRAINT `admin_accounts_account_id_fkey` FOREIGN KEY (`account_id`) REFERENCES `accounts`(`id`) ON DELETE CASCADE ON UPDATE CASCADE;
|
||||
|
||||
-- AddForeignKey
|
||||
ALTER TABLE `admin_accounts` ADD CONSTRAINT `admin_accounts_account_id_fkey` FOREIGN KEY (`account_id`) REFERENCES `accounts`(`id`) ON DELETE CASCADE ON UPDATE CASCADE;
|
||||
ALTER TABLE `admin_accounts` ADD CONSTRAINT `admin_accounts_admin_id_fkey` FOREIGN KEY (`admin_id`) REFERENCES `admins`(`id`) ON DELETE RESTRICT ON UPDATE CASCADE;
|
||||
|
||||
-- AddForeignKey
|
||||
ALTER TABLE `devices` ADD CONSTRAINT `devices_brand_id_fkey` FOREIGN KEY (`brand_id`) REFERENCES `device_brands`(`id`) ON DELETE RESTRICT ON UPDATE CASCADE;
|
||||
@@ -771,35 +798,38 @@ ALTER TABLE `provider_accounts` ADD CONSTRAINT `provider_accounts_account_id_fke
|
||||
ALTER TABLE `provider_accounts` ADD CONSTRAINT `provider_accounts_provider_id_fkey` FOREIGN KEY (`provider_id`) REFERENCES `providers`(`id`) ON DELETE RESTRICT ON UPDATE CASCADE;
|
||||
|
||||
-- AddForeignKey
|
||||
ALTER TABLE `consumer_devices` ADD CONSTRAINT `consumer_devices_consumer_id_fkey` FOREIGN KEY (`consumer_id`) REFERENCES `consumers`(`id`) ON DELETE RESTRICT ON UPDATE CASCADE;
|
||||
|
||||
-- AddForeignKey
|
||||
ALTER TABLE `consumer_accounts` ADD CONSTRAINT `consumer_accounts_consumer_id_fkey` FOREIGN KEY (`consumer_id`) REFERENCES `consumers`(`id`) ON DELETE RESTRICT ON UPDATE CASCADE;
|
||||
ALTER TABLE `consumer_account_device` ADD CONSTRAINT `consumer_account_device_consumer_account_id_fkey` FOREIGN KEY (`consumer_account_id`) REFERENCES `consumer_accounts`(`id`) ON DELETE RESTRICT ON UPDATE CASCADE;
|
||||
|
||||
-- AddForeignKey
|
||||
ALTER TABLE `consumer_accounts` ADD CONSTRAINT `consumer_accounts_account_id_fkey` FOREIGN KEY (`account_id`) REFERENCES `accounts`(`id`) ON DELETE RESTRICT ON UPDATE CASCADE;
|
||||
|
||||
-- AddForeignKey
|
||||
ALTER TABLE `consumers_individual` ADD CONSTRAINT `consumers_individual_partner_id_fkey` FOREIGN KEY (`partner_id`) REFERENCES `partners`(`id`) ON DELETE RESTRICT ON UPDATE CASCADE;
|
||||
ALTER TABLE `consumer_accounts` ADD CONSTRAINT `consumer_accounts_consumer_id_fkey` FOREIGN KEY (`consumer_id`) REFERENCES `consumers`(`id`) ON DELETE RESTRICT ON UPDATE CASCADE;
|
||||
|
||||
-- AddForeignKey
|
||||
ALTER TABLE `consumers_individual` ADD CONSTRAINT `consumers_individual_consumer_id_fkey` FOREIGN KEY (`consumer_id`) REFERENCES `consumers`(`id`) ON DELETE CASCADE ON UPDATE CASCADE;
|
||||
|
||||
-- AddForeignKey
|
||||
ALTER TABLE `consumers_legal` ADD CONSTRAINT `consumers_legal_partner_id_fkey` FOREIGN KEY (`partner_id`) REFERENCES `partners`(`id`) ON DELETE RESTRICT ON UPDATE CASCADE;
|
||||
ALTER TABLE `consumers_individual` ADD CONSTRAINT `consumers_individual_partner_id_fkey` FOREIGN KEY (`partner_id`) REFERENCES `partners`(`id`) ON DELETE RESTRICT ON UPDATE CASCADE;
|
||||
|
||||
-- AddForeignKey
|
||||
ALTER TABLE `consumers_legal` ADD CONSTRAINT `consumers_legal_consumer_id_fkey` FOREIGN KEY (`consumer_id`) REFERENCES `consumers`(`id`) ON DELETE CASCADE ON UPDATE CASCADE;
|
||||
|
||||
-- AddForeignKey
|
||||
ALTER TABLE `business_activities` ADD CONSTRAINT `business_activities_guild_id_fkey` FOREIGN KEY (`guild_id`) REFERENCES `guilds`(`id`) ON DELETE RESTRICT ON UPDATE CASCADE;
|
||||
ALTER TABLE `consumers_legal` ADD CONSTRAINT `consumers_legal_partner_id_fkey` FOREIGN KEY (`partner_id`) REFERENCES `partners`(`id`) ON DELETE RESTRICT ON UPDATE CASCADE;
|
||||
|
||||
-- AddForeignKey
|
||||
ALTER TABLE `business_activities` ADD CONSTRAINT `business_activities_consumer_id_fkey` FOREIGN KEY (`consumer_id`) REFERENCES `consumers`(`id`) ON DELETE RESTRICT ON UPDATE CASCADE;
|
||||
|
||||
-- AddForeignKey
|
||||
ALTER TABLE `business_activities` ADD CONSTRAINT `business_activities_guild_id_fkey` FOREIGN KEY (`guild_id`) REFERENCES `guilds`(`id`) ON DELETE RESTRICT ON UPDATE CASCADE;
|
||||
|
||||
-- AddForeignKey
|
||||
ALTER TABLE `complexes` ADD CONSTRAINT `complexes_business_activity_id_fkey` FOREIGN KEY (`business_activity_id`) REFERENCES `business_activities`(`id`) ON DELETE RESTRICT ON UPDATE CASCADE;
|
||||
|
||||
-- AddForeignKey
|
||||
ALTER TABLE `poses` ADD CONSTRAINT `poses_account_id_fkey` FOREIGN KEY (`account_id`) REFERENCES `consumer_accounts`(`id`) ON DELETE RESTRICT ON UPDATE CASCADE;
|
||||
|
||||
-- AddForeignKey
|
||||
ALTER TABLE `poses` ADD CONSTRAINT `poses_complex_id_fkey` FOREIGN KEY (`complex_id`) REFERENCES `complexes`(`id`) ON DELETE RESTRICT ON UPDATE CASCADE;
|
||||
|
||||
@@ -810,59 +840,62 @@ ALTER TABLE `poses` ADD CONSTRAINT `poses_device_id_fkey` FOREIGN KEY (`device_i
|
||||
ALTER TABLE `poses` ADD CONSTRAINT `poses_provider_id_fkey` FOREIGN KEY (`provider_id`) REFERENCES `providers`(`id`) ON DELETE SET NULL ON UPDATE CASCADE;
|
||||
|
||||
-- AddForeignKey
|
||||
ALTER TABLE `poses` ADD CONSTRAINT `poses_account_id_fkey` FOREIGN KEY (`account_id`) REFERENCES `consumer_accounts`(`id`) ON DELETE RESTRICT ON UPDATE CASCADE;
|
||||
ALTER TABLE `consumer_account_good_favorites` ADD CONSTRAINT `consumer_account_good_favorites_consumer_account_id_fkey` FOREIGN KEY (`consumer_account_id`) REFERENCES `consumer_accounts`(`id`) ON DELETE CASCADE ON UPDATE CASCADE;
|
||||
|
||||
-- AddForeignKey
|
||||
ALTER TABLE `goods` ADD CONSTRAINT `goods_sku_id_fkey` FOREIGN KEY (`sku_id`) REFERENCES `stock_keeping_units`(`id`) ON DELETE RESTRICT ON UPDATE CASCADE;
|
||||
|
||||
-- AddForeignKey
|
||||
ALTER TABLE `goods` ADD CONSTRAINT `goods_measure_unit_id_fkey` FOREIGN KEY (`measure_unit_id`) REFERENCES `measure_units`(`id`) ON DELETE RESTRICT ON UPDATE CASCADE;
|
||||
|
||||
-- AddForeignKey
|
||||
ALTER TABLE `goods` ADD CONSTRAINT `goods_category_id_fkey` FOREIGN KEY (`category_id`) REFERENCES `good_categories`(`id`) ON DELETE SET NULL ON UPDATE CASCADE;
|
||||
ALTER TABLE `consumer_account_good_favorites` ADD CONSTRAINT `consumer_account_good_favorites_good_id_fkey` FOREIGN KEY (`good_id`) REFERENCES `goods`(`id`) ON DELETE CASCADE ON UPDATE CASCADE;
|
||||
|
||||
-- AddForeignKey
|
||||
ALTER TABLE `goods` ADD CONSTRAINT `goods_business_activity_id_fkey` FOREIGN KEY (`business_activity_id`) REFERENCES `business_activities`(`id`) ON DELETE SET NULL ON UPDATE CASCADE;
|
||||
|
||||
-- AddForeignKey
|
||||
ALTER TABLE `good_categories` ADD CONSTRAINT `good_categories_guild_id_fkey` FOREIGN KEY (`guild_id`) REFERENCES `guilds`(`id`) ON DELETE SET NULL ON UPDATE CASCADE;
|
||||
ALTER TABLE `goods` ADD CONSTRAINT `goods_category_id_fkey` FOREIGN KEY (`category_id`) REFERENCES `good_categories`(`id`) ON DELETE SET NULL ON UPDATE CASCADE;
|
||||
|
||||
-- AddForeignKey
|
||||
ALTER TABLE `goods` ADD CONSTRAINT `goods_measure_unit_id_fkey` FOREIGN KEY (`measure_unit_id`) REFERENCES `measure_units`(`id`) ON DELETE RESTRICT ON UPDATE CASCADE;
|
||||
|
||||
-- AddForeignKey
|
||||
ALTER TABLE `goods` ADD CONSTRAINT `goods_sku_id_fkey` FOREIGN KEY (`sku_id`) REFERENCES `stock_keeping_units`(`id`) ON DELETE RESTRICT ON UPDATE CASCADE;
|
||||
|
||||
-- AddForeignKey
|
||||
ALTER TABLE `good_categories` ADD CONSTRAINT `good_categories_complex_id_fkey` FOREIGN KEY (`complex_id`) REFERENCES `complexes`(`id`) ON DELETE SET NULL ON UPDATE CASCADE;
|
||||
|
||||
-- AddForeignKey
|
||||
ALTER TABLE `stock_keeping_units` ADD CONSTRAINT `stock_keeping_units_guild_id_fkey` FOREIGN KEY (`guild_id`) REFERENCES `guilds`(`id`) ON DELETE RESTRICT ON UPDATE CASCADE;
|
||||
ALTER TABLE `good_categories` ADD CONSTRAINT `good_categories_guild_id_fkey` FOREIGN KEY (`guild_id`) REFERENCES `guilds`(`id`) ON DELETE SET NULL ON UPDATE CASCADE;
|
||||
|
||||
-- AddForeignKey
|
||||
ALTER TABLE `customer_individuals` ADD CONSTRAINT `customer_individuals_customer_id_fkey` FOREIGN KEY (`customer_id`) REFERENCES `customers`(`id`) ON DELETE CASCADE ON UPDATE CASCADE;
|
||||
ALTER TABLE `stock_keeping_units` ADD CONSTRAINT `stock_keeping_units_guild_id_fkey` FOREIGN KEY (`guild_id`) REFERENCES `guilds`(`id`) ON DELETE RESTRICT ON UPDATE CASCADE;
|
||||
|
||||
-- AddForeignKey
|
||||
ALTER TABLE `customer_individuals` ADD CONSTRAINT `customer_individuals_business_activity_id_fkey` FOREIGN KEY (`business_activity_id`) REFERENCES `business_activities`(`id`) ON DELETE RESTRICT ON UPDATE CASCADE;
|
||||
|
||||
-- AddForeignKey
|
||||
ALTER TABLE `customer_legal` ADD CONSTRAINT `customer_legal_customer_id_fkey` FOREIGN KEY (`customer_id`) REFERENCES `customers`(`id`) ON DELETE CASCADE ON UPDATE CASCADE;
|
||||
ALTER TABLE `customer_individuals` ADD CONSTRAINT `customer_individuals_customer_id_fkey` FOREIGN KEY (`customer_id`) REFERENCES `customers`(`id`) ON DELETE CASCADE ON UPDATE CASCADE;
|
||||
|
||||
-- AddForeignKey
|
||||
ALTER TABLE `customer_legal` ADD CONSTRAINT `customer_legal_business_activity_id_fkey` FOREIGN KEY (`business_activity_id`) REFERENCES `business_activities`(`id`) ON DELETE RESTRICT ON UPDATE CASCADE;
|
||||
|
||||
-- AddForeignKey
|
||||
ALTER TABLE `sales_invoices` ADD CONSTRAINT `sales_invoices_ref_id_fkey` FOREIGN KEY (`ref_id`) REFERENCES `sales_invoices`(`id`) ON DELETE SET NULL ON UPDATE CASCADE;
|
||||
|
||||
-- AddForeignKey
|
||||
ALTER TABLE `sales_invoices` ADD CONSTRAINT `sales_invoices_customer_id_fkey` FOREIGN KEY (`customer_id`) REFERENCES `customers`(`id`) ON DELETE SET NULL ON UPDATE CASCADE;
|
||||
ALTER TABLE `customer_legal` ADD CONSTRAINT `customer_legal_customer_id_fkey` FOREIGN KEY (`customer_id`) REFERENCES `customers`(`id`) ON DELETE CASCADE ON UPDATE CASCADE;
|
||||
|
||||
-- AddForeignKey
|
||||
ALTER TABLE `sales_invoices` ADD CONSTRAINT `sales_invoices_consumer_account_id_fkey` FOREIGN KEY (`consumer_account_id`) REFERENCES `consumer_accounts`(`id`) ON DELETE RESTRICT ON UPDATE CASCADE;
|
||||
|
||||
-- AddForeignKey
|
||||
ALTER TABLE `sales_invoices` ADD CONSTRAINT `sales_invoices_customer_id_fkey` FOREIGN KEY (`customer_id`) REFERENCES `customers`(`id`) ON DELETE SET NULL ON UPDATE CASCADE;
|
||||
|
||||
-- AddForeignKey
|
||||
ALTER TABLE `sales_invoices` ADD CONSTRAINT `sales_invoices_pos_id_fkey` FOREIGN KEY (`pos_id`) REFERENCES `poses`(`id`) ON DELETE RESTRICT ON UPDATE CASCADE;
|
||||
|
||||
-- AddForeignKey
|
||||
ALTER TABLE `sales_invoice_items` ADD CONSTRAINT `sales_invoice_items_invoice_id_fkey` FOREIGN KEY (`invoice_id`) REFERENCES `sales_invoices`(`id`) ON DELETE RESTRICT ON UPDATE CASCADE;
|
||||
ALTER TABLE `sales_invoices` ADD CONSTRAINT `sales_invoices_ref_id_fkey` FOREIGN KEY (`ref_id`) REFERENCES `sales_invoices`(`id`) ON DELETE SET NULL ON UPDATE CASCADE;
|
||||
|
||||
-- AddForeignKey
|
||||
ALTER TABLE `sales_invoice_items` ADD CONSTRAINT `sales_invoice_items_good_id_fkey` FOREIGN KEY (`good_id`) REFERENCES `goods`(`id`) ON DELETE RESTRICT ON UPDATE CASCADE;
|
||||
|
||||
-- AddForeignKey
|
||||
ALTER TABLE `sales_invoice_items` ADD CONSTRAINT `sales_invoice_items_invoice_id_fkey` FOREIGN KEY (`invoice_id`) REFERENCES `sales_invoices`(`id`) ON DELETE RESTRICT ON UPDATE CASCADE;
|
||||
|
||||
-- AddForeignKey
|
||||
ALTER TABLE `sales_invoice_items` ADD CONSTRAINT `sales_invoice_items_service_id_fkey` FOREIGN KEY (`service_id`) REFERENCES `services`(`id`) ON DELETE SET NULL ON UPDATE CASCADE;
|
||||
|
||||
@@ -877,3 +910,4 @@ ALTER TABLE `sales_invoice_payment_terminal_info` ADD CONSTRAINT `sales_invoice_
|
||||
|
||||
-- AddForeignKey
|
||||
ALTER TABLE `services` ADD CONSTRAINT `services_category_id_fkey` FOREIGN KEY (`category_id`) REFERENCES `service_categories`(`id`) ON DELETE SET NULL ON UPDATE CASCADE;
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
/*
|
||||
Warnings:
|
||||
|
||||
- You are about to drop the column `type` on the `stock_keeping_units` table. All the data in the column will be lost.
|
||||
|
||||
*/
|
||||
-- AlterTable
|
||||
ALTER TABLE `stock_keeping_units` DROP COLUMN `type`;
|
||||
@@ -1,48 +0,0 @@
|
||||
/*
|
||||
Warnings:
|
||||
|
||||
- You are about to drop the column `request_payload` on the `sale_invoice_tsp_attempts` table. All the data in the column will be lost.
|
||||
- You are about to drop the column `response_payload` on the `sale_invoice_tsp_attempts` table. All the data in the column will be lost.
|
||||
- Added the required column `raw_request_payload` to the `sale_invoice_tsp_attempts` table without a default value. This is not possible if the table is not empty.
|
||||
|
||||
*/
|
||||
-- DropForeignKey
|
||||
ALTER TABLE `sale_invoice_tsp_attempts` DROP FOREIGN KEY `sale_invoice_tsp_attempts_invoice_id_fkey`;
|
||||
|
||||
-- DropIndex
|
||||
DROP INDEX `sale_invoice_tsp_attempts_invoice_id_key` ON `sale_invoice_tsp_attempts`;
|
||||
|
||||
-- AlterTable
|
||||
ALTER TABLE `sale_invoice_tsp_attempts`
|
||||
ADD COLUMN `provider_request_payload` JSON NULL,
|
||||
ADD COLUMN `provider_response_payload` JSON NULL,
|
||||
ADD COLUMN `raw_request_payload` JSON NOT NULL;
|
||||
|
||||
UPDATE `sale_invoice_tsp_attempts`
|
||||
SET `provider_response_payload` = `response_payload`;
|
||||
UPDATE `sale_invoice_tsp_attempts`
|
||||
SET `raw_request_payload` = `request_payload`;
|
||||
|
||||
ALTER TABLE `sale_invoice_tsp_attempts`
|
||||
DROP COLUMN `response_payload`,
|
||||
DROP COLUMN `request_payload`;
|
||||
|
||||
-- AddForeignKey
|
||||
-- Check if the foreign key constraint already exists before adding it
|
||||
SET @constraint_exists = (
|
||||
SELECT COUNT(*)
|
||||
FROM information_schema.TABLE_CONSTRAINTS
|
||||
WHERE CONSTRAINT_SCHEMA = DATABASE()
|
||||
AND TABLE_NAME = 'customer_legal'
|
||||
AND CONSTRAINT_NAME = 'customer_legal_business_activity_id_fkey'
|
||||
AND CONSTRAINT_TYPE = 'FOREIGN KEY'
|
||||
);
|
||||
|
||||
SET @sql = IF(@constraint_exists = 0,
|
||||
'ALTER TABLE `customer_legal` ADD CONSTRAINT `customer_legal_business_activity_id_fkey` FOREIGN KEY (`business_activity_id`) REFERENCES `business_activities`(`id`) ON DELETE RESTRICT ON UPDATE CASCADE;',
|
||||
'SELECT "Foreign key constraint customer_legal_business_activity_id_fkey already exists" as message;'
|
||||
);
|
||||
|
||||
PREPARE stmt FROM @sql;
|
||||
EXECUTE stmt;
|
||||
DEALLOCATE PREPARE stmt;
|
||||
@@ -1,32 +0,0 @@
|
||||
/*
|
||||
Warnings:
|
||||
|
||||
- You are about to drop the `consumer_devices` table. If the table is not empty, all the data it contains will be lost.
|
||||
|
||||
*/
|
||||
-- DropForeignKey
|
||||
ALTER TABLE `consumer_devices` DROP FOREIGN KEY `consumer_devices_consumer_id_fkey`;
|
||||
|
||||
-- DropTable
|
||||
DROP TABLE `consumer_devices`;
|
||||
|
||||
-- CreateTable
|
||||
CREATE TABLE `consumer_account_device` (
|
||||
`id` VARCHAR(191) NOT NULL,
|
||||
`device_id` VARCHAR(191) NOT NULL,
|
||||
`device_name` VARCHAR(191) NULL,
|
||||
`created_at` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
|
||||
`updated_at` TIMESTAMP(0) NOT NULL,
|
||||
`consumer_account_id` VARCHAR(191) NOT NULL,
|
||||
|
||||
UNIQUE INDEX `consumer_account_device_device_id_key`(`device_id`),
|
||||
UNIQUE INDEX `consumer_account_device_consumer_account_id_key`(`consumer_account_id`),
|
||||
INDEX `consumer_account_device_consumer_account_id_idx`(`consumer_account_id`),
|
||||
PRIMARY KEY (`id`)
|
||||
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
|
||||
|
||||
-- AddForeignKey
|
||||
ALTER TABLE `consumer_account_device` ADD CONSTRAINT `consumer_account_device_consumer_account_id_fkey` FOREIGN KEY (`consumer_account_id`) REFERENCES `consumer_accounts`(`id`) ON DELETE RESTRICT ON UPDATE CASCADE;
|
||||
|
||||
-- AddForeignKey
|
||||
ALTER TABLE `sale_invoice_tsp_attempts` ADD CONSTRAINT `sale_invoice_tsp_attempts_invoice_id_fkey` FOREIGN KEY (`invoice_id`) REFERENCES `sales_invoices`(`id`) ON DELETE CASCADE ON UPDATE CASCADE;
|
||||
@@ -0,0 +1,25 @@
|
||||
/*
|
||||
Warnings:
|
||||
|
||||
- A unique constraint covering the columns `[business_activity_id,postal_code,national_id]` on the table `customer_individuals` will be added. If there are existing duplicate values, this will fail.
|
||||
- A unique constraint covering the columns `[business_activity_id,postal_code,registration_number]` on the table `customer_legal` will be added. If there are existing duplicate values, this will fail.
|
||||
|
||||
*/
|
||||
-- AlterTable
|
||||
ALTER TABLE `customer_individuals` MODIFY `first_name` VARCHAR(255) NULL,
|
||||
MODIFY `last_name` VARCHAR(255) NULL,
|
||||
MODIFY `national_id` CHAR(10) NULL,
|
||||
MODIFY `mobile_number` CHAR(15) NULL,
|
||||
MODIFY `postal_code` CHAR(10) NULL,
|
||||
MODIFY `economic_code` CHAR(14) NULL;
|
||||
|
||||
-- AlterTable
|
||||
ALTER TABLE `customer_legal` MODIFY `name` VARCHAR(255) NULL,
|
||||
MODIFY `economic_code` CHAR(11) NULL,
|
||||
MODIFY `postal_code` CHAR(10) NULL;
|
||||
|
||||
-- CreateIndex
|
||||
CREATE UNIQUE INDEX `customer_individuals_business_activity_id_postal_code_nation_key` ON `customer_individuals`(`business_activity_id`, `postal_code`, `national_id`);
|
||||
|
||||
-- CreateIndex
|
||||
CREATE UNIQUE INDEX `customer_legal_business_activity_id_postal_code_registration_key` ON `customer_legal`(`business_activity_id`, `postal_code`, `registration_number`);
|
||||
@@ -0,0 +1,50 @@
|
||||
-- ALTER TABLE
|
||||
ALTER TABLE `sales_invoices`
|
||||
ADD COLUMN `last_attempt_no` INT NULL,
|
||||
ADD COLUMN `last_tsp_status` ENUM(
|
||||
'NOT_SEND',
|
||||
'QUEUED',
|
||||
'FISCAL_QUEUED',
|
||||
'SEND_FAILURE',
|
||||
'SUCCESS',
|
||||
'FAILURE'
|
||||
) NULL;
|
||||
|
||||
-- INDEX
|
||||
CREATE INDEX `sales_invoices_pos_id_invoice_date_idx`
|
||||
ON `sales_invoices` (`pos_id`, `invoice_date`);
|
||||
|
||||
-- BACKFILL LAST ATTEMPT
|
||||
UPDATE sales_invoices si
|
||||
JOIN (
|
||||
SELECT invoice_id, attempt_no, status
|
||||
FROM (
|
||||
SELECT
|
||||
invoice_id,
|
||||
attempt_no,
|
||||
status,
|
||||
ROW_NUMBER() OVER (
|
||||
PARTITION BY invoice_id
|
||||
ORDER BY created_at DESC
|
||||
) rn
|
||||
FROM sale_invoice_tsp_attempts
|
||||
) t
|
||||
WHERE rn = 1
|
||||
) la ON la.invoice_id = si.id
|
||||
SET
|
||||
si.last_attempt_no = la.attempt_no,
|
||||
si.last_tsp_status = la.status;
|
||||
|
||||
-- SET NOT_SEND FOR NO ATTEMPTS
|
||||
UPDATE sales_invoices si
|
||||
LEFT JOIN sale_invoice_tsp_attempts att
|
||||
ON att.invoice_id = si.id
|
||||
SET
|
||||
si.last_attempt_no = NULL,
|
||||
si.last_tsp_status = 'NOT_SEND'
|
||||
WHERE att.invoice_id IS NULL;
|
||||
|
||||
-- SAFETY FILL
|
||||
UPDATE sales_invoices
|
||||
SET last_tsp_status = 'NOT_SEND'
|
||||
WHERE last_tsp_status IS NULL;
|
||||
@@ -1,15 +1,13 @@
|
||||
model AdminAccount {
|
||||
id String @id @default(ulid())
|
||||
|
||||
created_at DateTime @default(now()) @db.Timestamp(0)
|
||||
updated_at DateTime @updatedAt() @db.Timestamp(0)
|
||||
|
||||
updated_at DateTime @updatedAt @db.Timestamp(0)
|
||||
admin_id String
|
||||
admin Admin @relation(fields: [admin_id], references: [id])
|
||||
|
||||
account_id String @unique
|
||||
account Account @relation(fields: [account_id], references: [id], onDelete: Cascade)
|
||||
admin Admin @relation(fields: [admin_id], references: [id])
|
||||
|
||||
@@index([admin_id], map: "admin_accounts_admin_id_fkey")
|
||||
@@map("admin_accounts")
|
||||
}
|
||||
|
||||
|
||||
@@ -2,10 +2,8 @@ model ConsumerAccountDevice {
|
||||
id String @id @default(ulid())
|
||||
device_id String @unique
|
||||
device_name String?
|
||||
|
||||
created_at DateTime @default(now()) @db.Timestamp(0)
|
||||
updated_at DateTime @updatedAt @db.Timestamp(0)
|
||||
|
||||
consumer_account_id String @unique
|
||||
consumer_account ConsumerAccount @relation(fields: [consumer_account_id], references: [id])
|
||||
|
||||
|
||||
@@ -1,23 +1 @@
|
||||
// model ConsumerDevices {
|
||||
// uuid String @id @unique @db.VarChar(255)
|
||||
// app_version String @db.VarChar(20)
|
||||
// build_number String @db.VarChar(20)
|
||||
// platform String @db.VarChar(100)
|
||||
// brand String @db.VarChar(100)
|
||||
// model String @db.VarChar(100)
|
||||
// device String @db.VarChar(100)
|
||||
// publisher ApplicationPublisher
|
||||
// os_version String @db.VarChar(20)
|
||||
// sdk_version String @db.VarChar(20)
|
||||
// release_number String @db.VarChar(20)
|
||||
// user_agent String? @db.VarChar(100)
|
||||
// browser_name String? @db.VarChar(100)
|
||||
// fcm_token String? @db.VarChar(100)
|
||||
// created_at DateTime @default(now()) @db.Timestamp(0)
|
||||
// updated_at DateTime @updatedAt @db.Timestamp(0)
|
||||
// consumer_id String
|
||||
// consumer Consumer @relation(fields: [consumer_id], references: [id])
|
||||
|
||||
// @@index([consumer_id], map: "consumer_devices_consumer_id_fkey")
|
||||
// @@map("consumer_devices")
|
||||
// }
|
||||
|
||||
@@ -1,22 +1,20 @@
|
||||
model ConsumerAccount {
|
||||
id String @id @default(ulid())
|
||||
role ConsumerRole
|
||||
|
||||
created_at DateTime @default(now()) @db.Timestamp(0)
|
||||
updated_at DateTime @updatedAt() @db.Timestamp(0)
|
||||
|
||||
updated_at DateTime @updatedAt @db.Timestamp(0)
|
||||
consumer_id String
|
||||
consumer Consumer @relation(fields: [consumer_id], references: [id])
|
||||
|
||||
account_id String @unique()
|
||||
account Account @relation(fields: [account_id], references: [id])
|
||||
|
||||
pos Pos?
|
||||
permission PermissionConsumer?
|
||||
account_allocation LicenseAccountAllocation?
|
||||
sales_invoices SalesInvoice[]
|
||||
account_id String @unique
|
||||
account_device ConsumerAccountDevice?
|
||||
consumer_account_good_favorites ConsumerAccountGoodFavorite[]
|
||||
account Account @relation(fields: [account_id], references: [id])
|
||||
consumer Consumer @relation(fields: [consumer_id], references: [id])
|
||||
account_allocation LicenseAccountAllocation?
|
||||
permission PermissionConsumer?
|
||||
pos Pos?
|
||||
sales_invoices SalesInvoice[]
|
||||
|
||||
@@index([consumer_id], map: "consumer_accounts_consumer_id_fkey")
|
||||
@@map("consumer_accounts")
|
||||
}
|
||||
|
||||
@@ -24,13 +22,10 @@ model Consumer {
|
||||
id String @id @default(ulid())
|
||||
type ConsumerType
|
||||
status ConsumerStatus @default(ACTIVE)
|
||||
|
||||
created_at DateTime @default(now()) @db.Timestamp(0)
|
||||
updated_at DateTime @updatedAt() @db.Timestamp(0)
|
||||
|
||||
accounts ConsumerAccount[]
|
||||
updated_at DateTime @updatedAt @db.Timestamp(0)
|
||||
business_activities BusinessActivity[]
|
||||
// devices ConsumerDevices[]
|
||||
accounts ConsumerAccount[]
|
||||
individual ConsumerIndividual?
|
||||
legal ConsumerLegal?
|
||||
|
||||
@@ -42,15 +37,12 @@ model ConsumerIndividual {
|
||||
last_name String
|
||||
mobile_number String
|
||||
national_code String
|
||||
|
||||
created_at DateTime @default(now()) @db.Timestamp(0)
|
||||
updated_at DateTime @updatedAt() @db.Timestamp(0)
|
||||
|
||||
updated_at DateTime @updatedAt @db.Timestamp(0)
|
||||
partner_id String
|
||||
partner Partner @relation(fields: [partner_id], references: [id])
|
||||
|
||||
consumer_id String @id
|
||||
consumer Consumer @relation(fields: [consumer_id], references: [id], onDelete: Cascade)
|
||||
partner Partner @relation(fields: [partner_id], references: [id])
|
||||
|
||||
@@unique([mobile_number, consumer_id])
|
||||
@@unique([partner_id, national_code])
|
||||
@@ -60,15 +52,12 @@ model ConsumerIndividual {
|
||||
model ConsumerLegal {
|
||||
name String
|
||||
registration_code String
|
||||
|
||||
created_at DateTime @default(now()) @db.Timestamp(0)
|
||||
updated_at DateTime @updatedAt() @db.Timestamp(0)
|
||||
|
||||
updated_at DateTime @updatedAt @db.Timestamp(0)
|
||||
partner_id String
|
||||
partner Partner @relation(fields: [partner_id], references: [id])
|
||||
|
||||
consumer_id String @id
|
||||
consumer Consumer @relation(fields: [consumer_id], references: [id], onDelete: Cascade)
|
||||
partner Partner @relation(fields: [partner_id], references: [id])
|
||||
|
||||
@@unique([partner_id, registration_code])
|
||||
@@map("consumers_legal")
|
||||
@@ -81,24 +70,22 @@ model BusinessActivity {
|
||||
fiscal_id String
|
||||
partner_token String
|
||||
invoice_number_sequence Decimal @default(1) @db.Decimal(20, 0)
|
||||
|
||||
created_at DateTime @default(now()) @db.Timestamp(0)
|
||||
updated_at DateTime @updatedAt() @db.Timestamp(0)
|
||||
|
||||
updated_at DateTime @updatedAt @db.Timestamp(0)
|
||||
guild_id String
|
||||
guild Guild @relation(fields: [guild_id], references: [id])
|
||||
|
||||
consumer_id String
|
||||
consumer Consumer @relation(fields: [consumer_id], references: [id])
|
||||
|
||||
license_activation LicenseActivation?
|
||||
guild Guild @relation(fields: [guild_id], references: [id])
|
||||
complexes Complex[]
|
||||
permission_businesses PermissionBusiness[]
|
||||
goods Good[]
|
||||
customer_individuals CustomerIndividual[]
|
||||
customer_legals CustomerLegal[]
|
||||
goods Good[]
|
||||
license_activation LicenseActivation?
|
||||
permission_businesses PermissionBusiness[]
|
||||
|
||||
@@unique([economic_code, consumer_id])
|
||||
@@index([consumer_id], map: "business_activities_consumer_id_fkey")
|
||||
@@index([guild_id], map: "business_activities_guild_id_fkey")
|
||||
@@map("business_activities")
|
||||
}
|
||||
|
||||
@@ -107,18 +94,15 @@ model Complex {
|
||||
name String
|
||||
branch_code String
|
||||
address String?
|
||||
|
||||
created_at DateTime @default(now()) @db.Timestamp(0)
|
||||
updated_at DateTime @updatedAt() @db.Timestamp(0)
|
||||
|
||||
updated_at DateTime @updatedAt @db.Timestamp(0)
|
||||
business_activity_id String
|
||||
|
||||
business_activity BusinessActivity @relation(fields: [business_activity_id], references: [id])
|
||||
|
||||
pos_list Pos[]
|
||||
good_categories GoodCategory[]
|
||||
permission_complexes PermissionComplex[]
|
||||
pos_list Pos[]
|
||||
|
||||
@@index([business_activity_id], map: "complexes_business_activity_id_fkey")
|
||||
@@map("complexes")
|
||||
}
|
||||
|
||||
@@ -126,27 +110,37 @@ model Pos {
|
||||
id String @id @default(ulid())
|
||||
name String
|
||||
model String?
|
||||
serial_number String? @unique()
|
||||
serial_number String? @unique
|
||||
status POSStatus @default(ACTIVE)
|
||||
pos_type POSType
|
||||
|
||||
created_at DateTime @default(now()) @db.Timestamp(0)
|
||||
updated_at DateTime @updatedAt() @db.Timestamp(0)
|
||||
|
||||
updated_at DateTime @updatedAt @db.Timestamp(0)
|
||||
complex_id String
|
||||
complex Complex @relation(fields: [complex_id], references: [id])
|
||||
|
||||
device_id String?
|
||||
device Device? @relation(fields: [device_id], references: [id])
|
||||
|
||||
provider_id String?
|
||||
provider Provider? @relation(fields: [provider_id], references: [id])
|
||||
|
||||
account_id String @unique
|
||||
account ConsumerAccount @relation(fields: [account_id], references: [id])
|
||||
|
||||
permission_pos PermissionPos[]
|
||||
account ConsumerAccount @relation(fields: [account_id], references: [id])
|
||||
complex Complex @relation(fields: [complex_id], references: [id])
|
||||
device Device? @relation(fields: [device_id], references: [id])
|
||||
provider Provider? @relation(fields: [provider_id], references: [id])
|
||||
sales_invoices SalesInvoice[]
|
||||
|
||||
@@index([complex_id], map: "poses_complex_id_fkey")
|
||||
@@index([device_id], map: "poses_device_id_fkey")
|
||||
@@index([provider_id], map: "poses_provider_id_fkey")
|
||||
@@map("poses")
|
||||
}
|
||||
|
||||
model ConsumerAccountGoodFavorite {
|
||||
created_at DateTime @default(now())
|
||||
consumer_account_id String
|
||||
good_id String
|
||||
consumer_account ConsumerAccount @relation(fields: [consumer_account_id], references: [id], onDelete: Cascade)
|
||||
good Good @relation(fields: [good_id], references: [id], onDelete: Cascade)
|
||||
|
||||
@@id([consumer_account_id, good_id])
|
||||
@@index([good_id])
|
||||
@@index([consumer_account_id])
|
||||
@@map("consumer_account_good_favorites")
|
||||
}
|
||||
|
||||
@@ -4,30 +4,28 @@ model Good {
|
||||
is_default_guild_good Boolean @default(false)
|
||||
pricing_model GoodPricingModel
|
||||
description String? @db.Text
|
||||
local_sku String? @unique() @db.VarChar(100)
|
||||
barcode String? @unique() @db.VarChar(100)
|
||||
base_sale_price Decimal? @default(0.00) @db.Decimal(15, 0)
|
||||
local_sku String? @unique @db.VarChar(100)
|
||||
barcode String? @unique @db.VarChar(100)
|
||||
base_sale_price Decimal? @default(0) @db.Decimal(15, 0)
|
||||
image_url String? @db.VarChar(255)
|
||||
|
||||
created_at DateTime @default(now()) @db.Timestamp(0)
|
||||
updated_at DateTime @updatedAt @db.Timestamp(0)
|
||||
deleted_at DateTime? @db.Timestamp(0)
|
||||
|
||||
sku_id String
|
||||
sku StockKeepingUnits @relation(fields: [sku_id], references: [id])
|
||||
|
||||
measure_unit_id String
|
||||
measure_unit MeasureUnits @relation(fields: [measure_unit_id], references: [id])
|
||||
|
||||
category_id String?
|
||||
category GoodCategory? @relation(fields: [category_id], references: [id])
|
||||
|
||||
business_activity_id String?
|
||||
consumer_account_good_favorites ConsumerAccountGoodFavorite[]
|
||||
business_activity BusinessActivity? @relation(fields: [business_activity_id], references: [id])
|
||||
|
||||
category GoodCategory? @relation(fields: [category_id], references: [id])
|
||||
measure_unit MeasureUnits @relation(fields: [measure_unit_id], references: [id])
|
||||
sku StockKeepingUnits @relation(fields: [sku_id], references: [id])
|
||||
sales_invoice_items SalesInvoiceItem[]
|
||||
|
||||
@@index([category_id])
|
||||
@@index([business_activity_id], map: "goods_business_activity_id_fkey")
|
||||
@@index([measure_unit_id], map: "goods_measure_unit_id_fkey")
|
||||
@@index([sku_id], map: "goods_sku_id_fkey")
|
||||
@@map("goods")
|
||||
}
|
||||
|
||||
@@ -39,14 +37,14 @@ model GoodCategory {
|
||||
complex_id String?
|
||||
is_default_guild_good Boolean @default(false)
|
||||
guild_id String?
|
||||
|
||||
created_at DateTime @default(now()) @db.Timestamp(0)
|
||||
updated_at DateTime @updatedAt @db.Timestamp(0)
|
||||
deleted_at DateTime? @db.Timestamp(0)
|
||||
|
||||
goods Good[]
|
||||
guild Guild? @relation(fields: [guild_id], references: [id])
|
||||
complex Complex? @relation(fields: [complex_id], references: [id])
|
||||
guild Guild? @relation(fields: [guild_id], references: [id])
|
||||
goods Good[]
|
||||
|
||||
@@index([complex_id], map: "good_categories_complex_id_fkey")
|
||||
@@index([guild_id], map: "good_categories_guild_id_fkey")
|
||||
@@map("good_categories")
|
||||
}
|
||||
|
||||
@@ -3,10 +3,8 @@ model Guild {
|
||||
name String
|
||||
invoice_template InvoiceTemplateType
|
||||
code String?
|
||||
|
||||
created_at DateTime @default(now()) @db.Timestamp(0)
|
||||
updated_at DateTime @updatedAt() @db.Timestamp(0)
|
||||
|
||||
updated_at DateTime @updatedAt @db.Timestamp(0)
|
||||
business_activities BusinessActivity[]
|
||||
good_categories GoodCategory[]
|
||||
stockKeepingUnits StockKeepingUnits[]
|
||||
|
||||
@@ -2,10 +2,8 @@ model MeasureUnits {
|
||||
id String @id @default(ulid())
|
||||
code String @unique
|
||||
name String
|
||||
|
||||
created_at DateTime @default(now()) @db.Timestamp(0)
|
||||
updated_at DateTime @default(now()) @updatedAt @db.Timestamp(0)
|
||||
|
||||
goods Good[]
|
||||
|
||||
@@map("measure_units")
|
||||
|
||||
@@ -5,15 +5,13 @@ model StockKeepingUnits {
|
||||
VAT Decimal @db.Decimal(5, 2)
|
||||
is_public Boolean @default(true)
|
||||
is_domestic Boolean @default(false)
|
||||
|
||||
guild_id String
|
||||
created_at DateTime @default(now()) @db.Timestamp(0)
|
||||
updated_at DateTime @updatedAt @db.Timestamp(0)
|
||||
goods Good[]
|
||||
guild Guild @relation(fields: [guild_id], references: [id])
|
||||
|
||||
created_at DateTime @default(now()) @db.Timestamp(0)
|
||||
updated_at DateTime @updatedAt() @db.Timestamp(0)
|
||||
|
||||
goods Good[]
|
||||
|
||||
@@index([code])
|
||||
@@index([guild_id], map: "stock_keeping_units_guild_id_fkey")
|
||||
@@map("stock_keeping_units")
|
||||
}
|
||||
|
||||
@@ -2,52 +2,46 @@ model Customer {
|
||||
id String @id @default(ulid())
|
||||
is_favorite Boolean? @default(false)
|
||||
type CustomerType
|
||||
|
||||
created_at DateTime @default(now()) @db.Timestamp(0)
|
||||
updated_at DateTime @updatedAt @db.Timestamp(0)
|
||||
deleted_at DateTime? @db.Timestamp(0)
|
||||
|
||||
individual CustomerIndividual?
|
||||
legal CustomerLegal?
|
||||
|
||||
sales_invoices SalesInvoice[]
|
||||
|
||||
@@map("customers")
|
||||
}
|
||||
|
||||
model CustomerIndividual {
|
||||
first_name String @db.VarChar(255)
|
||||
last_name String @db.VarChar(255)
|
||||
national_id String @db.Char(10)
|
||||
mobile_number String @db.Char(15)
|
||||
|
||||
postal_code String @db.Char(10)
|
||||
economic_code String? @db.Char(10)
|
||||
|
||||
first_name String? @db.VarChar(255)
|
||||
last_name String? @db.VarChar(255)
|
||||
national_id String? @db.Char(10)
|
||||
mobile_number String? @db.Char(15)
|
||||
postal_code String? @db.Char(10)
|
||||
economic_code String? @db.Char(14)
|
||||
customer_id String @id
|
||||
business_activity_id String
|
||||
business_activity BusinessActivity @relation(fields: [business_activity_id], references: [id])
|
||||
customer Customer @relation(fields: [customer_id], references: [id], onDelete: Cascade)
|
||||
|
||||
business_activity_id String
|
||||
business_activity BusinessActivity @relation(fields: [business_activity_id], references: id)
|
||||
|
||||
@@unique([business_activity_id, national_id])
|
||||
@@unique([business_activity_id, postal_code, national_id])
|
||||
@@index([business_activity_id])
|
||||
@@map("customer_individuals")
|
||||
}
|
||||
|
||||
model CustomerLegal {
|
||||
name String @db.VarChar(255)
|
||||
economic_code String @db.Char(10)
|
||||
name String? @db.VarChar(255)
|
||||
economic_code String? @db.Char(11)
|
||||
registration_number String? @db.Char(20)
|
||||
postal_code String @db.Char(10)
|
||||
|
||||
postal_code String? @db.Char(10)
|
||||
customer_id String @id
|
||||
business_activity_id String
|
||||
business_activity BusinessActivity @relation(fields: [business_activity_id], references: [id])
|
||||
customer Customer @relation(fields: [customer_id], references: [id], onDelete: Cascade)
|
||||
|
||||
business_activity_id String
|
||||
business_activity BusinessActivity @relation(fields: [business_activity_id], references: id)
|
||||
|
||||
@@unique([business_activity_id, economic_code])
|
||||
@@unique([business_activity_id, postal_code, registration_number])
|
||||
@@index([business_activity_id])
|
||||
@@map("customer_legal")
|
||||
}
|
||||
|
||||
@@ -9,16 +9,6 @@ enum PaymentMethodType {
|
||||
OTHER
|
||||
}
|
||||
|
||||
enum UnitType {
|
||||
COUNT
|
||||
GRAM
|
||||
KILOGRAM
|
||||
MILLILITER
|
||||
LITER
|
||||
METER
|
||||
HOUR
|
||||
}
|
||||
|
||||
enum GoodPricingModel {
|
||||
STANDARD
|
||||
GOLD
|
||||
@@ -50,18 +40,6 @@ enum BusinessRole {
|
||||
OPERATOR
|
||||
}
|
||||
|
||||
enum LicenseType {
|
||||
BASIC
|
||||
PRO
|
||||
ENTERPRISE
|
||||
}
|
||||
|
||||
enum LicenseStatus {
|
||||
ACTIVE
|
||||
EXPIRED
|
||||
SUSPENDED
|
||||
}
|
||||
|
||||
enum POSType {
|
||||
PSP
|
||||
MOBILE
|
||||
@@ -69,11 +47,6 @@ enum POSType {
|
||||
API
|
||||
}
|
||||
|
||||
enum UserType {
|
||||
LEGAL
|
||||
INDIVIDUAL
|
||||
}
|
||||
|
||||
enum AccountType {
|
||||
ADMIN
|
||||
PROVIDER
|
||||
@@ -81,17 +54,6 @@ enum AccountType {
|
||||
CONSUMER
|
||||
}
|
||||
|
||||
enum UserStatus {
|
||||
ACTIVE
|
||||
INACTIVE
|
||||
}
|
||||
|
||||
enum AccountRole {
|
||||
OWNER
|
||||
OPERATOR
|
||||
ACCOUNTANT
|
||||
}
|
||||
|
||||
enum AccountStatus {
|
||||
ACTIVE
|
||||
SUSPENDED
|
||||
@@ -114,11 +76,6 @@ enum ProviderRole {
|
||||
OPERATOR
|
||||
}
|
||||
|
||||
enum ProviderStatus {
|
||||
ACTIVE
|
||||
SUSPENDED
|
||||
}
|
||||
|
||||
enum ConsumerRole {
|
||||
OWNER
|
||||
MANAGER
|
||||
@@ -130,11 +87,6 @@ enum ConsumerStatus {
|
||||
SUSPENDED
|
||||
}
|
||||
|
||||
enum TokenType {
|
||||
ACCESS
|
||||
REFRESH
|
||||
}
|
||||
|
||||
enum ApplicationPlatform {
|
||||
ANDROID
|
||||
IOS
|
||||
@@ -146,27 +98,29 @@ enum ApplicationReleaseType {
|
||||
ALPHA
|
||||
}
|
||||
|
||||
enum ApplicationPublisher {
|
||||
DIRECT
|
||||
CAFE_BAZAR
|
||||
MAYKET
|
||||
}
|
||||
|
||||
enum ConsumerType {
|
||||
INDIVIDUAL
|
||||
LEGAL
|
||||
}
|
||||
|
||||
enum InvoiceSettlementType {
|
||||
CASH
|
||||
CREDIT
|
||||
MIXED
|
||||
}
|
||||
|
||||
enum TspProviderType {
|
||||
NAMA
|
||||
SUN
|
||||
}
|
||||
|
||||
enum TspProviderResponseStatus {
|
||||
SUCCESS
|
||||
FAILURE
|
||||
NOT_SEND
|
||||
QUEUED
|
||||
FISCAL_QUEUED
|
||||
SEND_FAILURE
|
||||
SUCCESS
|
||||
FAILURE
|
||||
}
|
||||
|
||||
enum TspProviderRequestType {
|
||||
@@ -176,15 +130,6 @@ enum TspProviderRequestType {
|
||||
RETURN
|
||||
}
|
||||
|
||||
enum TspProviderCustomerType {
|
||||
Unknown
|
||||
Known
|
||||
}
|
||||
|
||||
enum SKUGuildType {
|
||||
GOLD
|
||||
}
|
||||
|
||||
enum InvoiceTemplateType {
|
||||
SALE
|
||||
FX_SALE
|
||||
|
||||
@@ -2,38 +2,39 @@ model SalesInvoice {
|
||||
id String @id @default(uuid())
|
||||
code String @unique @db.VarChar(100)
|
||||
total_amount Decimal @db.Decimal(15, 2)
|
||||
invoice_number Int @db.Int()
|
||||
invoice_number Int
|
||||
invoice_date DateTime @default(now()) @db.Timestamp(0)
|
||||
type TspProviderRequestType
|
||||
tax_id String? @unique @db.VarChar(32)
|
||||
|
||||
notes String? @db.Text
|
||||
unknown_customer Json? @db.Json
|
||||
|
||||
unknown_customer Json?
|
||||
created_at DateTime @default(now()) @db.Timestamp(0)
|
||||
updated_at DateTime @updatedAt @db.Timestamp(0)
|
||||
|
||||
main_id String? @db.VarChar(50)
|
||||
ref_id String? @unique @db.VarChar(50)
|
||||
reference_invoice SalesInvoice? @relation("SalesInvoiceReference", fields: [ref_id], references: [id])
|
||||
|
||||
customer_id String?
|
||||
customer Customer? @relation(fields: [customer_id], references: [id])
|
||||
|
||||
consumer_account_id String
|
||||
consumer_account ConsumerAccount @relation(fields: [consumer_account_id], references: [id])
|
||||
|
||||
pos_id String
|
||||
pos Pos @relation(fields: [pos_id], references: [id])
|
||||
|
||||
referenced_by SalesInvoice? @relation("SalesInvoiceReference")
|
||||
settlement_type InvoiceSettlementType
|
||||
discount_amount Decimal? @db.Decimal(15, 2)
|
||||
tax_amount Decimal? @db.Decimal(15, 2)
|
||||
last_tsp_status TspProviderResponseStatus?
|
||||
last_attempt_no Int?
|
||||
tsp_attempts SaleInvoiceTspAttempts[]
|
||||
items SalesInvoiceItem[]
|
||||
payments SalesInvoicePayment[]
|
||||
tsp_attempts SaleInvoiceTspAttempts[]
|
||||
consumer_account ConsumerAccount @relation(fields: [consumer_account_id], references: [id])
|
||||
customer Customer? @relation(fields: [customer_id], references: [id])
|
||||
pos Pos @relation(fields: [pos_id], references: [id])
|
||||
reference_invoice SalesInvoice? @relation("SalesInvoiceReference", fields: [ref_id], references: [id])
|
||||
referenced_by SalesInvoice? @relation("SalesInvoiceReference")
|
||||
|
||||
@@unique([invoice_number, pos_id])
|
||||
@@index([pos_id, invoice_date])
|
||||
@@index([ref_id])
|
||||
@@index([tax_id])
|
||||
@@index([consumer_account_id], map: "sales_invoices_consumer_account_id_fkey")
|
||||
@@index([customer_id], map: "sales_invoices_customer_id_fkey")
|
||||
@@map("sales_invoices")
|
||||
}
|
||||
|
||||
@@ -49,39 +50,39 @@ model SalesInvoiceItem {
|
||||
created_at DateTime @default(now()) @db.Timestamp(0)
|
||||
discount Decimal @default(0.00) @db.Decimal(15, 2)
|
||||
notes String? @db.Text
|
||||
|
||||
payload Json?
|
||||
good_snapshot Json
|
||||
|
||||
invoice_id String
|
||||
invoice SalesInvoice @relation(fields: [invoice_id], references: [id])
|
||||
|
||||
good_id String
|
||||
good Good @relation(fields: [good_id], references: [id])
|
||||
|
||||
service_id String?
|
||||
discount_amount Decimal? @db.Decimal(15, 2)
|
||||
tax_amount Decimal? @db.Decimal(15, 2)
|
||||
|
||||
good Good @relation(fields: [good_id], references: [id])
|
||||
invoice SalesInvoice @relation(fields: [invoice_id], references: [id])
|
||||
service Service? @relation(fields: [service_id], references: [id])
|
||||
|
||||
@@index([invoice_id, good_id])
|
||||
@@index([good_id], map: "sales_invoice_items_good_id_fkey")
|
||||
@@index([service_id], map: "sales_invoice_items_service_id_fkey")
|
||||
@@map("sales_invoice_items")
|
||||
}
|
||||
|
||||
model SaleInvoiceTspAttempts {
|
||||
id String @id @default(ulid())
|
||||
|
||||
attempt_no Int
|
||||
status TspProviderResponseStatus
|
||||
|
||||
raw_request_payload Json
|
||||
provider_request_payload Json?
|
||||
provider_response_payload Json?
|
||||
message String @db.Text
|
||||
|
||||
sent_at DateTime? @db.Timestamp(0)
|
||||
received_at DateTime? @db.Timestamp(0)
|
||||
created_at DateTime @default(now()) @db.Timestamp(0)
|
||||
|
||||
invoice_id String
|
||||
provider_request_payload Json
|
||||
raw_request_payload Json
|
||||
error_message String? @db.Text
|
||||
fiscal_warnings Json?
|
||||
provider_response Json?
|
||||
validation_errors Json?
|
||||
invoice SalesInvoice @relation(fields: [invoice_id], references: [id], onDelete: Cascade)
|
||||
|
||||
@@unique([invoice_id, attempt_no])
|
||||
@@ -95,13 +96,10 @@ model SalesInvoicePayment {
|
||||
amount Decimal @db.Decimal(15, 2)
|
||||
payment_method PaymentMethodType
|
||||
paid_at DateTime @db.Timestamp(0)
|
||||
|
||||
created_at DateTime @default(now()) @db.Timestamp(0)
|
||||
|
||||
invoice_id String
|
||||
invoice SalesInvoice @relation(fields: [invoice_id], references: [id])
|
||||
|
||||
terminal_info SalesInvoicePaymentTerminalInfo?
|
||||
invoice SalesInvoice @relation(fields: [invoice_id], references: [id])
|
||||
|
||||
@@index([invoice_id])
|
||||
@@map("sales_invoice_payments")
|
||||
@@ -115,9 +113,7 @@ model SalesInvoicePaymentTerminalInfo {
|
||||
transaction_date_time DateTime
|
||||
customer_card_no String?
|
||||
description String?
|
||||
|
||||
created_at DateTime @default(now()) @db.Timestamp(0)
|
||||
|
||||
payment_id String @unique
|
||||
payment SalesInvoicePayment @relation(fields: [payment_id], references: [id])
|
||||
|
||||
|
||||
@@ -2,19 +2,18 @@ model Service {
|
||||
id String @id @default(ulid())
|
||||
name String @db.VarChar(255)
|
||||
description String? @db.Text
|
||||
sku String @unique() @db.VarChar(100)
|
||||
local_sku String? @unique() @db.VarChar(100)
|
||||
barcode String? @unique() @db.VarChar(100)
|
||||
sku String @unique @db.VarChar(100)
|
||||
local_sku String? @unique @db.VarChar(100)
|
||||
barcode String? @unique @db.VarChar(100)
|
||||
created_at DateTime @default(now()) @db.Timestamp(0)
|
||||
updated_at DateTime @updatedAt @db.Timestamp(0)
|
||||
deleted_at DateTime? @db.Timestamp(0)
|
||||
category_id String?
|
||||
base_sale_price Decimal @default(0.00) @db.Decimal(15, 0)
|
||||
base_sale_price Decimal @default(0) @db.Decimal(15, 0)
|
||||
account_id String
|
||||
complex_id String
|
||||
|
||||
category ServiceCategory? @relation(fields: [category_id], references: [id])
|
||||
sales_invoice_items SalesInvoiceItem[]
|
||||
category ServiceCategory? @relation(fields: [category_id], references: [id])
|
||||
|
||||
@@index([category_id])
|
||||
@@map("services")
|
||||
@@ -30,7 +29,6 @@ model ServiceCategory {
|
||||
created_at DateTime @default(now()) @db.Timestamp(0)
|
||||
updated_at DateTime @updatedAt @db.Timestamp(0)
|
||||
deleted_at DateTime? @db.Timestamp(0)
|
||||
|
||||
services Service[]
|
||||
|
||||
@@map("service_categories")
|
||||
|
||||
+4
-3
@@ -1,7 +1,10 @@
|
||||
import { PasswordUtil } from '@/common/utils/password.util'
|
||||
import { GoodPricingModel } from '@/generated/prisma/enums'
|
||||
import { GoodCreateManyInput } from '@/generated/prisma/models'
|
||||
import { prisma } from '../src/lib/prisma'
|
||||
import { PrismaClient } from '../src/generated/prisma/client'
|
||||
import { prismaAdapter } from '../src/lib/prisma'
|
||||
|
||||
const prisma = new PrismaClient({ adapter: prismaAdapter })
|
||||
|
||||
async function main() {
|
||||
const password = await PasswordUtil.hash('123456')
|
||||
@@ -198,8 +201,6 @@ async function main() {
|
||||
code: sku_code,
|
||||
},
|
||||
})
|
||||
console.log(name)
|
||||
console.log(sku?.id)
|
||||
|
||||
if (sku) {
|
||||
return {
|
||||
|
||||
@@ -1,548 +0,0 @@
|
||||
-- AUTO-GENERATED MYSQL TRIGGER DUMP
|
||||
-- Generated at: 2026-01-06T16:09:38.959Z
|
||||
|
||||
-- ------------------------------------------
|
||||
-- index: 1
|
||||
-- Trigger: trg_bank_account_transaction_after_delete
|
||||
-- Event: DELETE
|
||||
-- Table: Bank_Account_Transactions
|
||||
-- ------------------------------------------
|
||||
DROP TRIGGER IF EXISTS `trg_bank_account_transaction_after_delete`;
|
||||
CREATE DEFINER=`pos`@`%` TRIGGER `trg_bank_account_transaction_after_delete` AFTER DELETE ON `Bank_Account_Transactions` FOR EACH ROW BEGIN
|
||||
UPDATE `Bank_Account_Balance` SET balance = balance - OLD.amount WHERE `bankAccountId` = OLD.bankAccountId;
|
||||
END;
|
||||
|
||||
-- ------------------------------------------
|
||||
-- index: 2
|
||||
-- Trigger: trg_transfer_item_after_insert
|
||||
-- Event: INSERT
|
||||
-- Table: Inventory_Transfer_Items
|
||||
-- ------------------------------------------
|
||||
DROP TRIGGER IF EXISTS `trg_transfer_item_after_insert`;
|
||||
CREATE DEFINER=`pos`@`%` TRIGGER `trg_transfer_item_after_insert` AFTER INSERT ON `Inventory_Transfer_Items` FOR EACH ROW begin
|
||||
|
||||
DECLARE fromInv INT;
|
||||
DECLARE toInv INT;
|
||||
DECLARE _avgCost DECIMAL(10,2);
|
||||
DECLARE latestQuantityInOrigin DECIMAL(10,2);
|
||||
DECLARE latestQuantityInDestination DECIMAL(10,2);
|
||||
|
||||
SELECT fromInventoryId, toInventoryId INTO fromInv, toInv
|
||||
FROM Inventory_Transfers WHERE id = NEW.transferId;
|
||||
|
||||
SELECT COALESCE(avgCost, 0), COALESCE(quantity, 0) INTO _avgCost, latestQuantityInOrigin FROM Stock_Balance
|
||||
WHERE ProductId = NEW.productId AND inventoryId = fromInv LIMIT 1;
|
||||
|
||||
SELECT COALESCE(quantity, 0) INTO latestQuantityInDestination FROM Stock_Balance
|
||||
WHERE ProductId = NEW.productId AND inventoryId = toInv LIMIT 1;
|
||||
|
||||
|
||||
-- OUT from source
|
||||
INSERT INTO Stock_Movements
|
||||
(type, quantity, unitPrice, totalCost, avgCost, referenceType, referenceId, productId, inventoryId, counterInventoryId, createdAt, remainedInStock)
|
||||
VALUES
|
||||
('OUT', NEW.count, _avgCost, _avgCost*NEW.count, _avgCost, 'INVENTORY_TRANSFER', NEW.transferId, NEW.productId, fromInv, toInv, NOW(), latestQuantityInOrigin-NEW.count);
|
||||
|
||||
-- IN to destination
|
||||
INSERT INTO Stock_Movements
|
||||
(type, quantity, unitPrice, totalCost, avgCost, referenceType, referenceId, productId, inventoryId, counterInventoryId, createdAt, remainedInStock)
|
||||
VALUES
|
||||
('IN', NEW.count,_avgCost, _avgCost*NEW.count,_avgCost, 'INVENTORY_TRANSFER', NEW.transferId, NEW.productId, toInv, fromInv, NOW(), latestQuantityInOrigin-NEW.count);
|
||||
end;
|
||||
|
||||
-- ------------------------------------------
|
||||
-- index: 3
|
||||
-- Trigger: trg_order_item_after_update
|
||||
-- Event: UPDATE
|
||||
-- Table: Order_Items
|
||||
-- ------------------------------------------
|
||||
DROP TRIGGER IF EXISTS `trg_order_item_after_update`;
|
||||
CREATE DEFINER=`pos`@`%` TRIGGER `trg_order_item_after_update` AFTER UPDATE ON `Order_Items` FOR EACH ROW BEGIN
|
||||
|
||||
UPDATE Stock_Reservations
|
||||
SET quantity = quantity - OLD.quantity + NEW.quantity
|
||||
WHERE orderId = NEW.orderId AND productId = NEW.productId;
|
||||
|
||||
END;
|
||||
|
||||
-- ------------------------------------------
|
||||
-- index: 4
|
||||
-- Trigger: trg_order_item_after_delete
|
||||
-- Event: DELETE
|
||||
-- Table: Order_Items
|
||||
-- ------------------------------------------
|
||||
DROP TRIGGER IF EXISTS `trg_order_item_after_delete`;
|
||||
CREATE DEFINER=`pos`@`%` TRIGGER `trg_order_item_after_delete` AFTER DELETE ON `Order_Items` FOR EACH ROW BEGIN
|
||||
|
||||
DELETE From Stock_Reservations
|
||||
WHERE orderId = OLD.orderId AND productId = OLD.productId;
|
||||
|
||||
END;
|
||||
|
||||
-- ------------------------------------------
|
||||
-- index: 5
|
||||
-- Trigger: trg_order_after_cancel
|
||||
-- Event: UPDATE
|
||||
-- Table: Orders
|
||||
-- ------------------------------------------
|
||||
DROP TRIGGER IF EXISTS `trg_order_after_cancel`;
|
||||
CREATE DEFINER=`pos`@`%` TRIGGER `trg_order_after_cancel` AFTER UPDATE ON `Orders` FOR EACH ROW BEGIN
|
||||
IF NEW.status = 'CANCELED' OR NEW.status = 'REJECTED' OR NEW.status = 'DONE' THEN
|
||||
UPDATE Stock_Reservations sr SET quantity = 0
|
||||
WHERE sr.orderId = NEW.id;
|
||||
END IF;
|
||||
END;
|
||||
|
||||
-- ------------------------------------------
|
||||
-- index: 6
|
||||
-- Trigger: trg_purchase_receipt_item_after_insert
|
||||
-- Event: INSERT
|
||||
-- Table: Purchase_Receipt_Items
|
||||
-- ------------------------------------------
|
||||
DROP TRIGGER IF EXISTS `trg_purchase_receipt_item_after_insert`;
|
||||
CREATE DEFINER=`pos`@`%` TRIGGER `trg_purchase_receipt_item_after_insert` AFTER INSERT ON `Purchase_Receipt_Items` FOR EACH ROW BEGIN DECLARE latestQuantity DECIMAL(10, 2) DEFAULT 0;
|
||||
|
||||
DECLARE invId INT;
|
||||
DECLARE suppId INT;
|
||||
|
||||
-- Get inventory & supplier from
|
||||
SELECT inventoryId, supplierId
|
||||
INTO invId, suppId
|
||||
FROM Purchase_Receipts
|
||||
WHERE id = NEW.receiptId;
|
||||
|
||||
-- Get current stock quantity (if exists)
|
||||
SELECT COALESCE(quantity, 0)
|
||||
INTO latestQuantity
|
||||
FROM Stock_Balance sb
|
||||
WHERE sb.inventoryId = invId
|
||||
AND sb.productId = NEW.productId
|
||||
LIMIT 1;
|
||||
|
||||
-- Insert stock movement
|
||||
INSERT INTO Stock_Movements (
|
||||
type,
|
||||
quantity,
|
||||
unitPrice,
|
||||
totalCost,
|
||||
referenceType,
|
||||
referenceId,
|
||||
productId,
|
||||
inventoryId,
|
||||
avgCost,
|
||||
supplierId,
|
||||
remainedInStock,
|
||||
createdAt
|
||||
)
|
||||
VALUES (
|
||||
'IN',
|
||||
NEW.count,
|
||||
NEW.unitPrice,
|
||||
NEW.totalAmount,
|
||||
'PURCHASE',
|
||||
NEW.receiptId,
|
||||
NEW.productId,
|
||||
invId,
|
||||
CASE
|
||||
WHEN NEW.count = 0 THEN 0
|
||||
ELSE NEW.totalAmount / NEW.count
|
||||
END
|
||||
|
||||
,
|
||||
suppId,
|
||||
latestQuantity + NEW.count,
|
||||
NOW()
|
||||
);
|
||||
|
||||
END;
|
||||
|
||||
-- ------------------------------------------
|
||||
-- index: 7
|
||||
-- Trigger: trg_pr_payment_after_delete
|
||||
-- Event: DELETE
|
||||
-- Table: Purchase_Receipt_Payments
|
||||
-- ------------------------------------------
|
||||
DROP TRIGGER IF EXISTS `trg_pr_payment_after_delete`;
|
||||
CREATE DEFINER=`pos`@`%` TRIGGER `trg_pr_payment_after_delete` AFTER DELETE ON `Purchase_Receipt_Payments` FOR EACH ROW BEGIN
|
||||
DECLARE receiptTotal DECIMAL(14,2);
|
||||
DECLARE newPaid DECIMAL(14,2);
|
||||
|
||||
SELECT totalAmount, paidAmount
|
||||
INTO receiptTotal, newPaid
|
||||
FROM Purchase_Receipts
|
||||
WHERE id = OLD.receiptId
|
||||
FOR UPDATE;
|
||||
|
||||
IF OLD.type = 'PAYMENT' THEN
|
||||
SET newPaid = newPaid - OLD.amount;
|
||||
ELSE
|
||||
SET newPaid = newPaid + OLD.amount;
|
||||
END IF;
|
||||
|
||||
UPDATE Purchase_Receipts
|
||||
SET
|
||||
paidAmount = newPaid,
|
||||
status =
|
||||
CASE
|
||||
WHEN newPaid = 0 THEN 'UNPAID'
|
||||
WHEN newPaid < receiptTotal THEN 'PARTIALLY_PAID'
|
||||
ELSE 'PAID'
|
||||
END
|
||||
WHERE id = OLD.receiptId;
|
||||
END;
|
||||
|
||||
-- ------------------------------------------
|
||||
-- index: 8
|
||||
-- Trigger: trg_sales_invoice_items_before_insert
|
||||
-- Event: INSERT
|
||||
-- Table: Sales_Invoice_Items
|
||||
-- ------------------------------------------
|
||||
DROP TRIGGER IF EXISTS `trg_sales_invoice_items_before_insert`;
|
||||
CREATE DEFINER=`pos`@`%` TRIGGER `trg_sales_invoice_items_before_insert` BEFORE INSERT ON `Sales_Invoice_Items` FOR EACH ROW BEGIN
|
||||
|
||||
DECLARE current_stock DECIMAL(10, 2);
|
||||
DECLARE inventory_id INT;
|
||||
|
||||
|
||||
|
||||
SELECT pa.inventoryId INTO inventory_id
|
||||
FROM Pos_Accounts pa
|
||||
INNER JOIN Sales_Invoices si ON pa.id = si.posAccountId
|
||||
WHERE si.id = NEW.invoiceId;
|
||||
|
||||
|
||||
SELECT COALESCE(sav.availableQuantity, 0) INTO current_stock
|
||||
FROM Stock_Available_View sav
|
||||
WHERE productId = NEW.productId AND sav.inventoryId = inventory_id;
|
||||
|
||||
|
||||
|
||||
IF NEW.count > current_stock THEN
|
||||
SIGNAL SQLSTATE '45000'
|
||||
SET MESSAGE_TEXT = 'موجودی کالا در انبار کافی نیست.';
|
||||
END IF;
|
||||
end;
|
||||
|
||||
-- ------------------------------------------
|
||||
-- index: 9
|
||||
-- Trigger: trg_sales_invoice_items_after_insert
|
||||
-- Event: INSERT
|
||||
-- Table: Sales_Invoice_Items
|
||||
-- ------------------------------------------
|
||||
DROP TRIGGER IF EXISTS `trg_sales_invoice_items_after_insert`;
|
||||
CREATE DEFINER=`pos`@`%` TRIGGER `trg_sales_invoice_items_after_insert` AFTER INSERT ON `Sales_Invoice_Items` FOR EACH ROW begin DECLARE current_stock DECIMAL(10, 2);
|
||||
|
||||
DECLARE inventory_id INT;
|
||||
DECLARE customer_id INT;
|
||||
DECLARE pos_id INT;
|
||||
|
||||
|
||||
|
||||
SELECT posAccountId, customerId INTO pos_id, customer_id
|
||||
FROM Sales_Invoices si
|
||||
WHERE si.id = NEW.invoiceId
|
||||
LIMIT 1;
|
||||
INSERT INTO Trigger_Logs (name , message) VALUES ('pos_id', pos_id);
|
||||
INSERT INTO Trigger_Logs (name , message) VALUES ('customer_id', customer_id);
|
||||
|
||||
|
||||
SELECT pa.inventoryId INTO inventory_id
|
||||
FROM Pos_Accounts pa
|
||||
INNER JOIN Sales_Invoices si ON pa.id = si.posAccountId
|
||||
WHERE si.id = NEW.invoiceId;
|
||||
|
||||
|
||||
|
||||
SELECT COALESCE(quantity, 0) INTO current_stock
|
||||
FROM Stock_Balance sb
|
||||
WHERE productId = NEW.productId AND sb.inventoryId = inventory_id
|
||||
LIMIT 1;
|
||||
|
||||
|
||||
|
||||
INSERT INTO Stock_Movements (
|
||||
type,
|
||||
quantity,
|
||||
unitPrice,
|
||||
totalCost,
|
||||
referenceType,
|
||||
referenceId,
|
||||
productId,
|
||||
inventoryId,
|
||||
avgCost,
|
||||
remainedInStock,
|
||||
customerId,
|
||||
createdAt
|
||||
)
|
||||
VALUES (
|
||||
'OUT',
|
||||
NEW.count,
|
||||
NEW.unitPrice,
|
||||
NEW.totalAmount,
|
||||
'SALES',
|
||||
NEW.invoiceId,
|
||||
NEW.productId,
|
||||
inventory_id,
|
||||
|
||||
CASE
|
||||
WHEN NEW.count = 0 THEN 0
|
||||
ELSE NEW.totalAmount / NEW.count
|
||||
END,
|
||||
current_stock - NEW.count,
|
||||
customer_id,
|
||||
NOW()
|
||||
);
|
||||
|
||||
|
||||
END;
|
||||
|
||||
-- ------------------------------------------
|
||||
-- index: 10
|
||||
-- Trigger: trg_pos_account_payment_after_insert
|
||||
-- Event: INSERT
|
||||
-- Table: Sales_Invoice_Payments
|
||||
-- ------------------------------------------
|
||||
DROP TRIGGER IF EXISTS `trg_pos_account_payment_after_insert`;
|
||||
CREATE DEFINER=`pos`@`%` TRIGGER `trg_pos_account_payment_after_insert` AFTER INSERT ON `Sales_Invoice_Payments` FOR EACH ROW BEGIN
|
||||
|
||||
DECLARE _bankAccountId INT;
|
||||
|
||||
IF(NEW.paymentMethod != 'CASH') THEN
|
||||
SELECT cashBankAccountId INTO _bankAccountId
|
||||
FROM Pos_Accounts pa
|
||||
INNER JOIN Sales_Invoices si ON pa.id = si.posAccountId
|
||||
WHERE si.id = NEW.invoiceId;
|
||||
End IF;
|
||||
|
||||
INSERT INTO Bank_Account_Transactions (
|
||||
bankAccountId,
|
||||
type,
|
||||
amount,
|
||||
balanceAfter,
|
||||
referenceType,
|
||||
referenceId
|
||||
)
|
||||
VALUES(
|
||||
_bankAccountId,
|
||||
'DEPOSIT',
|
||||
NEW.amount,
|
||||
0,
|
||||
'POS_SALE',
|
||||
NEW.id
|
||||
);
|
||||
END;
|
||||
|
||||
-- ------------------------------------------
|
||||
-- index: 11
|
||||
-- Trigger: trg_sales_invoice_payment_after_insert
|
||||
-- Event: INSERT
|
||||
-- Table: Sales_Invoice_Payments
|
||||
-- ------------------------------------------
|
||||
DROP TRIGGER IF EXISTS `trg_sales_invoice_payment_after_insert`;
|
||||
CREATE DEFINER=`pos`@`%` TRIGGER `trg_sales_invoice_payment_after_insert` AFTER INSERT ON `Sales_Invoice_Payments` FOR EACH ROW BEGIN
|
||||
DECLARE currentBalance DECIMAL(15,2);
|
||||
DECLARE bankAccountId INT;
|
||||
|
||||
SELECT pa.bankAccountId INTO bankAccountId
|
||||
FROM Pos_Accounts pa
|
||||
INNER JOIN Sales_Invoices si ON pa.id = si.posAccountId
|
||||
WHERE si.id = NEW.invoiceId;
|
||||
|
||||
SELECT balance INTO currentBalance
|
||||
FROM Bank_Account_Balance
|
||||
WHERE bankAccountId = bankAccountId
|
||||
FOR UPDATE;
|
||||
|
||||
IF currentBalance IS NULL THEN
|
||||
SET currentBalance = 0;
|
||||
INSERT INTO Bank_Account_Balance (bankAccountId, balance)
|
||||
VALUES (bankAccountId, 0);
|
||||
END IF;
|
||||
|
||||
SET currentBalance = currentBalance + NEW.amount;
|
||||
|
||||
INSERT INTO Bank_Account_Transactions
|
||||
(bankAccountId, type, amount, balanceAfter, referenceType, referenceId)
|
||||
VALUES
|
||||
(bankAccountId, 'DEPOSIT', NEW.amount, currentBalance, 'POS_SALE', NEW.id);
|
||||
|
||||
UPDATE Bank_Account_Balance
|
||||
SET balance = currentBalance
|
||||
WHERE bankAccountId = bankAccountId;
|
||||
END;
|
||||
|
||||
-- ------------------------------------------
|
||||
-- index: 12
|
||||
-- Trigger: trg_stock_sale_insert
|
||||
-- Event: INSERT
|
||||
-- Table: Stock_Movements
|
||||
-- ------------------------------------------
|
||||
DROP TRIGGER IF EXISTS `trg_stock_sale_insert`;
|
||||
CREATE DEFINER=`pos`@`%` TRIGGER `trg_stock_sale_insert` AFTER INSERT ON `Stock_Movements` FOR EACH ROW BEGIN IF NEW.referenceType = 'SALES' THEN
|
||||
|
||||
INSERT INTO
|
||||
Stock_Balance (
|
||||
productId,
|
||||
quantity,
|
||||
avgCost,
|
||||
totalCost,
|
||||
inventoryId,
|
||||
updatedAt
|
||||
)
|
||||
VALUES (
|
||||
NEW.productId,
|
||||
NEW.quantity,
|
||||
NEW.unitPrice,
|
||||
NEW.totalCost,
|
||||
NEW.inventoryId,
|
||||
NOW()
|
||||
)
|
||||
ON DUPLICATE KEY UPDATE
|
||||
quantity = quantity - NEW.quantity,
|
||||
totalCost = totalCost - NEW.totalCost,
|
||||
avgCost = totalCost / quantity;
|
||||
|
||||
END IF;
|
||||
|
||||
END;
|
||||
|
||||
-- ------------------------------------------
|
||||
-- index: 13
|
||||
-- Trigger: trg_stock_purchase_insert
|
||||
-- Event: INSERT
|
||||
-- Table: Stock_Movements
|
||||
-- ------------------------------------------
|
||||
DROP TRIGGER IF EXISTS `trg_stock_purchase_insert`;
|
||||
CREATE DEFINER=`pos`@`%` TRIGGER `trg_stock_purchase_insert` AFTER INSERT ON `Stock_Movements` FOR EACH ROW BEGIN IF NEW.referenceType = 'PURCHASE' THEN
|
||||
|
||||
INSERT INTO
|
||||
Stock_Balance (
|
||||
productId,
|
||||
quantity,
|
||||
avgCost,
|
||||
totalCost,
|
||||
inventoryId,
|
||||
updatedAt
|
||||
)
|
||||
VALUES (
|
||||
NEW.productId,
|
||||
NEW.quantity,
|
||||
NEW.unitPrice,
|
||||
NEW.totalCost,
|
||||
NEW.inventoryId,
|
||||
NOW()
|
||||
)
|
||||
ON DUPLICATE KEY UPDATE
|
||||
quantity = quantity + NEW.quantity,
|
||||
totalCost = totalCost + NEW.totalCost,
|
||||
avgCost = totalCost / quantity;
|
||||
|
||||
END IF;
|
||||
|
||||
END;
|
||||
|
||||
-- ------------------------------------------
|
||||
-- index: 14
|
||||
-- Trigger: trg_stock_transfer
|
||||
-- Event: INSERT
|
||||
-- Table: Stock_Movements
|
||||
-- ------------------------------------------
|
||||
DROP TRIGGER IF EXISTS `trg_stock_transfer`;
|
||||
CREATE DEFINER=`pos`@`%` TRIGGER `trg_stock_transfer` AFTER INSERT ON `Stock_Movements` FOR EACH ROW BEGIN IF NEW.referenceType = 'INVENTORY_TRANSFER' THEN IF NEW.type = 'IN' THEN
|
||||
INSERT INTO
|
||||
Stock_Balance (
|
||||
productId,
|
||||
inventoryId,
|
||||
quantity,
|
||||
totalCost,
|
||||
avgCost,
|
||||
updatedAt
|
||||
)
|
||||
VALUES (
|
||||
NEW.productId,
|
||||
NEW.inventoryId,
|
||||
NEW.quantity,
|
||||
NEW.totalCost,
|
||||
CASE
|
||||
WHEN NEW.quantity = 0 THEN 0
|
||||
ELSE NEW.totalCost / NEW.quantity
|
||||
END,
|
||||
NOW()
|
||||
)
|
||||
ON DUPLICATE KEY UPDATE
|
||||
quantity = quantity + NEW.quantity,
|
||||
totalCost = totalCost + NEW.totalCost,
|
||||
avgCost = CASE
|
||||
WHEN (quantity + NEW.quantity) = 0 THEN 0
|
||||
ELSE (totalCost + NEW.totalCost) / (quantity + NEW.quantity)
|
||||
END,
|
||||
updatedAt = NOW();
|
||||
|
||||
END IF;
|
||||
|
||||
IF NEW.type = 'OUT' THEN IF EXISTS (
|
||||
SELECT 1
|
||||
FROM Stock_Balance sb
|
||||
WHERE
|
||||
sb.productId = NEW.productId
|
||||
AND sb.inventoryId = NEW.inventoryId
|
||||
) THEN
|
||||
|
||||
UPDATE Stock_Balance sb
|
||||
SET
|
||||
sb.quantity = sb.quantity - NEW.quantity,
|
||||
sb.totalCost = sb.totalCost - (sb.avgCost * NEW.quantity),
|
||||
sb.updatedAt = NOW()
|
||||
WHERE
|
||||
sb.productId = NEW.productId
|
||||
AND sb.inventoryId = NEW.inventoryId;
|
||||
|
||||
ELSE
|
||||
INSERT INTO
|
||||
Stock_Balance (
|
||||
productId,
|
||||
inventoryId,
|
||||
quantity,
|
||||
totalCost,
|
||||
avgCost,
|
||||
updatedAt
|
||||
)
|
||||
VALUES (
|
||||
NEW.productId,
|
||||
NEW.inventoryId,
|
||||
- NEW.quantity,
|
||||
- COALESCE(NEW.unitPrice, 0) * NEW.quantity,
|
||||
COALESCE(NEW.unitPrice, 0),
|
||||
NOW()
|
||||
);
|
||||
|
||||
END IF;
|
||||
|
||||
END IF;
|
||||
|
||||
END IF;
|
||||
|
||||
END;
|
||||
|
||||
-- ------------------------------------------
|
||||
-- index: 15
|
||||
-- Trigger: trg_no_negative_available_stock
|
||||
-- Event: INSERT
|
||||
-- Table: Stock_Reservations
|
||||
-- ------------------------------------------
|
||||
DROP TRIGGER IF EXISTS `trg_no_negative_available_stock`;
|
||||
CREATE DEFINER=`pos`@`%` TRIGGER `trg_no_negative_available_stock` BEFORE INSERT ON `Stock_Reservations` FOR EACH ROW BEGIN
|
||||
DECLARE available DECIMAL(14,3);
|
||||
|
||||
SELECT availableQuantity
|
||||
INTO available
|
||||
FROM Stock_Available_View
|
||||
WHERE productId = NEW.productId
|
||||
AND inventoryId = NEW.inventoryId;
|
||||
|
||||
IF available < NEW.quantity THEN
|
||||
SIGNAL SQLSTATE '45000'
|
||||
SET MESSAGE_TEXT = 'موجودی کافی نیست';
|
||||
END IF;
|
||||
END;
|
||||
|
||||
@@ -1,825 +0,0 @@
|
||||
-- AUTO-GENERATED MYSQL TRIGGER DUMP
|
||||
-- Generated at: 2026-01-04T09:46:30.365Z
|
||||
|
||||
-- ------------------------------------------
|
||||
-- index: 1
|
||||
-- Trigger: trg_bank_account_transaction_after_insert
|
||||
-- Event: INSERT
|
||||
-- Table: Bank_Account_Transactions
|
||||
-- ------------------------------------------
|
||||
DROP TRIGGER IF EXISTS `trg_bank_account_transaction_after_insert`;
|
||||
|
||||
CREATE DEFINER=`pos`@`%` TRIGGER `trg_bank_account_transaction_after_insert` AFTER INSERT ON `Bank_Account_Transactions` FOR EACH ROW BEGIN
|
||||
IF NEW.type = 'DEPOSIT' THEN
|
||||
UPDATE Bank_Account_Balance SET balance = balance + NEW.amount WHERE bankAccountId = NEW.bankAccountId;
|
||||
ELSEIF NEW.type = 'WITHDRAWAL' THEN
|
||||
UPDATE Bank_Account_Balance SET balance = balance - NEW.amount WHERE bankAccountId = NEW.bankAccountId;
|
||||
END IF;
|
||||
END;
|
||||
|
||||
-- ------------------------------------------
|
||||
-- index: 2
|
||||
-- Trigger: trg_bank_account_transaction_after_delete
|
||||
-- Event: DELETE
|
||||
-- Table: Bank_Account_Transactions
|
||||
-- ------------------------------------------
|
||||
DROP TRIGGER IF EXISTS `trg_bank_account_transaction_after_delete`;
|
||||
|
||||
CREATE DEFINER=`pos`@`%` TRIGGER `trg_bank_account_transaction_after_delete` AFTER DELETE ON `Bank_Account_Transactions` FOR EACH ROW BEGIN
|
||||
UPDATE Bank_Accounts SET balance = balance - OLD.amount;
|
||||
END;
|
||||
|
||||
-- ------------------------------------------
|
||||
-- index: 3
|
||||
-- Trigger: trg_transfer_item_after_insert
|
||||
-- Event: INSERT
|
||||
-- Table: Inventory_Transfer_Items
|
||||
-- ------------------------------------------
|
||||
DROP TRIGGER IF EXISTS `trg_transfer_item_after_insert`;
|
||||
|
||||
CREATE DEFINER=`pos`@`%` TRIGGER `trg_transfer_item_after_insert` AFTER INSERT ON `Inventory_Transfer_Items` FOR EACH ROW begin
|
||||
|
||||
DECLARE fromInv INT;
|
||||
DECLARE toInv INT;
|
||||
DECLARE _avgCost DECIMAL(10,2);
|
||||
DECLARE latestQuantityInOrigin DECIMAL(10,2);
|
||||
DECLARE latestQuantityInDestination DECIMAL(10,2);
|
||||
|
||||
SELECT fromInventoryId, toInventoryId INTO fromInv, toInv
|
||||
FROM Inventory_Transfers WHERE id = NEW.transferId;
|
||||
|
||||
SELECT COALESCE(avgCost, 0), COALESCE(quantity, 0) INTO _avgCost, latestQuantityInOrigin FROM Stock_Balance
|
||||
WHERE ProductId = NEW.productId AND inventoryId = fromInv LIMIT 1;
|
||||
|
||||
SELECT COALESCE(quantity, 0) INTO latestQuantityInDestination FROM Stock_Balance
|
||||
WHERE ProductId = NEW.productId AND inventoryId = toInv LIMIT 1;
|
||||
|
||||
|
||||
-- OUT from source
|
||||
INSERT INTO Stock_Movements
|
||||
(type, quantity, unitPrice, totalCost, avgCost, referenceType, referenceId, productId, inventoryId, counterInventoryId, createdAt, remainedInStock)
|
||||
VALUES
|
||||
('OUT', NEW.count, _avgCost, _avgCost*NEW.count, _avgCost, 'INVENTORY_TRANSFER', NEW.transferId, NEW.productId, fromInv, toInv, NOW(), latestQuantityInOrigin-NEW.count);
|
||||
|
||||
-- IN to destination
|
||||
INSERT INTO Stock_Movements
|
||||
(type, quantity, unitPrice, totalCost, avgCost, referenceType, referenceId, productId, inventoryId, counterInventoryId, createdAt, remainedInStock)
|
||||
VALUES
|
||||
('IN', NEW.count,_avgCost, _avgCost*NEW.count,_avgCost, 'INVENTORY_TRANSFER', NEW.transferId, NEW.productId, toInv, fromInv, NOW(), latestQuantityInOrigin-NEW.count);
|
||||
end;
|
||||
|
||||
-- ------------------------------------------
|
||||
-- index: 4
|
||||
-- Trigger: trg_order_item_after_insert
|
||||
-- Event: INSERT
|
||||
-- Table: Order_Items
|
||||
-- ------------------------------------------
|
||||
DROP TRIGGER IF EXISTS `trg_order_item_after_insert`;
|
||||
|
||||
CREATE DEFINER=`pos`@`%` TRIGGER `trg_order_item_after_insert` AFTER INSERT ON `Order_Items` FOR EACH ROW BEGIN
|
||||
UPDATE Stock_Reservations SET quantity = quantity + NEW.quantity
|
||||
WHERE orderId = NEW.orderId AND productId = NEW.productId;
|
||||
END;
|
||||
|
||||
-- ------------------------------------------
|
||||
-- index: 5
|
||||
-- Trigger: trg_order_item_after_update
|
||||
-- Event: UPDATE
|
||||
-- Table: Order_Items
|
||||
-- ------------------------------------------
|
||||
DROP TRIGGER IF EXISTS `trg_order_item_after_update`;
|
||||
|
||||
CREATE DEFINER=`pos`@`%` TRIGGER `trg_order_item_after_update` AFTER UPDATE ON `Order_Items` FOR EACH ROW BEGIN
|
||||
UPDATE Stock_Reservations
|
||||
SET quantity = quantity - OLD.quantity + NEW.quantity
|
||||
WHERE orderId = NEW.orderId AND productId = NEW.productId;
|
||||
END;
|
||||
|
||||
-- ------------------------------------------
|
||||
-- index: 6
|
||||
-- Trigger: trg_order_item_after_delete
|
||||
-- Event: DELETE
|
||||
-- Table: Order_Items
|
||||
-- ------------------------------------------
|
||||
DROP TRIGGER IF EXISTS `trg_order_item_after_delete`;
|
||||
|
||||
CREATE DEFINER=`pos`@`%` TRIGGER `trg_order_item_after_delete` AFTER DELETE ON `Order_Items` FOR EACH ROW BEGIN
|
||||
UPDATE Stock_Reservations SET quantity = quantity - OLD.quantity
|
||||
WHERE orderId = OLD.orderId AND productId = OLD.productId;
|
||||
|
||||
END;
|
||||
|
||||
-- ------------------------------------------
|
||||
-- index: 7
|
||||
-- Trigger: trg_order_after_cancel
|
||||
-- Event: UPDATE
|
||||
-- Table: Orders
|
||||
-- ------------------------------------------
|
||||
DROP TRIGGER IF EXISTS `trg_order_after_cancel`;
|
||||
|
||||
CREATE DEFINER=`pos`@`%` TRIGGER `trg_order_after_cancel` AFTER UPDATE ON `Orders` FOR EACH ROW BEGIN
|
||||
IF NEW.status = 'CANCELED' OR NEW.status = 'REJECTED' OR NEW.status = 'DONE' THEN
|
||||
UPDATE Stock_Reservations sr SET quantity = 0
|
||||
WHERE sr.orderId = NEW.id;
|
||||
END IF;
|
||||
END;
|
||||
|
||||
-- ------------------------------------------
|
||||
-- index: 8
|
||||
-- Trigger: trg_purchase_receipt_item_after_insert
|
||||
-- Event: INSERT
|
||||
-- Table: Purchase_Receipt_Items
|
||||
-- ------------------------------------------
|
||||
DROP TRIGGER IF EXISTS `trg_purchase_receipt_item_after_insert`;
|
||||
|
||||
CREATE DEFINER=`pos`@`%` TRIGGER `trg_purchase_receipt_item_after_insert` AFTER INSERT ON `Purchase_Receipt_Items` FOR EACH ROW BEGIN DECLARE latestQuantity DECIMAL(10, 2) DEFAULT 0;
|
||||
|
||||
DECLARE invId INT;
|
||||
DECLARE suppId INT;
|
||||
|
||||
-- Get inventory & supplier from
|
||||
SELECT inventoryId, supplierId
|
||||
INTO invId, suppId
|
||||
FROM Purchase_Receipts
|
||||
WHERE id = NEW.receiptId;
|
||||
|
||||
-- Get current stock quantity (if exists)
|
||||
SELECT COALESCE(quantity, 0)
|
||||
INTO latestQuantity
|
||||
FROM Stock_Balance sb
|
||||
WHERE sb.inventoryId = invId
|
||||
AND sb.productId = NEW.productId
|
||||
LIMIT 1;
|
||||
|
||||
-- Insert stock movement
|
||||
INSERT INTO Stock_Movements (
|
||||
type,
|
||||
quantity,
|
||||
unitPrice,
|
||||
totalCost,
|
||||
referenceType,
|
||||
referenceId,
|
||||
productId,
|
||||
inventoryId,
|
||||
avgCost,
|
||||
supplierId,
|
||||
remainedInStock,
|
||||
createdAt
|
||||
)
|
||||
VALUES (
|
||||
'IN',
|
||||
NEW.count,
|
||||
NEW.unitPrice,
|
||||
NEW.totalAmount,
|
||||
'PURCHASE',
|
||||
NEW.receiptId,
|
||||
NEW.productId,
|
||||
invId,
|
||||
CASE
|
||||
WHEN NEW.count = 0 THEN 0
|
||||
ELSE NEW.totalAmount / NEW.count
|
||||
END
|
||||
|
||||
,
|
||||
suppId,
|
||||
latestQuantity + NEW.count,
|
||||
NOW()
|
||||
);
|
||||
|
||||
END;
|
||||
|
||||
-- ------------------------------------------
|
||||
-- index: 9
|
||||
-- Trigger: trg_pr_payment_before_insert
|
||||
-- Event: INSERT
|
||||
-- Table: Purchase_Receipt_Payments
|
||||
-- ------------------------------------------
|
||||
DROP TRIGGER IF EXISTS `trg_pr_payment_before_insert`;
|
||||
|
||||
CREATE DEFINER=`pos`@`%` TRIGGER `trg_pr_payment_before_insert` BEFORE INSERT ON `Purchase_Receipt_Payments` FOR EACH ROW BEGIN
|
||||
|
||||
|
||||
DECLARE receiptTotal DECIMAL(14,2);
|
||||
DECLARE paid DECIMAL(14,2);
|
||||
|
||||
|
||||
SELECT totalAmount, paidAmount
|
||||
INTO receiptTotal, paid
|
||||
FROM Purchase_Receipts
|
||||
WHERE id = NEW.receiptId
|
||||
FOR UPDATE;
|
||||
|
||||
IF NEW.type = 'PAYMENT' AND paid + NEW.amount > receiptTotal THEN
|
||||
SIGNAL SQLSTATE '45000'
|
||||
SET MESSAGE_TEXT = 'مجموع مبلغ پرداختی بیشتر از مبلغ فاکتور است.';
|
||||
END IF;
|
||||
END;
|
||||
|
||||
-- ------------------------------------------
|
||||
-- index: 10
|
||||
-- Trigger: trg_purchase_payment_update_receipt
|
||||
-- Event: INSERT
|
||||
-- Table: Purchase_Receipt_Payments
|
||||
-- ------------------------------------------
|
||||
DROP TRIGGER IF EXISTS `trg_purchase_payment_update_receipt`;
|
||||
|
||||
CREATE DEFINER=`pos`@`%` TRIGGER `trg_purchase_payment_update_receipt` AFTER INSERT ON `Purchase_Receipt_Payments` FOR EACH ROW BEGIN
|
||||
DECLARE paid DECIMAL(15,2);
|
||||
DECLARE total DECIMAL(15,2);
|
||||
|
||||
SELECT
|
||||
COALESCE(SUM(
|
||||
CASE WHEN type = 'PAYMENT' THEN amount ELSE -amount END
|
||||
),0)
|
||||
INTO paid
|
||||
FROM Purchase_Receipt_Payments
|
||||
WHERE receiptId = NEW.receiptId;
|
||||
|
||||
SELECT totalAmount INTO total
|
||||
FROM Purchase_Receipts
|
||||
WHERE id = NEW.receiptId;
|
||||
|
||||
UPDATE Purchase_Receipts
|
||||
SET
|
||||
paidAmount = paid,
|
||||
status = CASE
|
||||
WHEN paid = 0 THEN 'UNPAID'
|
||||
WHEN paid < total THEN 'PARTIALLY_PAID'
|
||||
ELSE 'PAID'
|
||||
END
|
||||
WHERE id = NEW.receiptId;
|
||||
END;
|
||||
|
||||
-- ------------------------------------------
|
||||
-- index: 11
|
||||
-- Trigger: trg_purchase_payment_after_insert
|
||||
-- Event: INSERT
|
||||
-- Table: Purchase_Receipt_Payments
|
||||
-- ------------------------------------------
|
||||
DROP TRIGGER IF EXISTS `trg_purchase_payment_after_insert`;
|
||||
|
||||
CREATE DEFINER=`pos`@`%` TRIGGER `trg_purchase_payment_after_insert` AFTER INSERT ON `Purchase_Receipt_Payments` FOR EACH ROW BEGIN
|
||||
|
||||
DECLARE currentBalance DECIMAL(15, 2);
|
||||
|
||||
|
||||
SELECT balance INTO currentBalance
|
||||
FROM Bank_Account_Balance
|
||||
WHERE
|
||||
bankAccountId = NEW.bankAccountId FOR
|
||||
UPDATE;
|
||||
|
||||
|
||||
IF currentBalance IS NULL THEN SET currentBalance = 0;
|
||||
|
||||
|
||||
INSERT INTO
|
||||
Bank_Account_Balance (bankAccountId, balance, updatedAt)
|
||||
VALUES (NEW.bankAccountId, 0, NOW());
|
||||
|
||||
END IF;
|
||||
|
||||
IF NEW.type = 'PAYMENT' THEN
|
||||
SET
|
||||
currentBalance = currentBalance - NEW.amount;
|
||||
|
||||
INSERT INTO
|
||||
Bank_Account_Transactions (
|
||||
bankAccountId,
|
||||
type,
|
||||
amount,
|
||||
balanceAfter,
|
||||
referenceType,
|
||||
referenceId
|
||||
)
|
||||
VALUES (
|
||||
NEW.bankAccountId,
|
||||
'WITHDRAWAL',
|
||||
NEW.amount,
|
||||
currentBalance,
|
||||
'PURCHASE_PAYMENT',
|
||||
NEW.id
|
||||
);
|
||||
|
||||
ELSE SET currentBalance = currentBalance + NEW.amount;
|
||||
|
||||
INSERT INTO
|
||||
Bank_Account_Transactions (
|
||||
bankAccountId,
|
||||
type,
|
||||
amount,
|
||||
balanceAfter,
|
||||
referenceType,
|
||||
referenceId
|
||||
)
|
||||
VALUES (
|
||||
NEW.bankAccountId,
|
||||
'DEPOSIT',
|
||||
NEW.amount,
|
||||
currentBalance,
|
||||
'PURCHASE_REFUND',
|
||||
NEW.id
|
||||
);
|
||||
|
||||
END IF;
|
||||
|
||||
UPDATE Bank_Account_Balance
|
||||
SET
|
||||
balance = currentBalance
|
||||
WHERE
|
||||
bankAccountId = NEW.bankAccountId;
|
||||
|
||||
END;
|
||||
|
||||
-- ------------------------------------------
|
||||
-- index: 12
|
||||
-- Trigger: trg_pr_payment_after_insert
|
||||
-- Event: INSERT
|
||||
-- Table: Purchase_Receipt_Payments
|
||||
-- ------------------------------------------
|
||||
DROP TRIGGER IF EXISTS `trg_pr_payment_after_insert`;
|
||||
|
||||
CREATE DEFINER=`pos`@`%` TRIGGER `trg_pr_payment_after_insert` AFTER INSERT ON `Purchase_Receipt_Payments` FOR EACH ROW BEGIN
|
||||
DECLARE receiptTotal DECIMAL(14,2) Default 0;
|
||||
DECLARE newPaid DECIMAL(14,2) Default 0;
|
||||
DECLARE _supplierId INT;
|
||||
DECLARE lastBalance DECIMAL(14,2) Default 0;
|
||||
|
||||
|
||||
-- Lock receipt row
|
||||
SELECT COALESCE(totalAmount, 0), COALESCE(paidAmount, 0), supplierId
|
||||
INTO receiptTotal, newPaid, _supplierId
|
||||
FROM Purchase_Receipts
|
||||
WHERE id = NEW.receiptId
|
||||
FOR UPDATE;
|
||||
|
||||
-- Apply payment or refund
|
||||
IF NEW.type = 'PAYMENT' THEN
|
||||
SET newPaid = newPaid + NEW.amount;
|
||||
ELSE
|
||||
SET newPaid = newPaid - NEW.amount;
|
||||
END IF;
|
||||
|
||||
-- Update receipt
|
||||
UPDATE Purchase_Receipts
|
||||
SET
|
||||
paidAmount = newPaid,
|
||||
status =
|
||||
CASE
|
||||
WHEN newPaid = 0 THEN 'UNPAID'
|
||||
WHEN newPaid < receiptTotal THEN 'PARTIALLY_PAID'
|
||||
ELSE 'PAID'
|
||||
END
|
||||
WHERE id = NEW.receiptId;
|
||||
|
||||
-- Get last supplier balance
|
||||
SELECT IFNULL(balance, 0)
|
||||
INTO lastBalance
|
||||
FROM Supplier_Ledger
|
||||
WHERE supplierId = _supplierId
|
||||
ORDER BY id DESC
|
||||
LIMIT 1;
|
||||
|
||||
|
||||
|
||||
-- Insert supplier ledger
|
||||
INSERT INTO Supplier_Ledger
|
||||
(
|
||||
supplierId,
|
||||
debit,
|
||||
credit,
|
||||
balance,
|
||||
sourceType,
|
||||
sourceId,
|
||||
createdAt
|
||||
)
|
||||
VALUES
|
||||
(
|
||||
_supplierId,
|
||||
IF(NEW.type = 'REFUND', NEW.amount, 0),
|
||||
IF(NEW.type = 'PAYMENT', NEW.amount, 0),
|
||||
lastBalance
|
||||
+ IF(NEW.type = 'PAYMENT', NEW.amount, 0)
|
||||
- IF(NEW.type = 'REFUND', NEW.amount, 0),
|
||||
'PAYMENT',
|
||||
NEW.id,
|
||||
NOW()
|
||||
);
|
||||
END;
|
||||
|
||||
-- ------------------------------------------
|
||||
-- index: 13
|
||||
-- Trigger: trg_pr_payment_after_delete
|
||||
-- Event: DELETE
|
||||
-- Table: Purchase_Receipt_Payments
|
||||
-- ------------------------------------------
|
||||
DROP TRIGGER IF EXISTS `trg_pr_payment_after_delete`;
|
||||
|
||||
CREATE DEFINER=`pos`@`%` TRIGGER `trg_pr_payment_after_delete` AFTER DELETE ON `Purchase_Receipt_Payments` FOR EACH ROW BEGIN
|
||||
DECLARE receiptTotal DECIMAL(14,2);
|
||||
DECLARE newPaid DECIMAL(14,2);
|
||||
|
||||
SELECT totalAmount, paidAmount
|
||||
INTO receiptTotal, newPaid
|
||||
FROM Purchase_Receipts
|
||||
WHERE id = OLD.receiptId
|
||||
FOR UPDATE;
|
||||
|
||||
IF OLD.type = 'PAYMENT' THEN
|
||||
SET newPaid = newPaid - OLD.amount;
|
||||
ELSE
|
||||
SET newPaid = newPaid + OLD.amount;
|
||||
END IF;
|
||||
|
||||
UPDATE Purchase_Receipts
|
||||
SET
|
||||
paidAmount = newPaid,
|
||||
status =
|
||||
CASE
|
||||
WHEN newPaid = 0 THEN 'UNPAID'
|
||||
WHEN newPaid < receiptTotal THEN 'PARTIALLY_PAID'
|
||||
ELSE 'PAID'
|
||||
END
|
||||
WHERE id = OLD.receiptId;
|
||||
END;
|
||||
|
||||
-- ------------------------------------------
|
||||
-- index: 14
|
||||
-- Trigger: trg_purchase_receipt_after_insert
|
||||
-- Event: INSERT
|
||||
-- Table: Purchase_Receipts
|
||||
-- ------------------------------------------
|
||||
DROP TRIGGER IF EXISTS `trg_purchase_receipt_after_insert`;
|
||||
|
||||
CREATE DEFINER=`pos`@`%` TRIGGER `trg_purchase_receipt_after_insert` AFTER INSERT ON `Purchase_Receipts` FOR EACH ROW BEGIN
|
||||
DECLARE lastBalance DECIMAL(14,2) DEFAULT 0;
|
||||
|
||||
SELECT COALESCE(balance, 0)
|
||||
INTO lastBalance
|
||||
FROM Supplier_Ledger
|
||||
WHERE supplierId = NEW.supplierId
|
||||
ORDER BY id DESC
|
||||
LIMIT 1;
|
||||
|
||||
INSERT INTO Supplier_Ledger
|
||||
(
|
||||
supplierId,
|
||||
debit,
|
||||
credit,
|
||||
balance,
|
||||
sourceType,
|
||||
sourceId,
|
||||
createdAt
|
||||
)
|
||||
VALUES
|
||||
(
|
||||
NEW.supplierId,
|
||||
NEW.totalAmount,
|
||||
0,
|
||||
lastBalance - NEW.totalAmount,
|
||||
'PURCHASE',
|
||||
NEW.id,
|
||||
NOW()
|
||||
);
|
||||
END;
|
||||
|
||||
-- ------------------------------------------
|
||||
-- index: 15
|
||||
-- Trigger: trg_sales_invoice_items_before_insert
|
||||
-- Event: INSERT
|
||||
-- Table: Sales_Invoice_Items
|
||||
-- ------------------------------------------
|
||||
DROP TRIGGER IF EXISTS `trg_sales_invoice_items_before_insert`;
|
||||
|
||||
CREATE DEFINER=`pos`@`%` TRIGGER `trg_sales_invoice_items_before_insert` BEFORE INSERT ON `Sales_Invoice_Items` FOR EACH ROW BEGIN
|
||||
|
||||
DECLARE current_stock DECIMAL(10, 2);
|
||||
DECLARE inventory_id INT;
|
||||
|
||||
|
||||
|
||||
SELECT pa.inventoryId INTO inventory_id
|
||||
FROM Pos_Accounts pa
|
||||
INNER JOIN Sales_Invoices si ON pa.id = si.posAccountId
|
||||
WHERE si.id = NEW.invoiceId;
|
||||
|
||||
|
||||
SELECT COALESCE(quantity, 0) INTO current_stock
|
||||
FROM Stock_Balance sb
|
||||
WHERE productId = NEW.productId AND sb.inventoryId = inventory_id
|
||||
LIMIT 1;
|
||||
|
||||
|
||||
|
||||
IF NEW.count > current_stock THEN
|
||||
SIGNAL SQLSTATE '45000'
|
||||
SET MESSAGE_TEXT = 'موجودی کالا در انبار کافی نیست.';
|
||||
END IF;
|
||||
end;
|
||||
|
||||
-- ------------------------------------------
|
||||
-- index: 16
|
||||
-- Trigger: trg_sales_invoice_items_after_insert
|
||||
-- Event: INSERT
|
||||
-- Table: Sales_Invoice_Items
|
||||
-- ------------------------------------------
|
||||
DROP TRIGGER IF EXISTS `trg_sales_invoice_items_after_insert`;
|
||||
|
||||
CREATE DEFINER=`pos`@`%` TRIGGER `trg_sales_invoice_items_after_insert` AFTER INSERT ON `Sales_Invoice_Items` FOR EACH ROW begin DECLARE current_stock DECIMAL(10, 2);
|
||||
|
||||
DECLARE inventory_id INT;
|
||||
DECLARE customer_id INT;
|
||||
DECLARE pos_id INT;
|
||||
|
||||
|
||||
|
||||
SELECT posAccountId, customerId INTO pos_id, customer_id
|
||||
FROM Sales_Invoices si
|
||||
WHERE si.id = NEW.invoiceId
|
||||
LIMIT 1;
|
||||
INSERT INTO Trigger_Logs (name , message) VALUES ('pos_id', pos_id);
|
||||
INSERT INTO Trigger_Logs (name , message) VALUES ('customer_id', customer_id);
|
||||
|
||||
|
||||
SELECT pa.inventoryId INTO inventory_id
|
||||
FROM Pos_Accounts pa
|
||||
INNER JOIN Sales_Invoices si ON pa.id = si.posAccountId
|
||||
WHERE si.id = NEW.invoiceId;
|
||||
|
||||
|
||||
|
||||
SELECT COALESCE(quantity, 0) INTO current_stock
|
||||
FROM Stock_Balance sb
|
||||
WHERE productId = NEW.productId AND sb.inventoryId = inventory_id
|
||||
LIMIT 1;
|
||||
|
||||
|
||||
|
||||
INSERT INTO Stock_Movements (
|
||||
type,
|
||||
quantity,
|
||||
unitPrice,
|
||||
totalCost,
|
||||
referenceType,
|
||||
referenceId,
|
||||
productId,
|
||||
inventoryId,
|
||||
avgCost,
|
||||
remainedInStock,
|
||||
customerId,
|
||||
createdAt
|
||||
)
|
||||
VALUES (
|
||||
'OUT',
|
||||
NEW.count,
|
||||
NEW.unitPrice,
|
||||
NEW.totalAmount,
|
||||
'SALES',
|
||||
NEW.invoiceId,
|
||||
NEW.productId,
|
||||
inventory_id,
|
||||
|
||||
CASE
|
||||
WHEN NEW.count = 0 THEN 0
|
||||
ELSE NEW.totalAmount / NEW.count
|
||||
END,
|
||||
current_stock - NEW.count,
|
||||
customer_id,
|
||||
NOW()
|
||||
);
|
||||
|
||||
|
||||
END;
|
||||
|
||||
-- ------------------------------------------
|
||||
-- index: 17
|
||||
-- Trigger: trg_sales_invoice_payment_after_insert
|
||||
-- Event: INSERT
|
||||
-- Table: Sales_Invoice_Payments
|
||||
-- ------------------------------------------
|
||||
DROP TRIGGER IF EXISTS `trg_sales_invoice_payment_after_insert`;
|
||||
|
||||
CREATE DEFINER=`pos`@`%` TRIGGER `trg_sales_invoice_payment_after_insert` AFTER INSERT ON `Sales_Invoice_Payments` FOR EACH ROW BEGIN
|
||||
DECLARE currentBalance DECIMAL(15,2);
|
||||
DECLARE bankAccountId INT;
|
||||
|
||||
SELECT pa.bankAccountId INTO bankAccountId
|
||||
FROM Pos_Accounts pa
|
||||
INNER JOIN Sales_Invoices si ON pa.id = si.posAccountId
|
||||
WHERE si.id = NEW.invoiceId;
|
||||
|
||||
SELECT balance INTO currentBalance
|
||||
FROM Bank_Account_Balance
|
||||
WHERE bankAccountId = bankAccountId
|
||||
FOR UPDATE;
|
||||
|
||||
IF currentBalance IS NULL THEN
|
||||
SET currentBalance = 0;
|
||||
INSERT INTO Bank_Account_Balance (bankAccountId, balance)
|
||||
VALUES (bankAccountId, 0);
|
||||
END IF;
|
||||
|
||||
SET currentBalance = currentBalance + NEW.amount;
|
||||
|
||||
INSERT INTO Bank_Account_Transactions
|
||||
(bankAccountId, type, amount, balanceAfter, referenceType, referenceId)
|
||||
VALUES
|
||||
(bankAccountId, 'DEPOSIT', NEW.amount, currentBalance, 'POS_SALE', NEW.id);
|
||||
|
||||
UPDATE Bank_Account_Balance
|
||||
SET balance = currentBalance
|
||||
WHERE bankAccountId = bankAccountId;
|
||||
END;
|
||||
|
||||
-- ------------------------------------------
|
||||
-- index: 18
|
||||
-- Trigger: trg_pos_account_payment_after_insert
|
||||
-- Event: INSERT
|
||||
-- Table: Sales_Invoice_Payments
|
||||
-- ------------------------------------------
|
||||
DROP TRIGGER IF EXISTS `trg_pos_account_payment_after_insert`;
|
||||
|
||||
CREATE DEFINER=`pos`@`%` TRIGGER `trg_pos_account_payment_after_insert` AFTER INSERT ON `Sales_Invoice_Payments` FOR EACH ROW BEGIN
|
||||
|
||||
DECLARE _bankAccountId INT;
|
||||
|
||||
IF(NEW.paymentMethod != 'CASH') THEN
|
||||
SELECT cashBankAccountId INTO _bankAccountId
|
||||
FROM Pos_Accounts pa
|
||||
INNER JOIN Sales_Invoices si ON pa.id = si.posAccountId
|
||||
WHERE si.id = NEW.invoiceId;
|
||||
End IF;
|
||||
|
||||
INSERT INTO Bank_Account_Transactions (
|
||||
bankAccountId,
|
||||
type,
|
||||
amount,
|
||||
balanceAfter,
|
||||
referenceType,
|
||||
referenceId
|
||||
)
|
||||
VALUES(
|
||||
_bankAccountId,
|
||||
'DEPOSIT',
|
||||
NEW.amount,
|
||||
0,
|
||||
'POS_SALE',
|
||||
NEW.id
|
||||
);
|
||||
END;
|
||||
|
||||
-- ------------------------------------------
|
||||
-- index: 19
|
||||
-- Trigger: trg_stock_transfer
|
||||
-- Event: INSERT
|
||||
-- Table: Stock_Movements
|
||||
-- ------------------------------------------
|
||||
DROP TRIGGER IF EXISTS `trg_stock_transfer`;
|
||||
|
||||
CREATE DEFINER=`pos`@`%` TRIGGER `trg_stock_transfer` AFTER INSERT ON `Stock_Movements` FOR EACH ROW BEGIN IF NEW.referenceType = 'INVENTORY_TRANSFER' THEN IF NEW.type = 'IN' THEN
|
||||
INSERT INTO
|
||||
Stock_Balance (
|
||||
productId,
|
||||
inventoryId,
|
||||
quantity,
|
||||
totalCost,
|
||||
avgCost,
|
||||
updatedAt
|
||||
)
|
||||
VALUES (
|
||||
NEW.productId,
|
||||
NEW.inventoryId,
|
||||
NEW.quantity,
|
||||
NEW.totalCost,
|
||||
CASE
|
||||
WHEN NEW.quantity = 0 THEN 0
|
||||
ELSE NEW.totalCost / NEW.quantity
|
||||
END,
|
||||
NOW()
|
||||
)
|
||||
ON DUPLICATE KEY UPDATE
|
||||
quantity = quantity + NEW.quantity,
|
||||
totalCost = totalCost + NEW.totalCost,
|
||||
avgCost = CASE
|
||||
WHEN (quantity + NEW.quantity) = 0 THEN 0
|
||||
ELSE (totalCost + NEW.totalCost) / (quantity + NEW.quantity)
|
||||
END,
|
||||
updatedAt = NOW();
|
||||
|
||||
END IF;
|
||||
|
||||
IF NEW.type = 'OUT' THEN IF EXISTS (
|
||||
SELECT 1
|
||||
FROM Stock_Balance sb
|
||||
WHERE
|
||||
sb.productId = NEW.productId
|
||||
AND sb.inventoryId = NEW.inventoryId
|
||||
) THEN
|
||||
|
||||
UPDATE Stock_Balance sb
|
||||
SET
|
||||
sb.quantity = sb.quantity - NEW.quantity,
|
||||
sb.totalCost = sb.totalCost - (sb.avgCost * NEW.quantity),
|
||||
sb.updatedAt = NOW()
|
||||
WHERE
|
||||
sb.productId = NEW.productId
|
||||
AND sb.inventoryId = NEW.inventoryId;
|
||||
|
||||
ELSE
|
||||
INSERT INTO
|
||||
Stock_Balance (
|
||||
productId,
|
||||
inventoryId,
|
||||
quantity,
|
||||
totalCost,
|
||||
avgCost,
|
||||
updatedAt
|
||||
)
|
||||
VALUES (
|
||||
NEW.productId,
|
||||
NEW.inventoryId,
|
||||
- NEW.quantity,
|
||||
- COALESCE(NEW.unitPrice, 0) * NEW.quantity,
|
||||
COALESCE(NEW.unitPrice, 0),
|
||||
NOW()
|
||||
);
|
||||
|
||||
END IF;
|
||||
|
||||
END IF;
|
||||
|
||||
END IF;
|
||||
|
||||
END;
|
||||
|
||||
-- ------------------------------------------
|
||||
-- index: 20
|
||||
-- Trigger: trg_stock_purchase_insert
|
||||
-- Event: INSERT
|
||||
-- Table: Stock_Movements
|
||||
-- ------------------------------------------
|
||||
DROP TRIGGER IF EXISTS `trg_stock_purchase_insert`;
|
||||
|
||||
CREATE DEFINER=`pos`@`%` TRIGGER `trg_stock_purchase_insert` AFTER INSERT ON `Stock_Movements` FOR EACH ROW BEGIN IF NEW.referenceType = 'PURCHASE' THEN
|
||||
|
||||
INSERT INTO
|
||||
Stock_Balance (
|
||||
productId,
|
||||
quantity,
|
||||
avgCost,
|
||||
totalCost,
|
||||
inventoryId,
|
||||
updatedAt
|
||||
)
|
||||
VALUES (
|
||||
NEW.productId,
|
||||
NEW.quantity,
|
||||
NEW.unitPrice,
|
||||
NEW.totalCost,
|
||||
NEW.inventoryId,
|
||||
NOW()
|
||||
)
|
||||
ON DUPLICATE KEY UPDATE
|
||||
quantity = quantity + NEW.quantity,
|
||||
totalCost = totalCost + NEW.totalCost,
|
||||
avgCost = totalCost / quantity;
|
||||
|
||||
END IF;
|
||||
|
||||
END;
|
||||
|
||||
-- ------------------------------------------
|
||||
-- index: 21
|
||||
-- Trigger: trg_stock_sale_insert
|
||||
-- Event: INSERT
|
||||
-- Table: Stock_Movements
|
||||
-- ------------------------------------------
|
||||
DROP TRIGGER IF EXISTS `trg_stock_sale_insert`;
|
||||
|
||||
CREATE DEFINER=`pos`@`%` TRIGGER `trg_stock_sale_insert` AFTER INSERT ON `Stock_Movements` FOR EACH ROW BEGIN IF NEW.referenceType = 'SALES' THEN
|
||||
|
||||
INSERT INTO
|
||||
Stock_Balance (
|
||||
productId,
|
||||
quantity,
|
||||
avgCost,
|
||||
totalCost,
|
||||
inventoryId,
|
||||
updatedAt
|
||||
)
|
||||
VALUES (
|
||||
NEW.productId,
|
||||
NEW.quantity,
|
||||
NEW.unitPrice,
|
||||
NEW.totalCost,
|
||||
NEW.inventoryId,
|
||||
NOW()
|
||||
)
|
||||
ON DUPLICATE KEY UPDATE
|
||||
quantity = quantity - NEW.quantity,
|
||||
totalCost = totalCost - NEW.totalCost,
|
||||
avgCost = totalCost / quantity;
|
||||
|
||||
END IF;
|
||||
|
||||
END;
|
||||
@@ -1,657 +0,0 @@
|
||||
-- Stored Procedures equivalent to triggers
|
||||
|
||||
DELIMITER / /
|
||||
|
||||
-- Procedure for trg_bank_account_transaction_after_insert
|
||||
CREATE PROCEDURE update_bank_balance(IN p_bankAccountId INT, IN p_type VARCHAR(20), IN p_amount DECIMAL(15,2))
|
||||
BEGIN
|
||||
START TRANSACTION;
|
||||
IF p_type = 'DEPOSIT' THEN
|
||||
UPDATE Bank_Account_Balance SET balance = balance + p_amount WHERE bankAccountId = p_bankAccountId;
|
||||
ELSEIF p_type = 'WITHDRAWAL' THEN
|
||||
UPDATE Bank_Account_Balance SET balance = balance - p_amount WHERE bankAccountId = p_bankAccountId;
|
||||
END IF;
|
||||
COMMIT;
|
||||
END //
|
||||
|
||||
-- Procedure for trg_bank_account_transaction_after_delete
|
||||
CREATE PROCEDURE update_bank_balance_on_delete(IN p_bankAccountId INT, IN p_amount DECIMAL(15,2))
|
||||
BEGIN
|
||||
START TRANSACTION;
|
||||
UPDATE Bank_Accounts SET balance = balance - p_amount WHERE id = p_bankAccountId;
|
||||
COMMIT;
|
||||
END //
|
||||
|
||||
-- Procedure for trg_transfer_item_after_insert
|
||||
CREATE PROCEDURE process_transfer_item(IN p_transferId INT, IN p_productId INT, IN p_count DECIMAL(10,2))
|
||||
BEGIN
|
||||
START TRANSACTION;
|
||||
DECLARE fromInv INT;
|
||||
DECLARE toInv INT;
|
||||
DECLARE _avgCost DECIMAL(10,2);
|
||||
DECLARE latestQuantityInOrigin DECIMAL(10,2);
|
||||
DECLARE latestQuantityInDestination DECIMAL(10,2);
|
||||
|
||||
SELECT fromInventoryId, toInventoryId INTO fromInv, toInv
|
||||
FROM Inventory_Transfers WHERE id = p_transferId;
|
||||
|
||||
SELECT COALESCE(avgCost, 0), COALESCE(quantity, 0) INTO _avgCost, latestQuantityInOrigin FROM Stock_Balance
|
||||
WHERE ProductId = p_productId AND inventoryId = fromInv LIMIT 1;
|
||||
|
||||
SELECT COALESCE(quantity, 0) INTO latestQuantityInDestination FROM Stock_Balance
|
||||
WHERE ProductId = p_productId AND inventoryId = toInv LIMIT 1;
|
||||
|
||||
-- OUT from source
|
||||
INSERT INTO Stock_Movements
|
||||
(type, quantity, unitPrice, totalCost, avgCost, referenceType, referenceId, productId, inventoryId, counterInventoryId, createdAt, remainedInStock)
|
||||
VALUES
|
||||
('OUT', p_count, _avgCost, _avgCost*p_count, _avgCost, 'INVENTORY_TRANSFER', p_transferId, p_productId, fromInv, toInv, NOW(), latestQuantityInOrigin-p_count);
|
||||
|
||||
-- IN to destination
|
||||
INSERT INTO Stock_Movements
|
||||
(type, quantity, unitPrice, totalCost, avgCost, referenceType, referenceId, productId, inventoryId, counterInventoryId, createdAt, remainedInStock)
|
||||
VALUES
|
||||
('IN', p_count, _avgCost, _avgCost*p_count, _avgCost, 'INVENTORY_TRANSFER', p_transferId, p_productId, toInv, fromInv, NOW(), latestQuantityInOrigin-p_count);
|
||||
COMMIT;
|
||||
END //
|
||||
|
||||
-- Procedure for trg_order_item_after_insert
|
||||
CREATE PROCEDURE update_stock_reservation_insert(IN p_orderId INT, IN p_productId INT, IN p_quantity DECIMAL(10,2))
|
||||
BEGIN
|
||||
START TRANSACTION;
|
||||
UPDATE Stock_Reservations SET quantity = quantity + p_quantity
|
||||
WHERE orderId = p_orderId AND productId = p_productId;
|
||||
COMMIT;
|
||||
END //
|
||||
|
||||
-- Procedure for trg_order_item_after_update
|
||||
CREATE PROCEDURE update_stock_reservation_update(IN p_orderId INT, IN p_productId INT, IN p_old_quantity DECIMAL(10,2), IN p_new_quantity DECIMAL(10,2))
|
||||
BEGIN
|
||||
START TRANSACTION;
|
||||
UPDATE Stock_Reservations
|
||||
SET quantity = quantity - p_old_quantity + p_new_quantity
|
||||
WHERE orderId = p_orderId AND productId = p_productId;
|
||||
COMMIT;
|
||||
END //
|
||||
|
||||
-- Procedure for trg_order_item_after_delete
|
||||
CREATE PROCEDURE update_stock_reservation_delete(IN p_orderId INT, IN p_productId INT, IN p_quantity DECIMAL(10,2))
|
||||
BEGIN
|
||||
START TRANSACTION;
|
||||
UPDATE Stock_Reservations SET quantity = quantity - p_quantity
|
||||
WHERE orderId = p_orderId AND productId = p_productId;
|
||||
COMMIT;
|
||||
END //
|
||||
|
||||
-- Procedure for trg_order_after_cancel
|
||||
CREATE PROCEDURE cancel_order_stock(IN p_orderId INT, IN p_status VARCHAR(20))
|
||||
BEGIN
|
||||
START TRANSACTION;
|
||||
IF p_status = 'CANCELED' OR p_status = 'REJECTED' OR p_status = 'DONE' THEN
|
||||
UPDATE Stock_Reservations sr SET quantity = 0
|
||||
WHERE sr.orderId = p_orderId;
|
||||
END IF;
|
||||
COMMIT;
|
||||
END //
|
||||
|
||||
-- Procedure for trg_purchase_receipt_item_after_insert
|
||||
CREATE PROCEDURE process_purchase_item(IN p_receiptId INT, IN p_productId INT, IN p_count DECIMAL(10,2), IN p_unitPrice DECIMAL(15,2), IN p_totalAmount DECIMAL(15,2))
|
||||
BEGIN
|
||||
START TRANSACTION;
|
||||
DECLARE latestQuantity DECIMAL(10, 2) DEFAULT 0;
|
||||
DECLARE invId INT;
|
||||
DECLARE suppId INT;
|
||||
|
||||
-- Get inventory & supplier from
|
||||
SELECT inventoryId, supplierId
|
||||
INTO invId, suppId
|
||||
FROM Purchase_Receipts
|
||||
WHERE id = p_receiptId;
|
||||
|
||||
-- Get current stock quantity (if exists)
|
||||
SELECT COALESCE(quantity, 0)
|
||||
INTO latestQuantity
|
||||
FROM Stock_Balance sb
|
||||
WHERE sb.inventoryId = invId
|
||||
AND sb.productId = p_productId
|
||||
LIMIT 1;
|
||||
|
||||
-- Insert stock movement
|
||||
INSERT INTO Stock_Movements (
|
||||
type,
|
||||
quantity,
|
||||
unitPrice,
|
||||
totalCost,
|
||||
referenceType,
|
||||
referenceId,
|
||||
productId,
|
||||
inventoryId,
|
||||
avgCost,
|
||||
supplierId,
|
||||
remainedInStock,
|
||||
createdAt
|
||||
)
|
||||
VALUES (
|
||||
'IN',
|
||||
p_count,
|
||||
p_unitPrice,
|
||||
p_totalAmount,
|
||||
'PURCHASE',
|
||||
p_receiptId,
|
||||
p_productId,
|
||||
invId,
|
||||
CASE
|
||||
WHEN p_count = 0 THEN 0
|
||||
ELSE p_totalAmount / p_count
|
||||
END,
|
||||
suppId,
|
||||
latestQuantity + p_count,
|
||||
NOW()
|
||||
);
|
||||
COMMIT;
|
||||
END //
|
||||
|
||||
-- Procedure for trg_pr_payment_before_insert
|
||||
CREATE PROCEDURE validate_payment_before_insert(IN p_receiptId INT, IN p_type VARCHAR(20), IN p_amount DECIMAL(15,2))
|
||||
BEGIN
|
||||
START TRANSACTION;
|
||||
DECLARE receiptTotal DECIMAL(14,2);
|
||||
DECLARE paid DECIMAL(14,2);
|
||||
|
||||
SELECT totalAmount, paidAmount
|
||||
INTO receiptTotal, paid
|
||||
FROM Purchase_Receipts
|
||||
WHERE id = p_receiptId
|
||||
FOR UPDATE;
|
||||
|
||||
IF p_type = 'PAYMENT' AND paid + p_amount > receiptTotal THEN
|
||||
SIGNAL SQLSTATE '45000'
|
||||
SET MESSAGE_TEXT = 'مجموع مبلغ پرداختی بیشتر از مبلغ فاکتور است.';
|
||||
END IF;
|
||||
COMMIT;
|
||||
END //
|
||||
|
||||
-- Procedure for trg_purchase_payment_update_receipt
|
||||
CREATE PROCEDURE update_receipt_payment(IN p_receiptId INT)
|
||||
BEGIN
|
||||
START TRANSACTION;
|
||||
DECLARE paid DECIMAL(15,2);
|
||||
DECLARE total DECIMAL(15,2);
|
||||
|
||||
SELECT
|
||||
COALESCE(SUM(
|
||||
CASE WHEN type = 'PAYMENT' THEN amount ELSE -amount END
|
||||
),0)
|
||||
INTO paid
|
||||
FROM Purchase_Receipt_Payments
|
||||
WHERE receiptId = p_receiptId;
|
||||
|
||||
SELECT totalAmount INTO total
|
||||
FROM Purchase_Receipts
|
||||
WHERE id = p_receiptId;
|
||||
|
||||
UPDATE Purchase_Receipts
|
||||
SET
|
||||
paidAmount = paid,
|
||||
status = CASE
|
||||
WHEN paid = 0 THEN 'UNPAID'
|
||||
WHEN paid < total THEN 'PARTIALLY_PAID'
|
||||
ELSE 'PAID'
|
||||
END
|
||||
WHERE id = p_receiptId;
|
||||
COMMIT;
|
||||
END //
|
||||
|
||||
-- Procedure for trg_purchase_payment_after_insert
|
||||
CREATE PROCEDURE process_purchase_payment(IN p_bankAccountId INT, IN p_type VARCHAR(20), IN p_amount DECIMAL(15,2), IN p_id INT)
|
||||
BEGIN
|
||||
START TRANSACTION;
|
||||
DECLARE currentBalance DECIMAL(15, 2);
|
||||
|
||||
SELECT balance INTO currentBalance
|
||||
FROM Bank_Account_Balance
|
||||
WHERE bankAccountId = p_bankAccountId FOR UPDATE;
|
||||
|
||||
IF currentBalance IS NULL THEN SET currentBalance = 0;
|
||||
INSERT INTO Bank_Account_Balance (bankAccountId, balance, updatedAt)
|
||||
VALUES (p_bankAccountId, 0, NOW());
|
||||
END IF;
|
||||
|
||||
IF p_type = 'PAYMENT' THEN
|
||||
SET currentBalance = currentBalance - p_amount;
|
||||
INSERT INTO Bank_Account_Transactions (
|
||||
bankAccountId,
|
||||
type,
|
||||
amount,
|
||||
balanceAfter,
|
||||
referenceType,
|
||||
referenceId
|
||||
)
|
||||
VALUES (
|
||||
p_bankAccountId,
|
||||
'WITHDRAWAL',
|
||||
p_amount,
|
||||
currentBalance,
|
||||
'PURCHASE_PAYMENT',
|
||||
p_id
|
||||
);
|
||||
ELSE
|
||||
SET currentBalance = currentBalance + p_amount;
|
||||
INSERT INTO Bank_Account_Transactions (
|
||||
bankAccountId,
|
||||
type,
|
||||
amount,
|
||||
balanceAfter,
|
||||
referenceType,
|
||||
referenceId
|
||||
)
|
||||
VALUES (
|
||||
p_bankAccountId,
|
||||
'DEPOSIT',
|
||||
p_amount,
|
||||
currentBalance,
|
||||
'PURCHASE_REFUND',
|
||||
p_id
|
||||
);
|
||||
END IF;
|
||||
|
||||
UPDATE Bank_Account_Balance
|
||||
SET balance = currentBalance
|
||||
WHERE bankAccountId = p_bankAccountId;
|
||||
COMMIT;
|
||||
END //
|
||||
|
||||
-- Procedure for trg_pr_payment_after_insert
|
||||
CREATE PROCEDURE update_supplier_ledger(IN p_receiptId INT, IN p_type VARCHAR(20), IN p_amount DECIMAL(15,2), IN p_id INT)
|
||||
BEGIN
|
||||
START TRANSACTION;
|
||||
DECLARE receiptTotal DECIMAL(14,2) DEFAULT 0;
|
||||
DECLARE newPaid DECIMAL(14,2) DEFAULT 0;
|
||||
DECLARE _supplierId INT;
|
||||
DECLARE lastBalance DECIMAL(14,2) DEFAULT 0;
|
||||
|
||||
-- Lock receipt row
|
||||
SELECT COALESCE(totalAmount, 0), COALESCE(paidAmount, 0), supplierId
|
||||
INTO receiptTotal, newPaid, _supplierId
|
||||
FROM Purchase_Receipts
|
||||
WHERE id = p_receiptId
|
||||
FOR UPDATE;
|
||||
|
||||
-- Apply payment or refund
|
||||
IF p_type = 'PAYMENT' THEN
|
||||
SET newPaid = newPaid + p_amount;
|
||||
ELSE
|
||||
SET newPaid = newPaid - p_amount;
|
||||
END IF;
|
||||
|
||||
-- Update receipt
|
||||
UPDATE Purchase_Receipts
|
||||
SET
|
||||
paidAmount = newPaid,
|
||||
status =
|
||||
CASE
|
||||
WHEN newPaid = 0 THEN 'UNPAID'
|
||||
WHEN newPaid < receiptTotal THEN 'PARTIALLY_PAID'
|
||||
ELSE 'PAID'
|
||||
END
|
||||
WHERE id = p_receiptId;
|
||||
|
||||
-- Get last supplier balance
|
||||
SELECT IFNULL(balance, 0)
|
||||
INTO lastBalance
|
||||
FROM Supplier_Ledger
|
||||
WHERE supplierId = _supplierId
|
||||
ORDER BY id DESC
|
||||
LIMIT 1;
|
||||
|
||||
-- Insert supplier ledger
|
||||
INSERT INTO Supplier_Ledger
|
||||
(
|
||||
supplierId,
|
||||
debit,
|
||||
credit,
|
||||
balance,
|
||||
sourceType,
|
||||
sourceId,
|
||||
createdAt
|
||||
)
|
||||
VALUES
|
||||
(
|
||||
_supplierId,
|
||||
IF(p_type = 'REFUND', p_amount, 0),
|
||||
IF(p_type = 'PAYMENT', p_amount, 0),
|
||||
lastBalance
|
||||
+ IF(p_type = 'PAYMENT', p_amount, 0)
|
||||
- IF(p_type = 'REFUND', p_amount, 0),
|
||||
'PAYMENT',
|
||||
p_id,
|
||||
NOW()
|
||||
);
|
||||
COMMIT;
|
||||
END //
|
||||
|
||||
-- Procedure for trg_pr_payment_after_delete
|
||||
CREATE PROCEDURE update_receipt_on_payment_delete(IN p_receiptId INT, IN p_type VARCHAR(20), IN p_amount DECIMAL(15,2))
|
||||
BEGIN
|
||||
DECLARE receiptTotal DECIMAL(14,2);
|
||||
DECLARE newPaid DECIMAL(14,2);
|
||||
|
||||
SELECT totalAmount, paidAmount
|
||||
INTO receiptTotal, newPaid
|
||||
FROM Purchase_Receipts
|
||||
WHERE id = p_receiptId
|
||||
FOR UPDATE;
|
||||
|
||||
IF p_type = 'PAYMENT' THEN
|
||||
SET newPaid = newPaid - p_amount;
|
||||
ELSE
|
||||
SET newPaid = newPaid + p_amount;
|
||||
END IF;
|
||||
|
||||
UPDATE Purchase_Receipts
|
||||
SET
|
||||
paidAmount = newPaid,
|
||||
status =
|
||||
CASE
|
||||
WHEN newPaid = 0 THEN 'UNPAID'
|
||||
WHEN newPaid < receiptTotal THEN 'PARTIALLY_PAID'
|
||||
ELSE 'PAID'
|
||||
END
|
||||
WHERE id = p_receiptId;
|
||||
END //
|
||||
|
||||
-- Procedure for trg_purchase_receipt_after_insert
|
||||
CREATE PROCEDURE insert_supplier_ledger_purchase(IN p_supplierId INT, IN p_totalAmount DECIMAL(15,2), IN p_id INT)
|
||||
BEGIN
|
||||
DECLARE lastBalance DECIMAL(14,2) DEFAULT 0;
|
||||
|
||||
SELECT COALESCE(balance, 0)
|
||||
INTO lastBalance
|
||||
FROM Supplier_Ledger
|
||||
WHERE supplierId = p_supplierId
|
||||
ORDER BY id DESC
|
||||
LIMIT 1;
|
||||
|
||||
INSERT INTO Supplier_Ledger
|
||||
(
|
||||
supplierId,
|
||||
debit,
|
||||
credit,
|
||||
balance,
|
||||
sourceType,
|
||||
sourceId,
|
||||
createdAt
|
||||
)
|
||||
VALUES
|
||||
(
|
||||
p_supplierId,
|
||||
p_totalAmount,
|
||||
0,
|
||||
lastBalance - p_totalAmount,
|
||||
'PURCHASE',
|
||||
p_id,
|
||||
NOW()
|
||||
);
|
||||
END //
|
||||
|
||||
-- Procedure for trg_sales_invoice_items_before_insert
|
||||
CREATE PROCEDURE validate_stock_before_sale(IN p_invoiceId INT, IN p_productId INT, IN p_count DECIMAL(10,2))
|
||||
BEGIN
|
||||
DECLARE current_stock DECIMAL(10, 2);
|
||||
DECLARE inventory_id INT;
|
||||
|
||||
SELECT pa.inventoryId INTO inventory_id
|
||||
FROM Pos_Accounts pa
|
||||
INNER JOIN Sales_Invoices si ON pa.id = si.posAccountId
|
||||
WHERE si.id = p_invoiceId;
|
||||
|
||||
SELECT COALESCE(quantity, 0) INTO current_stock
|
||||
FROM Stock_Balance sb
|
||||
WHERE productId = p_productId AND sb.inventoryId = inventory_id
|
||||
LIMIT 1;
|
||||
|
||||
IF p_count > current_stock THEN
|
||||
SIGNAL SQLSTATE '45000'
|
||||
SET MESSAGE_TEXT = 'موجودی کالا در انبار کافی نیست.';
|
||||
END IF;
|
||||
END //
|
||||
|
||||
-- Procedure for trg_sales_invoice_items_after_insert
|
||||
CREATE PROCEDURE process_sale_item(IN p_invoiceId INT, IN p_productId INT, IN p_count DECIMAL(10,2), IN p_unitPrice DECIMAL(15,2), IN p_totalAmount DECIMAL(15,2))
|
||||
BEGIN
|
||||
DECLARE current_stock DECIMAL(10, 2);
|
||||
DECLARE inventory_id INT;
|
||||
DECLARE customer_id INT;
|
||||
DECLARE pos_id INT;
|
||||
|
||||
SELECT posAccountId, customerId INTO pos_id, customer_id
|
||||
FROM Sales_Invoices si
|
||||
WHERE si.id = p_invoiceId
|
||||
LIMIT 1;
|
||||
|
||||
SELECT pa.inventoryId INTO inventory_id
|
||||
FROM Pos_Accounts pa
|
||||
INNER JOIN Sales_Invoices si ON pa.id = si.posAccountId
|
||||
WHERE si.id = p_invoiceId;
|
||||
|
||||
SELECT COALESCE(quantity, 0) INTO current_stock
|
||||
FROM Stock_Balance sb
|
||||
WHERE productId = p_productId AND sb.inventoryId = inventory_id
|
||||
LIMIT 1;
|
||||
|
||||
INSERT INTO Stock_Movements (
|
||||
type,
|
||||
quantity,
|
||||
unitPrice,
|
||||
totalCost,
|
||||
referenceType,
|
||||
referenceId,
|
||||
productId,
|
||||
inventoryId,
|
||||
avgCost,
|
||||
remainedInStock,
|
||||
customerId,
|
||||
createdAt
|
||||
)
|
||||
VALUES (
|
||||
'OUT',
|
||||
p_count,
|
||||
p_unitPrice,
|
||||
p_totalAmount,
|
||||
'SALES',
|
||||
p_invoiceId,
|
||||
p_productId,
|
||||
inventory_id,
|
||||
CASE
|
||||
WHEN p_count = 0 THEN 0
|
||||
ELSE p_totalAmount / p_count
|
||||
END,
|
||||
current_stock - p_count,
|
||||
customer_id,
|
||||
NOW()
|
||||
);
|
||||
END //
|
||||
|
||||
-- Procedure for trg_sales_invoice_payment_after_insert
|
||||
CREATE PROCEDURE process_sale_payment(IN p_invoiceId INT, IN p_amount DECIMAL(15,2), IN p_id INT)
|
||||
BEGIN
|
||||
DECLARE currentBalance DECIMAL(15,2);
|
||||
DECLARE bankAccountId INT;
|
||||
|
||||
SELECT pa.bankAccountId INTO bankAccountId
|
||||
FROM Pos_Accounts pa
|
||||
INNER JOIN Sales_Invoices si ON pa.id = si.posAccountId
|
||||
WHERE si.id = p_invoiceId;
|
||||
|
||||
SELECT balance INTO currentBalance
|
||||
FROM Bank_Account_Balance
|
||||
WHERE bankAccountId = bankAccountId
|
||||
FOR UPDATE;
|
||||
|
||||
IF currentBalance IS NULL THEN
|
||||
SET currentBalance = 0;
|
||||
INSERT INTO Bank_Account_Balance (bankAccountId, balance, updatedAt)
|
||||
VALUES (bankAccountId, 0, NOW());
|
||||
END IF;
|
||||
|
||||
SET currentBalance = currentBalance + p_amount;
|
||||
|
||||
INSERT INTO Bank_Account_Transactions
|
||||
(bankAccountId, type, amount, balanceAfter, referenceType, referenceId)
|
||||
VALUES
|
||||
(bankAccountId, 'DEPOSIT', p_amount, currentBalance, 'POS_SALE', p_id);
|
||||
|
||||
UPDATE Bank_Account_Balance
|
||||
SET balance = currentBalance
|
||||
WHERE bankAccountId = bankAccountId;
|
||||
END //
|
||||
|
||||
-- Procedure for trg_pos_account_payment_after_insert
|
||||
CREATE PROCEDURE process_pos_payment(IN p_invoiceId INT, IN p_paymentMethod VARCHAR(20), IN p_amount DECIMAL(15,2), IN p_id INT)
|
||||
BEGIN
|
||||
DECLARE _bankAccountId INT;
|
||||
|
||||
IF(p_paymentMethod != 'CASH') THEN
|
||||
SELECT cashBankAccountId INTO _bankAccountId
|
||||
FROM Pos_Accounts pa
|
||||
INNER JOIN Sales_Invoices si ON pa.id = si.posAccountId
|
||||
WHERE si.id = p_invoiceId;
|
||||
END IF;
|
||||
|
||||
INSERT INTO Bank_Account_Transactions (
|
||||
bankAccountId,
|
||||
type,
|
||||
amount,
|
||||
balanceAfter,
|
||||
referenceType,
|
||||
referenceId
|
||||
)
|
||||
VALUES(
|
||||
_bankAccountId,
|
||||
'DEPOSIT',
|
||||
p_amount,
|
||||
0,
|
||||
'POS_SALE',
|
||||
p_id
|
||||
);
|
||||
END //
|
||||
|
||||
-- Procedure for trg_stock_transfer
|
||||
CREATE PROCEDURE update_stock_balance_transfer(IN p_productId INT, IN p_inventoryId INT, IN p_quantity DECIMAL(10,2), IN p_unitPrice DECIMAL(15,2), IN p_totalCost DECIMAL(15,2), IN p_type VARCHAR(10))
|
||||
BEGIN
|
||||
IF p_type = 'IN' THEN
|
||||
INSERT INTO Stock_Balance (
|
||||
productId,
|
||||
inventoryId,
|
||||
quantity,
|
||||
totalCost,
|
||||
avgCost,
|
||||
updatedAt
|
||||
)
|
||||
VALUES (
|
||||
p_productId,
|
||||
p_inventoryId,
|
||||
p_quantity,
|
||||
p_totalCost,
|
||||
CASE
|
||||
WHEN p_quantity = 0 THEN 0
|
||||
ELSE p_totalCost / p_quantity
|
||||
END,
|
||||
NOW()
|
||||
)
|
||||
ON DUPLICATE KEY UPDATE
|
||||
quantity = quantity + p_quantity,
|
||||
totalCost = totalCost + p_totalCost,
|
||||
avgCost = CASE
|
||||
WHEN (quantity + p_quantity) = 0 THEN 0
|
||||
ELSE (totalCost + p_totalCost) / (quantity + p_quantity)
|
||||
END,
|
||||
updatedAt = NOW();
|
||||
END IF;
|
||||
|
||||
IF p_type = 'OUT' THEN
|
||||
IF EXISTS (
|
||||
SELECT 1
|
||||
FROM Stock_Balance sb
|
||||
WHERE sb.productId = p_productId AND sb.inventoryId = p_inventoryId
|
||||
) THEN
|
||||
UPDATE Stock_Balance sb
|
||||
SET
|
||||
sb.quantity = sb.quantity - p_quantity,
|
||||
sb.totalCost = sb.totalCost - (sb.avgCost * p_quantity),
|
||||
sb.updatedAt = NOW()
|
||||
WHERE
|
||||
sb.productId = p_productId
|
||||
AND sb.inventoryId = p_inventoryId;
|
||||
ELSE
|
||||
INSERT INTO Stock_Balance (
|
||||
productId,
|
||||
inventoryId,
|
||||
quantity,
|
||||
totalCost,
|
||||
avgCost,
|
||||
updatedAt
|
||||
)
|
||||
VALUES (
|
||||
p_productId,
|
||||
p_inventoryId,
|
||||
- p_quantity,
|
||||
- COALESCE(p_unitPrice, 0) * p_quantity,
|
||||
COALESCE(p_unitPrice, 0),
|
||||
NOW()
|
||||
);
|
||||
END IF;
|
||||
END IF;
|
||||
END //
|
||||
|
||||
-- Procedure for trg_stock_purchase_insert
|
||||
CREATE PROCEDURE update_stock_balance_purchase(IN p_productId INT, IN p_quantity DECIMAL(10,2), IN p_unitPrice DECIMAL(15,2), IN p_totalCost DECIMAL(15,2), IN p_inventoryId INT)
|
||||
BEGIN
|
||||
INSERT INTO Stock_Balance (
|
||||
productId,
|
||||
quantity,
|
||||
avgCost,
|
||||
totalCost,
|
||||
inventoryId,
|
||||
updatedAt
|
||||
)
|
||||
VALUES (
|
||||
p_productId,
|
||||
p_quantity,
|
||||
p_unitPrice,
|
||||
p_totalCost,
|
||||
p_inventoryId,
|
||||
NOW()
|
||||
)
|
||||
ON DUPLICATE KEY UPDATE
|
||||
quantity = quantity + p_quantity,
|
||||
totalCost = totalCost + p_totalCost,
|
||||
avgCost = totalCost / quantity;
|
||||
END //
|
||||
|
||||
-- Procedure for trg_stock_sale_insert
|
||||
CREATE PROCEDURE update_stock_balance_sale(IN p_productId INT, IN p_quantity DECIMAL(10,2), IN p_unitPrice DECIMAL(15,2), IN p_totalCost DECIMAL(15,2), IN p_inventoryId INT)
|
||||
BEGIN
|
||||
INSERT INTO Stock_Balance (
|
||||
productId,
|
||||
quantity,
|
||||
avgCost,
|
||||
totalCost,
|
||||
inventoryId,
|
||||
updatedAt
|
||||
)
|
||||
VALUES (
|
||||
p_productId,
|
||||
p_quantity,
|
||||
p_unitPrice,
|
||||
p_totalCost,
|
||||
p_inventoryId,
|
||||
NOW()
|
||||
)
|
||||
ON DUPLICATE KEY UPDATE
|
||||
quantity = quantity - p_quantity,
|
||||
totalCost = totalCost - p_totalCost,
|
||||
avgCost = totalCost / quantity;
|
||||
END //
|
||||
|
||||
DELIMITER;
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,66 +1,65 @@
|
||||
#!/usr/bin/env ts-node
|
||||
import * as fs from 'fs'
|
||||
import * as path from 'path'
|
||||
import { prisma } from '../src/lib/prisma'
|
||||
// #!/usr/bin/env ts-node
|
||||
// import * as fs from 'fs'
|
||||
// import * as path from 'path'
|
||||
|
||||
function findModules(dir: string): string[] {
|
||||
const results: string[] = []
|
||||
const entries = fs.readdirSync(dir, { withFileTypes: true })
|
||||
for (const e of entries) {
|
||||
const full = path.join(dir, e.name)
|
||||
if (e.isDirectory()) {
|
||||
results.push(...findModules(full))
|
||||
} else if (e.isFile() && e.name.endsWith('.module.ts')) {
|
||||
results.push(full)
|
||||
}
|
||||
}
|
||||
return results
|
||||
}
|
||||
|
||||
function moduleNameFromFile(filePath: string) {
|
||||
const name = path.basename(filePath).replace('.module.ts', '')
|
||||
return name.replace(/-module$|\.module$/i, '')
|
||||
}
|
||||
|
||||
function makePermissionsFor(moduleName: string) {
|
||||
const base = moduleName.replace(/\W+/g, '_').toLowerCase()
|
||||
return [`${base}:create`, `${base}:read`, `${base}:update`, `${base}:delete`]
|
||||
}
|
||||
|
||||
async function main() {
|
||||
// const srcDir = path.resolve(__dirname, '..', 'src')
|
||||
// const moduleFiles = findModules(srcDir)
|
||||
// const modules = moduleFiles.map(moduleNameFromFile)
|
||||
|
||||
// const permsMap: Record<string, boolean> = {}
|
||||
// for (const m of modules) {
|
||||
// for (const p of makePermissionsFor(m)) permsMap[p] = false
|
||||
// function findModules(dir: string): string[] {
|
||||
// const results: string[] = []
|
||||
// const entries = fs.readdirSync(dir, { withFileTypes: true })
|
||||
// for (const e of entries) {
|
||||
// const full = path.join(dir, e.name)
|
||||
// if (e.isDirectory()) {
|
||||
// results.push(...findModules(full))
|
||||
// } else if (e.isFile() && e.name.endsWith('.module.ts')) {
|
||||
// results.push(full)
|
||||
// }
|
||||
// }
|
||||
// return results
|
||||
// }
|
||||
|
||||
// // Upsert roles: ensure admin has full permissions, others get entries added
|
||||
// const roles = await prisma.role.findMany()
|
||||
// for (const r of roles) {
|
||||
// const current: Record<string, any> = (r.permissions as any) || {}
|
||||
// const merged = { ...permsMap, ...current }
|
||||
|
||||
// // If role name is admin (case-insensitive), set all permissions to true
|
||||
// if (r.name && r.name.toLowerCase() === 'admin') {
|
||||
// for (const key of Object.keys(merged)) merged[key] = true
|
||||
// } else {
|
||||
// // keep existing truthy values, otherwise false
|
||||
// for (const key of Object.keys(merged)) merged[key] = merged[key] || false
|
||||
// function moduleNameFromFile(filePath: string) {
|
||||
// const name = path.basename(filePath).replace('.module.ts', '')
|
||||
// return name.replace(/-module$|\.module$/i, '')
|
||||
// }
|
||||
|
||||
// await prisma.role.update({ where: { id: r.id }, data: { permissions: merged } })
|
||||
// console.log(
|
||||
// `Updated role ${r.name} (id=${r.id}) with ${Object.keys(merged).length} permissions`,
|
||||
// )
|
||||
// function makePermissionsFor(moduleName: string) {
|
||||
// const base = moduleName.replace(/\W+/g, '_').toLowerCase()
|
||||
// return [`${base}:create`, `${base}:read`, `${base}:update`, `${base}:delete`]
|
||||
// }
|
||||
|
||||
await prisma.$disconnect()
|
||||
}
|
||||
// async function main() {
|
||||
// // const srcDir = path.resolve(__dirname, '..', 'src')
|
||||
// // const moduleFiles = findModules(srcDir)
|
||||
// // const modules = moduleFiles.map(moduleNameFromFile)
|
||||
|
||||
main().catch(e => {
|
||||
console.error(e)
|
||||
process.exit(1)
|
||||
})
|
||||
// // const permsMap: Record<string, boolean> = {}
|
||||
// // for (const m of modules) {
|
||||
// // for (const p of makePermissionsFor(m)) permsMap[p] = false
|
||||
// // }
|
||||
|
||||
// // // Upsert roles: ensure admin has full permissions, others get entries added
|
||||
// // const roles = await prisma.role.findMany()
|
||||
// // for (const r of roles) {
|
||||
// // const current: Record<string, any> = (r.permissions as any) || {}
|
||||
// // const merged = { ...permsMap, ...current }
|
||||
|
||||
// // // If role name is admin (case-insensitive), set all permissions to true
|
||||
// // if (r.name && r.name.toLowerCase() === 'admin') {
|
||||
// // for (const key of Object.keys(merged)) merged[key] = true
|
||||
// // } else {
|
||||
// // // keep existing truthy values, otherwise false
|
||||
// // for (const key of Object.keys(merged)) merged[key] = merged[key] || false
|
||||
// // }
|
||||
|
||||
// // await prisma.role.update({ where: { id: r.id }, data: { permissions: merged } })
|
||||
// // console.log(
|
||||
// // `Updated role ${r.name} (id=${r.id}) with ${Object.keys(merged).length} permissions`,
|
||||
// // )
|
||||
// // }
|
||||
|
||||
// await prisma.$disconnect()
|
||||
// }
|
||||
|
||||
// main().catch(e => {
|
||||
// console.error(e)
|
||||
// process.exit(1)
|
||||
// })
|
||||
|
||||
+121
-122
@@ -1,144 +1,143 @@
|
||||
import fs from 'node:fs'
|
||||
import path from 'node:path'
|
||||
import { prisma } from '../src/lib/prisma'
|
||||
// import fs from 'node:fs'
|
||||
// import path from 'node:path'
|
||||
|
||||
type CsvRow = {
|
||||
ID?: string
|
||||
DescriptionOfID?: string
|
||||
Vat?: string
|
||||
Type?: string
|
||||
}
|
||||
// type CsvRow = {
|
||||
// ID?: string
|
||||
// DescriptionOfID?: string
|
||||
// Vat?: string
|
||||
// Type?: string
|
||||
// }
|
||||
|
||||
function parseCsvLine(line: string): string[] {
|
||||
const result: string[] = []
|
||||
let current = ''
|
||||
let inQuotes = false
|
||||
// function parseCsvLine(line: string): string[] {
|
||||
// const result: string[] = []
|
||||
// let current = ''
|
||||
// let inQuotes = false
|
||||
|
||||
for (let index = 0; index < line.length; index++) {
|
||||
const char = line[index]
|
||||
// for (let index = 0; index < line.length; index++) {
|
||||
// const char = line[index]
|
||||
|
||||
if (char === '"') {
|
||||
if (inQuotes && line[index + 1] === '"') {
|
||||
current += '"'
|
||||
index++
|
||||
} else {
|
||||
inQuotes = !inQuotes
|
||||
}
|
||||
continue
|
||||
}
|
||||
// if (char === '"') {
|
||||
// if (inQuotes && line[index + 1] === '"') {
|
||||
// current += '"'
|
||||
// index++
|
||||
// } else {
|
||||
// inQuotes = !inQuotes
|
||||
// }
|
||||
// continue
|
||||
// }
|
||||
|
||||
if (char === ',' && !inQuotes) {
|
||||
result.push(current)
|
||||
current = ''
|
||||
continue
|
||||
}
|
||||
// if (char === ',' && !inQuotes) {
|
||||
// result.push(current)
|
||||
// current = ''
|
||||
// continue
|
||||
// }
|
||||
|
||||
current += char
|
||||
}
|
||||
// current += char
|
||||
// }
|
||||
|
||||
result.push(current)
|
||||
return result.map(value => value.trim())
|
||||
}
|
||||
// result.push(current)
|
||||
// return result.map(value => value.trim())
|
||||
// }
|
||||
|
||||
function parseCsv(content: string): CsvRow[] {
|
||||
const lines = content
|
||||
.split(/\r?\n/)
|
||||
.map(line => line.trim())
|
||||
.filter(Boolean)
|
||||
// function parseCsv(content: string): CsvRow[] {
|
||||
// const lines = content
|
||||
// .split(/\r?\n/)
|
||||
// .map(line => line.trim())
|
||||
// .filter(Boolean)
|
||||
|
||||
if (!lines.length) return []
|
||||
// if (!lines.length) return []
|
||||
|
||||
const headers = parseCsvLine(lines[0])
|
||||
return lines.slice(1).map(line => {
|
||||
const cols = parseCsvLine(line)
|
||||
const row: Record<string, string> = {}
|
||||
for (let index = 0; index < headers.length; index++) {
|
||||
row[headers[index]] = cols[index] || ''
|
||||
}
|
||||
return row
|
||||
})
|
||||
}
|
||||
// const headers = parseCsvLine(lines[0])
|
||||
// return lines.slice(1).map(line => {
|
||||
// const cols = parseCsvLine(line)
|
||||
// const row: Record<string, string> = {}
|
||||
// for (let index = 0; index < headers.length; index++) {
|
||||
// row[headers[index]] = cols[index] || ''
|
||||
// }
|
||||
// return row
|
||||
// })
|
||||
// }
|
||||
|
||||
function toBooleanFlags(typeValue: string) {
|
||||
const normalized = typeValue || ''
|
||||
const isPublic = normalized.includes('شناسه عمومی')
|
||||
const isImported = normalized.includes('وارداتی')
|
||||
const isDomestic = !isImported
|
||||
// function toBooleanFlags(typeValue: string) {
|
||||
// const normalized = typeValue || ''
|
||||
// const isPublic = normalized.includes('شناسه عمومی')
|
||||
// const isImported = normalized.includes('وارداتی')
|
||||
// const isDomestic = !isImported
|
||||
|
||||
return { isPublic, isDomestic }
|
||||
}
|
||||
// return { isPublic, isDomestic }
|
||||
// }
|
||||
|
||||
function parseVat(vatValue: string) {
|
||||
const parsed = Number(vatValue || '0')
|
||||
if (!Number.isFinite(parsed)) return 0
|
||||
return parsed
|
||||
}
|
||||
// function parseVat(vatValue: string) {
|
||||
// const parsed = Number(vatValue || '0')
|
||||
// if (!Number.isFinite(parsed)) return 0
|
||||
// return parsed
|
||||
// }
|
||||
|
||||
async function main() {
|
||||
const defaultPath =
|
||||
'/Users/ahasani/Desktop/product_good_2026-05-01T11-35-57_part_1_28812448-0dd9-411c-99e1-334c28d781fe.csv'
|
||||
const csvPath = process.argv[2] || defaultPath
|
||||
const absolutePath = path.resolve(csvPath)
|
||||
// async function main() {
|
||||
// const defaultPath =
|
||||
// '/Users/ahasani/Desktop/product_good_2026-05-01T11-35-57_part_1_28812448-0dd9-411c-99e1-334c28d781fe.csv'
|
||||
// const csvPath = process.argv[2] || defaultPath
|
||||
// const absolutePath = path.resolve(csvPath)
|
||||
|
||||
if (!fs.existsSync(absolutePath)) {
|
||||
throw new Error(`CSV file not found: ${absolutePath}`)
|
||||
}
|
||||
// if (!fs.existsSync(absolutePath)) {
|
||||
// throw new Error(`CSV file not found: ${absolutePath}`)
|
||||
// }
|
||||
|
||||
const raw = fs.readFileSync(absolutePath, 'utf8').replace(/^\uFEFF/, '')
|
||||
const rows = parseCsv(raw)
|
||||
// const raw = fs.readFileSync(absolutePath, 'utf8').replace(/^\uFEFF/, '')
|
||||
// const rows = parseCsv(raw)
|
||||
|
||||
let upserted = 0
|
||||
let skipped = 0
|
||||
// let upserted = 0
|
||||
// let skipped = 0
|
||||
|
||||
const guild = await prisma.guild.findFirst({})
|
||||
// const guild = await prisma.guild.findFirst({})
|
||||
|
||||
for (const row of rows) {
|
||||
const code = (row.ID || '').trim()
|
||||
const name = (row.DescriptionOfID || '').trim()
|
||||
const vat = parseVat((row.Vat || '').trim())
|
||||
const type = (row.Type || '').trim()
|
||||
const { isPublic, isDomestic } = toBooleanFlags(type)
|
||||
// for (const row of rows) {
|
||||
// const code = (row.ID || '').trim()
|
||||
// const name = (row.DescriptionOfID || '').trim()
|
||||
// const vat = parseVat((row.Vat || '').trim())
|
||||
// const type = (row.Type || '').trim()
|
||||
// const { isPublic, isDomestic } = toBooleanFlags(type)
|
||||
|
||||
if (!code || !name) {
|
||||
skipped++
|
||||
continue
|
||||
}
|
||||
// if (!code || !name) {
|
||||
// skipped++
|
||||
// continue
|
||||
// }
|
||||
|
||||
await prisma.stockKeepingUnits.upsert({
|
||||
where: { code },
|
||||
create: {
|
||||
code,
|
||||
name,
|
||||
VAT: vat,
|
||||
guild: {
|
||||
connect: {
|
||||
id: guild?.id,
|
||||
},
|
||||
},
|
||||
is_public: isPublic,
|
||||
is_domestic: isDomestic,
|
||||
},
|
||||
update: {
|
||||
name,
|
||||
VAT: vat,
|
||||
guild: {
|
||||
connect: {
|
||||
id: guild?.id,
|
||||
},
|
||||
},
|
||||
is_public: isPublic,
|
||||
is_domestic: isDomestic,
|
||||
},
|
||||
})
|
||||
upserted++
|
||||
}
|
||||
}
|
||||
// await prisma.stockKeepingUnits.upsert({
|
||||
// where: { code },
|
||||
// create: {
|
||||
// code,
|
||||
// name,
|
||||
// VAT: vat,
|
||||
// guild: {
|
||||
// connect: {
|
||||
// id: guild?.id,
|
||||
// },
|
||||
// },
|
||||
// is_public: isPublic,
|
||||
// is_domestic: isDomestic,
|
||||
// },
|
||||
// update: {
|
||||
// name,
|
||||
// VAT: vat,
|
||||
// guild: {
|
||||
// connect: {
|
||||
// id: guild?.id,
|
||||
// },
|
||||
// },
|
||||
// is_public: isPublic,
|
||||
// is_domestic: isDomestic,
|
||||
// },
|
||||
// })
|
||||
// upserted++
|
||||
// }
|
||||
// }
|
||||
|
||||
main()
|
||||
.catch(error => {
|
||||
console.error(error)
|
||||
process.exit(1)
|
||||
})
|
||||
.finally(async () => {
|
||||
await prisma.$disconnect()
|
||||
})
|
||||
// main()
|
||||
// .catch(error => {
|
||||
// console.error(error)
|
||||
// process.exit(1)
|
||||
// })
|
||||
// .finally(async () => {
|
||||
// await prisma.$disconnect()
|
||||
// })
|
||||
|
||||
+4
-4
@@ -7,16 +7,17 @@ import { AuthModule } from './modules/auth/auth.module'
|
||||
import { CatalogModule } from './modules/catalog/catalog.module'
|
||||
import { ConsumerModule } from './modules/consumer/consumer.module'
|
||||
import { EnumsModule } from './modules/enums/enums.module'
|
||||
import { PublicInvoicesModule } from './modules/invoices/invoices.module'
|
||||
import { PartnerModule } from './modules/partners/partners.module'
|
||||
import { PosModule } from './modules/pos/pos.module'
|
||||
import { SalesInvoicePaymentsModule } from './modules/pos/sales-invoices/sales-invoice-payments/sales-invoice-payments.module'
|
||||
import { TriggerLogsModule } from './modules/trigger-logs/trigger-logs.module'
|
||||
import { UploaderModule } from './modules/uploader/uploader.module'
|
||||
import { PrismaModule } from './prisma/prisma.module'
|
||||
import { RedisModule } from './redis/redis.module'
|
||||
|
||||
@Module({
|
||||
imports: [
|
||||
PrismaModule,
|
||||
RedisModule,
|
||||
EnumsModule,
|
||||
AdminModule,
|
||||
AuthModule,
|
||||
@@ -24,8 +25,7 @@ import { PrismaModule } from './prisma/prisma.module'
|
||||
ConsumerModule,
|
||||
PosModule,
|
||||
PartnerModule,
|
||||
SalesInvoicePaymentsModule,
|
||||
TriggerLogsModule,
|
||||
PublicInvoicesModule,
|
||||
UploaderModule,
|
||||
ApplicationModule,
|
||||
],
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
import { TspProviderResponseStatus } from '@/generated/prisma/enums'
|
||||
import {
|
||||
InvoiceSettlementType,
|
||||
TspProviderRequestType,
|
||||
TspProviderResponseStatus,
|
||||
} from '@/generated/prisma/enums'
|
||||
|
||||
export default {
|
||||
PaymentMethodType: {
|
||||
@@ -137,16 +141,23 @@ export default {
|
||||
SUN: 'سان',
|
||||
},
|
||||
TspProviderResponseStatus: {
|
||||
SUCCESS: 'موفق',
|
||||
FAILURE: 'ناموفق',
|
||||
NOT_SEND: 'ارسال نشده',
|
||||
[TspProviderResponseStatus.SUCCESS]: 'تایید شده',
|
||||
[TspProviderResponseStatus.FAILURE]: 'ناموفق',
|
||||
[TspProviderResponseStatus.NOT_SEND]: 'ارسال نشده',
|
||||
[TspProviderResponseStatus.QUEUED]: 'در صف ارسال',
|
||||
[TspProviderResponseStatus.FISCAL_QUEUED]: 'در انتظار تایید سازمان',
|
||||
[TspProviderResponseStatus.SEND_FAILURE]: 'خطا در ارسال',
|
||||
},
|
||||
InvoiceSettlementType: {
|
||||
[InvoiceSettlementType.CASH]: 'نقدی',
|
||||
[InvoiceSettlementType.CREDIT]: 'نسیه',
|
||||
[InvoiceSettlementType.MIXED]: 'نقدی / نسیه',
|
||||
},
|
||||
TspProviderRequestType: {
|
||||
ORIGINAL: 'اصلی',
|
||||
CORRECTION: 'اصلاح',
|
||||
REVOKE: 'ابطال',
|
||||
REMOVE: 'حذف',
|
||||
[TspProviderRequestType.ORIGINAL]: 'اصلی',
|
||||
[TspProviderRequestType.CORRECTION]: 'اصلاح',
|
||||
[TspProviderRequestType.REVOKE]: 'ابطال',
|
||||
[TspProviderRequestType.RETURN]: 'برگشت از فروش',
|
||||
},
|
||||
TspProviderCustomerType: {
|
||||
Unknown: 'ناشناس',
|
||||
|
||||
@@ -11,9 +11,11 @@ export enum TspProviderRequestType {
|
||||
REMOVE = 'REMOVE',
|
||||
}
|
||||
|
||||
export enum SKUGuildType {
|
||||
GOLD = 'GOLD',
|
||||
}
|
||||
export const SKUGuildType = {
|
||||
GOLD: 'GOLD',
|
||||
} as const
|
||||
|
||||
export type SKUGuildType = (typeof SKUGuildType)[keyof typeof SKUGuildType]
|
||||
|
||||
export const UploadedFileTypes = {
|
||||
GOOD: 'GOOD',
|
||||
|
||||
@@ -52,85 +52,5 @@ export class PosGuard {
|
||||
}
|
||||
|
||||
return true
|
||||
// const pos = await this.prisma.pos.findUnique({
|
||||
// where: {
|
||||
// id: posId,
|
||||
// account_id: tokenPayload.account_id,
|
||||
// },
|
||||
// select: {
|
||||
// complex: {
|
||||
// select: {
|
||||
// id: true,
|
||||
// business_activity: {
|
||||
// select: {
|
||||
// id: true,
|
||||
// license_activation: {
|
||||
// select: {
|
||||
// expires_at: true,
|
||||
// },
|
||||
// },
|
||||
// },
|
||||
// },
|
||||
// },
|
||||
// },
|
||||
// },
|
||||
// })
|
||||
|
||||
// if (!pos) {
|
||||
// throw new ForbiddenException('شما دسترسی لازم را ندارید.')
|
||||
// }
|
||||
|
||||
// if (req.method !== 'GET') {
|
||||
// if (!pos.complex.business_activity.license_activation) {
|
||||
// throw new ForbiddenException('برای کاربر شما لایسنس ایجاد نشده است.')
|
||||
// }
|
||||
// if (
|
||||
// pos.complex.business_activity.license_activation.expires_at &&
|
||||
// new Date().getTime() >
|
||||
// new Date(pos.complex.business_activity.license_activation.expires_at).getTime()
|
||||
// ) {
|
||||
// throw new ForbiddenException('لایسنس شما منقضی شده است.')
|
||||
// }
|
||||
// }
|
||||
|
||||
// const foundedAccount = await this.prisma.consumerAccount.findUnique({
|
||||
// where: {
|
||||
// id: tokenPayload.account_id,
|
||||
// },
|
||||
// select: {
|
||||
// role: true,
|
||||
// },
|
||||
// })
|
||||
|
||||
// if (foundedAccount?.role === 'OWNER') {
|
||||
// return true
|
||||
// }
|
||||
|
||||
// const accountPermissions = await this.prisma.permissionConsumer.findUnique({
|
||||
// where: {
|
||||
// consumer_account_id: tokenPayload.account_id,
|
||||
// },
|
||||
// select: {
|
||||
// pos_permissions: true,
|
||||
// business_permissions: true,
|
||||
// complex_permissions: true,
|
||||
// },
|
||||
// })
|
||||
|
||||
// if (accountPermissions?.pos_permissions.some(p => p.pos_id === posId)) {
|
||||
// return true
|
||||
// }
|
||||
// if (
|
||||
// accountPermissions?.complex_permissions.some(p => p.complex_id === pos.complex.id)
|
||||
// ) {
|
||||
// return true
|
||||
// }
|
||||
// if (
|
||||
// accountPermissions?.business_permissions.some(
|
||||
// p => p.business_id === pos.complex.business_activity.id,
|
||||
// )
|
||||
// ) {
|
||||
// return true
|
||||
// }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -95,7 +95,7 @@ export class ResponseMappingInterceptor implements NestInterceptor {
|
||||
meta = {
|
||||
totalRecords: total,
|
||||
totalPages: Math.max(1, Math.ceil(total / perPage)),
|
||||
page,
|
||||
page: parseInt(page),
|
||||
perPage,
|
||||
}
|
||||
break
|
||||
@@ -188,7 +188,7 @@ export class ResponseMappingInterceptor implements NestInterceptor {
|
||||
meta = {
|
||||
totalRecords: total,
|
||||
totalPages: Math.max(1, Math.ceil(total / perPage)),
|
||||
page,
|
||||
page: parseInt(page),
|
||||
perPage,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,9 +24,10 @@ export const summarySelect: BusinessActivitySelect = {
|
||||
select: {
|
||||
activation: {
|
||||
select: {
|
||||
_count: {
|
||||
account_allocations: {
|
||||
select: {
|
||||
account_allocations: true,
|
||||
id: true,
|
||||
account_id: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -44,13 +45,18 @@ export const select: BusinessActivitySelect = {
|
||||
export const mappedData = (businessActivity: any) => {
|
||||
const { license_activation, ...rest } = businessActivity
|
||||
const { license, ...license_activation_rest } = license_activation
|
||||
const { _count } = license.activation
|
||||
const { account_allocations } = license.activation
|
||||
|
||||
console.log('license_activation', license_activation)
|
||||
|
||||
return {
|
||||
...rest,
|
||||
license_info: {
|
||||
...license_activation_rest,
|
||||
accounts_limit: _count.account_allocations,
|
||||
accounts_limit: account_allocations.length,
|
||||
allocated_account_count: account_allocations.filter(
|
||||
allocation => allocation.account_id,
|
||||
).length,
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,6 +11,10 @@ export const summarySelect: SalesInvoiceSelect = {
|
||||
type: true,
|
||||
notes: true,
|
||||
created_at: true,
|
||||
settlement_type: true,
|
||||
unknown_customer: true,
|
||||
last_attempt_no: true,
|
||||
last_tsp_status: true,
|
||||
customer: {
|
||||
select: {
|
||||
type: true,
|
||||
@@ -20,6 +24,8 @@ export const summarySelect: SalesInvoiceSelect = {
|
||||
last_name: true,
|
||||
mobile_number: true,
|
||||
national_id: true,
|
||||
economic_code: true,
|
||||
postal_code: true,
|
||||
},
|
||||
},
|
||||
legal: {
|
||||
@@ -27,33 +33,32 @@ export const summarySelect: SalesInvoiceSelect = {
|
||||
name: true,
|
||||
economic_code: true,
|
||||
registration_number: true,
|
||||
postal_code: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
tsp_attempts: {
|
||||
orderBy: {
|
||||
created_at: 'desc',
|
||||
},
|
||||
take: 1,
|
||||
select: {
|
||||
status: true,
|
||||
sent_at: true,
|
||||
message: true,
|
||||
},
|
||||
},
|
||||
reference_invoice: {
|
||||
select: {
|
||||
id: true,
|
||||
invoice_number: true,
|
||||
},
|
||||
},
|
||||
referenced_by: {
|
||||
select: {
|
||||
id: true,
|
||||
invoice_number: true,
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
export const select: SalesInvoiceSelect = {
|
||||
...summarySelect,
|
||||
discount_amount: true,
|
||||
tax_amount: true,
|
||||
updated_at: true,
|
||||
unknown_customer: true,
|
||||
|
||||
pos: {
|
||||
select: {
|
||||
id: true,
|
||||
@@ -66,6 +71,12 @@ export const select: SalesInvoiceSelect = {
|
||||
select: {
|
||||
id: true,
|
||||
name: true,
|
||||
economic_code: true,
|
||||
guild: {
|
||||
select: {
|
||||
name: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -93,19 +104,12 @@ export const select: SalesInvoiceSelect = {
|
||||
measure_unit_text: true,
|
||||
sku_code: true,
|
||||
unit_price: true,
|
||||
discount: true,
|
||||
discount_amount: true,
|
||||
tax_amount: true,
|
||||
total_amount: true,
|
||||
notes: true,
|
||||
payload: true,
|
||||
good_snapshot: true,
|
||||
good: {
|
||||
select: {
|
||||
name: true,
|
||||
barcode: true,
|
||||
image_url: true,
|
||||
category: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
payments: {
|
||||
@@ -127,19 +131,4 @@ export const select: SalesInvoiceSelect = {
|
||||
},
|
||||
},
|
||||
},
|
||||
tsp_attempts: {
|
||||
orderBy: {
|
||||
created_at: 'desc',
|
||||
},
|
||||
select: {
|
||||
id: true,
|
||||
attempt_no: true,
|
||||
status: true,
|
||||
message: true,
|
||||
sent_at: true,
|
||||
received_at: true,
|
||||
created_at: true,
|
||||
},
|
||||
take: 1,
|
||||
},
|
||||
}
|
||||
|
||||
@@ -21,7 +21,7 @@ export class SharedSaleInvoiceAccessService {
|
||||
})
|
||||
|
||||
if (!consumer) {
|
||||
throw new BadRequestException('شما دسترسی لازم برای ارسال فاکتور را ندارید.')
|
||||
throw new BadRequestException('شما دسترسی لازم برای ارسال صورتحساب را ندارید.')
|
||||
}
|
||||
|
||||
return consumer.consumer_id
|
||||
|
||||
@@ -1,12 +1,25 @@
|
||||
import { SharedSaleInvoiceAccessService } from '@/common/services/saleInvoices/sale-invoice-access.service'
|
||||
import { Injectable } from '@nestjs/common'
|
||||
import {
|
||||
PosCorrectionSalesInvoiceDto,
|
||||
PosReturnSalesInvoiceDto,
|
||||
} from '@/modules/pos/sales-invoices/dto/create-sales-invoice.dto'
|
||||
import { SalesInvoiceTspService } from '@/modules/tspProviders/sales-invoice-tsp.service'
|
||||
import { PrismaService } from '@/prisma/prisma.service'
|
||||
import { BadRequestException, Injectable, NotFoundException } from '@nestjs/common'
|
||||
import {
|
||||
CustomerType,
|
||||
TspProviderRequestType,
|
||||
TspProviderResponseStatus,
|
||||
} from 'generated/prisma/enums'
|
||||
import { SharedSaleInvoiceCreateService } from './sale-invoice-create.service'
|
||||
|
||||
@Injectable()
|
||||
export class SharedSaleInvoiceActionsService {
|
||||
constructor(
|
||||
private prisma: PrismaService,
|
||||
private readonly salesInvoiceTspService: SalesInvoiceTspService,
|
||||
private readonly saleInvoiceAccessService: SharedSaleInvoiceAccessService,
|
||||
private sharedSaleInvoiceCreateService: SharedSaleInvoiceCreateService,
|
||||
) {}
|
||||
|
||||
async send(consumerAccountId: string, posId: string, invoiceId: string) {
|
||||
@@ -45,6 +58,478 @@ export class SharedSaleInvoiceActionsService {
|
||||
)
|
||||
}
|
||||
|
||||
async correction(
|
||||
data: PosCorrectionSalesInvoiceDto,
|
||||
consumerAccountId: string,
|
||||
posId: string,
|
||||
complexId: string,
|
||||
businessId: string,
|
||||
invoiceId: string,
|
||||
) {
|
||||
await this.saleInvoiceAccessService.getConsumerIdWithPosAccess(
|
||||
consumerAccountId,
|
||||
posId,
|
||||
)
|
||||
|
||||
const newInvoice = await this.prisma.$transaction(async tx => {
|
||||
const relatedInvoice = await tx.salesInvoice.findUnique({
|
||||
where: {
|
||||
id: invoiceId,
|
||||
pos_id: posId,
|
||||
},
|
||||
select: {
|
||||
id: true,
|
||||
invoice_date: true,
|
||||
settlement_type: true,
|
||||
customer_id: true,
|
||||
main_id: true,
|
||||
last_tsp_status: true,
|
||||
referenced_by: {
|
||||
select: {
|
||||
id: true,
|
||||
},
|
||||
},
|
||||
customer: {
|
||||
select: {
|
||||
type: true,
|
||||
},
|
||||
},
|
||||
total_amount: true,
|
||||
items: {
|
||||
select: {
|
||||
id: true,
|
||||
good_id: true,
|
||||
service_id: true,
|
||||
quantity: true,
|
||||
unit_price: true,
|
||||
total_amount: true,
|
||||
discount_amount: true,
|
||||
tax_amount: true,
|
||||
payload: true,
|
||||
notes: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
if (!relatedInvoice) {
|
||||
throw new NotFoundException('صورتحساب مورد نظر شما یافت نشد.')
|
||||
}
|
||||
|
||||
if (relatedInvoice.last_tsp_status !== TspProviderResponseStatus.SUCCESS) {
|
||||
throw new BadRequestException('امکان اصلاح این صورتحساب وجود ندارد.')
|
||||
}
|
||||
|
||||
if (relatedInvoice.referenced_by) {
|
||||
throw new BadRequestException(
|
||||
'این صورتحساب قبلا با یک صورتحساب دیگر جایگزین شده است.',
|
||||
)
|
||||
}
|
||||
|
||||
const normalizedInvoiceDate = this.normalizeInvoiceDate(data.invoice_date)
|
||||
const originalInvoiceDate = this.normalizeInvoiceDate(relatedInvoice.invoice_date)
|
||||
|
||||
const originalItemsByKey = new Map(
|
||||
relatedInvoice.items.map(item => [this.getItemKey(item), item]),
|
||||
)
|
||||
|
||||
const usedItemKeys = new Set<string>()
|
||||
const normalizedItems = data.items.map(item => {
|
||||
const itemKey = this.getItemKey(item)
|
||||
|
||||
if (!itemKey) {
|
||||
throw new BadRequestException('هر قلم باید شناسه کالا یا خدمت داشته باشد.')
|
||||
}
|
||||
|
||||
usedItemKeys.add(itemKey)
|
||||
|
||||
const originalItem = originalItemsByKey.get(itemKey)
|
||||
|
||||
if (!originalItem) {
|
||||
throw new BadRequestException(
|
||||
'فقط اقلام موجود در صورتحساب اصلی قابل اصلاح هستند.',
|
||||
)
|
||||
}
|
||||
|
||||
const originalQuantity = Number(originalItem.quantity)
|
||||
const requestedQuantity = Number(item.quantity)
|
||||
const originalUnitPrice = Number(originalItem.unit_price)
|
||||
const requestedUnitPrice = Number(item.unit_price)
|
||||
const originalTotalAmount = this.roundAmount(Number(originalItem.total_amount))
|
||||
const requestedTotalAmount = this.roundAmount(Number(item.total_amount))
|
||||
|
||||
if (requestedQuantity <= 0) {
|
||||
throw new BadRequestException(
|
||||
'تعداد/مقدار اقلام اصلاحی باید بیشتر از صفر باشد.',
|
||||
)
|
||||
}
|
||||
|
||||
// if (requestedUnitPrice < originalUnitPrice) {
|
||||
// throw new BadRequestException(
|
||||
// 'مبلغ واحد اقلام اصلاحی نمیتواند کمتر از صورتحساب اصلی باشد.',
|
||||
// )
|
||||
// }
|
||||
|
||||
return {
|
||||
invoice_id: originalItem.id,
|
||||
good_id: originalItem.good_id,
|
||||
service_id: originalItem.service_id || undefined,
|
||||
quantity: requestedQuantity,
|
||||
unit_price: requestedUnitPrice,
|
||||
total_amount: requestedTotalAmount,
|
||||
discount_amount: this.roundAmount(Number(item.discount_amount || 0)),
|
||||
tax_amount: this.roundAmount(Number(item.tax_amount || 0)),
|
||||
payload: item.payload ? JSON.parse(JSON.stringify(item.payload)) : undefined,
|
||||
notes: item.notes || undefined,
|
||||
}
|
||||
})
|
||||
|
||||
if (usedItemKeys.size !== relatedInvoice.items.length) {
|
||||
throw new BadRequestException(
|
||||
'فقط اقلام موجود در صورتحساب اصلی قابل اصلاح هستند.',
|
||||
)
|
||||
}
|
||||
|
||||
const hasChangedQuantity = normalizedItems.some(item => {
|
||||
const originalItem = relatedInvoice.items.find(
|
||||
relatedItem => this.getItemKey(relatedItem) === this.getItemKey(item),
|
||||
)
|
||||
|
||||
if (!originalItem) {
|
||||
return false
|
||||
}
|
||||
|
||||
return Number(originalItem.quantity) !== Number(item.quantity)
|
||||
})
|
||||
const hasChangedAmount = normalizedItems.some(item => {
|
||||
const originalItem = relatedInvoice.items.find(
|
||||
relatedItem => this.getItemKey(relatedItem) === this.getItemKey(item),
|
||||
)
|
||||
|
||||
if (!originalItem) {
|
||||
return false
|
||||
}
|
||||
|
||||
return (
|
||||
this.roundAmount(Number(originalItem.total_amount)) !==
|
||||
this.roundAmount(Number(item.total_amount))
|
||||
)
|
||||
})
|
||||
const hasChangedInvoiceDate = normalizedInvoiceDate !== originalInvoiceDate
|
||||
|
||||
if (!hasChangedQuantity && !hasChangedAmount && !hasChangedInvoiceDate) {
|
||||
throw new BadRequestException('مقداری تغییر نکرده است.')
|
||||
}
|
||||
|
||||
const requestedTotalAmount = this.roundAmount(Number(data.total_amount))
|
||||
const originalTotalAmount = this.roundAmount(Number(relatedInvoice.total_amount))
|
||||
const totalDiff = this.roundAmount(requestedTotalAmount - originalTotalAmount)
|
||||
const paymentsAmount = this.roundAmount(this.getPaymentsAmount(data.payments))
|
||||
|
||||
if (totalDiff > 0 && paymentsAmount !== totalDiff) {
|
||||
throw new BadRequestException(
|
||||
'جمع پرداختی باید برابر با اختلاف مبلغ صورتحساب اصلاحی و صورتحساب مرجع باشد.',
|
||||
)
|
||||
}
|
||||
|
||||
if (totalDiff === 0 && paymentsAmount !== 0) {
|
||||
throw new BadRequestException('در صورت عدم افزایش مبلغ، پرداختی نباید ثبت شود.')
|
||||
}
|
||||
|
||||
const newInvoice = await this.sharedSaleInvoiceCreateService.create({
|
||||
tx,
|
||||
data: {
|
||||
invoice_date: new Date(normalizedInvoiceDate),
|
||||
items: normalizedItems as any,
|
||||
total_amount: requestedTotalAmount,
|
||||
discount_amount: this.roundAmount(Number(data.discount_amount)),
|
||||
tax_amount: this.roundAmount(Number(data.tax_amount)),
|
||||
customer_id: relatedInvoice.customer_id || undefined,
|
||||
customer_type: relatedInvoice.customer?.type || CustomerType.UNKNOWN,
|
||||
settlement_type: relatedInvoice.settlement_type,
|
||||
payments: data.payments,
|
||||
} as any,
|
||||
businessId,
|
||||
complexId,
|
||||
posId,
|
||||
consumerAccountId,
|
||||
main_invoice_id: relatedInvoice.main_id || relatedInvoice.id,
|
||||
ref_invoice_id: relatedInvoice.id,
|
||||
type: TspProviderRequestType.CORRECTION,
|
||||
})
|
||||
|
||||
await tx.salesInvoice.update({
|
||||
where: {
|
||||
id: relatedInvoice.id,
|
||||
},
|
||||
data: {
|
||||
referenced_by: {
|
||||
connect: {
|
||||
id: newInvoice.id,
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
return newInvoice
|
||||
})
|
||||
|
||||
return this.salesInvoiceTspService.correctionSend(posId, newInvoice.id)
|
||||
}
|
||||
|
||||
async return(
|
||||
data: PosReturnSalesInvoiceDto,
|
||||
consumerAccountId: string,
|
||||
pos_id: string,
|
||||
complex_id: string,
|
||||
business_id: string,
|
||||
invoiceId: string,
|
||||
) {
|
||||
await this.saleInvoiceAccessService.getConsumerIdWithPosAccess(
|
||||
consumerAccountId,
|
||||
pos_id,
|
||||
)
|
||||
|
||||
const newInvoice = await this.prisma.$transaction(async tx => {
|
||||
const relatedInvoice = await tx.salesInvoice.findUnique({
|
||||
where: {
|
||||
id: invoiceId,
|
||||
pos_id,
|
||||
},
|
||||
select: {
|
||||
id: true,
|
||||
type: true,
|
||||
invoice_date: true,
|
||||
settlement_type: true,
|
||||
customer_id: true,
|
||||
main_id: true,
|
||||
last_tsp_status: true,
|
||||
referenced_by: {
|
||||
select: {
|
||||
id: true,
|
||||
},
|
||||
},
|
||||
customer: {
|
||||
select: {
|
||||
type: true,
|
||||
},
|
||||
},
|
||||
items: {
|
||||
select: {
|
||||
id: true,
|
||||
good_id: true,
|
||||
service_id: true,
|
||||
quantity: true,
|
||||
unit_price: true,
|
||||
total_amount: true,
|
||||
discount_amount: true,
|
||||
tax_amount: true,
|
||||
payload: true,
|
||||
notes: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
if (!relatedInvoice) {
|
||||
throw new NotFoundException('صورتحساب مورد نظر شما یافت نشد.')
|
||||
}
|
||||
|
||||
if (relatedInvoice.last_tsp_status !== TspProviderResponseStatus.SUCCESS) {
|
||||
throw new BadRequestException('امکان برگشت از خرید روی این صورتحساب وجود ندارد.')
|
||||
}
|
||||
|
||||
if (relatedInvoice.referenced_by) {
|
||||
throw new BadRequestException(
|
||||
'این صورتحساب قبلا با یک صورتحساب دیگر جایگزین شده است.',
|
||||
)
|
||||
}
|
||||
|
||||
const normalizedInvoiceDate = this.normalizeInvoiceDate(data.invoice_date)
|
||||
const originalInvoiceDate = this.normalizeInvoiceDate(relatedInvoice.invoice_date)
|
||||
|
||||
const originalItemsByKey = new Map(
|
||||
relatedInvoice.items.map(item => [this.getReturnItemKey(item), item]),
|
||||
)
|
||||
|
||||
const usedItemKeys = new Set<string>()
|
||||
const normalizedItems = data.items.map(item => {
|
||||
const itemKey = this.getReturnItemKey(item)
|
||||
|
||||
if (!itemKey) {
|
||||
throw new BadRequestException('هر قلم باید شناسه کالا یا خدمت داشته باشد.')
|
||||
}
|
||||
|
||||
// if (usedItemKeys.has(itemKey)) {
|
||||
// throw new BadRequestException('اقلام تکراری در صورتحساب بازگشتی مجاز نیستند.')
|
||||
// }
|
||||
|
||||
usedItemKeys.add(itemKey)
|
||||
|
||||
const originalItem = originalItemsByKey.get(itemKey)
|
||||
|
||||
if (!originalItem) {
|
||||
throw new BadRequestException(
|
||||
'فقط اقلام موجود در صورتحساب اصلی قابل بازگشت هستند.',
|
||||
)
|
||||
}
|
||||
|
||||
const originalQuantity = Number(originalItem.quantity)
|
||||
const requestedQuantity = Number(item.quantity)
|
||||
|
||||
if (requestedQuantity <= 0) {
|
||||
throw new BadRequestException(
|
||||
'تعداد/مقدار اقلام بازگشتی باید بیشتر از صفر باشد.',
|
||||
)
|
||||
}
|
||||
|
||||
if (requestedQuantity > originalQuantity) {
|
||||
throw new BadRequestException(
|
||||
'تعداد/مقدار اقلام بازگشتی نمیتواند از مقدار صورتحساب اصلی بیشتر باشد.',
|
||||
)
|
||||
}
|
||||
|
||||
const quantityRatio = requestedQuantity / originalQuantity
|
||||
|
||||
return {
|
||||
invoice_id: originalItem.id,
|
||||
good_id: originalItem.good_id,
|
||||
service_id: originalItem.service_id || undefined,
|
||||
quantity: requestedQuantity,
|
||||
unit_price: Number(originalItem.unit_price),
|
||||
total_amount: this.roundAmount(
|
||||
Number(originalItem.total_amount) * quantityRatio,
|
||||
),
|
||||
discount_amount: this.roundAmount(
|
||||
Number(originalItem.discount_amount || 0) * quantityRatio,
|
||||
),
|
||||
tax_amount: this.roundAmount(
|
||||
Number(originalItem.tax_amount || 0) * quantityRatio,
|
||||
),
|
||||
payload: originalItem.payload
|
||||
? JSON.parse(JSON.stringify(originalItem.payload))
|
||||
: undefined,
|
||||
notes: originalItem.notes || undefined,
|
||||
}
|
||||
})
|
||||
|
||||
if (!normalizedItems.length) {
|
||||
throw new BadRequestException(
|
||||
'حداقل یک قلم باید در صورتحساب بازگشتی باقی بماند.',
|
||||
)
|
||||
}
|
||||
|
||||
const hasRemovedItem = relatedInvoice.items.some(
|
||||
item => !usedItemKeys.has(this.getReturnItemKey(item)),
|
||||
)
|
||||
const hasChangedQuantity = normalizedItems.some(item => {
|
||||
const originalItem = relatedInvoice.items.find(
|
||||
relatedItem =>
|
||||
this.getReturnItemKey(relatedItem) === this.getReturnItemKey(item),
|
||||
)
|
||||
|
||||
if (!originalItem) {
|
||||
return false
|
||||
}
|
||||
|
||||
return Number(originalItem.quantity) !== Number(item.quantity)
|
||||
})
|
||||
const hasChangedInvoiceDate = normalizedInvoiceDate !== originalInvoiceDate
|
||||
|
||||
if (!hasRemovedItem && !hasChangedQuantity && !hasChangedInvoiceDate) {
|
||||
throw new BadRequestException('مقداری تغییر نکرده است.')
|
||||
}
|
||||
|
||||
const totalAmount = normalizedItems.reduce(
|
||||
(sum, item) => sum + Number(item.total_amount),
|
||||
0,
|
||||
)
|
||||
const discountAmount = normalizedItems.reduce(
|
||||
(sum, item) => sum + Number(item.discount_amount || 0),
|
||||
0,
|
||||
)
|
||||
const taxAmount = normalizedItems.reduce(
|
||||
(sum, item) => sum + Number(item.tax_amount || 0),
|
||||
0,
|
||||
)
|
||||
|
||||
const newInvoice = await this.sharedSaleInvoiceCreateService.create({
|
||||
tx,
|
||||
data: {
|
||||
invoice_date: new Date(normalizedInvoiceDate),
|
||||
items: normalizedItems as any,
|
||||
total_amount: totalAmount,
|
||||
discount_amount: discountAmount,
|
||||
tax_amount: taxAmount,
|
||||
customer_id: relatedInvoice.customer_id || undefined,
|
||||
customer_type: relatedInvoice.customer?.type || CustomerType.UNKNOWN,
|
||||
settlement_type: relatedInvoice.settlement_type,
|
||||
payments: undefined,
|
||||
} as any,
|
||||
businessId: business_id,
|
||||
complexId: complex_id,
|
||||
posId: pos_id,
|
||||
consumerAccountId,
|
||||
main_invoice_id: relatedInvoice.main_id || relatedInvoice.id,
|
||||
ref_invoice_id: relatedInvoice.id,
|
||||
type: TspProviderRequestType.RETURN,
|
||||
})
|
||||
|
||||
await tx.salesInvoice.update({
|
||||
where: {
|
||||
id: relatedInvoice.id,
|
||||
},
|
||||
data: {
|
||||
referenced_by: {
|
||||
connect: {
|
||||
id: newInvoice.id,
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
return newInvoice
|
||||
})
|
||||
|
||||
return this.salesInvoiceTspService.returnFromSaleSend(
|
||||
pos_id,
|
||||
business_id,
|
||||
newInvoice.id,
|
||||
)
|
||||
}
|
||||
|
||||
private normalizeInvoiceDate(invoiceDate: Date | string) {
|
||||
return new Date(invoiceDate).toISOString()
|
||||
}
|
||||
|
||||
private getItemKey(item: { good_id?: string | null; service_id?: string | null }) {
|
||||
return item.good_id || item.service_id || ''
|
||||
}
|
||||
|
||||
private getPaymentsAmount(payments?: {
|
||||
terminals?: { amount?: number }
|
||||
cash?: number
|
||||
set_off?: number
|
||||
card?: number
|
||||
bank?: number
|
||||
check?: number
|
||||
other?: number
|
||||
}) {
|
||||
return (
|
||||
Number(payments?.terminals?.amount || 0) +
|
||||
Number(payments?.cash || 0) +
|
||||
Number(payments?.set_off || 0) +
|
||||
Number(payments?.card || 0) +
|
||||
Number(payments?.bank || 0) +
|
||||
Number(payments?.check || 0) +
|
||||
Number(payments?.other || 0)
|
||||
)
|
||||
}
|
||||
|
||||
private roundAmount(amount: number) {
|
||||
return Number(amount.toFixed(2))
|
||||
}
|
||||
|
||||
async inquiry(consumerAccountId: string, posId: string, invoiceId: string) {
|
||||
const consumerId = await this.saleInvoiceAccessService.getConsumerIdWithPosAccess(
|
||||
consumerAccountId,
|
||||
@@ -52,4 +537,11 @@ export class SharedSaleInvoiceActionsService {
|
||||
)
|
||||
return this.salesInvoiceTspService.get(invoiceId, posId, consumerId)
|
||||
}
|
||||
|
||||
private getReturnItemKey(item: {
|
||||
good_id?: string | null
|
||||
service_id?: string | null
|
||||
}) {
|
||||
return item.good_id || item.service_id || ''
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { SaleInvoiceType } from '@/common/interfaces/sale-invoice-payload'
|
||||
import { ApiProperty } from '@nestjs/swagger'
|
||||
import { ApiProperty, OmitType } from '@nestjs/swagger'
|
||||
import { Type } from 'class-transformer'
|
||||
import {
|
||||
ArrayMinSize,
|
||||
@@ -15,7 +15,11 @@ import {
|
||||
Min,
|
||||
ValidateNested,
|
||||
} from 'class-validator'
|
||||
import type { CustomerIndividual, CustomerLegal } from 'generated/prisma/client'
|
||||
import {
|
||||
CustomerIndividual,
|
||||
CustomerLegal,
|
||||
InvoiceSettlementType,
|
||||
} from 'generated/prisma/client'
|
||||
import { CustomerType } from 'generated/prisma/enums'
|
||||
|
||||
export class SharedCreateSalesInvoiceItemDto {
|
||||
@@ -29,11 +33,15 @@ export class SharedCreateSalesInvoiceItemDto {
|
||||
|
||||
@IsNumber()
|
||||
@ApiProperty({ required: true })
|
||||
total_amount: number
|
||||
discount_amount: number
|
||||
|
||||
@IsNumber()
|
||||
@ApiProperty({ required: true })
|
||||
discount_amount: number
|
||||
tax_amount: number
|
||||
|
||||
@IsNumber()
|
||||
@ApiProperty({ required: true })
|
||||
total_amount: number
|
||||
|
||||
@IsString()
|
||||
@ApiProperty({ required: true })
|
||||
@@ -75,7 +83,7 @@ export class SharedCreateTerminalPayment {
|
||||
@IsString()
|
||||
@IsNotEmpty()
|
||||
@ApiProperty({ required: true })
|
||||
terminalId: string
|
||||
terminal_id: string
|
||||
|
||||
@IsString()
|
||||
@IsNotEmpty()
|
||||
@@ -158,6 +166,14 @@ export class SharedCreateSalesInvoiceDto {
|
||||
@ApiProperty({ required: true, default: 0 })
|
||||
total_amount: number
|
||||
|
||||
@IsNumber()
|
||||
@ApiProperty({ required: true, default: 0 })
|
||||
discount_amount: number
|
||||
|
||||
@IsNumber()
|
||||
@ApiProperty({ required: true, default: 0 })
|
||||
tax_amount: number
|
||||
|
||||
@ApiProperty({ required: true })
|
||||
@IsDateString(
|
||||
{ strict: true },
|
||||
@@ -165,6 +181,10 @@ export class SharedCreateSalesInvoiceDto {
|
||||
)
|
||||
invoice_date: Date
|
||||
|
||||
@ApiProperty({ required: true, enum: InvoiceSettlementType })
|
||||
@IsEnum(InvoiceSettlementType)
|
||||
settlement_type: InvoiceSettlementType
|
||||
|
||||
@ApiProperty({ required: true })
|
||||
@IsObject()
|
||||
@ValidateNested({ each: true })
|
||||
@@ -176,6 +196,11 @@ export class SharedCreateSalesInvoiceDto {
|
||||
@ValidateNested({ each: true })
|
||||
items: SharedCreateSalesInvoiceItemDto[]
|
||||
|
||||
@ApiProperty({ required: false })
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
ref_invoice_id?: string
|
||||
|
||||
@ApiProperty({ required: false })
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
@@ -207,3 +232,16 @@ export class SharedCreateSalesInvoiceDto {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export class SharedCorrectionSalesInvoiceDto extends OmitType(
|
||||
SharedCreateSalesInvoiceDto,
|
||||
['customer', 'customer_id', 'customer_type', 'settlement_type'],
|
||||
) {}
|
||||
|
||||
export class SharedReturnSalesInvoiceDto extends OmitType(SharedCreateSalesInvoiceDto, [
|
||||
'customer',
|
||||
'customer_id',
|
||||
'customer_type',
|
||||
'settlement_type',
|
||||
'payments',
|
||||
]) {}
|
||||
|
||||
@@ -23,6 +23,7 @@ interface TerminalPaymentInfo {
|
||||
interface NormalizedPayment {
|
||||
method: PaymentMethodType
|
||||
amount: number
|
||||
terminalInfo?: TerminalPaymentInfo
|
||||
}
|
||||
|
||||
interface CreateSharedSaleInvoiceInput {
|
||||
@@ -57,10 +58,10 @@ export class SharedSaleInvoiceCreateService {
|
||||
} = input
|
||||
|
||||
const normalizedInvoiceDate = this.normalizeInvoiceDate(data.invoice_date)
|
||||
const { payments, terminalInfo } = this.buildPaymentsData(
|
||||
data.payments,
|
||||
data.total_amount,
|
||||
)
|
||||
const payments =
|
||||
type === TspProviderRequestType.ORIGINAL || data.payments
|
||||
? this.buildPaymentsData(data.payments, data.total_amount)
|
||||
: []
|
||||
|
||||
for (let attempt = 1; attempt <= this.createInvoiceRetries; attempt++) {
|
||||
try {
|
||||
@@ -88,13 +89,14 @@ export class SharedSaleInvoiceCreateService {
|
||||
select: { ...QUERY_CONSTANTS.SALE_INVOICE.select },
|
||||
})
|
||||
|
||||
if (payments.length) {
|
||||
await this.createPayments(
|
||||
$tx,
|
||||
salesInvoice.id,
|
||||
payments,
|
||||
terminalInfo,
|
||||
normalizedInvoiceDate,
|
||||
)
|
||||
}
|
||||
|
||||
return salesInvoice
|
||||
})
|
||||
@@ -109,7 +111,7 @@ export class SharedSaleInvoiceCreateService {
|
||||
}
|
||||
}
|
||||
|
||||
throw new BadRequestException('ایجاد فاکتور با خطا مواجه شد.')
|
||||
throw new BadRequestException('ایجاد صورتحساب با خطا مواجه شد.')
|
||||
}
|
||||
|
||||
private isRetryableInvoiceConflict(error: unknown) {
|
||||
@@ -148,13 +150,7 @@ export class SharedSaleInvoiceCreateService {
|
||||
}
|
||||
|
||||
const rawPayments = (paymentsData || {}) as Record<string, unknown>
|
||||
const terminalInfo = rawPayments.terminals as TerminalPaymentInfo | undefined
|
||||
|
||||
console.log(
|
||||
'terminalInfo0',
|
||||
rawPayments.terminals?.[0]?.customer_card_no,
|
||||
terminalInfo,
|
||||
)
|
||||
const terminalPayments = rawPayments.terminals as TerminalPaymentInfo[] | undefined
|
||||
|
||||
const payments: NormalizedPayment[] = Object.entries(rawPayments)
|
||||
.filter(([key, value]) => key !== 'terminals' && value && Number(value) > 0)
|
||||
@@ -164,54 +160,31 @@ export class SharedSaleInvoiceCreateService {
|
||||
}))
|
||||
.filter(payment => payment.method && payment.amount > 0) as NormalizedPayment[]
|
||||
|
||||
const hasTerminalPayment = payments.some(
|
||||
payment => payment.method === PaymentMethodType.TERMINAL,
|
||||
)
|
||||
const nonTerminalTotal = payments
|
||||
.filter(payment => payment.method !== PaymentMethodType.TERMINAL)
|
||||
.reduce((sum, payment) => sum + payment.amount, 0)
|
||||
const hasTerminalPayment = terminalPayments && terminalPayments.length
|
||||
|
||||
if (!hasTerminalPayment && terminalInfo) {
|
||||
const terminalAmount =
|
||||
typeof terminalInfo.amount === 'number'
|
||||
? terminalInfo.amount
|
||||
: Math.max(0, Number(totalAmount) - nonTerminalTotal)
|
||||
|
||||
if (terminalAmount > 0) {
|
||||
if (hasTerminalPayment) {
|
||||
for (const terminal of terminalPayments) {
|
||||
payments.push({
|
||||
method: PaymentMethodType.TERMINAL,
|
||||
amount: terminalAmount,
|
||||
amount: terminal.amount,
|
||||
terminalInfo: terminal,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
this.validatePayments(payments, totalAmount, terminalInfo)
|
||||
//TODO: for correction i need to validate payments with diff of total amount and original invoice amount
|
||||
// this.validatePayments(payments, totalAmount)
|
||||
|
||||
return {
|
||||
payments,
|
||||
terminalInfo,
|
||||
}
|
||||
return payments
|
||||
}
|
||||
|
||||
private validatePayments(
|
||||
payments: NormalizedPayment[],
|
||||
totalAmount: number,
|
||||
terminalInfo?: TerminalPaymentInfo,
|
||||
) {
|
||||
private validatePayments(payments: NormalizedPayment[], totalAmount: number) {
|
||||
const totalPayments = payments.reduce((sum, payment) => sum + payment.amount, 0)
|
||||
const roundedTotalPayments = Number(totalPayments.toFixed(2))
|
||||
const roundedTotalAmount = Number(Number(totalAmount).toFixed(2))
|
||||
|
||||
if (roundedTotalPayments !== roundedTotalAmount) {
|
||||
throw new BadRequestException('مبلغ پرداختی باید برابر با مبلغ کل فاکتور باشد.')
|
||||
}
|
||||
|
||||
const terminalPayments = payments.filter(
|
||||
payment => payment.method === PaymentMethodType.TERMINAL,
|
||||
)
|
||||
|
||||
if (terminalPayments.length > 0 && !terminalInfo) {
|
||||
throw new BadRequestException('برای پرداخت ترمینال اطلاعات ترمینال الزامی است.')
|
||||
throw new BadRequestException('مبلغ پرداختی باید برابر با مبلغ کل صورتحساب باشد.')
|
||||
}
|
||||
}
|
||||
|
||||
@@ -220,25 +193,48 @@ export class SharedSaleInvoiceCreateService {
|
||||
data: SharedCreateSalesInvoiceDto,
|
||||
businessId: string,
|
||||
) {
|
||||
if (data.customer_id) {
|
||||
return data.customer_id
|
||||
const { customer_id, customer_type, customer } = data
|
||||
|
||||
if (customer_id) {
|
||||
return customer_id
|
||||
}
|
||||
|
||||
if (
|
||||
data.customer_type === CustomerType.INDIVIDUAL &&
|
||||
data.customer?.customer_individual
|
||||
) {
|
||||
const { national_id, mobile_number, ...rest } = data.customer.customer_individual
|
||||
if (customer_type === CustomerType.INDIVIDUAL && customer?.customer_individual) {
|
||||
const { national_id, postal_code, economic_code, ...rest } =
|
||||
customer.customer_individual
|
||||
|
||||
const customerIndividual = await tx.customerIndividual.upsert({
|
||||
const foundedCustomer = await tx.customerIndividual.findFirst({
|
||||
where: {
|
||||
business_activity_id_national_id: {
|
||||
business_activity_id: businessId,
|
||||
national_id: data.customer.customer_individual.national_id,
|
||||
OR: [
|
||||
{
|
||||
economic_code,
|
||||
},
|
||||
{
|
||||
postal_code,
|
||||
national_id,
|
||||
},
|
||||
create: {
|
||||
...data.customer.customer_individual,
|
||||
],
|
||||
},
|
||||
select: {
|
||||
customer_id: true,
|
||||
},
|
||||
})
|
||||
let customerIndividualId: string | undefined = foundedCustomer?.customer_id
|
||||
|
||||
if (foundedCustomer) {
|
||||
await tx.customerIndividual.update({
|
||||
where: {
|
||||
customer_id: foundedCustomer.customer_id,
|
||||
},
|
||||
data: {
|
||||
...customer.customer_individual,
|
||||
},
|
||||
})
|
||||
} else {
|
||||
const createdCustomer = await tx.customerIndividual.create({
|
||||
data: {
|
||||
...customer.customer_individual,
|
||||
customer: {
|
||||
create: {
|
||||
type: CustomerType.INDIVIDUAL,
|
||||
@@ -250,30 +246,50 @@ export class SharedSaleInvoiceCreateService {
|
||||
},
|
||||
},
|
||||
},
|
||||
update: { ...rest },
|
||||
})
|
||||
|
||||
customerIndividualId = createdCustomer.customer_id
|
||||
}
|
||||
|
||||
if (!customerIndividualId) {
|
||||
throw new BadRequestException('متاسفانه مشکلی در اطلاعات مشتری وجود دارد.')
|
||||
}
|
||||
|
||||
return customerIndividualId
|
||||
} else if (customer_type === CustomerType.LEGAL && customer?.customer_legal) {
|
||||
const { registration_number, economic_code, postal_code } = customer.customer_legal
|
||||
const foundedCustomer = await tx.customerLegal.findFirst({
|
||||
where: {
|
||||
business_activity_id: businessId,
|
||||
OR: [
|
||||
{
|
||||
economic_code,
|
||||
},
|
||||
{
|
||||
postal_code,
|
||||
registration_number,
|
||||
},
|
||||
],
|
||||
},
|
||||
select: {
|
||||
customer_id: true,
|
||||
},
|
||||
})
|
||||
let customerLegalId: string | undefined = foundedCustomer?.customer_id
|
||||
|
||||
if (!customerIndividual) {
|
||||
throw new BadRequestException('متاسفانه مشکلی در اطلاعات مشتری وجود دارد.')
|
||||
}
|
||||
|
||||
return customerIndividual.customer_id
|
||||
}
|
||||
|
||||
if (data.customer_type === CustomerType.LEGAL && data.customer?.customer_legal) {
|
||||
const { registration_number, ...rest } = data.customer.customer_legal
|
||||
const customerLegal = await tx.customerLegal.upsert({
|
||||
if (foundedCustomer) {
|
||||
await tx.customerLegal.update({
|
||||
where: {
|
||||
business_activity_id_economic_code: {
|
||||
business_activity_id: businessId,
|
||||
economic_code: data.customer.customer_legal.economic_code,
|
||||
customer_id: foundedCustomer.customer_id,
|
||||
},
|
||||
data: {
|
||||
...customer.customer_legal,
|
||||
},
|
||||
create: {
|
||||
...data.customer.customer_legal,
|
||||
})
|
||||
} else {
|
||||
const createdCustomer = await tx.customerLegal.create({
|
||||
data: {
|
||||
...customer.customer_legal,
|
||||
customer: {
|
||||
create: {
|
||||
type: CustomerType.LEGAL,
|
||||
@@ -285,19 +301,16 @@ export class SharedSaleInvoiceCreateService {
|
||||
},
|
||||
},
|
||||
},
|
||||
update: {
|
||||
...rest,
|
||||
},
|
||||
select: {
|
||||
customer_id: true,
|
||||
},
|
||||
})
|
||||
|
||||
if (!customerLegal) {
|
||||
customerLegalId = createdCustomer.customer_id
|
||||
}
|
||||
|
||||
if (!customerLegalId) {
|
||||
throw new BadRequestException('متاسفانه مشکلی در اطلاعات مشتری وجود دارد.')
|
||||
}
|
||||
|
||||
return customerLegal.customer_id
|
||||
return customerLegalId
|
||||
}
|
||||
|
||||
return null
|
||||
@@ -382,13 +395,21 @@ export class SharedSaleInvoiceCreateService {
|
||||
main_invoice_id,
|
||||
ref_invoice_id,
|
||||
} = params
|
||||
const { customer_id, customer_type, customer, payments, ...invoiceData } = data
|
||||
const {
|
||||
customer_id,
|
||||
customer_type,
|
||||
customer,
|
||||
payments,
|
||||
settlement_type,
|
||||
send_to_tsp,
|
||||
...invoiceData
|
||||
} = data
|
||||
|
||||
if (
|
||||
type !== TspProviderRequestType.ORIGINAL &&
|
||||
!(main_invoice_id || ref_invoice_id)
|
||||
) {
|
||||
throw new BadRequestException('متاسفانه مشکلی در اطلاعات فاکتور وجود دارد.')
|
||||
throw new BadRequestException('متاسفانه مشکلی در اطلاعات صورتحساب وجود دارد.')
|
||||
}
|
||||
|
||||
const salesInvoiceData: SalesInvoiceCreateInput = {
|
||||
@@ -396,8 +417,14 @@ export class SharedSaleInvoiceCreateService {
|
||||
invoice_date: normalizedInvoiceDate,
|
||||
invoice_number: invoiceNumber,
|
||||
total_amount: data.total_amount,
|
||||
discount_amount: data.items.reduce(
|
||||
(prev, curr) => (prev += curr.discount_amount),
|
||||
0,
|
||||
),
|
||||
tax_amount: data.items.reduce((prev, curr) => (prev += curr.tax_amount), 0),
|
||||
code: this.generateInvoiceCode(businessId, complexId, posId, invoiceNumber),
|
||||
type,
|
||||
settlement_type,
|
||||
items: {
|
||||
createMany: {
|
||||
data: data.items.map(item => ({
|
||||
@@ -405,17 +432,15 @@ export class SharedSaleInvoiceCreateService {
|
||||
quantity: item.quantity,
|
||||
unit_price: item.unit_price,
|
||||
total_amount: item.total_amount,
|
||||
discount_amount: item.discount_amount,
|
||||
tax_amount: item.tax_amount,
|
||||
measure_unit_text: goodsById.get(item.good_id!)?.measure_unit.name || null,
|
||||
measure_unit_code: goodsById.get(item.good_id!)?.measure_unit.code || null,
|
||||
sku_code: goodsById.get(item.good_id!)?.sku.code || null,
|
||||
sku_vat: goodsById.get(item.good_id!)?.sku.VAT || null,
|
||||
payload: item.payload ? JSON.parse(JSON.stringify(item.payload)) : undefined,
|
||||
good_snapshot: item.good_id
|
||||
? JSON.parse(
|
||||
JSON.stringify({
|
||||
good: goodsById.get(item.good_id) || null,
|
||||
}),
|
||||
)
|
||||
? JSON.parse(JSON.stringify(goodsById.get(item.good_id) || null))
|
||||
: undefined,
|
||||
})),
|
||||
},
|
||||
@@ -439,6 +464,8 @@ export class SharedSaleInvoiceCreateService {
|
||||
id: customerId,
|
||||
},
|
||||
}
|
||||
} else if (data.customer?.customer_unknown) {
|
||||
salesInvoiceData.unknown_customer = data.customer.customer_unknown
|
||||
}
|
||||
|
||||
if (type !== TspProviderRequestType.ORIGINAL) {
|
||||
@@ -453,7 +480,7 @@ export class SharedSaleInvoiceCreateService {
|
||||
return salesInvoiceData
|
||||
}
|
||||
|
||||
private async getNextInvoiceNumber(tx: Prisma.TransactionClient, businessId: string) {
|
||||
async getNextInvoiceNumber(tx: Prisma.TransactionClient, businessId: string) {
|
||||
const latestInvoice = await tx.salesInvoice.findFirst({
|
||||
where: {
|
||||
pos: {
|
||||
@@ -494,7 +521,6 @@ export class SharedSaleInvoiceCreateService {
|
||||
tx: Prisma.TransactionClient,
|
||||
invoiceId: string,
|
||||
payments: NormalizedPayment[],
|
||||
terminalInfo: TerminalPaymentInfo | undefined,
|
||||
paidAt: Date,
|
||||
) {
|
||||
for (const payment of payments) {
|
||||
@@ -510,16 +536,27 @@ export class SharedSaleInvoiceCreateService {
|
||||
},
|
||||
})
|
||||
|
||||
if (payment.method === PaymentMethodType.TERMINAL && terminalInfo) {
|
||||
if (payment.method === PaymentMethodType.TERMINAL && payment.terminalInfo) {
|
||||
const {
|
||||
terminal_id,
|
||||
stan,
|
||||
rrn,
|
||||
transaction_date_time,
|
||||
customer_card_no,
|
||||
description,
|
||||
} = payment.terminalInfo
|
||||
await tx.salesInvoicePaymentTerminalInfo.create({
|
||||
data: {
|
||||
payment_id: createdPayment.id,
|
||||
terminal_id: terminalInfo.terminal_id,
|
||||
stan: terminalInfo.stan,
|
||||
rrn: terminalInfo.rrn,
|
||||
transaction_date_time: new Date(terminalInfo.transaction_date_time || ''),
|
||||
customer_card_no: terminalInfo.customer_card_no || null,
|
||||
description: terminalInfo.description || null,
|
||||
terminal_id,
|
||||
stan: stan,
|
||||
rrn: rrn,
|
||||
transaction_date_time: transaction_date_time
|
||||
? new Date(transaction_date_time)
|
||||
: new Date(),
|
||||
customer_card_no: '1234567890123456',
|
||||
// customer_card_no: customer_card_no || null,
|
||||
description: description || null,
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
@@ -0,0 +1,90 @@
|
||||
import { ApiPropertyOptional } from '@nestjs/swagger'
|
||||
import { Type } from 'class-transformer'
|
||||
import {
|
||||
IsDateString,
|
||||
IsEnum,
|
||||
IsNumber,
|
||||
IsOptional,
|
||||
IsString,
|
||||
Min,
|
||||
} from 'class-validator'
|
||||
import { TspProviderResponseStatus } from 'generated/prisma/enums'
|
||||
|
||||
export class SharedSaleInvoicesFilterDto {
|
||||
@ApiPropertyOptional({ default: 1 })
|
||||
@IsOptional()
|
||||
@Type(() => Number)
|
||||
@IsNumber()
|
||||
@Min(1)
|
||||
page?: number
|
||||
|
||||
@ApiPropertyOptional({ default: 10 })
|
||||
@IsOptional()
|
||||
@Type(() => Number)
|
||||
@IsNumber()
|
||||
@Min(1)
|
||||
perPage?: number
|
||||
|
||||
@ApiPropertyOptional()
|
||||
@IsOptional()
|
||||
@IsDateString()
|
||||
invoice_date_from?: string
|
||||
|
||||
@ApiPropertyOptional()
|
||||
@IsOptional()
|
||||
@IsDateString()
|
||||
invoice_date_to?: string
|
||||
|
||||
@ApiPropertyOptional()
|
||||
@IsOptional()
|
||||
@IsDateString()
|
||||
created_at_from?: string
|
||||
|
||||
@ApiPropertyOptional()
|
||||
@IsOptional()
|
||||
@IsDateString()
|
||||
created_at_to?: string
|
||||
|
||||
@ApiPropertyOptional()
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
customer_name?: string
|
||||
|
||||
@ApiPropertyOptional()
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
customer_mobile?: string
|
||||
|
||||
@ApiPropertyOptional()
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
customer_national_id?: string
|
||||
|
||||
@ApiPropertyOptional()
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
customer_economic_code?: string
|
||||
|
||||
@ApiPropertyOptional({ enum: TspProviderResponseStatus })
|
||||
@IsOptional()
|
||||
@IsEnum(TspProviderResponseStatus)
|
||||
status?: TspProviderResponseStatus
|
||||
|
||||
@ApiPropertyOptional()
|
||||
@IsOptional()
|
||||
@Type(() => Number)
|
||||
@IsNumber()
|
||||
total_amount?: number
|
||||
|
||||
@ApiPropertyOptional()
|
||||
@IsOptional()
|
||||
@Type(() => Number)
|
||||
@IsNumber()
|
||||
total_amount_from?: number
|
||||
|
||||
@ApiPropertyOptional()
|
||||
@IsOptional()
|
||||
@Type(() => Number)
|
||||
@IsNumber()
|
||||
total_amount_to?: number
|
||||
}
|
||||
@@ -0,0 +1,137 @@
|
||||
import { TspProviderResponseStatus } from '@/generated/prisma/enums'
|
||||
import { SalesInvoiceWhereInput } from '@/generated/prisma/models'
|
||||
import { Injectable } from '@nestjs/common'
|
||||
import { SharedSaleInvoicesFilterDto } from './sale-invoice-filter.dto'
|
||||
|
||||
@Injectable()
|
||||
export class SharedSaleInvoiceFilterService {
|
||||
buildWhere(filter: SharedSaleInvoicesFilterDto): SalesInvoiceWhereInput {
|
||||
const where: SalesInvoiceWhereInput = {}
|
||||
|
||||
if (filter.invoice_date_from || filter.invoice_date_to) {
|
||||
where.invoice_date = {
|
||||
...(filter.invoice_date_from ? { gte: new Date(filter.invoice_date_from) } : {}),
|
||||
...(filter.invoice_date_to ? { lte: new Date(filter.invoice_date_to) } : {}),
|
||||
}
|
||||
}
|
||||
|
||||
if (filter.created_at_from || filter.created_at_to) {
|
||||
where.created_at = {
|
||||
...(filter.created_at_from ? { gte: new Date(filter.created_at_from) } : {}),
|
||||
...(filter.created_at_to ? { lte: new Date(filter.created_at_to) } : {}),
|
||||
}
|
||||
}
|
||||
|
||||
if (
|
||||
filter.total_amount !== undefined ||
|
||||
filter.total_amount_from !== undefined ||
|
||||
filter.total_amount_to !== undefined
|
||||
) {
|
||||
where.total_amount = {
|
||||
...(filter.total_amount !== undefined ? { equals: filter.total_amount } : {}),
|
||||
...(filter.total_amount_from !== undefined
|
||||
? { gte: filter.total_amount_from }
|
||||
: {}),
|
||||
...(filter.total_amount_to !== undefined ? { lte: filter.total_amount_to } : {}),
|
||||
}
|
||||
}
|
||||
|
||||
if (
|
||||
filter.customer_name?.trim() ||
|
||||
filter.customer_mobile?.trim() ||
|
||||
filter.customer_national_id?.trim() ||
|
||||
filter.customer_economic_code?.trim()
|
||||
) {
|
||||
where.customer = {
|
||||
is: {
|
||||
OR: [
|
||||
...(filter.customer_name?.trim()
|
||||
? [
|
||||
{
|
||||
individual: {
|
||||
is: {
|
||||
OR: [
|
||||
{ first_name: { contains: filter.customer_name.trim() } },
|
||||
{ last_name: { contains: filter.customer_name.trim() } },
|
||||
],
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
legal: {
|
||||
is: {
|
||||
name: {
|
||||
contains: filter.customer_name.trim(),
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
]
|
||||
: []),
|
||||
...(filter.customer_mobile?.trim()
|
||||
? [
|
||||
{
|
||||
individual: {
|
||||
is: {
|
||||
mobile_number: { contains: filter.customer_mobile.trim() },
|
||||
},
|
||||
},
|
||||
},
|
||||
]
|
||||
: []),
|
||||
...(filter.customer_national_id?.trim()
|
||||
? [
|
||||
{
|
||||
individual: {
|
||||
is: {
|
||||
national_id: { contains: filter.customer_national_id.trim() },
|
||||
},
|
||||
},
|
||||
},
|
||||
]
|
||||
: []),
|
||||
...(filter.customer_economic_code?.trim()
|
||||
? [
|
||||
{
|
||||
legal: {
|
||||
is: {
|
||||
OR: [
|
||||
{
|
||||
economic_code: {
|
||||
contains: filter.customer_economic_code.trim(),
|
||||
},
|
||||
},
|
||||
{
|
||||
registration_number: {
|
||||
contains: filter.customer_economic_code.trim(),
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
},
|
||||
]
|
||||
: []),
|
||||
],
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
if (filter.status) {
|
||||
if (filter.status === TspProviderResponseStatus.NOT_SEND) {
|
||||
where.OR = [
|
||||
{
|
||||
last_tsp_status: null,
|
||||
},
|
||||
{
|
||||
last_tsp_status: TspProviderResponseStatus.NOT_SEND,
|
||||
},
|
||||
]
|
||||
} else {
|
||||
where.last_tsp_status = filter.status
|
||||
}
|
||||
}
|
||||
|
||||
return where
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
import { Injectable } from '@nestjs/common'
|
||||
|
||||
@Injectable()
|
||||
export class SharedSaleInvoicePaginationService {
|
||||
normalize(
|
||||
page: number = 1,
|
||||
perPage: number = 10,
|
||||
defaultPerPage: number = 10,
|
||||
maxPerPage: number = 50,
|
||||
) {
|
||||
const normalizedPageValue = Number(page ?? 1)
|
||||
const normalizedPage = Number.isFinite(normalizedPageValue)
|
||||
? Math.max(1, Math.floor(normalizedPageValue))
|
||||
: 1
|
||||
|
||||
const requestedPerPageValue = Number(perPage ?? defaultPerPage)
|
||||
const requestedPerPage = Number.isFinite(requestedPerPageValue)
|
||||
? Math.max(1, Math.floor(requestedPerPageValue))
|
||||
: defaultPerPage
|
||||
const normalizedPerPage = Math.min(requestedPerPage, maxPerPage)
|
||||
|
||||
return {
|
||||
page: normalizedPage,
|
||||
perPage: normalizedPerPage,
|
||||
skip: (normalizedPage - 1) * normalizedPerPage,
|
||||
take: normalizedPerPage,
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,90 @@
|
||||
import dayjs, { Dayjs } from 'dayjs'
|
||||
import 'dayjs/locale/fa'
|
||||
import relativeTime from 'dayjs/plugin/relativeTime'
|
||||
import jalaliPlugin from 'jalaliday/dayjs'
|
||||
|
||||
dayjs.extend(jalaliPlugin)
|
||||
dayjs.extend(relativeTime)
|
||||
|
||||
export function toJalali(date: string | number | Date | Dayjs): Date {
|
||||
return dayjs(date).calendar('jalali').toDate()
|
||||
}
|
||||
|
||||
export function toGregorian(date: string | number | Date | Dayjs): Date {
|
||||
return dayjs(date).calendar('gregory').toDate()
|
||||
}
|
||||
|
||||
export function getCurrentJalaliSeasonStart(
|
||||
baseDate: string | number | Date | Dayjs = dayjs(),
|
||||
): Date {
|
||||
const date = dayjs(baseDate).calendar('jalali')
|
||||
const month = date.month() + 1
|
||||
const seasonStartMonth = Math.floor((month - 1) / 3) * 3 + 1
|
||||
return date
|
||||
.month(seasonStartMonth - 1)
|
||||
.startOf('month')
|
||||
.startOf('day')
|
||||
.toDate()
|
||||
}
|
||||
|
||||
export function getCurrentJalaliSeasonEnd(
|
||||
baseDate: string | number | Date | Dayjs = dayjs(),
|
||||
): Date {
|
||||
return dayjs(getCurrentJalaliSeasonStart(baseDate))
|
||||
.add(3, 'month')
|
||||
.endOf('month')
|
||||
.endOf('day')
|
||||
.toDate()
|
||||
}
|
||||
|
||||
export function getCurrentGregorianSeasonStart(
|
||||
baseDate: string | number | Date | Dayjs = dayjs(),
|
||||
): Date {
|
||||
const date = dayjs(baseDate).calendar('gregory')
|
||||
const month = date.month() + 1
|
||||
const seasonStartMonth = Math.floor((month - 1) / 3) * 3 + 1
|
||||
return date
|
||||
.month(seasonStartMonth - 1)
|
||||
.startOf('month')
|
||||
.startOf('day')
|
||||
.toDate()
|
||||
}
|
||||
|
||||
export function getCurrentGregorianSeasonEnd(
|
||||
baseDate: string | number | Date | Dayjs = dayjs(),
|
||||
): Date {
|
||||
return dayjs(getCurrentGregorianSeasonStart(baseDate))
|
||||
.add(2, 'month')
|
||||
.endOf('month')
|
||||
.endOf('day')
|
||||
.toDate()
|
||||
}
|
||||
|
||||
export function getCurrentJalaliSeasonRange(
|
||||
baseDate: string | number | Date | Dayjs = dayjs(),
|
||||
): { start: Date; end: Date } {
|
||||
return {
|
||||
start: getCurrentJalaliSeasonStart(baseDate),
|
||||
end: getCurrentJalaliSeasonEnd(baseDate),
|
||||
}
|
||||
}
|
||||
|
||||
export function getCurrentGregorianSeasonRange(
|
||||
baseDate: string | number | Date | Dayjs = dayjs(),
|
||||
): { start: Date; end: Date } {
|
||||
return {
|
||||
start: getCurrentGregorianSeasonStart(baseDate),
|
||||
end: getCurrentGregorianSeasonEnd(baseDate),
|
||||
}
|
||||
}
|
||||
|
||||
export default {
|
||||
toJalali,
|
||||
toGregorian,
|
||||
getCurrentJalaliSeasonStart,
|
||||
getCurrentJalaliSeasonEnd,
|
||||
getCurrentGregorianSeasonStart,
|
||||
getCurrentGregorianSeasonEnd,
|
||||
getCurrentJalaliSeasonRange,
|
||||
getCurrentGregorianSeasonRange,
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
import { Matches, MinLength } from 'class-validator'
|
||||
|
||||
const MIN_LENGTH = 6
|
||||
const REGEX = /^[a-zA-Z0-9]*$/
|
||||
|
||||
export const FiscalIdFieldValidator = () =>
|
||||
function (target: object, propertyKey: string) {
|
||||
MinLength(MIN_LENGTH, {
|
||||
message: `شناسه یکتا باید حداقل ${MIN_LENGTH} کاراکتر باشد`,
|
||||
})(target, propertyKey)
|
||||
Matches(REGEX, {
|
||||
message: 'شناسه یکتا فقط میتواند شامل حروف و اعداد باشد',
|
||||
})(target, propertyKey)
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
export { FiscalIdFieldValidator } from './fiscalId-validator'
|
||||
export { PasswordFieldValidator, PASSWORD_MIN_LENGTH } from './password'
|
||||
export { UsernameFieldValidator } from './username'
|
||||
@@ -0,0 +1,10 @@
|
||||
import { MinLength } from 'class-validator'
|
||||
|
||||
export const PASSWORD_MIN_LENGTH = 6
|
||||
|
||||
export const PasswordFieldValidator = () =>
|
||||
function (target: object, propertyKey: string) {
|
||||
MinLength(PASSWORD_MIN_LENGTH, {
|
||||
message: `رمز عبور باید حداقل ${PASSWORD_MIN_LENGTH} کاراکتر باشد`,
|
||||
})(target, propertyKey)
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
import { Matches, MinLength } from 'class-validator'
|
||||
|
||||
const USERNAME_REGEX = /^[a-zA-Z0-9_-]*$/
|
||||
const USERNAME_MIN_LENGTH = 6
|
||||
|
||||
export const UsernameFieldValidator = () =>
|
||||
function (target: object, propertyKey: string) {
|
||||
MinLength(USERNAME_MIN_LENGTH, {
|
||||
message: `نام کاربری باید حداقل ${USERNAME_MIN_LENGTH} کاراکتر باشد`,
|
||||
})(target, propertyKey)
|
||||
Matches(USERNAME_REGEX, {
|
||||
message: 'نام کاربری فقط میتواند شامل حروف، اعداد، زیرخط و خط تیره باشد',
|
||||
})(target, propertyKey)
|
||||
}
|
||||
@@ -1,6 +1,9 @@
|
||||
export * from './jwt-user.util'
|
||||
export * from './date-formatter.utils'
|
||||
export * from './enum-translator.util'
|
||||
export * from './field-validator.util'
|
||||
export * from './http-client.util'
|
||||
export * from './jwt-user.util'
|
||||
export * from './mappers/consumer_mappers.util'
|
||||
export * from './password.util'
|
||||
export * from './redisKeyMaker'
|
||||
export * from './tracking-code-generator.util'
|
||||
export * from './http-client.util'
|
||||
|
||||
@@ -18,13 +18,13 @@ export function checkAndDecodeJwtToken(
|
||||
token = authHeader.slice(7)
|
||||
}
|
||||
}
|
||||
if (!token) throw new UnauthorizedException('Missing accessToken cookie')
|
||||
if (!token) throw new UnauthorizedException('توکن احراز هویت ارسال نشده است')
|
||||
|
||||
try {
|
||||
const payload = jwtService.decode(token) as AccessTokenPayload
|
||||
|
||||
return payload as ITokenPayload
|
||||
} catch {
|
||||
return null
|
||||
throw new UnauthorizedException('توکن احراز هویت نامعتبر است')
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
export class ConsumerKeyMaker {
|
||||
static middleware(token: string): string {
|
||||
return `consumer:middleware:${token}`
|
||||
}
|
||||
|
||||
static consumerInfo(consumerId: string): string {
|
||||
return `consumers:${consumerId}:info`
|
||||
}
|
||||
|
||||
static consumerBusinessActivitiesList(consumerId: string): string {
|
||||
return `consumers:${consumerId}:business-activities:list`
|
||||
}
|
||||
|
||||
static consumerBusinessActivityInfo(
|
||||
consumerId: string,
|
||||
businessActivityId: string,
|
||||
): string {
|
||||
return `consumers:${consumerId}:business-activities:${businessActivityId}:info`
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
export class EnumKeyMaker {
|
||||
static enumsAll(buildVersion: string): string {
|
||||
return `enums:${buildVersion}:all`
|
||||
}
|
||||
|
||||
static enumsValues(buildVersion: string, enumName: string): string {
|
||||
return `enums:${buildVersion}:values:${enumName}`
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
export class GuildKeyMaker {
|
||||
static guildStockKeepingUnitsList(guildId: string): string {
|
||||
return `guilds:${guildId}:stock-keeping-units:list`
|
||||
}
|
||||
|
||||
static guildGoodsList(guildId: string): string {
|
||||
return `guilds:${guildId}:goods:list`
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
import { ConsumerKeyMaker } from './consumer'
|
||||
import { EnumKeyMaker } from './enum'
|
||||
import { GuildKeyMaker } from './guild'
|
||||
import { PartnerKeyMaker } from './partner'
|
||||
import { PosKeyMaker } from './pos'
|
||||
import { PublicSaleInvoiceKeyMaker } from './publicSaleInvoice'
|
||||
|
||||
// Keep backward-compatible static methods while separating key builders by domain.
|
||||
export class RedisKeyMaker extends PartnerKeyMaker {
|
||||
static consumer = ConsumerKeyMaker
|
||||
static enums = EnumKeyMaker
|
||||
static guild = GuildKeyMaker
|
||||
static partner = PartnerKeyMaker
|
||||
static pos = PosKeyMaker
|
||||
|
||||
static consumerInfo = ConsumerKeyMaker.consumerInfo
|
||||
static consumerMiddleware = ConsumerKeyMaker.middleware
|
||||
static consumerBusinessActivitiesList = ConsumerKeyMaker.consumerBusinessActivitiesList
|
||||
static consumerBusinessActivityInfo = ConsumerKeyMaker.consumerBusinessActivityInfo
|
||||
|
||||
static guildStockKeepingUnitsList = GuildKeyMaker.guildStockKeepingUnitsList
|
||||
static guildGoodsList = GuildKeyMaker.guildGoodsList
|
||||
|
||||
static posMiddleware = PosKeyMaker.middleware
|
||||
static partnerMiddleware = PartnerKeyMaker.middleware
|
||||
static posInfo = PosKeyMaker.info
|
||||
static posMe = PosKeyMaker.me
|
||||
static posGoodsList = PosKeyMaker.goodList
|
||||
|
||||
static enumsAll = EnumKeyMaker.enumsAll
|
||||
static enumsValues = EnumKeyMaker.enumsValues
|
||||
|
||||
static publicSaleInvoice = PublicSaleInvoiceKeyMaker.invoice
|
||||
}
|
||||
|
||||
export { ConsumerKeyMaker, EnumKeyMaker, GuildKeyMaker, PartnerKeyMaker, PosKeyMaker }
|
||||
@@ -0,0 +1,139 @@
|
||||
export class PartnerKeyMaker {
|
||||
static middleware(token): string {
|
||||
return `partner:middleware:${token}`
|
||||
}
|
||||
|
||||
static partnersList(): string {
|
||||
return 'partners:list'
|
||||
}
|
||||
|
||||
static partnerDetail(partnerId: string): string {
|
||||
return `partners:${partnerId}:detail`
|
||||
}
|
||||
|
||||
static partnerActivatedLicensesList(
|
||||
partnerId: string,
|
||||
page: number,
|
||||
perPage: number,
|
||||
): string {
|
||||
return `partners:${partnerId}:activated-licenses:list:${page}:${perPage}`
|
||||
}
|
||||
|
||||
static partnerActivatedLicensesListPattern(partnerId: string): string {
|
||||
return `partners:${partnerId}:activated-licenses:list:*`
|
||||
}
|
||||
|
||||
static partnerLicenseChargeTransactionsList(
|
||||
partnerId: string,
|
||||
page: number,
|
||||
perPage: number,
|
||||
): string {
|
||||
return `partners:${partnerId}:license-charge-transactions:list:${page}:${perPage}`
|
||||
}
|
||||
|
||||
static partnerLicenseChargeTransactionsListPattern(partnerId: string): string {
|
||||
return `partners:${partnerId}:license-charge-transactions:list:*`
|
||||
}
|
||||
|
||||
static partnerLicenseChargeTransactionDetail(
|
||||
partnerId: string,
|
||||
transactionId: string,
|
||||
): string {
|
||||
return `partners:${partnerId}:license-charge-transactions:${transactionId}:detail`
|
||||
}
|
||||
|
||||
static partnerLicenseChargeTransactionDetailPattern(partnerId: string): string {
|
||||
return `partners:${partnerId}:license-charge-transactions:*:detail`
|
||||
}
|
||||
|
||||
//////////////////// consumers ////////////////////
|
||||
|
||||
static partnerConsumersPattern(partnerId: string): string {
|
||||
return `partners:${partnerId}:consumers:*`
|
||||
}
|
||||
|
||||
static partnerConsumerPattern(partnerId: string): string {
|
||||
return this.partnerConsumersPattern(partnerId)
|
||||
}
|
||||
static partnerConsumersListPattern(partnerId: string): string {
|
||||
return `partners:${partnerId}:consumers:list:*`
|
||||
}
|
||||
|
||||
static partnerConsumersList(partnerId: string, page: number, perPage: number): string {
|
||||
return `partners:${partnerId}:consumers:list:${page}:${perPage}`
|
||||
}
|
||||
|
||||
static partnerConsumerInfo(partnerId: string, consumerId: string): string {
|
||||
return `partners:${partnerId}:consumers:${consumerId}:info`
|
||||
}
|
||||
|
||||
static partnerConsumerBusinessActivitiesList(
|
||||
partnerId: string,
|
||||
consumerId: string,
|
||||
page: number,
|
||||
perPage: number,
|
||||
): string {
|
||||
return `partners:${partnerId}:consumers:${consumerId}:business-activities:list:${page}:${perPage}`
|
||||
}
|
||||
|
||||
static partnerConsumerBusinessActivitiesPattern(
|
||||
partnerId: string,
|
||||
consumerId: string,
|
||||
): string {
|
||||
return `partners:${partnerId}:consumers:${consumerId}:business-activities:*`
|
||||
}
|
||||
|
||||
static partnerConsumerBusinessActivityInfo(
|
||||
partnerId: string,
|
||||
consumerId: string,
|
||||
businessActivityId: string,
|
||||
): string {
|
||||
return `partners:${partnerId}:consumers:${consumerId}:business-activities:${businessActivityId}:info`
|
||||
}
|
||||
|
||||
static partnerConsumerBusinessActivityComplexesList(
|
||||
partnerId: string,
|
||||
consumerId: string,
|
||||
businessActivityId: string,
|
||||
page: number,
|
||||
perPage: number,
|
||||
): string {
|
||||
return `partners:${partnerId}:consumers:${consumerId}:business-activities:${businessActivityId}:complexes:list:${page}:${perPage}`
|
||||
}
|
||||
|
||||
static partnerConsumerBusinessActivityComplexesPattern(
|
||||
partnerId: string,
|
||||
consumerId: string,
|
||||
businessActivityId: string,
|
||||
): string {
|
||||
return `partners:${partnerId}:consumers:${consumerId}:business-activities:${businessActivityId}:complexes:*`
|
||||
}
|
||||
|
||||
static partnerConsumerBusinessActivityComplexInfo(
|
||||
partnerId: string,
|
||||
consumerId: string,
|
||||
businessActivityId: string,
|
||||
complexId: string,
|
||||
): string {
|
||||
return `partners:${partnerId}:consumers:${consumerId}:business-activities:${businessActivityId}:complexes:${complexId}`
|
||||
}
|
||||
|
||||
static partnerConsumerBusinessActivityComplexPosesPattern(
|
||||
partnerId: string,
|
||||
consumerId: string,
|
||||
businessActivityId: string,
|
||||
complexId: string,
|
||||
): string {
|
||||
return `partners:${partnerId}:consumers:${consumerId}:business-activities:${businessActivityId}:complexes:${complexId}:poses:*`
|
||||
}
|
||||
|
||||
static partnerConsumerBusinessActivityComplexPosInfo(
|
||||
partnerId: string,
|
||||
consumerId: string,
|
||||
businessActivityId: string,
|
||||
complexId: string,
|
||||
posId: string,
|
||||
): string {
|
||||
return `partners:${partnerId}:consumers:${consumerId}:business-activities:${businessActivityId}:complexes:${complexId}:poses:${posId}`
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,67 @@
|
||||
export class PosKeyMaker {
|
||||
static middleware(token: string): string {
|
||||
return `pos:${token}:middleware`
|
||||
}
|
||||
|
||||
static info(posId: string): string {
|
||||
return `pos:${posId}:info`
|
||||
}
|
||||
|
||||
static me(accountId: string, posId: string): string {
|
||||
return `pos:${posId}:me:${accountId}`
|
||||
}
|
||||
|
||||
static goodList(guildId: string, businessActivityId: string): string {
|
||||
return `pos:goods:list:guildId:${guildId}:ba:${businessActivityId}`
|
||||
}
|
||||
|
||||
static goodListByGuildPattern(guildId: string): string {
|
||||
return `pos:goods:list:guildId:${guildId}:ba:*`
|
||||
}
|
||||
|
||||
static statisticInvoicesPattern(businessActivityId: string): string {
|
||||
return `pos:statistics:invoices:ba:${businessActivityId}:*`
|
||||
}
|
||||
static statisticInvoices(
|
||||
businessActivityId: string,
|
||||
posId: string,
|
||||
from: string,
|
||||
): string {
|
||||
return `pos:statistics:invoices:ba:${businessActivityId}:pos:${posId}:from:${from}:all`
|
||||
}
|
||||
static statisticInvoicesNotSent(
|
||||
businessActivityId: string,
|
||||
posId: string,
|
||||
from: string,
|
||||
): string {
|
||||
return `pos:statistics:invoices:ba:${businessActivityId}:pos:${posId}:from:${from}:not-sent`
|
||||
}
|
||||
static statisticInvoicesSuccess(
|
||||
businessActivityId: string,
|
||||
posId: string,
|
||||
from: string,
|
||||
): string {
|
||||
return `pos:statistics:invoices:ba:${businessActivityId}:pos:${posId}:from:${from}:success`
|
||||
}
|
||||
static statisticInvoicesFailure(
|
||||
businessActivityId: string,
|
||||
posId: string,
|
||||
from: string,
|
||||
): string {
|
||||
return `pos:statistics:invoices:ba:${businessActivityId}:pos:${posId}:from:${from}:failure`
|
||||
}
|
||||
static statisticInvoicesPending(
|
||||
businessActivityId: string,
|
||||
posId: string,
|
||||
from: string,
|
||||
): string {
|
||||
return `pos:statistics:invoices:ba:${businessActivityId}:pos:${posId}:from:${from}:pending`
|
||||
}
|
||||
static statisticInvoicesCredit(
|
||||
businessActivityId: string,
|
||||
posId: string,
|
||||
from: string,
|
||||
): string {
|
||||
return `pos:statistics:invoices:ba:${businessActivityId}:pos:${posId}:from:${from}:credit`
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
export class PublicSaleInvoiceKeyMaker {
|
||||
static invoice(id: string): string {
|
||||
return `publicSaleInvoices:${id}`
|
||||
}
|
||||
}
|
||||
@@ -167,6 +167,11 @@ export type Complex = Prisma.ComplexModel
|
||||
*
|
||||
*/
|
||||
export type Pos = Prisma.PosModel
|
||||
/**
|
||||
* Model ConsumerAccountGoodFavorite
|
||||
*
|
||||
*/
|
||||
export type ConsumerAccountGoodFavorite = Prisma.ConsumerAccountGoodFavoriteModel
|
||||
/**
|
||||
* Model Good
|
||||
*
|
||||
|
||||
@@ -189,6 +189,11 @@ export type Complex = Prisma.ComplexModel
|
||||
*
|
||||
*/
|
||||
export type Pos = Prisma.PosModel
|
||||
/**
|
||||
* Model ConsumerAccountGoodFavorite
|
||||
*
|
||||
*/
|
||||
export type ConsumerAccountGoodFavorite = Prisma.ConsumerAccountGoodFavoriteModel
|
||||
/**
|
||||
* Model Good
|
||||
*
|
||||
|
||||
@@ -623,6 +623,31 @@ export type EnumTspProviderRequestTypeFilter<$PrismaModel = never> = {
|
||||
not?: Prisma.NestedEnumTspProviderRequestTypeFilter<$PrismaModel> | $Enums.TspProviderRequestType
|
||||
}
|
||||
|
||||
export type EnumInvoiceSettlementTypeFilter<$PrismaModel = never> = {
|
||||
equals?: $Enums.InvoiceSettlementType | Prisma.EnumInvoiceSettlementTypeFieldRefInput<$PrismaModel>
|
||||
in?: $Enums.InvoiceSettlementType[]
|
||||
notIn?: $Enums.InvoiceSettlementType[]
|
||||
not?: Prisma.NestedEnumInvoiceSettlementTypeFilter<$PrismaModel> | $Enums.InvoiceSettlementType
|
||||
}
|
||||
|
||||
export type EnumTspProviderResponseStatusNullableFilter<$PrismaModel = never> = {
|
||||
equals?: $Enums.TspProviderResponseStatus | Prisma.EnumTspProviderResponseStatusFieldRefInput<$PrismaModel> | null
|
||||
in?: $Enums.TspProviderResponseStatus[] | null
|
||||
notIn?: $Enums.TspProviderResponseStatus[] | null
|
||||
not?: Prisma.NestedEnumTspProviderResponseStatusNullableFilter<$PrismaModel> | $Enums.TspProviderResponseStatus | null
|
||||
}
|
||||
|
||||
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 EnumTspProviderRequestTypeWithAggregatesFilter<$PrismaModel = never> = {
|
||||
equals?: $Enums.TspProviderRequestType | Prisma.EnumTspProviderRequestTypeFieldRefInput<$PrismaModel>
|
||||
in?: $Enums.TspProviderRequestType[]
|
||||
@@ -633,6 +658,42 @@ export type EnumTspProviderRequestTypeWithAggregatesFilter<$PrismaModel = never>
|
||||
_max?: Prisma.NestedEnumTspProviderRequestTypeFilter<$PrismaModel>
|
||||
}
|
||||
|
||||
export type EnumInvoiceSettlementTypeWithAggregatesFilter<$PrismaModel = never> = {
|
||||
equals?: $Enums.InvoiceSettlementType | Prisma.EnumInvoiceSettlementTypeFieldRefInput<$PrismaModel>
|
||||
in?: $Enums.InvoiceSettlementType[]
|
||||
notIn?: $Enums.InvoiceSettlementType[]
|
||||
not?: Prisma.NestedEnumInvoiceSettlementTypeWithAggregatesFilter<$PrismaModel> | $Enums.InvoiceSettlementType
|
||||
_count?: Prisma.NestedIntFilter<$PrismaModel>
|
||||
_min?: Prisma.NestedEnumInvoiceSettlementTypeFilter<$PrismaModel>
|
||||
_max?: Prisma.NestedEnumInvoiceSettlementTypeFilter<$PrismaModel>
|
||||
}
|
||||
|
||||
export type EnumTspProviderResponseStatusNullableWithAggregatesFilter<$PrismaModel = never> = {
|
||||
equals?: $Enums.TspProviderResponseStatus | Prisma.EnumTspProviderResponseStatusFieldRefInput<$PrismaModel> | null
|
||||
in?: $Enums.TspProviderResponseStatus[] | null
|
||||
notIn?: $Enums.TspProviderResponseStatus[] | null
|
||||
not?: Prisma.NestedEnumTspProviderResponseStatusNullableWithAggregatesFilter<$PrismaModel> | $Enums.TspProviderResponseStatus | null
|
||||
_count?: Prisma.NestedIntNullableFilter<$PrismaModel>
|
||||
_min?: Prisma.NestedEnumTspProviderResponseStatusNullableFilter<$PrismaModel>
|
||||
_max?: Prisma.NestedEnumTspProviderResponseStatusNullableFilter<$PrismaModel>
|
||||
}
|
||||
|
||||
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 JsonFilter<$PrismaModel = never> =
|
||||
| Prisma.PatchUndefined<
|
||||
Prisma.Either<Required<JsonFilterBase<$PrismaModel>>, Exclude<keyof Required<JsonFilterBase<$PrismaModel>>, 'path'>>,
|
||||
@@ -1317,6 +1378,20 @@ export type NestedEnumTspProviderRequestTypeFilter<$PrismaModel = never> = {
|
||||
not?: Prisma.NestedEnumTspProviderRequestTypeFilter<$PrismaModel> | $Enums.TspProviderRequestType
|
||||
}
|
||||
|
||||
export type NestedEnumInvoiceSettlementTypeFilter<$PrismaModel = never> = {
|
||||
equals?: $Enums.InvoiceSettlementType | Prisma.EnumInvoiceSettlementTypeFieldRefInput<$PrismaModel>
|
||||
in?: $Enums.InvoiceSettlementType[]
|
||||
notIn?: $Enums.InvoiceSettlementType[]
|
||||
not?: Prisma.NestedEnumInvoiceSettlementTypeFilter<$PrismaModel> | $Enums.InvoiceSettlementType
|
||||
}
|
||||
|
||||
export type NestedEnumTspProviderResponseStatusNullableFilter<$PrismaModel = never> = {
|
||||
equals?: $Enums.TspProviderResponseStatus | Prisma.EnumTspProviderResponseStatusFieldRefInput<$PrismaModel> | null
|
||||
in?: $Enums.TspProviderResponseStatus[] | null
|
||||
notIn?: $Enums.TspProviderResponseStatus[] | null
|
||||
not?: Prisma.NestedEnumTspProviderResponseStatusNullableFilter<$PrismaModel> | $Enums.TspProviderResponseStatus | null
|
||||
}
|
||||
|
||||
export type NestedEnumTspProviderRequestTypeWithAggregatesFilter<$PrismaModel = never> = {
|
||||
equals?: $Enums.TspProviderRequestType | Prisma.EnumTspProviderRequestTypeFieldRefInput<$PrismaModel>
|
||||
in?: $Enums.TspProviderRequestType[]
|
||||
@@ -1327,6 +1402,53 @@ export type NestedEnumTspProviderRequestTypeWithAggregatesFilter<$PrismaModel =
|
||||
_max?: Prisma.NestedEnumTspProviderRequestTypeFilter<$PrismaModel>
|
||||
}
|
||||
|
||||
export type NestedEnumInvoiceSettlementTypeWithAggregatesFilter<$PrismaModel = never> = {
|
||||
equals?: $Enums.InvoiceSettlementType | Prisma.EnumInvoiceSettlementTypeFieldRefInput<$PrismaModel>
|
||||
in?: $Enums.InvoiceSettlementType[]
|
||||
notIn?: $Enums.InvoiceSettlementType[]
|
||||
not?: Prisma.NestedEnumInvoiceSettlementTypeWithAggregatesFilter<$PrismaModel> | $Enums.InvoiceSettlementType
|
||||
_count?: Prisma.NestedIntFilter<$PrismaModel>
|
||||
_min?: Prisma.NestedEnumInvoiceSettlementTypeFilter<$PrismaModel>
|
||||
_max?: Prisma.NestedEnumInvoiceSettlementTypeFilter<$PrismaModel>
|
||||
}
|
||||
|
||||
export type NestedEnumTspProviderResponseStatusNullableWithAggregatesFilter<$PrismaModel = never> = {
|
||||
equals?: $Enums.TspProviderResponseStatus | Prisma.EnumTspProviderResponseStatusFieldRefInput<$PrismaModel> | null
|
||||
in?: $Enums.TspProviderResponseStatus[] | null
|
||||
notIn?: $Enums.TspProviderResponseStatus[] | null
|
||||
not?: Prisma.NestedEnumTspProviderResponseStatusNullableWithAggregatesFilter<$PrismaModel> | $Enums.TspProviderResponseStatus | null
|
||||
_count?: Prisma.NestedIntNullableFilter<$PrismaModel>
|
||||
_min?: Prisma.NestedEnumTspProviderResponseStatusNullableFilter<$PrismaModel>
|
||||
_max?: Prisma.NestedEnumTspProviderResponseStatusNullableFilter<$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>
|
||||
}
|
||||
|
||||
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 NestedJsonFilter<$PrismaModel = never> =
|
||||
| Prisma.PatchUndefined<
|
||||
Prisma.Either<Required<NestedJsonFilterBase<$PrismaModel>>, Exclude<keyof Required<NestedJsonFilterBase<$PrismaModel>>, 'path'>>,
|
||||
|
||||
@@ -23,19 +23,6 @@ export const PaymentMethodType = {
|
||||
export type PaymentMethodType = (typeof PaymentMethodType)[keyof typeof PaymentMethodType]
|
||||
|
||||
|
||||
export const UnitType = {
|
||||
COUNT: 'COUNT',
|
||||
GRAM: 'GRAM',
|
||||
KILOGRAM: 'KILOGRAM',
|
||||
MILLILITER: 'MILLILITER',
|
||||
LITER: 'LITER',
|
||||
METER: 'METER',
|
||||
HOUR: 'HOUR'
|
||||
} as const
|
||||
|
||||
export type UnitType = (typeof UnitType)[keyof typeof UnitType]
|
||||
|
||||
|
||||
export const GoodPricingModel = {
|
||||
STANDARD: 'STANDARD',
|
||||
GOLD: 'GOLD'
|
||||
@@ -85,24 +72,6 @@ export const BusinessRole = {
|
||||
export type BusinessRole = (typeof BusinessRole)[keyof typeof BusinessRole]
|
||||
|
||||
|
||||
export const LicenseType = {
|
||||
BASIC: 'BASIC',
|
||||
PRO: 'PRO',
|
||||
ENTERPRISE: 'ENTERPRISE'
|
||||
} as const
|
||||
|
||||
export type LicenseType = (typeof LicenseType)[keyof typeof LicenseType]
|
||||
|
||||
|
||||
export const LicenseStatus = {
|
||||
ACTIVE: 'ACTIVE',
|
||||
EXPIRED: 'EXPIRED',
|
||||
SUSPENDED: 'SUSPENDED'
|
||||
} as const
|
||||
|
||||
export type LicenseStatus = (typeof LicenseStatus)[keyof typeof LicenseStatus]
|
||||
|
||||
|
||||
export const POSType = {
|
||||
PSP: 'PSP',
|
||||
MOBILE: 'MOBILE',
|
||||
@@ -113,14 +82,6 @@ export const POSType = {
|
||||
export type POSType = (typeof POSType)[keyof typeof POSType]
|
||||
|
||||
|
||||
export const UserType = {
|
||||
LEGAL: 'LEGAL',
|
||||
INDIVIDUAL: 'INDIVIDUAL'
|
||||
} as const
|
||||
|
||||
export type UserType = (typeof UserType)[keyof typeof UserType]
|
||||
|
||||
|
||||
export const AccountType = {
|
||||
ADMIN: 'ADMIN',
|
||||
PROVIDER: 'PROVIDER',
|
||||
@@ -131,23 +92,6 @@ export const AccountType = {
|
||||
export type AccountType = (typeof AccountType)[keyof typeof AccountType]
|
||||
|
||||
|
||||
export const UserStatus = {
|
||||
ACTIVE: 'ACTIVE',
|
||||
INACTIVE: 'INACTIVE'
|
||||
} as const
|
||||
|
||||
export type UserStatus = (typeof UserStatus)[keyof typeof UserStatus]
|
||||
|
||||
|
||||
export const AccountRole = {
|
||||
OWNER: 'OWNER',
|
||||
OPERATOR: 'OPERATOR',
|
||||
ACCOUNTANT: 'ACCOUNTANT'
|
||||
} as const
|
||||
|
||||
export type AccountRole = (typeof AccountRole)[keyof typeof AccountRole]
|
||||
|
||||
|
||||
export const AccountStatus = {
|
||||
ACTIVE: 'ACTIVE',
|
||||
SUSPENDED: 'SUSPENDED'
|
||||
@@ -182,14 +126,6 @@ export const ProviderRole = {
|
||||
export type ProviderRole = (typeof ProviderRole)[keyof typeof ProviderRole]
|
||||
|
||||
|
||||
export const ProviderStatus = {
|
||||
ACTIVE: 'ACTIVE',
|
||||
SUSPENDED: 'SUSPENDED'
|
||||
} as const
|
||||
|
||||
export type ProviderStatus = (typeof ProviderStatus)[keyof typeof ProviderStatus]
|
||||
|
||||
|
||||
export const ConsumerRole = {
|
||||
OWNER: 'OWNER',
|
||||
MANAGER: 'MANAGER',
|
||||
@@ -207,14 +143,6 @@ export const ConsumerStatus = {
|
||||
export type ConsumerStatus = (typeof ConsumerStatus)[keyof typeof ConsumerStatus]
|
||||
|
||||
|
||||
export const TokenType = {
|
||||
ACCESS: 'ACCESS',
|
||||
REFRESH: 'REFRESH'
|
||||
} as const
|
||||
|
||||
export type TokenType = (typeof TokenType)[keyof typeof TokenType]
|
||||
|
||||
|
||||
export const ApplicationPlatform = {
|
||||
ANDROID: 'ANDROID',
|
||||
IOS: 'IOS'
|
||||
@@ -232,15 +160,6 @@ export const ApplicationReleaseType = {
|
||||
export type ApplicationReleaseType = (typeof ApplicationReleaseType)[keyof typeof ApplicationReleaseType]
|
||||
|
||||
|
||||
export const ApplicationPublisher = {
|
||||
DIRECT: 'DIRECT',
|
||||
CAFE_BAZAR: 'CAFE_BAZAR',
|
||||
MAYKET: 'MAYKET'
|
||||
} as const
|
||||
|
||||
export type ApplicationPublisher = (typeof ApplicationPublisher)[keyof typeof ApplicationPublisher]
|
||||
|
||||
|
||||
export const ConsumerType = {
|
||||
INDIVIDUAL: 'INDIVIDUAL',
|
||||
LEGAL: 'LEGAL'
|
||||
@@ -249,6 +168,15 @@ export const ConsumerType = {
|
||||
export type ConsumerType = (typeof ConsumerType)[keyof typeof ConsumerType]
|
||||
|
||||
|
||||
export const InvoiceSettlementType = {
|
||||
CASH: 'CASH',
|
||||
CREDIT: 'CREDIT',
|
||||
MIXED: 'MIXED'
|
||||
} as const
|
||||
|
||||
export type InvoiceSettlementType = (typeof InvoiceSettlementType)[keyof typeof InvoiceSettlementType]
|
||||
|
||||
|
||||
export const TspProviderType = {
|
||||
NAMA: 'NAMA',
|
||||
SUN: 'SUN'
|
||||
@@ -258,10 +186,12 @@ export type TspProviderType = (typeof TspProviderType)[keyof typeof TspProviderT
|
||||
|
||||
|
||||
export const TspProviderResponseStatus = {
|
||||
SUCCESS: 'SUCCESS',
|
||||
FAILURE: 'FAILURE',
|
||||
NOT_SEND: 'NOT_SEND',
|
||||
QUEUED: 'QUEUED'
|
||||
QUEUED: 'QUEUED',
|
||||
FISCAL_QUEUED: 'FISCAL_QUEUED',
|
||||
SEND_FAILURE: 'SEND_FAILURE',
|
||||
SUCCESS: 'SUCCESS',
|
||||
FAILURE: 'FAILURE'
|
||||
} as const
|
||||
|
||||
export type TspProviderResponseStatus = (typeof TspProviderResponseStatus)[keyof typeof TspProviderResponseStatus]
|
||||
@@ -277,21 +207,6 @@ export const TspProviderRequestType = {
|
||||
export type TspProviderRequestType = (typeof TspProviderRequestType)[keyof typeof TspProviderRequestType]
|
||||
|
||||
|
||||
export const TspProviderCustomerType = {
|
||||
Unknown: 'Unknown',
|
||||
Known: 'Known'
|
||||
} as const
|
||||
|
||||
export type TspProviderCustomerType = (typeof TspProviderCustomerType)[keyof typeof TspProviderCustomerType]
|
||||
|
||||
|
||||
export const SKUGuildType = {
|
||||
GOLD: 'GOLD'
|
||||
} as const
|
||||
|
||||
export type SKUGuildType = (typeof SKUGuildType)[keyof typeof SKUGuildType]
|
||||
|
||||
|
||||
export const InvoiceTemplateType = {
|
||||
SALE: 'SALE',
|
||||
FX_SALE: 'FX_SALE',
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -414,6 +414,7 @@ export const ModelName = {
|
||||
BusinessActivity: 'BusinessActivity',
|
||||
Complex: 'Complex',
|
||||
Pos: 'Pos',
|
||||
ConsumerAccountGoodFavorite: 'ConsumerAccountGoodFavorite',
|
||||
Good: 'Good',
|
||||
GoodCategory: 'GoodCategory',
|
||||
Guild: 'Guild',
|
||||
@@ -445,7 +446,7 @@ export type TypeMap<ExtArgs extends runtime.Types.Extensions.InternalArgs = runt
|
||||
omit: GlobalOmitOptions
|
||||
}
|
||||
meta: {
|
||||
modelProps: "adminAccount" | "admin" | "account" | "deviceBrand" | "device" | "licenseChargeTransaction" | "license" | "licenseActivation" | "licenseRenewChargeTransaction" | "licenseRenew" | "partnerAccountQuotaChargeTransaction" | "partnerAccountQuotaCredit" | "licenseAccountAllocation" | "partnerAccount" | "partner" | "permissionConsumer" | "permissionPos" | "permissionComplex" | "permissionBusiness" | "providerAccount" | "provider" | "consumerAccountDevice" | "applicationReleasedInfo" | "consumerAccount" | "consumer" | "consumerIndividual" | "consumerLegal" | "businessActivity" | "complex" | "pos" | "good" | "goodCategory" | "guild" | "measureUnits" | "stockKeepingUnits" | "triggerLog" | "customer" | "customerIndividual" | "customerLegal" | "salesInvoice" | "salesInvoiceItem" | "saleInvoiceTspAttempts" | "salesInvoicePayment" | "salesInvoicePaymentTerminalInfo" | "service" | "serviceCategory"
|
||||
modelProps: "adminAccount" | "admin" | "account" | "deviceBrand" | "device" | "licenseChargeTransaction" | "license" | "licenseActivation" | "licenseRenewChargeTransaction" | "licenseRenew" | "partnerAccountQuotaChargeTransaction" | "partnerAccountQuotaCredit" | "licenseAccountAllocation" | "partnerAccount" | "partner" | "permissionConsumer" | "permissionPos" | "permissionComplex" | "permissionBusiness" | "providerAccount" | "provider" | "consumerAccountDevice" | "applicationReleasedInfo" | "consumerAccount" | "consumer" | "consumerIndividual" | "consumerLegal" | "businessActivity" | "complex" | "pos" | "consumerAccountGoodFavorite" | "good" | "goodCategory" | "guild" | "measureUnits" | "stockKeepingUnits" | "triggerLog" | "customer" | "customerIndividual" | "customerLegal" | "salesInvoice" | "salesInvoiceItem" | "saleInvoiceTspAttempts" | "salesInvoicePayment" | "salesInvoicePaymentTerminalInfo" | "service" | "serviceCategory"
|
||||
txIsolationLevel: TransactionIsolationLevel
|
||||
}
|
||||
model: {
|
||||
@@ -2429,6 +2430,72 @@ export type TypeMap<ExtArgs extends runtime.Types.Extensions.InternalArgs = runt
|
||||
}
|
||||
}
|
||||
}
|
||||
ConsumerAccountGoodFavorite: {
|
||||
payload: Prisma.$ConsumerAccountGoodFavoritePayload<ExtArgs>
|
||||
fields: Prisma.ConsumerAccountGoodFavoriteFieldRefs
|
||||
operations: {
|
||||
findUnique: {
|
||||
args: Prisma.ConsumerAccountGoodFavoriteFindUniqueArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.PayloadToResult<Prisma.$ConsumerAccountGoodFavoritePayload> | null
|
||||
}
|
||||
findUniqueOrThrow: {
|
||||
args: Prisma.ConsumerAccountGoodFavoriteFindUniqueOrThrowArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.PayloadToResult<Prisma.$ConsumerAccountGoodFavoritePayload>
|
||||
}
|
||||
findFirst: {
|
||||
args: Prisma.ConsumerAccountGoodFavoriteFindFirstArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.PayloadToResult<Prisma.$ConsumerAccountGoodFavoritePayload> | null
|
||||
}
|
||||
findFirstOrThrow: {
|
||||
args: Prisma.ConsumerAccountGoodFavoriteFindFirstOrThrowArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.PayloadToResult<Prisma.$ConsumerAccountGoodFavoritePayload>
|
||||
}
|
||||
findMany: {
|
||||
args: Prisma.ConsumerAccountGoodFavoriteFindManyArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.PayloadToResult<Prisma.$ConsumerAccountGoodFavoritePayload>[]
|
||||
}
|
||||
create: {
|
||||
args: Prisma.ConsumerAccountGoodFavoriteCreateArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.PayloadToResult<Prisma.$ConsumerAccountGoodFavoritePayload>
|
||||
}
|
||||
createMany: {
|
||||
args: Prisma.ConsumerAccountGoodFavoriteCreateManyArgs<ExtArgs>
|
||||
result: BatchPayload
|
||||
}
|
||||
delete: {
|
||||
args: Prisma.ConsumerAccountGoodFavoriteDeleteArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.PayloadToResult<Prisma.$ConsumerAccountGoodFavoritePayload>
|
||||
}
|
||||
update: {
|
||||
args: Prisma.ConsumerAccountGoodFavoriteUpdateArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.PayloadToResult<Prisma.$ConsumerAccountGoodFavoritePayload>
|
||||
}
|
||||
deleteMany: {
|
||||
args: Prisma.ConsumerAccountGoodFavoriteDeleteManyArgs<ExtArgs>
|
||||
result: BatchPayload
|
||||
}
|
||||
updateMany: {
|
||||
args: Prisma.ConsumerAccountGoodFavoriteUpdateManyArgs<ExtArgs>
|
||||
result: BatchPayload
|
||||
}
|
||||
upsert: {
|
||||
args: Prisma.ConsumerAccountGoodFavoriteUpsertArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.PayloadToResult<Prisma.$ConsumerAccountGoodFavoritePayload>
|
||||
}
|
||||
aggregate: {
|
||||
args: Prisma.ConsumerAccountGoodFavoriteAggregateArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.Optional<Prisma.AggregateConsumerAccountGoodFavorite>
|
||||
}
|
||||
groupBy: {
|
||||
args: Prisma.ConsumerAccountGoodFavoriteGroupByArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.Optional<Prisma.ConsumerAccountGoodFavoriteGroupByOutputType>[]
|
||||
}
|
||||
count: {
|
||||
args: Prisma.ConsumerAccountGoodFavoriteCountArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.Optional<Prisma.ConsumerAccountGoodFavoriteCountAggregateOutputType> | number
|
||||
}
|
||||
}
|
||||
}
|
||||
Good: {
|
||||
payload: Prisma.$GoodPayload<ExtArgs>
|
||||
fields: Prisma.GoodFieldRefs
|
||||
@@ -3890,6 +3957,15 @@ export const PosScalarFieldEnum = {
|
||||
export type PosScalarFieldEnum = (typeof PosScalarFieldEnum)[keyof typeof PosScalarFieldEnum]
|
||||
|
||||
|
||||
export const ConsumerAccountGoodFavoriteScalarFieldEnum = {
|
||||
created_at: 'created_at',
|
||||
consumer_account_id: 'consumer_account_id',
|
||||
good_id: 'good_id'
|
||||
} as const
|
||||
|
||||
export type ConsumerAccountGoodFavoriteScalarFieldEnum = (typeof ConsumerAccountGoodFavoriteScalarFieldEnum)[keyof typeof ConsumerAccountGoodFavoriteScalarFieldEnum]
|
||||
|
||||
|
||||
export const GoodScalarFieldEnum = {
|
||||
id: 'id',
|
||||
name: 'name',
|
||||
@@ -4030,7 +4106,12 @@ export const SalesInvoiceScalarFieldEnum = {
|
||||
ref_id: 'ref_id',
|
||||
customer_id: 'customer_id',
|
||||
consumer_account_id: 'consumer_account_id',
|
||||
pos_id: 'pos_id'
|
||||
pos_id: 'pos_id',
|
||||
settlement_type: 'settlement_type',
|
||||
discount_amount: 'discount_amount',
|
||||
tax_amount: 'tax_amount',
|
||||
last_tsp_status: 'last_tsp_status',
|
||||
last_attempt_no: 'last_attempt_no'
|
||||
} as const
|
||||
|
||||
export type SalesInvoiceScalarFieldEnum = (typeof SalesInvoiceScalarFieldEnum)[keyof typeof SalesInvoiceScalarFieldEnum]
|
||||
@@ -4052,7 +4133,9 @@ export const SalesInvoiceItemScalarFieldEnum = {
|
||||
good_snapshot: 'good_snapshot',
|
||||
invoice_id: 'invoice_id',
|
||||
good_id: 'good_id',
|
||||
service_id: 'service_id'
|
||||
service_id: 'service_id',
|
||||
discount_amount: 'discount_amount',
|
||||
tax_amount: 'tax_amount'
|
||||
} as const
|
||||
|
||||
export type SalesInvoiceItemScalarFieldEnum = (typeof SalesInvoiceItemScalarFieldEnum)[keyof typeof SalesInvoiceItemScalarFieldEnum]
|
||||
@@ -4062,14 +4145,17 @@ export const SaleInvoiceTspAttemptsScalarFieldEnum = {
|
||||
id: 'id',
|
||||
attempt_no: 'attempt_no',
|
||||
status: 'status',
|
||||
raw_request_payload: 'raw_request_payload',
|
||||
provider_request_payload: 'provider_request_payload',
|
||||
provider_response_payload: 'provider_response_payload',
|
||||
message: 'message',
|
||||
sent_at: 'sent_at',
|
||||
received_at: 'received_at',
|
||||
created_at: 'created_at',
|
||||
invoice_id: 'invoice_id'
|
||||
invoice_id: 'invoice_id',
|
||||
provider_request_payload: 'provider_request_payload',
|
||||
raw_request_payload: 'raw_request_payload',
|
||||
error_message: 'error_message',
|
||||
fiscal_warnings: 'fiscal_warnings',
|
||||
provider_response: 'provider_response',
|
||||
validation_errors: 'validation_errors'
|
||||
} as const
|
||||
|
||||
export type SaleInvoiceTspAttemptsScalarFieldEnum = (typeof SaleInvoiceTspAttemptsScalarFieldEnum)[keyof typeof SaleInvoiceTspAttemptsScalarFieldEnum]
|
||||
@@ -4469,6 +4555,14 @@ export const PosOrderByRelevanceFieldEnum = {
|
||||
export type PosOrderByRelevanceFieldEnum = (typeof PosOrderByRelevanceFieldEnum)[keyof typeof PosOrderByRelevanceFieldEnum]
|
||||
|
||||
|
||||
export const ConsumerAccountGoodFavoriteOrderByRelevanceFieldEnum = {
|
||||
consumer_account_id: 'consumer_account_id',
|
||||
good_id: 'good_id'
|
||||
} as const
|
||||
|
||||
export type ConsumerAccountGoodFavoriteOrderByRelevanceFieldEnum = (typeof ConsumerAccountGoodFavoriteOrderByRelevanceFieldEnum)[keyof typeof ConsumerAccountGoodFavoriteOrderByRelevanceFieldEnum]
|
||||
|
||||
|
||||
export const GoodOrderByRelevanceFieldEnum = {
|
||||
id: 'id',
|
||||
name: 'name',
|
||||
@@ -4598,7 +4692,8 @@ export type SalesInvoiceItemOrderByRelevanceFieldEnum = (typeof SalesInvoiceItem
|
||||
export const SaleInvoiceTspAttemptsOrderByRelevanceFieldEnum = {
|
||||
id: 'id',
|
||||
message: 'message',
|
||||
invoice_id: 'invoice_id'
|
||||
invoice_id: 'invoice_id',
|
||||
error_message: 'error_message'
|
||||
} as const
|
||||
|
||||
export type SaleInvoiceTspAttemptsOrderByRelevanceFieldEnum = (typeof SaleInvoiceTspAttemptsOrderByRelevanceFieldEnum)[keyof typeof SaleInvoiceTspAttemptsOrderByRelevanceFieldEnum]
|
||||
@@ -4847,6 +4942,13 @@ export type EnumTspProviderRequestTypeFieldRefInput<$PrismaModel> = FieldRefInpu
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Reference to a field of type 'InvoiceSettlementType'
|
||||
*/
|
||||
export type EnumInvoiceSettlementTypeFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'InvoiceSettlementType'>
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Reference to a field of type 'TspProviderResponseStatus'
|
||||
*/
|
||||
@@ -4992,6 +5094,7 @@ export type GlobalOmitConfig = {
|
||||
businessActivity?: Prisma.BusinessActivityOmit
|
||||
complex?: Prisma.ComplexOmit
|
||||
pos?: Prisma.PosOmit
|
||||
consumerAccountGoodFavorite?: Prisma.ConsumerAccountGoodFavoriteOmit
|
||||
good?: Prisma.GoodOmit
|
||||
goodCategory?: Prisma.GoodCategoryOmit
|
||||
guild?: Prisma.GuildOmit
|
||||
|
||||
@@ -81,6 +81,7 @@ export const ModelName = {
|
||||
BusinessActivity: 'BusinessActivity',
|
||||
Complex: 'Complex',
|
||||
Pos: 'Pos',
|
||||
ConsumerAccountGoodFavorite: 'ConsumerAccountGoodFavorite',
|
||||
Good: 'Good',
|
||||
GoodCategory: 'GoodCategory',
|
||||
Guild: 'Guild',
|
||||
@@ -481,6 +482,15 @@ export const PosScalarFieldEnum = {
|
||||
export type PosScalarFieldEnum = (typeof PosScalarFieldEnum)[keyof typeof PosScalarFieldEnum]
|
||||
|
||||
|
||||
export const ConsumerAccountGoodFavoriteScalarFieldEnum = {
|
||||
created_at: 'created_at',
|
||||
consumer_account_id: 'consumer_account_id',
|
||||
good_id: 'good_id'
|
||||
} as const
|
||||
|
||||
export type ConsumerAccountGoodFavoriteScalarFieldEnum = (typeof ConsumerAccountGoodFavoriteScalarFieldEnum)[keyof typeof ConsumerAccountGoodFavoriteScalarFieldEnum]
|
||||
|
||||
|
||||
export const GoodScalarFieldEnum = {
|
||||
id: 'id',
|
||||
name: 'name',
|
||||
@@ -621,7 +631,12 @@ export const SalesInvoiceScalarFieldEnum = {
|
||||
ref_id: 'ref_id',
|
||||
customer_id: 'customer_id',
|
||||
consumer_account_id: 'consumer_account_id',
|
||||
pos_id: 'pos_id'
|
||||
pos_id: 'pos_id',
|
||||
settlement_type: 'settlement_type',
|
||||
discount_amount: 'discount_amount',
|
||||
tax_amount: 'tax_amount',
|
||||
last_tsp_status: 'last_tsp_status',
|
||||
last_attempt_no: 'last_attempt_no'
|
||||
} as const
|
||||
|
||||
export type SalesInvoiceScalarFieldEnum = (typeof SalesInvoiceScalarFieldEnum)[keyof typeof SalesInvoiceScalarFieldEnum]
|
||||
@@ -643,7 +658,9 @@ export const SalesInvoiceItemScalarFieldEnum = {
|
||||
good_snapshot: 'good_snapshot',
|
||||
invoice_id: 'invoice_id',
|
||||
good_id: 'good_id',
|
||||
service_id: 'service_id'
|
||||
service_id: 'service_id',
|
||||
discount_amount: 'discount_amount',
|
||||
tax_amount: 'tax_amount'
|
||||
} as const
|
||||
|
||||
export type SalesInvoiceItemScalarFieldEnum = (typeof SalesInvoiceItemScalarFieldEnum)[keyof typeof SalesInvoiceItemScalarFieldEnum]
|
||||
@@ -653,14 +670,17 @@ export const SaleInvoiceTspAttemptsScalarFieldEnum = {
|
||||
id: 'id',
|
||||
attempt_no: 'attempt_no',
|
||||
status: 'status',
|
||||
raw_request_payload: 'raw_request_payload',
|
||||
provider_request_payload: 'provider_request_payload',
|
||||
provider_response_payload: 'provider_response_payload',
|
||||
message: 'message',
|
||||
sent_at: 'sent_at',
|
||||
received_at: 'received_at',
|
||||
created_at: 'created_at',
|
||||
invoice_id: 'invoice_id'
|
||||
invoice_id: 'invoice_id',
|
||||
provider_request_payload: 'provider_request_payload',
|
||||
raw_request_payload: 'raw_request_payload',
|
||||
error_message: 'error_message',
|
||||
fiscal_warnings: 'fiscal_warnings',
|
||||
provider_response: 'provider_response',
|
||||
validation_errors: 'validation_errors'
|
||||
} as const
|
||||
|
||||
export type SaleInvoiceTspAttemptsScalarFieldEnum = (typeof SaleInvoiceTspAttemptsScalarFieldEnum)[keyof typeof SaleInvoiceTspAttemptsScalarFieldEnum]
|
||||
@@ -1060,6 +1080,14 @@ export const PosOrderByRelevanceFieldEnum = {
|
||||
export type PosOrderByRelevanceFieldEnum = (typeof PosOrderByRelevanceFieldEnum)[keyof typeof PosOrderByRelevanceFieldEnum]
|
||||
|
||||
|
||||
export const ConsumerAccountGoodFavoriteOrderByRelevanceFieldEnum = {
|
||||
consumer_account_id: 'consumer_account_id',
|
||||
good_id: 'good_id'
|
||||
} as const
|
||||
|
||||
export type ConsumerAccountGoodFavoriteOrderByRelevanceFieldEnum = (typeof ConsumerAccountGoodFavoriteOrderByRelevanceFieldEnum)[keyof typeof ConsumerAccountGoodFavoriteOrderByRelevanceFieldEnum]
|
||||
|
||||
|
||||
export const GoodOrderByRelevanceFieldEnum = {
|
||||
id: 'id',
|
||||
name: 'name',
|
||||
@@ -1189,7 +1217,8 @@ export type SalesInvoiceItemOrderByRelevanceFieldEnum = (typeof SalesInvoiceItem
|
||||
export const SaleInvoiceTspAttemptsOrderByRelevanceFieldEnum = {
|
||||
id: 'id',
|
||||
message: 'message',
|
||||
invoice_id: 'invoice_id'
|
||||
invoice_id: 'invoice_id',
|
||||
error_message: 'error_message'
|
||||
} as const
|
||||
|
||||
export type SaleInvoiceTspAttemptsOrderByRelevanceFieldEnum = (typeof SaleInvoiceTspAttemptsOrderByRelevanceFieldEnum)[keyof typeof SaleInvoiceTspAttemptsOrderByRelevanceFieldEnum]
|
||||
|
||||
@@ -38,6 +38,7 @@ export type * from './models/ConsumerLegal.js'
|
||||
export type * from './models/BusinessActivity.js'
|
||||
export type * from './models/Complex.js'
|
||||
export type * from './models/Pos.js'
|
||||
export type * from './models/ConsumerAccountGoodFavorite.js'
|
||||
export type * from './models/Good.js'
|
||||
export type * from './models/GoodCategory.js'
|
||||
export type * from './models/Guild.js'
|
||||
|
||||
@@ -182,8 +182,8 @@ export type AdminAccountWhereInput = {
|
||||
updated_at?: Prisma.DateTimeFilter<"AdminAccount"> | Date | string
|
||||
admin_id?: Prisma.StringFilter<"AdminAccount"> | string
|
||||
account_id?: Prisma.StringFilter<"AdminAccount"> | string
|
||||
admin?: Prisma.XOR<Prisma.AdminScalarRelationFilter, Prisma.AdminWhereInput>
|
||||
account?: Prisma.XOR<Prisma.AccountScalarRelationFilter, Prisma.AccountWhereInput>
|
||||
admin?: Prisma.XOR<Prisma.AdminScalarRelationFilter, Prisma.AdminWhereInput>
|
||||
}
|
||||
|
||||
export type AdminAccountOrderByWithRelationInput = {
|
||||
@@ -192,8 +192,8 @@ export type AdminAccountOrderByWithRelationInput = {
|
||||
updated_at?: Prisma.SortOrder
|
||||
admin_id?: Prisma.SortOrder
|
||||
account_id?: Prisma.SortOrder
|
||||
admin?: Prisma.AdminOrderByWithRelationInput
|
||||
account?: Prisma.AccountOrderByWithRelationInput
|
||||
admin?: Prisma.AdminOrderByWithRelationInput
|
||||
_relevance?: Prisma.AdminAccountOrderByRelevanceInput
|
||||
}
|
||||
|
||||
@@ -206,8 +206,8 @@ export type AdminAccountWhereUniqueInput = Prisma.AtLeast<{
|
||||
created_at?: Prisma.DateTimeFilter<"AdminAccount"> | Date | string
|
||||
updated_at?: Prisma.DateTimeFilter<"AdminAccount"> | Date | string
|
||||
admin_id?: Prisma.StringFilter<"AdminAccount"> | string
|
||||
admin?: Prisma.XOR<Prisma.AdminScalarRelationFilter, Prisma.AdminWhereInput>
|
||||
account?: Prisma.XOR<Prisma.AccountScalarRelationFilter, Prisma.AccountWhereInput>
|
||||
admin?: Prisma.XOR<Prisma.AdminScalarRelationFilter, Prisma.AdminWhereInput>
|
||||
}, "id" | "account_id">
|
||||
|
||||
export type AdminAccountOrderByWithAggregationInput = {
|
||||
@@ -236,8 +236,8 @@ export type AdminAccountCreateInput = {
|
||||
id?: string
|
||||
created_at?: Date | string
|
||||
updated_at?: Date | string
|
||||
admin: Prisma.AdminCreateNestedOneWithoutAccountsInput
|
||||
account: Prisma.AccountCreateNestedOneWithoutAdmin_accountInput
|
||||
admin: Prisma.AdminCreateNestedOneWithoutAccountsInput
|
||||
}
|
||||
|
||||
export type AdminAccountUncheckedCreateInput = {
|
||||
@@ -252,8 +252,8 @@ export type AdminAccountUpdateInput = {
|
||||
id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
admin?: Prisma.AdminUpdateOneRequiredWithoutAccountsNestedInput
|
||||
account?: Prisma.AccountUpdateOneRequiredWithoutAdmin_accountNestedInput
|
||||
admin?: Prisma.AdminUpdateOneRequiredWithoutAccountsNestedInput
|
||||
}
|
||||
|
||||
export type AdminAccountUncheckedUpdateInput = {
|
||||
@@ -544,8 +544,8 @@ export type AdminAccountSelect<ExtArgs extends runtime.Types.Extensions.Internal
|
||||
updated_at?: boolean
|
||||
admin_id?: boolean
|
||||
account_id?: boolean
|
||||
admin?: boolean | Prisma.AdminDefaultArgs<ExtArgs>
|
||||
account?: boolean | Prisma.AccountDefaultArgs<ExtArgs>
|
||||
admin?: boolean | Prisma.AdminDefaultArgs<ExtArgs>
|
||||
}, ExtArgs["result"]["adminAccount"]>
|
||||
|
||||
|
||||
@@ -560,15 +560,15 @@ export type AdminAccountSelectScalar = {
|
||||
|
||||
export type AdminAccountOmit<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetOmit<"id" | "created_at" | "updated_at" | "admin_id" | "account_id", ExtArgs["result"]["adminAccount"]>
|
||||
export type AdminAccountInclude<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
|
||||
admin?: boolean | Prisma.AdminDefaultArgs<ExtArgs>
|
||||
account?: boolean | Prisma.AccountDefaultArgs<ExtArgs>
|
||||
admin?: boolean | Prisma.AdminDefaultArgs<ExtArgs>
|
||||
}
|
||||
|
||||
export type $AdminAccountPayload<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
|
||||
name: "AdminAccount"
|
||||
objects: {
|
||||
admin: Prisma.$AdminPayload<ExtArgs>
|
||||
account: Prisma.$AccountPayload<ExtArgs>
|
||||
admin: Prisma.$AdminPayload<ExtArgs>
|
||||
}
|
||||
scalars: runtime.Types.Extensions.GetPayloadResult<{
|
||||
id: string
|
||||
@@ -916,8 +916,8 @@ readonly fields: AdminAccountFieldRefs;
|
||||
*/
|
||||
export interface Prisma__AdminAccountClient<T, Null = never, ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs, GlobalOmitOptions = {}> extends Prisma.PrismaPromise<T> {
|
||||
readonly [Symbol.toStringTag]: "PrismaPromise"
|
||||
admin<T extends Prisma.AdminDefaultArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.AdminDefaultArgs<ExtArgs>>): Prisma.Prisma__AdminClient<runtime.Types.Result.GetResult<Prisma.$AdminPayload<ExtArgs>, T, "findUniqueOrThrow", GlobalOmitOptions> | Null, Null, ExtArgs, GlobalOmitOptions>
|
||||
account<T extends Prisma.AccountDefaultArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.AccountDefaultArgs<ExtArgs>>): Prisma.Prisma__AccountClient<runtime.Types.Result.GetResult<Prisma.$AccountPayload<ExtArgs>, T, "findUniqueOrThrow", GlobalOmitOptions> | Null, Null, ExtArgs, GlobalOmitOptions>
|
||||
admin<T extends Prisma.AdminDefaultArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.AdminDefaultArgs<ExtArgs>>): Prisma.Prisma__AdminClient<runtime.Types.Result.GetResult<Prisma.$AdminPayload<ExtArgs>, T, "findUniqueOrThrow", GlobalOmitOptions> | Null, Null, ExtArgs, GlobalOmitOptions>
|
||||
/**
|
||||
* Attaches callbacks for the resolution and/or rejection of the Promise.
|
||||
* @param onfulfilled The callback to execute when the Promise is resolved.
|
||||
|
||||
@@ -256,14 +256,14 @@ export type BusinessActivityWhereInput = {
|
||||
updated_at?: Prisma.DateTimeFilter<"BusinessActivity"> | Date | string
|
||||
guild_id?: Prisma.StringFilter<"BusinessActivity"> | string
|
||||
consumer_id?: Prisma.StringFilter<"BusinessActivity"> | string
|
||||
guild?: Prisma.XOR<Prisma.GuildScalarRelationFilter, Prisma.GuildWhereInput>
|
||||
consumer?: Prisma.XOR<Prisma.ConsumerScalarRelationFilter, Prisma.ConsumerWhereInput>
|
||||
license_activation?: Prisma.XOR<Prisma.LicenseActivationNullableScalarRelationFilter, Prisma.LicenseActivationWhereInput> | null
|
||||
guild?: Prisma.XOR<Prisma.GuildScalarRelationFilter, Prisma.GuildWhereInput>
|
||||
complexes?: Prisma.ComplexListRelationFilter
|
||||
permission_businesses?: Prisma.PermissionBusinessListRelationFilter
|
||||
goods?: Prisma.GoodListRelationFilter
|
||||
customer_individuals?: Prisma.CustomerIndividualListRelationFilter
|
||||
customer_legals?: Prisma.CustomerLegalListRelationFilter
|
||||
goods?: Prisma.GoodListRelationFilter
|
||||
license_activation?: Prisma.XOR<Prisma.LicenseActivationNullableScalarRelationFilter, Prisma.LicenseActivationWhereInput> | null
|
||||
permission_businesses?: Prisma.PermissionBusinessListRelationFilter
|
||||
}
|
||||
|
||||
export type BusinessActivityOrderByWithRelationInput = {
|
||||
@@ -277,14 +277,14 @@ export type BusinessActivityOrderByWithRelationInput = {
|
||||
updated_at?: Prisma.SortOrder
|
||||
guild_id?: Prisma.SortOrder
|
||||
consumer_id?: Prisma.SortOrder
|
||||
guild?: Prisma.GuildOrderByWithRelationInput
|
||||
consumer?: Prisma.ConsumerOrderByWithRelationInput
|
||||
license_activation?: Prisma.LicenseActivationOrderByWithRelationInput
|
||||
guild?: Prisma.GuildOrderByWithRelationInput
|
||||
complexes?: Prisma.ComplexOrderByRelationAggregateInput
|
||||
permission_businesses?: Prisma.PermissionBusinessOrderByRelationAggregateInput
|
||||
goods?: Prisma.GoodOrderByRelationAggregateInput
|
||||
customer_individuals?: Prisma.CustomerIndividualOrderByRelationAggregateInput
|
||||
customer_legals?: Prisma.CustomerLegalOrderByRelationAggregateInput
|
||||
goods?: Prisma.GoodOrderByRelationAggregateInput
|
||||
license_activation?: Prisma.LicenseActivationOrderByWithRelationInput
|
||||
permission_businesses?: Prisma.PermissionBusinessOrderByRelationAggregateInput
|
||||
_relevance?: Prisma.BusinessActivityOrderByRelevanceInput
|
||||
}
|
||||
|
||||
@@ -303,14 +303,14 @@ export type BusinessActivityWhereUniqueInput = Prisma.AtLeast<{
|
||||
updated_at?: Prisma.DateTimeFilter<"BusinessActivity"> | Date | string
|
||||
guild_id?: Prisma.StringFilter<"BusinessActivity"> | string
|
||||
consumer_id?: Prisma.StringFilter<"BusinessActivity"> | string
|
||||
guild?: Prisma.XOR<Prisma.GuildScalarRelationFilter, Prisma.GuildWhereInput>
|
||||
consumer?: Prisma.XOR<Prisma.ConsumerScalarRelationFilter, Prisma.ConsumerWhereInput>
|
||||
license_activation?: Prisma.XOR<Prisma.LicenseActivationNullableScalarRelationFilter, Prisma.LicenseActivationWhereInput> | null
|
||||
guild?: Prisma.XOR<Prisma.GuildScalarRelationFilter, Prisma.GuildWhereInput>
|
||||
complexes?: Prisma.ComplexListRelationFilter
|
||||
permission_businesses?: Prisma.PermissionBusinessListRelationFilter
|
||||
goods?: Prisma.GoodListRelationFilter
|
||||
customer_individuals?: Prisma.CustomerIndividualListRelationFilter
|
||||
customer_legals?: Prisma.CustomerLegalListRelationFilter
|
||||
goods?: Prisma.GoodListRelationFilter
|
||||
license_activation?: Prisma.XOR<Prisma.LicenseActivationNullableScalarRelationFilter, Prisma.LicenseActivationWhereInput> | null
|
||||
permission_businesses?: Prisma.PermissionBusinessListRelationFilter
|
||||
}, "id" | "economic_code_consumer_id">
|
||||
|
||||
export type BusinessActivityOrderByWithAggregationInput = {
|
||||
@@ -356,14 +356,14 @@ export type BusinessActivityCreateInput = {
|
||||
invoice_number_sequence?: runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
created_at?: Date | string
|
||||
updated_at?: Date | string
|
||||
guild: Prisma.GuildCreateNestedOneWithoutBusiness_activitiesInput
|
||||
consumer: Prisma.ConsumerCreateNestedOneWithoutBusiness_activitiesInput
|
||||
license_activation?: Prisma.LicenseActivationCreateNestedOneWithoutBusiness_activityInput
|
||||
guild: Prisma.GuildCreateNestedOneWithoutBusiness_activitiesInput
|
||||
complexes?: Prisma.ComplexCreateNestedManyWithoutBusiness_activityInput
|
||||
permission_businesses?: Prisma.PermissionBusinessCreateNestedManyWithoutBusinessInput
|
||||
goods?: Prisma.GoodCreateNestedManyWithoutBusiness_activityInput
|
||||
customer_individuals?: Prisma.CustomerIndividualCreateNestedManyWithoutBusiness_activityInput
|
||||
customer_legals?: Prisma.CustomerLegalCreateNestedManyWithoutBusiness_activityInput
|
||||
goods?: Prisma.GoodCreateNestedManyWithoutBusiness_activityInput
|
||||
license_activation?: Prisma.LicenseActivationCreateNestedOneWithoutBusiness_activityInput
|
||||
permission_businesses?: Prisma.PermissionBusinessCreateNestedManyWithoutBusinessInput
|
||||
}
|
||||
|
||||
export type BusinessActivityUncheckedCreateInput = {
|
||||
@@ -377,12 +377,12 @@ export type BusinessActivityUncheckedCreateInput = {
|
||||
updated_at?: Date | string
|
||||
guild_id: string
|
||||
consumer_id: string
|
||||
license_activation?: Prisma.LicenseActivationUncheckedCreateNestedOneWithoutBusiness_activityInput
|
||||
complexes?: Prisma.ComplexUncheckedCreateNestedManyWithoutBusiness_activityInput
|
||||
permission_businesses?: Prisma.PermissionBusinessUncheckedCreateNestedManyWithoutBusinessInput
|
||||
goods?: Prisma.GoodUncheckedCreateNestedManyWithoutBusiness_activityInput
|
||||
customer_individuals?: Prisma.CustomerIndividualUncheckedCreateNestedManyWithoutBusiness_activityInput
|
||||
customer_legals?: Prisma.CustomerLegalUncheckedCreateNestedManyWithoutBusiness_activityInput
|
||||
goods?: Prisma.GoodUncheckedCreateNestedManyWithoutBusiness_activityInput
|
||||
license_activation?: Prisma.LicenseActivationUncheckedCreateNestedOneWithoutBusiness_activityInput
|
||||
permission_businesses?: Prisma.PermissionBusinessUncheckedCreateNestedManyWithoutBusinessInput
|
||||
}
|
||||
|
||||
export type BusinessActivityUpdateInput = {
|
||||
@@ -394,14 +394,14 @@ export type BusinessActivityUpdateInput = {
|
||||
invoice_number_sequence?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
guild?: Prisma.GuildUpdateOneRequiredWithoutBusiness_activitiesNestedInput
|
||||
consumer?: Prisma.ConsumerUpdateOneRequiredWithoutBusiness_activitiesNestedInput
|
||||
license_activation?: Prisma.LicenseActivationUpdateOneWithoutBusiness_activityNestedInput
|
||||
guild?: Prisma.GuildUpdateOneRequiredWithoutBusiness_activitiesNestedInput
|
||||
complexes?: Prisma.ComplexUpdateManyWithoutBusiness_activityNestedInput
|
||||
permission_businesses?: Prisma.PermissionBusinessUpdateManyWithoutBusinessNestedInput
|
||||
goods?: Prisma.GoodUpdateManyWithoutBusiness_activityNestedInput
|
||||
customer_individuals?: Prisma.CustomerIndividualUpdateManyWithoutBusiness_activityNestedInput
|
||||
customer_legals?: Prisma.CustomerLegalUpdateManyWithoutBusiness_activityNestedInput
|
||||
goods?: Prisma.GoodUpdateManyWithoutBusiness_activityNestedInput
|
||||
license_activation?: Prisma.LicenseActivationUpdateOneWithoutBusiness_activityNestedInput
|
||||
permission_businesses?: Prisma.PermissionBusinessUpdateManyWithoutBusinessNestedInput
|
||||
}
|
||||
|
||||
export type BusinessActivityUncheckedUpdateInput = {
|
||||
@@ -415,12 +415,12 @@ export type BusinessActivityUncheckedUpdateInput = {
|
||||
updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
guild_id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
consumer_id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
license_activation?: Prisma.LicenseActivationUncheckedUpdateOneWithoutBusiness_activityNestedInput
|
||||
complexes?: Prisma.ComplexUncheckedUpdateManyWithoutBusiness_activityNestedInput
|
||||
permission_businesses?: Prisma.PermissionBusinessUncheckedUpdateManyWithoutBusinessNestedInput
|
||||
goods?: Prisma.GoodUncheckedUpdateManyWithoutBusiness_activityNestedInput
|
||||
customer_individuals?: Prisma.CustomerIndividualUncheckedUpdateManyWithoutBusiness_activityNestedInput
|
||||
customer_legals?: Prisma.CustomerLegalUncheckedUpdateManyWithoutBusiness_activityNestedInput
|
||||
goods?: Prisma.GoodUncheckedUpdateManyWithoutBusiness_activityNestedInput
|
||||
license_activation?: Prisma.LicenseActivationUncheckedUpdateOneWithoutBusiness_activityNestedInput
|
||||
permission_businesses?: Prisma.PermissionBusinessUncheckedUpdateManyWithoutBusinessNestedInput
|
||||
}
|
||||
|
||||
export type BusinessActivityCreateManyInput = {
|
||||
@@ -725,13 +725,13 @@ export type BusinessActivityCreateWithoutLicense_activationInput = {
|
||||
invoice_number_sequence?: runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
created_at?: Date | string
|
||||
updated_at?: Date | string
|
||||
guild: Prisma.GuildCreateNestedOneWithoutBusiness_activitiesInput
|
||||
consumer: Prisma.ConsumerCreateNestedOneWithoutBusiness_activitiesInput
|
||||
guild: Prisma.GuildCreateNestedOneWithoutBusiness_activitiesInput
|
||||
complexes?: Prisma.ComplexCreateNestedManyWithoutBusiness_activityInput
|
||||
permission_businesses?: Prisma.PermissionBusinessCreateNestedManyWithoutBusinessInput
|
||||
goods?: Prisma.GoodCreateNestedManyWithoutBusiness_activityInput
|
||||
customer_individuals?: Prisma.CustomerIndividualCreateNestedManyWithoutBusiness_activityInput
|
||||
customer_legals?: Prisma.CustomerLegalCreateNestedManyWithoutBusiness_activityInput
|
||||
goods?: Prisma.GoodCreateNestedManyWithoutBusiness_activityInput
|
||||
permission_businesses?: Prisma.PermissionBusinessCreateNestedManyWithoutBusinessInput
|
||||
}
|
||||
|
||||
export type BusinessActivityUncheckedCreateWithoutLicense_activationInput = {
|
||||
@@ -746,10 +746,10 @@ export type BusinessActivityUncheckedCreateWithoutLicense_activationInput = {
|
||||
guild_id: string
|
||||
consumer_id: string
|
||||
complexes?: Prisma.ComplexUncheckedCreateNestedManyWithoutBusiness_activityInput
|
||||
permission_businesses?: Prisma.PermissionBusinessUncheckedCreateNestedManyWithoutBusinessInput
|
||||
goods?: Prisma.GoodUncheckedCreateNestedManyWithoutBusiness_activityInput
|
||||
customer_individuals?: Prisma.CustomerIndividualUncheckedCreateNestedManyWithoutBusiness_activityInput
|
||||
customer_legals?: Prisma.CustomerLegalUncheckedCreateNestedManyWithoutBusiness_activityInput
|
||||
goods?: Prisma.GoodUncheckedCreateNestedManyWithoutBusiness_activityInput
|
||||
permission_businesses?: Prisma.PermissionBusinessUncheckedCreateNestedManyWithoutBusinessInput
|
||||
}
|
||||
|
||||
export type BusinessActivityCreateOrConnectWithoutLicense_activationInput = {
|
||||
@@ -777,13 +777,13 @@ export type BusinessActivityUpdateWithoutLicense_activationInput = {
|
||||
invoice_number_sequence?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
guild?: Prisma.GuildUpdateOneRequiredWithoutBusiness_activitiesNestedInput
|
||||
consumer?: Prisma.ConsumerUpdateOneRequiredWithoutBusiness_activitiesNestedInput
|
||||
guild?: Prisma.GuildUpdateOneRequiredWithoutBusiness_activitiesNestedInput
|
||||
complexes?: Prisma.ComplexUpdateManyWithoutBusiness_activityNestedInput
|
||||
permission_businesses?: Prisma.PermissionBusinessUpdateManyWithoutBusinessNestedInput
|
||||
goods?: Prisma.GoodUpdateManyWithoutBusiness_activityNestedInput
|
||||
customer_individuals?: Prisma.CustomerIndividualUpdateManyWithoutBusiness_activityNestedInput
|
||||
customer_legals?: Prisma.CustomerLegalUpdateManyWithoutBusiness_activityNestedInput
|
||||
goods?: Prisma.GoodUpdateManyWithoutBusiness_activityNestedInput
|
||||
permission_businesses?: Prisma.PermissionBusinessUpdateManyWithoutBusinessNestedInput
|
||||
}
|
||||
|
||||
export type BusinessActivityUncheckedUpdateWithoutLicense_activationInput = {
|
||||
@@ -798,10 +798,10 @@ export type BusinessActivityUncheckedUpdateWithoutLicense_activationInput = {
|
||||
guild_id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
consumer_id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
complexes?: Prisma.ComplexUncheckedUpdateManyWithoutBusiness_activityNestedInput
|
||||
permission_businesses?: Prisma.PermissionBusinessUncheckedUpdateManyWithoutBusinessNestedInput
|
||||
goods?: Prisma.GoodUncheckedUpdateManyWithoutBusiness_activityNestedInput
|
||||
customer_individuals?: Prisma.CustomerIndividualUncheckedUpdateManyWithoutBusiness_activityNestedInput
|
||||
customer_legals?: Prisma.CustomerLegalUncheckedUpdateManyWithoutBusiness_activityNestedInput
|
||||
goods?: Prisma.GoodUncheckedUpdateManyWithoutBusiness_activityNestedInput
|
||||
permission_businesses?: Prisma.PermissionBusinessUncheckedUpdateManyWithoutBusinessNestedInput
|
||||
}
|
||||
|
||||
export type BusinessActivityCreateWithoutPermission_businessesInput = {
|
||||
@@ -813,13 +813,13 @@ export type BusinessActivityCreateWithoutPermission_businessesInput = {
|
||||
invoice_number_sequence?: runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
created_at?: Date | string
|
||||
updated_at?: Date | string
|
||||
guild: Prisma.GuildCreateNestedOneWithoutBusiness_activitiesInput
|
||||
consumer: Prisma.ConsumerCreateNestedOneWithoutBusiness_activitiesInput
|
||||
license_activation?: Prisma.LicenseActivationCreateNestedOneWithoutBusiness_activityInput
|
||||
guild: Prisma.GuildCreateNestedOneWithoutBusiness_activitiesInput
|
||||
complexes?: Prisma.ComplexCreateNestedManyWithoutBusiness_activityInput
|
||||
goods?: Prisma.GoodCreateNestedManyWithoutBusiness_activityInput
|
||||
customer_individuals?: Prisma.CustomerIndividualCreateNestedManyWithoutBusiness_activityInput
|
||||
customer_legals?: Prisma.CustomerLegalCreateNestedManyWithoutBusiness_activityInput
|
||||
goods?: Prisma.GoodCreateNestedManyWithoutBusiness_activityInput
|
||||
license_activation?: Prisma.LicenseActivationCreateNestedOneWithoutBusiness_activityInput
|
||||
}
|
||||
|
||||
export type BusinessActivityUncheckedCreateWithoutPermission_businessesInput = {
|
||||
@@ -833,11 +833,11 @@ export type BusinessActivityUncheckedCreateWithoutPermission_businessesInput = {
|
||||
updated_at?: Date | string
|
||||
guild_id: string
|
||||
consumer_id: string
|
||||
license_activation?: Prisma.LicenseActivationUncheckedCreateNestedOneWithoutBusiness_activityInput
|
||||
complexes?: Prisma.ComplexUncheckedCreateNestedManyWithoutBusiness_activityInput
|
||||
goods?: Prisma.GoodUncheckedCreateNestedManyWithoutBusiness_activityInput
|
||||
customer_individuals?: Prisma.CustomerIndividualUncheckedCreateNestedManyWithoutBusiness_activityInput
|
||||
customer_legals?: Prisma.CustomerLegalUncheckedCreateNestedManyWithoutBusiness_activityInput
|
||||
goods?: Prisma.GoodUncheckedCreateNestedManyWithoutBusiness_activityInput
|
||||
license_activation?: Prisma.LicenseActivationUncheckedCreateNestedOneWithoutBusiness_activityInput
|
||||
}
|
||||
|
||||
export type BusinessActivityCreateOrConnectWithoutPermission_businessesInput = {
|
||||
@@ -865,13 +865,13 @@ export type BusinessActivityUpdateWithoutPermission_businessesInput = {
|
||||
invoice_number_sequence?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
guild?: Prisma.GuildUpdateOneRequiredWithoutBusiness_activitiesNestedInput
|
||||
consumer?: Prisma.ConsumerUpdateOneRequiredWithoutBusiness_activitiesNestedInput
|
||||
license_activation?: Prisma.LicenseActivationUpdateOneWithoutBusiness_activityNestedInput
|
||||
guild?: Prisma.GuildUpdateOneRequiredWithoutBusiness_activitiesNestedInput
|
||||
complexes?: Prisma.ComplexUpdateManyWithoutBusiness_activityNestedInput
|
||||
goods?: Prisma.GoodUpdateManyWithoutBusiness_activityNestedInput
|
||||
customer_individuals?: Prisma.CustomerIndividualUpdateManyWithoutBusiness_activityNestedInput
|
||||
customer_legals?: Prisma.CustomerLegalUpdateManyWithoutBusiness_activityNestedInput
|
||||
goods?: Prisma.GoodUpdateManyWithoutBusiness_activityNestedInput
|
||||
license_activation?: Prisma.LicenseActivationUpdateOneWithoutBusiness_activityNestedInput
|
||||
}
|
||||
|
||||
export type BusinessActivityUncheckedUpdateWithoutPermission_businessesInput = {
|
||||
@@ -885,11 +885,11 @@ export type BusinessActivityUncheckedUpdateWithoutPermission_businessesInput = {
|
||||
updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
guild_id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
consumer_id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
license_activation?: Prisma.LicenseActivationUncheckedUpdateOneWithoutBusiness_activityNestedInput
|
||||
complexes?: Prisma.ComplexUncheckedUpdateManyWithoutBusiness_activityNestedInput
|
||||
goods?: Prisma.GoodUncheckedUpdateManyWithoutBusiness_activityNestedInput
|
||||
customer_individuals?: Prisma.CustomerIndividualUncheckedUpdateManyWithoutBusiness_activityNestedInput
|
||||
customer_legals?: Prisma.CustomerLegalUncheckedUpdateManyWithoutBusiness_activityNestedInput
|
||||
goods?: Prisma.GoodUncheckedUpdateManyWithoutBusiness_activityNestedInput
|
||||
license_activation?: Prisma.LicenseActivationUncheckedUpdateOneWithoutBusiness_activityNestedInput
|
||||
}
|
||||
|
||||
export type BusinessActivityCreateWithoutConsumerInput = {
|
||||
@@ -902,12 +902,12 @@ export type BusinessActivityCreateWithoutConsumerInput = {
|
||||
created_at?: Date | string
|
||||
updated_at?: Date | string
|
||||
guild: Prisma.GuildCreateNestedOneWithoutBusiness_activitiesInput
|
||||
license_activation?: Prisma.LicenseActivationCreateNestedOneWithoutBusiness_activityInput
|
||||
complexes?: Prisma.ComplexCreateNestedManyWithoutBusiness_activityInput
|
||||
permission_businesses?: Prisma.PermissionBusinessCreateNestedManyWithoutBusinessInput
|
||||
goods?: Prisma.GoodCreateNestedManyWithoutBusiness_activityInput
|
||||
customer_individuals?: Prisma.CustomerIndividualCreateNestedManyWithoutBusiness_activityInput
|
||||
customer_legals?: Prisma.CustomerLegalCreateNestedManyWithoutBusiness_activityInput
|
||||
goods?: Prisma.GoodCreateNestedManyWithoutBusiness_activityInput
|
||||
license_activation?: Prisma.LicenseActivationCreateNestedOneWithoutBusiness_activityInput
|
||||
permission_businesses?: Prisma.PermissionBusinessCreateNestedManyWithoutBusinessInput
|
||||
}
|
||||
|
||||
export type BusinessActivityUncheckedCreateWithoutConsumerInput = {
|
||||
@@ -920,12 +920,12 @@ export type BusinessActivityUncheckedCreateWithoutConsumerInput = {
|
||||
created_at?: Date | string
|
||||
updated_at?: Date | string
|
||||
guild_id: string
|
||||
license_activation?: Prisma.LicenseActivationUncheckedCreateNestedOneWithoutBusiness_activityInput
|
||||
complexes?: Prisma.ComplexUncheckedCreateNestedManyWithoutBusiness_activityInput
|
||||
permission_businesses?: Prisma.PermissionBusinessUncheckedCreateNestedManyWithoutBusinessInput
|
||||
goods?: Prisma.GoodUncheckedCreateNestedManyWithoutBusiness_activityInput
|
||||
customer_individuals?: Prisma.CustomerIndividualUncheckedCreateNestedManyWithoutBusiness_activityInput
|
||||
customer_legals?: Prisma.CustomerLegalUncheckedCreateNestedManyWithoutBusiness_activityInput
|
||||
goods?: Prisma.GoodUncheckedCreateNestedManyWithoutBusiness_activityInput
|
||||
license_activation?: Prisma.LicenseActivationUncheckedCreateNestedOneWithoutBusiness_activityInput
|
||||
permission_businesses?: Prisma.PermissionBusinessUncheckedCreateNestedManyWithoutBusinessInput
|
||||
}
|
||||
|
||||
export type BusinessActivityCreateOrConnectWithoutConsumerInput = {
|
||||
@@ -979,13 +979,13 @@ export type BusinessActivityCreateWithoutComplexesInput = {
|
||||
invoice_number_sequence?: runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
created_at?: Date | string
|
||||
updated_at?: Date | string
|
||||
guild: Prisma.GuildCreateNestedOneWithoutBusiness_activitiesInput
|
||||
consumer: Prisma.ConsumerCreateNestedOneWithoutBusiness_activitiesInput
|
||||
license_activation?: Prisma.LicenseActivationCreateNestedOneWithoutBusiness_activityInput
|
||||
permission_businesses?: Prisma.PermissionBusinessCreateNestedManyWithoutBusinessInput
|
||||
goods?: Prisma.GoodCreateNestedManyWithoutBusiness_activityInput
|
||||
guild: Prisma.GuildCreateNestedOneWithoutBusiness_activitiesInput
|
||||
customer_individuals?: Prisma.CustomerIndividualCreateNestedManyWithoutBusiness_activityInput
|
||||
customer_legals?: Prisma.CustomerLegalCreateNestedManyWithoutBusiness_activityInput
|
||||
goods?: Prisma.GoodCreateNestedManyWithoutBusiness_activityInput
|
||||
license_activation?: Prisma.LicenseActivationCreateNestedOneWithoutBusiness_activityInput
|
||||
permission_businesses?: Prisma.PermissionBusinessCreateNestedManyWithoutBusinessInput
|
||||
}
|
||||
|
||||
export type BusinessActivityUncheckedCreateWithoutComplexesInput = {
|
||||
@@ -999,11 +999,11 @@ export type BusinessActivityUncheckedCreateWithoutComplexesInput = {
|
||||
updated_at?: Date | string
|
||||
guild_id: string
|
||||
consumer_id: string
|
||||
license_activation?: Prisma.LicenseActivationUncheckedCreateNestedOneWithoutBusiness_activityInput
|
||||
permission_businesses?: Prisma.PermissionBusinessUncheckedCreateNestedManyWithoutBusinessInput
|
||||
goods?: Prisma.GoodUncheckedCreateNestedManyWithoutBusiness_activityInput
|
||||
customer_individuals?: Prisma.CustomerIndividualUncheckedCreateNestedManyWithoutBusiness_activityInput
|
||||
customer_legals?: Prisma.CustomerLegalUncheckedCreateNestedManyWithoutBusiness_activityInput
|
||||
goods?: Prisma.GoodUncheckedCreateNestedManyWithoutBusiness_activityInput
|
||||
license_activation?: Prisma.LicenseActivationUncheckedCreateNestedOneWithoutBusiness_activityInput
|
||||
permission_businesses?: Prisma.PermissionBusinessUncheckedCreateNestedManyWithoutBusinessInput
|
||||
}
|
||||
|
||||
export type BusinessActivityCreateOrConnectWithoutComplexesInput = {
|
||||
@@ -1031,13 +1031,13 @@ export type BusinessActivityUpdateWithoutComplexesInput = {
|
||||
invoice_number_sequence?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
guild?: Prisma.GuildUpdateOneRequiredWithoutBusiness_activitiesNestedInput
|
||||
consumer?: Prisma.ConsumerUpdateOneRequiredWithoutBusiness_activitiesNestedInput
|
||||
license_activation?: Prisma.LicenseActivationUpdateOneWithoutBusiness_activityNestedInput
|
||||
permission_businesses?: Prisma.PermissionBusinessUpdateManyWithoutBusinessNestedInput
|
||||
goods?: Prisma.GoodUpdateManyWithoutBusiness_activityNestedInput
|
||||
guild?: Prisma.GuildUpdateOneRequiredWithoutBusiness_activitiesNestedInput
|
||||
customer_individuals?: Prisma.CustomerIndividualUpdateManyWithoutBusiness_activityNestedInput
|
||||
customer_legals?: Prisma.CustomerLegalUpdateManyWithoutBusiness_activityNestedInput
|
||||
goods?: Prisma.GoodUpdateManyWithoutBusiness_activityNestedInput
|
||||
license_activation?: Prisma.LicenseActivationUpdateOneWithoutBusiness_activityNestedInput
|
||||
permission_businesses?: Prisma.PermissionBusinessUpdateManyWithoutBusinessNestedInput
|
||||
}
|
||||
|
||||
export type BusinessActivityUncheckedUpdateWithoutComplexesInput = {
|
||||
@@ -1051,11 +1051,11 @@ export type BusinessActivityUncheckedUpdateWithoutComplexesInput = {
|
||||
updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
guild_id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
consumer_id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
license_activation?: Prisma.LicenseActivationUncheckedUpdateOneWithoutBusiness_activityNestedInput
|
||||
permission_businesses?: Prisma.PermissionBusinessUncheckedUpdateManyWithoutBusinessNestedInput
|
||||
goods?: Prisma.GoodUncheckedUpdateManyWithoutBusiness_activityNestedInput
|
||||
customer_individuals?: Prisma.CustomerIndividualUncheckedUpdateManyWithoutBusiness_activityNestedInput
|
||||
customer_legals?: Prisma.CustomerLegalUncheckedUpdateManyWithoutBusiness_activityNestedInput
|
||||
goods?: Prisma.GoodUncheckedUpdateManyWithoutBusiness_activityNestedInput
|
||||
license_activation?: Prisma.LicenseActivationUncheckedUpdateOneWithoutBusiness_activityNestedInput
|
||||
permission_businesses?: Prisma.PermissionBusinessUncheckedUpdateManyWithoutBusinessNestedInput
|
||||
}
|
||||
|
||||
export type BusinessActivityCreateWithoutGoodsInput = {
|
||||
@@ -1067,13 +1067,13 @@ export type BusinessActivityCreateWithoutGoodsInput = {
|
||||
invoice_number_sequence?: runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
created_at?: Date | string
|
||||
updated_at?: Date | string
|
||||
guild: Prisma.GuildCreateNestedOneWithoutBusiness_activitiesInput
|
||||
consumer: Prisma.ConsumerCreateNestedOneWithoutBusiness_activitiesInput
|
||||
license_activation?: Prisma.LicenseActivationCreateNestedOneWithoutBusiness_activityInput
|
||||
guild: Prisma.GuildCreateNestedOneWithoutBusiness_activitiesInput
|
||||
complexes?: Prisma.ComplexCreateNestedManyWithoutBusiness_activityInput
|
||||
permission_businesses?: Prisma.PermissionBusinessCreateNestedManyWithoutBusinessInput
|
||||
customer_individuals?: Prisma.CustomerIndividualCreateNestedManyWithoutBusiness_activityInput
|
||||
customer_legals?: Prisma.CustomerLegalCreateNestedManyWithoutBusiness_activityInput
|
||||
license_activation?: Prisma.LicenseActivationCreateNestedOneWithoutBusiness_activityInput
|
||||
permission_businesses?: Prisma.PermissionBusinessCreateNestedManyWithoutBusinessInput
|
||||
}
|
||||
|
||||
export type BusinessActivityUncheckedCreateWithoutGoodsInput = {
|
||||
@@ -1087,11 +1087,11 @@ export type BusinessActivityUncheckedCreateWithoutGoodsInput = {
|
||||
updated_at?: Date | string
|
||||
guild_id: string
|
||||
consumer_id: string
|
||||
license_activation?: Prisma.LicenseActivationUncheckedCreateNestedOneWithoutBusiness_activityInput
|
||||
complexes?: Prisma.ComplexUncheckedCreateNestedManyWithoutBusiness_activityInput
|
||||
permission_businesses?: Prisma.PermissionBusinessUncheckedCreateNestedManyWithoutBusinessInput
|
||||
customer_individuals?: Prisma.CustomerIndividualUncheckedCreateNestedManyWithoutBusiness_activityInput
|
||||
customer_legals?: Prisma.CustomerLegalUncheckedCreateNestedManyWithoutBusiness_activityInput
|
||||
license_activation?: Prisma.LicenseActivationUncheckedCreateNestedOneWithoutBusiness_activityInput
|
||||
permission_businesses?: Prisma.PermissionBusinessUncheckedCreateNestedManyWithoutBusinessInput
|
||||
}
|
||||
|
||||
export type BusinessActivityCreateOrConnectWithoutGoodsInput = {
|
||||
@@ -1119,13 +1119,13 @@ export type BusinessActivityUpdateWithoutGoodsInput = {
|
||||
invoice_number_sequence?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
guild?: Prisma.GuildUpdateOneRequiredWithoutBusiness_activitiesNestedInput
|
||||
consumer?: Prisma.ConsumerUpdateOneRequiredWithoutBusiness_activitiesNestedInput
|
||||
license_activation?: Prisma.LicenseActivationUpdateOneWithoutBusiness_activityNestedInput
|
||||
guild?: Prisma.GuildUpdateOneRequiredWithoutBusiness_activitiesNestedInput
|
||||
complexes?: Prisma.ComplexUpdateManyWithoutBusiness_activityNestedInput
|
||||
permission_businesses?: Prisma.PermissionBusinessUpdateManyWithoutBusinessNestedInput
|
||||
customer_individuals?: Prisma.CustomerIndividualUpdateManyWithoutBusiness_activityNestedInput
|
||||
customer_legals?: Prisma.CustomerLegalUpdateManyWithoutBusiness_activityNestedInput
|
||||
license_activation?: Prisma.LicenseActivationUpdateOneWithoutBusiness_activityNestedInput
|
||||
permission_businesses?: Prisma.PermissionBusinessUpdateManyWithoutBusinessNestedInput
|
||||
}
|
||||
|
||||
export type BusinessActivityUncheckedUpdateWithoutGoodsInput = {
|
||||
@@ -1139,11 +1139,11 @@ export type BusinessActivityUncheckedUpdateWithoutGoodsInput = {
|
||||
updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
guild_id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
consumer_id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
license_activation?: Prisma.LicenseActivationUncheckedUpdateOneWithoutBusiness_activityNestedInput
|
||||
complexes?: Prisma.ComplexUncheckedUpdateManyWithoutBusiness_activityNestedInput
|
||||
permission_businesses?: Prisma.PermissionBusinessUncheckedUpdateManyWithoutBusinessNestedInput
|
||||
customer_individuals?: Prisma.CustomerIndividualUncheckedUpdateManyWithoutBusiness_activityNestedInput
|
||||
customer_legals?: Prisma.CustomerLegalUncheckedUpdateManyWithoutBusiness_activityNestedInput
|
||||
license_activation?: Prisma.LicenseActivationUncheckedUpdateOneWithoutBusiness_activityNestedInput
|
||||
permission_businesses?: Prisma.PermissionBusinessUncheckedUpdateManyWithoutBusinessNestedInput
|
||||
}
|
||||
|
||||
export type BusinessActivityCreateWithoutGuildInput = {
|
||||
@@ -1156,12 +1156,12 @@ export type BusinessActivityCreateWithoutGuildInput = {
|
||||
created_at?: Date | string
|
||||
updated_at?: Date | string
|
||||
consumer: Prisma.ConsumerCreateNestedOneWithoutBusiness_activitiesInput
|
||||
license_activation?: Prisma.LicenseActivationCreateNestedOneWithoutBusiness_activityInput
|
||||
complexes?: Prisma.ComplexCreateNestedManyWithoutBusiness_activityInput
|
||||
permission_businesses?: Prisma.PermissionBusinessCreateNestedManyWithoutBusinessInput
|
||||
goods?: Prisma.GoodCreateNestedManyWithoutBusiness_activityInput
|
||||
customer_individuals?: Prisma.CustomerIndividualCreateNestedManyWithoutBusiness_activityInput
|
||||
customer_legals?: Prisma.CustomerLegalCreateNestedManyWithoutBusiness_activityInput
|
||||
goods?: Prisma.GoodCreateNestedManyWithoutBusiness_activityInput
|
||||
license_activation?: Prisma.LicenseActivationCreateNestedOneWithoutBusiness_activityInput
|
||||
permission_businesses?: Prisma.PermissionBusinessCreateNestedManyWithoutBusinessInput
|
||||
}
|
||||
|
||||
export type BusinessActivityUncheckedCreateWithoutGuildInput = {
|
||||
@@ -1174,12 +1174,12 @@ export type BusinessActivityUncheckedCreateWithoutGuildInput = {
|
||||
created_at?: Date | string
|
||||
updated_at?: Date | string
|
||||
consumer_id: string
|
||||
license_activation?: Prisma.LicenseActivationUncheckedCreateNestedOneWithoutBusiness_activityInput
|
||||
complexes?: Prisma.ComplexUncheckedCreateNestedManyWithoutBusiness_activityInput
|
||||
permission_businesses?: Prisma.PermissionBusinessUncheckedCreateNestedManyWithoutBusinessInput
|
||||
goods?: Prisma.GoodUncheckedCreateNestedManyWithoutBusiness_activityInput
|
||||
customer_individuals?: Prisma.CustomerIndividualUncheckedCreateNestedManyWithoutBusiness_activityInput
|
||||
customer_legals?: Prisma.CustomerLegalUncheckedCreateNestedManyWithoutBusiness_activityInput
|
||||
goods?: Prisma.GoodUncheckedCreateNestedManyWithoutBusiness_activityInput
|
||||
license_activation?: Prisma.LicenseActivationUncheckedCreateNestedOneWithoutBusiness_activityInput
|
||||
permission_businesses?: Prisma.PermissionBusinessUncheckedCreateNestedManyWithoutBusinessInput
|
||||
}
|
||||
|
||||
export type BusinessActivityCreateOrConnectWithoutGuildInput = {
|
||||
@@ -1217,13 +1217,13 @@ export type BusinessActivityCreateWithoutCustomer_individualsInput = {
|
||||
invoice_number_sequence?: runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
created_at?: Date | string
|
||||
updated_at?: Date | string
|
||||
guild: Prisma.GuildCreateNestedOneWithoutBusiness_activitiesInput
|
||||
consumer: Prisma.ConsumerCreateNestedOneWithoutBusiness_activitiesInput
|
||||
license_activation?: Prisma.LicenseActivationCreateNestedOneWithoutBusiness_activityInput
|
||||
guild: Prisma.GuildCreateNestedOneWithoutBusiness_activitiesInput
|
||||
complexes?: Prisma.ComplexCreateNestedManyWithoutBusiness_activityInput
|
||||
permission_businesses?: Prisma.PermissionBusinessCreateNestedManyWithoutBusinessInput
|
||||
goods?: Prisma.GoodCreateNestedManyWithoutBusiness_activityInput
|
||||
customer_legals?: Prisma.CustomerLegalCreateNestedManyWithoutBusiness_activityInput
|
||||
goods?: Prisma.GoodCreateNestedManyWithoutBusiness_activityInput
|
||||
license_activation?: Prisma.LicenseActivationCreateNestedOneWithoutBusiness_activityInput
|
||||
permission_businesses?: Prisma.PermissionBusinessCreateNestedManyWithoutBusinessInput
|
||||
}
|
||||
|
||||
export type BusinessActivityUncheckedCreateWithoutCustomer_individualsInput = {
|
||||
@@ -1237,11 +1237,11 @@ export type BusinessActivityUncheckedCreateWithoutCustomer_individualsInput = {
|
||||
updated_at?: Date | string
|
||||
guild_id: string
|
||||
consumer_id: string
|
||||
license_activation?: Prisma.LicenseActivationUncheckedCreateNestedOneWithoutBusiness_activityInput
|
||||
complexes?: Prisma.ComplexUncheckedCreateNestedManyWithoutBusiness_activityInput
|
||||
permission_businesses?: Prisma.PermissionBusinessUncheckedCreateNestedManyWithoutBusinessInput
|
||||
goods?: Prisma.GoodUncheckedCreateNestedManyWithoutBusiness_activityInput
|
||||
customer_legals?: Prisma.CustomerLegalUncheckedCreateNestedManyWithoutBusiness_activityInput
|
||||
goods?: Prisma.GoodUncheckedCreateNestedManyWithoutBusiness_activityInput
|
||||
license_activation?: Prisma.LicenseActivationUncheckedCreateNestedOneWithoutBusiness_activityInput
|
||||
permission_businesses?: Prisma.PermissionBusinessUncheckedCreateNestedManyWithoutBusinessInput
|
||||
}
|
||||
|
||||
export type BusinessActivityCreateOrConnectWithoutCustomer_individualsInput = {
|
||||
@@ -1269,13 +1269,13 @@ export type BusinessActivityUpdateWithoutCustomer_individualsInput = {
|
||||
invoice_number_sequence?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
guild?: Prisma.GuildUpdateOneRequiredWithoutBusiness_activitiesNestedInput
|
||||
consumer?: Prisma.ConsumerUpdateOneRequiredWithoutBusiness_activitiesNestedInput
|
||||
license_activation?: Prisma.LicenseActivationUpdateOneWithoutBusiness_activityNestedInput
|
||||
guild?: Prisma.GuildUpdateOneRequiredWithoutBusiness_activitiesNestedInput
|
||||
complexes?: Prisma.ComplexUpdateManyWithoutBusiness_activityNestedInput
|
||||
permission_businesses?: Prisma.PermissionBusinessUpdateManyWithoutBusinessNestedInput
|
||||
goods?: Prisma.GoodUpdateManyWithoutBusiness_activityNestedInput
|
||||
customer_legals?: Prisma.CustomerLegalUpdateManyWithoutBusiness_activityNestedInput
|
||||
goods?: Prisma.GoodUpdateManyWithoutBusiness_activityNestedInput
|
||||
license_activation?: Prisma.LicenseActivationUpdateOneWithoutBusiness_activityNestedInput
|
||||
permission_businesses?: Prisma.PermissionBusinessUpdateManyWithoutBusinessNestedInput
|
||||
}
|
||||
|
||||
export type BusinessActivityUncheckedUpdateWithoutCustomer_individualsInput = {
|
||||
@@ -1289,11 +1289,11 @@ export type BusinessActivityUncheckedUpdateWithoutCustomer_individualsInput = {
|
||||
updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
guild_id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
consumer_id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
license_activation?: Prisma.LicenseActivationUncheckedUpdateOneWithoutBusiness_activityNestedInput
|
||||
complexes?: Prisma.ComplexUncheckedUpdateManyWithoutBusiness_activityNestedInput
|
||||
permission_businesses?: Prisma.PermissionBusinessUncheckedUpdateManyWithoutBusinessNestedInput
|
||||
goods?: Prisma.GoodUncheckedUpdateManyWithoutBusiness_activityNestedInput
|
||||
customer_legals?: Prisma.CustomerLegalUncheckedUpdateManyWithoutBusiness_activityNestedInput
|
||||
goods?: Prisma.GoodUncheckedUpdateManyWithoutBusiness_activityNestedInput
|
||||
license_activation?: Prisma.LicenseActivationUncheckedUpdateOneWithoutBusiness_activityNestedInput
|
||||
permission_businesses?: Prisma.PermissionBusinessUncheckedUpdateManyWithoutBusinessNestedInput
|
||||
}
|
||||
|
||||
export type BusinessActivityCreateWithoutCustomer_legalsInput = {
|
||||
@@ -1305,13 +1305,13 @@ export type BusinessActivityCreateWithoutCustomer_legalsInput = {
|
||||
invoice_number_sequence?: runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
created_at?: Date | string
|
||||
updated_at?: Date | string
|
||||
guild: Prisma.GuildCreateNestedOneWithoutBusiness_activitiesInput
|
||||
consumer: Prisma.ConsumerCreateNestedOneWithoutBusiness_activitiesInput
|
||||
license_activation?: Prisma.LicenseActivationCreateNestedOneWithoutBusiness_activityInput
|
||||
guild: Prisma.GuildCreateNestedOneWithoutBusiness_activitiesInput
|
||||
complexes?: Prisma.ComplexCreateNestedManyWithoutBusiness_activityInput
|
||||
permission_businesses?: Prisma.PermissionBusinessCreateNestedManyWithoutBusinessInput
|
||||
goods?: Prisma.GoodCreateNestedManyWithoutBusiness_activityInput
|
||||
customer_individuals?: Prisma.CustomerIndividualCreateNestedManyWithoutBusiness_activityInput
|
||||
goods?: Prisma.GoodCreateNestedManyWithoutBusiness_activityInput
|
||||
license_activation?: Prisma.LicenseActivationCreateNestedOneWithoutBusiness_activityInput
|
||||
permission_businesses?: Prisma.PermissionBusinessCreateNestedManyWithoutBusinessInput
|
||||
}
|
||||
|
||||
export type BusinessActivityUncheckedCreateWithoutCustomer_legalsInput = {
|
||||
@@ -1325,11 +1325,11 @@ export type BusinessActivityUncheckedCreateWithoutCustomer_legalsInput = {
|
||||
updated_at?: Date | string
|
||||
guild_id: string
|
||||
consumer_id: string
|
||||
license_activation?: Prisma.LicenseActivationUncheckedCreateNestedOneWithoutBusiness_activityInput
|
||||
complexes?: Prisma.ComplexUncheckedCreateNestedManyWithoutBusiness_activityInput
|
||||
permission_businesses?: Prisma.PermissionBusinessUncheckedCreateNestedManyWithoutBusinessInput
|
||||
goods?: Prisma.GoodUncheckedCreateNestedManyWithoutBusiness_activityInput
|
||||
customer_individuals?: Prisma.CustomerIndividualUncheckedCreateNestedManyWithoutBusiness_activityInput
|
||||
goods?: Prisma.GoodUncheckedCreateNestedManyWithoutBusiness_activityInput
|
||||
license_activation?: Prisma.LicenseActivationUncheckedCreateNestedOneWithoutBusiness_activityInput
|
||||
permission_businesses?: Prisma.PermissionBusinessUncheckedCreateNestedManyWithoutBusinessInput
|
||||
}
|
||||
|
||||
export type BusinessActivityCreateOrConnectWithoutCustomer_legalsInput = {
|
||||
@@ -1357,13 +1357,13 @@ export type BusinessActivityUpdateWithoutCustomer_legalsInput = {
|
||||
invoice_number_sequence?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
guild?: Prisma.GuildUpdateOneRequiredWithoutBusiness_activitiesNestedInput
|
||||
consumer?: Prisma.ConsumerUpdateOneRequiredWithoutBusiness_activitiesNestedInput
|
||||
license_activation?: Prisma.LicenseActivationUpdateOneWithoutBusiness_activityNestedInput
|
||||
guild?: Prisma.GuildUpdateOneRequiredWithoutBusiness_activitiesNestedInput
|
||||
complexes?: Prisma.ComplexUpdateManyWithoutBusiness_activityNestedInput
|
||||
permission_businesses?: Prisma.PermissionBusinessUpdateManyWithoutBusinessNestedInput
|
||||
goods?: Prisma.GoodUpdateManyWithoutBusiness_activityNestedInput
|
||||
customer_individuals?: Prisma.CustomerIndividualUpdateManyWithoutBusiness_activityNestedInput
|
||||
goods?: Prisma.GoodUpdateManyWithoutBusiness_activityNestedInput
|
||||
license_activation?: Prisma.LicenseActivationUpdateOneWithoutBusiness_activityNestedInput
|
||||
permission_businesses?: Prisma.PermissionBusinessUpdateManyWithoutBusinessNestedInput
|
||||
}
|
||||
|
||||
export type BusinessActivityUncheckedUpdateWithoutCustomer_legalsInput = {
|
||||
@@ -1377,11 +1377,11 @@ export type BusinessActivityUncheckedUpdateWithoutCustomer_legalsInput = {
|
||||
updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
guild_id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
consumer_id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
license_activation?: Prisma.LicenseActivationUncheckedUpdateOneWithoutBusiness_activityNestedInput
|
||||
complexes?: Prisma.ComplexUncheckedUpdateManyWithoutBusiness_activityNestedInput
|
||||
permission_businesses?: Prisma.PermissionBusinessUncheckedUpdateManyWithoutBusinessNestedInput
|
||||
goods?: Prisma.GoodUncheckedUpdateManyWithoutBusiness_activityNestedInput
|
||||
customer_individuals?: Prisma.CustomerIndividualUncheckedUpdateManyWithoutBusiness_activityNestedInput
|
||||
goods?: Prisma.GoodUncheckedUpdateManyWithoutBusiness_activityNestedInput
|
||||
license_activation?: Prisma.LicenseActivationUncheckedUpdateOneWithoutBusiness_activityNestedInput
|
||||
permission_businesses?: Prisma.PermissionBusinessUncheckedUpdateManyWithoutBusinessNestedInput
|
||||
}
|
||||
|
||||
export type BusinessActivityCreateManyConsumerInput = {
|
||||
@@ -1406,12 +1406,12 @@ export type BusinessActivityUpdateWithoutConsumerInput = {
|
||||
created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
guild?: Prisma.GuildUpdateOneRequiredWithoutBusiness_activitiesNestedInput
|
||||
license_activation?: Prisma.LicenseActivationUpdateOneWithoutBusiness_activityNestedInput
|
||||
complexes?: Prisma.ComplexUpdateManyWithoutBusiness_activityNestedInput
|
||||
permission_businesses?: Prisma.PermissionBusinessUpdateManyWithoutBusinessNestedInput
|
||||
goods?: Prisma.GoodUpdateManyWithoutBusiness_activityNestedInput
|
||||
customer_individuals?: Prisma.CustomerIndividualUpdateManyWithoutBusiness_activityNestedInput
|
||||
customer_legals?: Prisma.CustomerLegalUpdateManyWithoutBusiness_activityNestedInput
|
||||
goods?: Prisma.GoodUpdateManyWithoutBusiness_activityNestedInput
|
||||
license_activation?: Prisma.LicenseActivationUpdateOneWithoutBusiness_activityNestedInput
|
||||
permission_businesses?: Prisma.PermissionBusinessUpdateManyWithoutBusinessNestedInput
|
||||
}
|
||||
|
||||
export type BusinessActivityUncheckedUpdateWithoutConsumerInput = {
|
||||
@@ -1424,12 +1424,12 @@ export type BusinessActivityUncheckedUpdateWithoutConsumerInput = {
|
||||
created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
guild_id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
license_activation?: Prisma.LicenseActivationUncheckedUpdateOneWithoutBusiness_activityNestedInput
|
||||
complexes?: Prisma.ComplexUncheckedUpdateManyWithoutBusiness_activityNestedInput
|
||||
permission_businesses?: Prisma.PermissionBusinessUncheckedUpdateManyWithoutBusinessNestedInput
|
||||
goods?: Prisma.GoodUncheckedUpdateManyWithoutBusiness_activityNestedInput
|
||||
customer_individuals?: Prisma.CustomerIndividualUncheckedUpdateManyWithoutBusiness_activityNestedInput
|
||||
customer_legals?: Prisma.CustomerLegalUncheckedUpdateManyWithoutBusiness_activityNestedInput
|
||||
goods?: Prisma.GoodUncheckedUpdateManyWithoutBusiness_activityNestedInput
|
||||
license_activation?: Prisma.LicenseActivationUncheckedUpdateOneWithoutBusiness_activityNestedInput
|
||||
permission_businesses?: Prisma.PermissionBusinessUncheckedUpdateManyWithoutBusinessNestedInput
|
||||
}
|
||||
|
||||
export type BusinessActivityUncheckedUpdateManyWithoutConsumerInput = {
|
||||
@@ -1466,12 +1466,12 @@ export type BusinessActivityUpdateWithoutGuildInput = {
|
||||
created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
consumer?: Prisma.ConsumerUpdateOneRequiredWithoutBusiness_activitiesNestedInput
|
||||
license_activation?: Prisma.LicenseActivationUpdateOneWithoutBusiness_activityNestedInput
|
||||
complexes?: Prisma.ComplexUpdateManyWithoutBusiness_activityNestedInput
|
||||
permission_businesses?: Prisma.PermissionBusinessUpdateManyWithoutBusinessNestedInput
|
||||
goods?: Prisma.GoodUpdateManyWithoutBusiness_activityNestedInput
|
||||
customer_individuals?: Prisma.CustomerIndividualUpdateManyWithoutBusiness_activityNestedInput
|
||||
customer_legals?: Prisma.CustomerLegalUpdateManyWithoutBusiness_activityNestedInput
|
||||
goods?: Prisma.GoodUpdateManyWithoutBusiness_activityNestedInput
|
||||
license_activation?: Prisma.LicenseActivationUpdateOneWithoutBusiness_activityNestedInput
|
||||
permission_businesses?: Prisma.PermissionBusinessUpdateManyWithoutBusinessNestedInput
|
||||
}
|
||||
|
||||
export type BusinessActivityUncheckedUpdateWithoutGuildInput = {
|
||||
@@ -1484,12 +1484,12 @@ export type BusinessActivityUncheckedUpdateWithoutGuildInput = {
|
||||
created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
consumer_id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
license_activation?: Prisma.LicenseActivationUncheckedUpdateOneWithoutBusiness_activityNestedInput
|
||||
complexes?: Prisma.ComplexUncheckedUpdateManyWithoutBusiness_activityNestedInput
|
||||
permission_businesses?: Prisma.PermissionBusinessUncheckedUpdateManyWithoutBusinessNestedInput
|
||||
goods?: Prisma.GoodUncheckedUpdateManyWithoutBusiness_activityNestedInput
|
||||
customer_individuals?: Prisma.CustomerIndividualUncheckedUpdateManyWithoutBusiness_activityNestedInput
|
||||
customer_legals?: Prisma.CustomerLegalUncheckedUpdateManyWithoutBusiness_activityNestedInput
|
||||
goods?: Prisma.GoodUncheckedUpdateManyWithoutBusiness_activityNestedInput
|
||||
license_activation?: Prisma.LicenseActivationUncheckedUpdateOneWithoutBusiness_activityNestedInput
|
||||
permission_businesses?: Prisma.PermissionBusinessUncheckedUpdateManyWithoutBusinessNestedInput
|
||||
}
|
||||
|
||||
export type BusinessActivityUncheckedUpdateManyWithoutGuildInput = {
|
||||
@@ -1511,18 +1511,18 @@ export type BusinessActivityUncheckedUpdateManyWithoutGuildInput = {
|
||||
|
||||
export type BusinessActivityCountOutputType = {
|
||||
complexes: number
|
||||
permission_businesses: number
|
||||
goods: number
|
||||
customer_individuals: number
|
||||
customer_legals: number
|
||||
goods: number
|
||||
permission_businesses: number
|
||||
}
|
||||
|
||||
export type BusinessActivityCountOutputTypeSelect<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
|
||||
complexes?: boolean | BusinessActivityCountOutputTypeCountComplexesArgs
|
||||
permission_businesses?: boolean | BusinessActivityCountOutputTypeCountPermission_businessesArgs
|
||||
goods?: boolean | BusinessActivityCountOutputTypeCountGoodsArgs
|
||||
customer_individuals?: boolean | BusinessActivityCountOutputTypeCountCustomer_individualsArgs
|
||||
customer_legals?: boolean | BusinessActivityCountOutputTypeCountCustomer_legalsArgs
|
||||
goods?: boolean | BusinessActivityCountOutputTypeCountGoodsArgs
|
||||
permission_businesses?: boolean | BusinessActivityCountOutputTypeCountPermission_businessesArgs
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1545,8 +1545,15 @@ export type BusinessActivityCountOutputTypeCountComplexesArgs<ExtArgs extends ru
|
||||
/**
|
||||
* BusinessActivityCountOutputType without action
|
||||
*/
|
||||
export type BusinessActivityCountOutputTypeCountPermission_businessesArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
|
||||
where?: Prisma.PermissionBusinessWhereInput
|
||||
export type BusinessActivityCountOutputTypeCountCustomer_individualsArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
|
||||
where?: Prisma.CustomerIndividualWhereInput
|
||||
}
|
||||
|
||||
/**
|
||||
* BusinessActivityCountOutputType without action
|
||||
*/
|
||||
export type BusinessActivityCountOutputTypeCountCustomer_legalsArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
|
||||
where?: Prisma.CustomerLegalWhereInput
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1559,15 +1566,8 @@ export type BusinessActivityCountOutputTypeCountGoodsArgs<ExtArgs extends runtim
|
||||
/**
|
||||
* BusinessActivityCountOutputType without action
|
||||
*/
|
||||
export type BusinessActivityCountOutputTypeCountCustomer_individualsArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
|
||||
where?: Prisma.CustomerIndividualWhereInput
|
||||
}
|
||||
|
||||
/**
|
||||
* BusinessActivityCountOutputType without action
|
||||
*/
|
||||
export type BusinessActivityCountOutputTypeCountCustomer_legalsArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
|
||||
where?: Prisma.CustomerLegalWhereInput
|
||||
export type BusinessActivityCountOutputTypeCountPermission_businessesArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
|
||||
where?: Prisma.PermissionBusinessWhereInput
|
||||
}
|
||||
|
||||
|
||||
@@ -1582,14 +1582,14 @@ export type BusinessActivitySelect<ExtArgs extends runtime.Types.Extensions.Inte
|
||||
updated_at?: boolean
|
||||
guild_id?: boolean
|
||||
consumer_id?: boolean
|
||||
guild?: boolean | Prisma.GuildDefaultArgs<ExtArgs>
|
||||
consumer?: boolean | Prisma.ConsumerDefaultArgs<ExtArgs>
|
||||
license_activation?: boolean | Prisma.BusinessActivity$license_activationArgs<ExtArgs>
|
||||
guild?: boolean | Prisma.GuildDefaultArgs<ExtArgs>
|
||||
complexes?: boolean | Prisma.BusinessActivity$complexesArgs<ExtArgs>
|
||||
permission_businesses?: boolean | Prisma.BusinessActivity$permission_businessesArgs<ExtArgs>
|
||||
goods?: boolean | Prisma.BusinessActivity$goodsArgs<ExtArgs>
|
||||
customer_individuals?: boolean | Prisma.BusinessActivity$customer_individualsArgs<ExtArgs>
|
||||
customer_legals?: boolean | Prisma.BusinessActivity$customer_legalsArgs<ExtArgs>
|
||||
goods?: boolean | Prisma.BusinessActivity$goodsArgs<ExtArgs>
|
||||
license_activation?: boolean | Prisma.BusinessActivity$license_activationArgs<ExtArgs>
|
||||
permission_businesses?: boolean | Prisma.BusinessActivity$permission_businessesArgs<ExtArgs>
|
||||
_count?: boolean | Prisma.BusinessActivityCountOutputTypeDefaultArgs<ExtArgs>
|
||||
}, ExtArgs["result"]["businessActivity"]>
|
||||
|
||||
@@ -1610,28 +1610,28 @@ export type BusinessActivitySelectScalar = {
|
||||
|
||||
export type BusinessActivityOmit<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetOmit<"id" | "economic_code" | "name" | "fiscal_id" | "partner_token" | "invoice_number_sequence" | "created_at" | "updated_at" | "guild_id" | "consumer_id", ExtArgs["result"]["businessActivity"]>
|
||||
export type BusinessActivityInclude<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
|
||||
guild?: boolean | Prisma.GuildDefaultArgs<ExtArgs>
|
||||
consumer?: boolean | Prisma.ConsumerDefaultArgs<ExtArgs>
|
||||
license_activation?: boolean | Prisma.BusinessActivity$license_activationArgs<ExtArgs>
|
||||
guild?: boolean | Prisma.GuildDefaultArgs<ExtArgs>
|
||||
complexes?: boolean | Prisma.BusinessActivity$complexesArgs<ExtArgs>
|
||||
permission_businesses?: boolean | Prisma.BusinessActivity$permission_businessesArgs<ExtArgs>
|
||||
goods?: boolean | Prisma.BusinessActivity$goodsArgs<ExtArgs>
|
||||
customer_individuals?: boolean | Prisma.BusinessActivity$customer_individualsArgs<ExtArgs>
|
||||
customer_legals?: boolean | Prisma.BusinessActivity$customer_legalsArgs<ExtArgs>
|
||||
goods?: boolean | Prisma.BusinessActivity$goodsArgs<ExtArgs>
|
||||
license_activation?: boolean | Prisma.BusinessActivity$license_activationArgs<ExtArgs>
|
||||
permission_businesses?: boolean | Prisma.BusinessActivity$permission_businessesArgs<ExtArgs>
|
||||
_count?: boolean | Prisma.BusinessActivityCountOutputTypeDefaultArgs<ExtArgs>
|
||||
}
|
||||
|
||||
export type $BusinessActivityPayload<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
|
||||
name: "BusinessActivity"
|
||||
objects: {
|
||||
guild: Prisma.$GuildPayload<ExtArgs>
|
||||
consumer: Prisma.$ConsumerPayload<ExtArgs>
|
||||
license_activation: Prisma.$LicenseActivationPayload<ExtArgs> | null
|
||||
guild: Prisma.$GuildPayload<ExtArgs>
|
||||
complexes: Prisma.$ComplexPayload<ExtArgs>[]
|
||||
permission_businesses: Prisma.$PermissionBusinessPayload<ExtArgs>[]
|
||||
goods: Prisma.$GoodPayload<ExtArgs>[]
|
||||
customer_individuals: Prisma.$CustomerIndividualPayload<ExtArgs>[]
|
||||
customer_legals: Prisma.$CustomerLegalPayload<ExtArgs>[]
|
||||
goods: Prisma.$GoodPayload<ExtArgs>[]
|
||||
license_activation: Prisma.$LicenseActivationPayload<ExtArgs> | null
|
||||
permission_businesses: Prisma.$PermissionBusinessPayload<ExtArgs>[]
|
||||
}
|
||||
scalars: runtime.Types.Extensions.GetPayloadResult<{
|
||||
id: string
|
||||
@@ -1984,14 +1984,14 @@ readonly fields: BusinessActivityFieldRefs;
|
||||
*/
|
||||
export interface Prisma__BusinessActivityClient<T, Null = never, ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs, GlobalOmitOptions = {}> extends Prisma.PrismaPromise<T> {
|
||||
readonly [Symbol.toStringTag]: "PrismaPromise"
|
||||
guild<T extends Prisma.GuildDefaultArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.GuildDefaultArgs<ExtArgs>>): Prisma.Prisma__GuildClient<runtime.Types.Result.GetResult<Prisma.$GuildPayload<ExtArgs>, T, "findUniqueOrThrow", GlobalOmitOptions> | Null, Null, ExtArgs, GlobalOmitOptions>
|
||||
consumer<T extends Prisma.ConsumerDefaultArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.ConsumerDefaultArgs<ExtArgs>>): Prisma.Prisma__ConsumerClient<runtime.Types.Result.GetResult<Prisma.$ConsumerPayload<ExtArgs>, T, "findUniqueOrThrow", GlobalOmitOptions> | Null, Null, ExtArgs, GlobalOmitOptions>
|
||||
license_activation<T extends Prisma.BusinessActivity$license_activationArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.BusinessActivity$license_activationArgs<ExtArgs>>): Prisma.Prisma__LicenseActivationClient<runtime.Types.Result.GetResult<Prisma.$LicenseActivationPayload<ExtArgs>, T, "findUniqueOrThrow", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions>
|
||||
guild<T extends Prisma.GuildDefaultArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.GuildDefaultArgs<ExtArgs>>): Prisma.Prisma__GuildClient<runtime.Types.Result.GetResult<Prisma.$GuildPayload<ExtArgs>, T, "findUniqueOrThrow", GlobalOmitOptions> | Null, Null, ExtArgs, GlobalOmitOptions>
|
||||
complexes<T extends Prisma.BusinessActivity$complexesArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.BusinessActivity$complexesArgs<ExtArgs>>): Prisma.PrismaPromise<runtime.Types.Result.GetResult<Prisma.$ComplexPayload<ExtArgs>, T, "findMany", GlobalOmitOptions> | Null>
|
||||
permission_businesses<T extends Prisma.BusinessActivity$permission_businessesArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.BusinessActivity$permission_businessesArgs<ExtArgs>>): Prisma.PrismaPromise<runtime.Types.Result.GetResult<Prisma.$PermissionBusinessPayload<ExtArgs>, T, "findMany", GlobalOmitOptions> | Null>
|
||||
goods<T extends Prisma.BusinessActivity$goodsArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.BusinessActivity$goodsArgs<ExtArgs>>): Prisma.PrismaPromise<runtime.Types.Result.GetResult<Prisma.$GoodPayload<ExtArgs>, T, "findMany", GlobalOmitOptions> | Null>
|
||||
customer_individuals<T extends Prisma.BusinessActivity$customer_individualsArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.BusinessActivity$customer_individualsArgs<ExtArgs>>): Prisma.PrismaPromise<runtime.Types.Result.GetResult<Prisma.$CustomerIndividualPayload<ExtArgs>, T, "findMany", GlobalOmitOptions> | Null>
|
||||
customer_legals<T extends Prisma.BusinessActivity$customer_legalsArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.BusinessActivity$customer_legalsArgs<ExtArgs>>): Prisma.PrismaPromise<runtime.Types.Result.GetResult<Prisma.$CustomerLegalPayload<ExtArgs>, T, "findMany", GlobalOmitOptions> | Null>
|
||||
goods<T extends Prisma.BusinessActivity$goodsArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.BusinessActivity$goodsArgs<ExtArgs>>): Prisma.PrismaPromise<runtime.Types.Result.GetResult<Prisma.$GoodPayload<ExtArgs>, T, "findMany", GlobalOmitOptions> | Null>
|
||||
license_activation<T extends Prisma.BusinessActivity$license_activationArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.BusinessActivity$license_activationArgs<ExtArgs>>): Prisma.Prisma__LicenseActivationClient<runtime.Types.Result.GetResult<Prisma.$LicenseActivationPayload<ExtArgs>, T, "findUniqueOrThrow", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions>
|
||||
permission_businesses<T extends Prisma.BusinessActivity$permission_businessesArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.BusinessActivity$permission_businessesArgs<ExtArgs>>): Prisma.PrismaPromise<runtime.Types.Result.GetResult<Prisma.$PermissionBusinessPayload<ExtArgs>, T, "findMany", GlobalOmitOptions> | Null>
|
||||
/**
|
||||
* Attaches callbacks for the resolution and/or rejection of the Promise.
|
||||
* @param onfulfilled The callback to execute when the Promise is resolved.
|
||||
@@ -2378,25 +2378,6 @@ export type BusinessActivityDeleteManyArgs<ExtArgs extends runtime.Types.Extensi
|
||||
limit?: number
|
||||
}
|
||||
|
||||
/**
|
||||
* BusinessActivity.license_activation
|
||||
*/
|
||||
export type BusinessActivity$license_activationArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
|
||||
/**
|
||||
* Select specific fields to fetch from the LicenseActivation
|
||||
*/
|
||||
select?: Prisma.LicenseActivationSelect<ExtArgs> | null
|
||||
/**
|
||||
* Omit specific fields from the LicenseActivation
|
||||
*/
|
||||
omit?: Prisma.LicenseActivationOmit<ExtArgs> | null
|
||||
/**
|
||||
* Choose, which related nodes to fetch as well
|
||||
*/
|
||||
include?: Prisma.LicenseActivationInclude<ExtArgs> | null
|
||||
where?: Prisma.LicenseActivationWhereInput
|
||||
}
|
||||
|
||||
/**
|
||||
* BusinessActivity.complexes
|
||||
*/
|
||||
@@ -2421,54 +2402,6 @@ export type BusinessActivity$complexesArgs<ExtArgs extends runtime.Types.Extensi
|
||||
distinct?: Prisma.ComplexScalarFieldEnum | Prisma.ComplexScalarFieldEnum[]
|
||||
}
|
||||
|
||||
/**
|
||||
* BusinessActivity.permission_businesses
|
||||
*/
|
||||
export type BusinessActivity$permission_businessesArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
|
||||
/**
|
||||
* Select specific fields to fetch from the PermissionBusiness
|
||||
*/
|
||||
select?: Prisma.PermissionBusinessSelect<ExtArgs> | null
|
||||
/**
|
||||
* Omit specific fields from the PermissionBusiness
|
||||
*/
|
||||
omit?: Prisma.PermissionBusinessOmit<ExtArgs> | null
|
||||
/**
|
||||
* Choose, which related nodes to fetch as well
|
||||
*/
|
||||
include?: Prisma.PermissionBusinessInclude<ExtArgs> | null
|
||||
where?: Prisma.PermissionBusinessWhereInput
|
||||
orderBy?: Prisma.PermissionBusinessOrderByWithRelationInput | Prisma.PermissionBusinessOrderByWithRelationInput[]
|
||||
cursor?: Prisma.PermissionBusinessWhereUniqueInput
|
||||
take?: number
|
||||
skip?: number
|
||||
distinct?: Prisma.PermissionBusinessScalarFieldEnum | Prisma.PermissionBusinessScalarFieldEnum[]
|
||||
}
|
||||
|
||||
/**
|
||||
* BusinessActivity.goods
|
||||
*/
|
||||
export type BusinessActivity$goodsArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
|
||||
/**
|
||||
* Select specific fields to fetch from the Good
|
||||
*/
|
||||
select?: Prisma.GoodSelect<ExtArgs> | null
|
||||
/**
|
||||
* Omit specific fields from the Good
|
||||
*/
|
||||
omit?: Prisma.GoodOmit<ExtArgs> | null
|
||||
/**
|
||||
* Choose, which related nodes to fetch as well
|
||||
*/
|
||||
include?: Prisma.GoodInclude<ExtArgs> | null
|
||||
where?: Prisma.GoodWhereInput
|
||||
orderBy?: Prisma.GoodOrderByWithRelationInput | Prisma.GoodOrderByWithRelationInput[]
|
||||
cursor?: Prisma.GoodWhereUniqueInput
|
||||
take?: number
|
||||
skip?: number
|
||||
distinct?: Prisma.GoodScalarFieldEnum | Prisma.GoodScalarFieldEnum[]
|
||||
}
|
||||
|
||||
/**
|
||||
* BusinessActivity.customer_individuals
|
||||
*/
|
||||
@@ -2517,6 +2450,73 @@ export type BusinessActivity$customer_legalsArgs<ExtArgs extends runtime.Types.E
|
||||
distinct?: Prisma.CustomerLegalScalarFieldEnum | Prisma.CustomerLegalScalarFieldEnum[]
|
||||
}
|
||||
|
||||
/**
|
||||
* BusinessActivity.goods
|
||||
*/
|
||||
export type BusinessActivity$goodsArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
|
||||
/**
|
||||
* Select specific fields to fetch from the Good
|
||||
*/
|
||||
select?: Prisma.GoodSelect<ExtArgs> | null
|
||||
/**
|
||||
* Omit specific fields from the Good
|
||||
*/
|
||||
omit?: Prisma.GoodOmit<ExtArgs> | null
|
||||
/**
|
||||
* Choose, which related nodes to fetch as well
|
||||
*/
|
||||
include?: Prisma.GoodInclude<ExtArgs> | null
|
||||
where?: Prisma.GoodWhereInput
|
||||
orderBy?: Prisma.GoodOrderByWithRelationInput | Prisma.GoodOrderByWithRelationInput[]
|
||||
cursor?: Prisma.GoodWhereUniqueInput
|
||||
take?: number
|
||||
skip?: number
|
||||
distinct?: Prisma.GoodScalarFieldEnum | Prisma.GoodScalarFieldEnum[]
|
||||
}
|
||||
|
||||
/**
|
||||
* BusinessActivity.license_activation
|
||||
*/
|
||||
export type BusinessActivity$license_activationArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
|
||||
/**
|
||||
* Select specific fields to fetch from the LicenseActivation
|
||||
*/
|
||||
select?: Prisma.LicenseActivationSelect<ExtArgs> | null
|
||||
/**
|
||||
* Omit specific fields from the LicenseActivation
|
||||
*/
|
||||
omit?: Prisma.LicenseActivationOmit<ExtArgs> | null
|
||||
/**
|
||||
* Choose, which related nodes to fetch as well
|
||||
*/
|
||||
include?: Prisma.LicenseActivationInclude<ExtArgs> | null
|
||||
where?: Prisma.LicenseActivationWhereInput
|
||||
}
|
||||
|
||||
/**
|
||||
* BusinessActivity.permission_businesses
|
||||
*/
|
||||
export type BusinessActivity$permission_businessesArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
|
||||
/**
|
||||
* Select specific fields to fetch from the PermissionBusiness
|
||||
*/
|
||||
select?: Prisma.PermissionBusinessSelect<ExtArgs> | null
|
||||
/**
|
||||
* Omit specific fields from the PermissionBusiness
|
||||
*/
|
||||
omit?: Prisma.PermissionBusinessOmit<ExtArgs> | null
|
||||
/**
|
||||
* Choose, which related nodes to fetch as well
|
||||
*/
|
||||
include?: Prisma.PermissionBusinessInclude<ExtArgs> | null
|
||||
where?: Prisma.PermissionBusinessWhereInput
|
||||
orderBy?: Prisma.PermissionBusinessOrderByWithRelationInput | Prisma.PermissionBusinessOrderByWithRelationInput[]
|
||||
cursor?: Prisma.PermissionBusinessWhereUniqueInput
|
||||
take?: number
|
||||
skip?: number
|
||||
distinct?: Prisma.PermissionBusinessScalarFieldEnum | Prisma.PermissionBusinessScalarFieldEnum[]
|
||||
}
|
||||
|
||||
/**
|
||||
* BusinessActivity without action
|
||||
*/
|
||||
|
||||
@@ -199,9 +199,9 @@ export type ComplexWhereInput = {
|
||||
updated_at?: Prisma.DateTimeFilter<"Complex"> | Date | string
|
||||
business_activity_id?: Prisma.StringFilter<"Complex"> | string
|
||||
business_activity?: Prisma.XOR<Prisma.BusinessActivityScalarRelationFilter, Prisma.BusinessActivityWhereInput>
|
||||
pos_list?: Prisma.PosListRelationFilter
|
||||
good_categories?: Prisma.GoodCategoryListRelationFilter
|
||||
permission_complexes?: Prisma.PermissionComplexListRelationFilter
|
||||
pos_list?: Prisma.PosListRelationFilter
|
||||
}
|
||||
|
||||
export type ComplexOrderByWithRelationInput = {
|
||||
@@ -213,9 +213,9 @@ export type ComplexOrderByWithRelationInput = {
|
||||
updated_at?: Prisma.SortOrder
|
||||
business_activity_id?: Prisma.SortOrder
|
||||
business_activity?: Prisma.BusinessActivityOrderByWithRelationInput
|
||||
pos_list?: Prisma.PosOrderByRelationAggregateInput
|
||||
good_categories?: Prisma.GoodCategoryOrderByRelationAggregateInput
|
||||
permission_complexes?: Prisma.PermissionComplexOrderByRelationAggregateInput
|
||||
pos_list?: Prisma.PosOrderByRelationAggregateInput
|
||||
_relevance?: Prisma.ComplexOrderByRelevanceInput
|
||||
}
|
||||
|
||||
@@ -231,9 +231,9 @@ export type ComplexWhereUniqueInput = Prisma.AtLeast<{
|
||||
updated_at?: Prisma.DateTimeFilter<"Complex"> | Date | string
|
||||
business_activity_id?: Prisma.StringFilter<"Complex"> | string
|
||||
business_activity?: Prisma.XOR<Prisma.BusinessActivityScalarRelationFilter, Prisma.BusinessActivityWhereInput>
|
||||
pos_list?: Prisma.PosListRelationFilter
|
||||
good_categories?: Prisma.GoodCategoryListRelationFilter
|
||||
permission_complexes?: Prisma.PermissionComplexListRelationFilter
|
||||
pos_list?: Prisma.PosListRelationFilter
|
||||
}, "id">
|
||||
|
||||
export type ComplexOrderByWithAggregationInput = {
|
||||
@@ -270,9 +270,9 @@ export type ComplexCreateInput = {
|
||||
created_at?: Date | string
|
||||
updated_at?: Date | string
|
||||
business_activity: Prisma.BusinessActivityCreateNestedOneWithoutComplexesInput
|
||||
pos_list?: Prisma.PosCreateNestedManyWithoutComplexInput
|
||||
good_categories?: Prisma.GoodCategoryCreateNestedManyWithoutComplexInput
|
||||
permission_complexes?: Prisma.PermissionComplexCreateNestedManyWithoutComplexInput
|
||||
pos_list?: Prisma.PosCreateNestedManyWithoutComplexInput
|
||||
}
|
||||
|
||||
export type ComplexUncheckedCreateInput = {
|
||||
@@ -283,9 +283,9 @@ export type ComplexUncheckedCreateInput = {
|
||||
created_at?: Date | string
|
||||
updated_at?: Date | string
|
||||
business_activity_id: string
|
||||
pos_list?: Prisma.PosUncheckedCreateNestedManyWithoutComplexInput
|
||||
good_categories?: Prisma.GoodCategoryUncheckedCreateNestedManyWithoutComplexInput
|
||||
permission_complexes?: Prisma.PermissionComplexUncheckedCreateNestedManyWithoutComplexInput
|
||||
pos_list?: Prisma.PosUncheckedCreateNestedManyWithoutComplexInput
|
||||
}
|
||||
|
||||
export type ComplexUpdateInput = {
|
||||
@@ -296,9 +296,9 @@ export type ComplexUpdateInput = {
|
||||
created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
business_activity?: Prisma.BusinessActivityUpdateOneRequiredWithoutComplexesNestedInput
|
||||
pos_list?: Prisma.PosUpdateManyWithoutComplexNestedInput
|
||||
good_categories?: Prisma.GoodCategoryUpdateManyWithoutComplexNestedInput
|
||||
permission_complexes?: Prisma.PermissionComplexUpdateManyWithoutComplexNestedInput
|
||||
pos_list?: Prisma.PosUpdateManyWithoutComplexNestedInput
|
||||
}
|
||||
|
||||
export type ComplexUncheckedUpdateInput = {
|
||||
@@ -309,9 +309,9 @@ export type ComplexUncheckedUpdateInput = {
|
||||
created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
business_activity_id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
pos_list?: Prisma.PosUncheckedUpdateManyWithoutComplexNestedInput
|
||||
good_categories?: Prisma.GoodCategoryUncheckedUpdateManyWithoutComplexNestedInput
|
||||
permission_complexes?: Prisma.PermissionComplexUncheckedUpdateManyWithoutComplexNestedInput
|
||||
pos_list?: Prisma.PosUncheckedUpdateManyWithoutComplexNestedInput
|
||||
}
|
||||
|
||||
export type ComplexCreateManyInput = {
|
||||
@@ -493,8 +493,8 @@ export type ComplexCreateWithoutPermission_complexesInput = {
|
||||
created_at?: Date | string
|
||||
updated_at?: Date | string
|
||||
business_activity: Prisma.BusinessActivityCreateNestedOneWithoutComplexesInput
|
||||
pos_list?: Prisma.PosCreateNestedManyWithoutComplexInput
|
||||
good_categories?: Prisma.GoodCategoryCreateNestedManyWithoutComplexInput
|
||||
pos_list?: Prisma.PosCreateNestedManyWithoutComplexInput
|
||||
}
|
||||
|
||||
export type ComplexUncheckedCreateWithoutPermission_complexesInput = {
|
||||
@@ -505,8 +505,8 @@ export type ComplexUncheckedCreateWithoutPermission_complexesInput = {
|
||||
created_at?: Date | string
|
||||
updated_at?: Date | string
|
||||
business_activity_id: string
|
||||
pos_list?: Prisma.PosUncheckedCreateNestedManyWithoutComplexInput
|
||||
good_categories?: Prisma.GoodCategoryUncheckedCreateNestedManyWithoutComplexInput
|
||||
pos_list?: Prisma.PosUncheckedCreateNestedManyWithoutComplexInput
|
||||
}
|
||||
|
||||
export type ComplexCreateOrConnectWithoutPermission_complexesInput = {
|
||||
@@ -533,8 +533,8 @@ export type ComplexUpdateWithoutPermission_complexesInput = {
|
||||
created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
business_activity?: Prisma.BusinessActivityUpdateOneRequiredWithoutComplexesNestedInput
|
||||
pos_list?: Prisma.PosUpdateManyWithoutComplexNestedInput
|
||||
good_categories?: Prisma.GoodCategoryUpdateManyWithoutComplexNestedInput
|
||||
pos_list?: Prisma.PosUpdateManyWithoutComplexNestedInput
|
||||
}
|
||||
|
||||
export type ComplexUncheckedUpdateWithoutPermission_complexesInput = {
|
||||
@@ -545,8 +545,8 @@ export type ComplexUncheckedUpdateWithoutPermission_complexesInput = {
|
||||
created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
business_activity_id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
pos_list?: Prisma.PosUncheckedUpdateManyWithoutComplexNestedInput
|
||||
good_categories?: Prisma.GoodCategoryUncheckedUpdateManyWithoutComplexNestedInput
|
||||
pos_list?: Prisma.PosUncheckedUpdateManyWithoutComplexNestedInput
|
||||
}
|
||||
|
||||
export type ComplexCreateWithoutBusiness_activityInput = {
|
||||
@@ -556,9 +556,9 @@ export type ComplexCreateWithoutBusiness_activityInput = {
|
||||
address?: string | null
|
||||
created_at?: Date | string
|
||||
updated_at?: Date | string
|
||||
pos_list?: Prisma.PosCreateNestedManyWithoutComplexInput
|
||||
good_categories?: Prisma.GoodCategoryCreateNestedManyWithoutComplexInput
|
||||
permission_complexes?: Prisma.PermissionComplexCreateNestedManyWithoutComplexInput
|
||||
pos_list?: Prisma.PosCreateNestedManyWithoutComplexInput
|
||||
}
|
||||
|
||||
export type ComplexUncheckedCreateWithoutBusiness_activityInput = {
|
||||
@@ -568,9 +568,9 @@ export type ComplexUncheckedCreateWithoutBusiness_activityInput = {
|
||||
address?: string | null
|
||||
created_at?: Date | string
|
||||
updated_at?: Date | string
|
||||
pos_list?: Prisma.PosUncheckedCreateNestedManyWithoutComplexInput
|
||||
good_categories?: Prisma.GoodCategoryUncheckedCreateNestedManyWithoutComplexInput
|
||||
permission_complexes?: Prisma.PermissionComplexUncheckedCreateNestedManyWithoutComplexInput
|
||||
pos_list?: Prisma.PosUncheckedCreateNestedManyWithoutComplexInput
|
||||
}
|
||||
|
||||
export type ComplexCreateOrConnectWithoutBusiness_activityInput = {
|
||||
@@ -684,8 +684,8 @@ export type ComplexCreateWithoutGood_categoriesInput = {
|
||||
created_at?: Date | string
|
||||
updated_at?: Date | string
|
||||
business_activity: Prisma.BusinessActivityCreateNestedOneWithoutComplexesInput
|
||||
pos_list?: Prisma.PosCreateNestedManyWithoutComplexInput
|
||||
permission_complexes?: Prisma.PermissionComplexCreateNestedManyWithoutComplexInput
|
||||
pos_list?: Prisma.PosCreateNestedManyWithoutComplexInput
|
||||
}
|
||||
|
||||
export type ComplexUncheckedCreateWithoutGood_categoriesInput = {
|
||||
@@ -696,8 +696,8 @@ export type ComplexUncheckedCreateWithoutGood_categoriesInput = {
|
||||
created_at?: Date | string
|
||||
updated_at?: Date | string
|
||||
business_activity_id: string
|
||||
pos_list?: Prisma.PosUncheckedCreateNestedManyWithoutComplexInput
|
||||
permission_complexes?: Prisma.PermissionComplexUncheckedCreateNestedManyWithoutComplexInput
|
||||
pos_list?: Prisma.PosUncheckedCreateNestedManyWithoutComplexInput
|
||||
}
|
||||
|
||||
export type ComplexCreateOrConnectWithoutGood_categoriesInput = {
|
||||
@@ -724,8 +724,8 @@ export type ComplexUpdateWithoutGood_categoriesInput = {
|
||||
created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
business_activity?: Prisma.BusinessActivityUpdateOneRequiredWithoutComplexesNestedInput
|
||||
pos_list?: Prisma.PosUpdateManyWithoutComplexNestedInput
|
||||
permission_complexes?: Prisma.PermissionComplexUpdateManyWithoutComplexNestedInput
|
||||
pos_list?: Prisma.PosUpdateManyWithoutComplexNestedInput
|
||||
}
|
||||
|
||||
export type ComplexUncheckedUpdateWithoutGood_categoriesInput = {
|
||||
@@ -736,8 +736,8 @@ export type ComplexUncheckedUpdateWithoutGood_categoriesInput = {
|
||||
created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
business_activity_id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
pos_list?: Prisma.PosUncheckedUpdateManyWithoutComplexNestedInput
|
||||
permission_complexes?: Prisma.PermissionComplexUncheckedUpdateManyWithoutComplexNestedInput
|
||||
pos_list?: Prisma.PosUncheckedUpdateManyWithoutComplexNestedInput
|
||||
}
|
||||
|
||||
export type ComplexCreateManyBusiness_activityInput = {
|
||||
@@ -756,9 +756,9 @@ export type ComplexUpdateWithoutBusiness_activityInput = {
|
||||
address?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
pos_list?: Prisma.PosUpdateManyWithoutComplexNestedInput
|
||||
good_categories?: Prisma.GoodCategoryUpdateManyWithoutComplexNestedInput
|
||||
permission_complexes?: Prisma.PermissionComplexUpdateManyWithoutComplexNestedInput
|
||||
pos_list?: Prisma.PosUpdateManyWithoutComplexNestedInput
|
||||
}
|
||||
|
||||
export type ComplexUncheckedUpdateWithoutBusiness_activityInput = {
|
||||
@@ -768,9 +768,9 @@ export type ComplexUncheckedUpdateWithoutBusiness_activityInput = {
|
||||
address?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
pos_list?: Prisma.PosUncheckedUpdateManyWithoutComplexNestedInput
|
||||
good_categories?: Prisma.GoodCategoryUncheckedUpdateManyWithoutComplexNestedInput
|
||||
permission_complexes?: Prisma.PermissionComplexUncheckedUpdateManyWithoutComplexNestedInput
|
||||
pos_list?: Prisma.PosUncheckedUpdateManyWithoutComplexNestedInput
|
||||
}
|
||||
|
||||
export type ComplexUncheckedUpdateManyWithoutBusiness_activityInput = {
|
||||
@@ -788,15 +788,15 @@ export type ComplexUncheckedUpdateManyWithoutBusiness_activityInput = {
|
||||
*/
|
||||
|
||||
export type ComplexCountOutputType = {
|
||||
pos_list: number
|
||||
good_categories: number
|
||||
permission_complexes: number
|
||||
pos_list: number
|
||||
}
|
||||
|
||||
export type ComplexCountOutputTypeSelect<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
|
||||
pos_list?: boolean | ComplexCountOutputTypeCountPos_listArgs
|
||||
good_categories?: boolean | ComplexCountOutputTypeCountGood_categoriesArgs
|
||||
permission_complexes?: boolean | ComplexCountOutputTypeCountPermission_complexesArgs
|
||||
pos_list?: boolean | ComplexCountOutputTypeCountPos_listArgs
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -809,13 +809,6 @@ export type ComplexCountOutputTypeDefaultArgs<ExtArgs extends runtime.Types.Exte
|
||||
select?: Prisma.ComplexCountOutputTypeSelect<ExtArgs> | null
|
||||
}
|
||||
|
||||
/**
|
||||
* ComplexCountOutputType without action
|
||||
*/
|
||||
export type ComplexCountOutputTypeCountPos_listArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
|
||||
where?: Prisma.PosWhereInput
|
||||
}
|
||||
|
||||
/**
|
||||
* ComplexCountOutputType without action
|
||||
*/
|
||||
@@ -830,6 +823,13 @@ export type ComplexCountOutputTypeCountPermission_complexesArgs<ExtArgs extends
|
||||
where?: Prisma.PermissionComplexWhereInput
|
||||
}
|
||||
|
||||
/**
|
||||
* ComplexCountOutputType without action
|
||||
*/
|
||||
export type ComplexCountOutputTypeCountPos_listArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
|
||||
where?: Prisma.PosWhereInput
|
||||
}
|
||||
|
||||
|
||||
export type ComplexSelect<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetSelect<{
|
||||
id?: boolean
|
||||
@@ -840,9 +840,9 @@ export type ComplexSelect<ExtArgs extends runtime.Types.Extensions.InternalArgs
|
||||
updated_at?: boolean
|
||||
business_activity_id?: boolean
|
||||
business_activity?: boolean | Prisma.BusinessActivityDefaultArgs<ExtArgs>
|
||||
pos_list?: boolean | Prisma.Complex$pos_listArgs<ExtArgs>
|
||||
good_categories?: boolean | Prisma.Complex$good_categoriesArgs<ExtArgs>
|
||||
permission_complexes?: boolean | Prisma.Complex$permission_complexesArgs<ExtArgs>
|
||||
pos_list?: boolean | Prisma.Complex$pos_listArgs<ExtArgs>
|
||||
_count?: boolean | Prisma.ComplexCountOutputTypeDefaultArgs<ExtArgs>
|
||||
}, ExtArgs["result"]["complex"]>
|
||||
|
||||
@@ -861,9 +861,9 @@ export type ComplexSelectScalar = {
|
||||
export type ComplexOmit<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetOmit<"id" | "name" | "branch_code" | "address" | "created_at" | "updated_at" | "business_activity_id", ExtArgs["result"]["complex"]>
|
||||
export type ComplexInclude<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
|
||||
business_activity?: boolean | Prisma.BusinessActivityDefaultArgs<ExtArgs>
|
||||
pos_list?: boolean | Prisma.Complex$pos_listArgs<ExtArgs>
|
||||
good_categories?: boolean | Prisma.Complex$good_categoriesArgs<ExtArgs>
|
||||
permission_complexes?: boolean | Prisma.Complex$permission_complexesArgs<ExtArgs>
|
||||
pos_list?: boolean | Prisma.Complex$pos_listArgs<ExtArgs>
|
||||
_count?: boolean | Prisma.ComplexCountOutputTypeDefaultArgs<ExtArgs>
|
||||
}
|
||||
|
||||
@@ -871,9 +871,9 @@ export type $ComplexPayload<ExtArgs extends runtime.Types.Extensions.InternalArg
|
||||
name: "Complex"
|
||||
objects: {
|
||||
business_activity: Prisma.$BusinessActivityPayload<ExtArgs>
|
||||
pos_list: Prisma.$PosPayload<ExtArgs>[]
|
||||
good_categories: Prisma.$GoodCategoryPayload<ExtArgs>[]
|
||||
permission_complexes: Prisma.$PermissionComplexPayload<ExtArgs>[]
|
||||
pos_list: Prisma.$PosPayload<ExtArgs>[]
|
||||
}
|
||||
scalars: runtime.Types.Extensions.GetPayloadResult<{
|
||||
id: string
|
||||
@@ -1224,9 +1224,9 @@ readonly fields: ComplexFieldRefs;
|
||||
export interface Prisma__ComplexClient<T, Null = never, ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs, GlobalOmitOptions = {}> extends Prisma.PrismaPromise<T> {
|
||||
readonly [Symbol.toStringTag]: "PrismaPromise"
|
||||
business_activity<T extends Prisma.BusinessActivityDefaultArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.BusinessActivityDefaultArgs<ExtArgs>>): Prisma.Prisma__BusinessActivityClient<runtime.Types.Result.GetResult<Prisma.$BusinessActivityPayload<ExtArgs>, T, "findUniqueOrThrow", GlobalOmitOptions> | Null, Null, ExtArgs, GlobalOmitOptions>
|
||||
pos_list<T extends Prisma.Complex$pos_listArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.Complex$pos_listArgs<ExtArgs>>): Prisma.PrismaPromise<runtime.Types.Result.GetResult<Prisma.$PosPayload<ExtArgs>, T, "findMany", GlobalOmitOptions> | Null>
|
||||
good_categories<T extends Prisma.Complex$good_categoriesArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.Complex$good_categoriesArgs<ExtArgs>>): Prisma.PrismaPromise<runtime.Types.Result.GetResult<Prisma.$GoodCategoryPayload<ExtArgs>, T, "findMany", GlobalOmitOptions> | Null>
|
||||
permission_complexes<T extends Prisma.Complex$permission_complexesArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.Complex$permission_complexesArgs<ExtArgs>>): Prisma.PrismaPromise<runtime.Types.Result.GetResult<Prisma.$PermissionComplexPayload<ExtArgs>, T, "findMany", GlobalOmitOptions> | Null>
|
||||
pos_list<T extends Prisma.Complex$pos_listArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.Complex$pos_listArgs<ExtArgs>>): Prisma.PrismaPromise<runtime.Types.Result.GetResult<Prisma.$PosPayload<ExtArgs>, T, "findMany", GlobalOmitOptions> | Null>
|
||||
/**
|
||||
* Attaches callbacks for the resolution and/or rejection of the Promise.
|
||||
* @param onfulfilled The callback to execute when the Promise is resolved.
|
||||
@@ -1610,30 +1610,6 @@ export type ComplexDeleteManyArgs<ExtArgs extends runtime.Types.Extensions.Inter
|
||||
limit?: number
|
||||
}
|
||||
|
||||
/**
|
||||
* Complex.pos_list
|
||||
*/
|
||||
export type Complex$pos_listArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
|
||||
/**
|
||||
* Select specific fields to fetch from the Pos
|
||||
*/
|
||||
select?: Prisma.PosSelect<ExtArgs> | null
|
||||
/**
|
||||
* Omit specific fields from the Pos
|
||||
*/
|
||||
omit?: Prisma.PosOmit<ExtArgs> | null
|
||||
/**
|
||||
* Choose, which related nodes to fetch as well
|
||||
*/
|
||||
include?: Prisma.PosInclude<ExtArgs> | null
|
||||
where?: Prisma.PosWhereInput
|
||||
orderBy?: Prisma.PosOrderByWithRelationInput | Prisma.PosOrderByWithRelationInput[]
|
||||
cursor?: Prisma.PosWhereUniqueInput
|
||||
take?: number
|
||||
skip?: number
|
||||
distinct?: Prisma.PosScalarFieldEnum | Prisma.PosScalarFieldEnum[]
|
||||
}
|
||||
|
||||
/**
|
||||
* Complex.good_categories
|
||||
*/
|
||||
@@ -1682,6 +1658,30 @@ export type Complex$permission_complexesArgs<ExtArgs extends runtime.Types.Exten
|
||||
distinct?: Prisma.PermissionComplexScalarFieldEnum | Prisma.PermissionComplexScalarFieldEnum[]
|
||||
}
|
||||
|
||||
/**
|
||||
* Complex.pos_list
|
||||
*/
|
||||
export type Complex$pos_listArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
|
||||
/**
|
||||
* Select specific fields to fetch from the Pos
|
||||
*/
|
||||
select?: Prisma.PosSelect<ExtArgs> | null
|
||||
/**
|
||||
* Omit specific fields from the Pos
|
||||
*/
|
||||
omit?: Prisma.PosOmit<ExtArgs> | null
|
||||
/**
|
||||
* Choose, which related nodes to fetch as well
|
||||
*/
|
||||
include?: Prisma.PosInclude<ExtArgs> | null
|
||||
where?: Prisma.PosWhereInput
|
||||
orderBy?: Prisma.PosOrderByWithRelationInput | Prisma.PosOrderByWithRelationInput[]
|
||||
cursor?: Prisma.PosWhereUniqueInput
|
||||
take?: number
|
||||
skip?: number
|
||||
distinct?: Prisma.PosScalarFieldEnum | Prisma.PosScalarFieldEnum[]
|
||||
}
|
||||
|
||||
/**
|
||||
* Complex without action
|
||||
*/
|
||||
|
||||
@@ -182,8 +182,8 @@ export type ConsumerWhereInput = {
|
||||
status?: Prisma.EnumConsumerStatusFilter<"Consumer"> | $Enums.ConsumerStatus
|
||||
created_at?: Prisma.DateTimeFilter<"Consumer"> | Date | string
|
||||
updated_at?: Prisma.DateTimeFilter<"Consumer"> | Date | string
|
||||
accounts?: Prisma.ConsumerAccountListRelationFilter
|
||||
business_activities?: Prisma.BusinessActivityListRelationFilter
|
||||
accounts?: Prisma.ConsumerAccountListRelationFilter
|
||||
individual?: Prisma.XOR<Prisma.ConsumerIndividualNullableScalarRelationFilter, Prisma.ConsumerIndividualWhereInput> | null
|
||||
legal?: Prisma.XOR<Prisma.ConsumerLegalNullableScalarRelationFilter, Prisma.ConsumerLegalWhereInput> | null
|
||||
}
|
||||
@@ -194,8 +194,8 @@ export type ConsumerOrderByWithRelationInput = {
|
||||
status?: Prisma.SortOrder
|
||||
created_at?: Prisma.SortOrder
|
||||
updated_at?: Prisma.SortOrder
|
||||
accounts?: Prisma.ConsumerAccountOrderByRelationAggregateInput
|
||||
business_activities?: Prisma.BusinessActivityOrderByRelationAggregateInput
|
||||
accounts?: Prisma.ConsumerAccountOrderByRelationAggregateInput
|
||||
individual?: Prisma.ConsumerIndividualOrderByWithRelationInput
|
||||
legal?: Prisma.ConsumerLegalOrderByWithRelationInput
|
||||
_relevance?: Prisma.ConsumerOrderByRelevanceInput
|
||||
@@ -210,8 +210,8 @@ export type ConsumerWhereUniqueInput = Prisma.AtLeast<{
|
||||
status?: Prisma.EnumConsumerStatusFilter<"Consumer"> | $Enums.ConsumerStatus
|
||||
created_at?: Prisma.DateTimeFilter<"Consumer"> | Date | string
|
||||
updated_at?: Prisma.DateTimeFilter<"Consumer"> | Date | string
|
||||
accounts?: Prisma.ConsumerAccountListRelationFilter
|
||||
business_activities?: Prisma.BusinessActivityListRelationFilter
|
||||
accounts?: Prisma.ConsumerAccountListRelationFilter
|
||||
individual?: Prisma.XOR<Prisma.ConsumerIndividualNullableScalarRelationFilter, Prisma.ConsumerIndividualWhereInput> | null
|
||||
legal?: Prisma.XOR<Prisma.ConsumerLegalNullableScalarRelationFilter, Prisma.ConsumerLegalWhereInput> | null
|
||||
}, "id">
|
||||
@@ -244,8 +244,8 @@ export type ConsumerCreateInput = {
|
||||
status?: $Enums.ConsumerStatus
|
||||
created_at?: Date | string
|
||||
updated_at?: Date | string
|
||||
accounts?: Prisma.ConsumerAccountCreateNestedManyWithoutConsumerInput
|
||||
business_activities?: Prisma.BusinessActivityCreateNestedManyWithoutConsumerInput
|
||||
accounts?: Prisma.ConsumerAccountCreateNestedManyWithoutConsumerInput
|
||||
individual?: Prisma.ConsumerIndividualCreateNestedOneWithoutConsumerInput
|
||||
legal?: Prisma.ConsumerLegalCreateNestedOneWithoutConsumerInput
|
||||
}
|
||||
@@ -256,8 +256,8 @@ export type ConsumerUncheckedCreateInput = {
|
||||
status?: $Enums.ConsumerStatus
|
||||
created_at?: Date | string
|
||||
updated_at?: Date | string
|
||||
accounts?: Prisma.ConsumerAccountUncheckedCreateNestedManyWithoutConsumerInput
|
||||
business_activities?: Prisma.BusinessActivityUncheckedCreateNestedManyWithoutConsumerInput
|
||||
accounts?: Prisma.ConsumerAccountUncheckedCreateNestedManyWithoutConsumerInput
|
||||
individual?: Prisma.ConsumerIndividualUncheckedCreateNestedOneWithoutConsumerInput
|
||||
legal?: Prisma.ConsumerLegalUncheckedCreateNestedOneWithoutConsumerInput
|
||||
}
|
||||
@@ -268,8 +268,8 @@ export type ConsumerUpdateInput = {
|
||||
status?: Prisma.EnumConsumerStatusFieldUpdateOperationsInput | $Enums.ConsumerStatus
|
||||
created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
accounts?: Prisma.ConsumerAccountUpdateManyWithoutConsumerNestedInput
|
||||
business_activities?: Prisma.BusinessActivityUpdateManyWithoutConsumerNestedInput
|
||||
accounts?: Prisma.ConsumerAccountUpdateManyWithoutConsumerNestedInput
|
||||
individual?: Prisma.ConsumerIndividualUpdateOneWithoutConsumerNestedInput
|
||||
legal?: Prisma.ConsumerLegalUpdateOneWithoutConsumerNestedInput
|
||||
}
|
||||
@@ -280,8 +280,8 @@ export type ConsumerUncheckedUpdateInput = {
|
||||
status?: Prisma.EnumConsumerStatusFieldUpdateOperationsInput | $Enums.ConsumerStatus
|
||||
created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
accounts?: Prisma.ConsumerAccountUncheckedUpdateManyWithoutConsumerNestedInput
|
||||
business_activities?: Prisma.BusinessActivityUncheckedUpdateManyWithoutConsumerNestedInput
|
||||
accounts?: Prisma.ConsumerAccountUncheckedUpdateManyWithoutConsumerNestedInput
|
||||
individual?: Prisma.ConsumerIndividualUncheckedUpdateOneWithoutConsumerNestedInput
|
||||
legal?: Prisma.ConsumerLegalUncheckedUpdateOneWithoutConsumerNestedInput
|
||||
}
|
||||
@@ -475,8 +475,8 @@ export type ConsumerCreateWithoutIndividualInput = {
|
||||
status?: $Enums.ConsumerStatus
|
||||
created_at?: Date | string
|
||||
updated_at?: Date | string
|
||||
accounts?: Prisma.ConsumerAccountCreateNestedManyWithoutConsumerInput
|
||||
business_activities?: Prisma.BusinessActivityCreateNestedManyWithoutConsumerInput
|
||||
accounts?: Prisma.ConsumerAccountCreateNestedManyWithoutConsumerInput
|
||||
legal?: Prisma.ConsumerLegalCreateNestedOneWithoutConsumerInput
|
||||
}
|
||||
|
||||
@@ -486,8 +486,8 @@ export type ConsumerUncheckedCreateWithoutIndividualInput = {
|
||||
status?: $Enums.ConsumerStatus
|
||||
created_at?: Date | string
|
||||
updated_at?: Date | string
|
||||
accounts?: Prisma.ConsumerAccountUncheckedCreateNestedManyWithoutConsumerInput
|
||||
business_activities?: Prisma.BusinessActivityUncheckedCreateNestedManyWithoutConsumerInput
|
||||
accounts?: Prisma.ConsumerAccountUncheckedCreateNestedManyWithoutConsumerInput
|
||||
legal?: Prisma.ConsumerLegalUncheckedCreateNestedOneWithoutConsumerInput
|
||||
}
|
||||
|
||||
@@ -513,8 +513,8 @@ export type ConsumerUpdateWithoutIndividualInput = {
|
||||
status?: Prisma.EnumConsumerStatusFieldUpdateOperationsInput | $Enums.ConsumerStatus
|
||||
created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
accounts?: Prisma.ConsumerAccountUpdateManyWithoutConsumerNestedInput
|
||||
business_activities?: Prisma.BusinessActivityUpdateManyWithoutConsumerNestedInput
|
||||
accounts?: Prisma.ConsumerAccountUpdateManyWithoutConsumerNestedInput
|
||||
legal?: Prisma.ConsumerLegalUpdateOneWithoutConsumerNestedInput
|
||||
}
|
||||
|
||||
@@ -524,8 +524,8 @@ export type ConsumerUncheckedUpdateWithoutIndividualInput = {
|
||||
status?: Prisma.EnumConsumerStatusFieldUpdateOperationsInput | $Enums.ConsumerStatus
|
||||
created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
accounts?: Prisma.ConsumerAccountUncheckedUpdateManyWithoutConsumerNestedInput
|
||||
business_activities?: Prisma.BusinessActivityUncheckedUpdateManyWithoutConsumerNestedInput
|
||||
accounts?: Prisma.ConsumerAccountUncheckedUpdateManyWithoutConsumerNestedInput
|
||||
legal?: Prisma.ConsumerLegalUncheckedUpdateOneWithoutConsumerNestedInput
|
||||
}
|
||||
|
||||
@@ -535,8 +535,8 @@ export type ConsumerCreateWithoutLegalInput = {
|
||||
status?: $Enums.ConsumerStatus
|
||||
created_at?: Date | string
|
||||
updated_at?: Date | string
|
||||
accounts?: Prisma.ConsumerAccountCreateNestedManyWithoutConsumerInput
|
||||
business_activities?: Prisma.BusinessActivityCreateNestedManyWithoutConsumerInput
|
||||
accounts?: Prisma.ConsumerAccountCreateNestedManyWithoutConsumerInput
|
||||
individual?: Prisma.ConsumerIndividualCreateNestedOneWithoutConsumerInput
|
||||
}
|
||||
|
||||
@@ -546,8 +546,8 @@ export type ConsumerUncheckedCreateWithoutLegalInput = {
|
||||
status?: $Enums.ConsumerStatus
|
||||
created_at?: Date | string
|
||||
updated_at?: Date | string
|
||||
accounts?: Prisma.ConsumerAccountUncheckedCreateNestedManyWithoutConsumerInput
|
||||
business_activities?: Prisma.BusinessActivityUncheckedCreateNestedManyWithoutConsumerInput
|
||||
accounts?: Prisma.ConsumerAccountUncheckedCreateNestedManyWithoutConsumerInput
|
||||
individual?: Prisma.ConsumerIndividualUncheckedCreateNestedOneWithoutConsumerInput
|
||||
}
|
||||
|
||||
@@ -573,8 +573,8 @@ export type ConsumerUpdateWithoutLegalInput = {
|
||||
status?: Prisma.EnumConsumerStatusFieldUpdateOperationsInput | $Enums.ConsumerStatus
|
||||
created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
accounts?: Prisma.ConsumerAccountUpdateManyWithoutConsumerNestedInput
|
||||
business_activities?: Prisma.BusinessActivityUpdateManyWithoutConsumerNestedInput
|
||||
accounts?: Prisma.ConsumerAccountUpdateManyWithoutConsumerNestedInput
|
||||
individual?: Prisma.ConsumerIndividualUpdateOneWithoutConsumerNestedInput
|
||||
}
|
||||
|
||||
@@ -584,8 +584,8 @@ export type ConsumerUncheckedUpdateWithoutLegalInput = {
|
||||
status?: Prisma.EnumConsumerStatusFieldUpdateOperationsInput | $Enums.ConsumerStatus
|
||||
created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
accounts?: Prisma.ConsumerAccountUncheckedUpdateManyWithoutConsumerNestedInput
|
||||
business_activities?: Prisma.BusinessActivityUncheckedUpdateManyWithoutConsumerNestedInput
|
||||
accounts?: Prisma.ConsumerAccountUncheckedUpdateManyWithoutConsumerNestedInput
|
||||
individual?: Prisma.ConsumerIndividualUncheckedUpdateOneWithoutConsumerNestedInput
|
||||
}
|
||||
|
||||
@@ -655,13 +655,13 @@ export type ConsumerUncheckedUpdateWithoutBusiness_activitiesInput = {
|
||||
*/
|
||||
|
||||
export type ConsumerCountOutputType = {
|
||||
accounts: number
|
||||
business_activities: number
|
||||
accounts: number
|
||||
}
|
||||
|
||||
export type ConsumerCountOutputTypeSelect<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
|
||||
accounts?: boolean | ConsumerCountOutputTypeCountAccountsArgs
|
||||
business_activities?: boolean | ConsumerCountOutputTypeCountBusiness_activitiesArgs
|
||||
accounts?: boolean | ConsumerCountOutputTypeCountAccountsArgs
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -677,15 +677,15 @@ export type ConsumerCountOutputTypeDefaultArgs<ExtArgs extends runtime.Types.Ext
|
||||
/**
|
||||
* ConsumerCountOutputType without action
|
||||
*/
|
||||
export type ConsumerCountOutputTypeCountAccountsArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
|
||||
where?: Prisma.ConsumerAccountWhereInput
|
||||
export type ConsumerCountOutputTypeCountBusiness_activitiesArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
|
||||
where?: Prisma.BusinessActivityWhereInput
|
||||
}
|
||||
|
||||
/**
|
||||
* ConsumerCountOutputType without action
|
||||
*/
|
||||
export type ConsumerCountOutputTypeCountBusiness_activitiesArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
|
||||
where?: Prisma.BusinessActivityWhereInput
|
||||
export type ConsumerCountOutputTypeCountAccountsArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
|
||||
where?: Prisma.ConsumerAccountWhereInput
|
||||
}
|
||||
|
||||
|
||||
@@ -695,8 +695,8 @@ export type ConsumerSelect<ExtArgs extends runtime.Types.Extensions.InternalArgs
|
||||
status?: boolean
|
||||
created_at?: boolean
|
||||
updated_at?: boolean
|
||||
accounts?: boolean | Prisma.Consumer$accountsArgs<ExtArgs>
|
||||
business_activities?: boolean | Prisma.Consumer$business_activitiesArgs<ExtArgs>
|
||||
accounts?: boolean | Prisma.Consumer$accountsArgs<ExtArgs>
|
||||
individual?: boolean | Prisma.Consumer$individualArgs<ExtArgs>
|
||||
legal?: boolean | Prisma.Consumer$legalArgs<ExtArgs>
|
||||
_count?: boolean | Prisma.ConsumerCountOutputTypeDefaultArgs<ExtArgs>
|
||||
@@ -714,8 +714,8 @@ export type ConsumerSelectScalar = {
|
||||
|
||||
export type ConsumerOmit<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetOmit<"id" | "type" | "status" | "created_at" | "updated_at", ExtArgs["result"]["consumer"]>
|
||||
export type ConsumerInclude<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
|
||||
accounts?: boolean | Prisma.Consumer$accountsArgs<ExtArgs>
|
||||
business_activities?: boolean | Prisma.Consumer$business_activitiesArgs<ExtArgs>
|
||||
accounts?: boolean | Prisma.Consumer$accountsArgs<ExtArgs>
|
||||
individual?: boolean | Prisma.Consumer$individualArgs<ExtArgs>
|
||||
legal?: boolean | Prisma.Consumer$legalArgs<ExtArgs>
|
||||
_count?: boolean | Prisma.ConsumerCountOutputTypeDefaultArgs<ExtArgs>
|
||||
@@ -724,8 +724,8 @@ export type ConsumerInclude<ExtArgs extends runtime.Types.Extensions.InternalArg
|
||||
export type $ConsumerPayload<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
|
||||
name: "Consumer"
|
||||
objects: {
|
||||
accounts: Prisma.$ConsumerAccountPayload<ExtArgs>[]
|
||||
business_activities: Prisma.$BusinessActivityPayload<ExtArgs>[]
|
||||
accounts: Prisma.$ConsumerAccountPayload<ExtArgs>[]
|
||||
individual: Prisma.$ConsumerIndividualPayload<ExtArgs> | null
|
||||
legal: Prisma.$ConsumerLegalPayload<ExtArgs> | null
|
||||
}
|
||||
@@ -1075,8 +1075,8 @@ readonly fields: ConsumerFieldRefs;
|
||||
*/
|
||||
export interface Prisma__ConsumerClient<T, Null = never, ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs, GlobalOmitOptions = {}> extends Prisma.PrismaPromise<T> {
|
||||
readonly [Symbol.toStringTag]: "PrismaPromise"
|
||||
accounts<T extends Prisma.Consumer$accountsArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.Consumer$accountsArgs<ExtArgs>>): Prisma.PrismaPromise<runtime.Types.Result.GetResult<Prisma.$ConsumerAccountPayload<ExtArgs>, T, "findMany", GlobalOmitOptions> | Null>
|
||||
business_activities<T extends Prisma.Consumer$business_activitiesArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.Consumer$business_activitiesArgs<ExtArgs>>): Prisma.PrismaPromise<runtime.Types.Result.GetResult<Prisma.$BusinessActivityPayload<ExtArgs>, T, "findMany", GlobalOmitOptions> | Null>
|
||||
accounts<T extends Prisma.Consumer$accountsArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.Consumer$accountsArgs<ExtArgs>>): Prisma.PrismaPromise<runtime.Types.Result.GetResult<Prisma.$ConsumerAccountPayload<ExtArgs>, T, "findMany", GlobalOmitOptions> | Null>
|
||||
individual<T extends Prisma.Consumer$individualArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.Consumer$individualArgs<ExtArgs>>): Prisma.Prisma__ConsumerIndividualClient<runtime.Types.Result.GetResult<Prisma.$ConsumerIndividualPayload<ExtArgs>, T, "findUniqueOrThrow", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions>
|
||||
legal<T extends Prisma.Consumer$legalArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.Consumer$legalArgs<ExtArgs>>): Prisma.Prisma__ConsumerLegalClient<runtime.Types.Result.GetResult<Prisma.$ConsumerLegalPayload<ExtArgs>, T, "findUniqueOrThrow", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions>
|
||||
/**
|
||||
@@ -1460,30 +1460,6 @@ export type ConsumerDeleteManyArgs<ExtArgs extends runtime.Types.Extensions.Inte
|
||||
limit?: number
|
||||
}
|
||||
|
||||
/**
|
||||
* Consumer.accounts
|
||||
*/
|
||||
export type Consumer$accountsArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
|
||||
/**
|
||||
* Select specific fields to fetch from the ConsumerAccount
|
||||
*/
|
||||
select?: Prisma.ConsumerAccountSelect<ExtArgs> | null
|
||||
/**
|
||||
* Omit specific fields from the ConsumerAccount
|
||||
*/
|
||||
omit?: Prisma.ConsumerAccountOmit<ExtArgs> | null
|
||||
/**
|
||||
* Choose, which related nodes to fetch as well
|
||||
*/
|
||||
include?: Prisma.ConsumerAccountInclude<ExtArgs> | null
|
||||
where?: Prisma.ConsumerAccountWhereInput
|
||||
orderBy?: Prisma.ConsumerAccountOrderByWithRelationInput | Prisma.ConsumerAccountOrderByWithRelationInput[]
|
||||
cursor?: Prisma.ConsumerAccountWhereUniqueInput
|
||||
take?: number
|
||||
skip?: number
|
||||
distinct?: Prisma.ConsumerAccountScalarFieldEnum | Prisma.ConsumerAccountScalarFieldEnum[]
|
||||
}
|
||||
|
||||
/**
|
||||
* Consumer.business_activities
|
||||
*/
|
||||
@@ -1508,6 +1484,30 @@ export type Consumer$business_activitiesArgs<ExtArgs extends runtime.Types.Exten
|
||||
distinct?: Prisma.BusinessActivityScalarFieldEnum | Prisma.BusinessActivityScalarFieldEnum[]
|
||||
}
|
||||
|
||||
/**
|
||||
* Consumer.accounts
|
||||
*/
|
||||
export type Consumer$accountsArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
|
||||
/**
|
||||
* Select specific fields to fetch from the ConsumerAccount
|
||||
*/
|
||||
select?: Prisma.ConsumerAccountSelect<ExtArgs> | null
|
||||
/**
|
||||
* Omit specific fields from the ConsumerAccount
|
||||
*/
|
||||
omit?: Prisma.ConsumerAccountOmit<ExtArgs> | null
|
||||
/**
|
||||
* Choose, which related nodes to fetch as well
|
||||
*/
|
||||
include?: Prisma.ConsumerAccountInclude<ExtArgs> | null
|
||||
where?: Prisma.ConsumerAccountWhereInput
|
||||
orderBy?: Prisma.ConsumerAccountOrderByWithRelationInput | Prisma.ConsumerAccountOrderByWithRelationInput[]
|
||||
cursor?: Prisma.ConsumerAccountWhereUniqueInput
|
||||
take?: number
|
||||
skip?: number
|
||||
distinct?: Prisma.ConsumerAccountScalarFieldEnum | Prisma.ConsumerAccountScalarFieldEnum[]
|
||||
}
|
||||
|
||||
/**
|
||||
* Consumer.individual
|
||||
*/
|
||||
|
||||
@@ -190,13 +190,14 @@ export type ConsumerAccountWhereInput = {
|
||||
updated_at?: Prisma.DateTimeFilter<"ConsumerAccount"> | Date | string
|
||||
consumer_id?: Prisma.StringFilter<"ConsumerAccount"> | string
|
||||
account_id?: Prisma.StringFilter<"ConsumerAccount"> | string
|
||||
consumer?: Prisma.XOR<Prisma.ConsumerScalarRelationFilter, Prisma.ConsumerWhereInput>
|
||||
account?: Prisma.XOR<Prisma.AccountScalarRelationFilter, Prisma.AccountWhereInput>
|
||||
pos?: Prisma.XOR<Prisma.PosNullableScalarRelationFilter, Prisma.PosWhereInput> | null
|
||||
permission?: Prisma.XOR<Prisma.PermissionConsumerNullableScalarRelationFilter, Prisma.PermissionConsumerWhereInput> | null
|
||||
account_allocation?: Prisma.XOR<Prisma.LicenseAccountAllocationNullableScalarRelationFilter, Prisma.LicenseAccountAllocationWhereInput> | null
|
||||
sales_invoices?: Prisma.SalesInvoiceListRelationFilter
|
||||
account_device?: Prisma.XOR<Prisma.ConsumerAccountDeviceNullableScalarRelationFilter, Prisma.ConsumerAccountDeviceWhereInput> | null
|
||||
consumer_account_good_favorites?: Prisma.ConsumerAccountGoodFavoriteListRelationFilter
|
||||
account?: Prisma.XOR<Prisma.AccountScalarRelationFilter, Prisma.AccountWhereInput>
|
||||
consumer?: Prisma.XOR<Prisma.ConsumerScalarRelationFilter, Prisma.ConsumerWhereInput>
|
||||
account_allocation?: Prisma.XOR<Prisma.LicenseAccountAllocationNullableScalarRelationFilter, Prisma.LicenseAccountAllocationWhereInput> | null
|
||||
permission?: Prisma.XOR<Prisma.PermissionConsumerNullableScalarRelationFilter, Prisma.PermissionConsumerWhereInput> | null
|
||||
pos?: Prisma.XOR<Prisma.PosNullableScalarRelationFilter, Prisma.PosWhereInput> | null
|
||||
sales_invoices?: Prisma.SalesInvoiceListRelationFilter
|
||||
}
|
||||
|
||||
export type ConsumerAccountOrderByWithRelationInput = {
|
||||
@@ -206,13 +207,14 @@ export type ConsumerAccountOrderByWithRelationInput = {
|
||||
updated_at?: Prisma.SortOrder
|
||||
consumer_id?: Prisma.SortOrder
|
||||
account_id?: Prisma.SortOrder
|
||||
consumer?: Prisma.ConsumerOrderByWithRelationInput
|
||||
account?: Prisma.AccountOrderByWithRelationInput
|
||||
pos?: Prisma.PosOrderByWithRelationInput
|
||||
permission?: Prisma.PermissionConsumerOrderByWithRelationInput
|
||||
account_allocation?: Prisma.LicenseAccountAllocationOrderByWithRelationInput
|
||||
sales_invoices?: Prisma.SalesInvoiceOrderByRelationAggregateInput
|
||||
account_device?: Prisma.ConsumerAccountDeviceOrderByWithRelationInput
|
||||
consumer_account_good_favorites?: Prisma.ConsumerAccountGoodFavoriteOrderByRelationAggregateInput
|
||||
account?: Prisma.AccountOrderByWithRelationInput
|
||||
consumer?: Prisma.ConsumerOrderByWithRelationInput
|
||||
account_allocation?: Prisma.LicenseAccountAllocationOrderByWithRelationInput
|
||||
permission?: Prisma.PermissionConsumerOrderByWithRelationInput
|
||||
pos?: Prisma.PosOrderByWithRelationInput
|
||||
sales_invoices?: Prisma.SalesInvoiceOrderByRelationAggregateInput
|
||||
_relevance?: Prisma.ConsumerAccountOrderByRelevanceInput
|
||||
}
|
||||
|
||||
@@ -226,13 +228,14 @@ export type ConsumerAccountWhereUniqueInput = Prisma.AtLeast<{
|
||||
created_at?: Prisma.DateTimeFilter<"ConsumerAccount"> | Date | string
|
||||
updated_at?: Prisma.DateTimeFilter<"ConsumerAccount"> | Date | string
|
||||
consumer_id?: Prisma.StringFilter<"ConsumerAccount"> | string
|
||||
consumer?: Prisma.XOR<Prisma.ConsumerScalarRelationFilter, Prisma.ConsumerWhereInput>
|
||||
account?: Prisma.XOR<Prisma.AccountScalarRelationFilter, Prisma.AccountWhereInput>
|
||||
pos?: Prisma.XOR<Prisma.PosNullableScalarRelationFilter, Prisma.PosWhereInput> | null
|
||||
permission?: Prisma.XOR<Prisma.PermissionConsumerNullableScalarRelationFilter, Prisma.PermissionConsumerWhereInput> | null
|
||||
account_allocation?: Prisma.XOR<Prisma.LicenseAccountAllocationNullableScalarRelationFilter, Prisma.LicenseAccountAllocationWhereInput> | null
|
||||
sales_invoices?: Prisma.SalesInvoiceListRelationFilter
|
||||
account_device?: Prisma.XOR<Prisma.ConsumerAccountDeviceNullableScalarRelationFilter, Prisma.ConsumerAccountDeviceWhereInput> | null
|
||||
consumer_account_good_favorites?: Prisma.ConsumerAccountGoodFavoriteListRelationFilter
|
||||
account?: Prisma.XOR<Prisma.AccountScalarRelationFilter, Prisma.AccountWhereInput>
|
||||
consumer?: Prisma.XOR<Prisma.ConsumerScalarRelationFilter, Prisma.ConsumerWhereInput>
|
||||
account_allocation?: Prisma.XOR<Prisma.LicenseAccountAllocationNullableScalarRelationFilter, Prisma.LicenseAccountAllocationWhereInput> | null
|
||||
permission?: Prisma.XOR<Prisma.PermissionConsumerNullableScalarRelationFilter, Prisma.PermissionConsumerWhereInput> | null
|
||||
pos?: Prisma.XOR<Prisma.PosNullableScalarRelationFilter, Prisma.PosWhereInput> | null
|
||||
sales_invoices?: Prisma.SalesInvoiceListRelationFilter
|
||||
}, "id" | "account_id">
|
||||
|
||||
export type ConsumerAccountOrderByWithAggregationInput = {
|
||||
@@ -264,13 +267,14 @@ export type ConsumerAccountCreateInput = {
|
||||
role: $Enums.ConsumerRole
|
||||
created_at?: Date | string
|
||||
updated_at?: Date | string
|
||||
consumer: Prisma.ConsumerCreateNestedOneWithoutAccountsInput
|
||||
account: Prisma.AccountCreateNestedOneWithoutConsumer_accountInput
|
||||
pos?: Prisma.PosCreateNestedOneWithoutAccountInput
|
||||
permission?: Prisma.PermissionConsumerCreateNestedOneWithoutConsumer_accountInput
|
||||
account_allocation?: Prisma.LicenseAccountAllocationCreateNestedOneWithoutAccountInput
|
||||
sales_invoices?: Prisma.SalesInvoiceCreateNestedManyWithoutConsumer_accountInput
|
||||
account_device?: Prisma.ConsumerAccountDeviceCreateNestedOneWithoutConsumer_accountInput
|
||||
consumer_account_good_favorites?: Prisma.ConsumerAccountGoodFavoriteCreateNestedManyWithoutConsumer_accountInput
|
||||
account: Prisma.AccountCreateNestedOneWithoutConsumer_accountInput
|
||||
consumer: Prisma.ConsumerCreateNestedOneWithoutAccountsInput
|
||||
account_allocation?: Prisma.LicenseAccountAllocationCreateNestedOneWithoutAccountInput
|
||||
permission?: Prisma.PermissionConsumerCreateNestedOneWithoutConsumer_accountInput
|
||||
pos?: Prisma.PosCreateNestedOneWithoutAccountInput
|
||||
sales_invoices?: Prisma.SalesInvoiceCreateNestedManyWithoutConsumer_accountInput
|
||||
}
|
||||
|
||||
export type ConsumerAccountUncheckedCreateInput = {
|
||||
@@ -280,11 +284,12 @@ export type ConsumerAccountUncheckedCreateInput = {
|
||||
updated_at?: Date | string
|
||||
consumer_id: string
|
||||
account_id: string
|
||||
pos?: Prisma.PosUncheckedCreateNestedOneWithoutAccountInput
|
||||
permission?: Prisma.PermissionConsumerUncheckedCreateNestedOneWithoutConsumer_accountInput
|
||||
account_allocation?: Prisma.LicenseAccountAllocationUncheckedCreateNestedOneWithoutAccountInput
|
||||
sales_invoices?: Prisma.SalesInvoiceUncheckedCreateNestedManyWithoutConsumer_accountInput
|
||||
account_device?: Prisma.ConsumerAccountDeviceUncheckedCreateNestedOneWithoutConsumer_accountInput
|
||||
consumer_account_good_favorites?: Prisma.ConsumerAccountGoodFavoriteUncheckedCreateNestedManyWithoutConsumer_accountInput
|
||||
account_allocation?: Prisma.LicenseAccountAllocationUncheckedCreateNestedOneWithoutAccountInput
|
||||
permission?: Prisma.PermissionConsumerUncheckedCreateNestedOneWithoutConsumer_accountInput
|
||||
pos?: Prisma.PosUncheckedCreateNestedOneWithoutAccountInput
|
||||
sales_invoices?: Prisma.SalesInvoiceUncheckedCreateNestedManyWithoutConsumer_accountInput
|
||||
}
|
||||
|
||||
export type ConsumerAccountUpdateInput = {
|
||||
@@ -292,13 +297,14 @@ export type ConsumerAccountUpdateInput = {
|
||||
role?: Prisma.EnumConsumerRoleFieldUpdateOperationsInput | $Enums.ConsumerRole
|
||||
created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
consumer?: Prisma.ConsumerUpdateOneRequiredWithoutAccountsNestedInput
|
||||
account?: Prisma.AccountUpdateOneRequiredWithoutConsumer_accountNestedInput
|
||||
pos?: Prisma.PosUpdateOneWithoutAccountNestedInput
|
||||
permission?: Prisma.PermissionConsumerUpdateOneWithoutConsumer_accountNestedInput
|
||||
account_allocation?: Prisma.LicenseAccountAllocationUpdateOneWithoutAccountNestedInput
|
||||
sales_invoices?: Prisma.SalesInvoiceUpdateManyWithoutConsumer_accountNestedInput
|
||||
account_device?: Prisma.ConsumerAccountDeviceUpdateOneWithoutConsumer_accountNestedInput
|
||||
consumer_account_good_favorites?: Prisma.ConsumerAccountGoodFavoriteUpdateManyWithoutConsumer_accountNestedInput
|
||||
account?: Prisma.AccountUpdateOneRequiredWithoutConsumer_accountNestedInput
|
||||
consumer?: Prisma.ConsumerUpdateOneRequiredWithoutAccountsNestedInput
|
||||
account_allocation?: Prisma.LicenseAccountAllocationUpdateOneWithoutAccountNestedInput
|
||||
permission?: Prisma.PermissionConsumerUpdateOneWithoutConsumer_accountNestedInput
|
||||
pos?: Prisma.PosUpdateOneWithoutAccountNestedInput
|
||||
sales_invoices?: Prisma.SalesInvoiceUpdateManyWithoutConsumer_accountNestedInput
|
||||
}
|
||||
|
||||
export type ConsumerAccountUncheckedUpdateInput = {
|
||||
@@ -308,11 +314,12 @@ export type ConsumerAccountUncheckedUpdateInput = {
|
||||
updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
consumer_id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
account_id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
pos?: Prisma.PosUncheckedUpdateOneWithoutAccountNestedInput
|
||||
permission?: Prisma.PermissionConsumerUncheckedUpdateOneWithoutConsumer_accountNestedInput
|
||||
account_allocation?: Prisma.LicenseAccountAllocationUncheckedUpdateOneWithoutAccountNestedInput
|
||||
sales_invoices?: Prisma.SalesInvoiceUncheckedUpdateManyWithoutConsumer_accountNestedInput
|
||||
account_device?: Prisma.ConsumerAccountDeviceUncheckedUpdateOneWithoutConsumer_accountNestedInput
|
||||
consumer_account_good_favorites?: Prisma.ConsumerAccountGoodFavoriteUncheckedUpdateManyWithoutConsumer_accountNestedInput
|
||||
account_allocation?: Prisma.LicenseAccountAllocationUncheckedUpdateOneWithoutAccountNestedInput
|
||||
permission?: Prisma.PermissionConsumerUncheckedUpdateOneWithoutConsumer_accountNestedInput
|
||||
pos?: Prisma.PosUncheckedUpdateOneWithoutAccountNestedInput
|
||||
sales_invoices?: Prisma.SalesInvoiceUncheckedUpdateManyWithoutConsumer_accountNestedInput
|
||||
}
|
||||
|
||||
export type ConsumerAccountCreateManyInput = {
|
||||
@@ -529,6 +536,20 @@ export type ConsumerAccountUpdateOneRequiredWithoutPosNestedInput = {
|
||||
update?: Prisma.XOR<Prisma.XOR<Prisma.ConsumerAccountUpdateToOneWithWhereWithoutPosInput, Prisma.ConsumerAccountUpdateWithoutPosInput>, Prisma.ConsumerAccountUncheckedUpdateWithoutPosInput>
|
||||
}
|
||||
|
||||
export type ConsumerAccountCreateNestedOneWithoutConsumer_account_good_favoritesInput = {
|
||||
create?: Prisma.XOR<Prisma.ConsumerAccountCreateWithoutConsumer_account_good_favoritesInput, Prisma.ConsumerAccountUncheckedCreateWithoutConsumer_account_good_favoritesInput>
|
||||
connectOrCreate?: Prisma.ConsumerAccountCreateOrConnectWithoutConsumer_account_good_favoritesInput
|
||||
connect?: Prisma.ConsumerAccountWhereUniqueInput
|
||||
}
|
||||
|
||||
export type ConsumerAccountUpdateOneRequiredWithoutConsumer_account_good_favoritesNestedInput = {
|
||||
create?: Prisma.XOR<Prisma.ConsumerAccountCreateWithoutConsumer_account_good_favoritesInput, Prisma.ConsumerAccountUncheckedCreateWithoutConsumer_account_good_favoritesInput>
|
||||
connectOrCreate?: Prisma.ConsumerAccountCreateOrConnectWithoutConsumer_account_good_favoritesInput
|
||||
upsert?: Prisma.ConsumerAccountUpsertWithoutConsumer_account_good_favoritesInput
|
||||
connect?: Prisma.ConsumerAccountWhereUniqueInput
|
||||
update?: Prisma.XOR<Prisma.XOR<Prisma.ConsumerAccountUpdateToOneWithWhereWithoutConsumer_account_good_favoritesInput, Prisma.ConsumerAccountUpdateWithoutConsumer_account_good_favoritesInput>, Prisma.ConsumerAccountUncheckedUpdateWithoutConsumer_account_good_favoritesInput>
|
||||
}
|
||||
|
||||
export type ConsumerAccountCreateNestedOneWithoutSales_invoicesInput = {
|
||||
create?: Prisma.XOR<Prisma.ConsumerAccountCreateWithoutSales_invoicesInput, Prisma.ConsumerAccountUncheckedCreateWithoutSales_invoicesInput>
|
||||
connectOrCreate?: Prisma.ConsumerAccountCreateOrConnectWithoutSales_invoicesInput
|
||||
@@ -548,12 +569,13 @@ export type ConsumerAccountCreateWithoutAccountInput = {
|
||||
role: $Enums.ConsumerRole
|
||||
created_at?: Date | string
|
||||
updated_at?: Date | string
|
||||
consumer: Prisma.ConsumerCreateNestedOneWithoutAccountsInput
|
||||
pos?: Prisma.PosCreateNestedOneWithoutAccountInput
|
||||
permission?: Prisma.PermissionConsumerCreateNestedOneWithoutConsumer_accountInput
|
||||
account_allocation?: Prisma.LicenseAccountAllocationCreateNestedOneWithoutAccountInput
|
||||
sales_invoices?: Prisma.SalesInvoiceCreateNestedManyWithoutConsumer_accountInput
|
||||
account_device?: Prisma.ConsumerAccountDeviceCreateNestedOneWithoutConsumer_accountInput
|
||||
consumer_account_good_favorites?: Prisma.ConsumerAccountGoodFavoriteCreateNestedManyWithoutConsumer_accountInput
|
||||
consumer: Prisma.ConsumerCreateNestedOneWithoutAccountsInput
|
||||
account_allocation?: Prisma.LicenseAccountAllocationCreateNestedOneWithoutAccountInput
|
||||
permission?: Prisma.PermissionConsumerCreateNestedOneWithoutConsumer_accountInput
|
||||
pos?: Prisma.PosCreateNestedOneWithoutAccountInput
|
||||
sales_invoices?: Prisma.SalesInvoiceCreateNestedManyWithoutConsumer_accountInput
|
||||
}
|
||||
|
||||
export type ConsumerAccountUncheckedCreateWithoutAccountInput = {
|
||||
@@ -562,11 +584,12 @@ export type ConsumerAccountUncheckedCreateWithoutAccountInput = {
|
||||
created_at?: Date | string
|
||||
updated_at?: Date | string
|
||||
consumer_id: string
|
||||
pos?: Prisma.PosUncheckedCreateNestedOneWithoutAccountInput
|
||||
permission?: Prisma.PermissionConsumerUncheckedCreateNestedOneWithoutConsumer_accountInput
|
||||
account_allocation?: Prisma.LicenseAccountAllocationUncheckedCreateNestedOneWithoutAccountInput
|
||||
sales_invoices?: Prisma.SalesInvoiceUncheckedCreateNestedManyWithoutConsumer_accountInput
|
||||
account_device?: Prisma.ConsumerAccountDeviceUncheckedCreateNestedOneWithoutConsumer_accountInput
|
||||
consumer_account_good_favorites?: Prisma.ConsumerAccountGoodFavoriteUncheckedCreateNestedManyWithoutConsumer_accountInput
|
||||
account_allocation?: Prisma.LicenseAccountAllocationUncheckedCreateNestedOneWithoutAccountInput
|
||||
permission?: Prisma.PermissionConsumerUncheckedCreateNestedOneWithoutConsumer_accountInput
|
||||
pos?: Prisma.PosUncheckedCreateNestedOneWithoutAccountInput
|
||||
sales_invoices?: Prisma.SalesInvoiceUncheckedCreateNestedManyWithoutConsumer_accountInput
|
||||
}
|
||||
|
||||
export type ConsumerAccountCreateOrConnectWithoutAccountInput = {
|
||||
@@ -590,12 +613,13 @@ export type ConsumerAccountUpdateWithoutAccountInput = {
|
||||
role?: Prisma.EnumConsumerRoleFieldUpdateOperationsInput | $Enums.ConsumerRole
|
||||
created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
consumer?: Prisma.ConsumerUpdateOneRequiredWithoutAccountsNestedInput
|
||||
pos?: Prisma.PosUpdateOneWithoutAccountNestedInput
|
||||
permission?: Prisma.PermissionConsumerUpdateOneWithoutConsumer_accountNestedInput
|
||||
account_allocation?: Prisma.LicenseAccountAllocationUpdateOneWithoutAccountNestedInput
|
||||
sales_invoices?: Prisma.SalesInvoiceUpdateManyWithoutConsumer_accountNestedInput
|
||||
account_device?: Prisma.ConsumerAccountDeviceUpdateOneWithoutConsumer_accountNestedInput
|
||||
consumer_account_good_favorites?: Prisma.ConsumerAccountGoodFavoriteUpdateManyWithoutConsumer_accountNestedInput
|
||||
consumer?: Prisma.ConsumerUpdateOneRequiredWithoutAccountsNestedInput
|
||||
account_allocation?: Prisma.LicenseAccountAllocationUpdateOneWithoutAccountNestedInput
|
||||
permission?: Prisma.PermissionConsumerUpdateOneWithoutConsumer_accountNestedInput
|
||||
pos?: Prisma.PosUpdateOneWithoutAccountNestedInput
|
||||
sales_invoices?: Prisma.SalesInvoiceUpdateManyWithoutConsumer_accountNestedInput
|
||||
}
|
||||
|
||||
export type ConsumerAccountUncheckedUpdateWithoutAccountInput = {
|
||||
@@ -604,11 +628,12 @@ export type ConsumerAccountUncheckedUpdateWithoutAccountInput = {
|
||||
created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
consumer_id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
pos?: Prisma.PosUncheckedUpdateOneWithoutAccountNestedInput
|
||||
permission?: Prisma.PermissionConsumerUncheckedUpdateOneWithoutConsumer_accountNestedInput
|
||||
account_allocation?: Prisma.LicenseAccountAllocationUncheckedUpdateOneWithoutAccountNestedInput
|
||||
sales_invoices?: Prisma.SalesInvoiceUncheckedUpdateManyWithoutConsumer_accountNestedInput
|
||||
account_device?: Prisma.ConsumerAccountDeviceUncheckedUpdateOneWithoutConsumer_accountNestedInput
|
||||
consumer_account_good_favorites?: Prisma.ConsumerAccountGoodFavoriteUncheckedUpdateManyWithoutConsumer_accountNestedInput
|
||||
account_allocation?: Prisma.LicenseAccountAllocationUncheckedUpdateOneWithoutAccountNestedInput
|
||||
permission?: Prisma.PermissionConsumerUncheckedUpdateOneWithoutConsumer_accountNestedInput
|
||||
pos?: Prisma.PosUncheckedUpdateOneWithoutAccountNestedInput
|
||||
sales_invoices?: Prisma.SalesInvoiceUncheckedUpdateManyWithoutConsumer_accountNestedInput
|
||||
}
|
||||
|
||||
export type ConsumerAccountCreateWithoutAccount_allocationInput = {
|
||||
@@ -616,12 +641,13 @@ export type ConsumerAccountCreateWithoutAccount_allocationInput = {
|
||||
role: $Enums.ConsumerRole
|
||||
created_at?: Date | string
|
||||
updated_at?: Date | string
|
||||
consumer: Prisma.ConsumerCreateNestedOneWithoutAccountsInput
|
||||
account: Prisma.AccountCreateNestedOneWithoutConsumer_accountInput
|
||||
pos?: Prisma.PosCreateNestedOneWithoutAccountInput
|
||||
permission?: Prisma.PermissionConsumerCreateNestedOneWithoutConsumer_accountInput
|
||||
sales_invoices?: Prisma.SalesInvoiceCreateNestedManyWithoutConsumer_accountInput
|
||||
account_device?: Prisma.ConsumerAccountDeviceCreateNestedOneWithoutConsumer_accountInput
|
||||
consumer_account_good_favorites?: Prisma.ConsumerAccountGoodFavoriteCreateNestedManyWithoutConsumer_accountInput
|
||||
account: Prisma.AccountCreateNestedOneWithoutConsumer_accountInput
|
||||
consumer: Prisma.ConsumerCreateNestedOneWithoutAccountsInput
|
||||
permission?: Prisma.PermissionConsumerCreateNestedOneWithoutConsumer_accountInput
|
||||
pos?: Prisma.PosCreateNestedOneWithoutAccountInput
|
||||
sales_invoices?: Prisma.SalesInvoiceCreateNestedManyWithoutConsumer_accountInput
|
||||
}
|
||||
|
||||
export type ConsumerAccountUncheckedCreateWithoutAccount_allocationInput = {
|
||||
@@ -631,10 +657,11 @@ export type ConsumerAccountUncheckedCreateWithoutAccount_allocationInput = {
|
||||
updated_at?: Date | string
|
||||
consumer_id: string
|
||||
account_id: string
|
||||
pos?: Prisma.PosUncheckedCreateNestedOneWithoutAccountInput
|
||||
permission?: Prisma.PermissionConsumerUncheckedCreateNestedOneWithoutConsumer_accountInput
|
||||
sales_invoices?: Prisma.SalesInvoiceUncheckedCreateNestedManyWithoutConsumer_accountInput
|
||||
account_device?: Prisma.ConsumerAccountDeviceUncheckedCreateNestedOneWithoutConsumer_accountInput
|
||||
consumer_account_good_favorites?: Prisma.ConsumerAccountGoodFavoriteUncheckedCreateNestedManyWithoutConsumer_accountInput
|
||||
permission?: Prisma.PermissionConsumerUncheckedCreateNestedOneWithoutConsumer_accountInput
|
||||
pos?: Prisma.PosUncheckedCreateNestedOneWithoutAccountInput
|
||||
sales_invoices?: Prisma.SalesInvoiceUncheckedCreateNestedManyWithoutConsumer_accountInput
|
||||
}
|
||||
|
||||
export type ConsumerAccountCreateOrConnectWithoutAccount_allocationInput = {
|
||||
@@ -658,12 +685,13 @@ export type ConsumerAccountUpdateWithoutAccount_allocationInput = {
|
||||
role?: Prisma.EnumConsumerRoleFieldUpdateOperationsInput | $Enums.ConsumerRole
|
||||
created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
consumer?: Prisma.ConsumerUpdateOneRequiredWithoutAccountsNestedInput
|
||||
account?: Prisma.AccountUpdateOneRequiredWithoutConsumer_accountNestedInput
|
||||
pos?: Prisma.PosUpdateOneWithoutAccountNestedInput
|
||||
permission?: Prisma.PermissionConsumerUpdateOneWithoutConsumer_accountNestedInput
|
||||
sales_invoices?: Prisma.SalesInvoiceUpdateManyWithoutConsumer_accountNestedInput
|
||||
account_device?: Prisma.ConsumerAccountDeviceUpdateOneWithoutConsumer_accountNestedInput
|
||||
consumer_account_good_favorites?: Prisma.ConsumerAccountGoodFavoriteUpdateManyWithoutConsumer_accountNestedInput
|
||||
account?: Prisma.AccountUpdateOneRequiredWithoutConsumer_accountNestedInput
|
||||
consumer?: Prisma.ConsumerUpdateOneRequiredWithoutAccountsNestedInput
|
||||
permission?: Prisma.PermissionConsumerUpdateOneWithoutConsumer_accountNestedInput
|
||||
pos?: Prisma.PosUpdateOneWithoutAccountNestedInput
|
||||
sales_invoices?: Prisma.SalesInvoiceUpdateManyWithoutConsumer_accountNestedInput
|
||||
}
|
||||
|
||||
export type ConsumerAccountUncheckedUpdateWithoutAccount_allocationInput = {
|
||||
@@ -673,10 +701,11 @@ export type ConsumerAccountUncheckedUpdateWithoutAccount_allocationInput = {
|
||||
updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
consumer_id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
account_id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
pos?: Prisma.PosUncheckedUpdateOneWithoutAccountNestedInput
|
||||
permission?: Prisma.PermissionConsumerUncheckedUpdateOneWithoutConsumer_accountNestedInput
|
||||
sales_invoices?: Prisma.SalesInvoiceUncheckedUpdateManyWithoutConsumer_accountNestedInput
|
||||
account_device?: Prisma.ConsumerAccountDeviceUncheckedUpdateOneWithoutConsumer_accountNestedInput
|
||||
consumer_account_good_favorites?: Prisma.ConsumerAccountGoodFavoriteUncheckedUpdateManyWithoutConsumer_accountNestedInput
|
||||
permission?: Prisma.PermissionConsumerUncheckedUpdateOneWithoutConsumer_accountNestedInput
|
||||
pos?: Prisma.PosUncheckedUpdateOneWithoutAccountNestedInput
|
||||
sales_invoices?: Prisma.SalesInvoiceUncheckedUpdateManyWithoutConsumer_accountNestedInput
|
||||
}
|
||||
|
||||
export type ConsumerAccountCreateWithoutPermissionInput = {
|
||||
@@ -684,12 +713,13 @@ export type ConsumerAccountCreateWithoutPermissionInput = {
|
||||
role: $Enums.ConsumerRole
|
||||
created_at?: Date | string
|
||||
updated_at?: Date | string
|
||||
consumer: Prisma.ConsumerCreateNestedOneWithoutAccountsInput
|
||||
account: Prisma.AccountCreateNestedOneWithoutConsumer_accountInput
|
||||
pos?: Prisma.PosCreateNestedOneWithoutAccountInput
|
||||
account_allocation?: Prisma.LicenseAccountAllocationCreateNestedOneWithoutAccountInput
|
||||
sales_invoices?: Prisma.SalesInvoiceCreateNestedManyWithoutConsumer_accountInput
|
||||
account_device?: Prisma.ConsumerAccountDeviceCreateNestedOneWithoutConsumer_accountInput
|
||||
consumer_account_good_favorites?: Prisma.ConsumerAccountGoodFavoriteCreateNestedManyWithoutConsumer_accountInput
|
||||
account: Prisma.AccountCreateNestedOneWithoutConsumer_accountInput
|
||||
consumer: Prisma.ConsumerCreateNestedOneWithoutAccountsInput
|
||||
account_allocation?: Prisma.LicenseAccountAllocationCreateNestedOneWithoutAccountInput
|
||||
pos?: Prisma.PosCreateNestedOneWithoutAccountInput
|
||||
sales_invoices?: Prisma.SalesInvoiceCreateNestedManyWithoutConsumer_accountInput
|
||||
}
|
||||
|
||||
export type ConsumerAccountUncheckedCreateWithoutPermissionInput = {
|
||||
@@ -699,10 +729,11 @@ export type ConsumerAccountUncheckedCreateWithoutPermissionInput = {
|
||||
updated_at?: Date | string
|
||||
consumer_id: string
|
||||
account_id: string
|
||||
pos?: Prisma.PosUncheckedCreateNestedOneWithoutAccountInput
|
||||
account_allocation?: Prisma.LicenseAccountAllocationUncheckedCreateNestedOneWithoutAccountInput
|
||||
sales_invoices?: Prisma.SalesInvoiceUncheckedCreateNestedManyWithoutConsumer_accountInput
|
||||
account_device?: Prisma.ConsumerAccountDeviceUncheckedCreateNestedOneWithoutConsumer_accountInput
|
||||
consumer_account_good_favorites?: Prisma.ConsumerAccountGoodFavoriteUncheckedCreateNestedManyWithoutConsumer_accountInput
|
||||
account_allocation?: Prisma.LicenseAccountAllocationUncheckedCreateNestedOneWithoutAccountInput
|
||||
pos?: Prisma.PosUncheckedCreateNestedOneWithoutAccountInput
|
||||
sales_invoices?: Prisma.SalesInvoiceUncheckedCreateNestedManyWithoutConsumer_accountInput
|
||||
}
|
||||
|
||||
export type ConsumerAccountCreateOrConnectWithoutPermissionInput = {
|
||||
@@ -726,12 +757,13 @@ export type ConsumerAccountUpdateWithoutPermissionInput = {
|
||||
role?: Prisma.EnumConsumerRoleFieldUpdateOperationsInput | $Enums.ConsumerRole
|
||||
created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
consumer?: Prisma.ConsumerUpdateOneRequiredWithoutAccountsNestedInput
|
||||
account?: Prisma.AccountUpdateOneRequiredWithoutConsumer_accountNestedInput
|
||||
pos?: Prisma.PosUpdateOneWithoutAccountNestedInput
|
||||
account_allocation?: Prisma.LicenseAccountAllocationUpdateOneWithoutAccountNestedInput
|
||||
sales_invoices?: Prisma.SalesInvoiceUpdateManyWithoutConsumer_accountNestedInput
|
||||
account_device?: Prisma.ConsumerAccountDeviceUpdateOneWithoutConsumer_accountNestedInput
|
||||
consumer_account_good_favorites?: Prisma.ConsumerAccountGoodFavoriteUpdateManyWithoutConsumer_accountNestedInput
|
||||
account?: Prisma.AccountUpdateOneRequiredWithoutConsumer_accountNestedInput
|
||||
consumer?: Prisma.ConsumerUpdateOneRequiredWithoutAccountsNestedInput
|
||||
account_allocation?: Prisma.LicenseAccountAllocationUpdateOneWithoutAccountNestedInput
|
||||
pos?: Prisma.PosUpdateOneWithoutAccountNestedInput
|
||||
sales_invoices?: Prisma.SalesInvoiceUpdateManyWithoutConsumer_accountNestedInput
|
||||
}
|
||||
|
||||
export type ConsumerAccountUncheckedUpdateWithoutPermissionInput = {
|
||||
@@ -741,10 +773,11 @@ export type ConsumerAccountUncheckedUpdateWithoutPermissionInput = {
|
||||
updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
consumer_id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
account_id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
pos?: Prisma.PosUncheckedUpdateOneWithoutAccountNestedInput
|
||||
account_allocation?: Prisma.LicenseAccountAllocationUncheckedUpdateOneWithoutAccountNestedInput
|
||||
sales_invoices?: Prisma.SalesInvoiceUncheckedUpdateManyWithoutConsumer_accountNestedInput
|
||||
account_device?: Prisma.ConsumerAccountDeviceUncheckedUpdateOneWithoutConsumer_accountNestedInput
|
||||
consumer_account_good_favorites?: Prisma.ConsumerAccountGoodFavoriteUncheckedUpdateManyWithoutConsumer_accountNestedInput
|
||||
account_allocation?: Prisma.LicenseAccountAllocationUncheckedUpdateOneWithoutAccountNestedInput
|
||||
pos?: Prisma.PosUncheckedUpdateOneWithoutAccountNestedInput
|
||||
sales_invoices?: Prisma.SalesInvoiceUncheckedUpdateManyWithoutConsumer_accountNestedInput
|
||||
}
|
||||
|
||||
export type ConsumerAccountCreateWithoutAccount_deviceInput = {
|
||||
@@ -752,11 +785,12 @@ export type ConsumerAccountCreateWithoutAccount_deviceInput = {
|
||||
role: $Enums.ConsumerRole
|
||||
created_at?: Date | string
|
||||
updated_at?: Date | string
|
||||
consumer: Prisma.ConsumerCreateNestedOneWithoutAccountsInput
|
||||
consumer_account_good_favorites?: Prisma.ConsumerAccountGoodFavoriteCreateNestedManyWithoutConsumer_accountInput
|
||||
account: Prisma.AccountCreateNestedOneWithoutConsumer_accountInput
|
||||
pos?: Prisma.PosCreateNestedOneWithoutAccountInput
|
||||
permission?: Prisma.PermissionConsumerCreateNestedOneWithoutConsumer_accountInput
|
||||
consumer: Prisma.ConsumerCreateNestedOneWithoutAccountsInput
|
||||
account_allocation?: Prisma.LicenseAccountAllocationCreateNestedOneWithoutAccountInput
|
||||
permission?: Prisma.PermissionConsumerCreateNestedOneWithoutConsumer_accountInput
|
||||
pos?: Prisma.PosCreateNestedOneWithoutAccountInput
|
||||
sales_invoices?: Prisma.SalesInvoiceCreateNestedManyWithoutConsumer_accountInput
|
||||
}
|
||||
|
||||
@@ -767,9 +801,10 @@ export type ConsumerAccountUncheckedCreateWithoutAccount_deviceInput = {
|
||||
updated_at?: Date | string
|
||||
consumer_id: string
|
||||
account_id: string
|
||||
pos?: Prisma.PosUncheckedCreateNestedOneWithoutAccountInput
|
||||
permission?: Prisma.PermissionConsumerUncheckedCreateNestedOneWithoutConsumer_accountInput
|
||||
consumer_account_good_favorites?: Prisma.ConsumerAccountGoodFavoriteUncheckedCreateNestedManyWithoutConsumer_accountInput
|
||||
account_allocation?: Prisma.LicenseAccountAllocationUncheckedCreateNestedOneWithoutAccountInput
|
||||
permission?: Prisma.PermissionConsumerUncheckedCreateNestedOneWithoutConsumer_accountInput
|
||||
pos?: Prisma.PosUncheckedCreateNestedOneWithoutAccountInput
|
||||
sales_invoices?: Prisma.SalesInvoiceUncheckedCreateNestedManyWithoutConsumer_accountInput
|
||||
}
|
||||
|
||||
@@ -794,11 +829,12 @@ export type ConsumerAccountUpdateWithoutAccount_deviceInput = {
|
||||
role?: Prisma.EnumConsumerRoleFieldUpdateOperationsInput | $Enums.ConsumerRole
|
||||
created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
consumer?: Prisma.ConsumerUpdateOneRequiredWithoutAccountsNestedInput
|
||||
consumer_account_good_favorites?: Prisma.ConsumerAccountGoodFavoriteUpdateManyWithoutConsumer_accountNestedInput
|
||||
account?: Prisma.AccountUpdateOneRequiredWithoutConsumer_accountNestedInput
|
||||
pos?: Prisma.PosUpdateOneWithoutAccountNestedInput
|
||||
permission?: Prisma.PermissionConsumerUpdateOneWithoutConsumer_accountNestedInput
|
||||
consumer?: Prisma.ConsumerUpdateOneRequiredWithoutAccountsNestedInput
|
||||
account_allocation?: Prisma.LicenseAccountAllocationUpdateOneWithoutAccountNestedInput
|
||||
permission?: Prisma.PermissionConsumerUpdateOneWithoutConsumer_accountNestedInput
|
||||
pos?: Prisma.PosUpdateOneWithoutAccountNestedInput
|
||||
sales_invoices?: Prisma.SalesInvoiceUpdateManyWithoutConsumer_accountNestedInput
|
||||
}
|
||||
|
||||
@@ -809,9 +845,10 @@ export type ConsumerAccountUncheckedUpdateWithoutAccount_deviceInput = {
|
||||
updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
consumer_id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
account_id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
pos?: Prisma.PosUncheckedUpdateOneWithoutAccountNestedInput
|
||||
permission?: Prisma.PermissionConsumerUncheckedUpdateOneWithoutConsumer_accountNestedInput
|
||||
consumer_account_good_favorites?: Prisma.ConsumerAccountGoodFavoriteUncheckedUpdateManyWithoutConsumer_accountNestedInput
|
||||
account_allocation?: Prisma.LicenseAccountAllocationUncheckedUpdateOneWithoutAccountNestedInput
|
||||
permission?: Prisma.PermissionConsumerUncheckedUpdateOneWithoutConsumer_accountNestedInput
|
||||
pos?: Prisma.PosUncheckedUpdateOneWithoutAccountNestedInput
|
||||
sales_invoices?: Prisma.SalesInvoiceUncheckedUpdateManyWithoutConsumer_accountNestedInput
|
||||
}
|
||||
|
||||
@@ -820,12 +857,13 @@ export type ConsumerAccountCreateWithoutConsumerInput = {
|
||||
role: $Enums.ConsumerRole
|
||||
created_at?: Date | string
|
||||
updated_at?: Date | string
|
||||
account: Prisma.AccountCreateNestedOneWithoutConsumer_accountInput
|
||||
pos?: Prisma.PosCreateNestedOneWithoutAccountInput
|
||||
permission?: Prisma.PermissionConsumerCreateNestedOneWithoutConsumer_accountInput
|
||||
account_allocation?: Prisma.LicenseAccountAllocationCreateNestedOneWithoutAccountInput
|
||||
sales_invoices?: Prisma.SalesInvoiceCreateNestedManyWithoutConsumer_accountInput
|
||||
account_device?: Prisma.ConsumerAccountDeviceCreateNestedOneWithoutConsumer_accountInput
|
||||
consumer_account_good_favorites?: Prisma.ConsumerAccountGoodFavoriteCreateNestedManyWithoutConsumer_accountInput
|
||||
account: Prisma.AccountCreateNestedOneWithoutConsumer_accountInput
|
||||
account_allocation?: Prisma.LicenseAccountAllocationCreateNestedOneWithoutAccountInput
|
||||
permission?: Prisma.PermissionConsumerCreateNestedOneWithoutConsumer_accountInput
|
||||
pos?: Prisma.PosCreateNestedOneWithoutAccountInput
|
||||
sales_invoices?: Prisma.SalesInvoiceCreateNestedManyWithoutConsumer_accountInput
|
||||
}
|
||||
|
||||
export type ConsumerAccountUncheckedCreateWithoutConsumerInput = {
|
||||
@@ -834,11 +872,12 @@ export type ConsumerAccountUncheckedCreateWithoutConsumerInput = {
|
||||
created_at?: Date | string
|
||||
updated_at?: Date | string
|
||||
account_id: string
|
||||
pos?: Prisma.PosUncheckedCreateNestedOneWithoutAccountInput
|
||||
permission?: Prisma.PermissionConsumerUncheckedCreateNestedOneWithoutConsumer_accountInput
|
||||
account_allocation?: Prisma.LicenseAccountAllocationUncheckedCreateNestedOneWithoutAccountInput
|
||||
sales_invoices?: Prisma.SalesInvoiceUncheckedCreateNestedManyWithoutConsumer_accountInput
|
||||
account_device?: Prisma.ConsumerAccountDeviceUncheckedCreateNestedOneWithoutConsumer_accountInput
|
||||
consumer_account_good_favorites?: Prisma.ConsumerAccountGoodFavoriteUncheckedCreateNestedManyWithoutConsumer_accountInput
|
||||
account_allocation?: Prisma.LicenseAccountAllocationUncheckedCreateNestedOneWithoutAccountInput
|
||||
permission?: Prisma.PermissionConsumerUncheckedCreateNestedOneWithoutConsumer_accountInput
|
||||
pos?: Prisma.PosUncheckedCreateNestedOneWithoutAccountInput
|
||||
sales_invoices?: Prisma.SalesInvoiceUncheckedCreateNestedManyWithoutConsumer_accountInput
|
||||
}
|
||||
|
||||
export type ConsumerAccountCreateOrConnectWithoutConsumerInput = {
|
||||
@@ -884,12 +923,13 @@ export type ConsumerAccountCreateWithoutPosInput = {
|
||||
role: $Enums.ConsumerRole
|
||||
created_at?: Date | string
|
||||
updated_at?: Date | string
|
||||
consumer: Prisma.ConsumerCreateNestedOneWithoutAccountsInput
|
||||
account: Prisma.AccountCreateNestedOneWithoutConsumer_accountInput
|
||||
permission?: Prisma.PermissionConsumerCreateNestedOneWithoutConsumer_accountInput
|
||||
account_allocation?: Prisma.LicenseAccountAllocationCreateNestedOneWithoutAccountInput
|
||||
sales_invoices?: Prisma.SalesInvoiceCreateNestedManyWithoutConsumer_accountInput
|
||||
account_device?: Prisma.ConsumerAccountDeviceCreateNestedOneWithoutConsumer_accountInput
|
||||
consumer_account_good_favorites?: Prisma.ConsumerAccountGoodFavoriteCreateNestedManyWithoutConsumer_accountInput
|
||||
account: Prisma.AccountCreateNestedOneWithoutConsumer_accountInput
|
||||
consumer: Prisma.ConsumerCreateNestedOneWithoutAccountsInput
|
||||
account_allocation?: Prisma.LicenseAccountAllocationCreateNestedOneWithoutAccountInput
|
||||
permission?: Prisma.PermissionConsumerCreateNestedOneWithoutConsumer_accountInput
|
||||
sales_invoices?: Prisma.SalesInvoiceCreateNestedManyWithoutConsumer_accountInput
|
||||
}
|
||||
|
||||
export type ConsumerAccountUncheckedCreateWithoutPosInput = {
|
||||
@@ -899,10 +939,11 @@ export type ConsumerAccountUncheckedCreateWithoutPosInput = {
|
||||
updated_at?: Date | string
|
||||
consumer_id: string
|
||||
account_id: string
|
||||
permission?: Prisma.PermissionConsumerUncheckedCreateNestedOneWithoutConsumer_accountInput
|
||||
account_allocation?: Prisma.LicenseAccountAllocationUncheckedCreateNestedOneWithoutAccountInput
|
||||
sales_invoices?: Prisma.SalesInvoiceUncheckedCreateNestedManyWithoutConsumer_accountInput
|
||||
account_device?: Prisma.ConsumerAccountDeviceUncheckedCreateNestedOneWithoutConsumer_accountInput
|
||||
consumer_account_good_favorites?: Prisma.ConsumerAccountGoodFavoriteUncheckedCreateNestedManyWithoutConsumer_accountInput
|
||||
account_allocation?: Prisma.LicenseAccountAllocationUncheckedCreateNestedOneWithoutAccountInput
|
||||
permission?: Prisma.PermissionConsumerUncheckedCreateNestedOneWithoutConsumer_accountInput
|
||||
sales_invoices?: Prisma.SalesInvoiceUncheckedCreateNestedManyWithoutConsumer_accountInput
|
||||
}
|
||||
|
||||
export type ConsumerAccountCreateOrConnectWithoutPosInput = {
|
||||
@@ -926,12 +967,13 @@ export type ConsumerAccountUpdateWithoutPosInput = {
|
||||
role?: Prisma.EnumConsumerRoleFieldUpdateOperationsInput | $Enums.ConsumerRole
|
||||
created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
consumer?: Prisma.ConsumerUpdateOneRequiredWithoutAccountsNestedInput
|
||||
account?: Prisma.AccountUpdateOneRequiredWithoutConsumer_accountNestedInput
|
||||
permission?: Prisma.PermissionConsumerUpdateOneWithoutConsumer_accountNestedInput
|
||||
account_allocation?: Prisma.LicenseAccountAllocationUpdateOneWithoutAccountNestedInput
|
||||
sales_invoices?: Prisma.SalesInvoiceUpdateManyWithoutConsumer_accountNestedInput
|
||||
account_device?: Prisma.ConsumerAccountDeviceUpdateOneWithoutConsumer_accountNestedInput
|
||||
consumer_account_good_favorites?: Prisma.ConsumerAccountGoodFavoriteUpdateManyWithoutConsumer_accountNestedInput
|
||||
account?: Prisma.AccountUpdateOneRequiredWithoutConsumer_accountNestedInput
|
||||
consumer?: Prisma.ConsumerUpdateOneRequiredWithoutAccountsNestedInput
|
||||
account_allocation?: Prisma.LicenseAccountAllocationUpdateOneWithoutAccountNestedInput
|
||||
permission?: Prisma.PermissionConsumerUpdateOneWithoutConsumer_accountNestedInput
|
||||
sales_invoices?: Prisma.SalesInvoiceUpdateManyWithoutConsumer_accountNestedInput
|
||||
}
|
||||
|
||||
export type ConsumerAccountUncheckedUpdateWithoutPosInput = {
|
||||
@@ -941,10 +983,83 @@ export type ConsumerAccountUncheckedUpdateWithoutPosInput = {
|
||||
updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
consumer_id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
account_id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
permission?: Prisma.PermissionConsumerUncheckedUpdateOneWithoutConsumer_accountNestedInput
|
||||
account_allocation?: Prisma.LicenseAccountAllocationUncheckedUpdateOneWithoutAccountNestedInput
|
||||
sales_invoices?: Prisma.SalesInvoiceUncheckedUpdateManyWithoutConsumer_accountNestedInput
|
||||
account_device?: Prisma.ConsumerAccountDeviceUncheckedUpdateOneWithoutConsumer_accountNestedInput
|
||||
consumer_account_good_favorites?: Prisma.ConsumerAccountGoodFavoriteUncheckedUpdateManyWithoutConsumer_accountNestedInput
|
||||
account_allocation?: Prisma.LicenseAccountAllocationUncheckedUpdateOneWithoutAccountNestedInput
|
||||
permission?: Prisma.PermissionConsumerUncheckedUpdateOneWithoutConsumer_accountNestedInput
|
||||
sales_invoices?: Prisma.SalesInvoiceUncheckedUpdateManyWithoutConsumer_accountNestedInput
|
||||
}
|
||||
|
||||
export type ConsumerAccountCreateWithoutConsumer_account_good_favoritesInput = {
|
||||
id?: string
|
||||
role: $Enums.ConsumerRole
|
||||
created_at?: Date | string
|
||||
updated_at?: Date | string
|
||||
account_device?: Prisma.ConsumerAccountDeviceCreateNestedOneWithoutConsumer_accountInput
|
||||
account: Prisma.AccountCreateNestedOneWithoutConsumer_accountInput
|
||||
consumer: Prisma.ConsumerCreateNestedOneWithoutAccountsInput
|
||||
account_allocation?: Prisma.LicenseAccountAllocationCreateNestedOneWithoutAccountInput
|
||||
permission?: Prisma.PermissionConsumerCreateNestedOneWithoutConsumer_accountInput
|
||||
pos?: Prisma.PosCreateNestedOneWithoutAccountInput
|
||||
sales_invoices?: Prisma.SalesInvoiceCreateNestedManyWithoutConsumer_accountInput
|
||||
}
|
||||
|
||||
export type ConsumerAccountUncheckedCreateWithoutConsumer_account_good_favoritesInput = {
|
||||
id?: string
|
||||
role: $Enums.ConsumerRole
|
||||
created_at?: Date | string
|
||||
updated_at?: Date | string
|
||||
consumer_id: string
|
||||
account_id: string
|
||||
account_device?: Prisma.ConsumerAccountDeviceUncheckedCreateNestedOneWithoutConsumer_accountInput
|
||||
account_allocation?: Prisma.LicenseAccountAllocationUncheckedCreateNestedOneWithoutAccountInput
|
||||
permission?: Prisma.PermissionConsumerUncheckedCreateNestedOneWithoutConsumer_accountInput
|
||||
pos?: Prisma.PosUncheckedCreateNestedOneWithoutAccountInput
|
||||
sales_invoices?: Prisma.SalesInvoiceUncheckedCreateNestedManyWithoutConsumer_accountInput
|
||||
}
|
||||
|
||||
export type ConsumerAccountCreateOrConnectWithoutConsumer_account_good_favoritesInput = {
|
||||
where: Prisma.ConsumerAccountWhereUniqueInput
|
||||
create: Prisma.XOR<Prisma.ConsumerAccountCreateWithoutConsumer_account_good_favoritesInput, Prisma.ConsumerAccountUncheckedCreateWithoutConsumer_account_good_favoritesInput>
|
||||
}
|
||||
|
||||
export type ConsumerAccountUpsertWithoutConsumer_account_good_favoritesInput = {
|
||||
update: Prisma.XOR<Prisma.ConsumerAccountUpdateWithoutConsumer_account_good_favoritesInput, Prisma.ConsumerAccountUncheckedUpdateWithoutConsumer_account_good_favoritesInput>
|
||||
create: Prisma.XOR<Prisma.ConsumerAccountCreateWithoutConsumer_account_good_favoritesInput, Prisma.ConsumerAccountUncheckedCreateWithoutConsumer_account_good_favoritesInput>
|
||||
where?: Prisma.ConsumerAccountWhereInput
|
||||
}
|
||||
|
||||
export type ConsumerAccountUpdateToOneWithWhereWithoutConsumer_account_good_favoritesInput = {
|
||||
where?: Prisma.ConsumerAccountWhereInput
|
||||
data: Prisma.XOR<Prisma.ConsumerAccountUpdateWithoutConsumer_account_good_favoritesInput, Prisma.ConsumerAccountUncheckedUpdateWithoutConsumer_account_good_favoritesInput>
|
||||
}
|
||||
|
||||
export type ConsumerAccountUpdateWithoutConsumer_account_good_favoritesInput = {
|
||||
id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
role?: Prisma.EnumConsumerRoleFieldUpdateOperationsInput | $Enums.ConsumerRole
|
||||
created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
account_device?: Prisma.ConsumerAccountDeviceUpdateOneWithoutConsumer_accountNestedInput
|
||||
account?: Prisma.AccountUpdateOneRequiredWithoutConsumer_accountNestedInput
|
||||
consumer?: Prisma.ConsumerUpdateOneRequiredWithoutAccountsNestedInput
|
||||
account_allocation?: Prisma.LicenseAccountAllocationUpdateOneWithoutAccountNestedInput
|
||||
permission?: Prisma.PermissionConsumerUpdateOneWithoutConsumer_accountNestedInput
|
||||
pos?: Prisma.PosUpdateOneWithoutAccountNestedInput
|
||||
sales_invoices?: Prisma.SalesInvoiceUpdateManyWithoutConsumer_accountNestedInput
|
||||
}
|
||||
|
||||
export type ConsumerAccountUncheckedUpdateWithoutConsumer_account_good_favoritesInput = {
|
||||
id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
role?: Prisma.EnumConsumerRoleFieldUpdateOperationsInput | $Enums.ConsumerRole
|
||||
created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
consumer_id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
account_id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
account_device?: Prisma.ConsumerAccountDeviceUncheckedUpdateOneWithoutConsumer_accountNestedInput
|
||||
account_allocation?: Prisma.LicenseAccountAllocationUncheckedUpdateOneWithoutAccountNestedInput
|
||||
permission?: Prisma.PermissionConsumerUncheckedUpdateOneWithoutConsumer_accountNestedInput
|
||||
pos?: Prisma.PosUncheckedUpdateOneWithoutAccountNestedInput
|
||||
sales_invoices?: Prisma.SalesInvoiceUncheckedUpdateManyWithoutConsumer_accountNestedInput
|
||||
}
|
||||
|
||||
export type ConsumerAccountCreateWithoutSales_invoicesInput = {
|
||||
@@ -952,12 +1067,13 @@ export type ConsumerAccountCreateWithoutSales_invoicesInput = {
|
||||
role: $Enums.ConsumerRole
|
||||
created_at?: Date | string
|
||||
updated_at?: Date | string
|
||||
consumer: Prisma.ConsumerCreateNestedOneWithoutAccountsInput
|
||||
account: Prisma.AccountCreateNestedOneWithoutConsumer_accountInput
|
||||
pos?: Prisma.PosCreateNestedOneWithoutAccountInput
|
||||
permission?: Prisma.PermissionConsumerCreateNestedOneWithoutConsumer_accountInput
|
||||
account_allocation?: Prisma.LicenseAccountAllocationCreateNestedOneWithoutAccountInput
|
||||
account_device?: Prisma.ConsumerAccountDeviceCreateNestedOneWithoutConsumer_accountInput
|
||||
consumer_account_good_favorites?: Prisma.ConsumerAccountGoodFavoriteCreateNestedManyWithoutConsumer_accountInput
|
||||
account: Prisma.AccountCreateNestedOneWithoutConsumer_accountInput
|
||||
consumer: Prisma.ConsumerCreateNestedOneWithoutAccountsInput
|
||||
account_allocation?: Prisma.LicenseAccountAllocationCreateNestedOneWithoutAccountInput
|
||||
permission?: Prisma.PermissionConsumerCreateNestedOneWithoutConsumer_accountInput
|
||||
pos?: Prisma.PosCreateNestedOneWithoutAccountInput
|
||||
}
|
||||
|
||||
export type ConsumerAccountUncheckedCreateWithoutSales_invoicesInput = {
|
||||
@@ -967,10 +1083,11 @@ export type ConsumerAccountUncheckedCreateWithoutSales_invoicesInput = {
|
||||
updated_at?: Date | string
|
||||
consumer_id: string
|
||||
account_id: string
|
||||
pos?: Prisma.PosUncheckedCreateNestedOneWithoutAccountInput
|
||||
permission?: Prisma.PermissionConsumerUncheckedCreateNestedOneWithoutConsumer_accountInput
|
||||
account_allocation?: Prisma.LicenseAccountAllocationUncheckedCreateNestedOneWithoutAccountInput
|
||||
account_device?: Prisma.ConsumerAccountDeviceUncheckedCreateNestedOneWithoutConsumer_accountInput
|
||||
consumer_account_good_favorites?: Prisma.ConsumerAccountGoodFavoriteUncheckedCreateNestedManyWithoutConsumer_accountInput
|
||||
account_allocation?: Prisma.LicenseAccountAllocationUncheckedCreateNestedOneWithoutAccountInput
|
||||
permission?: Prisma.PermissionConsumerUncheckedCreateNestedOneWithoutConsumer_accountInput
|
||||
pos?: Prisma.PosUncheckedCreateNestedOneWithoutAccountInput
|
||||
}
|
||||
|
||||
export type ConsumerAccountCreateOrConnectWithoutSales_invoicesInput = {
|
||||
@@ -994,12 +1111,13 @@ export type ConsumerAccountUpdateWithoutSales_invoicesInput = {
|
||||
role?: Prisma.EnumConsumerRoleFieldUpdateOperationsInput | $Enums.ConsumerRole
|
||||
created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
consumer?: Prisma.ConsumerUpdateOneRequiredWithoutAccountsNestedInput
|
||||
account?: Prisma.AccountUpdateOneRequiredWithoutConsumer_accountNestedInput
|
||||
pos?: Prisma.PosUpdateOneWithoutAccountNestedInput
|
||||
permission?: Prisma.PermissionConsumerUpdateOneWithoutConsumer_accountNestedInput
|
||||
account_allocation?: Prisma.LicenseAccountAllocationUpdateOneWithoutAccountNestedInput
|
||||
account_device?: Prisma.ConsumerAccountDeviceUpdateOneWithoutConsumer_accountNestedInput
|
||||
consumer_account_good_favorites?: Prisma.ConsumerAccountGoodFavoriteUpdateManyWithoutConsumer_accountNestedInput
|
||||
account?: Prisma.AccountUpdateOneRequiredWithoutConsumer_accountNestedInput
|
||||
consumer?: Prisma.ConsumerUpdateOneRequiredWithoutAccountsNestedInput
|
||||
account_allocation?: Prisma.LicenseAccountAllocationUpdateOneWithoutAccountNestedInput
|
||||
permission?: Prisma.PermissionConsumerUpdateOneWithoutConsumer_accountNestedInput
|
||||
pos?: Prisma.PosUpdateOneWithoutAccountNestedInput
|
||||
}
|
||||
|
||||
export type ConsumerAccountUncheckedUpdateWithoutSales_invoicesInput = {
|
||||
@@ -1009,10 +1127,11 @@ export type ConsumerAccountUncheckedUpdateWithoutSales_invoicesInput = {
|
||||
updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
consumer_id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
account_id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
pos?: Prisma.PosUncheckedUpdateOneWithoutAccountNestedInput
|
||||
permission?: Prisma.PermissionConsumerUncheckedUpdateOneWithoutConsumer_accountNestedInput
|
||||
account_allocation?: Prisma.LicenseAccountAllocationUncheckedUpdateOneWithoutAccountNestedInput
|
||||
account_device?: Prisma.ConsumerAccountDeviceUncheckedUpdateOneWithoutConsumer_accountNestedInput
|
||||
consumer_account_good_favorites?: Prisma.ConsumerAccountGoodFavoriteUncheckedUpdateManyWithoutConsumer_accountNestedInput
|
||||
account_allocation?: Prisma.LicenseAccountAllocationUncheckedUpdateOneWithoutAccountNestedInput
|
||||
permission?: Prisma.PermissionConsumerUncheckedUpdateOneWithoutConsumer_accountNestedInput
|
||||
pos?: Prisma.PosUncheckedUpdateOneWithoutAccountNestedInput
|
||||
}
|
||||
|
||||
export type ConsumerAccountCreateManyConsumerInput = {
|
||||
@@ -1028,12 +1147,13 @@ export type ConsumerAccountUpdateWithoutConsumerInput = {
|
||||
role?: Prisma.EnumConsumerRoleFieldUpdateOperationsInput | $Enums.ConsumerRole
|
||||
created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
account?: Prisma.AccountUpdateOneRequiredWithoutConsumer_accountNestedInput
|
||||
pos?: Prisma.PosUpdateOneWithoutAccountNestedInput
|
||||
permission?: Prisma.PermissionConsumerUpdateOneWithoutConsumer_accountNestedInput
|
||||
account_allocation?: Prisma.LicenseAccountAllocationUpdateOneWithoutAccountNestedInput
|
||||
sales_invoices?: Prisma.SalesInvoiceUpdateManyWithoutConsumer_accountNestedInput
|
||||
account_device?: Prisma.ConsumerAccountDeviceUpdateOneWithoutConsumer_accountNestedInput
|
||||
consumer_account_good_favorites?: Prisma.ConsumerAccountGoodFavoriteUpdateManyWithoutConsumer_accountNestedInput
|
||||
account?: Prisma.AccountUpdateOneRequiredWithoutConsumer_accountNestedInput
|
||||
account_allocation?: Prisma.LicenseAccountAllocationUpdateOneWithoutAccountNestedInput
|
||||
permission?: Prisma.PermissionConsumerUpdateOneWithoutConsumer_accountNestedInput
|
||||
pos?: Prisma.PosUpdateOneWithoutAccountNestedInput
|
||||
sales_invoices?: Prisma.SalesInvoiceUpdateManyWithoutConsumer_accountNestedInput
|
||||
}
|
||||
|
||||
export type ConsumerAccountUncheckedUpdateWithoutConsumerInput = {
|
||||
@@ -1042,11 +1162,12 @@ export type ConsumerAccountUncheckedUpdateWithoutConsumerInput = {
|
||||
created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
account_id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
pos?: Prisma.PosUncheckedUpdateOneWithoutAccountNestedInput
|
||||
permission?: Prisma.PermissionConsumerUncheckedUpdateOneWithoutConsumer_accountNestedInput
|
||||
account_allocation?: Prisma.LicenseAccountAllocationUncheckedUpdateOneWithoutAccountNestedInput
|
||||
sales_invoices?: Prisma.SalesInvoiceUncheckedUpdateManyWithoutConsumer_accountNestedInput
|
||||
account_device?: Prisma.ConsumerAccountDeviceUncheckedUpdateOneWithoutConsumer_accountNestedInput
|
||||
consumer_account_good_favorites?: Prisma.ConsumerAccountGoodFavoriteUncheckedUpdateManyWithoutConsumer_accountNestedInput
|
||||
account_allocation?: Prisma.LicenseAccountAllocationUncheckedUpdateOneWithoutAccountNestedInput
|
||||
permission?: Prisma.PermissionConsumerUncheckedUpdateOneWithoutConsumer_accountNestedInput
|
||||
pos?: Prisma.PosUncheckedUpdateOneWithoutAccountNestedInput
|
||||
sales_invoices?: Prisma.SalesInvoiceUncheckedUpdateManyWithoutConsumer_accountNestedInput
|
||||
}
|
||||
|
||||
export type ConsumerAccountUncheckedUpdateManyWithoutConsumerInput = {
|
||||
@@ -1063,10 +1184,12 @@ export type ConsumerAccountUncheckedUpdateManyWithoutConsumerInput = {
|
||||
*/
|
||||
|
||||
export type ConsumerAccountCountOutputType = {
|
||||
consumer_account_good_favorites: number
|
||||
sales_invoices: number
|
||||
}
|
||||
|
||||
export type ConsumerAccountCountOutputTypeSelect<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
|
||||
consumer_account_good_favorites?: boolean | ConsumerAccountCountOutputTypeCountConsumer_account_good_favoritesArgs
|
||||
sales_invoices?: boolean | ConsumerAccountCountOutputTypeCountSales_invoicesArgs
|
||||
}
|
||||
|
||||
@@ -1080,6 +1203,13 @@ export type ConsumerAccountCountOutputTypeDefaultArgs<ExtArgs extends runtime.Ty
|
||||
select?: Prisma.ConsumerAccountCountOutputTypeSelect<ExtArgs> | null
|
||||
}
|
||||
|
||||
/**
|
||||
* ConsumerAccountCountOutputType without action
|
||||
*/
|
||||
export type ConsumerAccountCountOutputTypeCountConsumer_account_good_favoritesArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
|
||||
where?: Prisma.ConsumerAccountGoodFavoriteWhereInput
|
||||
}
|
||||
|
||||
/**
|
||||
* ConsumerAccountCountOutputType without action
|
||||
*/
|
||||
@@ -1095,13 +1225,14 @@ export type ConsumerAccountSelect<ExtArgs extends runtime.Types.Extensions.Inter
|
||||
updated_at?: boolean
|
||||
consumer_id?: boolean
|
||||
account_id?: boolean
|
||||
consumer?: boolean | Prisma.ConsumerDefaultArgs<ExtArgs>
|
||||
account?: boolean | Prisma.AccountDefaultArgs<ExtArgs>
|
||||
pos?: boolean | Prisma.ConsumerAccount$posArgs<ExtArgs>
|
||||
permission?: boolean | Prisma.ConsumerAccount$permissionArgs<ExtArgs>
|
||||
account_allocation?: boolean | Prisma.ConsumerAccount$account_allocationArgs<ExtArgs>
|
||||
sales_invoices?: boolean | Prisma.ConsumerAccount$sales_invoicesArgs<ExtArgs>
|
||||
account_device?: boolean | Prisma.ConsumerAccount$account_deviceArgs<ExtArgs>
|
||||
consumer_account_good_favorites?: boolean | Prisma.ConsumerAccount$consumer_account_good_favoritesArgs<ExtArgs>
|
||||
account?: boolean | Prisma.AccountDefaultArgs<ExtArgs>
|
||||
consumer?: boolean | Prisma.ConsumerDefaultArgs<ExtArgs>
|
||||
account_allocation?: boolean | Prisma.ConsumerAccount$account_allocationArgs<ExtArgs>
|
||||
permission?: boolean | Prisma.ConsumerAccount$permissionArgs<ExtArgs>
|
||||
pos?: boolean | Prisma.ConsumerAccount$posArgs<ExtArgs>
|
||||
sales_invoices?: boolean | Prisma.ConsumerAccount$sales_invoicesArgs<ExtArgs>
|
||||
_count?: boolean | Prisma.ConsumerAccountCountOutputTypeDefaultArgs<ExtArgs>
|
||||
}, ExtArgs["result"]["consumerAccount"]>
|
||||
|
||||
@@ -1118,26 +1249,28 @@ export type ConsumerAccountSelectScalar = {
|
||||
|
||||
export type ConsumerAccountOmit<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetOmit<"id" | "role" | "created_at" | "updated_at" | "consumer_id" | "account_id", ExtArgs["result"]["consumerAccount"]>
|
||||
export type ConsumerAccountInclude<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
|
||||
consumer?: boolean | Prisma.ConsumerDefaultArgs<ExtArgs>
|
||||
account?: boolean | Prisma.AccountDefaultArgs<ExtArgs>
|
||||
pos?: boolean | Prisma.ConsumerAccount$posArgs<ExtArgs>
|
||||
permission?: boolean | Prisma.ConsumerAccount$permissionArgs<ExtArgs>
|
||||
account_allocation?: boolean | Prisma.ConsumerAccount$account_allocationArgs<ExtArgs>
|
||||
sales_invoices?: boolean | Prisma.ConsumerAccount$sales_invoicesArgs<ExtArgs>
|
||||
account_device?: boolean | Prisma.ConsumerAccount$account_deviceArgs<ExtArgs>
|
||||
consumer_account_good_favorites?: boolean | Prisma.ConsumerAccount$consumer_account_good_favoritesArgs<ExtArgs>
|
||||
account?: boolean | Prisma.AccountDefaultArgs<ExtArgs>
|
||||
consumer?: boolean | Prisma.ConsumerDefaultArgs<ExtArgs>
|
||||
account_allocation?: boolean | Prisma.ConsumerAccount$account_allocationArgs<ExtArgs>
|
||||
permission?: boolean | Prisma.ConsumerAccount$permissionArgs<ExtArgs>
|
||||
pos?: boolean | Prisma.ConsumerAccount$posArgs<ExtArgs>
|
||||
sales_invoices?: boolean | Prisma.ConsumerAccount$sales_invoicesArgs<ExtArgs>
|
||||
_count?: boolean | Prisma.ConsumerAccountCountOutputTypeDefaultArgs<ExtArgs>
|
||||
}
|
||||
|
||||
export type $ConsumerAccountPayload<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
|
||||
name: "ConsumerAccount"
|
||||
objects: {
|
||||
consumer: Prisma.$ConsumerPayload<ExtArgs>
|
||||
account: Prisma.$AccountPayload<ExtArgs>
|
||||
pos: Prisma.$PosPayload<ExtArgs> | null
|
||||
permission: Prisma.$PermissionConsumerPayload<ExtArgs> | null
|
||||
account_allocation: Prisma.$LicenseAccountAllocationPayload<ExtArgs> | null
|
||||
sales_invoices: Prisma.$SalesInvoicePayload<ExtArgs>[]
|
||||
account_device: Prisma.$ConsumerAccountDevicePayload<ExtArgs> | null
|
||||
consumer_account_good_favorites: Prisma.$ConsumerAccountGoodFavoritePayload<ExtArgs>[]
|
||||
account: Prisma.$AccountPayload<ExtArgs>
|
||||
consumer: Prisma.$ConsumerPayload<ExtArgs>
|
||||
account_allocation: Prisma.$LicenseAccountAllocationPayload<ExtArgs> | null
|
||||
permission: Prisma.$PermissionConsumerPayload<ExtArgs> | null
|
||||
pos: Prisma.$PosPayload<ExtArgs> | null
|
||||
sales_invoices: Prisma.$SalesInvoicePayload<ExtArgs>[]
|
||||
}
|
||||
scalars: runtime.Types.Extensions.GetPayloadResult<{
|
||||
id: string
|
||||
@@ -1486,13 +1619,14 @@ readonly fields: ConsumerAccountFieldRefs;
|
||||
*/
|
||||
export interface Prisma__ConsumerAccountClient<T, Null = never, ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs, GlobalOmitOptions = {}> extends Prisma.PrismaPromise<T> {
|
||||
readonly [Symbol.toStringTag]: "PrismaPromise"
|
||||
consumer<T extends Prisma.ConsumerDefaultArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.ConsumerDefaultArgs<ExtArgs>>): Prisma.Prisma__ConsumerClient<runtime.Types.Result.GetResult<Prisma.$ConsumerPayload<ExtArgs>, T, "findUniqueOrThrow", GlobalOmitOptions> | Null, Null, ExtArgs, GlobalOmitOptions>
|
||||
account<T extends Prisma.AccountDefaultArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.AccountDefaultArgs<ExtArgs>>): Prisma.Prisma__AccountClient<runtime.Types.Result.GetResult<Prisma.$AccountPayload<ExtArgs>, T, "findUniqueOrThrow", GlobalOmitOptions> | Null, Null, ExtArgs, GlobalOmitOptions>
|
||||
pos<T extends Prisma.ConsumerAccount$posArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.ConsumerAccount$posArgs<ExtArgs>>): Prisma.Prisma__PosClient<runtime.Types.Result.GetResult<Prisma.$PosPayload<ExtArgs>, T, "findUniqueOrThrow", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions>
|
||||
permission<T extends Prisma.ConsumerAccount$permissionArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.ConsumerAccount$permissionArgs<ExtArgs>>): Prisma.Prisma__PermissionConsumerClient<runtime.Types.Result.GetResult<Prisma.$PermissionConsumerPayload<ExtArgs>, T, "findUniqueOrThrow", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions>
|
||||
account_allocation<T extends Prisma.ConsumerAccount$account_allocationArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.ConsumerAccount$account_allocationArgs<ExtArgs>>): Prisma.Prisma__LicenseAccountAllocationClient<runtime.Types.Result.GetResult<Prisma.$LicenseAccountAllocationPayload<ExtArgs>, T, "findUniqueOrThrow", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions>
|
||||
sales_invoices<T extends Prisma.ConsumerAccount$sales_invoicesArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.ConsumerAccount$sales_invoicesArgs<ExtArgs>>): Prisma.PrismaPromise<runtime.Types.Result.GetResult<Prisma.$SalesInvoicePayload<ExtArgs>, T, "findMany", GlobalOmitOptions> | Null>
|
||||
account_device<T extends Prisma.ConsumerAccount$account_deviceArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.ConsumerAccount$account_deviceArgs<ExtArgs>>): Prisma.Prisma__ConsumerAccountDeviceClient<runtime.Types.Result.GetResult<Prisma.$ConsumerAccountDevicePayload<ExtArgs>, T, "findUniqueOrThrow", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions>
|
||||
consumer_account_good_favorites<T extends Prisma.ConsumerAccount$consumer_account_good_favoritesArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.ConsumerAccount$consumer_account_good_favoritesArgs<ExtArgs>>): Prisma.PrismaPromise<runtime.Types.Result.GetResult<Prisma.$ConsumerAccountGoodFavoritePayload<ExtArgs>, T, "findMany", GlobalOmitOptions> | Null>
|
||||
account<T extends Prisma.AccountDefaultArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.AccountDefaultArgs<ExtArgs>>): Prisma.Prisma__AccountClient<runtime.Types.Result.GetResult<Prisma.$AccountPayload<ExtArgs>, T, "findUniqueOrThrow", GlobalOmitOptions> | Null, Null, ExtArgs, GlobalOmitOptions>
|
||||
consumer<T extends Prisma.ConsumerDefaultArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.ConsumerDefaultArgs<ExtArgs>>): Prisma.Prisma__ConsumerClient<runtime.Types.Result.GetResult<Prisma.$ConsumerPayload<ExtArgs>, T, "findUniqueOrThrow", GlobalOmitOptions> | Null, Null, ExtArgs, GlobalOmitOptions>
|
||||
account_allocation<T extends Prisma.ConsumerAccount$account_allocationArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.ConsumerAccount$account_allocationArgs<ExtArgs>>): Prisma.Prisma__LicenseAccountAllocationClient<runtime.Types.Result.GetResult<Prisma.$LicenseAccountAllocationPayload<ExtArgs>, T, "findUniqueOrThrow", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions>
|
||||
permission<T extends Prisma.ConsumerAccount$permissionArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.ConsumerAccount$permissionArgs<ExtArgs>>): Prisma.Prisma__PermissionConsumerClient<runtime.Types.Result.GetResult<Prisma.$PermissionConsumerPayload<ExtArgs>, T, "findUniqueOrThrow", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions>
|
||||
pos<T extends Prisma.ConsumerAccount$posArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.ConsumerAccount$posArgs<ExtArgs>>): Prisma.Prisma__PosClient<runtime.Types.Result.GetResult<Prisma.$PosPayload<ExtArgs>, T, "findUniqueOrThrow", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions>
|
||||
sales_invoices<T extends Prisma.ConsumerAccount$sales_invoicesArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.ConsumerAccount$sales_invoicesArgs<ExtArgs>>): Prisma.PrismaPromise<runtime.Types.Result.GetResult<Prisma.$SalesInvoicePayload<ExtArgs>, T, "findMany", GlobalOmitOptions> | Null>
|
||||
/**
|
||||
* Attaches callbacks for the resolution and/or rejection of the Promise.
|
||||
* @param onfulfilled The callback to execute when the Promise is resolved.
|
||||
@@ -1876,22 +2010,65 @@ export type ConsumerAccountDeleteManyArgs<ExtArgs extends runtime.Types.Extensio
|
||||
}
|
||||
|
||||
/**
|
||||
* ConsumerAccount.pos
|
||||
* ConsumerAccount.account_device
|
||||
*/
|
||||
export type ConsumerAccount$posArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
|
||||
export type ConsumerAccount$account_deviceArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
|
||||
/**
|
||||
* Select specific fields to fetch from the Pos
|
||||
* Select specific fields to fetch from the ConsumerAccountDevice
|
||||
*/
|
||||
select?: Prisma.PosSelect<ExtArgs> | null
|
||||
select?: Prisma.ConsumerAccountDeviceSelect<ExtArgs> | null
|
||||
/**
|
||||
* Omit specific fields from the Pos
|
||||
* Omit specific fields from the ConsumerAccountDevice
|
||||
*/
|
||||
omit?: Prisma.PosOmit<ExtArgs> | null
|
||||
omit?: Prisma.ConsumerAccountDeviceOmit<ExtArgs> | null
|
||||
/**
|
||||
* Choose, which related nodes to fetch as well
|
||||
*/
|
||||
include?: Prisma.PosInclude<ExtArgs> | null
|
||||
where?: Prisma.PosWhereInput
|
||||
include?: Prisma.ConsumerAccountDeviceInclude<ExtArgs> | null
|
||||
where?: Prisma.ConsumerAccountDeviceWhereInput
|
||||
}
|
||||
|
||||
/**
|
||||
* ConsumerAccount.consumer_account_good_favorites
|
||||
*/
|
||||
export type ConsumerAccount$consumer_account_good_favoritesArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
|
||||
/**
|
||||
* Select specific fields to fetch from the ConsumerAccountGoodFavorite
|
||||
*/
|
||||
select?: Prisma.ConsumerAccountGoodFavoriteSelect<ExtArgs> | null
|
||||
/**
|
||||
* Omit specific fields from the ConsumerAccountGoodFavorite
|
||||
*/
|
||||
omit?: Prisma.ConsumerAccountGoodFavoriteOmit<ExtArgs> | null
|
||||
/**
|
||||
* Choose, which related nodes to fetch as well
|
||||
*/
|
||||
include?: Prisma.ConsumerAccountGoodFavoriteInclude<ExtArgs> | null
|
||||
where?: Prisma.ConsumerAccountGoodFavoriteWhereInput
|
||||
orderBy?: Prisma.ConsumerAccountGoodFavoriteOrderByWithRelationInput | Prisma.ConsumerAccountGoodFavoriteOrderByWithRelationInput[]
|
||||
cursor?: Prisma.ConsumerAccountGoodFavoriteWhereUniqueInput
|
||||
take?: number
|
||||
skip?: number
|
||||
distinct?: Prisma.ConsumerAccountGoodFavoriteScalarFieldEnum | Prisma.ConsumerAccountGoodFavoriteScalarFieldEnum[]
|
||||
}
|
||||
|
||||
/**
|
||||
* ConsumerAccount.account_allocation
|
||||
*/
|
||||
export type ConsumerAccount$account_allocationArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
|
||||
/**
|
||||
* Select specific fields to fetch from the LicenseAccountAllocation
|
||||
*/
|
||||
select?: Prisma.LicenseAccountAllocationSelect<ExtArgs> | null
|
||||
/**
|
||||
* Omit specific fields from the LicenseAccountAllocation
|
||||
*/
|
||||
omit?: Prisma.LicenseAccountAllocationOmit<ExtArgs> | null
|
||||
/**
|
||||
* Choose, which related nodes to fetch as well
|
||||
*/
|
||||
include?: Prisma.LicenseAccountAllocationInclude<ExtArgs> | null
|
||||
where?: Prisma.LicenseAccountAllocationWhereInput
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1914,22 +2091,22 @@ export type ConsumerAccount$permissionArgs<ExtArgs extends runtime.Types.Extensi
|
||||
}
|
||||
|
||||
/**
|
||||
* ConsumerAccount.account_allocation
|
||||
* ConsumerAccount.pos
|
||||
*/
|
||||
export type ConsumerAccount$account_allocationArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
|
||||
export type ConsumerAccount$posArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
|
||||
/**
|
||||
* Select specific fields to fetch from the LicenseAccountAllocation
|
||||
* Select specific fields to fetch from the Pos
|
||||
*/
|
||||
select?: Prisma.LicenseAccountAllocationSelect<ExtArgs> | null
|
||||
select?: Prisma.PosSelect<ExtArgs> | null
|
||||
/**
|
||||
* Omit specific fields from the LicenseAccountAllocation
|
||||
* Omit specific fields from the Pos
|
||||
*/
|
||||
omit?: Prisma.LicenseAccountAllocationOmit<ExtArgs> | null
|
||||
omit?: Prisma.PosOmit<ExtArgs> | null
|
||||
/**
|
||||
* Choose, which related nodes to fetch as well
|
||||
*/
|
||||
include?: Prisma.LicenseAccountAllocationInclude<ExtArgs> | null
|
||||
where?: Prisma.LicenseAccountAllocationWhereInput
|
||||
include?: Prisma.PosInclude<ExtArgs> | null
|
||||
where?: Prisma.PosWhereInput
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1956,25 +2133,6 @@ export type ConsumerAccount$sales_invoicesArgs<ExtArgs extends runtime.Types.Ext
|
||||
distinct?: Prisma.SalesInvoiceScalarFieldEnum | Prisma.SalesInvoiceScalarFieldEnum[]
|
||||
}
|
||||
|
||||
/**
|
||||
* ConsumerAccount.account_device
|
||||
*/
|
||||
export type ConsumerAccount$account_deviceArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
|
||||
/**
|
||||
* Select specific fields to fetch from the ConsumerAccountDevice
|
||||
*/
|
||||
select?: Prisma.ConsumerAccountDeviceSelect<ExtArgs> | null
|
||||
/**
|
||||
* Omit specific fields from the ConsumerAccountDevice
|
||||
*/
|
||||
omit?: Prisma.ConsumerAccountDeviceOmit<ExtArgs> | null
|
||||
/**
|
||||
* Choose, which related nodes to fetch as well
|
||||
*/
|
||||
include?: Prisma.ConsumerAccountDeviceInclude<ExtArgs> | null
|
||||
where?: Prisma.ConsumerAccountDeviceWhereInput
|
||||
}
|
||||
|
||||
/**
|
||||
* ConsumerAccount without action
|
||||
*/
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -206,8 +206,8 @@ export type ConsumerIndividualWhereInput = {
|
||||
updated_at?: Prisma.DateTimeFilter<"ConsumerIndividual"> | Date | string
|
||||
partner_id?: Prisma.StringFilter<"ConsumerIndividual"> | string
|
||||
consumer_id?: Prisma.StringFilter<"ConsumerIndividual"> | string
|
||||
partner?: Prisma.XOR<Prisma.PartnerScalarRelationFilter, Prisma.PartnerWhereInput>
|
||||
consumer?: Prisma.XOR<Prisma.ConsumerScalarRelationFilter, Prisma.ConsumerWhereInput>
|
||||
partner?: Prisma.XOR<Prisma.PartnerScalarRelationFilter, Prisma.PartnerWhereInput>
|
||||
}
|
||||
|
||||
export type ConsumerIndividualOrderByWithRelationInput = {
|
||||
@@ -219,8 +219,8 @@ export type ConsumerIndividualOrderByWithRelationInput = {
|
||||
updated_at?: Prisma.SortOrder
|
||||
partner_id?: Prisma.SortOrder
|
||||
consumer_id?: Prisma.SortOrder
|
||||
partner?: Prisma.PartnerOrderByWithRelationInput
|
||||
consumer?: Prisma.ConsumerOrderByWithRelationInput
|
||||
partner?: Prisma.PartnerOrderByWithRelationInput
|
||||
_relevance?: Prisma.ConsumerIndividualOrderByRelevanceInput
|
||||
}
|
||||
|
||||
@@ -238,8 +238,8 @@ export type ConsumerIndividualWhereUniqueInput = Prisma.AtLeast<{
|
||||
created_at?: Prisma.DateTimeFilter<"ConsumerIndividual"> | Date | string
|
||||
updated_at?: Prisma.DateTimeFilter<"ConsumerIndividual"> | Date | string
|
||||
partner_id?: Prisma.StringFilter<"ConsumerIndividual"> | string
|
||||
partner?: Prisma.XOR<Prisma.PartnerScalarRelationFilter, Prisma.PartnerWhereInput>
|
||||
consumer?: Prisma.XOR<Prisma.ConsumerScalarRelationFilter, Prisma.ConsumerWhereInput>
|
||||
partner?: Prisma.XOR<Prisma.PartnerScalarRelationFilter, Prisma.PartnerWhereInput>
|
||||
}, "consumer_id" | "mobile_number_consumer_id" | "partner_id_national_code">
|
||||
|
||||
export type ConsumerIndividualOrderByWithAggregationInput = {
|
||||
@@ -277,8 +277,8 @@ export type ConsumerIndividualCreateInput = {
|
||||
national_code: string
|
||||
created_at?: Date | string
|
||||
updated_at?: Date | string
|
||||
partner: Prisma.PartnerCreateNestedOneWithoutConsumers_individualInput
|
||||
consumer: Prisma.ConsumerCreateNestedOneWithoutIndividualInput
|
||||
partner: Prisma.PartnerCreateNestedOneWithoutConsumers_individualInput
|
||||
}
|
||||
|
||||
export type ConsumerIndividualUncheckedCreateInput = {
|
||||
@@ -299,8 +299,8 @@ export type ConsumerIndividualUpdateInput = {
|
||||
national_code?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
partner?: Prisma.PartnerUpdateOneRequiredWithoutConsumers_individualNestedInput
|
||||
consumer?: Prisma.ConsumerUpdateOneRequiredWithoutIndividualNestedInput
|
||||
partner?: Prisma.PartnerUpdateOneRequiredWithoutConsumers_individualNestedInput
|
||||
}
|
||||
|
||||
export type ConsumerIndividualUncheckedUpdateInput = {
|
||||
@@ -650,8 +650,8 @@ export type ConsumerIndividualSelect<ExtArgs extends runtime.Types.Extensions.In
|
||||
updated_at?: boolean
|
||||
partner_id?: boolean
|
||||
consumer_id?: boolean
|
||||
partner?: boolean | Prisma.PartnerDefaultArgs<ExtArgs>
|
||||
consumer?: boolean | Prisma.ConsumerDefaultArgs<ExtArgs>
|
||||
partner?: boolean | Prisma.PartnerDefaultArgs<ExtArgs>
|
||||
}, ExtArgs["result"]["consumerIndividual"]>
|
||||
|
||||
|
||||
@@ -669,15 +669,15 @@ export type ConsumerIndividualSelectScalar = {
|
||||
|
||||
export type ConsumerIndividualOmit<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetOmit<"first_name" | "last_name" | "mobile_number" | "national_code" | "created_at" | "updated_at" | "partner_id" | "consumer_id", ExtArgs["result"]["consumerIndividual"]>
|
||||
export type ConsumerIndividualInclude<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
|
||||
partner?: boolean | Prisma.PartnerDefaultArgs<ExtArgs>
|
||||
consumer?: boolean | Prisma.ConsumerDefaultArgs<ExtArgs>
|
||||
partner?: boolean | Prisma.PartnerDefaultArgs<ExtArgs>
|
||||
}
|
||||
|
||||
export type $ConsumerIndividualPayload<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
|
||||
name: "ConsumerIndividual"
|
||||
objects: {
|
||||
partner: Prisma.$PartnerPayload<ExtArgs>
|
||||
consumer: Prisma.$ConsumerPayload<ExtArgs>
|
||||
partner: Prisma.$PartnerPayload<ExtArgs>
|
||||
}
|
||||
scalars: runtime.Types.Extensions.GetPayloadResult<{
|
||||
first_name: string
|
||||
@@ -1028,8 +1028,8 @@ readonly fields: ConsumerIndividualFieldRefs;
|
||||
*/
|
||||
export interface Prisma__ConsumerIndividualClient<T, Null = never, ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs, GlobalOmitOptions = {}> extends Prisma.PrismaPromise<T> {
|
||||
readonly [Symbol.toStringTag]: "PrismaPromise"
|
||||
partner<T extends Prisma.PartnerDefaultArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.PartnerDefaultArgs<ExtArgs>>): Prisma.Prisma__PartnerClient<runtime.Types.Result.GetResult<Prisma.$PartnerPayload<ExtArgs>, T, "findUniqueOrThrow", GlobalOmitOptions> | Null, Null, ExtArgs, GlobalOmitOptions>
|
||||
consumer<T extends Prisma.ConsumerDefaultArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.ConsumerDefaultArgs<ExtArgs>>): Prisma.Prisma__ConsumerClient<runtime.Types.Result.GetResult<Prisma.$ConsumerPayload<ExtArgs>, T, "findUniqueOrThrow", GlobalOmitOptions> | Null, Null, ExtArgs, GlobalOmitOptions>
|
||||
partner<T extends Prisma.PartnerDefaultArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.PartnerDefaultArgs<ExtArgs>>): Prisma.Prisma__PartnerClient<runtime.Types.Result.GetResult<Prisma.$PartnerPayload<ExtArgs>, T, "findUniqueOrThrow", GlobalOmitOptions> | Null, Null, ExtArgs, GlobalOmitOptions>
|
||||
/**
|
||||
* Attaches callbacks for the resolution and/or rejection of the Promise.
|
||||
* @param onfulfilled The callback to execute when the Promise is resolved.
|
||||
|
||||
@@ -190,8 +190,8 @@ export type ConsumerLegalWhereInput = {
|
||||
updated_at?: Prisma.DateTimeFilter<"ConsumerLegal"> | Date | string
|
||||
partner_id?: Prisma.StringFilter<"ConsumerLegal"> | string
|
||||
consumer_id?: Prisma.StringFilter<"ConsumerLegal"> | string
|
||||
partner?: Prisma.XOR<Prisma.PartnerScalarRelationFilter, Prisma.PartnerWhereInput>
|
||||
consumer?: Prisma.XOR<Prisma.ConsumerScalarRelationFilter, Prisma.ConsumerWhereInput>
|
||||
partner?: Prisma.XOR<Prisma.PartnerScalarRelationFilter, Prisma.PartnerWhereInput>
|
||||
}
|
||||
|
||||
export type ConsumerLegalOrderByWithRelationInput = {
|
||||
@@ -201,8 +201,8 @@ export type ConsumerLegalOrderByWithRelationInput = {
|
||||
updated_at?: Prisma.SortOrder
|
||||
partner_id?: Prisma.SortOrder
|
||||
consumer_id?: Prisma.SortOrder
|
||||
partner?: Prisma.PartnerOrderByWithRelationInput
|
||||
consumer?: Prisma.ConsumerOrderByWithRelationInput
|
||||
partner?: Prisma.PartnerOrderByWithRelationInput
|
||||
_relevance?: Prisma.ConsumerLegalOrderByRelevanceInput
|
||||
}
|
||||
|
||||
@@ -217,8 +217,8 @@ export type ConsumerLegalWhereUniqueInput = Prisma.AtLeast<{
|
||||
created_at?: Prisma.DateTimeFilter<"ConsumerLegal"> | Date | string
|
||||
updated_at?: Prisma.DateTimeFilter<"ConsumerLegal"> | Date | string
|
||||
partner_id?: Prisma.StringFilter<"ConsumerLegal"> | string
|
||||
partner?: Prisma.XOR<Prisma.PartnerScalarRelationFilter, Prisma.PartnerWhereInput>
|
||||
consumer?: Prisma.XOR<Prisma.ConsumerScalarRelationFilter, Prisma.ConsumerWhereInput>
|
||||
partner?: Prisma.XOR<Prisma.PartnerScalarRelationFilter, Prisma.PartnerWhereInput>
|
||||
}, "consumer_id" | "partner_id_registration_code">
|
||||
|
||||
export type ConsumerLegalOrderByWithAggregationInput = {
|
||||
@@ -250,8 +250,8 @@ export type ConsumerLegalCreateInput = {
|
||||
registration_code: string
|
||||
created_at?: Date | string
|
||||
updated_at?: Date | string
|
||||
partner: Prisma.PartnerCreateNestedOneWithoutConsumers_legalInput
|
||||
consumer: Prisma.ConsumerCreateNestedOneWithoutLegalInput
|
||||
partner: Prisma.PartnerCreateNestedOneWithoutConsumers_legalInput
|
||||
}
|
||||
|
||||
export type ConsumerLegalUncheckedCreateInput = {
|
||||
@@ -268,8 +268,8 @@ export type ConsumerLegalUpdateInput = {
|
||||
registration_code?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
partner?: Prisma.PartnerUpdateOneRequiredWithoutConsumers_legalNestedInput
|
||||
consumer?: Prisma.ConsumerUpdateOneRequiredWithoutLegalNestedInput
|
||||
partner?: Prisma.PartnerUpdateOneRequiredWithoutConsumers_legalNestedInput
|
||||
}
|
||||
|
||||
export type ConsumerLegalUncheckedUpdateInput = {
|
||||
@@ -576,8 +576,8 @@ export type ConsumerLegalSelect<ExtArgs extends runtime.Types.Extensions.Interna
|
||||
updated_at?: boolean
|
||||
partner_id?: boolean
|
||||
consumer_id?: boolean
|
||||
partner?: boolean | Prisma.PartnerDefaultArgs<ExtArgs>
|
||||
consumer?: boolean | Prisma.ConsumerDefaultArgs<ExtArgs>
|
||||
partner?: boolean | Prisma.PartnerDefaultArgs<ExtArgs>
|
||||
}, ExtArgs["result"]["consumerLegal"]>
|
||||
|
||||
|
||||
@@ -593,15 +593,15 @@ export type ConsumerLegalSelectScalar = {
|
||||
|
||||
export type ConsumerLegalOmit<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetOmit<"name" | "registration_code" | "created_at" | "updated_at" | "partner_id" | "consumer_id", ExtArgs["result"]["consumerLegal"]>
|
||||
export type ConsumerLegalInclude<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
|
||||
partner?: boolean | Prisma.PartnerDefaultArgs<ExtArgs>
|
||||
consumer?: boolean | Prisma.ConsumerDefaultArgs<ExtArgs>
|
||||
partner?: boolean | Prisma.PartnerDefaultArgs<ExtArgs>
|
||||
}
|
||||
|
||||
export type $ConsumerLegalPayload<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
|
||||
name: "ConsumerLegal"
|
||||
objects: {
|
||||
partner: Prisma.$PartnerPayload<ExtArgs>
|
||||
consumer: Prisma.$ConsumerPayload<ExtArgs>
|
||||
partner: Prisma.$PartnerPayload<ExtArgs>
|
||||
}
|
||||
scalars: runtime.Types.Extensions.GetPayloadResult<{
|
||||
name: string
|
||||
@@ -950,8 +950,8 @@ readonly fields: ConsumerLegalFieldRefs;
|
||||
*/
|
||||
export interface Prisma__ConsumerLegalClient<T, Null = never, ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs, GlobalOmitOptions = {}> extends Prisma.PrismaPromise<T> {
|
||||
readonly [Symbol.toStringTag]: "PrismaPromise"
|
||||
partner<T extends Prisma.PartnerDefaultArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.PartnerDefaultArgs<ExtArgs>>): Prisma.Prisma__PartnerClient<runtime.Types.Result.GetResult<Prisma.$PartnerPayload<ExtArgs>, T, "findUniqueOrThrow", GlobalOmitOptions> | Null, Null, ExtArgs, GlobalOmitOptions>
|
||||
consumer<T extends Prisma.ConsumerDefaultArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.ConsumerDefaultArgs<ExtArgs>>): Prisma.Prisma__ConsumerClient<runtime.Types.Result.GetResult<Prisma.$ConsumerPayload<ExtArgs>, T, "findUniqueOrThrow", GlobalOmitOptions> | Null, Null, ExtArgs, GlobalOmitOptions>
|
||||
partner<T extends Prisma.PartnerDefaultArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.PartnerDefaultArgs<ExtArgs>>): Prisma.Prisma__PartnerClient<runtime.Types.Result.GetResult<Prisma.$PartnerPayload<ExtArgs>, T, "findUniqueOrThrow", GlobalOmitOptions> | Null, Null, ExtArgs, GlobalOmitOptions>
|
||||
/**
|
||||
* Attaches callbacks for the resolution and/or rejection of the Promise.
|
||||
* @param onfulfilled The callback to execute when the Promise is resolved.
|
||||
|
||||
@@ -166,11 +166,11 @@ export type CustomerIndividualGroupByArgs<ExtArgs extends runtime.Types.Extensio
|
||||
}
|
||||
|
||||
export type CustomerIndividualGroupByOutputType = {
|
||||
first_name: string
|
||||
last_name: string
|
||||
national_id: string
|
||||
mobile_number: string
|
||||
postal_code: string
|
||||
first_name: string | null
|
||||
last_name: string | null
|
||||
national_id: string | null
|
||||
mobile_number: string | null
|
||||
postal_code: string | null
|
||||
economic_code: string | null
|
||||
customer_id: string
|
||||
business_activity_id: string
|
||||
@@ -198,55 +198,56 @@ export type CustomerIndividualWhereInput = {
|
||||
AND?: Prisma.CustomerIndividualWhereInput | Prisma.CustomerIndividualWhereInput[]
|
||||
OR?: Prisma.CustomerIndividualWhereInput[]
|
||||
NOT?: Prisma.CustomerIndividualWhereInput | Prisma.CustomerIndividualWhereInput[]
|
||||
first_name?: Prisma.StringFilter<"CustomerIndividual"> | string
|
||||
last_name?: Prisma.StringFilter<"CustomerIndividual"> | string
|
||||
national_id?: Prisma.StringFilter<"CustomerIndividual"> | string
|
||||
mobile_number?: Prisma.StringFilter<"CustomerIndividual"> | string
|
||||
postal_code?: Prisma.StringFilter<"CustomerIndividual"> | string
|
||||
first_name?: Prisma.StringNullableFilter<"CustomerIndividual"> | string | null
|
||||
last_name?: Prisma.StringNullableFilter<"CustomerIndividual"> | string | null
|
||||
national_id?: Prisma.StringNullableFilter<"CustomerIndividual"> | string | null
|
||||
mobile_number?: Prisma.StringNullableFilter<"CustomerIndividual"> | string | null
|
||||
postal_code?: Prisma.StringNullableFilter<"CustomerIndividual"> | string | null
|
||||
economic_code?: Prisma.StringNullableFilter<"CustomerIndividual"> | string | null
|
||||
customer_id?: Prisma.StringFilter<"CustomerIndividual"> | string
|
||||
business_activity_id?: Prisma.StringFilter<"CustomerIndividual"> | string
|
||||
customer?: Prisma.XOR<Prisma.CustomerScalarRelationFilter, Prisma.CustomerWhereInput>
|
||||
business_activity?: Prisma.XOR<Prisma.BusinessActivityScalarRelationFilter, Prisma.BusinessActivityWhereInput>
|
||||
customer?: Prisma.XOR<Prisma.CustomerScalarRelationFilter, Prisma.CustomerWhereInput>
|
||||
}
|
||||
|
||||
export type CustomerIndividualOrderByWithRelationInput = {
|
||||
first_name?: Prisma.SortOrder
|
||||
last_name?: Prisma.SortOrder
|
||||
national_id?: Prisma.SortOrder
|
||||
mobile_number?: Prisma.SortOrder
|
||||
postal_code?: Prisma.SortOrder
|
||||
first_name?: Prisma.SortOrderInput | Prisma.SortOrder
|
||||
last_name?: Prisma.SortOrderInput | Prisma.SortOrder
|
||||
national_id?: Prisma.SortOrderInput | Prisma.SortOrder
|
||||
mobile_number?: Prisma.SortOrderInput | Prisma.SortOrder
|
||||
postal_code?: Prisma.SortOrderInput | Prisma.SortOrder
|
||||
economic_code?: Prisma.SortOrderInput | Prisma.SortOrder
|
||||
customer_id?: Prisma.SortOrder
|
||||
business_activity_id?: Prisma.SortOrder
|
||||
customer?: Prisma.CustomerOrderByWithRelationInput
|
||||
business_activity?: Prisma.BusinessActivityOrderByWithRelationInput
|
||||
customer?: Prisma.CustomerOrderByWithRelationInput
|
||||
_relevance?: Prisma.CustomerIndividualOrderByRelevanceInput
|
||||
}
|
||||
|
||||
export type CustomerIndividualWhereUniqueInput = Prisma.AtLeast<{
|
||||
customer_id?: string
|
||||
business_activity_id_national_id?: Prisma.CustomerIndividualBusiness_activity_idNational_idCompoundUniqueInput
|
||||
business_activity_id_postal_code_national_id?: Prisma.CustomerIndividualBusiness_activity_idPostal_codeNational_idCompoundUniqueInput
|
||||
AND?: Prisma.CustomerIndividualWhereInput | Prisma.CustomerIndividualWhereInput[]
|
||||
OR?: Prisma.CustomerIndividualWhereInput[]
|
||||
NOT?: Prisma.CustomerIndividualWhereInput | Prisma.CustomerIndividualWhereInput[]
|
||||
first_name?: Prisma.StringFilter<"CustomerIndividual"> | string
|
||||
last_name?: Prisma.StringFilter<"CustomerIndividual"> | string
|
||||
national_id?: Prisma.StringFilter<"CustomerIndividual"> | string
|
||||
mobile_number?: Prisma.StringFilter<"CustomerIndividual"> | string
|
||||
postal_code?: Prisma.StringFilter<"CustomerIndividual"> | string
|
||||
first_name?: Prisma.StringNullableFilter<"CustomerIndividual"> | string | null
|
||||
last_name?: Prisma.StringNullableFilter<"CustomerIndividual"> | string | null
|
||||
national_id?: Prisma.StringNullableFilter<"CustomerIndividual"> | string | null
|
||||
mobile_number?: Prisma.StringNullableFilter<"CustomerIndividual"> | string | null
|
||||
postal_code?: Prisma.StringNullableFilter<"CustomerIndividual"> | string | null
|
||||
economic_code?: Prisma.StringNullableFilter<"CustomerIndividual"> | string | null
|
||||
business_activity_id?: Prisma.StringFilter<"CustomerIndividual"> | string
|
||||
customer?: Prisma.XOR<Prisma.CustomerScalarRelationFilter, Prisma.CustomerWhereInput>
|
||||
business_activity?: Prisma.XOR<Prisma.BusinessActivityScalarRelationFilter, Prisma.BusinessActivityWhereInput>
|
||||
}, "customer_id" | "business_activity_id_national_id">
|
||||
customer?: Prisma.XOR<Prisma.CustomerScalarRelationFilter, Prisma.CustomerWhereInput>
|
||||
}, "customer_id" | "business_activity_id_national_id" | "business_activity_id_postal_code_national_id">
|
||||
|
||||
export type CustomerIndividualOrderByWithAggregationInput = {
|
||||
first_name?: Prisma.SortOrder
|
||||
last_name?: Prisma.SortOrder
|
||||
national_id?: Prisma.SortOrder
|
||||
mobile_number?: Prisma.SortOrder
|
||||
postal_code?: Prisma.SortOrder
|
||||
first_name?: Prisma.SortOrderInput | Prisma.SortOrder
|
||||
last_name?: Prisma.SortOrderInput | Prisma.SortOrder
|
||||
national_id?: Prisma.SortOrderInput | Prisma.SortOrder
|
||||
mobile_number?: Prisma.SortOrderInput | Prisma.SortOrder
|
||||
postal_code?: Prisma.SortOrderInput | Prisma.SortOrder
|
||||
economic_code?: Prisma.SortOrderInput | Prisma.SortOrder
|
||||
customer_id?: Prisma.SortOrder
|
||||
business_activity_id?: Prisma.SortOrder
|
||||
@@ -259,86 +260,86 @@ export type CustomerIndividualScalarWhereWithAggregatesInput = {
|
||||
AND?: Prisma.CustomerIndividualScalarWhereWithAggregatesInput | Prisma.CustomerIndividualScalarWhereWithAggregatesInput[]
|
||||
OR?: Prisma.CustomerIndividualScalarWhereWithAggregatesInput[]
|
||||
NOT?: Prisma.CustomerIndividualScalarWhereWithAggregatesInput | Prisma.CustomerIndividualScalarWhereWithAggregatesInput[]
|
||||
first_name?: Prisma.StringWithAggregatesFilter<"CustomerIndividual"> | string
|
||||
last_name?: Prisma.StringWithAggregatesFilter<"CustomerIndividual"> | string
|
||||
national_id?: Prisma.StringWithAggregatesFilter<"CustomerIndividual"> | string
|
||||
mobile_number?: Prisma.StringWithAggregatesFilter<"CustomerIndividual"> | string
|
||||
postal_code?: Prisma.StringWithAggregatesFilter<"CustomerIndividual"> | string
|
||||
first_name?: Prisma.StringNullableWithAggregatesFilter<"CustomerIndividual"> | string | null
|
||||
last_name?: Prisma.StringNullableWithAggregatesFilter<"CustomerIndividual"> | string | null
|
||||
national_id?: Prisma.StringNullableWithAggregatesFilter<"CustomerIndividual"> | string | null
|
||||
mobile_number?: Prisma.StringNullableWithAggregatesFilter<"CustomerIndividual"> | string | null
|
||||
postal_code?: Prisma.StringNullableWithAggregatesFilter<"CustomerIndividual"> | string | null
|
||||
economic_code?: Prisma.StringNullableWithAggregatesFilter<"CustomerIndividual"> | string | null
|
||||
customer_id?: Prisma.StringWithAggregatesFilter<"CustomerIndividual"> | string
|
||||
business_activity_id?: Prisma.StringWithAggregatesFilter<"CustomerIndividual"> | string
|
||||
}
|
||||
|
||||
export type CustomerIndividualCreateInput = {
|
||||
first_name: string
|
||||
last_name: string
|
||||
national_id: string
|
||||
mobile_number: string
|
||||
postal_code: string
|
||||
first_name?: string | null
|
||||
last_name?: string | null
|
||||
national_id?: string | null
|
||||
mobile_number?: string | null
|
||||
postal_code?: string | null
|
||||
economic_code?: string | null
|
||||
customer: Prisma.CustomerCreateNestedOneWithoutIndividualInput
|
||||
business_activity: Prisma.BusinessActivityCreateNestedOneWithoutCustomer_individualsInput
|
||||
customer: Prisma.CustomerCreateNestedOneWithoutIndividualInput
|
||||
}
|
||||
|
||||
export type CustomerIndividualUncheckedCreateInput = {
|
||||
first_name: string
|
||||
last_name: string
|
||||
national_id: string
|
||||
mobile_number: string
|
||||
postal_code: string
|
||||
first_name?: string | null
|
||||
last_name?: string | null
|
||||
national_id?: string | null
|
||||
mobile_number?: string | null
|
||||
postal_code?: string | null
|
||||
economic_code?: string | null
|
||||
customer_id: string
|
||||
business_activity_id: string
|
||||
}
|
||||
|
||||
export type CustomerIndividualUpdateInput = {
|
||||
first_name?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
last_name?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
national_id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
mobile_number?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
postal_code?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
first_name?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
last_name?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
national_id?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
mobile_number?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
postal_code?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
economic_code?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
customer?: Prisma.CustomerUpdateOneRequiredWithoutIndividualNestedInput
|
||||
business_activity?: Prisma.BusinessActivityUpdateOneRequiredWithoutCustomer_individualsNestedInput
|
||||
customer?: Prisma.CustomerUpdateOneRequiredWithoutIndividualNestedInput
|
||||
}
|
||||
|
||||
export type CustomerIndividualUncheckedUpdateInput = {
|
||||
first_name?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
last_name?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
national_id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
mobile_number?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
postal_code?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
first_name?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
last_name?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
national_id?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
mobile_number?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
postal_code?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
economic_code?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
customer_id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
business_activity_id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
}
|
||||
|
||||
export type CustomerIndividualCreateManyInput = {
|
||||
first_name: string
|
||||
last_name: string
|
||||
national_id: string
|
||||
mobile_number: string
|
||||
postal_code: string
|
||||
first_name?: string | null
|
||||
last_name?: string | null
|
||||
national_id?: string | null
|
||||
mobile_number?: string | null
|
||||
postal_code?: string | null
|
||||
economic_code?: string | null
|
||||
customer_id: string
|
||||
business_activity_id: string
|
||||
}
|
||||
|
||||
export type CustomerIndividualUpdateManyMutationInput = {
|
||||
first_name?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
last_name?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
national_id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
mobile_number?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
postal_code?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
first_name?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
last_name?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
national_id?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
mobile_number?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
postal_code?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
economic_code?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
}
|
||||
|
||||
export type CustomerIndividualUncheckedUpdateManyInput = {
|
||||
first_name?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
last_name?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
national_id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
mobile_number?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
postal_code?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
first_name?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
last_name?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
national_id?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
mobile_number?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
postal_code?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
economic_code?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
customer_id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
business_activity_id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
@@ -370,6 +371,12 @@ export type CustomerIndividualBusiness_activity_idNational_idCompoundUniqueInput
|
||||
national_id: string
|
||||
}
|
||||
|
||||
export type CustomerIndividualBusiness_activity_idPostal_codeNational_idCompoundUniqueInput = {
|
||||
business_activity_id: string
|
||||
postal_code: string
|
||||
national_id: string
|
||||
}
|
||||
|
||||
export type CustomerIndividualCountOrderByAggregateInput = {
|
||||
first_name?: Prisma.SortOrder
|
||||
last_name?: Prisma.SortOrder
|
||||
@@ -478,21 +485,21 @@ export type CustomerIndividualUncheckedUpdateOneWithoutCustomerNestedInput = {
|
||||
}
|
||||
|
||||
export type CustomerIndividualCreateWithoutBusiness_activityInput = {
|
||||
first_name: string
|
||||
last_name: string
|
||||
national_id: string
|
||||
mobile_number: string
|
||||
postal_code: string
|
||||
first_name?: string | null
|
||||
last_name?: string | null
|
||||
national_id?: string | null
|
||||
mobile_number?: string | null
|
||||
postal_code?: string | null
|
||||
economic_code?: string | null
|
||||
customer: Prisma.CustomerCreateNestedOneWithoutIndividualInput
|
||||
}
|
||||
|
||||
export type CustomerIndividualUncheckedCreateWithoutBusiness_activityInput = {
|
||||
first_name: string
|
||||
last_name: string
|
||||
national_id: string
|
||||
mobile_number: string
|
||||
postal_code: string
|
||||
first_name?: string | null
|
||||
last_name?: string | null
|
||||
national_id?: string | null
|
||||
mobile_number?: string | null
|
||||
postal_code?: string | null
|
||||
economic_code?: string | null
|
||||
customer_id: string
|
||||
}
|
||||
@@ -527,32 +534,32 @@ export type CustomerIndividualScalarWhereInput = {
|
||||
AND?: Prisma.CustomerIndividualScalarWhereInput | Prisma.CustomerIndividualScalarWhereInput[]
|
||||
OR?: Prisma.CustomerIndividualScalarWhereInput[]
|
||||
NOT?: Prisma.CustomerIndividualScalarWhereInput | Prisma.CustomerIndividualScalarWhereInput[]
|
||||
first_name?: Prisma.StringFilter<"CustomerIndividual"> | string
|
||||
last_name?: Prisma.StringFilter<"CustomerIndividual"> | string
|
||||
national_id?: Prisma.StringFilter<"CustomerIndividual"> | string
|
||||
mobile_number?: Prisma.StringFilter<"CustomerIndividual"> | string
|
||||
postal_code?: Prisma.StringFilter<"CustomerIndividual"> | string
|
||||
first_name?: Prisma.StringNullableFilter<"CustomerIndividual"> | string | null
|
||||
last_name?: Prisma.StringNullableFilter<"CustomerIndividual"> | string | null
|
||||
national_id?: Prisma.StringNullableFilter<"CustomerIndividual"> | string | null
|
||||
mobile_number?: Prisma.StringNullableFilter<"CustomerIndividual"> | string | null
|
||||
postal_code?: Prisma.StringNullableFilter<"CustomerIndividual"> | string | null
|
||||
economic_code?: Prisma.StringNullableFilter<"CustomerIndividual"> | string | null
|
||||
customer_id?: Prisma.StringFilter<"CustomerIndividual"> | string
|
||||
business_activity_id?: Prisma.StringFilter<"CustomerIndividual"> | string
|
||||
}
|
||||
|
||||
export type CustomerIndividualCreateWithoutCustomerInput = {
|
||||
first_name: string
|
||||
last_name: string
|
||||
national_id: string
|
||||
mobile_number: string
|
||||
postal_code: string
|
||||
first_name?: string | null
|
||||
last_name?: string | null
|
||||
national_id?: string | null
|
||||
mobile_number?: string | null
|
||||
postal_code?: string | null
|
||||
economic_code?: string | null
|
||||
business_activity: Prisma.BusinessActivityCreateNestedOneWithoutCustomer_individualsInput
|
||||
}
|
||||
|
||||
export type CustomerIndividualUncheckedCreateWithoutCustomerInput = {
|
||||
first_name: string
|
||||
last_name: string
|
||||
national_id: string
|
||||
mobile_number: string
|
||||
postal_code: string
|
||||
first_name?: string | null
|
||||
last_name?: string | null
|
||||
national_id?: string | null
|
||||
mobile_number?: string | null
|
||||
postal_code?: string | null
|
||||
economic_code?: string | null
|
||||
business_activity_id: string
|
||||
}
|
||||
@@ -574,61 +581,61 @@ export type CustomerIndividualUpdateToOneWithWhereWithoutCustomerInput = {
|
||||
}
|
||||
|
||||
export type CustomerIndividualUpdateWithoutCustomerInput = {
|
||||
first_name?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
last_name?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
national_id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
mobile_number?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
postal_code?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
first_name?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
last_name?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
national_id?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
mobile_number?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
postal_code?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
economic_code?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
business_activity?: Prisma.BusinessActivityUpdateOneRequiredWithoutCustomer_individualsNestedInput
|
||||
}
|
||||
|
||||
export type CustomerIndividualUncheckedUpdateWithoutCustomerInput = {
|
||||
first_name?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
last_name?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
national_id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
mobile_number?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
postal_code?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
first_name?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
last_name?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
national_id?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
mobile_number?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
postal_code?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
economic_code?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
business_activity_id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
}
|
||||
|
||||
export type CustomerIndividualCreateManyBusiness_activityInput = {
|
||||
first_name: string
|
||||
last_name: string
|
||||
national_id: string
|
||||
mobile_number: string
|
||||
postal_code: string
|
||||
first_name?: string | null
|
||||
last_name?: string | null
|
||||
national_id?: string | null
|
||||
mobile_number?: string | null
|
||||
postal_code?: string | null
|
||||
economic_code?: string | null
|
||||
customer_id: string
|
||||
}
|
||||
|
||||
export type CustomerIndividualUpdateWithoutBusiness_activityInput = {
|
||||
first_name?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
last_name?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
national_id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
mobile_number?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
postal_code?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
first_name?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
last_name?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
national_id?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
mobile_number?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
postal_code?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
economic_code?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
customer?: Prisma.CustomerUpdateOneRequiredWithoutIndividualNestedInput
|
||||
}
|
||||
|
||||
export type CustomerIndividualUncheckedUpdateWithoutBusiness_activityInput = {
|
||||
first_name?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
last_name?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
national_id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
mobile_number?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
postal_code?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
first_name?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
last_name?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
national_id?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
mobile_number?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
postal_code?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
economic_code?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
customer_id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
}
|
||||
|
||||
export type CustomerIndividualUncheckedUpdateManyWithoutBusiness_activityInput = {
|
||||
first_name?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
last_name?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
national_id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
mobile_number?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
postal_code?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
first_name?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
last_name?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
national_id?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
mobile_number?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
postal_code?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
economic_code?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
customer_id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
}
|
||||
@@ -644,8 +651,8 @@ export type CustomerIndividualSelect<ExtArgs extends runtime.Types.Extensions.In
|
||||
economic_code?: boolean
|
||||
customer_id?: boolean
|
||||
business_activity_id?: boolean
|
||||
customer?: boolean | Prisma.CustomerDefaultArgs<ExtArgs>
|
||||
business_activity?: boolean | Prisma.BusinessActivityDefaultArgs<ExtArgs>
|
||||
customer?: boolean | Prisma.CustomerDefaultArgs<ExtArgs>
|
||||
}, ExtArgs["result"]["customerIndividual"]>
|
||||
|
||||
|
||||
@@ -663,22 +670,22 @@ export type CustomerIndividualSelectScalar = {
|
||||
|
||||
export type CustomerIndividualOmit<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetOmit<"first_name" | "last_name" | "national_id" | "mobile_number" | "postal_code" | "economic_code" | "customer_id" | "business_activity_id", ExtArgs["result"]["customerIndividual"]>
|
||||
export type CustomerIndividualInclude<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
|
||||
customer?: boolean | Prisma.CustomerDefaultArgs<ExtArgs>
|
||||
business_activity?: boolean | Prisma.BusinessActivityDefaultArgs<ExtArgs>
|
||||
customer?: boolean | Prisma.CustomerDefaultArgs<ExtArgs>
|
||||
}
|
||||
|
||||
export type $CustomerIndividualPayload<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
|
||||
name: "CustomerIndividual"
|
||||
objects: {
|
||||
customer: Prisma.$CustomerPayload<ExtArgs>
|
||||
business_activity: Prisma.$BusinessActivityPayload<ExtArgs>
|
||||
customer: Prisma.$CustomerPayload<ExtArgs>
|
||||
}
|
||||
scalars: runtime.Types.Extensions.GetPayloadResult<{
|
||||
first_name: string
|
||||
last_name: string
|
||||
national_id: string
|
||||
mobile_number: string
|
||||
postal_code: string
|
||||
first_name: string | null
|
||||
last_name: string | null
|
||||
national_id: string | null
|
||||
mobile_number: string | null
|
||||
postal_code: string | null
|
||||
economic_code: string | null
|
||||
customer_id: string
|
||||
business_activity_id: string
|
||||
@@ -1022,8 +1029,8 @@ readonly fields: CustomerIndividualFieldRefs;
|
||||
*/
|
||||
export interface Prisma__CustomerIndividualClient<T, Null = never, ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs, GlobalOmitOptions = {}> extends Prisma.PrismaPromise<T> {
|
||||
readonly [Symbol.toStringTag]: "PrismaPromise"
|
||||
customer<T extends Prisma.CustomerDefaultArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.CustomerDefaultArgs<ExtArgs>>): Prisma.Prisma__CustomerClient<runtime.Types.Result.GetResult<Prisma.$CustomerPayload<ExtArgs>, T, "findUniqueOrThrow", GlobalOmitOptions> | Null, Null, ExtArgs, GlobalOmitOptions>
|
||||
business_activity<T extends Prisma.BusinessActivityDefaultArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.BusinessActivityDefaultArgs<ExtArgs>>): Prisma.Prisma__BusinessActivityClient<runtime.Types.Result.GetResult<Prisma.$BusinessActivityPayload<ExtArgs>, T, "findUniqueOrThrow", GlobalOmitOptions> | Null, Null, ExtArgs, GlobalOmitOptions>
|
||||
customer<T extends Prisma.CustomerDefaultArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.CustomerDefaultArgs<ExtArgs>>): Prisma.Prisma__CustomerClient<runtime.Types.Result.GetResult<Prisma.$CustomerPayload<ExtArgs>, T, "findUniqueOrThrow", GlobalOmitOptions> | Null, Null, ExtArgs, GlobalOmitOptions>
|
||||
/**
|
||||
* Attaches callbacks for the resolution and/or rejection of the Promise.
|
||||
* @param onfulfilled The callback to execute when the Promise is resolved.
|
||||
|
||||
@@ -154,10 +154,10 @@ export type CustomerLegalGroupByArgs<ExtArgs extends runtime.Types.Extensions.In
|
||||
}
|
||||
|
||||
export type CustomerLegalGroupByOutputType = {
|
||||
name: string
|
||||
economic_code: string
|
||||
name: string | null
|
||||
economic_code: string | null
|
||||
registration_number: string | null
|
||||
postal_code: string
|
||||
postal_code: string | null
|
||||
customer_id: string
|
||||
business_activity_id: string
|
||||
_count: CustomerLegalCountAggregateOutputType | null
|
||||
@@ -184,48 +184,49 @@ export type CustomerLegalWhereInput = {
|
||||
AND?: Prisma.CustomerLegalWhereInput | Prisma.CustomerLegalWhereInput[]
|
||||
OR?: Prisma.CustomerLegalWhereInput[]
|
||||
NOT?: Prisma.CustomerLegalWhereInput | Prisma.CustomerLegalWhereInput[]
|
||||
name?: Prisma.StringFilter<"CustomerLegal"> | string
|
||||
economic_code?: Prisma.StringFilter<"CustomerLegal"> | string
|
||||
name?: Prisma.StringNullableFilter<"CustomerLegal"> | string | null
|
||||
economic_code?: Prisma.StringNullableFilter<"CustomerLegal"> | string | null
|
||||
registration_number?: Prisma.StringNullableFilter<"CustomerLegal"> | string | null
|
||||
postal_code?: Prisma.StringFilter<"CustomerLegal"> | string
|
||||
postal_code?: Prisma.StringNullableFilter<"CustomerLegal"> | string | null
|
||||
customer_id?: Prisma.StringFilter<"CustomerLegal"> | string
|
||||
business_activity_id?: Prisma.StringFilter<"CustomerLegal"> | string
|
||||
customer?: Prisma.XOR<Prisma.CustomerScalarRelationFilter, Prisma.CustomerWhereInput>
|
||||
business_activity?: Prisma.XOR<Prisma.BusinessActivityScalarRelationFilter, Prisma.BusinessActivityWhereInput>
|
||||
customer?: Prisma.XOR<Prisma.CustomerScalarRelationFilter, Prisma.CustomerWhereInput>
|
||||
}
|
||||
|
||||
export type CustomerLegalOrderByWithRelationInput = {
|
||||
name?: Prisma.SortOrder
|
||||
economic_code?: Prisma.SortOrder
|
||||
name?: Prisma.SortOrderInput | Prisma.SortOrder
|
||||
economic_code?: Prisma.SortOrderInput | Prisma.SortOrder
|
||||
registration_number?: Prisma.SortOrderInput | Prisma.SortOrder
|
||||
postal_code?: Prisma.SortOrder
|
||||
postal_code?: Prisma.SortOrderInput | Prisma.SortOrder
|
||||
customer_id?: Prisma.SortOrder
|
||||
business_activity_id?: Prisma.SortOrder
|
||||
customer?: Prisma.CustomerOrderByWithRelationInput
|
||||
business_activity?: Prisma.BusinessActivityOrderByWithRelationInput
|
||||
customer?: Prisma.CustomerOrderByWithRelationInput
|
||||
_relevance?: Prisma.CustomerLegalOrderByRelevanceInput
|
||||
}
|
||||
|
||||
export type CustomerLegalWhereUniqueInput = Prisma.AtLeast<{
|
||||
customer_id?: string
|
||||
business_activity_id_economic_code?: Prisma.CustomerLegalBusiness_activity_idEconomic_codeCompoundUniqueInput
|
||||
business_activity_id_postal_code_registration_number?: Prisma.CustomerLegalBusiness_activity_idPostal_codeRegistration_numberCompoundUniqueInput
|
||||
AND?: Prisma.CustomerLegalWhereInput | Prisma.CustomerLegalWhereInput[]
|
||||
OR?: Prisma.CustomerLegalWhereInput[]
|
||||
NOT?: Prisma.CustomerLegalWhereInput | Prisma.CustomerLegalWhereInput[]
|
||||
name?: Prisma.StringFilter<"CustomerLegal"> | string
|
||||
economic_code?: Prisma.StringFilter<"CustomerLegal"> | string
|
||||
name?: Prisma.StringNullableFilter<"CustomerLegal"> | string | null
|
||||
economic_code?: Prisma.StringNullableFilter<"CustomerLegal"> | string | null
|
||||
registration_number?: Prisma.StringNullableFilter<"CustomerLegal"> | string | null
|
||||
postal_code?: Prisma.StringFilter<"CustomerLegal"> | string
|
||||
postal_code?: Prisma.StringNullableFilter<"CustomerLegal"> | string | null
|
||||
business_activity_id?: Prisma.StringFilter<"CustomerLegal"> | string
|
||||
customer?: Prisma.XOR<Prisma.CustomerScalarRelationFilter, Prisma.CustomerWhereInput>
|
||||
business_activity?: Prisma.XOR<Prisma.BusinessActivityScalarRelationFilter, Prisma.BusinessActivityWhereInput>
|
||||
}, "customer_id" | "business_activity_id_economic_code">
|
||||
customer?: Prisma.XOR<Prisma.CustomerScalarRelationFilter, Prisma.CustomerWhereInput>
|
||||
}, "customer_id" | "business_activity_id_economic_code" | "business_activity_id_postal_code_registration_number">
|
||||
|
||||
export type CustomerLegalOrderByWithAggregationInput = {
|
||||
name?: Prisma.SortOrder
|
||||
economic_code?: Prisma.SortOrder
|
||||
name?: Prisma.SortOrderInput | Prisma.SortOrder
|
||||
economic_code?: Prisma.SortOrderInput | Prisma.SortOrder
|
||||
registration_number?: Prisma.SortOrderInput | Prisma.SortOrder
|
||||
postal_code?: Prisma.SortOrder
|
||||
postal_code?: Prisma.SortOrderInput | Prisma.SortOrder
|
||||
customer_id?: Prisma.SortOrder
|
||||
business_activity_id?: Prisma.SortOrder
|
||||
_count?: Prisma.CustomerLegalCountOrderByAggregateInput
|
||||
@@ -237,71 +238,71 @@ export type CustomerLegalScalarWhereWithAggregatesInput = {
|
||||
AND?: Prisma.CustomerLegalScalarWhereWithAggregatesInput | Prisma.CustomerLegalScalarWhereWithAggregatesInput[]
|
||||
OR?: Prisma.CustomerLegalScalarWhereWithAggregatesInput[]
|
||||
NOT?: Prisma.CustomerLegalScalarWhereWithAggregatesInput | Prisma.CustomerLegalScalarWhereWithAggregatesInput[]
|
||||
name?: Prisma.StringWithAggregatesFilter<"CustomerLegal"> | string
|
||||
economic_code?: Prisma.StringWithAggregatesFilter<"CustomerLegal"> | string
|
||||
name?: Prisma.StringNullableWithAggregatesFilter<"CustomerLegal"> | string | null
|
||||
economic_code?: Prisma.StringNullableWithAggregatesFilter<"CustomerLegal"> | string | null
|
||||
registration_number?: Prisma.StringNullableWithAggregatesFilter<"CustomerLegal"> | string | null
|
||||
postal_code?: Prisma.StringWithAggregatesFilter<"CustomerLegal"> | string
|
||||
postal_code?: Prisma.StringNullableWithAggregatesFilter<"CustomerLegal"> | string | null
|
||||
customer_id?: Prisma.StringWithAggregatesFilter<"CustomerLegal"> | string
|
||||
business_activity_id?: Prisma.StringWithAggregatesFilter<"CustomerLegal"> | string
|
||||
}
|
||||
|
||||
export type CustomerLegalCreateInput = {
|
||||
name: string
|
||||
economic_code: string
|
||||
name?: string | null
|
||||
economic_code?: string | null
|
||||
registration_number?: string | null
|
||||
postal_code: string
|
||||
customer: Prisma.CustomerCreateNestedOneWithoutLegalInput
|
||||
postal_code?: string | null
|
||||
business_activity: Prisma.BusinessActivityCreateNestedOneWithoutCustomer_legalsInput
|
||||
customer: Prisma.CustomerCreateNestedOneWithoutLegalInput
|
||||
}
|
||||
|
||||
export type CustomerLegalUncheckedCreateInput = {
|
||||
name: string
|
||||
economic_code: string
|
||||
name?: string | null
|
||||
economic_code?: string | null
|
||||
registration_number?: string | null
|
||||
postal_code: string
|
||||
postal_code?: string | null
|
||||
customer_id: string
|
||||
business_activity_id: string
|
||||
}
|
||||
|
||||
export type CustomerLegalUpdateInput = {
|
||||
name?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
economic_code?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
name?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
economic_code?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
registration_number?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
postal_code?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
customer?: Prisma.CustomerUpdateOneRequiredWithoutLegalNestedInput
|
||||
postal_code?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
business_activity?: Prisma.BusinessActivityUpdateOneRequiredWithoutCustomer_legalsNestedInput
|
||||
customer?: Prisma.CustomerUpdateOneRequiredWithoutLegalNestedInput
|
||||
}
|
||||
|
||||
export type CustomerLegalUncheckedUpdateInput = {
|
||||
name?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
economic_code?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
name?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
economic_code?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
registration_number?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
postal_code?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
postal_code?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
customer_id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
business_activity_id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
}
|
||||
|
||||
export type CustomerLegalCreateManyInput = {
|
||||
name: string
|
||||
economic_code: string
|
||||
name?: string | null
|
||||
economic_code?: string | null
|
||||
registration_number?: string | null
|
||||
postal_code: string
|
||||
postal_code?: string | null
|
||||
customer_id: string
|
||||
business_activity_id: string
|
||||
}
|
||||
|
||||
export type CustomerLegalUpdateManyMutationInput = {
|
||||
name?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
economic_code?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
name?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
economic_code?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
registration_number?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
postal_code?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
postal_code?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
}
|
||||
|
||||
export type CustomerLegalUncheckedUpdateManyInput = {
|
||||
name?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
economic_code?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
name?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
economic_code?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
registration_number?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
postal_code?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
postal_code?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
customer_id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
business_activity_id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
}
|
||||
@@ -332,6 +333,12 @@ export type CustomerLegalBusiness_activity_idEconomic_codeCompoundUniqueInput =
|
||||
economic_code: string
|
||||
}
|
||||
|
||||
export type CustomerLegalBusiness_activity_idPostal_codeRegistration_numberCompoundUniqueInput = {
|
||||
business_activity_id: string
|
||||
postal_code: string
|
||||
registration_number: string
|
||||
}
|
||||
|
||||
export type CustomerLegalCountOrderByAggregateInput = {
|
||||
name?: Prisma.SortOrder
|
||||
economic_code?: Prisma.SortOrder
|
||||
@@ -434,18 +441,18 @@ export type CustomerLegalUncheckedUpdateOneWithoutCustomerNestedInput = {
|
||||
}
|
||||
|
||||
export type CustomerLegalCreateWithoutBusiness_activityInput = {
|
||||
name: string
|
||||
economic_code: string
|
||||
name?: string | null
|
||||
economic_code?: string | null
|
||||
registration_number?: string | null
|
||||
postal_code: string
|
||||
postal_code?: string | null
|
||||
customer: Prisma.CustomerCreateNestedOneWithoutLegalInput
|
||||
}
|
||||
|
||||
export type CustomerLegalUncheckedCreateWithoutBusiness_activityInput = {
|
||||
name: string
|
||||
economic_code: string
|
||||
name?: string | null
|
||||
economic_code?: string | null
|
||||
registration_number?: string | null
|
||||
postal_code: string
|
||||
postal_code?: string | null
|
||||
customer_id: string
|
||||
}
|
||||
|
||||
@@ -479,27 +486,27 @@ export type CustomerLegalScalarWhereInput = {
|
||||
AND?: Prisma.CustomerLegalScalarWhereInput | Prisma.CustomerLegalScalarWhereInput[]
|
||||
OR?: Prisma.CustomerLegalScalarWhereInput[]
|
||||
NOT?: Prisma.CustomerLegalScalarWhereInput | Prisma.CustomerLegalScalarWhereInput[]
|
||||
name?: Prisma.StringFilter<"CustomerLegal"> | string
|
||||
economic_code?: Prisma.StringFilter<"CustomerLegal"> | string
|
||||
name?: Prisma.StringNullableFilter<"CustomerLegal"> | string | null
|
||||
economic_code?: Prisma.StringNullableFilter<"CustomerLegal"> | string | null
|
||||
registration_number?: Prisma.StringNullableFilter<"CustomerLegal"> | string | null
|
||||
postal_code?: Prisma.StringFilter<"CustomerLegal"> | string
|
||||
postal_code?: Prisma.StringNullableFilter<"CustomerLegal"> | string | null
|
||||
customer_id?: Prisma.StringFilter<"CustomerLegal"> | string
|
||||
business_activity_id?: Prisma.StringFilter<"CustomerLegal"> | string
|
||||
}
|
||||
|
||||
export type CustomerLegalCreateWithoutCustomerInput = {
|
||||
name: string
|
||||
economic_code: string
|
||||
name?: string | null
|
||||
economic_code?: string | null
|
||||
registration_number?: string | null
|
||||
postal_code: string
|
||||
postal_code?: string | null
|
||||
business_activity: Prisma.BusinessActivityCreateNestedOneWithoutCustomer_legalsInput
|
||||
}
|
||||
|
||||
export type CustomerLegalUncheckedCreateWithoutCustomerInput = {
|
||||
name: string
|
||||
economic_code: string
|
||||
name?: string | null
|
||||
economic_code?: string | null
|
||||
registration_number?: string | null
|
||||
postal_code: string
|
||||
postal_code?: string | null
|
||||
business_activity_id: string
|
||||
}
|
||||
|
||||
@@ -520,50 +527,50 @@ export type CustomerLegalUpdateToOneWithWhereWithoutCustomerInput = {
|
||||
}
|
||||
|
||||
export type CustomerLegalUpdateWithoutCustomerInput = {
|
||||
name?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
economic_code?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
name?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
economic_code?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
registration_number?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
postal_code?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
postal_code?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
business_activity?: Prisma.BusinessActivityUpdateOneRequiredWithoutCustomer_legalsNestedInput
|
||||
}
|
||||
|
||||
export type CustomerLegalUncheckedUpdateWithoutCustomerInput = {
|
||||
name?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
economic_code?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
name?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
economic_code?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
registration_number?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
postal_code?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
postal_code?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
business_activity_id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
}
|
||||
|
||||
export type CustomerLegalCreateManyBusiness_activityInput = {
|
||||
name: string
|
||||
economic_code: string
|
||||
name?: string | null
|
||||
economic_code?: string | null
|
||||
registration_number?: string | null
|
||||
postal_code: string
|
||||
postal_code?: string | null
|
||||
customer_id: string
|
||||
}
|
||||
|
||||
export type CustomerLegalUpdateWithoutBusiness_activityInput = {
|
||||
name?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
economic_code?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
name?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
economic_code?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
registration_number?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
postal_code?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
postal_code?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
customer?: Prisma.CustomerUpdateOneRequiredWithoutLegalNestedInput
|
||||
}
|
||||
|
||||
export type CustomerLegalUncheckedUpdateWithoutBusiness_activityInput = {
|
||||
name?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
economic_code?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
name?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
economic_code?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
registration_number?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
postal_code?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
postal_code?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
customer_id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
}
|
||||
|
||||
export type CustomerLegalUncheckedUpdateManyWithoutBusiness_activityInput = {
|
||||
name?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
economic_code?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
name?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
economic_code?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
registration_number?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
postal_code?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
postal_code?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
customer_id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
}
|
||||
|
||||
@@ -576,8 +583,8 @@ export type CustomerLegalSelect<ExtArgs extends runtime.Types.Extensions.Interna
|
||||
postal_code?: boolean
|
||||
customer_id?: boolean
|
||||
business_activity_id?: boolean
|
||||
customer?: boolean | Prisma.CustomerDefaultArgs<ExtArgs>
|
||||
business_activity?: boolean | Prisma.BusinessActivityDefaultArgs<ExtArgs>
|
||||
customer?: boolean | Prisma.CustomerDefaultArgs<ExtArgs>
|
||||
}, ExtArgs["result"]["customerLegal"]>
|
||||
|
||||
|
||||
@@ -593,21 +600,21 @@ export type CustomerLegalSelectScalar = {
|
||||
|
||||
export type CustomerLegalOmit<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetOmit<"name" | "economic_code" | "registration_number" | "postal_code" | "customer_id" | "business_activity_id", ExtArgs["result"]["customerLegal"]>
|
||||
export type CustomerLegalInclude<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
|
||||
customer?: boolean | Prisma.CustomerDefaultArgs<ExtArgs>
|
||||
business_activity?: boolean | Prisma.BusinessActivityDefaultArgs<ExtArgs>
|
||||
customer?: boolean | Prisma.CustomerDefaultArgs<ExtArgs>
|
||||
}
|
||||
|
||||
export type $CustomerLegalPayload<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
|
||||
name: "CustomerLegal"
|
||||
objects: {
|
||||
customer: Prisma.$CustomerPayload<ExtArgs>
|
||||
business_activity: Prisma.$BusinessActivityPayload<ExtArgs>
|
||||
customer: Prisma.$CustomerPayload<ExtArgs>
|
||||
}
|
||||
scalars: runtime.Types.Extensions.GetPayloadResult<{
|
||||
name: string
|
||||
economic_code: string
|
||||
name: string | null
|
||||
economic_code: string | null
|
||||
registration_number: string | null
|
||||
postal_code: string
|
||||
postal_code: string | null
|
||||
customer_id: string
|
||||
business_activity_id: string
|
||||
}, ExtArgs["result"]["customerLegal"]>
|
||||
@@ -950,8 +957,8 @@ readonly fields: CustomerLegalFieldRefs;
|
||||
*/
|
||||
export interface Prisma__CustomerLegalClient<T, Null = never, ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs, GlobalOmitOptions = {}> extends Prisma.PrismaPromise<T> {
|
||||
readonly [Symbol.toStringTag]: "PrismaPromise"
|
||||
customer<T extends Prisma.CustomerDefaultArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.CustomerDefaultArgs<ExtArgs>>): Prisma.Prisma__CustomerClient<runtime.Types.Result.GetResult<Prisma.$CustomerPayload<ExtArgs>, T, "findUniqueOrThrow", GlobalOmitOptions> | Null, Null, ExtArgs, GlobalOmitOptions>
|
||||
business_activity<T extends Prisma.BusinessActivityDefaultArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.BusinessActivityDefaultArgs<ExtArgs>>): Prisma.Prisma__BusinessActivityClient<runtime.Types.Result.GetResult<Prisma.$BusinessActivityPayload<ExtArgs>, T, "findUniqueOrThrow", GlobalOmitOptions> | Null, Null, ExtArgs, GlobalOmitOptions>
|
||||
customer<T extends Prisma.CustomerDefaultArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.CustomerDefaultArgs<ExtArgs>>): Prisma.Prisma__CustomerClient<runtime.Types.Result.GetResult<Prisma.$CustomerPayload<ExtArgs>, T, "findUniqueOrThrow", GlobalOmitOptions> | Null, Null, ExtArgs, GlobalOmitOptions>
|
||||
/**
|
||||
* Attaches callbacks for the resolution and/or rejection of the Promise.
|
||||
* @param onfulfilled The callback to execute when the Promise is resolved.
|
||||
|
||||
@@ -304,10 +304,11 @@ export type GoodWhereInput = {
|
||||
measure_unit_id?: Prisma.StringFilter<"Good"> | string
|
||||
category_id?: Prisma.StringNullableFilter<"Good"> | string | null
|
||||
business_activity_id?: Prisma.StringNullableFilter<"Good"> | string | null
|
||||
sku?: Prisma.XOR<Prisma.StockKeepingUnitsScalarRelationFilter, Prisma.StockKeepingUnitsWhereInput>
|
||||
measure_unit?: Prisma.XOR<Prisma.MeasureUnitsScalarRelationFilter, Prisma.MeasureUnitsWhereInput>
|
||||
category?: Prisma.XOR<Prisma.GoodCategoryNullableScalarRelationFilter, Prisma.GoodCategoryWhereInput> | null
|
||||
consumer_account_good_favorites?: Prisma.ConsumerAccountGoodFavoriteListRelationFilter
|
||||
business_activity?: Prisma.XOR<Prisma.BusinessActivityNullableScalarRelationFilter, Prisma.BusinessActivityWhereInput> | null
|
||||
category?: Prisma.XOR<Prisma.GoodCategoryNullableScalarRelationFilter, Prisma.GoodCategoryWhereInput> | null
|
||||
measure_unit?: Prisma.XOR<Prisma.MeasureUnitsScalarRelationFilter, Prisma.MeasureUnitsWhereInput>
|
||||
sku?: Prisma.XOR<Prisma.StockKeepingUnitsScalarRelationFilter, Prisma.StockKeepingUnitsWhereInput>
|
||||
sales_invoice_items?: Prisma.SalesInvoiceItemListRelationFilter
|
||||
}
|
||||
|
||||
@@ -328,10 +329,11 @@ export type GoodOrderByWithRelationInput = {
|
||||
measure_unit_id?: Prisma.SortOrder
|
||||
category_id?: Prisma.SortOrderInput | Prisma.SortOrder
|
||||
business_activity_id?: Prisma.SortOrderInput | Prisma.SortOrder
|
||||
sku?: Prisma.StockKeepingUnitsOrderByWithRelationInput
|
||||
measure_unit?: Prisma.MeasureUnitsOrderByWithRelationInput
|
||||
category?: Prisma.GoodCategoryOrderByWithRelationInput
|
||||
consumer_account_good_favorites?: Prisma.ConsumerAccountGoodFavoriteOrderByRelationAggregateInput
|
||||
business_activity?: Prisma.BusinessActivityOrderByWithRelationInput
|
||||
category?: Prisma.GoodCategoryOrderByWithRelationInput
|
||||
measure_unit?: Prisma.MeasureUnitsOrderByWithRelationInput
|
||||
sku?: Prisma.StockKeepingUnitsOrderByWithRelationInput
|
||||
sales_invoice_items?: Prisma.SalesInvoiceItemOrderByRelationAggregateInput
|
||||
_relevance?: Prisma.GoodOrderByRelevanceInput
|
||||
}
|
||||
@@ -356,10 +358,11 @@ export type GoodWhereUniqueInput = Prisma.AtLeast<{
|
||||
measure_unit_id?: Prisma.StringFilter<"Good"> | string
|
||||
category_id?: Prisma.StringNullableFilter<"Good"> | string | null
|
||||
business_activity_id?: Prisma.StringNullableFilter<"Good"> | string | null
|
||||
sku?: Prisma.XOR<Prisma.StockKeepingUnitsScalarRelationFilter, Prisma.StockKeepingUnitsWhereInput>
|
||||
measure_unit?: Prisma.XOR<Prisma.MeasureUnitsScalarRelationFilter, Prisma.MeasureUnitsWhereInput>
|
||||
category?: Prisma.XOR<Prisma.GoodCategoryNullableScalarRelationFilter, Prisma.GoodCategoryWhereInput> | null
|
||||
consumer_account_good_favorites?: Prisma.ConsumerAccountGoodFavoriteListRelationFilter
|
||||
business_activity?: Prisma.XOR<Prisma.BusinessActivityNullableScalarRelationFilter, Prisma.BusinessActivityWhereInput> | null
|
||||
category?: Prisma.XOR<Prisma.GoodCategoryNullableScalarRelationFilter, Prisma.GoodCategoryWhereInput> | null
|
||||
measure_unit?: Prisma.XOR<Prisma.MeasureUnitsScalarRelationFilter, Prisma.MeasureUnitsWhereInput>
|
||||
sku?: Prisma.XOR<Prisma.StockKeepingUnitsScalarRelationFilter, Prisma.StockKeepingUnitsWhereInput>
|
||||
sales_invoice_items?: Prisma.SalesInvoiceItemListRelationFilter
|
||||
}, "id" | "local_sku" | "barcode">
|
||||
|
||||
@@ -422,10 +425,11 @@ export type GoodCreateInput = {
|
||||
created_at?: Date | string
|
||||
updated_at?: Date | string
|
||||
deleted_at?: Date | string | null
|
||||
sku: Prisma.StockKeepingUnitsCreateNestedOneWithoutGoodsInput
|
||||
measure_unit: Prisma.MeasureUnitsCreateNestedOneWithoutGoodsInput
|
||||
category?: Prisma.GoodCategoryCreateNestedOneWithoutGoodsInput
|
||||
consumer_account_good_favorites?: Prisma.ConsumerAccountGoodFavoriteCreateNestedManyWithoutGoodInput
|
||||
business_activity?: Prisma.BusinessActivityCreateNestedOneWithoutGoodsInput
|
||||
category?: Prisma.GoodCategoryCreateNestedOneWithoutGoodsInput
|
||||
measure_unit: Prisma.MeasureUnitsCreateNestedOneWithoutGoodsInput
|
||||
sku: Prisma.StockKeepingUnitsCreateNestedOneWithoutGoodsInput
|
||||
sales_invoice_items?: Prisma.SalesInvoiceItemCreateNestedManyWithoutGoodInput
|
||||
}
|
||||
|
||||
@@ -446,6 +450,7 @@ export type GoodUncheckedCreateInput = {
|
||||
measure_unit_id: string
|
||||
category_id?: string | null
|
||||
business_activity_id?: string | null
|
||||
consumer_account_good_favorites?: Prisma.ConsumerAccountGoodFavoriteUncheckedCreateNestedManyWithoutGoodInput
|
||||
sales_invoice_items?: Prisma.SalesInvoiceItemUncheckedCreateNestedManyWithoutGoodInput
|
||||
}
|
||||
|
||||
@@ -462,10 +467,11 @@ export type GoodUpdateInput = {
|
||||
created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
deleted_at?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null
|
||||
sku?: Prisma.StockKeepingUnitsUpdateOneRequiredWithoutGoodsNestedInput
|
||||
measure_unit?: Prisma.MeasureUnitsUpdateOneRequiredWithoutGoodsNestedInput
|
||||
category?: Prisma.GoodCategoryUpdateOneWithoutGoodsNestedInput
|
||||
consumer_account_good_favorites?: Prisma.ConsumerAccountGoodFavoriteUpdateManyWithoutGoodNestedInput
|
||||
business_activity?: Prisma.BusinessActivityUpdateOneWithoutGoodsNestedInput
|
||||
category?: Prisma.GoodCategoryUpdateOneWithoutGoodsNestedInput
|
||||
measure_unit?: Prisma.MeasureUnitsUpdateOneRequiredWithoutGoodsNestedInput
|
||||
sku?: Prisma.StockKeepingUnitsUpdateOneRequiredWithoutGoodsNestedInput
|
||||
sales_invoice_items?: Prisma.SalesInvoiceItemUpdateManyWithoutGoodNestedInput
|
||||
}
|
||||
|
||||
@@ -486,6 +492,7 @@ export type GoodUncheckedUpdateInput = {
|
||||
measure_unit_id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
category_id?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
business_activity_id?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
consumer_account_good_favorites?: Prisma.ConsumerAccountGoodFavoriteUncheckedUpdateManyWithoutGoodNestedInput
|
||||
sales_invoice_items?: Prisma.SalesInvoiceItemUncheckedUpdateManyWithoutGoodNestedInput
|
||||
}
|
||||
|
||||
@@ -552,6 +559,11 @@ export type GoodOrderByRelationAggregateInput = {
|
||||
_count?: Prisma.SortOrder
|
||||
}
|
||||
|
||||
export type GoodScalarRelationFilter = {
|
||||
is?: Prisma.GoodWhereInput
|
||||
isNot?: Prisma.GoodWhereInput
|
||||
}
|
||||
|
||||
export type GoodOrderByRelevanceInput = {
|
||||
fields: Prisma.GoodOrderByRelevanceFieldEnum | Prisma.GoodOrderByRelevanceFieldEnum[]
|
||||
sort: Prisma.SortOrder
|
||||
@@ -623,11 +635,6 @@ export type GoodSumOrderByAggregateInput = {
|
||||
base_sale_price?: Prisma.SortOrder
|
||||
}
|
||||
|
||||
export type GoodScalarRelationFilter = {
|
||||
is?: Prisma.GoodWhereInput
|
||||
isNot?: Prisma.GoodWhereInput
|
||||
}
|
||||
|
||||
export type GoodCreateNestedManyWithoutBusiness_activityInput = {
|
||||
create?: Prisma.XOR<Prisma.GoodCreateWithoutBusiness_activityInput, Prisma.GoodUncheckedCreateWithoutBusiness_activityInput> | Prisma.GoodCreateWithoutBusiness_activityInput[] | Prisma.GoodUncheckedCreateWithoutBusiness_activityInput[]
|
||||
connectOrCreate?: Prisma.GoodCreateOrConnectWithoutBusiness_activityInput | Prisma.GoodCreateOrConnectWithoutBusiness_activityInput[]
|
||||
@@ -670,6 +677,20 @@ export type GoodUncheckedUpdateManyWithoutBusiness_activityNestedInput = {
|
||||
deleteMany?: Prisma.GoodScalarWhereInput | Prisma.GoodScalarWhereInput[]
|
||||
}
|
||||
|
||||
export type GoodCreateNestedOneWithoutConsumer_account_good_favoritesInput = {
|
||||
create?: Prisma.XOR<Prisma.GoodCreateWithoutConsumer_account_good_favoritesInput, Prisma.GoodUncheckedCreateWithoutConsumer_account_good_favoritesInput>
|
||||
connectOrCreate?: Prisma.GoodCreateOrConnectWithoutConsumer_account_good_favoritesInput
|
||||
connect?: Prisma.GoodWhereUniqueInput
|
||||
}
|
||||
|
||||
export type GoodUpdateOneRequiredWithoutConsumer_account_good_favoritesNestedInput = {
|
||||
create?: Prisma.XOR<Prisma.GoodCreateWithoutConsumer_account_good_favoritesInput, Prisma.GoodUncheckedCreateWithoutConsumer_account_good_favoritesInput>
|
||||
connectOrCreate?: Prisma.GoodCreateOrConnectWithoutConsumer_account_good_favoritesInput
|
||||
upsert?: Prisma.GoodUpsertWithoutConsumer_account_good_favoritesInput
|
||||
connect?: Prisma.GoodWhereUniqueInput
|
||||
update?: Prisma.XOR<Prisma.XOR<Prisma.GoodUpdateToOneWithWhereWithoutConsumer_account_good_favoritesInput, Prisma.GoodUpdateWithoutConsumer_account_good_favoritesInput>, Prisma.GoodUncheckedUpdateWithoutConsumer_account_good_favoritesInput>
|
||||
}
|
||||
|
||||
export type EnumGoodPricingModelFieldUpdateOperationsInput = {
|
||||
set?: $Enums.GoodPricingModel
|
||||
}
|
||||
@@ -839,9 +860,10 @@ export type GoodCreateWithoutBusiness_activityInput = {
|
||||
created_at?: Date | string
|
||||
updated_at?: Date | string
|
||||
deleted_at?: Date | string | null
|
||||
sku: Prisma.StockKeepingUnitsCreateNestedOneWithoutGoodsInput
|
||||
measure_unit: Prisma.MeasureUnitsCreateNestedOneWithoutGoodsInput
|
||||
consumer_account_good_favorites?: Prisma.ConsumerAccountGoodFavoriteCreateNestedManyWithoutGoodInput
|
||||
category?: Prisma.GoodCategoryCreateNestedOneWithoutGoodsInput
|
||||
measure_unit: Prisma.MeasureUnitsCreateNestedOneWithoutGoodsInput
|
||||
sku: Prisma.StockKeepingUnitsCreateNestedOneWithoutGoodsInput
|
||||
sales_invoice_items?: Prisma.SalesInvoiceItemCreateNestedManyWithoutGoodInput
|
||||
}
|
||||
|
||||
@@ -861,6 +883,7 @@ export type GoodUncheckedCreateWithoutBusiness_activityInput = {
|
||||
sku_id: string
|
||||
measure_unit_id: string
|
||||
category_id?: string | null
|
||||
consumer_account_good_favorites?: Prisma.ConsumerAccountGoodFavoriteUncheckedCreateNestedManyWithoutGoodInput
|
||||
sales_invoice_items?: Prisma.SalesInvoiceItemUncheckedCreateNestedManyWithoutGoodInput
|
||||
}
|
||||
|
||||
@@ -912,6 +935,102 @@ export type GoodScalarWhereInput = {
|
||||
business_activity_id?: Prisma.StringNullableFilter<"Good"> | string | null
|
||||
}
|
||||
|
||||
export type GoodCreateWithoutConsumer_account_good_favoritesInput = {
|
||||
id?: string
|
||||
name: string
|
||||
is_default_guild_good?: boolean
|
||||
pricing_model: $Enums.GoodPricingModel
|
||||
description?: string | null
|
||||
local_sku?: string | null
|
||||
barcode?: string | null
|
||||
base_sale_price?: runtime.Decimal | runtime.DecimalJsLike | number | string | null
|
||||
image_url?: string | null
|
||||
created_at?: Date | string
|
||||
updated_at?: Date | string
|
||||
deleted_at?: Date | string | null
|
||||
business_activity?: Prisma.BusinessActivityCreateNestedOneWithoutGoodsInput
|
||||
category?: Prisma.GoodCategoryCreateNestedOneWithoutGoodsInput
|
||||
measure_unit: Prisma.MeasureUnitsCreateNestedOneWithoutGoodsInput
|
||||
sku: Prisma.StockKeepingUnitsCreateNestedOneWithoutGoodsInput
|
||||
sales_invoice_items?: Prisma.SalesInvoiceItemCreateNestedManyWithoutGoodInput
|
||||
}
|
||||
|
||||
export type GoodUncheckedCreateWithoutConsumer_account_good_favoritesInput = {
|
||||
id?: string
|
||||
name: string
|
||||
is_default_guild_good?: boolean
|
||||
pricing_model: $Enums.GoodPricingModel
|
||||
description?: string | null
|
||||
local_sku?: string | null
|
||||
barcode?: string | null
|
||||
base_sale_price?: runtime.Decimal | runtime.DecimalJsLike | number | string | null
|
||||
image_url?: string | null
|
||||
created_at?: Date | string
|
||||
updated_at?: Date | string
|
||||
deleted_at?: Date | string | null
|
||||
sku_id: string
|
||||
measure_unit_id: string
|
||||
category_id?: string | null
|
||||
business_activity_id?: string | null
|
||||
sales_invoice_items?: Prisma.SalesInvoiceItemUncheckedCreateNestedManyWithoutGoodInput
|
||||
}
|
||||
|
||||
export type GoodCreateOrConnectWithoutConsumer_account_good_favoritesInput = {
|
||||
where: Prisma.GoodWhereUniqueInput
|
||||
create: Prisma.XOR<Prisma.GoodCreateWithoutConsumer_account_good_favoritesInput, Prisma.GoodUncheckedCreateWithoutConsumer_account_good_favoritesInput>
|
||||
}
|
||||
|
||||
export type GoodUpsertWithoutConsumer_account_good_favoritesInput = {
|
||||
update: Prisma.XOR<Prisma.GoodUpdateWithoutConsumer_account_good_favoritesInput, Prisma.GoodUncheckedUpdateWithoutConsumer_account_good_favoritesInput>
|
||||
create: Prisma.XOR<Prisma.GoodCreateWithoutConsumer_account_good_favoritesInput, Prisma.GoodUncheckedCreateWithoutConsumer_account_good_favoritesInput>
|
||||
where?: Prisma.GoodWhereInput
|
||||
}
|
||||
|
||||
export type GoodUpdateToOneWithWhereWithoutConsumer_account_good_favoritesInput = {
|
||||
where?: Prisma.GoodWhereInput
|
||||
data: Prisma.XOR<Prisma.GoodUpdateWithoutConsumer_account_good_favoritesInput, Prisma.GoodUncheckedUpdateWithoutConsumer_account_good_favoritesInput>
|
||||
}
|
||||
|
||||
export type GoodUpdateWithoutConsumer_account_good_favoritesInput = {
|
||||
id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
name?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
is_default_guild_good?: Prisma.BoolFieldUpdateOperationsInput | boolean
|
||||
pricing_model?: Prisma.EnumGoodPricingModelFieldUpdateOperationsInput | $Enums.GoodPricingModel
|
||||
description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
local_sku?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
barcode?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
base_sale_price?: Prisma.NullableDecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string | null
|
||||
image_url?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
deleted_at?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null
|
||||
business_activity?: Prisma.BusinessActivityUpdateOneWithoutGoodsNestedInput
|
||||
category?: Prisma.GoodCategoryUpdateOneWithoutGoodsNestedInput
|
||||
measure_unit?: Prisma.MeasureUnitsUpdateOneRequiredWithoutGoodsNestedInput
|
||||
sku?: Prisma.StockKeepingUnitsUpdateOneRequiredWithoutGoodsNestedInput
|
||||
sales_invoice_items?: Prisma.SalesInvoiceItemUpdateManyWithoutGoodNestedInput
|
||||
}
|
||||
|
||||
export type GoodUncheckedUpdateWithoutConsumer_account_good_favoritesInput = {
|
||||
id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
name?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
is_default_guild_good?: Prisma.BoolFieldUpdateOperationsInput | boolean
|
||||
pricing_model?: Prisma.EnumGoodPricingModelFieldUpdateOperationsInput | $Enums.GoodPricingModel
|
||||
description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
local_sku?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
barcode?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
base_sale_price?: Prisma.NullableDecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string | null
|
||||
image_url?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
deleted_at?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null
|
||||
sku_id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
measure_unit_id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
category_id?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
business_activity_id?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
sales_invoice_items?: Prisma.SalesInvoiceItemUncheckedUpdateManyWithoutGoodNestedInput
|
||||
}
|
||||
|
||||
export type GoodCreateWithoutCategoryInput = {
|
||||
id?: string
|
||||
name: string
|
||||
@@ -925,9 +1044,10 @@ export type GoodCreateWithoutCategoryInput = {
|
||||
created_at?: Date | string
|
||||
updated_at?: Date | string
|
||||
deleted_at?: Date | string | null
|
||||
sku: Prisma.StockKeepingUnitsCreateNestedOneWithoutGoodsInput
|
||||
measure_unit: Prisma.MeasureUnitsCreateNestedOneWithoutGoodsInput
|
||||
consumer_account_good_favorites?: Prisma.ConsumerAccountGoodFavoriteCreateNestedManyWithoutGoodInput
|
||||
business_activity?: Prisma.BusinessActivityCreateNestedOneWithoutGoodsInput
|
||||
measure_unit: Prisma.MeasureUnitsCreateNestedOneWithoutGoodsInput
|
||||
sku: Prisma.StockKeepingUnitsCreateNestedOneWithoutGoodsInput
|
||||
sales_invoice_items?: Prisma.SalesInvoiceItemCreateNestedManyWithoutGoodInput
|
||||
}
|
||||
|
||||
@@ -947,6 +1067,7 @@ export type GoodUncheckedCreateWithoutCategoryInput = {
|
||||
sku_id: string
|
||||
measure_unit_id: string
|
||||
business_activity_id?: string | null
|
||||
consumer_account_good_favorites?: Prisma.ConsumerAccountGoodFavoriteUncheckedCreateNestedManyWithoutGoodInput
|
||||
sales_invoice_items?: Prisma.SalesInvoiceItemUncheckedCreateNestedManyWithoutGoodInput
|
||||
}
|
||||
|
||||
@@ -989,9 +1110,10 @@ export type GoodCreateWithoutMeasure_unitInput = {
|
||||
created_at?: Date | string
|
||||
updated_at?: Date | string
|
||||
deleted_at?: Date | string | null
|
||||
sku: Prisma.StockKeepingUnitsCreateNestedOneWithoutGoodsInput
|
||||
category?: Prisma.GoodCategoryCreateNestedOneWithoutGoodsInput
|
||||
consumer_account_good_favorites?: Prisma.ConsumerAccountGoodFavoriteCreateNestedManyWithoutGoodInput
|
||||
business_activity?: Prisma.BusinessActivityCreateNestedOneWithoutGoodsInput
|
||||
category?: Prisma.GoodCategoryCreateNestedOneWithoutGoodsInput
|
||||
sku: Prisma.StockKeepingUnitsCreateNestedOneWithoutGoodsInput
|
||||
sales_invoice_items?: Prisma.SalesInvoiceItemCreateNestedManyWithoutGoodInput
|
||||
}
|
||||
|
||||
@@ -1011,6 +1133,7 @@ export type GoodUncheckedCreateWithoutMeasure_unitInput = {
|
||||
sku_id: string
|
||||
category_id?: string | null
|
||||
business_activity_id?: string | null
|
||||
consumer_account_good_favorites?: Prisma.ConsumerAccountGoodFavoriteUncheckedCreateNestedManyWithoutGoodInput
|
||||
sales_invoice_items?: Prisma.SalesInvoiceItemUncheckedCreateNestedManyWithoutGoodInput
|
||||
}
|
||||
|
||||
@@ -1053,9 +1176,10 @@ export type GoodCreateWithoutSkuInput = {
|
||||
created_at?: Date | string
|
||||
updated_at?: Date | string
|
||||
deleted_at?: Date | string | null
|
||||
measure_unit: Prisma.MeasureUnitsCreateNestedOneWithoutGoodsInput
|
||||
category?: Prisma.GoodCategoryCreateNestedOneWithoutGoodsInput
|
||||
consumer_account_good_favorites?: Prisma.ConsumerAccountGoodFavoriteCreateNestedManyWithoutGoodInput
|
||||
business_activity?: Prisma.BusinessActivityCreateNestedOneWithoutGoodsInput
|
||||
category?: Prisma.GoodCategoryCreateNestedOneWithoutGoodsInput
|
||||
measure_unit: Prisma.MeasureUnitsCreateNestedOneWithoutGoodsInput
|
||||
sales_invoice_items?: Prisma.SalesInvoiceItemCreateNestedManyWithoutGoodInput
|
||||
}
|
||||
|
||||
@@ -1075,6 +1199,7 @@ export type GoodUncheckedCreateWithoutSkuInput = {
|
||||
measure_unit_id: string
|
||||
category_id?: string | null
|
||||
business_activity_id?: string | null
|
||||
consumer_account_good_favorites?: Prisma.ConsumerAccountGoodFavoriteUncheckedCreateNestedManyWithoutGoodInput
|
||||
sales_invoice_items?: Prisma.SalesInvoiceItemUncheckedCreateNestedManyWithoutGoodInput
|
||||
}
|
||||
|
||||
@@ -1117,10 +1242,11 @@ export type GoodCreateWithoutSales_invoice_itemsInput = {
|
||||
created_at?: Date | string
|
||||
updated_at?: Date | string
|
||||
deleted_at?: Date | string | null
|
||||
sku: Prisma.StockKeepingUnitsCreateNestedOneWithoutGoodsInput
|
||||
measure_unit: Prisma.MeasureUnitsCreateNestedOneWithoutGoodsInput
|
||||
category?: Prisma.GoodCategoryCreateNestedOneWithoutGoodsInput
|
||||
consumer_account_good_favorites?: Prisma.ConsumerAccountGoodFavoriteCreateNestedManyWithoutGoodInput
|
||||
business_activity?: Prisma.BusinessActivityCreateNestedOneWithoutGoodsInput
|
||||
category?: Prisma.GoodCategoryCreateNestedOneWithoutGoodsInput
|
||||
measure_unit: Prisma.MeasureUnitsCreateNestedOneWithoutGoodsInput
|
||||
sku: Prisma.StockKeepingUnitsCreateNestedOneWithoutGoodsInput
|
||||
}
|
||||
|
||||
export type GoodUncheckedCreateWithoutSales_invoice_itemsInput = {
|
||||
@@ -1140,6 +1266,7 @@ export type GoodUncheckedCreateWithoutSales_invoice_itemsInput = {
|
||||
measure_unit_id: string
|
||||
category_id?: string | null
|
||||
business_activity_id?: string | null
|
||||
consumer_account_good_favorites?: Prisma.ConsumerAccountGoodFavoriteUncheckedCreateNestedManyWithoutGoodInput
|
||||
}
|
||||
|
||||
export type GoodCreateOrConnectWithoutSales_invoice_itemsInput = {
|
||||
@@ -1171,10 +1298,11 @@ export type GoodUpdateWithoutSales_invoice_itemsInput = {
|
||||
created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
deleted_at?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null
|
||||
sku?: Prisma.StockKeepingUnitsUpdateOneRequiredWithoutGoodsNestedInput
|
||||
measure_unit?: Prisma.MeasureUnitsUpdateOneRequiredWithoutGoodsNestedInput
|
||||
category?: Prisma.GoodCategoryUpdateOneWithoutGoodsNestedInput
|
||||
consumer_account_good_favorites?: Prisma.ConsumerAccountGoodFavoriteUpdateManyWithoutGoodNestedInput
|
||||
business_activity?: Prisma.BusinessActivityUpdateOneWithoutGoodsNestedInput
|
||||
category?: Prisma.GoodCategoryUpdateOneWithoutGoodsNestedInput
|
||||
measure_unit?: Prisma.MeasureUnitsUpdateOneRequiredWithoutGoodsNestedInput
|
||||
sku?: Prisma.StockKeepingUnitsUpdateOneRequiredWithoutGoodsNestedInput
|
||||
}
|
||||
|
||||
export type GoodUncheckedUpdateWithoutSales_invoice_itemsInput = {
|
||||
@@ -1194,6 +1322,7 @@ export type GoodUncheckedUpdateWithoutSales_invoice_itemsInput = {
|
||||
measure_unit_id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
category_id?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
business_activity_id?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
consumer_account_good_favorites?: Prisma.ConsumerAccountGoodFavoriteUncheckedUpdateManyWithoutGoodNestedInput
|
||||
}
|
||||
|
||||
export type GoodCreateManyBusiness_activityInput = {
|
||||
@@ -1227,9 +1356,10 @@ export type GoodUpdateWithoutBusiness_activityInput = {
|
||||
created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
deleted_at?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null
|
||||
sku?: Prisma.StockKeepingUnitsUpdateOneRequiredWithoutGoodsNestedInput
|
||||
measure_unit?: Prisma.MeasureUnitsUpdateOneRequiredWithoutGoodsNestedInput
|
||||
consumer_account_good_favorites?: Prisma.ConsumerAccountGoodFavoriteUpdateManyWithoutGoodNestedInput
|
||||
category?: Prisma.GoodCategoryUpdateOneWithoutGoodsNestedInput
|
||||
measure_unit?: Prisma.MeasureUnitsUpdateOneRequiredWithoutGoodsNestedInput
|
||||
sku?: Prisma.StockKeepingUnitsUpdateOneRequiredWithoutGoodsNestedInput
|
||||
sales_invoice_items?: Prisma.SalesInvoiceItemUpdateManyWithoutGoodNestedInput
|
||||
}
|
||||
|
||||
@@ -1249,6 +1379,7 @@ export type GoodUncheckedUpdateWithoutBusiness_activityInput = {
|
||||
sku_id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
measure_unit_id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
category_id?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
consumer_account_good_favorites?: Prisma.ConsumerAccountGoodFavoriteUncheckedUpdateManyWithoutGoodNestedInput
|
||||
sales_invoice_items?: Prisma.SalesInvoiceItemUncheckedUpdateManyWithoutGoodNestedInput
|
||||
}
|
||||
|
||||
@@ -1301,9 +1432,10 @@ export type GoodUpdateWithoutCategoryInput = {
|
||||
created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
deleted_at?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null
|
||||
sku?: Prisma.StockKeepingUnitsUpdateOneRequiredWithoutGoodsNestedInput
|
||||
measure_unit?: Prisma.MeasureUnitsUpdateOneRequiredWithoutGoodsNestedInput
|
||||
consumer_account_good_favorites?: Prisma.ConsumerAccountGoodFavoriteUpdateManyWithoutGoodNestedInput
|
||||
business_activity?: Prisma.BusinessActivityUpdateOneWithoutGoodsNestedInput
|
||||
measure_unit?: Prisma.MeasureUnitsUpdateOneRequiredWithoutGoodsNestedInput
|
||||
sku?: Prisma.StockKeepingUnitsUpdateOneRequiredWithoutGoodsNestedInput
|
||||
sales_invoice_items?: Prisma.SalesInvoiceItemUpdateManyWithoutGoodNestedInput
|
||||
}
|
||||
|
||||
@@ -1323,6 +1455,7 @@ export type GoodUncheckedUpdateWithoutCategoryInput = {
|
||||
sku_id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
measure_unit_id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
business_activity_id?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
consumer_account_good_favorites?: Prisma.ConsumerAccountGoodFavoriteUncheckedUpdateManyWithoutGoodNestedInput
|
||||
sales_invoice_items?: Prisma.SalesInvoiceItemUncheckedUpdateManyWithoutGoodNestedInput
|
||||
}
|
||||
|
||||
@@ -1375,9 +1508,10 @@ export type GoodUpdateWithoutMeasure_unitInput = {
|
||||
created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
deleted_at?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null
|
||||
sku?: Prisma.StockKeepingUnitsUpdateOneRequiredWithoutGoodsNestedInput
|
||||
category?: Prisma.GoodCategoryUpdateOneWithoutGoodsNestedInput
|
||||
consumer_account_good_favorites?: Prisma.ConsumerAccountGoodFavoriteUpdateManyWithoutGoodNestedInput
|
||||
business_activity?: Prisma.BusinessActivityUpdateOneWithoutGoodsNestedInput
|
||||
category?: Prisma.GoodCategoryUpdateOneWithoutGoodsNestedInput
|
||||
sku?: Prisma.StockKeepingUnitsUpdateOneRequiredWithoutGoodsNestedInput
|
||||
sales_invoice_items?: Prisma.SalesInvoiceItemUpdateManyWithoutGoodNestedInput
|
||||
}
|
||||
|
||||
@@ -1397,6 +1531,7 @@ export type GoodUncheckedUpdateWithoutMeasure_unitInput = {
|
||||
sku_id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
category_id?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
business_activity_id?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
consumer_account_good_favorites?: Prisma.ConsumerAccountGoodFavoriteUncheckedUpdateManyWithoutGoodNestedInput
|
||||
sales_invoice_items?: Prisma.SalesInvoiceItemUncheckedUpdateManyWithoutGoodNestedInput
|
||||
}
|
||||
|
||||
@@ -1449,9 +1584,10 @@ export type GoodUpdateWithoutSkuInput = {
|
||||
created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
deleted_at?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null
|
||||
measure_unit?: Prisma.MeasureUnitsUpdateOneRequiredWithoutGoodsNestedInput
|
||||
category?: Prisma.GoodCategoryUpdateOneWithoutGoodsNestedInput
|
||||
consumer_account_good_favorites?: Prisma.ConsumerAccountGoodFavoriteUpdateManyWithoutGoodNestedInput
|
||||
business_activity?: Prisma.BusinessActivityUpdateOneWithoutGoodsNestedInput
|
||||
category?: Prisma.GoodCategoryUpdateOneWithoutGoodsNestedInput
|
||||
measure_unit?: Prisma.MeasureUnitsUpdateOneRequiredWithoutGoodsNestedInput
|
||||
sales_invoice_items?: Prisma.SalesInvoiceItemUpdateManyWithoutGoodNestedInput
|
||||
}
|
||||
|
||||
@@ -1471,6 +1607,7 @@ export type GoodUncheckedUpdateWithoutSkuInput = {
|
||||
measure_unit_id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
category_id?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
business_activity_id?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
consumer_account_good_favorites?: Prisma.ConsumerAccountGoodFavoriteUncheckedUpdateManyWithoutGoodNestedInput
|
||||
sales_invoice_items?: Prisma.SalesInvoiceItemUncheckedUpdateManyWithoutGoodNestedInput
|
||||
}
|
||||
|
||||
@@ -1498,10 +1635,12 @@ export type GoodUncheckedUpdateManyWithoutSkuInput = {
|
||||
*/
|
||||
|
||||
export type GoodCountOutputType = {
|
||||
consumer_account_good_favorites: number
|
||||
sales_invoice_items: number
|
||||
}
|
||||
|
||||
export type GoodCountOutputTypeSelect<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
|
||||
consumer_account_good_favorites?: boolean | GoodCountOutputTypeCountConsumer_account_good_favoritesArgs
|
||||
sales_invoice_items?: boolean | GoodCountOutputTypeCountSales_invoice_itemsArgs
|
||||
}
|
||||
|
||||
@@ -1515,6 +1654,13 @@ export type GoodCountOutputTypeDefaultArgs<ExtArgs extends runtime.Types.Extensi
|
||||
select?: Prisma.GoodCountOutputTypeSelect<ExtArgs> | null
|
||||
}
|
||||
|
||||
/**
|
||||
* GoodCountOutputType without action
|
||||
*/
|
||||
export type GoodCountOutputTypeCountConsumer_account_good_favoritesArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
|
||||
where?: Prisma.ConsumerAccountGoodFavoriteWhereInput
|
||||
}
|
||||
|
||||
/**
|
||||
* GoodCountOutputType without action
|
||||
*/
|
||||
@@ -1540,10 +1686,11 @@ export type GoodSelect<ExtArgs extends runtime.Types.Extensions.InternalArgs = r
|
||||
measure_unit_id?: boolean
|
||||
category_id?: boolean
|
||||
business_activity_id?: boolean
|
||||
sku?: boolean | Prisma.StockKeepingUnitsDefaultArgs<ExtArgs>
|
||||
measure_unit?: boolean | Prisma.MeasureUnitsDefaultArgs<ExtArgs>
|
||||
category?: boolean | Prisma.Good$categoryArgs<ExtArgs>
|
||||
consumer_account_good_favorites?: boolean | Prisma.Good$consumer_account_good_favoritesArgs<ExtArgs>
|
||||
business_activity?: boolean | Prisma.Good$business_activityArgs<ExtArgs>
|
||||
category?: boolean | Prisma.Good$categoryArgs<ExtArgs>
|
||||
measure_unit?: boolean | Prisma.MeasureUnitsDefaultArgs<ExtArgs>
|
||||
sku?: boolean | Prisma.StockKeepingUnitsDefaultArgs<ExtArgs>
|
||||
sales_invoice_items?: boolean | Prisma.Good$sales_invoice_itemsArgs<ExtArgs>
|
||||
_count?: boolean | Prisma.GoodCountOutputTypeDefaultArgs<ExtArgs>
|
||||
}, ExtArgs["result"]["good"]>
|
||||
@@ -1571,10 +1718,11 @@ export type GoodSelectScalar = {
|
||||
|
||||
export type GoodOmit<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetOmit<"id" | "name" | "is_default_guild_good" | "pricing_model" | "description" | "local_sku" | "barcode" | "base_sale_price" | "image_url" | "created_at" | "updated_at" | "deleted_at" | "sku_id" | "measure_unit_id" | "category_id" | "business_activity_id", ExtArgs["result"]["good"]>
|
||||
export type GoodInclude<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
|
||||
sku?: boolean | Prisma.StockKeepingUnitsDefaultArgs<ExtArgs>
|
||||
measure_unit?: boolean | Prisma.MeasureUnitsDefaultArgs<ExtArgs>
|
||||
category?: boolean | Prisma.Good$categoryArgs<ExtArgs>
|
||||
consumer_account_good_favorites?: boolean | Prisma.Good$consumer_account_good_favoritesArgs<ExtArgs>
|
||||
business_activity?: boolean | Prisma.Good$business_activityArgs<ExtArgs>
|
||||
category?: boolean | Prisma.Good$categoryArgs<ExtArgs>
|
||||
measure_unit?: boolean | Prisma.MeasureUnitsDefaultArgs<ExtArgs>
|
||||
sku?: boolean | Prisma.StockKeepingUnitsDefaultArgs<ExtArgs>
|
||||
sales_invoice_items?: boolean | Prisma.Good$sales_invoice_itemsArgs<ExtArgs>
|
||||
_count?: boolean | Prisma.GoodCountOutputTypeDefaultArgs<ExtArgs>
|
||||
}
|
||||
@@ -1582,10 +1730,11 @@ export type GoodInclude<ExtArgs extends runtime.Types.Extensions.InternalArgs =
|
||||
export type $GoodPayload<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
|
||||
name: "Good"
|
||||
objects: {
|
||||
sku: Prisma.$StockKeepingUnitsPayload<ExtArgs>
|
||||
measure_unit: Prisma.$MeasureUnitsPayload<ExtArgs>
|
||||
category: Prisma.$GoodCategoryPayload<ExtArgs> | null
|
||||
consumer_account_good_favorites: Prisma.$ConsumerAccountGoodFavoritePayload<ExtArgs>[]
|
||||
business_activity: Prisma.$BusinessActivityPayload<ExtArgs> | null
|
||||
category: Prisma.$GoodCategoryPayload<ExtArgs> | null
|
||||
measure_unit: Prisma.$MeasureUnitsPayload<ExtArgs>
|
||||
sku: Prisma.$StockKeepingUnitsPayload<ExtArgs>
|
||||
sales_invoice_items: Prisma.$SalesInvoiceItemPayload<ExtArgs>[]
|
||||
}
|
||||
scalars: runtime.Types.Extensions.GetPayloadResult<{
|
||||
@@ -1945,10 +2094,11 @@ readonly fields: GoodFieldRefs;
|
||||
*/
|
||||
export interface Prisma__GoodClient<T, Null = never, ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs, GlobalOmitOptions = {}> extends Prisma.PrismaPromise<T> {
|
||||
readonly [Symbol.toStringTag]: "PrismaPromise"
|
||||
sku<T extends Prisma.StockKeepingUnitsDefaultArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.StockKeepingUnitsDefaultArgs<ExtArgs>>): Prisma.Prisma__StockKeepingUnitsClient<runtime.Types.Result.GetResult<Prisma.$StockKeepingUnitsPayload<ExtArgs>, T, "findUniqueOrThrow", GlobalOmitOptions> | Null, Null, ExtArgs, GlobalOmitOptions>
|
||||
measure_unit<T extends Prisma.MeasureUnitsDefaultArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.MeasureUnitsDefaultArgs<ExtArgs>>): Prisma.Prisma__MeasureUnitsClient<runtime.Types.Result.GetResult<Prisma.$MeasureUnitsPayload<ExtArgs>, T, "findUniqueOrThrow", GlobalOmitOptions> | Null, Null, ExtArgs, GlobalOmitOptions>
|
||||
category<T extends Prisma.Good$categoryArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.Good$categoryArgs<ExtArgs>>): Prisma.Prisma__GoodCategoryClient<runtime.Types.Result.GetResult<Prisma.$GoodCategoryPayload<ExtArgs>, T, "findUniqueOrThrow", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions>
|
||||
consumer_account_good_favorites<T extends Prisma.Good$consumer_account_good_favoritesArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.Good$consumer_account_good_favoritesArgs<ExtArgs>>): Prisma.PrismaPromise<runtime.Types.Result.GetResult<Prisma.$ConsumerAccountGoodFavoritePayload<ExtArgs>, T, "findMany", GlobalOmitOptions> | Null>
|
||||
business_activity<T extends Prisma.Good$business_activityArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.Good$business_activityArgs<ExtArgs>>): Prisma.Prisma__BusinessActivityClient<runtime.Types.Result.GetResult<Prisma.$BusinessActivityPayload<ExtArgs>, T, "findUniqueOrThrow", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions>
|
||||
category<T extends Prisma.Good$categoryArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.Good$categoryArgs<ExtArgs>>): Prisma.Prisma__GoodCategoryClient<runtime.Types.Result.GetResult<Prisma.$GoodCategoryPayload<ExtArgs>, T, "findUniqueOrThrow", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions>
|
||||
measure_unit<T extends Prisma.MeasureUnitsDefaultArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.MeasureUnitsDefaultArgs<ExtArgs>>): Prisma.Prisma__MeasureUnitsClient<runtime.Types.Result.GetResult<Prisma.$MeasureUnitsPayload<ExtArgs>, T, "findUniqueOrThrow", GlobalOmitOptions> | Null, Null, ExtArgs, GlobalOmitOptions>
|
||||
sku<T extends Prisma.StockKeepingUnitsDefaultArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.StockKeepingUnitsDefaultArgs<ExtArgs>>): Prisma.Prisma__StockKeepingUnitsClient<runtime.Types.Result.GetResult<Prisma.$StockKeepingUnitsPayload<ExtArgs>, T, "findUniqueOrThrow", GlobalOmitOptions> | Null, Null, ExtArgs, GlobalOmitOptions>
|
||||
sales_invoice_items<T extends Prisma.Good$sales_invoice_itemsArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.Good$sales_invoice_itemsArgs<ExtArgs>>): Prisma.PrismaPromise<runtime.Types.Result.GetResult<Prisma.$SalesInvoiceItemPayload<ExtArgs>, T, "findMany", GlobalOmitOptions> | Null>
|
||||
/**
|
||||
* Attaches callbacks for the resolution and/or rejection of the Promise.
|
||||
@@ -2343,22 +2493,27 @@ export type GoodDeleteManyArgs<ExtArgs extends runtime.Types.Extensions.Internal
|
||||
}
|
||||
|
||||
/**
|
||||
* Good.category
|
||||
* Good.consumer_account_good_favorites
|
||||
*/
|
||||
export type Good$categoryArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
|
||||
export type Good$consumer_account_good_favoritesArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
|
||||
/**
|
||||
* Select specific fields to fetch from the GoodCategory
|
||||
* Select specific fields to fetch from the ConsumerAccountGoodFavorite
|
||||
*/
|
||||
select?: Prisma.GoodCategorySelect<ExtArgs> | null
|
||||
select?: Prisma.ConsumerAccountGoodFavoriteSelect<ExtArgs> | null
|
||||
/**
|
||||
* Omit specific fields from the GoodCategory
|
||||
* Omit specific fields from the ConsumerAccountGoodFavorite
|
||||
*/
|
||||
omit?: Prisma.GoodCategoryOmit<ExtArgs> | null
|
||||
omit?: Prisma.ConsumerAccountGoodFavoriteOmit<ExtArgs> | null
|
||||
/**
|
||||
* Choose, which related nodes to fetch as well
|
||||
*/
|
||||
include?: Prisma.GoodCategoryInclude<ExtArgs> | null
|
||||
where?: Prisma.GoodCategoryWhereInput
|
||||
include?: Prisma.ConsumerAccountGoodFavoriteInclude<ExtArgs> | null
|
||||
where?: Prisma.ConsumerAccountGoodFavoriteWhereInput
|
||||
orderBy?: Prisma.ConsumerAccountGoodFavoriteOrderByWithRelationInput | Prisma.ConsumerAccountGoodFavoriteOrderByWithRelationInput[]
|
||||
cursor?: Prisma.ConsumerAccountGoodFavoriteWhereUniqueInput
|
||||
take?: number
|
||||
skip?: number
|
||||
distinct?: Prisma.ConsumerAccountGoodFavoriteScalarFieldEnum | Prisma.ConsumerAccountGoodFavoriteScalarFieldEnum[]
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -2380,6 +2535,25 @@ export type Good$business_activityArgs<ExtArgs extends runtime.Types.Extensions.
|
||||
where?: Prisma.BusinessActivityWhereInput
|
||||
}
|
||||
|
||||
/**
|
||||
* Good.category
|
||||
*/
|
||||
export type Good$categoryArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
|
||||
/**
|
||||
* Select specific fields to fetch from the GoodCategory
|
||||
*/
|
||||
select?: Prisma.GoodCategorySelect<ExtArgs> | null
|
||||
/**
|
||||
* Omit specific fields from the GoodCategory
|
||||
*/
|
||||
omit?: Prisma.GoodCategoryOmit<ExtArgs> | null
|
||||
/**
|
||||
* Choose, which related nodes to fetch as well
|
||||
*/
|
||||
include?: Prisma.GoodCategoryInclude<ExtArgs> | null
|
||||
where?: Prisma.GoodCategoryWhereInput
|
||||
}
|
||||
|
||||
/**
|
||||
* Good.sales_invoice_items
|
||||
*/
|
||||
|
||||
@@ -222,9 +222,9 @@ export type GoodCategoryWhereInput = {
|
||||
created_at?: Prisma.DateTimeFilter<"GoodCategory"> | Date | string
|
||||
updated_at?: Prisma.DateTimeFilter<"GoodCategory"> | Date | string
|
||||
deleted_at?: Prisma.DateTimeNullableFilter<"GoodCategory"> | Date | string | null
|
||||
goods?: Prisma.GoodListRelationFilter
|
||||
guild?: Prisma.XOR<Prisma.GuildNullableScalarRelationFilter, Prisma.GuildWhereInput> | null
|
||||
complex?: Prisma.XOR<Prisma.ComplexNullableScalarRelationFilter, Prisma.ComplexWhereInput> | null
|
||||
guild?: Prisma.XOR<Prisma.GuildNullableScalarRelationFilter, Prisma.GuildWhereInput> | null
|
||||
goods?: Prisma.GoodListRelationFilter
|
||||
}
|
||||
|
||||
export type GoodCategoryOrderByWithRelationInput = {
|
||||
@@ -238,9 +238,9 @@ export type GoodCategoryOrderByWithRelationInput = {
|
||||
created_at?: Prisma.SortOrder
|
||||
updated_at?: Prisma.SortOrder
|
||||
deleted_at?: Prisma.SortOrderInput | Prisma.SortOrder
|
||||
goods?: Prisma.GoodOrderByRelationAggregateInput
|
||||
guild?: Prisma.GuildOrderByWithRelationInput
|
||||
complex?: Prisma.ComplexOrderByWithRelationInput
|
||||
guild?: Prisma.GuildOrderByWithRelationInput
|
||||
goods?: Prisma.GoodOrderByRelationAggregateInput
|
||||
_relevance?: Prisma.GoodCategoryOrderByRelevanceInput
|
||||
}
|
||||
|
||||
@@ -258,9 +258,9 @@ export type GoodCategoryWhereUniqueInput = Prisma.AtLeast<{
|
||||
created_at?: Prisma.DateTimeFilter<"GoodCategory"> | Date | string
|
||||
updated_at?: Prisma.DateTimeFilter<"GoodCategory"> | Date | string
|
||||
deleted_at?: Prisma.DateTimeNullableFilter<"GoodCategory"> | Date | string | null
|
||||
goods?: Prisma.GoodListRelationFilter
|
||||
guild?: Prisma.XOR<Prisma.GuildNullableScalarRelationFilter, Prisma.GuildWhereInput> | null
|
||||
complex?: Prisma.XOR<Prisma.ComplexNullableScalarRelationFilter, Prisma.ComplexWhereInput> | null
|
||||
guild?: Prisma.XOR<Prisma.GuildNullableScalarRelationFilter, Prisma.GuildWhereInput> | null
|
||||
goods?: Prisma.GoodListRelationFilter
|
||||
}, "id">
|
||||
|
||||
export type GoodCategoryOrderByWithAggregationInput = {
|
||||
@@ -304,9 +304,9 @@ export type GoodCategoryCreateInput = {
|
||||
created_at?: Date | string
|
||||
updated_at?: Date | string
|
||||
deleted_at?: Date | string | null
|
||||
goods?: Prisma.GoodCreateNestedManyWithoutCategoryInput
|
||||
guild?: Prisma.GuildCreateNestedOneWithoutGood_categoriesInput
|
||||
complex?: Prisma.ComplexCreateNestedOneWithoutGood_categoriesInput
|
||||
guild?: Prisma.GuildCreateNestedOneWithoutGood_categoriesInput
|
||||
goods?: Prisma.GoodCreateNestedManyWithoutCategoryInput
|
||||
}
|
||||
|
||||
export type GoodCategoryUncheckedCreateInput = {
|
||||
@@ -332,9 +332,9 @@ export type GoodCategoryUpdateInput = {
|
||||
created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
deleted_at?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null
|
||||
goods?: Prisma.GoodUpdateManyWithoutCategoryNestedInput
|
||||
guild?: Prisma.GuildUpdateOneWithoutGood_categoriesNestedInput
|
||||
complex?: Prisma.ComplexUpdateOneWithoutGood_categoriesNestedInput
|
||||
guild?: Prisma.GuildUpdateOneWithoutGood_categoriesNestedInput
|
||||
goods?: Prisma.GoodUpdateManyWithoutCategoryNestedInput
|
||||
}
|
||||
|
||||
export type GoodCategoryUncheckedUpdateInput = {
|
||||
@@ -557,8 +557,8 @@ export type GoodCategoryCreateWithoutComplexInput = {
|
||||
created_at?: Date | string
|
||||
updated_at?: Date | string
|
||||
deleted_at?: Date | string | null
|
||||
goods?: Prisma.GoodCreateNestedManyWithoutCategoryInput
|
||||
guild?: Prisma.GuildCreateNestedOneWithoutGood_categoriesInput
|
||||
goods?: Prisma.GoodCreateNestedManyWithoutCategoryInput
|
||||
}
|
||||
|
||||
export type GoodCategoryUncheckedCreateWithoutComplexInput = {
|
||||
@@ -625,8 +625,8 @@ export type GoodCategoryCreateWithoutGoodsInput = {
|
||||
created_at?: Date | string
|
||||
updated_at?: Date | string
|
||||
deleted_at?: Date | string | null
|
||||
guild?: Prisma.GuildCreateNestedOneWithoutGood_categoriesInput
|
||||
complex?: Prisma.ComplexCreateNestedOneWithoutGood_categoriesInput
|
||||
guild?: Prisma.GuildCreateNestedOneWithoutGood_categoriesInput
|
||||
}
|
||||
|
||||
export type GoodCategoryUncheckedCreateWithoutGoodsInput = {
|
||||
@@ -667,8 +667,8 @@ export type GoodCategoryUpdateWithoutGoodsInput = {
|
||||
created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
deleted_at?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null
|
||||
guild?: Prisma.GuildUpdateOneWithoutGood_categoriesNestedInput
|
||||
complex?: Prisma.ComplexUpdateOneWithoutGood_categoriesNestedInput
|
||||
guild?: Prisma.GuildUpdateOneWithoutGood_categoriesNestedInput
|
||||
}
|
||||
|
||||
export type GoodCategoryUncheckedUpdateWithoutGoodsInput = {
|
||||
@@ -693,8 +693,8 @@ export type GoodCategoryCreateWithoutGuildInput = {
|
||||
created_at?: Date | string
|
||||
updated_at?: Date | string
|
||||
deleted_at?: Date | string | null
|
||||
goods?: Prisma.GoodCreateNestedManyWithoutCategoryInput
|
||||
complex?: Prisma.ComplexCreateNestedOneWithoutGood_categoriesInput
|
||||
goods?: Prisma.GoodCreateNestedManyWithoutCategoryInput
|
||||
}
|
||||
|
||||
export type GoodCategoryUncheckedCreateWithoutGuildInput = {
|
||||
@@ -757,8 +757,8 @@ export type GoodCategoryUpdateWithoutComplexInput = {
|
||||
created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
deleted_at?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null
|
||||
goods?: Prisma.GoodUpdateManyWithoutCategoryNestedInput
|
||||
guild?: Prisma.GuildUpdateOneWithoutGood_categoriesNestedInput
|
||||
goods?: Prisma.GoodUpdateManyWithoutCategoryNestedInput
|
||||
}
|
||||
|
||||
export type GoodCategoryUncheckedUpdateWithoutComplexInput = {
|
||||
@@ -807,8 +807,8 @@ export type GoodCategoryUpdateWithoutGuildInput = {
|
||||
created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
deleted_at?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null
|
||||
goods?: Prisma.GoodUpdateManyWithoutCategoryNestedInput
|
||||
complex?: Prisma.ComplexUpdateOneWithoutGood_categoriesNestedInput
|
||||
goods?: Prisma.GoodUpdateManyWithoutCategoryNestedInput
|
||||
}
|
||||
|
||||
export type GoodCategoryUncheckedUpdateWithoutGuildInput = {
|
||||
@@ -878,9 +878,9 @@ export type GoodCategorySelect<ExtArgs extends runtime.Types.Extensions.Internal
|
||||
created_at?: boolean
|
||||
updated_at?: boolean
|
||||
deleted_at?: boolean
|
||||
goods?: boolean | Prisma.GoodCategory$goodsArgs<ExtArgs>
|
||||
guild?: boolean | Prisma.GoodCategory$guildArgs<ExtArgs>
|
||||
complex?: boolean | Prisma.GoodCategory$complexArgs<ExtArgs>
|
||||
guild?: boolean | Prisma.GoodCategory$guildArgs<ExtArgs>
|
||||
goods?: boolean | Prisma.GoodCategory$goodsArgs<ExtArgs>
|
||||
_count?: boolean | Prisma.GoodCategoryCountOutputTypeDefaultArgs<ExtArgs>
|
||||
}, ExtArgs["result"]["goodCategory"]>
|
||||
|
||||
@@ -901,18 +901,18 @@ export type GoodCategorySelectScalar = {
|
||||
|
||||
export type GoodCategoryOmit<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetOmit<"id" | "name" | "description" | "image_url" | "complex_id" | "is_default_guild_good" | "guild_id" | "created_at" | "updated_at" | "deleted_at", ExtArgs["result"]["goodCategory"]>
|
||||
export type GoodCategoryInclude<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
|
||||
goods?: boolean | Prisma.GoodCategory$goodsArgs<ExtArgs>
|
||||
guild?: boolean | Prisma.GoodCategory$guildArgs<ExtArgs>
|
||||
complex?: boolean | Prisma.GoodCategory$complexArgs<ExtArgs>
|
||||
guild?: boolean | Prisma.GoodCategory$guildArgs<ExtArgs>
|
||||
goods?: boolean | Prisma.GoodCategory$goodsArgs<ExtArgs>
|
||||
_count?: boolean | Prisma.GoodCategoryCountOutputTypeDefaultArgs<ExtArgs>
|
||||
}
|
||||
|
||||
export type $GoodCategoryPayload<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
|
||||
name: "GoodCategory"
|
||||
objects: {
|
||||
goods: Prisma.$GoodPayload<ExtArgs>[]
|
||||
guild: Prisma.$GuildPayload<ExtArgs> | null
|
||||
complex: Prisma.$ComplexPayload<ExtArgs> | null
|
||||
guild: Prisma.$GuildPayload<ExtArgs> | null
|
||||
goods: Prisma.$GoodPayload<ExtArgs>[]
|
||||
}
|
||||
scalars: runtime.Types.Extensions.GetPayloadResult<{
|
||||
id: string
|
||||
@@ -1265,9 +1265,9 @@ readonly fields: GoodCategoryFieldRefs;
|
||||
*/
|
||||
export interface Prisma__GoodCategoryClient<T, Null = never, ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs, GlobalOmitOptions = {}> extends Prisma.PrismaPromise<T> {
|
||||
readonly [Symbol.toStringTag]: "PrismaPromise"
|
||||
goods<T extends Prisma.GoodCategory$goodsArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.GoodCategory$goodsArgs<ExtArgs>>): Prisma.PrismaPromise<runtime.Types.Result.GetResult<Prisma.$GoodPayload<ExtArgs>, T, "findMany", GlobalOmitOptions> | Null>
|
||||
guild<T extends Prisma.GoodCategory$guildArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.GoodCategory$guildArgs<ExtArgs>>): Prisma.Prisma__GuildClient<runtime.Types.Result.GetResult<Prisma.$GuildPayload<ExtArgs>, T, "findUniqueOrThrow", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions>
|
||||
complex<T extends Prisma.GoodCategory$complexArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.GoodCategory$complexArgs<ExtArgs>>): Prisma.Prisma__ComplexClient<runtime.Types.Result.GetResult<Prisma.$ComplexPayload<ExtArgs>, T, "findUniqueOrThrow", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions>
|
||||
guild<T extends Prisma.GoodCategory$guildArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.GoodCategory$guildArgs<ExtArgs>>): Prisma.Prisma__GuildClient<runtime.Types.Result.GetResult<Prisma.$GuildPayload<ExtArgs>, T, "findUniqueOrThrow", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions>
|
||||
goods<T extends Prisma.GoodCategory$goodsArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.GoodCategory$goodsArgs<ExtArgs>>): Prisma.PrismaPromise<runtime.Types.Result.GetResult<Prisma.$GoodPayload<ExtArgs>, T, "findMany", GlobalOmitOptions> | Null>
|
||||
/**
|
||||
* Attaches callbacks for the resolution and/or rejection of the Promise.
|
||||
* @param onfulfilled The callback to execute when the Promise is resolved.
|
||||
@@ -1654,6 +1654,44 @@ export type GoodCategoryDeleteManyArgs<ExtArgs extends runtime.Types.Extensions.
|
||||
limit?: number
|
||||
}
|
||||
|
||||
/**
|
||||
* GoodCategory.complex
|
||||
*/
|
||||
export type GoodCategory$complexArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
|
||||
/**
|
||||
* Select specific fields to fetch from the Complex
|
||||
*/
|
||||
select?: Prisma.ComplexSelect<ExtArgs> | null
|
||||
/**
|
||||
* Omit specific fields from the Complex
|
||||
*/
|
||||
omit?: Prisma.ComplexOmit<ExtArgs> | null
|
||||
/**
|
||||
* Choose, which related nodes to fetch as well
|
||||
*/
|
||||
include?: Prisma.ComplexInclude<ExtArgs> | null
|
||||
where?: Prisma.ComplexWhereInput
|
||||
}
|
||||
|
||||
/**
|
||||
* GoodCategory.guild
|
||||
*/
|
||||
export type GoodCategory$guildArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
|
||||
/**
|
||||
* Select specific fields to fetch from the Guild
|
||||
*/
|
||||
select?: Prisma.GuildSelect<ExtArgs> | null
|
||||
/**
|
||||
* Omit specific fields from the Guild
|
||||
*/
|
||||
omit?: Prisma.GuildOmit<ExtArgs> | null
|
||||
/**
|
||||
* Choose, which related nodes to fetch as well
|
||||
*/
|
||||
include?: Prisma.GuildInclude<ExtArgs> | null
|
||||
where?: Prisma.GuildWhereInput
|
||||
}
|
||||
|
||||
/**
|
||||
* GoodCategory.goods
|
||||
*/
|
||||
@@ -1678,44 +1716,6 @@ export type GoodCategory$goodsArgs<ExtArgs extends runtime.Types.Extensions.Inte
|
||||
distinct?: Prisma.GoodScalarFieldEnum | Prisma.GoodScalarFieldEnum[]
|
||||
}
|
||||
|
||||
/**
|
||||
* GoodCategory.guild
|
||||
*/
|
||||
export type GoodCategory$guildArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
|
||||
/**
|
||||
* Select specific fields to fetch from the Guild
|
||||
*/
|
||||
select?: Prisma.GuildSelect<ExtArgs> | null
|
||||
/**
|
||||
* Omit specific fields from the Guild
|
||||
*/
|
||||
omit?: Prisma.GuildOmit<ExtArgs> | null
|
||||
/**
|
||||
* Choose, which related nodes to fetch as well
|
||||
*/
|
||||
include?: Prisma.GuildInclude<ExtArgs> | null
|
||||
where?: Prisma.GuildWhereInput
|
||||
}
|
||||
|
||||
/**
|
||||
* GoodCategory.complex
|
||||
*/
|
||||
export type GoodCategory$complexArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
|
||||
/**
|
||||
* Select specific fields to fetch from the Complex
|
||||
*/
|
||||
select?: Prisma.ComplexSelect<ExtArgs> | null
|
||||
/**
|
||||
* Omit specific fields from the Complex
|
||||
*/
|
||||
omit?: Prisma.ComplexOmit<ExtArgs> | null
|
||||
/**
|
||||
* Choose, which related nodes to fetch as well
|
||||
*/
|
||||
include?: Prisma.ComplexInclude<ExtArgs> | null
|
||||
where?: Prisma.ComplexWhereInput
|
||||
}
|
||||
|
||||
/**
|
||||
* GoodCategory without action
|
||||
*/
|
||||
|
||||
@@ -238,11 +238,11 @@ export type PosWhereInput = {
|
||||
device_id?: Prisma.StringNullableFilter<"Pos"> | string | null
|
||||
provider_id?: Prisma.StringNullableFilter<"Pos"> | string | null
|
||||
account_id?: Prisma.StringFilter<"Pos"> | string
|
||||
permission_pos?: Prisma.PermissionPosListRelationFilter
|
||||
account?: Prisma.XOR<Prisma.ConsumerAccountScalarRelationFilter, Prisma.ConsumerAccountWhereInput>
|
||||
complex?: Prisma.XOR<Prisma.ComplexScalarRelationFilter, Prisma.ComplexWhereInput>
|
||||
device?: Prisma.XOR<Prisma.DeviceNullableScalarRelationFilter, Prisma.DeviceWhereInput> | null
|
||||
provider?: Prisma.XOR<Prisma.ProviderNullableScalarRelationFilter, Prisma.ProviderWhereInput> | null
|
||||
account?: Prisma.XOR<Prisma.ConsumerAccountScalarRelationFilter, Prisma.ConsumerAccountWhereInput>
|
||||
permission_pos?: Prisma.PermissionPosListRelationFilter
|
||||
sales_invoices?: Prisma.SalesInvoiceListRelationFilter
|
||||
}
|
||||
|
||||
@@ -259,11 +259,11 @@ export type PosOrderByWithRelationInput = {
|
||||
device_id?: Prisma.SortOrderInput | Prisma.SortOrder
|
||||
provider_id?: Prisma.SortOrderInput | Prisma.SortOrder
|
||||
account_id?: Prisma.SortOrder
|
||||
permission_pos?: Prisma.PermissionPosOrderByRelationAggregateInput
|
||||
account?: Prisma.ConsumerAccountOrderByWithRelationInput
|
||||
complex?: Prisma.ComplexOrderByWithRelationInput
|
||||
device?: Prisma.DeviceOrderByWithRelationInput
|
||||
provider?: Prisma.ProviderOrderByWithRelationInput
|
||||
account?: Prisma.ConsumerAccountOrderByWithRelationInput
|
||||
permission_pos?: Prisma.PermissionPosOrderByRelationAggregateInput
|
||||
sales_invoices?: Prisma.SalesInvoiceOrderByRelationAggregateInput
|
||||
_relevance?: Prisma.PosOrderByRelevanceInput
|
||||
}
|
||||
@@ -284,11 +284,11 @@ export type PosWhereUniqueInput = Prisma.AtLeast<{
|
||||
complex_id?: Prisma.StringFilter<"Pos"> | string
|
||||
device_id?: Prisma.StringNullableFilter<"Pos"> | string | null
|
||||
provider_id?: Prisma.StringNullableFilter<"Pos"> | string | null
|
||||
permission_pos?: Prisma.PermissionPosListRelationFilter
|
||||
account?: Prisma.XOR<Prisma.ConsumerAccountScalarRelationFilter, Prisma.ConsumerAccountWhereInput>
|
||||
complex?: Prisma.XOR<Prisma.ComplexScalarRelationFilter, Prisma.ComplexWhereInput>
|
||||
device?: Prisma.XOR<Prisma.DeviceNullableScalarRelationFilter, Prisma.DeviceWhereInput> | null
|
||||
provider?: Prisma.XOR<Prisma.ProviderNullableScalarRelationFilter, Prisma.ProviderWhereInput> | null
|
||||
account?: Prisma.XOR<Prisma.ConsumerAccountScalarRelationFilter, Prisma.ConsumerAccountWhereInput>
|
||||
permission_pos?: Prisma.PermissionPosListRelationFilter
|
||||
sales_invoices?: Prisma.SalesInvoiceListRelationFilter
|
||||
}, "id" | "serial_number" | "account_id">
|
||||
|
||||
@@ -337,11 +337,11 @@ export type PosCreateInput = {
|
||||
pos_type: $Enums.POSType
|
||||
created_at?: Date | string
|
||||
updated_at?: Date | string
|
||||
permission_pos?: Prisma.PermissionPosCreateNestedManyWithoutPosInput
|
||||
account: Prisma.ConsumerAccountCreateNestedOneWithoutPosInput
|
||||
complex: Prisma.ComplexCreateNestedOneWithoutPos_listInput
|
||||
device?: Prisma.DeviceCreateNestedOneWithoutPosesInput
|
||||
provider?: Prisma.ProviderCreateNestedOneWithoutPos_listInput
|
||||
account: Prisma.ConsumerAccountCreateNestedOneWithoutPosInput
|
||||
permission_pos?: Prisma.PermissionPosCreateNestedManyWithoutPosInput
|
||||
sales_invoices?: Prisma.SalesInvoiceCreateNestedManyWithoutPosInput
|
||||
}
|
||||
|
||||
@@ -371,11 +371,11 @@ export type PosUpdateInput = {
|
||||
pos_type?: Prisma.EnumPOSTypeFieldUpdateOperationsInput | $Enums.POSType
|
||||
created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
permission_pos?: Prisma.PermissionPosUpdateManyWithoutPosNestedInput
|
||||
account?: Prisma.ConsumerAccountUpdateOneRequiredWithoutPosNestedInput
|
||||
complex?: Prisma.ComplexUpdateOneRequiredWithoutPos_listNestedInput
|
||||
device?: Prisma.DeviceUpdateOneWithoutPosesNestedInput
|
||||
provider?: Prisma.ProviderUpdateOneWithoutPos_listNestedInput
|
||||
account?: Prisma.ConsumerAccountUpdateOneRequiredWithoutPosNestedInput
|
||||
permission_pos?: Prisma.PermissionPosUpdateManyWithoutPosNestedInput
|
||||
sales_invoices?: Prisma.SalesInvoiceUpdateManyWithoutPosNestedInput
|
||||
}
|
||||
|
||||
@@ -711,10 +711,10 @@ export type PosCreateWithoutDeviceInput = {
|
||||
pos_type: $Enums.POSType
|
||||
created_at?: Date | string
|
||||
updated_at?: Date | string
|
||||
permission_pos?: Prisma.PermissionPosCreateNestedManyWithoutPosInput
|
||||
account: Prisma.ConsumerAccountCreateNestedOneWithoutPosInput
|
||||
complex: Prisma.ComplexCreateNestedOneWithoutPos_listInput
|
||||
provider?: Prisma.ProviderCreateNestedOneWithoutPos_listInput
|
||||
account: Prisma.ConsumerAccountCreateNestedOneWithoutPosInput
|
||||
permission_pos?: Prisma.PermissionPosCreateNestedManyWithoutPosInput
|
||||
sales_invoices?: Prisma.SalesInvoiceCreateNestedManyWithoutPosInput
|
||||
}
|
||||
|
||||
@@ -787,10 +787,10 @@ export type PosCreateWithoutPermission_posInput = {
|
||||
pos_type: $Enums.POSType
|
||||
created_at?: Date | string
|
||||
updated_at?: Date | string
|
||||
account: Prisma.ConsumerAccountCreateNestedOneWithoutPosInput
|
||||
complex: Prisma.ComplexCreateNestedOneWithoutPos_listInput
|
||||
device?: Prisma.DeviceCreateNestedOneWithoutPosesInput
|
||||
provider?: Prisma.ProviderCreateNestedOneWithoutPos_listInput
|
||||
account: Prisma.ConsumerAccountCreateNestedOneWithoutPosInput
|
||||
sales_invoices?: Prisma.SalesInvoiceCreateNestedManyWithoutPosInput
|
||||
}
|
||||
|
||||
@@ -835,10 +835,10 @@ export type PosUpdateWithoutPermission_posInput = {
|
||||
pos_type?: Prisma.EnumPOSTypeFieldUpdateOperationsInput | $Enums.POSType
|
||||
created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
account?: Prisma.ConsumerAccountUpdateOneRequiredWithoutPosNestedInput
|
||||
complex?: Prisma.ComplexUpdateOneRequiredWithoutPos_listNestedInput
|
||||
device?: Prisma.DeviceUpdateOneWithoutPosesNestedInput
|
||||
provider?: Prisma.ProviderUpdateOneWithoutPos_listNestedInput
|
||||
account?: Prisma.ConsumerAccountUpdateOneRequiredWithoutPosNestedInput
|
||||
sales_invoices?: Prisma.SalesInvoiceUpdateManyWithoutPosNestedInput
|
||||
}
|
||||
|
||||
@@ -867,10 +867,10 @@ export type PosCreateWithoutProviderInput = {
|
||||
pos_type: $Enums.POSType
|
||||
created_at?: Date | string
|
||||
updated_at?: Date | string
|
||||
permission_pos?: Prisma.PermissionPosCreateNestedManyWithoutPosInput
|
||||
account: Prisma.ConsumerAccountCreateNestedOneWithoutPosInput
|
||||
complex: Prisma.ComplexCreateNestedOneWithoutPos_listInput
|
||||
device?: Prisma.DeviceCreateNestedOneWithoutPosesInput
|
||||
account: Prisma.ConsumerAccountCreateNestedOneWithoutPosInput
|
||||
permission_pos?: Prisma.PermissionPosCreateNestedManyWithoutPosInput
|
||||
sales_invoices?: Prisma.SalesInvoiceCreateNestedManyWithoutPosInput
|
||||
}
|
||||
|
||||
@@ -925,10 +925,10 @@ export type PosCreateWithoutAccountInput = {
|
||||
pos_type: $Enums.POSType
|
||||
created_at?: Date | string
|
||||
updated_at?: Date | string
|
||||
permission_pos?: Prisma.PermissionPosCreateNestedManyWithoutPosInput
|
||||
complex: Prisma.ComplexCreateNestedOneWithoutPos_listInput
|
||||
device?: Prisma.DeviceCreateNestedOneWithoutPosesInput
|
||||
provider?: Prisma.ProviderCreateNestedOneWithoutPos_listInput
|
||||
permission_pos?: Prisma.PermissionPosCreateNestedManyWithoutPosInput
|
||||
sales_invoices?: Prisma.SalesInvoiceCreateNestedManyWithoutPosInput
|
||||
}
|
||||
|
||||
@@ -973,10 +973,10 @@ export type PosUpdateWithoutAccountInput = {
|
||||
pos_type?: Prisma.EnumPOSTypeFieldUpdateOperationsInput | $Enums.POSType
|
||||
created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
permission_pos?: Prisma.PermissionPosUpdateManyWithoutPosNestedInput
|
||||
complex?: Prisma.ComplexUpdateOneRequiredWithoutPos_listNestedInput
|
||||
device?: Prisma.DeviceUpdateOneWithoutPosesNestedInput
|
||||
provider?: Prisma.ProviderUpdateOneWithoutPos_listNestedInput
|
||||
permission_pos?: Prisma.PermissionPosUpdateManyWithoutPosNestedInput
|
||||
sales_invoices?: Prisma.SalesInvoiceUpdateManyWithoutPosNestedInput
|
||||
}
|
||||
|
||||
@@ -1005,10 +1005,10 @@ export type PosCreateWithoutComplexInput = {
|
||||
pos_type: $Enums.POSType
|
||||
created_at?: Date | string
|
||||
updated_at?: Date | string
|
||||
permission_pos?: Prisma.PermissionPosCreateNestedManyWithoutPosInput
|
||||
account: Prisma.ConsumerAccountCreateNestedOneWithoutPosInput
|
||||
device?: Prisma.DeviceCreateNestedOneWithoutPosesInput
|
||||
provider?: Prisma.ProviderCreateNestedOneWithoutPos_listInput
|
||||
account: Prisma.ConsumerAccountCreateNestedOneWithoutPosInput
|
||||
permission_pos?: Prisma.PermissionPosCreateNestedManyWithoutPosInput
|
||||
sales_invoices?: Prisma.SalesInvoiceCreateNestedManyWithoutPosInput
|
||||
}
|
||||
|
||||
@@ -1063,11 +1063,11 @@ export type PosCreateWithoutSales_invoicesInput = {
|
||||
pos_type: $Enums.POSType
|
||||
created_at?: Date | string
|
||||
updated_at?: Date | string
|
||||
permission_pos?: Prisma.PermissionPosCreateNestedManyWithoutPosInput
|
||||
account: Prisma.ConsumerAccountCreateNestedOneWithoutPosInput
|
||||
complex: Prisma.ComplexCreateNestedOneWithoutPos_listInput
|
||||
device?: Prisma.DeviceCreateNestedOneWithoutPosesInput
|
||||
provider?: Prisma.ProviderCreateNestedOneWithoutPos_listInput
|
||||
account: Prisma.ConsumerAccountCreateNestedOneWithoutPosInput
|
||||
permission_pos?: Prisma.PermissionPosCreateNestedManyWithoutPosInput
|
||||
}
|
||||
|
||||
export type PosUncheckedCreateWithoutSales_invoicesInput = {
|
||||
@@ -1111,11 +1111,11 @@ export type PosUpdateWithoutSales_invoicesInput = {
|
||||
pos_type?: Prisma.EnumPOSTypeFieldUpdateOperationsInput | $Enums.POSType
|
||||
created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
permission_pos?: Prisma.PermissionPosUpdateManyWithoutPosNestedInput
|
||||
account?: Prisma.ConsumerAccountUpdateOneRequiredWithoutPosNestedInput
|
||||
complex?: Prisma.ComplexUpdateOneRequiredWithoutPos_listNestedInput
|
||||
device?: Prisma.DeviceUpdateOneWithoutPosesNestedInput
|
||||
provider?: Prisma.ProviderUpdateOneWithoutPos_listNestedInput
|
||||
account?: Prisma.ConsumerAccountUpdateOneRequiredWithoutPosNestedInput
|
||||
permission_pos?: Prisma.PermissionPosUpdateManyWithoutPosNestedInput
|
||||
}
|
||||
|
||||
export type PosUncheckedUpdateWithoutSales_invoicesInput = {
|
||||
@@ -1157,10 +1157,10 @@ export type PosUpdateWithoutDeviceInput = {
|
||||
pos_type?: Prisma.EnumPOSTypeFieldUpdateOperationsInput | $Enums.POSType
|
||||
created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
permission_pos?: Prisma.PermissionPosUpdateManyWithoutPosNestedInput
|
||||
account?: Prisma.ConsumerAccountUpdateOneRequiredWithoutPosNestedInput
|
||||
complex?: Prisma.ComplexUpdateOneRequiredWithoutPos_listNestedInput
|
||||
provider?: Prisma.ProviderUpdateOneWithoutPos_listNestedInput
|
||||
account?: Prisma.ConsumerAccountUpdateOneRequiredWithoutPosNestedInput
|
||||
permission_pos?: Prisma.PermissionPosUpdateManyWithoutPosNestedInput
|
||||
sales_invoices?: Prisma.SalesInvoiceUpdateManyWithoutPosNestedInput
|
||||
}
|
||||
|
||||
@@ -1217,10 +1217,10 @@ export type PosUpdateWithoutProviderInput = {
|
||||
pos_type?: Prisma.EnumPOSTypeFieldUpdateOperationsInput | $Enums.POSType
|
||||
created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
permission_pos?: Prisma.PermissionPosUpdateManyWithoutPosNestedInput
|
||||
account?: Prisma.ConsumerAccountUpdateOneRequiredWithoutPosNestedInput
|
||||
complex?: Prisma.ComplexUpdateOneRequiredWithoutPos_listNestedInput
|
||||
device?: Prisma.DeviceUpdateOneWithoutPosesNestedInput
|
||||
account?: Prisma.ConsumerAccountUpdateOneRequiredWithoutPosNestedInput
|
||||
permission_pos?: Prisma.PermissionPosUpdateManyWithoutPosNestedInput
|
||||
sales_invoices?: Prisma.SalesInvoiceUpdateManyWithoutPosNestedInput
|
||||
}
|
||||
|
||||
@@ -1277,10 +1277,10 @@ export type PosUpdateWithoutComplexInput = {
|
||||
pos_type?: Prisma.EnumPOSTypeFieldUpdateOperationsInput | $Enums.POSType
|
||||
created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
permission_pos?: Prisma.PermissionPosUpdateManyWithoutPosNestedInput
|
||||
account?: Prisma.ConsumerAccountUpdateOneRequiredWithoutPosNestedInput
|
||||
device?: Prisma.DeviceUpdateOneWithoutPosesNestedInput
|
||||
provider?: Prisma.ProviderUpdateOneWithoutPos_listNestedInput
|
||||
account?: Prisma.ConsumerAccountUpdateOneRequiredWithoutPosNestedInput
|
||||
permission_pos?: Prisma.PermissionPosUpdateManyWithoutPosNestedInput
|
||||
sales_invoices?: Prisma.SalesInvoiceUpdateManyWithoutPosNestedInput
|
||||
}
|
||||
|
||||
@@ -1367,11 +1367,11 @@ export type PosSelect<ExtArgs extends runtime.Types.Extensions.InternalArgs = ru
|
||||
device_id?: boolean
|
||||
provider_id?: boolean
|
||||
account_id?: boolean
|
||||
permission_pos?: boolean | Prisma.Pos$permission_posArgs<ExtArgs>
|
||||
account?: boolean | Prisma.ConsumerAccountDefaultArgs<ExtArgs>
|
||||
complex?: boolean | Prisma.ComplexDefaultArgs<ExtArgs>
|
||||
device?: boolean | Prisma.Pos$deviceArgs<ExtArgs>
|
||||
provider?: boolean | Prisma.Pos$providerArgs<ExtArgs>
|
||||
account?: boolean | Prisma.ConsumerAccountDefaultArgs<ExtArgs>
|
||||
permission_pos?: boolean | Prisma.Pos$permission_posArgs<ExtArgs>
|
||||
sales_invoices?: boolean | Prisma.Pos$sales_invoicesArgs<ExtArgs>
|
||||
_count?: boolean | Prisma.PosCountOutputTypeDefaultArgs<ExtArgs>
|
||||
}, ExtArgs["result"]["pos"]>
|
||||
@@ -1395,11 +1395,11 @@ export type PosSelectScalar = {
|
||||
|
||||
export type PosOmit<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetOmit<"id" | "name" | "model" | "serial_number" | "status" | "pos_type" | "created_at" | "updated_at" | "complex_id" | "device_id" | "provider_id" | "account_id", ExtArgs["result"]["pos"]>
|
||||
export type PosInclude<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
|
||||
permission_pos?: boolean | Prisma.Pos$permission_posArgs<ExtArgs>
|
||||
account?: boolean | Prisma.ConsumerAccountDefaultArgs<ExtArgs>
|
||||
complex?: boolean | Prisma.ComplexDefaultArgs<ExtArgs>
|
||||
device?: boolean | Prisma.Pos$deviceArgs<ExtArgs>
|
||||
provider?: boolean | Prisma.Pos$providerArgs<ExtArgs>
|
||||
account?: boolean | Prisma.ConsumerAccountDefaultArgs<ExtArgs>
|
||||
permission_pos?: boolean | Prisma.Pos$permission_posArgs<ExtArgs>
|
||||
sales_invoices?: boolean | Prisma.Pos$sales_invoicesArgs<ExtArgs>
|
||||
_count?: boolean | Prisma.PosCountOutputTypeDefaultArgs<ExtArgs>
|
||||
}
|
||||
@@ -1407,11 +1407,11 @@ export type PosInclude<ExtArgs extends runtime.Types.Extensions.InternalArgs = r
|
||||
export type $PosPayload<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
|
||||
name: "Pos"
|
||||
objects: {
|
||||
permission_pos: Prisma.$PermissionPosPayload<ExtArgs>[]
|
||||
account: Prisma.$ConsumerAccountPayload<ExtArgs>
|
||||
complex: Prisma.$ComplexPayload<ExtArgs>
|
||||
device: Prisma.$DevicePayload<ExtArgs> | null
|
||||
provider: Prisma.$ProviderPayload<ExtArgs> | null
|
||||
account: Prisma.$ConsumerAccountPayload<ExtArgs>
|
||||
permission_pos: Prisma.$PermissionPosPayload<ExtArgs>[]
|
||||
sales_invoices: Prisma.$SalesInvoicePayload<ExtArgs>[]
|
||||
}
|
||||
scalars: runtime.Types.Extensions.GetPayloadResult<{
|
||||
@@ -1767,11 +1767,11 @@ readonly fields: PosFieldRefs;
|
||||
*/
|
||||
export interface Prisma__PosClient<T, Null = never, ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs, GlobalOmitOptions = {}> extends Prisma.PrismaPromise<T> {
|
||||
readonly [Symbol.toStringTag]: "PrismaPromise"
|
||||
permission_pos<T extends Prisma.Pos$permission_posArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.Pos$permission_posArgs<ExtArgs>>): Prisma.PrismaPromise<runtime.Types.Result.GetResult<Prisma.$PermissionPosPayload<ExtArgs>, T, "findMany", GlobalOmitOptions> | Null>
|
||||
account<T extends Prisma.ConsumerAccountDefaultArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.ConsumerAccountDefaultArgs<ExtArgs>>): Prisma.Prisma__ConsumerAccountClient<runtime.Types.Result.GetResult<Prisma.$ConsumerAccountPayload<ExtArgs>, T, "findUniqueOrThrow", GlobalOmitOptions> | Null, Null, ExtArgs, GlobalOmitOptions>
|
||||
complex<T extends Prisma.ComplexDefaultArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.ComplexDefaultArgs<ExtArgs>>): Prisma.Prisma__ComplexClient<runtime.Types.Result.GetResult<Prisma.$ComplexPayload<ExtArgs>, T, "findUniqueOrThrow", GlobalOmitOptions> | Null, Null, ExtArgs, GlobalOmitOptions>
|
||||
device<T extends Prisma.Pos$deviceArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.Pos$deviceArgs<ExtArgs>>): Prisma.Prisma__DeviceClient<runtime.Types.Result.GetResult<Prisma.$DevicePayload<ExtArgs>, T, "findUniqueOrThrow", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions>
|
||||
provider<T extends Prisma.Pos$providerArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.Pos$providerArgs<ExtArgs>>): Prisma.Prisma__ProviderClient<runtime.Types.Result.GetResult<Prisma.$ProviderPayload<ExtArgs>, T, "findUniqueOrThrow", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions>
|
||||
account<T extends Prisma.ConsumerAccountDefaultArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.ConsumerAccountDefaultArgs<ExtArgs>>): Prisma.Prisma__ConsumerAccountClient<runtime.Types.Result.GetResult<Prisma.$ConsumerAccountPayload<ExtArgs>, T, "findUniqueOrThrow", GlobalOmitOptions> | Null, Null, ExtArgs, GlobalOmitOptions>
|
||||
permission_pos<T extends Prisma.Pos$permission_posArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.Pos$permission_posArgs<ExtArgs>>): Prisma.PrismaPromise<runtime.Types.Result.GetResult<Prisma.$PermissionPosPayload<ExtArgs>, T, "findMany", GlobalOmitOptions> | Null>
|
||||
sales_invoices<T extends Prisma.Pos$sales_invoicesArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.Pos$sales_invoicesArgs<ExtArgs>>): Prisma.PrismaPromise<runtime.Types.Result.GetResult<Prisma.$SalesInvoicePayload<ExtArgs>, T, "findMany", GlobalOmitOptions> | Null>
|
||||
/**
|
||||
* Attaches callbacks for the resolution and/or rejection of the Promise.
|
||||
@@ -2161,6 +2161,30 @@ export type PosDeleteManyArgs<ExtArgs extends runtime.Types.Extensions.InternalA
|
||||
limit?: number
|
||||
}
|
||||
|
||||
/**
|
||||
* Pos.permission_pos
|
||||
*/
|
||||
export type Pos$permission_posArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
|
||||
/**
|
||||
* Select specific fields to fetch from the PermissionPos
|
||||
*/
|
||||
select?: Prisma.PermissionPosSelect<ExtArgs> | null
|
||||
/**
|
||||
* Omit specific fields from the PermissionPos
|
||||
*/
|
||||
omit?: Prisma.PermissionPosOmit<ExtArgs> | null
|
||||
/**
|
||||
* Choose, which related nodes to fetch as well
|
||||
*/
|
||||
include?: Prisma.PermissionPosInclude<ExtArgs> | null
|
||||
where?: Prisma.PermissionPosWhereInput
|
||||
orderBy?: Prisma.PermissionPosOrderByWithRelationInput | Prisma.PermissionPosOrderByWithRelationInput[]
|
||||
cursor?: Prisma.PermissionPosWhereUniqueInput
|
||||
take?: number
|
||||
skip?: number
|
||||
distinct?: Prisma.PermissionPosScalarFieldEnum | Prisma.PermissionPosScalarFieldEnum[]
|
||||
}
|
||||
|
||||
/**
|
||||
* Pos.device
|
||||
*/
|
||||
@@ -2199,30 +2223,6 @@ export type Pos$providerArgs<ExtArgs extends runtime.Types.Extensions.InternalAr
|
||||
where?: Prisma.ProviderWhereInput
|
||||
}
|
||||
|
||||
/**
|
||||
* Pos.permission_pos
|
||||
*/
|
||||
export type Pos$permission_posArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
|
||||
/**
|
||||
* Select specific fields to fetch from the PermissionPos
|
||||
*/
|
||||
select?: Prisma.PermissionPosSelect<ExtArgs> | null
|
||||
/**
|
||||
* Omit specific fields from the PermissionPos
|
||||
*/
|
||||
omit?: Prisma.PermissionPosOmit<ExtArgs> | null
|
||||
/**
|
||||
* Choose, which related nodes to fetch as well
|
||||
*/
|
||||
include?: Prisma.PermissionPosInclude<ExtArgs> | null
|
||||
where?: Prisma.PermissionPosWhereInput
|
||||
orderBy?: Prisma.PermissionPosOrderByWithRelationInput | Prisma.PermissionPosOrderByWithRelationInput[]
|
||||
cursor?: Prisma.PermissionPosWhereUniqueInput
|
||||
take?: number
|
||||
skip?: number
|
||||
distinct?: Prisma.PermissionPosScalarFieldEnum | Prisma.PermissionPosScalarFieldEnum[]
|
||||
}
|
||||
|
||||
/**
|
||||
* Pos.sales_invoices
|
||||
*/
|
||||
|
||||
@@ -43,6 +43,7 @@ export type SaleInvoiceTspAttemptsMinAggregateOutputType = {
|
||||
received_at: Date | null
|
||||
created_at: Date | null
|
||||
invoice_id: string | null
|
||||
error_message: string | null
|
||||
}
|
||||
|
||||
export type SaleInvoiceTspAttemptsMaxAggregateOutputType = {
|
||||
@@ -54,20 +55,24 @@ export type SaleInvoiceTspAttemptsMaxAggregateOutputType = {
|
||||
received_at: Date | null
|
||||
created_at: Date | null
|
||||
invoice_id: string | null
|
||||
error_message: string | null
|
||||
}
|
||||
|
||||
export type SaleInvoiceTspAttemptsCountAggregateOutputType = {
|
||||
id: number
|
||||
attempt_no: number
|
||||
status: number
|
||||
raw_request_payload: number
|
||||
provider_request_payload: number
|
||||
provider_response_payload: number
|
||||
message: number
|
||||
sent_at: number
|
||||
received_at: number
|
||||
created_at: number
|
||||
invoice_id: number
|
||||
provider_request_payload: number
|
||||
raw_request_payload: number
|
||||
error_message: number
|
||||
fiscal_warnings: number
|
||||
provider_response: number
|
||||
validation_errors: number
|
||||
_all: number
|
||||
}
|
||||
|
||||
@@ -89,6 +94,7 @@ export type SaleInvoiceTspAttemptsMinAggregateInputType = {
|
||||
received_at?: true
|
||||
created_at?: true
|
||||
invoice_id?: true
|
||||
error_message?: true
|
||||
}
|
||||
|
||||
export type SaleInvoiceTspAttemptsMaxAggregateInputType = {
|
||||
@@ -100,20 +106,24 @@ export type SaleInvoiceTspAttemptsMaxAggregateInputType = {
|
||||
received_at?: true
|
||||
created_at?: true
|
||||
invoice_id?: true
|
||||
error_message?: true
|
||||
}
|
||||
|
||||
export type SaleInvoiceTspAttemptsCountAggregateInputType = {
|
||||
id?: true
|
||||
attempt_no?: true
|
||||
status?: true
|
||||
raw_request_payload?: true
|
||||
provider_request_payload?: true
|
||||
provider_response_payload?: true
|
||||
message?: true
|
||||
sent_at?: true
|
||||
received_at?: true
|
||||
created_at?: true
|
||||
invoice_id?: true
|
||||
provider_request_payload?: true
|
||||
raw_request_payload?: true
|
||||
error_message?: true
|
||||
fiscal_warnings?: true
|
||||
provider_response?: true
|
||||
validation_errors?: true
|
||||
_all?: true
|
||||
}
|
||||
|
||||
@@ -207,14 +217,17 @@ export type SaleInvoiceTspAttemptsGroupByOutputType = {
|
||||
id: string
|
||||
attempt_no: number
|
||||
status: $Enums.TspProviderResponseStatus
|
||||
raw_request_payload: runtime.JsonValue
|
||||
provider_request_payload: runtime.JsonValue | null
|
||||
provider_response_payload: runtime.JsonValue | null
|
||||
message: string
|
||||
sent_at: Date | null
|
||||
received_at: Date | null
|
||||
created_at: Date
|
||||
invoice_id: string
|
||||
provider_request_payload: runtime.JsonValue
|
||||
raw_request_payload: runtime.JsonValue
|
||||
error_message: string | null
|
||||
fiscal_warnings: runtime.JsonValue | null
|
||||
provider_response: runtime.JsonValue | null
|
||||
validation_errors: runtime.JsonValue | null
|
||||
_count: SaleInvoiceTspAttemptsCountAggregateOutputType | null
|
||||
_avg: SaleInvoiceTspAttemptsAvgAggregateOutputType | null
|
||||
_sum: SaleInvoiceTspAttemptsSumAggregateOutputType | null
|
||||
@@ -244,14 +257,17 @@ export type SaleInvoiceTspAttemptsWhereInput = {
|
||||
id?: Prisma.StringFilter<"SaleInvoiceTspAttempts"> | string
|
||||
attempt_no?: Prisma.IntFilter<"SaleInvoiceTspAttempts"> | number
|
||||
status?: Prisma.EnumTspProviderResponseStatusFilter<"SaleInvoiceTspAttempts"> | $Enums.TspProviderResponseStatus
|
||||
raw_request_payload?: Prisma.JsonFilter<"SaleInvoiceTspAttempts">
|
||||
provider_request_payload?: Prisma.JsonNullableFilter<"SaleInvoiceTspAttempts">
|
||||
provider_response_payload?: Prisma.JsonNullableFilter<"SaleInvoiceTspAttempts">
|
||||
message?: Prisma.StringFilter<"SaleInvoiceTspAttempts"> | string
|
||||
sent_at?: Prisma.DateTimeNullableFilter<"SaleInvoiceTspAttempts"> | Date | string | null
|
||||
received_at?: Prisma.DateTimeNullableFilter<"SaleInvoiceTspAttempts"> | Date | string | null
|
||||
created_at?: Prisma.DateTimeFilter<"SaleInvoiceTspAttempts"> | Date | string
|
||||
invoice_id?: Prisma.StringFilter<"SaleInvoiceTspAttempts"> | string
|
||||
provider_request_payload?: Prisma.JsonFilter<"SaleInvoiceTspAttempts">
|
||||
raw_request_payload?: Prisma.JsonFilter<"SaleInvoiceTspAttempts">
|
||||
error_message?: Prisma.StringNullableFilter<"SaleInvoiceTspAttempts"> | string | null
|
||||
fiscal_warnings?: Prisma.JsonNullableFilter<"SaleInvoiceTspAttempts">
|
||||
provider_response?: Prisma.JsonNullableFilter<"SaleInvoiceTspAttempts">
|
||||
validation_errors?: Prisma.JsonNullableFilter<"SaleInvoiceTspAttempts">
|
||||
invoice?: Prisma.XOR<Prisma.SalesInvoiceScalarRelationFilter, Prisma.SalesInvoiceWhereInput>
|
||||
}
|
||||
|
||||
@@ -259,14 +275,17 @@ export type SaleInvoiceTspAttemptsOrderByWithRelationInput = {
|
||||
id?: Prisma.SortOrder
|
||||
attempt_no?: Prisma.SortOrder
|
||||
status?: Prisma.SortOrder
|
||||
raw_request_payload?: Prisma.SortOrder
|
||||
provider_request_payload?: Prisma.SortOrderInput | Prisma.SortOrder
|
||||
provider_response_payload?: Prisma.SortOrderInput | Prisma.SortOrder
|
||||
message?: Prisma.SortOrder
|
||||
sent_at?: Prisma.SortOrderInput | Prisma.SortOrder
|
||||
received_at?: Prisma.SortOrderInput | Prisma.SortOrder
|
||||
created_at?: Prisma.SortOrder
|
||||
invoice_id?: Prisma.SortOrder
|
||||
provider_request_payload?: Prisma.SortOrder
|
||||
raw_request_payload?: Prisma.SortOrder
|
||||
error_message?: Prisma.SortOrderInput | Prisma.SortOrder
|
||||
fiscal_warnings?: Prisma.SortOrderInput | Prisma.SortOrder
|
||||
provider_response?: Prisma.SortOrderInput | Prisma.SortOrder
|
||||
validation_errors?: Prisma.SortOrderInput | Prisma.SortOrder
|
||||
invoice?: Prisma.SalesInvoiceOrderByWithRelationInput
|
||||
_relevance?: Prisma.SaleInvoiceTspAttemptsOrderByRelevanceInput
|
||||
}
|
||||
@@ -279,14 +298,17 @@ export type SaleInvoiceTspAttemptsWhereUniqueInput = Prisma.AtLeast<{
|
||||
NOT?: Prisma.SaleInvoiceTspAttemptsWhereInput | Prisma.SaleInvoiceTspAttemptsWhereInput[]
|
||||
attempt_no?: Prisma.IntFilter<"SaleInvoiceTspAttempts"> | number
|
||||
status?: Prisma.EnumTspProviderResponseStatusFilter<"SaleInvoiceTspAttempts"> | $Enums.TspProviderResponseStatus
|
||||
raw_request_payload?: Prisma.JsonFilter<"SaleInvoiceTspAttempts">
|
||||
provider_request_payload?: Prisma.JsonNullableFilter<"SaleInvoiceTspAttempts">
|
||||
provider_response_payload?: Prisma.JsonNullableFilter<"SaleInvoiceTspAttempts">
|
||||
message?: Prisma.StringFilter<"SaleInvoiceTspAttempts"> | string
|
||||
sent_at?: Prisma.DateTimeNullableFilter<"SaleInvoiceTspAttempts"> | Date | string | null
|
||||
received_at?: Prisma.DateTimeNullableFilter<"SaleInvoiceTspAttempts"> | Date | string | null
|
||||
created_at?: Prisma.DateTimeFilter<"SaleInvoiceTspAttempts"> | Date | string
|
||||
invoice_id?: Prisma.StringFilter<"SaleInvoiceTspAttempts"> | string
|
||||
provider_request_payload?: Prisma.JsonFilter<"SaleInvoiceTspAttempts">
|
||||
raw_request_payload?: Prisma.JsonFilter<"SaleInvoiceTspAttempts">
|
||||
error_message?: Prisma.StringNullableFilter<"SaleInvoiceTspAttempts"> | string | null
|
||||
fiscal_warnings?: Prisma.JsonNullableFilter<"SaleInvoiceTspAttempts">
|
||||
provider_response?: Prisma.JsonNullableFilter<"SaleInvoiceTspAttempts">
|
||||
validation_errors?: Prisma.JsonNullableFilter<"SaleInvoiceTspAttempts">
|
||||
invoice?: Prisma.XOR<Prisma.SalesInvoiceScalarRelationFilter, Prisma.SalesInvoiceWhereInput>
|
||||
}, "id" | "invoice_id_attempt_no">
|
||||
|
||||
@@ -294,14 +316,17 @@ export type SaleInvoiceTspAttemptsOrderByWithAggregationInput = {
|
||||
id?: Prisma.SortOrder
|
||||
attempt_no?: Prisma.SortOrder
|
||||
status?: Prisma.SortOrder
|
||||
raw_request_payload?: Prisma.SortOrder
|
||||
provider_request_payload?: Prisma.SortOrderInput | Prisma.SortOrder
|
||||
provider_response_payload?: Prisma.SortOrderInput | Prisma.SortOrder
|
||||
message?: Prisma.SortOrder
|
||||
sent_at?: Prisma.SortOrderInput | Prisma.SortOrder
|
||||
received_at?: Prisma.SortOrderInput | Prisma.SortOrder
|
||||
created_at?: Prisma.SortOrder
|
||||
invoice_id?: Prisma.SortOrder
|
||||
provider_request_payload?: Prisma.SortOrder
|
||||
raw_request_payload?: Prisma.SortOrder
|
||||
error_message?: Prisma.SortOrderInput | Prisma.SortOrder
|
||||
fiscal_warnings?: Prisma.SortOrderInput | Prisma.SortOrder
|
||||
provider_response?: Prisma.SortOrderInput | Prisma.SortOrder
|
||||
validation_errors?: Prisma.SortOrderInput | Prisma.SortOrder
|
||||
_count?: Prisma.SaleInvoiceTspAttemptsCountOrderByAggregateInput
|
||||
_avg?: Prisma.SaleInvoiceTspAttemptsAvgOrderByAggregateInput
|
||||
_max?: Prisma.SaleInvoiceTspAttemptsMaxOrderByAggregateInput
|
||||
@@ -316,27 +341,33 @@ export type SaleInvoiceTspAttemptsScalarWhereWithAggregatesInput = {
|
||||
id?: Prisma.StringWithAggregatesFilter<"SaleInvoiceTspAttempts"> | string
|
||||
attempt_no?: Prisma.IntWithAggregatesFilter<"SaleInvoiceTspAttempts"> | number
|
||||
status?: Prisma.EnumTspProviderResponseStatusWithAggregatesFilter<"SaleInvoiceTspAttempts"> | $Enums.TspProviderResponseStatus
|
||||
raw_request_payload?: Prisma.JsonWithAggregatesFilter<"SaleInvoiceTspAttempts">
|
||||
provider_request_payload?: Prisma.JsonNullableWithAggregatesFilter<"SaleInvoiceTspAttempts">
|
||||
provider_response_payload?: Prisma.JsonNullableWithAggregatesFilter<"SaleInvoiceTspAttempts">
|
||||
message?: Prisma.StringWithAggregatesFilter<"SaleInvoiceTspAttempts"> | string
|
||||
sent_at?: Prisma.DateTimeNullableWithAggregatesFilter<"SaleInvoiceTspAttempts"> | Date | string | null
|
||||
received_at?: Prisma.DateTimeNullableWithAggregatesFilter<"SaleInvoiceTspAttempts"> | Date | string | null
|
||||
created_at?: Prisma.DateTimeWithAggregatesFilter<"SaleInvoiceTspAttempts"> | Date | string
|
||||
invoice_id?: Prisma.StringWithAggregatesFilter<"SaleInvoiceTspAttempts"> | string
|
||||
provider_request_payload?: Prisma.JsonWithAggregatesFilter<"SaleInvoiceTspAttempts">
|
||||
raw_request_payload?: Prisma.JsonWithAggregatesFilter<"SaleInvoiceTspAttempts">
|
||||
error_message?: Prisma.StringNullableWithAggregatesFilter<"SaleInvoiceTspAttempts"> | string | null
|
||||
fiscal_warnings?: Prisma.JsonNullableWithAggregatesFilter<"SaleInvoiceTspAttempts">
|
||||
provider_response?: Prisma.JsonNullableWithAggregatesFilter<"SaleInvoiceTspAttempts">
|
||||
validation_errors?: Prisma.JsonNullableWithAggregatesFilter<"SaleInvoiceTspAttempts">
|
||||
}
|
||||
|
||||
export type SaleInvoiceTspAttemptsCreateInput = {
|
||||
id?: string
|
||||
attempt_no: number
|
||||
status: $Enums.TspProviderResponseStatus
|
||||
raw_request_payload: Prisma.JsonNullValueInput | runtime.InputJsonValue
|
||||
provider_request_payload?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue
|
||||
provider_response_payload?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue
|
||||
message: string
|
||||
sent_at?: Date | string | null
|
||||
received_at?: Date | string | null
|
||||
created_at?: Date | string
|
||||
provider_request_payload: Prisma.JsonNullValueInput | runtime.InputJsonValue
|
||||
raw_request_payload: Prisma.JsonNullValueInput | runtime.InputJsonValue
|
||||
error_message?: string | null
|
||||
fiscal_warnings?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue
|
||||
provider_response?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue
|
||||
validation_errors?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue
|
||||
invoice: Prisma.SalesInvoiceCreateNestedOneWithoutTsp_attemptsInput
|
||||
}
|
||||
|
||||
@@ -344,27 +375,33 @@ export type SaleInvoiceTspAttemptsUncheckedCreateInput = {
|
||||
id?: string
|
||||
attempt_no: number
|
||||
status: $Enums.TspProviderResponseStatus
|
||||
raw_request_payload: Prisma.JsonNullValueInput | runtime.InputJsonValue
|
||||
provider_request_payload?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue
|
||||
provider_response_payload?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue
|
||||
message: string
|
||||
sent_at?: Date | string | null
|
||||
received_at?: Date | string | null
|
||||
created_at?: Date | string
|
||||
invoice_id: string
|
||||
provider_request_payload: Prisma.JsonNullValueInput | runtime.InputJsonValue
|
||||
raw_request_payload: Prisma.JsonNullValueInput | runtime.InputJsonValue
|
||||
error_message?: string | null
|
||||
fiscal_warnings?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue
|
||||
provider_response?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue
|
||||
validation_errors?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue
|
||||
}
|
||||
|
||||
export type SaleInvoiceTspAttemptsUpdateInput = {
|
||||
id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
attempt_no?: Prisma.IntFieldUpdateOperationsInput | number
|
||||
status?: Prisma.EnumTspProviderResponseStatusFieldUpdateOperationsInput | $Enums.TspProviderResponseStatus
|
||||
raw_request_payload?: Prisma.JsonNullValueInput | runtime.InputJsonValue
|
||||
provider_request_payload?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue
|
||||
provider_response_payload?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue
|
||||
message?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
sent_at?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null
|
||||
received_at?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null
|
||||
created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
provider_request_payload?: Prisma.JsonNullValueInput | runtime.InputJsonValue
|
||||
raw_request_payload?: Prisma.JsonNullValueInput | runtime.InputJsonValue
|
||||
error_message?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
fiscal_warnings?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue
|
||||
provider_response?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue
|
||||
validation_errors?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue
|
||||
invoice?: Prisma.SalesInvoiceUpdateOneRequiredWithoutTsp_attemptsNestedInput
|
||||
}
|
||||
|
||||
@@ -372,55 +409,67 @@ export type SaleInvoiceTspAttemptsUncheckedUpdateInput = {
|
||||
id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
attempt_no?: Prisma.IntFieldUpdateOperationsInput | number
|
||||
status?: Prisma.EnumTspProviderResponseStatusFieldUpdateOperationsInput | $Enums.TspProviderResponseStatus
|
||||
raw_request_payload?: Prisma.JsonNullValueInput | runtime.InputJsonValue
|
||||
provider_request_payload?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue
|
||||
provider_response_payload?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue
|
||||
message?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
sent_at?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null
|
||||
received_at?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null
|
||||
created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
invoice_id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
provider_request_payload?: Prisma.JsonNullValueInput | runtime.InputJsonValue
|
||||
raw_request_payload?: Prisma.JsonNullValueInput | runtime.InputJsonValue
|
||||
error_message?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
fiscal_warnings?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue
|
||||
provider_response?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue
|
||||
validation_errors?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue
|
||||
}
|
||||
|
||||
export type SaleInvoiceTspAttemptsCreateManyInput = {
|
||||
id?: string
|
||||
attempt_no: number
|
||||
status: $Enums.TspProviderResponseStatus
|
||||
raw_request_payload: Prisma.JsonNullValueInput | runtime.InputJsonValue
|
||||
provider_request_payload?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue
|
||||
provider_response_payload?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue
|
||||
message: string
|
||||
sent_at?: Date | string | null
|
||||
received_at?: Date | string | null
|
||||
created_at?: Date | string
|
||||
invoice_id: string
|
||||
provider_request_payload: Prisma.JsonNullValueInput | runtime.InputJsonValue
|
||||
raw_request_payload: Prisma.JsonNullValueInput | runtime.InputJsonValue
|
||||
error_message?: string | null
|
||||
fiscal_warnings?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue
|
||||
provider_response?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue
|
||||
validation_errors?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue
|
||||
}
|
||||
|
||||
export type SaleInvoiceTspAttemptsUpdateManyMutationInput = {
|
||||
id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
attempt_no?: Prisma.IntFieldUpdateOperationsInput | number
|
||||
status?: Prisma.EnumTspProviderResponseStatusFieldUpdateOperationsInput | $Enums.TspProviderResponseStatus
|
||||
raw_request_payload?: Prisma.JsonNullValueInput | runtime.InputJsonValue
|
||||
provider_request_payload?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue
|
||||
provider_response_payload?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue
|
||||
message?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
sent_at?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null
|
||||
received_at?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null
|
||||
created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
provider_request_payload?: Prisma.JsonNullValueInput | runtime.InputJsonValue
|
||||
raw_request_payload?: Prisma.JsonNullValueInput | runtime.InputJsonValue
|
||||
error_message?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
fiscal_warnings?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue
|
||||
provider_response?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue
|
||||
validation_errors?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue
|
||||
}
|
||||
|
||||
export type SaleInvoiceTspAttemptsUncheckedUpdateManyInput = {
|
||||
id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
attempt_no?: Prisma.IntFieldUpdateOperationsInput | number
|
||||
status?: Prisma.EnumTspProviderResponseStatusFieldUpdateOperationsInput | $Enums.TspProviderResponseStatus
|
||||
raw_request_payload?: Prisma.JsonNullValueInput | runtime.InputJsonValue
|
||||
provider_request_payload?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue
|
||||
provider_response_payload?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue
|
||||
message?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
sent_at?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null
|
||||
received_at?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null
|
||||
created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
invoice_id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
provider_request_payload?: Prisma.JsonNullValueInput | runtime.InputJsonValue
|
||||
raw_request_payload?: Prisma.JsonNullValueInput | runtime.InputJsonValue
|
||||
error_message?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
fiscal_warnings?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue
|
||||
provider_response?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue
|
||||
validation_errors?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue
|
||||
}
|
||||
|
||||
export type SaleInvoiceTspAttemptsListRelationFilter = {
|
||||
@@ -448,14 +497,17 @@ export type SaleInvoiceTspAttemptsCountOrderByAggregateInput = {
|
||||
id?: Prisma.SortOrder
|
||||
attempt_no?: Prisma.SortOrder
|
||||
status?: Prisma.SortOrder
|
||||
raw_request_payload?: Prisma.SortOrder
|
||||
provider_request_payload?: Prisma.SortOrder
|
||||
provider_response_payload?: Prisma.SortOrder
|
||||
message?: Prisma.SortOrder
|
||||
sent_at?: Prisma.SortOrder
|
||||
received_at?: Prisma.SortOrder
|
||||
created_at?: Prisma.SortOrder
|
||||
invoice_id?: Prisma.SortOrder
|
||||
provider_request_payload?: Prisma.SortOrder
|
||||
raw_request_payload?: Prisma.SortOrder
|
||||
error_message?: Prisma.SortOrder
|
||||
fiscal_warnings?: Prisma.SortOrder
|
||||
provider_response?: Prisma.SortOrder
|
||||
validation_errors?: Prisma.SortOrder
|
||||
}
|
||||
|
||||
export type SaleInvoiceTspAttemptsAvgOrderByAggregateInput = {
|
||||
@@ -471,6 +523,7 @@ export type SaleInvoiceTspAttemptsMaxOrderByAggregateInput = {
|
||||
received_at?: Prisma.SortOrder
|
||||
created_at?: Prisma.SortOrder
|
||||
invoice_id?: Prisma.SortOrder
|
||||
error_message?: Prisma.SortOrder
|
||||
}
|
||||
|
||||
export type SaleInvoiceTspAttemptsMinOrderByAggregateInput = {
|
||||
@@ -482,6 +535,7 @@ export type SaleInvoiceTspAttemptsMinOrderByAggregateInput = {
|
||||
received_at?: Prisma.SortOrder
|
||||
created_at?: Prisma.SortOrder
|
||||
invoice_id?: Prisma.SortOrder
|
||||
error_message?: Prisma.SortOrder
|
||||
}
|
||||
|
||||
export type SaleInvoiceTspAttemptsSumOrderByAggregateInput = {
|
||||
@@ -538,26 +592,32 @@ export type SaleInvoiceTspAttemptsCreateWithoutInvoiceInput = {
|
||||
id?: string
|
||||
attempt_no: number
|
||||
status: $Enums.TspProviderResponseStatus
|
||||
raw_request_payload: Prisma.JsonNullValueInput | runtime.InputJsonValue
|
||||
provider_request_payload?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue
|
||||
provider_response_payload?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue
|
||||
message: string
|
||||
sent_at?: Date | string | null
|
||||
received_at?: Date | string | null
|
||||
created_at?: Date | string
|
||||
provider_request_payload: Prisma.JsonNullValueInput | runtime.InputJsonValue
|
||||
raw_request_payload: Prisma.JsonNullValueInput | runtime.InputJsonValue
|
||||
error_message?: string | null
|
||||
fiscal_warnings?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue
|
||||
provider_response?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue
|
||||
validation_errors?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue
|
||||
}
|
||||
|
||||
export type SaleInvoiceTspAttemptsUncheckedCreateWithoutInvoiceInput = {
|
||||
id?: string
|
||||
attempt_no: number
|
||||
status: $Enums.TspProviderResponseStatus
|
||||
raw_request_payload: Prisma.JsonNullValueInput | runtime.InputJsonValue
|
||||
provider_request_payload?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue
|
||||
provider_response_payload?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue
|
||||
message: string
|
||||
sent_at?: Date | string | null
|
||||
received_at?: Date | string | null
|
||||
created_at?: Date | string
|
||||
provider_request_payload: Prisma.JsonNullValueInput | runtime.InputJsonValue
|
||||
raw_request_payload: Prisma.JsonNullValueInput | runtime.InputJsonValue
|
||||
error_message?: string | null
|
||||
fiscal_warnings?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue
|
||||
provider_response?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue
|
||||
validation_errors?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue
|
||||
}
|
||||
|
||||
export type SaleInvoiceTspAttemptsCreateOrConnectWithoutInvoiceInput = {
|
||||
@@ -593,66 +653,81 @@ export type SaleInvoiceTspAttemptsScalarWhereInput = {
|
||||
id?: Prisma.StringFilter<"SaleInvoiceTspAttempts"> | string
|
||||
attempt_no?: Prisma.IntFilter<"SaleInvoiceTspAttempts"> | number
|
||||
status?: Prisma.EnumTspProviderResponseStatusFilter<"SaleInvoiceTspAttempts"> | $Enums.TspProviderResponseStatus
|
||||
raw_request_payload?: Prisma.JsonFilter<"SaleInvoiceTspAttempts">
|
||||
provider_request_payload?: Prisma.JsonNullableFilter<"SaleInvoiceTspAttempts">
|
||||
provider_response_payload?: Prisma.JsonNullableFilter<"SaleInvoiceTspAttempts">
|
||||
message?: Prisma.StringFilter<"SaleInvoiceTspAttempts"> | string
|
||||
sent_at?: Prisma.DateTimeNullableFilter<"SaleInvoiceTspAttempts"> | Date | string | null
|
||||
received_at?: Prisma.DateTimeNullableFilter<"SaleInvoiceTspAttempts"> | Date | string | null
|
||||
created_at?: Prisma.DateTimeFilter<"SaleInvoiceTspAttempts"> | Date | string
|
||||
invoice_id?: Prisma.StringFilter<"SaleInvoiceTspAttempts"> | string
|
||||
provider_request_payload?: Prisma.JsonFilter<"SaleInvoiceTspAttempts">
|
||||
raw_request_payload?: Prisma.JsonFilter<"SaleInvoiceTspAttempts">
|
||||
error_message?: Prisma.StringNullableFilter<"SaleInvoiceTspAttempts"> | string | null
|
||||
fiscal_warnings?: Prisma.JsonNullableFilter<"SaleInvoiceTspAttempts">
|
||||
provider_response?: Prisma.JsonNullableFilter<"SaleInvoiceTspAttempts">
|
||||
validation_errors?: Prisma.JsonNullableFilter<"SaleInvoiceTspAttempts">
|
||||
}
|
||||
|
||||
export type SaleInvoiceTspAttemptsCreateManyInvoiceInput = {
|
||||
id?: string
|
||||
attempt_no: number
|
||||
status: $Enums.TspProviderResponseStatus
|
||||
raw_request_payload: Prisma.JsonNullValueInput | runtime.InputJsonValue
|
||||
provider_request_payload?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue
|
||||
provider_response_payload?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue
|
||||
message: string
|
||||
sent_at?: Date | string | null
|
||||
received_at?: Date | string | null
|
||||
created_at?: Date | string
|
||||
provider_request_payload: Prisma.JsonNullValueInput | runtime.InputJsonValue
|
||||
raw_request_payload: Prisma.JsonNullValueInput | runtime.InputJsonValue
|
||||
error_message?: string | null
|
||||
fiscal_warnings?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue
|
||||
provider_response?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue
|
||||
validation_errors?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue
|
||||
}
|
||||
|
||||
export type SaleInvoiceTspAttemptsUpdateWithoutInvoiceInput = {
|
||||
id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
attempt_no?: Prisma.IntFieldUpdateOperationsInput | number
|
||||
status?: Prisma.EnumTspProviderResponseStatusFieldUpdateOperationsInput | $Enums.TspProviderResponseStatus
|
||||
raw_request_payload?: Prisma.JsonNullValueInput | runtime.InputJsonValue
|
||||
provider_request_payload?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue
|
||||
provider_response_payload?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue
|
||||
message?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
sent_at?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null
|
||||
received_at?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null
|
||||
created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
provider_request_payload?: Prisma.JsonNullValueInput | runtime.InputJsonValue
|
||||
raw_request_payload?: Prisma.JsonNullValueInput | runtime.InputJsonValue
|
||||
error_message?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
fiscal_warnings?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue
|
||||
provider_response?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue
|
||||
validation_errors?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue
|
||||
}
|
||||
|
||||
export type SaleInvoiceTspAttemptsUncheckedUpdateWithoutInvoiceInput = {
|
||||
id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
attempt_no?: Prisma.IntFieldUpdateOperationsInput | number
|
||||
status?: Prisma.EnumTspProviderResponseStatusFieldUpdateOperationsInput | $Enums.TspProviderResponseStatus
|
||||
raw_request_payload?: Prisma.JsonNullValueInput | runtime.InputJsonValue
|
||||
provider_request_payload?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue
|
||||
provider_response_payload?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue
|
||||
message?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
sent_at?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null
|
||||
received_at?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null
|
||||
created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
provider_request_payload?: Prisma.JsonNullValueInput | runtime.InputJsonValue
|
||||
raw_request_payload?: Prisma.JsonNullValueInput | runtime.InputJsonValue
|
||||
error_message?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
fiscal_warnings?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue
|
||||
provider_response?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue
|
||||
validation_errors?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue
|
||||
}
|
||||
|
||||
export type SaleInvoiceTspAttemptsUncheckedUpdateManyWithoutInvoiceInput = {
|
||||
id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
attempt_no?: Prisma.IntFieldUpdateOperationsInput | number
|
||||
status?: Prisma.EnumTspProviderResponseStatusFieldUpdateOperationsInput | $Enums.TspProviderResponseStatus
|
||||
raw_request_payload?: Prisma.JsonNullValueInput | runtime.InputJsonValue
|
||||
provider_request_payload?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue
|
||||
provider_response_payload?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue
|
||||
message?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
sent_at?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null
|
||||
received_at?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null
|
||||
created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
provider_request_payload?: Prisma.JsonNullValueInput | runtime.InputJsonValue
|
||||
raw_request_payload?: Prisma.JsonNullValueInput | runtime.InputJsonValue
|
||||
error_message?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
fiscal_warnings?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue
|
||||
provider_response?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue
|
||||
validation_errors?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue
|
||||
}
|
||||
|
||||
|
||||
@@ -661,14 +736,17 @@ export type SaleInvoiceTspAttemptsSelect<ExtArgs extends runtime.Types.Extension
|
||||
id?: boolean
|
||||
attempt_no?: boolean
|
||||
status?: boolean
|
||||
raw_request_payload?: boolean
|
||||
provider_request_payload?: boolean
|
||||
provider_response_payload?: boolean
|
||||
message?: boolean
|
||||
sent_at?: boolean
|
||||
received_at?: boolean
|
||||
created_at?: boolean
|
||||
invoice_id?: boolean
|
||||
provider_request_payload?: boolean
|
||||
raw_request_payload?: boolean
|
||||
error_message?: boolean
|
||||
fiscal_warnings?: boolean
|
||||
provider_response?: boolean
|
||||
validation_errors?: boolean
|
||||
invoice?: boolean | Prisma.SalesInvoiceDefaultArgs<ExtArgs>
|
||||
}, ExtArgs["result"]["saleInvoiceTspAttempts"]>
|
||||
|
||||
@@ -678,17 +756,20 @@ export type SaleInvoiceTspAttemptsSelectScalar = {
|
||||
id?: boolean
|
||||
attempt_no?: boolean
|
||||
status?: boolean
|
||||
raw_request_payload?: boolean
|
||||
provider_request_payload?: boolean
|
||||
provider_response_payload?: boolean
|
||||
message?: boolean
|
||||
sent_at?: boolean
|
||||
received_at?: boolean
|
||||
created_at?: boolean
|
||||
invoice_id?: boolean
|
||||
provider_request_payload?: boolean
|
||||
raw_request_payload?: boolean
|
||||
error_message?: boolean
|
||||
fiscal_warnings?: boolean
|
||||
provider_response?: boolean
|
||||
validation_errors?: boolean
|
||||
}
|
||||
|
||||
export type SaleInvoiceTspAttemptsOmit<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetOmit<"id" | "attempt_no" | "status" | "raw_request_payload" | "provider_request_payload" | "provider_response_payload" | "message" | "sent_at" | "received_at" | "created_at" | "invoice_id", ExtArgs["result"]["saleInvoiceTspAttempts"]>
|
||||
export type SaleInvoiceTspAttemptsOmit<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetOmit<"id" | "attempt_no" | "status" | "message" | "sent_at" | "received_at" | "created_at" | "invoice_id" | "provider_request_payload" | "raw_request_payload" | "error_message" | "fiscal_warnings" | "provider_response" | "validation_errors", ExtArgs["result"]["saleInvoiceTspAttempts"]>
|
||||
export type SaleInvoiceTspAttemptsInclude<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
|
||||
invoice?: boolean | Prisma.SalesInvoiceDefaultArgs<ExtArgs>
|
||||
}
|
||||
@@ -702,14 +783,17 @@ export type $SaleInvoiceTspAttemptsPayload<ExtArgs extends runtime.Types.Extensi
|
||||
id: string
|
||||
attempt_no: number
|
||||
status: $Enums.TspProviderResponseStatus
|
||||
raw_request_payload: runtime.JsonValue
|
||||
provider_request_payload: runtime.JsonValue | null
|
||||
provider_response_payload: runtime.JsonValue | null
|
||||
message: string
|
||||
sent_at: Date | null
|
||||
received_at: Date | null
|
||||
created_at: Date
|
||||
invoice_id: string
|
||||
provider_request_payload: runtime.JsonValue
|
||||
raw_request_payload: runtime.JsonValue
|
||||
error_message: string | null
|
||||
fiscal_warnings: runtime.JsonValue | null
|
||||
provider_response: runtime.JsonValue | null
|
||||
validation_errors: runtime.JsonValue | null
|
||||
}, ExtArgs["result"]["saleInvoiceTspAttempts"]>
|
||||
composites: {}
|
||||
}
|
||||
@@ -1083,14 +1167,17 @@ export interface SaleInvoiceTspAttemptsFieldRefs {
|
||||
readonly id: Prisma.FieldRef<"SaleInvoiceTspAttempts", 'String'>
|
||||
readonly attempt_no: Prisma.FieldRef<"SaleInvoiceTspAttempts", 'Int'>
|
||||
readonly status: Prisma.FieldRef<"SaleInvoiceTspAttempts", 'TspProviderResponseStatus'>
|
||||
readonly raw_request_payload: Prisma.FieldRef<"SaleInvoiceTspAttempts", 'Json'>
|
||||
readonly provider_request_payload: Prisma.FieldRef<"SaleInvoiceTspAttempts", 'Json'>
|
||||
readonly provider_response_payload: Prisma.FieldRef<"SaleInvoiceTspAttempts", 'Json'>
|
||||
readonly message: Prisma.FieldRef<"SaleInvoiceTspAttempts", 'String'>
|
||||
readonly sent_at: Prisma.FieldRef<"SaleInvoiceTspAttempts", 'DateTime'>
|
||||
readonly received_at: Prisma.FieldRef<"SaleInvoiceTspAttempts", 'DateTime'>
|
||||
readonly created_at: Prisma.FieldRef<"SaleInvoiceTspAttempts", 'DateTime'>
|
||||
readonly invoice_id: Prisma.FieldRef<"SaleInvoiceTspAttempts", 'String'>
|
||||
readonly provider_request_payload: Prisma.FieldRef<"SaleInvoiceTspAttempts", 'Json'>
|
||||
readonly raw_request_payload: Prisma.FieldRef<"SaleInvoiceTspAttempts", 'Json'>
|
||||
readonly error_message: Prisma.FieldRef<"SaleInvoiceTspAttempts", 'String'>
|
||||
readonly fiscal_warnings: Prisma.FieldRef<"SaleInvoiceTspAttempts", 'Json'>
|
||||
readonly provider_response: Prisma.FieldRef<"SaleInvoiceTspAttempts", 'Json'>
|
||||
readonly validation_errors: Prisma.FieldRef<"SaleInvoiceTspAttempts", 'Json'>
|
||||
}
|
||||
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -32,6 +32,8 @@ export type SalesInvoiceItemAvgAggregateOutputType = {
|
||||
unit_price: runtime.Decimal | null
|
||||
total_amount: runtime.Decimal | null
|
||||
discount: runtime.Decimal | null
|
||||
discount_amount: runtime.Decimal | null
|
||||
tax_amount: runtime.Decimal | null
|
||||
}
|
||||
|
||||
export type SalesInvoiceItemSumAggregateOutputType = {
|
||||
@@ -40,6 +42,8 @@ export type SalesInvoiceItemSumAggregateOutputType = {
|
||||
unit_price: runtime.Decimal | null
|
||||
total_amount: runtime.Decimal | null
|
||||
discount: runtime.Decimal | null
|
||||
discount_amount: runtime.Decimal | null
|
||||
tax_amount: runtime.Decimal | null
|
||||
}
|
||||
|
||||
export type SalesInvoiceItemMinAggregateOutputType = {
|
||||
@@ -57,6 +61,8 @@ export type SalesInvoiceItemMinAggregateOutputType = {
|
||||
invoice_id: string | null
|
||||
good_id: string | null
|
||||
service_id: string | null
|
||||
discount_amount: runtime.Decimal | null
|
||||
tax_amount: runtime.Decimal | null
|
||||
}
|
||||
|
||||
export type SalesInvoiceItemMaxAggregateOutputType = {
|
||||
@@ -74,6 +80,8 @@ export type SalesInvoiceItemMaxAggregateOutputType = {
|
||||
invoice_id: string | null
|
||||
good_id: string | null
|
||||
service_id: string | null
|
||||
discount_amount: runtime.Decimal | null
|
||||
tax_amount: runtime.Decimal | null
|
||||
}
|
||||
|
||||
export type SalesInvoiceItemCountAggregateOutputType = {
|
||||
@@ -93,6 +101,8 @@ export type SalesInvoiceItemCountAggregateOutputType = {
|
||||
invoice_id: number
|
||||
good_id: number
|
||||
service_id: number
|
||||
discount_amount: number
|
||||
tax_amount: number
|
||||
_all: number
|
||||
}
|
||||
|
||||
@@ -103,6 +113,8 @@ export type SalesInvoiceItemAvgAggregateInputType = {
|
||||
unit_price?: true
|
||||
total_amount?: true
|
||||
discount?: true
|
||||
discount_amount?: true
|
||||
tax_amount?: true
|
||||
}
|
||||
|
||||
export type SalesInvoiceItemSumAggregateInputType = {
|
||||
@@ -111,6 +123,8 @@ export type SalesInvoiceItemSumAggregateInputType = {
|
||||
unit_price?: true
|
||||
total_amount?: true
|
||||
discount?: true
|
||||
discount_amount?: true
|
||||
tax_amount?: true
|
||||
}
|
||||
|
||||
export type SalesInvoiceItemMinAggregateInputType = {
|
||||
@@ -128,6 +142,8 @@ export type SalesInvoiceItemMinAggregateInputType = {
|
||||
invoice_id?: true
|
||||
good_id?: true
|
||||
service_id?: true
|
||||
discount_amount?: true
|
||||
tax_amount?: true
|
||||
}
|
||||
|
||||
export type SalesInvoiceItemMaxAggregateInputType = {
|
||||
@@ -145,6 +161,8 @@ export type SalesInvoiceItemMaxAggregateInputType = {
|
||||
invoice_id?: true
|
||||
good_id?: true
|
||||
service_id?: true
|
||||
discount_amount?: true
|
||||
tax_amount?: true
|
||||
}
|
||||
|
||||
export type SalesInvoiceItemCountAggregateInputType = {
|
||||
@@ -164,6 +182,8 @@ export type SalesInvoiceItemCountAggregateInputType = {
|
||||
invoice_id?: true
|
||||
good_id?: true
|
||||
service_id?: true
|
||||
discount_amount?: true
|
||||
tax_amount?: true
|
||||
_all?: true
|
||||
}
|
||||
|
||||
@@ -270,6 +290,8 @@ export type SalesInvoiceItemGroupByOutputType = {
|
||||
invoice_id: string
|
||||
good_id: string
|
||||
service_id: string | null
|
||||
discount_amount: runtime.Decimal | null
|
||||
tax_amount: runtime.Decimal | null
|
||||
_count: SalesInvoiceItemCountAggregateOutputType | null
|
||||
_avg: SalesInvoiceItemAvgAggregateOutputType | null
|
||||
_sum: SalesInvoiceItemSumAggregateOutputType | null
|
||||
@@ -312,8 +334,10 @@ export type SalesInvoiceItemWhereInput = {
|
||||
invoice_id?: Prisma.StringFilter<"SalesInvoiceItem"> | string
|
||||
good_id?: Prisma.StringFilter<"SalesInvoiceItem"> | string
|
||||
service_id?: Prisma.StringNullableFilter<"SalesInvoiceItem"> | string | null
|
||||
invoice?: Prisma.XOR<Prisma.SalesInvoiceScalarRelationFilter, Prisma.SalesInvoiceWhereInput>
|
||||
discount_amount?: Prisma.DecimalNullableFilter<"SalesInvoiceItem"> | runtime.Decimal | runtime.DecimalJsLike | number | string | null
|
||||
tax_amount?: Prisma.DecimalNullableFilter<"SalesInvoiceItem"> | runtime.Decimal | runtime.DecimalJsLike | number | string | null
|
||||
good?: Prisma.XOR<Prisma.GoodScalarRelationFilter, Prisma.GoodWhereInput>
|
||||
invoice?: Prisma.XOR<Prisma.SalesInvoiceScalarRelationFilter, Prisma.SalesInvoiceWhereInput>
|
||||
service?: Prisma.XOR<Prisma.ServiceNullableScalarRelationFilter, Prisma.ServiceWhereInput> | null
|
||||
}
|
||||
|
||||
@@ -334,8 +358,10 @@ export type SalesInvoiceItemOrderByWithRelationInput = {
|
||||
invoice_id?: Prisma.SortOrder
|
||||
good_id?: Prisma.SortOrder
|
||||
service_id?: Prisma.SortOrderInput | Prisma.SortOrder
|
||||
invoice?: Prisma.SalesInvoiceOrderByWithRelationInput
|
||||
discount_amount?: Prisma.SortOrderInput | Prisma.SortOrder
|
||||
tax_amount?: Prisma.SortOrderInput | Prisma.SortOrder
|
||||
good?: Prisma.GoodOrderByWithRelationInput
|
||||
invoice?: Prisma.SalesInvoiceOrderByWithRelationInput
|
||||
service?: Prisma.ServiceOrderByWithRelationInput
|
||||
_relevance?: Prisma.SalesInvoiceItemOrderByRelevanceInput
|
||||
}
|
||||
@@ -360,8 +386,10 @@ export type SalesInvoiceItemWhereUniqueInput = Prisma.AtLeast<{
|
||||
invoice_id?: Prisma.StringFilter<"SalesInvoiceItem"> | string
|
||||
good_id?: Prisma.StringFilter<"SalesInvoiceItem"> | string
|
||||
service_id?: Prisma.StringNullableFilter<"SalesInvoiceItem"> | string | null
|
||||
invoice?: Prisma.XOR<Prisma.SalesInvoiceScalarRelationFilter, Prisma.SalesInvoiceWhereInput>
|
||||
discount_amount?: Prisma.DecimalNullableFilter<"SalesInvoiceItem"> | runtime.Decimal | runtime.DecimalJsLike | number | string | null
|
||||
tax_amount?: Prisma.DecimalNullableFilter<"SalesInvoiceItem"> | runtime.Decimal | runtime.DecimalJsLike | number | string | null
|
||||
good?: Prisma.XOR<Prisma.GoodScalarRelationFilter, Prisma.GoodWhereInput>
|
||||
invoice?: Prisma.XOR<Prisma.SalesInvoiceScalarRelationFilter, Prisma.SalesInvoiceWhereInput>
|
||||
service?: Prisma.XOR<Prisma.ServiceNullableScalarRelationFilter, Prisma.ServiceWhereInput> | null
|
||||
}, "id">
|
||||
|
||||
@@ -382,6 +410,8 @@ export type SalesInvoiceItemOrderByWithAggregationInput = {
|
||||
invoice_id?: Prisma.SortOrder
|
||||
good_id?: Prisma.SortOrder
|
||||
service_id?: Prisma.SortOrderInput | Prisma.SortOrder
|
||||
discount_amount?: Prisma.SortOrderInput | Prisma.SortOrder
|
||||
tax_amount?: Prisma.SortOrderInput | Prisma.SortOrder
|
||||
_count?: Prisma.SalesInvoiceItemCountOrderByAggregateInput
|
||||
_avg?: Prisma.SalesInvoiceItemAvgOrderByAggregateInput
|
||||
_max?: Prisma.SalesInvoiceItemMaxOrderByAggregateInput
|
||||
@@ -409,6 +439,8 @@ export type SalesInvoiceItemScalarWhereWithAggregatesInput = {
|
||||
invoice_id?: Prisma.StringWithAggregatesFilter<"SalesInvoiceItem"> | string
|
||||
good_id?: Prisma.StringWithAggregatesFilter<"SalesInvoiceItem"> | string
|
||||
service_id?: Prisma.StringNullableWithAggregatesFilter<"SalesInvoiceItem"> | string | null
|
||||
discount_amount?: Prisma.DecimalNullableWithAggregatesFilter<"SalesInvoiceItem"> | runtime.Decimal | runtime.DecimalJsLike | number | string | null
|
||||
tax_amount?: Prisma.DecimalNullableWithAggregatesFilter<"SalesInvoiceItem"> | runtime.Decimal | runtime.DecimalJsLike | number | string | null
|
||||
}
|
||||
|
||||
export type SalesInvoiceItemCreateInput = {
|
||||
@@ -425,8 +457,10 @@ export type SalesInvoiceItemCreateInput = {
|
||||
notes?: string | null
|
||||
payload?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue
|
||||
good_snapshot: Prisma.JsonNullValueInput | runtime.InputJsonValue
|
||||
invoice: Prisma.SalesInvoiceCreateNestedOneWithoutItemsInput
|
||||
discount_amount?: runtime.Decimal | runtime.DecimalJsLike | number | string | null
|
||||
tax_amount?: runtime.Decimal | runtime.DecimalJsLike | number | string | null
|
||||
good: Prisma.GoodCreateNestedOneWithoutSales_invoice_itemsInput
|
||||
invoice: Prisma.SalesInvoiceCreateNestedOneWithoutItemsInput
|
||||
service?: Prisma.ServiceCreateNestedOneWithoutSales_invoice_itemsInput
|
||||
}
|
||||
|
||||
@@ -447,6 +481,8 @@ export type SalesInvoiceItemUncheckedCreateInput = {
|
||||
invoice_id: string
|
||||
good_id: string
|
||||
service_id?: string | null
|
||||
discount_amount?: runtime.Decimal | runtime.DecimalJsLike | number | string | null
|
||||
tax_amount?: runtime.Decimal | runtime.DecimalJsLike | number | string | null
|
||||
}
|
||||
|
||||
export type SalesInvoiceItemUpdateInput = {
|
||||
@@ -463,8 +499,10 @@ export type SalesInvoiceItemUpdateInput = {
|
||||
notes?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
payload?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue
|
||||
good_snapshot?: Prisma.JsonNullValueInput | runtime.InputJsonValue
|
||||
invoice?: Prisma.SalesInvoiceUpdateOneRequiredWithoutItemsNestedInput
|
||||
discount_amount?: Prisma.NullableDecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string | null
|
||||
tax_amount?: Prisma.NullableDecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string | null
|
||||
good?: Prisma.GoodUpdateOneRequiredWithoutSales_invoice_itemsNestedInput
|
||||
invoice?: Prisma.SalesInvoiceUpdateOneRequiredWithoutItemsNestedInput
|
||||
service?: Prisma.ServiceUpdateOneWithoutSales_invoice_itemsNestedInput
|
||||
}
|
||||
|
||||
@@ -485,6 +523,8 @@ export type SalesInvoiceItemUncheckedUpdateInput = {
|
||||
invoice_id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
good_id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
service_id?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
discount_amount?: Prisma.NullableDecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string | null
|
||||
tax_amount?: Prisma.NullableDecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string | null
|
||||
}
|
||||
|
||||
export type SalesInvoiceItemCreateManyInput = {
|
||||
@@ -504,6 +544,8 @@ export type SalesInvoiceItemCreateManyInput = {
|
||||
invoice_id: string
|
||||
good_id: string
|
||||
service_id?: string | null
|
||||
discount_amount?: runtime.Decimal | runtime.DecimalJsLike | number | string | null
|
||||
tax_amount?: runtime.Decimal | runtime.DecimalJsLike | number | string | null
|
||||
}
|
||||
|
||||
export type SalesInvoiceItemUpdateManyMutationInput = {
|
||||
@@ -520,6 +562,8 @@ export type SalesInvoiceItemUpdateManyMutationInput = {
|
||||
notes?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
payload?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue
|
||||
good_snapshot?: Prisma.JsonNullValueInput | runtime.InputJsonValue
|
||||
discount_amount?: Prisma.NullableDecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string | null
|
||||
tax_amount?: Prisma.NullableDecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string | null
|
||||
}
|
||||
|
||||
export type SalesInvoiceItemUncheckedUpdateManyInput = {
|
||||
@@ -539,6 +583,8 @@ export type SalesInvoiceItemUncheckedUpdateManyInput = {
|
||||
invoice_id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
good_id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
service_id?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
discount_amount?: Prisma.NullableDecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string | null
|
||||
tax_amount?: Prisma.NullableDecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string | null
|
||||
}
|
||||
|
||||
export type SalesInvoiceItemListRelationFilter = {
|
||||
@@ -574,6 +620,8 @@ export type SalesInvoiceItemCountOrderByAggregateInput = {
|
||||
invoice_id?: Prisma.SortOrder
|
||||
good_id?: Prisma.SortOrder
|
||||
service_id?: Prisma.SortOrder
|
||||
discount_amount?: Prisma.SortOrder
|
||||
tax_amount?: Prisma.SortOrder
|
||||
}
|
||||
|
||||
export type SalesInvoiceItemAvgOrderByAggregateInput = {
|
||||
@@ -582,6 +630,8 @@ export type SalesInvoiceItemAvgOrderByAggregateInput = {
|
||||
unit_price?: Prisma.SortOrder
|
||||
total_amount?: Prisma.SortOrder
|
||||
discount?: Prisma.SortOrder
|
||||
discount_amount?: Prisma.SortOrder
|
||||
tax_amount?: Prisma.SortOrder
|
||||
}
|
||||
|
||||
export type SalesInvoiceItemMaxOrderByAggregateInput = {
|
||||
@@ -599,6 +649,8 @@ export type SalesInvoiceItemMaxOrderByAggregateInput = {
|
||||
invoice_id?: Prisma.SortOrder
|
||||
good_id?: Prisma.SortOrder
|
||||
service_id?: Prisma.SortOrder
|
||||
discount_amount?: Prisma.SortOrder
|
||||
tax_amount?: Prisma.SortOrder
|
||||
}
|
||||
|
||||
export type SalesInvoiceItemMinOrderByAggregateInput = {
|
||||
@@ -616,6 +668,8 @@ export type SalesInvoiceItemMinOrderByAggregateInput = {
|
||||
invoice_id?: Prisma.SortOrder
|
||||
good_id?: Prisma.SortOrder
|
||||
service_id?: Prisma.SortOrder
|
||||
discount_amount?: Prisma.SortOrder
|
||||
tax_amount?: Prisma.SortOrder
|
||||
}
|
||||
|
||||
export type SalesInvoiceItemSumOrderByAggregateInput = {
|
||||
@@ -624,6 +678,8 @@ export type SalesInvoiceItemSumOrderByAggregateInput = {
|
||||
unit_price?: Prisma.SortOrder
|
||||
total_amount?: Prisma.SortOrder
|
||||
discount?: Prisma.SortOrder
|
||||
discount_amount?: Prisma.SortOrder
|
||||
tax_amount?: Prisma.SortOrder
|
||||
}
|
||||
|
||||
export type SalesInvoiceItemCreateNestedManyWithoutGoodInput = {
|
||||
@@ -766,6 +822,8 @@ export type SalesInvoiceItemCreateWithoutGoodInput = {
|
||||
notes?: string | null
|
||||
payload?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue
|
||||
good_snapshot: Prisma.JsonNullValueInput | runtime.InputJsonValue
|
||||
discount_amount?: runtime.Decimal | runtime.DecimalJsLike | number | string | null
|
||||
tax_amount?: runtime.Decimal | runtime.DecimalJsLike | number | string | null
|
||||
invoice: Prisma.SalesInvoiceCreateNestedOneWithoutItemsInput
|
||||
service?: Prisma.ServiceCreateNestedOneWithoutSales_invoice_itemsInput
|
||||
}
|
||||
@@ -786,6 +844,8 @@ export type SalesInvoiceItemUncheckedCreateWithoutGoodInput = {
|
||||
good_snapshot: Prisma.JsonNullValueInput | runtime.InputJsonValue
|
||||
invoice_id: string
|
||||
service_id?: string | null
|
||||
discount_amount?: runtime.Decimal | runtime.DecimalJsLike | number | string | null
|
||||
tax_amount?: runtime.Decimal | runtime.DecimalJsLike | number | string | null
|
||||
}
|
||||
|
||||
export type SalesInvoiceItemCreateOrConnectWithoutGoodInput = {
|
||||
@@ -834,6 +894,8 @@ export type SalesInvoiceItemScalarWhereInput = {
|
||||
invoice_id?: Prisma.StringFilter<"SalesInvoiceItem"> | string
|
||||
good_id?: Prisma.StringFilter<"SalesInvoiceItem"> | string
|
||||
service_id?: Prisma.StringNullableFilter<"SalesInvoiceItem"> | string | null
|
||||
discount_amount?: Prisma.DecimalNullableFilter<"SalesInvoiceItem"> | runtime.Decimal | runtime.DecimalJsLike | number | string | null
|
||||
tax_amount?: Prisma.DecimalNullableFilter<"SalesInvoiceItem"> | runtime.Decimal | runtime.DecimalJsLike | number | string | null
|
||||
}
|
||||
|
||||
export type SalesInvoiceItemCreateWithoutInvoiceInput = {
|
||||
@@ -850,6 +912,8 @@ export type SalesInvoiceItemCreateWithoutInvoiceInput = {
|
||||
notes?: string | null
|
||||
payload?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue
|
||||
good_snapshot: Prisma.JsonNullValueInput | runtime.InputJsonValue
|
||||
discount_amount?: runtime.Decimal | runtime.DecimalJsLike | number | string | null
|
||||
tax_amount?: runtime.Decimal | runtime.DecimalJsLike | number | string | null
|
||||
good: Prisma.GoodCreateNestedOneWithoutSales_invoice_itemsInput
|
||||
service?: Prisma.ServiceCreateNestedOneWithoutSales_invoice_itemsInput
|
||||
}
|
||||
@@ -870,6 +934,8 @@ export type SalesInvoiceItemUncheckedCreateWithoutInvoiceInput = {
|
||||
good_snapshot: Prisma.JsonNullValueInput | runtime.InputJsonValue
|
||||
good_id: string
|
||||
service_id?: string | null
|
||||
discount_amount?: runtime.Decimal | runtime.DecimalJsLike | number | string | null
|
||||
tax_amount?: runtime.Decimal | runtime.DecimalJsLike | number | string | null
|
||||
}
|
||||
|
||||
export type SalesInvoiceItemCreateOrConnectWithoutInvoiceInput = {
|
||||
@@ -912,8 +978,10 @@ export type SalesInvoiceItemCreateWithoutServiceInput = {
|
||||
notes?: string | null
|
||||
payload?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue
|
||||
good_snapshot: Prisma.JsonNullValueInput | runtime.InputJsonValue
|
||||
invoice: Prisma.SalesInvoiceCreateNestedOneWithoutItemsInput
|
||||
discount_amount?: runtime.Decimal | runtime.DecimalJsLike | number | string | null
|
||||
tax_amount?: runtime.Decimal | runtime.DecimalJsLike | number | string | null
|
||||
good: Prisma.GoodCreateNestedOneWithoutSales_invoice_itemsInput
|
||||
invoice: Prisma.SalesInvoiceCreateNestedOneWithoutItemsInput
|
||||
}
|
||||
|
||||
export type SalesInvoiceItemUncheckedCreateWithoutServiceInput = {
|
||||
@@ -932,6 +1000,8 @@ export type SalesInvoiceItemUncheckedCreateWithoutServiceInput = {
|
||||
good_snapshot: Prisma.JsonNullValueInput | runtime.InputJsonValue
|
||||
invoice_id: string
|
||||
good_id: string
|
||||
discount_amount?: runtime.Decimal | runtime.DecimalJsLike | number | string | null
|
||||
tax_amount?: runtime.Decimal | runtime.DecimalJsLike | number | string | null
|
||||
}
|
||||
|
||||
export type SalesInvoiceItemCreateOrConnectWithoutServiceInput = {
|
||||
@@ -976,6 +1046,8 @@ export type SalesInvoiceItemCreateManyGoodInput = {
|
||||
good_snapshot: Prisma.JsonNullValueInput | runtime.InputJsonValue
|
||||
invoice_id: string
|
||||
service_id?: string | null
|
||||
discount_amount?: runtime.Decimal | runtime.DecimalJsLike | number | string | null
|
||||
tax_amount?: runtime.Decimal | runtime.DecimalJsLike | number | string | null
|
||||
}
|
||||
|
||||
export type SalesInvoiceItemUpdateWithoutGoodInput = {
|
||||
@@ -992,6 +1064,8 @@ export type SalesInvoiceItemUpdateWithoutGoodInput = {
|
||||
notes?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
payload?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue
|
||||
good_snapshot?: Prisma.JsonNullValueInput | runtime.InputJsonValue
|
||||
discount_amount?: Prisma.NullableDecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string | null
|
||||
tax_amount?: Prisma.NullableDecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string | null
|
||||
invoice?: Prisma.SalesInvoiceUpdateOneRequiredWithoutItemsNestedInput
|
||||
service?: Prisma.ServiceUpdateOneWithoutSales_invoice_itemsNestedInput
|
||||
}
|
||||
@@ -1012,6 +1086,8 @@ export type SalesInvoiceItemUncheckedUpdateWithoutGoodInput = {
|
||||
good_snapshot?: Prisma.JsonNullValueInput | runtime.InputJsonValue
|
||||
invoice_id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
service_id?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
discount_amount?: Prisma.NullableDecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string | null
|
||||
tax_amount?: Prisma.NullableDecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string | null
|
||||
}
|
||||
|
||||
export type SalesInvoiceItemUncheckedUpdateManyWithoutGoodInput = {
|
||||
@@ -1030,6 +1106,8 @@ export type SalesInvoiceItemUncheckedUpdateManyWithoutGoodInput = {
|
||||
good_snapshot?: Prisma.JsonNullValueInput | runtime.InputJsonValue
|
||||
invoice_id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
service_id?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
discount_amount?: Prisma.NullableDecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string | null
|
||||
tax_amount?: Prisma.NullableDecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string | null
|
||||
}
|
||||
|
||||
export type SalesInvoiceItemCreateManyInvoiceInput = {
|
||||
@@ -1048,6 +1126,8 @@ export type SalesInvoiceItemCreateManyInvoiceInput = {
|
||||
good_snapshot: Prisma.JsonNullValueInput | runtime.InputJsonValue
|
||||
good_id: string
|
||||
service_id?: string | null
|
||||
discount_amount?: runtime.Decimal | runtime.DecimalJsLike | number | string | null
|
||||
tax_amount?: runtime.Decimal | runtime.DecimalJsLike | number | string | null
|
||||
}
|
||||
|
||||
export type SalesInvoiceItemUpdateWithoutInvoiceInput = {
|
||||
@@ -1064,6 +1144,8 @@ export type SalesInvoiceItemUpdateWithoutInvoiceInput = {
|
||||
notes?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
payload?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue
|
||||
good_snapshot?: Prisma.JsonNullValueInput | runtime.InputJsonValue
|
||||
discount_amount?: Prisma.NullableDecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string | null
|
||||
tax_amount?: Prisma.NullableDecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string | null
|
||||
good?: Prisma.GoodUpdateOneRequiredWithoutSales_invoice_itemsNestedInput
|
||||
service?: Prisma.ServiceUpdateOneWithoutSales_invoice_itemsNestedInput
|
||||
}
|
||||
@@ -1084,6 +1166,8 @@ export type SalesInvoiceItemUncheckedUpdateWithoutInvoiceInput = {
|
||||
good_snapshot?: Prisma.JsonNullValueInput | runtime.InputJsonValue
|
||||
good_id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
service_id?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
discount_amount?: Prisma.NullableDecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string | null
|
||||
tax_amount?: Prisma.NullableDecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string | null
|
||||
}
|
||||
|
||||
export type SalesInvoiceItemUncheckedUpdateManyWithoutInvoiceInput = {
|
||||
@@ -1102,6 +1186,8 @@ export type SalesInvoiceItemUncheckedUpdateManyWithoutInvoiceInput = {
|
||||
good_snapshot?: Prisma.JsonNullValueInput | runtime.InputJsonValue
|
||||
good_id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
service_id?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
discount_amount?: Prisma.NullableDecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string | null
|
||||
tax_amount?: Prisma.NullableDecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string | null
|
||||
}
|
||||
|
||||
export type SalesInvoiceItemCreateManyServiceInput = {
|
||||
@@ -1120,6 +1206,8 @@ export type SalesInvoiceItemCreateManyServiceInput = {
|
||||
good_snapshot: Prisma.JsonNullValueInput | runtime.InputJsonValue
|
||||
invoice_id: string
|
||||
good_id: string
|
||||
discount_amount?: runtime.Decimal | runtime.DecimalJsLike | number | string | null
|
||||
tax_amount?: runtime.Decimal | runtime.DecimalJsLike | number | string | null
|
||||
}
|
||||
|
||||
export type SalesInvoiceItemUpdateWithoutServiceInput = {
|
||||
@@ -1136,8 +1224,10 @@ export type SalesInvoiceItemUpdateWithoutServiceInput = {
|
||||
notes?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
payload?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue
|
||||
good_snapshot?: Prisma.JsonNullValueInput | runtime.InputJsonValue
|
||||
invoice?: Prisma.SalesInvoiceUpdateOneRequiredWithoutItemsNestedInput
|
||||
discount_amount?: Prisma.NullableDecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string | null
|
||||
tax_amount?: Prisma.NullableDecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string | null
|
||||
good?: Prisma.GoodUpdateOneRequiredWithoutSales_invoice_itemsNestedInput
|
||||
invoice?: Prisma.SalesInvoiceUpdateOneRequiredWithoutItemsNestedInput
|
||||
}
|
||||
|
||||
export type SalesInvoiceItemUncheckedUpdateWithoutServiceInput = {
|
||||
@@ -1156,6 +1246,8 @@ export type SalesInvoiceItemUncheckedUpdateWithoutServiceInput = {
|
||||
good_snapshot?: Prisma.JsonNullValueInput | runtime.InputJsonValue
|
||||
invoice_id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
good_id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
discount_amount?: Prisma.NullableDecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string | null
|
||||
tax_amount?: Prisma.NullableDecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string | null
|
||||
}
|
||||
|
||||
export type SalesInvoiceItemUncheckedUpdateManyWithoutServiceInput = {
|
||||
@@ -1174,6 +1266,8 @@ export type SalesInvoiceItemUncheckedUpdateManyWithoutServiceInput = {
|
||||
good_snapshot?: Prisma.JsonNullValueInput | runtime.InputJsonValue
|
||||
invoice_id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
good_id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
discount_amount?: Prisma.NullableDecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string | null
|
||||
tax_amount?: Prisma.NullableDecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string | null
|
||||
}
|
||||
|
||||
|
||||
@@ -1195,8 +1289,10 @@ export type SalesInvoiceItemSelect<ExtArgs extends runtime.Types.Extensions.Inte
|
||||
invoice_id?: boolean
|
||||
good_id?: boolean
|
||||
service_id?: boolean
|
||||
invoice?: boolean | Prisma.SalesInvoiceDefaultArgs<ExtArgs>
|
||||
discount_amount?: boolean
|
||||
tax_amount?: boolean
|
||||
good?: boolean | Prisma.GoodDefaultArgs<ExtArgs>
|
||||
invoice?: boolean | Prisma.SalesInvoiceDefaultArgs<ExtArgs>
|
||||
service?: boolean | Prisma.SalesInvoiceItem$serviceArgs<ExtArgs>
|
||||
}, ExtArgs["result"]["salesInvoiceItem"]>
|
||||
|
||||
@@ -1219,20 +1315,22 @@ export type SalesInvoiceItemSelectScalar = {
|
||||
invoice_id?: boolean
|
||||
good_id?: boolean
|
||||
service_id?: boolean
|
||||
discount_amount?: boolean
|
||||
tax_amount?: boolean
|
||||
}
|
||||
|
||||
export type SalesInvoiceItemOmit<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetOmit<"id" | "quantity" | "measure_unit_text" | "measure_unit_code" | "sku_code" | "sku_vat" | "unit_price" | "total_amount" | "created_at" | "discount" | "notes" | "payload" | "good_snapshot" | "invoice_id" | "good_id" | "service_id", ExtArgs["result"]["salesInvoiceItem"]>
|
||||
export type SalesInvoiceItemOmit<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetOmit<"id" | "quantity" | "measure_unit_text" | "measure_unit_code" | "sku_code" | "sku_vat" | "unit_price" | "total_amount" | "created_at" | "discount" | "notes" | "payload" | "good_snapshot" | "invoice_id" | "good_id" | "service_id" | "discount_amount" | "tax_amount", ExtArgs["result"]["salesInvoiceItem"]>
|
||||
export type SalesInvoiceItemInclude<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
|
||||
invoice?: boolean | Prisma.SalesInvoiceDefaultArgs<ExtArgs>
|
||||
good?: boolean | Prisma.GoodDefaultArgs<ExtArgs>
|
||||
invoice?: boolean | Prisma.SalesInvoiceDefaultArgs<ExtArgs>
|
||||
service?: boolean | Prisma.SalesInvoiceItem$serviceArgs<ExtArgs>
|
||||
}
|
||||
|
||||
export type $SalesInvoiceItemPayload<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
|
||||
name: "SalesInvoiceItem"
|
||||
objects: {
|
||||
invoice: Prisma.$SalesInvoicePayload<ExtArgs>
|
||||
good: Prisma.$GoodPayload<ExtArgs>
|
||||
invoice: Prisma.$SalesInvoicePayload<ExtArgs>
|
||||
service: Prisma.$ServicePayload<ExtArgs> | null
|
||||
}
|
||||
scalars: runtime.Types.Extensions.GetPayloadResult<{
|
||||
@@ -1252,6 +1350,8 @@ export type $SalesInvoiceItemPayload<ExtArgs extends runtime.Types.Extensions.In
|
||||
invoice_id: string
|
||||
good_id: string
|
||||
service_id: string | null
|
||||
discount_amount: runtime.Decimal | null
|
||||
tax_amount: runtime.Decimal | null
|
||||
}, ExtArgs["result"]["salesInvoiceItem"]>
|
||||
composites: {}
|
||||
}
|
||||
@@ -1592,8 +1692,8 @@ readonly fields: SalesInvoiceItemFieldRefs;
|
||||
*/
|
||||
export interface Prisma__SalesInvoiceItemClient<T, Null = never, ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs, GlobalOmitOptions = {}> extends Prisma.PrismaPromise<T> {
|
||||
readonly [Symbol.toStringTag]: "PrismaPromise"
|
||||
invoice<T extends Prisma.SalesInvoiceDefaultArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.SalesInvoiceDefaultArgs<ExtArgs>>): Prisma.Prisma__SalesInvoiceClient<runtime.Types.Result.GetResult<Prisma.$SalesInvoicePayload<ExtArgs>, T, "findUniqueOrThrow", GlobalOmitOptions> | Null, Null, ExtArgs, GlobalOmitOptions>
|
||||
good<T extends Prisma.GoodDefaultArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.GoodDefaultArgs<ExtArgs>>): Prisma.Prisma__GoodClient<runtime.Types.Result.GetResult<Prisma.$GoodPayload<ExtArgs>, T, "findUniqueOrThrow", GlobalOmitOptions> | Null, Null, ExtArgs, GlobalOmitOptions>
|
||||
invoice<T extends Prisma.SalesInvoiceDefaultArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.SalesInvoiceDefaultArgs<ExtArgs>>): Prisma.Prisma__SalesInvoiceClient<runtime.Types.Result.GetResult<Prisma.$SalesInvoicePayload<ExtArgs>, T, "findUniqueOrThrow", GlobalOmitOptions> | Null, Null, ExtArgs, GlobalOmitOptions>
|
||||
service<T extends Prisma.SalesInvoiceItem$serviceArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.SalesInvoiceItem$serviceArgs<ExtArgs>>): Prisma.Prisma__ServiceClient<runtime.Types.Result.GetResult<Prisma.$ServicePayload<ExtArgs>, T, "findUniqueOrThrow", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions>
|
||||
/**
|
||||
* Attaches callbacks for the resolution and/or rejection of the Promise.
|
||||
@@ -1640,6 +1740,8 @@ export interface SalesInvoiceItemFieldRefs {
|
||||
readonly invoice_id: Prisma.FieldRef<"SalesInvoiceItem", 'String'>
|
||||
readonly good_id: Prisma.FieldRef<"SalesInvoiceItem", 'String'>
|
||||
readonly service_id: Prisma.FieldRef<"SalesInvoiceItem", 'String'>
|
||||
readonly discount_amount: Prisma.FieldRef<"SalesInvoiceItem", 'Decimal'>
|
||||
readonly tax_amount: Prisma.FieldRef<"SalesInvoiceItem", 'Decimal'>
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -224,8 +224,8 @@ export type SalesInvoicePaymentWhereInput = {
|
||||
paid_at?: Prisma.DateTimeFilter<"SalesInvoicePayment"> | Date | string
|
||||
created_at?: Prisma.DateTimeFilter<"SalesInvoicePayment"> | Date | string
|
||||
invoice_id?: Prisma.StringFilter<"SalesInvoicePayment"> | string
|
||||
invoice?: Prisma.XOR<Prisma.SalesInvoiceScalarRelationFilter, Prisma.SalesInvoiceWhereInput>
|
||||
terminal_info?: Prisma.XOR<Prisma.SalesInvoicePaymentTerminalInfoNullableScalarRelationFilter, Prisma.SalesInvoicePaymentTerminalInfoWhereInput> | null
|
||||
invoice?: Prisma.XOR<Prisma.SalesInvoiceScalarRelationFilter, Prisma.SalesInvoiceWhereInput>
|
||||
}
|
||||
|
||||
export type SalesInvoicePaymentOrderByWithRelationInput = {
|
||||
@@ -235,8 +235,8 @@ export type SalesInvoicePaymentOrderByWithRelationInput = {
|
||||
paid_at?: Prisma.SortOrder
|
||||
created_at?: Prisma.SortOrder
|
||||
invoice_id?: Prisma.SortOrder
|
||||
invoice?: Prisma.SalesInvoiceOrderByWithRelationInput
|
||||
terminal_info?: Prisma.SalesInvoicePaymentTerminalInfoOrderByWithRelationInput
|
||||
invoice?: Prisma.SalesInvoiceOrderByWithRelationInput
|
||||
_relevance?: Prisma.SalesInvoicePaymentOrderByRelevanceInput
|
||||
}
|
||||
|
||||
@@ -250,8 +250,8 @@ export type SalesInvoicePaymentWhereUniqueInput = Prisma.AtLeast<{
|
||||
paid_at?: Prisma.DateTimeFilter<"SalesInvoicePayment"> | Date | string
|
||||
created_at?: Prisma.DateTimeFilter<"SalesInvoicePayment"> | Date | string
|
||||
invoice_id?: Prisma.StringFilter<"SalesInvoicePayment"> | string
|
||||
invoice?: Prisma.XOR<Prisma.SalesInvoiceScalarRelationFilter, Prisma.SalesInvoiceWhereInput>
|
||||
terminal_info?: Prisma.XOR<Prisma.SalesInvoicePaymentTerminalInfoNullableScalarRelationFilter, Prisma.SalesInvoicePaymentTerminalInfoWhereInput> | null
|
||||
invoice?: Prisma.XOR<Prisma.SalesInvoiceScalarRelationFilter, Prisma.SalesInvoiceWhereInput>
|
||||
}, "id">
|
||||
|
||||
export type SalesInvoicePaymentOrderByWithAggregationInput = {
|
||||
@@ -286,8 +286,8 @@ export type SalesInvoicePaymentCreateInput = {
|
||||
payment_method: $Enums.PaymentMethodType
|
||||
paid_at: Date | string
|
||||
created_at?: Date | string
|
||||
invoice: Prisma.SalesInvoiceCreateNestedOneWithoutPaymentsInput
|
||||
terminal_info?: Prisma.SalesInvoicePaymentTerminalInfoCreateNestedOneWithoutPaymentInput
|
||||
invoice: Prisma.SalesInvoiceCreateNestedOneWithoutPaymentsInput
|
||||
}
|
||||
|
||||
export type SalesInvoicePaymentUncheckedCreateInput = {
|
||||
@@ -306,8 +306,8 @@ export type SalesInvoicePaymentUpdateInput = {
|
||||
payment_method?: Prisma.EnumPaymentMethodTypeFieldUpdateOperationsInput | $Enums.PaymentMethodType
|
||||
paid_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
invoice?: Prisma.SalesInvoiceUpdateOneRequiredWithoutPaymentsNestedInput
|
||||
terminal_info?: Prisma.SalesInvoicePaymentTerminalInfoUpdateOneWithoutPaymentNestedInput
|
||||
invoice?: Prisma.SalesInvoiceUpdateOneRequiredWithoutPaymentsNestedInput
|
||||
}
|
||||
|
||||
export type SalesInvoicePaymentUncheckedUpdateInput = {
|
||||
@@ -613,8 +613,8 @@ export type SalesInvoicePaymentSelect<ExtArgs extends runtime.Types.Extensions.I
|
||||
paid_at?: boolean
|
||||
created_at?: boolean
|
||||
invoice_id?: boolean
|
||||
invoice?: boolean | Prisma.SalesInvoiceDefaultArgs<ExtArgs>
|
||||
terminal_info?: boolean | Prisma.SalesInvoicePayment$terminal_infoArgs<ExtArgs>
|
||||
invoice?: boolean | Prisma.SalesInvoiceDefaultArgs<ExtArgs>
|
||||
}, ExtArgs["result"]["salesInvoicePayment"]>
|
||||
|
||||
|
||||
@@ -630,15 +630,15 @@ export type SalesInvoicePaymentSelectScalar = {
|
||||
|
||||
export type SalesInvoicePaymentOmit<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetOmit<"id" | "amount" | "payment_method" | "paid_at" | "created_at" | "invoice_id", ExtArgs["result"]["salesInvoicePayment"]>
|
||||
export type SalesInvoicePaymentInclude<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
|
||||
invoice?: boolean | Prisma.SalesInvoiceDefaultArgs<ExtArgs>
|
||||
terminal_info?: boolean | Prisma.SalesInvoicePayment$terminal_infoArgs<ExtArgs>
|
||||
invoice?: boolean | Prisma.SalesInvoiceDefaultArgs<ExtArgs>
|
||||
}
|
||||
|
||||
export type $SalesInvoicePaymentPayload<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
|
||||
name: "SalesInvoicePayment"
|
||||
objects: {
|
||||
invoice: Prisma.$SalesInvoicePayload<ExtArgs>
|
||||
terminal_info: Prisma.$SalesInvoicePaymentTerminalInfoPayload<ExtArgs> | null
|
||||
invoice: Prisma.$SalesInvoicePayload<ExtArgs>
|
||||
}
|
||||
scalars: runtime.Types.Extensions.GetPayloadResult<{
|
||||
id: string
|
||||
@@ -987,8 +987,8 @@ readonly fields: SalesInvoicePaymentFieldRefs;
|
||||
*/
|
||||
export interface Prisma__SalesInvoicePaymentClient<T, Null = never, ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs, GlobalOmitOptions = {}> extends Prisma.PrismaPromise<T> {
|
||||
readonly [Symbol.toStringTag]: "PrismaPromise"
|
||||
invoice<T extends Prisma.SalesInvoiceDefaultArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.SalesInvoiceDefaultArgs<ExtArgs>>): Prisma.Prisma__SalesInvoiceClient<runtime.Types.Result.GetResult<Prisma.$SalesInvoicePayload<ExtArgs>, T, "findUniqueOrThrow", GlobalOmitOptions> | Null, Null, ExtArgs, GlobalOmitOptions>
|
||||
terminal_info<T extends Prisma.SalesInvoicePayment$terminal_infoArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.SalesInvoicePayment$terminal_infoArgs<ExtArgs>>): Prisma.Prisma__SalesInvoicePaymentTerminalInfoClient<runtime.Types.Result.GetResult<Prisma.$SalesInvoicePaymentTerminalInfoPayload<ExtArgs>, T, "findUniqueOrThrow", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions>
|
||||
invoice<T extends Prisma.SalesInvoiceDefaultArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.SalesInvoiceDefaultArgs<ExtArgs>>): Prisma.Prisma__SalesInvoiceClient<runtime.Types.Result.GetResult<Prisma.$SalesInvoicePayload<ExtArgs>, T, "findUniqueOrThrow", GlobalOmitOptions> | Null, Null, ExtArgs, GlobalOmitOptions>
|
||||
/**
|
||||
* Attaches callbacks for the resolution and/or rejection of the Promise.
|
||||
* @param onfulfilled The callback to execute when the Promise is resolved.
|
||||
|
||||
@@ -280,8 +280,8 @@ export type ServiceWhereInput = {
|
||||
base_sale_price?: Prisma.DecimalFilter<"Service"> | runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
account_id?: Prisma.StringFilter<"Service"> | string
|
||||
complex_id?: Prisma.StringFilter<"Service"> | string
|
||||
category?: Prisma.XOR<Prisma.ServiceCategoryNullableScalarRelationFilter, Prisma.ServiceCategoryWhereInput> | null
|
||||
sales_invoice_items?: Prisma.SalesInvoiceItemListRelationFilter
|
||||
category?: Prisma.XOR<Prisma.ServiceCategoryNullableScalarRelationFilter, Prisma.ServiceCategoryWhereInput> | null
|
||||
}
|
||||
|
||||
export type ServiceOrderByWithRelationInput = {
|
||||
@@ -298,8 +298,8 @@ export type ServiceOrderByWithRelationInput = {
|
||||
base_sale_price?: Prisma.SortOrder
|
||||
account_id?: Prisma.SortOrder
|
||||
complex_id?: Prisma.SortOrder
|
||||
category?: Prisma.ServiceCategoryOrderByWithRelationInput
|
||||
sales_invoice_items?: Prisma.SalesInvoiceItemOrderByRelationAggregateInput
|
||||
category?: Prisma.ServiceCategoryOrderByWithRelationInput
|
||||
_relevance?: Prisma.ServiceOrderByRelevanceInput
|
||||
}
|
||||
|
||||
@@ -320,8 +320,8 @@ export type ServiceWhereUniqueInput = Prisma.AtLeast<{
|
||||
base_sale_price?: Prisma.DecimalFilter<"Service"> | runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
account_id?: Prisma.StringFilter<"Service"> | string
|
||||
complex_id?: Prisma.StringFilter<"Service"> | string
|
||||
category?: Prisma.XOR<Prisma.ServiceCategoryNullableScalarRelationFilter, Prisma.ServiceCategoryWhereInput> | null
|
||||
sales_invoice_items?: Prisma.SalesInvoiceItemListRelationFilter
|
||||
category?: Prisma.XOR<Prisma.ServiceCategoryNullableScalarRelationFilter, Prisma.ServiceCategoryWhereInput> | null
|
||||
}, "id" | "sku" | "local_sku" | "barcode">
|
||||
|
||||
export type ServiceOrderByWithAggregationInput = {
|
||||
@@ -377,8 +377,8 @@ export type ServiceCreateInput = {
|
||||
base_sale_price?: runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
account_id: string
|
||||
complex_id: string
|
||||
category?: Prisma.ServiceCategoryCreateNestedOneWithoutServicesInput
|
||||
sales_invoice_items?: Prisma.SalesInvoiceItemCreateNestedManyWithoutServiceInput
|
||||
category?: Prisma.ServiceCategoryCreateNestedOneWithoutServicesInput
|
||||
}
|
||||
|
||||
export type ServiceUncheckedCreateInput = {
|
||||
@@ -411,8 +411,8 @@ export type ServiceUpdateInput = {
|
||||
base_sale_price?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
account_id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
complex_id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
category?: Prisma.ServiceCategoryUpdateOneWithoutServicesNestedInput
|
||||
sales_invoice_items?: Prisma.SalesInvoiceItemUpdateManyWithoutServiceNestedInput
|
||||
category?: Prisma.ServiceCategoryUpdateOneWithoutServicesNestedInput
|
||||
}
|
||||
|
||||
export type ServiceUncheckedUpdateInput = {
|
||||
@@ -878,8 +878,8 @@ export type ServiceSelect<ExtArgs extends runtime.Types.Extensions.InternalArgs
|
||||
base_sale_price?: boolean
|
||||
account_id?: boolean
|
||||
complex_id?: boolean
|
||||
category?: boolean | Prisma.Service$categoryArgs<ExtArgs>
|
||||
sales_invoice_items?: boolean | Prisma.Service$sales_invoice_itemsArgs<ExtArgs>
|
||||
category?: boolean | Prisma.Service$categoryArgs<ExtArgs>
|
||||
_count?: boolean | Prisma.ServiceCountOutputTypeDefaultArgs<ExtArgs>
|
||||
}, ExtArgs["result"]["service"]>
|
||||
|
||||
@@ -903,16 +903,16 @@ export type ServiceSelectScalar = {
|
||||
|
||||
export type ServiceOmit<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetOmit<"id" | "name" | "description" | "sku" | "local_sku" | "barcode" | "created_at" | "updated_at" | "deleted_at" | "category_id" | "base_sale_price" | "account_id" | "complex_id", ExtArgs["result"]["service"]>
|
||||
export type ServiceInclude<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
|
||||
category?: boolean | Prisma.Service$categoryArgs<ExtArgs>
|
||||
sales_invoice_items?: boolean | Prisma.Service$sales_invoice_itemsArgs<ExtArgs>
|
||||
category?: boolean | Prisma.Service$categoryArgs<ExtArgs>
|
||||
_count?: boolean | Prisma.ServiceCountOutputTypeDefaultArgs<ExtArgs>
|
||||
}
|
||||
|
||||
export type $ServicePayload<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
|
||||
name: "Service"
|
||||
objects: {
|
||||
category: Prisma.$ServiceCategoryPayload<ExtArgs> | null
|
||||
sales_invoice_items: Prisma.$SalesInvoiceItemPayload<ExtArgs>[]
|
||||
category: Prisma.$ServiceCategoryPayload<ExtArgs> | null
|
||||
}
|
||||
scalars: runtime.Types.Extensions.GetPayloadResult<{
|
||||
id: string
|
||||
@@ -1268,8 +1268,8 @@ readonly fields: ServiceFieldRefs;
|
||||
*/
|
||||
export interface Prisma__ServiceClient<T, Null = never, ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs, GlobalOmitOptions = {}> extends Prisma.PrismaPromise<T> {
|
||||
readonly [Symbol.toStringTag]: "PrismaPromise"
|
||||
category<T extends Prisma.Service$categoryArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.Service$categoryArgs<ExtArgs>>): Prisma.Prisma__ServiceCategoryClient<runtime.Types.Result.GetResult<Prisma.$ServiceCategoryPayload<ExtArgs>, T, "findUniqueOrThrow", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions>
|
||||
sales_invoice_items<T extends Prisma.Service$sales_invoice_itemsArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.Service$sales_invoice_itemsArgs<ExtArgs>>): Prisma.PrismaPromise<runtime.Types.Result.GetResult<Prisma.$SalesInvoiceItemPayload<ExtArgs>, T, "findMany", GlobalOmitOptions> | Null>
|
||||
category<T extends Prisma.Service$categoryArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.Service$categoryArgs<ExtArgs>>): Prisma.Prisma__ServiceCategoryClient<runtime.Types.Result.GetResult<Prisma.$ServiceCategoryPayload<ExtArgs>, T, "findUniqueOrThrow", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions>
|
||||
/**
|
||||
* Attaches callbacks for the resolution and/or rejection of the Promise.
|
||||
* @param onfulfilled The callback to execute when the Promise is resolved.
|
||||
@@ -1659,25 +1659,6 @@ export type ServiceDeleteManyArgs<ExtArgs extends runtime.Types.Extensions.Inter
|
||||
limit?: number
|
||||
}
|
||||
|
||||
/**
|
||||
* Service.category
|
||||
*/
|
||||
export type Service$categoryArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
|
||||
/**
|
||||
* Select specific fields to fetch from the ServiceCategory
|
||||
*/
|
||||
select?: Prisma.ServiceCategorySelect<ExtArgs> | null
|
||||
/**
|
||||
* Omit specific fields from the ServiceCategory
|
||||
*/
|
||||
omit?: Prisma.ServiceCategoryOmit<ExtArgs> | null
|
||||
/**
|
||||
* Choose, which related nodes to fetch as well
|
||||
*/
|
||||
include?: Prisma.ServiceCategoryInclude<ExtArgs> | null
|
||||
where?: Prisma.ServiceCategoryWhereInput
|
||||
}
|
||||
|
||||
/**
|
||||
* Service.sales_invoice_items
|
||||
*/
|
||||
@@ -1702,6 +1683,25 @@ export type Service$sales_invoice_itemsArgs<ExtArgs extends runtime.Types.Extens
|
||||
distinct?: Prisma.SalesInvoiceItemScalarFieldEnum | Prisma.SalesInvoiceItemScalarFieldEnum[]
|
||||
}
|
||||
|
||||
/**
|
||||
* Service.category
|
||||
*/
|
||||
export type Service$categoryArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
|
||||
/**
|
||||
* Select specific fields to fetch from the ServiceCategory
|
||||
*/
|
||||
select?: Prisma.ServiceCategorySelect<ExtArgs> | null
|
||||
/**
|
||||
* Omit specific fields from the ServiceCategory
|
||||
*/
|
||||
omit?: Prisma.ServiceCategoryOmit<ExtArgs> | null
|
||||
/**
|
||||
* Choose, which related nodes to fetch as well
|
||||
*/
|
||||
include?: Prisma.ServiceCategoryInclude<ExtArgs> | null
|
||||
where?: Prisma.ServiceCategoryWhereInput
|
||||
}
|
||||
|
||||
/**
|
||||
* Service without action
|
||||
*/
|
||||
|
||||
@@ -248,8 +248,8 @@ export type StockKeepingUnitsWhereInput = {
|
||||
guild_id?: Prisma.StringFilter<"StockKeepingUnits"> | string
|
||||
created_at?: Prisma.DateTimeFilter<"StockKeepingUnits"> | Date | string
|
||||
updated_at?: Prisma.DateTimeFilter<"StockKeepingUnits"> | Date | string
|
||||
guild?: Prisma.XOR<Prisma.GuildScalarRelationFilter, Prisma.GuildWhereInput>
|
||||
goods?: Prisma.GoodListRelationFilter
|
||||
guild?: Prisma.XOR<Prisma.GuildScalarRelationFilter, Prisma.GuildWhereInput>
|
||||
}
|
||||
|
||||
export type StockKeepingUnitsOrderByWithRelationInput = {
|
||||
@@ -262,8 +262,8 @@ export type StockKeepingUnitsOrderByWithRelationInput = {
|
||||
guild_id?: Prisma.SortOrder
|
||||
created_at?: Prisma.SortOrder
|
||||
updated_at?: Prisma.SortOrder
|
||||
guild?: Prisma.GuildOrderByWithRelationInput
|
||||
goods?: Prisma.GoodOrderByRelationAggregateInput
|
||||
guild?: Prisma.GuildOrderByWithRelationInput
|
||||
_relevance?: Prisma.StockKeepingUnitsOrderByRelevanceInput
|
||||
}
|
||||
|
||||
@@ -280,8 +280,8 @@ export type StockKeepingUnitsWhereUniqueInput = Prisma.AtLeast<{
|
||||
guild_id?: Prisma.StringFilter<"StockKeepingUnits"> | string
|
||||
created_at?: Prisma.DateTimeFilter<"StockKeepingUnits"> | Date | string
|
||||
updated_at?: Prisma.DateTimeFilter<"StockKeepingUnits"> | Date | string
|
||||
guild?: Prisma.XOR<Prisma.GuildScalarRelationFilter, Prisma.GuildWhereInput>
|
||||
goods?: Prisma.GoodListRelationFilter
|
||||
guild?: Prisma.XOR<Prisma.GuildScalarRelationFilter, Prisma.GuildWhereInput>
|
||||
}, "id" | "code">
|
||||
|
||||
export type StockKeepingUnitsOrderByWithAggregationInput = {
|
||||
@@ -325,8 +325,8 @@ export type StockKeepingUnitsCreateInput = {
|
||||
is_domestic?: boolean
|
||||
created_at?: Date | string
|
||||
updated_at?: Date | string
|
||||
guild: Prisma.GuildCreateNestedOneWithoutStockKeepingUnitsInput
|
||||
goods?: Prisma.GoodCreateNestedManyWithoutSkuInput
|
||||
guild: Prisma.GuildCreateNestedOneWithoutStockKeepingUnitsInput
|
||||
}
|
||||
|
||||
export type StockKeepingUnitsUncheckedCreateInput = {
|
||||
@@ -351,8 +351,8 @@ export type StockKeepingUnitsUpdateInput = {
|
||||
is_domestic?: Prisma.BoolFieldUpdateOperationsInput | boolean
|
||||
created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
guild?: Prisma.GuildUpdateOneRequiredWithoutStockKeepingUnitsNestedInput
|
||||
goods?: Prisma.GoodUpdateManyWithoutSkuNestedInput
|
||||
guild?: Prisma.GuildUpdateOneRequiredWithoutStockKeepingUnitsNestedInput
|
||||
}
|
||||
|
||||
export type StockKeepingUnitsUncheckedUpdateInput = {
|
||||
@@ -740,8 +740,8 @@ export type StockKeepingUnitsSelect<ExtArgs extends runtime.Types.Extensions.Int
|
||||
guild_id?: boolean
|
||||
created_at?: boolean
|
||||
updated_at?: boolean
|
||||
guild?: boolean | Prisma.GuildDefaultArgs<ExtArgs>
|
||||
goods?: boolean | Prisma.StockKeepingUnits$goodsArgs<ExtArgs>
|
||||
guild?: boolean | Prisma.GuildDefaultArgs<ExtArgs>
|
||||
_count?: boolean | Prisma.StockKeepingUnitsCountOutputTypeDefaultArgs<ExtArgs>
|
||||
}, ExtArgs["result"]["stockKeepingUnits"]>
|
||||
|
||||
@@ -761,16 +761,16 @@ export type StockKeepingUnitsSelectScalar = {
|
||||
|
||||
export type StockKeepingUnitsOmit<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetOmit<"id" | "code" | "name" | "VAT" | "is_public" | "is_domestic" | "guild_id" | "created_at" | "updated_at", ExtArgs["result"]["stockKeepingUnits"]>
|
||||
export type StockKeepingUnitsInclude<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
|
||||
guild?: boolean | Prisma.GuildDefaultArgs<ExtArgs>
|
||||
goods?: boolean | Prisma.StockKeepingUnits$goodsArgs<ExtArgs>
|
||||
guild?: boolean | Prisma.GuildDefaultArgs<ExtArgs>
|
||||
_count?: boolean | Prisma.StockKeepingUnitsCountOutputTypeDefaultArgs<ExtArgs>
|
||||
}
|
||||
|
||||
export type $StockKeepingUnitsPayload<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
|
||||
name: "StockKeepingUnits"
|
||||
objects: {
|
||||
guild: Prisma.$GuildPayload<ExtArgs>
|
||||
goods: Prisma.$GoodPayload<ExtArgs>[]
|
||||
guild: Prisma.$GuildPayload<ExtArgs>
|
||||
}
|
||||
scalars: runtime.Types.Extensions.GetPayloadResult<{
|
||||
id: string
|
||||
@@ -1122,8 +1122,8 @@ readonly fields: StockKeepingUnitsFieldRefs;
|
||||
*/
|
||||
export interface Prisma__StockKeepingUnitsClient<T, Null = never, ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs, GlobalOmitOptions = {}> extends Prisma.PrismaPromise<T> {
|
||||
readonly [Symbol.toStringTag]: "PrismaPromise"
|
||||
guild<T extends Prisma.GuildDefaultArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.GuildDefaultArgs<ExtArgs>>): Prisma.Prisma__GuildClient<runtime.Types.Result.GetResult<Prisma.$GuildPayload<ExtArgs>, T, "findUniqueOrThrow", GlobalOmitOptions> | Null, Null, ExtArgs, GlobalOmitOptions>
|
||||
goods<T extends Prisma.StockKeepingUnits$goodsArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.StockKeepingUnits$goodsArgs<ExtArgs>>): Prisma.PrismaPromise<runtime.Types.Result.GetResult<Prisma.$GoodPayload<ExtArgs>, T, "findMany", GlobalOmitOptions> | Null>
|
||||
guild<T extends Prisma.GuildDefaultArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.GuildDefaultArgs<ExtArgs>>): Prisma.Prisma__GuildClient<runtime.Types.Result.GetResult<Prisma.$GuildPayload<ExtArgs>, T, "findUniqueOrThrow", GlobalOmitOptions> | Null, Null, ExtArgs, GlobalOmitOptions>
|
||||
/**
|
||||
* Attaches callbacks for the resolution and/or rejection of the Promise.
|
||||
* @param onfulfilled The callback to execute when the Promise is resolved.
|
||||
|
||||
+7
-5
@@ -2,18 +2,20 @@ import { PrismaMariaDb } from '@prisma/adapter-mariadb'
|
||||
import 'dotenv/config'
|
||||
import { env } from 'prisma/config'
|
||||
|
||||
import { PrismaClient } from '../generated/prisma/client'
|
||||
|
||||
const adapter = new PrismaMariaDb({
|
||||
host: env('DATABASE_HOST'),
|
||||
user: env('DATABASE_USER'),
|
||||
password: env('DATABASE_PASSWORD'),
|
||||
database: env('DATABASE_NAME'),
|
||||
ssl: false,
|
||||
connectionLimit: 5,
|
||||
port: Number(env('DATABASE_PORT')) || 3306,
|
||||
allowPublicKeyRetrieval: true,
|
||||
ssl: {
|
||||
rejectUnauthorized: false,
|
||||
},
|
||||
connectTimeout: 10000,
|
||||
})
|
||||
|
||||
const prisma = new PrismaClient({ adapter })
|
||||
// const prisma = new PrismaClient({ adapter })
|
||||
|
||||
export { prisma }
|
||||
export { adapter as prismaAdapter }
|
||||
|
||||
+3
-2
@@ -17,6 +17,8 @@ const cookieParser = require('cookie-parser')
|
||||
async function bootstrap() {
|
||||
const app = await NestFactory.create(AppModule)
|
||||
|
||||
app.enableShutdownHooks()
|
||||
|
||||
app.use(cookieParser())
|
||||
|
||||
const config = new DocumentBuilder()
|
||||
@@ -33,6 +35,7 @@ async function bootstrap() {
|
||||
in: 'header',
|
||||
})
|
||||
.build()
|
||||
|
||||
const documentFactory = () => SwaggerModule.createDocument(app, config)
|
||||
SwaggerModule.setup('swagger', app, documentFactory, {
|
||||
swaggerOptions: {
|
||||
@@ -47,14 +50,12 @@ async function bootstrap() {
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
// Set API prefix and enable URI versioning so alls routes live under /api/v1/*
|
||||
app.setGlobalPrefix('api')
|
||||
app.enableVersioning({
|
||||
type: VersioningType.URI,
|
||||
defaultVersion: '1',
|
||||
})
|
||||
|
||||
// Enable CORS. You can set `CORS_ORIGINS` to a comma-separated list of allowed origins.
|
||||
// Defaults include common localhost origins used by front-end dev servers.
|
||||
const defaultOrigins: string[] = []
|
||||
|
||||
@@ -1,8 +1,16 @@
|
||||
import { Body, Controller, Get, Param, Patch, Post } from '@nestjs/common'
|
||||
import { ApiTags } from '@nestjs/swagger'
|
||||
import { AccountsService } from './accounts.service'
|
||||
import { CreateConsumerAccountDto, UpdateAccountDto } from './dto/account.dto'
|
||||
import type { AccountsServiceCreateResponseDto, AccountsServiceFindAllResponseDto, AccountsServiceFindOneResponseDto, AccountsServiceUpdateResponseDto } from './dto/accounts-response.dto'
|
||||
import {
|
||||
CreateAdminConsumerAccountDto,
|
||||
UpdateAdminConsumerAccountDto,
|
||||
} from './dto/account.dto'
|
||||
import type {
|
||||
AccountsServiceCreateResponseDto,
|
||||
AccountsServiceFindAllResponseDto,
|
||||
AccountsServiceFindOneResponseDto,
|
||||
AccountsServiceUpdateResponseDto,
|
||||
} from './dto/accounts-response.dto'
|
||||
|
||||
@ApiTags('AdminConsumerAccounts')
|
||||
@Controller('admin/consumers/:consumerId/accounts')
|
||||
@@ -10,7 +18,9 @@ export class AccountsController {
|
||||
constructor(private readonly accountsService: AccountsService) {}
|
||||
|
||||
@Get()
|
||||
async findAll(@Param('consumerId') consumerId: string): Promise<AccountsServiceFindAllResponseDto> {
|
||||
async findAll(
|
||||
@Param('consumerId') consumerId: string,
|
||||
): Promise<AccountsServiceFindAllResponseDto> {
|
||||
return this.accountsService.findAll(consumerId)
|
||||
}
|
||||
|
||||
@@ -22,13 +32,16 @@ export class AccountsController {
|
||||
@Post()
|
||||
async create(
|
||||
@Param('consumerId') consumerId: string,
|
||||
@Body() data: CreateConsumerAccountDto,
|
||||
@Body() data: CreateAdminConsumerAccountDto,
|
||||
): Promise<AccountsServiceCreateResponseDto> {
|
||||
return this.accountsService.create(consumerId, data)
|
||||
}
|
||||
|
||||
@Patch(':id')
|
||||
async update(@Param('id') id: string, @Body() data: UpdateAccountDto): Promise<AccountsServiceUpdateResponseDto> {
|
||||
async update(
|
||||
@Param('id') id: string,
|
||||
@Body() data: UpdateAdminConsumerAccountDto,
|
||||
): Promise<AccountsServiceUpdateResponseDto> {
|
||||
return this.accountsService.update(id, data)
|
||||
}
|
||||
|
||||
|
||||
@@ -4,7 +4,10 @@ import { AccountStatus, AccountType } from '@/generated/prisma/enums'
|
||||
import { PrismaService } from '@/prisma/prisma.service'
|
||||
import { Injectable } from '@nestjs/common'
|
||||
import { ResponseMapper } from 'common/response/response-mapper'
|
||||
import { CreateConsumerAccountDto, UpdateAccountDto } from './dto/account.dto'
|
||||
import {
|
||||
CreateAdminConsumerAccountDto,
|
||||
UpdateAdminConsumerAccountDto,
|
||||
} from './dto/account.dto'
|
||||
|
||||
@Injectable()
|
||||
export class AccountsService {
|
||||
@@ -70,7 +73,7 @@ export class AccountsService {
|
||||
return ResponseMapper.single(account)
|
||||
}
|
||||
|
||||
async create(consumerId: string, data: CreateConsumerAccountDto) {
|
||||
async create(consumerId: string, data: CreateAdminConsumerAccountDto) {
|
||||
const account = await this.prisma.consumerAccount.create({
|
||||
data: {
|
||||
role: data.role,
|
||||
@@ -95,7 +98,7 @@ export class AccountsService {
|
||||
return ResponseMapper.create(account)
|
||||
}
|
||||
|
||||
async update(id: string, data: UpdateAccountDto) {
|
||||
async update(id: string, data: UpdateAdminConsumerAccountDto) {
|
||||
const account = await this.prisma.account.update({ where: { id }, data })
|
||||
return ResponseMapper.update(account)
|
||||
}
|
||||
|
||||
@@ -1,13 +1,16 @@
|
||||
import { PasswordFieldValidator, UsernameFieldValidator } from '@/common/utils'
|
||||
import { ApiProperty, PartialType } from '@nestjs/swagger'
|
||||
import { IsEnum, IsOptional, IsString } from 'class-validator'
|
||||
import { AccountStatus, ConsumerRole } from 'generated/prisma/enums'
|
||||
|
||||
export class CreateConsumerAccountDto {
|
||||
export class CreateAdminConsumerAccountDto {
|
||||
@IsString()
|
||||
@UsernameFieldValidator()
|
||||
@ApiProperty({ required: true })
|
||||
username: string
|
||||
|
||||
@IsString()
|
||||
@PasswordFieldValidator()
|
||||
@ApiProperty({ required: true })
|
||||
password: string
|
||||
|
||||
@@ -16,7 +19,9 @@ export class CreateConsumerAccountDto {
|
||||
role: ConsumerRole
|
||||
}
|
||||
|
||||
export class UpdateAccountDto extends PartialType(CreateConsumerAccountDto) {
|
||||
export class UpdateAdminConsumerAccountDto extends PartialType(
|
||||
CreateAdminConsumerAccountDto,
|
||||
) {
|
||||
@IsOptional()
|
||||
@IsEnum(AccountStatus)
|
||||
@ApiProperty({ enum: AccountStatus })
|
||||
|
||||
@@ -14,6 +14,26 @@ export class AdminConsumersService {
|
||||
type: true,
|
||||
...QUERY_CONSTANTS.CONSUMER.infoSelect,
|
||||
...QUERY_CONSTANTS.CONSUMER.activeBusinessCount,
|
||||
individual: {
|
||||
select: {
|
||||
partner: {
|
||||
select: {
|
||||
id: true,
|
||||
name: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
legal: {
|
||||
select: {
|
||||
partner: {
|
||||
select: {
|
||||
id: true,
|
||||
name: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
status: true,
|
||||
created_at: true,
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import { PasswordFieldValidator, UsernameFieldValidator } from '@/common/utils'
|
||||
import { ConsumerStatus } from '@/generated/prisma/enums'
|
||||
import { ApiProperty, OmitType, PartialType } from '@nestjs/swagger'
|
||||
import { IsEnum, IsOptional, IsString } from 'class-validator'
|
||||
@@ -16,10 +17,12 @@ export class CreateConsumerDto {
|
||||
last_name: string
|
||||
|
||||
@IsString()
|
||||
@UsernameFieldValidator()
|
||||
@ApiProperty({ required: true })
|
||||
username: string
|
||||
|
||||
@IsString()
|
||||
@PasswordFieldValidator()
|
||||
@ApiProperty({ required: true })
|
||||
password: string
|
||||
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
import { RedisKeyMaker } from '@/common/utils/redisKeyMaker'
|
||||
import { PosCacheInvalidationService } from '@/modules/pos/cache/pos-cache-invalidation.service'
|
||||
import { RedisService } from '@/redis/redis.service'
|
||||
import { Injectable } from '@nestjs/common'
|
||||
|
||||
@Injectable()
|
||||
export class AdminGuildCacheInvalidationService {
|
||||
constructor(
|
||||
private readonly redisService: RedisService,
|
||||
private readonly posCacheInvalidationService: PosCacheInvalidationService,
|
||||
) {}
|
||||
|
||||
async invalidateGoodsList(guildId: string): Promise<void> {
|
||||
await this.redisService.delete(RedisKeyMaker.guildGoodsList(guildId))
|
||||
await this.posCacheInvalidationService.invalidatePosGoodsByGuildPattern(guildId)
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user