V19 · Repository runtime

API không nên ghi thẳng vào dữ liệu sống.

V19 thêm một lớp repository để kiểm tra consent, ghi submission, sinh report và tạo audit event theo cùng một đường kiểm soát.

v19-repository-runtime

Nguyên tắc repository

  • API không ghi trực tiếp vào store; API gọi repository.
  • Repository kiểm tra consent scope trước khi ghi hoặc xuất dữ liệu.
  • Mỗi hành động quan trọng tạo audit event.
  • Submission đã khóa không bị ghi đè; chỉnh sửa phải tạo phiên bản mới.
  • Export pack phải giữ ranh giới dữ liệu theo vai trò.
demo state

Dữ liệu seed sau thao tác demo

  • Participants: 2
  • Consents: 2
  • Submissions: 2
  • Reports: 1
  • Audit events: 4
  • Lock OK: true
  • Report OK: true