账务事实身份与双时态记录
原能力
保存账务事实的原身份、发生与获知时间、修订和来源,不覆盖历史。(合同附件 R7 13.2)
首选项目
Formance Ledger(MIT)。 Formance Ledger
匹配范围
总账记录及时间关联查询支持事实回看。
源码
Formance Ledger · func (s *Server) handleCreateTransaction(
internal/adapter/http/handlers_create_transaction.go · 13–26 行。 在 GitHub 查看源码 · 许可证与声明
源码片段
func (s *Server) handleCreateTransaction(w http.ResponseWriter, r *http.Request) {
ledgerName, ok := requireLedgerName(w, r)
if !ok {
return
}
// Decode request body into protobuf CreateTransactionPayload.
// The custom UnmarshalJSON in service.pb.json.go drives field naming
// from the public camelCase contract (scriptReference, accountMetadata,
// …) — the default protoc-gen-go tags are snake_case and would silently
// drop multi-word keys (#452).
req := &servicepb.CreateTransactionPayload{}
err := json.UnmarshalRead(r.Body, req)
DuckDB · PhysicalAsOfJoin::
src/execution/operator/join/physical_asof_join.cpp · 18–31 行。 在 GitHub 查看源码 · 许可证与声明
源码片段
PhysicalAsOfJoin::PhysicalAsOfJoin(PhysicalPlan &physical_plan, LogicalComparisonJoin &op, PhysicalOperator &left,
PhysicalOperator &right, vector<column_t> lhs_partition_cols,
vector<column_t> rhs_partition_cols)
: PhysicalComparisonJoin(physical_plan, op, PhysicalOperatorType::ASOF_JOIN, std::move(op.conditions), op.join_type,
op.estimated_cardinality),
comparison_type(ExpressionType::INVALID) {
// Convert the conditions partitions and sorts
for (auto &cond : conditions) {
D_ASSERT(cond.IsComparison());
D_ASSERT(cond.GetLHS().GetReturnType() == cond.GetRHS().GetReturnType());
join_key_types.push_back(cond.GetLHS().GetReturnType());
const auto join_key_idx = join_key_types.size() - 1;
auto left_cond = cond.LeftReference()->Copy();
实现与验收要点
原事实身份、两种时间、更正和权威版本。