@happyvertical/smrt-education 0.57.33 → 0.57.34

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (55) hide show
  1. package/AGENTS.md +8 -1
  2. package/README.md +117 -13
  3. package/agents/catalog-sync.md +46 -0
  4. package/agents/photo-intake.md +249 -0
  5. package/agents/workbook-service.md +355 -0
  6. package/agents/workbook-test-matrix.md +74 -0
  7. package/dist/catalog-acquisition-service.d.ts.map +1 -1
  8. package/dist/catalog-capability.d.ts +21 -0
  9. package/dist/catalog-capability.d.ts.map +1 -0
  10. package/dist/catalog-contracts.d.ts +40 -0
  11. package/dist/catalog-contracts.d.ts.map +1 -1
  12. package/dist/catalog-database-sync-store.d.ts.map +1 -1
  13. package/dist/catalog-models.d.ts +5 -1
  14. package/dist/catalog-models.d.ts.map +1 -1
  15. package/dist/catalog-read-service.d.ts +2 -1
  16. package/dist/catalog-read-service.d.ts.map +1 -1
  17. package/dist/catalog-service.d.ts +5 -0
  18. package/dist/catalog-service.d.ts.map +1 -1
  19. package/dist/chunks/workbook-photo-service-1wcnf-Xf.js +27359 -0
  20. package/dist/chunks/workbook-photo-service-1wcnf-Xf.js.map +1 -0
  21. package/dist/index.d.ts +11 -2
  22. package/dist/index.d.ts.map +1 -1
  23. package/dist/index.js +339 -24864
  24. package/dist/index.js.map +1 -1
  25. package/dist/ingestion.d.ts +37 -0
  26. package/dist/ingestion.d.ts.map +1 -1
  27. package/dist/ingestion.js +829 -20
  28. package/dist/ingestion.js.map +1 -1
  29. package/dist/learner-service.d.ts +15 -0
  30. package/dist/learner-service.d.ts.map +1 -1
  31. package/dist/manifest.json +4735 -6
  32. package/dist/smrt-knowledge.json +1760 -26
  33. package/dist/sources/public-illustrative-mathematics-adapter.d.ts.map +1 -1
  34. package/dist/sources/public-illustrative-mathematics-parser.d.ts.map +1 -1
  35. package/dist/submission-service.d.ts +38 -11
  36. package/dist/submission-service.d.ts.map +1 -1
  37. package/dist/workbook-answer-regions.d.ts +11 -0
  38. package/dist/workbook-answer-regions.d.ts.map +1 -0
  39. package/dist/workbook-contracts.d.ts +224 -0
  40. package/dist/workbook-contracts.d.ts.map +1 -0
  41. package/dist/workbook-layout.d.ts +13 -0
  42. package/dist/workbook-layout.d.ts.map +1 -0
  43. package/dist/workbook-models.d.ts +129 -0
  44. package/dist/workbook-models.d.ts.map +1 -0
  45. package/dist/workbook-photo-contracts.d.ts +56 -0
  46. package/dist/workbook-photo-contracts.d.ts.map +1 -0
  47. package/dist/workbook-photo-ingestion.d.ts +70 -0
  48. package/dist/workbook-photo-ingestion.d.ts.map +1 -0
  49. package/dist/workbook-photo-models.d.ts +63 -0
  50. package/dist/workbook-photo-models.d.ts.map +1 -0
  51. package/dist/workbook-photo-service.d.ts +72 -0
  52. package/dist/workbook-photo-service.d.ts.map +1 -0
  53. package/dist/workbook-service.d.ts +158 -0
  54. package/dist/workbook-service.d.ts.map +1 -0
  55. package/package.json +8 -8
@@ -2,7 +2,7 @@
2
2
  "version": "1.0.0",
3
3
  "timestamp": 0,
4
4
  "packageName": "@happyvertical/smrt-education",
5
- "packageVersion": "0.57.33",
5
+ "packageVersion": "0.57.34",
6
6
  "objects": {
7
7
  "@happyvertical/smrt-education:CatalogProviderCollection": {
8
8
  "name": "catalogprovidercollection",
@@ -108,7 +108,7 @@
108
108
  "collectionExportName": "CatalogResourceCollectionCollection",
109
109
  "schema": {
110
110
  "tableName": "catalog_resources",
111
- "ddl": "CREATE TABLE IF NOT EXISTS \"catalog_resources\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"provider_id\" TEXT NOT NULL,\n \"stable_id\" TEXT NOT NULL,\n \"revision\" TEXT NOT NULL,\n \"canonical_url\" TEXT,\n \"title\" TEXT NOT NULL,\n \"supplied_description\" TEXT,\n \"author\" TEXT,\n \"subjects\" TEXT,\n \"grades\" TEXT,\n \"language\" TEXT,\n \"resource_type\" TEXT,\n \"parent_stable_id\" TEXT,\n \"available_formats\" TEXT,\n \"license_evidence\" TEXT,\n \"license_state\" TEXT DEFAULT 'unknown',\n \"visibility\" TEXT DEFAULT 'catalog',\n \"last_seen_run_id\" TEXT,\n \"withdrawn_at\" TEXT\n);",
111
+ "ddl": "CREATE TABLE IF NOT EXISTS \"catalog_resources\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"provider_id\" TEXT NOT NULL,\n \"stable_id\" TEXT NOT NULL,\n \"revision\" TEXT NOT NULL,\n \"canonical_url\" TEXT,\n \"title\" TEXT NOT NULL,\n \"supplied_description\" TEXT,\n \"author\" TEXT,\n \"subjects\" TEXT,\n \"grades\" TEXT,\n \"language\" TEXT,\n \"resource_type\" TEXT,\n \"parent_stable_id\" TEXT,\n \"available_formats\" TEXT,\n \"representation\" TEXT,\n \"license_evidence\" TEXT,\n \"license_state\" TEXT DEFAULT 'unknown',\n \"visibility\" TEXT DEFAULT 'catalog',\n \"last_seen_run_id\" TEXT,\n \"withdrawn_at\" TEXT\n);",
112
112
  "columns": {
113
113
  "id": {
114
114
  "type": "UUID",
@@ -200,6 +200,11 @@
200
200
  "notNull": false,
201
201
  "unique": false
202
202
  },
203
+ "representation": {
204
+ "type": "TEXT",
205
+ "notNull": false,
206
+ "unique": false
207
+ },
203
208
  "license_evidence": {
204
209
  "type": "TEXT",
205
210
  "notNull": false,
@@ -244,7 +249,7 @@
244
249
  ]
245
250
  }
246
251
  ],
247
- "version": "441b7271"
252
+ "version": "e75f6bd0"
248
253
  },
249
254
  "importPath": "@happyvertical/smrt-education"
250
255
  },
@@ -800,6 +805,10 @@
800
805
  "type": "text",
801
806
  "required": false
802
807
  },
808
+ "representation": {
809
+ "type": "text",
810
+ "required": false
811
+ },
803
812
  "licenseEvidence": {
804
813
  "type": "text",
805
814
  "required": false
@@ -833,7 +842,38 @@
833
842
  "required": false
834
843
  }
835
844
  },
836
- "methods": {},
845
+ "methods": {
846
+ "getRepresentation": {
847
+ "name": "getRepresentation",
848
+ "async": false,
849
+ "parameters": [],
850
+ "returnType": "CatalogResourceRepresentation | undefined",
851
+ "isStatic": false,
852
+ "isPublic": true
853
+ },
854
+ "setRepresentation": {
855
+ "name": "setRepresentation",
856
+ "async": false,
857
+ "parameters": [
858
+ {
859
+ "name": "value",
860
+ "type": "CatalogResourceRepresentation | undefined",
861
+ "optional": false,
862
+ "unionBranches": [
863
+ {
864
+ "type": "CatalogResourceRepresentation"
865
+ },
866
+ {
867
+ "type": "undefined"
868
+ }
869
+ ]
870
+ }
871
+ ],
872
+ "returnType": "void",
873
+ "isStatic": false,
874
+ "isPublic": true
875
+ }
876
+ },
837
877
  "decoratorConfig": {
838
878
  "api": false,
839
879
  "mcp": false,
@@ -867,7 +907,7 @@
867
907
  ],
868
908
  "schema": {
869
909
  "tableName": "catalog_resources",
870
- "ddl": "CREATE TABLE IF NOT EXISTS \"catalog_resources\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"provider_id\" TEXT NOT NULL,\n \"stable_id\" TEXT NOT NULL,\n \"revision\" TEXT NOT NULL,\n \"canonical_url\" TEXT,\n \"title\" TEXT NOT NULL,\n \"supplied_description\" TEXT,\n \"author\" TEXT,\n \"subjects\" TEXT,\n \"grades\" TEXT,\n \"language\" TEXT,\n \"resource_type\" TEXT,\n \"parent_stable_id\" TEXT,\n \"available_formats\" TEXT,\n \"license_evidence\" TEXT,\n \"license_state\" TEXT DEFAULT 'unknown',\n \"visibility\" TEXT DEFAULT 'catalog',\n \"last_seen_run_id\" TEXT,\n \"withdrawn_at\" TEXT\n);",
910
+ "ddl": "CREATE TABLE IF NOT EXISTS \"catalog_resources\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"provider_id\" TEXT NOT NULL,\n \"stable_id\" TEXT NOT NULL,\n \"revision\" TEXT NOT NULL,\n \"canonical_url\" TEXT,\n \"title\" TEXT NOT NULL,\n \"supplied_description\" TEXT,\n \"author\" TEXT,\n \"subjects\" TEXT,\n \"grades\" TEXT,\n \"language\" TEXT,\n \"resource_type\" TEXT,\n \"parent_stable_id\" TEXT,\n \"available_formats\" TEXT,\n \"representation\" TEXT,\n \"license_evidence\" TEXT,\n \"license_state\" TEXT DEFAULT 'unknown',\n \"visibility\" TEXT DEFAULT 'catalog',\n \"last_seen_run_id\" TEXT,\n \"withdrawn_at\" TEXT\n);",
871
911
  "columns": {
872
912
  "id": {
873
913
  "type": "UUID",
@@ -959,6 +999,11 @@
959
999
  "notNull": false,
960
1000
  "unique": false
961
1001
  },
1002
+ "representation": {
1003
+ "type": "TEXT",
1004
+ "notNull": false,
1005
+ "unique": false
1006
+ },
962
1007
  "license_evidence": {
963
1008
  "type": "TEXT",
964
1009
  "notNull": false,
@@ -1003,7 +1048,7 @@
1003
1048
  ]
1004
1049
  }
1005
1050
  ],
1006
- "version": "441b7271"
1051
+ "version": "e75f6bd0"
1007
1052
  },
1008
1053
  "importPath": "@happyvertical/smrt-education"
1009
1054
  },
@@ -11564,6 +11609,4690 @@
11564
11609
  "version": "7d629fec"
11565
11610
  },
11566
11611
  "importPath": "@happyvertical/smrt-education"
