Skip to content

Feature/ak 001 core domain types#3

Merged
y-aithnini merged 9 commits intodevelopfrom
feature/AK-001-core-domain-types
Mar 13, 2026
Merged

Feature/ak 001 core domain types#3
y-aithnini merged 9 commits intodevelopfrom
feature/AK-001-core-domain-types

Conversation

@y-aithnini
Copy link

Summary

  • What does this PR change?

Why

  • Why is this change needed?

Checklist

  • Added/updated tests (if behavior changed)
  • npm run lint passes
  • npm run typecheck passes
  • npm test passes
  • npm run build passes
  • Added a changeset (npx changeset) if this affects consumers

Notes

  • Anything reviewers should pay attention to?

y-aithnini and others added 8 commits March 13, 2026 10:07
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings March 13, 2026 10:44
@sonarqubecloud
Copy link

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Introduces a first pass of “core domain” building blocks for AuditKit (framework-free types, ports, DTO schemas, and domain errors) and exposes them via src/core/index.ts to form a public core API.

Changes:

  • Added core domain model types (audit log, actors/resources, filters/pagination) plus runtime type guards.
  • Added hexagonal “ports” interfaces (repository, change detector, ID generator, timestamp provider) and barrel exports.
  • Added Zod-based DTO schemas for create/query/response payloads and added domain-specific error classes; updated core exports accordingly.

Reviewed changes

Copilot reviewed 16 out of 16 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
src/core/types.ts Defines core domain types/enums and type guards for audit logging.
src/core/ports/audit-repository.port.ts Adds repository port contract for persistence/query operations.
src/core/ports/change-detector.port.ts Adds port contract for diffing/masking/formatting changesets.
src/core/ports/id-generator.port.ts Adds port contract for ID generation/validation/metadata.
src/core/ports/timestamp-provider.port.ts Adds port contract for timestamp generation/format/parse/validation utilities.
src/core/ports/index.ts Barrel export for ports.
src/core/dtos/create-audit-log.dto.ts Adds Zod schema/types for creating audit logs (+ before/after variant).
src/core/dtos/query-audit-logs.dto.ts Adds Zod schema/types for querying audit logs with pagination and date validation.
src/core/dtos/audit-log-response.dto.ts Adds Zod schema/types for standardized response payloads.
src/core/dtos/index.ts Barrel export for DTOs.
src/core/errors/audit-not-found.error.ts Adds a typed “not found” domain error with context/toJSON.
src/core/errors/invalid-actor.error.ts Adds a typed actor validation error with details/toJSON.
src/core/errors/invalid-changeset.error.ts Adds a typed changeset validation error with helpers/toJSON.
src/core/errors/index.ts Barrel export for domain errors.
src/core/index.ts Replaces placeholder core entrypoint with re-exports for types/DTOs/ports/errors.
eslint.config.mjs Adds/adjusts unused-vars lint configuration (note: repo also has eslint.config.js).

@y-aithnini y-aithnini merged commit 6c1cf06 into develop Mar 13, 2026
2 checks passed
@y-aithnini y-aithnini deleted the feature/AK-001-core-domain-types branch March 13, 2026 10:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants