feat: pretty build output
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { AggregateRoot } from "../../libraries/aggregate.ts";
|
||||
import { Events } from "./events.ts";
|
||||
import { EventRecord, Events } from "./events.ts";
|
||||
|
||||
export class User extends AggregateRoot<Events> {
|
||||
static override readonly name = "user";
|
||||
@@ -19,7 +19,7 @@ export class User extends AggregateRoot<Events> {
|
||||
// Reducer
|
||||
// -------------------------------------------------------------------------
|
||||
|
||||
with(event: Events["$events"][number]["$record"]) {
|
||||
with(event: EventRecord) {
|
||||
switch (event.type) {
|
||||
case "user:name:given-set": {
|
||||
this.name.given = event.data;
|
||||
|
||||
@@ -2,6 +2,7 @@ import z from "zod";
|
||||
|
||||
import { event } from "../../libraries/event.ts";
|
||||
import { EventFactory } from "../../libraries/event-factory.ts";
|
||||
import { Prettify } from "../../types/utilities.ts";
|
||||
|
||||
export const auditor = z.strictObject({ auditor: z.string() });
|
||||
|
||||
@@ -33,3 +34,5 @@ export const events = new EventFactory([
|
||||
]);
|
||||
|
||||
export type Events = typeof events;
|
||||
|
||||
export type EventRecord = Prettify<Events["$events"][number]["$record"]>;
|
||||
|
||||
Reference in New Issue
Block a user