Skip to main content

Generate Room/LivingRoom STI model

Git Log

commit 3da43ab4064d7d9859b6f2db1483ada2e15ed7e5
Author: Daniel Nelson <844258+daniel-nelson@users.noreply.github.com>
Date: Sat Nov 8 11:53:13 2025 -0600

Generate Room/LivingRoom STI model

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

## Diff from 9d12d03

```diff
diff --git a/api/spec/factories/Room/LivingRoomFactory.ts b/api/spec/factories/Room/LivingRoomFactory.ts
new file mode 100644
index 0000000..501cde5
--- /dev/null
+++ b/api/spec/factories/Room/LivingRoomFactory.ts
@@ -0,0 +1,8 @@
+import { UpdateableProperties } from '@rvoh/dream/types'
+import RoomLivingRoom from '@models/Room/LivingRoom.js'
+
+export default async function createRoomLivingRoom(attrs: UpdateableProperties<RoomLivingRoom> = {}) {
+ return await RoomLivingRoom.create({
+ ...attrs,
+ })
+}
diff --git a/api/spec/unit/models/Room/LivingRoom.spec.ts b/api/spec/unit/models/Room/LivingRoom.spec.ts
new file mode 100644
index 0000000..6e4aa50
--- /dev/null
+++ b/api/spec/unit/models/Room/LivingRoom.spec.ts
@@ -0,0 +1,3 @@
+describe('Room/LivingRoom', () => {
+ it.todo('add a test here to get started building Room/LivingRoom')
+})
diff --git a/api/src/app/models/Room/LivingRoom.ts b/api/src/app/models/Room/LivingRoom.ts
new file mode 100644
index 0000000..feaca2f
--- /dev/null
+++ b/api/src/app/models/Room/LivingRoom.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 RoomLivingRoom>()
+
+@STI(Room)
+export default class RoomLivingRoom extends Room {
+ public override get serializers(): DreamSerializers<RoomLivingRoom> {
+ return {
+ default: 'Room/LivingRoomSerializer',
+ summary: 'Room/LivingRoomSummarySerializer',
+ }
+ }
+
+}
diff --git a/api/src/app/serializers/Room/LivingRoomSerializer.ts b/api/src/app/serializers/Room/LivingRoomSerializer.ts
new file mode 100644
index 0000000..e44755e
--- /dev/null
+++ b/api/src/app/serializers/Room/LivingRoomSerializer.ts
@@ -0,0 +1,8 @@
+import { RoomSerializer, RoomSummarySerializer } from '@serializers/RoomSerializer.js'
+import RoomLivingRoom from '@models/Room/LivingRoom.js'
+
+export const RoomLivingRoomSummarySerializer = (roomLivingRoom: RoomLivingRoom) =>
+ RoomSummarySerializer(RoomLivingRoom, roomLivingRoom)
+
+export const RoomLivingRoomSerializer = (roomLivingRoom: RoomLivingRoom) =>
+ RoomSerializer(RoomLivingRoom, roomLivingRoom)