diff --git a/package-lock.json b/package-lock.json index acc9cfb..275e128 100644 --- a/package-lock.json +++ b/package-lock.json @@ -21,6 +21,8 @@ "@types/dompurify": "^3.0.5", "@types/jest": "^29.5.12", "@types/node": "^25.4.0", + "ajv": "^8.20.0", + "ajv-formats": "^3.0.1", "babel-jest": "^29.7.0", "babel-loader": "^9.1.3", "core-js": "^3.38.1", @@ -39,6 +41,7 @@ "postcss-syntax": "^0.36.2", "prettier": "^2.8.8", "rimraf": "^6.0.1", + "ts-json-schema-generator": "^2.9.0", "ts-node": "^10.9.2", "typescript": "^5.9.3", "webpack": "^5.94.0", @@ -2712,10 +2715,11 @@ } }, "node_modules/ajv": { - "version": "8.18.0", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.18.0.tgz", - "integrity": "sha512-PlXPeEWMXMZ7sPYOHqmDyCJzcfNrUr3fGNKtezX14ykXOEIvyK81d+qydx89KY5O71FKMPaQ2vBfBFI5NHR63A==", + "version": "8.20.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.20.0.tgz", + "integrity": "sha512-Thbli+OlOj+iMPYFBVBfJ3OmCAnaSyNn4M1vz9T6Gka5Jt9ba/HIR56joy65tY6kx/FCF5VXNB819Y7/GUrBGA==", "dev": true, + "license": "MIT", "dependencies": { "fast-deep-equal": "^3.1.3", "fast-uri": "^3.0.1", @@ -2728,10 +2732,11 @@ } }, "node_modules/ajv-formats": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ajv-formats/-/ajv-formats-2.1.1.tgz", - "integrity": "sha512-Wx0Kx52hxE7C18hkMEggYlEifqWZtYaRgouJor+WMdPnQyEK13vgEWyVNup7SoeeoLMsr4kf5h6dOW11I15MUA==", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/ajv-formats/-/ajv-formats-3.0.1.tgz", + "integrity": "sha512-8iUql50EUR+uUcdRQ3HDqa6EVyo3docL8g5WJ3FNcWmu62IbkGUue/pEyLBW8VGKKucTPgqeks4fIU1DA4yowQ==", "dev": true, + "license": "MIT", "dependencies": { "ajv": "^8.0.0" }, @@ -8654,6 +8659,16 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/safe-stable-stringify": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/safe-stable-stringify/-/safe-stable-stringify-2.5.0.tgz", + "integrity": "sha512-b3rppTKm9T+PsVCBEOUR46GWI7fdOs00VKZ1+9c1EWDaDMvjQc6tUwuFyIprgGgTcWoVHSKrU8H31ZHA2e0RHA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + } + }, "node_modules/sax": { "version": "1.5.0", "resolved": "https://registry.npmjs.org/sax/-/sax-1.5.0.tgz", @@ -8682,6 +8697,24 @@ "url": "https://opencollective.com/webpack" } }, + "node_modules/schema-utils/node_modules/ajv-formats": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ajv-formats/-/ajv-formats-2.1.1.tgz", + "integrity": "sha512-Wx0Kx52hxE7C18hkMEggYlEifqWZtYaRgouJor+WMdPnQyEK13vgEWyVNup7SoeeoLMsr4kf5h6dOW11I15MUA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ajv": "^8.0.0" + }, + "peerDependencies": { + "ajv": "^8.0.0" + }, + "peerDependenciesMeta": { + "ajv": { + "optional": true + } + } + }, "node_modules/semver": { "version": "6.3.1", "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", @@ -9404,6 +9437,96 @@ "node": ">=8.0" } }, + "node_modules/ts-json-schema-generator": { + "version": "2.9.0", + "resolved": "https://registry.npmjs.org/ts-json-schema-generator/-/ts-json-schema-generator-2.9.0.tgz", + "integrity": "sha512-NR5ZE108uiPtBHBJNGnhwoUaUx5vWTDJzDFG9YlRoqxPU76n+5FClRh92dcGgysbe1smRmYalM9Saj97GW1J4Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/json-schema": "^7.0.15", + "commander": "^14.0.3", + "glob": "^13.0.6", + "json5": "^2.2.3", + "normalize-path": "^3.0.0", + "safe-stable-stringify": "^2.5.0", + "tslib": "^2.8.1", + "typescript": "^5.9.3" + }, + "bin": { + "ts-json-schema-generator": "bin/ts-json-schema-generator.js" + }, + "engines": { + "node": ">=22.0.0" + } + }, + "node_modules/ts-json-schema-generator/node_modules/balanced-match": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-4.0.4.tgz", + "integrity": "sha512-BLrgEcRTwX2o6gGxGOCNyMvGSp35YofuYzw9h1IMTRmKqttAZZVU67bdb9Pr2vUHA8+j3i2tJfjO6C6+4myGTA==", + "dev": true, + "license": "MIT", + "engines": { + "node": "18 || 20 || >=22" + } + }, + "node_modules/ts-json-schema-generator/node_modules/brace-expansion": { + "version": "5.0.7", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.7.tgz", + "integrity": "sha512-7oFy703dxfY3/NLxC1fh2SUCQ0H9rmAY+5EpDVfXjUTTs+HEwR2nYaqLv+GWcTsumwxPfiz6CzCNkwXwBUwqCA==", + "dev": true, + "license": "MIT", + "dependencies": { + "balanced-match": "^4.0.2" + }, + "engines": { + "node": "18 || 20 || >=22" + } + }, + "node_modules/ts-json-schema-generator/node_modules/commander": { + "version": "14.0.3", + "resolved": "https://registry.npmjs.org/commander/-/commander-14.0.3.tgz", + "integrity": "sha512-H+y0Jo/T1RZ9qPP4Eh1pkcQcLRglraJaSLoyOtHxu6AapkjWVCy2Sit1QQ4x3Dng8qDlSsZEet7g5Pq06MvTgw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=20" + } + }, + "node_modules/ts-json-schema-generator/node_modules/glob": { + "version": "13.0.6", + "resolved": "https://registry.npmjs.org/glob/-/glob-13.0.6.tgz", + "integrity": "sha512-Wjlyrolmm8uDpm/ogGyXZXb1Z+Ca2B8NbJwqBVg0axK9GbBeoS7yGV6vjXnYdGm6X53iehEuxxbyiKp8QmN4Vw==", + "dev": true, + "license": "BlueOak-1.0.0", + "dependencies": { + "minimatch": "^10.2.2", + "minipass": "^7.1.3", + "path-scurry": "^2.0.2" + }, + "engines": { + "node": "18 || 20 || >=22" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/ts-json-schema-generator/node_modules/minimatch": { + "version": "10.2.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.2.5.tgz", + "integrity": "sha512-MULkVLfKGYDFYejP07QOurDLLQpcjk7Fw+7jXS2R2czRQzR56yHRveU5NDJEOviH+hETZKSkIk5c+T23GjFUMg==", + "dev": true, + "license": "BlueOak-1.0.0", + "dependencies": { + "brace-expansion": "^5.0.5" + }, + "engines": { + "node": "18 || 20 || >=22" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, "node_modules/ts-node": { "version": "10.9.2", "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.9.2.tgz", diff --git a/package.json b/package.json index 812cef2..3877882 100644 --- a/package.json +++ b/package.json @@ -15,7 +15,9 @@ "build:widget": "cross-env BUILD_WIDGETS_ONLY=1 WIDGET=$npm_config_widget webpack --config webpack.config.js", "build:vendor": "cross-env BUILD_VENDOR_ONLY=1 webpack --config webpack.config.js", "test": "jest", - "test:staged": "cross-env JEST_CI_RUN=1 jest --bail --ci --silent --coverage --passWithNoTests --forceExit --findRelatedTests" + "test:staged": "cross-env JEST_CI_RUN=1 jest --bail --ci --silent --coverage --passWithNoTests --forceExit --findRelatedTests", + "generate:schemas": "node scripts/generate-schemas.mjs", + "check:schemas": "node scripts/generate-schemas.mjs --check" }, "browserslist": [ "ie 11", @@ -33,6 +35,8 @@ "@types/dompurify": "^3.0.5", "@types/jest": "^29.5.12", "@types/node": "^25.4.0", + "ajv": "^8.20.0", + "ajv-formats": "^3.0.1", "babel-jest": "^29.7.0", "babel-loader": "^9.1.3", "core-js": "^3.38.1", @@ -51,6 +55,7 @@ "postcss-syntax": "^0.36.2", "prettier": "^2.8.8", "rimraf": "^6.0.1", + "ts-json-schema-generator": "^2.9.0", "ts-node": "^10.9.2", "typescript": "^5.9.3", "webpack": "^5.94.0", diff --git a/schemas/normalized-state.schema.json b/schemas/normalized-state.schema.json new file mode 100644 index 0000000..69be98e --- /dev/null +++ b/schemas/normalized-state.schema.json @@ -0,0 +1,1910 @@ +{ + "$id": "refrens://ceres/schemas/normalized-state.schema.json", + "$schema": "http://json-schema.org/draft-07/schema#", + "definitions": { + "AdditionalCharge": { + "properties": { + "_id": { + "type": "string" + }, + "amount": { + "type": "number" + }, + "amountType": { + "type": "string" + }, + "cgst": { + "type": "number" + }, + "hsn": { + "type": "string" + }, + "igst": { + "type": "number" + }, + "label": { + "type": "string" + }, + "multiplier": { + "type": "number" + }, + "name": { + "type": "string" + }, + "sgst": { + "type": "number" + }, + "tax": { + "type": "number" + }, + "taxAmount": { + "type": "number" + }, + "utgst": { + "type": "number" + } + }, + "required": [ + "_id", + "amount" + ], + "type": "object" + }, + "BankDetails": { + "properties": { + "accountHolderName": { + "type": "string" + }, + "accountNo": { + "type": "string" + }, + "accountNumber": { + "type": "string" + }, + "accountType": { + "type": "string" + }, + "bank": { + "type": "string" + }, + "bankName": { + "type": "string" + }, + "branch": { + "type": "string" + }, + "country": { + "type": "string" + }, + "customFields": { + "items": { + "$ref": "#/definitions/CustomFieldValue" + }, + "type": "array" + }, + "customLabels": { + "additionalProperties": { + "type": "string" + }, + "type": "object" + }, + "iban": { + "type": "string" + }, + "ifsc": { + "type": "string" + }, + "ifscCode": { + "type": "string" + }, + "name": { + "type": "string" + }, + "sortCode": { + "type": "string" + }, + "swift": { + "type": "string" + }, + "swiftCode": { + "type": "string" + } + }, + "type": "object" + }, + "BillerDetails": { + "properties": { + "additionalIds": { + "items": { + "properties": { + "_id": { + "type": "string" + }, + "label": { + "type": "string" + }, + "showInInvoice": { + "type": "boolean" + }, + "value": { + "type": "string" + } + }, + "required": [ + "label", + "value" + ], + "type": "object" + }, + "type": "array" + }, + "address": { + "type": "string" + }, + "building": { + "type": "string" + }, + "city": { + "type": "string" + }, + "country": { + "type": "string" + }, + "customFields": { + "items": { + "properties": { + "label": { + "type": "string" + }, + "params": { + "properties": { + "showInInvoice": { + "type": "boolean" + } + }, + "type": "object" + }, + "value": { + "type": "string" + } + }, + "required": [ + "label", + "value" + ], + "type": "object" + }, + "type": "array" + }, + "customHeaders": { + "items": { + "properties": { + "label": { + "type": "string" + }, + "value": { + "type": "string" + } + }, + "required": [ + "label", + "value" + ], + "type": "object" + }, + "type": "array" + }, + "district": { + "type": "string" + }, + "email": { + "type": "string" + }, + "emailShowInInvoice": { + "type": "boolean" + }, + "fieldVisibility": { + "additionalProperties": { + "type": "boolean" + }, + "type": "object" + }, + "gstState": { + "type": "string" + }, + "gstin": { + "type": "string" + }, + "logo": { + "type": "string" + }, + "name": { + "type": "string" + }, + "panNumber": { + "type": "string" + }, + "phone": { + "type": "string" + }, + "phoneShowInInvoice": { + "type": "boolean" + }, + "pincode": { + "type": "string" + }, + "sstNumber": { + "type": "string" + }, + "state": { + "type": "string" + }, + "stateCode": { + "type": "string" + }, + "street": { + "type": "string" + }, + "tinNumber": { + "type": "string" + }, + "trnNumber": { + "type": "string" + }, + "vatLabel": { + "type": "string" + }, + "vatNumber": { + "type": "string" + }, + "zipCode": { + "type": "string" + } + }, + "required": [ + "name" + ], + "type": "object" + }, + "BusinessData": { + "properties": { + "_id": { + "type": "string" + }, + "_systemMeta": { + "properties": { + "indexedFieldsEnabled": { + "type": "boolean" + }, + "showExtraIndexedField": { + "type": "boolean" + } + }, + "type": "object" + }, + "configuration": { + "properties": { + "einvoice": {}, + "eway": {}, + "indexedCustomFields": {}, + "units": {} + }, + "type": "object" + }, + "country": { + "type": "string" + }, + "name": { + "type": "string" + } + }, + "required": [ + "_id" + ], + "type": "object" + }, + "CessCharge": { + "properties": { + "_id": { + "type": "string" + }, + "amount": { + "type": "number" + }, + "cessAmountKey": { + "type": "string" + }, + "cessKey": { + "type": "string" + }, + "cessName": { + "type": "string" + }, + "isApplied": { + "type": "boolean" + }, + "name": { + "type": "string" + } + }, + "required": [ + "_id" + ], + "type": "object" + }, + "ColumnDef": { + "properties": { + "dataType": { + "type": "string" + }, + "fxReturnType": { + "type": "string" + }, + "isHidden": { + "type": "boolean" + }, + "key": { + "type": "string" + }, + "label": { + "type": "string" + }, + "summarise": { + "type": "boolean" + } + }, + "required": [ + "key", + "label" + ], + "type": "object" + }, + "CustomFieldValue": { + "properties": { + "_id": { + "type": "string" + }, + "dataType": { + "type": "string" + }, + "label": { + "type": "string" + }, + "name": { + "type": "string" + }, + "params": { + "properties": { + "currency": { + "type": "string" + }, + "showInInvoice": { + "type": "boolean" + } + }, + "type": "object" + }, + "value": {} + }, + "required": [ + "label", + "value", + "dataType" + ], + "type": "object" + }, + "DocumentBatchSummaryEntry": { + "properties": { + "batch": { + "type": "object" + }, + "inventory": { + "type": "string" + }, + "itemName": { + "type": "string" + }, + "quantity": { + "type": "number" + }, + "sku": { + "type": "string" + }, + "warehouse": { + "type": "string" + }, + "warehouseName": { + "type": "string" + } + }, + "type": "object" + }, + "EinvoiceConfig": { + "properties": { + "irnAcknowledgementDate": { + "type": "boolean" + }, + "irnAcknowledgementNumber": { + "type": "boolean" + }, + "irnCancelledDate": { + "type": "boolean" + }, + "irnNumber": { + "type": "boolean" + } + }, + "type": "object" + }, + "EwayConfig": { + "properties": { + "billCancelledDate": { + "type": "boolean" + }, + "billDate": { + "type": "boolean" + }, + "billNumber": { + "type": "boolean" + }, + "billValidTillDate": { + "type": "boolean" + } + }, + "type": "object" + }, + "FlattenedInvoicePayload": { + "properties": { + "_id": { + "type": "string" + }, + "additionalCharges": { + "items": { + "$ref": "#/definitions/AdditionalCharge" + }, + "type": "array" + }, + "advanceOptions": { + "$ref": "#/definitions/InvoiceAdvanceOptions" + }, + "allPayments": { + "items": { + "$ref": "#/definitions/Payment" + }, + "type": "array" + }, + "attachments": { + "items": { + "type": "string" + }, + "type": "array" + }, + "balance": { + "properties": { + "credit": { + "type": [ + "number", + "string" + ] + }, + "due": { + "type": [ + "number", + "string" + ] + }, + "paid": { + "type": [ + "number", + "string" + ] + }, + "settledAmount": { + "type": [ + "number", + "string" + ] + }, + "tds": { + "type": [ + "number", + "string" + ] + }, + "transactionCharge": { + "type": [ + "number", + "string" + ] + } + }, + "type": "object" + }, + "bankAccount": { + "$ref": "#/definitions/BankDetails" + }, + "batchSummary": { + "items": { + "$ref": "#/definitions/DocumentBatchSummaryEntry" + }, + "type": "array" + }, + "beforeDiscountPay": { + "anyOf": [ + { + "type": "number" + }, + { + "properties": { + "full": { + "type": "number" + } + }, + "required": [ + "full" + ], + "type": "object" + } + ] + }, + "billType": { + "type": "string" + }, + "billedBy": { + "$ref": "#/definitions/BillerDetails" + }, + "billedTo": { + "$ref": "#/definitions/BillerDetails" + }, + "business": { + "$ref": "#/definitions/BusinessData" + }, + "businessCurrency": { + "type": "string" + }, + "businessLocale": { + "type": "string" + }, + "businessTimeZone": { + "type": "string" + }, + "cesses": { + "items": { + "$ref": "#/definitions/CessCharge" + }, + "type": "array" + }, + "cgst": { + "type": "number" + }, + "columns": { + "items": { + "$ref": "#/definitions/ColumnDef" + }, + "type": "array" + }, + "contact": { + "properties": { + "email": { + "type": "string" + }, + "phone": { + "type": "string" + } + }, + "type": "object" + }, + "copy": { + "type": "string" + }, + "creditDiscount": { + "type": "number" + }, + "creditNoteStatus": { + "type": "string" + }, + "currency": { + "type": "string" + }, + "customCurrencySymbol": { + "type": "string" + }, + "customFields": { + "items": { + "$ref": "#/definitions/CustomFieldValue" + }, + "type": "array" + }, + "customFooters": { + "items": { + "properties": { + "defaultValue": { + "type": "string" + }, + "label": { + "type": "string" + }, + "value": { + "type": "string" + } + }, + "required": [ + "label", + "value" + ], + "type": "object" + }, + "type": "array" + }, + "customHeaders": { + "items": { + "properties": { + "label": { + "type": "string" + }, + "value": { + "type": "string" + } + }, + "required": [ + "label", + "value" + ], + "type": "object" + }, + "type": "array" + }, + "customLabels": { + "additionalProperties": { + "type": "string" + }, + "type": "object" + }, + "defaultBatchColumns": { + "items": { + "properties": { + "isHidden": { + "type": "boolean" + }, + "key": { + "type": "string" + }, + "label": { + "type": "string" + }, + "system": { + "type": "boolean" + } + }, + "required": [ + "key", + "label" + ], + "type": "object" + }, + "type": "array" + }, + "discount": { + "type": "number" + }, + "documentQr": { + "type": "string" + }, + "documentReason": { + "type": "string" + }, + "dueDate": { + "anyOf": [ + { + "type": "string" + }, + { + "format": "date-time", + "type": "string" + } + ] + }, + "earlyPayDiscount": { + "properties": { + "applied": { + "type": "boolean" + }, + "enabled": { + "type": "boolean" + }, + "totals": { + "type": "object" + } + }, + "type": "object" + }, + "einvoiceConfig": { + "$ref": "#/definitions/EinvoiceConfig" + }, + "ewayConfig": { + "$ref": "#/definitions/EwayConfig" + }, + "expenseNumber": { + "type": "string" + }, + "finalTotal": { + "type": "object" + }, + "footers": { + "items": { + "properties": { + "_id": { + "type": "string" + }, + "label": { + "type": "string" + }, + "value": { + "type": "string" + } + }, + "required": [ + "_id", + "label", + "value" + ], + "type": "object" + }, + "type": "array" + }, + "hasPgPayments": { + "type": "boolean" + }, + "hideEarlyPay": { + "type": "boolean" + }, + "hideHashInDocumentNumber": { + "type": "boolean" + }, + "hsnSummary": { + "anyOf": [ + { + "$ref": "#/definitions/HsnSummary" + }, + { + "items": { + "$ref": "#/definitions/HsnSummary" + }, + "type": "array" + } + ] + }, + "igst": { + "type": "number" + }, + "invoiceAccepted": { + "type": "string" + }, + "invoiceDate": { + "anyOf": [ + { + "type": "string" + }, + { + "format": "date-time", + "type": "string" + } + ] + }, + "invoiceDateUserInput": { + "type": "string" + }, + "invoiceNumber": { + "type": "string" + }, + "invoiceSubTitle": { + "type": "string" + }, + "invoiceTitle": { + "type": "string" + }, + "invoiceType": { + "type": "string" + }, + "invoiceValueProps": { + "additionalProperties": { + "properties": { + "visible": { + "type": "boolean" + } + }, + "required": [ + "visible" + ], + "type": "object" + }, + "type": "object" + }, + "irn": { + "$ref": "#/definitions/IrnDetails" + }, + "irnPosition": { + "type": "string" + }, + "isBusinessUser": { + "type": "boolean" + }, + "isDescriptionFullWidth": { + "type": "boolean" + }, + "isEarlyPayApplicable": { + "type": "boolean" + }, + "isExpenditure": { + "type": "boolean" + }, + "isIgst": { + "type": "boolean" + }, + "isOverdue": { + "type": "boolean" + }, + "isPublicView": { + "type": "boolean" + }, + "isRemoved": { + "type": "boolean" + }, + "isUtgst": { + "type": "boolean" + }, + "items": { + "items": { + "$ref": "#/definitions/LineItem" + }, + "type": "array" + }, + "lastPaymentDate": { + "anyOf": [ + { + "type": "string" + }, + { + "format": "date-time", + "type": "string" + } + ] + }, + "latePaymentFee": { + "properties": { + "enabled": { + "type": "boolean" + }, + "finalAmount": { + "type": "number" + }, + "isApplied": { + "type": "boolean" + }, + "showInInvoice": { + "type": "boolean" + }, + "when": { + "type": "number" + } + }, + "type": "object" + }, + "letterHead": { + "type": "string" + }, + "letterHeadFooter": { + "type": "string" + }, + "lhdnQrCode": { + "type": "string" + }, + "linkedInvoices": { + "items": {}, + "type": "array" + }, + "notes": { + "type": "string" + }, + "owner": { + "$ref": "#/definitions/BusinessData" + }, + "ownerBusiness": { + "$ref": "#/definitions/BusinessData" + }, + "ownerOffset": { + "type": "string" + }, + "ownerTimeZone": { + "type": "string" + }, + "payUrl": { + "type": "string" + }, + "paymentOptions": { + "$ref": "#/definitions/InvoicePaymentOptions" + }, + "payments": { + "items": { + "$ref": "#/definitions/Payment" + }, + "type": "array" + }, + "pdfOptions": { + "$ref": "#/definitions/InvoicePdfOptions" + }, + "placeOfSupply": { + "type": "string" + }, + "pos": { + "type": "string" + }, + "purchaseOrderNumber": { + "type": "string" + }, + "qrCode": { + "type": "string" + }, + "query": { + "additionalProperties": { + "type": "string" + }, + "type": "object" + }, + "quotationNumber": { + "type": "string" + }, + "reminders": { + "properties": { + "sent": { + "type": "boolean" + } + }, + "type": "object" + }, + "roundOffQuantity": { + "type": "boolean" + }, + "roundOffRate": { + "type": "boolean" + }, + "sgst": { + "type": "number" + }, + "share": { + "properties": { + "fileName": { + "type": "string" + }, + "link": { + "type": "string" + }, + "name": { + "type": "string" + }, + "pdf": { + "type": "string" + }, + "printLabels": { + "items": { + "properties": { + "label": { + "type": "string" + }, + "pdf": { + "type": "string" + } + }, + "required": [ + "label", + "pdf" + ], + "type": "object" + }, + "type": "array" + } + }, + "type": "object" + }, + "sharedDocumentId": { + "type": "string" + }, + "shippedFrom": { + "$ref": "#/definitions/BillerDetails" + }, + "shippedTo": { + "$ref": "#/definitions/BillerDetails" + }, + "showBankAccount": { + "type": "boolean" + }, + "showBranding": { + "type": "boolean" + }, + "showExpenseNumber": { + "type": "boolean" + }, + "showItemNameFullWidth": { + "type": "boolean" + }, + "showPaymentsTable": { + "type": "boolean" + }, + "showStockSummary": { + "type": "boolean" + }, + "showTotalsRow": { + "type": "boolean" + }, + "showUpi": { + "type": "boolean" + }, + "showVendorBankAccount": { + "type": "boolean" + }, + "signature": { + "type": "string" + }, + "status": { + "type": "string" + }, + "store": { + "properties": { + "asideCollapsed": { + "type": "boolean" + } + }, + "required": [ + "asideCollapsed" + ], + "type": "object" + }, + "subTotal": { + "type": "number" + }, + "subUnitLength": { + "type": "number" + }, + "taxName": { + "type": "string" + }, + "taxSummary": { + "anyOf": [ + { + "$ref": "#/definitions/TaxSummary" + }, + { + "items": { + "$ref": "#/definitions/TaxSummary" + }, + "type": "array" + } + ] + }, + "taxType": { + "type": "string" + }, + "template": { + "$ref": "#/definitions/InvoiceTemplateConfig" + }, + "templateName": { + "type": "string" + }, + "terms": { + "items": { + "properties": { + "label": { + "type": "string" + }, + "terms": { + "items": { + "type": "string" + }, + "type": "array" + } + }, + "required": [ + "label", + "terms" + ], + "type": "object" + }, + "type": "array" + }, + "toPay": { + "anyOf": [ + { + "type": "number" + }, + { + "properties": { + "full": { + "type": "number" + } + }, + "required": [ + "full" + ], + "type": "object" + } + ] + }, + "totalConversions": { + "type": "object" + }, + "totals": { + "type": "object" + }, + "transportDetails": { + "$ref": "#/definitions/TransportDetails" + }, + "upi": { + "$ref": "#/definitions/UpiDetails" + }, + "utgst": { + "type": "number" + }, + "vendorFields": { + "type": "object" + }, + "zatcaQrCode": { + "type": "string" + } + }, + "required": [ + "_id", + "billType", + "currency", + "finalTotal", + "invoiceNumber", + "status", + "subTotal" + ], + "type": "object" + }, + "HsnSummary": { + "properties": { + "cessAmount": { + "type": "number" + }, + "cgst": { + "type": "number" + }, + "hsn": { + "type": "string" + }, + "igst": { + "type": "number" + }, + "sgst": { + "type": "number" + }, + "tax": { + "type": "number" + }, + "taxableValue": { + "type": "number" + }, + "utgst": { + "type": "number" + } + }, + "required": [ + "cgst", + "hsn", + "igst", + "sgst", + "tax", + "taxableValue", + "utgst" + ], + "type": "object" + }, + "InvoiceAdvanceOptions": { + "additionalProperties": {}, + "properties": { + "hideCountryOfSupply": { + "type": "boolean" + }, + "hideCurrencyCode": { + "type": "boolean" + }, + "hideGroupSubTotal": { + "type": "boolean" + }, + "hideTaxes": { + "type": "boolean" + }, + "hideTotals": { + "type": "boolean" + }, + "hsnView": { + "type": "string" + }, + "isDescriptionFullWidth": { + "type": "boolean" + }, + "itemNameFullWidth": { + "type": "boolean" + }, + "reverseCharge": { + "type": "boolean" + }, + "showHSNSummaryInInvoice": { + "type": "boolean" + }, + "showHsnSummary": { + "type": "boolean" + }, + "showPaymentsTable": { + "type": "boolean" + }, + "showSkuInInvoice": { + "type": "boolean" + }, + "showStockSummary": { + "type": "boolean" + }, + "showThumbnailAsColumn": { + "type": "boolean" + }, + "taxSummaryView": { + "type": "string" + }, + "unitColumn": { + "type": "string" + } + }, + "type": "object" + }, + "InvoicePaymentOptions": { + "additionalProperties": {}, + "properties": { + "accountTransfer": { + "type": "boolean" + }, + "upi": { + "type": "boolean" + }, + "vendorAccountTransfer": { + "type": "boolean" + } + }, + "type": "object" + }, + "InvoicePdfOptions": { + "additionalProperties": {}, + "properties": { + "footerOnLastPage": { + "type": "boolean" + }, + "letterHeadOnFirstPage": { + "type": "boolean" + } + }, + "type": "object" + }, + "InvoiceTemplateColumn": { + "properties": { + "className": { + "type": "string" + }, + "dataType": { + "type": "string" + }, + "fxReturnType": { + "type": "string" + }, + "isHidden": { + "type": "boolean" + }, + "key": { + "type": "string" + }, + "label": { + "type": "string" + }, + "summarise": { + "type": "boolean" + } + }, + "required": [ + "key", + "label", + "className", + "isHidden", + "dataType", + "fxReturnType", + "summarise" + ], + "type": "object" + }, + "InvoiceTemplateConfig": { + "additionalProperties": {}, + "properties": { + "parentTemplate": { + "type": "string" + }, + "pdfOptions": { + "$ref": "#/definitions/InvoicePdfOptions" + }, + "template": { + "type": "string" + }, + "upiShrink": { + "type": "boolean" + } + }, + "type": "object" + }, + "InvoiceTemplateDerivedState": { + "properties": { + "showClassificationColumn": { + "type": "boolean" + }, + "showHsnColumn": { + "type": "boolean" + }, + "showInlineClassification": { + "type": "boolean" + }, + "showInlineHsn": { + "type": "boolean" + }, + "showSkuInName": { + "type": "boolean" + }, + "showUnitInName": { + "type": "boolean" + } + }, + "required": [ + "showHsnColumn", + "showClassificationColumn", + "showInlineHsn", + "showInlineClassification", + "showSkuInName", + "showUnitInName" + ], + "type": "object" + }, + "InvoiceTemplateMappedState": { + "properties": { + "columns": { + "items": { + "$ref": "#/definitions/InvoiceTemplateColumn" + }, + "type": "array" + }, + "irn": { + "properties": { + "isCancelled": { + "type": "boolean" + } + }, + "required": [ + "isCancelled" + ], + "type": "object" + }, + "qr": { + "properties": { + "top": { + "type": "string" + }, + "upi": { + "type": "string" + } + }, + "required": [ + "top", + "upi" + ], + "type": "object" + }, + "upi": { + "properties": { + "id": { + "type": "string" + } + }, + "required": [ + "id" + ], + "type": "object" + }, + "visibility": { + "$ref": "#/definitions/InvoiceTemplateVisibility" + } + }, + "required": [ + "qr", + "upi", + "columns", + "irn", + "visibility" + ], + "type": "object" + }, + "InvoiceTemplateVisibility": { + "properties": { + "contactStrip": { + "type": "boolean" + }, + "footerOnLastPage": { + "type": "boolean" + }, + "isDescriptionFullWidth": { + "type": "boolean" + }, + "isUtgst": { + "type": "boolean" + }, + "itemNameFullWidth": { + "type": "boolean" + }, + "letterHeadOnFirstPage": { + "type": "boolean" + }, + "shippedFrom": { + "type": "boolean" + }, + "shippedTo": { + "type": "boolean" + }, + "showBankAccount": { + "type": "boolean" + }, + "showBankUpiSection": { + "type": "boolean" + }, + "showCgstSgst": { + "type": "boolean" + }, + "showHsn": { + "type": "boolean" + }, + "showHsnSummary": { + "type": "boolean" + }, + "showIgst": { + "type": "boolean" + }, + "showInlineClassification": { + "type": "boolean" + }, + "showInlineHsn": { + "type": "boolean" + }, + "showLogistics": { + "type": "boolean" + }, + "showSku": { + "type": "boolean" + }, + "showSkuInName": { + "type": "boolean" + }, + "showStatusTagInPrint": { + "type": "boolean" + }, + "showSummaryCess": { + "type": "boolean" + }, + "showTaxTable": { + "type": "boolean" + }, + "showThumbnailAsColumn": { + "type": "boolean" + }, + "showUnitInName": { + "type": "boolean" + }, + "showUpi": { + "type": "boolean" + }, + "singleLogistics": { + "type": "boolean" + }, + "transport": { + "type": "boolean" + }, + "upiShrink": { + "type": "boolean" + }, + "visibleColumnCount": { + "type": "number" + } + }, + "required": [ + "shippedTo", + "shippedFrom", + "transport", + "showLogistics", + "singleLogistics", + "showBankAccount", + "showUpi", + "showBankUpiSection", + "contactStrip", + "showIgst", + "showCgstSgst", + "isUtgst", + "showTaxTable", + "showHsnSummary", + "showSummaryCess", + "showSku", + "showHsn", + "showThumbnailAsColumn", + "showInlineHsn", + "showInlineClassification", + "showSkuInName", + "showUnitInName", + "upiShrink", + "letterHeadOnFirstPage", + "footerOnLastPage", + "itemNameFullWidth", + "isDescriptionFullWidth", + "showStatusTagInPrint", + "visibleColumnCount" + ], + "type": "object" + }, + "IrnDetails": { + "properties": { + "AckDt": { + "type": "string" + }, + "AckNo": { + "type": "string" + }, + "CancelDate": { + "type": "string" + }, + "EwbDt": { + "type": "string" + }, + "EwbNo": { + "type": "string" + }, + "EwbValidTill": { + "type": "string" + }, + "Irn": { + "type": "string" + }, + "ewayCancelDate": { + "type": "string" + }, + "qrCode": { + "type": "string" + } + }, + "type": "object" + }, + "LineItem": { + "properties": { + "_id": { + "type": "string" + }, + "amount": { + "type": "number" + }, + "batchSummary": { + "items": { + "properties": { + "_id": { + "type": "string" + }, + "batchName": { + "type": "string" + }, + "expiryDate": { + "type": "string" + }, + "itemName": { + "type": "string" + }, + "manufacturingDate": { + "type": "string" + }, + "quantity": { + "type": "number" + }, + "warehouse": { + "type": "string" + }, + "warehouseName": { + "type": "string" + } + }, + "required": [ + "quantity" + ], + "type": "object" + }, + "type": "array" + }, + "cessAmount": { + "type": "number" + }, + "cgst": { + "type": "number" + }, + "classification": { + "type": "string" + }, + "custom": { + "type": "object" + }, + "customFields": { + "items": { + "$ref": "#/definitions/CustomFieldValue" + }, + "type": "array" + }, + "description": { + "type": "string" + }, + "discount": { + "type": "number" + }, + "group": { + "type": "boolean" + }, + "gstRate": { + "type": [ + "number", + "string" + ] + }, + "hsn": { + "type": "string" + }, + "igst": { + "type": "number" + }, + "images": { + "items": { + "type": "string" + }, + "type": "array" + }, + "inventoryTxn": { + "type": "string" + }, + "isAdditionalCharge": { + "type": "boolean" + }, + "isGroupItemTotalRow": { + "type": "boolean" + }, + "name": { + "type": "string" + }, + "originalImages": { + "items": { + "type": "string" + }, + "type": "array" + }, + "quantity": { + "type": "number" + }, + "rate": { + "type": "number" + }, + "sgst": { + "type": "number" + }, + "showSku": { + "type": "boolean" + }, + "sku": { + "type": "string" + }, + "subTotal": { + "type": "number" + }, + "tax": { + "type": "number" + }, + "taxAmount": { + "type": "number" + }, + "taxRate": { + "type": [ + "number", + "string" + ] + }, + "thumbnail": { + "type": "string" + }, + "unit": { + "type": "string" + }, + "utgst": { + "type": "number" + } + }, + "required": [ + "_id", + "name", + "quantity", + "rate", + "amount" + ], + "type": "object" + }, + "NormalizedInvoiceTemplateState": { + "properties": { + "advanceOptions": { + "additionalProperties": {}, + "type": "object" + }, + "derived": { + "$ref": "#/definitions/InvoiceTemplateDerivedState" + }, + "invoice": { + "$ref": "#/definitions/FlattenedInvoicePayload" + }, + "mapped": { + "$ref": "#/definitions/InvoiceTemplateMappedState" + }, + "pdfOptions": { + "additionalProperties": {}, + "type": "object" + } + }, + "required": [ + "invoice", + "advanceOptions", + "pdfOptions", + "mapped", + "derived" + ], + "type": "object" + }, + "Payment": { + "properties": { + "amount": { + "type": [ + "number", + "string" + ] + }, + "createdAt": { + "type": "string" + }, + "date": { + "type": "string" + }, + "method": { + "type": "string" + }, + "mode": { + "type": "string" + }, + "paymentDate": { + "type": "string" + }, + "paymentMethod": { + "type": "string" + }, + "status": { + "type": "string" + } + }, + "type": "object" + }, + "TaxSummary": { + "properties": { + "cessAmount": { + "type": "number" + }, + "cgst": { + "type": "number" + }, + "igst": { + "type": "number" + }, + "sgst": { + "type": "number" + }, + "tax": { + "type": "number" + }, + "taxableValue": { + "type": "number" + }, + "utgst": { + "type": "number" + } + }, + "required": [ + "tax", + "taxableValue", + "cgst", + "sgst", + "igst", + "utgst" + ], + "type": "object" + }, + "TransportDetails": { + "properties": { + "challanDate": { + "type": "string" + }, + "challanNumber": { + "type": "string" + }, + "distance": { + "type": [ + "number", + "string" + ] + }, + "extraInformation": { + "type": "string" + }, + "subSupplyType": { + "type": "string" + }, + "transactionType": { + "type": "string" + }, + "transport": { + "type": "string" + }, + "transportMode": { + "type": "string" + }, + "transporter": { + "properties": { + "name": { + "type": "string" + }, + "transporterId": { + "type": "string" + } + }, + "type": "object" + }, + "transporterId": { + "type": "string" + }, + "transporterName": { + "type": "string" + }, + "vehicleNumber": { + "type": "string" + }, + "vehicleType": { + "type": "string" + } + }, + "type": "object" + }, + "UpiDetails": { + "properties": { + "qr": { + "type": "string" + }, + "qrCode": { + "type": "string" + }, + "upi": { + "type": "string" + }, + "upiId": { + "type": "string" + }, + "vpa": { + "type": "string" + } + }, + "type": "object" + } + } +} diff --git a/schemas/payload.schema.json b/schemas/payload.schema.json new file mode 100644 index 0000000..4886dc1 --- /dev/null +++ b/schemas/payload.schema.json @@ -0,0 +1,2358 @@ +{ + "$id": "refrens://ceres/schemas/payload.schema.json", + "$schema": "http://json-schema.org/draft-07/schema#", + "definitions": { + "AdditionalCharge": { + "properties": { + "_id": { + "type": "string" + }, + "amount": { + "type": "number" + }, + "amountType": { + "type": "string" + }, + "cgst": { + "type": "number" + }, + "hsn": { + "type": "string" + }, + "igst": { + "type": "number" + }, + "label": { + "type": "string" + }, + "multiplier": { + "type": "number" + }, + "name": { + "type": "string" + }, + "sgst": { + "type": "number" + }, + "tax": { + "type": "number" + }, + "taxAmount": { + "type": "number" + }, + "utgst": { + "type": "number" + } + }, + "required": [ + "_id", + "amount" + ], + "type": "object" + }, + "BankDetails": { + "properties": { + "accountHolderName": { + "type": "string" + }, + "accountNo": { + "type": "string" + }, + "accountNumber": { + "type": "string" + }, + "accountType": { + "type": "string" + }, + "bank": { + "type": "string" + }, + "bankName": { + "type": "string" + }, + "branch": { + "type": "string" + }, + "country": { + "type": "string" + }, + "customFields": { + "items": { + "$ref": "#/definitions/CustomFieldValue" + }, + "type": "array" + }, + "customLabels": { + "additionalProperties": { + "type": "string" + }, + "type": "object" + }, + "iban": { + "type": "string" + }, + "ifsc": { + "type": "string" + }, + "ifscCode": { + "type": "string" + }, + "name": { + "type": "string" + }, + "sortCode": { + "type": "string" + }, + "swift": { + "type": "string" + }, + "swiftCode": { + "type": "string" + } + }, + "type": "object" + }, + "BillerDetails": { + "properties": { + "additionalIds": { + "items": { + "properties": { + "_id": { + "type": "string" + }, + "label": { + "type": "string" + }, + "showInInvoice": { + "type": "boolean" + }, + "value": { + "type": "string" + } + }, + "required": [ + "label", + "value" + ], + "type": "object" + }, + "type": "array" + }, + "address": { + "type": "string" + }, + "building": { + "type": "string" + }, + "city": { + "type": "string" + }, + "country": { + "type": "string" + }, + "customFields": { + "items": { + "properties": { + "label": { + "type": "string" + }, + "params": { + "properties": { + "showInInvoice": { + "type": "boolean" + } + }, + "type": "object" + }, + "value": { + "type": "string" + } + }, + "required": [ + "label", + "value" + ], + "type": "object" + }, + "type": "array" + }, + "customHeaders": { + "items": { + "properties": { + "label": { + "type": "string" + }, + "value": { + "type": "string" + } + }, + "required": [ + "label", + "value" + ], + "type": "object" + }, + "type": "array" + }, + "district": { + "type": "string" + }, + "email": { + "type": "string" + }, + "emailShowInInvoice": { + "type": "boolean" + }, + "fieldVisibility": { + "additionalProperties": { + "type": "boolean" + }, + "type": "object" + }, + "gstState": { + "type": "string" + }, + "gstin": { + "type": "string" + }, + "logo": { + "type": "string" + }, + "name": { + "type": "string" + }, + "panNumber": { + "type": "string" + }, + "phone": { + "type": "string" + }, + "phoneShowInInvoice": { + "type": "boolean" + }, + "pincode": { + "type": "string" + }, + "sstNumber": { + "type": "string" + }, + "state": { + "type": "string" + }, + "stateCode": { + "type": "string" + }, + "street": { + "type": "string" + }, + "tinNumber": { + "type": "string" + }, + "trnNumber": { + "type": "string" + }, + "vatLabel": { + "type": "string" + }, + "vatNumber": { + "type": "string" + }, + "zipCode": { + "type": "string" + } + }, + "required": [ + "name" + ], + "type": "object" + }, + "BusinessData": { + "properties": { + "_id": { + "type": "string" + }, + "_systemMeta": { + "properties": { + "indexedFieldsEnabled": { + "type": "boolean" + }, + "showExtraIndexedField": { + "type": "boolean" + } + }, + "type": "object" + }, + "configuration": { + "properties": { + "einvoice": {}, + "eway": {}, + "indexedCustomFields": {}, + "units": {} + }, + "type": "object" + }, + "country": { + "type": "string" + }, + "name": { + "type": "string" + } + }, + "required": [ + "_id" + ], + "type": "object" + }, + "CeresTemplatePayload": { + "properties": { + "business": { + "$ref": "#/definitions/BusinessData" + }, + "businessCurrency": { + "type": "string" + }, + "businessLocale": { + "type": "string" + }, + "businessTimeZone": { + "type": "string" + }, + "copy": { + "type": "string" + }, + "defaultBatchColumns": { + "items": { + "properties": { + "isHidden": { + "type": "boolean" + }, + "key": { + "type": "string" + }, + "label": { + "type": "string" + }, + "system": { + "type": "boolean" + } + }, + "required": [ + "key", + "label" + ], + "type": "object" + }, + "type": "array" + }, + "einvoiceConfig": { + "$ref": "#/definitions/EinvoiceConfig" + }, + "ewayConfig": { + "$ref": "#/definitions/EwayConfig" + }, + "hideEarlyPay": { + "type": "boolean" + }, + "hideHashInDocumentNumber": { + "type": "boolean" + }, + "invoice": { + "$ref": "#/definitions/InvoiceData" + }, + "invoiceValueProps": { + "additionalProperties": { + "properties": { + "visible": { + "type": "boolean" + } + }, + "required": [ + "visible" + ], + "type": "object" + }, + "type": "object" + }, + "irnPosition": { + "type": "string" + }, + "isBusinessUser": { + "type": "boolean" + }, + "isDescriptionFullWidth": { + "type": "boolean" + }, + "isEarlyPayApplicable": { + "type": "boolean" + }, + "isPublicView": { + "type": "boolean" + }, + "ownerBusiness": { + "$ref": "#/definitions/BusinessData" + }, + "ownerTimeZone": { + "type": "string" + }, + "payUrl": { + "type": "string" + }, + "query": { + "additionalProperties": { + "type": "string" + }, + "type": "object" + }, + "showBankAccount": { + "type": "boolean" + }, + "showExpenseNumber": { + "type": "boolean" + }, + "showItemNameFullWidth": { + "type": "boolean" + }, + "showPaymentsTable": { + "type": "boolean" + }, + "showStockSummary": { + "type": "boolean" + }, + "showUpi": { + "type": "boolean" + }, + "showVendorBankAccount": { + "type": "boolean" + }, + "store": { + "properties": { + "asideCollapsed": { + "type": "boolean" + } + }, + "required": [ + "asideCollapsed" + ], + "type": "object" + }, + "template": { + "type": "string" + } + }, + "required": [ + "invoice", + "ownerBusiness" + ], + "type": "object" + }, + "CessCharge": { + "properties": { + "_id": { + "type": "string" + }, + "amount": { + "type": "number" + }, + "cessAmountKey": { + "type": "string" + }, + "cessKey": { + "type": "string" + }, + "cessName": { + "type": "string" + }, + "isApplied": { + "type": "boolean" + }, + "name": { + "type": "string" + } + }, + "required": [ + "_id" + ], + "type": "object" + }, + "ColumnDef": { + "properties": { + "dataType": { + "type": "string" + }, + "fxReturnType": { + "type": "string" + }, + "isHidden": { + "type": "boolean" + }, + "key": { + "type": "string" + }, + "label": { + "type": "string" + }, + "summarise": { + "type": "boolean" + } + }, + "required": [ + "key", + "label" + ], + "type": "object" + }, + "CustomFieldValue": { + "properties": { + "_id": { + "type": "string" + }, + "dataType": { + "type": "string" + }, + "label": { + "type": "string" + }, + "name": { + "type": "string" + }, + "params": { + "properties": { + "currency": { + "type": "string" + }, + "showInInvoice": { + "type": "boolean" + } + }, + "type": "object" + }, + "value": {} + }, + "required": [ + "label", + "value", + "dataType" + ], + "type": "object" + }, + "DocumentBatchSummaryEntry": { + "properties": { + "batch": { + "type": "object" + }, + "inventory": { + "type": "string" + }, + "itemName": { + "type": "string" + }, + "quantity": { + "type": "number" + }, + "sku": { + "type": "string" + }, + "warehouse": { + "type": "string" + }, + "warehouseName": { + "type": "string" + } + }, + "type": "object" + }, + "EinvoiceConfig": { + "properties": { + "irnAcknowledgementDate": { + "type": "boolean" + }, + "irnAcknowledgementNumber": { + "type": "boolean" + }, + "irnCancelledDate": { + "type": "boolean" + }, + "irnNumber": { + "type": "boolean" + } + }, + "type": "object" + }, + "EwayConfig": { + "properties": { + "billCancelledDate": { + "type": "boolean" + }, + "billDate": { + "type": "boolean" + }, + "billNumber": { + "type": "boolean" + }, + "billValidTillDate": { + "type": "boolean" + } + }, + "type": "object" + }, + "FlattenedInvoicePayload": { + "properties": { + "_id": { + "type": "string" + }, + "additionalCharges": { + "items": { + "$ref": "#/definitions/AdditionalCharge" + }, + "type": "array" + }, + "advanceOptions": { + "$ref": "#/definitions/InvoiceAdvanceOptions" + }, + "allPayments": { + "items": { + "$ref": "#/definitions/Payment" + }, + "type": "array" + }, + "attachments": { + "items": { + "type": "string" + }, + "type": "array" + }, + "balance": { + "properties": { + "credit": { + "type": [ + "number", + "string" + ] + }, + "due": { + "type": [ + "number", + "string" + ] + }, + "paid": { + "type": [ + "number", + "string" + ] + }, + "settledAmount": { + "type": [ + "number", + "string" + ] + }, + "tds": { + "type": [ + "number", + "string" + ] + }, + "transactionCharge": { + "type": [ + "number", + "string" + ] + } + }, + "type": "object" + }, + "bankAccount": { + "$ref": "#/definitions/BankDetails" + }, + "batchSummary": { + "items": { + "$ref": "#/definitions/DocumentBatchSummaryEntry" + }, + "type": "array" + }, + "beforeDiscountPay": { + "anyOf": [ + { + "type": "number" + }, + { + "properties": { + "full": { + "type": "number" + } + }, + "required": [ + "full" + ], + "type": "object" + } + ] + }, + "billType": { + "type": "string" + }, + "billedBy": { + "$ref": "#/definitions/BillerDetails" + }, + "billedTo": { + "$ref": "#/definitions/BillerDetails" + }, + "business": { + "$ref": "#/definitions/BusinessData" + }, + "businessCurrency": { + "type": "string" + }, + "businessLocale": { + "type": "string" + }, + "businessTimeZone": { + "type": "string" + }, + "cesses": { + "items": { + "$ref": "#/definitions/CessCharge" + }, + "type": "array" + }, + "cgst": { + "type": "number" + }, + "columns": { + "items": { + "$ref": "#/definitions/ColumnDef" + }, + "type": "array" + }, + "contact": { + "properties": { + "email": { + "type": "string" + }, + "phone": { + "type": "string" + } + }, + "type": "object" + }, + "copy": { + "type": "string" + }, + "creditDiscount": { + "type": "number" + }, + "creditNoteStatus": { + "type": "string" + }, + "currency": { + "type": "string" + }, + "customCurrencySymbol": { + "type": "string" + }, + "customFields": { + "items": { + "$ref": "#/definitions/CustomFieldValue" + }, + "type": "array" + }, + "customFooters": { + "items": { + "properties": { + "defaultValue": { + "type": "string" + }, + "label": { + "type": "string" + }, + "value": { + "type": "string" + } + }, + "required": [ + "label", + "value" + ], + "type": "object" + }, + "type": "array" + }, + "customHeaders": { + "items": { + "properties": { + "label": { + "type": "string" + }, + "value": { + "type": "string" + } + }, + "required": [ + "label", + "value" + ], + "type": "object" + }, + "type": "array" + }, + "customLabels": { + "additionalProperties": { + "type": "string" + }, + "type": "object" + }, + "defaultBatchColumns": { + "items": { + "properties": { + "isHidden": { + "type": "boolean" + }, + "key": { + "type": "string" + }, + "label": { + "type": "string" + }, + "system": { + "type": "boolean" + } + }, + "required": [ + "key", + "label" + ], + "type": "object" + }, + "type": "array" + }, + "discount": { + "type": "number" + }, + "documentQr": { + "type": "string" + }, + "documentReason": { + "type": "string" + }, + "dueDate": { + "anyOf": [ + { + "type": "string" + }, + { + "format": "date-time", + "type": "string" + } + ] + }, + "earlyPayDiscount": { + "properties": { + "applied": { + "type": "boolean" + }, + "enabled": { + "type": "boolean" + }, + "totals": { + "type": "object" + } + }, + "type": "object" + }, + "einvoiceConfig": { + "$ref": "#/definitions/EinvoiceConfig" + }, + "ewayConfig": { + "$ref": "#/definitions/EwayConfig" + }, + "expenseNumber": { + "type": "string" + }, + "finalTotal": { + "type": "object" + }, + "footers": { + "items": { + "properties": { + "_id": { + "type": "string" + }, + "label": { + "type": "string" + }, + "value": { + "type": "string" + } + }, + "required": [ + "_id", + "label", + "value" + ], + "type": "object" + }, + "type": "array" + }, + "hasPgPayments": { + "type": "boolean" + }, + "hideEarlyPay": { + "type": "boolean" + }, + "hideHashInDocumentNumber": { + "type": "boolean" + }, + "hsnSummary": { + "anyOf": [ + { + "$ref": "#/definitions/HsnSummary" + }, + { + "items": { + "$ref": "#/definitions/HsnSummary" + }, + "type": "array" + } + ] + }, + "igst": { + "type": "number" + }, + "invoiceAccepted": { + "type": "string" + }, + "invoiceDate": { + "anyOf": [ + { + "type": "string" + }, + { + "format": "date-time", + "type": "string" + } + ] + }, + "invoiceDateUserInput": { + "type": "string" + }, + "invoiceNumber": { + "type": "string" + }, + "invoiceSubTitle": { + "type": "string" + }, + "invoiceTitle": { + "type": "string" + }, + "invoiceType": { + "type": "string" + }, + "invoiceValueProps": { + "additionalProperties": { + "properties": { + "visible": { + "type": "boolean" + } + }, + "required": [ + "visible" + ], + "type": "object" + }, + "type": "object" + }, + "irn": { + "$ref": "#/definitions/IrnDetails" + }, + "irnPosition": { + "type": "string" + }, + "isBusinessUser": { + "type": "boolean" + }, + "isDescriptionFullWidth": { + "type": "boolean" + }, + "isEarlyPayApplicable": { + "type": "boolean" + }, + "isExpenditure": { + "type": "boolean" + }, + "isIgst": { + "type": "boolean" + }, + "isOverdue": { + "type": "boolean" + }, + "isPublicView": { + "type": "boolean" + }, + "isRemoved": { + "type": "boolean" + }, + "isUtgst": { + "type": "boolean" + }, + "items": { + "items": { + "$ref": "#/definitions/LineItem" + }, + "type": "array" + }, + "lastPaymentDate": { + "anyOf": [ + { + "type": "string" + }, + { + "format": "date-time", + "type": "string" + } + ] + }, + "latePaymentFee": { + "properties": { + "enabled": { + "type": "boolean" + }, + "finalAmount": { + "type": "number" + }, + "isApplied": { + "type": "boolean" + }, + "showInInvoice": { + "type": "boolean" + }, + "when": { + "type": "number" + } + }, + "type": "object" + }, + "letterHead": { + "type": "string" + }, + "letterHeadFooter": { + "type": "string" + }, + "lhdnQrCode": { + "type": "string" + }, + "linkedInvoices": { + "items": {}, + "type": "array" + }, + "notes": { + "type": "string" + }, + "owner": { + "$ref": "#/definitions/BusinessData" + }, + "ownerBusiness": { + "$ref": "#/definitions/BusinessData" + }, + "ownerOffset": { + "type": "string" + }, + "ownerTimeZone": { + "type": "string" + }, + "payUrl": { + "type": "string" + }, + "paymentOptions": { + "$ref": "#/definitions/InvoicePaymentOptions" + }, + "payments": { + "items": { + "$ref": "#/definitions/Payment" + }, + "type": "array" + }, + "pdfOptions": { + "$ref": "#/definitions/InvoicePdfOptions" + }, + "placeOfSupply": { + "type": "string" + }, + "pos": { + "type": "string" + }, + "purchaseOrderNumber": { + "type": "string" + }, + "qrCode": { + "type": "string" + }, + "query": { + "additionalProperties": { + "type": "string" + }, + "type": "object" + }, + "quotationNumber": { + "type": "string" + }, + "reminders": { + "properties": { + "sent": { + "type": "boolean" + } + }, + "type": "object" + }, + "roundOffQuantity": { + "type": "boolean" + }, + "roundOffRate": { + "type": "boolean" + }, + "sgst": { + "type": "number" + }, + "share": { + "properties": { + "fileName": { + "type": "string" + }, + "link": { + "type": "string" + }, + "name": { + "type": "string" + }, + "pdf": { + "type": "string" + }, + "printLabels": { + "items": { + "properties": { + "label": { + "type": "string" + }, + "pdf": { + "type": "string" + } + }, + "required": [ + "label", + "pdf" + ], + "type": "object" + }, + "type": "array" + } + }, + "type": "object" + }, + "sharedDocumentId": { + "type": "string" + }, + "shippedFrom": { + "$ref": "#/definitions/BillerDetails" + }, + "shippedTo": { + "$ref": "#/definitions/BillerDetails" + }, + "showBankAccount": { + "type": "boolean" + }, + "showBranding": { + "type": "boolean" + }, + "showExpenseNumber": { + "type": "boolean" + }, + "showItemNameFullWidth": { + "type": "boolean" + }, + "showPaymentsTable": { + "type": "boolean" + }, + "showStockSummary": { + "type": "boolean" + }, + "showTotalsRow": { + "type": "boolean" + }, + "showUpi": { + "type": "boolean" + }, + "showVendorBankAccount": { + "type": "boolean" + }, + "signature": { + "type": "string" + }, + "status": { + "type": "string" + }, + "store": { + "properties": { + "asideCollapsed": { + "type": "boolean" + } + }, + "required": [ + "asideCollapsed" + ], + "type": "object" + }, + "subTotal": { + "type": "number" + }, + "subUnitLength": { + "type": "number" + }, + "taxName": { + "type": "string" + }, + "taxSummary": { + "anyOf": [ + { + "$ref": "#/definitions/TaxSummary" + }, + { + "items": { + "$ref": "#/definitions/TaxSummary" + }, + "type": "array" + } + ] + }, + "taxType": { + "type": "string" + }, + "template": { + "$ref": "#/definitions/InvoiceTemplateConfig" + }, + "templateName": { + "type": "string" + }, + "terms": { + "items": { + "properties": { + "label": { + "type": "string" + }, + "terms": { + "items": { + "type": "string" + }, + "type": "array" + } + }, + "required": [ + "label", + "terms" + ], + "type": "object" + }, + "type": "array" + }, + "toPay": { + "anyOf": [ + { + "type": "number" + }, + { + "properties": { + "full": { + "type": "number" + } + }, + "required": [ + "full" + ], + "type": "object" + } + ] + }, + "totalConversions": { + "type": "object" + }, + "totals": { + "type": "object" + }, + "transportDetails": { + "$ref": "#/definitions/TransportDetails" + }, + "upi": { + "$ref": "#/definitions/UpiDetails" + }, + "utgst": { + "type": "number" + }, + "vendorFields": { + "type": "object" + }, + "zatcaQrCode": { + "type": "string" + } + }, + "required": [ + "_id", + "billType", + "currency", + "finalTotal", + "invoiceNumber", + "status", + "subTotal" + ], + "type": "object" + }, + "HsnSummary": { + "properties": { + "cessAmount": { + "type": "number" + }, + "cgst": { + "type": "number" + }, + "hsn": { + "type": "string" + }, + "igst": { + "type": "number" + }, + "sgst": { + "type": "number" + }, + "tax": { + "type": "number" + }, + "taxableValue": { + "type": "number" + }, + "utgst": { + "type": "number" + } + }, + "required": [ + "cgst", + "hsn", + "igst", + "sgst", + "tax", + "taxableValue", + "utgst" + ], + "type": "object" + }, + "InvoiceAdvanceOptions": { + "additionalProperties": {}, + "properties": { + "hideCountryOfSupply": { + "type": "boolean" + }, + "hideCurrencyCode": { + "type": "boolean" + }, + "hideGroupSubTotal": { + "type": "boolean" + }, + "hideTaxes": { + "type": "boolean" + }, + "hideTotals": { + "type": "boolean" + }, + "hsnView": { + "type": "string" + }, + "isDescriptionFullWidth": { + "type": "boolean" + }, + "itemNameFullWidth": { + "type": "boolean" + }, + "reverseCharge": { + "type": "boolean" + }, + "showHSNSummaryInInvoice": { + "type": "boolean" + }, + "showHsnSummary": { + "type": "boolean" + }, + "showPaymentsTable": { + "type": "boolean" + }, + "showSkuInInvoice": { + "type": "boolean" + }, + "showStockSummary": { + "type": "boolean" + }, + "showThumbnailAsColumn": { + "type": "boolean" + }, + "taxSummaryView": { + "type": "string" + }, + "unitColumn": { + "type": "string" + } + }, + "type": "object" + }, + "InvoiceData": { + "properties": { + "_id": { + "type": "string" + }, + "additionalCharges": { + "items": { + "$ref": "#/definitions/AdditionalCharge" + }, + "type": "array" + }, + "advanceOptions": { + "$ref": "#/definitions/InvoiceAdvanceOptions" + }, + "allPayments": { + "items": { + "$ref": "#/definitions/Payment" + }, + "type": "array" + }, + "attachments": { + "items": { + "type": "string" + }, + "type": "array" + }, + "balance": { + "properties": { + "credit": { + "type": [ + "number", + "string" + ] + }, + "due": { + "type": [ + "number", + "string" + ] + }, + "paid": { + "type": [ + "number", + "string" + ] + }, + "settledAmount": { + "type": [ + "number", + "string" + ] + }, + "tds": { + "type": [ + "number", + "string" + ] + }, + "transactionCharge": { + "type": [ + "number", + "string" + ] + } + }, + "type": "object" + }, + "bankAccount": { + "$ref": "#/definitions/BankDetails" + }, + "batchSummary": { + "items": { + "$ref": "#/definitions/DocumentBatchSummaryEntry" + }, + "type": "array" + }, + "beforeDiscountPay": { + "anyOf": [ + { + "type": "number" + }, + { + "properties": { + "full": { + "type": "number" + } + }, + "required": [ + "full" + ], + "type": "object" + } + ] + }, + "billType": { + "type": "string" + }, + "billedBy": { + "$ref": "#/definitions/BillerDetails" + }, + "billedTo": { + "$ref": "#/definitions/BillerDetails" + }, + "cesses": { + "items": { + "$ref": "#/definitions/CessCharge" + }, + "type": "array" + }, + "cgst": { + "type": "number" + }, + "columns": { + "items": { + "$ref": "#/definitions/ColumnDef" + }, + "type": "array" + }, + "contact": { + "properties": { + "email": { + "type": "string" + }, + "phone": { + "type": "string" + } + }, + "type": "object" + }, + "creditDiscount": { + "type": "number" + }, + "creditNoteStatus": { + "type": "string" + }, + "currency": { + "type": "string" + }, + "customCurrencySymbol": { + "type": "string" + }, + "customFields": { + "items": { + "$ref": "#/definitions/CustomFieldValue" + }, + "type": "array" + }, + "customFooters": { + "items": { + "properties": { + "defaultValue": { + "type": "string" + }, + "label": { + "type": "string" + }, + "value": { + "type": "string" + } + }, + "required": [ + "label", + "value" + ], + "type": "object" + }, + "type": "array" + }, + "customHeaders": { + "items": { + "properties": { + "label": { + "type": "string" + }, + "value": { + "type": "string" + } + }, + "required": [ + "label", + "value" + ], + "type": "object" + }, + "type": "array" + }, + "customLabels": { + "additionalProperties": { + "type": "string" + }, + "type": "object" + }, + "discount": { + "type": "number" + }, + "documentQr": { + "type": "string" + }, + "documentReason": { + "type": "string" + }, + "dueDate": { + "anyOf": [ + { + "type": "string" + }, + { + "format": "date-time", + "type": "string" + } + ] + }, + "earlyPayDiscount": { + "properties": { + "applied": { + "type": "boolean" + }, + "enabled": { + "type": "boolean" + }, + "totals": { + "type": "object" + } + }, + "type": "object" + }, + "expenseNumber": { + "type": "string" + }, + "finalTotal": { + "type": "object" + }, + "footers": { + "items": { + "properties": { + "_id": { + "type": "string" + }, + "label": { + "type": "string" + }, + "value": { + "type": "string" + } + }, + "required": [ + "_id", + "label", + "value" + ], + "type": "object" + }, + "type": "array" + }, + "hasPgPayments": { + "type": "boolean" + }, + "hsnSummary": { + "anyOf": [ + { + "$ref": "#/definitions/HsnSummary" + }, + { + "items": { + "$ref": "#/definitions/HsnSummary" + }, + "type": "array" + } + ] + }, + "igst": { + "type": "number" + }, + "invoiceAccepted": { + "type": "string" + }, + "invoiceDate": { + "anyOf": [ + { + "type": "string" + }, + { + "format": "date-time", + "type": "string" + } + ] + }, + "invoiceDateUserInput": { + "type": "string" + }, + "invoiceNumber": { + "type": "string" + }, + "invoiceSubTitle": { + "type": "string" + }, + "invoiceTitle": { + "type": "string" + }, + "invoiceType": { + "type": "string" + }, + "irn": { + "$ref": "#/definitions/IrnDetails" + }, + "isExpenditure": { + "type": "boolean" + }, + "isIgst": { + "type": "boolean" + }, + "isOverdue": { + "type": "boolean" + }, + "isRemoved": { + "type": "boolean" + }, + "isUtgst": { + "type": "boolean" + }, + "items": { + "items": { + "$ref": "#/definitions/LineItem" + }, + "type": "array" + }, + "lastPaymentDate": { + "anyOf": [ + { + "type": "string" + }, + { + "format": "date-time", + "type": "string" + } + ] + }, + "latePaymentFee": { + "properties": { + "enabled": { + "type": "boolean" + }, + "finalAmount": { + "type": "number" + }, + "isApplied": { + "type": "boolean" + }, + "showInInvoice": { + "type": "boolean" + }, + "when": { + "type": "number" + } + }, + "type": "object" + }, + "letterHead": { + "type": "string" + }, + "letterHeadFooter": { + "type": "string" + }, + "lhdnQrCode": { + "type": "string" + }, + "linkedInvoices": { + "items": {}, + "type": "array" + }, + "notes": { + "type": "string" + }, + "owner": { + "$ref": "#/definitions/BusinessData" + }, + "ownerOffset": { + "type": "string" + }, + "paymentOptions": { + "$ref": "#/definitions/InvoicePaymentOptions" + }, + "payments": { + "items": { + "$ref": "#/definitions/Payment" + }, + "type": "array" + }, + "pdfOptions": { + "$ref": "#/definitions/InvoicePdfOptions" + }, + "placeOfSupply": { + "type": "string" + }, + "pos": { + "type": "string" + }, + "purchaseOrderNumber": { + "type": "string" + }, + "qrCode": { + "type": "string" + }, + "quotationNumber": { + "type": "string" + }, + "reminders": { + "properties": { + "sent": { + "type": "boolean" + } + }, + "type": "object" + }, + "roundOffQuantity": { + "type": "boolean" + }, + "roundOffRate": { + "type": "boolean" + }, + "sgst": { + "type": "number" + }, + "share": { + "properties": { + "fileName": { + "type": "string" + }, + "link": { + "type": "string" + }, + "name": { + "type": "string" + }, + "pdf": { + "type": "string" + }, + "printLabels": { + "items": { + "properties": { + "label": { + "type": "string" + }, + "pdf": { + "type": "string" + } + }, + "required": [ + "label", + "pdf" + ], + "type": "object" + }, + "type": "array" + } + }, + "type": "object" + }, + "sharedDocumentId": { + "type": "string" + }, + "shippedFrom": { + "$ref": "#/definitions/BillerDetails" + }, + "shippedTo": { + "$ref": "#/definitions/BillerDetails" + }, + "showBranding": { + "type": "boolean" + }, + "showTotalsRow": { + "type": "boolean" + }, + "signature": { + "type": "string" + }, + "status": { + "type": "string" + }, + "subTotal": { + "type": "number" + }, + "subUnitLength": { + "type": "number" + }, + "taxName": { + "type": "string" + }, + "taxSummary": { + "anyOf": [ + { + "$ref": "#/definitions/TaxSummary" + }, + { + "items": { + "$ref": "#/definitions/TaxSummary" + }, + "type": "array" + } + ] + }, + "taxType": { + "type": "string" + }, + "template": { + "$ref": "#/definitions/InvoiceTemplateConfig" + }, + "templateName": { + "type": "string" + }, + "terms": { + "items": { + "properties": { + "label": { + "type": "string" + }, + "terms": { + "items": { + "type": "string" + }, + "type": "array" + } + }, + "required": [ + "label", + "terms" + ], + "type": "object" + }, + "type": "array" + }, + "toPay": { + "anyOf": [ + { + "type": "number" + }, + { + "properties": { + "full": { + "type": "number" + } + }, + "required": [ + "full" + ], + "type": "object" + } + ] + }, + "totalConversions": { + "type": "object" + }, + "totals": { + "type": "object" + }, + "transportDetails": { + "$ref": "#/definitions/TransportDetails" + }, + "upi": { + "$ref": "#/definitions/UpiDetails" + }, + "utgst": { + "type": "number" + }, + "vendorFields": { + "type": "object" + }, + "zatcaQrCode": { + "type": "string" + } + }, + "required": [ + "_id", + "billType", + "status", + "invoiceNumber", + "currency", + "subTotal", + "finalTotal" + ], + "type": "object" + }, + "InvoicePaymentOptions": { + "additionalProperties": {}, + "properties": { + "accountTransfer": { + "type": "boolean" + }, + "upi": { + "type": "boolean" + }, + "vendorAccountTransfer": { + "type": "boolean" + } + }, + "type": "object" + }, + "InvoicePdfOptions": { + "additionalProperties": {}, + "properties": { + "footerOnLastPage": { + "type": "boolean" + }, + "letterHeadOnFirstPage": { + "type": "boolean" + } + }, + "type": "object" + }, + "InvoiceTemplateConfig": { + "additionalProperties": {}, + "properties": { + "parentTemplate": { + "type": "string" + }, + "pdfOptions": { + "$ref": "#/definitions/InvoicePdfOptions" + }, + "template": { + "type": "string" + }, + "upiShrink": { + "type": "boolean" + } + }, + "type": "object" + }, + "IrnDetails": { + "properties": { + "AckDt": { + "type": "string" + }, + "AckNo": { + "type": "string" + }, + "CancelDate": { + "type": "string" + }, + "EwbDt": { + "type": "string" + }, + "EwbNo": { + "type": "string" + }, + "EwbValidTill": { + "type": "string" + }, + "Irn": { + "type": "string" + }, + "ewayCancelDate": { + "type": "string" + }, + "qrCode": { + "type": "string" + } + }, + "type": "object" + }, + "LineItem": { + "properties": { + "_id": { + "type": "string" + }, + "amount": { + "type": "number" + }, + "batchSummary": { + "items": { + "properties": { + "_id": { + "type": "string" + }, + "batchName": { + "type": "string" + }, + "expiryDate": { + "type": "string" + }, + "itemName": { + "type": "string" + }, + "manufacturingDate": { + "type": "string" + }, + "quantity": { + "type": "number" + }, + "warehouse": { + "type": "string" + }, + "warehouseName": { + "type": "string" + } + }, + "required": [ + "quantity" + ], + "type": "object" + }, + "type": "array" + }, + "cessAmount": { + "type": "number" + }, + "cgst": { + "type": "number" + }, + "classification": { + "type": "string" + }, + "custom": { + "type": "object" + }, + "customFields": { + "items": { + "$ref": "#/definitions/CustomFieldValue" + }, + "type": "array" + }, + "description": { + "type": "string" + }, + "discount": { + "type": "number" + }, + "group": { + "type": "boolean" + }, + "gstRate": { + "type": [ + "number", + "string" + ] + }, + "hsn": { + "type": "string" + }, + "igst": { + "type": "number" + }, + "images": { + "items": { + "type": "string" + }, + "type": "array" + }, + "inventoryTxn": { + "type": "string" + }, + "isAdditionalCharge": { + "type": "boolean" + }, + "isGroupItemTotalRow": { + "type": "boolean" + }, + "name": { + "type": "string" + }, + "originalImages": { + "items": { + "type": "string" + }, + "type": "array" + }, + "quantity": { + "type": "number" + }, + "rate": { + "type": "number" + }, + "sgst": { + "type": "number" + }, + "showSku": { + "type": "boolean" + }, + "sku": { + "type": "string" + }, + "subTotal": { + "type": "number" + }, + "tax": { + "type": "number" + }, + "taxAmount": { + "type": "number" + }, + "taxRate": { + "type": [ + "number", + "string" + ] + }, + "thumbnail": { + "type": "string" + }, + "unit": { + "type": "string" + }, + "utgst": { + "type": "number" + } + }, + "required": [ + "_id", + "name", + "quantity", + "rate", + "amount" + ], + "type": "object" + }, + "Payment": { + "properties": { + "amount": { + "type": [ + "number", + "string" + ] + }, + "createdAt": { + "type": "string" + }, + "date": { + "type": "string" + }, + "method": { + "type": "string" + }, + "mode": { + "type": "string" + }, + "paymentDate": { + "type": "string" + }, + "paymentMethod": { + "type": "string" + }, + "status": { + "type": "string" + } + }, + "type": "object" + }, + "TaxSummary": { + "properties": { + "cessAmount": { + "type": "number" + }, + "cgst": { + "type": "number" + }, + "igst": { + "type": "number" + }, + "sgst": { + "type": "number" + }, + "tax": { + "type": "number" + }, + "taxableValue": { + "type": "number" + }, + "utgst": { + "type": "number" + } + }, + "required": [ + "tax", + "taxableValue", + "cgst", + "sgst", + "igst", + "utgst" + ], + "type": "object" + }, + "TransportDetails": { + "properties": { + "challanDate": { + "type": "string" + }, + "challanNumber": { + "type": "string" + }, + "distance": { + "type": [ + "number", + "string" + ] + }, + "extraInformation": { + "type": "string" + }, + "subSupplyType": { + "type": "string" + }, + "transactionType": { + "type": "string" + }, + "transport": { + "type": "string" + }, + "transportMode": { + "type": "string" + }, + "transporter": { + "properties": { + "name": { + "type": "string" + }, + "transporterId": { + "type": "string" + } + }, + "type": "object" + }, + "transporterId": { + "type": "string" + }, + "transporterName": { + "type": "string" + }, + "vehicleNumber": { + "type": "string" + }, + "vehicleType": { + "type": "string" + } + }, + "type": "object" + }, + "UpiDetails": { + "properties": { + "qr": { + "type": "string" + }, + "qrCode": { + "type": "string" + }, + "upi": { + "type": "string" + }, + "upiId": { + "type": "string" + }, + "vpa": { + "type": "string" + } + }, + "type": "object" + } + } +} diff --git a/scripts/generate-schemas.mjs b/scripts/generate-schemas.mjs new file mode 100644 index 0000000..952a3cb --- /dev/null +++ b/scripts/generate-schemas.mjs @@ -0,0 +1,130 @@ +#!/usr/bin/env node +/** + * Generates JSON Schemas from the TypeScript contract definitions so that + * template validation has a machine-readable source of truth. + * + * Usage: + * node scripts/generate-schemas.mjs # (re)write schemas/ + * node scripts/generate-schemas.mjs --check # fail if schemas/ is stale + * node scripts/generate-schemas.mjs --schemas-dir