11612
+ },
11613
+ "@happyvertical/smrt-education:Workbook": {
11614
+ "name": "workbook",
11615
+ "className": "Workbook",
11616
+ "qualifiedName": "@happyvertical/smrt-education:Workbook",
11617
+ "collection": "workbooks",
11618
+ "description": "Education-owned private workbook record. Mutations go through WorkbookService.",
11619
+ "filePath": "/home/runner/work/smrt/smrt/packages/education/src/workbook-models.ts",
11620
+ "packageName": "@happyvertical/smrt-education",
11621
+ "fields": {
11622
+ "tenantId": {
11623
+ "type": "text",
11624
+ "required": true,
11625
+ "_meta": {
11626
+ "sqlType": "UUID",
11627
+ "__tenancy": {
11628
+ "isTenantIdField": true,
11629
+ "autoFilter": true,
11630
+ "required": true,
11631
+ "autoPopulate": true,
11632
+ "nullable": false,
11633
+ "mode": "required",
11634
+ "field": "tenantId",
11635
+ "allowSuperAdminBypass": false
11636
+ }
11637
+ }
11638
+ },
11639
+ "learnerId": {
11640
+ "type": "foreignKey",
11641
+ "required": true,
11642
+ "related": "Learner",
11643
+ "_meta": {
11644
+ "required": true
11645
+ }
11646
+ },
11647
+ "workbookKey": {
11648
+ "type": "text",
11649
+ "required": false
11650
+ },
11651
+ "title": {
11652
+ "type": "text",
11653
+ "required": false
11654
+ },
11655
+ "edition": {
11656
+ "type": "text",
11657
+ "required": false
11658
+ },
11659
+ "reviewRequired": {
11660
+ "type": "boolean",
11661
+ "required": true,
11662
+ "default": true
11663
+ },
11664
+ "policyVersion": {
11665
+ "type": "integer",
11666
+ "required": true,
11667
+ "default": 1
11668
+ }
11669
+ },
11670
+ "methods": {
11671
+ "save": {
11672
+ "name": "save",
11673
+ "async": true,
11674
+ "parameters": [],
11675
+ "returnType": "Promise<this>",
11676
+ "isStatic": false,
11677
+ "isPublic": true
11678
+ }
11679
+ },
11680
+ "decoratorConfig": {
11681
+ "tableName": "workbooks",
11682
+ "conflictColumns": [
11683
+ "tenant_id",
11684
+ "learner_id",
11685
+ "workbook_key"
11686
+ ],
11687
+ "api": false,
11688
+ "mcp": false,
11689
+ "cli": false,
11690
+ "tenantScoped": {
11691
+ "mode": "required"
11692
+ }
11693
+ },
11694
+ "extends": "SmrtObject",
11695
+ "exportName": "Workbook",
11696
+ "collectionExportName": "WorkbookCollection",
11697
+ "displayLabelField": "title",
11698
+ "validationRules": [
11699
+ {
11700
+ "field": "learnerId",
11701
+ "rule": "required",
11702
+ "fieldType": "foreignKey"
11703
+ },
11704
+ {
11705
+ "field": "reviewRequired",
11706
+ "rule": "required",
11707
+ "fieldType": "boolean"
11708
+ },
11709
+ {
11710
+ "field": "policyVersion",
11711
+ "rule": "required",
11712
+ "fieldType": "integer"
11713
+ }
11714
+ ],
11715
+ "schema": {
11716
+ "tableName": "workbooks",
11717
+ "ddl": "CREATE TABLE IF NOT EXISTS \"workbooks\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"tenant_id\" UUID NOT NULL,\n \"learner_id\" UUID NOT NULL,\n \"workbook_key\" TEXT,\n \"title\" TEXT,\n \"edition\" TEXT,\n \"review_required\" BOOLEAN NOT NULL DEFAULT TRUE,\n \"policy_version\" INTEGER NOT NULL DEFAULT 1\n);",
11718
+ "columns": {
11719
+ "id": {
11720
+ "type": "UUID",
11721
+ "primaryKey": true,
11722
+ "referenceKind": "id",
11723
+ "notNull": true
11724
+ },
11725
+ "slug": {
11726
+ "type": "TEXT",
11727
+ "notNull": true
11728
+ },
11729
+ "context": {
11730
+ "type": "TEXT",
11731
+ "notNull": true,
11732
+ "default": ""
11733
+ },
11734
+ "created_at": {
11735
+ "type": "TIMESTAMP",
11736
+ "notNull": true,
11737
+ "default": "current_timestamp"
11738
+ },
11739
+ "updated_at": {
11740
+ "type": "TIMESTAMP",
11741
+ "notNull": true,
11742
+ "default": "current_timestamp"
11743
+ },
11744
+ "tenant_id": {
11745
+ "type": "UUID",
11746
+ "referenceKind": "tenantId",
11747
+ "notNull": true,
11748
+ "unique": false
11749
+ },
11750
+ "learner_id": {
11751
+ "type": "UUID",
11752
+ "referenceKind": "foreignKey",
11753
+ "notNull": true,
11754
+ "unique": false,
11755
+ "foreignKey": {
11756
+ "table": "learners",
11757
+ "column": "id",
11758
+ "onDelete": "CASCADE",
11759
+ "onUpdate": "CASCADE"
11760
+ }
11761
+ },
11762
+ "workbook_key": {
11763
+ "type": "TEXT",
11764
+ "notNull": false,
11765
+ "unique": false
11766
+ },
11767
+ "title": {
11768
+ "type": "TEXT",
11769
+ "notNull": false,
11770
+ "unique": false
11771
+ },
11772
+ "edition": {
11773
+ "type": "TEXT",
11774
+ "notNull": false,
11775
+ "unique": false
11776
+ },
11777
+ "review_required": {
11778
+ "type": "BOOLEAN",
11779
+ "notNull": true,
11780
+ "unique": false,
11781
+ "default": true
11782
+ },
11783
+ "policy_version": {
11784
+ "type": "INTEGER",
11785
+ "notNull": true,
11786
+ "unique": false,
11787
+ "default": 1
11788
+ }
11789
+ },
11790
+ "indexes": [
11791
+ {
11792
+ "name": "workbooks_tenant_id_learner_id_idx",
11793
+ "columns": [
11794
+ "tenant_id",
11795
+ "learner_id",
11796
+ "workbook_key"
11797
+ ],
11798
+ "unique": true,
11799
+ "nullsNotDistinct": true
11800
+ },
11801
+ {
11802
+ "name": "workbooks_slug_context_idx",
11803
+ "columns": [
11804
+ "slug",
11805
+ "context"
11806
+ ]
11807
+ },
11808
+ {
11809
+ "name": "workbooks_tenant_id_created_at_idx",
11810
+ "columns": [
11811
+ "tenant_id",
11812
+ "created_at"
11813
+ ]
11814
+ },
11815
+ {
11816
+ "name": "workbooks_learner_id_idx",
11817
+ "columns": [
11818
+ "learner_id"
11819
+ ]
11820
+ }
11821
+ ],
11822
+ "version": "a5b56a39"
11823
+ },
11824
+ "importPath": "@happyvertical/smrt-education"
11825
+ },
11826
+ "@happyvertical/smrt-education:WorkbookCollection": {
11827
+ "name": "workbookcollection",
11828
+ "className": "WorkbookCollection",
11829
+ "qualifiedName": "@happyvertical/smrt-education:WorkbookCollection",
11830
+ "collection": "workbooks",
11831
+ "filePath": "/home/runner/work/smrt/smrt/packages/education/src/workbook-models.ts",
11832
+ "packageName": "@happyvertical/smrt-education",
11833
+ "fields": {},
11834
+ "methods": {},
11835
+ "decoratorConfig": {
11836
+ "tableName": "workbooks",
11837
+ "api": false,
11838
+ "mcp": false,
11839
+ "cli": false
11840
+ },
11841
+ "extends": "SmrtCollection",
11842
+ "extendsTypeArg": "Workbook",
11843
+ "exportName": "WorkbookCollection",
11844
+ "collectionExportName": "WorkbookCollectionCollection",
11845
+ "schema": {
11846
+ "tableName": "workbooks",
11847
+ "ddl": "CREATE TABLE IF NOT EXISTS \"workbooks\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"tenant_id\" UUID NOT NULL,\n \"learner_id\" UUID NOT NULL,\n \"workbook_key\" TEXT,\n \"title\" TEXT,\n \"edition\" TEXT,\n \"review_required\" BOOLEAN NOT NULL DEFAULT TRUE,\n \"policy_version\" INTEGER NOT NULL DEFAULT 1\n);",
11848
+ "columns": {
11849
+ "id": {
11850
+ "type": "UUID",
11851
+ "primaryKey": true,
11852
+ "referenceKind": "id",
11853
+ "notNull": true
11854
+ },
11855
+ "slug": {
11856
+ "type": "TEXT",
11857
+ "notNull": true
11858
+ },
11859
+ "context": {
11860
+ "type": "TEXT",
11861
+ "notNull": true,
11862
+ "default": ""
11863
+ },
11864
+ "created_at": {
11865
+ "type": "TIMESTAMP",
11866
+ "notNull": true,
11867
+ "default": "current_timestamp"
11868
+ },
11869
+ "updated_at": {
11870
+ "type": "TIMESTAMP",
11871
+ "notNull": true,
11872
+ "default": "current_timestamp"
11873
+ },
11874
+ "tenant_id": {
11875
+ "type": "UUID",
11876
+ "referenceKind": "tenantId",
11877
+ "notNull": true,
11878
+ "unique": false
11879
+ },
11880
+ "learner_id": {
11881
+ "type": "UUID",
11882
+ "referenceKind": "foreignKey",
11883
+ "notNull": true,
11884
+ "unique": false,
11885
+ "foreignKey": {
11886
+ "table": "learners",
11887
+ "column": "id",
11888
+ "onDelete": "CASCADE",
11889
+ "onUpdate": "CASCADE"
11890
+ }
11891
+ },
11892
+ "workbook_key": {
11893
+ "type": "TEXT",
11894
+ "notNull": false,
11895
+ "unique": false
11896
+ },
11897
+ "title": {
11898
+ "type": "TEXT",
11899
+ "notNull": false,
11900
+ "unique": false
11901
+ },
11902
+ "edition": {
11903
+ "type": "TEXT",
11904
+ "notNull": false,
11905
+ "unique": false
11906
+ },
11907
+ "review_required": {
11908
+ "type": "BOOLEAN",
11909
+ "notNull": true,
11910
+ "unique": false,
11911
+ "default": true
11912
+ },
11913
+ "policy_version": {
11914
+ "type": "INTEGER",
11915
+ "notNull": true,
11916
+ "unique": false,
11917
+ "default": 1
11918
+ }
11919
+ },
11920
+ "indexes": [
11921
+ {
11922
+ "name": "workbooks_tenant_id_learner_id_idx",
11923
+ "columns": [
11924
+ "tenant_id",
11925
+ "learner_id",
11926
+ "workbook_key"
11927
+ ],
11928
+ "unique": true,
11929
+ "nullsNotDistinct": true
11930
+ },
11931
+ {
11932
+ "name": "workbooks_slug_context_idx",
11933
+ "columns": [
11934
+ "slug",
11935
+ "context"
11936
+ ]
11937
+ },
11938
+ {
11939
+ "name": "workbooks_tenant_id_created_at_idx",
11940
+ "columns": [
11941
+ "tenant_id",
11942
+ "created_at"
11943
+ ]
11944
+ },
11945
+ {
11946
+ "name": "workbooks_learner_id_idx",
11947
+ "columns": [
11948
+ "learner_id"
11949
+ ]
11950
+ }
11951
+ ],
11952
+ "version": "a5b56a39"
11953
+ },
11954
+ "importPath": "@happyvertical/smrt-education"
11955
+ },
11956
+ "@happyvertical/smrt-education:WorkbookActivity": {
11957
+ "name": "workbookactivity",
11958
+ "className": "WorkbookActivity",
11959
+ "qualifiedName": "@happyvertical/smrt-education:WorkbookActivity",
11960
+ "collection": "workbookactivities",
11961
+ "description": "Education-owned private workbook record. Mutations go through WorkbookService.",
11962
+ "filePath": "/home/runner/work/smrt/smrt/packages/education/src/workbook-models.ts",
11963
+ "packageName": "@happyvertical/smrt-education",
11964
+ "fields": {
11965
+ "tenantId": {
11966
+ "type": "text",
11967
+ "required": true,
11968
+ "_meta": {
11969
+ "sqlType": "UUID",
11970
+ "__tenancy": {
11971
+ "isTenantIdField": true,
11972
+ "autoFilter": true,
11973
+ "required": true,
11974
+ "autoPopulate": true,
11975
+ "nullable": false,
11976
+ "mode": "required",
11977
+ "field": "tenantId",
11978
+ "allowSuperAdminBypass": false
11979
+ }
11980
+ }
11981
+ },
11982
+ "learnerId": {
11983
+ "type": "foreignKey",
11984
+ "required": true,
11985
+ "related": "Learner",
11986
+ "_meta": {
11987
+ "required": true
11988
+ }
11989
+ },
11990
+ "workbookId": {
11991
+ "type": "foreignKey",
11992
+ "required": false,
11993
+ "related": "Workbook",
11994
+ "_meta": {
11995
+ "nullable": true
11996
+ }
11997
+ },
11998
+ "captureKind": {
11999
+ "type": "text",
12000
+ "required": true,
12001
+ "default": "identified",
12002
+ "_meta": {
12003
+ "required": true,
12004
+ "default": "identified"
12005
+ }
12006
+ },
12007
+ "photoIntakeId": {
12008
+ "type": "foreignKey",
12009
+ "required": false,
12010
+ "related": "WorkbookPhotoIntake",
12011
+ "_meta": {
12012
+ "nullable": true
12013
+ }
12014
+ },
12015
+ "enrollmentId": {
12016
+ "type": "foreignKey",
12017
+ "required": true,
12018
+ "related": "Enrollment",
12019
+ "_meta": {
12020
+ "required": true
12021
+ }
12022
+ },
12023
+ "lessonId": {
12024
+ "type": "foreignKey",
12025
+ "required": true,
12026
+ "related": "Lesson",
12027
+ "_meta": {
12028
+ "required": true
12029
+ }
12030
+ },
12031
+ "pageKey": {
12032
+ "type": "text",
12033
+ "required": false
12034
+ },
12035
+ "pageLabel": {
12036
+ "type": "text",
12037
+ "required": false
12038
+ }
12039
+ },
12040
+ "methods": {
12041
+ "delete": {
12042
+ "name": "delete",
12043
+ "async": true,
12044
+ "parameters": [],
12045
+ "returnType": "Promise<void>",
12046
+ "isStatic": false,
12047
+ "isPublic": true
12048
+ },
12049
+ "save": {
12050
+ "name": "save",
12051
+ "async": true,
12052
+ "parameters": [],
12053
+ "returnType": "Promise<this>",
12054
+ "isStatic": false,
12055
+ "isPublic": true
12056
+ }
12057
+ },
12058
+ "decoratorConfig": {
12059
+ "tableName": "workbook_activities",
12060
+ "conflictColumns": [
12061
+ "tenant_id",
12062
+ "workbook_id",
12063
+ "page_key"
12064
+ ],
12065
+ "api": false,
12066
+ "mcp": false,
12067
+ "cli": false,
12068
+ "tenantScoped": {
12069
+ "mode": "required"
12070
+ }
12071
+ },
12072
+ "extends": "SmrtObject",
12073
+ "exportName": "WorkbookActivity",
12074
+ "collectionExportName": "WorkbookActivityCollection",
12075
+ "validationRules": [
12076
+ {
12077
+ "field": "learnerId",
12078
+ "rule": "required",
12079
+ "fieldType": "foreignKey"
12080
+ },
12081
+ {
12082
+ "field": "captureKind",
12083
+ "rule": "required",
12084
+ "fieldType": "text"
12085
+ },
12086
+ {
12087
+ "field": "enrollmentId",
12088
+ "rule": "required",
12089
+ "fieldType": "foreignKey"
12090
+ },
12091
+ {
12092
+ "field": "lessonId",
12093
+ "rule": "required",
12094
+ "fieldType": "foreignKey"
12095
+ }
12096
+ ],
12097
+ "schema": {
12098
+ "tableName": "workbook_activities",
12099
+ "ddl": "CREATE TABLE IF NOT EXISTS \"workbook_activities\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"tenant_id\" UUID NOT NULL,\n \"learner_id\" UUID NOT NULL,\n \"workbook_id\" UUID,\n \"capture_kind\" TEXT NOT NULL DEFAULT 'identified',\n \"photo_intake_id\" UUID,\n \"enrollment_id\" UUID NOT NULL,\n \"lesson_id\" UUID NOT NULL,\n \"page_key\" TEXT,\n \"page_label\" TEXT\n);",
12100
+ "columns": {
12101
+ "id": {
12102
+ "type": "UUID",
12103
+ "primaryKey": true,
12104
+ "referenceKind": "id",
12105
+ "notNull": true
12106
+ },
12107
+ "slug": {
12108
+ "type": "TEXT",
12109
+ "notNull": true
12110
+ },
12111
+ "context": {
12112
+ "type": "TEXT",
12113
+ "notNull": true,
12114
+ "default": ""
12115
+ },
12116
+ "created_at": {
12117
+ "type": "TIMESTAMP",
12118
+ "notNull": true,
12119
+ "default": "current_timestamp"
12120
+ },
12121
+ "updated_at": {
12122
+ "type": "TIMESTAMP",
12123
+ "notNull": true,
12124
+ "default": "current_timestamp"
12125
+ },
12126
+ "tenant_id": {
12127
+ "type": "UUID",
12128
+ "referenceKind": "tenantId",
12129
+ "notNull": true,
12130
+ "unique": false
12131
+ },
12132
+ "learner_id": {
12133
+ "type": "UUID",
12134
+ "referenceKind": "foreignKey",
12135
+ "notNull": true,
12136
+ "unique": false,
12137
+ "foreignKey": {
12138
+ "table": "learners",
12139
+ "column": "id",
12140
+ "onDelete": "NO ACTION",
12141
+ "onUpdate": "CASCADE"
12142
+ }
12143
+ },
12144
+ "workbook_id": {
12145
+ "type": "UUID",
12146
+ "referenceKind": "foreignKey",
12147
+ "notNull": false,
12148
+ "unique": false,
12149
+ "foreignKey": {
12150
+ "table": "workbooks",
12151
+ "column": "id",
12152
+ "onDelete": "CASCADE",
12153
+ "onUpdate": "CASCADE"
12154
+ }
12155
+ },
12156
+ "capture_kind": {
12157
+ "type": "TEXT",
12158
+ "notNull": true,
12159
+ "unique": false,
12160
+ "default": "identified"
12161
+ },
12162
+ "photo_intake_id": {
12163
+ "type": "UUID",
12164
+ "referenceKind": "foreignKey",
12165
+ "notNull": false,
12166
+ "unique": false,
12167
+ "foreignKey": {
12168
+ "table": "workbook_photo_intakes",
12169
+ "column": "id",
12170
+ "onDelete": "NO ACTION",
12171
+ "onUpdate": "CASCADE"
12172
+ }
12173
+ },
12174
+ "enrollment_id": {
12175
+ "type": "UUID",
12176
+ "referenceKind": "foreignKey",
12177
+ "notNull": true,
12178
+ "unique": false,
12179
+ "foreignKey": {
12180
+ "table": "enrollments",
12181
+ "column": "id",
12182
+ "onDelete": "NO ACTION",
12183
+ "onUpdate": "CASCADE"
12184
+ }
12185
+ },
12186
+ "lesson_id": {
12187
+ "type": "UUID",
12188
+ "referenceKind": "foreignKey",
12189
+ "notNull": true,
12190
+ "unique": false,
12191
+ "foreignKey": {
12192
+ "table": "lessons",
12193
+ "column": "id",
12194
+ "onDelete": "NO ACTION",
12195
+ "onUpdate": "CASCADE"
12196
+ }
12197
+ },
12198
+ "page_key": {
12199
+ "type": "TEXT",
12200
+ "notNull": false,
12201
+ "unique": false
12202
+ },
12203
+ "page_label": {
12204
+ "type": "TEXT",
12205
+ "notNull": false,
12206
+ "unique": false
12207
+ }
12208
+ },
12209
+ "indexes": [
12210
+ {
12211
+ "name": "workbook_activities_tenant_id_workbook_id_idx",
12212
+ "columns": [
12213
+ "tenant_id",
12214
+ "workbook_id",
12215
+ "page_key"
12216
+ ],
12217
+ "unique": true,
12218
+ "nullsNotDistinct": true
12219
+ },
12220
+ {
12221
+ "name": "workbook_activities_slug_context_idx",
12222
+ "columns": [
12223
+ "slug",
12224
+ "context"
12225
+ ]
12226
+ },
12227
+ {
12228
+ "name": "workbook_activities_tenant_id_created_at_idx",
12229
+ "columns": [
12230
+ "tenant_id",
12231
+ "created_at"
12232
+ ]
12233
+ },
12234
+ {
12235
+ "name": "workbook_activities_learner_id_idx",
12236
+ "columns": [
12237
+ "learner_id"
12238
+ ]
12239
+ },
12240
+ {
12241
+ "name": "workbook_activities_workbook_id_idx",
12242
+ "columns": [
12243
+ "workbook_id"
12244
+ ]
12245
+ },
12246
+ {
12247
+ "name": "workbook_activities_photo_intake_id_idx",
12248
+ "columns": [
12249
+ "photo_intake_id"
12250
+ ]
12251
+ },
12252
+ {
12253
+ "name": "workbook_activities_enrollment_id_idx",
12254
+ "columns": [
12255
+ "enrollment_id"
12256
+ ]
12257
+ },
12258
+ {
12259
+ "name": "workbook_activities_lesson_id_idx",
12260
+ "columns": [
12261
+ "lesson_id"
12262
+ ]
12263
+ }
12264
+ ],
12265
+ "version": "320c8eb0"
12266
+ },
12267
+ "importPath": "@happyvertical/smrt-education"
12268
+ },
12269
+ "@happyvertical/smrt-education:WorkbookActivityCollection": {
12270
+ "name": "workbookactivitycollection",
12271
+ "className": "WorkbookActivityCollection",
12272
+ "qualifiedName": "@happyvertical/smrt-education:WorkbookActivityCollection",
12273
+ "collection": "workbookactivities",
12274
+ "filePath": "/home/runner/work/smrt/smrt/packages/education/src/workbook-models.ts",
12275
+ "packageName": "@happyvertical/smrt-education",
12276
+ "fields": {},
12277
+ "methods": {},
12278
+ "decoratorConfig": {
12279
+ "tableName": "workbook_activities",
12280
+ "api": false,
12281
+ "mcp": false,
12282
+ "cli": false
12283
+ },
12284
+ "extends": "SmrtCollection",
12285
+ "extendsTypeArg": "WorkbookActivity",
12286
+ "exportName": "WorkbookActivityCollection",
12287
+ "collectionExportName": "WorkbookActivityCollectionCollection",
12288
+ "schema": {
12289
+ "tableName": "workbook_activities",
12290
+ "ddl": "CREATE TABLE IF NOT EXISTS \"workbook_activities\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"tenant_id\" UUID NOT NULL,\n \"learner_id\" UUID NOT NULL,\n \"workbook_id\" UUID,\n \"capture_kind\" TEXT NOT NULL DEFAULT 'identified',\n \"photo_intake_id\" UUID,\n \"enrollment_id\" UUID NOT NULL,\n \"lesson_id\" UUID NOT NULL,\n \"page_key\" TEXT,\n \"page_label\" TEXT\n);",
12291
+ "columns": {
12292
+ "id": {
12293
+ "type": "UUID",
12294
+ "primaryKey": true,
12295
+ "referenceKind": "id",
12296
+ "notNull": true
12297
+ },
12298
+ "slug": {
12299
+ "type": "TEXT",
12300
+ "notNull": true
12301
+ },
12302
+ "context": {
12303
+ "type": "TEXT",
12304
+ "notNull": true,
12305
+ "default": ""
12306
+ },
12307
+ "created_at": {
12308
+ "type": "TIMESTAMP",
12309
+ "notNull": true,
12310
+ "default": "current_timestamp"
12311
+ },
12312
+ "updated_at": {
12313
+ "type": "TIMESTAMP",
12314
+ "notNull": true,
12315
+ "default": "current_timestamp"
12316
+ },
12317
+ "tenant_id": {
12318
+ "type": "UUID",
12319
+ "referenceKind": "tenantId",
12320
+ "notNull": true,
12321
+ "unique": false
12322
+ },
12323
+ "learner_id": {
12324
+ "type": "UUID",
12325
+ "referenceKind": "foreignKey",
12326
+ "notNull": true,
12327
+ "unique": false,
12328
+ "foreignKey": {
12329
+ "table": "learners",
12330
+ "column": "id",
12331
+ "onDelete": "NO ACTION",
12332
+ "onUpdate": "CASCADE"
12333
+ }
12334
+ },
12335
+ "workbook_id": {
12336
+ "type": "UUID",
12337
+ "referenceKind": "foreignKey",
12338
+ "notNull": false,
12339
+ "unique": false,
12340
+ "foreignKey": {
12341
+ "table": "workbooks",
12342
+ "column": "id",
12343
+ "onDelete": "CASCADE",
12344
+ "onUpdate": "CASCADE"
12345
+ }
12346
+ },
12347
+ "capture_kind": {
12348
+ "type": "TEXT",
12349
+ "notNull": true,
12350
+ "unique": false,
12351
+ "default": "identified"
12352
+ },
12353
+ "photo_intake_id": {
12354
+ "type": "UUID",
12355
+ "referenceKind": "foreignKey",
12356
+ "notNull": false,
12357
+ "unique": false,
12358
+ "foreignKey": {
12359
+ "table": "workbook_photo_intakes",
12360
+ "column": "id",
12361
+ "onDelete": "NO ACTION",
12362
+ "onUpdate": "CASCADE"
12363
+ }
12364
+ },
12365
+ "enrollment_id": {
12366
+ "type": "UUID",
12367
+ "referenceKind": "foreignKey",
12368
+ "notNull": true,
12369
+ "unique": false,
12370
+ "foreignKey": {
12371
+ "table": "enrollments",
12372
+ "column": "id",
12373
+ "onDelete": "NO ACTION",
12374
+ "onUpdate": "CASCADE"
12375
+ }
12376
+ },
12377
+ "lesson_id": {
12378
+ "type": "UUID",
12379
+ "referenceKind": "foreignKey",
12380
+ "notNull": true,
12381
+ "unique": false,
12382
+ "foreignKey": {
12383
+ "table": "lessons",
12384
+ "column": "id",
12385
+ "onDelete": "NO ACTION",
12386
+ "onUpdate": "CASCADE"
12387
+ }
12388
+ },
12389
+ "page_key": {
12390
+ "type": "TEXT",
12391
+ "notNull": false,
12392
+ "unique": false
12393
+ },
12394
+ "page_label": {
12395
+ "type": "TEXT",
12396
+ "notNull": false,
12397
+ "unique": false
12398
+ }
12399
+ },
12400
+ "indexes": [
12401
+ {
12402
+ "name": "workbook_activities_tenant_id_workbook_id_idx",
12403
+ "columns": [
12404
+ "tenant_id",
12405
+ "workbook_id",
12406
+ "page_key"
12407
+ ],
12408
+ "unique": true,
12409
+ "nullsNotDistinct": true
12410
+ },
12411
+ {
12412
+ "name": "workbook_activities_slug_context_idx",
12413
+ "columns": [
12414
+ "slug",
12415
+ "context"
12416
+ ]
12417
+ },
12418
+ {
12419
+ "name": "workbook_activities_tenant_id_created_at_idx",
12420
+ "columns": [
12421
+ "tenant_id",
12422
+ "created_at"
12423
+ ]
12424
+ },
12425
+ {
12426
+ "name": "workbook_activities_learner_id_idx",
12427
+ "columns": [
12428
+ "learner_id"
12429
+ ]
12430
+ },
12431
+ {
12432
+ "name": "workbook_activities_workbook_id_idx",
12433
+ "columns": [
12434
+ "workbook_id"
12435
+ ]
12436
+ },
12437
+ {
12438
+ "name": "workbook_activities_photo_intake_id_idx",
12439
+ "columns": [
12440
+ "photo_intake_id"
12441
+ ]
12442
+ },
12443
+ {
12444
+ "name": "workbook_activities_enrollment_id_idx",
12445
+ "columns": [
12446
+ "enrollment_id"
12447
+ ]
12448
+ },
12449
+ {
12450
+ "name": "workbook_activities_lesson_id_idx",
12451
+ "columns": [
12452
+ "lesson_id"
12453
+ ]
12454
+ }
12455
+ ],
12456
+ "version": "320c8eb0"
12457
+ },
12458
+ "importPath": "@happyvertical/smrt-education"
12459
+ },
12460
+ "@happyvertical/smrt-education:WorkbookWorkFiling": {
12461
+ "name": "workbookworkfiling",
12462
+ "className": "WorkbookWorkFiling",
12463
+ "qualifiedName": "@happyvertical/smrt-education:WorkbookWorkFiling",
12464
+ "collection": "workbookworkfilings",
12465
+ "description": "Append-only association; the source work unit and its routing never move.",
12466
+ "filePath": "/home/runner/work/smrt/smrt/packages/education/src/workbook-models.ts",
12467
+ "packageName": "@happyvertical/smrt-education",
12468
+ "fields": {
12469
+ "tenantId": {
12470
+ "type": "text",
12471
+ "required": true,
12472
+ "_meta": {
12473
+ "sqlType": "UUID",
12474
+ "__tenancy": {
12475
+ "isTenantIdField": true,
12476
+ "autoFilter": true,
12477
+ "required": true,
12478
+ "autoPopulate": true,
12479
+ "nullable": false,
12480
+ "mode": "required",
12481
+ "field": "tenantId",
12482
+ "allowSuperAdminBypass": false
12483
+ }
12484
+ }
12485
+ },
12486
+ "learnerId": {
12487
+ "type": "foreignKey",
12488
+ "required": true,
12489
+ "related": "Learner",
12490
+ "_meta": {
12491
+ "required": true
12492
+ }
12493
+ },
12494
+ "sourceActivityId": {
12495
+ "type": "foreignKey",
12496
+ "required": true,
12497
+ "related": "WorkbookActivity",
12498
+ "_meta": {
12499
+ "required": true
12500
+ }
12501
+ },
12502
+ "workbookId": {
12503
+ "type": "foreignKey",
12504
+ "required": true,
12505
+ "related": "Workbook",
12506
+ "_meta": {
12507
+ "required": true
12508
+ }
12509
+ },
12510
+ "canonicalActivityId": {
12511
+ "type": "foreignKey",
12512
+ "required": false,
12513
+ "related": "WorkbookActivity",
12514
+ "_meta": {
12515
+ "nullable": true
12516
+ }
12517
+ },
12518
+ "previousRevisionId": {
12519
+ "type": "foreignKey",
12520
+ "required": false,
12521
+ "related": "WorkbookWorkFiling",
12522
+ "_meta": {
12523
+ "nullable": true
12524
+ }
12525
+ },
12526
+ "actorUserId": {
12527
+ "type": "text",
12528
+ "required": false
12529
+ },
12530
+ "requestKey": {
12531
+ "type": "text",
12532
+ "required": false
12533
+ },
12534
+ "reason": {
12535
+ "type": "text",
12536
+ "required": false
12537
+ },
12538
+ "digest": {
12539
+ "type": "text",
12540
+ "required": false
12541
+ }
12542
+ },
12543
+ "methods": {
12544
+ "delete": {
12545
+ "name": "delete",
12546
+ "async": true,
12547
+ "parameters": [],
12548
+ "returnType": "Promise<void>",
12549
+ "isStatic": false,
12550
+ "isPublic": true
12551
+ },
12552
+ "save": {
12553
+ "name": "save",
12554
+ "async": true,
12555
+ "parameters": [],
12556
+ "returnType": "Promise<this>",
12557
+ "isStatic": false,
12558
+ "isPublic": true
12559
+ }
12560
+ },
12561
+ "decoratorConfig": {
12562
+ "tableName": "workbook_work_filings",
12563
+ "conflictColumns": [
12564
+ "tenant_id",
12565
+ "source_activity_id",
12566
+ "request_key"
12567
+ ],
12568
+ "api": false,
12569
+ "mcp": false,
12570
+ "cli": false,
12571
+ "tenantScoped": {
12572
+ "mode": "required"
12573
+ }
12574
+ },
12575
+ "extends": "SmrtObject",
12576
+ "exportName": "WorkbookWorkFiling",
12577
+ "collectionExportName": "WorkbookWorkFilingCollection",
12578
+ "validationRules": [
12579
+ {
12580
+ "field": "learnerId",
12581
+ "rule": "required",
12582
+ "fieldType": "foreignKey"
12583
+ },
12584
+ {
12585
+ "field": "sourceActivityId",
12586
+ "rule": "required",
12587
+ "fieldType": "foreignKey"
12588
+ },
12589
+ {
12590
+ "field": "workbookId",
12591
+ "rule": "required",
12592
+ "fieldType": "foreignKey"
12593
+ }
12594
+ ],
12595
+ "schema": {
12596
+ "tableName": "workbook_work_filings",
12597
+ "ddl": "CREATE TABLE IF NOT EXISTS \"workbook_work_filings\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"tenant_id\" UUID NOT NULL,\n \"learner_id\" UUID NOT NULL,\n \"source_activity_id\" UUID NOT NULL,\n \"workbook_id\" UUID NOT NULL,\n \"canonical_activity_id\" UUID,\n \"previous_revision_id\" UUID,\n \"actor_user_id\" TEXT,\n \"request_key\" TEXT,\n \"reason\" TEXT,\n \"digest\" TEXT\n);",
12598
+ "columns": {
12599
+ "id": {
12600
+ "type": "UUID",
12601
+ "primaryKey": true,
12602
+ "referenceKind": "id",
12603
+ "notNull": true
12604
+ },
12605
+ "slug": {
12606
+ "type": "TEXT",
12607
+ "notNull": true
12608
+ },
12609
+ "context": {
12610
+ "type": "TEXT",
12611
+ "notNull": true,
12612
+ "default": ""
12613
+ },
12614
+ "created_at": {
12615
+ "type": "TIMESTAMP",
12616
+ "notNull": true,
12617
+ "default": "current_timestamp"
12618
+ },
12619
+ "updated_at": {
12620
+ "type": "TIMESTAMP",
12621
+ "notNull": true,
12622
+ "default": "current_timestamp"
12623
+ },
12624
+ "tenant_id": {
12625
+ "type": "UUID",
12626
+ "referenceKind": "tenantId",
12627
+ "notNull": true,
12628
+ "unique": false
12629
+ },
12630
+ "learner_id": {
12631
+ "type": "UUID",
12632
+ "referenceKind": "foreignKey",
12633
+ "notNull": true,
12634
+ "unique": false,
12635
+ "foreignKey": {
12636
+ "table": "learners",
12637
+ "column": "id",
12638
+ "onDelete": "NO ACTION",
12639
+ "onUpdate": "CASCADE"
12640
+ }
12641
+ },
12642
+ "source_activity_id": {
12643
+ "type": "UUID",
12644
+ "referenceKind": "foreignKey",
12645
+ "notNull": true,
12646
+ "unique": false,
12647
+ "foreignKey": {
12648
+ "table": "workbook_activities",
12649
+ "column": "id",
12650
+ "onDelete": "CASCADE",
12651
+ "onUpdate": "CASCADE"
12652
+ }
12653
+ },
12654
+ "workbook_id": {
12655
+ "type": "UUID",
12656
+ "referenceKind": "foreignKey",
12657
+ "notNull": true,
12658
+ "unique": false,
12659
+ "foreignKey": {
12660
+ "table": "workbooks",
12661
+ "column": "id",
12662
+ "onDelete": "NO ACTION",
12663
+ "onUpdate": "CASCADE"
12664
+ }
12665
+ },
12666
+ "canonical_activity_id": {
12667
+ "type": "UUID",
12668
+ "referenceKind": "foreignKey",
12669
+ "notNull": false,
12670
+ "unique": false,
12671
+ "foreignKey": {
12672
+ "table": "workbook_activities",
12673
+ "column": "id",
12674
+ "onDelete": "NO ACTION",
12675
+ "onUpdate": "CASCADE"
12676
+ }
12677
+ },
12678
+ "previous_revision_id": {
12679
+ "type": "UUID",
12680
+ "referenceKind": "foreignKey",
12681
+ "notNull": false,
12682
+ "unique": false,
12683
+ "foreignKey": {
12684
+ "table": "workbook_work_filings",
12685
+ "column": "id",
12686
+ "onDelete": "NO ACTION",
12687
+ "onUpdate": "CASCADE"
12688
+ }
12689
+ },
12690
+ "actor_user_id": {
12691
+ "type": "TEXT",
12692
+ "notNull": false,
12693
+ "unique": false
12694
+ },
12695
+ "request_key": {
12696
+ "type": "TEXT",
12697
+ "notNull": false,
12698
+ "unique": false
12699
+ },
12700
+ "reason": {
12701
+ "type": "TEXT",
12702
+ "notNull": false,
12703
+ "unique": false
12704
+ },
12705
+ "digest": {
12706
+ "type": "TEXT",
12707
+ "notNull": false,
12708
+ "unique": false
12709
+ }
12710
+ },
12711
+ "indexes": [
12712
+ {
12713
+ "name": "workbook_work_filings_tenant_id_source_activity_id_idx",
12714
+ "columns": [
12715
+ "tenant_id",
12716
+ "source_activity_id",
12717
+ "request_key"
12718
+ ],
12719
+ "unique": true,
12720
+ "nullsNotDistinct": true
12721
+ },
12722
+ {
12723
+ "name": "workbook_work_filings_slug_context_idx",
12724
+ "columns": [
12725
+ "slug",
12726
+ "context"
12727
+ ]
12728
+ },
12729
+ {
12730
+ "name": "workbook_work_filings_tenant_id_created_at_idx",
12731
+ "columns": [
12732
+ "tenant_id",
12733
+ "created_at"
12734
+ ]
12735
+ },
12736
+ {
12737
+ "name": "workbook_work_filings_learner_id_idx",
12738
+ "columns": [
12739
+ "learner_id"
12740
+ ]
12741
+ },
12742
+ {
12743
+ "name": "workbook_work_filings_source_activity_id_idx",
12744
+ "columns": [
12745
+ "source_activity_id"
12746
+ ]
12747
+ },
12748
+ {
12749
+ "name": "workbook_work_filings_workbook_id_idx",
12750
+ "columns": [
12751
+ "workbook_id"
12752
+ ]
12753
+ },
12754
+ {
12755
+ "name": "workbook_work_filings_canonical_activity_id_idx",
12756
+ "columns": [
12757
+ "canonical_activity_id"
12758
+ ]
12759
+ },
12760
+ {
12761
+ "name": "workbook_work_filings_previous_revision_id_idx",
12762
+ "columns": [
12763
+ "previous_revision_id"
12764
+ ]
12765
+ }
12766
+ ],
12767
+ "version": "03e989a0"
12768
+ },
12769
+ "importPath": "@happyvertical/smrt-education"
12770
+ },
12771
+ "@happyvertical/smrt-education:WorkbookWorkFilingCollection": {
12772
+ "name": "workbookworkfilingcollection",
12773
+ "className": "WorkbookWorkFilingCollection",
12774
+ "qualifiedName": "@happyvertical/smrt-education:WorkbookWorkFilingCollection",
12775
+ "collection": "workbookworkfilings",
12776
+ "filePath": "/home/runner/work/smrt/smrt/packages/education/src/workbook-models.ts",
12777
+ "packageName": "@happyvertical/smrt-education",
12778
+ "fields": {},
12779
+ "methods": {},
12780
+ "decoratorConfig": {
12781
+ "tableName": "workbook_work_filings",
12782
+ "api": false,
12783
+ "mcp": false,
12784
+ "cli": false
12785
+ },
12786
+ "extends": "SmrtCollection",
12787
+ "extendsTypeArg": "WorkbookWorkFiling",
12788
+ "exportName": "WorkbookWorkFilingCollection",
12789
+ "collectionExportName": "WorkbookWorkFilingCollectionCollection",
12790
+ "schema": {
12791
+ "tableName": "workbook_work_filings",
12792
+ "ddl": "CREATE TABLE IF NOT EXISTS \"workbook_work_filings\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"tenant_id\" UUID NOT NULL,\n \"learner_id\" UUID NOT NULL,\n \"source_activity_id\" UUID NOT NULL,\n \"workbook_id\" UUID NOT NULL,\n \"canonical_activity_id\" UUID,\n \"previous_revision_id\" UUID,\n \"actor_user_id\" TEXT,\n \"request_key\" TEXT,\n \"reason\" TEXT,\n \"digest\" TEXT\n);",
12793
+ "columns": {
12794
+ "id": {
12795
+ "type": "UUID",
12796
+ "primaryKey": true,
12797
+ "referenceKind": "id",
12798
+ "notNull": true
12799
+ },
12800
+ "slug": {
12801
+ "type": "TEXT",
12802
+ "notNull": true
12803
+ },
12804
+ "context": {
12805
+ "type": "TEXT",
12806
+ "notNull": true,
12807
+ "default": ""
12808
+ },
12809
+ "created_at": {
12810
+ "type": "TIMESTAMP",
12811
+ "notNull": true,
12812
+ "default": "current_timestamp"
12813
+ },
12814
+ "updated_at": {
12815
+ "type": "TIMESTAMP",
12816
+ "notNull": true,
12817
+ "default": "current_timestamp"
12818
+ },
12819
+ "tenant_id": {
12820
+ "type": "UUID",
12821
+ "referenceKind": "tenantId",
12822
+ "notNull": true,
12823
+ "unique": false
12824
+ },
12825
+ "learner_id": {
12826
+ "type": "UUID",
12827
+ "referenceKind": "foreignKey",
12828
+ "notNull": true,
12829
+ "unique": false,
12830
+ "foreignKey": {
12831
+ "table": "learners",
12832
+ "column": "id",
12833
+ "onDelete": "NO ACTION",
12834
+ "onUpdate": "CASCADE"
12835
+ }
12836
+ },
12837
+ "source_activity_id": {
12838
+ "type": "UUID",
12839
+ "referenceKind": "foreignKey",
12840
+ "notNull": true,
12841
+ "unique": false,
12842
+ "foreignKey": {
12843
+ "table": "workbook_activities",
12844
+ "column": "id",
12845
+ "onDelete": "CASCADE",
12846
+ "onUpdate": "CASCADE"
12847
+ }
12848
+ },
12849
+ "workbook_id": {
12850
+ "type": "UUID",
12851
+ "referenceKind": "foreignKey",
12852
+ "notNull": true,
12853
+ "unique": false,
12854
+ "foreignKey": {
12855
+ "table": "workbooks",
12856
+ "column": "id",
12857
+ "onDelete": "NO ACTION",
12858
+ "onUpdate": "CASCADE"
12859
+ }
12860
+ },
12861
+ "canonical_activity_id": {
12862
+ "type": "UUID",
12863
+ "referenceKind": "foreignKey",
12864
+ "notNull": false,
12865
+ "unique": false,
12866
+ "foreignKey": {
12867
+ "table": "workbook_activities",
12868
+ "column": "id",
12869
+ "onDelete": "NO ACTION",
12870
+ "onUpdate": "CASCADE"
12871
+ }
12872
+ },
12873
+ "previous_revision_id": {
12874
+ "type": "UUID",
12875
+ "referenceKind": "foreignKey",
12876
+ "notNull": false,
12877
+ "unique": false,
12878
+ "foreignKey": {
12879
+ "table": "workbook_work_filings",
12880
+ "column": "id",
12881
+ "onDelete": "NO ACTION",
12882
+ "onUpdate": "CASCADE"
12883
+ }
12884
+ },
12885
+ "actor_user_id": {
12886
+ "type": "TEXT",
12887
+ "notNull": false,
12888
+ "unique": false
12889
+ },
12890
+ "request_key": {
12891
+ "type": "TEXT",
12892
+ "notNull": false,
12893
+ "unique": false
12894
+ },
12895
+ "reason": {
12896
+ "type": "TEXT",
12897
+ "notNull": false,
12898
+ "unique": false
12899
+ },
12900
+ "digest": {
12901
+ "type": "TEXT",
12902
+ "notNull": false,
12903
+ "unique": false
12904
+ }
12905
+ },
12906
+ "indexes": [
12907
+ {
12908
+ "name": "workbook_work_filings_tenant_id_source_activity_id_idx",
12909
+ "columns": [
12910
+ "tenant_id",
12911
+ "source_activity_id",
12912
+ "request_key"
12913
+ ],
12914
+ "unique": true,
12915
+ "nullsNotDistinct": true
12916
+ },
12917
+ {
12918
+ "name": "workbook_work_filings_slug_context_idx",
12919
+ "columns": [
12920
+ "slug",
12921
+ "context"
12922
+ ]
12923
+ },
12924
+ {
12925
+ "name": "workbook_work_filings_tenant_id_created_at_idx",
12926
+ "columns": [
12927
+ "tenant_id",
12928
+ "created_at"
12929
+ ]
12930
+ },
12931
+ {
12932
+ "name": "workbook_work_filings_learner_id_idx",
12933
+ "columns": [
12934
+ "learner_id"
12935
+ ]
12936
+ },
12937
+ {
12938
+ "name": "workbook_work_filings_source_activity_id_idx",
12939
+ "columns": [
12940
+ "source_activity_id"
12941
+ ]
12942
+ },
12943
+ {
12944
+ "name": "workbook_work_filings_workbook_id_idx",
12945
+ "columns": [
12946
+ "workbook_id"
12947
+ ]
12948
+ },
12949
+ {
12950
+ "name": "workbook_work_filings_canonical_activity_id_idx",
12951
+ "columns": [
12952
+ "canonical_activity_id"
12953
+ ]
12954
+ },
12955
+ {
12956
+ "name": "workbook_work_filings_previous_revision_id_idx",
12957
+ "columns": [
12958
+ "previous_revision_id"
12959
+ ]
12960
+ }
12961
+ ],
12962
+ "version": "03e989a0"
12963
+ },
12964
+ "importPath": "@happyvertical/smrt-education"
12965
+ },
12966
+ "@happyvertical/smrt-education:WorkbookAttempt": {
12967
+ "name": "workbookattempt",
12968
+ "className": "WorkbookAttempt",
12969
+ "qualifiedName": "@happyvertical/smrt-education:WorkbookAttempt",
12970
+ "collection": "workbookattempts",
12971
+ "description": "Education-owned private workbook record. Mutations go through WorkbookService.",
12972
+ "filePath": "/home/runner/work/smrt/smrt/packages/education/src/workbook-models.ts",
12973
+ "packageName": "@happyvertical/smrt-education",
12974
+ "fields": {
12975
+ "tenantId": {
12976
+ "type": "text",
12977
+ "required": true,
12978
+ "_meta": {
12979
+ "sqlType": "UUID",
12980
+ "__tenancy": {
12981
+ "isTenantIdField": true,
12982
+ "autoFilter": true,
12983
+ "required": true,
12984
+ "autoPopulate": true,
12985
+ "nullable": false,
12986
+ "mode": "required",
12987
+ "field": "tenantId",
12988
+ "allowSuperAdminBypass": false
12989
+ }
12990
+ }
12991
+ },
12992
+ "learnerId": {
12993
+ "type": "foreignKey",
12994
+ "required": true,
12995
+ "related": "Learner",
12996
+ "_meta": {
12997
+ "required": true
12998
+ }
12999
+ },
13000
+ "activityId": {
13001
+ "type": "foreignKey",
13002
+ "required": true,
13003
+ "related": "WorkbookActivity",
13004
+ "_meta": {
13005
+ "required": true
13006
+ }
13007
+ },
13008
+ "submissionId": {
13009
+ "type": "foreignKey",
13010
+ "required": true,
13011
+ "related": "Submission",
13012
+ "_meta": {
13013
+ "required": true
13014
+ }
13015
+ },
13016
+ "previousAttemptId": {
13017
+ "type": "foreignKey",
13018
+ "required": false,
13019
+ "related": "WorkbookAttempt",
13020
+ "_meta": {
13021
+ "nullable": true
13022
+ }
13023
+ },
13024
+ "capturedAt": {
13025
+ "type": "text",
13026
+ "required": false
13027
+ },
13028
+ "episodeId": {
13029
+ "type": "text",
13030
+ "required": false
13031
+ },
13032
+ "reviewRequired": {
13033
+ "type": "boolean",
13034
+ "required": true,
13035
+ "default": true
13036
+ },
13037
+ "policyVersion": {
13038
+ "type": "integer",
13039
+ "required": true,
13040
+ "default": 1
13041
+ },
13042
+ "assistance": {
13043
+ "type": "text",
13044
+ "required": false
13045
+ },
13046
+ "actorUserId": {
13047
+ "type": "text",
13048
+ "required": false
13049
+ },
13050
+ "sourceHashes": {
13051
+ "type": "text",
13052
+ "required": false,
13053
+ "_meta": {}
13054
+ }
13055
+ },
13056
+ "methods": {
13057
+ "delete": {
13058
+ "name": "delete",
13059
+ "async": true,
13060
+ "parameters": [],
13061
+ "returnType": "Promise<void>",
13062
+ "isStatic": false,
13063
+ "isPublic": true
13064
+ },
13065
+ "save": {
13066
+ "name": "save",
13067
+ "async": true,
13068
+ "parameters": [],
13069
+ "returnType": "Promise<this>",
13070
+ "isStatic": false,
13071
+ "isPublic": true
13072
+ }
13073
+ },
13074
+ "decoratorConfig": {
13075
+ "tableName": "workbook_attempts",
13076
+ "conflictColumns": [
13077
+ "tenant_id",
13078
+ "submission_id"
13079
+ ],
13080
+ "api": false,
13081
+ "mcp": false,
13082
+ "cli": false,
13083
+ "tenantScoped": {
13084
+ "mode": "required"
13085
+ }
13086
+ },
13087
+ "extends": "SmrtObject",
13088
+ "exportName": "WorkbookAttempt",
13089
+ "collectionExportName": "WorkbookAttemptCollection",
13090
+ "validationRules": [
13091
+ {
13092
+ "field": "learnerId",
13093
+ "rule": "required",
13094
+ "fieldType": "foreignKey"
13095
+ },
13096
+ {
13097
+ "field": "activityId",
13098
+ "rule": "required",
13099
+ "fieldType": "foreignKey"
13100
+ },
13101
+ {
13102
+ "field": "submissionId",
13103
+ "rule": "required",
13104
+ "fieldType": "foreignKey"
13105
+ },
13106
+ {
13107
+ "field": "reviewRequired",
13108
+ "rule": "required",
13109
+ "fieldType": "boolean"
13110
+ },
13111
+ {
13112
+ "field": "policyVersion",
13113
+ "rule": "required",
13114
+ "fieldType": "integer"
13115
+ }
13116
+ ],
13117
+ "schema": {
13118
+ "tableName": "workbook_attempts",
13119
+ "ddl": "CREATE TABLE IF NOT EXISTS \"workbook_attempts\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"tenant_id\" UUID NOT NULL,\n \"learner_id\" UUID NOT NULL,\n \"activity_id\" UUID NOT NULL,\n \"submission_id\" UUID NOT NULL,\n \"previous_attempt_id\" UUID,\n \"captured_at\" TEXT,\n \"episode_id\" TEXT,\n \"review_required\" BOOLEAN NOT NULL DEFAULT TRUE,\n \"policy_version\" INTEGER NOT NULL DEFAULT 1,\n \"assistance\" TEXT,\n \"actor_user_id\" TEXT,\n \"source_hashes\" TEXT\n);",
13120
+ "columns": {
13121
+ "id": {
13122
+ "type": "UUID",
13123
+ "primaryKey": true,
13124
+ "referenceKind": "id",
13125
+ "notNull": true
13126
+ },
13127
+ "slug": {
13128
+ "type": "TEXT",
13129
+ "notNull": true
13130
+ },
13131
+ "context": {
13132
+ "type": "TEXT",
13133
+ "notNull": true,
13134
+ "default": ""
13135
+ },
13136
+ "created_at": {
13137
+ "type": "TIMESTAMP",
13138
+ "notNull": true,
13139
+ "default": "current_timestamp"
13140
+ },
13141
+ "updated_at": {
13142
+ "type": "TIMESTAMP",
13143
+ "notNull": true,
13144
+ "default": "current_timestamp"
13145
+ },
13146
+ "tenant_id": {
13147
+ "type": "UUID",
13148
+ "referenceKind": "tenantId",
13149
+ "notNull": true,
13150
+ "unique": false
13151
+ },
13152
+ "learner_id": {
13153
+ "type": "UUID",
13154
+ "referenceKind": "foreignKey",
13155
+ "notNull": true,
13156
+ "unique": false,
13157
+ "foreignKey": {
13158
+ "table": "learners",
13159
+ "column": "id",
13160
+ "onDelete": "NO ACTION",
13161
+ "onUpdate": "CASCADE"
13162
+ }
13163
+ },
13164
+ "activity_id": {
13165
+ "type": "UUID",
13166
+ "referenceKind": "foreignKey",
13167
+ "notNull": true,
13168
+ "unique": false,
13169
+ "foreignKey": {
13170
+ "table": "workbook_activities",
13171
+ "column": "id",
13172
+ "onDelete": "NO ACTION",
13173
+ "onUpdate": "CASCADE"
13174
+ }
13175
+ },
13176
+ "submission_id": {
13177
+ "type": "UUID",
13178
+ "referenceKind": "foreignKey",
13179
+ "notNull": true,
13180
+ "unique": false,
13181
+ "foreignKey": {
13182
+ "table": "submissions",
13183
+ "column": "id",
13184
+ "onDelete": "CASCADE",
13185
+ "onUpdate": "CASCADE"
13186
+ }
13187
+ },
13188
+ "previous_attempt_id": {
13189
+ "type": "UUID",
13190
+ "referenceKind": "foreignKey",
13191
+ "notNull": false,
13192
+ "unique": false,
13193
+ "foreignKey": {
13194
+ "table": "workbook_attempts",
13195
+ "column": "id",
13196
+ "onDelete": "NO ACTION",
13197
+ "onUpdate": "CASCADE"
13198
+ }
13199
+ },
13200
+ "captured_at": {
13201
+ "type": "TEXT",
13202
+ "notNull": false,
13203
+ "unique": false
13204
+ },
13205
+ "episode_id": {
13206
+ "type": "TEXT",
13207
+ "notNull": false,
13208
+ "unique": false
13209
+ },
13210
+ "review_required": {
13211
+ "type": "BOOLEAN",
13212
+ "notNull": true,
13213
+ "unique": false,
13214
+ "default": true
13215
+ },
13216
+ "policy_version": {
13217
+ "type": "INTEGER",
13218
+ "notNull": true,
13219
+ "unique": false,
13220
+ "default": 1
13221
+ },
13222
+ "assistance": {
13223
+ "type": "TEXT",
13224
+ "notNull": false,
13225
+ "unique": false
13226
+ },
13227
+ "actor_user_id": {
13228
+ "type": "TEXT",
13229
+ "notNull": false,
13230
+ "unique": false
13231
+ },
13232
+ "source_hashes": {
13233
+ "type": "TEXT",
13234
+ "notNull": false,
13235
+ "unique": false
13236
+ }
13237
+ },
13238
+ "indexes": [
13239
+ {
13240
+ "name": "workbook_attempts_tenant_id_submission_id_idx",
13241
+ "columns": [
13242
+ "tenant_id",
13243
+ "submission_id"
13244
+ ],
13245
+ "unique": true
13246
+ },
13247
+ {
13248
+ "name": "workbook_attempts_slug_context_idx",
13249
+ "columns": [
13250
+ "slug",
13251
+ "context"
13252
+ ]
13253
+ },
13254
+ {
13255
+ "name": "workbook_attempts_tenant_id_created_at_idx",
13256
+ "columns": [
13257
+ "tenant_id",
13258
+ "created_at"
13259
+ ]
13260
+ },
13261
+ {
13262
+ "name": "workbook_attempts_learner_id_idx",
13263
+ "columns": [
13264
+ "learner_id"
13265
+ ]
13266
+ },
13267
+ {
13268
+ "name": "workbook_attempts_activity_id_idx",
13269
+ "columns": [
13270
+ "activity_id"
13271
+ ]
13272
+ },
13273
+ {
13274
+ "name": "workbook_attempts_submission_id_idx",
13275
+ "columns": [
13276
+ "submission_id"
13277
+ ]
13278
+ },
13279
+ {
13280
+ "name": "workbook_attempts_previous_attempt_id_idx",
13281
+ "columns": [
13282
+ "previous_attempt_id"
13283
+ ]
13284
+ }
13285
+ ],
13286
+ "version": "bd9cdd9f"
13287
+ },
13288
+ "importPath": "@happyvertical/smrt-education"
13289
+ },
13290
+ "@happyvertical/smrt-education:WorkbookAttemptCollection": {
13291
+ "name": "workbookattemptcollection",
13292
+ "className": "WorkbookAttemptCollection",
13293
+ "qualifiedName": "@happyvertical/smrt-education:WorkbookAttemptCollection",
13294
+ "collection": "workbookattempts",
13295
+ "filePath": "/home/runner/work/smrt/smrt/packages/education/src/workbook-models.ts",
13296
+ "packageName": "@happyvertical/smrt-education",
13297
+ "fields": {},
13298
+ "methods": {},
13299
+ "decoratorConfig": {
13300
+ "tableName": "workbook_attempts",
13301
+ "api": false,
13302
+ "mcp": false,
13303
+ "cli": false
13304
+ },
13305
+ "extends": "SmrtCollection",
13306
+ "extendsTypeArg": "WorkbookAttempt",
13307
+ "exportName": "WorkbookAttemptCollection",
13308
+ "collectionExportName": "WorkbookAttemptCollectionCollection",
13309
+ "schema": {
13310
+ "tableName": "workbook_attempts",
13311
+ "ddl": "CREATE TABLE IF NOT EXISTS \"workbook_attempts\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"tenant_id\" UUID NOT NULL,\n \"learner_id\" UUID NOT NULL,\n \"activity_id\" UUID NOT NULL,\n \"submission_id\" UUID NOT NULL,\n \"previous_attempt_id\" UUID,\n \"captured_at\" TEXT,\n \"episode_id\" TEXT,\n \"review_required\" BOOLEAN NOT NULL DEFAULT TRUE,\n \"policy_version\" INTEGER NOT NULL DEFAULT 1,\n \"assistance\" TEXT,\n \"actor_user_id\" TEXT,\n \"source_hashes\" TEXT\n);",
13312
+ "columns": {
13313
+ "id": {
13314
+ "type": "UUID",
13315
+ "primaryKey": true,
13316
+ "referenceKind": "id",
13317
+ "notNull": true
13318
+ },
13319
+ "slug": {
13320
+ "type": "TEXT",
13321
+ "notNull": true
13322
+ },
13323
+ "context": {
13324
+ "type": "TEXT",
13325
+ "notNull": true,
13326
+ "default": ""
13327
+ },
13328
+ "created_at": {
13329
+ "type": "TIMESTAMP",
13330
+ "notNull": true,
13331
+ "default": "current_timestamp"
13332
+ },
13333
+ "updated_at": {
13334
+ "type": "TIMESTAMP",
13335
+ "notNull": true,
13336
+ "default": "current_timestamp"
13337
+ },
13338
+ "tenant_id": {
13339
+ "type": "UUID",
13340
+ "referenceKind": "tenantId",
13341
+ "notNull": true,
13342
+ "unique": false
13343
+ },
13344
+ "learner_id": {
13345
+ "type": "UUID",
13346
+ "referenceKind": "foreignKey",
13347
+ "notNull": true,
13348
+ "unique": false,
13349
+ "foreignKey": {
13350
+ "table": "learners",
13351
+ "column": "id",
13352
+ "onDelete": "NO ACTION",
13353
+ "onUpdate": "CASCADE"
13354
+ }
13355
+ },
13356
+ "activity_id": {
13357
+ "type": "UUID",
13358
+ "referenceKind": "foreignKey",
13359
+ "notNull": true,
13360
+ "unique": false,
13361
+ "foreignKey": {
13362
+ "table": "workbook_activities",
13363
+ "column": "id",
13364
+ "onDelete": "NO ACTION",
13365
+ "onUpdate": "CASCADE"
13366
+ }
13367
+ },
13368
+ "submission_id": {
13369
+ "type": "UUID",
13370
+ "referenceKind": "foreignKey",
13371
+ "notNull": true,
13372
+ "unique": false,
13373
+ "foreignKey": {
13374
+ "table": "submissions",
13375
+ "column": "id",
13376
+ "onDelete": "CASCADE",
13377
+ "onUpdate": "CASCADE"
13378
+ }
13379
+ },
13380
+ "previous_attempt_id": {
13381
+ "type": "UUID",
13382
+ "referenceKind": "foreignKey",
13383
+ "notNull": false,
13384
+ "unique": false,
13385
+ "foreignKey": {
13386
+ "table": "workbook_attempts",
13387
+ "column": "id",
13388
+ "onDelete": "NO ACTION",
13389
+ "onUpdate": "CASCADE"
13390
+ }
13391
+ },
13392
+ "captured_at": {
13393
+ "type": "TEXT",
13394
+ "notNull": false,
13395
+ "unique": false
13396
+ },
13397
+ "episode_id": {
13398
+ "type": "TEXT",
13399
+ "notNull": false,
13400
+ "unique": false
13401
+ },
13402
+ "review_required": {
13403
+ "type": "BOOLEAN",
13404
+ "notNull": true,
13405
+ "unique": false,
13406
+ "default": true
13407
+ },
13408
+ "policy_version": {
13409
+ "type": "INTEGER",
13410
+ "notNull": true,
13411
+ "unique": false,
13412
+ "default": 1
13413
+ },
13414
+ "assistance": {
13415
+ "type": "TEXT",
13416
+ "notNull": false,
13417
+ "unique": false
13418
+ },
13419
+ "actor_user_id": {
13420
+ "type": "TEXT",
13421
+ "notNull": false,
13422
+ "unique": false
13423
+ },
13424
+ "source_hashes": {
13425
+ "type": "TEXT",
13426
+ "notNull": false,
13427
+ "unique": false
13428
+ }
13429
+ },
13430
+ "indexes": [
13431
+ {
13432
+ "name": "workbook_attempts_tenant_id_submission_id_idx",
13433
+ "columns": [
13434
+ "tenant_id",
13435
+ "submission_id"
13436
+ ],
13437
+ "unique": true
13438
+ },
13439
+ {
13440
+ "name": "workbook_attempts_slug_context_idx",
13441
+ "columns": [
13442
+ "slug",
13443
+ "context"
13444
+ ]
13445
+ },
13446
+ {
13447
+ "name": "workbook_attempts_tenant_id_created_at_idx",
13448
+ "columns": [
13449
+ "tenant_id",
13450
+ "created_at"
13451
+ ]
13452
+ },
13453
+ {
13454
+ "name": "workbook_attempts_learner_id_idx",
13455
+ "columns": [
13456
+ "learner_id"
13457
+ ]
13458
+ },
13459
+ {
13460
+ "name": "workbook_attempts_activity_id_idx",
13461
+ "columns": [
13462
+ "activity_id"
13463
+ ]
13464
+ },
13465
+ {
13466
+ "name": "workbook_attempts_submission_id_idx",
13467
+ "columns": [
13468
+ "submission_id"
13469
+ ]
13470
+ },
13471
+ {
13472
+ "name": "workbook_attempts_previous_attempt_id_idx",
13473
+ "columns": [
13474
+ "previous_attempt_id"
13475
+ ]
13476
+ }
13477
+ ],
13478
+ "version": "bd9cdd9f"
13479
+ },
13480
+ "importPath": "@happyvertical/smrt-education"
13481
+ },
13482
+ "@happyvertical/smrt-education:WorkbookAssessmentRevision": {
13483
+ "name": "workbookassessmentrevision",
13484
+ "className": "WorkbookAssessmentRevision",
13485
+ "qualifiedName": "@happyvertical/smrt-education:WorkbookAssessmentRevision",
13486
+ "collection": "workbookassessmentrevisions",
13487
+ "description": "Education-owned private workbook record. Mutations go through WorkbookService.",
13488
+ "filePath": "/home/runner/work/smrt/smrt/packages/education/src/workbook-models.ts",
13489
+ "packageName": "@happyvertical/smrt-education",
13490
+ "fields": {
13491
+ "tenantId": {
13492
+ "type": "text",
13493
+ "required": true,
13494
+ "_meta": {
13495
+ "sqlType": "UUID",
13496
+ "__tenancy": {
13497
+ "isTenantIdField": true,
13498
+ "autoFilter": true,
13499
+ "required": true,
13500
+ "autoPopulate": true,
13501
+ "nullable": false,
13502
+ "mode": "required",
13503
+ "field": "tenantId",
13504
+ "allowSuperAdminBypass": false
13505
+ }
13506
+ }
13507
+ },
13508
+ "learnerId": {
13509
+ "type": "foreignKey",
13510
+ "required": true,
13511
+ "related": "Learner",
13512
+ "_meta": {
13513
+ "required": true
13514
+ }
13515
+ },
13516
+ "attemptId": {
13517
+ "type": "foreignKey",
13518
+ "required": true,
13519
+ "related": "WorkbookAttempt",
13520
+ "_meta": {
13521
+ "required": true
13522
+ }
13523
+ },
13524
+ "requestKey": {
13525
+ "type": "text",
13526
+ "required": false
13527
+ },
13528
+ "requestDigest": {
13529
+ "type": "text",
13530
+ "required": false
13531
+ },
13532
+ "kind": {
13533
+ "type": "text",
13534
+ "required": false
13535
+ },
13536
+ "actorUserId": {
13537
+ "type": "text",
13538
+ "required": false
13539
+ },
13540
+ "sourceRevisionId": {
13541
+ "type": "foreignKey",
13542
+ "required": false,
13543
+ "related": "WorkbookAssessmentRevision",
13544
+ "_meta": {
13545
+ "nullable": true
13546
+ }
13547
+ },
13548
+ "decisionReason": {
13549
+ "type": "text",
13550
+ "required": false
13551
+ },
13552
+ "supersedesId": {
13553
+ "type": "foreignKey",
13554
+ "required": false,
13555
+ "related": "WorkbookAssessmentRevision",
13556
+ "_meta": {
13557
+ "nullable": true
13558
+ }
13559
+ },
13560
+ "assessmentJson": {
13561
+ "type": "text",
13562
+ "required": false,
13563
+ "_meta": {}
13564
+ },
13565
+ "recordedAt": {
13566
+ "type": "text",
13567
+ "required": false
13568
+ }
13569
+ },
13570
+ "methods": {
13571
+ "delete": {
13572
+ "name": "delete",
13573
+ "async": true,
13574
+ "parameters": [],
13575
+ "returnType": "Promise<void>",
13576
+ "isStatic": false,
13577
+ "isPublic": true
13578
+ },
13579
+ "save": {
13580
+ "name": "save",
13581
+ "async": true,
13582
+ "parameters": [],
13583
+ "returnType": "Promise<this>",
13584
+ "isStatic": false,
13585
+ "isPublic": true
13586
+ }
13587
+ },
13588
+ "decoratorConfig": {
13589
+ "tableName": "workbook_assessment_revisions",
13590
+ "conflictColumns": [
13591
+ "tenant_id",
13592
+ "attempt_id",
13593
+ "request_key"
13594
+ ],
13595
+ "api": false,
13596
+ "mcp": false,
13597
+ "cli": false,
13598
+ "tenantScoped": {
13599
+ "mode": "required"
13600
+ }
13601
+ },
13602
+ "extends": "SmrtObject",
13603
+ "exportName": "WorkbookAssessmentRevision",
13604
+ "collectionExportName": "WorkbookAssessmentRevisionCollection",
13605
+ "validationRules": [
13606
+ {
13607
+ "field": "learnerId",
13608
+ "rule": "required",
13609
+ "fieldType": "foreignKey"
13610
+ },
13611
+ {
13612
+ "field": "attemptId",
13613
+ "rule": "required",
13614
+ "fieldType": "foreignKey"
13615
+ }
13616
+ ],
13617
+ "schema": {
13618
+ "tableName": "workbook_assessment_revisions",
13619
+ "ddl": "CREATE TABLE IF NOT EXISTS \"workbook_assessment_revisions\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"tenant_id\" UUID NOT NULL,\n \"learner_id\" UUID NOT NULL,\n \"attempt_id\" UUID NOT NULL,\n \"request_key\" TEXT,\n \"request_digest\" TEXT,\n \"kind\" TEXT,\n \"actor_user_id\" TEXT,\n \"source_revision_id\" UUID,\n \"decision_reason\" TEXT,\n \"supersedes_id\" UUID,\n \"assessment_json\" TEXT,\n \"recorded_at\" TEXT\n);",
13620
+ "columns": {
13621
+ "id": {
13622
+ "type": "UUID",
13623
+ "primaryKey": true,
13624
+ "referenceKind": "id",
13625
+ "notNull": true
13626
+ },
13627
+ "slug": {
13628
+ "type": "TEXT",
13629
+ "notNull": true
13630
+ },
13631
+ "context": {
13632
+ "type": "TEXT",
13633
+ "notNull": true,
13634
+ "default": ""
13635
+ },
13636
+ "created_at": {
13637
+ "type": "TIMESTAMP",
13638
+ "notNull": true,
13639
+ "default": "current_timestamp"
13640
+ },
13641
+ "updated_at": {
13642
+ "type": "TIMESTAMP",
13643
+ "notNull": true,
13644
+ "default": "current_timestamp"
13645
+ },
13646
+ "tenant_id": {
13647
+ "type": "UUID",
13648
+ "referenceKind": "tenantId",
13649
+ "notNull": true,
13650
+ "unique": false
13651
+ },
13652
+ "learner_id": {
13653
+ "type": "UUID",
13654
+ "referenceKind": "foreignKey",
13655
+ "notNull": true,
13656
+ "unique": false,
13657
+ "foreignKey": {
13658
+ "table": "learners",
13659
+ "column": "id",
13660
+ "onDelete": "NO ACTION",
13661
+ "onUpdate": "CASCADE"
13662
+ }
13663
+ },
13664
+ "attempt_id": {
13665
+ "type": "UUID",
13666
+ "referenceKind": "foreignKey",
13667
+ "notNull": true,
13668
+ "unique": false,
13669
+ "foreignKey": {
13670
+ "table": "workbook_attempts",
13671
+ "column": "id",
13672
+ "onDelete": "CASCADE",
13673
+ "onUpdate": "CASCADE"
13674
+ }
13675
+ },
13676
+ "request_key": {
13677
+ "type": "TEXT",
13678
+ "notNull": false,
13679
+ "unique": false
13680
+ },
13681
+ "request_digest": {
13682
+ "type": "TEXT",
13683
+ "notNull": false,
13684
+ "unique": false
13685
+ },
13686
+ "kind": {
13687
+ "type": "TEXT",
13688
+ "notNull": false,
13689
+ "unique": false
13690
+ },
13691
+ "actor_user_id": {
13692
+ "type": "TEXT",
13693
+ "notNull": false,
13694
+ "unique": false
13695
+ },
13696
+ "source_revision_id": {
13697
+ "type": "UUID",
13698
+ "referenceKind": "foreignKey",
13699
+ "notNull": false,
13700
+ "unique": false,
13701
+ "foreignKey": {
13702
+ "table": "workbook_assessment_revisions",
13703
+ "column": "id",
13704
+ "onDelete": "NO ACTION",
13705
+ "onUpdate": "CASCADE"
13706
+ }
13707
+ },
13708
+ "decision_reason": {
13709
+ "type": "TEXT",
13710
+ "notNull": false,
13711
+ "unique": false
13712
+ },
13713
+ "supersedes_id": {
13714
+ "type": "UUID",
13715
+ "referenceKind": "foreignKey",
13716
+ "notNull": false,
13717
+ "unique": false,
13718
+ "foreignKey": {
13719
+ "table": "workbook_assessment_revisions",
13720
+ "column": "id",
13721
+ "onDelete": "NO ACTION",
13722
+ "onUpdate": "CASCADE"
13723
+ }
13724
+ },
13725
+ "assessment_json": {
13726
+ "type": "TEXT",
13727
+ "notNull": false,
13728
+ "unique": false
13729
+ },
13730
+ "recorded_at": {
13731
+ "type": "TEXT",
13732
+ "notNull": false,
13733
+ "unique": false
13734
+ }
13735
+ },
13736
+ "indexes": [
13737
+ {
13738
+ "name": "workbook_assessment_revisions_tenant_id_attempt_id_idx",
13739
+ "columns": [
13740
+ "tenant_id",
13741
+ "attempt_id",
13742
+ "request_key"
13743
+ ],
13744
+ "unique": true,
13745
+ "nullsNotDistinct": true
13746
+ },
13747
+ {
13748
+ "name": "workbook_assessment_revisions_slug_context_idx",
13749
+ "columns": [
13750
+ "slug",
13751
+ "context"
13752
+ ]
13753
+ },
13754
+ {
13755
+ "name": "workbook_assessment_revisions_tenant_id_created_at_idx",
13756
+ "columns": [
13757
+ "tenant_id",
13758
+ "created_at"
13759
+ ]
13760
+ },
13761
+ {
13762
+ "name": "workbook_assessment_revisions_learner_id_idx",
13763
+ "columns": [
13764
+ "learner_id"
13765
+ ]
13766
+ },
13767
+ {
13768
+ "name": "workbook_assessment_revisions_attempt_id_idx",
13769
+ "columns": [
13770
+ "attempt_id"
13771
+ ]
13772
+ },
13773
+ {
13774
+ "name": "workbook_assessment_revisions_source_revision_id_idx",
13775
+ "columns": [
13776
+ "source_revision_id"
13777
+ ]
13778
+ },
13779
+ {
13780
+ "name": "workbook_assessment_revisions_supersedes_id_idx",
13781
+ "columns": [
13782
+ "supersedes_id"
13783
+ ]
13784
+ }
13785
+ ],
13786
+ "version": "94b2bd33"
13787
+ },
13788
+ "importPath": "@happyvertical/smrt-education"
13789
+ },
13790
+ "@happyvertical/smrt-education:WorkbookAssessmentRevisionCollection": {
13791
+ "name": "workbookassessmentrevisioncollection",
13792
+ "className": "WorkbookAssessmentRevisionCollection",
13793
+ "qualifiedName": "@happyvertical/smrt-education:WorkbookAssessmentRevisionCollection",
13794
+ "collection": "workbookassessmentrevisions",
13795
+ "filePath": "/home/runner/work/smrt/smrt/packages/education/src/workbook-models.ts",
13796
+ "packageName": "@happyvertical/smrt-education",
13797
+ "fields": {},
13798
+ "methods": {},
13799
+ "decoratorConfig": {
13800
+ "tableName": "workbook_assessment_revisions",
13801
+ "api": false,
13802
+ "mcp": false,
13803
+ "cli": false
13804
+ },
13805
+ "extends": "SmrtCollection",
13806
+ "extendsTypeArg": "WorkbookAssessmentRevision",
13807
+ "exportName": "WorkbookAssessmentRevisionCollection",
13808
+ "collectionExportName": "WorkbookAssessmentRevisionCollectionCollection",
13809
+ "schema": {
13810
+ "tableName": "workbook_assessment_revisions",
13811
+ "ddl": "CREATE TABLE IF NOT EXISTS \"workbook_assessment_revisions\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"tenant_id\" UUID NOT NULL,\n \"learner_id\" UUID NOT NULL,\n \"attempt_id\" UUID NOT NULL,\n \"request_key\" TEXT,\n \"request_digest\" TEXT,\n \"kind\" TEXT,\n \"actor_user_id\" TEXT,\n \"source_revision_id\" UUID,\n \"decision_reason\" TEXT,\n \"supersedes_id\" UUID,\n \"assessment_json\" TEXT,\n \"recorded_at\" TEXT\n);",
13812
+ "columns": {
13813
+ "id": {
13814
+ "type": "UUID",
13815
+ "primaryKey": true,
13816
+ "referenceKind": "id",
13817
+ "notNull": true
13818
+ },
13819
+ "slug": {
13820
+ "type": "TEXT",
13821
+ "notNull": true
13822
+ },
13823
+ "context": {
13824
+ "type": "TEXT",
13825
+ "notNull": true,
13826
+ "default": ""
13827
+ },
13828
+ "created_at": {
13829
+ "type": "TIMESTAMP",
13830
+ "notNull": true,
13831
+ "default": "current_timestamp"
13832
+ },
13833
+ "updated_at": {
13834
+ "type": "TIMESTAMP",
13835
+ "notNull": true,
13836
+ "default": "current_timestamp"
13837
+ },
13838
+ "tenant_id": {
13839
+ "type": "UUID",
13840
+ "referenceKind": "tenantId",
13841
+ "notNull": true,
13842
+ "unique": false
13843
+ },
13844
+ "learner_id": {
13845
+ "type": "UUID",
13846
+ "referenceKind": "foreignKey",
13847
+ "notNull": true,
13848
+ "unique": false,
13849
+ "foreignKey": {
13850
+ "table": "learners",
13851
+ "column": "id",
13852
+ "onDelete": "NO ACTION",
13853
+ "onUpdate": "CASCADE"
13854
+ }
13855
+ },
13856
+ "attempt_id": {
13857
+ "type": "UUID",
13858
+ "referenceKind": "foreignKey",
13859
+ "notNull": true,
13860
+ "unique": false,
13861
+ "foreignKey": {
13862
+ "table": "workbook_attempts",
13863
+ "column": "id",
13864
+ "onDelete": "CASCADE",
13865
+ "onUpdate": "CASCADE"
13866
+ }
13867
+ },
13868
+ "request_key": {
13869
+ "type": "TEXT",
13870
+ "notNull": false,
13871
+ "unique": false
13872
+ },
13873
+ "request_digest": {
13874
+ "type": "TEXT",
13875
+ "notNull": false,
13876
+ "unique": false
13877
+ },
13878
+ "kind": {
13879
+ "type": "TEXT",
13880
+ "notNull": false,
13881
+ "unique": false
13882
+ },
13883
+ "actor_user_id": {
13884
+ "type": "TEXT",
13885
+ "notNull": false,
13886
+ "unique": false
13887
+ },
13888
+ "source_revision_id": {
13889
+ "type": "UUID",
13890
+ "referenceKind": "foreignKey",
13891
+ "notNull": false,
13892
+ "unique": false,
13893
+ "foreignKey": {
13894
+ "table": "workbook_assessment_revisions",
13895
+ "column": "id",
13896
+ "onDelete": "NO ACTION",
13897
+ "onUpdate": "CASCADE"
13898
+ }
13899
+ },
13900
+ "decision_reason": {
13901
+ "type": "TEXT",
13902
+ "notNull": false,
13903
+ "unique": false
13904
+ },
13905
+ "supersedes_id": {
13906
+ "type": "UUID",
13907
+ "referenceKind": "foreignKey",
13908
+ "notNull": false,
13909
+ "unique": false,
13910
+ "foreignKey": {
13911
+ "table": "workbook_assessment_revisions",
13912
+ "column": "id",
13913
+ "onDelete": "NO ACTION",
13914
+ "onUpdate": "CASCADE"
13915
+ }
13916
+ },
13917
+ "assessment_json": {
13918
+ "type": "TEXT",
13919
+ "notNull": false,
13920
+ "unique": false
13921
+ },
13922
+ "recorded_at": {
13923
+ "type": "TEXT",
13924
+ "notNull": false,
13925
+ "unique": false
13926
+ }
13927
+ },
13928
+ "indexes": [
13929
+ {
13930
+ "name": "workbook_assessment_revisions_tenant_id_attempt_id_idx",
13931
+ "columns": [
13932
+ "tenant_id",
13933
+ "attempt_id",
13934
+ "request_key"
13935
+ ],
13936
+ "unique": true,
13937
+ "nullsNotDistinct": true
13938
+ },
13939
+ {
13940
+ "name": "workbook_assessment_revisions_slug_context_idx",
13941
+ "columns": [
13942
+ "slug",
13943
+ "context"
13944
+ ]
13945
+ },
13946
+ {
13947
+ "name": "workbook_assessment_revisions_tenant_id_created_at_idx",
13948
+ "columns": [
13949
+ "tenant_id",
13950
+ "created_at"
13951
+ ]
13952
+ },
13953
+ {
13954
+ "name": "workbook_assessment_revisions_learner_id_idx",
13955
+ "columns": [
13956
+ "learner_id"
13957
+ ]
13958
+ },
13959
+ {
13960
+ "name": "workbook_assessment_revisions_attempt_id_idx",
13961
+ "columns": [
13962
+ "attempt_id"
13963
+ ]
13964
+ },
13965
+ {
13966
+ "name": "workbook_assessment_revisions_source_revision_id_idx",
13967
+ "columns": [
13968
+ "source_revision_id"
13969
+ ]
13970
+ },
13971
+ {
13972
+ "name": "workbook_assessment_revisions_supersedes_id_idx",
13973
+ "columns": [
13974
+ "supersedes_id"
13975
+ ]
13976
+ }
13977
+ ],
13978
+ "version": "94b2bd33"
13979
+ },
13980
+ "importPath": "@happyvertical/smrt-education"
13981
+ },
13982
+ "@happyvertical/smrt-education:WorkbookFeedbackRelease": {
13983
+ "name": "workbookfeedbackrelease",
13984
+ "className": "WorkbookFeedbackRelease",
13985
+ "qualifiedName": "@happyvertical/smrt-education:WorkbookFeedbackRelease",
13986
+ "collection": "workbookfeedbackreleases",
13987
+ "description": "Education-owned private workbook record. Mutations go through WorkbookService.",
13988
+ "filePath": "/home/runner/work/smrt/smrt/packages/education/src/workbook-models.ts",
13989
+ "packageName": "@happyvertical/smrt-education",
13990
+ "fields": {
13991
+ "tenantId": {
13992
+ "type": "text",
13993
+ "required": true,
13994
+ "_meta": {
13995
+ "sqlType": "UUID",
13996
+ "__tenancy": {
13997
+ "isTenantIdField": true,
13998
+ "autoFilter": true,
13999
+ "required": true,
14000
+ "autoPopulate": true,
14001
+ "nullable": false,
14002
+ "mode": "required",
14003
+ "field": "tenantId",
14004
+ "allowSuperAdminBypass": false
14005
+ }
14006
+ }
14007
+ },
14008
+ "learnerId": {
14009
+ "type": "foreignKey",
14010
+ "required": true,
14011
+ "related": "Learner",
14012
+ "_meta": {
14013
+ "required": true
14014
+ }
14015
+ },
14016
+ "attemptId": {
14017
+ "type": "foreignKey",
14018
+ "required": true,
14019
+ "related": "WorkbookAttempt",
14020
+ "_meta": {
14021
+ "required": true
14022
+ }
14023
+ },
14024
+ "revisionId": {
14025
+ "type": "foreignKey",
14026
+ "required": true,
14027
+ "related": "WorkbookAssessmentRevision",
14028
+ "_meta": {
14029
+ "required": true
14030
+ }
14031
+ },
14032
+ "expectedHeadId": {
14033
+ "type": "foreignKey",
14034
+ "required": false,
14035
+ "related": "WorkbookAssessmentRevision",
14036
+ "_meta": {
14037
+ "nullable": true
14038
+ }
14039
+ },
14040
+ "requestKey": {
14041
+ "type": "text",
14042
+ "required": false
14043
+ },
14044
+ "actorUserId": {
14045
+ "type": "text",
14046
+ "required": false
14047
+ },
14048
+ "recordedAt": {
14049
+ "type": "text",
14050
+ "required": false
14051
+ }
14052
+ },
14053
+ "methods": {
14054
+ "delete": {
14055
+ "name": "delete",
14056
+ "async": true,
14057
+ "parameters": [],
14058
+ "returnType": "Promise<void>",
14059
+ "isStatic": false,
14060
+ "isPublic": true
14061
+ },
14062
+ "save": {
14063
+ "name": "save",
14064
+ "async": true,
14065
+ "parameters": [],
14066
+ "returnType": "Promise<this>",
14067
+ "isStatic": false,
14068
+ "isPublic": true
14069
+ }
14070
+ },
14071
+ "decoratorConfig": {
14072
+ "tableName": "workbook_feedback_releases",
14073
+ "conflictColumns": [
14074
+ "tenant_id",
14075
+ "attempt_id",
14076
+ "request_key"
14077
+ ],
14078
+ "api": false,
14079
+ "mcp": false,
14080
+ "cli": false,
14081
+ "tenantScoped": {
14082
+ "mode": "required"
14083
+ }
14084
+ },
14085
+ "extends": "SmrtObject",
14086
+ "exportName": "WorkbookFeedbackRelease",
14087
+ "collectionExportName": "WorkbookFeedbackReleaseCollection",
14088
+ "validationRules": [
14089
+ {
14090
+ "field": "learnerId",
14091
+ "rule": "required",
14092
+ "fieldType": "foreignKey"
14093
+ },
14094
+ {
14095
+ "field": "attemptId",
14096
+ "rule": "required",
14097
+ "fieldType": "foreignKey"
14098
+ },
14099
+ {
14100
+ "field": "revisionId",
14101
+ "rule": "required",
14102
+ "fieldType": "foreignKey"
14103
+ }
14104
+ ],
14105
+ "schema": {
14106
+ "tableName": "workbook_feedback_releases",
14107
+ "ddl": "CREATE TABLE IF NOT EXISTS \"workbook_feedback_releases\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"tenant_id\" UUID NOT NULL,\n \"learner_id\" UUID NOT NULL,\n \"attempt_id\" UUID NOT NULL,\n \"revision_id\" UUID NOT NULL,\n \"expected_head_id\" UUID,\n \"request_key\" TEXT,\n \"actor_user_id\" TEXT,\n \"recorded_at\" TEXT\n);",
14108
+ "columns": {
14109
+ "id": {
14110
+ "type": "UUID",
14111
+ "primaryKey": true,
14112
+ "referenceKind": "id",
14113
+ "notNull": true
14114
+ },
14115
+ "slug": {
14116
+ "type": "TEXT",
14117
+ "notNull": true
14118
+ },
14119
+ "context": {
14120
+ "type": "TEXT",
14121
+ "notNull": true,
14122
+ "default": ""
14123
+ },
14124
+ "created_at": {
14125
+ "type": "TIMESTAMP",
14126
+ "notNull": true,
14127
+ "default": "current_timestamp"
14128
+ },
14129
+ "updated_at": {
14130
+ "type": "TIMESTAMP",
14131
+ "notNull": true,
14132
+ "default": "current_timestamp"
14133
+ },
14134
+ "tenant_id": {
14135
+ "type": "UUID",
14136
+ "referenceKind": "tenantId",
14137
+ "notNull": true,
14138
+ "unique": false
14139
+ },
14140
+ "learner_id": {
14141
+ "type": "UUID",
14142
+ "referenceKind": "foreignKey",
14143
+ "notNull": true,
14144
+ "unique": false,
14145
+ "foreignKey": {
14146
+ "table": "learners",
14147
+ "column": "id",
14148
+ "onDelete": "NO ACTION",
14149
+ "onUpdate": "CASCADE"
14150
+ }
14151
+ },
14152
+ "attempt_id": {
14153
+ "type": "UUID",
14154
+ "referenceKind": "foreignKey",
14155
+ "notNull": true,
14156
+ "unique": false,
14157
+ "foreignKey": {
14158
+ "table": "workbook_attempts",
14159
+ "column": "id",
14160
+ "onDelete": "CASCADE",
14161
+ "onUpdate": "CASCADE"
14162
+ }
14163
+ },
14164
+ "revision_id": {
14165
+ "type": "UUID",
14166
+ "referenceKind": "foreignKey",
14167
+ "notNull": true,
14168
+ "unique": false,
14169
+ "foreignKey": {
14170
+ "table": "workbook_assessment_revisions",
14171
+ "column": "id",
14172
+ "onDelete": "NO ACTION",
14173
+ "onUpdate": "CASCADE"
14174
+ }
14175
+ },
14176
+ "expected_head_id": {
14177
+ "type": "UUID",
14178
+ "referenceKind": "foreignKey",
14179
+ "notNull": false,
14180
+ "unique": false,
14181
+ "foreignKey": {
14182
+ "table": "workbook_assessment_revisions",
14183
+ "column": "id",
14184
+ "onDelete": "NO ACTION",
14185
+ "onUpdate": "CASCADE"
14186
+ }
14187
+ },
14188
+ "request_key": {
14189
+ "type": "TEXT",
14190
+ "notNull": false,
14191
+ "unique": false
14192
+ },
14193
+ "actor_user_id": {
14194
+ "type": "TEXT",
14195
+ "notNull": false,
14196
+ "unique": false
14197
+ },
14198
+ "recorded_at": {
14199
+ "type": "TEXT",
14200
+ "notNull": false,
14201
+ "unique": false
14202
+ }
14203
+ },
14204
+ "indexes": [
14205
+ {
14206
+ "name": "workbook_feedback_releases_tenant_id_attempt_id_idx",
14207
+ "columns": [
14208
+ "tenant_id",
14209
+ "attempt_id",
14210
+ "request_key"
14211
+ ],
14212
+ "unique": true,
14213
+ "nullsNotDistinct": true
14214
+ },
14215
+ {
14216
+ "name": "workbook_feedback_releases_slug_context_idx",
14217
+ "columns": [
14218
+ "slug",
14219
+ "context"
14220
+ ]
14221
+ },
14222
+ {
14223
+ "name": "workbook_feedback_releases_tenant_id_created_at_idx",
14224
+ "columns": [
14225
+ "tenant_id",
14226
+ "created_at"
14227
+ ]
14228
+ },
14229
+ {
14230
+ "name": "workbook_feedback_releases_learner_id_idx",
14231
+ "columns": [
14232
+ "learner_id"
14233
+ ]
14234
+ },
14235
+ {
14236
+ "name": "workbook_feedback_releases_attempt_id_idx",
14237
+ "columns": [
14238
+ "attempt_id"
14239
+ ]
14240
+ },
14241
+ {
14242
+ "name": "workbook_feedback_releases_revision_id_idx",
14243
+ "columns": [
14244
+ "revision_id"
14245
+ ]
14246
+ },
14247
+ {
14248
+ "name": "workbook_feedback_releases_expected_head_id_idx",
14249
+ "columns": [
14250
+ "expected_head_id"
14251
+ ]
14252
+ }
14253
+ ],
14254
+ "version": "ebe23baf"
14255
+ },
14256
+ "importPath": "@happyvertical/smrt-education"
14257
+ },
14258
+ "@happyvertical/smrt-education:WorkbookFeedbackReleaseCollection": {
14259
+ "name": "workbookfeedbackreleasecollection",
14260
+ "className": "WorkbookFeedbackReleaseCollection",
14261
+ "qualifiedName": "@happyvertical/smrt-education:WorkbookFeedbackReleaseCollection",
14262
+ "collection": "workbookfeedbackreleases",
14263
+ "filePath": "/home/runner/work/smrt/smrt/packages/education/src/workbook-models.ts",
14264
+ "packageName": "@happyvertical/smrt-education",
14265
+ "fields": {},
14266
+ "methods": {},
14267
+ "decoratorConfig": {
14268
+ "tableName": "workbook_feedback_releases",
14269
+ "api": false,
14270
+ "mcp": false,
14271
+ "cli": false
14272
+ },
14273
+ "extends": "SmrtCollection",
14274
+ "extendsTypeArg": "WorkbookFeedbackRelease",
14275
+ "exportName": "WorkbookFeedbackReleaseCollection",
14276
+ "collectionExportName": "WorkbookFeedbackReleaseCollectionCollection",
14277
+ "schema": {
14278
+ "tableName": "workbook_feedback_releases",
14279
+ "ddl": "CREATE TABLE IF NOT EXISTS \"workbook_feedback_releases\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"tenant_id\" UUID NOT NULL,\n \"learner_id\" UUID NOT NULL,\n \"attempt_id\" UUID NOT NULL,\n \"revision_id\" UUID NOT NULL,\n \"expected_head_id\" UUID,\n \"request_key\" TEXT,\n \"actor_user_id\" TEXT,\n \"recorded_at\" TEXT\n);",
14280
+ "columns": {
14281
+ "id": {
14282
+ "type": "UUID",
14283
+ "primaryKey": true,
14284
+ "referenceKind": "id",
14285
+ "notNull": true
14286
+ },
14287
+ "slug": {
14288
+ "type": "TEXT",
14289
+ "notNull": true
14290
+ },
14291
+ "context": {
14292
+ "type": "TEXT",
14293
+ "notNull": true,
14294
+ "default": ""
14295
+ },
14296
+ "created_at": {
14297
+ "type": "TIMESTAMP",
14298
+ "notNull": true,
14299
+ "default": "current_timestamp"
14300
+ },
14301
+ "updated_at": {
14302
+ "type": "TIMESTAMP",
14303
+ "notNull": true,
14304
+ "default": "current_timestamp"
14305
+ },
14306
+ "tenant_id": {
14307
+ "type": "UUID",
14308
+ "referenceKind": "tenantId",
14309
+ "notNull": true,
14310
+ "unique": false
14311
+ },
14312
+ "learner_id": {
14313
+ "type": "UUID",
14314
+ "referenceKind": "foreignKey",
14315
+ "notNull": true,
14316
+ "unique": false,
14317
+ "foreignKey": {
14318
+ "table": "learners",
14319
+ "column": "id",
14320
+ "onDelete": "NO ACTION",
14321
+ "onUpdate": "CASCADE"
14322
+ }
14323
+ },
14324
+ "attempt_id": {
14325
+ "type": "UUID",
14326
+ "referenceKind": "foreignKey",
14327
+ "notNull": true,
14328
+ "unique": false,
14329
+ "foreignKey": {
14330
+ "table": "workbook_attempts",
14331
+ "column": "id",
14332
+ "onDelete": "CASCADE",
14333
+ "onUpdate": "CASCADE"
14334
+ }
14335
+ },
14336
+ "revision_id": {
14337
+ "type": "UUID",
14338
+ "referenceKind": "foreignKey",
14339
+ "notNull": true,
14340
+ "unique": false,
14341
+ "foreignKey": {
14342
+ "table": "workbook_assessment_revisions",
14343
+ "column": "id",
14344
+ "onDelete": "NO ACTION",
14345
+ "onUpdate": "CASCADE"
14346
+ }
14347
+ },
14348
+ "expected_head_id": {
14349
+ "type": "UUID",
14350
+ "referenceKind": "foreignKey",
14351
+ "notNull": false,
14352
+ "unique": false,
14353
+ "foreignKey": {
14354
+ "table": "workbook_assessment_revisions",
14355
+ "column": "id",
14356
+ "onDelete": "NO ACTION",
14357
+ "onUpdate": "CASCADE"
14358
+ }
14359
+ },
14360
+ "request_key": {
14361
+ "type": "TEXT",
14362
+ "notNull": false,
14363
+ "unique": false
14364
+ },
14365
+ "actor_user_id": {
14366
+ "type": "TEXT",
14367
+ "notNull": false,
14368
+ "unique": false
14369
+ },
14370
+ "recorded_at": {
14371
+ "type": "TEXT",
14372
+ "notNull": false,
14373
+ "unique": false
14374
+ }
14375
+ },
14376
+ "indexes": [
14377
+ {
14378
+ "name": "workbook_feedback_releases_tenant_id_attempt_id_idx",
14379
+ "columns": [
14380
+ "tenant_id",
14381
+ "attempt_id",
14382
+ "request_key"
14383
+ ],
14384
+ "unique": true,
14385
+ "nullsNotDistinct": true
14386
+ },
14387
+ {
14388
+ "name": "workbook_feedback_releases_slug_context_idx",
14389
+ "columns": [
14390
+ "slug",
14391
+ "context"
14392
+ ]
14393
+ },
14394
+ {
14395
+ "name": "workbook_feedback_releases_tenant_id_created_at_idx",
14396
+ "columns": [
14397
+ "tenant_id",
14398
+ "created_at"
14399
+ ]
14400
+ },
14401
+ {
14402
+ "name": "workbook_feedback_releases_learner_id_idx",
14403
+ "columns": [
14404
+ "learner_id"
14405
+ ]
14406
+ },
14407
+ {
14408
+ "name": "workbook_feedback_releases_attempt_id_idx",
14409
+ "columns": [
14410
+ "attempt_id"
14411
+ ]
14412
+ },
14413
+ {
14414
+ "name": "workbook_feedback_releases_revision_id_idx",
14415
+ "columns": [
14416
+ "revision_id"
14417
+ ]
14418
+ },
14419
+ {
14420
+ "name": "workbook_feedback_releases_expected_head_id_idx",
14421
+ "columns": [
14422
+ "expected_head_id"
14423
+ ]
14424
+ }
14425
+ ],
14426
+ "version": "ebe23baf"
14427
+ },
14428
+ "importPath": "@happyvertical/smrt-education"
14429
+ },
14430
+ "@happyvertical/smrt-education:WorkbookFeedbackDelivery": {
14431
+ "name": "workbookfeedbackdelivery",
14432
+ "className": "WorkbookFeedbackDelivery",
14433
+ "qualifiedName": "@happyvertical/smrt-education:WorkbookFeedbackDelivery",
14434
+ "collection": "workbookfeedbackdeliveries",
14435
+ "description": "Authenticated delivery acknowledgment; this does not assert comprehension.",
14436
+ "filePath": "/home/runner/work/smrt/smrt/packages/education/src/workbook-models.ts",
14437
+ "packageName": "@happyvertical/smrt-education",
14438
+ "fields": {
14439
+ "tenantId": {
14440
+ "type": "text",
14441
+ "required": true,
14442
+ "_meta": {
14443
+ "sqlType": "UUID",
14444
+ "__tenancy": {
14445
+ "isTenantIdField": true,
14446
+ "autoFilter": true,
14447
+ "required": true,
14448
+ "autoPopulate": true,
14449
+ "nullable": false,
14450
+ "mode": "required",
14451
+ "field": "tenantId",
14452
+ "allowSuperAdminBypass": false
14453
+ }
14454
+ }
14455
+ },
14456
+ "learnerId": {
14457
+ "type": "foreignKey",
14458
+ "required": true,
14459
+ "related": "Learner",
14460
+ "_meta": {
14461
+ "required": true
14462
+ }
14463
+ },
14464
+ "attemptId": {
14465
+ "type": "foreignKey",
14466
+ "required": true,
14467
+ "related": "WorkbookAttempt",
14468
+ "_meta": {
14469
+ "required": true
14470
+ }
14471
+ },
14472
+ "revisionId": {
14473
+ "type": "foreignKey",
14474
+ "required": true,
14475
+ "related": "WorkbookAssessmentRevision",
14476
+ "_meta": {
14477
+ "required": true
14478
+ }
14479
+ },
14480
+ "actorUserId": {
14481
+ "type": "text",
14482
+ "required": false
14483
+ },
14484
+ "requestKey": {
14485
+ "type": "text",
14486
+ "required": false
14487
+ },
14488
+ "recordedAt": {
14489
+ "type": "text",
14490
+ "required": false
14491
+ }
14492
+ },
14493
+ "methods": {
14494
+ "save": {
14495
+ "name": "save",
14496
+ "async": true,
14497
+ "parameters": [],
14498
+ "returnType": "Promise<this>",
14499
+ "isStatic": false,
14500
+ "isPublic": true
14501
+ },
14502
+ "delete": {
14503
+ "name": "delete",
14504
+ "async": true,
14505
+ "parameters": [],
14506
+ "returnType": "Promise<void>",
14507
+ "isStatic": false,
14508
+ "isPublic": true
14509
+ }
14510
+ },
14511
+ "decoratorConfig": {
14512
+ "tableName": "workbook_feedback_deliveries",
14513
+ "conflictColumns": [
14514
+ "tenant_id",
14515
+ "attempt_id",
14516
+ "actor_user_id",
14517
+ "revision_id"
14518
+ ],
14519
+ "api": false,
14520
+ "mcp": false,
14521
+ "cli": false,
14522
+ "tenantScoped": {
14523
+ "mode": "required"
14524
+ }
14525
+ },
14526
+ "extends": "SmrtObject",
14527
+ "exportName": "WorkbookFeedbackDelivery",
14528
+ "collectionExportName": "WorkbookFeedbackDeliveryCollection",
14529
+ "validationRules": [
14530
+ {
14531
+ "field": "learnerId",
14532
+ "rule": "required",
14533
+ "fieldType": "foreignKey"
14534
+ },
14535
+ {
14536
+ "field": "attemptId",
14537
+ "rule": "required",
14538
+ "fieldType": "foreignKey"
14539
+ },
14540
+ {
14541
+ "field": "revisionId",
14542
+ "rule": "required",
14543
+ "fieldType": "foreignKey"
14544
+ }
14545
+ ],
14546
+ "schema": {
14547
+ "tableName": "workbook_feedback_deliveries",
14548
+ "ddl": "CREATE TABLE IF NOT EXISTS \"workbook_feedback_deliveries\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"tenant_id\" UUID NOT NULL,\n \"learner_id\" UUID NOT NULL,\n \"attempt_id\" UUID NOT NULL,\n \"revision_id\" UUID NOT NULL,\n \"actor_user_id\" TEXT,\n \"request_key\" TEXT,\n \"recorded_at\" TEXT\n);",
14549
+ "columns": {
14550
+ "id": {
14551
+ "type": "UUID",
14552
+ "primaryKey": true,
14553
+ "referenceKind": "id",
14554
+ "notNull": true
14555
+ },
14556
+ "slug": {
14557
+ "type": "TEXT",
14558
+ "notNull": true
14559
+ },
14560
+ "context": {
14561
+ "type": "TEXT",
14562
+ "notNull": true,
14563
+ "default": ""
14564
+ },
14565
+ "created_at": {
14566
+ "type": "TIMESTAMP",
14567
+ "notNull": true,
14568
+ "default": "current_timestamp"
14569
+ },
14570
+ "updated_at": {
14571
+ "type": "TIMESTAMP",
14572
+ "notNull": true,
14573
+ "default": "current_timestamp"
14574
+ },
14575
+ "tenant_id": {
14576
+ "type": "UUID",
14577
+ "referenceKind": "tenantId",
14578
+ "notNull": true,
14579
+ "unique": false
14580
+ },
14581
+ "learner_id": {
14582
+ "type": "UUID",
14583
+ "referenceKind": "foreignKey",
14584
+ "notNull": true,
14585
+ "unique": false,
14586
+ "foreignKey": {
14587
+ "table": "learners",
14588
+ "column": "id",
14589
+ "onDelete": "NO ACTION",
14590
+ "onUpdate": "CASCADE"
14591
+ }
14592
+ },
14593
+ "attempt_id": {
14594
+ "type": "UUID",
14595
+ "referenceKind": "foreignKey",
14596
+ "notNull": true,
14597
+ "unique": false,
14598
+ "foreignKey": {
14599
+ "table": "workbook_attempts",
14600
+ "column": "id",
14601
+ "onDelete": "CASCADE",
14602
+ "onUpdate": "CASCADE"
14603
+ }
14604
+ },
14605
+ "revision_id": {
14606
+ "type": "UUID",
14607
+ "referenceKind": "foreignKey",
14608
+ "notNull": true,
14609
+ "unique": false,
14610
+ "foreignKey": {
14611
+ "table": "workbook_assessment_revisions",
14612
+ "column": "id",
14613
+ "onDelete": "CASCADE",
14614
+ "onUpdate": "CASCADE"
14615
+ }
14616
+ },
14617
+ "actor_user_id": {
14618
+ "type": "TEXT",
14619
+ "notNull": false,
14620
+ "unique": false
14621
+ },
14622
+ "request_key": {
14623
+ "type": "TEXT",
14624
+ "notNull": false,
14625
+ "unique": false
14626
+ },
14627
+ "recorded_at": {
14628
+ "type": "TEXT",
14629
+ "notNull": false,
14630
+ "unique": false
14631
+ }
14632
+ },
14633
+ "indexes": [
14634
+ {
14635
+ "name": "workbook_feedback_deliveries_tenant_id_attempt_id_idx",
14636
+ "columns": [
14637
+ "tenant_id",
14638
+ "attempt_id",
14639
+ "actor_user_id",
14640
+ "revision_id"
14641
+ ],
14642
+ "unique": true,
14643
+ "nullsNotDistinct": true
14644
+ },
14645
+ {
14646
+ "name": "workbook_feedback_deliveries_slug_context_idx",
14647
+ "columns": [
14648
+ "slug",
14649
+ "context"
14650
+ ]
14651
+ },
14652
+ {
14653
+ "name": "workbook_feedback_deliveries_tenant_id_created_at_idx",
14654
+ "columns": [
14655
+ "tenant_id",
14656
+ "created_at"
14657
+ ]
14658
+ },
14659
+ {
14660
+ "name": "workbook_feedback_deliveries_learner_id_idx",
14661
+ "columns": [
14662
+ "learner_id"
14663
+ ]
14664
+ },
14665
+ {
14666
+ "name": "workbook_feedback_deliveries_attempt_id_idx",
14667
+ "columns": [
14668
+ "attempt_id"
14669
+ ]
14670
+ },
14671
+ {
14672
+ "name": "workbook_feedback_deliveries_revision_id_idx",
14673
+ "columns": [
14674
+ "revision_id"
14675
+ ]
14676
+ }
14677
+ ],
14678
+ "version": "37bfd434"
14679
+ },
14680
+ "importPath": "@happyvertical/smrt-education"
14681
+ },
14682
+ "@happyvertical/smrt-education:WorkbookFeedbackDeliveryCollection": {
14683
+ "name": "workbookfeedbackdeliverycollection",
14684
+ "className": "WorkbookFeedbackDeliveryCollection",
14685
+ "qualifiedName": "@happyvertical/smrt-education:WorkbookFeedbackDeliveryCollection",
14686
+ "collection": "workbookfeedbackdeliveries",
14687
+ "filePath": "/home/runner/work/smrt/smrt/packages/education/src/workbook-models.ts",
14688
+ "packageName": "@happyvertical/smrt-education",
14689
+ "fields": {},
14690
+ "methods": {},
14691
+ "decoratorConfig": {
14692
+ "tableName": "workbook_feedback_deliveries",
14693
+ "api": false,
14694
+ "mcp": false,
14695
+ "cli": false
14696
+ },
14697
+ "extends": "SmrtCollection",
14698
+ "extendsTypeArg": "WorkbookFeedbackDelivery",
14699
+ "exportName": "WorkbookFeedbackDeliveryCollection",
14700
+ "collectionExportName": "WorkbookFeedbackDeliveryCollectionCollection",
14701
+ "schema": {
14702
+ "tableName": "workbook_feedback_deliveries",
14703
+ "ddl": "CREATE TABLE IF NOT EXISTS \"workbook_feedback_deliveries\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"tenant_id\" UUID NOT NULL,\n \"learner_id\" UUID NOT NULL,\n \"attempt_id\" UUID NOT NULL,\n \"revision_id\" UUID NOT NULL,\n \"actor_user_id\" TEXT,\n \"request_key\" TEXT,\n \"recorded_at\" TEXT\n);",
14704
+ "columns": {
14705
+ "id": {
14706
+ "type": "UUID",
14707
+ "primaryKey": true,
14708
+ "referenceKind": "id",
14709
+ "notNull": true
14710
+ },
14711
+ "slug": {
14712
+ "type": "TEXT",
14713
+ "notNull": true
14714
+ },
14715
+ "context": {
14716
+ "type": "TEXT",
14717
+ "notNull": true,
14718
+ "default": ""
14719
+ },
14720
+ "created_at": {
14721
+ "type": "TIMESTAMP",
14722
+ "notNull": true,
14723
+ "default": "current_timestamp"
14724
+ },
14725
+ "updated_at": {
14726
+ "type": "TIMESTAMP",
14727
+ "notNull": true,
14728
+ "default": "current_timestamp"
14729
+ },
14730
+ "tenant_id": {
14731
+ "type": "UUID",
14732
+ "referenceKind": "tenantId",
14733
+ "notNull": true,
14734
+ "unique": false
14735
+ },
14736
+ "learner_id": {
14737
+ "type": "UUID",
14738
+ "referenceKind": "foreignKey",
14739
+ "notNull": true,
14740
+ "unique": false,
14741
+ "foreignKey": {
14742
+ "table": "learners",
14743
+ "column": "id",
14744
+ "onDelete": "NO ACTION",
14745
+ "onUpdate": "CASCADE"
14746
+ }
14747
+ },
14748
+ "attempt_id": {
14749
+ "type": "UUID",
14750
+ "referenceKind": "foreignKey",
14751
+ "notNull": true,
14752
+ "unique": false,
14753
+ "foreignKey": {
14754
+ "table": "workbook_attempts",
14755
+ "column": "id",
14756
+ "onDelete": "CASCADE",
14757
+ "onUpdate": "CASCADE"
14758
+ }
14759
+ },
14760
+ "revision_id": {
14761
+ "type": "UUID",
14762
+ "referenceKind": "foreignKey",
14763
+ "notNull": true,
14764
+ "unique": false,
14765
+ "foreignKey": {
14766
+ "table": "workbook_assessment_revisions",
14767
+ "column": "id",
14768
+ "onDelete": "CASCADE",
14769
+ "onUpdate": "CASCADE"
14770
+ }
14771
+ },
14772
+ "actor_user_id": {
14773
+ "type": "TEXT",
14774
+ "notNull": false,
14775
+ "unique": false
14776
+ },
14777
+ "request_key": {
14778
+ "type": "TEXT",
14779
+ "notNull": false,
14780
+ "unique": false
14781
+ },
14782
+ "recorded_at": {
14783
+ "type": "TEXT",
14784
+ "notNull": false,
14785
+ "unique": false
14786
+ }
14787
+ },
14788
+ "indexes": [
14789
+ {
14790
+ "name": "workbook_feedback_deliveries_tenant_id_attempt_id_idx",
14791
+ "columns": [
14792
+ "tenant_id",
14793
+ "attempt_id",
14794
+ "actor_user_id",
14795
+ "revision_id"
14796
+ ],
14797
+ "unique": true,
14798
+ "nullsNotDistinct": true
14799
+ },
14800
+ {
14801
+ "name": "workbook_feedback_deliveries_slug_context_idx",
14802
+ "columns": [
14803
+ "slug",
14804
+ "context"
14805
+ ]
14806
+ },
14807
+ {
14808
+ "name": "workbook_feedback_deliveries_tenant_id_created_at_idx",
14809
+ "columns": [
14810
+ "tenant_id",
14811
+ "created_at"
14812
+ ]
14813
+ },
14814
+ {
14815
+ "name": "workbook_feedback_deliveries_learner_id_idx",
14816
+ "columns": [
14817
+ "learner_id"
14818
+ ]
14819
+ },
14820
+ {
14821
+ "name": "workbook_feedback_deliveries_attempt_id_idx",
14822
+ "columns": [
14823
+ "attempt_id"
14824
+ ]
14825
+ },
14826
+ {
14827
+ "name": "workbook_feedback_deliveries_revision_id_idx",
14828
+ "columns": [
14829
+ "revision_id"
14830
+ ]
14831
+ }
14832
+ ],
14833
+ "version": "37bfd434"
14834
+ },
14835
+ "importPath": "@happyvertical/smrt-education"
14836
+ },
14837
+ "@happyvertical/smrt-education:WorkbookPhotoIntake": {
14838
+ "name": "workbookphotointake",
14839
+ "className": "WorkbookPhotoIntake",
14840
+ "qualifiedName": "@happyvertical/smrt-education:WorkbookPhotoIntake",
14841
+ "collection": "workbookphotointakes",
14842
+ "description": "Durable receipt before any course, enrollment or activity exists.",
14843
+ "filePath": "/home/runner/work/smrt/smrt/packages/education/src/workbook-photo-models.ts",
14844
+ "packageName": "@happyvertical/smrt-education",
14845
+ "fields": {
14846
+ "tenantId": {
14847
+ "type": "text",
14848
+ "required": true,
14849
+ "_meta": {
14850
+ "sqlType": "UUID",
14851
+ "__tenancy": {
14852
+ "isTenantIdField": true,
14853
+ "autoFilter": true,
14854
+ "required": true,
14855
+ "autoPopulate": true,
14856
+ "nullable": false,
14857
+ "mode": "required",
14858
+ "field": "tenantId",
14859
+ "allowSuperAdminBypass": false
14860
+ }
14861
+ }
14862
+ },
14863
+ "learnerId": {
14864
+ "type": "foreignKey",
14865
+ "required": true,
14866
+ "related": "Learner",
14867
+ "_meta": {
14868
+ "required": true
14869
+ }
14870
+ },
14871
+ "itemId": {
14872
+ "type": "text",
14873
+ "required": false
14874
+ },
14875
+ "actorUserId": {
14876
+ "type": "text",
14877
+ "required": false
14878
+ },
14879
+ "contentDigest": {
14880
+ "type": "text",
14881
+ "required": false
14882
+ }
14883
+ },
14884
+ "methods": {
14885
+ "delete": {
14886
+ "name": "delete",
14887
+ "async": true,
14888
+ "parameters": [],
14889
+ "returnType": "Promise<void>",
14890
+ "isStatic": false,
14891
+ "isPublic": true
14892
+ },
14893
+ "save": {
14894
+ "name": "save",
14895
+ "async": true,
14896
+ "parameters": [],
14897
+ "returnType": "Promise<this>",
14898
+ "isStatic": false,
14899
+ "isPublic": true
14900
+ }
14901
+ },
14902
+ "decoratorConfig": {
14903
+ "tableName": "workbook_photo_intakes",
14904
+ "conflictColumns": [
14905
+ "tenant_id",
14906
+ "item_id"
14907
+ ],
14908
+ "api": false,
14909
+ "mcp": false,
14910
+ "cli": false,
14911
+ "tenantScoped": {
14912
+ "mode": "required"
14913
+ }
14914
+ },
14915
+ "extends": "SmrtObject",
14916
+ "exportName": "WorkbookPhotoIntake",
14917
+ "collectionExportName": "WorkbookPhotoIntakeCollection",
14918
+ "validationRules": [
14919
+ {
14920
+ "field": "learnerId",
14921
+ "rule": "required",
14922
+ "fieldType": "foreignKey"
14923
+ }
14924
+ ],
14925
+ "schema": {
14926
+ "tableName": "workbook_photo_intakes",
14927
+ "ddl": "CREATE TABLE IF NOT EXISTS \"workbook_photo_intakes\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"tenant_id\" UUID NOT NULL,\n \"learner_id\" UUID NOT NULL,\n \"item_id\" TEXT,\n \"actor_user_id\" TEXT,\n \"content_digest\" TEXT\n);",
14928
+ "columns": {
14929
+ "id": {
14930
+ "type": "UUID",
14931
+ "primaryKey": true,
14932
+ "referenceKind": "id",
14933
+ "notNull": true
14934
+ },
14935
+ "slug": {
14936
+ "type": "TEXT",
14937
+ "notNull": true
14938
+ },
14939
+ "context": {
14940
+ "type": "TEXT",
14941
+ "notNull": true,
14942
+ "default": ""
14943
+ },
14944
+ "created_at": {
14945
+ "type": "TIMESTAMP",
14946
+ "notNull": true,
14947
+ "default": "current_timestamp"
14948
+ },
14949
+ "updated_at": {
14950
+ "type": "TIMESTAMP",
14951
+ "notNull": true,
14952
+ "default": "current_timestamp"
14953
+ },
14954
+ "tenant_id": {
14955
+ "type": "UUID",
14956
+ "referenceKind": "tenantId",
14957
+ "notNull": true,
14958
+ "unique": false
14959
+ },
14960
+ "learner_id": {
14961
+ "type": "UUID",
14962
+ "referenceKind": "foreignKey",
14963
+ "notNull": true,
14964
+ "unique": false,
14965
+ "foreignKey": {
14966
+ "table": "learners",
14967
+ "column": "id",
14968
+ "onDelete": "NO ACTION",
14969
+ "onUpdate": "CASCADE"
14970
+ }
14971
+ },
14972
+ "item_id": {
14973
+ "type": "TEXT",
14974
+ "notNull": false,
14975
+ "unique": false
14976
+ },
14977
+ "actor_user_id": {
14978
+ "type": "TEXT",
14979
+ "notNull": false,
14980
+ "unique": false
14981
+ },
14982
+ "content_digest": {
14983
+ "type": "TEXT",
14984
+ "notNull": false,
14985
+ "unique": false
14986
+ }
14987
+ },
14988
+ "indexes": [
14989
+ {
14990
+ "name": "workbook_photo_intakes_tenant_id_item_id_idx",
14991
+ "columns": [
14992
+ "tenant_id",
14993
+ "item_id"
14994
+ ],
14995
+ "unique": true,
14996
+ "nullsNotDistinct": true
14997
+ },
14998
+ {
14999
+ "name": "workbook_photo_intakes_slug_context_idx",
15000
+ "columns": [
15001
+ "slug",
15002
+ "context"
15003
+ ]
15004
+ },
15005
+ {
15006
+ "name": "workbook_photo_intakes_tenant_id_created_at_idx",
15007
+ "columns": [
15008
+ "tenant_id",
15009
+ "created_at"
15010
+ ]
15011
+ },
15012
+ {
15013
+ "name": "workbook_photo_intakes_learner_id_idx",
15014
+ "columns": [
15015
+ "learner_id"
15016
+ ]
15017
+ }
15018
+ ],
15019
+ "version": "fafc1daf"
15020
+ },
15021
+ "importPath": "@happyvertical/smrt-education"
15022
+ },
15023
+ "@happyvertical/smrt-education:WorkbookPhotoIntakeCollection": {
15024
+ "name": "workbookphotointakecollection",
15025
+ "className": "WorkbookPhotoIntakeCollection",
15026
+ "qualifiedName": "@happyvertical/smrt-education:WorkbookPhotoIntakeCollection",
15027
+ "collection": "workbookphotointakes",
15028
+ "filePath": "/home/runner/work/smrt/smrt/packages/education/src/workbook-photo-models.ts",
15029
+ "packageName": "@happyvertical/smrt-education",
15030
+ "fields": {},
15031
+ "methods": {},
15032
+ "decoratorConfig": {
15033
+ "tableName": "workbook_photo_intakes",
15034
+ "api": false,
15035
+ "mcp": false,
15036
+ "cli": false
15037
+ },
15038
+ "extends": "SmrtCollection",
15039
+ "extendsTypeArg": "WorkbookPhotoIntake",
15040
+ "exportName": "WorkbookPhotoIntakeCollection",
15041
+ "collectionExportName": "WorkbookPhotoIntakeCollectionCollection",
15042
+ "schema": {
15043
+ "tableName": "workbook_photo_intakes",
15044
+ "ddl": "CREATE TABLE IF NOT EXISTS \"workbook_photo_intakes\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"tenant_id\" UUID NOT NULL,\n \"learner_id\" UUID NOT NULL,\n \"item_id\" TEXT,\n \"actor_user_id\" TEXT,\n \"content_digest\" TEXT\n);",
15045
+ "columns": {
15046
+ "id": {
15047
+ "type": "UUID",
15048
+ "primaryKey": true,
15049
+ "referenceKind": "id",
15050
+ "notNull": true
15051
+ },
15052
+ "slug": {
15053
+ "type": "TEXT",
15054
+ "notNull": true
15055
+ },
15056
+ "context": {
15057
+ "type": "TEXT",
15058
+ "notNull": true,
15059
+ "default": ""
15060
+ },
15061
+ "created_at": {
15062
+ "type": "TIMESTAMP",
15063
+ "notNull": true,
15064
+ "default": "current_timestamp"
15065
+ },
15066
+ "updated_at": {
15067
+ "type": "TIMESTAMP",
15068
+ "notNull": true,
15069
+ "default": "current_timestamp"
15070
+ },
15071
+ "tenant_id": {
15072
+ "type": "UUID",
15073
+ "referenceKind": "tenantId",
15074
+ "notNull": true,
15075
+ "unique": false
15076
+ },
15077
+ "learner_id": {
15078
+ "type": "UUID",
15079
+ "referenceKind": "foreignKey",
15080
+ "notNull": true,
15081
+ "unique": false,
15082
+ "foreignKey": {
15083
+ "table": "learners",
15084
+ "column": "id",
15085
+ "onDelete": "NO ACTION",
15086
+ "onUpdate": "CASCADE"
15087
+ }
15088
+ },
15089
+ "item_id": {
15090
+ "type": "TEXT",
15091
+ "notNull": false,
15092
+ "unique": false
15093
+ },
15094
+ "actor_user_id": {
15095
+ "type": "TEXT",
15096
+ "notNull": false,
15097
+ "unique": false
15098
+ },
15099
+ "content_digest": {
15100
+ "type": "TEXT",
15101
+ "notNull": false,
15102
+ "unique": false
15103
+ }
15104
+ },
15105
+ "indexes": [
15106
+ {
15107
+ "name": "workbook_photo_intakes_tenant_id_item_id_idx",
15108
+ "columns": [
15109
+ "tenant_id",
15110
+ "item_id"
15111
+ ],
15112
+ "unique": true,
15113
+ "nullsNotDistinct": true
15114
+ },
15115
+ {
15116
+ "name": "workbook_photo_intakes_slug_context_idx",
15117
+ "columns": [
15118
+ "slug",
15119
+ "context"
15120
+ ]
15121
+ },
15122
+ {
15123
+ "name": "workbook_photo_intakes_tenant_id_created_at_idx",
15124
+ "columns": [
15125
+ "tenant_id",
15126
+ "created_at"
15127
+ ]
15128
+ },
15129
+ {
15130
+ "name": "workbook_photo_intakes_learner_id_idx",
15131
+ "columns": [
15132
+ "learner_id"
15133
+ ]
15134
+ }
15135
+ ],
15136
+ "version": "fafc1daf"
15137
+ },
15138
+ "importPath": "@happyvertical/smrt-education"
15139
+ },
15140
+ "@happyvertical/smrt-education:WorkbookPhotoAsset": {
15141
+ "name": "workbookphotoasset",
15142
+ "className": "WorkbookPhotoAsset",
15143
+ "qualifiedName": "@happyvertical/smrt-education:WorkbookPhotoAsset",
15144
+ "collection": "workbookphotoassets",
15145
+ "description": "Sole owner join for original photo intake files.",
15146
+ "filePath": "/home/runner/work/smrt/smrt/packages/education/src/workbook-photo-models.ts",
15147
+ "packageName": "@happyvertical/smrt-education",
15148
+ "fields": {
15149
+ "tenantId": {
15150
+ "type": "text",
15151
+ "required": true,
15152
+ "_meta": {
15153
+ "sqlType": "UUID",
15154
+ "__tenancy": {
15155
+ "isTenantIdField": true,
15156
+ "autoFilter": true,
15157
+ "required": true,
15158
+ "autoPopulate": true,
15159
+ "nullable": false,
15160
+ "mode": "required",
15161
+ "field": "tenantId",
15162
+ "allowSuperAdminBypass": false
15163
+ }
15164
+ }
15165
+ },
15166
+ "learnerId": {
15167
+ "type": "foreignKey",
15168
+ "required": true,
15169
+ "related": "Learner",
15170
+ "_meta": {
15171
+ "required": true
15172
+ }
15173
+ },
15174
+ "intakeId": {
15175
+ "type": "foreignKey",
15176
+ "required": true,
15177
+ "related": "WorkbookPhotoIntake",
15178
+ "_meta": {
15179
+ "required": true
15180
+ }
15181
+ },
15182
+ "assetId": {
15183
+ "type": "crossPackageRef",
15184
+ "required": false,
15185
+ "related": "@happyvertical/smrt-assets:Asset"
15186
+ },
15187
+ "name": {
15188
+ "type": "text",
15189
+ "required": false
15190
+ },
15191
+ "mimeType": {
15192
+ "type": "text",
15193
+ "required": false
15194
+ },
15195
+ "sha256": {
15196
+ "type": "text",
15197
+ "required": false
15198
+ },
15199
+ "position": {
15200
+ "type": "integer",
15201
+ "required": true,
15202
+ "default": 0
15203
+ }
15204
+ },
15205
+ "methods": {
15206
+ "delete": {
15207
+ "name": "delete",
15208
+ "async": true,
15209
+ "parameters": [],
15210
+ "returnType": "Promise<void>",
15211
+ "isStatic": false,
15212
+ "isPublic": true
15213
+ },
15214
+ "save": {
15215
+ "name": "save",
15216
+ "async": true,
15217
+ "parameters": [],
15218
+ "returnType": "Promise<this>",
15219
+ "isStatic": false,
15220
+ "isPublic": true
15221
+ }
15222
+ },
15223
+ "decoratorConfig": {
15224
+ "tableName": "workbook_photo_assets",
15225
+ "conflictColumns": [
15226
+ "tenant_id",
15227
+ "intake_id",
15228
+ "asset_id"
15229
+ ],
15230
+ "api": false,
15231
+ "mcp": false,
15232
+ "cli": false,
15233
+ "tenantScoped": {
15234
+ "mode": "required"
15235
+ }
15236
+ },
15237
+ "extends": "SmrtObject",
15238
+ "exportName": "WorkbookPhotoAsset",
15239
+ "collectionExportName": "WorkbookPhotoAssetCollection",
15240
+ "displayLabelField": "name",
15241
+ "validationRules": [
15242
+ {
15243
+ "field": "learnerId",
15244
+ "rule": "required",
15245
+ "fieldType": "foreignKey"
15246
+ },
15247
+ {
15248
+ "field": "intakeId",
15249
+ "rule": "required",
15250
+ "fieldType": "foreignKey"
15251
+ },
15252
+ {
15253
+ "field": "position",
15254
+ "rule": "required",
15255
+ "fieldType": "integer"
15256
+ }
15257
+ ],
15258
+ "schema": {
15259
+ "tableName": "workbook_photo_assets",
15260
+ "ddl": "CREATE TABLE IF NOT EXISTS \"workbook_photo_assets\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"tenant_id\" UUID NOT NULL,\n \"learner_id\" UUID NOT NULL,\n \"intake_id\" UUID NOT NULL,\n \"asset_id\" UUID,\n \"name\" TEXT,\n \"mime_type\" TEXT,\n \"sha256\" TEXT,\n \"position\" INTEGER NOT NULL DEFAULT 0\n);",
15261
+ "columns": {
15262
+ "id": {
15263
+ "type": "UUID",
15264
+ "primaryKey": true,
15265
+ "referenceKind": "id",
15266
+ "notNull": true
15267
+ },
15268
+ "slug": {
15269
+ "type": "TEXT",
15270
+ "notNull": true
15271
+ },
15272
+ "context": {
15273
+ "type": "TEXT",
15274
+ "notNull": true,
15275
+ "default": ""
15276
+ },
15277
+ "created_at": {
15278
+ "type": "TIMESTAMP",
15279
+ "notNull": true,
15280
+ "default": "current_timestamp"
15281
+ },
15282
+ "updated_at": {
15283
+ "type": "TIMESTAMP",
15284
+ "notNull": true,
15285
+ "default": "current_timestamp"
15286
+ },
15287
+ "tenant_id": {
15288
+ "type": "UUID",
15289
+ "referenceKind": "tenantId",
15290
+ "notNull": true,
15291
+ "unique": false
15292
+ },
15293
+ "learner_id": {
15294
+ "type": "UUID",
15295
+ "referenceKind": "foreignKey",
15296
+ "notNull": true,
15297
+ "unique": false,
15298
+ "foreignKey": {
15299
+ "table": "learners",
15300
+ "column": "id",
15301
+ "onDelete": "NO ACTION",
15302
+ "onUpdate": "CASCADE"
15303
+ }
15304
+ },
15305
+ "intake_id": {
15306
+ "type": "UUID",
15307
+ "referenceKind": "foreignKey",
15308
+ "notNull": true,
15309
+ "unique": false,
15310
+ "foreignKey": {
15311
+ "table": "workbook_photo_intakes",
15312
+ "column": "id",
15313
+ "onDelete": "CASCADE",
15314
+ "onUpdate": "CASCADE"
15315
+ }
15316
+ },
15317
+ "asset_id": {
15318
+ "type": "UUID",
15319
+ "referenceKind": "crossPackageRef",
15320
+ "notNull": false,
15321
+ "unique": false
15322
+ },
15323
+ "name": {
15324
+ "type": "TEXT",
15325
+ "notNull": false,
15326
+ "unique": false
15327
+ },
15328
+ "mime_type": {
15329
+ "type": "TEXT",
15330
+ "notNull": false,
15331
+ "unique": false
15332
+ },
15333
+ "sha256": {
15334
+ "type": "TEXT",
15335
+ "notNull": false,
15336
+ "unique": false
15337
+ },
15338
+ "position": {
15339
+ "type": "INTEGER",
15340
+ "notNull": true,
15341
+ "unique": false,
15342
+ "default": 0
15343
+ }
15344
+ },
15345
+ "indexes": [
15346
+ {
15347
+ "name": "workbook_photo_assets_tenant_id_intake_id_idx",
15348
+ "columns": [
15349
+ "tenant_id",
15350
+ "intake_id",
15351
+ "asset_id"
15352
+ ],
15353
+ "unique": true,
15354
+ "nullsNotDistinct": true
15355
+ },
15356
+ {
15357
+ "name": "workbook_photo_assets_slug_context_idx",
15358
+ "columns": [
15359
+ "slug",
15360
+ "context"
15361
+ ]
15362
+ },
15363
+ {
15364
+ "name": "workbook_photo_assets_tenant_id_created_at_idx",
15365
+ "columns": [
15366
+ "tenant_id",
15367
+ "created_at"
15368
+ ]
15369
+ },
15370
+ {
15371
+ "name": "workbook_photo_assets_learner_id_idx",
15372
+ "columns": [
15373
+ "learner_id"
15374
+ ]
15375
+ },
15376
+ {
15377
+ "name": "workbook_photo_assets_intake_id_idx",
15378
+ "columns": [
15379
+ "intake_id"
15380
+ ]
15381
+ },
15382
+ {
15383
+ "name": "workbook_photo_assets_asset_id_idx",
15384
+ "columns": [
15385
+ "asset_id"
15386
+ ]
15387
+ }
15388
+ ],
15389
+ "version": "9d49acb2"
15390
+ },
15391
+ "importPath": "@happyvertical/smrt-education"
15392
+ },
15393
+ "@happyvertical/smrt-education:WorkbookPhotoAssetCollection": {
15394
+ "name": "workbookphotoassetcollection",
15395
+ "className": "WorkbookPhotoAssetCollection",
15396
+ "qualifiedName": "@happyvertical/smrt-education:WorkbookPhotoAssetCollection",
15397
+ "collection": "workbookphotoassets",
15398
+ "filePath": "/home/runner/work/smrt/smrt/packages/education/src/workbook-photo-models.ts",
15399
+ "packageName": "@happyvertical/smrt-education",
15400
+ "fields": {},
15401
+ "methods": {},
15402
+ "decoratorConfig": {
15403
+ "tableName": "workbook_photo_assets",
15404
+ "api": false,
15405
+ "mcp": false,
15406
+ "cli": false
15407
+ },
15408
+ "extends": "SmrtCollection",
15409
+ "extendsTypeArg": "WorkbookPhotoAsset",
15410
+ "exportName": "WorkbookPhotoAssetCollection",
15411
+ "collectionExportName": "WorkbookPhotoAssetCollectionCollection",
15412
+ "schema": {
15413
+ "tableName": "workbook_photo_assets",
15414
+ "ddl": "CREATE TABLE IF NOT EXISTS \"workbook_photo_assets\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"tenant_id\" UUID NOT NULL,\n \"learner_id\" UUID NOT NULL,\n \"intake_id\" UUID NOT NULL,\n \"asset_id\" UUID,\n \"name\" TEXT,\n \"mime_type\" TEXT,\n \"sha256\" TEXT,\n \"position\" INTEGER NOT NULL DEFAULT 0\n);",
15415
+ "columns": {
15416
+ "id": {
15417
+ "type": "UUID",
15418
+ "primaryKey": true,
15419
+ "referenceKind": "id",
15420
+ "notNull": true
15421
+ },
15422
+ "slug": {
15423
+ "type": "TEXT",
15424
+ "notNull": true
15425
+ },
15426
+ "context": {
15427
+ "type": "TEXT",
15428
+ "notNull": true,
15429
+ "default": ""
15430
+ },
15431
+ "created_at": {
15432
+ "type": "TIMESTAMP",
15433
+ "notNull": true,
15434
+ "default": "current_timestamp"
15435
+ },
15436
+ "updated_at": {
15437
+ "type": "TIMESTAMP",
15438
+ "notNull": true,
15439
+ "default": "current_timestamp"
15440
+ },
15441
+ "tenant_id": {
15442
+ "type": "UUID",
15443
+ "referenceKind": "tenantId",
15444
+ "notNull": true,
15445
+ "unique": false
15446
+ },
15447
+ "learner_id": {
15448
+ "type": "UUID",
15449
+ "referenceKind": "foreignKey",
15450
+ "notNull": true,
15451
+ "unique": false,
15452
+ "foreignKey": {
15453
+ "table": "learners",
15454
+ "column": "id",
15455
+ "onDelete": "NO ACTION",
15456
+ "onUpdate": "CASCADE"
15457
+ }
15458
+ },
15459
+ "intake_id": {
15460
+ "type": "UUID",
15461
+ "referenceKind": "foreignKey",
15462
+ "notNull": true,
15463
+ "unique": false,
15464
+ "foreignKey": {
15465
+ "table": "workbook_photo_intakes",
15466
+ "column": "id",
15467
+ "onDelete": "CASCADE",
15468
+ "onUpdate": "CASCADE"
15469
+ }
15470
+ },
15471
+ "asset_id": {
15472
+ "type": "UUID",
15473
+ "referenceKind": "crossPackageRef",
15474
+ "notNull": false,
15475
+ "unique": false
15476
+ },
15477
+ "name": {
15478
+ "type": "TEXT",
15479
+ "notNull": false,
15480
+ "unique": false
15481
+ },
15482
+ "mime_type": {
15483
+ "type": "TEXT",
15484
+ "notNull": false,
15485
+ "unique": false
15486
+ },
15487
+ "sha256": {
15488
+ "type": "TEXT",
15489
+ "notNull": false,
15490
+ "unique": false
15491
+ },
15492
+ "position": {
15493
+ "type": "INTEGER",
15494
+ "notNull": true,
15495
+ "unique": false,
15496
+ "default": 0
15497
+ }
15498
+ },
15499
+ "indexes": [
15500
+ {
15501
+ "name": "workbook_photo_assets_tenant_id_intake_id_idx",
15502
+ "columns": [
15503
+ "tenant_id",
15504
+ "intake_id",
15505
+ "asset_id"
15506
+ ],
15507
+ "unique": true,
15508
+ "nullsNotDistinct": true
15509
+ },
15510
+ {
15511
+ "name": "workbook_photo_assets_slug_context_idx",
15512
+ "columns": [
15513
+ "slug",
15514
+ "context"
15515
+ ]
15516
+ },
15517
+ {
15518
+ "name": "workbook_photo_assets_tenant_id_created_at_idx",
15519
+ "columns": [
15520
+ "tenant_id",
15521
+ "created_at"
15522
+ ]
15523
+ },
15524
+ {
15525
+ "name": "workbook_photo_assets_learner_id_idx",
15526
+ "columns": [
15527
+ "learner_id"
15528
+ ]
15529
+ },
15530
+ {
15531
+ "name": "workbook_photo_assets_intake_id_idx",
15532
+ "columns": [
15533
+ "intake_id"
15534
+ ]
15535
+ },
15536
+ {
15537
+ "name": "workbook_photo_assets_asset_id_idx",
15538
+ "columns": [
15539
+ "asset_id"
15540
+ ]
15541
+ }
15542
+ ],
15543
+ "version": "9d49acb2"
15544
+ },
15545
+ "importPath": "@happyvertical/smrt-education"
15546
+ },
15547
+ "@happyvertical/smrt-education:WorkbookPhotoDecision": {
15548
+ "name": "workbookphotodecision",
15549
+ "className": "WorkbookPhotoDecision",
15550
+ "qualifiedName": "@happyvertical/smrt-education:WorkbookPhotoDecision",
15551
+ "collection": "workbookphotodecisions",
15552
+ "description": "Immutable provider/guardian/capture decision, retaining provenance and retry key.",
15553
+ "filePath": "/home/runner/work/smrt/smrt/packages/education/src/workbook-photo-models.ts",
15554
+ "packageName": "@happyvertical/smrt-education",
15555
+ "fields": {
15556
+ "tenantId": {
15557
+ "type": "text",
15558
+ "required": true,
15559
+ "_meta": {
15560
+ "sqlType": "UUID",
15561
+ "__tenancy": {
15562
+ "isTenantIdField": true,
15563
+ "autoFilter": true,
15564
+ "required": true,
15565
+ "autoPopulate": true,
15566
+ "nullable": false,
15567
+ "mode": "required",
15568
+ "field": "tenantId",
15569
+ "allowSuperAdminBypass": false
15570
+ }
15571
+ }
15572
+ },
15573
+ "learnerId": {
15574
+ "type": "foreignKey",
15575
+ "required": true,
15576
+ "related": "Learner",
15577
+ "_meta": {
15578
+ "required": true
15579
+ }
15580
+ },
15581
+ "intakeId": {
15582
+ "type": "foreignKey",
15583
+ "required": true,
15584
+ "related": "WorkbookPhotoIntake",
15585
+ "_meta": {
15586
+ "required": true
15587
+ }
15588
+ },
15589
+ "requestKey": {
15590
+ "type": "text",
15591
+ "required": false
15592
+ },
15593
+ "sequence": {
15594
+ "type": "integer",
15595
+ "required": true,
15596
+ "default": 0
15597
+ },
15598
+ "actorUserId": {
15599
+ "type": "text",
15600
+ "required": false
15601
+ },
15602
+ "bodyJson": {
15603
+ "type": "text",
15604
+ "required": false,
15605
+ "_meta": {}
15606
+ }
15607
+ },
15608
+ "methods": {
15609
+ "delete": {
15610
+ "name": "delete",
15611
+ "async": true,
15612
+ "parameters": [],
15613
+ "returnType": "Promise<void>",
15614
+ "isStatic": false,
15615
+ "isPublic": true
15616
+ },
15617
+ "save": {
15618
+ "name": "save",
15619
+ "async": true,
15620
+ "parameters": [],
15621
+ "returnType": "Promise<this>",
15622
+ "isStatic": false,
15623
+ "isPublic": true
15624
+ }
15625
+ },
15626
+ "decoratorConfig": {
15627
+ "tableName": "workbook_photo_decisions",
15628
+ "conflictColumns": [
15629
+ "tenant_id",
15630
+ "intake_id",
15631
+ "request_key"
15632
+ ],
15633
+ "api": false,
15634
+ "mcp": false,
15635
+ "cli": false,
15636
+ "tenantScoped": {
15637
+ "mode": "required"
15638
+ }
15639
+ },
15640
+ "extends": "SmrtObject",
15641
+ "exportName": "WorkbookPhotoDecision",
15642
+ "collectionExportName": "WorkbookPhotoDecisionCollection",
15643
+ "validationRules": [
15644
+ {
15645
+ "field": "learnerId",
15646
+ "rule": "required",
15647
+ "fieldType": "foreignKey"
15648
+ },
15649
+ {
15650
+ "field": "intakeId",
15651
+ "rule": "required",
15652
+ "fieldType": "foreignKey"
15653
+ },
15654
+ {
15655
+ "field": "sequence",
15656
+ "rule": "required",
15657
+ "fieldType": "integer"
15658
+ }
15659
+ ],
15660
+ "schema": {
15661
+ "tableName": "workbook_photo_decisions",
15662
+ "ddl": "CREATE TABLE IF NOT EXISTS \"workbook_photo_decisions\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"tenant_id\" UUID NOT NULL,\n \"learner_id\" UUID NOT NULL,\n \"intake_id\" UUID NOT NULL,\n \"request_key\" TEXT,\n \"sequence\" INTEGER NOT NULL DEFAULT 0,\n \"actor_user_id\" TEXT,\n \"body_json\" TEXT\n);",
15663
+ "columns": {
15664
+ "id": {
15665
+ "type": "UUID",
15666
+ "primaryKey": true,
15667
+ "referenceKind": "id",
15668
+ "notNull": true
15669
+ },
15670
+ "slug": {
15671
+ "type": "TEXT",
15672
+ "notNull": true
15673
+ },
15674
+ "context": {
15675
+ "type": "TEXT",
15676
+ "notNull": true,
15677
+ "default": ""
15678
+ },
15679
+ "created_at": {
15680
+ "type": "TIMESTAMP",
15681
+ "notNull": true,
15682
+ "default": "current_timestamp"
15683
+ },
15684
+ "updated_at": {
15685
+ "type": "TIMESTAMP",
15686
+ "notNull": true,
15687
+ "default": "current_timestamp"
15688
+ },
15689
+ "tenant_id": {
15690
+ "type": "UUID",
15691
+ "referenceKind": "tenantId",
15692
+ "notNull": true,
15693
+ "unique": false
15694
+ },
15695
+ "learner_id": {
15696
+ "type": "UUID",
15697
+ "referenceKind": "foreignKey",
15698
+ "notNull": true,
15699
+ "unique": false,
15700
+ "foreignKey": {
15701
+ "table": "learners",
15702
+ "column": "id",
15703
+ "onDelete": "NO ACTION",
15704
+ "onUpdate": "CASCADE"
15705
+ }
15706
+ },
15707
+ "intake_id": {
15708
+ "type": "UUID",
15709
+ "referenceKind": "foreignKey",
15710
+ "notNull": true,
15711
+ "unique": false,
15712
+ "foreignKey": {
15713
+ "table": "workbook_photo_intakes",
15714
+ "column": "id",
15715
+ "onDelete": "CASCADE",
15716
+ "onUpdate": "CASCADE"
15717
+ }
15718
+ },
15719
+ "request_key": {
15720
+ "type": "TEXT",
15721
+ "notNull": false,
15722
+ "unique": false
15723
+ },
15724
+ "sequence": {
15725
+ "type": "INTEGER",
15726
+ "notNull": true,
15727
+ "unique": false,
15728
+ "default": 0
15729
+ },
15730
+ "actor_user_id": {
15731
+ "type": "TEXT",
15732
+ "notNull": false,
15733
+ "unique": false
15734
+ },
15735
+ "body_json": {
15736
+ "type": "TEXT",
15737
+ "notNull": false,
15738
+ "unique": false
15739
+ }
15740
+ },
15741
+ "indexes": [
15742
+ {
15743
+ "name": "workbook_photo_decisions_tenant_id_intake_id_idx",
15744
+ "columns": [
15745
+ "tenant_id",
15746
+ "intake_id",
15747
+ "request_key"
15748
+ ],
15749
+ "unique": true,
15750
+ "nullsNotDistinct": true
15751
+ },
15752
+ {
15753
+ "name": "workbook_photo_decisions_slug_context_idx",
15754
+ "columns": [
15755
+ "slug",
15756
+ "context"
15757
+ ]
15758
+ },
15759
+ {
15760
+ "name": "workbook_photo_decisions_tenant_id_created_at_idx",
15761
+ "columns": [
15762
+ "tenant_id",
15763
+ "created_at"
15764
+ ]
15765
+ },
15766
+ {
15767
+ "name": "workbook_photo_decisions_learner_id_idx",
15768
+ "columns": [
15769
+ "learner_id"
15770
+ ]
15771
+ },
15772
+ {
15773
+ "name": "workbook_photo_decisions_intake_id_idx",
15774
+ "columns": [
15775
+ "intake_id"
15776
+ ]
15777
+ }
15778
+ ],
15779
+ "version": "4c8b4e5f"
15780
+ },
15781
+ "importPath": "@happyvertical/smrt-education"
15782
+ },
15783
+ "@happyvertical/smrt-education:WorkbookPhotoDecisionCollection": {
15784
+ "name": "workbookphotodecisioncollection",
15785
+ "className": "WorkbookPhotoDecisionCollection",
15786
+ "qualifiedName": "@happyvertical/smrt-education:WorkbookPhotoDecisionCollection",
15787
+ "collection": "workbookphotodecisions",
15788
+ "filePath": "/home/runner/work/smrt/smrt/packages/education/src/workbook-photo-models.ts",
15789
+ "packageName": "@happyvertical/smrt-education",
15790
+ "fields": {},
15791
+ "methods": {},
15792
+ "decoratorConfig": {
15793
+ "tableName": "workbook_photo_decisions",
15794
+ "api": false,
15795
+ "mcp": false,
15796
+ "cli": false
15797
+ },
15798
+ "extends": "SmrtCollection",
15799
+ "extendsTypeArg": "WorkbookPhotoDecision",
15800
+ "exportName": "WorkbookPhotoDecisionCollection",
15801
+ "collectionExportName": "WorkbookPhotoDecisionCollectionCollection",
15802
+ "schema": {
15803
+ "tableName": "workbook_photo_decisions",
15804
+ "ddl": "CREATE TABLE IF NOT EXISTS \"workbook_photo_decisions\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"tenant_id\" UUID NOT NULL,\n \"learner_id\" UUID NOT NULL,\n \"intake_id\" UUID NOT NULL,\n \"request_key\" TEXT,\n \"sequence\" INTEGER NOT NULL DEFAULT 0,\n \"actor_user_id\" TEXT,\n \"body_json\" TEXT\n);",
15805
+ "columns": {
15806
+ "id": {
15807
+ "type": "UUID",
15808
+ "primaryKey": true,
15809
+ "referenceKind": "id",
15810
+ "notNull": true
15811
+ },
15812
+ "slug": {
15813
+ "type": "TEXT",
15814
+ "notNull": true
15815
+ },
15816
+ "context": {
15817
+ "type": "TEXT",
15818
+ "notNull": true,
15819
+ "default": ""
15820
+ },
15821
+ "created_at": {
15822
+ "type": "TIMESTAMP",
15823
+ "notNull": true,
15824
+ "default": "current_timestamp"
15825
+ },
15826
+ "updated_at": {
15827
+ "type": "TIMESTAMP",
15828
+ "notNull": true,
15829
+ "default": "current_timestamp"
15830
+ },
15831
+ "tenant_id": {
15832
+ "type": "UUID",
15833
+ "referenceKind": "tenantId",
15834
+ "notNull": true,
15835
+ "unique": false
15836
+ },
15837
+ "learner_id": {
15838
+ "type": "UUID",
15839
+ "referenceKind": "foreignKey",
15840
+ "notNull": true,
15841
+ "unique": false,
15842
+ "foreignKey": {
15843
+ "table": "learners",
15844
+ "column": "id",
15845
+ "onDelete": "NO ACTION",
15846
+ "onUpdate": "CASCADE"
15847
+ }
15848
+ },
15849
+ "intake_id": {
15850
+ "type": "UUID",
15851
+ "referenceKind": "foreignKey",
15852
+ "notNull": true,
15853
+ "unique": false,
15854
+ "foreignKey": {
15855
+ "table": "workbook_photo_intakes",
15856
+ "column": "id",
15857
+ "onDelete": "CASCADE",
15858
+ "onUpdate": "CASCADE"
15859
+ }
15860
+ },
15861
+ "request_key": {
15862
+ "type": "TEXT",
15863
+ "notNull": false,
15864
+ "unique": false
15865
+ },
15866
+ "sequence": {
15867
+ "type": "INTEGER",
15868
+ "notNull": true,
15869
+ "unique": false,
15870
+ "default": 0
15871
+ },
15872
+ "actor_user_id": {
15873
+ "type": "TEXT",
15874
+ "notNull": false,
15875
+ "unique": false
15876
+ },
15877
+ "body_json": {
15878
+ "type": "TEXT",
15879
+ "notNull": false,
15880
+ "unique": false
15881
+ }
15882
+ },
15883
+ "indexes": [
15884
+ {
15885
+ "name": "workbook_photo_decisions_tenant_id_intake_id_idx",
15886
+ "columns": [
15887
+ "tenant_id",
15888
+ "intake_id",
15889
+ "request_key"
15890
+ ],
15891
+ "unique": true,
15892
+ "nullsNotDistinct": true
15893
+ },
15894
+ {
15895
+ "name": "workbook_photo_decisions_slug_context_idx",
15896
+ "columns": [
15897
+ "slug",
15898
+ "context"
15899
+ ]
15900
+ },
15901
+ {
15902
+ "name": "workbook_photo_decisions_tenant_id_created_at_idx",
15903
+ "columns": [
15904
+ "tenant_id",
15905
+ "created_at"
15906
+ ]
15907
+ },
15908
+ {
15909
+ "name": "workbook_photo_decisions_learner_id_idx",
15910
+ "columns": [
15911
+ "learner_id"
15912
+ ]
15913
+ },
15914
+ {
15915
+ "name": "workbook_photo_decisions_intake_id_idx",
15916
+ "columns": [
15917
+ "intake_id"
15918
+ ]
15919
+ }
15920
+ ],
15921
+ "version": "4c8b4e5f"
15922
+ },
15923
+ "importPath": "@happyvertical/smrt-education"
15924
+ },
15925
+ "@happyvertical/smrt-education:WorkbookContextRevision": {
15926
+ "name": "workbookcontextrevision",
15927
+ "className": "WorkbookContextRevision",
15928
+ "qualifiedName": "@happyvertical/smrt-education:WorkbookContextRevision",
15929
+ "collection": "workbookcontextrevisions",
15930
+ "description": "Versioned contextual metadata; never edits Workbook identity or learning evidence.",
15931
+ "filePath": "/home/runner/work/smrt/smrt/packages/education/src/workbook-photo-models.ts",
15932
+ "packageName": "@happyvertical/smrt-education",
15933
+ "fields": {
15934
+ "tenantId": {
15935
+ "type": "text",
15936
+ "required": true,
15937
+ "_meta": {
15938
+ "sqlType": "UUID",
15939
+ "__tenancy": {
15940
+ "isTenantIdField": true,
15941
+ "autoFilter": true,
15942
+ "required": true,
15943
+ "autoPopulate": true,
15944
+ "nullable": false,
15945
+ "mode": "required",
15946
+ "field": "tenantId",
15947
+ "allowSuperAdminBypass": false
15948
+ }
15949
+ }
15950
+ },
15951
+ "learnerId": {
15952
+ "type": "foreignKey",
15953
+ "required": true,
15954
+ "related": "Learner",
15955
+ "_meta": {
15956
+ "required": true
15957
+ }
15958
+ },
15959
+ "workbookId": {
15960
+ "type": "foreignKey",
15961
+ "required": true,
15962
+ "related": "Workbook",
15963
+ "_meta": {
15964
+ "required": true
15965
+ }
15966
+ },
15967
+ "decisionId": {
15968
+ "type": "foreignKey",
15969
+ "required": true,
15970
+ "related": "WorkbookPhotoDecision",
15971
+ "_meta": {
15972
+ "required": true
15973
+ }
15974
+ },
15975
+ "metadataJson": {
15976
+ "type": "text",
15977
+ "required": false,
15978
+ "_meta": {}
15979
+ }
15980
+ },
15981
+ "methods": {
15982
+ "delete": {
15983
+ "name": "delete",
15984
+ "async": true,
15985
+ "parameters": [],
15986
+ "returnType": "Promise<void>",
15987
+ "isStatic": false,
15988
+ "isPublic": true
15989
+ },
15990
+ "save": {
15991
+ "name": "save",
15992
+ "async": true,
15993
+ "parameters": [],
15994
+ "returnType": "Promise<this>",
15995
+ "isStatic": false,
15996
+ "isPublic": true
15997
+ }
15998
+ },
15999
+ "decoratorConfig": {
16000
+ "tableName": "workbook_context_revisions",
16001
+ "conflictColumns": [
16002
+ "tenant_id",
16003
+ "decision_id"
16004
+ ],
16005
+ "api": false,
16006
+ "mcp": false,
16007
+ "cli": false,
16008
+ "tenantScoped": {
16009
+ "mode": "required"
16010
+ }
16011
+ },
16012
+ "extends": "SmrtObject",
16013
+ "exportName": "WorkbookContextRevision",
16014
+ "collectionExportName": "WorkbookContextRevisionCollection",
16015
+ "validationRules": [
16016
+ {
16017
+ "field": "learnerId",
16018
+ "rule": "required",
16019
+ "fieldType": "foreignKey"
16020
+ },
16021
+ {
16022
+ "field": "workbookId",
16023
+ "rule": "required",
16024
+ "fieldType": "foreignKey"
16025
+ },
16026
+ {
16027
+ "field": "decisionId",
16028
+ "rule": "required",
16029
+ "fieldType": "foreignKey"
16030
+ }
16031
+ ],
16032
+ "schema": {
16033
+ "tableName": "workbook_context_revisions",
16034
+ "ddl": "CREATE TABLE IF NOT EXISTS \"workbook_context_revisions\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"tenant_id\" UUID NOT NULL,\n \"learner_id\" UUID NOT NULL,\n \"workbook_id\" UUID NOT NULL,\n \"decision_id\" UUID NOT NULL,\n \"metadata_json\" TEXT\n);",
16035
+ "columns": {
16036
+ "id": {
16037
+ "type": "UUID",
16038
+ "primaryKey": true,
16039
+ "referenceKind": "id",
16040
+ "notNull": true
16041
+ },
16042
+ "slug": {
16043
+ "type": "TEXT",
16044
+ "notNull": true
16045
+ },
16046
+ "context": {
16047
+ "type": "TEXT",
16048
+ "notNull": true,
16049
+ "default": ""
16050
+ },
16051
+ "created_at": {
16052
+ "type": "TIMESTAMP",
16053
+ "notNull": true,
16054
+ "default": "current_timestamp"
16055
+ },
16056
+ "updated_at": {
16057
+ "type": "TIMESTAMP",
16058
+ "notNull": true,
16059
+ "default": "current_timestamp"
16060
+ },
16061
+ "tenant_id": {
16062
+ "type": "UUID",
16063
+ "referenceKind": "tenantId",
16064
+ "notNull": true,
16065
+ "unique": false
16066
+ },
16067
+ "learner_id": {
16068
+ "type": "UUID",
16069
+ "referenceKind": "foreignKey",
16070
+ "notNull": true,
16071
+ "unique": false,
16072
+ "foreignKey": {
16073
+ "table": "learners",
16074
+ "column": "id",
16075
+ "onDelete": "NO ACTION",
16076
+ "onUpdate": "CASCADE"
16077
+ }
16078
+ },
16079
+ "workbook_id": {
16080
+ "type": "UUID",
16081
+ "referenceKind": "foreignKey",
16082
+ "notNull": true,
16083
+ "unique": false,
16084
+ "foreignKey": {
16085
+ "table": "workbooks",
16086
+ "column": "id",
16087
+ "onDelete": "NO ACTION",
16088
+ "onUpdate": "CASCADE"
16089
+ }
16090
+ },
16091
+ "decision_id": {
16092
+ "type": "UUID",
16093
+ "referenceKind": "foreignKey",
16094
+ "notNull": true,
16095
+ "unique": false,
16096
+ "foreignKey": {
16097
+ "table": "workbook_photo_decisions",
16098
+ "column": "id",
16099
+ "onDelete": "CASCADE",
16100
+ "onUpdate": "CASCADE"
16101
+ }
16102
+ },
16103
+ "metadata_json": {
16104
+ "type": "TEXT",
16105
+ "notNull": false,
16106
+ "unique": false
16107
+ }
16108
+ },
16109
+ "indexes": [
16110
+ {
16111
+ "name": "workbook_context_revisions_tenant_id_decision_id_idx",
16112
+ "columns": [
16113
+ "tenant_id",
16114
+ "decision_id"
16115
+ ],
16116
+ "unique": true
16117
+ },
16118
+ {
16119
+ "name": "workbook_context_revisions_slug_context_idx",
16120
+ "columns": [
16121
+ "slug",
16122
+ "context"
16123
+ ]
16124
+ },
16125
+ {
16126
+ "name": "workbook_context_revisions_tenant_id_created_at_idx",
16127
+ "columns": [
16128
+ "tenant_id",
16129
+ "created_at"
16130
+ ]
16131
+ },
16132
+ {
16133
+ "name": "workbook_context_revisions_learner_id_idx",
16134
+ "columns": [
16135
+ "learner_id"
16136
+ ]
16137
+ },
16138
+ {
16139
+ "name": "workbook_context_revisions_workbook_id_idx",
16140
+ "columns": [
16141
+ "workbook_id"
16142
+ ]
16143
+ },
16144
+ {
16145
+ "name": "workbook_context_revisions_decision_id_idx",
16146
+ "columns": [
16147
+ "decision_id"
16148
+ ]
16149
+ }
16150
+ ],
16151
+ "version": "b1e8b4dc"
16152
+ },
16153
+ "importPath": "@happyvertical/smrt-education"
16154
+ },
16155
+ "@happyvertical/smrt-education:WorkbookContextRevisionCollection": {
16156
+ "name": "workbookcontextrevisioncollection",
16157
+ "className": "WorkbookContextRevisionCollection",
16158
+ "qualifiedName": "@happyvertical/smrt-education:WorkbookContextRevisionCollection",
16159
+ "collection": "workbookcontextrevisions",
16160
+ "filePath": "/home/runner/work/smrt/smrt/packages/education/src/workbook-photo-models.ts",
16161
+ "packageName": "@happyvertical/smrt-education",
16162
+ "fields": {},
16163
+ "methods": {},
16164
+ "decoratorConfig": {
16165
+ "tableName": "workbook_context_revisions",
16166
+ "api": false,
16167
+ "mcp": false,
16168
+ "cli": false
16169
+ },
16170
+ "extends": "SmrtCollection",
16171
+ "extendsTypeArg": "WorkbookContextRevision",
16172
+ "exportName": "WorkbookContextRevisionCollection",
16173
+ "collectionExportName": "WorkbookContextRevisionCollectionCollection",
16174
+ "schema": {
16175
+ "tableName": "workbook_context_revisions",
16176
+ "ddl": "CREATE TABLE IF NOT EXISTS \"workbook_context_revisions\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"tenant_id\" UUID NOT NULL,\n \"learner_id\" UUID NOT NULL,\n \"workbook_id\" UUID NOT NULL,\n \"decision_id\" UUID NOT NULL,\n \"metadata_json\" TEXT\n);",
16177
+ "columns": {
16178
+ "id": {
16179
+ "type": "UUID",
16180
+ "primaryKey": true,
16181
+ "referenceKind": "id",
16182
+ "notNull": true
16183
+ },
16184
+ "slug": {
16185
+ "type": "TEXT",
16186
+ "notNull": true
16187
+ },
16188
+ "context": {
16189
+ "type": "TEXT",
16190
+ "notNull": true,
16191
+ "default": ""
16192
+ },
16193
+ "created_at": {
16194
+ "type": "TIMESTAMP",
16195
+ "notNull": true,
16196
+ "default": "current_timestamp"
16197
+ },
16198
+ "updated_at": {
16199
+ "type": "TIMESTAMP",
16200
+ "notNull": true,
16201
+ "default": "current_timestamp"
16202
+ },
16203
+ "tenant_id": {
16204
+ "type": "UUID",
16205
+ "referenceKind": "tenantId",
16206
+ "notNull": true,
16207
+ "unique": false
16208
+ },
16209
+ "learner_id": {
16210
+ "type": "UUID",
16211
+ "referenceKind": "foreignKey",
16212
+ "notNull": true,
16213
+ "unique": false,
16214
+ "foreignKey": {
16215
+ "table": "learners",
16216
+ "column": "id",
16217
+ "onDelete": "NO ACTION",
16218
+ "onUpdate": "CASCADE"
16219
+ }
16220
+ },
16221
+ "workbook_id": {
16222
+ "type": "UUID",
16223
+ "referenceKind": "foreignKey",
16224
+ "notNull": true,
16225
+ "unique": false,
16226
+ "foreignKey": {
16227
+ "table": "workbooks",
16228
+ "column": "id",
16229
+ "onDelete": "NO ACTION",
16230
+ "onUpdate": "CASCADE"
16231
+ }
16232
+ },
16233
+ "decision_id": {
16234
+ "type": "UUID",
16235
+ "referenceKind": "foreignKey",
16236
+ "notNull": true,
16237
+ "unique": false,
16238
+ "foreignKey": {
16239
+ "table": "workbook_photo_decisions",
16240
+ "column": "id",
16241
+ "onDelete": "CASCADE",
16242
+ "onUpdate": "CASCADE"
16243
+ }
16244
+ },
16245
+ "metadata_json": {
16246
+ "type": "TEXT",
16247
+ "notNull": false,
16248
+ "unique": false
16249
+ }
16250
+ },
16251
+ "indexes": [
16252
+ {
16253
+ "name": "workbook_context_revisions_tenant_id_decision_id_idx",
16254
+ "columns": [
16255
+ "tenant_id",
16256
+ "decision_id"
16257
+ ],
16258
+ "unique": true
16259
+ },
16260
+ {
16261
+ "name": "workbook_context_revisions_slug_context_idx",
16262
+ "columns": [
16263
+ "slug",
16264
+ "context"
16265
+ ]
16266
+ },
16267
+ {
16268
+ "name": "workbook_context_revisions_tenant_id_created_at_idx",
16269
+ "columns": [
16270
+ "tenant_id",
16271
+ "created_at"
16272
+ ]
16273
+ },
16274
+ {
16275
+ "name": "workbook_context_revisions_learner_id_idx",
16276
+ "columns": [
16277
+ "learner_id"
16278
+ ]
16279
+ },
16280
+ {
16281
+ "name": "workbook_context_revisions_workbook_id_idx",
16282
+ "columns": [
16283
+ "workbook_id"
16284
+ ]
16285
+ },
16286
+ {
16287
+ "name": "workbook_context_revisions_decision_id_idx",
16288
+ "columns": [
16289
+ "decision_id"
16290
+ ]
16291
+ }
16292
+ ],
16293
+ "version": "b1e8b4dc"
16294
+ },
16295
+ "importPath": "@happyvertical/smrt-education"
11567
16296
  }
11568
16297
  },
11569
16298
  "moduleType": "smrt",