Update wire protocol to version 6 and enhance timetable functionality
- Bumped the wire protocol version to 6, reflecting changes in the communication structure.
- Expanded the timetable API with new endpoints for fetching and managing lesson schedules, including `GET /api/schools/{id}/timetable` and `POST /api/schools/{id}/timetable/pin`.
- Updated the protocol documentation to include detailed descriptions of the new timetable features and message structures.
- Enhanced the client-side implementation to support the new timetable functionalities, including lesson pinning and unpinning.
- Revised server-side logic to handle timetable operations and ensure proper integration with existing school management features.
- Added tests to validate the new timetable functionalities and ensure robustness in handling lesson data.
This commit is contained in:
@@ -164,6 +164,34 @@ public class ProtocolCodecTests
|
||||
Assert.Equal(0, read.Nodes[0].PupilSlots);
|
||||
Assert.Equal([new MapSnapshotItem("Стул", 2)], read.Nodes[1].Items);
|
||||
Assert.Equal(["Директор"], read.Nodes[1].Positions);
|
||||
Assert.Equal("", read.Nodes[0].ActivitySubject);
|
||||
Assert.Empty(read.Nodes[0].Present);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void MapSnapshot_RoundTripsOccupancyAfterPositions()
|
||||
{
|
||||
var message = new ServerMapSnapshotMessage(3, [
|
||||
new MapSnapshotNode(
|
||||
3,
|
||||
"classroom-101",
|
||||
"floor-1",
|
||||
"Класс 101",
|
||||
16,
|
||||
[new MapSnapshotItem("Парта", 16)],
|
||||
[],
|
||||
"Математика",
|
||||
"5А",
|
||||
["Иванова Ольга Михайловна", "Соколов Иван Петрович"]),
|
||||
]);
|
||||
var buffer = new byte[ProtocolCodec.MapSnapshotSize(message)];
|
||||
|
||||
var length = ProtocolCodec.WriteMapSnapshot(buffer, message);
|
||||
var read = ProtocolCodec.ReadMapSnapshot(buffer.AsSpan(0, length));
|
||||
|
||||
Assert.Equal("Математика", read.Nodes[0].ActivitySubject);
|
||||
Assert.Equal("5А", read.Nodes[0].ActivityClass);
|
||||
Assert.Equal(["Иванова Ольга Михайловна", "Соколов Иван Петрович"], read.Nodes[0].Present);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
|
||||
Reference in New Issue
Block a user