-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathWeekly_Bulletin.h
66 lines (50 loc) · 1.39 KB
/
Weekly_Bulletin.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#ifndef WEEKLY_BULLETIN_H
#define WEEKLY_BULLETIN_H
#include "pch.h"
#include <afx.h> // For CString
#include <vector>
#include <string>
#include <map>
#include <ctime>
enum Load {
NoLoad,
LessLoad,
NormalLoad,
HighLoad
};
struct SubTask {
CString description;
std::time_t dueDate;
std::vector<CString> warnings;
};
struct Task {
int taskId;
CString description;
std::time_t dueDate;
std::vector<SubTask> subTasks;
std::vector<CString> warnings;
};
struct Branch {
CString name;
Load predictedLoad;
CString customIndicator;
std::vector<CString> warnings;
std::map<CString, std::vector<Task>> categories;
};
class WeeklyBulletin {
private:
std::time_t startDate;
std::time_t endDate;
std::vector<Branch> branches;
CString formatDate(std::time_t date) const;
public:
int nextTaskId;
WeeklyBulletin() : nextTaskId(1) {}
void setDates(std::time_t start, std::time_t end);
void addBranch(const CString& name, Load load, const CString& customIndicator = _T(""));
void addWarningToBranch(const CString& branchName, const CString& warning);
void addTaskToBranch(const CString& branchName, const CString& category, Task& task);
void addSubTaskToTask(const CString& branchName, const CString& category, int taskId, const SubTask& subTask);
CString printBulletin() const;
};
#endif // WEEKLY_BULLETIN_H