diff --git a/school_data_hub_client/lib/src/protocol/_features/schoolday_events/models/schoolday_event.dart b/school_data_hub_client/lib/src/protocol/_features/schoolday_events/models/schoolday_event.dart index 1a8a968d..2f8465fe 100644 --- a/school_data_hub_client/lib/src/protocol/_features/schoolday_events/models/schoolday_event.dart +++ b/school_data_hub_client/lib/src/protocol/_features/schoolday_events/models/schoolday_event.dart @@ -22,6 +22,7 @@ abstract class SchooldayEvent implements _i1.SerializableModel { required this.eventId, required this.eventType, required this.eventReason, + this.eventTime, required this.createdBy, required this.processed, this.processedBy, @@ -42,6 +43,7 @@ abstract class SchooldayEvent implements _i1.SerializableModel { required String eventId, required _i2.SchooldayEventType eventType, required String eventReason, + String? eventTime, required String createdBy, required bool processed, String? processedBy, @@ -64,6 +66,7 @@ abstract class SchooldayEvent implements _i1.SerializableModel { eventType: _i2.SchooldayEventType.fromJson( (jsonSerialization['eventType'] as String)), eventReason: jsonSerialization['eventReason'] as String, + eventTime: jsonSerialization['eventTime'] as String?, createdBy: jsonSerialization['createdBy'] as String, processed: jsonSerialization['processed'] as bool, processedBy: jsonSerialization['processedBy'] as String?, @@ -106,6 +109,8 @@ abstract class SchooldayEvent implements _i1.SerializableModel { String eventReason; + String? eventTime; + String createdBy; bool processed; @@ -140,6 +145,7 @@ abstract class SchooldayEvent implements _i1.SerializableModel { String? eventId, _i2.SchooldayEventType? eventType, String? eventReason, + String? eventTime, String? createdBy, bool? processed, String? processedBy, @@ -161,6 +167,7 @@ abstract class SchooldayEvent implements _i1.SerializableModel { 'eventId': eventId, 'eventType': eventType.toJson(), 'eventReason': eventReason, + if (eventTime != null) 'eventTime': eventTime, 'createdBy': createdBy, 'processed': processed, if (processedBy != null) 'processedBy': processedBy, @@ -193,6 +200,7 @@ class _SchooldayEventImpl extends SchooldayEvent { required String eventId, required _i2.SchooldayEventType eventType, required String eventReason, + String? eventTime, required String createdBy, required bool processed, String? processedBy, @@ -211,6 +219,7 @@ class _SchooldayEventImpl extends SchooldayEvent { eventId: eventId, eventType: eventType, eventReason: eventReason, + eventTime: eventTime, createdBy: createdBy, processed: processed, processedBy: processedBy, @@ -235,6 +244,7 @@ class _SchooldayEventImpl extends SchooldayEvent { String? eventId, _i2.SchooldayEventType? eventType, String? eventReason, + Object? eventTime = _Undefined, String? createdBy, bool? processed, Object? processedBy = _Undefined, @@ -254,6 +264,7 @@ class _SchooldayEventImpl extends SchooldayEvent { eventId: eventId ?? this.eventId, eventType: eventType ?? this.eventType, eventReason: eventReason ?? this.eventReason, + eventTime: eventTime is String? ? eventTime : this.eventTime, createdBy: createdBy ?? this.createdBy, processed: processed ?? this.processed, processedBy: processedBy is String? ? processedBy : this.processedBy, diff --git a/school_data_hub_client/lib/src/protocol/client.dart b/school_data_hub_client/lib/src/protocol/client.dart index 57d682d6..16317633 100644 --- a/school_data_hub_client/lib/src/protocol/client.dart +++ b/school_data_hub_client/lib/src/protocol/client.dart @@ -845,6 +845,95 @@ class EndpointCompetence extends _i1.EndpointRef { ); } +/// {@category Endpoint} +class EndpointCompetenceGoal extends _i1.EndpointRef { + EndpointCompetenceGoal(_i1.EndpointCaller caller) : super(caller); + + @override + String get name => 'competenceGoal'; + + _i2.Future<_i5.PupilData> postCompetenceGoal({ + required int competenceId, + required int pupilId, + required String description, + List? strategies, + required String createdBy, + String? modifiedBy, + int? score, + DateTime? achievedAt, + }) => + caller.callServerEndpoint<_i5.PupilData>( + 'competenceGoal', + 'postCompetenceGoal', + { + 'competenceId': competenceId, + 'pupilId': pupilId, + 'description': description, + 'strategies': strategies, + 'createdBy': createdBy, + 'modifiedBy': modifiedBy, + 'score': score, + 'achievedAt': achievedAt, + }, + ); + + _i2.Future<_i5.PupilData> updateCompetenceGoal( + String publicId, { + ({String value})? description, + ({List? value})? strategies, + ({String value})? modifiedBy, + ({int? value})? score, + ({DateTime value})? achievedAt, + }) => + caller.callServerEndpoint<_i5.PupilData>( + 'competenceGoal', + 'updateCompetenceGoal', + { + 'publicId': publicId, + 'description': _i16.mapRecordToJson(description), + 'strategies': _i16.mapRecordToJson(strategies), + 'modifiedBy': _i16.mapRecordToJson(modifiedBy), + 'score': _i16.mapRecordToJson(score), + 'achievedAt': _i16.mapRecordToJson(achievedAt), + }, + ); + + _i2.Future<_i5.PupilData> deleteCompetenceGoal(String publicId) => + caller.callServerEndpoint<_i5.PupilData>( + 'competenceGoal', + 'deleteCompetenceGoal', + {'publicId': publicId}, + ); + + _i2.Future<_i5.PupilData> addFileToCompetenceGoal( + String publicId, + String filePath, + String createdBy, + ) => + caller.callServerEndpoint<_i5.PupilData>( + 'competenceGoal', + 'addFileToCompetenceGoal', + { + 'publicId': publicId, + 'filePath': filePath, + 'createdBy': createdBy, + }, + ); + + _i2.Future<_i5.PupilData> removeFileFromCompetenceGoal( + String publicId, + String documentId, + ) => + caller.callServerEndpoint<_i5.PupilData>( + 'competenceGoal', + 'removeFileFromCompetenceGoal', + { + 'publicId': publicId, + 'documentId': documentId, + }, + ); +} + /// {@category Endpoint} class EndpointLearningSupportPlan extends _i1.EndpointRef { EndpointLearningSupportPlan(_i1.EndpointCaller caller) : super(caller); @@ -1274,8 +1363,8 @@ class EndpointPupilIdentity extends _i1.EndpointRef { {}, ); - _i2.Future updateLastPupilIdentitiesUpdate(DateTime date) => - caller.callServerEndpoint( + _i2.Future updateLastPupilIdentitiesUpdate(DateTime date) => + caller.callServerEndpoint( 'pupilIdentity', 'updateLastPupilIdentitiesUpdate', {'date': date}, @@ -2514,6 +2603,7 @@ class Client extends _i1.ServerpodClientShared { pupilBookLending = EndpointPupilBookLending(this); competenceCheck = EndpointCompetenceCheck(this); competence = EndpointCompetence(this); + competenceGoal = EndpointCompetenceGoal(this); learningSupportPlan = EndpointLearningSupportPlan(this); preSchoolMedical = EndpointPreSchoolMedical(this); supportCategory = EndpointSupportCategory(this); @@ -2565,6 +2655,8 @@ class Client extends _i1.ServerpodClientShared { late final EndpointCompetence competence; + late final EndpointCompetenceGoal competenceGoal; + late final EndpointLearningSupportPlan learningSupportPlan; late final EndpointPreSchoolMedical preSchoolMedical; @@ -2628,6 +2720,7 @@ class Client extends _i1.ServerpodClientShared { 'pupilBookLending': pupilBookLending, 'competenceCheck': competenceCheck, 'competence': competence, + 'competenceGoal': competenceGoal, 'learningSupportPlan': learningSupportPlan, 'preSchoolMedical': preSchoolMedical, 'supportCategory': supportCategory, diff --git a/school_data_hub_client/lib/src/protocol/protocol.dart b/school_data_hub_client/lib/src/protocol/protocol.dart index 05aa048d..202a5855 100644 --- a/school_data_hub_client/lib/src/protocol/protocol.dart +++ b/school_data_hub_client/lib/src/protocol/protocol.dart @@ -1307,6 +1307,37 @@ class Protocol extends _i1.SerializationManager { : deserialize(data['n']['value']), ) as T; } + if (t == _i1.getType?>()) { + return (data != null + ? (data as List).map((e) => deserialize(e)).toList() + : null) as T; + } + if (t == _i1.getType<({List? value})?>()) { + return (data == null) + ? null as T + : ( + value: ((data as Map)['n'] as Map)['value'] == null + ? null + : deserialize>(data['n']['value']), + ) as T; + } + if (t == _i1.getType<({int? value})?>()) { + return (data == null) + ? null as T + : ( + value: ((data as Map)['n'] as Map)['value'] == null + ? null + : deserialize(data['n']['value']), + ) as T; + } + if (t == _i1.getType<({DateTime value})?>()) { + return (data == null) + ? null as T + : ( + value: + deserialize(((data as Map)['n'] as Map)['value']), + ) as T; + } if (t == List<_i93.LearningSupportPlan>) { return (data as List) .map((e) => deserialize<_i93.LearningSupportPlan>(e)) @@ -2010,6 +2041,27 @@ Map? mapRecordToJson(Record? record) { }, }; } + if (record is ({List? value})) { + return { + "n": { + "value": record.value, + }, + }; + } + if (record is ({int? value})) { + return { + "n": { + "value": record.value, + }, + }; + } + if (record is ({DateTime value})) { + return { + "n": { + "value": record.value, + }, + }; + } if (record is ({DateTime? value})) { return { "n": { diff --git a/school_data_hub_client/pubspec.yaml b/school_data_hub_client/pubspec.yaml index 03c0b555..01369a14 100644 --- a/school_data_hub_client/pubspec.yaml +++ b/school_data_hub_client/pubspec.yaml @@ -5,5 +5,5 @@ environment: sdk: '>=3.3.0 <4.0.0' dependencies: - serverpod_client: 2.9.1 - serverpod_auth_client: 2.9.1 + serverpod_client: 2.9.2 + serverpod_auth_client: 2.9.2 diff --git a/school_data_hub_flutter/.gitignore b/school_data_hub_flutter/.gitignore index b69e5706..ff0b127c 100644 --- a/school_data_hub_flutter/.gitignore +++ b/school_data_hub_flutter/.gitignore @@ -28,6 +28,7 @@ rooms.json test_enc.dart decrypt_files.dart **/scripts/ +cursor_docs/ # Flutter/Dart/Pub related **/doc/api/ diff --git a/school_data_hub_flutter/.vscode/settings.json b/school_data_hub_flutter/.vscode/settings.json index f01283e9..a88affac 100644 --- a/school_data_hub_flutter/.vscode/settings.json +++ b/school_data_hub_flutter/.vscode/settings.json @@ -1,4 +1,4 @@ { - "dart.flutterSdkPath": "C:\\Users\\p53\\.puro\\envs\\3.32.8\\flutter", - "dart.sdkPath": "C:\\Users\\p53\\.puro\\envs\\3.32.8\\flutter\\bin\\cache\\dart-sdk" + "dart.flutterSdkPath": "C:\\src\\flutter", + "dart.sdkPath": "C:\\src\\flutter\\bin\\cache\\dart-sdk" } \ No newline at end of file diff --git a/school_data_hub_flutter/Makefile b/school_data_hub_flutter/Makefile index 1c2bf3df..e39dad6d 100644 --- a/school_data_hub_flutter/Makefile +++ b/school_data_hub_flutter/Makefile @@ -6,5 +6,5 @@ patch_android: ## Create a patch and publish it to Shorebird shorebird patch android patch_windows: ## Create a patch and publish it to Shorebird - shorebird patch windows --platforms=windows --release-version=0.5.1+1 + shorebird patch windows --platforms=windows --release-version=0.5.2+1 diff --git a/school_data_hub_flutter/android/app/src/main/AndroidManifest.xml b/school_data_hub_flutter/android/app/src/main/AndroidManifest.xml index 473013b8..9c7d6b08 100644 --- a/school_data_hub_flutter/android/app/src/main/AndroidManifest.xml +++ b/school_data_hub_flutter/android/app/src/main/AndroidManifest.xml @@ -1,5 +1,5 @@ - +