diff --git a/package.json b/package.json index 11fdfa0..4d6c939 100644 --- a/package.json +++ b/package.json @@ -31,6 +31,7 @@ "@nestjs/schematics": "^11.0.0", "@nestjs/testing": "^11.0.1", "@prisma/client": "^7.2.0", + "@types/cookie-parser": "^1.4.10", "@types/express": "^5.0.0", "@types/jest": "^30.0.0", "@types/node": "^22.10.7", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index b962106..a4ca4f6 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -90,6 +90,9 @@ importers: '@prisma/client': specifier: ^7.2.0 version: 7.2.0(prisma@7.2.0(@types/react@19.2.7)(react-dom@19.2.1(react@19.2.1))(react@19.2.1)(typescript@5.9.3))(typescript@5.9.3) + '@types/cookie-parser': + specifier: ^1.4.10 + version: 1.4.10(@types/express@5.0.6) '@types/express': specifier: ^5.0.0 version: 5.0.6 @@ -368,7 +371,7 @@ packages: resolution: {integrity: sha512-hBzuU5+JjB2cqNZyszkDHZgOSrUUT8V3dhgRl8Q9Gp6dAj/H5+KILGjbhDpc3Iy9qmqlm/akuOI2ut9VUtzJxQ==} '@colors/colors@1.5.0': - resolution: {integrity: sha512-ooWCrlZP11i8GImSjTHYHLkvFDP48nS4+204nGb1RiX/WXYHmJA2III9/e2DWVabCESdW7hBAEzHRqUn9OUVvQ==} + resolution: {integrity: sha512-ooWCrlZP11i8GImSjTHYHLkvFDP48nS4+204nGb1RiX/WXYHmJA2III9/e2DWVabCESdW7hBAEzHRqUn9OUVvQ==, tarball: https://hub.megan.ir/repository/npm/@colors/colors/-/colors-1.5.0.tgz} engines: {node: '>=0.1.90'} '@cspotcode/source-map-support@0.8.1': @@ -390,166 +393,166 @@ packages: resolution: {integrity: sha512-zfWWa+V2ViDCY/cmUfRqeWY1yLto+EpxjXnZzenB1TyxsTiXaTWeZFIZw6mac52BsuQm0RjCnisjBtdBaXOI6w==} '@emnapi/core@1.7.1': - resolution: {integrity: sha512-o1uhUASyo921r2XtHYOHy7gdkGLge8ghBEQHMWmyJFoXlpU58kIrhhN3w26lpQb6dspetweapMn2CSNwQ8I4wg==} + resolution: {integrity: sha512-o1uhUASyo921r2XtHYOHy7gdkGLge8ghBEQHMWmyJFoXlpU58kIrhhN3w26lpQb6dspetweapMn2CSNwQ8I4wg==, tarball: https://hub.megan.ir/repository/npm/@emnapi/core/-/core-1.7.1.tgz} '@emnapi/runtime@1.7.1': - resolution: {integrity: sha512-PVtJr5CmLwYAU9PZDMITZoR5iAOShYREoR45EyyLrbntV50mdePTgUn4AmOw90Ifcj+x2kRjdzr1HP3RrNiHGA==} + resolution: {integrity: sha512-PVtJr5CmLwYAU9PZDMITZoR5iAOShYREoR45EyyLrbntV50mdePTgUn4AmOw90Ifcj+x2kRjdzr1HP3RrNiHGA==, tarball: https://hub.megan.ir/repository/npm/@emnapi/runtime/-/runtime-1.7.1.tgz} '@emnapi/wasi-threads@1.1.0': - resolution: {integrity: sha512-WI0DdZ8xFSbgMjR1sFsKABJ/C5OnRrjT06JXbZKexJGrDuPTzZdDYfFlsgcCXCyf+suG5QU2e/y1Wo2V/OapLQ==} + resolution: {integrity: sha512-WI0DdZ8xFSbgMjR1sFsKABJ/C5OnRrjT06JXbZKexJGrDuPTzZdDYfFlsgcCXCyf+suG5QU2e/y1Wo2V/OapLQ==, tarball: https://hub.megan.ir/repository/npm/@emnapi/wasi-threads/-/wasi-threads-1.1.0.tgz} '@esbuild/aix-ppc64@0.27.1': - resolution: {integrity: sha512-HHB50pdsBX6k47S4u5g/CaLjqS3qwaOVE5ILsq64jyzgMhLuCuZ8rGzM9yhsAjfjkbgUPMzZEPa7DAp7yz6vuA==} + resolution: {integrity: sha512-HHB50pdsBX6k47S4u5g/CaLjqS3qwaOVE5ILsq64jyzgMhLuCuZ8rGzM9yhsAjfjkbgUPMzZEPa7DAp7yz6vuA==, tarball: https://hub.megan.ir/repository/npm/@esbuild/aix-ppc64/-/aix-ppc64-0.27.1.tgz} engines: {node: '>=18'} cpu: [ppc64] os: [aix] '@esbuild/android-arm64@0.27.1': - resolution: {integrity: sha512-45fuKmAJpxnQWixOGCrS+ro4Uvb4Re9+UTieUY2f8AEc+t7d4AaZ6eUJ3Hva7dtrxAAWHtlEFsXFMAgNnGU9uQ==} + resolution: {integrity: sha512-45fuKmAJpxnQWixOGCrS+ro4Uvb4Re9+UTieUY2f8AEc+t7d4AaZ6eUJ3Hva7dtrxAAWHtlEFsXFMAgNnGU9uQ==, tarball: https://hub.megan.ir/repository/npm/@esbuild/android-arm64/-/android-arm64-0.27.1.tgz} engines: {node: '>=18'} cpu: [arm64] os: [android] '@esbuild/android-arm@0.27.1': - resolution: {integrity: sha512-kFqa6/UcaTbGm/NncN9kzVOODjhZW8e+FRdSeypWe6j33gzclHtwlANs26JrupOntlcWmB0u8+8HZo8s7thHvg==} + resolution: {integrity: sha512-kFqa6/UcaTbGm/NncN9kzVOODjhZW8e+FRdSeypWe6j33gzclHtwlANs26JrupOntlcWmB0u8+8HZo8s7thHvg==, tarball: https://hub.megan.ir/repository/npm/@esbuild/android-arm/-/android-arm-0.27.1.tgz} engines: {node: '>=18'} cpu: [arm] os: [android] '@esbuild/android-x64@0.27.1': - resolution: {integrity: sha512-LBEpOz0BsgMEeHgenf5aqmn/lLNTFXVfoWMUox8CtWWYK9X4jmQzWjoGoNb8lmAYml/tQ/Ysvm8q7szu7BoxRQ==} + resolution: {integrity: sha512-LBEpOz0BsgMEeHgenf5aqmn/lLNTFXVfoWMUox8CtWWYK9X4jmQzWjoGoNb8lmAYml/tQ/Ysvm8q7szu7BoxRQ==, tarball: https://hub.megan.ir/repository/npm/@esbuild/android-x64/-/android-x64-0.27.1.tgz} engines: {node: '>=18'} cpu: [x64] os: [android] '@esbuild/darwin-arm64@0.27.1': - resolution: {integrity: sha512-veg7fL8eMSCVKL7IW4pxb54QERtedFDfY/ASrumK/SbFsXnRazxY4YykN/THYqFnFwJ0aVjiUrVG2PwcdAEqQQ==} + resolution: {integrity: sha512-veg7fL8eMSCVKL7IW4pxb54QERtedFDfY/ASrumK/SbFsXnRazxY4YykN/THYqFnFwJ0aVjiUrVG2PwcdAEqQQ==, tarball: https://hub.megan.ir/repository/npm/@esbuild/darwin-arm64/-/darwin-arm64-0.27.1.tgz} engines: {node: '>=18'} cpu: [arm64] os: [darwin] '@esbuild/darwin-x64@0.27.1': - resolution: {integrity: sha512-+3ELd+nTzhfWb07Vol7EZ+5PTbJ/u74nC6iv4/lwIU99Ip5uuY6QoIf0Hn4m2HoV0qcnRivN3KSqc+FyCHjoVQ==} + resolution: {integrity: sha512-+3ELd+nTzhfWb07Vol7EZ+5PTbJ/u74nC6iv4/lwIU99Ip5uuY6QoIf0Hn4m2HoV0qcnRivN3KSqc+FyCHjoVQ==, tarball: https://hub.megan.ir/repository/npm/@esbuild/darwin-x64/-/darwin-x64-0.27.1.tgz} engines: {node: '>=18'} cpu: [x64] os: [darwin] '@esbuild/freebsd-arm64@0.27.1': - resolution: {integrity: sha512-/8Rfgns4XD9XOSXlzUDepG8PX+AVWHliYlUkFI3K3GB6tqbdjYqdhcb4BKRd7C0BhZSoaCxhv8kTcBrcZWP+xg==} + resolution: {integrity: sha512-/8Rfgns4XD9XOSXlzUDepG8PX+AVWHliYlUkFI3K3GB6tqbdjYqdhcb4BKRd7C0BhZSoaCxhv8kTcBrcZWP+xg==, tarball: https://hub.megan.ir/repository/npm/@esbuild/freebsd-arm64/-/freebsd-arm64-0.27.1.tgz} engines: {node: '>=18'} cpu: [arm64] os: [freebsd] '@esbuild/freebsd-x64@0.27.1': - resolution: {integrity: sha512-GITpD8dK9C+r+5yRT/UKVT36h/DQLOHdwGVwwoHidlnA168oD3uxA878XloXebK4Ul3gDBBIvEdL7go9gCUFzQ==} + resolution: {integrity: sha512-GITpD8dK9C+r+5yRT/UKVT36h/DQLOHdwGVwwoHidlnA168oD3uxA878XloXebK4Ul3gDBBIvEdL7go9gCUFzQ==, tarball: https://hub.megan.ir/repository/npm/@esbuild/freebsd-x64/-/freebsd-x64-0.27.1.tgz} engines: {node: '>=18'} cpu: [x64] os: [freebsd] '@esbuild/linux-arm64@0.27.1': - resolution: {integrity: sha512-W9//kCrh/6in9rWIBdKaMtuTTzNj6jSeG/haWBADqLLa9P8O5YSRDzgD5y9QBok4AYlzS6ARHifAb75V6G670Q==} + resolution: {integrity: sha512-W9//kCrh/6in9rWIBdKaMtuTTzNj6jSeG/haWBADqLLa9P8O5YSRDzgD5y9QBok4AYlzS6ARHifAb75V6G670Q==, tarball: https://hub.megan.ir/repository/npm/@esbuild/linux-arm64/-/linux-arm64-0.27.1.tgz} engines: {node: '>=18'} cpu: [arm64] os: [linux] '@esbuild/linux-arm@0.27.1': - resolution: {integrity: sha512-ieMID0JRZY/ZeCrsFQ3Y3NlHNCqIhTprJfDgSB3/lv5jJZ8FX3hqPyXWhe+gvS5ARMBJ242PM+VNz/ctNj//eA==} + resolution: {integrity: sha512-ieMID0JRZY/ZeCrsFQ3Y3NlHNCqIhTprJfDgSB3/lv5jJZ8FX3hqPyXWhe+gvS5ARMBJ242PM+VNz/ctNj//eA==, tarball: https://hub.megan.ir/repository/npm/@esbuild/linux-arm/-/linux-arm-0.27.1.tgz} engines: {node: '>=18'} cpu: [arm] os: [linux] '@esbuild/linux-ia32@0.27.1': - resolution: {integrity: sha512-VIUV4z8GD8rtSVMfAj1aXFahsi/+tcoXXNYmXgzISL+KB381vbSTNdeZHHHIYqFyXcoEhu9n5cT+05tRv13rlw==} + resolution: {integrity: sha512-VIUV4z8GD8rtSVMfAj1aXFahsi/+tcoXXNYmXgzISL+KB381vbSTNdeZHHHIYqFyXcoEhu9n5cT+05tRv13rlw==, tarball: https://hub.megan.ir/repository/npm/@esbuild/linux-ia32/-/linux-ia32-0.27.1.tgz} engines: {node: '>=18'} cpu: [ia32] os: [linux] '@esbuild/linux-loong64@0.27.1': - resolution: {integrity: sha512-l4rfiiJRN7sTNI//ff65zJ9z8U+k6zcCg0LALU5iEWzY+a1mVZ8iWC1k5EsNKThZ7XCQ6YWtsZ8EWYm7r1UEsg==} + resolution: {integrity: sha512-l4rfiiJRN7sTNI//ff65zJ9z8U+k6zcCg0LALU5iEWzY+a1mVZ8iWC1k5EsNKThZ7XCQ6YWtsZ8EWYm7r1UEsg==, tarball: https://hub.megan.ir/repository/npm/@esbuild/linux-loong64/-/linux-loong64-0.27.1.tgz} engines: {node: '>=18'} cpu: [loong64] os: [linux] '@esbuild/linux-mips64el@0.27.1': - resolution: {integrity: sha512-U0bEuAOLvO/DWFdygTHWY8C067FXz+UbzKgxYhXC0fDieFa0kDIra1FAhsAARRJbvEyso8aAqvPdNxzWuStBnA==} + resolution: {integrity: sha512-U0bEuAOLvO/DWFdygTHWY8C067FXz+UbzKgxYhXC0fDieFa0kDIra1FAhsAARRJbvEyso8aAqvPdNxzWuStBnA==, tarball: https://hub.megan.ir/repository/npm/@esbuild/linux-mips64el/-/linux-mips64el-0.27.1.tgz} engines: {node: '>=18'} cpu: [mips64el] os: [linux] '@esbuild/linux-ppc64@0.27.1': - resolution: {integrity: sha512-NzdQ/Xwu6vPSf/GkdmRNsOfIeSGnh7muundsWItmBsVpMoNPVpM61qNzAVY3pZ1glzzAxLR40UyYM23eaDDbYQ==} + resolution: {integrity: sha512-NzdQ/Xwu6vPSf/GkdmRNsOfIeSGnh7muundsWItmBsVpMoNPVpM61qNzAVY3pZ1glzzAxLR40UyYM23eaDDbYQ==, tarball: https://hub.megan.ir/repository/npm/@esbuild/linux-ppc64/-/linux-ppc64-0.27.1.tgz} engines: {node: '>=18'} cpu: [ppc64] os: [linux] '@esbuild/linux-riscv64@0.27.1': - resolution: {integrity: sha512-7zlw8p3IApcsN7mFw0O1Z1PyEk6PlKMu18roImfl3iQHTnr/yAfYv6s4hXPidbDoI2Q0pW+5xeoM4eTCC0UdrQ==} + resolution: {integrity: sha512-7zlw8p3IApcsN7mFw0O1Z1PyEk6PlKMu18roImfl3iQHTnr/yAfYv6s4hXPidbDoI2Q0pW+5xeoM4eTCC0UdrQ==, tarball: https://hub.megan.ir/repository/npm/@esbuild/linux-riscv64/-/linux-riscv64-0.27.1.tgz} engines: {node: '>=18'} cpu: [riscv64] os: [linux] '@esbuild/linux-s390x@0.27.1': - resolution: {integrity: sha512-cGj5wli+G+nkVQdZo3+7FDKC25Uh4ZVwOAK6A06Hsvgr8WqBBuOy/1s+PUEd/6Je+vjfm6stX0kmib5b/O2Ykw==} + resolution: {integrity: sha512-cGj5wli+G+nkVQdZo3+7FDKC25Uh4ZVwOAK6A06Hsvgr8WqBBuOy/1s+PUEd/6Je+vjfm6stX0kmib5b/O2Ykw==, tarball: https://hub.megan.ir/repository/npm/@esbuild/linux-s390x/-/linux-s390x-0.27.1.tgz} engines: {node: '>=18'} cpu: [s390x] os: [linux] '@esbuild/linux-x64@0.27.1': - resolution: {integrity: sha512-z3H/HYI9MM0HTv3hQZ81f+AKb+yEoCRlUby1F80vbQ5XdzEMyY/9iNlAmhqiBKw4MJXwfgsh7ERGEOhrM1niMA==} + resolution: {integrity: sha512-z3H/HYI9MM0HTv3hQZ81f+AKb+yEoCRlUby1F80vbQ5XdzEMyY/9iNlAmhqiBKw4MJXwfgsh7ERGEOhrM1niMA==, tarball: https://hub.megan.ir/repository/npm/@esbuild/linux-x64/-/linux-x64-0.27.1.tgz} engines: {node: '>=18'} cpu: [x64] os: [linux] '@esbuild/netbsd-arm64@0.27.1': - resolution: {integrity: sha512-wzC24DxAvk8Em01YmVXyjl96Mr+ecTPyOuADAvjGg+fyBpGmxmcr2E5ttf7Im8D0sXZihpxzO1isus8MdjMCXQ==} + resolution: {integrity: sha512-wzC24DxAvk8Em01YmVXyjl96Mr+ecTPyOuADAvjGg+fyBpGmxmcr2E5ttf7Im8D0sXZihpxzO1isus8MdjMCXQ==, tarball: https://hub.megan.ir/repository/npm/@esbuild/netbsd-arm64/-/netbsd-arm64-0.27.1.tgz} engines: {node: '>=18'} cpu: [arm64] os: [netbsd] '@esbuild/netbsd-x64@0.27.1': - resolution: {integrity: sha512-1YQ8ybGi2yIXswu6eNzJsrYIGFpnlzEWRl6iR5gMgmsrR0FcNoV1m9k9sc3PuP5rUBLshOZylc9nqSgymI+TYg==} + resolution: {integrity: sha512-1YQ8ybGi2yIXswu6eNzJsrYIGFpnlzEWRl6iR5gMgmsrR0FcNoV1m9k9sc3PuP5rUBLshOZylc9nqSgymI+TYg==, tarball: https://hub.megan.ir/repository/npm/@esbuild/netbsd-x64/-/netbsd-x64-0.27.1.tgz} engines: {node: '>=18'} cpu: [x64] os: [netbsd] '@esbuild/openbsd-arm64@0.27.1': - resolution: {integrity: sha512-5Z+DzLCrq5wmU7RDaMDe2DVXMRm2tTDvX2KU14JJVBN2CT/qov7XVix85QoJqHltpvAOZUAc3ndU56HSMWrv8g==} + resolution: {integrity: sha512-5Z+DzLCrq5wmU7RDaMDe2DVXMRm2tTDvX2KU14JJVBN2CT/qov7XVix85QoJqHltpvAOZUAc3ndU56HSMWrv8g==, tarball: https://hub.megan.ir/repository/npm/@esbuild/openbsd-arm64/-/openbsd-arm64-0.27.1.tgz} engines: {node: '>=18'} cpu: [arm64] os: [openbsd] '@esbuild/openbsd-x64@0.27.1': - resolution: {integrity: sha512-Q73ENzIdPF5jap4wqLtsfh8YbYSZ8Q0wnxplOlZUOyZy7B4ZKW8DXGWgTCZmF8VWD7Tciwv5F4NsRf6vYlZtqg==} + resolution: {integrity: sha512-Q73ENzIdPF5jap4wqLtsfh8YbYSZ8Q0wnxplOlZUOyZy7B4ZKW8DXGWgTCZmF8VWD7Tciwv5F4NsRf6vYlZtqg==, tarball: https://hub.megan.ir/repository/npm/@esbuild/openbsd-x64/-/openbsd-x64-0.27.1.tgz} engines: {node: '>=18'} cpu: [x64] os: [openbsd] '@esbuild/openharmony-arm64@0.27.1': - resolution: {integrity: sha512-ajbHrGM/XiK+sXM0JzEbJAen+0E+JMQZ2l4RR4VFwvV9JEERx+oxtgkpoKv1SevhjavK2z2ReHk32pjzktWbGg==} + resolution: {integrity: sha512-ajbHrGM/XiK+sXM0JzEbJAen+0E+JMQZ2l4RR4VFwvV9JEERx+oxtgkpoKv1SevhjavK2z2ReHk32pjzktWbGg==, tarball: https://hub.megan.ir/repository/npm/@esbuild/openharmony-arm64/-/openharmony-arm64-0.27.1.tgz} engines: {node: '>=18'} cpu: [arm64] os: [openharmony] '@esbuild/sunos-x64@0.27.1': - resolution: {integrity: sha512-IPUW+y4VIjuDVn+OMzHc5FV4GubIwPnsz6ubkvN8cuhEqH81NovB53IUlrlBkPMEPxvNnf79MGBoz8rZ2iW8HA==} + resolution: {integrity: sha512-IPUW+y4VIjuDVn+OMzHc5FV4GubIwPnsz6ubkvN8cuhEqH81NovB53IUlrlBkPMEPxvNnf79MGBoz8rZ2iW8HA==, tarball: https://hub.megan.ir/repository/npm/@esbuild/sunos-x64/-/sunos-x64-0.27.1.tgz} engines: {node: '>=18'} cpu: [x64] os: [sunos] '@esbuild/win32-arm64@0.27.1': - resolution: {integrity: sha512-RIVRWiljWA6CdVu8zkWcRmGP7iRRIIwvhDKem8UMBjPql2TXM5PkDVvvrzMtj1V+WFPB4K7zkIGM7VzRtFkjdg==} + resolution: {integrity: sha512-RIVRWiljWA6CdVu8zkWcRmGP7iRRIIwvhDKem8UMBjPql2TXM5PkDVvvrzMtj1V+WFPB4K7zkIGM7VzRtFkjdg==, tarball: https://hub.megan.ir/repository/npm/@esbuild/win32-arm64/-/win32-arm64-0.27.1.tgz} engines: {node: '>=18'} cpu: [arm64] os: [win32] '@esbuild/win32-ia32@0.27.1': - resolution: {integrity: sha512-2BR5M8CPbptC1AK5JbJT1fWrHLvejwZidKx3UMSF0ecHMa+smhi16drIrCEggkgviBwLYd5nwrFLSl5Kho96RQ==} + resolution: {integrity: sha512-2BR5M8CPbptC1AK5JbJT1fWrHLvejwZidKx3UMSF0ecHMa+smhi16drIrCEggkgviBwLYd5nwrFLSl5Kho96RQ==, tarball: https://hub.megan.ir/repository/npm/@esbuild/win32-ia32/-/win32-ia32-0.27.1.tgz} engines: {node: '>=18'} cpu: [ia32] os: [win32] '@esbuild/win32-x64@0.27.1': - resolution: {integrity: sha512-d5X6RMYv6taIymSk8JBP+nxv8DQAMY6A51GPgusqLdK9wBz5wWIXy1KjTck6HnjE9hqJzJRdk+1p/t5soSbCtw==} + resolution: {integrity: sha512-d5X6RMYv6taIymSk8JBP+nxv8DQAMY6A51GPgusqLdK9wBz5wWIXy1KjTck6HnjE9hqJzJRdk+1p/t5soSbCtw==, tarball: https://hub.megan.ir/repository/npm/@esbuild/win32-x64/-/win32-x64-0.27.1.tgz} engines: {node: '>=18'} cpu: [x64] os: [win32] @@ -893,7 +896,7 @@ packages: engines: {node: '>=16'} '@napi-rs/wasm-runtime@0.2.12': - resolution: {integrity: sha512-ZVWUcfwY4E/yPitQJl481FjFo3K22D6qF0DuFH6Y/nbnE11GY5uguDxZMGXPQ8WQ0128MXQD7TnfHyK4oWoIJQ==} + resolution: {integrity: sha512-ZVWUcfwY4E/yPitQJl481FjFo3K22D6qF0DuFH6Y/nbnE11GY5uguDxZMGXPQ8WQ0128MXQD7TnfHyK4oWoIJQ==, tarball: https://hub.megan.ir/repository/npm/@napi-rs/wasm-runtime/-/wasm-runtime-0.2.12.tgz} '@nestjs/cli@11.0.14': resolution: {integrity: sha512-YwP03zb5VETTwelXU+AIzMVbEZKk/uxJL+z9pw0mdG9ogAtqZ6/mpmIM4nEq/NU8D0a7CBRLcMYUmWW/55pfqw==} @@ -1011,7 +1014,7 @@ packages: resolution: {integrity: sha512-XO7cAxhnTZl0Yggq6jOgjiOHhbgcO4NqFqwSmQpjK3b6TEE6Uj/jfSk6wzYyemh3+I0sHirKSetjQwn5cZktFw==} '@pkgjs/parseargs@0.11.0': - resolution: {integrity: sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==} + resolution: {integrity: sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==, tarball: https://hub.megan.ir/repository/npm/@pkgjs/parseargs/-/parseargs-0.11.0.tgz} engines: {node: '>=14'} '@pkgr/core@0.2.9': @@ -1117,7 +1120,7 @@ packages: resolution: {integrity: sha512-vxhUy4J8lyeyinH7Azl1pdd43GJhZH/tP2weN8TntQblOY+A0XbT8DJk1/oCPuOOyg/Ja757rG0CgHcWC8OfMA==} '@tybys/wasm-util@0.10.1': - resolution: {integrity: sha512-9tTaPJLSiejZKx+Bmog4uSubteqTvFrVrURwkmHixBo0G4seD0zUxp98E1DzUBJxLQ3NPwXrGKDiVjwx/DpPsg==} + resolution: {integrity: sha512-9tTaPJLSiejZKx+Bmog4uSubteqTvFrVrURwkmHixBo0G4seD0zUxp98E1DzUBJxLQ3NPwXrGKDiVjwx/DpPsg==, tarball: https://hub.megan.ir/repository/npm/@tybys/wasm-util/-/wasm-util-0.10.1.tgz} '@types/babel__core@7.20.5': resolution: {integrity: sha512-qoQprZvz5wQFJwMDqeseRXWv3rqMvhgpbXFfVyWhbx9X47POIA6i/+dXefEmZKoAgOaTdaIgNSMqMIU61yRyzA==} @@ -1140,6 +1143,11 @@ packages: '@types/connect@3.4.38': resolution: {integrity: sha512-K6uROf1LD88uDQqJCktA4yzL1YYAK6NgfsI0v/mTgyPKWsX1CnJ0XPSDhViejru1GcRkLWb8RlzFYJRqGUbaug==} + '@types/cookie-parser@1.4.10': + resolution: {integrity: sha512-B4xqkqfZ8Wek+rCOeRxsjMS9OgvzebEzzLYw7NHYuvzb7IdxOkI0ZHGgeEBX4PUM7QGVvNSK60T3OvWj3YfBRg==, tarball: https://hub.megan.ir/repository/npm/@types/cookie-parser/-/cookie-parser-1.4.10.tgz} + peerDependencies: + '@types/express': '*' + '@types/cookiejar@2.1.5': resolution: {integrity: sha512-he+DHOWReW0nghN24E1WUqM0efK4kI9oTqDm6XmK8ZPe2djZ90BSNdGnIyCLzCPw7/pogPlGbzI2wHGGmi4O/Q==} @@ -1204,7 +1212,7 @@ packages: resolution: {integrity: sha512-hKormJbkJqzQGhziax5PItDUTMAM9uE2XXQmM37dyd4hVM+5aVl7oVxMVUiVQn2oCQFN/LKCZdvSM0pFRqbSmQ==} '@types/react@19.2.7': - resolution: {integrity: sha512-MWtvHrGZLFttgeEj28VXHxpmwYbor/ATPYbBfSFZEIRK0ecCFLl2Qo55z52Hss+UV9CRN7trSeq1zbgx7YDWWg==} + resolution: {integrity: sha512-MWtvHrGZLFttgeEj28VXHxpmwYbor/ATPYbBfSFZEIRK0ecCFLl2Qo55z52Hss+UV9CRN7trSeq1zbgx7YDWWg==, tarball: https://hub.megan.ir/repository/npm/@types/react/-/react-19.2.7.tgz} '@types/send@1.2.1': resolution: {integrity: sha512-arsCikDvlU99zl1g69TcAB3mzZPpxgw0UQnaHeC1Nwb015xp8bknZv5rIfri9xTOcMuaVgvabfIRA7PSZVuZIQ==} @@ -1293,97 +1301,105 @@ packages: resolution: {integrity: sha512-WmoN8qaIAo7WTYWbAZuG8PYEhn5fkz7dZrqTBZ7dtt//lL2Gwms1IcnQ5yHqjDfX8Ft5j4YzDM23f87zBfDe9g==} '@unrs/resolver-binding-android-arm-eabi@1.11.1': - resolution: {integrity: sha512-ppLRUgHVaGRWUx0R0Ut06Mjo9gBaBkg3v/8AxusGLhsIotbBLuRk51rAzqLC8gq6NyyAojEXglNjzf6R948DNw==} + resolution: {integrity: sha512-ppLRUgHVaGRWUx0R0Ut06Mjo9gBaBkg3v/8AxusGLhsIotbBLuRk51rAzqLC8gq6NyyAojEXglNjzf6R948DNw==, tarball: https://hub.megan.ir/repository/npm/@unrs/resolver-binding-android-arm-eabi/-/resolver-binding-android-arm-eabi-1.11.1.tgz} cpu: [arm] os: [android] '@unrs/resolver-binding-android-arm64@1.11.1': - resolution: {integrity: sha512-lCxkVtb4wp1v+EoN+HjIG9cIIzPkX5OtM03pQYkG+U5O/wL53LC4QbIeazgiKqluGeVEeBlZahHalCaBvU1a2g==} + resolution: {integrity: sha512-lCxkVtb4wp1v+EoN+HjIG9cIIzPkX5OtM03pQYkG+U5O/wL53LC4QbIeazgiKqluGeVEeBlZahHalCaBvU1a2g==, tarball: https://hub.megan.ir/repository/npm/@unrs/resolver-binding-android-arm64/-/resolver-binding-android-arm64-1.11.1.tgz} cpu: [arm64] os: [android] '@unrs/resolver-binding-darwin-arm64@1.11.1': - resolution: {integrity: sha512-gPVA1UjRu1Y/IsB/dQEsp2V1pm44Of6+LWvbLc9SDk1c2KhhDRDBUkQCYVWe6f26uJb3fOK8saWMgtX8IrMk3g==} + resolution: {integrity: sha512-gPVA1UjRu1Y/IsB/dQEsp2V1pm44Of6+LWvbLc9SDk1c2KhhDRDBUkQCYVWe6f26uJb3fOK8saWMgtX8IrMk3g==, tarball: https://hub.megan.ir/repository/npm/@unrs/resolver-binding-darwin-arm64/-/resolver-binding-darwin-arm64-1.11.1.tgz} cpu: [arm64] os: [darwin] '@unrs/resolver-binding-darwin-x64@1.11.1': - resolution: {integrity: sha512-cFzP7rWKd3lZaCsDze07QX1SC24lO8mPty9vdP+YVa3MGdVgPmFc59317b2ioXtgCMKGiCLxJ4HQs62oz6GfRQ==} + resolution: {integrity: sha512-cFzP7rWKd3lZaCsDze07QX1SC24lO8mPty9vdP+YVa3MGdVgPmFc59317b2ioXtgCMKGiCLxJ4HQs62oz6GfRQ==, tarball: https://hub.megan.ir/repository/npm/@unrs/resolver-binding-darwin-x64/-/resolver-binding-darwin-x64-1.11.1.tgz} cpu: [x64] os: [darwin] '@unrs/resolver-binding-freebsd-x64@1.11.1': - resolution: {integrity: sha512-fqtGgak3zX4DCB6PFpsH5+Kmt/8CIi4Bry4rb1ho6Av2QHTREM+47y282Uqiu3ZRF5IQioJQ5qWRV6jduA+iGw==} + resolution: {integrity: sha512-fqtGgak3zX4DCB6PFpsH5+Kmt/8CIi4Bry4rb1ho6Av2QHTREM+47y282Uqiu3ZRF5IQioJQ5qWRV6jduA+iGw==, tarball: https://hub.megan.ir/repository/npm/@unrs/resolver-binding-freebsd-x64/-/resolver-binding-freebsd-x64-1.11.1.tgz} cpu: [x64] os: [freebsd] '@unrs/resolver-binding-linux-arm-gnueabihf@1.11.1': - resolution: {integrity: sha512-u92mvlcYtp9MRKmP+ZvMmtPN34+/3lMHlyMj7wXJDeXxuM0Vgzz0+PPJNsro1m3IZPYChIkn944wW8TYgGKFHw==} + resolution: {integrity: sha512-u92mvlcYtp9MRKmP+ZvMmtPN34+/3lMHlyMj7wXJDeXxuM0Vgzz0+PPJNsro1m3IZPYChIkn944wW8TYgGKFHw==, tarball: https://hub.megan.ir/repository/npm/@unrs/resolver-binding-linux-arm-gnueabihf/-/resolver-binding-linux-arm-gnueabihf-1.11.1.tgz} cpu: [arm] os: [linux] '@unrs/resolver-binding-linux-arm-musleabihf@1.11.1': - resolution: {integrity: sha512-cINaoY2z7LVCrfHkIcmvj7osTOtm6VVT16b5oQdS4beibX2SYBwgYLmqhBjA1t51CarSaBuX5YNsWLjsqfW5Cw==} + resolution: {integrity: sha512-cINaoY2z7LVCrfHkIcmvj7osTOtm6VVT16b5oQdS4beibX2SYBwgYLmqhBjA1t51CarSaBuX5YNsWLjsqfW5Cw==, tarball: https://hub.megan.ir/repository/npm/@unrs/resolver-binding-linux-arm-musleabihf/-/resolver-binding-linux-arm-musleabihf-1.11.1.tgz} cpu: [arm] os: [linux] '@unrs/resolver-binding-linux-arm64-gnu@1.11.1': - resolution: {integrity: sha512-34gw7PjDGB9JgePJEmhEqBhWvCiiWCuXsL9hYphDF7crW7UgI05gyBAi6MF58uGcMOiOqSJ2ybEeCvHcq0BCmQ==} + resolution: {integrity: sha512-34gw7PjDGB9JgePJEmhEqBhWvCiiWCuXsL9hYphDF7crW7UgI05gyBAi6MF58uGcMOiOqSJ2ybEeCvHcq0BCmQ==, tarball: https://hub.megan.ir/repository/npm/@unrs/resolver-binding-linux-arm64-gnu/-/resolver-binding-linux-arm64-gnu-1.11.1.tgz} cpu: [arm64] os: [linux] + libc: [glibc] '@unrs/resolver-binding-linux-arm64-musl@1.11.1': - resolution: {integrity: sha512-RyMIx6Uf53hhOtJDIamSbTskA99sPHS96wxVE/bJtePJJtpdKGXO1wY90oRdXuYOGOTuqjT8ACccMc4K6QmT3w==} + resolution: {integrity: sha512-RyMIx6Uf53hhOtJDIamSbTskA99sPHS96wxVE/bJtePJJtpdKGXO1wY90oRdXuYOGOTuqjT8ACccMc4K6QmT3w==, tarball: https://hub.megan.ir/repository/npm/@unrs/resolver-binding-linux-arm64-musl/-/resolver-binding-linux-arm64-musl-1.11.1.tgz} cpu: [arm64] os: [linux] + libc: [musl] '@unrs/resolver-binding-linux-ppc64-gnu@1.11.1': - resolution: {integrity: sha512-D8Vae74A4/a+mZH0FbOkFJL9DSK2R6TFPC9M+jCWYia/q2einCubX10pecpDiTmkJVUH+y8K3BZClycD8nCShA==} + resolution: {integrity: sha512-D8Vae74A4/a+mZH0FbOkFJL9DSK2R6TFPC9M+jCWYia/q2einCubX10pecpDiTmkJVUH+y8K3BZClycD8nCShA==, tarball: https://hub.megan.ir/repository/npm/@unrs/resolver-binding-linux-ppc64-gnu/-/resolver-binding-linux-ppc64-gnu-1.11.1.tgz} cpu: [ppc64] os: [linux] + libc: [glibc] '@unrs/resolver-binding-linux-riscv64-gnu@1.11.1': - resolution: {integrity: sha512-frxL4OrzOWVVsOc96+V3aqTIQl1O2TjgExV4EKgRY09AJ9leZpEg8Ak9phadbuX0BA4k8U5qtvMSQQGGmaJqcQ==} + resolution: {integrity: sha512-frxL4OrzOWVVsOc96+V3aqTIQl1O2TjgExV4EKgRY09AJ9leZpEg8Ak9phadbuX0BA4k8U5qtvMSQQGGmaJqcQ==, tarball: https://hub.megan.ir/repository/npm/@unrs/resolver-binding-linux-riscv64-gnu/-/resolver-binding-linux-riscv64-gnu-1.11.1.tgz} cpu: [riscv64] os: [linux] + libc: [glibc] '@unrs/resolver-binding-linux-riscv64-musl@1.11.1': - resolution: {integrity: sha512-mJ5vuDaIZ+l/acv01sHoXfpnyrNKOk/3aDoEdLO/Xtn9HuZlDD6jKxHlkN8ZhWyLJsRBxfv9GYM2utQ1SChKew==} + resolution: {integrity: sha512-mJ5vuDaIZ+l/acv01sHoXfpnyrNKOk/3aDoEdLO/Xtn9HuZlDD6jKxHlkN8ZhWyLJsRBxfv9GYM2utQ1SChKew==, tarball: https://hub.megan.ir/repository/npm/@unrs/resolver-binding-linux-riscv64-musl/-/resolver-binding-linux-riscv64-musl-1.11.1.tgz} cpu: [riscv64] os: [linux] + libc: [musl] '@unrs/resolver-binding-linux-s390x-gnu@1.11.1': - resolution: {integrity: sha512-kELo8ebBVtb9sA7rMe1Cph4QHreByhaZ2QEADd9NzIQsYNQpt9UkM9iqr2lhGr5afh885d/cB5QeTXSbZHTYPg==} + resolution: {integrity: sha512-kELo8ebBVtb9sA7rMe1Cph4QHreByhaZ2QEADd9NzIQsYNQpt9UkM9iqr2lhGr5afh885d/cB5QeTXSbZHTYPg==, tarball: https://hub.megan.ir/repository/npm/@unrs/resolver-binding-linux-s390x-gnu/-/resolver-binding-linux-s390x-gnu-1.11.1.tgz} cpu: [s390x] os: [linux] + libc: [glibc] '@unrs/resolver-binding-linux-x64-gnu@1.11.1': - resolution: {integrity: sha512-C3ZAHugKgovV5YvAMsxhq0gtXuwESUKc5MhEtjBpLoHPLYM+iuwSj3lflFwK3DPm68660rZ7G8BMcwSro7hD5w==} + resolution: {integrity: sha512-C3ZAHugKgovV5YvAMsxhq0gtXuwESUKc5MhEtjBpLoHPLYM+iuwSj3lflFwK3DPm68660rZ7G8BMcwSro7hD5w==, tarball: https://hub.megan.ir/repository/npm/@unrs/resolver-binding-linux-x64-gnu/-/resolver-binding-linux-x64-gnu-1.11.1.tgz} cpu: [x64] os: [linux] + libc: [glibc] '@unrs/resolver-binding-linux-x64-musl@1.11.1': - resolution: {integrity: sha512-rV0YSoyhK2nZ4vEswT/QwqzqQXw5I6CjoaYMOX0TqBlWhojUf8P94mvI7nuJTeaCkkds3QE4+zS8Ko+GdXuZtA==} + resolution: {integrity: sha512-rV0YSoyhK2nZ4vEswT/QwqzqQXw5I6CjoaYMOX0TqBlWhojUf8P94mvI7nuJTeaCkkds3QE4+zS8Ko+GdXuZtA==, tarball: https://hub.megan.ir/repository/npm/@unrs/resolver-binding-linux-x64-musl/-/resolver-binding-linux-x64-musl-1.11.1.tgz} cpu: [x64] os: [linux] + libc: [musl] '@unrs/resolver-binding-wasm32-wasi@1.11.1': - resolution: {integrity: sha512-5u4RkfxJm+Ng7IWgkzi3qrFOvLvQYnPBmjmZQ8+szTK/b31fQCnleNl1GgEt7nIsZRIf5PLhPwT0WM+q45x/UQ==} + resolution: {integrity: sha512-5u4RkfxJm+Ng7IWgkzi3qrFOvLvQYnPBmjmZQ8+szTK/b31fQCnleNl1GgEt7nIsZRIf5PLhPwT0WM+q45x/UQ==, tarball: https://hub.megan.ir/repository/npm/@unrs/resolver-binding-wasm32-wasi/-/resolver-binding-wasm32-wasi-1.11.1.tgz} engines: {node: '>=14.0.0'} cpu: [wasm32] '@unrs/resolver-binding-win32-arm64-msvc@1.11.1': - resolution: {integrity: sha512-nRcz5Il4ln0kMhfL8S3hLkxI85BXs3o8EYoattsJNdsX4YUU89iOkVn7g0VHSRxFuVMdM4Q1jEpIId1Ihim/Uw==} + resolution: {integrity: sha512-nRcz5Il4ln0kMhfL8S3hLkxI85BXs3o8EYoattsJNdsX4YUU89iOkVn7g0VHSRxFuVMdM4Q1jEpIId1Ihim/Uw==, tarball: https://hub.megan.ir/repository/npm/@unrs/resolver-binding-win32-arm64-msvc/-/resolver-binding-win32-arm64-msvc-1.11.1.tgz} cpu: [arm64] os: [win32] '@unrs/resolver-binding-win32-ia32-msvc@1.11.1': - resolution: {integrity: sha512-DCEI6t5i1NmAZp6pFonpD5m7i6aFrpofcp4LA2i8IIq60Jyo28hamKBxNrZcyOwVOZkgsRp9O2sXWBWP8MnvIQ==} + resolution: {integrity: sha512-DCEI6t5i1NmAZp6pFonpD5m7i6aFrpofcp4LA2i8IIq60Jyo28hamKBxNrZcyOwVOZkgsRp9O2sXWBWP8MnvIQ==, tarball: https://hub.megan.ir/repository/npm/@unrs/resolver-binding-win32-ia32-msvc/-/resolver-binding-win32-ia32-msvc-1.11.1.tgz} cpu: [ia32] os: [win32] '@unrs/resolver-binding-win32-x64-msvc@1.11.1': - resolution: {integrity: sha512-lrW200hZdbfRtztbygyaq/6jP6AKE8qQN2KvPcJ+x7wiD038YtnYtZ82IMNJ69GJibV7bwL3y9FgK+5w/pYt6g==} + resolution: {integrity: sha512-lrW200hZdbfRtztbygyaq/6jP6AKE8qQN2KvPcJ+x7wiD038YtnYtZ82IMNJ69GJibV7bwL3y9FgK+5w/pYt6g==, tarball: https://hub.megan.ir/repository/npm/@unrs/resolver-binding-win32-x64-msvc/-/resolver-binding-win32-x64-msvc-1.11.1.tgz} cpu: [x64] os: [win32] @@ -1832,7 +1848,7 @@ packages: engines: {node: '>= 8'} csstype@3.2.3: - resolution: {integrity: sha512-z1HGKcYy2xA8AGQfwrn0PAy+PB7X/GSj3UVJW9qKyn43xWa+gl5nXmU4qqLMRzWVLFC8KusUX8T/0kCiOYpAIQ==} + resolution: {integrity: sha512-z1HGKcYy2xA8AGQfwrn0PAy+PB7X/GSj3UVJW9qKyn43xWa+gl5nXmU4qqLMRzWVLFC8KusUX8T/0kCiOYpAIQ==, tarball: https://hub.megan.ir/repository/npm/csstype/-/csstype-3.2.3.tgz} dayjs@1.11.19: resolution: {integrity: sha512-t5EcLVS6QPBNqM2z8fakk/NKel+Xzshgt8FFKAn+qwlD1pzZWxh0nVCrvFK7ZDb6XucZeF9z8C7CBWTRIVApAw==} @@ -2196,7 +2212,7 @@ packages: resolution: {integrity: sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==} fsevents@2.3.3: - resolution: {integrity: sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==} + resolution: {integrity: sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==, tarball: https://hub.megan.ir/repository/npm/fsevents/-/fsevents-2.3.3.tgz} engines: {node: ^8.16.0 || ^10.6.0 || >=11.0.0} os: [darwin] @@ -3087,7 +3103,7 @@ packages: resolution: {integrity: sha512-btXCnMmRIBINM2LDZoEmOogIZU7Qe7zn4BpomSKZ/ykbLObuBdvG+mFq11DL6fjH1DRwHhrlgtYWG96bJiC7Cg==} react-dom@19.2.1: - resolution: {integrity: sha512-ibrK8llX2a4eOskq1mXKu/TGZj9qzomO+sNfO98M6d9zIPOEhlBkMkBUBLd1vgS0gQsLDBzA+8jJBVXDnfHmJg==} + resolution: {integrity: sha512-ibrK8llX2a4eOskq1mXKu/TGZj9qzomO+sNfO98M6d9zIPOEhlBkMkBUBLd1vgS0gQsLDBzA+8jJBVXDnfHmJg==, tarball: https://hub.megan.ir/repository/npm/react-dom/-/react-dom-19.2.1.tgz} peerDependencies: react: ^19.2.1 @@ -3095,7 +3111,7 @@ packages: resolution: {integrity: sha512-/LLMVyas0ljjAtoYiPqYiL8VWXzUUdThrmU5+n20DZv+a+ClRoevUzw5JxU+Ieh5/c87ytoTBV9G1FiKfNJdmg==} react@19.2.1: - resolution: {integrity: sha512-DGrYcCWK7tvYMnWh79yrPHt+vdx9tY+1gPZa7nJQtO/p8bLTDaHp4dzwEhQB7pZ4Xe3ok4XKuEPrVuc+wlpkmw==} + resolution: {integrity: sha512-DGrYcCWK7tvYMnWh79yrPHt+vdx9tY+1gPZa7nJQtO/p8bLTDaHp4dzwEhQB7pZ4Xe3ok4XKuEPrVuc+wlpkmw==, tarball: https://hub.megan.ir/repository/npm/react/-/react-19.2.1.tgz} engines: {node: '>=0.10.0'} readable-stream@3.6.2: @@ -3163,7 +3179,7 @@ packages: resolution: {integrity: sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==} scheduler@0.27.0: - resolution: {integrity: sha512-eNv+WrVbKu1f3vbYJT/xtiF5syA5HPIMtf9IgY/nKg0sWqzAUEvqY/xm7OcZc/qafLx/iO9FgOmeSAp4v5ti/Q==} + resolution: {integrity: sha512-eNv+WrVbKu1f3vbYJT/xtiF5syA5HPIMtf9IgY/nKg0sWqzAUEvqY/xm7OcZc/qafLx/iO9FgOmeSAp4v5ti/Q==, tarball: https://hub.megan.ir/repository/npm/scheduler/-/scheduler-0.27.0.tgz} schema-utils@3.3.0: resolution: {integrity: sha512-pN/yOAvcC+5rQ5nERGuwrjLlYvLTbCibnZ1I7B1LaiAz9BRBlE9GMgE/eqV30P7aJQUf7Ddimy/RsbYO/GrVGg==} @@ -3506,7 +3522,7 @@ packages: hasBin: true uglify-js@3.19.3: - resolution: {integrity: sha512-v3Xu+yuwBXisp6QYTcH4UbH+xYJXqnq2m/LtQVWKWzYc1iehYnLixoQDN9FH6/j9/oybfd6W9Ghwkl8+UMKTKQ==} + resolution: {integrity: sha512-v3Xu+yuwBXisp6QYTcH4UbH+xYJXqnq2m/LtQVWKWzYc1iehYnLixoQDN9FH6/j9/oybfd6W9Ghwkl8+UMKTKQ==, tarball: https://hub.megan.ir/repository/npm/uglify-js/-/uglify-js-3.19.3.tgz} engines: {node: '>=0.8.0'} hasBin: true @@ -4779,6 +4795,10 @@ snapshots: dependencies: '@types/node': 22.19.1 + '@types/cookie-parser@1.4.10(@types/express@5.0.6)': + dependencies: + '@types/express': 5.0.6 + '@types/cookiejar@2.1.5': {} '@types/eslint-scope@3.7.7': diff --git a/prisma/migrations/20260329141805_init/migration.sql b/prisma/migrations/20260329141805_init/migration.sql new file mode 100644 index 0000000..3959da6 --- /dev/null +++ b/prisma/migrations/20260329141805_init/migration.sql @@ -0,0 +1,26 @@ +/* + Warnings: + + - You are about to drop the column `complex_id` on the `customers` table. All the data in the column will be lost. + - You are about to drop the column `complex_id` on the `sales_invoices` table. All the data in the column will be lost. + - Added the required column `pos_id` to the `sales_invoices` table without a default value. This is not possible if the table is not empty. + +*/ +-- AlterTable +ALTER TABLE `customers` DROP COLUMN `complex_id`; + +-- AlterTable +ALTER TABLE `sales_invoices` DROP COLUMN `complex_id`, + ADD COLUMN `pos_id` VARCHAR(191) NOT NULL; + +-- AddForeignKey +ALTER TABLE `customer_individuals` ADD CONSTRAINT `customer_individuals_complex_id_fkey` FOREIGN KEY (`complex_id`) REFERENCES `complexes`(`id`) ON DELETE RESTRICT ON UPDATE CASCADE; + +-- AddForeignKey +ALTER TABLE `customer_legal` ADD CONSTRAINT `customer_legal_complex_id_fkey` FOREIGN KEY (`complex_id`) REFERENCES `complexes`(`id`) ON DELETE RESTRICT 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_invoices` ADD CONSTRAINT `sales_invoices_account_id_fkey` FOREIGN KEY (`account_id`) REFERENCES `consumer_accounts`(`id`) ON DELETE RESTRICT ON UPDATE CASCADE; diff --git a/prisma/schema/admin/consumers.prisma b/prisma/schema/admin/consumers.prisma index 4fa5c72..6a587ee 100644 --- a/prisma/schema/admin/consumers.prisma +++ b/prisma/schema/admin/consumers.prisma @@ -27,7 +27,8 @@ model ConsumerAccount { account_id String @unique account Account @relation(fields: [account_id], references: [id]) - permissions PermissionConsumer[] + permissions PermissionConsumer[] + salesInvoices SalesInvoice[] @@map("consumer_accounts") } @@ -67,6 +68,8 @@ model Complex { goods Good[] good_categories GoodCategory[] permissionComplexes PermissionComplex[] + customerIndividuals CustomerIndividual[] + customerLegals CustomerLegal[] @@map("complexes") } @@ -92,6 +95,7 @@ model Pos { licenses License[] permissionPos PermissionPos[] + salesInvoices SalesInvoice[] @@map("poses") } diff --git a/prisma/schema/shared/customers.prisma b/prisma/schema/shared/customers.prisma index fddec2a..001a8a9 100644 --- a/prisma/schema/shared/customers.prisma +++ b/prisma/schema/shared/customers.prisma @@ -1,15 +1,15 @@ model Customer { id String @id @default(uuid()) - created_at DateTime @default(now()) @db.Timestamp(0) - updated_at DateTime @updatedAt @db.Timestamp(0) - deleted_at DateTime? @db.Timestamp(0) type CustomerType - complex_id String is_favorite Boolean? @default(false) - sales_invoices SalesInvoice[] - customerIndividuals CustomerIndividual? - customerLegals CustomerLegal? + created_at DateTime @default(now()) @db.Timestamp(0) + updated_at DateTime @updatedAt @db.Timestamp(0) + deleted_at DateTime? @db.Timestamp(0) + + sales_invoices SalesInvoice[] + customer_individuals CustomerIndividual? + customer_legals CustomerLegal? @@map("customers") } @@ -24,6 +24,7 @@ model CustomerIndividual { complex_id String customer Customer @relation(fields: [customer_id], references: [id]) + complex Complex @relation(fields: [complex_id], references: [id]) @@unique([complex_id, national_id]) @@map("customer_individuals") @@ -38,6 +39,7 @@ model CustomerLegal { complex_id String customer Customer @relation(fields: [customer_id], references: [id]) + complex Complex @relation(fields: [complex_id], references: [id]) @@unique([complex_id, registration_number]) @@map("customer_legal") diff --git a/prisma/schema/shared/sales.prisma b/prisma/schema/shared/sales.prisma index 7311680..c70079e 100644 --- a/prisma/schema/shared/sales.prisma +++ b/prisma/schema/shared/sales.prisma @@ -10,9 +10,11 @@ model SalesInvoice { customer_id String? account_id String - complex_id String + pos_id String customer Customer? @relation(fields: [customer_id], references: [id]) + pos Pos @relation(fields: [pos_id], references: [id]) + account ConsumerAccount @relation(fields: [account_id], references: [id]) items SalesInvoiceItem[] payments SalesInvoicePayment[] diff --git a/req.d.ts b/req.d.ts index 47bad14..5493a7b 100644 --- a/req.d.ts +++ b/req.d.ts @@ -1,12 +1,15 @@ -import { AccessTokenPayload } from '@/modules/auth/models' +import { IPosPayload } from '@/common/models/posPayload.model' +import { AccessTokenPayload } from '@/common/models/tokenPayload.model' declare global { interface Request { decodedToken: AccessTokenPayload + posData: IPosPayload } namespace Express { interface Request { decodedToken: AccessTokenPayload + posData: IPosPayload } } } diff --git a/src/app.module.ts b/src/app.module.ts index 9fc9ff1..84c7d92 100644 --- a/src/app.module.ts +++ b/src/app.module.ts @@ -9,7 +9,6 @@ import { EnumsModule } from './modules/enums/enums.module' import { PosModule } from './modules/pos/pos.module' import { SalesInvoiceItemsModule } from './modules/pos/sales-invoices/sales-invoice-items/sales-invoice-items.module' import { SalesInvoicePaymentsModule } from './modules/pos/sales-invoices/sales-invoice-payments/sales-invoice-payments.module' -import { ProfileModule } from './modules/profile/profile.module' import { ServiceCategoriesModule } from './modules/service-categories/service-categories.module' import { ServicesModule } from './modules/services/services.module' import { TriggerLogsModule } from './modules/trigger-logs/trigger-logs.module' @@ -31,7 +30,6 @@ import { PrismaModule } from './prisma/prisma.module' ServicesModule, TriggerLogsModule, UploadersModule, - ProfileModule, ], controllers: [AppController], providers: [AppService], diff --git a/src/common/decorators/posInfo.decorator.ts b/src/common/decorators/posInfo.decorator.ts new file mode 100644 index 0000000..1c53382 --- /dev/null +++ b/src/common/decorators/posInfo.decorator.ts @@ -0,0 +1,29 @@ +import { + BadRequestException, + createParamDecorator, + ExecutionContext, + UnauthorizedException, +} from '@nestjs/common' +import { Request } from 'express' +import { IPosPayload } from '../models/posPayload.model' + +export const PosInfo = createParamDecorator( + (data: keyof IPosPayload | undefined, ctx: ExecutionContext) => { + try { + const request = ctx.switchToHttp().getRequest() + const posInfo = request.posData + + if (!posInfo) { + throw new UnauthorizedException('شما به این بخش دسترسی ندارید') + } + + if (data) { + return posInfo[data] + } + + return posInfo + } catch (err) { + throw new BadRequestException('مشکلی در ساختار درخواست شما وجود دارد.') + } + }, +) diff --git a/src/common/decorators/tokenInfo.decorator.ts b/src/common/decorators/tokenInfo.decorator.ts index 6dfc310..08f776a 100644 --- a/src/common/decorators/tokenInfo.decorator.ts +++ b/src/common/decorators/tokenInfo.decorator.ts @@ -1,4 +1,4 @@ -import { AccessTokenPayload } from '@/modules/auth/models' +import { AccessTokenPayload } from '@/common/models/tokenPayload.model' import { BadRequestException, createParamDecorator, @@ -29,6 +29,8 @@ export const TokenAccount = createParamDecorator( // ✅ if called with no param — return full account object return account } catch (err) { + console.log(err) + throw new BadRequestException('مشکلی در ساختار درخواست شما وجود دارد.') } }, diff --git a/src/common/filters/validation-exception.filter.ts b/src/common/filters/validation-exception.filter.ts index f88c857..22d80e6 100644 --- a/src/common/filters/validation-exception.filter.ts +++ b/src/common/filters/validation-exception.filter.ts @@ -8,15 +8,11 @@ import { Response } from 'express' @Catch(BadRequestException) export class ValidationExceptionFilter implements ExceptionFilter { - constructor() { - console.log('ValidationExceptionFilter initialized') - } catch(exception: BadRequestException, host: ArgumentsHost) { const ctx = host.switchToHttp() const response = ctx.getResponse() const status = exception.getStatus() const exceptionResponse = exception.getResponse() - console.log(exception) response.status(status).json({ statusCode: status, diff --git a/src/common/guards/context.guard.ts b/src/common/guards/context.guard.ts deleted file mode 100644 index 440a2e3..0000000 --- a/src/common/guards/context.guard.ts +++ /dev/null @@ -1,57 +0,0 @@ -import { - CanActivate, - ExecutionContext, - Injectable, - UnauthorizedException, -} from '@nestjs/common' -import { Reflector } from '@nestjs/core' -import { JwtService } from '@nestjs/jwt' -import { IS_PUBLIC_KEY } from '../decorators/public.decorator' -import { IWithJWTPayloadRequest } from '../models/token-model' - -@Injectable() -export class JwtAuthGuard implements CanActivate { - constructor( - private jwt: JwtService, - private reflector: Reflector, - ) {} - - async canActivate(context: ExecutionContext): Promise { - const isPublic = this.reflector.getAllAndOverride(IS_PUBLIC_KEY, [ - context.getHandler(), - context.getClass(), - ]) - if (isPublic) return true - - const req = context.switchToHttp().getRequest() - - let token: string | undefined = req.cookies?.accessToken - if (!token) { - const authHeader = (req.headers.authorization || req.headers.Authorization) as - | string - | undefined - if (authHeader && authHeader.startsWith('Bearer ')) { - token = authHeader.slice(7) - } - } - - if (!token) throw new UnauthorizedException('Missing access token') - - try { - const payload = this.jwt.verify(token, { - secret: process.env.JWT_SECRET || 'secret', - }) - - if (payload.type !== 'POS') - throw new UnauthorizedException('Invalid or expired token') - - // Set the typed dataPayload to the request - req.dataPayload = payload - - return true - } catch (err) { - console.log(err) - throw new UnauthorizedException('Invalid or expired token') - } - } -} diff --git a/src/common/guards/jwt-auth.guard.ts b/src/common/guards/jwt-auth.guard.ts index b27c05c..b9f4342 100644 --- a/src/common/guards/jwt-auth.guard.ts +++ b/src/common/guards/jwt-auth.guard.ts @@ -6,8 +6,8 @@ import { } from '@nestjs/common' import { Reflector } from '@nestjs/core' import { JwtService } from '@nestjs/jwt' +import { Request as ExpressRequest } from 'express' import { IS_PUBLIC_KEY } from '../decorators/public.decorator' -import { IWithJWTPayloadRequest } from '../models/token-model' @Injectable() export class JwtAuthGuard implements CanActivate { @@ -23,7 +23,7 @@ export class JwtAuthGuard implements CanActivate { ]) if (isPublic) return true - const req = context.switchToHttp().getRequest() + const req = context.switchToHttp().getRequest() let token: string | undefined = req.cookies?.accessToken if (!token) { @@ -38,15 +38,15 @@ export class JwtAuthGuard implements CanActivate { if (!token) throw new UnauthorizedException('Missing access token') try { - const payload = this.jwt.verify(token, { - secret: process.env.JWT_SECRET || 'secret', + this.jwt.verify(token, { + secret: process.env.JWT_SECRET, }) // if (payload.type !== 'POS') // throw new UnauthorizedException('Invalid or expired token') // Set the typed dataPayload to the request - req.dataPayload = payload + // req.dataPayload = payload return true } catch (err) { diff --git a/src/common/guards/pos.gaurd.ts b/src/common/guards/pos.gaurd.ts new file mode 100644 index 0000000..2bcb924 --- /dev/null +++ b/src/common/guards/pos.gaurd.ts @@ -0,0 +1,130 @@ +// src/common/guards/permissions.guard.ts +import { PrismaService } from '@/prisma/prisma.service' +import { + CanActivate, + ExecutionContext, + ForbiddenException, + Injectable, +} from '@nestjs/common' +import { Reflector } from '@nestjs/core' +import { JwtService } from '@nestjs/jwt' +import { Request as ExpressRequest } from 'express' +import { IS_PUBLIC_KEY } from '../decorators/public.decorator' +import { checkAndDecodeJwtToken } from '../utils/jwt-user.util' + +@Injectable() +export class PosGuard implements CanActivate { + constructor( + private jwt: JwtService, + private reflector: Reflector, + private prisma: PrismaService, + ) {} + + async canActivate(context: ExecutionContext): Promise { + const isPublic = this.reflector.getAllAndOverride(IS_PUBLIC_KEY, [ + context.getHandler(), + context.getClass(), + ]) + if (isPublic) return true + + // const requiredPermissions = this.reflector.get( + // 'permissions', + // context.getHandler(), + // ) + // if (!requiredPermissions || requiredPermissions.length === 0) return true + + const req = context.switchToHttp().getRequest() + + const account = checkAndDecodeJwtToken(req, this.jwt) + // const account = req.decodedToken + + if (!req.url.startsWith('/api/v1/pos/')) { + return true + } + + if (!account || account.type !== 'CONSUMER') + throw new ForbiddenException('شما دسترسی لازم را ندارید.') + + const cookie = req.cookies + const { posId, accessToken } = cookie + + if (!posId || !accessToken) { + return false + } + + const pos = await this.prisma.pos.findUnique({ + where: { + id: posId, + complex: { + business_activity: { + user: { + accounts: { + some: { + account_id: account.account_id, + }, + }, + }, + }, + }, + }, + select: { + complex: { + select: { + id: true, + business_activity_id: true, + }, + }, + }, + }) + + if (!pos) { + throw new ForbiddenException('شما دسترسی لازم را ندارید.') + } + + const foundedAccount = await this.prisma.account.findUnique({ + where: { + id: account.account_id, + }, + select: { + consumer_account: { + select: { + role: true, + }, + }, + }, + }) + + if (foundedAccount?.consumer_account?.role === 'OWNER') { + return true + } + + const accountPermissions = await this.prisma.permissionConsumer.findUnique({ + where: { + account_id: account.account_id, + }, + select: { + posPermissions: true, + businessPermissions: true, + complexPermissions: true, + }, + }) + + if (accountPermissions?.posPermissions.some(p => p.pos_id === posId)) { + return true + } + if ( + accountPermissions?.complexPermissions.some(p => p.complex_id === pos.complex.id) + ) { + return true + } + if ( + accountPermissions?.businessPermissions.some( + p => p.business_id === pos.complex.business_activity_id, + ) + ) { + return true + } + + throw new ForbiddenException('شما دسترسی لازم را ندارید.') + } +} diff --git a/src/common/interfaces/sale-invoice-payload.ts b/src/common/interfaces/sale-invoice-payload.ts index d9993c6..00beab3 100644 --- a/src/common/interfaces/sale-invoice-payload.ts +++ b/src/common/interfaces/sale-invoice-payload.ts @@ -6,3 +6,5 @@ export interface SaleInvoiceGoldTypePayload { profit: number } export interface SaleInvoiceStandardPayload {} + +export type SaleInvoiceType = SaleInvoiceGoldTypePayload | SaleInvoiceStandardPayload diff --git a/src/common/models/posPayload.model.ts b/src/common/models/posPayload.model.ts new file mode 100644 index 0000000..7b6cbc1 --- /dev/null +++ b/src/common/models/posPayload.model.ts @@ -0,0 +1,7 @@ +export interface IPosPayload { + pos_id: string + complex_id: string + guild_id: string + business_id: string + consumer_account_id: string +} diff --git a/src/common/models/token-model.ts b/src/common/models/token-model.ts deleted file mode 100644 index 0eb17e6..0000000 --- a/src/common/models/token-model.ts +++ /dev/null @@ -1,29 +0,0 @@ -import { Request as ExpressRequest } from 'express' -import { AccountType } from '../enums/enums' - -export interface IWithJWTPayloadRequest extends ExpressRequest { - dataPayload?: AccessTokenPayload -} - -export interface AccessTokenPayload { - userId: string - mobile_number: string - type: AccountType - username: string - pos_id: number - pos_name: string - - complex_id: string - license_id: string - license_expired_at: string - // complex: { - // id: string - // name: string - // } - // license: { - // id: string - // starts_at: string - // expires_at: string - // status: string - // } -} diff --git a/src/modules/auth/models/index.ts b/src/common/models/tokenPayload.model.ts similarity index 56% rename from src/modules/auth/models/index.ts rename to src/common/models/tokenPayload.model.ts index c633ba1..89de22a 100644 --- a/src/modules/auth/models/index.ts +++ b/src/common/models/tokenPayload.model.ts @@ -1,9 +1,4 @@ -import { Request as ExpressRequest } from 'express' -import { AccountType } from '../../../generated/prisma/enums' - -export interface IWithJWTPayloadRequest extends ExpressRequest { - dataPayload?: AccessTokenPayload -} +import { AccountType } from '../../generated/prisma/enums' export interface AccessTokenPayload { account_id: string diff --git a/src/common/utils/jwt-user.util.ts b/src/common/utils/jwt-user.util.ts index 5f63f48..ea8fd6a 100644 --- a/src/common/utils/jwt-user.util.ts +++ b/src/common/utils/jwt-user.util.ts @@ -1,8 +1,8 @@ +import { AccessTokenPayload } from '@/common/models/tokenPayload.model' import { ITokenPayload } from '@/modules/auth/auth.utils' import { UnauthorizedException } from '@nestjs/common' import { JwtService } from '@nestjs/jwt' import { Request } from 'express' -import { AccessTokenPayload } from 'modules/auth/models' export function checkAndDecodeJwtToken( req: Request, diff --git a/src/generated/prisma/commonInputTypes.ts b/src/generated/prisma/commonInputTypes.ts index ff7eef1..b8983ef 100644 --- a/src/generated/prisma/commonInputTypes.ts +++ b/src/generated/prisma/commonInputTypes.ts @@ -385,17 +385,6 @@ export type IntWithAggregatesFilter<$PrismaModel = never> = { _max?: Prisma.NestedIntFilter<$PrismaModel> } -export type DateTimeNullableFilter<$PrismaModel = never> = { - equals?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> | null - in?: Date[] | string[] | null - notIn?: Date[] | string[] | null - lt?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> - lte?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> - gt?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> - gte?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> - not?: Prisma.NestedDateTimeNullableFilter<$PrismaModel> | Date | string | null -} - export type EnumCustomerTypeFilter<$PrismaModel = never> = { equals?: $Enums.CustomerType | Prisma.EnumCustomerTypeFieldRefInput<$PrismaModel> in?: $Enums.CustomerType[] @@ -408,7 +397,7 @@ export type BoolNullableFilter<$PrismaModel = never> = { not?: Prisma.NestedBoolNullableFilter<$PrismaModel> | boolean | null } -export type DateTimeNullableWithAggregatesFilter<$PrismaModel = never> = { +export type DateTimeNullableFilter<$PrismaModel = never> = { equals?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> | null in?: Date[] | string[] | null notIn?: Date[] | string[] | null @@ -416,10 +405,7 @@ export type DateTimeNullableWithAggregatesFilter<$PrismaModel = never> = { lte?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> gt?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> gte?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> - not?: Prisma.NestedDateTimeNullableWithAggregatesFilter<$PrismaModel> | Date | string | null - _count?: Prisma.NestedIntNullableFilter<$PrismaModel> - _min?: Prisma.NestedDateTimeNullableFilter<$PrismaModel> - _max?: Prisma.NestedDateTimeNullableFilter<$PrismaModel> + not?: Prisma.NestedDateTimeNullableFilter<$PrismaModel> | Date | string | null } export type EnumCustomerTypeWithAggregatesFilter<$PrismaModel = never> = { @@ -440,6 +426,20 @@ export type BoolNullableWithAggregatesFilter<$PrismaModel = never> = { _max?: Prisma.NestedBoolNullableFilter<$PrismaModel> } +export type DateTimeNullableWithAggregatesFilter<$PrismaModel = never> = { + equals?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> | null + in?: Date[] | string[] | null + notIn?: Date[] | string[] | null + lt?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> + lte?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> + gt?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> + gte?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> + not?: Prisma.NestedDateTimeNullableWithAggregatesFilter<$PrismaModel> | Date | string | null + _count?: Prisma.NestedIntNullableFilter<$PrismaModel> + _min?: Prisma.NestedDateTimeNullableFilter<$PrismaModel> + _max?: Prisma.NestedDateTimeNullableFilter<$PrismaModel> +} + export type BoolFilter<$PrismaModel = never> = { equals?: boolean | Prisma.BooleanFieldRefInput<$PrismaModel> not?: Prisma.NestedBoolFilter<$PrismaModel> | boolean @@ -997,17 +997,6 @@ export type NestedFloatFilter<$PrismaModel = never> = { not?: Prisma.NestedFloatFilter<$PrismaModel> | number } -export type NestedDateTimeNullableFilter<$PrismaModel = never> = { - equals?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> | null - in?: Date[] | string[] | null - notIn?: Date[] | string[] | null - lt?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> - lte?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> - gt?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> - gte?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> - not?: Prisma.NestedDateTimeNullableFilter<$PrismaModel> | Date | string | null -} - export type NestedEnumCustomerTypeFilter<$PrismaModel = never> = { equals?: $Enums.CustomerType | Prisma.EnumCustomerTypeFieldRefInput<$PrismaModel> in?: $Enums.CustomerType[] @@ -1020,7 +1009,7 @@ export type NestedBoolNullableFilter<$PrismaModel = never> = { not?: Prisma.NestedBoolNullableFilter<$PrismaModel> | boolean | null } -export type NestedDateTimeNullableWithAggregatesFilter<$PrismaModel = never> = { +export type NestedDateTimeNullableFilter<$PrismaModel = never> = { equals?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> | null in?: Date[] | string[] | null notIn?: Date[] | string[] | null @@ -1028,10 +1017,7 @@ export type NestedDateTimeNullableWithAggregatesFilter<$PrismaModel = never> = { lte?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> gt?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> gte?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> - not?: Prisma.NestedDateTimeNullableWithAggregatesFilter<$PrismaModel> | Date | string | null - _count?: Prisma.NestedIntNullableFilter<$PrismaModel> - _min?: Prisma.NestedDateTimeNullableFilter<$PrismaModel> - _max?: Prisma.NestedDateTimeNullableFilter<$PrismaModel> + not?: Prisma.NestedDateTimeNullableFilter<$PrismaModel> | Date | string | null } export type NestedEnumCustomerTypeWithAggregatesFilter<$PrismaModel = never> = { @@ -1052,6 +1038,20 @@ export type NestedBoolNullableWithAggregatesFilter<$PrismaModel = never> = { _max?: Prisma.NestedBoolNullableFilter<$PrismaModel> } +export type NestedDateTimeNullableWithAggregatesFilter<$PrismaModel = never> = { + equals?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> | null + in?: Date[] | string[] | null + notIn?: Date[] | string[] | null + lt?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> + lte?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> + gt?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> + gte?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> + not?: Prisma.NestedDateTimeNullableWithAggregatesFilter<$PrismaModel> | Date | string | null + _count?: Prisma.NestedIntNullableFilter<$PrismaModel> + _min?: Prisma.NestedDateTimeNullableFilter<$PrismaModel> + _max?: Prisma.NestedDateTimeNullableFilter<$PrismaModel> +} + export type NestedBoolFilter<$PrismaModel = never> = { equals?: boolean | Prisma.BooleanFieldRefInput<$PrismaModel> not?: Prisma.NestedBoolFilter<$PrismaModel> | boolean diff --git a/src/generated/prisma/internal/class.ts b/src/generated/prisma/internal/class.ts index 1383170..4357f3a 100644 --- a/src/generated/prisma/internal/class.ts +++ b/src/generated/prisma/internal/class.ts @@ -22,7 +22,7 @@ const config: runtime.GetPrismaClientConfig = { "clientVersion": "7.2.0", "engineVersion": "0c8ef2ce45c83248ab3df073180d5eda9e8be7a3", "activeProvider": "mysql", - "inlineSchema": "model Admin {\n id String @id @default(uuid())\n mobile_number String @unique()\n national_code String? @unique()\n first_name String\n last_name String\n\n created_at DateTime @default(now()) @db.Timestamp(0)\n updated_at DateTime @updatedAt() @db.Timestamp(0)\n\n accounts AdminAccount[]\n\n @@map(\"admins\")\n}\n\nmodel AdminAccount {\n id String @id @default(uuid())\n\n created_at DateTime @default(now()) @db.Timestamp(0)\n updated_at DateTime @updatedAt() @db.Timestamp(0)\n\n user_id String\n user Admin @relation(fields: [user_id], references: [id])\n\n account_id String @unique\n account Account @relation(fields: [account_id], references: [id])\n\n @@map(\"admin_accounts\")\n}\n\n// model LegalProfile {\n// user_id String @id\n// company_name String\n// register_no String @unique()\n// representative_name String?\n// representative_national_id String?\n\n// // user User @relation(fields: [user_id], references: [id])\n\n// @@map(\"legal_profiles\")\n// }\n\n// model IndividualProfile {\n// user_id String @id\n// national_code String @unique()\n// first_name String\n// last_name String\n// birth_date DateTime?\n// mobile_number String\n// // user User @relation(fields: [user_id], references: [id])\n\n// @@map(\"individual_profiles\")\n// }\n\nmodel Account {\n id String @id @default(uuid())\n username String @unique()\n password String @unique()\n status AccountStatus\n type AccountType\n\n admin_account AdminAccount?\n provider_account ProviderAccount?\n partner_account PartnerAccount?\n consumer_account ConsumerAccount?\n\n // tokens Token[]\n // refresh_tokens RefreshToken[]\n\n @@map(\"accounts\")\n}\n\n// model Token {\n// id String @id @d @uniqueefault(uuid())\n// token String @unique\n// type TokenType\n// created_at DateTime @default(now())\n// expires_at DateTime\n\n// account_id String\n// account Account @relation(fields: [account_id], references: [id])\n\n// @@unique([type, account_id])\n// @@map(\"tokens\")\n// }\n\n// model VerificationCode {\n// id String @id @default(uuid())\n// code String\n// is_used Boolean @default(false)\n// created_at DateTime @default(now())\n// expires_at DateTime\n\n// account_id String\n// account Account @relation(fields: [account_id], references: [id])\n\n// @@map(\"verification_codes\")\n// }\n\nmodel Consumer {\n id String @id @default(uuid())\n mobile_number String @unique()\n first_name String\n last_name String\n status ConsumerStatus @default(ACTIVE)\n\n created_at DateTime @default(now()) @db.Timestamp(0)\n updated_at DateTime @updatedAt() @db.Timestamp(0)\n\n accounts ConsumerAccount[]\n businessActivities BusinessActivity[]\n\n @@map(\"consumers\")\n}\n\nmodel ConsumerAccount {\n id String @id @default(uuid())\n role ConsumerRole\n\n created_at DateTime @default(now()) @db.Timestamp(0)\n updated_at DateTime @updatedAt() @db.Timestamp(0)\n\n user_id String\n user Consumer @relation(fields: [user_id], references: [id])\n\n account_id String @unique\n account Account @relation(fields: [account_id], references: [id])\n\n permissions PermissionConsumer[]\n\n @@map(\"consumer_accounts\")\n}\n\nmodel BusinessActivity {\n id String @id @default(uuid())\n name String\n created_at DateTime @default(now()) @db.Timestamp(0)\n updated_at DateTime @updatedAt() @db.Timestamp(0)\n\n guild_id String\n user_id String\n\n guild Guild @relation(fields: [guild_id], references: [id])\n user Consumer @relation(fields: [user_id], references: [id])\n\n complexes Complex[]\n permissionBusinesses PermissionBusiness[]\n\n @@map(\"business_activities\")\n}\n\nmodel Complex {\n id String @id @default(uuid())\n name String\n address String?\n tax_id String?\n\n created_at DateTime @default(now()) @db.Timestamp(0)\n updated_at DateTime @updatedAt() @db.Timestamp(0)\n\n business_activity_id String\n\n business_activity BusinessActivity @relation(fields: [business_activity_id], references: [id])\n\n pos_list Pos[]\n goods Good[]\n good_categories GoodCategory[]\n permissionComplexes PermissionComplex[]\n\n @@map(\"complexes\")\n}\n\nmodel Pos {\n id String @id @default(uuid())\n name String\n serial String @unique\n model String?\n status POSStatus @default(ACTIVE)\n pos_type POSType\n created_at DateTime @default(now()) @db.Timestamp(0)\n updated_at DateTime @updatedAt() @db.Timestamp(0)\n\n complex_id String\n complex Complex @relation(fields: [complex_id], references: [id])\n\n device_id String?\n device Device? @relation(fields: [device_id], references: [id])\n\n provider_id String?\n provider Provider? @relation(fields: [provider_id], references: [id])\n\n licenses License[]\n permissionPos PermissionPos[]\n\n @@map(\"poses\")\n}\n\n// model BusinessAccount {\n// id String @id @default(uuid())\n// role BusinessRole\n// status AccountStatus @default(ACTIVE)\n// created_at DateTime @default(now())\n// business_activity_id String\n// account_id String @unique\n\n// account Account @relation(fields: [account_id], references: [id])\n// owned_activities BusinessActivity[] @relation(\"business_owner\")\n\n// @@unique([business_activity_id, account_id])\n// @@map(\"business_accounts\")\n// }\n\n// model PosAccount {\n// id String @id @default(uuid())\n// pos_id String\n// account_id String\n// role POSRole\n// created_at DateTime @default(now())\n\n// pos Pos @relation(fields: [pos_id], references: [id])\n// account Account @relation(fields: [account_id], references: [id])\n\n// @@unique([pos_id, account_id])\n// @@map(\"pos_accounts\")\n// }\n\nmodel DeviceBrand {\n id String @id @default(uuid())\n name String\n\n created_at DateTime @default(now()) @db.Timestamp(0)\n updated_at DateTime @updatedAt() @db.Timestamp(0)\n\n devices Device[]\n\n @@map(\"device_brands\")\n}\n\nmodel Device {\n id String @id @default(uuid())\n name String\n os_version String?\n\n created_at DateTime @default(now()) @db.Timestamp(0)\n updated_at DateTime @updatedAt() @db.Timestamp(0)\n\n brand_id String\n\n brand DeviceBrand @relation(fields: [brand_id], references: [id])\n poses Pos[]\n\n @@map(\"devices\")\n}\n\nmodel License {\n id String @id @default(uuid())\n starts_at DateTime\n expires_at DateTime\n status LicenseStatus\n\n created_at DateTime @default(now()) @db.Timestamp(0)\n updated_at DateTime @updatedAt() @db.Timestamp(0)\n\n pos_id String\n partner_id String\n\n pos Pos @relation(fields: [pos_id], references: [id])\n partner Partner @relation(fields: [partner_id], references: [id])\n\n @@map(\"licenses\")\n}\n\nmodel Partner {\n id String @id @default(uuid())\n name String\n code String @unique()\n license_quota Int? @default(0)\n status PartnerStatus @default(ACTIVE)\n\n created_at DateTime @default(now()) @db.Timestamp(0)\n updated_at DateTime @default(now()) @updatedAt @db.Timestamp(0)\n\n licenses License[]\n accounts PartnerAccount[]\n\n @@map(\"partners\")\n}\n\nmodel PartnerAccount {\n id String @id @default(uuid())\n role PartnerRole\n\n created_at DateTime @default(now()) @db.Timestamp(0)\n updated_at DateTime @default(now()) @updatedAt @db.Timestamp(0)\n\n user_id String\n user Partner @relation(fields: [user_id], references: [id])\n\n account_id String @unique\n account Account @relation(fields: [account_id], references: [id])\n\n @@map(\"partner_accounts\")\n}\n\nmodel PermissionConsumer {\n id String @id @default(uuid())\n\n account_id String @unique\n\n account ConsumerAccount @relation(fields: [account_id], references: [id])\n\n posPermissions PermissionPos[]\n complexPermissions PermissionComplex[]\n businessPermissions PermissionBusiness[]\n\n @@map(\"permission_consumers\")\n}\n\nmodel PermissionPos {\n id String @id @default(uuid())\n role POSRole\n\n pos_id String\n permission_id String\n\n pos Pos @relation(fields: [pos_id], references: [id])\n permission PermissionConsumer @relation(fields: [permission_id], references: [id])\n\n @@unique([permission_id, pos_id])\n @@map(\"permission_poses\")\n}\n\nmodel PermissionComplex {\n id String @id @default(uuid())\n role ComplexRole\n\n complex_id String\n permission_id String\n\n complex Complex @relation(fields: [complex_id], references: [id])\n permission PermissionConsumer @relation(fields: [permission_id], references: [id])\n\n @@unique([permission_id, complex_id])\n @@map(\"permission_complexes\")\n}\n\nmodel PermissionBusiness {\n id String @id @default(uuid())\n role BusinessRole\n\n business_id String\n permission_id String\n\n business BusinessActivity @relation(fields: [business_id], references: [id])\n permission PermissionConsumer @relation(fields: [permission_id], references: [id])\n\n @@unique([permission_id, business_id])\n @@map(\"permission_business_activities\")\n}\n\nmodel Provider {\n id String @id @default(uuid())\n code String @unique()\n status PartnerStatus @default(ACTIVE)\n name String\n\n created_at DateTime @default(now()) @db.Timestamp(0)\n updated_at DateTime @updatedAt @db.Timestamp(0)\n\n pos_list Pos[]\n accounts ProviderAccount[]\n\n @@map(\"providers\")\n}\n\nmodel ProviderAccount {\n id String @id @default(uuid())\n role ProviderRole\n\n created_at DateTime @default(now()) @db.Timestamp(0)\n updated_at DateTime @updatedAt() @db.Timestamp(0)\n\n user_id String\n user Provider @relation(fields: [user_id], references: [id])\n\n account_id String @unique\n account Account @relation(fields: [account_id], references: [id])\n\n @@map(\"provider_accounts\")\n}\n\nmodel TriggerLog {\n id Int @id @default(autoincrement())\n message String @db.Text\n createdAt DateTime @default(now()) @db.Timestamp(0)\n name String @db.Text\n\n @@map(\"trigger_logs\")\n}\n\nmodel UserDevices {\n account_id String? @db.VarChar(255)\n app_version String @db.VarChar(20)\n build_number String @db.VarChar(20)\n\n uuid String @id @unique() @db.VarChar(255)\n platform String @db.VarChar(100)\n brand String @db.VarChar(100)\n model String @db.VarChar(100)\n device String @db.VarChar(100)\n os_version String @db.VarChar(20)\n sdk_version String @db.VarChar(20)\n release_number String @db.VarChar(20)\n browser_name String? @db.VarChar(100)\n fcm_token String? @db.VarChar(100)\n\n @@map(\"user_devices\")\n}\n\ngenerator client {\n provider = \"prisma-client\"\n output = \"../../src/generated/prisma\"\n moduleFormat = \"cjs\"\n previewFeatures = [\"views\"]\n}\n\ndatasource db {\n provider = \"mysql\"\n}\n\nmodel Customer {\n id String @id @default(uuid())\n created_at DateTime @default(now()) @db.Timestamp(0)\n updated_at DateTime @updatedAt @db.Timestamp(0)\n deleted_at DateTime? @db.Timestamp(0)\n type CustomerType\n complex_id String\n is_favorite Boolean? @default(false)\n\n sales_invoices SalesInvoice[]\n customerIndividuals CustomerIndividual?\n customerLegals CustomerLegal?\n\n @@map(\"customers\")\n}\n\nmodel CustomerIndividual {\n customer_id String @id\n first_name String @db.VarChar(255)\n last_name String @db.VarChar(255)\n national_id String @db.Char(10)\n postal_code String @db.Char(10)\n economic_code String? @db.Char(10)\n complex_id String\n\n customer Customer @relation(fields: [customer_id], references: [id])\n\n @@unique([complex_id, national_id])\n @@map(\"customer_individuals\")\n}\n\nmodel CustomerLegal {\n customer_id String @id\n company_name String @db.VarChar(255)\n economic_code String @db.Char(10)\n registration_number String @db.Char(20)\n postal_code String @db.Char(10)\n complex_id String\n\n customer Customer @relation(fields: [customer_id], references: [id])\n\n @@unique([complex_id, registration_number])\n @@map(\"customer_legal\")\n}\n\nenum PaymentMethodType {\n TERMINAL\n CASH\n SET_OFF\n CARD\n BANK\n CHECK\n OTHER\n}\n\nenum UnitType {\n COUNT\n GRAM\n KILOGRAM\n MILLILITER\n LITER\n METER\n HOUR\n}\n\nenum GoodPricingModel {\n STANDARD\n GOLD\n}\n\nenum CustomerType {\n INDIVIDUAL\n LEGAL\n UNKNOWN\n}\n\nenum POSStatus {\n ACTIVE\n DISABLED\n}\n\nenum POSRole {\n MANAGER\n OPERATOR\n}\n\nenum ComplexRole {\n MANAGER\n OPERATOR\n}\n\nenum BusinessRole {\n MANAGER\n OPERATOR\n}\n\nenum LicenseType {\n BASIC\n PRO\n ENTERPRISE\n}\n\nenum LicenseStatus {\n ACTIVE\n EXPIRED\n SUSPENDED\n}\n\nenum POSType {\n PSP\n MOBILE\n WEB\n API\n}\n\nenum UserType {\n LEGAL\n INDIVIDUAL\n}\n\nenum AccountType {\n ADMIN\n PROVIDER\n PARTNER\n CONSUMER\n}\n\nenum UserStatus {\n ACTIVE\n INACTIVE\n}\n\nenum AccountRole {\n OWNER\n OPERATOR\n ACCOUNTANT\n}\n\nenum AccountStatus {\n ACTIVE\n SUSPENDED\n}\n\nenum PartnerRole {\n OWNER\n MANAGER\n OPERATOR\n}\n\nenum PartnerStatus {\n ACTIVE\n SUSPENDED\n}\n\nenum ProviderRole {\n OWNER\n MANAGER\n OPERATOR\n}\n\nenum ProviderStatus {\n ACTIVE\n SUSPENDED\n}\n\nenum ConsumerRole {\n OWNER\n MANAGER\n OPERATOR\n}\n\nenum ConsumerStatus {\n ACTIVE\n SUSPENDED\n}\n\nenum TokenType {\n ACCESS\n REFRESH\n}\n\nmodel Good {\n id String @id @default(uuid())\n name String @db.VarChar(255)\n is_default_guild_good Boolean @default(false)\n sku String @db.VarChar(100)\n unit_type UnitType\n pricing_model GoodPricingModel\n description String? @db.Text\n local_sku String? @unique() @db.VarChar(100)\n barcode String? @unique() @db.VarChar(100)\n base_sale_price Decimal? @default(0.00) @db.Decimal(15, 0)\n created_at DateTime @default(now()) @db.Timestamp(0)\n updated_at DateTime @updatedAt @db.Timestamp(0)\n deleted_at DateTime? @db.Timestamp(0)\n\n complex_id String?\n category_id String?\n\n category GoodCategory? @relation(fields: [category_id], references: [id])\n complex Complex? @relation(fields: [complex_id], references: [id])\n sales_invoice_items SalesInvoiceItem[]\n\n @@index([category_id])\n @@map(\"goods\")\n}\n\nmodel GoodCategory {\n id String @id @default(uuid())\n name String @db.VarChar(100)\n description String? @db.Text\n image_url String? @db.VarChar(255)\n complex_id String?\n is_default_guild_good Boolean @default(false)\n guild_id String?\n\n created_at DateTime @default(now()) @db.Timestamp(0)\n updated_at DateTime @updatedAt @db.Timestamp(0)\n deleted_at DateTime? @db.Timestamp(0)\n\n goods Good[]\n guild Guild? @relation(fields: [guild_id], references: [id])\n complex Complex? @relation(fields: [complex_id], references: [id])\n\n @@map(\"good_categories\")\n}\n\nmodel Guild {\n id String @id @default(uuid())\n name String\n code String?\n\n created_at DateTime @default(now()) @db.Timestamp(0)\n updated_at DateTime @updatedAt() @db.Timestamp(0)\n\n business_activities BusinessActivity[]\n good_categories GoodCategory[]\n\n @@map(\"guilds\")\n}\n\nmodel SalesInvoice {\n id String @id @default(uuid())\n code String @unique @db.VarChar(100)\n total_amount Decimal @db.Decimal(15, 2)\n notes String? @db.Text\n unknown_customer Json? @db.Json\n invoice_date DateTime? @default(now()) @db.Timestamp(0)\n created_at DateTime @default(now()) @db.Timestamp(0)\n updated_at DateTime @updatedAt @db.Timestamp(0)\n\n customer_id String?\n account_id String\n complex_id String\n\n customer Customer? @relation(fields: [customer_id], references: [id])\n items SalesInvoiceItem[]\n payments SalesInvoicePayment[]\n\n @@map(\"sales_invoices\")\n}\n\nmodel SalesInvoiceItem {\n id String @id @default(uuid())\n quantity Decimal @db.Decimal(10, 0)\n unit_type UnitType\n unit_price Decimal @default(0.00) @db.Decimal(15, 2)\n total_amount Decimal @default(0.00) @db.Decimal(15, 2)\n created_at DateTime @default(now()) @db.Timestamp(0)\n discount Decimal @default(0.00) @db.Decimal(15, 2)\n notes String? @db.Text\n\n invoice_id String\n good_id String?\n service_id String?\n\n payload Json?\n\n invoice SalesInvoice @relation(fields: [invoice_id], references: [id])\n good Good? @relation(fields: [good_id], references: [id])\n service Service? @relation(fields: [service_id], references: [id])\n\n @@index([invoice_id, good_id])\n @@map(\"sales_invoice_items\")\n}\n\nmodel SalesInvoicePayment {\n id String @id @default(uuid())\n invoice_id String\n amount Decimal @db.Decimal(15, 2)\n payment_method PaymentMethodType\n paid_at DateTime\n created_at DateTime @default(now())\n\n invoice SalesInvoice @relation(fields: [invoice_id], references: [id])\n\n @@index([invoice_id])\n @@map(\"sales_invoice_payments\")\n}\n\nmodel Service {\n id String @id @default(uuid())\n name String @db.VarChar(255)\n description String? @db.Text\n sku String @unique() @db.VarChar(100)\n local_sku String? @unique() @db.VarChar(100)\n barcode String? @unique() @db.VarChar(100)\n created_at DateTime @default(now()) @db.Timestamp(0)\n updated_at DateTime @updatedAt @db.Timestamp(0)\n deleted_at DateTime? @db.Timestamp(0)\n category_id String?\n base_sale_price Decimal @default(0.00) @db.Decimal(15, 0)\n account_id String\n complex_id String\n\n category ServiceCategory? @relation(fields: [category_id], references: [id])\n sales_invoice_items SalesInvoiceItem[]\n\n @@index([category_id])\n @@map(\"services\")\n}\n\nmodel ServiceCategory {\n id String @id @default(uuid())\n name String @db.VarChar(100)\n description String? @db.Text\n image_url String? @db.VarChar(255)\n account_id String\n complex_id String\n created_at DateTime @default(now()) @db.Timestamp(0)\n updated_at DateTime @updatedAt @db.Timestamp(0)\n deleted_at DateTime? @db.Timestamp(0)\n\n services Service[]\n\n @@map(\"service_categories\")\n}\n", + "inlineSchema": "model Admin {\n id String @id @default(uuid())\n mobile_number String @unique()\n national_code String? @unique()\n first_name String\n last_name String\n\n created_at DateTime @default(now()) @db.Timestamp(0)\n updated_at DateTime @updatedAt() @db.Timestamp(0)\n\n accounts AdminAccount[]\n\n @@map(\"admins\")\n}\n\nmodel AdminAccount {\n id String @id @default(uuid())\n\n created_at DateTime @default(now()) @db.Timestamp(0)\n updated_at DateTime @updatedAt() @db.Timestamp(0)\n\n user_id String\n user Admin @relation(fields: [user_id], references: [id])\n\n account_id String @unique\n account Account @relation(fields: [account_id], references: [id])\n\n @@map(\"admin_accounts\")\n}\n\n// model LegalProfile {\n// user_id String @id\n// company_name String\n// register_no String @unique()\n// representative_name String?\n// representative_national_id String?\n\n// // user User @relation(fields: [user_id], references: [id])\n\n// @@map(\"legal_profiles\")\n// }\n\n// model IndividualProfile {\n// user_id String @id\n// national_code String @unique()\n// first_name String\n// last_name String\n// birth_date DateTime?\n// mobile_number String\n// // user User @relation(fields: [user_id], references: [id])\n\n// @@map(\"individual_profiles\")\n// }\n\nmodel Account {\n id String @id @default(uuid())\n username String @unique()\n password String @unique()\n status AccountStatus\n type AccountType\n\n admin_account AdminAccount?\n provider_account ProviderAccount?\n partner_account PartnerAccount?\n consumer_account ConsumerAccount?\n\n // tokens Token[]\n // refresh_tokens RefreshToken[]\n\n @@map(\"accounts\")\n}\n\n// model Token {\n// id String @id @d @uniqueefault(uuid())\n// token String @unique\n// type TokenType\n// created_at DateTime @default(now())\n// expires_at DateTime\n\n// account_id String\n// account Account @relation(fields: [account_id], references: [id])\n\n// @@unique([type, account_id])\n// @@map(\"tokens\")\n// }\n\n// model VerificationCode {\n// id String @id @default(uuid())\n// code String\n// is_used Boolean @default(false)\n// created_at DateTime @default(now())\n// expires_at DateTime\n\n// account_id String\n// account Account @relation(fields: [account_id], references: [id])\n\n// @@map(\"verification_codes\")\n// }\n\nmodel Consumer {\n id String @id @default(uuid())\n mobile_number String @unique()\n first_name String\n last_name String\n status ConsumerStatus @default(ACTIVE)\n\n created_at DateTime @default(now()) @db.Timestamp(0)\n updated_at DateTime @updatedAt() @db.Timestamp(0)\n\n accounts ConsumerAccount[]\n businessActivities BusinessActivity[]\n\n @@map(\"consumers\")\n}\n\nmodel ConsumerAccount {\n id String @id @default(uuid())\n role ConsumerRole\n\n created_at DateTime @default(now()) @db.Timestamp(0)\n updated_at DateTime @updatedAt() @db.Timestamp(0)\n\n user_id String\n user Consumer @relation(fields: [user_id], references: [id])\n\n account_id String @unique\n account Account @relation(fields: [account_id], references: [id])\n\n permissions PermissionConsumer[]\n salesInvoices SalesInvoice[]\n\n @@map(\"consumer_accounts\")\n}\n\nmodel BusinessActivity {\n id String @id @default(uuid())\n name String\n created_at DateTime @default(now()) @db.Timestamp(0)\n updated_at DateTime @updatedAt() @db.Timestamp(0)\n\n guild_id String\n user_id String\n\n guild Guild @relation(fields: [guild_id], references: [id])\n user Consumer @relation(fields: [user_id], references: [id])\n\n complexes Complex[]\n permissionBusinesses PermissionBusiness[]\n\n @@map(\"business_activities\")\n}\n\nmodel Complex {\n id String @id @default(uuid())\n name String\n address String?\n tax_id String?\n\n created_at DateTime @default(now()) @db.Timestamp(0)\n updated_at DateTime @updatedAt() @db.Timestamp(0)\n\n business_activity_id String\n\n business_activity BusinessActivity @relation(fields: [business_activity_id], references: [id])\n\n pos_list Pos[]\n goods Good[]\n good_categories GoodCategory[]\n permissionComplexes PermissionComplex[]\n customerIndividuals CustomerIndividual[]\n customerLegals CustomerLegal[]\n\n @@map(\"complexes\")\n}\n\nmodel Pos {\n id String @id @default(uuid())\n name String\n serial String @unique\n model String?\n status POSStatus @default(ACTIVE)\n pos_type POSType\n created_at DateTime @default(now()) @db.Timestamp(0)\n updated_at DateTime @updatedAt() @db.Timestamp(0)\n\n complex_id String\n complex Complex @relation(fields: [complex_id], references: [id])\n\n device_id String?\n device Device? @relation(fields: [device_id], references: [id])\n\n provider_id String?\n provider Provider? @relation(fields: [provider_id], references: [id])\n\n licenses License[]\n permissionPos PermissionPos[]\n salesInvoices SalesInvoice[]\n\n @@map(\"poses\")\n}\n\n// model BusinessAccount {\n// id String @id @default(uuid())\n// role BusinessRole\n// status AccountStatus @default(ACTIVE)\n// created_at DateTime @default(now())\n// business_activity_id String\n// account_id String @unique\n\n// account Account @relation(fields: [account_id], references: [id])\n// owned_activities BusinessActivity[] @relation(\"business_owner\")\n\n// @@unique([business_activity_id, account_id])\n// @@map(\"business_accounts\")\n// }\n\n// model PosAccount {\n// id String @id @default(uuid())\n// pos_id String\n// account_id String\n// role POSRole\n// created_at DateTime @default(now())\n\n// pos Pos @relation(fields: [pos_id], references: [id])\n// account Account @relation(fields: [account_id], references: [id])\n\n// @@unique([pos_id, account_id])\n// @@map(\"pos_accounts\")\n// }\n\nmodel DeviceBrand {\n id String @id @default(uuid())\n name String\n\n created_at DateTime @default(now()) @db.Timestamp(0)\n updated_at DateTime @updatedAt() @db.Timestamp(0)\n\n devices Device[]\n\n @@map(\"device_brands\")\n}\n\nmodel Device {\n id String @id @default(uuid())\n name String\n os_version String?\n\n created_at DateTime @default(now()) @db.Timestamp(0)\n updated_at DateTime @updatedAt() @db.Timestamp(0)\n\n brand_id String\n\n brand DeviceBrand @relation(fields: [brand_id], references: [id])\n poses Pos[]\n\n @@map(\"devices\")\n}\n\nmodel License {\n id String @id @default(uuid())\n starts_at DateTime\n expires_at DateTime\n status LicenseStatus\n\n created_at DateTime @default(now()) @db.Timestamp(0)\n updated_at DateTime @updatedAt() @db.Timestamp(0)\n\n pos_id String\n partner_id String\n\n pos Pos @relation(fields: [pos_id], references: [id])\n partner Partner @relation(fields: [partner_id], references: [id])\n\n @@map(\"licenses\")\n}\n\nmodel Partner {\n id String @id @default(uuid())\n name String\n code String @unique()\n license_quota Int? @default(0)\n status PartnerStatus @default(ACTIVE)\n\n created_at DateTime @default(now()) @db.Timestamp(0)\n updated_at DateTime @default(now()) @updatedAt @db.Timestamp(0)\n\n licenses License[]\n accounts PartnerAccount[]\n\n @@map(\"partners\")\n}\n\nmodel PartnerAccount {\n id String @id @default(uuid())\n role PartnerRole\n\n created_at DateTime @default(now()) @db.Timestamp(0)\n updated_at DateTime @default(now()) @updatedAt @db.Timestamp(0)\n\n user_id String\n user Partner @relation(fields: [user_id], references: [id])\n\n account_id String @unique\n account Account @relation(fields: [account_id], references: [id])\n\n @@map(\"partner_accounts\")\n}\n\nmodel PermissionConsumer {\n id String @id @default(uuid())\n\n account_id String @unique\n\n account ConsumerAccount @relation(fields: [account_id], references: [id])\n\n posPermissions PermissionPos[]\n complexPermissions PermissionComplex[]\n businessPermissions PermissionBusiness[]\n\n @@map(\"permission_consumers\")\n}\n\nmodel PermissionPos {\n id String @id @default(uuid())\n role POSRole\n\n pos_id String\n permission_id String\n\n pos Pos @relation(fields: [pos_id], references: [id])\n permission PermissionConsumer @relation(fields: [permission_id], references: [id])\n\n @@unique([permission_id, pos_id])\n @@map(\"permission_poses\")\n}\n\nmodel PermissionComplex {\n id String @id @default(uuid())\n role ComplexRole\n\n complex_id String\n permission_id String\n\n complex Complex @relation(fields: [complex_id], references: [id])\n permission PermissionConsumer @relation(fields: [permission_id], references: [id])\n\n @@unique([permission_id, complex_id])\n @@map(\"permission_complexes\")\n}\n\nmodel PermissionBusiness {\n id String @id @default(uuid())\n role BusinessRole\n\n business_id String\n permission_id String\n\n business BusinessActivity @relation(fields: [business_id], references: [id])\n permission PermissionConsumer @relation(fields: [permission_id], references: [id])\n\n @@unique([permission_id, business_id])\n @@map(\"permission_business_activities\")\n}\n\nmodel Provider {\n id String @id @default(uuid())\n code String @unique()\n status PartnerStatus @default(ACTIVE)\n name String\n\n created_at DateTime @default(now()) @db.Timestamp(0)\n updated_at DateTime @updatedAt @db.Timestamp(0)\n\n pos_list Pos[]\n accounts ProviderAccount[]\n\n @@map(\"providers\")\n}\n\nmodel ProviderAccount {\n id String @id @default(uuid())\n role ProviderRole\n\n created_at DateTime @default(now()) @db.Timestamp(0)\n updated_at DateTime @updatedAt() @db.Timestamp(0)\n\n user_id String\n user Provider @relation(fields: [user_id], references: [id])\n\n account_id String @unique\n account Account @relation(fields: [account_id], references: [id])\n\n @@map(\"provider_accounts\")\n}\n\nmodel TriggerLog {\n id Int @id @default(autoincrement())\n message String @db.Text\n createdAt DateTime @default(now()) @db.Timestamp(0)\n name String @db.Text\n\n @@map(\"trigger_logs\")\n}\n\nmodel UserDevices {\n account_id String? @db.VarChar(255)\n app_version String @db.VarChar(20)\n build_number String @db.VarChar(20)\n\n uuid String @id @unique() @db.VarChar(255)\n platform String @db.VarChar(100)\n brand String @db.VarChar(100)\n model String @db.VarChar(100)\n device String @db.VarChar(100)\n os_version String @db.VarChar(20)\n sdk_version String @db.VarChar(20)\n release_number String @db.VarChar(20)\n browser_name String? @db.VarChar(100)\n fcm_token String? @db.VarChar(100)\n\n @@map(\"user_devices\")\n}\n\ngenerator client {\n provider = \"prisma-client\"\n output = \"../../src/generated/prisma\"\n moduleFormat = \"cjs\"\n previewFeatures = [\"views\"]\n}\n\ndatasource db {\n provider = \"mysql\"\n}\n\nmodel Customer {\n id String @id @default(uuid())\n type CustomerType\n is_favorite Boolean? @default(false)\n\n created_at DateTime @default(now()) @db.Timestamp(0)\n updated_at DateTime @updatedAt @db.Timestamp(0)\n deleted_at DateTime? @db.Timestamp(0)\n\n sales_invoices SalesInvoice[]\n customer_individuals CustomerIndividual?\n customer_legals CustomerLegal?\n\n @@map(\"customers\")\n}\n\nmodel CustomerIndividual {\n customer_id String @id\n first_name String @db.VarChar(255)\n last_name String @db.VarChar(255)\n national_id String @db.Char(10)\n postal_code String @db.Char(10)\n economic_code String? @db.Char(10)\n complex_id String\n\n customer Customer @relation(fields: [customer_id], references: [id])\n complex Complex @relation(fields: [complex_id], references: [id])\n\n @@unique([complex_id, national_id])\n @@map(\"customer_individuals\")\n}\n\nmodel CustomerLegal {\n customer_id String @id\n company_name String @db.VarChar(255)\n economic_code String @db.Char(10)\n registration_number String @db.Char(20)\n postal_code String @db.Char(10)\n complex_id String\n\n customer Customer @relation(fields: [customer_id], references: [id])\n complex Complex @relation(fields: [complex_id], references: [id])\n\n @@unique([complex_id, registration_number])\n @@map(\"customer_legal\")\n}\n\nenum PaymentMethodType {\n TERMINAL\n CASH\n SET_OFF\n CARD\n BANK\n CHECK\n OTHER\n}\n\nenum UnitType {\n COUNT\n GRAM\n KILOGRAM\n MILLILITER\n LITER\n METER\n HOUR\n}\n\nenum GoodPricingModel {\n STANDARD\n GOLD\n}\n\nenum CustomerType {\n INDIVIDUAL\n LEGAL\n UNKNOWN\n}\n\nenum POSStatus {\n ACTIVE\n DISABLED\n}\n\nenum POSRole {\n MANAGER\n OPERATOR\n}\n\nenum ComplexRole {\n MANAGER\n OPERATOR\n}\n\nenum BusinessRole {\n MANAGER\n OPERATOR\n}\n\nenum LicenseType {\n BASIC\n PRO\n ENTERPRISE\n}\n\nenum LicenseStatus {\n ACTIVE\n EXPIRED\n SUSPENDED\n}\n\nenum POSType {\n PSP\n MOBILE\n WEB\n API\n}\n\nenum UserType {\n LEGAL\n INDIVIDUAL\n}\n\nenum AccountType {\n ADMIN\n PROVIDER\n PARTNER\n CONSUMER\n}\n\nenum UserStatus {\n ACTIVE\n INACTIVE\n}\n\nenum AccountRole {\n OWNER\n OPERATOR\n ACCOUNTANT\n}\n\nenum AccountStatus {\n ACTIVE\n SUSPENDED\n}\n\nenum PartnerRole {\n OWNER\n MANAGER\n OPERATOR\n}\n\nenum PartnerStatus {\n ACTIVE\n SUSPENDED\n}\n\nenum ProviderRole {\n OWNER\n MANAGER\n OPERATOR\n}\n\nenum ProviderStatus {\n ACTIVE\n SUSPENDED\n}\n\nenum ConsumerRole {\n OWNER\n MANAGER\n OPERATOR\n}\n\nenum ConsumerStatus {\n ACTIVE\n SUSPENDED\n}\n\nenum TokenType {\n ACCESS\n REFRESH\n}\n\nmodel Good {\n id String @id @default(uuid())\n name String @db.VarChar(255)\n is_default_guild_good Boolean @default(false)\n sku String @db.VarChar(100)\n unit_type UnitType\n pricing_model GoodPricingModel\n description String? @db.Text\n local_sku String? @unique() @db.VarChar(100)\n barcode String? @unique() @db.VarChar(100)\n base_sale_price Decimal? @default(0.00) @db.Decimal(15, 0)\n created_at DateTime @default(now()) @db.Timestamp(0)\n updated_at DateTime @updatedAt @db.Timestamp(0)\n deleted_at DateTime? @db.Timestamp(0)\n\n complex_id String?\n category_id String?\n\n category GoodCategory? @relation(fields: [category_id], references: [id])\n complex Complex? @relation(fields: [complex_id], references: [id])\n sales_invoice_items SalesInvoiceItem[]\n\n @@index([category_id])\n @@map(\"goods\")\n}\n\nmodel GoodCategory {\n id String @id @default(uuid())\n name String @db.VarChar(100)\n description String? @db.Text\n image_url String? @db.VarChar(255)\n complex_id String?\n is_default_guild_good Boolean @default(false)\n guild_id String?\n\n created_at DateTime @default(now()) @db.Timestamp(0)\n updated_at DateTime @updatedAt @db.Timestamp(0)\n deleted_at DateTime? @db.Timestamp(0)\n\n goods Good[]\n guild Guild? @relation(fields: [guild_id], references: [id])\n complex Complex? @relation(fields: [complex_id], references: [id])\n\n @@map(\"good_categories\")\n}\n\nmodel Guild {\n id String @id @default(uuid())\n name String\n code String?\n\n created_at DateTime @default(now()) @db.Timestamp(0)\n updated_at DateTime @updatedAt() @db.Timestamp(0)\n\n business_activities BusinessActivity[]\n good_categories GoodCategory[]\n\n @@map(\"guilds\")\n}\n\nmodel SalesInvoice {\n id String @id @default(uuid())\n code String @unique @db.VarChar(100)\n total_amount Decimal @db.Decimal(15, 2)\n notes String? @db.Text\n unknown_customer Json? @db.Json\n invoice_date DateTime? @default(now()) @db.Timestamp(0)\n created_at DateTime @default(now()) @db.Timestamp(0)\n updated_at DateTime @updatedAt @db.Timestamp(0)\n\n customer_id String?\n account_id String\n pos_id String\n\n customer Customer? @relation(fields: [customer_id], references: [id])\n pos Pos @relation(fields: [pos_id], references: [id])\n account ConsumerAccount @relation(fields: [account_id], references: [id])\n items SalesInvoiceItem[]\n payments SalesInvoicePayment[]\n\n @@map(\"sales_invoices\")\n}\n\nmodel SalesInvoiceItem {\n id String @id @default(uuid())\n quantity Decimal @db.Decimal(10, 0)\n unit_type UnitType\n unit_price Decimal @default(0.00) @db.Decimal(15, 2)\n total_amount Decimal @default(0.00) @db.Decimal(15, 2)\n created_at DateTime @default(now()) @db.Timestamp(0)\n discount Decimal @default(0.00) @db.Decimal(15, 2)\n notes String? @db.Text\n\n invoice_id String\n good_id String?\n service_id String?\n\n payload Json?\n\n invoice SalesInvoice @relation(fields: [invoice_id], references: [id])\n good Good? @relation(fields: [good_id], references: [id])\n service Service? @relation(fields: [service_id], references: [id])\n\n @@index([invoice_id, good_id])\n @@map(\"sales_invoice_items\")\n}\n\nmodel SalesInvoicePayment {\n id String @id @default(uuid())\n invoice_id String\n amount Decimal @db.Decimal(15, 2)\n payment_method PaymentMethodType\n paid_at DateTime\n created_at DateTime @default(now())\n\n invoice SalesInvoice @relation(fields: [invoice_id], references: [id])\n\n @@index([invoice_id])\n @@map(\"sales_invoice_payments\")\n}\n\nmodel Service {\n id String @id @default(uuid())\n name String @db.VarChar(255)\n description String? @db.Text\n sku String @unique() @db.VarChar(100)\n local_sku String? @unique() @db.VarChar(100)\n barcode String? @unique() @db.VarChar(100)\n created_at DateTime @default(now()) @db.Timestamp(0)\n updated_at DateTime @updatedAt @db.Timestamp(0)\n deleted_at DateTime? @db.Timestamp(0)\n category_id String?\n base_sale_price Decimal @default(0.00) @db.Decimal(15, 0)\n account_id String\n complex_id String\n\n category ServiceCategory? @relation(fields: [category_id], references: [id])\n sales_invoice_items SalesInvoiceItem[]\n\n @@index([category_id])\n @@map(\"services\")\n}\n\nmodel ServiceCategory {\n id String @id @default(uuid())\n name String @db.VarChar(100)\n description String? @db.Text\n image_url String? @db.VarChar(255)\n account_id String\n complex_id String\n created_at DateTime @default(now()) @db.Timestamp(0)\n updated_at DateTime @updatedAt @db.Timestamp(0)\n deleted_at DateTime? @db.Timestamp(0)\n\n services Service[]\n\n @@map(\"service_categories\")\n}\n", "runtimeDataModel": { "models": {}, "enums": {}, @@ -30,7 +30,7 @@ const config: runtime.GetPrismaClientConfig = { } } -config.runtimeDataModel = JSON.parse("{\"models\":{\"Admin\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"mobile_number\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"national_code\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"first_name\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"last_name\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"created_at\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"updated_at\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"accounts\",\"kind\":\"object\",\"type\":\"AdminAccount\",\"relationName\":\"AdminToAdminAccount\"}],\"dbName\":\"admins\"},\"AdminAccount\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"created_at\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"updated_at\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"user_id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"user\",\"kind\":\"object\",\"type\":\"Admin\",\"relationName\":\"AdminToAdminAccount\"},{\"name\":\"account_id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"account\",\"kind\":\"object\",\"type\":\"Account\",\"relationName\":\"AccountToAdminAccount\"}],\"dbName\":\"admin_accounts\"},\"Account\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"username\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"password\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"status\",\"kind\":\"enum\",\"type\":\"AccountStatus\"},{\"name\":\"type\",\"kind\":\"enum\",\"type\":\"AccountType\"},{\"name\":\"admin_account\",\"kind\":\"object\",\"type\":\"AdminAccount\",\"relationName\":\"AccountToAdminAccount\"},{\"name\":\"provider_account\",\"kind\":\"object\",\"type\":\"ProviderAccount\",\"relationName\":\"AccountToProviderAccount\"},{\"name\":\"partner_account\",\"kind\":\"object\",\"type\":\"PartnerAccount\",\"relationName\":\"AccountToPartnerAccount\"},{\"name\":\"consumer_account\",\"kind\":\"object\",\"type\":\"ConsumerAccount\",\"relationName\":\"AccountToConsumerAccount\"}],\"dbName\":\"accounts\"},\"Consumer\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"mobile_number\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"first_name\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"last_name\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"status\",\"kind\":\"enum\",\"type\":\"ConsumerStatus\"},{\"name\":\"created_at\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"updated_at\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"accounts\",\"kind\":\"object\",\"type\":\"ConsumerAccount\",\"relationName\":\"ConsumerToConsumerAccount\"},{\"name\":\"businessActivities\",\"kind\":\"object\",\"type\":\"BusinessActivity\",\"relationName\":\"BusinessActivityToConsumer\"}],\"dbName\":\"consumers\"},\"ConsumerAccount\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"role\",\"kind\":\"enum\",\"type\":\"ConsumerRole\"},{\"name\":\"created_at\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"updated_at\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"user_id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"user\",\"kind\":\"object\",\"type\":\"Consumer\",\"relationName\":\"ConsumerToConsumerAccount\"},{\"name\":\"account_id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"account\",\"kind\":\"object\",\"type\":\"Account\",\"relationName\":\"AccountToConsumerAccount\"},{\"name\":\"permissions\",\"kind\":\"object\",\"type\":\"PermissionConsumer\",\"relationName\":\"ConsumerAccountToPermissionConsumer\"}],\"dbName\":\"consumer_accounts\"},\"BusinessActivity\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"name\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"created_at\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"updated_at\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"guild_id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"user_id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"guild\",\"kind\":\"object\",\"type\":\"Guild\",\"relationName\":\"BusinessActivityToGuild\"},{\"name\":\"user\",\"kind\":\"object\",\"type\":\"Consumer\",\"relationName\":\"BusinessActivityToConsumer\"},{\"name\":\"complexes\",\"kind\":\"object\",\"type\":\"Complex\",\"relationName\":\"BusinessActivityToComplex\"},{\"name\":\"permissionBusinesses\",\"kind\":\"object\",\"type\":\"PermissionBusiness\",\"relationName\":\"BusinessActivityToPermissionBusiness\"}],\"dbName\":\"business_activities\"},\"Complex\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"name\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"address\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"tax_id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"created_at\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"updated_at\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"business_activity_id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"business_activity\",\"kind\":\"object\",\"type\":\"BusinessActivity\",\"relationName\":\"BusinessActivityToComplex\"},{\"name\":\"pos_list\",\"kind\":\"object\",\"type\":\"Pos\",\"relationName\":\"ComplexToPos\"},{\"name\":\"goods\",\"kind\":\"object\",\"type\":\"Good\",\"relationName\":\"ComplexToGood\"},{\"name\":\"good_categories\",\"kind\":\"object\",\"type\":\"GoodCategory\",\"relationName\":\"ComplexToGoodCategory\"},{\"name\":\"permissionComplexes\",\"kind\":\"object\",\"type\":\"PermissionComplex\",\"relationName\":\"ComplexToPermissionComplex\"}],\"dbName\":\"complexes\"},\"Pos\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"name\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"serial\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"model\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"status\",\"kind\":\"enum\",\"type\":\"POSStatus\"},{\"name\":\"pos_type\",\"kind\":\"enum\",\"type\":\"POSType\"},{\"name\":\"created_at\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"updated_at\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"complex_id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"complex\",\"kind\":\"object\",\"type\":\"Complex\",\"relationName\":\"ComplexToPos\"},{\"name\":\"device_id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"device\",\"kind\":\"object\",\"type\":\"Device\",\"relationName\":\"DeviceToPos\"},{\"name\":\"provider_id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"provider\",\"kind\":\"object\",\"type\":\"Provider\",\"relationName\":\"PosToProvider\"},{\"name\":\"licenses\",\"kind\":\"object\",\"type\":\"License\",\"relationName\":\"LicenseToPos\"},{\"name\":\"permissionPos\",\"kind\":\"object\",\"type\":\"PermissionPos\",\"relationName\":\"PermissionPosToPos\"}],\"dbName\":\"poses\"},\"DeviceBrand\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"name\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"created_at\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"updated_at\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"devices\",\"kind\":\"object\",\"type\":\"Device\",\"relationName\":\"DeviceToDeviceBrand\"}],\"dbName\":\"device_brands\"},\"Device\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"name\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"os_version\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"created_at\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"updated_at\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"brand_id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"brand\",\"kind\":\"object\",\"type\":\"DeviceBrand\",\"relationName\":\"DeviceToDeviceBrand\"},{\"name\":\"poses\",\"kind\":\"object\",\"type\":\"Pos\",\"relationName\":\"DeviceToPos\"}],\"dbName\":\"devices\"},\"License\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"starts_at\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"expires_at\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"status\",\"kind\":\"enum\",\"type\":\"LicenseStatus\"},{\"name\":\"created_at\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"updated_at\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"pos_id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"partner_id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"pos\",\"kind\":\"object\",\"type\":\"Pos\",\"relationName\":\"LicenseToPos\"},{\"name\":\"partner\",\"kind\":\"object\",\"type\":\"Partner\",\"relationName\":\"LicenseToPartner\"}],\"dbName\":\"licenses\"},\"Partner\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"name\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"code\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"license_quota\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"status\",\"kind\":\"enum\",\"type\":\"PartnerStatus\"},{\"name\":\"created_at\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"updated_at\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"licenses\",\"kind\":\"object\",\"type\":\"License\",\"relationName\":\"LicenseToPartner\"},{\"name\":\"accounts\",\"kind\":\"object\",\"type\":\"PartnerAccount\",\"relationName\":\"PartnerToPartnerAccount\"}],\"dbName\":\"partners\"},\"PartnerAccount\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"role\",\"kind\":\"enum\",\"type\":\"PartnerRole\"},{\"name\":\"created_at\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"updated_at\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"user_id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"user\",\"kind\":\"object\",\"type\":\"Partner\",\"relationName\":\"PartnerToPartnerAccount\"},{\"name\":\"account_id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"account\",\"kind\":\"object\",\"type\":\"Account\",\"relationName\":\"AccountToPartnerAccount\"}],\"dbName\":\"partner_accounts\"},\"PermissionConsumer\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"account_id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"account\",\"kind\":\"object\",\"type\":\"ConsumerAccount\",\"relationName\":\"ConsumerAccountToPermissionConsumer\"},{\"name\":\"posPermissions\",\"kind\":\"object\",\"type\":\"PermissionPos\",\"relationName\":\"PermissionConsumerToPermissionPos\"},{\"name\":\"complexPermissions\",\"kind\":\"object\",\"type\":\"PermissionComplex\",\"relationName\":\"PermissionComplexToPermissionConsumer\"},{\"name\":\"businessPermissions\",\"kind\":\"object\",\"type\":\"PermissionBusiness\",\"relationName\":\"PermissionBusinessToPermissionConsumer\"}],\"dbName\":\"permission_consumers\"},\"PermissionPos\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"role\",\"kind\":\"enum\",\"type\":\"POSRole\"},{\"name\":\"pos_id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"permission_id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"pos\",\"kind\":\"object\",\"type\":\"Pos\",\"relationName\":\"PermissionPosToPos\"},{\"name\":\"permission\",\"kind\":\"object\",\"type\":\"PermissionConsumer\",\"relationName\":\"PermissionConsumerToPermissionPos\"}],\"dbName\":\"permission_poses\"},\"PermissionComplex\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"role\",\"kind\":\"enum\",\"type\":\"ComplexRole\"},{\"name\":\"complex_id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"permission_id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"complex\",\"kind\":\"object\",\"type\":\"Complex\",\"relationName\":\"ComplexToPermissionComplex\"},{\"name\":\"permission\",\"kind\":\"object\",\"type\":\"PermissionConsumer\",\"relationName\":\"PermissionComplexToPermissionConsumer\"}],\"dbName\":\"permission_complexes\"},\"PermissionBusiness\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"role\",\"kind\":\"enum\",\"type\":\"BusinessRole\"},{\"name\":\"business_id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"permission_id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"business\",\"kind\":\"object\",\"type\":\"BusinessActivity\",\"relationName\":\"BusinessActivityToPermissionBusiness\"},{\"name\":\"permission\",\"kind\":\"object\",\"type\":\"PermissionConsumer\",\"relationName\":\"PermissionBusinessToPermissionConsumer\"}],\"dbName\":\"permission_business_activities\"},\"Provider\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"code\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"status\",\"kind\":\"enum\",\"type\":\"PartnerStatus\"},{\"name\":\"name\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"created_at\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"updated_at\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"pos_list\",\"kind\":\"object\",\"type\":\"Pos\",\"relationName\":\"PosToProvider\"},{\"name\":\"accounts\",\"kind\":\"object\",\"type\":\"ProviderAccount\",\"relationName\":\"ProviderToProviderAccount\"}],\"dbName\":\"providers\"},\"ProviderAccount\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"role\",\"kind\":\"enum\",\"type\":\"ProviderRole\"},{\"name\":\"created_at\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"updated_at\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"user_id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"user\",\"kind\":\"object\",\"type\":\"Provider\",\"relationName\":\"ProviderToProviderAccount\"},{\"name\":\"account_id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"account\",\"kind\":\"object\",\"type\":\"Account\",\"relationName\":\"AccountToProviderAccount\"}],\"dbName\":\"provider_accounts\"},\"TriggerLog\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"message\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"name\",\"kind\":\"scalar\",\"type\":\"String\"}],\"dbName\":\"trigger_logs\"},\"UserDevices\":{\"fields\":[{\"name\":\"account_id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"app_version\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"build_number\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"uuid\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"platform\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"brand\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"model\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"device\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"os_version\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"sdk_version\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"release_number\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"browser_name\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"fcm_token\",\"kind\":\"scalar\",\"type\":\"String\"}],\"dbName\":\"user_devices\"},\"Customer\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"created_at\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"updated_at\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"deleted_at\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"type\",\"kind\":\"enum\",\"type\":\"CustomerType\"},{\"name\":\"complex_id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"is_favorite\",\"kind\":\"scalar\",\"type\":\"Boolean\"},{\"name\":\"sales_invoices\",\"kind\":\"object\",\"type\":\"SalesInvoice\",\"relationName\":\"CustomerToSalesInvoice\"},{\"name\":\"customerIndividuals\",\"kind\":\"object\",\"type\":\"CustomerIndividual\",\"relationName\":\"CustomerToCustomerIndividual\"},{\"name\":\"customerLegals\",\"kind\":\"object\",\"type\":\"CustomerLegal\",\"relationName\":\"CustomerToCustomerLegal\"}],\"dbName\":\"customers\"},\"CustomerIndividual\":{\"fields\":[{\"name\":\"customer_id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"first_name\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"last_name\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"national_id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"postal_code\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"economic_code\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"complex_id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"customer\",\"kind\":\"object\",\"type\":\"Customer\",\"relationName\":\"CustomerToCustomerIndividual\"}],\"dbName\":\"customer_individuals\"},\"CustomerLegal\":{\"fields\":[{\"name\":\"customer_id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"company_name\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"economic_code\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"registration_number\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"postal_code\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"complex_id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"customer\",\"kind\":\"object\",\"type\":\"Customer\",\"relationName\":\"CustomerToCustomerLegal\"}],\"dbName\":\"customer_legal\"},\"Good\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"name\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"is_default_guild_good\",\"kind\":\"scalar\",\"type\":\"Boolean\"},{\"name\":\"sku\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"unit_type\",\"kind\":\"enum\",\"type\":\"UnitType\"},{\"name\":\"pricing_model\",\"kind\":\"enum\",\"type\":\"GoodPricingModel\"},{\"name\":\"description\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"local_sku\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"barcode\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"base_sale_price\",\"kind\":\"scalar\",\"type\":\"Decimal\"},{\"name\":\"created_at\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"updated_at\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"deleted_at\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"complex_id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"category_id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"category\",\"kind\":\"object\",\"type\":\"GoodCategory\",\"relationName\":\"GoodToGoodCategory\"},{\"name\":\"complex\",\"kind\":\"object\",\"type\":\"Complex\",\"relationName\":\"ComplexToGood\"},{\"name\":\"sales_invoice_items\",\"kind\":\"object\",\"type\":\"SalesInvoiceItem\",\"relationName\":\"GoodToSalesInvoiceItem\"}],\"dbName\":\"goods\"},\"GoodCategory\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"name\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"description\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"image_url\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"complex_id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"is_default_guild_good\",\"kind\":\"scalar\",\"type\":\"Boolean\"},{\"name\":\"guild_id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"created_at\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"updated_at\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"deleted_at\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"goods\",\"kind\":\"object\",\"type\":\"Good\",\"relationName\":\"GoodToGoodCategory\"},{\"name\":\"guild\",\"kind\":\"object\",\"type\":\"Guild\",\"relationName\":\"GoodCategoryToGuild\"},{\"name\":\"complex\",\"kind\":\"object\",\"type\":\"Complex\",\"relationName\":\"ComplexToGoodCategory\"}],\"dbName\":\"good_categories\"},\"Guild\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"name\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"code\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"created_at\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"updated_at\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"business_activities\",\"kind\":\"object\",\"type\":\"BusinessActivity\",\"relationName\":\"BusinessActivityToGuild\"},{\"name\":\"good_categories\",\"kind\":\"object\",\"type\":\"GoodCategory\",\"relationName\":\"GoodCategoryToGuild\"}],\"dbName\":\"guilds\"},\"SalesInvoice\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"code\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"total_amount\",\"kind\":\"scalar\",\"type\":\"Decimal\"},{\"name\":\"notes\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"unknown_customer\",\"kind\":\"scalar\",\"type\":\"Json\"},{\"name\":\"invoice_date\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"created_at\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"updated_at\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"customer_id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"account_id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"complex_id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"customer\",\"kind\":\"object\",\"type\":\"Customer\",\"relationName\":\"CustomerToSalesInvoice\"},{\"name\":\"items\",\"kind\":\"object\",\"type\":\"SalesInvoiceItem\",\"relationName\":\"SalesInvoiceToSalesInvoiceItem\"},{\"name\":\"payments\",\"kind\":\"object\",\"type\":\"SalesInvoicePayment\",\"relationName\":\"SalesInvoiceToSalesInvoicePayment\"}],\"dbName\":\"sales_invoices\"},\"SalesInvoiceItem\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"quantity\",\"kind\":\"scalar\",\"type\":\"Decimal\"},{\"name\":\"unit_type\",\"kind\":\"enum\",\"type\":\"UnitType\"},{\"name\":\"unit_price\",\"kind\":\"scalar\",\"type\":\"Decimal\"},{\"name\":\"total_amount\",\"kind\":\"scalar\",\"type\":\"Decimal\"},{\"name\":\"created_at\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"discount\",\"kind\":\"scalar\",\"type\":\"Decimal\"},{\"name\":\"notes\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"invoice_id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"good_id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"service_id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"payload\",\"kind\":\"scalar\",\"type\":\"Json\"},{\"name\":\"invoice\",\"kind\":\"object\",\"type\":\"SalesInvoice\",\"relationName\":\"SalesInvoiceToSalesInvoiceItem\"},{\"name\":\"good\",\"kind\":\"object\",\"type\":\"Good\",\"relationName\":\"GoodToSalesInvoiceItem\"},{\"name\":\"service\",\"kind\":\"object\",\"type\":\"Service\",\"relationName\":\"SalesInvoiceItemToService\"}],\"dbName\":\"sales_invoice_items\"},\"SalesInvoicePayment\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"invoice_id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"amount\",\"kind\":\"scalar\",\"type\":\"Decimal\"},{\"name\":\"payment_method\",\"kind\":\"enum\",\"type\":\"PaymentMethodType\"},{\"name\":\"paid_at\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"created_at\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"invoice\",\"kind\":\"object\",\"type\":\"SalesInvoice\",\"relationName\":\"SalesInvoiceToSalesInvoicePayment\"}],\"dbName\":\"sales_invoice_payments\"},\"Service\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"name\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"description\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"sku\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"local_sku\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"barcode\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"created_at\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"updated_at\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"deleted_at\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"category_id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"base_sale_price\",\"kind\":\"scalar\",\"type\":\"Decimal\"},{\"name\":\"account_id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"complex_id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"category\",\"kind\":\"object\",\"type\":\"ServiceCategory\",\"relationName\":\"ServiceToServiceCategory\"},{\"name\":\"sales_invoice_items\",\"kind\":\"object\",\"type\":\"SalesInvoiceItem\",\"relationName\":\"SalesInvoiceItemToService\"}],\"dbName\":\"services\"},\"ServiceCategory\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"name\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"description\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"image_url\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"account_id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"complex_id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"created_at\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"updated_at\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"deleted_at\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"services\",\"kind\":\"object\",\"type\":\"Service\",\"relationName\":\"ServiceToServiceCategory\"}],\"dbName\":\"service_categories\"}},\"enums\":{},\"types\":{}}") +config.runtimeDataModel = JSON.parse("{\"models\":{\"Admin\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"mobile_number\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"national_code\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"first_name\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"last_name\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"created_at\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"updated_at\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"accounts\",\"kind\":\"object\",\"type\":\"AdminAccount\",\"relationName\":\"AdminToAdminAccount\"}],\"dbName\":\"admins\"},\"AdminAccount\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"created_at\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"updated_at\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"user_id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"user\",\"kind\":\"object\",\"type\":\"Admin\",\"relationName\":\"AdminToAdminAccount\"},{\"name\":\"account_id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"account\",\"kind\":\"object\",\"type\":\"Account\",\"relationName\":\"AccountToAdminAccount\"}],\"dbName\":\"admin_accounts\"},\"Account\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"username\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"password\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"status\",\"kind\":\"enum\",\"type\":\"AccountStatus\"},{\"name\":\"type\",\"kind\":\"enum\",\"type\":\"AccountType\"},{\"name\":\"admin_account\",\"kind\":\"object\",\"type\":\"AdminAccount\",\"relationName\":\"AccountToAdminAccount\"},{\"name\":\"provider_account\",\"kind\":\"object\",\"type\":\"ProviderAccount\",\"relationName\":\"AccountToProviderAccount\"},{\"name\":\"partner_account\",\"kind\":\"object\",\"type\":\"PartnerAccount\",\"relationName\":\"AccountToPartnerAccount\"},{\"name\":\"consumer_account\",\"kind\":\"object\",\"type\":\"ConsumerAccount\",\"relationName\":\"AccountToConsumerAccount\"}],\"dbName\":\"accounts\"},\"Consumer\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"mobile_number\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"first_name\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"last_name\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"status\",\"kind\":\"enum\",\"type\":\"ConsumerStatus\"},{\"name\":\"created_at\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"updated_at\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"accounts\",\"kind\":\"object\",\"type\":\"ConsumerAccount\",\"relationName\":\"ConsumerToConsumerAccount\"},{\"name\":\"businessActivities\",\"kind\":\"object\",\"type\":\"BusinessActivity\",\"relationName\":\"BusinessActivityToConsumer\"}],\"dbName\":\"consumers\"},\"ConsumerAccount\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"role\",\"kind\":\"enum\",\"type\":\"ConsumerRole\"},{\"name\":\"created_at\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"updated_at\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"user_id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"user\",\"kind\":\"object\",\"type\":\"Consumer\",\"relationName\":\"ConsumerToConsumerAccount\"},{\"name\":\"account_id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"account\",\"kind\":\"object\",\"type\":\"Account\",\"relationName\":\"AccountToConsumerAccount\"},{\"name\":\"permissions\",\"kind\":\"object\",\"type\":\"PermissionConsumer\",\"relationName\":\"ConsumerAccountToPermissionConsumer\"},{\"name\":\"salesInvoices\",\"kind\":\"object\",\"type\":\"SalesInvoice\",\"relationName\":\"ConsumerAccountToSalesInvoice\"}],\"dbName\":\"consumer_accounts\"},\"BusinessActivity\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"name\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"created_at\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"updated_at\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"guild_id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"user_id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"guild\",\"kind\":\"object\",\"type\":\"Guild\",\"relationName\":\"BusinessActivityToGuild\"},{\"name\":\"user\",\"kind\":\"object\",\"type\":\"Consumer\",\"relationName\":\"BusinessActivityToConsumer\"},{\"name\":\"complexes\",\"kind\":\"object\",\"type\":\"Complex\",\"relationName\":\"BusinessActivityToComplex\"},{\"name\":\"permissionBusinesses\",\"kind\":\"object\",\"type\":\"PermissionBusiness\",\"relationName\":\"BusinessActivityToPermissionBusiness\"}],\"dbName\":\"business_activities\"},\"Complex\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"name\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"address\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"tax_id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"created_at\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"updated_at\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"business_activity_id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"business_activity\",\"kind\":\"object\",\"type\":\"BusinessActivity\",\"relationName\":\"BusinessActivityToComplex\"},{\"name\":\"pos_list\",\"kind\":\"object\",\"type\":\"Pos\",\"relationName\":\"ComplexToPos\"},{\"name\":\"goods\",\"kind\":\"object\",\"type\":\"Good\",\"relationName\":\"ComplexToGood\"},{\"name\":\"good_categories\",\"kind\":\"object\",\"type\":\"GoodCategory\",\"relationName\":\"ComplexToGoodCategory\"},{\"name\":\"permissionComplexes\",\"kind\":\"object\",\"type\":\"PermissionComplex\",\"relationName\":\"ComplexToPermissionComplex\"},{\"name\":\"customerIndividuals\",\"kind\":\"object\",\"type\":\"CustomerIndividual\",\"relationName\":\"ComplexToCustomerIndividual\"},{\"name\":\"customerLegals\",\"kind\":\"object\",\"type\":\"CustomerLegal\",\"relationName\":\"ComplexToCustomerLegal\"}],\"dbName\":\"complexes\"},\"Pos\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"name\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"serial\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"model\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"status\",\"kind\":\"enum\",\"type\":\"POSStatus\"},{\"name\":\"pos_type\",\"kind\":\"enum\",\"type\":\"POSType\"},{\"name\":\"created_at\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"updated_at\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"complex_id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"complex\",\"kind\":\"object\",\"type\":\"Complex\",\"relationName\":\"ComplexToPos\"},{\"name\":\"device_id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"device\",\"kind\":\"object\",\"type\":\"Device\",\"relationName\":\"DeviceToPos\"},{\"name\":\"provider_id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"provider\",\"kind\":\"object\",\"type\":\"Provider\",\"relationName\":\"PosToProvider\"},{\"name\":\"licenses\",\"kind\":\"object\",\"type\":\"License\",\"relationName\":\"LicenseToPos\"},{\"name\":\"permissionPos\",\"kind\":\"object\",\"type\":\"PermissionPos\",\"relationName\":\"PermissionPosToPos\"},{\"name\":\"salesInvoices\",\"kind\":\"object\",\"type\":\"SalesInvoice\",\"relationName\":\"PosToSalesInvoice\"}],\"dbName\":\"poses\"},\"DeviceBrand\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"name\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"created_at\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"updated_at\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"devices\",\"kind\":\"object\",\"type\":\"Device\",\"relationName\":\"DeviceToDeviceBrand\"}],\"dbName\":\"device_brands\"},\"Device\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"name\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"os_version\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"created_at\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"updated_at\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"brand_id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"brand\",\"kind\":\"object\",\"type\":\"DeviceBrand\",\"relationName\":\"DeviceToDeviceBrand\"},{\"name\":\"poses\",\"kind\":\"object\",\"type\":\"Pos\",\"relationName\":\"DeviceToPos\"}],\"dbName\":\"devices\"},\"License\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"starts_at\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"expires_at\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"status\",\"kind\":\"enum\",\"type\":\"LicenseStatus\"},{\"name\":\"created_at\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"updated_at\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"pos_id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"partner_id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"pos\",\"kind\":\"object\",\"type\":\"Pos\",\"relationName\":\"LicenseToPos\"},{\"name\":\"partner\",\"kind\":\"object\",\"type\":\"Partner\",\"relationName\":\"LicenseToPartner\"}],\"dbName\":\"licenses\"},\"Partner\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"name\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"code\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"license_quota\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"status\",\"kind\":\"enum\",\"type\":\"PartnerStatus\"},{\"name\":\"created_at\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"updated_at\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"licenses\",\"kind\":\"object\",\"type\":\"License\",\"relationName\":\"LicenseToPartner\"},{\"name\":\"accounts\",\"kind\":\"object\",\"type\":\"PartnerAccount\",\"relationName\":\"PartnerToPartnerAccount\"}],\"dbName\":\"partners\"},\"PartnerAccount\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"role\",\"kind\":\"enum\",\"type\":\"PartnerRole\"},{\"name\":\"created_at\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"updated_at\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"user_id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"user\",\"kind\":\"object\",\"type\":\"Partner\",\"relationName\":\"PartnerToPartnerAccount\"},{\"name\":\"account_id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"account\",\"kind\":\"object\",\"type\":\"Account\",\"relationName\":\"AccountToPartnerAccount\"}],\"dbName\":\"partner_accounts\"},\"PermissionConsumer\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"account_id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"account\",\"kind\":\"object\",\"type\":\"ConsumerAccount\",\"relationName\":\"ConsumerAccountToPermissionConsumer\"},{\"name\":\"posPermissions\",\"kind\":\"object\",\"type\":\"PermissionPos\",\"relationName\":\"PermissionConsumerToPermissionPos\"},{\"name\":\"complexPermissions\",\"kind\":\"object\",\"type\":\"PermissionComplex\",\"relationName\":\"PermissionComplexToPermissionConsumer\"},{\"name\":\"businessPermissions\",\"kind\":\"object\",\"type\":\"PermissionBusiness\",\"relationName\":\"PermissionBusinessToPermissionConsumer\"}],\"dbName\":\"permission_consumers\"},\"PermissionPos\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"role\",\"kind\":\"enum\",\"type\":\"POSRole\"},{\"name\":\"pos_id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"permission_id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"pos\",\"kind\":\"object\",\"type\":\"Pos\",\"relationName\":\"PermissionPosToPos\"},{\"name\":\"permission\",\"kind\":\"object\",\"type\":\"PermissionConsumer\",\"relationName\":\"PermissionConsumerToPermissionPos\"}],\"dbName\":\"permission_poses\"},\"PermissionComplex\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"role\",\"kind\":\"enum\",\"type\":\"ComplexRole\"},{\"name\":\"complex_id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"permission_id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"complex\",\"kind\":\"object\",\"type\":\"Complex\",\"relationName\":\"ComplexToPermissionComplex\"},{\"name\":\"permission\",\"kind\":\"object\",\"type\":\"PermissionConsumer\",\"relationName\":\"PermissionComplexToPermissionConsumer\"}],\"dbName\":\"permission_complexes\"},\"PermissionBusiness\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"role\",\"kind\":\"enum\",\"type\":\"BusinessRole\"},{\"name\":\"business_id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"permission_id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"business\",\"kind\":\"object\",\"type\":\"BusinessActivity\",\"relationName\":\"BusinessActivityToPermissionBusiness\"},{\"name\":\"permission\",\"kind\":\"object\",\"type\":\"PermissionConsumer\",\"relationName\":\"PermissionBusinessToPermissionConsumer\"}],\"dbName\":\"permission_business_activities\"},\"Provider\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"code\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"status\",\"kind\":\"enum\",\"type\":\"PartnerStatus\"},{\"name\":\"name\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"created_at\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"updated_at\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"pos_list\",\"kind\":\"object\",\"type\":\"Pos\",\"relationName\":\"PosToProvider\"},{\"name\":\"accounts\",\"kind\":\"object\",\"type\":\"ProviderAccount\",\"relationName\":\"ProviderToProviderAccount\"}],\"dbName\":\"providers\"},\"ProviderAccount\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"role\",\"kind\":\"enum\",\"type\":\"ProviderRole\"},{\"name\":\"created_at\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"updated_at\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"user_id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"user\",\"kind\":\"object\",\"type\":\"Provider\",\"relationName\":\"ProviderToProviderAccount\"},{\"name\":\"account_id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"account\",\"kind\":\"object\",\"type\":\"Account\",\"relationName\":\"AccountToProviderAccount\"}],\"dbName\":\"provider_accounts\"},\"TriggerLog\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"message\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"name\",\"kind\":\"scalar\",\"type\":\"String\"}],\"dbName\":\"trigger_logs\"},\"UserDevices\":{\"fields\":[{\"name\":\"account_id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"app_version\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"build_number\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"uuid\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"platform\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"brand\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"model\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"device\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"os_version\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"sdk_version\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"release_number\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"browser_name\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"fcm_token\",\"kind\":\"scalar\",\"type\":\"String\"}],\"dbName\":\"user_devices\"},\"Customer\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"type\",\"kind\":\"enum\",\"type\":\"CustomerType\"},{\"name\":\"is_favorite\",\"kind\":\"scalar\",\"type\":\"Boolean\"},{\"name\":\"created_at\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"updated_at\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"deleted_at\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"sales_invoices\",\"kind\":\"object\",\"type\":\"SalesInvoice\",\"relationName\":\"CustomerToSalesInvoice\"},{\"name\":\"customer_individuals\",\"kind\":\"object\",\"type\":\"CustomerIndividual\",\"relationName\":\"CustomerToCustomerIndividual\"},{\"name\":\"customer_legals\",\"kind\":\"object\",\"type\":\"CustomerLegal\",\"relationName\":\"CustomerToCustomerLegal\"}],\"dbName\":\"customers\"},\"CustomerIndividual\":{\"fields\":[{\"name\":\"customer_id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"first_name\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"last_name\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"national_id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"postal_code\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"economic_code\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"complex_id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"customer\",\"kind\":\"object\",\"type\":\"Customer\",\"relationName\":\"CustomerToCustomerIndividual\"},{\"name\":\"complex\",\"kind\":\"object\",\"type\":\"Complex\",\"relationName\":\"ComplexToCustomerIndividual\"}],\"dbName\":\"customer_individuals\"},\"CustomerLegal\":{\"fields\":[{\"name\":\"customer_id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"company_name\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"economic_code\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"registration_number\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"postal_code\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"complex_id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"customer\",\"kind\":\"object\",\"type\":\"Customer\",\"relationName\":\"CustomerToCustomerLegal\"},{\"name\":\"complex\",\"kind\":\"object\",\"type\":\"Complex\",\"relationName\":\"ComplexToCustomerLegal\"}],\"dbName\":\"customer_legal\"},\"Good\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"name\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"is_default_guild_good\",\"kind\":\"scalar\",\"type\":\"Boolean\"},{\"name\":\"sku\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"unit_type\",\"kind\":\"enum\",\"type\":\"UnitType\"},{\"name\":\"pricing_model\",\"kind\":\"enum\",\"type\":\"GoodPricingModel\"},{\"name\":\"description\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"local_sku\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"barcode\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"base_sale_price\",\"kind\":\"scalar\",\"type\":\"Decimal\"},{\"name\":\"created_at\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"updated_at\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"deleted_at\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"complex_id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"category_id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"category\",\"kind\":\"object\",\"type\":\"GoodCategory\",\"relationName\":\"GoodToGoodCategory\"},{\"name\":\"complex\",\"kind\":\"object\",\"type\":\"Complex\",\"relationName\":\"ComplexToGood\"},{\"name\":\"sales_invoice_items\",\"kind\":\"object\",\"type\":\"SalesInvoiceItem\",\"relationName\":\"GoodToSalesInvoiceItem\"}],\"dbName\":\"goods\"},\"GoodCategory\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"name\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"description\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"image_url\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"complex_id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"is_default_guild_good\",\"kind\":\"scalar\",\"type\":\"Boolean\"},{\"name\":\"guild_id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"created_at\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"updated_at\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"deleted_at\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"goods\",\"kind\":\"object\",\"type\":\"Good\",\"relationName\":\"GoodToGoodCategory\"},{\"name\":\"guild\",\"kind\":\"object\",\"type\":\"Guild\",\"relationName\":\"GoodCategoryToGuild\"},{\"name\":\"complex\",\"kind\":\"object\",\"type\":\"Complex\",\"relationName\":\"ComplexToGoodCategory\"}],\"dbName\":\"good_categories\"},\"Guild\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"name\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"code\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"created_at\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"updated_at\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"business_activities\",\"kind\":\"object\",\"type\":\"BusinessActivity\",\"relationName\":\"BusinessActivityToGuild\"},{\"name\":\"good_categories\",\"kind\":\"object\",\"type\":\"GoodCategory\",\"relationName\":\"GoodCategoryToGuild\"}],\"dbName\":\"guilds\"},\"SalesInvoice\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"code\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"total_amount\",\"kind\":\"scalar\",\"type\":\"Decimal\"},{\"name\":\"notes\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"unknown_customer\",\"kind\":\"scalar\",\"type\":\"Json\"},{\"name\":\"invoice_date\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"created_at\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"updated_at\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"customer_id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"account_id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"pos_id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"customer\",\"kind\":\"object\",\"type\":\"Customer\",\"relationName\":\"CustomerToSalesInvoice\"},{\"name\":\"pos\",\"kind\":\"object\",\"type\":\"Pos\",\"relationName\":\"PosToSalesInvoice\"},{\"name\":\"account\",\"kind\":\"object\",\"type\":\"ConsumerAccount\",\"relationName\":\"ConsumerAccountToSalesInvoice\"},{\"name\":\"items\",\"kind\":\"object\",\"type\":\"SalesInvoiceItem\",\"relationName\":\"SalesInvoiceToSalesInvoiceItem\"},{\"name\":\"payments\",\"kind\":\"object\",\"type\":\"SalesInvoicePayment\",\"relationName\":\"SalesInvoiceToSalesInvoicePayment\"}],\"dbName\":\"sales_invoices\"},\"SalesInvoiceItem\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"quantity\",\"kind\":\"scalar\",\"type\":\"Decimal\"},{\"name\":\"unit_type\",\"kind\":\"enum\",\"type\":\"UnitType\"},{\"name\":\"unit_price\",\"kind\":\"scalar\",\"type\":\"Decimal\"},{\"name\":\"total_amount\",\"kind\":\"scalar\",\"type\":\"Decimal\"},{\"name\":\"created_at\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"discount\",\"kind\":\"scalar\",\"type\":\"Decimal\"},{\"name\":\"notes\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"invoice_id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"good_id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"service_id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"payload\",\"kind\":\"scalar\",\"type\":\"Json\"},{\"name\":\"invoice\",\"kind\":\"object\",\"type\":\"SalesInvoice\",\"relationName\":\"SalesInvoiceToSalesInvoiceItem\"},{\"name\":\"good\",\"kind\":\"object\",\"type\":\"Good\",\"relationName\":\"GoodToSalesInvoiceItem\"},{\"name\":\"service\",\"kind\":\"object\",\"type\":\"Service\",\"relationName\":\"SalesInvoiceItemToService\"}],\"dbName\":\"sales_invoice_items\"},\"SalesInvoicePayment\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"invoice_id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"amount\",\"kind\":\"scalar\",\"type\":\"Decimal\"},{\"name\":\"payment_method\",\"kind\":\"enum\",\"type\":\"PaymentMethodType\"},{\"name\":\"paid_at\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"created_at\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"invoice\",\"kind\":\"object\",\"type\":\"SalesInvoice\",\"relationName\":\"SalesInvoiceToSalesInvoicePayment\"}],\"dbName\":\"sales_invoice_payments\"},\"Service\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"name\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"description\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"sku\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"local_sku\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"barcode\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"created_at\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"updated_at\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"deleted_at\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"category_id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"base_sale_price\",\"kind\":\"scalar\",\"type\":\"Decimal\"},{\"name\":\"account_id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"complex_id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"category\",\"kind\":\"object\",\"type\":\"ServiceCategory\",\"relationName\":\"ServiceToServiceCategory\"},{\"name\":\"sales_invoice_items\",\"kind\":\"object\",\"type\":\"SalesInvoiceItem\",\"relationName\":\"SalesInvoiceItemToService\"}],\"dbName\":\"services\"},\"ServiceCategory\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"name\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"description\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"image_url\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"account_id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"complex_id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"created_at\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"updated_at\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"deleted_at\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"services\",\"kind\":\"object\",\"type\":\"Service\",\"relationName\":\"ServiceToServiceCategory\"}],\"dbName\":\"service_categories\"}},\"enums\":{},\"types\":{}}") async function decodeBase64AsWasm(wasmBase64: string): Promise { const { Buffer } = await import('node:buffer') diff --git a/src/generated/prisma/internal/prismaNamespace.ts b/src/generated/prisma/internal/prismaNamespace.ts index 6f4dfd8..f2ed12e 100644 --- a/src/generated/prisma/internal/prismaNamespace.ts +++ b/src/generated/prisma/internal/prismaNamespace.ts @@ -2842,12 +2842,11 @@ export type UserDevicesScalarFieldEnum = (typeof UserDevicesScalarFieldEnum)[key export const CustomerScalarFieldEnum = { id: 'id', + type: 'type', + is_favorite: 'is_favorite', created_at: 'created_at', updated_at: 'updated_at', - deleted_at: 'deleted_at', - type: 'type', - complex_id: 'complex_id', - is_favorite: 'is_favorite' + deleted_at: 'deleted_at' } as const export type CustomerScalarFieldEnum = (typeof CustomerScalarFieldEnum)[keyof typeof CustomerScalarFieldEnum] @@ -2937,7 +2936,7 @@ export const SalesInvoiceScalarFieldEnum = { updated_at: 'updated_at', customer_id: 'customer_id', account_id: 'account_id', - complex_id: 'complex_id' + pos_id: 'pos_id' } as const export type SalesInvoiceScalarFieldEnum = (typeof SalesInvoiceScalarFieldEnum)[keyof typeof SalesInvoiceScalarFieldEnum] @@ -3239,8 +3238,7 @@ export type UserDevicesOrderByRelevanceFieldEnum = (typeof UserDevicesOrderByRel export const CustomerOrderByRelevanceFieldEnum = { - id: 'id', - complex_id: 'complex_id' + id: 'id' } as const export type CustomerOrderByRelevanceFieldEnum = (typeof CustomerOrderByRelevanceFieldEnum)[keyof typeof CustomerOrderByRelevanceFieldEnum] @@ -3329,7 +3327,7 @@ export const SalesInvoiceOrderByRelevanceFieldEnum = { notes: 'notes', customer_id: 'customer_id', account_id: 'account_id', - complex_id: 'complex_id' + pos_id: 'pos_id' } as const export type SalesInvoiceOrderByRelevanceFieldEnum = (typeof SalesInvoiceOrderByRelevanceFieldEnum)[keyof typeof SalesInvoiceOrderByRelevanceFieldEnum] diff --git a/src/generated/prisma/internal/prismaNamespaceBrowser.ts b/src/generated/prisma/internal/prismaNamespaceBrowser.ts index fe2f604..a1c8c41 100644 --- a/src/generated/prisma/internal/prismaNamespaceBrowser.ts +++ b/src/generated/prisma/internal/prismaNamespaceBrowser.ts @@ -357,12 +357,11 @@ export type UserDevicesScalarFieldEnum = (typeof UserDevicesScalarFieldEnum)[key export const CustomerScalarFieldEnum = { id: 'id', + type: 'type', + is_favorite: 'is_favorite', created_at: 'created_at', updated_at: 'updated_at', - deleted_at: 'deleted_at', - type: 'type', - complex_id: 'complex_id', - is_favorite: 'is_favorite' + deleted_at: 'deleted_at' } as const export type CustomerScalarFieldEnum = (typeof CustomerScalarFieldEnum)[keyof typeof CustomerScalarFieldEnum] @@ -452,7 +451,7 @@ export const SalesInvoiceScalarFieldEnum = { updated_at: 'updated_at', customer_id: 'customer_id', account_id: 'account_id', - complex_id: 'complex_id' + pos_id: 'pos_id' } as const export type SalesInvoiceScalarFieldEnum = (typeof SalesInvoiceScalarFieldEnum)[keyof typeof SalesInvoiceScalarFieldEnum] @@ -754,8 +753,7 @@ export type UserDevicesOrderByRelevanceFieldEnum = (typeof UserDevicesOrderByRel export const CustomerOrderByRelevanceFieldEnum = { - id: 'id', - complex_id: 'complex_id' + id: 'id' } as const export type CustomerOrderByRelevanceFieldEnum = (typeof CustomerOrderByRelevanceFieldEnum)[keyof typeof CustomerOrderByRelevanceFieldEnum] @@ -844,7 +842,7 @@ export const SalesInvoiceOrderByRelevanceFieldEnum = { notes: 'notes', customer_id: 'customer_id', account_id: 'account_id', - complex_id: 'complex_id' + pos_id: 'pos_id' } as const export type SalesInvoiceOrderByRelevanceFieldEnum = (typeof SalesInvoiceOrderByRelevanceFieldEnum)[keyof typeof SalesInvoiceOrderByRelevanceFieldEnum] diff --git a/src/generated/prisma/models/Complex.ts b/src/generated/prisma/models/Complex.ts index b2f2322..84a0846 100644 --- a/src/generated/prisma/models/Complex.ts +++ b/src/generated/prisma/models/Complex.ts @@ -203,6 +203,8 @@ export type ComplexWhereInput = { goods?: Prisma.GoodListRelationFilter good_categories?: Prisma.GoodCategoryListRelationFilter permissionComplexes?: Prisma.PermissionComplexListRelationFilter + customerIndividuals?: Prisma.CustomerIndividualListRelationFilter + customerLegals?: Prisma.CustomerLegalListRelationFilter } export type ComplexOrderByWithRelationInput = { @@ -218,6 +220,8 @@ export type ComplexOrderByWithRelationInput = { goods?: Prisma.GoodOrderByRelationAggregateInput good_categories?: Prisma.GoodCategoryOrderByRelationAggregateInput permissionComplexes?: Prisma.PermissionComplexOrderByRelationAggregateInput + customerIndividuals?: Prisma.CustomerIndividualOrderByRelationAggregateInput + customerLegals?: Prisma.CustomerLegalOrderByRelationAggregateInput _relevance?: Prisma.ComplexOrderByRelevanceInput } @@ -237,6 +241,8 @@ export type ComplexWhereUniqueInput = Prisma.AtLeast<{ goods?: Prisma.GoodListRelationFilter good_categories?: Prisma.GoodCategoryListRelationFilter permissionComplexes?: Prisma.PermissionComplexListRelationFilter + customerIndividuals?: Prisma.CustomerIndividualListRelationFilter + customerLegals?: Prisma.CustomerLegalListRelationFilter }, "id"> export type ComplexOrderByWithAggregationInput = { @@ -277,6 +283,8 @@ export type ComplexCreateInput = { goods?: Prisma.GoodCreateNestedManyWithoutComplexInput good_categories?: Prisma.GoodCategoryCreateNestedManyWithoutComplexInput permissionComplexes?: Prisma.PermissionComplexCreateNestedManyWithoutComplexInput + customerIndividuals?: Prisma.CustomerIndividualCreateNestedManyWithoutComplexInput + customerLegals?: Prisma.CustomerLegalCreateNestedManyWithoutComplexInput } export type ComplexUncheckedCreateInput = { @@ -291,6 +299,8 @@ export type ComplexUncheckedCreateInput = { goods?: Prisma.GoodUncheckedCreateNestedManyWithoutComplexInput good_categories?: Prisma.GoodCategoryUncheckedCreateNestedManyWithoutComplexInput permissionComplexes?: Prisma.PermissionComplexUncheckedCreateNestedManyWithoutComplexInput + customerIndividuals?: Prisma.CustomerIndividualUncheckedCreateNestedManyWithoutComplexInput + customerLegals?: Prisma.CustomerLegalUncheckedCreateNestedManyWithoutComplexInput } export type ComplexUpdateInput = { @@ -305,6 +315,8 @@ export type ComplexUpdateInput = { goods?: Prisma.GoodUpdateManyWithoutComplexNestedInput good_categories?: Prisma.GoodCategoryUpdateManyWithoutComplexNestedInput permissionComplexes?: Prisma.PermissionComplexUpdateManyWithoutComplexNestedInput + customerIndividuals?: Prisma.CustomerIndividualUpdateManyWithoutComplexNestedInput + customerLegals?: Prisma.CustomerLegalUpdateManyWithoutComplexNestedInput } export type ComplexUncheckedUpdateInput = { @@ -319,6 +331,8 @@ export type ComplexUncheckedUpdateInput = { goods?: Prisma.GoodUncheckedUpdateManyWithoutComplexNestedInput good_categories?: Prisma.GoodCategoryUncheckedUpdateManyWithoutComplexNestedInput permissionComplexes?: Prisma.PermissionComplexUncheckedUpdateManyWithoutComplexNestedInput + customerIndividuals?: Prisma.CustomerIndividualUncheckedUpdateManyWithoutComplexNestedInput + customerLegals?: Prisma.CustomerLegalUncheckedUpdateManyWithoutComplexNestedInput } export type ComplexCreateManyInput = { @@ -476,6 +490,34 @@ export type ComplexUpdateOneRequiredWithoutPermissionComplexesNestedInput = { update?: Prisma.XOR, Prisma.ComplexUncheckedUpdateWithoutPermissionComplexesInput> } +export type ComplexCreateNestedOneWithoutCustomerIndividualsInput = { + create?: Prisma.XOR + connectOrCreate?: Prisma.ComplexCreateOrConnectWithoutCustomerIndividualsInput + connect?: Prisma.ComplexWhereUniqueInput +} + +export type ComplexUpdateOneRequiredWithoutCustomerIndividualsNestedInput = { + create?: Prisma.XOR + connectOrCreate?: Prisma.ComplexCreateOrConnectWithoutCustomerIndividualsInput + upsert?: Prisma.ComplexUpsertWithoutCustomerIndividualsInput + connect?: Prisma.ComplexWhereUniqueInput + update?: Prisma.XOR, Prisma.ComplexUncheckedUpdateWithoutCustomerIndividualsInput> +} + +export type ComplexCreateNestedOneWithoutCustomerLegalsInput = { + create?: Prisma.XOR + connectOrCreate?: Prisma.ComplexCreateOrConnectWithoutCustomerLegalsInput + connect?: Prisma.ComplexWhereUniqueInput +} + +export type ComplexUpdateOneRequiredWithoutCustomerLegalsNestedInput = { + create?: Prisma.XOR + connectOrCreate?: Prisma.ComplexCreateOrConnectWithoutCustomerLegalsInput + upsert?: Prisma.ComplexUpsertWithoutCustomerLegalsInput + connect?: Prisma.ComplexWhereUniqueInput + update?: Prisma.XOR, Prisma.ComplexUncheckedUpdateWithoutCustomerLegalsInput> +} + export type ComplexCreateNestedOneWithoutGoodsInput = { create?: Prisma.XOR connectOrCreate?: Prisma.ComplexCreateOrConnectWithoutGoodsInput @@ -519,6 +561,8 @@ export type ComplexCreateWithoutBusiness_activityInput = { goods?: Prisma.GoodCreateNestedManyWithoutComplexInput good_categories?: Prisma.GoodCategoryCreateNestedManyWithoutComplexInput permissionComplexes?: Prisma.PermissionComplexCreateNestedManyWithoutComplexInput + customerIndividuals?: Prisma.CustomerIndividualCreateNestedManyWithoutComplexInput + customerLegals?: Prisma.CustomerLegalCreateNestedManyWithoutComplexInput } export type ComplexUncheckedCreateWithoutBusiness_activityInput = { @@ -532,6 +576,8 @@ export type ComplexUncheckedCreateWithoutBusiness_activityInput = { goods?: Prisma.GoodUncheckedCreateNestedManyWithoutComplexInput good_categories?: Prisma.GoodCategoryUncheckedCreateNestedManyWithoutComplexInput permissionComplexes?: Prisma.PermissionComplexUncheckedCreateNestedManyWithoutComplexInput + customerIndividuals?: Prisma.CustomerIndividualUncheckedCreateNestedManyWithoutComplexInput + customerLegals?: Prisma.CustomerLegalUncheckedCreateNestedManyWithoutComplexInput } export type ComplexCreateOrConnectWithoutBusiness_activityInput = { @@ -584,6 +630,8 @@ export type ComplexCreateWithoutPos_listInput = { goods?: Prisma.GoodCreateNestedManyWithoutComplexInput good_categories?: Prisma.GoodCategoryCreateNestedManyWithoutComplexInput permissionComplexes?: Prisma.PermissionComplexCreateNestedManyWithoutComplexInput + customerIndividuals?: Prisma.CustomerIndividualCreateNestedManyWithoutComplexInput + customerLegals?: Prisma.CustomerLegalCreateNestedManyWithoutComplexInput } export type ComplexUncheckedCreateWithoutPos_listInput = { @@ -597,6 +645,8 @@ export type ComplexUncheckedCreateWithoutPos_listInput = { goods?: Prisma.GoodUncheckedCreateNestedManyWithoutComplexInput good_categories?: Prisma.GoodCategoryUncheckedCreateNestedManyWithoutComplexInput permissionComplexes?: Prisma.PermissionComplexUncheckedCreateNestedManyWithoutComplexInput + customerIndividuals?: Prisma.CustomerIndividualUncheckedCreateNestedManyWithoutComplexInput + customerLegals?: Prisma.CustomerLegalUncheckedCreateNestedManyWithoutComplexInput } export type ComplexCreateOrConnectWithoutPos_listInput = { @@ -626,6 +676,8 @@ export type ComplexUpdateWithoutPos_listInput = { goods?: Prisma.GoodUpdateManyWithoutComplexNestedInput good_categories?: Prisma.GoodCategoryUpdateManyWithoutComplexNestedInput permissionComplexes?: Prisma.PermissionComplexUpdateManyWithoutComplexNestedInput + customerIndividuals?: Prisma.CustomerIndividualUpdateManyWithoutComplexNestedInput + customerLegals?: Prisma.CustomerLegalUpdateManyWithoutComplexNestedInput } export type ComplexUncheckedUpdateWithoutPos_listInput = { @@ -639,6 +691,8 @@ export type ComplexUncheckedUpdateWithoutPos_listInput = { goods?: Prisma.GoodUncheckedUpdateManyWithoutComplexNestedInput good_categories?: Prisma.GoodCategoryUncheckedUpdateManyWithoutComplexNestedInput permissionComplexes?: Prisma.PermissionComplexUncheckedUpdateManyWithoutComplexNestedInput + customerIndividuals?: Prisma.CustomerIndividualUncheckedUpdateManyWithoutComplexNestedInput + customerLegals?: Prisma.CustomerLegalUncheckedUpdateManyWithoutComplexNestedInput } export type ComplexCreateWithoutPermissionComplexesInput = { @@ -652,6 +706,8 @@ export type ComplexCreateWithoutPermissionComplexesInput = { pos_list?: Prisma.PosCreateNestedManyWithoutComplexInput goods?: Prisma.GoodCreateNestedManyWithoutComplexInput good_categories?: Prisma.GoodCategoryCreateNestedManyWithoutComplexInput + customerIndividuals?: Prisma.CustomerIndividualCreateNestedManyWithoutComplexInput + customerLegals?: Prisma.CustomerLegalCreateNestedManyWithoutComplexInput } export type ComplexUncheckedCreateWithoutPermissionComplexesInput = { @@ -665,6 +721,8 @@ export type ComplexUncheckedCreateWithoutPermissionComplexesInput = { pos_list?: Prisma.PosUncheckedCreateNestedManyWithoutComplexInput goods?: Prisma.GoodUncheckedCreateNestedManyWithoutComplexInput good_categories?: Prisma.GoodCategoryUncheckedCreateNestedManyWithoutComplexInput + customerIndividuals?: Prisma.CustomerIndividualUncheckedCreateNestedManyWithoutComplexInput + customerLegals?: Prisma.CustomerLegalUncheckedCreateNestedManyWithoutComplexInput } export type ComplexCreateOrConnectWithoutPermissionComplexesInput = { @@ -694,6 +752,8 @@ export type ComplexUpdateWithoutPermissionComplexesInput = { pos_list?: Prisma.PosUpdateManyWithoutComplexNestedInput goods?: Prisma.GoodUpdateManyWithoutComplexNestedInput good_categories?: Prisma.GoodCategoryUpdateManyWithoutComplexNestedInput + customerIndividuals?: Prisma.CustomerIndividualUpdateManyWithoutComplexNestedInput + customerLegals?: Prisma.CustomerLegalUpdateManyWithoutComplexNestedInput } export type ComplexUncheckedUpdateWithoutPermissionComplexesInput = { @@ -707,6 +767,160 @@ export type ComplexUncheckedUpdateWithoutPermissionComplexesInput = { pos_list?: Prisma.PosUncheckedUpdateManyWithoutComplexNestedInput goods?: Prisma.GoodUncheckedUpdateManyWithoutComplexNestedInput good_categories?: Prisma.GoodCategoryUncheckedUpdateManyWithoutComplexNestedInput + customerIndividuals?: Prisma.CustomerIndividualUncheckedUpdateManyWithoutComplexNestedInput + customerLegals?: Prisma.CustomerLegalUncheckedUpdateManyWithoutComplexNestedInput +} + +export type ComplexCreateWithoutCustomerIndividualsInput = { + id?: string + name: string + address?: string | null + tax_id?: string | null + created_at?: Date | string + updated_at?: Date | string + business_activity: Prisma.BusinessActivityCreateNestedOneWithoutComplexesInput + pos_list?: Prisma.PosCreateNestedManyWithoutComplexInput + goods?: Prisma.GoodCreateNestedManyWithoutComplexInput + good_categories?: Prisma.GoodCategoryCreateNestedManyWithoutComplexInput + permissionComplexes?: Prisma.PermissionComplexCreateNestedManyWithoutComplexInput + customerLegals?: Prisma.CustomerLegalCreateNestedManyWithoutComplexInput +} + +export type ComplexUncheckedCreateWithoutCustomerIndividualsInput = { + id?: string + name: string + address?: string | null + tax_id?: string | null + created_at?: Date | string + updated_at?: Date | string + business_activity_id: string + pos_list?: Prisma.PosUncheckedCreateNestedManyWithoutComplexInput + goods?: Prisma.GoodUncheckedCreateNestedManyWithoutComplexInput + good_categories?: Prisma.GoodCategoryUncheckedCreateNestedManyWithoutComplexInput + permissionComplexes?: Prisma.PermissionComplexUncheckedCreateNestedManyWithoutComplexInput + customerLegals?: Prisma.CustomerLegalUncheckedCreateNestedManyWithoutComplexInput +} + +export type ComplexCreateOrConnectWithoutCustomerIndividualsInput = { + where: Prisma.ComplexWhereUniqueInput + create: Prisma.XOR +} + +export type ComplexUpsertWithoutCustomerIndividualsInput = { + update: Prisma.XOR + create: Prisma.XOR + where?: Prisma.ComplexWhereInput +} + +export type ComplexUpdateToOneWithWhereWithoutCustomerIndividualsInput = { + where?: Prisma.ComplexWhereInput + data: Prisma.XOR +} + +export type ComplexUpdateWithoutCustomerIndividualsInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + name?: Prisma.StringFieldUpdateOperationsInput | string + address?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + tax_id?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + business_activity?: Prisma.BusinessActivityUpdateOneRequiredWithoutComplexesNestedInput + pos_list?: Prisma.PosUpdateManyWithoutComplexNestedInput + goods?: Prisma.GoodUpdateManyWithoutComplexNestedInput + good_categories?: Prisma.GoodCategoryUpdateManyWithoutComplexNestedInput + permissionComplexes?: Prisma.PermissionComplexUpdateManyWithoutComplexNestedInput + customerLegals?: Prisma.CustomerLegalUpdateManyWithoutComplexNestedInput +} + +export type ComplexUncheckedUpdateWithoutCustomerIndividualsInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + name?: Prisma.StringFieldUpdateOperationsInput | string + address?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + tax_id?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + business_activity_id?: Prisma.StringFieldUpdateOperationsInput | string + pos_list?: Prisma.PosUncheckedUpdateManyWithoutComplexNestedInput + goods?: Prisma.GoodUncheckedUpdateManyWithoutComplexNestedInput + good_categories?: Prisma.GoodCategoryUncheckedUpdateManyWithoutComplexNestedInput + permissionComplexes?: Prisma.PermissionComplexUncheckedUpdateManyWithoutComplexNestedInput + customerLegals?: Prisma.CustomerLegalUncheckedUpdateManyWithoutComplexNestedInput +} + +export type ComplexCreateWithoutCustomerLegalsInput = { + id?: string + name: string + address?: string | null + tax_id?: string | null + created_at?: Date | string + updated_at?: Date | string + business_activity: Prisma.BusinessActivityCreateNestedOneWithoutComplexesInput + pos_list?: Prisma.PosCreateNestedManyWithoutComplexInput + goods?: Prisma.GoodCreateNestedManyWithoutComplexInput + good_categories?: Prisma.GoodCategoryCreateNestedManyWithoutComplexInput + permissionComplexes?: Prisma.PermissionComplexCreateNestedManyWithoutComplexInput + customerIndividuals?: Prisma.CustomerIndividualCreateNestedManyWithoutComplexInput +} + +export type ComplexUncheckedCreateWithoutCustomerLegalsInput = { + id?: string + name: string + address?: string | null + tax_id?: string | null + created_at?: Date | string + updated_at?: Date | string + business_activity_id: string + pos_list?: Prisma.PosUncheckedCreateNestedManyWithoutComplexInput + goods?: Prisma.GoodUncheckedCreateNestedManyWithoutComplexInput + good_categories?: Prisma.GoodCategoryUncheckedCreateNestedManyWithoutComplexInput + permissionComplexes?: Prisma.PermissionComplexUncheckedCreateNestedManyWithoutComplexInput + customerIndividuals?: Prisma.CustomerIndividualUncheckedCreateNestedManyWithoutComplexInput +} + +export type ComplexCreateOrConnectWithoutCustomerLegalsInput = { + where: Prisma.ComplexWhereUniqueInput + create: Prisma.XOR +} + +export type ComplexUpsertWithoutCustomerLegalsInput = { + update: Prisma.XOR + create: Prisma.XOR + where?: Prisma.ComplexWhereInput +} + +export type ComplexUpdateToOneWithWhereWithoutCustomerLegalsInput = { + where?: Prisma.ComplexWhereInput + data: Prisma.XOR +} + +export type ComplexUpdateWithoutCustomerLegalsInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + name?: Prisma.StringFieldUpdateOperationsInput | string + address?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + tax_id?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + business_activity?: Prisma.BusinessActivityUpdateOneRequiredWithoutComplexesNestedInput + pos_list?: Prisma.PosUpdateManyWithoutComplexNestedInput + goods?: Prisma.GoodUpdateManyWithoutComplexNestedInput + good_categories?: Prisma.GoodCategoryUpdateManyWithoutComplexNestedInput + permissionComplexes?: Prisma.PermissionComplexUpdateManyWithoutComplexNestedInput + customerIndividuals?: Prisma.CustomerIndividualUpdateManyWithoutComplexNestedInput +} + +export type ComplexUncheckedUpdateWithoutCustomerLegalsInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + name?: Prisma.StringFieldUpdateOperationsInput | string + address?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + tax_id?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + business_activity_id?: Prisma.StringFieldUpdateOperationsInput | string + pos_list?: Prisma.PosUncheckedUpdateManyWithoutComplexNestedInput + goods?: Prisma.GoodUncheckedUpdateManyWithoutComplexNestedInput + good_categories?: Prisma.GoodCategoryUncheckedUpdateManyWithoutComplexNestedInput + permissionComplexes?: Prisma.PermissionComplexUncheckedUpdateManyWithoutComplexNestedInput + customerIndividuals?: Prisma.CustomerIndividualUncheckedUpdateManyWithoutComplexNestedInput } export type ComplexCreateWithoutGoodsInput = { @@ -720,6 +934,8 @@ export type ComplexCreateWithoutGoodsInput = { pos_list?: Prisma.PosCreateNestedManyWithoutComplexInput good_categories?: Prisma.GoodCategoryCreateNestedManyWithoutComplexInput permissionComplexes?: Prisma.PermissionComplexCreateNestedManyWithoutComplexInput + customerIndividuals?: Prisma.CustomerIndividualCreateNestedManyWithoutComplexInput + customerLegals?: Prisma.CustomerLegalCreateNestedManyWithoutComplexInput } export type ComplexUncheckedCreateWithoutGoodsInput = { @@ -733,6 +949,8 @@ export type ComplexUncheckedCreateWithoutGoodsInput = { pos_list?: Prisma.PosUncheckedCreateNestedManyWithoutComplexInput good_categories?: Prisma.GoodCategoryUncheckedCreateNestedManyWithoutComplexInput permissionComplexes?: Prisma.PermissionComplexUncheckedCreateNestedManyWithoutComplexInput + customerIndividuals?: Prisma.CustomerIndividualUncheckedCreateNestedManyWithoutComplexInput + customerLegals?: Prisma.CustomerLegalUncheckedCreateNestedManyWithoutComplexInput } export type ComplexCreateOrConnectWithoutGoodsInput = { @@ -762,6 +980,8 @@ export type ComplexUpdateWithoutGoodsInput = { pos_list?: Prisma.PosUpdateManyWithoutComplexNestedInput good_categories?: Prisma.GoodCategoryUpdateManyWithoutComplexNestedInput permissionComplexes?: Prisma.PermissionComplexUpdateManyWithoutComplexNestedInput + customerIndividuals?: Prisma.CustomerIndividualUpdateManyWithoutComplexNestedInput + customerLegals?: Prisma.CustomerLegalUpdateManyWithoutComplexNestedInput } export type ComplexUncheckedUpdateWithoutGoodsInput = { @@ -775,6 +995,8 @@ export type ComplexUncheckedUpdateWithoutGoodsInput = { pos_list?: Prisma.PosUncheckedUpdateManyWithoutComplexNestedInput good_categories?: Prisma.GoodCategoryUncheckedUpdateManyWithoutComplexNestedInput permissionComplexes?: Prisma.PermissionComplexUncheckedUpdateManyWithoutComplexNestedInput + customerIndividuals?: Prisma.CustomerIndividualUncheckedUpdateManyWithoutComplexNestedInput + customerLegals?: Prisma.CustomerLegalUncheckedUpdateManyWithoutComplexNestedInput } export type ComplexCreateWithoutGood_categoriesInput = { @@ -788,6 +1010,8 @@ export type ComplexCreateWithoutGood_categoriesInput = { pos_list?: Prisma.PosCreateNestedManyWithoutComplexInput goods?: Prisma.GoodCreateNestedManyWithoutComplexInput permissionComplexes?: Prisma.PermissionComplexCreateNestedManyWithoutComplexInput + customerIndividuals?: Prisma.CustomerIndividualCreateNestedManyWithoutComplexInput + customerLegals?: Prisma.CustomerLegalCreateNestedManyWithoutComplexInput } export type ComplexUncheckedCreateWithoutGood_categoriesInput = { @@ -801,6 +1025,8 @@ export type ComplexUncheckedCreateWithoutGood_categoriesInput = { pos_list?: Prisma.PosUncheckedCreateNestedManyWithoutComplexInput goods?: Prisma.GoodUncheckedCreateNestedManyWithoutComplexInput permissionComplexes?: Prisma.PermissionComplexUncheckedCreateNestedManyWithoutComplexInput + customerIndividuals?: Prisma.CustomerIndividualUncheckedCreateNestedManyWithoutComplexInput + customerLegals?: Prisma.CustomerLegalUncheckedCreateNestedManyWithoutComplexInput } export type ComplexCreateOrConnectWithoutGood_categoriesInput = { @@ -830,6 +1056,8 @@ export type ComplexUpdateWithoutGood_categoriesInput = { pos_list?: Prisma.PosUpdateManyWithoutComplexNestedInput goods?: Prisma.GoodUpdateManyWithoutComplexNestedInput permissionComplexes?: Prisma.PermissionComplexUpdateManyWithoutComplexNestedInput + customerIndividuals?: Prisma.CustomerIndividualUpdateManyWithoutComplexNestedInput + customerLegals?: Prisma.CustomerLegalUpdateManyWithoutComplexNestedInput } export type ComplexUncheckedUpdateWithoutGood_categoriesInput = { @@ -843,6 +1071,8 @@ export type ComplexUncheckedUpdateWithoutGood_categoriesInput = { pos_list?: Prisma.PosUncheckedUpdateManyWithoutComplexNestedInput goods?: Prisma.GoodUncheckedUpdateManyWithoutComplexNestedInput permissionComplexes?: Prisma.PermissionComplexUncheckedUpdateManyWithoutComplexNestedInput + customerIndividuals?: Prisma.CustomerIndividualUncheckedUpdateManyWithoutComplexNestedInput + customerLegals?: Prisma.CustomerLegalUncheckedUpdateManyWithoutComplexNestedInput } export type ComplexCreateManyBusiness_activityInput = { @@ -865,6 +1095,8 @@ export type ComplexUpdateWithoutBusiness_activityInput = { goods?: Prisma.GoodUpdateManyWithoutComplexNestedInput good_categories?: Prisma.GoodCategoryUpdateManyWithoutComplexNestedInput permissionComplexes?: Prisma.PermissionComplexUpdateManyWithoutComplexNestedInput + customerIndividuals?: Prisma.CustomerIndividualUpdateManyWithoutComplexNestedInput + customerLegals?: Prisma.CustomerLegalUpdateManyWithoutComplexNestedInput } export type ComplexUncheckedUpdateWithoutBusiness_activityInput = { @@ -878,6 +1110,8 @@ export type ComplexUncheckedUpdateWithoutBusiness_activityInput = { goods?: Prisma.GoodUncheckedUpdateManyWithoutComplexNestedInput good_categories?: Prisma.GoodCategoryUncheckedUpdateManyWithoutComplexNestedInput permissionComplexes?: Prisma.PermissionComplexUncheckedUpdateManyWithoutComplexNestedInput + customerIndividuals?: Prisma.CustomerIndividualUncheckedUpdateManyWithoutComplexNestedInput + customerLegals?: Prisma.CustomerLegalUncheckedUpdateManyWithoutComplexNestedInput } export type ComplexUncheckedUpdateManyWithoutBusiness_activityInput = { @@ -899,6 +1133,8 @@ export type ComplexCountOutputType = { goods: number good_categories: number permissionComplexes: number + customerIndividuals: number + customerLegals: number } export type ComplexCountOutputTypeSelect = { @@ -906,6 +1142,8 @@ export type ComplexCountOutputTypeSelect = { + where?: Prisma.CustomerIndividualWhereInput +} + +/** + * ComplexCountOutputType without action + */ +export type ComplexCountOutputTypeCountCustomerLegalsArgs = { + where?: Prisma.CustomerLegalWhereInput +} + export type ComplexSelect = runtime.Types.Extensions.GetSelect<{ id?: boolean @@ -960,6 +1212,8 @@ export type ComplexSelect good_categories?: boolean | Prisma.Complex$good_categoriesArgs permissionComplexes?: boolean | Prisma.Complex$permissionComplexesArgs + customerIndividuals?: boolean | Prisma.Complex$customerIndividualsArgs + customerLegals?: boolean | Prisma.Complex$customerLegalsArgs _count?: boolean | Prisma.ComplexCountOutputTypeDefaultArgs }, ExtArgs["result"]["complex"]> @@ -982,6 +1236,8 @@ export type ComplexInclude good_categories?: boolean | Prisma.Complex$good_categoriesArgs permissionComplexes?: boolean | Prisma.Complex$permissionComplexesArgs + customerIndividuals?: boolean | Prisma.Complex$customerIndividualsArgs + customerLegals?: boolean | Prisma.Complex$customerLegalsArgs _count?: boolean | Prisma.ComplexCountOutputTypeDefaultArgs } @@ -993,6 +1249,8 @@ export type $ComplexPayload[] good_categories: Prisma.$GoodCategoryPayload[] permissionComplexes: Prisma.$PermissionComplexPayload[] + customerIndividuals: Prisma.$CustomerIndividualPayload[] + customerLegals: Prisma.$CustomerLegalPayload[] } scalars: runtime.Types.Extensions.GetPayloadResult<{ id: string @@ -1347,6 +1605,8 @@ export interface Prisma__ComplexClient = {}>(args?: Prisma.Subset>): Prisma.PrismaPromise, T, "findMany", GlobalOmitOptions> | Null> good_categories = {}>(args?: Prisma.Subset>): Prisma.PrismaPromise, T, "findMany", GlobalOmitOptions> | Null> permissionComplexes = {}>(args?: Prisma.Subset>): Prisma.PrismaPromise, T, "findMany", GlobalOmitOptions> | Null> + customerIndividuals = {}>(args?: Prisma.Subset>): Prisma.PrismaPromise, T, "findMany", GlobalOmitOptions> | Null> + customerLegals = {}>(args?: Prisma.Subset>): Prisma.PrismaPromise, 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. @@ -1821,6 +2081,54 @@ export type Complex$permissionComplexesArgs = { + /** + * Select specific fields to fetch from the CustomerIndividual + */ + select?: Prisma.CustomerIndividualSelect | null + /** + * Omit specific fields from the CustomerIndividual + */ + omit?: Prisma.CustomerIndividualOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.CustomerIndividualInclude | null + where?: Prisma.CustomerIndividualWhereInput + orderBy?: Prisma.CustomerIndividualOrderByWithRelationInput | Prisma.CustomerIndividualOrderByWithRelationInput[] + cursor?: Prisma.CustomerIndividualWhereUniqueInput + take?: number + skip?: number + distinct?: Prisma.CustomerIndividualScalarFieldEnum | Prisma.CustomerIndividualScalarFieldEnum[] +} + +/** + * Complex.customerLegals + */ +export type Complex$customerLegalsArgs = { + /** + * Select specific fields to fetch from the CustomerLegal + */ + select?: Prisma.CustomerLegalSelect | null + /** + * Omit specific fields from the CustomerLegal + */ + omit?: Prisma.CustomerLegalOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.CustomerLegalInclude | null + where?: Prisma.CustomerLegalWhereInput + orderBy?: Prisma.CustomerLegalOrderByWithRelationInput | Prisma.CustomerLegalOrderByWithRelationInput[] + cursor?: Prisma.CustomerLegalWhereUniqueInput + take?: number + skip?: number + distinct?: Prisma.CustomerLegalScalarFieldEnum | Prisma.CustomerLegalScalarFieldEnum[] +} + /** * Complex without action */ diff --git a/src/generated/prisma/models/ConsumerAccount.ts b/src/generated/prisma/models/ConsumerAccount.ts index c778ff1..0110b0c 100644 --- a/src/generated/prisma/models/ConsumerAccount.ts +++ b/src/generated/prisma/models/ConsumerAccount.ts @@ -193,6 +193,7 @@ export type ConsumerAccountWhereInput = { user?: Prisma.XOR account?: Prisma.XOR permissions?: Prisma.PermissionConsumerListRelationFilter + salesInvoices?: Prisma.SalesInvoiceListRelationFilter } export type ConsumerAccountOrderByWithRelationInput = { @@ -205,6 +206,7 @@ export type ConsumerAccountOrderByWithRelationInput = { user?: Prisma.ConsumerOrderByWithRelationInput account?: Prisma.AccountOrderByWithRelationInput permissions?: Prisma.PermissionConsumerOrderByRelationAggregateInput + salesInvoices?: Prisma.SalesInvoiceOrderByRelationAggregateInput _relevance?: Prisma.ConsumerAccountOrderByRelevanceInput } @@ -221,6 +223,7 @@ export type ConsumerAccountWhereUniqueInput = Prisma.AtLeast<{ user?: Prisma.XOR account?: Prisma.XOR permissions?: Prisma.PermissionConsumerListRelationFilter + salesInvoices?: Prisma.SalesInvoiceListRelationFilter }, "id" | "account_id"> export type ConsumerAccountOrderByWithAggregationInput = { @@ -255,6 +258,7 @@ export type ConsumerAccountCreateInput = { user: Prisma.ConsumerCreateNestedOneWithoutAccountsInput account: Prisma.AccountCreateNestedOneWithoutConsumer_accountInput permissions?: Prisma.PermissionConsumerCreateNestedManyWithoutAccountInput + salesInvoices?: Prisma.SalesInvoiceCreateNestedManyWithoutAccountInput } export type ConsumerAccountUncheckedCreateInput = { @@ -265,6 +269,7 @@ export type ConsumerAccountUncheckedCreateInput = { user_id: string account_id: string permissions?: Prisma.PermissionConsumerUncheckedCreateNestedManyWithoutAccountInput + salesInvoices?: Prisma.SalesInvoiceUncheckedCreateNestedManyWithoutAccountInput } export type ConsumerAccountUpdateInput = { @@ -275,6 +280,7 @@ export type ConsumerAccountUpdateInput = { user?: Prisma.ConsumerUpdateOneRequiredWithoutAccountsNestedInput account?: Prisma.AccountUpdateOneRequiredWithoutConsumer_accountNestedInput permissions?: Prisma.PermissionConsumerUpdateManyWithoutAccountNestedInput + salesInvoices?: Prisma.SalesInvoiceUpdateManyWithoutAccountNestedInput } export type ConsumerAccountUncheckedUpdateInput = { @@ -285,6 +291,7 @@ export type ConsumerAccountUncheckedUpdateInput = { user_id?: Prisma.StringFieldUpdateOperationsInput | string account_id?: Prisma.StringFieldUpdateOperationsInput | string permissions?: Prisma.PermissionConsumerUncheckedUpdateManyWithoutAccountNestedInput + salesInvoices?: Prisma.SalesInvoiceUncheckedUpdateManyWithoutAccountNestedInput } export type ConsumerAccountCreateManyInput = { @@ -457,6 +464,20 @@ export type ConsumerAccountUpdateOneRequiredWithoutPermissionsNestedInput = { update?: Prisma.XOR, Prisma.ConsumerAccountUncheckedUpdateWithoutPermissionsInput> } +export type ConsumerAccountCreateNestedOneWithoutSalesInvoicesInput = { + create?: Prisma.XOR + connectOrCreate?: Prisma.ConsumerAccountCreateOrConnectWithoutSalesInvoicesInput + connect?: Prisma.ConsumerAccountWhereUniqueInput +} + +export type ConsumerAccountUpdateOneRequiredWithoutSalesInvoicesNestedInput = { + create?: Prisma.XOR + connectOrCreate?: Prisma.ConsumerAccountCreateOrConnectWithoutSalesInvoicesInput + upsert?: Prisma.ConsumerAccountUpsertWithoutSalesInvoicesInput + connect?: Prisma.ConsumerAccountWhereUniqueInput + update?: Prisma.XOR, Prisma.ConsumerAccountUncheckedUpdateWithoutSalesInvoicesInput> +} + export type ConsumerAccountCreateWithoutAccountInput = { id?: string role: $Enums.ConsumerRole @@ -464,6 +485,7 @@ export type ConsumerAccountCreateWithoutAccountInput = { updated_at?: Date | string user: Prisma.ConsumerCreateNestedOneWithoutAccountsInput permissions?: Prisma.PermissionConsumerCreateNestedManyWithoutAccountInput + salesInvoices?: Prisma.SalesInvoiceCreateNestedManyWithoutAccountInput } export type ConsumerAccountUncheckedCreateWithoutAccountInput = { @@ -473,6 +495,7 @@ export type ConsumerAccountUncheckedCreateWithoutAccountInput = { updated_at?: Date | string user_id: string permissions?: Prisma.PermissionConsumerUncheckedCreateNestedManyWithoutAccountInput + salesInvoices?: Prisma.SalesInvoiceUncheckedCreateNestedManyWithoutAccountInput } export type ConsumerAccountCreateOrConnectWithoutAccountInput = { @@ -498,6 +521,7 @@ export type ConsumerAccountUpdateWithoutAccountInput = { updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string user?: Prisma.ConsumerUpdateOneRequiredWithoutAccountsNestedInput permissions?: Prisma.PermissionConsumerUpdateManyWithoutAccountNestedInput + salesInvoices?: Prisma.SalesInvoiceUpdateManyWithoutAccountNestedInput } export type ConsumerAccountUncheckedUpdateWithoutAccountInput = { @@ -507,6 +531,7 @@ export type ConsumerAccountUncheckedUpdateWithoutAccountInput = { updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string user_id?: Prisma.StringFieldUpdateOperationsInput | string permissions?: Prisma.PermissionConsumerUncheckedUpdateManyWithoutAccountNestedInput + salesInvoices?: Prisma.SalesInvoiceUncheckedUpdateManyWithoutAccountNestedInput } export type ConsumerAccountCreateWithoutUserInput = { @@ -516,6 +541,7 @@ export type ConsumerAccountCreateWithoutUserInput = { updated_at?: Date | string account: Prisma.AccountCreateNestedOneWithoutConsumer_accountInput permissions?: Prisma.PermissionConsumerCreateNestedManyWithoutAccountInput + salesInvoices?: Prisma.SalesInvoiceCreateNestedManyWithoutAccountInput } export type ConsumerAccountUncheckedCreateWithoutUserInput = { @@ -525,6 +551,7 @@ export type ConsumerAccountUncheckedCreateWithoutUserInput = { updated_at?: Date | string account_id: string permissions?: Prisma.PermissionConsumerUncheckedCreateNestedManyWithoutAccountInput + salesInvoices?: Prisma.SalesInvoiceUncheckedCreateNestedManyWithoutAccountInput } export type ConsumerAccountCreateOrConnectWithoutUserInput = { @@ -572,6 +599,7 @@ export type ConsumerAccountCreateWithoutPermissionsInput = { updated_at?: Date | string user: Prisma.ConsumerCreateNestedOneWithoutAccountsInput account: Prisma.AccountCreateNestedOneWithoutConsumer_accountInput + salesInvoices?: Prisma.SalesInvoiceCreateNestedManyWithoutAccountInput } export type ConsumerAccountUncheckedCreateWithoutPermissionsInput = { @@ -581,6 +609,7 @@ export type ConsumerAccountUncheckedCreateWithoutPermissionsInput = { updated_at?: Date | string user_id: string account_id: string + salesInvoices?: Prisma.SalesInvoiceUncheckedCreateNestedManyWithoutAccountInput } export type ConsumerAccountCreateOrConnectWithoutPermissionsInput = { @@ -606,6 +635,7 @@ export type ConsumerAccountUpdateWithoutPermissionsInput = { updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string user?: Prisma.ConsumerUpdateOneRequiredWithoutAccountsNestedInput account?: Prisma.AccountUpdateOneRequiredWithoutConsumer_accountNestedInput + salesInvoices?: Prisma.SalesInvoiceUpdateManyWithoutAccountNestedInput } export type ConsumerAccountUncheckedUpdateWithoutPermissionsInput = { @@ -615,6 +645,63 @@ export type ConsumerAccountUncheckedUpdateWithoutPermissionsInput = { updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string user_id?: Prisma.StringFieldUpdateOperationsInput | string account_id?: Prisma.StringFieldUpdateOperationsInput | string + salesInvoices?: Prisma.SalesInvoiceUncheckedUpdateManyWithoutAccountNestedInput +} + +export type ConsumerAccountCreateWithoutSalesInvoicesInput = { + id?: string + role: $Enums.ConsumerRole + created_at?: Date | string + updated_at?: Date | string + user: Prisma.ConsumerCreateNestedOneWithoutAccountsInput + account: Prisma.AccountCreateNestedOneWithoutConsumer_accountInput + permissions?: Prisma.PermissionConsumerCreateNestedManyWithoutAccountInput +} + +export type ConsumerAccountUncheckedCreateWithoutSalesInvoicesInput = { + id?: string + role: $Enums.ConsumerRole + created_at?: Date | string + updated_at?: Date | string + user_id: string + account_id: string + permissions?: Prisma.PermissionConsumerUncheckedCreateNestedManyWithoutAccountInput +} + +export type ConsumerAccountCreateOrConnectWithoutSalesInvoicesInput = { + where: Prisma.ConsumerAccountWhereUniqueInput + create: Prisma.XOR +} + +export type ConsumerAccountUpsertWithoutSalesInvoicesInput = { + update: Prisma.XOR + create: Prisma.XOR + where?: Prisma.ConsumerAccountWhereInput +} + +export type ConsumerAccountUpdateToOneWithWhereWithoutSalesInvoicesInput = { + where?: Prisma.ConsumerAccountWhereInput + data: Prisma.XOR +} + +export type ConsumerAccountUpdateWithoutSalesInvoicesInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + role?: Prisma.EnumConsumerRoleFieldUpdateOperationsInput | $Enums.ConsumerRole + created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + user?: Prisma.ConsumerUpdateOneRequiredWithoutAccountsNestedInput + account?: Prisma.AccountUpdateOneRequiredWithoutConsumer_accountNestedInput + permissions?: Prisma.PermissionConsumerUpdateManyWithoutAccountNestedInput +} + +export type ConsumerAccountUncheckedUpdateWithoutSalesInvoicesInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + role?: Prisma.EnumConsumerRoleFieldUpdateOperationsInput | $Enums.ConsumerRole + created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + user_id?: Prisma.StringFieldUpdateOperationsInput | string + account_id?: Prisma.StringFieldUpdateOperationsInput | string + permissions?: Prisma.PermissionConsumerUncheckedUpdateManyWithoutAccountNestedInput } export type ConsumerAccountCreateManyUserInput = { @@ -632,6 +719,7 @@ export type ConsumerAccountUpdateWithoutUserInput = { updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string account?: Prisma.AccountUpdateOneRequiredWithoutConsumer_accountNestedInput permissions?: Prisma.PermissionConsumerUpdateManyWithoutAccountNestedInput + salesInvoices?: Prisma.SalesInvoiceUpdateManyWithoutAccountNestedInput } export type ConsumerAccountUncheckedUpdateWithoutUserInput = { @@ -641,6 +729,7 @@ export type ConsumerAccountUncheckedUpdateWithoutUserInput = { updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string account_id?: Prisma.StringFieldUpdateOperationsInput | string permissions?: Prisma.PermissionConsumerUncheckedUpdateManyWithoutAccountNestedInput + salesInvoices?: Prisma.SalesInvoiceUncheckedUpdateManyWithoutAccountNestedInput } export type ConsumerAccountUncheckedUpdateManyWithoutUserInput = { @@ -658,10 +747,12 @@ export type ConsumerAccountUncheckedUpdateManyWithoutUserInput = { export type ConsumerAccountCountOutputType = { permissions: number + salesInvoices: number } export type ConsumerAccountCountOutputTypeSelect = { permissions?: boolean | ConsumerAccountCountOutputTypeCountPermissionsArgs + salesInvoices?: boolean | ConsumerAccountCountOutputTypeCountSalesInvoicesArgs } /** @@ -681,6 +772,13 @@ export type ConsumerAccountCountOutputTypeCountPermissionsArgs = { + where?: Prisma.SalesInvoiceWhereInput +} + export type ConsumerAccountSelect = runtime.Types.Extensions.GetSelect<{ id?: boolean @@ -692,6 +790,7 @@ export type ConsumerAccountSelect account?: boolean | Prisma.AccountDefaultArgs permissions?: boolean | Prisma.ConsumerAccount$permissionsArgs + salesInvoices?: boolean | Prisma.ConsumerAccount$salesInvoicesArgs _count?: boolean | Prisma.ConsumerAccountCountOutputTypeDefaultArgs }, ExtArgs["result"]["consumerAccount"]> @@ -711,6 +810,7 @@ export type ConsumerAccountInclude account?: boolean | Prisma.AccountDefaultArgs permissions?: boolean | Prisma.ConsumerAccount$permissionsArgs + salesInvoices?: boolean | Prisma.ConsumerAccount$salesInvoicesArgs _count?: boolean | Prisma.ConsumerAccountCountOutputTypeDefaultArgs } @@ -720,6 +820,7 @@ export type $ConsumerAccountPayload account: Prisma.$AccountPayload permissions: Prisma.$PermissionConsumerPayload[] + salesInvoices: Prisma.$SalesInvoicePayload[] } scalars: runtime.Types.Extensions.GetPayloadResult<{ id: string @@ -1071,6 +1172,7 @@ export interface Prisma__ConsumerAccountClient = {}>(args?: Prisma.Subset>): Prisma.Prisma__ConsumerClient, T, "findUniqueOrThrow", GlobalOmitOptions> | Null, Null, ExtArgs, GlobalOmitOptions> account = {}>(args?: Prisma.Subset>): Prisma.Prisma__AccountClient, T, "findUniqueOrThrow", GlobalOmitOptions> | Null, Null, ExtArgs, GlobalOmitOptions> permissions = {}>(args?: Prisma.Subset>): Prisma.PrismaPromise, T, "findMany", GlobalOmitOptions> | Null> + salesInvoices = {}>(args?: Prisma.Subset>): Prisma.PrismaPromise, 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. @@ -1472,6 +1574,30 @@ export type ConsumerAccount$permissionsArgs = { + /** + * Select specific fields to fetch from the SalesInvoice + */ + select?: Prisma.SalesInvoiceSelect | null + /** + * Omit specific fields from the SalesInvoice + */ + omit?: Prisma.SalesInvoiceOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.SalesInvoiceInclude | null + where?: Prisma.SalesInvoiceWhereInput + orderBy?: Prisma.SalesInvoiceOrderByWithRelationInput | Prisma.SalesInvoiceOrderByWithRelationInput[] + cursor?: Prisma.SalesInvoiceWhereUniqueInput + take?: number + skip?: number + distinct?: Prisma.SalesInvoiceScalarFieldEnum | Prisma.SalesInvoiceScalarFieldEnum[] +} + /** * ConsumerAccount without action */ diff --git a/src/generated/prisma/models/Customer.ts b/src/generated/prisma/models/Customer.ts index 1101653..0d87a41 100644 --- a/src/generated/prisma/models/Customer.ts +++ b/src/generated/prisma/models/Customer.ts @@ -26,64 +26,58 @@ export type AggregateCustomer = { export type CustomerMinAggregateOutputType = { id: string | null + type: $Enums.CustomerType | null + is_favorite: boolean | null created_at: Date | null updated_at: Date | null deleted_at: Date | null - type: $Enums.CustomerType | null - complex_id: string | null - is_favorite: boolean | null } export type CustomerMaxAggregateOutputType = { id: string | null + type: $Enums.CustomerType | null + is_favorite: boolean | null created_at: Date | null updated_at: Date | null deleted_at: Date | null - type: $Enums.CustomerType | null - complex_id: string | null - is_favorite: boolean | null } export type CustomerCountAggregateOutputType = { id: number + type: number + is_favorite: number created_at: number updated_at: number deleted_at: number - type: number - complex_id: number - is_favorite: number _all: number } export type CustomerMinAggregateInputType = { id?: true + type?: true + is_favorite?: true created_at?: true updated_at?: true deleted_at?: true - type?: true - complex_id?: true - is_favorite?: true } export type CustomerMaxAggregateInputType = { id?: true + type?: true + is_favorite?: true created_at?: true updated_at?: true deleted_at?: true - type?: true - complex_id?: true - is_favorite?: true } export type CustomerCountAggregateInputType = { id?: true + type?: true + is_favorite?: true created_at?: true updated_at?: true deleted_at?: true - type?: true - complex_id?: true - is_favorite?: true _all?: true } @@ -161,12 +155,11 @@ export type CustomerGroupByArgs | string + type?: Prisma.EnumCustomerTypeFilter<"Customer"> | $Enums.CustomerType + is_favorite?: Prisma.BoolNullableFilter<"Customer"> | boolean | null created_at?: Prisma.DateTimeFilter<"Customer"> | Date | string updated_at?: Prisma.DateTimeFilter<"Customer"> | Date | string deleted_at?: Prisma.DateTimeNullableFilter<"Customer"> | Date | string | null - type?: Prisma.EnumCustomerTypeFilter<"Customer"> | $Enums.CustomerType - complex_id?: Prisma.StringFilter<"Customer"> | string - is_favorite?: Prisma.BoolNullableFilter<"Customer"> | boolean | null sales_invoices?: Prisma.SalesInvoiceListRelationFilter - customerIndividuals?: Prisma.XOR | null - customerLegals?: Prisma.XOR | null + customer_individuals?: Prisma.XOR | null + customer_legals?: Prisma.XOR | null } export type CustomerOrderByWithRelationInput = { id?: Prisma.SortOrder + type?: Prisma.SortOrder + is_favorite?: Prisma.SortOrderInput | Prisma.SortOrder created_at?: Prisma.SortOrder updated_at?: Prisma.SortOrder deleted_at?: Prisma.SortOrderInput | Prisma.SortOrder - type?: Prisma.SortOrder - complex_id?: Prisma.SortOrder - is_favorite?: Prisma.SortOrderInput | Prisma.SortOrder sales_invoices?: Prisma.SalesInvoiceOrderByRelationAggregateInput - customerIndividuals?: Prisma.CustomerIndividualOrderByWithRelationInput - customerLegals?: Prisma.CustomerLegalOrderByWithRelationInput + customer_individuals?: Prisma.CustomerIndividualOrderByWithRelationInput + customer_legals?: Prisma.CustomerLegalOrderByWithRelationInput _relevance?: Prisma.CustomerOrderByRelevanceInput } @@ -222,25 +213,23 @@ export type CustomerWhereUniqueInput = Prisma.AtLeast<{ AND?: Prisma.CustomerWhereInput | Prisma.CustomerWhereInput[] OR?: Prisma.CustomerWhereInput[] NOT?: Prisma.CustomerWhereInput | Prisma.CustomerWhereInput[] + type?: Prisma.EnumCustomerTypeFilter<"Customer"> | $Enums.CustomerType + is_favorite?: Prisma.BoolNullableFilter<"Customer"> | boolean | null created_at?: Prisma.DateTimeFilter<"Customer"> | Date | string updated_at?: Prisma.DateTimeFilter<"Customer"> | Date | string deleted_at?: Prisma.DateTimeNullableFilter<"Customer"> | Date | string | null - type?: Prisma.EnumCustomerTypeFilter<"Customer"> | $Enums.CustomerType - complex_id?: Prisma.StringFilter<"Customer"> | string - is_favorite?: Prisma.BoolNullableFilter<"Customer"> | boolean | null sales_invoices?: Prisma.SalesInvoiceListRelationFilter - customerIndividuals?: Prisma.XOR | null - customerLegals?: Prisma.XOR | null + customer_individuals?: Prisma.XOR | null + customer_legals?: Prisma.XOR | null }, "id"> export type CustomerOrderByWithAggregationInput = { id?: Prisma.SortOrder + type?: Prisma.SortOrder + is_favorite?: Prisma.SortOrderInput | Prisma.SortOrder created_at?: Prisma.SortOrder updated_at?: Prisma.SortOrder deleted_at?: Prisma.SortOrderInput | Prisma.SortOrder - type?: Prisma.SortOrder - complex_id?: Prisma.SortOrder - is_favorite?: Prisma.SortOrderInput | Prisma.SortOrder _count?: Prisma.CustomerCountOrderByAggregateInput _max?: Prisma.CustomerMaxOrderByAggregateInput _min?: Prisma.CustomerMinOrderByAggregateInput @@ -251,94 +240,86 @@ export type CustomerScalarWhereWithAggregatesInput = { OR?: Prisma.CustomerScalarWhereWithAggregatesInput[] NOT?: Prisma.CustomerScalarWhereWithAggregatesInput | Prisma.CustomerScalarWhereWithAggregatesInput[] id?: Prisma.StringWithAggregatesFilter<"Customer"> | string + type?: Prisma.EnumCustomerTypeWithAggregatesFilter<"Customer"> | $Enums.CustomerType + is_favorite?: Prisma.BoolNullableWithAggregatesFilter<"Customer"> | boolean | null created_at?: Prisma.DateTimeWithAggregatesFilter<"Customer"> | Date | string updated_at?: Prisma.DateTimeWithAggregatesFilter<"Customer"> | Date | string deleted_at?: Prisma.DateTimeNullableWithAggregatesFilter<"Customer"> | Date | string | null - type?: Prisma.EnumCustomerTypeWithAggregatesFilter<"Customer"> | $Enums.CustomerType - complex_id?: Prisma.StringWithAggregatesFilter<"Customer"> | string - is_favorite?: Prisma.BoolNullableWithAggregatesFilter<"Customer"> | boolean | null } export type CustomerCreateInput = { id?: string + type: $Enums.CustomerType + is_favorite?: boolean | null created_at?: Date | string updated_at?: Date | string deleted_at?: Date | string | null - type: $Enums.CustomerType - complex_id: string - is_favorite?: boolean | null sales_invoices?: Prisma.SalesInvoiceCreateNestedManyWithoutCustomerInput - customerIndividuals?: Prisma.CustomerIndividualCreateNestedOneWithoutCustomerInput - customerLegals?: Prisma.CustomerLegalCreateNestedOneWithoutCustomerInput + customer_individuals?: Prisma.CustomerIndividualCreateNestedOneWithoutCustomerInput + customer_legals?: Prisma.CustomerLegalCreateNestedOneWithoutCustomerInput } export type CustomerUncheckedCreateInput = { id?: string + type: $Enums.CustomerType + is_favorite?: boolean | null created_at?: Date | string updated_at?: Date | string deleted_at?: Date | string | null - type: $Enums.CustomerType - complex_id: string - is_favorite?: boolean | null sales_invoices?: Prisma.SalesInvoiceUncheckedCreateNestedManyWithoutCustomerInput - customerIndividuals?: Prisma.CustomerIndividualUncheckedCreateNestedOneWithoutCustomerInput - customerLegals?: Prisma.CustomerLegalUncheckedCreateNestedOneWithoutCustomerInput + customer_individuals?: Prisma.CustomerIndividualUncheckedCreateNestedOneWithoutCustomerInput + customer_legals?: Prisma.CustomerLegalUncheckedCreateNestedOneWithoutCustomerInput } export type CustomerUpdateInput = { id?: Prisma.StringFieldUpdateOperationsInput | string + type?: Prisma.EnumCustomerTypeFieldUpdateOperationsInput | $Enums.CustomerType + is_favorite?: Prisma.NullableBoolFieldUpdateOperationsInput | boolean | null created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string deleted_at?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null - type?: Prisma.EnumCustomerTypeFieldUpdateOperationsInput | $Enums.CustomerType - complex_id?: Prisma.StringFieldUpdateOperationsInput | string - is_favorite?: Prisma.NullableBoolFieldUpdateOperationsInput | boolean | null sales_invoices?: Prisma.SalesInvoiceUpdateManyWithoutCustomerNestedInput - customerIndividuals?: Prisma.CustomerIndividualUpdateOneWithoutCustomerNestedInput - customerLegals?: Prisma.CustomerLegalUpdateOneWithoutCustomerNestedInput + customer_individuals?: Prisma.CustomerIndividualUpdateOneWithoutCustomerNestedInput + customer_legals?: Prisma.CustomerLegalUpdateOneWithoutCustomerNestedInput } export type CustomerUncheckedUpdateInput = { id?: Prisma.StringFieldUpdateOperationsInput | string + type?: Prisma.EnumCustomerTypeFieldUpdateOperationsInput | $Enums.CustomerType + is_favorite?: Prisma.NullableBoolFieldUpdateOperationsInput | boolean | null created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string deleted_at?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null - type?: Prisma.EnumCustomerTypeFieldUpdateOperationsInput | $Enums.CustomerType - complex_id?: Prisma.StringFieldUpdateOperationsInput | string - is_favorite?: Prisma.NullableBoolFieldUpdateOperationsInput | boolean | null sales_invoices?: Prisma.SalesInvoiceUncheckedUpdateManyWithoutCustomerNestedInput - customerIndividuals?: Prisma.CustomerIndividualUncheckedUpdateOneWithoutCustomerNestedInput - customerLegals?: Prisma.CustomerLegalUncheckedUpdateOneWithoutCustomerNestedInput + customer_individuals?: Prisma.CustomerIndividualUncheckedUpdateOneWithoutCustomerNestedInput + customer_legals?: Prisma.CustomerLegalUncheckedUpdateOneWithoutCustomerNestedInput } export type CustomerCreateManyInput = { id?: string + type: $Enums.CustomerType + is_favorite?: boolean | null created_at?: Date | string updated_at?: Date | string deleted_at?: Date | string | null - type: $Enums.CustomerType - complex_id: string - is_favorite?: boolean | null } export type CustomerUpdateManyMutationInput = { id?: Prisma.StringFieldUpdateOperationsInput | string + type?: Prisma.EnumCustomerTypeFieldUpdateOperationsInput | $Enums.CustomerType + is_favorite?: Prisma.NullableBoolFieldUpdateOperationsInput | boolean | null created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string deleted_at?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null - type?: Prisma.EnumCustomerTypeFieldUpdateOperationsInput | $Enums.CustomerType - complex_id?: Prisma.StringFieldUpdateOperationsInput | string - is_favorite?: Prisma.NullableBoolFieldUpdateOperationsInput | boolean | null } export type CustomerUncheckedUpdateManyInput = { id?: Prisma.StringFieldUpdateOperationsInput | string + type?: Prisma.EnumCustomerTypeFieldUpdateOperationsInput | $Enums.CustomerType + is_favorite?: Prisma.NullableBoolFieldUpdateOperationsInput | boolean | null created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string deleted_at?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null - type?: Prisma.EnumCustomerTypeFieldUpdateOperationsInput | $Enums.CustomerType - complex_id?: Prisma.StringFieldUpdateOperationsInput | string - is_favorite?: Prisma.NullableBoolFieldUpdateOperationsInput | boolean | null } export type CustomerOrderByRelevanceInput = { @@ -349,32 +330,29 @@ export type CustomerOrderByRelevanceInput = { export type CustomerCountOrderByAggregateInput = { id?: Prisma.SortOrder + type?: Prisma.SortOrder + is_favorite?: Prisma.SortOrder created_at?: Prisma.SortOrder updated_at?: Prisma.SortOrder deleted_at?: Prisma.SortOrder - type?: Prisma.SortOrder - complex_id?: Prisma.SortOrder - is_favorite?: Prisma.SortOrder } export type CustomerMaxOrderByAggregateInput = { id?: Prisma.SortOrder + type?: Prisma.SortOrder + is_favorite?: Prisma.SortOrder created_at?: Prisma.SortOrder updated_at?: Prisma.SortOrder deleted_at?: Prisma.SortOrder - type?: Prisma.SortOrder - complex_id?: Prisma.SortOrder - is_favorite?: Prisma.SortOrder } export type CustomerMinOrderByAggregateInput = { id?: Prisma.SortOrder + type?: Prisma.SortOrder + is_favorite?: Prisma.SortOrder created_at?: Prisma.SortOrder updated_at?: Prisma.SortOrder deleted_at?: Prisma.SortOrder - type?: Prisma.SortOrder - complex_id?: Prisma.SortOrder - is_favorite?: Prisma.SortOrder } export type CustomerScalarRelationFilter = { @@ -387,10 +365,6 @@ export type CustomerNullableScalarRelationFilter = { isNot?: Prisma.CustomerWhereInput | null } -export type NullableDateTimeFieldUpdateOperationsInput = { - set?: Date | string | null -} - export type EnumCustomerTypeFieldUpdateOperationsInput = { set?: $Enums.CustomerType } @@ -399,32 +373,36 @@ export type NullableBoolFieldUpdateOperationsInput = { set?: boolean | null } -export type CustomerCreateNestedOneWithoutCustomerIndividualsInput = { - create?: Prisma.XOR - connectOrCreate?: Prisma.CustomerCreateOrConnectWithoutCustomerIndividualsInput +export type NullableDateTimeFieldUpdateOperationsInput = { + set?: Date | string | null +} + +export type CustomerCreateNestedOneWithoutCustomer_individualsInput = { + create?: Prisma.XOR + connectOrCreate?: Prisma.CustomerCreateOrConnectWithoutCustomer_individualsInput connect?: Prisma.CustomerWhereUniqueInput } -export type CustomerUpdateOneRequiredWithoutCustomerIndividualsNestedInput = { - create?: Prisma.XOR - connectOrCreate?: Prisma.CustomerCreateOrConnectWithoutCustomerIndividualsInput - upsert?: Prisma.CustomerUpsertWithoutCustomerIndividualsInput +export type CustomerUpdateOneRequiredWithoutCustomer_individualsNestedInput = { + create?: Prisma.XOR + connectOrCreate?: Prisma.CustomerCreateOrConnectWithoutCustomer_individualsInput + upsert?: Prisma.CustomerUpsertWithoutCustomer_individualsInput connect?: Prisma.CustomerWhereUniqueInput - update?: Prisma.XOR, Prisma.CustomerUncheckedUpdateWithoutCustomerIndividualsInput> + update?: Prisma.XOR, Prisma.CustomerUncheckedUpdateWithoutCustomer_individualsInput> } -export type CustomerCreateNestedOneWithoutCustomerLegalsInput = { - create?: Prisma.XOR - connectOrCreate?: Prisma.CustomerCreateOrConnectWithoutCustomerLegalsInput +export type CustomerCreateNestedOneWithoutCustomer_legalsInput = { + create?: Prisma.XOR + connectOrCreate?: Prisma.CustomerCreateOrConnectWithoutCustomer_legalsInput connect?: Prisma.CustomerWhereUniqueInput } -export type CustomerUpdateOneRequiredWithoutCustomerLegalsNestedInput = { - create?: Prisma.XOR - connectOrCreate?: Prisma.CustomerCreateOrConnectWithoutCustomerLegalsInput - upsert?: Prisma.CustomerUpsertWithoutCustomerLegalsInput +export type CustomerUpdateOneRequiredWithoutCustomer_legalsNestedInput = { + create?: Prisma.XOR + connectOrCreate?: Prisma.CustomerCreateOrConnectWithoutCustomer_legalsInput + upsert?: Prisma.CustomerUpsertWithoutCustomer_legalsInput connect?: Prisma.CustomerWhereUniqueInput - update?: Prisma.XOR, Prisma.CustomerUncheckedUpdateWithoutCustomerLegalsInput> + update?: Prisma.XOR, Prisma.CustomerUncheckedUpdateWithoutCustomer_legalsInput> } export type CustomerCreateNestedOneWithoutSales_invoicesInput = { @@ -443,156 +421,146 @@ export type CustomerUpdateOneWithoutSales_invoicesNestedInput = { update?: Prisma.XOR, Prisma.CustomerUncheckedUpdateWithoutSales_invoicesInput> } -export type CustomerCreateWithoutCustomerIndividualsInput = { +export type CustomerCreateWithoutCustomer_individualsInput = { id?: string + type: $Enums.CustomerType + is_favorite?: boolean | null created_at?: Date | string updated_at?: Date | string deleted_at?: Date | string | null - type: $Enums.CustomerType - complex_id: string - is_favorite?: boolean | null sales_invoices?: Prisma.SalesInvoiceCreateNestedManyWithoutCustomerInput - customerLegals?: Prisma.CustomerLegalCreateNestedOneWithoutCustomerInput + customer_legals?: Prisma.CustomerLegalCreateNestedOneWithoutCustomerInput } -export type CustomerUncheckedCreateWithoutCustomerIndividualsInput = { +export type CustomerUncheckedCreateWithoutCustomer_individualsInput = { id?: string + type: $Enums.CustomerType + is_favorite?: boolean | null created_at?: Date | string updated_at?: Date | string deleted_at?: Date | string | null - type: $Enums.CustomerType - complex_id: string - is_favorite?: boolean | null sales_invoices?: Prisma.SalesInvoiceUncheckedCreateNestedManyWithoutCustomerInput - customerLegals?: Prisma.CustomerLegalUncheckedCreateNestedOneWithoutCustomerInput + customer_legals?: Prisma.CustomerLegalUncheckedCreateNestedOneWithoutCustomerInput } -export type CustomerCreateOrConnectWithoutCustomerIndividualsInput = { +export type CustomerCreateOrConnectWithoutCustomer_individualsInput = { where: Prisma.CustomerWhereUniqueInput - create: Prisma.XOR + create: Prisma.XOR } -export type CustomerUpsertWithoutCustomerIndividualsInput = { - update: Prisma.XOR - create: Prisma.XOR +export type CustomerUpsertWithoutCustomer_individualsInput = { + update: Prisma.XOR + create: Prisma.XOR where?: Prisma.CustomerWhereInput } -export type CustomerUpdateToOneWithWhereWithoutCustomerIndividualsInput = { +export type CustomerUpdateToOneWithWhereWithoutCustomer_individualsInput = { where?: Prisma.CustomerWhereInput - data: Prisma.XOR + data: Prisma.XOR } -export type CustomerUpdateWithoutCustomerIndividualsInput = { +export type CustomerUpdateWithoutCustomer_individualsInput = { id?: Prisma.StringFieldUpdateOperationsInput | string + type?: Prisma.EnumCustomerTypeFieldUpdateOperationsInput | $Enums.CustomerType + is_favorite?: Prisma.NullableBoolFieldUpdateOperationsInput | boolean | null created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string deleted_at?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null - type?: Prisma.EnumCustomerTypeFieldUpdateOperationsInput | $Enums.CustomerType - complex_id?: Prisma.StringFieldUpdateOperationsInput | string - is_favorite?: Prisma.NullableBoolFieldUpdateOperationsInput | boolean | null sales_invoices?: Prisma.SalesInvoiceUpdateManyWithoutCustomerNestedInput - customerLegals?: Prisma.CustomerLegalUpdateOneWithoutCustomerNestedInput + customer_legals?: Prisma.CustomerLegalUpdateOneWithoutCustomerNestedInput } -export type CustomerUncheckedUpdateWithoutCustomerIndividualsInput = { +export type CustomerUncheckedUpdateWithoutCustomer_individualsInput = { id?: Prisma.StringFieldUpdateOperationsInput | string + type?: Prisma.EnumCustomerTypeFieldUpdateOperationsInput | $Enums.CustomerType + is_favorite?: Prisma.NullableBoolFieldUpdateOperationsInput | boolean | null created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string deleted_at?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null - type?: Prisma.EnumCustomerTypeFieldUpdateOperationsInput | $Enums.CustomerType - complex_id?: Prisma.StringFieldUpdateOperationsInput | string - is_favorite?: Prisma.NullableBoolFieldUpdateOperationsInput | boolean | null sales_invoices?: Prisma.SalesInvoiceUncheckedUpdateManyWithoutCustomerNestedInput - customerLegals?: Prisma.CustomerLegalUncheckedUpdateOneWithoutCustomerNestedInput + customer_legals?: Prisma.CustomerLegalUncheckedUpdateOneWithoutCustomerNestedInput } -export type CustomerCreateWithoutCustomerLegalsInput = { +export type CustomerCreateWithoutCustomer_legalsInput = { id?: string + type: $Enums.CustomerType + is_favorite?: boolean | null created_at?: Date | string updated_at?: Date | string deleted_at?: Date | string | null - type: $Enums.CustomerType - complex_id: string - is_favorite?: boolean | null sales_invoices?: Prisma.SalesInvoiceCreateNestedManyWithoutCustomerInput - customerIndividuals?: Prisma.CustomerIndividualCreateNestedOneWithoutCustomerInput + customer_individuals?: Prisma.CustomerIndividualCreateNestedOneWithoutCustomerInput } -export type CustomerUncheckedCreateWithoutCustomerLegalsInput = { +export type CustomerUncheckedCreateWithoutCustomer_legalsInput = { id?: string + type: $Enums.CustomerType + is_favorite?: boolean | null created_at?: Date | string updated_at?: Date | string deleted_at?: Date | string | null - type: $Enums.CustomerType - complex_id: string - is_favorite?: boolean | null sales_invoices?: Prisma.SalesInvoiceUncheckedCreateNestedManyWithoutCustomerInput - customerIndividuals?: Prisma.CustomerIndividualUncheckedCreateNestedOneWithoutCustomerInput + customer_individuals?: Prisma.CustomerIndividualUncheckedCreateNestedOneWithoutCustomerInput } -export type CustomerCreateOrConnectWithoutCustomerLegalsInput = { +export type CustomerCreateOrConnectWithoutCustomer_legalsInput = { where: Prisma.CustomerWhereUniqueInput - create: Prisma.XOR + create: Prisma.XOR } -export type CustomerUpsertWithoutCustomerLegalsInput = { - update: Prisma.XOR - create: Prisma.XOR +export type CustomerUpsertWithoutCustomer_legalsInput = { + update: Prisma.XOR + create: Prisma.XOR where?: Prisma.CustomerWhereInput } -export type CustomerUpdateToOneWithWhereWithoutCustomerLegalsInput = { +export type CustomerUpdateToOneWithWhereWithoutCustomer_legalsInput = { where?: Prisma.CustomerWhereInput - data: Prisma.XOR + data: Prisma.XOR } -export type CustomerUpdateWithoutCustomerLegalsInput = { +export type CustomerUpdateWithoutCustomer_legalsInput = { id?: Prisma.StringFieldUpdateOperationsInput | string + type?: Prisma.EnumCustomerTypeFieldUpdateOperationsInput | $Enums.CustomerType + is_favorite?: Prisma.NullableBoolFieldUpdateOperationsInput | boolean | null created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string deleted_at?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null - type?: Prisma.EnumCustomerTypeFieldUpdateOperationsInput | $Enums.CustomerType - complex_id?: Prisma.StringFieldUpdateOperationsInput | string - is_favorite?: Prisma.NullableBoolFieldUpdateOperationsInput | boolean | null sales_invoices?: Prisma.SalesInvoiceUpdateManyWithoutCustomerNestedInput - customerIndividuals?: Prisma.CustomerIndividualUpdateOneWithoutCustomerNestedInput + customer_individuals?: Prisma.CustomerIndividualUpdateOneWithoutCustomerNestedInput } -export type CustomerUncheckedUpdateWithoutCustomerLegalsInput = { +export type CustomerUncheckedUpdateWithoutCustomer_legalsInput = { id?: Prisma.StringFieldUpdateOperationsInput | string + type?: Prisma.EnumCustomerTypeFieldUpdateOperationsInput | $Enums.CustomerType + is_favorite?: Prisma.NullableBoolFieldUpdateOperationsInput | boolean | null created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string deleted_at?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null - type?: Prisma.EnumCustomerTypeFieldUpdateOperationsInput | $Enums.CustomerType - complex_id?: Prisma.StringFieldUpdateOperationsInput | string - is_favorite?: Prisma.NullableBoolFieldUpdateOperationsInput | boolean | null sales_invoices?: Prisma.SalesInvoiceUncheckedUpdateManyWithoutCustomerNestedInput - customerIndividuals?: Prisma.CustomerIndividualUncheckedUpdateOneWithoutCustomerNestedInput + customer_individuals?: Prisma.CustomerIndividualUncheckedUpdateOneWithoutCustomerNestedInput } export type CustomerCreateWithoutSales_invoicesInput = { id?: string + type: $Enums.CustomerType + is_favorite?: boolean | null created_at?: Date | string updated_at?: Date | string deleted_at?: Date | string | null - type: $Enums.CustomerType - complex_id: string - is_favorite?: boolean | null - customerIndividuals?: Prisma.CustomerIndividualCreateNestedOneWithoutCustomerInput - customerLegals?: Prisma.CustomerLegalCreateNestedOneWithoutCustomerInput + customer_individuals?: Prisma.CustomerIndividualCreateNestedOneWithoutCustomerInput + customer_legals?: Prisma.CustomerLegalCreateNestedOneWithoutCustomerInput } export type CustomerUncheckedCreateWithoutSales_invoicesInput = { id?: string + type: $Enums.CustomerType + is_favorite?: boolean | null created_at?: Date | string updated_at?: Date | string deleted_at?: Date | string | null - type: $Enums.CustomerType - complex_id: string - is_favorite?: boolean | null - customerIndividuals?: Prisma.CustomerIndividualUncheckedCreateNestedOneWithoutCustomerInput - customerLegals?: Prisma.CustomerLegalUncheckedCreateNestedOneWithoutCustomerInput + customer_individuals?: Prisma.CustomerIndividualUncheckedCreateNestedOneWithoutCustomerInput + customer_legals?: Prisma.CustomerLegalUncheckedCreateNestedOneWithoutCustomerInput } export type CustomerCreateOrConnectWithoutSales_invoicesInput = { @@ -613,26 +581,24 @@ export type CustomerUpdateToOneWithWhereWithoutSales_invoicesInput = { export type CustomerUpdateWithoutSales_invoicesInput = { id?: Prisma.StringFieldUpdateOperationsInput | string + type?: Prisma.EnumCustomerTypeFieldUpdateOperationsInput | $Enums.CustomerType + is_favorite?: Prisma.NullableBoolFieldUpdateOperationsInput | boolean | null created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string deleted_at?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null - type?: Prisma.EnumCustomerTypeFieldUpdateOperationsInput | $Enums.CustomerType - complex_id?: Prisma.StringFieldUpdateOperationsInput | string - is_favorite?: Prisma.NullableBoolFieldUpdateOperationsInput | boolean | null - customerIndividuals?: Prisma.CustomerIndividualUpdateOneWithoutCustomerNestedInput - customerLegals?: Prisma.CustomerLegalUpdateOneWithoutCustomerNestedInput + customer_individuals?: Prisma.CustomerIndividualUpdateOneWithoutCustomerNestedInput + customer_legals?: Prisma.CustomerLegalUpdateOneWithoutCustomerNestedInput } export type CustomerUncheckedUpdateWithoutSales_invoicesInput = { id?: Prisma.StringFieldUpdateOperationsInput | string + type?: Prisma.EnumCustomerTypeFieldUpdateOperationsInput | $Enums.CustomerType + is_favorite?: Prisma.NullableBoolFieldUpdateOperationsInput | boolean | null created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string deleted_at?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null - type?: Prisma.EnumCustomerTypeFieldUpdateOperationsInput | $Enums.CustomerType - complex_id?: Prisma.StringFieldUpdateOperationsInput | string - is_favorite?: Prisma.NullableBoolFieldUpdateOperationsInput | boolean | null - customerIndividuals?: Prisma.CustomerIndividualUncheckedUpdateOneWithoutCustomerNestedInput - customerLegals?: Prisma.CustomerLegalUncheckedUpdateOneWithoutCustomerNestedInput + customer_individuals?: Prisma.CustomerIndividualUncheckedUpdateOneWithoutCustomerNestedInput + customer_legals?: Prisma.CustomerLegalUncheckedUpdateOneWithoutCustomerNestedInput } @@ -668,15 +634,14 @@ export type CustomerCountOutputTypeCountSales_invoicesArgs = runtime.Types.Extensions.GetSelect<{ id?: boolean + type?: boolean + is_favorite?: boolean created_at?: boolean updated_at?: boolean deleted_at?: boolean - type?: boolean - complex_id?: boolean - is_favorite?: boolean sales_invoices?: boolean | Prisma.Customer$sales_invoicesArgs - customerIndividuals?: boolean | Prisma.Customer$customerIndividualsArgs - customerLegals?: boolean | Prisma.Customer$customerLegalsArgs + customer_individuals?: boolean | Prisma.Customer$customer_individualsArgs + customer_legals?: boolean | Prisma.Customer$customer_legalsArgs _count?: boolean | Prisma.CustomerCountOutputTypeDefaultArgs }, ExtArgs["result"]["customer"]> @@ -684,19 +649,18 @@ export type CustomerSelect = runtime.Types.Extensions.GetOmit<"id" | "created_at" | "updated_at" | "deleted_at" | "type" | "complex_id" | "is_favorite", ExtArgs["result"]["customer"]> +export type CustomerOmit = runtime.Types.Extensions.GetOmit<"id" | "type" | "is_favorite" | "created_at" | "updated_at" | "deleted_at", ExtArgs["result"]["customer"]> export type CustomerInclude = { sales_invoices?: boolean | Prisma.Customer$sales_invoicesArgs - customerIndividuals?: boolean | Prisma.Customer$customerIndividualsArgs - customerLegals?: boolean | Prisma.Customer$customerLegalsArgs + customer_individuals?: boolean | Prisma.Customer$customer_individualsArgs + customer_legals?: boolean | Prisma.Customer$customer_legalsArgs _count?: boolean | Prisma.CustomerCountOutputTypeDefaultArgs } @@ -704,17 +668,16 @@ export type $CustomerPayload[] - customerIndividuals: Prisma.$CustomerIndividualPayload | null - customerLegals: Prisma.$CustomerLegalPayload | null + customer_individuals: Prisma.$CustomerIndividualPayload | null + customer_legals: Prisma.$CustomerLegalPayload | null } scalars: runtime.Types.Extensions.GetPayloadResult<{ id: string + type: $Enums.CustomerType + is_favorite: boolean | null created_at: Date updated_at: Date deleted_at: Date | null - type: $Enums.CustomerType - complex_id: string - is_favorite: boolean | null }, ExtArgs["result"]["customer"]> composites: {} } @@ -1056,8 +1019,8 @@ readonly fields: CustomerFieldRefs; export interface Prisma__CustomerClient extends Prisma.PrismaPromise { readonly [Symbol.toStringTag]: "PrismaPromise" sales_invoices = {}>(args?: Prisma.Subset>): Prisma.PrismaPromise, T, "findMany", GlobalOmitOptions> | Null> - customerIndividuals = {}>(args?: Prisma.Subset>): Prisma.Prisma__CustomerIndividualClient, T, "findUniqueOrThrow", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions> - customerLegals = {}>(args?: Prisma.Subset>): Prisma.Prisma__CustomerLegalClient, T, "findUniqueOrThrow", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions> + customer_individuals = {}>(args?: Prisma.Subset>): Prisma.Prisma__CustomerIndividualClient, T, "findUniqueOrThrow", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions> + customer_legals = {}>(args?: Prisma.Subset>): Prisma.Prisma__CustomerLegalClient, 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. @@ -1088,12 +1051,11 @@ export interface Prisma__CustomerClient + readonly type: Prisma.FieldRef<"Customer", 'CustomerType'> + readonly is_favorite: Prisma.FieldRef<"Customer", 'Boolean'> readonly created_at: Prisma.FieldRef<"Customer", 'DateTime'> readonly updated_at: Prisma.FieldRef<"Customer", 'DateTime'> readonly deleted_at: Prisma.FieldRef<"Customer", 'DateTime'> - readonly type: Prisma.FieldRef<"Customer", 'CustomerType'> - readonly complex_id: Prisma.FieldRef<"Customer", 'String'> - readonly is_favorite: Prisma.FieldRef<"Customer", 'Boolean'> } @@ -1461,9 +1423,9 @@ export type Customer$sales_invoicesArgs = { +export type Customer$customer_individualsArgs = { /** * Select specific fields to fetch from the CustomerIndividual */ @@ -1480,9 +1442,9 @@ export type Customer$customerIndividualsArgs = { +export type Customer$customer_legalsArgs = { /** * Select specific fields to fetch from the CustomerLegal */ diff --git a/src/generated/prisma/models/CustomerIndividual.ts b/src/generated/prisma/models/CustomerIndividual.ts index da398ac..8b5b7d5 100644 --- a/src/generated/prisma/models/CustomerIndividual.ts +++ b/src/generated/prisma/models/CustomerIndividual.ts @@ -199,6 +199,7 @@ export type CustomerIndividualWhereInput = { economic_code?: Prisma.StringNullableFilter<"CustomerIndividual"> | string | null complex_id?: Prisma.StringFilter<"CustomerIndividual"> | string customer?: Prisma.XOR + complex?: Prisma.XOR } export type CustomerIndividualOrderByWithRelationInput = { @@ -210,6 +211,7 @@ export type CustomerIndividualOrderByWithRelationInput = { economic_code?: Prisma.SortOrderInput | Prisma.SortOrder complex_id?: Prisma.SortOrder customer?: Prisma.CustomerOrderByWithRelationInput + complex?: Prisma.ComplexOrderByWithRelationInput _relevance?: Prisma.CustomerIndividualOrderByRelevanceInput } @@ -226,6 +228,7 @@ export type CustomerIndividualWhereUniqueInput = Prisma.AtLeast<{ economic_code?: Prisma.StringNullableFilter<"CustomerIndividual"> | string | null complex_id?: Prisma.StringFilter<"CustomerIndividual"> | string customer?: Prisma.XOR + complex?: Prisma.XOR }, "customer_id" | "complex_id_national_id"> export type CustomerIndividualOrderByWithAggregationInput = { @@ -260,8 +263,8 @@ export type CustomerIndividualCreateInput = { national_id: string postal_code: string economic_code?: string | null - complex_id: string - customer: Prisma.CustomerCreateNestedOneWithoutCustomerIndividualsInput + customer: Prisma.CustomerCreateNestedOneWithoutCustomer_individualsInput + complex: Prisma.ComplexCreateNestedOneWithoutCustomerIndividualsInput } export type CustomerIndividualUncheckedCreateInput = { @@ -280,8 +283,8 @@ export type CustomerIndividualUpdateInput = { national_id?: Prisma.StringFieldUpdateOperationsInput | string postal_code?: Prisma.StringFieldUpdateOperationsInput | string economic_code?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - complex_id?: Prisma.StringFieldUpdateOperationsInput | string - customer?: Prisma.CustomerUpdateOneRequiredWithoutCustomerIndividualsNestedInput + customer?: Prisma.CustomerUpdateOneRequiredWithoutCustomer_individualsNestedInput + complex?: Prisma.ComplexUpdateOneRequiredWithoutCustomerIndividualsNestedInput } export type CustomerIndividualUncheckedUpdateInput = { @@ -310,7 +313,6 @@ export type CustomerIndividualUpdateManyMutationInput = { national_id?: Prisma.StringFieldUpdateOperationsInput | string postal_code?: Prisma.StringFieldUpdateOperationsInput | string economic_code?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - complex_id?: Prisma.StringFieldUpdateOperationsInput | string } export type CustomerIndividualUncheckedUpdateManyInput = { @@ -323,6 +325,16 @@ export type CustomerIndividualUncheckedUpdateManyInput = { complex_id?: Prisma.StringFieldUpdateOperationsInput | string } +export type CustomerIndividualListRelationFilter = { + every?: Prisma.CustomerIndividualWhereInput + some?: Prisma.CustomerIndividualWhereInput + none?: Prisma.CustomerIndividualWhereInput +} + +export type CustomerIndividualOrderByRelationAggregateInput = { + _count?: Prisma.SortOrder +} + export type CustomerIndividualNullableScalarRelationFilter = { is?: Prisma.CustomerIndividualWhereInput | null isNot?: Prisma.CustomerIndividualWhereInput | null @@ -369,6 +381,48 @@ export type CustomerIndividualMinOrderByAggregateInput = { complex_id?: Prisma.SortOrder } +export type CustomerIndividualCreateNestedManyWithoutComplexInput = { + create?: Prisma.XOR | Prisma.CustomerIndividualCreateWithoutComplexInput[] | Prisma.CustomerIndividualUncheckedCreateWithoutComplexInput[] + connectOrCreate?: Prisma.CustomerIndividualCreateOrConnectWithoutComplexInput | Prisma.CustomerIndividualCreateOrConnectWithoutComplexInput[] + createMany?: Prisma.CustomerIndividualCreateManyComplexInputEnvelope + connect?: Prisma.CustomerIndividualWhereUniqueInput | Prisma.CustomerIndividualWhereUniqueInput[] +} + +export type CustomerIndividualUncheckedCreateNestedManyWithoutComplexInput = { + create?: Prisma.XOR | Prisma.CustomerIndividualCreateWithoutComplexInput[] | Prisma.CustomerIndividualUncheckedCreateWithoutComplexInput[] + connectOrCreate?: Prisma.CustomerIndividualCreateOrConnectWithoutComplexInput | Prisma.CustomerIndividualCreateOrConnectWithoutComplexInput[] + createMany?: Prisma.CustomerIndividualCreateManyComplexInputEnvelope + connect?: Prisma.CustomerIndividualWhereUniqueInput | Prisma.CustomerIndividualWhereUniqueInput[] +} + +export type CustomerIndividualUpdateManyWithoutComplexNestedInput = { + create?: Prisma.XOR | Prisma.CustomerIndividualCreateWithoutComplexInput[] | Prisma.CustomerIndividualUncheckedCreateWithoutComplexInput[] + connectOrCreate?: Prisma.CustomerIndividualCreateOrConnectWithoutComplexInput | Prisma.CustomerIndividualCreateOrConnectWithoutComplexInput[] + upsert?: Prisma.CustomerIndividualUpsertWithWhereUniqueWithoutComplexInput | Prisma.CustomerIndividualUpsertWithWhereUniqueWithoutComplexInput[] + createMany?: Prisma.CustomerIndividualCreateManyComplexInputEnvelope + set?: Prisma.CustomerIndividualWhereUniqueInput | Prisma.CustomerIndividualWhereUniqueInput[] + disconnect?: Prisma.CustomerIndividualWhereUniqueInput | Prisma.CustomerIndividualWhereUniqueInput[] + delete?: Prisma.CustomerIndividualWhereUniqueInput | Prisma.CustomerIndividualWhereUniqueInput[] + connect?: Prisma.CustomerIndividualWhereUniqueInput | Prisma.CustomerIndividualWhereUniqueInput[] + update?: Prisma.CustomerIndividualUpdateWithWhereUniqueWithoutComplexInput | Prisma.CustomerIndividualUpdateWithWhereUniqueWithoutComplexInput[] + updateMany?: Prisma.CustomerIndividualUpdateManyWithWhereWithoutComplexInput | Prisma.CustomerIndividualUpdateManyWithWhereWithoutComplexInput[] + deleteMany?: Prisma.CustomerIndividualScalarWhereInput | Prisma.CustomerIndividualScalarWhereInput[] +} + +export type CustomerIndividualUncheckedUpdateManyWithoutComplexNestedInput = { + create?: Prisma.XOR | Prisma.CustomerIndividualCreateWithoutComplexInput[] | Prisma.CustomerIndividualUncheckedCreateWithoutComplexInput[] + connectOrCreate?: Prisma.CustomerIndividualCreateOrConnectWithoutComplexInput | Prisma.CustomerIndividualCreateOrConnectWithoutComplexInput[] + upsert?: Prisma.CustomerIndividualUpsertWithWhereUniqueWithoutComplexInput | Prisma.CustomerIndividualUpsertWithWhereUniqueWithoutComplexInput[] + createMany?: Prisma.CustomerIndividualCreateManyComplexInputEnvelope + set?: Prisma.CustomerIndividualWhereUniqueInput | Prisma.CustomerIndividualWhereUniqueInput[] + disconnect?: Prisma.CustomerIndividualWhereUniqueInput | Prisma.CustomerIndividualWhereUniqueInput[] + delete?: Prisma.CustomerIndividualWhereUniqueInput | Prisma.CustomerIndividualWhereUniqueInput[] + connect?: Prisma.CustomerIndividualWhereUniqueInput | Prisma.CustomerIndividualWhereUniqueInput[] + update?: Prisma.CustomerIndividualUpdateWithWhereUniqueWithoutComplexInput | Prisma.CustomerIndividualUpdateWithWhereUniqueWithoutComplexInput[] + updateMany?: Prisma.CustomerIndividualUpdateManyWithWhereWithoutComplexInput | Prisma.CustomerIndividualUpdateManyWithWhereWithoutComplexInput[] + deleteMany?: Prisma.CustomerIndividualScalarWhereInput | Prisma.CustomerIndividualScalarWhereInput[] +} + export type CustomerIndividualCreateNestedOneWithoutCustomerInput = { create?: Prisma.XOR connectOrCreate?: Prisma.CustomerIndividualCreateOrConnectWithoutCustomerInput @@ -401,13 +455,70 @@ export type CustomerIndividualUncheckedUpdateOneWithoutCustomerNestedInput = { update?: Prisma.XOR, Prisma.CustomerIndividualUncheckedUpdateWithoutCustomerInput> } +export type CustomerIndividualCreateWithoutComplexInput = { + first_name: string + last_name: string + national_id: string + postal_code: string + economic_code?: string | null + customer: Prisma.CustomerCreateNestedOneWithoutCustomer_individualsInput +} + +export type CustomerIndividualUncheckedCreateWithoutComplexInput = { + customer_id: string + first_name: string + last_name: string + national_id: string + postal_code: string + economic_code?: string | null +} + +export type CustomerIndividualCreateOrConnectWithoutComplexInput = { + where: Prisma.CustomerIndividualWhereUniqueInput + create: Prisma.XOR +} + +export type CustomerIndividualCreateManyComplexInputEnvelope = { + data: Prisma.CustomerIndividualCreateManyComplexInput | Prisma.CustomerIndividualCreateManyComplexInput[] + skipDuplicates?: boolean +} + +export type CustomerIndividualUpsertWithWhereUniqueWithoutComplexInput = { + where: Prisma.CustomerIndividualWhereUniqueInput + update: Prisma.XOR + create: Prisma.XOR +} + +export type CustomerIndividualUpdateWithWhereUniqueWithoutComplexInput = { + where: Prisma.CustomerIndividualWhereUniqueInput + data: Prisma.XOR +} + +export type CustomerIndividualUpdateManyWithWhereWithoutComplexInput = { + where: Prisma.CustomerIndividualScalarWhereInput + data: Prisma.XOR +} + +export type CustomerIndividualScalarWhereInput = { + AND?: Prisma.CustomerIndividualScalarWhereInput | Prisma.CustomerIndividualScalarWhereInput[] + OR?: Prisma.CustomerIndividualScalarWhereInput[] + NOT?: Prisma.CustomerIndividualScalarWhereInput | Prisma.CustomerIndividualScalarWhereInput[] + customer_id?: Prisma.StringFilter<"CustomerIndividual"> | string + first_name?: Prisma.StringFilter<"CustomerIndividual"> | string + last_name?: Prisma.StringFilter<"CustomerIndividual"> | string + national_id?: Prisma.StringFilter<"CustomerIndividual"> | string + postal_code?: Prisma.StringFilter<"CustomerIndividual"> | string + economic_code?: Prisma.StringNullableFilter<"CustomerIndividual"> | string | null + complex_id?: Prisma.StringFilter<"CustomerIndividual"> | string +} + export type CustomerIndividualCreateWithoutCustomerInput = { first_name: string last_name: string national_id: string postal_code: string economic_code?: string | null - complex_id: string + complex: Prisma.ComplexCreateNestedOneWithoutCustomerIndividualsInput } export type CustomerIndividualUncheckedCreateWithoutCustomerInput = { @@ -441,7 +552,7 @@ export type CustomerIndividualUpdateWithoutCustomerInput = { national_id?: Prisma.StringFieldUpdateOperationsInput | string postal_code?: Prisma.StringFieldUpdateOperationsInput | string economic_code?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - complex_id?: Prisma.StringFieldUpdateOperationsInput | string + complex?: Prisma.ComplexUpdateOneRequiredWithoutCustomerIndividualsNestedInput } export type CustomerIndividualUncheckedUpdateWithoutCustomerInput = { @@ -453,6 +564,42 @@ export type CustomerIndividualUncheckedUpdateWithoutCustomerInput = { complex_id?: Prisma.StringFieldUpdateOperationsInput | string } +export type CustomerIndividualCreateManyComplexInput = { + customer_id: string + first_name: string + last_name: string + national_id: string + postal_code: string + economic_code?: string | null +} + +export type CustomerIndividualUpdateWithoutComplexInput = { + first_name?: Prisma.StringFieldUpdateOperationsInput | string + last_name?: Prisma.StringFieldUpdateOperationsInput | string + national_id?: Prisma.StringFieldUpdateOperationsInput | string + postal_code?: Prisma.StringFieldUpdateOperationsInput | string + economic_code?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + customer?: Prisma.CustomerUpdateOneRequiredWithoutCustomer_individualsNestedInput +} + +export type CustomerIndividualUncheckedUpdateWithoutComplexInput = { + customer_id?: Prisma.StringFieldUpdateOperationsInput | string + first_name?: Prisma.StringFieldUpdateOperationsInput | string + last_name?: Prisma.StringFieldUpdateOperationsInput | string + national_id?: Prisma.StringFieldUpdateOperationsInput | string + postal_code?: Prisma.StringFieldUpdateOperationsInput | string + economic_code?: Prisma.NullableStringFieldUpdateOperationsInput | string | null +} + +export type CustomerIndividualUncheckedUpdateManyWithoutComplexInput = { + customer_id?: Prisma.StringFieldUpdateOperationsInput | string + first_name?: Prisma.StringFieldUpdateOperationsInput | string + last_name?: Prisma.StringFieldUpdateOperationsInput | string + national_id?: Prisma.StringFieldUpdateOperationsInput | string + postal_code?: Prisma.StringFieldUpdateOperationsInput | string + economic_code?: Prisma.NullableStringFieldUpdateOperationsInput | string | null +} + export type CustomerIndividualSelect = runtime.Types.Extensions.GetSelect<{ @@ -464,6 +611,7 @@ export type CustomerIndividualSelect + complex?: boolean | Prisma.ComplexDefaultArgs }, ExtArgs["result"]["customerIndividual"]> @@ -481,12 +629,14 @@ export type CustomerIndividualSelectScalar = { export type CustomerIndividualOmit = runtime.Types.Extensions.GetOmit<"customer_id" | "first_name" | "last_name" | "national_id" | "postal_code" | "economic_code" | "complex_id", ExtArgs["result"]["customerIndividual"]> export type CustomerIndividualInclude = { customer?: boolean | Prisma.CustomerDefaultArgs + complex?: boolean | Prisma.ComplexDefaultArgs } export type $CustomerIndividualPayload = { name: "CustomerIndividual" objects: { customer: Prisma.$CustomerPayload + complex: Prisma.$ComplexPayload } scalars: runtime.Types.Extensions.GetPayloadResult<{ customer_id: string @@ -837,6 +987,7 @@ readonly fields: CustomerIndividualFieldRefs; export interface Prisma__CustomerIndividualClient extends Prisma.PrismaPromise { readonly [Symbol.toStringTag]: "PrismaPromise" customer = {}>(args?: Prisma.Subset>): Prisma.Prisma__CustomerClient, T, "findUniqueOrThrow", GlobalOmitOptions> | Null, Null, ExtArgs, GlobalOmitOptions> + complex = {}>(args?: Prisma.Subset>): Prisma.Prisma__ComplexClient, 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. diff --git a/src/generated/prisma/models/CustomerLegal.ts b/src/generated/prisma/models/CustomerLegal.ts index 900998c..6b090d9 100644 --- a/src/generated/prisma/models/CustomerLegal.ts +++ b/src/generated/prisma/models/CustomerLegal.ts @@ -191,6 +191,7 @@ export type CustomerLegalWhereInput = { postal_code?: Prisma.StringFilter<"CustomerLegal"> | string complex_id?: Prisma.StringFilter<"CustomerLegal"> | string customer?: Prisma.XOR + complex?: Prisma.XOR } export type CustomerLegalOrderByWithRelationInput = { @@ -201,6 +202,7 @@ export type CustomerLegalOrderByWithRelationInput = { postal_code?: Prisma.SortOrder complex_id?: Prisma.SortOrder customer?: Prisma.CustomerOrderByWithRelationInput + complex?: Prisma.ComplexOrderByWithRelationInput _relevance?: Prisma.CustomerLegalOrderByRelevanceInput } @@ -216,6 +218,7 @@ export type CustomerLegalWhereUniqueInput = Prisma.AtLeast<{ postal_code?: Prisma.StringFilter<"CustomerLegal"> | string complex_id?: Prisma.StringFilter<"CustomerLegal"> | string customer?: Prisma.XOR + complex?: Prisma.XOR }, "customer_id" | "complex_id_registration_number"> export type CustomerLegalOrderByWithAggregationInput = { @@ -247,8 +250,8 @@ export type CustomerLegalCreateInput = { economic_code: string registration_number: string postal_code: string - complex_id: string - customer: Prisma.CustomerCreateNestedOneWithoutCustomerLegalsInput + customer: Prisma.CustomerCreateNestedOneWithoutCustomer_legalsInput + complex: Prisma.ComplexCreateNestedOneWithoutCustomerLegalsInput } export type CustomerLegalUncheckedCreateInput = { @@ -265,8 +268,8 @@ export type CustomerLegalUpdateInput = { economic_code?: Prisma.StringFieldUpdateOperationsInput | string registration_number?: Prisma.StringFieldUpdateOperationsInput | string postal_code?: Prisma.StringFieldUpdateOperationsInput | string - complex_id?: Prisma.StringFieldUpdateOperationsInput | string - customer?: Prisma.CustomerUpdateOneRequiredWithoutCustomerLegalsNestedInput + customer?: Prisma.CustomerUpdateOneRequiredWithoutCustomer_legalsNestedInput + complex?: Prisma.ComplexUpdateOneRequiredWithoutCustomerLegalsNestedInput } export type CustomerLegalUncheckedUpdateInput = { @@ -292,7 +295,6 @@ export type CustomerLegalUpdateManyMutationInput = { economic_code?: Prisma.StringFieldUpdateOperationsInput | string registration_number?: Prisma.StringFieldUpdateOperationsInput | string postal_code?: Prisma.StringFieldUpdateOperationsInput | string - complex_id?: Prisma.StringFieldUpdateOperationsInput | string } export type CustomerLegalUncheckedUpdateManyInput = { @@ -304,6 +306,16 @@ export type CustomerLegalUncheckedUpdateManyInput = { complex_id?: Prisma.StringFieldUpdateOperationsInput | string } +export type CustomerLegalListRelationFilter = { + every?: Prisma.CustomerLegalWhereInput + some?: Prisma.CustomerLegalWhereInput + none?: Prisma.CustomerLegalWhereInput +} + +export type CustomerLegalOrderByRelationAggregateInput = { + _count?: Prisma.SortOrder +} + export type CustomerLegalNullableScalarRelationFilter = { is?: Prisma.CustomerLegalWhereInput | null isNot?: Prisma.CustomerLegalWhereInput | null @@ -347,6 +359,48 @@ export type CustomerLegalMinOrderByAggregateInput = { complex_id?: Prisma.SortOrder } +export type CustomerLegalCreateNestedManyWithoutComplexInput = { + create?: Prisma.XOR | Prisma.CustomerLegalCreateWithoutComplexInput[] | Prisma.CustomerLegalUncheckedCreateWithoutComplexInput[] + connectOrCreate?: Prisma.CustomerLegalCreateOrConnectWithoutComplexInput | Prisma.CustomerLegalCreateOrConnectWithoutComplexInput[] + createMany?: Prisma.CustomerLegalCreateManyComplexInputEnvelope + connect?: Prisma.CustomerLegalWhereUniqueInput | Prisma.CustomerLegalWhereUniqueInput[] +} + +export type CustomerLegalUncheckedCreateNestedManyWithoutComplexInput = { + create?: Prisma.XOR | Prisma.CustomerLegalCreateWithoutComplexInput[] | Prisma.CustomerLegalUncheckedCreateWithoutComplexInput[] + connectOrCreate?: Prisma.CustomerLegalCreateOrConnectWithoutComplexInput | Prisma.CustomerLegalCreateOrConnectWithoutComplexInput[] + createMany?: Prisma.CustomerLegalCreateManyComplexInputEnvelope + connect?: Prisma.CustomerLegalWhereUniqueInput | Prisma.CustomerLegalWhereUniqueInput[] +} + +export type CustomerLegalUpdateManyWithoutComplexNestedInput = { + create?: Prisma.XOR | Prisma.CustomerLegalCreateWithoutComplexInput[] | Prisma.CustomerLegalUncheckedCreateWithoutComplexInput[] + connectOrCreate?: Prisma.CustomerLegalCreateOrConnectWithoutComplexInput | Prisma.CustomerLegalCreateOrConnectWithoutComplexInput[] + upsert?: Prisma.CustomerLegalUpsertWithWhereUniqueWithoutComplexInput | Prisma.CustomerLegalUpsertWithWhereUniqueWithoutComplexInput[] + createMany?: Prisma.CustomerLegalCreateManyComplexInputEnvelope + set?: Prisma.CustomerLegalWhereUniqueInput | Prisma.CustomerLegalWhereUniqueInput[] + disconnect?: Prisma.CustomerLegalWhereUniqueInput | Prisma.CustomerLegalWhereUniqueInput[] + delete?: Prisma.CustomerLegalWhereUniqueInput | Prisma.CustomerLegalWhereUniqueInput[] + connect?: Prisma.CustomerLegalWhereUniqueInput | Prisma.CustomerLegalWhereUniqueInput[] + update?: Prisma.CustomerLegalUpdateWithWhereUniqueWithoutComplexInput | Prisma.CustomerLegalUpdateWithWhereUniqueWithoutComplexInput[] + updateMany?: Prisma.CustomerLegalUpdateManyWithWhereWithoutComplexInput | Prisma.CustomerLegalUpdateManyWithWhereWithoutComplexInput[] + deleteMany?: Prisma.CustomerLegalScalarWhereInput | Prisma.CustomerLegalScalarWhereInput[] +} + +export type CustomerLegalUncheckedUpdateManyWithoutComplexNestedInput = { + create?: Prisma.XOR | Prisma.CustomerLegalCreateWithoutComplexInput[] | Prisma.CustomerLegalUncheckedCreateWithoutComplexInput[] + connectOrCreate?: Prisma.CustomerLegalCreateOrConnectWithoutComplexInput | Prisma.CustomerLegalCreateOrConnectWithoutComplexInput[] + upsert?: Prisma.CustomerLegalUpsertWithWhereUniqueWithoutComplexInput | Prisma.CustomerLegalUpsertWithWhereUniqueWithoutComplexInput[] + createMany?: Prisma.CustomerLegalCreateManyComplexInputEnvelope + set?: Prisma.CustomerLegalWhereUniqueInput | Prisma.CustomerLegalWhereUniqueInput[] + disconnect?: Prisma.CustomerLegalWhereUniqueInput | Prisma.CustomerLegalWhereUniqueInput[] + delete?: Prisma.CustomerLegalWhereUniqueInput | Prisma.CustomerLegalWhereUniqueInput[] + connect?: Prisma.CustomerLegalWhereUniqueInput | Prisma.CustomerLegalWhereUniqueInput[] + update?: Prisma.CustomerLegalUpdateWithWhereUniqueWithoutComplexInput | Prisma.CustomerLegalUpdateWithWhereUniqueWithoutComplexInput[] + updateMany?: Prisma.CustomerLegalUpdateManyWithWhereWithoutComplexInput | Prisma.CustomerLegalUpdateManyWithWhereWithoutComplexInput[] + deleteMany?: Prisma.CustomerLegalScalarWhereInput | Prisma.CustomerLegalScalarWhereInput[] +} + export type CustomerLegalCreateNestedOneWithoutCustomerInput = { create?: Prisma.XOR connectOrCreate?: Prisma.CustomerLegalCreateOrConnectWithoutCustomerInput @@ -379,12 +433,66 @@ export type CustomerLegalUncheckedUpdateOneWithoutCustomerNestedInput = { update?: Prisma.XOR, Prisma.CustomerLegalUncheckedUpdateWithoutCustomerInput> } +export type CustomerLegalCreateWithoutComplexInput = { + company_name: string + economic_code: string + registration_number: string + postal_code: string + customer: Prisma.CustomerCreateNestedOneWithoutCustomer_legalsInput +} + +export type CustomerLegalUncheckedCreateWithoutComplexInput = { + customer_id: string + company_name: string + economic_code: string + registration_number: string + postal_code: string +} + +export type CustomerLegalCreateOrConnectWithoutComplexInput = { + where: Prisma.CustomerLegalWhereUniqueInput + create: Prisma.XOR +} + +export type CustomerLegalCreateManyComplexInputEnvelope = { + data: Prisma.CustomerLegalCreateManyComplexInput | Prisma.CustomerLegalCreateManyComplexInput[] + skipDuplicates?: boolean +} + +export type CustomerLegalUpsertWithWhereUniqueWithoutComplexInput = { + where: Prisma.CustomerLegalWhereUniqueInput + update: Prisma.XOR + create: Prisma.XOR +} + +export type CustomerLegalUpdateWithWhereUniqueWithoutComplexInput = { + where: Prisma.CustomerLegalWhereUniqueInput + data: Prisma.XOR +} + +export type CustomerLegalUpdateManyWithWhereWithoutComplexInput = { + where: Prisma.CustomerLegalScalarWhereInput + data: Prisma.XOR +} + +export type CustomerLegalScalarWhereInput = { + AND?: Prisma.CustomerLegalScalarWhereInput | Prisma.CustomerLegalScalarWhereInput[] + OR?: Prisma.CustomerLegalScalarWhereInput[] + NOT?: Prisma.CustomerLegalScalarWhereInput | Prisma.CustomerLegalScalarWhereInput[] + customer_id?: Prisma.StringFilter<"CustomerLegal"> | string + company_name?: Prisma.StringFilter<"CustomerLegal"> | string + economic_code?: Prisma.StringFilter<"CustomerLegal"> | string + registration_number?: Prisma.StringFilter<"CustomerLegal"> | string + postal_code?: Prisma.StringFilter<"CustomerLegal"> | string + complex_id?: Prisma.StringFilter<"CustomerLegal"> | string +} + export type CustomerLegalCreateWithoutCustomerInput = { company_name: string economic_code: string registration_number: string postal_code: string - complex_id: string + complex: Prisma.ComplexCreateNestedOneWithoutCustomerLegalsInput } export type CustomerLegalUncheckedCreateWithoutCustomerInput = { @@ -416,7 +524,7 @@ export type CustomerLegalUpdateWithoutCustomerInput = { economic_code?: Prisma.StringFieldUpdateOperationsInput | string registration_number?: Prisma.StringFieldUpdateOperationsInput | string postal_code?: Prisma.StringFieldUpdateOperationsInput | string - complex_id?: Prisma.StringFieldUpdateOperationsInput | string + complex?: Prisma.ComplexUpdateOneRequiredWithoutCustomerLegalsNestedInput } export type CustomerLegalUncheckedUpdateWithoutCustomerInput = { @@ -427,6 +535,38 @@ export type CustomerLegalUncheckedUpdateWithoutCustomerInput = { complex_id?: Prisma.StringFieldUpdateOperationsInput | string } +export type CustomerLegalCreateManyComplexInput = { + customer_id: string + company_name: string + economic_code: string + registration_number: string + postal_code: string +} + +export type CustomerLegalUpdateWithoutComplexInput = { + company_name?: Prisma.StringFieldUpdateOperationsInput | string + economic_code?: Prisma.StringFieldUpdateOperationsInput | string + registration_number?: Prisma.StringFieldUpdateOperationsInput | string + postal_code?: Prisma.StringFieldUpdateOperationsInput | string + customer?: Prisma.CustomerUpdateOneRequiredWithoutCustomer_legalsNestedInput +} + +export type CustomerLegalUncheckedUpdateWithoutComplexInput = { + customer_id?: Prisma.StringFieldUpdateOperationsInput | string + company_name?: Prisma.StringFieldUpdateOperationsInput | string + economic_code?: Prisma.StringFieldUpdateOperationsInput | string + registration_number?: Prisma.StringFieldUpdateOperationsInput | string + postal_code?: Prisma.StringFieldUpdateOperationsInput | string +} + +export type CustomerLegalUncheckedUpdateManyWithoutComplexInput = { + customer_id?: Prisma.StringFieldUpdateOperationsInput | string + company_name?: Prisma.StringFieldUpdateOperationsInput | string + economic_code?: Prisma.StringFieldUpdateOperationsInput | string + registration_number?: Prisma.StringFieldUpdateOperationsInput | string + postal_code?: Prisma.StringFieldUpdateOperationsInput | string +} + export type CustomerLegalSelect = runtime.Types.Extensions.GetSelect<{ @@ -437,6 +577,7 @@ export type CustomerLegalSelect + complex?: boolean | Prisma.ComplexDefaultArgs }, ExtArgs["result"]["customerLegal"]> @@ -453,12 +594,14 @@ export type CustomerLegalSelectScalar = { export type CustomerLegalOmit = runtime.Types.Extensions.GetOmit<"customer_id" | "company_name" | "economic_code" | "registration_number" | "postal_code" | "complex_id", ExtArgs["result"]["customerLegal"]> export type CustomerLegalInclude = { customer?: boolean | Prisma.CustomerDefaultArgs + complex?: boolean | Prisma.ComplexDefaultArgs } export type $CustomerLegalPayload = { name: "CustomerLegal" objects: { customer: Prisma.$CustomerPayload + complex: Prisma.$ComplexPayload } scalars: runtime.Types.Extensions.GetPayloadResult<{ customer_id: string @@ -808,6 +951,7 @@ readonly fields: CustomerLegalFieldRefs; export interface Prisma__CustomerLegalClient extends Prisma.PrismaPromise { readonly [Symbol.toStringTag]: "PrismaPromise" customer = {}>(args?: Prisma.Subset>): Prisma.Prisma__CustomerClient, T, "findUniqueOrThrow", GlobalOmitOptions> | Null, Null, ExtArgs, GlobalOmitOptions> + complex = {}>(args?: Prisma.Subset>): Prisma.Prisma__ComplexClient, 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. diff --git a/src/generated/prisma/models/Pos.ts b/src/generated/prisma/models/Pos.ts index 78d3a4e..5711d01 100644 --- a/src/generated/prisma/models/Pos.ts +++ b/src/generated/prisma/models/Pos.ts @@ -235,6 +235,7 @@ export type PosWhereInput = { provider?: Prisma.XOR | null licenses?: Prisma.LicenseListRelationFilter permissionPos?: Prisma.PermissionPosListRelationFilter + salesInvoices?: Prisma.SalesInvoiceListRelationFilter } export type PosOrderByWithRelationInput = { @@ -254,6 +255,7 @@ export type PosOrderByWithRelationInput = { provider?: Prisma.ProviderOrderByWithRelationInput licenses?: Prisma.LicenseOrderByRelationAggregateInput permissionPos?: Prisma.PermissionPosOrderByRelationAggregateInput + salesInvoices?: Prisma.SalesInvoiceOrderByRelationAggregateInput _relevance?: Prisma.PosOrderByRelevanceInput } @@ -277,6 +279,7 @@ export type PosWhereUniqueInput = Prisma.AtLeast<{ provider?: Prisma.XOR | null licenses?: Prisma.LicenseListRelationFilter permissionPos?: Prisma.PermissionPosListRelationFilter + salesInvoices?: Prisma.SalesInvoiceListRelationFilter }, "id" | "serial"> export type PosOrderByWithAggregationInput = { @@ -327,6 +330,7 @@ export type PosCreateInput = { provider?: Prisma.ProviderCreateNestedOneWithoutPos_listInput licenses?: Prisma.LicenseCreateNestedManyWithoutPosInput permissionPos?: Prisma.PermissionPosCreateNestedManyWithoutPosInput + salesInvoices?: Prisma.SalesInvoiceCreateNestedManyWithoutPosInput } export type PosUncheckedCreateInput = { @@ -343,6 +347,7 @@ export type PosUncheckedCreateInput = { provider_id?: string | null licenses?: Prisma.LicenseUncheckedCreateNestedManyWithoutPosInput permissionPos?: Prisma.PermissionPosUncheckedCreateNestedManyWithoutPosInput + salesInvoices?: Prisma.SalesInvoiceUncheckedCreateNestedManyWithoutPosInput } export type PosUpdateInput = { @@ -359,6 +364,7 @@ export type PosUpdateInput = { provider?: Prisma.ProviderUpdateOneWithoutPos_listNestedInput licenses?: Prisma.LicenseUpdateManyWithoutPosNestedInput permissionPos?: Prisma.PermissionPosUpdateManyWithoutPosNestedInput + salesInvoices?: Prisma.SalesInvoiceUpdateManyWithoutPosNestedInput } export type PosUncheckedUpdateInput = { @@ -375,6 +381,7 @@ export type PosUncheckedUpdateInput = { provider_id?: Prisma.NullableStringFieldUpdateOperationsInput | string | null licenses?: Prisma.LicenseUncheckedUpdateManyWithoutPosNestedInput permissionPos?: Prisma.PermissionPosUncheckedUpdateManyWithoutPosNestedInput + salesInvoices?: Prisma.SalesInvoiceUncheckedUpdateManyWithoutPosNestedInput } export type PosCreateManyInput = { @@ -641,6 +648,20 @@ export type PosUncheckedUpdateManyWithoutProviderNestedInput = { deleteMany?: Prisma.PosScalarWhereInput | Prisma.PosScalarWhereInput[] } +export type PosCreateNestedOneWithoutSalesInvoicesInput = { + create?: Prisma.XOR + connectOrCreate?: Prisma.PosCreateOrConnectWithoutSalesInvoicesInput + connect?: Prisma.PosWhereUniqueInput +} + +export type PosUpdateOneRequiredWithoutSalesInvoicesNestedInput = { + create?: Prisma.XOR + connectOrCreate?: Prisma.PosCreateOrConnectWithoutSalesInvoicesInput + upsert?: Prisma.PosUpsertWithoutSalesInvoicesInput + connect?: Prisma.PosWhereUniqueInput + update?: Prisma.XOR, Prisma.PosUncheckedUpdateWithoutSalesInvoicesInput> +} + export type PosCreateWithoutComplexInput = { id?: string name: string @@ -654,6 +675,7 @@ export type PosCreateWithoutComplexInput = { provider?: Prisma.ProviderCreateNestedOneWithoutPos_listInput licenses?: Prisma.LicenseCreateNestedManyWithoutPosInput permissionPos?: Prisma.PermissionPosCreateNestedManyWithoutPosInput + salesInvoices?: Prisma.SalesInvoiceCreateNestedManyWithoutPosInput } export type PosUncheckedCreateWithoutComplexInput = { @@ -669,6 +691,7 @@ export type PosUncheckedCreateWithoutComplexInput = { provider_id?: string | null licenses?: Prisma.LicenseUncheckedCreateNestedManyWithoutPosInput permissionPos?: Prisma.PermissionPosUncheckedCreateNestedManyWithoutPosInput + salesInvoices?: Prisma.SalesInvoiceUncheckedCreateNestedManyWithoutPosInput } export type PosCreateOrConnectWithoutComplexInput = { @@ -727,6 +750,7 @@ export type PosCreateWithoutDeviceInput = { provider?: Prisma.ProviderCreateNestedOneWithoutPos_listInput licenses?: Prisma.LicenseCreateNestedManyWithoutPosInput permissionPos?: Prisma.PermissionPosCreateNestedManyWithoutPosInput + salesInvoices?: Prisma.SalesInvoiceCreateNestedManyWithoutPosInput } export type PosUncheckedCreateWithoutDeviceInput = { @@ -742,6 +766,7 @@ export type PosUncheckedCreateWithoutDeviceInput = { provider_id?: string | null licenses?: Prisma.LicenseUncheckedCreateNestedManyWithoutPosInput permissionPos?: Prisma.PermissionPosUncheckedCreateNestedManyWithoutPosInput + salesInvoices?: Prisma.SalesInvoiceUncheckedCreateNestedManyWithoutPosInput } export type PosCreateOrConnectWithoutDeviceInput = { @@ -783,6 +808,7 @@ export type PosCreateWithoutLicensesInput = { device?: Prisma.DeviceCreateNestedOneWithoutPosesInput provider?: Prisma.ProviderCreateNestedOneWithoutPos_listInput permissionPos?: Prisma.PermissionPosCreateNestedManyWithoutPosInput + salesInvoices?: Prisma.SalesInvoiceCreateNestedManyWithoutPosInput } export type PosUncheckedCreateWithoutLicensesInput = { @@ -798,6 +824,7 @@ export type PosUncheckedCreateWithoutLicensesInput = { device_id?: string | null provider_id?: string | null permissionPos?: Prisma.PermissionPosUncheckedCreateNestedManyWithoutPosInput + salesInvoices?: Prisma.SalesInvoiceUncheckedCreateNestedManyWithoutPosInput } export type PosCreateOrConnectWithoutLicensesInput = { @@ -829,6 +856,7 @@ export type PosUpdateWithoutLicensesInput = { device?: Prisma.DeviceUpdateOneWithoutPosesNestedInput provider?: Prisma.ProviderUpdateOneWithoutPos_listNestedInput permissionPos?: Prisma.PermissionPosUpdateManyWithoutPosNestedInput + salesInvoices?: Prisma.SalesInvoiceUpdateManyWithoutPosNestedInput } export type PosUncheckedUpdateWithoutLicensesInput = { @@ -844,6 +872,7 @@ export type PosUncheckedUpdateWithoutLicensesInput = { device_id?: Prisma.NullableStringFieldUpdateOperationsInput | string | null provider_id?: Prisma.NullableStringFieldUpdateOperationsInput | string | null permissionPos?: Prisma.PermissionPosUncheckedUpdateManyWithoutPosNestedInput + salesInvoices?: Prisma.SalesInvoiceUncheckedUpdateManyWithoutPosNestedInput } export type PosCreateWithoutPermissionPosInput = { @@ -859,6 +888,7 @@ export type PosCreateWithoutPermissionPosInput = { device?: Prisma.DeviceCreateNestedOneWithoutPosesInput provider?: Prisma.ProviderCreateNestedOneWithoutPos_listInput licenses?: Prisma.LicenseCreateNestedManyWithoutPosInput + salesInvoices?: Prisma.SalesInvoiceCreateNestedManyWithoutPosInput } export type PosUncheckedCreateWithoutPermissionPosInput = { @@ -874,6 +904,7 @@ export type PosUncheckedCreateWithoutPermissionPosInput = { device_id?: string | null provider_id?: string | null licenses?: Prisma.LicenseUncheckedCreateNestedManyWithoutPosInput + salesInvoices?: Prisma.SalesInvoiceUncheckedCreateNestedManyWithoutPosInput } export type PosCreateOrConnectWithoutPermissionPosInput = { @@ -905,6 +936,7 @@ export type PosUpdateWithoutPermissionPosInput = { device?: Prisma.DeviceUpdateOneWithoutPosesNestedInput provider?: Prisma.ProviderUpdateOneWithoutPos_listNestedInput licenses?: Prisma.LicenseUpdateManyWithoutPosNestedInput + salesInvoices?: Prisma.SalesInvoiceUpdateManyWithoutPosNestedInput } export type PosUncheckedUpdateWithoutPermissionPosInput = { @@ -920,6 +952,7 @@ export type PosUncheckedUpdateWithoutPermissionPosInput = { device_id?: Prisma.NullableStringFieldUpdateOperationsInput | string | null provider_id?: Prisma.NullableStringFieldUpdateOperationsInput | string | null licenses?: Prisma.LicenseUncheckedUpdateManyWithoutPosNestedInput + salesInvoices?: Prisma.SalesInvoiceUncheckedUpdateManyWithoutPosNestedInput } export type PosCreateWithoutProviderInput = { @@ -935,6 +968,7 @@ export type PosCreateWithoutProviderInput = { device?: Prisma.DeviceCreateNestedOneWithoutPosesInput licenses?: Prisma.LicenseCreateNestedManyWithoutPosInput permissionPos?: Prisma.PermissionPosCreateNestedManyWithoutPosInput + salesInvoices?: Prisma.SalesInvoiceCreateNestedManyWithoutPosInput } export type PosUncheckedCreateWithoutProviderInput = { @@ -950,6 +984,7 @@ export type PosUncheckedCreateWithoutProviderInput = { device_id?: string | null licenses?: Prisma.LicenseUncheckedCreateNestedManyWithoutPosInput permissionPos?: Prisma.PermissionPosUncheckedCreateNestedManyWithoutPosInput + salesInvoices?: Prisma.SalesInvoiceUncheckedCreateNestedManyWithoutPosInput } export type PosCreateOrConnectWithoutProviderInput = { @@ -978,6 +1013,86 @@ export type PosUpdateManyWithWhereWithoutProviderInput = { data: Prisma.XOR } +export type PosCreateWithoutSalesInvoicesInput = { + id?: string + name: string + serial: string + model?: string | null + status?: $Enums.POSStatus + pos_type: $Enums.POSType + created_at?: Date | string + updated_at?: Date | string + complex: Prisma.ComplexCreateNestedOneWithoutPos_listInput + device?: Prisma.DeviceCreateNestedOneWithoutPosesInput + provider?: Prisma.ProviderCreateNestedOneWithoutPos_listInput + licenses?: Prisma.LicenseCreateNestedManyWithoutPosInput + permissionPos?: Prisma.PermissionPosCreateNestedManyWithoutPosInput +} + +export type PosUncheckedCreateWithoutSalesInvoicesInput = { + id?: string + name: string + serial: string + model?: string | null + status?: $Enums.POSStatus + pos_type: $Enums.POSType + created_at?: Date | string + updated_at?: Date | string + complex_id: string + device_id?: string | null + provider_id?: string | null + licenses?: Prisma.LicenseUncheckedCreateNestedManyWithoutPosInput + permissionPos?: Prisma.PermissionPosUncheckedCreateNestedManyWithoutPosInput +} + +export type PosCreateOrConnectWithoutSalesInvoicesInput = { + where: Prisma.PosWhereUniqueInput + create: Prisma.XOR +} + +export type PosUpsertWithoutSalesInvoicesInput = { + update: Prisma.XOR + create: Prisma.XOR + where?: Prisma.PosWhereInput +} + +export type PosUpdateToOneWithWhereWithoutSalesInvoicesInput = { + where?: Prisma.PosWhereInput + data: Prisma.XOR +} + +export type PosUpdateWithoutSalesInvoicesInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + name?: Prisma.StringFieldUpdateOperationsInput | string + serial?: Prisma.StringFieldUpdateOperationsInput | string + model?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + status?: Prisma.EnumPOSStatusFieldUpdateOperationsInput | $Enums.POSStatus + pos_type?: Prisma.EnumPOSTypeFieldUpdateOperationsInput | $Enums.POSType + created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + complex?: Prisma.ComplexUpdateOneRequiredWithoutPos_listNestedInput + device?: Prisma.DeviceUpdateOneWithoutPosesNestedInput + provider?: Prisma.ProviderUpdateOneWithoutPos_listNestedInput + licenses?: Prisma.LicenseUpdateManyWithoutPosNestedInput + permissionPos?: Prisma.PermissionPosUpdateManyWithoutPosNestedInput +} + +export type PosUncheckedUpdateWithoutSalesInvoicesInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + name?: Prisma.StringFieldUpdateOperationsInput | string + serial?: Prisma.StringFieldUpdateOperationsInput | string + model?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + status?: Prisma.EnumPOSStatusFieldUpdateOperationsInput | $Enums.POSStatus + pos_type?: Prisma.EnumPOSTypeFieldUpdateOperationsInput | $Enums.POSType + created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + complex_id?: Prisma.StringFieldUpdateOperationsInput | string + device_id?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + provider_id?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + licenses?: Prisma.LicenseUncheckedUpdateManyWithoutPosNestedInput + permissionPos?: Prisma.PermissionPosUncheckedUpdateManyWithoutPosNestedInput +} + export type PosCreateManyComplexInput = { id?: string name: string @@ -1004,6 +1119,7 @@ export type PosUpdateWithoutComplexInput = { provider?: Prisma.ProviderUpdateOneWithoutPos_listNestedInput licenses?: Prisma.LicenseUpdateManyWithoutPosNestedInput permissionPos?: Prisma.PermissionPosUpdateManyWithoutPosNestedInput + salesInvoices?: Prisma.SalesInvoiceUpdateManyWithoutPosNestedInput } export type PosUncheckedUpdateWithoutComplexInput = { @@ -1019,6 +1135,7 @@ export type PosUncheckedUpdateWithoutComplexInput = { provider_id?: Prisma.NullableStringFieldUpdateOperationsInput | string | null licenses?: Prisma.LicenseUncheckedUpdateManyWithoutPosNestedInput permissionPos?: Prisma.PermissionPosUncheckedUpdateManyWithoutPosNestedInput + salesInvoices?: Prisma.SalesInvoiceUncheckedUpdateManyWithoutPosNestedInput } export type PosUncheckedUpdateManyWithoutComplexInput = { @@ -1060,6 +1177,7 @@ export type PosUpdateWithoutDeviceInput = { provider?: Prisma.ProviderUpdateOneWithoutPos_listNestedInput licenses?: Prisma.LicenseUpdateManyWithoutPosNestedInput permissionPos?: Prisma.PermissionPosUpdateManyWithoutPosNestedInput + salesInvoices?: Prisma.SalesInvoiceUpdateManyWithoutPosNestedInput } export type PosUncheckedUpdateWithoutDeviceInput = { @@ -1075,6 +1193,7 @@ export type PosUncheckedUpdateWithoutDeviceInput = { provider_id?: Prisma.NullableStringFieldUpdateOperationsInput | string | null licenses?: Prisma.LicenseUncheckedUpdateManyWithoutPosNestedInput permissionPos?: Prisma.PermissionPosUncheckedUpdateManyWithoutPosNestedInput + salesInvoices?: Prisma.SalesInvoiceUncheckedUpdateManyWithoutPosNestedInput } export type PosUncheckedUpdateManyWithoutDeviceInput = { @@ -1116,6 +1235,7 @@ export type PosUpdateWithoutProviderInput = { device?: Prisma.DeviceUpdateOneWithoutPosesNestedInput licenses?: Prisma.LicenseUpdateManyWithoutPosNestedInput permissionPos?: Prisma.PermissionPosUpdateManyWithoutPosNestedInput + salesInvoices?: Prisma.SalesInvoiceUpdateManyWithoutPosNestedInput } export type PosUncheckedUpdateWithoutProviderInput = { @@ -1131,6 +1251,7 @@ export type PosUncheckedUpdateWithoutProviderInput = { device_id?: Prisma.NullableStringFieldUpdateOperationsInput | string | null licenses?: Prisma.LicenseUncheckedUpdateManyWithoutPosNestedInput permissionPos?: Prisma.PermissionPosUncheckedUpdateManyWithoutPosNestedInput + salesInvoices?: Prisma.SalesInvoiceUncheckedUpdateManyWithoutPosNestedInput } export type PosUncheckedUpdateManyWithoutProviderInput = { @@ -1154,11 +1275,13 @@ export type PosUncheckedUpdateManyWithoutProviderInput = { export type PosCountOutputType = { licenses: number permissionPos: number + salesInvoices: number } export type PosCountOutputTypeSelect = { licenses?: boolean | PosCountOutputTypeCountLicensesArgs permissionPos?: boolean | PosCountOutputTypeCountPermissionPosArgs + salesInvoices?: boolean | PosCountOutputTypeCountSalesInvoicesArgs } /** @@ -1185,6 +1308,13 @@ export type PosCountOutputTypeCountPermissionPosArgs = { + where?: Prisma.SalesInvoiceWhereInput +} + export type PosSelect = runtime.Types.Extensions.GetSelect<{ id?: boolean @@ -1203,6 +1333,7 @@ export type PosSelect licenses?: boolean | Prisma.Pos$licensesArgs permissionPos?: boolean | Prisma.Pos$permissionPosArgs + salesInvoices?: boolean | Prisma.Pos$salesInvoicesArgs _count?: boolean | Prisma.PosCountOutputTypeDefaultArgs }, ExtArgs["result"]["pos"]> @@ -1229,6 +1360,7 @@ export type PosInclude licenses?: boolean | Prisma.Pos$licensesArgs permissionPos?: boolean | Prisma.Pos$permissionPosArgs + salesInvoices?: boolean | Prisma.Pos$salesInvoicesArgs _count?: boolean | Prisma.PosCountOutputTypeDefaultArgs } @@ -1240,6 +1372,7 @@ export type $PosPayload | null licenses: Prisma.$LicensePayload[] permissionPos: Prisma.$PermissionPosPayload[] + salesInvoices: Prisma.$SalesInvoicePayload[] } scalars: runtime.Types.Extensions.GetPayloadResult<{ id: string @@ -1598,6 +1731,7 @@ export interface Prisma__PosClient = {}>(args?: Prisma.Subset>): Prisma.Prisma__ProviderClient, T, "findUniqueOrThrow", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions> licenses = {}>(args?: Prisma.Subset>): Prisma.PrismaPromise, T, "findMany", GlobalOmitOptions> | Null> permissionPos = {}>(args?: Prisma.Subset>): Prisma.PrismaPromise, T, "findMany", GlobalOmitOptions> | Null> + salesInvoices = {}>(args?: Prisma.Subset>): Prisma.PrismaPromise, 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. @@ -2066,6 +2200,30 @@ export type Pos$permissionPosArgs = { + /** + * Select specific fields to fetch from the SalesInvoice + */ + select?: Prisma.SalesInvoiceSelect | null + /** + * Omit specific fields from the SalesInvoice + */ + omit?: Prisma.SalesInvoiceOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.SalesInvoiceInclude | null + where?: Prisma.SalesInvoiceWhereInput + orderBy?: Prisma.SalesInvoiceOrderByWithRelationInput | Prisma.SalesInvoiceOrderByWithRelationInput[] + cursor?: Prisma.SalesInvoiceWhereUniqueInput + take?: number + skip?: number + distinct?: Prisma.SalesInvoiceScalarFieldEnum | Prisma.SalesInvoiceScalarFieldEnum[] +} + /** * Pos without action */ diff --git a/src/generated/prisma/models/SalesInvoice.ts b/src/generated/prisma/models/SalesInvoice.ts index f6dea28..de39d69 100644 --- a/src/generated/prisma/models/SalesInvoice.ts +++ b/src/generated/prisma/models/SalesInvoice.ts @@ -44,7 +44,7 @@ export type SalesInvoiceMinAggregateOutputType = { updated_at: Date | null customer_id: string | null account_id: string | null - complex_id: string | null + pos_id: string | null } export type SalesInvoiceMaxAggregateOutputType = { @@ -57,7 +57,7 @@ export type SalesInvoiceMaxAggregateOutputType = { updated_at: Date | null customer_id: string | null account_id: string | null - complex_id: string | null + pos_id: string | null } export type SalesInvoiceCountAggregateOutputType = { @@ -71,7 +71,7 @@ export type SalesInvoiceCountAggregateOutputType = { updated_at: number customer_id: number account_id: number - complex_id: number + pos_id: number _all: number } @@ -94,7 +94,7 @@ export type SalesInvoiceMinAggregateInputType = { updated_at?: true customer_id?: true account_id?: true - complex_id?: true + pos_id?: true } export type SalesInvoiceMaxAggregateInputType = { @@ -107,7 +107,7 @@ export type SalesInvoiceMaxAggregateInputType = { updated_at?: true customer_id?: true account_id?: true - complex_id?: true + pos_id?: true } export type SalesInvoiceCountAggregateInputType = { @@ -121,7 +121,7 @@ export type SalesInvoiceCountAggregateInputType = { updated_at?: true customer_id?: true account_id?: true - complex_id?: true + pos_id?: true _all?: true } @@ -222,7 +222,7 @@ export type SalesInvoiceGroupByOutputType = { updated_at: Date customer_id: string | null account_id: string - complex_id: string + pos_id: string _count: SalesInvoiceCountAggregateOutputType | null _avg: SalesInvoiceAvgAggregateOutputType | null _sum: SalesInvoiceSumAggregateOutputType | null @@ -259,8 +259,10 @@ export type SalesInvoiceWhereInput = { updated_at?: Prisma.DateTimeFilter<"SalesInvoice"> | Date | string customer_id?: Prisma.StringNullableFilter<"SalesInvoice"> | string | null account_id?: Prisma.StringFilter<"SalesInvoice"> | string - complex_id?: Prisma.StringFilter<"SalesInvoice"> | string + pos_id?: Prisma.StringFilter<"SalesInvoice"> | string customer?: Prisma.XOR | null + pos?: Prisma.XOR + account?: Prisma.XOR items?: Prisma.SalesInvoiceItemListRelationFilter payments?: Prisma.SalesInvoicePaymentListRelationFilter } @@ -276,8 +278,10 @@ export type SalesInvoiceOrderByWithRelationInput = { updated_at?: Prisma.SortOrder customer_id?: Prisma.SortOrderInput | Prisma.SortOrder account_id?: Prisma.SortOrder - complex_id?: Prisma.SortOrder + pos_id?: Prisma.SortOrder customer?: Prisma.CustomerOrderByWithRelationInput + pos?: Prisma.PosOrderByWithRelationInput + account?: Prisma.ConsumerAccountOrderByWithRelationInput items?: Prisma.SalesInvoiceItemOrderByRelationAggregateInput payments?: Prisma.SalesInvoicePaymentOrderByRelationAggregateInput _relevance?: Prisma.SalesInvoiceOrderByRelevanceInput @@ -297,8 +301,10 @@ export type SalesInvoiceWhereUniqueInput = Prisma.AtLeast<{ updated_at?: Prisma.DateTimeFilter<"SalesInvoice"> | Date | string customer_id?: Prisma.StringNullableFilter<"SalesInvoice"> | string | null account_id?: Prisma.StringFilter<"SalesInvoice"> | string - complex_id?: Prisma.StringFilter<"SalesInvoice"> | string + pos_id?: Prisma.StringFilter<"SalesInvoice"> | string customer?: Prisma.XOR | null + pos?: Prisma.XOR + account?: Prisma.XOR items?: Prisma.SalesInvoiceItemListRelationFilter payments?: Prisma.SalesInvoicePaymentListRelationFilter }, "id" | "code"> @@ -314,7 +320,7 @@ export type SalesInvoiceOrderByWithAggregationInput = { updated_at?: Prisma.SortOrder customer_id?: Prisma.SortOrderInput | Prisma.SortOrder account_id?: Prisma.SortOrder - complex_id?: Prisma.SortOrder + pos_id?: Prisma.SortOrder _count?: Prisma.SalesInvoiceCountOrderByAggregateInput _avg?: Prisma.SalesInvoiceAvgOrderByAggregateInput _max?: Prisma.SalesInvoiceMaxOrderByAggregateInput @@ -336,7 +342,7 @@ export type SalesInvoiceScalarWhereWithAggregatesInput = { updated_at?: Prisma.DateTimeWithAggregatesFilter<"SalesInvoice"> | Date | string customer_id?: Prisma.StringNullableWithAggregatesFilter<"SalesInvoice"> | string | null account_id?: Prisma.StringWithAggregatesFilter<"SalesInvoice"> | string - complex_id?: Prisma.StringWithAggregatesFilter<"SalesInvoice"> | string + pos_id?: Prisma.StringWithAggregatesFilter<"SalesInvoice"> | string } export type SalesInvoiceCreateInput = { @@ -348,9 +354,9 @@ export type SalesInvoiceCreateInput = { invoice_date?: Date | string | null created_at?: Date | string updated_at?: Date | string - account_id: string - complex_id: string customer?: Prisma.CustomerCreateNestedOneWithoutSales_invoicesInput + pos: Prisma.PosCreateNestedOneWithoutSalesInvoicesInput + account: Prisma.ConsumerAccountCreateNestedOneWithoutSalesInvoicesInput items?: Prisma.SalesInvoiceItemCreateNestedManyWithoutInvoiceInput payments?: Prisma.SalesInvoicePaymentCreateNestedManyWithoutInvoiceInput } @@ -366,7 +372,7 @@ export type SalesInvoiceUncheckedCreateInput = { updated_at?: Date | string customer_id?: string | null account_id: string - complex_id: string + pos_id: string items?: Prisma.SalesInvoiceItemUncheckedCreateNestedManyWithoutInvoiceInput payments?: Prisma.SalesInvoicePaymentUncheckedCreateNestedManyWithoutInvoiceInput } @@ -380,9 +386,9 @@ export type SalesInvoiceUpdateInput = { invoice_date?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string - account_id?: Prisma.StringFieldUpdateOperationsInput | string - complex_id?: Prisma.StringFieldUpdateOperationsInput | string customer?: Prisma.CustomerUpdateOneWithoutSales_invoicesNestedInput + pos?: Prisma.PosUpdateOneRequiredWithoutSalesInvoicesNestedInput + account?: Prisma.ConsumerAccountUpdateOneRequiredWithoutSalesInvoicesNestedInput items?: Prisma.SalesInvoiceItemUpdateManyWithoutInvoiceNestedInput payments?: Prisma.SalesInvoicePaymentUpdateManyWithoutInvoiceNestedInput } @@ -398,7 +404,7 @@ export type SalesInvoiceUncheckedUpdateInput = { updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string customer_id?: Prisma.NullableStringFieldUpdateOperationsInput | string | null account_id?: Prisma.StringFieldUpdateOperationsInput | string - complex_id?: Prisma.StringFieldUpdateOperationsInput | string + pos_id?: Prisma.StringFieldUpdateOperationsInput | string items?: Prisma.SalesInvoiceItemUncheckedUpdateManyWithoutInvoiceNestedInput payments?: Prisma.SalesInvoicePaymentUncheckedUpdateManyWithoutInvoiceNestedInput } @@ -414,7 +420,7 @@ export type SalesInvoiceCreateManyInput = { updated_at?: Date | string customer_id?: string | null account_id: string - complex_id: string + pos_id: string } export type SalesInvoiceUpdateManyMutationInput = { @@ -426,8 +432,6 @@ export type SalesInvoiceUpdateManyMutationInput = { invoice_date?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string - account_id?: Prisma.StringFieldUpdateOperationsInput | string - complex_id?: Prisma.StringFieldUpdateOperationsInput | string } export type SalesInvoiceUncheckedUpdateManyInput = { @@ -441,7 +445,7 @@ export type SalesInvoiceUncheckedUpdateManyInput = { updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string customer_id?: Prisma.NullableStringFieldUpdateOperationsInput | string | null account_id?: Prisma.StringFieldUpdateOperationsInput | string - complex_id?: Prisma.StringFieldUpdateOperationsInput | string + pos_id?: Prisma.StringFieldUpdateOperationsInput | string } export type SalesInvoiceListRelationFilter = { @@ -471,7 +475,7 @@ export type SalesInvoiceCountOrderByAggregateInput = { updated_at?: Prisma.SortOrder customer_id?: Prisma.SortOrder account_id?: Prisma.SortOrder - complex_id?: Prisma.SortOrder + pos_id?: Prisma.SortOrder } export type SalesInvoiceAvgOrderByAggregateInput = { @@ -488,7 +492,7 @@ export type SalesInvoiceMaxOrderByAggregateInput = { updated_at?: Prisma.SortOrder customer_id?: Prisma.SortOrder account_id?: Prisma.SortOrder - complex_id?: Prisma.SortOrder + pos_id?: Prisma.SortOrder } export type SalesInvoiceMinOrderByAggregateInput = { @@ -501,7 +505,7 @@ export type SalesInvoiceMinOrderByAggregateInput = { updated_at?: Prisma.SortOrder customer_id?: Prisma.SortOrder account_id?: Prisma.SortOrder - complex_id?: Prisma.SortOrder + pos_id?: Prisma.SortOrder } export type SalesInvoiceSumOrderByAggregateInput = { @@ -513,6 +517,90 @@ export type SalesInvoiceScalarRelationFilter = { isNot?: Prisma.SalesInvoiceWhereInput } +export type SalesInvoiceCreateNestedManyWithoutAccountInput = { + create?: Prisma.XOR | Prisma.SalesInvoiceCreateWithoutAccountInput[] | Prisma.SalesInvoiceUncheckedCreateWithoutAccountInput[] + connectOrCreate?: Prisma.SalesInvoiceCreateOrConnectWithoutAccountInput | Prisma.SalesInvoiceCreateOrConnectWithoutAccountInput[] + createMany?: Prisma.SalesInvoiceCreateManyAccountInputEnvelope + connect?: Prisma.SalesInvoiceWhereUniqueInput | Prisma.SalesInvoiceWhereUniqueInput[] +} + +export type SalesInvoiceUncheckedCreateNestedManyWithoutAccountInput = { + create?: Prisma.XOR | Prisma.SalesInvoiceCreateWithoutAccountInput[] | Prisma.SalesInvoiceUncheckedCreateWithoutAccountInput[] + connectOrCreate?: Prisma.SalesInvoiceCreateOrConnectWithoutAccountInput | Prisma.SalesInvoiceCreateOrConnectWithoutAccountInput[] + createMany?: Prisma.SalesInvoiceCreateManyAccountInputEnvelope + connect?: Prisma.SalesInvoiceWhereUniqueInput | Prisma.SalesInvoiceWhereUniqueInput[] +} + +export type SalesInvoiceUpdateManyWithoutAccountNestedInput = { + create?: Prisma.XOR | Prisma.SalesInvoiceCreateWithoutAccountInput[] | Prisma.SalesInvoiceUncheckedCreateWithoutAccountInput[] + connectOrCreate?: Prisma.SalesInvoiceCreateOrConnectWithoutAccountInput | Prisma.SalesInvoiceCreateOrConnectWithoutAccountInput[] + upsert?: Prisma.SalesInvoiceUpsertWithWhereUniqueWithoutAccountInput | Prisma.SalesInvoiceUpsertWithWhereUniqueWithoutAccountInput[] + createMany?: Prisma.SalesInvoiceCreateManyAccountInputEnvelope + set?: Prisma.SalesInvoiceWhereUniqueInput | Prisma.SalesInvoiceWhereUniqueInput[] + disconnect?: Prisma.SalesInvoiceWhereUniqueInput | Prisma.SalesInvoiceWhereUniqueInput[] + delete?: Prisma.SalesInvoiceWhereUniqueInput | Prisma.SalesInvoiceWhereUniqueInput[] + connect?: Prisma.SalesInvoiceWhereUniqueInput | Prisma.SalesInvoiceWhereUniqueInput[] + update?: Prisma.SalesInvoiceUpdateWithWhereUniqueWithoutAccountInput | Prisma.SalesInvoiceUpdateWithWhereUniqueWithoutAccountInput[] + updateMany?: Prisma.SalesInvoiceUpdateManyWithWhereWithoutAccountInput | Prisma.SalesInvoiceUpdateManyWithWhereWithoutAccountInput[] + deleteMany?: Prisma.SalesInvoiceScalarWhereInput | Prisma.SalesInvoiceScalarWhereInput[] +} + +export type SalesInvoiceUncheckedUpdateManyWithoutAccountNestedInput = { + create?: Prisma.XOR | Prisma.SalesInvoiceCreateWithoutAccountInput[] | Prisma.SalesInvoiceUncheckedCreateWithoutAccountInput[] + connectOrCreate?: Prisma.SalesInvoiceCreateOrConnectWithoutAccountInput | Prisma.SalesInvoiceCreateOrConnectWithoutAccountInput[] + upsert?: Prisma.SalesInvoiceUpsertWithWhereUniqueWithoutAccountInput | Prisma.SalesInvoiceUpsertWithWhereUniqueWithoutAccountInput[] + createMany?: Prisma.SalesInvoiceCreateManyAccountInputEnvelope + set?: Prisma.SalesInvoiceWhereUniqueInput | Prisma.SalesInvoiceWhereUniqueInput[] + disconnect?: Prisma.SalesInvoiceWhereUniqueInput | Prisma.SalesInvoiceWhereUniqueInput[] + delete?: Prisma.SalesInvoiceWhereUniqueInput | Prisma.SalesInvoiceWhereUniqueInput[] + connect?: Prisma.SalesInvoiceWhereUniqueInput | Prisma.SalesInvoiceWhereUniqueInput[] + update?: Prisma.SalesInvoiceUpdateWithWhereUniqueWithoutAccountInput | Prisma.SalesInvoiceUpdateWithWhereUniqueWithoutAccountInput[] + updateMany?: Prisma.SalesInvoiceUpdateManyWithWhereWithoutAccountInput | Prisma.SalesInvoiceUpdateManyWithWhereWithoutAccountInput[] + deleteMany?: Prisma.SalesInvoiceScalarWhereInput | Prisma.SalesInvoiceScalarWhereInput[] +} + +export type SalesInvoiceCreateNestedManyWithoutPosInput = { + create?: Prisma.XOR | Prisma.SalesInvoiceCreateWithoutPosInput[] | Prisma.SalesInvoiceUncheckedCreateWithoutPosInput[] + connectOrCreate?: Prisma.SalesInvoiceCreateOrConnectWithoutPosInput | Prisma.SalesInvoiceCreateOrConnectWithoutPosInput[] + createMany?: Prisma.SalesInvoiceCreateManyPosInputEnvelope + connect?: Prisma.SalesInvoiceWhereUniqueInput | Prisma.SalesInvoiceWhereUniqueInput[] +} + +export type SalesInvoiceUncheckedCreateNestedManyWithoutPosInput = { + create?: Prisma.XOR | Prisma.SalesInvoiceCreateWithoutPosInput[] | Prisma.SalesInvoiceUncheckedCreateWithoutPosInput[] + connectOrCreate?: Prisma.SalesInvoiceCreateOrConnectWithoutPosInput | Prisma.SalesInvoiceCreateOrConnectWithoutPosInput[] + createMany?: Prisma.SalesInvoiceCreateManyPosInputEnvelope + connect?: Prisma.SalesInvoiceWhereUniqueInput | Prisma.SalesInvoiceWhereUniqueInput[] +} + +export type SalesInvoiceUpdateManyWithoutPosNestedInput = { + create?: Prisma.XOR | Prisma.SalesInvoiceCreateWithoutPosInput[] | Prisma.SalesInvoiceUncheckedCreateWithoutPosInput[] + connectOrCreate?: Prisma.SalesInvoiceCreateOrConnectWithoutPosInput | Prisma.SalesInvoiceCreateOrConnectWithoutPosInput[] + upsert?: Prisma.SalesInvoiceUpsertWithWhereUniqueWithoutPosInput | Prisma.SalesInvoiceUpsertWithWhereUniqueWithoutPosInput[] + createMany?: Prisma.SalesInvoiceCreateManyPosInputEnvelope + set?: Prisma.SalesInvoiceWhereUniqueInput | Prisma.SalesInvoiceWhereUniqueInput[] + disconnect?: Prisma.SalesInvoiceWhereUniqueInput | Prisma.SalesInvoiceWhereUniqueInput[] + delete?: Prisma.SalesInvoiceWhereUniqueInput | Prisma.SalesInvoiceWhereUniqueInput[] + connect?: Prisma.SalesInvoiceWhereUniqueInput | Prisma.SalesInvoiceWhereUniqueInput[] + update?: Prisma.SalesInvoiceUpdateWithWhereUniqueWithoutPosInput | Prisma.SalesInvoiceUpdateWithWhereUniqueWithoutPosInput[] + updateMany?: Prisma.SalesInvoiceUpdateManyWithWhereWithoutPosInput | Prisma.SalesInvoiceUpdateManyWithWhereWithoutPosInput[] + deleteMany?: Prisma.SalesInvoiceScalarWhereInput | Prisma.SalesInvoiceScalarWhereInput[] +} + +export type SalesInvoiceUncheckedUpdateManyWithoutPosNestedInput = { + create?: Prisma.XOR | Prisma.SalesInvoiceCreateWithoutPosInput[] | Prisma.SalesInvoiceUncheckedCreateWithoutPosInput[] + connectOrCreate?: Prisma.SalesInvoiceCreateOrConnectWithoutPosInput | Prisma.SalesInvoiceCreateOrConnectWithoutPosInput[] + upsert?: Prisma.SalesInvoiceUpsertWithWhereUniqueWithoutPosInput | Prisma.SalesInvoiceUpsertWithWhereUniqueWithoutPosInput[] + createMany?: Prisma.SalesInvoiceCreateManyPosInputEnvelope + set?: Prisma.SalesInvoiceWhereUniqueInput | Prisma.SalesInvoiceWhereUniqueInput[] + disconnect?: Prisma.SalesInvoiceWhereUniqueInput | Prisma.SalesInvoiceWhereUniqueInput[] + delete?: Prisma.SalesInvoiceWhereUniqueInput | Prisma.SalesInvoiceWhereUniqueInput[] + connect?: Prisma.SalesInvoiceWhereUniqueInput | Prisma.SalesInvoiceWhereUniqueInput[] + update?: Prisma.SalesInvoiceUpdateWithWhereUniqueWithoutPosInput | Prisma.SalesInvoiceUpdateWithWhereUniqueWithoutPosInput[] + updateMany?: Prisma.SalesInvoiceUpdateManyWithWhereWithoutPosInput | Prisma.SalesInvoiceUpdateManyWithWhereWithoutPosInput[] + deleteMany?: Prisma.SalesInvoiceScalarWhereInput | Prisma.SalesInvoiceScalarWhereInput[] +} + export type SalesInvoiceCreateNestedManyWithoutCustomerInput = { create?: Prisma.XOR | Prisma.SalesInvoiceCreateWithoutCustomerInput[] | Prisma.SalesInvoiceUncheckedCreateWithoutCustomerInput[] connectOrCreate?: Prisma.SalesInvoiceCreateOrConnectWithoutCustomerInput | Prisma.SalesInvoiceCreateOrConnectWithoutCustomerInput[] @@ -591,6 +679,135 @@ export type SalesInvoiceUpdateOneRequiredWithoutPaymentsNestedInput = { update?: Prisma.XOR, Prisma.SalesInvoiceUncheckedUpdateWithoutPaymentsInput> } +export type SalesInvoiceCreateWithoutAccountInput = { + id?: string + code: string + total_amount: runtime.Decimal | runtime.DecimalJsLike | number | string + notes?: string | null + unknown_customer?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue + invoice_date?: Date | string | null + created_at?: Date | string + updated_at?: Date | string + customer?: Prisma.CustomerCreateNestedOneWithoutSales_invoicesInput + pos: Prisma.PosCreateNestedOneWithoutSalesInvoicesInput + items?: Prisma.SalesInvoiceItemCreateNestedManyWithoutInvoiceInput + payments?: Prisma.SalesInvoicePaymentCreateNestedManyWithoutInvoiceInput +} + +export type SalesInvoiceUncheckedCreateWithoutAccountInput = { + id?: string + code: string + total_amount: runtime.Decimal | runtime.DecimalJsLike | number | string + notes?: string | null + unknown_customer?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue + invoice_date?: Date | string | null + created_at?: Date | string + updated_at?: Date | string + customer_id?: string | null + pos_id: string + items?: Prisma.SalesInvoiceItemUncheckedCreateNestedManyWithoutInvoiceInput + payments?: Prisma.SalesInvoicePaymentUncheckedCreateNestedManyWithoutInvoiceInput +} + +export type SalesInvoiceCreateOrConnectWithoutAccountInput = { + where: Prisma.SalesInvoiceWhereUniqueInput + create: Prisma.XOR +} + +export type SalesInvoiceCreateManyAccountInputEnvelope = { + data: Prisma.SalesInvoiceCreateManyAccountInput | Prisma.SalesInvoiceCreateManyAccountInput[] + skipDuplicates?: boolean +} + +export type SalesInvoiceUpsertWithWhereUniqueWithoutAccountInput = { + where: Prisma.SalesInvoiceWhereUniqueInput + update: Prisma.XOR + create: Prisma.XOR +} + +export type SalesInvoiceUpdateWithWhereUniqueWithoutAccountInput = { + where: Prisma.SalesInvoiceWhereUniqueInput + data: Prisma.XOR +} + +export type SalesInvoiceUpdateManyWithWhereWithoutAccountInput = { + where: Prisma.SalesInvoiceScalarWhereInput + data: Prisma.XOR +} + +export type SalesInvoiceScalarWhereInput = { + AND?: Prisma.SalesInvoiceScalarWhereInput | Prisma.SalesInvoiceScalarWhereInput[] + OR?: Prisma.SalesInvoiceScalarWhereInput[] + NOT?: Prisma.SalesInvoiceScalarWhereInput | Prisma.SalesInvoiceScalarWhereInput[] + id?: Prisma.StringFilter<"SalesInvoice"> | string + code?: Prisma.StringFilter<"SalesInvoice"> | string + total_amount?: Prisma.DecimalFilter<"SalesInvoice"> | runtime.Decimal | runtime.DecimalJsLike | number | string + notes?: Prisma.StringNullableFilter<"SalesInvoice"> | string | null + unknown_customer?: Prisma.JsonNullableFilter<"SalesInvoice"> + invoice_date?: Prisma.DateTimeNullableFilter<"SalesInvoice"> | Date | string | null + created_at?: Prisma.DateTimeFilter<"SalesInvoice"> | Date | string + updated_at?: Prisma.DateTimeFilter<"SalesInvoice"> | Date | string + customer_id?: Prisma.StringNullableFilter<"SalesInvoice"> | string | null + account_id?: Prisma.StringFilter<"SalesInvoice"> | string + pos_id?: Prisma.StringFilter<"SalesInvoice"> | string +} + +export type SalesInvoiceCreateWithoutPosInput = { + id?: string + code: string + total_amount: runtime.Decimal | runtime.DecimalJsLike | number | string + notes?: string | null + unknown_customer?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue + invoice_date?: Date | string | null + created_at?: Date | string + updated_at?: Date | string + customer?: Prisma.CustomerCreateNestedOneWithoutSales_invoicesInput + account: Prisma.ConsumerAccountCreateNestedOneWithoutSalesInvoicesInput + items?: Prisma.SalesInvoiceItemCreateNestedManyWithoutInvoiceInput + payments?: Prisma.SalesInvoicePaymentCreateNestedManyWithoutInvoiceInput +} + +export type SalesInvoiceUncheckedCreateWithoutPosInput = { + id?: string + code: string + total_amount: runtime.Decimal | runtime.DecimalJsLike | number | string + notes?: string | null + unknown_customer?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue + invoice_date?: Date | string | null + created_at?: Date | string + updated_at?: Date | string + customer_id?: string | null + account_id: string + items?: Prisma.SalesInvoiceItemUncheckedCreateNestedManyWithoutInvoiceInput + payments?: Prisma.SalesInvoicePaymentUncheckedCreateNestedManyWithoutInvoiceInput +} + +export type SalesInvoiceCreateOrConnectWithoutPosInput = { + where: Prisma.SalesInvoiceWhereUniqueInput + create: Prisma.XOR +} + +export type SalesInvoiceCreateManyPosInputEnvelope = { + data: Prisma.SalesInvoiceCreateManyPosInput | Prisma.SalesInvoiceCreateManyPosInput[] + skipDuplicates?: boolean +} + +export type SalesInvoiceUpsertWithWhereUniqueWithoutPosInput = { + where: Prisma.SalesInvoiceWhereUniqueInput + update: Prisma.XOR + create: Prisma.XOR +} + +export type SalesInvoiceUpdateWithWhereUniqueWithoutPosInput = { + where: Prisma.SalesInvoiceWhereUniqueInput + data: Prisma.XOR +} + +export type SalesInvoiceUpdateManyWithWhereWithoutPosInput = { + where: Prisma.SalesInvoiceScalarWhereInput + data: Prisma.XOR +} + export type SalesInvoiceCreateWithoutCustomerInput = { id?: string code: string @@ -600,8 +817,8 @@ export type SalesInvoiceCreateWithoutCustomerInput = { invoice_date?: Date | string | null created_at?: Date | string updated_at?: Date | string - account_id: string - complex_id: string + pos: Prisma.PosCreateNestedOneWithoutSalesInvoicesInput + account: Prisma.ConsumerAccountCreateNestedOneWithoutSalesInvoicesInput items?: Prisma.SalesInvoiceItemCreateNestedManyWithoutInvoiceInput payments?: Prisma.SalesInvoicePaymentCreateNestedManyWithoutInvoiceInput } @@ -616,7 +833,7 @@ export type SalesInvoiceUncheckedCreateWithoutCustomerInput = { created_at?: Date | string updated_at?: Date | string account_id: string - complex_id: string + pos_id: string items?: Prisma.SalesInvoiceItemUncheckedCreateNestedManyWithoutInvoiceInput payments?: Prisma.SalesInvoicePaymentUncheckedCreateNestedManyWithoutInvoiceInput } @@ -647,23 +864,6 @@ export type SalesInvoiceUpdateManyWithWhereWithoutCustomerInput = { data: Prisma.XOR } -export type SalesInvoiceScalarWhereInput = { - AND?: Prisma.SalesInvoiceScalarWhereInput | Prisma.SalesInvoiceScalarWhereInput[] - OR?: Prisma.SalesInvoiceScalarWhereInput[] - NOT?: Prisma.SalesInvoiceScalarWhereInput | Prisma.SalesInvoiceScalarWhereInput[] - id?: Prisma.StringFilter<"SalesInvoice"> | string - code?: Prisma.StringFilter<"SalesInvoice"> | string - total_amount?: Prisma.DecimalFilter<"SalesInvoice"> | runtime.Decimal | runtime.DecimalJsLike | number | string - notes?: Prisma.StringNullableFilter<"SalesInvoice"> | string | null - unknown_customer?: Prisma.JsonNullableFilter<"SalesInvoice"> - invoice_date?: Prisma.DateTimeNullableFilter<"SalesInvoice"> | Date | string | null - created_at?: Prisma.DateTimeFilter<"SalesInvoice"> | Date | string - updated_at?: Prisma.DateTimeFilter<"SalesInvoice"> | Date | string - customer_id?: Prisma.StringNullableFilter<"SalesInvoice"> | string | null - account_id?: Prisma.StringFilter<"SalesInvoice"> | string - complex_id?: Prisma.StringFilter<"SalesInvoice"> | string -} - export type SalesInvoiceCreateWithoutItemsInput = { id?: string code: string @@ -673,9 +873,9 @@ export type SalesInvoiceCreateWithoutItemsInput = { invoice_date?: Date | string | null created_at?: Date | string updated_at?: Date | string - account_id: string - complex_id: string customer?: Prisma.CustomerCreateNestedOneWithoutSales_invoicesInput + pos: Prisma.PosCreateNestedOneWithoutSalesInvoicesInput + account: Prisma.ConsumerAccountCreateNestedOneWithoutSalesInvoicesInput payments?: Prisma.SalesInvoicePaymentCreateNestedManyWithoutInvoiceInput } @@ -690,7 +890,7 @@ export type SalesInvoiceUncheckedCreateWithoutItemsInput = { updated_at?: Date | string customer_id?: string | null account_id: string - complex_id: string + pos_id: string payments?: Prisma.SalesInvoicePaymentUncheckedCreateNestedManyWithoutInvoiceInput } @@ -719,9 +919,9 @@ export type SalesInvoiceUpdateWithoutItemsInput = { invoice_date?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string - account_id?: Prisma.StringFieldUpdateOperationsInput | string - complex_id?: Prisma.StringFieldUpdateOperationsInput | string customer?: Prisma.CustomerUpdateOneWithoutSales_invoicesNestedInput + pos?: Prisma.PosUpdateOneRequiredWithoutSalesInvoicesNestedInput + account?: Prisma.ConsumerAccountUpdateOneRequiredWithoutSalesInvoicesNestedInput payments?: Prisma.SalesInvoicePaymentUpdateManyWithoutInvoiceNestedInput } @@ -736,7 +936,7 @@ export type SalesInvoiceUncheckedUpdateWithoutItemsInput = { updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string customer_id?: Prisma.NullableStringFieldUpdateOperationsInput | string | null account_id?: Prisma.StringFieldUpdateOperationsInput | string - complex_id?: Prisma.StringFieldUpdateOperationsInput | string + pos_id?: Prisma.StringFieldUpdateOperationsInput | string payments?: Prisma.SalesInvoicePaymentUncheckedUpdateManyWithoutInvoiceNestedInput } @@ -749,9 +949,9 @@ export type SalesInvoiceCreateWithoutPaymentsInput = { invoice_date?: Date | string | null created_at?: Date | string updated_at?: Date | string - account_id: string - complex_id: string customer?: Prisma.CustomerCreateNestedOneWithoutSales_invoicesInput + pos: Prisma.PosCreateNestedOneWithoutSalesInvoicesInput + account: Prisma.ConsumerAccountCreateNestedOneWithoutSalesInvoicesInput items?: Prisma.SalesInvoiceItemCreateNestedManyWithoutInvoiceInput } @@ -766,7 +966,7 @@ export type SalesInvoiceUncheckedCreateWithoutPaymentsInput = { updated_at?: Date | string customer_id?: string | null account_id: string - complex_id: string + pos_id: string items?: Prisma.SalesInvoiceItemUncheckedCreateNestedManyWithoutInvoiceInput } @@ -795,9 +995,9 @@ export type SalesInvoiceUpdateWithoutPaymentsInput = { invoice_date?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string - account_id?: Prisma.StringFieldUpdateOperationsInput | string - complex_id?: Prisma.StringFieldUpdateOperationsInput | string customer?: Prisma.CustomerUpdateOneWithoutSales_invoicesNestedInput + pos?: Prisma.PosUpdateOneRequiredWithoutSalesInvoicesNestedInput + account?: Prisma.ConsumerAccountUpdateOneRequiredWithoutSalesInvoicesNestedInput items?: Prisma.SalesInvoiceItemUpdateManyWithoutInvoiceNestedInput } @@ -812,10 +1012,122 @@ export type SalesInvoiceUncheckedUpdateWithoutPaymentsInput = { updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string customer_id?: Prisma.NullableStringFieldUpdateOperationsInput | string | null account_id?: Prisma.StringFieldUpdateOperationsInput | string - complex_id?: Prisma.StringFieldUpdateOperationsInput | string + pos_id?: Prisma.StringFieldUpdateOperationsInput | string items?: Prisma.SalesInvoiceItemUncheckedUpdateManyWithoutInvoiceNestedInput } +export type SalesInvoiceCreateManyAccountInput = { + id?: string + code: string + total_amount: runtime.Decimal | runtime.DecimalJsLike | number | string + notes?: string | null + unknown_customer?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue + invoice_date?: Date | string | null + created_at?: Date | string + updated_at?: Date | string + customer_id?: string | null + pos_id: string +} + +export type SalesInvoiceUpdateWithoutAccountInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + code?: Prisma.StringFieldUpdateOperationsInput | string + total_amount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + notes?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + unknown_customer?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue + invoice_date?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null + created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + customer?: Prisma.CustomerUpdateOneWithoutSales_invoicesNestedInput + pos?: Prisma.PosUpdateOneRequiredWithoutSalesInvoicesNestedInput + items?: Prisma.SalesInvoiceItemUpdateManyWithoutInvoiceNestedInput + payments?: Prisma.SalesInvoicePaymentUpdateManyWithoutInvoiceNestedInput +} + +export type SalesInvoiceUncheckedUpdateWithoutAccountInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + code?: Prisma.StringFieldUpdateOperationsInput | string + total_amount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + notes?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + unknown_customer?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue + invoice_date?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null + created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + customer_id?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + pos_id?: Prisma.StringFieldUpdateOperationsInput | string + items?: Prisma.SalesInvoiceItemUncheckedUpdateManyWithoutInvoiceNestedInput + payments?: Prisma.SalesInvoicePaymentUncheckedUpdateManyWithoutInvoiceNestedInput +} + +export type SalesInvoiceUncheckedUpdateManyWithoutAccountInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + code?: Prisma.StringFieldUpdateOperationsInput | string + total_amount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + notes?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + unknown_customer?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue + invoice_date?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null + created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + customer_id?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + pos_id?: Prisma.StringFieldUpdateOperationsInput | string +} + +export type SalesInvoiceCreateManyPosInput = { + id?: string + code: string + total_amount: runtime.Decimal | runtime.DecimalJsLike | number | string + notes?: string | null + unknown_customer?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue + invoice_date?: Date | string | null + created_at?: Date | string + updated_at?: Date | string + customer_id?: string | null + account_id: string +} + +export type SalesInvoiceUpdateWithoutPosInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + code?: Prisma.StringFieldUpdateOperationsInput | string + total_amount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + notes?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + unknown_customer?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue + invoice_date?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null + created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + customer?: Prisma.CustomerUpdateOneWithoutSales_invoicesNestedInput + account?: Prisma.ConsumerAccountUpdateOneRequiredWithoutSalesInvoicesNestedInput + items?: Prisma.SalesInvoiceItemUpdateManyWithoutInvoiceNestedInput + payments?: Prisma.SalesInvoicePaymentUpdateManyWithoutInvoiceNestedInput +} + +export type SalesInvoiceUncheckedUpdateWithoutPosInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + code?: Prisma.StringFieldUpdateOperationsInput | string + total_amount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + notes?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + unknown_customer?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue + invoice_date?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null + created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + customer_id?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + account_id?: Prisma.StringFieldUpdateOperationsInput | string + items?: Prisma.SalesInvoiceItemUncheckedUpdateManyWithoutInvoiceNestedInput + payments?: Prisma.SalesInvoicePaymentUncheckedUpdateManyWithoutInvoiceNestedInput +} + +export type SalesInvoiceUncheckedUpdateManyWithoutPosInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + code?: Prisma.StringFieldUpdateOperationsInput | string + total_amount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + notes?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + unknown_customer?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue + invoice_date?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null + created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + customer_id?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + account_id?: Prisma.StringFieldUpdateOperationsInput | string +} + export type SalesInvoiceCreateManyCustomerInput = { id?: string code: string @@ -826,7 +1138,7 @@ export type SalesInvoiceCreateManyCustomerInput = { created_at?: Date | string updated_at?: Date | string account_id: string - complex_id: string + pos_id: string } export type SalesInvoiceUpdateWithoutCustomerInput = { @@ -838,8 +1150,8 @@ export type SalesInvoiceUpdateWithoutCustomerInput = { invoice_date?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string - account_id?: Prisma.StringFieldUpdateOperationsInput | string - complex_id?: Prisma.StringFieldUpdateOperationsInput | string + pos?: Prisma.PosUpdateOneRequiredWithoutSalesInvoicesNestedInput + account?: Prisma.ConsumerAccountUpdateOneRequiredWithoutSalesInvoicesNestedInput items?: Prisma.SalesInvoiceItemUpdateManyWithoutInvoiceNestedInput payments?: Prisma.SalesInvoicePaymentUpdateManyWithoutInvoiceNestedInput } @@ -854,7 +1166,7 @@ export type SalesInvoiceUncheckedUpdateWithoutCustomerInput = { created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string account_id?: Prisma.StringFieldUpdateOperationsInput | string - complex_id?: Prisma.StringFieldUpdateOperationsInput | string + pos_id?: Prisma.StringFieldUpdateOperationsInput | string items?: Prisma.SalesInvoiceItemUncheckedUpdateManyWithoutInvoiceNestedInput payments?: Prisma.SalesInvoicePaymentUncheckedUpdateManyWithoutInvoiceNestedInput } @@ -869,7 +1181,7 @@ export type SalesInvoiceUncheckedUpdateManyWithoutCustomerInput = { created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string account_id?: Prisma.StringFieldUpdateOperationsInput | string - complex_id?: Prisma.StringFieldUpdateOperationsInput | string + pos_id?: Prisma.StringFieldUpdateOperationsInput | string } @@ -923,8 +1235,10 @@ export type SalesInvoiceSelect + pos?: boolean | Prisma.PosDefaultArgs + account?: boolean | Prisma.ConsumerAccountDefaultArgs items?: boolean | Prisma.SalesInvoice$itemsArgs payments?: boolean | Prisma.SalesInvoice$paymentsArgs _count?: boolean | Prisma.SalesInvoiceCountOutputTypeDefaultArgs @@ -943,12 +1257,14 @@ export type SalesInvoiceSelectScalar = { updated_at?: boolean customer_id?: boolean account_id?: boolean - complex_id?: boolean + pos_id?: boolean } -export type SalesInvoiceOmit = runtime.Types.Extensions.GetOmit<"id" | "code" | "total_amount" | "notes" | "unknown_customer" | "invoice_date" | "created_at" | "updated_at" | "customer_id" | "account_id" | "complex_id", ExtArgs["result"]["salesInvoice"]> +export type SalesInvoiceOmit = runtime.Types.Extensions.GetOmit<"id" | "code" | "total_amount" | "notes" | "unknown_customer" | "invoice_date" | "created_at" | "updated_at" | "customer_id" | "account_id" | "pos_id", ExtArgs["result"]["salesInvoice"]> export type SalesInvoiceInclude = { customer?: boolean | Prisma.SalesInvoice$customerArgs + pos?: boolean | Prisma.PosDefaultArgs + account?: boolean | Prisma.ConsumerAccountDefaultArgs items?: boolean | Prisma.SalesInvoice$itemsArgs payments?: boolean | Prisma.SalesInvoice$paymentsArgs _count?: boolean | Prisma.SalesInvoiceCountOutputTypeDefaultArgs @@ -958,6 +1274,8 @@ export type $SalesInvoicePayload | null + pos: Prisma.$PosPayload + account: Prisma.$ConsumerAccountPayload items: Prisma.$SalesInvoiceItemPayload[] payments: Prisma.$SalesInvoicePaymentPayload[] } @@ -972,7 +1290,7 @@ export type $SalesInvoicePayload composites: {} } @@ -1314,6 +1632,8 @@ readonly fields: SalesInvoiceFieldRefs; export interface Prisma__SalesInvoiceClient extends Prisma.PrismaPromise { readonly [Symbol.toStringTag]: "PrismaPromise" customer = {}>(args?: Prisma.Subset>): Prisma.Prisma__CustomerClient, T, "findUniqueOrThrow", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions> + pos = {}>(args?: Prisma.Subset>): Prisma.Prisma__PosClient, T, "findUniqueOrThrow", GlobalOmitOptions> | Null, Null, ExtArgs, GlobalOmitOptions> + account = {}>(args?: Prisma.Subset>): Prisma.Prisma__ConsumerAccountClient, T, "findUniqueOrThrow", GlobalOmitOptions> | Null, Null, ExtArgs, GlobalOmitOptions> items = {}>(args?: Prisma.Subset>): Prisma.PrismaPromise, T, "findMany", GlobalOmitOptions> | Null> payments = {}>(args?: Prisma.Subset>): Prisma.PrismaPromise, T, "findMany", GlobalOmitOptions> | Null> /** @@ -1355,7 +1675,7 @@ export interface SalesInvoiceFieldRefs { readonly updated_at: Prisma.FieldRef<"SalesInvoice", 'DateTime'> readonly customer_id: Prisma.FieldRef<"SalesInvoice", 'String'> readonly account_id: Prisma.FieldRef<"SalesInvoice", 'String'> - readonly complex_id: Prisma.FieldRef<"SalesInvoice", 'String'> + readonly pos_id: Prisma.FieldRef<"SalesInvoice", 'String'> } diff --git a/src/main.ts b/src/main.ts index 5b59e63..38177c2 100644 --- a/src/main.ts +++ b/src/main.ts @@ -6,13 +6,15 @@ import { AppModule } from './app.module' import { PrismaExceptionFilter } from './common/filters/prisma-exception.filter' import { ValidationExceptionFilter } from './common/filters/validation-exception.filter' import { JwtAuthGuard } from './common/guards/jwt-auth.guard' +import { PosGuard } from './common/guards/pos.gaurd' import { LoggingInterceptor } from './common/interceptors/logging.interceptor' import { ResponseMappingInterceptor } from './common/interceptors/response-mapping.interceptor' +import { PrismaService } from './prisma/prisma.service' +const cookieParser = require('cookie-parser') async function bootstrap() { const app = await NestFactory.create(AppModule) - const cookieParser = (await import('cookie-parser')).default app.use(cookieParser()) const config = new DocumentBuilder() @@ -53,18 +55,21 @@ async function bootstrap() { // 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 = ['*', 'http://localhost:5000'] + const defaultOrigins = ['http://localhost:5000', 'http://127.0.0.1:5000'] const envOrigins = process.env.CORS_ORIGINS ? process.env.CORS_ORIGINS.split(',') .map(s => s.trim()) .filter(Boolean) : [] - const allowedOrigins = envOrigins.length ? envOrigins : defaultOrigins + const allowedOrigins = (envOrigins.length ? envOrigins : defaultOrigins).filter( + origin => origin !== '*', + ) app.enableCors({ origin: allowedOrigins, credentials: true, methods: 'GET,HEAD,PUT,PATCH,POST,DELETE,OPTIONS', - allowedHeaders: 'Content-Type, Accept, Authorization, X-Requested-With, X-CSRF-Token', + allowedHeaders: + 'Content-Type, Accept, Authorization, X-Requested-With, X-CSRF-Token, pos_id', }) // Register global logging and response mapping interceptors @@ -77,6 +82,9 @@ async function bootstrap() { app.useGlobalFilters(new ValidationExceptionFilter(), new PrismaExceptionFilter()) app.useGlobalGuards(new JwtAuthGuard(app.get(JwtService), app.get(Reflector))) + app.useGlobalGuards( + new PosGuard(app.get(JwtService), app.get(Reflector), app.get(PrismaService)), + ) await app.listen(process.env.PORT ?? 5002) } diff --git a/src/modules/auth/auth.module.ts b/src/modules/auth/auth.module.ts index f212904..d96ec57 100644 --- a/src/modules/auth/auth.module.ts +++ b/src/modules/auth/auth.module.ts @@ -11,7 +11,7 @@ import { AuthUtils } from './auth.utils' imports: [ PrismaModule, JwtModule.register({ - secret: env('JWT_SECRET') || 'secret', + secret: env('JWT_SECRET'), signOptions: { expiresIn: Number(env('JWT_EXPIRES_IN')) || '48h' }, }), ], diff --git a/src/modules/auth/auth.utils.ts b/src/modules/auth/auth.utils.ts index 85982d0..0084e45 100644 --- a/src/modules/auth/auth.utils.ts +++ b/src/modules/auth/auth.utils.ts @@ -6,7 +6,7 @@ import { Injectable, NotFoundException } from '@nestjs/common' import { JwtService } from '@nestjs/jwt' import { randomBytes } from 'crypto' import { env } from 'prisma/config' -import { AccessTokenPayload } from './models' +import { AccessTokenPayload } from '../../common/models/tokenPayload.model' export interface ITokenPayload { type: AccountType diff --git a/src/modules/auth/current-user.decorator.ts b/src/modules/auth/current-user.decorator.ts index 82cdbde..05344a6 100644 --- a/src/modules/auth/current-user.decorator.ts +++ b/src/modules/auth/current-user.decorator.ts @@ -1,9 +1,8 @@ import { createParamDecorator, ExecutionContext } from '@nestjs/common' -import { AccessTokenPayload } from 'common/models/token-model' export const reqTokenPayload = createParamDecorator( (data: unknown, ctx: ExecutionContext) => { const req = ctx.switchToHttp().getRequest() - return req.dataPayload as AccessTokenPayload + return req.dataPayload }, ) diff --git a/src/modules/consumer/accounts/accounts.controller.ts b/src/modules/consumer/accounts/accounts.controller.ts index f8f0d88..8beaf74 100644 --- a/src/modules/consumer/accounts/accounts.controller.ts +++ b/src/modules/consumer/accounts/accounts.controller.ts @@ -1,3 +1,4 @@ +import { TokenAccount } from '@/common/decorators/tokenInfo.decorator' import { Body, Controller, Get, Param, Patch, Post } from '@nestjs/common' import { ApiTags } from '@nestjs/swagger' import { AccountsService } from './accounts.service' @@ -9,7 +10,7 @@ export class AccountsController { constructor(private readonly accountsService: AccountsService) {} @Get() - async findAll(@Param('consumerId') consumerId: string) { + async findAll(@TokenAccount('userId') consumerId: string) { return this.accountsService.findAll(consumerId) } @@ -20,7 +21,7 @@ export class AccountsController { @Post() async create( - @Param('consumerId') consumerId: string, + @TokenAccount('userId') consumerId: string, @Body() data: CreateConsumerAccountDto, ) { return this.accountsService.create(consumerId, data) diff --git a/src/modules/consumer/accounts/accounts.service.ts b/src/modules/consumer/accounts/accounts.service.ts index d4cc769..24154c4 100644 --- a/src/modules/consumer/accounts/accounts.service.ts +++ b/src/modules/consumer/accounts/accounts.service.ts @@ -72,8 +72,8 @@ export class AccountsService { return ResponseMapper.update(account) } - async delete(id: string) { - await this.prisma.account.delete({ where: { id } }) - return ResponseMapper.delete() - } + // async delete(id: string) { + // await this.prisma.account.delete({ where: { id } }) + // return ResponseMapper.delete() + // } } diff --git a/src/modules/consumer/business-activities/complexes/goods/goods.controller.ts b/src/modules/consumer/business-activities/complexes/goods/goods.controller.ts index 67f748b..a4dcf24 100644 --- a/src/modules/consumer/business-activities/complexes/goods/goods.controller.ts +++ b/src/modules/consumer/business-activities/complexes/goods/goods.controller.ts @@ -15,8 +15,6 @@ export class ConsumerComplexGoodsController { @Param('businessActivityId') businessActivityId: string, @Param('complexId') complexId: string, ) { - console.log(userId, businessActivityId, complexId) - return this.service.findAll(userId, businessActivityId, complexId) } diff --git a/src/modules/pos/good-categories/good-categories.controller.ts b/src/modules/pos/good-categories/good-categories.controller.ts index d119f87..0598842 100644 --- a/src/modules/pos/good-categories/good-categories.controller.ts +++ b/src/modules/pos/good-categories/good-categories.controller.ts @@ -1,6 +1,6 @@ -import { Body, Controller, Get, Param, Post } from '@nestjs/common' -import { reqTokenPayload } from '../../auth/current-user.decorator' -import { CreateGoodCategoryDto } from './dto/create-good-category.dto' +import { PosInfo } from '@/common/decorators/posInfo.decorator' +import type { IPosPayload } from '@/common/models/posPayload.model' +import { Controller, Get } from '@nestjs/common' import { GoodCategoriesService } from './good-categories.service' @Controller('pos/good_categories') @@ -8,17 +8,17 @@ export class GoodCategoriesController { constructor(private readonly goodCategoriesService: GoodCategoriesService) {} @Get() - findAll(@reqTokenPayload() account) { - return this.goodCategoriesService.findAll(account.complex_id) + findAll(@PosInfo() { complex_id, guild_id }: IPosPayload) { + return this.goodCategoriesService.findAll(complex_id, guild_id) } - @Get(':id') - findOne(@Param('id') id: string, @reqTokenPayload() account) { - return this.goodCategoriesService.findOne(id, account.complex_id) - } + // @Get(':id') + // findOne(@Param('id') id: string, @PosInfo() { complex_id, guild_id }: IPosPayload) { + // return this.goodCategoriesService.findOne(id, account.complex_id) + // } - @Post() - create(@Body() data: CreateGoodCategoryDto, @reqTokenPayload() account) { - return this.goodCategoriesService.create(data, account.complex_id) - } + // @Post() + // create(@Body() data: CreateGoodCategoryDto, @reqTokenPayload() account) { + // return this.goodCategoriesService.create(data, account.complex_id) + // } } diff --git a/src/modules/pos/good-categories/good-categories.service.ts b/src/modules/pos/good-categories/good-categories.service.ts index b8d70ae..c92003e 100644 --- a/src/modules/pos/good-categories/good-categories.service.ts +++ b/src/modules/pos/good-categories/good-categories.service.ts @@ -1,26 +1,40 @@ +import { GoodCategorySelect } from '@/generated/prisma/models' import { Injectable } from '@nestjs/common' import { ResponseMapper } from '../../../common/response/response-mapper' import { PrismaService } from '../../../prisma/prisma.service' -import { CreateGoodCategoryDto } from './dto/create-good-category.dto' @Injectable() export class GoodCategoriesService { constructor(private prisma: PrismaService) {} - async findAll(complex_id: string) { + + private readonly defaultSelect: GoodCategorySelect = { + id: true, + name: true, + image_url: true, + } + + async findAll(complex_id: string, guild_id: string) { const categories = await this.prisma.goodCategory.findMany({ where: { - complex_id, + guild_id, }, - include: { + select: { + ...this.defaultSelect, _count: { select: { - goods: true, + goods: { + where: { + OR: [ + { is_default_guild_good: true }, + { + complex_id, + }, + ], + }, + }, }, }, }, - omit: { - complex_id: true, - }, }) return ResponseMapper.list( @@ -34,18 +48,18 @@ export class GoodCategoriesService { ) } - findOne(categoryId: string, complex_id: string) { - return {} - } + // findOne(categoryId: string, complex_id: string) { + // return {} + // } - create(data: CreateGoodCategoryDto, complex_id: string) { - const category = this.prisma.goodCategory.create({ - data: { - ...data, - complex_id, - }, - }) + // create(data: CreateGoodCategoryDto, complex_id: string) { + // const category = this.prisma.goodCategory.create({ + // data: { + // ...data, + // complex_id, + // }, + // }) - return ResponseMapper.create(category) - } + // return ResponseMapper.create(category) + // } } diff --git a/src/modules/pos/goods/goods.controller.ts b/src/modules/pos/goods/goods.controller.ts index e00e84f..23c9bb0 100644 --- a/src/modules/pos/goods/goods.controller.ts +++ b/src/modules/pos/goods/goods.controller.ts @@ -1,6 +1,6 @@ -import { Body, Controller, Get, Param, Post } from '@nestjs/common' -import { reqTokenPayload } from '../../auth/current-user.decorator' -import { CreateGoodDto } from './dto/create-good.dto' +import { PosInfo } from '@/common/decorators/posInfo.decorator' +import type { IPosPayload } from '@/common/models/posPayload.model' +import { Controller, Get, Param } from '@nestjs/common' import { GoodsService } from './goods.service' @Controller('pos/goods') @@ -8,17 +8,17 @@ export class GoodsController { constructor(private readonly goodsService: GoodsService) {} @Get() - findAll(@reqTokenPayload() account) { - return this.goodsService.findAll(account.complex_id) + findAll(@PosInfo() { complex_id, guild_id }: IPosPayload) { + return this.goodsService.findAll(complex_id, guild_id) } @Get(':id') - findOne(@Param('id') goodId: string, @reqTokenPayload() account) { - return this.goodsService.findOne(goodId, account.complex_id) + findOne(@PosInfo() { complex_id, guild_id }: IPosPayload, @Param('id') goodId: string) { + return this.goodsService.findOne(goodId, complex_id, guild_id) } - @Post() - create(@Body() data: CreateGoodDto, @reqTokenPayload() account) { - return this.goodsService.create(data, account.complex_id) - } + // @Post() + // create(@Body() data: CreateGoodDto, @PosInfo() { complex_id, guild_id }: IPosPayload) { + // return this.goodsService.create(data, complex_id, guild_id) + // } } diff --git a/src/modules/pos/goods/goods.service.ts b/src/modules/pos/goods/goods.service.ts index 8edf05e..1324f89 100644 --- a/src/modules/pos/goods/goods.service.ts +++ b/src/modules/pos/goods/goods.service.ts @@ -1,3 +1,4 @@ +import { GoodSelect } from '@/generated/prisma/models' import { Injectable } from '@nestjs/common' import { ResponseMapper } from '../../../common/response/response-mapper' import { PrismaService } from '../../../prisma/prisma.service' @@ -7,31 +8,59 @@ import { CreateGoodDto } from './dto/create-good.dto' export class GoodsService { constructor(private prisma: PrismaService) {} - async findAll(complex_id: string) { + private readonly defaultSelect: GoodSelect = { + id: true, + name: true, + barcode: true, + created_at: true, + description: true, + sku: true, + local_sku: true, + is_default_guild_good: true, + pricing_model: true, + unit_type: true, + category: { + select: { + id: true, + name: true, + image_url: true, + }, + }, + } + + async findAll(complex_id: string, guild_id: string) { const goods = await this.prisma.good.findMany({ where: { - complex_id, - }, - omit: { - complex_id: true, - deleted_at: true, + OR: [ + { + is_default_guild_good: true, + category: { + guild_id, + }, + }, + { + complex_id, + }, + ], }, + select: this.defaultSelect, }) return ResponseMapper.list(goods) } - async findOne(good_id: string, complex_id: string) { + async findOne(good_id: string, complex_id: string, guild_id: string) { const good = await this.prisma.good.findUnique({ where: { - complex_id, id: good_id, + complex: { + id: complex_id, + business_activity: { + guild_id, + }, + }, }, - - omit: { - complex_id: true, - deleted_at: true, - }, + select: this.defaultSelect, }) return ResponseMapper.single(good) @@ -64,10 +93,7 @@ export class GoodsService { }, }, }, - omit: { - complex_id: true, - deleted_at: true, - }, + select: this.defaultSelect, }) return ResponseMapper.create(good) diff --git a/src/modules/pos/pos.controller.ts b/src/modules/pos/pos.controller.ts new file mode 100644 index 0000000..9d93e97 --- /dev/null +++ b/src/modules/pos/pos.controller.ts @@ -0,0 +1,15 @@ +import { PosInfo } from '@/common/decorators/posInfo.decorator' +import { Controller, Get } from '@nestjs/common' +import { ApiTags } from '@nestjs/swagger' +import { PosService } from './pos.service' + +@ApiTags('Pos') +@Controller('pos') +export class PosController { + constructor(private service: PosService) {} + + @Get() + async getInfo(@PosInfo('pos_id') pos_id: string) { + return await this.service.getInfo(pos_id) + } +} diff --git a/src/modules/pos/pos.middleware.ts b/src/modules/pos/pos.middleware.ts index 4cfcce8..8e7a07e 100644 --- a/src/modules/pos/pos.middleware.ts +++ b/src/modules/pos/pos.middleware.ts @@ -1,21 +1,97 @@ -import { Injectable, NestMiddleware, UnauthorizedException } from '@nestjs/common' +import { checkAndDecodeJwtToken } from '@/common/utils/jwt-user.util' +import { PrismaService } from '@/prisma/prisma.service' +import { ForbiddenException, Injectable, NestMiddleware } from '@nestjs/common' +import { JwtService } from '@nestjs/jwt' import { NextFunction, Request, Response } from 'express' @Injectable() export class PosMiddleware implements NestMiddleware { - use(req: Request, _res: Response, next: NextFunction) { - // const a = reqTokenPayload() - // console.log(a) + constructor( + private prisma: PrismaService, + private jwtService: JwtService, + ) {} - // Middleware-based admin check (replace with real auth logic) - const isAdminHeader = req.headers['x-admin'] - - if (isAdminHeader === 'true') { - // mark request if needed downstream - req['isAdminRequest'] = true + async use(req: Request, _res: Response, next: NextFunction) { + const doForbidden = () => { + throw new ForbiddenException('شما دسترسی لازم را ندارید') } - return next() + try { + const tokenAccount = checkAndDecodeJwtToken(req, this.jwtService) - throw new UnauthorizedException('Admin access required') + // const posId = req.cookies['posId'] + const posId = req.headers.pos_id as string + + if (tokenAccount?.type !== 'CONSUMER' || !posId || typeof posId !== 'string') { + return doForbidden() + } + + const consumerAccount = await this.prisma.consumerAccount.findUnique({ + where: { + account_id: tokenAccount.account_id, + }, + }) + if (!consumerAccount) { + return doForbidden() + } + + const complex = await this.prisma.complex.findFirst({ + where: { + pos_list: { + some: { + id: posId, + }, + }, + }, + include: { + business_activity: { + include: { + guild: true, + }, + }, + }, + }) + if (!complex) { + return doForbidden() + } + + // if (account?.role !== ConsumerRole.OWNER) { + // const accountPermissions = await this.prisma.permissionConsumer.findUnique({ + // where: { + // account_id: account?.id, + // }, + // include: { + // posPermissions: true, + // businessPermissions: true, + // complexPermissions: true, + // }, + // }) + + // if ( + // !( + // accountPermissions?.businessPermissions.some( + // permission => permission.business_id, + // ) || + // accountPermissions?.complexPermissions.some( + // permission => permission.complex_id, + // ) || + // accountPermissions?.posPermissions.some(permission => permission.pos_id) + // ) + // ) { + // return doForbidden() + // } + // } + req.posData = { + pos_id: posId, + complex_id: complex.id, + business_id: complex.business_activity_id, + guild_id: complex.business_activity.guild_id, + consumer_account_id: consumerAccount.id, + } + req.decodedToken = tokenAccount + + return next() + } catch (error) { + return doForbidden() + } } } diff --git a/src/modules/pos/pos.module.ts b/src/modules/pos/pos.module.ts index 52f92f4..28cde23 100644 --- a/src/modules/pos/pos.module.ts +++ b/src/modules/pos/pos.module.ts @@ -1,12 +1,17 @@ import { MiddlewareConsumer, Module, NestModule, RequestMethod } from '@nestjs/common' +import { JwtService } from '@nestjs/jwt' import { PosConfigModule } from './config/config.module' import { PosCustomersModule } from './customers/customers.module' import { PosGoodCategoriesModule } from './good-categories/good-categories.module' import { PosGoodsModule } from './goods/goods.module' +import { PosController } from './pos.controller' import { PosMiddleware } from './pos.middleware' +import { PosService } from './pos.service' import { PosSalesInvoicesModule } from './sales-invoices/sales-invoices.module' @Module({ + controllers: [PosController], + providers: [PosService, JwtService], imports: [ PosConfigModule, PosCustomersModule, @@ -17,11 +22,15 @@ import { PosSalesInvoicesModule } from './sales-invoices/sales-invoices.module' }) export class PosModule implements NestModule { configure(consumer: MiddlewareConsumer) { - // apply middleware to all routes within this module (scoped under /admin) consumer.apply(PosMiddleware).forRoutes({ path: '/pos*path', method: RequestMethod.ALL, version: '1', }) + consumer.apply(PosMiddleware).forRoutes({ + path: '/pos', + method: RequestMethod.ALL, + version: '1', + }) } } diff --git a/src/modules/pos/pos.service.ts b/src/modules/pos/pos.service.ts new file mode 100644 index 0000000..89b44c8 --- /dev/null +++ b/src/modules/pos/pos.service.ts @@ -0,0 +1,56 @@ +import { PrismaService } from '@/prisma/prisma.service' +import { Injectable } from '@nestjs/common' +import { ResponseMapper } from 'common/response/response-mapper' + +@Injectable() +export class PosService { + constructor(private readonly prisma: PrismaService) {} + + async getInfo(pos_id: string) { + const pos = await this.prisma.pos.findUniqueOrThrow({ + where: { + id: pos_id, + }, + select: { + name: true, + complex: { + select: { + id: true, + name: true, + tax_id: true, + business_activity: { + select: { + id: true, + name: true, + guild: { + select: { + id: true, + name: true, + code: true, + }, + }, + }, + }, + }, + }, + }, + }) + const { name, complex } = pos + const { name: complexName, id: complexId, tax_id, business_activity } = complex + const { name: businessName, id: businessId, guild } = business_activity + + return ResponseMapper.single({ + name, + complex: { + id: complexId, + name: complexName, + tax_id, + }, + businessActivity: { + id: businessId, + name: businessName, + }, + guild, + }) + } +} diff --git a/src/modules/pos/sales-invoices/dto/create-sales-invoice.dto.ts b/src/modules/pos/sales-invoices/dto/create-sales-invoice.dto.ts index 3feb6a8..23fcb86 100644 --- a/src/modules/pos/sales-invoices/dto/create-sales-invoice.dto.ts +++ b/src/modules/pos/sales-invoices/dto/create-sales-invoice.dto.ts @@ -13,6 +13,7 @@ import { CustomerType } from 'generated/prisma/enums' import { CreateSalesInvoiceItemDto } from '../sales-invoice-items/dto/create-sales-invoice-item.dto' export class CreateSalesInvoiceDto { + // @TODO: totalAmount must calculated instead of get from api @IsNumber() @ApiProperty({ required: true, default: 0 }) total_amount: number diff --git a/src/modules/pos/sales-invoices/sales-invoice-items/dto/create-sales-invoice-item.dto.ts b/src/modules/pos/sales-invoices/sales-invoice-items/dto/create-sales-invoice-item.dto.ts index e7615be..6f85bec 100644 --- a/src/modules/pos/sales-invoices/sales-invoice-items/dto/create-sales-invoice-item.dto.ts +++ b/src/modules/pos/sales-invoices/sales-invoice-items/dto/create-sales-invoice-item.dto.ts @@ -1,21 +1,33 @@ import { ApiProperty, PartialType } from '@nestjs/swagger' import { IsEnum, IsNumber, IsObject, IsOptional, IsString } from 'class-validator' -import type { SaleInvoiceStandardPayload } from 'common/interfaces/sale-invoice-payload' +import type { SaleInvoiceType } from 'common/interfaces/sale-invoice-payload' import { UnitType } from 'generated/prisma/enums' export class CreateSalesInvoiceItemDto { @IsNumber() - @ApiProperty() + @ApiProperty({ required: true }) unit_price: number @IsNumber() - @ApiProperty() + @ApiProperty({ required: true, default: 1 }) + quantity: number + + @IsNumber() + @ApiProperty({ required: true }) total_amount: number + @IsNumber() + @ApiProperty({ required: true }) + discount_amount: number + @IsString() - @ApiProperty() + @ApiProperty({ required: true }) invoice_id: string + @IsEnum(UnitType) + @ApiProperty({ enum: Object.values(UnitType) }) + unit_type: UnitType + @IsOptional() @IsString() @ApiProperty({ required: false }) @@ -26,14 +38,6 @@ export class CreateSalesInvoiceItemDto { @ApiProperty({ required: false }) service_id?: string - @IsNumber() - @ApiProperty({ required: true, default: 1 }) - quantity: number - - @IsEnum(UnitType) - @ApiProperty({ enum: Object.values(UnitType) }) - unit_type: UnitType - // @IsEnum(SalesInvoiceItemPricingModel) // @ApiProperty({ enum: Object.values(SalesInvoiceItemPricingModel) }) // @IsOptional() @@ -42,7 +46,7 @@ export class CreateSalesInvoiceItemDto { @IsOptional() @IsObject() @ApiProperty({ required: false, default: {} }) - payload?: SaleInvoiceStandardPayload + payload: SaleInvoiceType @IsOptional() @IsString() diff --git a/src/modules/pos/sales-invoices/sales-invoices.controller.ts b/src/modules/pos/sales-invoices/sales-invoices.controller.ts index 0166f08..4de7bb6 100644 --- a/src/modules/pos/sales-invoices/sales-invoices.controller.ts +++ b/src/modules/pos/sales-invoices/sales-invoices.controller.ts @@ -1,6 +1,7 @@ import { Body, Controller, Get, Param, Post } from '@nestjs/common' -import { reqTokenPayload } from '@/modules/auth/current-user.decorator' +import { PosInfo } from '@/common/decorators/posInfo.decorator' +import type { IPosPayload } from '@/common/models/posPayload.model' import { CreateSalesInvoiceDto } from './dto/create-sales-invoice.dto' import { SalesInvoicesService } from './sales-invoices.service' @@ -19,7 +20,7 @@ export class SalesInvoicesController { } @Post() - create(@Body() data: CreateSalesInvoiceDto, @reqTokenPayload() account) { - return this.salesInvoicesService.create(data, account) + create(@Body() data: CreateSalesInvoiceDto, @PosInfo() posInfo: IPosPayload) { + return this.salesInvoicesService.create(data, posInfo) } } diff --git a/src/modules/pos/sales-invoices/sales-invoices.service.ts b/src/modules/pos/sales-invoices/sales-invoices.service.ts index efcf988..8afc8a4 100644 --- a/src/modules/pos/sales-invoices/sales-invoices.service.ts +++ b/src/modules/pos/sales-invoices/sales-invoices.service.ts @@ -1,3 +1,4 @@ +import { IPosPayload } from '@/common/models/posPayload.model' import { PrismaService } from '@/prisma/prisma.service' import { Injectable } from '@nestjs/common' import { ResponseMapper } from 'common/response/response-mapper' @@ -7,12 +8,6 @@ import { CreateSalesInvoiceDto } from './dto/create-sales-invoice.dto' // Define type guard for CustomerIndividual function isCustomerIndividual(customer: any): customer is CustomerIndividual { - console.log( - customer && - typeof customer.first_name === 'string' && - typeof customer.last_name === 'string', - ) - return ( customer && typeof customer.first_name === 'string' && @@ -43,9 +38,11 @@ export class SalesInvoicesService { return {} } - async create(data: CreateSalesInvoiceDto, account) { + async create(data: CreateSalesInvoiceDto, posInfo: IPosPayload) { data.invoice_date = new Date(data.invoice_date).toISOString() as any + const { complex_id, pos_id, consumer_account_id } = posInfo + const salesInvoice = await this.prisma.$transaction(async $tx => { const payments = Object.entries(data.payments) .filter(([_, value]) => value > 0 && PaymentMethodType[_.toUpperCase()]) @@ -58,6 +55,7 @@ export class SalesInvoicesService { }) const totalPayments = payments.reduce((sum, payment) => sum + payment.amount, 0) + if (totalPayments !== data.total_amount) { throw new Error('مبلغ پرداختی باید برابر با مبلغ کل فاکتور باشد.') } @@ -72,7 +70,7 @@ export class SalesInvoicesService { let customerIndividual = await $tx.customerIndividual.findUnique({ where: { complex_id_national_id: { - complex_id: account.complex_id, + complex_id, national_id: customer.national_id, }, }, @@ -82,7 +80,7 @@ export class SalesInvoicesService { await $tx.customerIndividual.update({ where: { complex_id_national_id: { - complex_id: account.complex_id, + complex_id, national_id: customer.national_id, }, }, @@ -99,8 +97,7 @@ export class SalesInvoicesService { const createdCustomer = await $tx.customer.create({ data: { type: CustomerType.INDIVIDUAL, - complex_id: account.complex_id, - customerIndividuals: { + customer_individuals: { connect: { customer_id: customerIndividual.customer_id, }, @@ -116,7 +113,7 @@ export class SalesInvoicesService { let customerLegal = await $tx.customerLegal.findUnique({ where: { complex_id_registration_number: { - complex_id: account.complex_id, + complex_id, registration_number: customer.registration_number, }, }, @@ -126,7 +123,7 @@ export class SalesInvoicesService { await $tx.customerLegal.update({ where: { complex_id_registration_number: { - complex_id: account.complex_id, + complex_id, registration_number: customer.registration_number, }, }, @@ -143,8 +140,8 @@ export class SalesInvoicesService { const createdCustomer = await $tx.customer.create({ data: { type: CustomerType.LEGAL, - complex_id: account.complex_id, - customerIndividuals: { + + customer_individuals: { connect: { customer_id: customerLegal.customer_id, }, @@ -156,16 +153,15 @@ export class SalesInvoicesService { newCustomerId = createdCustomer.id } } + } else if (data.customer_type === CustomerType.UNKNOWN) { } const salesInvoice = await $tx.salesInvoice.create({ data: { ...invoiceData, - account_id: account.account_id, - customer_id: newCustomerId, total_amount: data.total_amount, code: 'INV-' + Date.now(), - complex_id: account.complex_id, + items: { createMany: { data: data.items.map(item => ({ @@ -173,17 +169,33 @@ export class SalesInvoicesService { quantity: item.quantity, unit_price: item.unit_price, total_amount: item.total_amount, - payload: item.payload, + payload: JSON.parse(JSON.stringify(item.payload)), unit_type: item.unit_type, // pricing_model: item.pricingModel, })), }, }, + unknown_customer: {}, payments: { createMany: { data: payments, }, }, + // customer: { + // connect: { + // id: newCustomerId, + // }, + // }, + account: { + connect: { + id: consumer_account_id, + }, + }, + pos: { + connect: { + id: pos_id, + }, + }, }, }) diff --git a/src/modules/profile/dto/create-profile.dto.ts b/src/modules/profile/dto/create-profile.dto.ts deleted file mode 100644 index 5992521..0000000 --- a/src/modules/profile/dto/create-profile.dto.ts +++ /dev/null @@ -1,5 +0,0 @@ -import { PartialType } from '@nestjs/swagger' - -export class CreateProfileDto {} - -export class UpdateProfileDto extends PartialType(CreateProfileDto) {} diff --git a/src/modules/profile/profile.controller.ts b/src/modules/profile/profile.controller.ts deleted file mode 100644 index 46ff8e6..0000000 --- a/src/modules/profile/profile.controller.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { Controller, Get } from '@nestjs/common' -import { reqTokenPayload } from '../auth/current-user.decorator' -import { ProfileService } from './profile.service' - -@Controller('profile') -export class ProfileController { - constructor(private readonly profileService: ProfileService) {} - - @Get('me') - findOne(@reqTokenPayload() account) { - return this.profileService.findOne(account) - } -} diff --git a/src/modules/profile/profile.module.ts b/src/modules/profile/profile.module.ts deleted file mode 100644 index 3ad1c8c..0000000 --- a/src/modules/profile/profile.module.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { Module } from '@nestjs/common' -import { ProfileController } from './profile.controller' -import { ProfileService } from './profile.service' - -@Module({ - controllers: [ProfileController], - providers: [ProfileService], -}) -export class ProfileModule {} diff --git a/src/modules/profile/profile.service.ts b/src/modules/profile/profile.service.ts deleted file mode 100644 index 7ce6f90..0000000 --- a/src/modules/profile/profile.service.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { PrismaService } from '@/prisma/prisma.service' -import { Injectable } from '@nestjs/common' -import { Public } from 'common/decorators/public.decorator' -import type { AccessTokenPayload } from 'common/models/token-model' -import { ResponseMapper } from 'common/response/response-mapper' - -@Injectable() -export class ProfileService { - constructor(private prisma: PrismaService) {} - - @Public() - async findOne(account: AccessTokenPayload) { - return ResponseMapper.single(account) - } -}