Skip to main content

Generate Room/Den STI model

Git Log

commit e1c1dcc0afc8044752a694f052a000e7ab35c616
Author: Daniel Nelson <844258+daniel-nelson@users.noreply.github.com>
Date: Sat Nov 8 11:52:15 2025 -0600

Generate Room/Den STI model

```console
yarn psy g:sti-child Room/Den extends Room

## Diff from 5972453

```diff
diff --git a/api/spec/factories/Room/DenFactory.ts b/api/spec/factories/Room/DenFactory.ts
new file mode 100644
index 0000000..4840bb0
--- /dev/null
+++ b/api/spec/factories/Room/DenFactory.ts
@@ -0,0 +1,8 @@
+import { UpdateableProperties } from '@rvoh/dream/types'
+import RoomDen from '@models/Room/Den.js'
+
+export default async function createRoomDen(attrs: UpdateableProperties<RoomDen> = {}) {
+ return await RoomDen.create({
+ ...attrs,
+ })
+}
diff --git a/api/spec/unit/models/Room/Den.spec.ts b/api/spec/unit/models/Room/Den.spec.ts
new file mode 100644
index 0000000..f1e12ce
--- /dev/null
+++ b/api/spec/unit/models/Room/Den.spec.ts
@@ -0,0 +1,3 @@
+describe('Room/Den', () => {
+ it.todo('add a test here to get started building Room/Den')
+})
diff --git a/api/src/app/models/Room/Den.ts b/api/src/app/models/Room/Den.ts
new file mode 100644
index 0000000..7f67007
--- /dev/null
+++ b/api/src/app/models/Room/Den.ts
@@ -0,0 +1,16 @@
+import { Decorators, STI } from '@rvoh/dream'
+import { DreamColumn, DreamSerializers } from '@rvoh/dream/types'
+import Room from '@models/Room.js'
+
+const deco = new Decorators<typeof RoomDen>()
+
+@STI(Room)
+export default class RoomDen extends Room {
+ public override get serializers(): DreamSerializers<RoomDen> {
+ return {
+ default: 'Room/DenSerializer',
+ summary: 'Room/DenSummarySerializer',
+ }
+ }
+
+}
diff --git a/api/src/app/serializers/Room/DenSerializer.ts b/api/src/app/serializers/Room/DenSerializer.ts
new file mode 100644
index 0000000..9030e23
--- /dev/null
+++ b/api/src/app/serializers/Room/DenSerializer.ts
@@ -0,0 +1,8 @@
+import { RoomSerializer, RoomSummarySerializer } from '@serializers/RoomSerializer.js'
+import RoomDen from '@models/Room/Den.js'
+
+export const RoomDenSummarySerializer = (roomDen: RoomDen) =>
+ RoomSummarySerializer(RoomDen, roomDen)
+
+export const RoomDenSerializer = (roomDen: RoomDen) =>
+ RoomSerializer(RoomDen, roomDen)