{"$schema":"https://json-schema.org/draft/2020-12/schema","$id":"https://puranwater.com/schemas/postgres/tally_accounting/tally_voucher.schema.json","title":"tally_voucher","type":"object","properties":{"voucher_id":{"type":"string","format":"uuid","x-pg-type":"uuid"},"company_period_id":{"type":"string","format":"uuid","x-pg-type":"uuid"},"ingestion_batch_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"x-pg-type":"uuid"},"voucher_type_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"x-pg-type":"uuid"},"voucher_date":{"type":"string","format":"date","x-pg-type":"date"},"voucher_number":{"type":"string","x-pg-type":"text"},"reference_number":{"anyOf":[{"type":"string"},{"type":"null"}],"x-pg-type":"text"},"party_ledger_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"x-pg-type":"uuid"},"party_ledger_name":{"anyOf":[{"type":"string"},{"type":"null"}],"x-pg-type":"text"},"particulars":{"anyOf":[{"type":"string"},{"type":"null"}],"x-pg-type":"text"},"debit_amount":{"anyOf":[{"type":"number"},{"type":"null"}],"x-pg-type":"numeric"},"credit_amount":{"anyOf":[{"type":"number"},{"type":"null"}],"x-pg-type":"numeric"},"quantity":{"anyOf":[{"type":"number"},{"type":"null"}],"x-pg-type":"numeric"},"quantity_unit":{"anyOf":[{"type":"string"},{"type":"null"}],"x-pg-type":"text"},"narration":{"anyOf":[{"type":"string"},{"type":"null"}],"x-pg-type":"text"},"raw_payload":{"anyOf":[{},{"type":"null"}],"x-pg-type":"jsonb"},"created_at":{"type":"string","format":"date-time","x-pg-type":"timestamptz"},"updated_at":{"type":"string","format":"date-time","x-pg-type":"timestamptz"},"tally_native_key":{"type":"string","x-pg-type":"text"},"tally_guid":{"anyOf":[{"type":"string"},{"type":"null"}],"x-pg-type":"text"},"tally_remote_id":{"anyOf":[{"type":"string"},{"type":"null"}],"x-pg-type":"text"},"tally_vch_key":{"anyOf":[{"type":"string"},{"type":"null"}],"x-pg-type":"text"},"tally_voucher_key":{"anyOf":[{"type":"string"},{"type":"null"}],"x-pg-type":"text"},"tally_voucher_retain_key":{"anyOf":[{"type":"string"},{"type":"null"}],"x-pg-type":"text"},"tally_alter_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"x-pg-type":"int8"},"tally_action":{"anyOf":[{"type":"string"},{"type":"null"}],"x-pg-type":"text"},"object_view":{"anyOf":[{"type":"string"},{"type":"null"}],"x-pg-type":"text"},"persisted_view":{"anyOf":[{"type":"string"},{"type":"null"}],"x-pg-type":"text"},"entered_by":{"anyOf":[{"type":"string"},{"type":"null"}],"x-pg-type":"text"},"original_voucher_number":{"anyOf":[{"type":"string"},{"type":"null"}],"x-pg-type":"text"},"counterparty_name":{"anyOf":[{"type":"string"},{"type":"null"}],"x-pg-type":"text"},"buyer_name":{"anyOf":[{"type":"string"},{"type":"null"}],"x-pg-type":"text"},"base_party_name":{"anyOf":[{"type":"string"},{"type":"null"}],"x-pg-type":"text"},"country_of_residence":{"anyOf":[{"type":"string"},{"type":"null"}],"x-pg-type":"text"},"state_name":{"anyOf":[{"type":"string"},{"type":"null"}],"x-pg-type":"text"},"place_of_supply":{"anyOf":[{"type":"string"},{"type":"null"}],"x-pg-type":"text"},"gst_registration_type":{"anyOf":[{"type":"string"},{"type":"null"}],"x-pg-type":"text"},"party_gstin":{"anyOf":[{"type":"string"},{"type":"null"}],"x-pg-type":"text"},"gst_nature_of_transaction":{"anyOf":[{"type":"string"},{"type":"null"}],"x-pg-type":"text"}},"x-table-schema":"public","required":["company_period_id","voucher_date","voucher_number","tally_native_key"],"x-primary-key":["voucher_id"],"x-foreign-keys":[{"column":"company_period_id","references_table":"tally_company_period","references_column":"company_period_id","constraint":"tally_voucher_company_period_id_fkey"},{"column":"ingestion_batch_id","references_table":"tally_ingestion_batch","references_column":"ingestion_batch_id","constraint":"tally_voucher_ingestion_batch_id_fkey"},{"column":"party_ledger_id","references_table":"tally_ledger","references_column":"ledger_id","constraint":"tally_voucher_party_ledger_id_fkey"},{"column":"voucher_type_id","references_table":"tally_voucher_type","references_column":"voucher_type_id","constraint":"tally_voucher_voucher_type_id_fkey"}]}