-
Notifications
You must be signed in to change notification settings - Fork 0
/
test-data.txt
73 lines (49 loc) · 3.22 KB
/
test-data.txt
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
67
68
69
70
71
72
73
CREATE EXTENSION pgcrypto;
INSERT INTO employee (emp_name) VALUES ('Gunturi'), ('Somitra'), ('Martha'), ('Deepak'), ('SKDas');
INSERT INTO department (dep_name) VALUES ('cse'), ('me'), ('ee');
INSERT INTO faculty (fac_email, password, fac_emp_id, fac_dep_name) VALUES ('[email protected]', crypt('password', gen_salt('bf')), 1, 'cse'), ('[email protected]', crypt('password', gen_salt('bf')), 2, 'cse');
INSERT INTO cc_faculty (cc_fac_post_email, password, cc_fac_post, cc_fac_emp_id, cc_fac_end_date) VALUES ('[email protected]', crypt('password', gen_salt('bf')), 'adfa', 3, '2020-10-20'), ('[email protected]', crypt('password', gen_salt('bf')), 'dfa', 4, '2021-10-20'), ('[email protected]', crypt('password', gen_salt('bf')), 'director', 4, '2022-10-20');
INSERT INTO hod (hod_post_email, password, hod_fac_email, hod_end_date) VALUES ('[email protected]', crypt('password', gen_salt('bf')), '[email protected]', '2023-10-20');
INSERT INTO fac_leave_app_path (curr_holder, next_holder) VALUES ('owner', 'hod'), ('hod', 'dfa'), ('dfa', 'approve_or_reject');
INSERT INTO hods_deans_leave_app_path (curr_holder, next_holder) VALUES ('owner', 'director'), ('director', 'approve_or_reject');
CALL launch_new_leave_application('[email protected]', 12, 'I want 12 days leave');
SELECT * FROM curr_leave_application;
SELECT * FROM leave_application_status;
SELECT * FROM application_detail;
SELECT * FROM rem_leaves;
SELECT * FROM approved_or_rejected_leave_application;
CALL forward(1, 'Yes, okay with HOD CSE');
SELECT * FROM curr_leave_application;
SELECT * FROM leave_application_status;
SELECT * FROM application_detail;
SELECT * FROM rem_leaves;
SELECT * FROM approved_or_rejected_leave_application;
CALL approve_or_reject(1, TRUE, 'Granted Permission');
SELECT * FROM curr_leave_application;
SELECT * FROM leave_application_status;
SELECT * FROM application_detail;
SELECT * FROM rem_leaves;
SELECT * FROM approved_or_rejected_leave_application;
/* ---------------------------------------------------------------------------------------------- */
CALL launch_new_leave_application('[email protected]', 15, 'I want another leave, now for 15 days.');
CALL launch_new_leave_application('[email protected]', 15, 'Will you allow me 2 leave applications simultaneously?');
SELECT * FROM curr_leave_application;
SELECT * FROM leave_application_status;
SELECT * FROM application_detail;
SELECT * FROM rem_leaves;
SELECT * FROM approved_or_rejected_leave_application;
CALL forward(2, 'This time it is not okay');
SELECT * FROM curr_leave_application;
SELECT * FROM leave_application_status;
SELECT * FROM application_detail;
SELECT * FROM rem_leaves;
SELECT * FROM approved_or_rejected_leave_application;
CALL approve_or_reject(2, FALSE, 'Not granted');
SELECT * FROM curr_leave_application;
SELECT * FROM leave_application_status;
SELECT * FROM application_detail;
SELECT * FROM rem_leaves;
SELECT * FROM approved_or_rejected_leave_application;
/* ---------------------------------------------------------------------------------------------- */
CALL launch_new_leave_application('[email protected]', 22, 'Going abroad.');
CALL approve_or_reject(4, TRUE, 'Director approves it.');