- Limit how far any account can go below zero (max {MAX_NEGATIVE_LIMIT.toLocaleString()}). -
-+ Limit how far any account can go below zero (max {MAX_NEGATIVE_LIMIT.toLocaleString()}). +
+- Insufficient balance. Available: {Number(fromBalance.balance).toLocaleString()} + {fromCurrencyData.allowNegativeGroupOnly && !isGroupMember + ? "Insufficient balance. Negative balances are restricted to group members only." + : `Insufficient balance. Available: ${Number(fromBalance.balance).toLocaleString()}`}
)} {fromCurrencyData && fromCurrencyData.allowNegative && ({fromCurrencyData.allowNegativeGroupOnly - ? "Negative balances allowed for group members" + ? isGroupMember + ? "Negative balances allowed (you are a group member)" + : "Negative balances restricted to group members — you must maintain a positive balance" : "Negative balances are allowed for this currency"}
)} @@ -371,7 +398,7 @@ export default function TransferModal({ open, onOpenChange, fromCurrencyId, acco !toAccountId || !amount || parseFloat(amount.replace(/,/g, '')) <= 0 || - (fromBalance && fromCurrencyData && !fromCurrencyData.allowNegative && parseFloat(amount.replace(/,/g, '')) > Number(fromBalance.balance)) + (fromBalance && fromCurrencyData && !negativeAllowed && parseFloat(amount.replace(/,/g, '')) > Number(fromBalance.balance)) } className="px-6 py-2 bg-primary text-primary-foreground rounded-lg hover:opacity-90 disabled:opacity-50 font-medium" > diff --git a/platforms/ecurrency/client/vite.config.ts b/platforms/ecurrency/client/vite.config.ts index 044f5558f..fddfd9611 100644 --- a/platforms/ecurrency/client/vite.config.ts +++ b/platforms/ecurrency/client/vite.config.ts @@ -3,7 +3,6 @@ import react from "@vitejs/plugin-react"; import path from "path"; const envDir = path.resolve(import.meta.dirname, "../../../"); -console.log("🔍 Vite envDir:", envDir); export default defineConfig({ plugins: [react()], diff --git a/services/ontology/schemas/binding-document.json b/services/ontology/schemas/binding-document.json new file mode 100644 index 000000000..919f171da --- /dev/null +++ b/services/ontology/schemas/binding-document.json @@ -0,0 +1,152 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "schemaId": "b1d0a8c3-4e5f-6789-0abc-def012345678", + "title": "Binding Document", + "type": "object", + "properties": { + "subject": { + "type": "string", + "description": "eName of the subject (pre-fixed with @)" + }, + "type": { + "type": "string", + "enum": ["id_document", "photograph", "social_connection", "self"], + "description": "The type of binding document" + }, + "data": { + "type": "object", + "description": "Format dependent payload for the binding document" + }, + "signatures": { + "type": "array", + "description": "Array of signatures from the user and counterparties", + "items": { + "$ref": "#/definitions/Signature" + } + } + }, + "allOf": [ + { + "if": { + "properties": { "type": { "const": "id_document" } }, + "required": ["type"] + }, + "then": { + "properties": { "data": { "$ref": "#/definitions/IdDocumentData" } } + } + }, + { + "if": { + "properties": { "type": { "const": "photograph" } }, + "required": ["type"] + }, + "then": { + "properties": { "data": { "$ref": "#/definitions/PhotographData" } } + } + }, + { + "if": { + "properties": { "type": { "const": "social_connection" } }, + "required": ["type"] + }, + "then": { + "properties": { "data": { "$ref": "#/definitions/SocialConnectionData" } } + } + }, + { + "if": { + "properties": { "type": { "const": "self" } }, + "required": ["type"] + }, + "then": { + "properties": { "data": { "$ref": "#/definitions/SelfData" } } + } + } + ], + "definitions": { + "IdDocumentData": { + "type": "object", + "properties": { + "vendor": { + "type": "string", + "description": "Vendor name for the ID document verification" + }, + "reference": { + "type": "string", + "description": "Reference ID from the vendor" + }, + "name": { + "type": "string", + "description": "Name verified against the ID document" + } + }, + "required": ["vendor", "reference", "name"], + "additionalProperties": false + }, + "PhotographData": { + "type": "object", + "properties": { + "photoBlob": { + "type": "string", + "description": "Base64 encoded photo blob" + } + }, + "required": ["photoBlob"], + "additionalProperties": false + }, + "SocialConnectionData": { + "type": "object", + "properties": { + "kind": { + "type": "string", + "const": "social_connection", + "description": "Discriminant for social connection data" + }, + "name": { + "type": "string", + "description": "Name of the social connection" + } + }, + "required": ["kind", "name"], + "additionalProperties": false + }, + "SelfData": { + "type": "object", + "properties": { + "kind": { + "type": "string", + "const": "self", + "description": "Discriminant for self data" + }, + "name": { + "type": "string", + "description": "Self-declared name" + } + }, + "required": ["kind", "name"], + "additionalProperties": false + }, + "Signature": { + "type": "object", + "properties": { + "signer": { + "type": "string", + "description": "eName or keyID of who signed it" + }, + "signature": { + "type": "string", + "description": "Cryptographic signature" + }, + "timestamp": { + "type": "string", + "format": "date-time", + "description": "When the signature was created" + } + }, + "required": ["signer", "signature", "timestamp"], + "additionalProperties": false + } + }, + "required": ["subject", "type", "data", "signatures"], + "additionalProperties": false +}