MCPcopy Create free account
hub / github.com/devaccuracy/ledgerforge / getBalanceSchema

Function getBalanceSchema

internal/search/search.go:543–572  ·  view source on GitHub ↗

getBalanceSchema returns the schema for the "balances" collection.

()

Source from the content-addressed store, hash-verified

541
542// getBalanceSchema returns the schema for the "balances" collection.
543func getBalanceSchema() *api.CollectionSchema {
544 facet := true
545 sortBy := "created_at"
546 enableNested := true
547 identityId := "identities.identity_id"
548 ledgerId := "ledgers.ledger_id"
549 return &api.CollectionSchema{
550 Name: "balances",
551 Fields: []api.Field{
552 {Name: "balance", Type: "string", Facet: &facet},
553 {Name: "version", Type: "int64", Facet: &facet},
554 {Name: "inflight_balance", Type: "string", Facet: &facet},
555 {Name: "credit_balance", Type: "string", Facet: &facet},
556 {Name: "inflight_credit_balance", Type: "string", Facet: &facet},
557 {Name: "debit_balance", Type: "string", Facet: &facet},
558 {Name: "inflight_debit_balance", Type: "string", Facet: &facet},
559 {Name: "precision", Type: "float", Facet: &facet},
560 {Name: "ledger_id", Type: "string", Reference: &ledgerId, Facet: &facet},
561 {Name: "identity_id", Type: "string", Facet: &facet, Reference: &identityId, Optional: &enableNested},
562 {Name: "balance_id", Type: "string", Facet: &facet},
563 {Name: "indicator", Type: "string", Facet: &facet},
564 {Name: "currency", Type: "string", Facet: &facet},
565 {Name: "created_at", Type: "int64", Facet: &facet},
566 {Name: "inflight_expires_at", Type: "int64", Facet: &facet},
567 {Name: "meta_data", Type: "object", Facet: &facet, Optional: &enableNested},
568 },
569 DefaultSortingField: &sortBy,
570 EnableNestedFields: &enableNested,
571 }
572}
573
574// getTransactionSchema returns the schema for the "transactions" collection.
575func getTransactionSchema() *api.CollectionSchema {

Callers 1

initFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected