Skip to content
This repository was archived by the owner on Jul 23, 2024. It is now read-only.

Commit ceb2acb

Browse files
authored
Merge branch 'master' into config
2 parents 7e14a7a + 73c922a commit ceb2acb

7 files changed

+38
-15
lines changed

app/representers/semesters_representer.rb

+1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ class SemestersRepresenter < Roar::Decorator
2222

2323
collection :semester_periods, as: :periods do
2424
property :type
25+
property :name
2526
property :irregular
2627
property :starts_at
2728
property :ends_at
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
Sequel.migration do
2+
change do
3+
alter_table(:semester_periods) do
4+
add_column :name, 'hstore'
5+
end
6+
end
7+
end

db/schema.sql

+3-1
Original file line numberDiff line numberDiff line change
@@ -769,7 +769,8 @@ CREATE TABLE semester_periods (
769769
created_at timestamp without time zone NOT NULL,
770770
updated_at timestamp without time zone NOT NULL,
771771
first_day_override integer,
772-
irregular boolean DEFAULT false NOT NULL
772+
irregular boolean DEFAULT false NOT NULL,
773+
name hstore
773774
);
774775

775776

@@ -1234,3 +1235,4 @@ INSERT INTO "schema_migrations" ("filename") VALUES ('1469463514_convert_text_to
12341235
INSERT INTO "schema_migrations" ("filename") VALUES ('1469465920_convert_schedule_exception_type_to_enum.rb');
12351236
INSERT INTO "schema_migrations" ("filename") VALUES ('1469470701_convert_parities_to_enum.rb');
12361237
INSERT INTO "schema_migrations" ("filename") VALUES ('1493051746_convert_semester_period_type_to_enum.rb');
1238+
INSERT INTO "schema_migrations" ("filename") VALUES ('1499120813_add_name_to_semester_periods.rb');

docs/Sirius.raml

+20-14
Original file line numberDiff line numberDiff line change
@@ -489,6 +489,10 @@ resourceTypes:
489489
},
490490
{
491491
"type": "holiday",
492+
"name": {
493+
"cs": "Vánoční prázdniny",
494+
"en": "Christmas Holidays"
495+
},
492496
"irregular": false,
493497
"starts_at": "2015-12-23",
494498
"ends_at": "2016-01-03"
@@ -524,28 +528,30 @@ resourceTypes:
524528
{
525529
"id": 1,
526530
"type": "CANCEL",
527-
"name": "Den české státnosti",
531+
"name": "Výuka zrušena z důvodu nemoci",
528532
"scope": {
529-
"starts_at": "2014-09-28T00:00:00.000+02:00",
530-
"ends_at": "2014-09-29T00:00:00.000+02:00",
531-
"faculty": null,
532-
"semester": null,
533-
"courses": null,
533+
"starts_at": "2014-10-07T00:00:00.000+02:00",
534+
"ends_at": "2014-10-08T00:00:00.000+02:00",
535+
"faculty": 18000,
536+
"semester": "B141",
537+
"courses": [ "MI-RUB" ],
534538
"timetable_slots": null
535539
}
536540
},
537541
{
538-
"id": 11,
539-
"type": "CANCEL"
540-
"name": "Děkanský den FIT",
541-
"note": "Výuka odpadá",
542+
"id": 7,
543+
"type": "ROOM_CHANGE",
544+
"name": "MI-MPI - přednáška 24. 9. 2014 přesunuta do T9:105",
542545
"scope": {
543-
"starts_at": "2015-04-30T00:00:00Z",
544-
"ends_at": "2015-05-01T00:00:00Z",
546+
"starts_at": "2014-09-24T00:00:00.000+02:00",
547+
"ends_at": "2014-09-25T00:00:00.000+02:00",
545548
"faculty": 18000,
546-
"semester": "B142",
549+
"semester": "B141",
547550
"courses": null,
548-
"timetable_slots": null
551+
"timetable_slots": [ 392651000 ]
552+
},
553+
"options": {
554+
"room_id": "T9:105"
549555
}
550556
}
551557
],

spec/api/faculties_endpoints_spec.rb

+3
Original file line numberDiff line numberDiff line change
@@ -282,6 +282,9 @@ def period_for_json(period)
282282
ends_at: period.ends_at,
283283
irregular: period.irregular
284284
}
285+
if period.name
286+
ret[:name] = period.name
287+
end
285288
if period.first_week_parity
286289
ret[:first_week_parity] = period.first_week_parity
287290
end

spec/api/semesters_endpoints_spec.rb

+3
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,9 @@ def period_for_json(period)
4444
ends_at: period.ends_at,
4545
irregular: period.irregular
4646
}
47+
if period.name
48+
ret[:name] = period.name
49+
end
4750
if period.first_week_parity
4851
ret[:first_week_parity] = period.first_week_parity
4952
end

spec/fabricators/semester_period_fabricator.rb

+1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919

2020
Fabricator(:holiday_semester_period, from: :semester_period) do
2121
type 'holiday'
22+
name { {cs: 'Vánoční prázdniny', en: 'Christmas Holidays'} }
2223
first_week_parity nil
2324
starts_at '2014-12-21'
2425
ends_at '2015-01-04'

0 commit comments

Comments
 (0)