-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathticket.h
67 lines (47 loc) · 1.62 KB
/
ticket.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
67
#pragma once
/*==================================================
Assignment #2 Milestone #4
==================================================
Name : Jenish Rajnikant Patel
ID : 131733206
Email : jrpatel47@myseneca.ca
Section : NCC */
#ifndef TICKET_H_
#define TICKET_H_
#define TICKETSFILE "tickets.txt"
#define TICKETSARCFILE "tickets_arc.txt"
#define DISPLAY_NAME_LENGTH 30
#define MESSAGE_SIZE 150
#define SUBJECT_SIZE 30
#define NUMBER_OF_MESSAGES 20
#define NEW_MESSAGE_COUNT 1
#define REMAINING_LIMIT 3
#define ACTIVE_TICKET_INDICATOR 1
#define CLOSED_TICKET_INDICATOR 0
//STRUCTURES
struct Message
{
char account_type_author;
char displayName[DISPLAY_NAME_LENGTH + 1];
char messageDetail[MESSAGE_SIZE + 1];
};
struct Ticket
{
int uniqueNum;
int customer_account_number;
int ticketStatus;
char subjectLine[SUBJECT_SIZE + 1];
int countMessage;
struct Message messageInfo[NUMBER_OF_MESSAGES];
};
//This function's purpose is to search the array received in argument 2 for a match on a desired ticket number.
int findTicketIndexByTickNum(int ticketNum, const struct Ticket ticketData[], int maxElements, int prompt_ticket_num);
// To save the current updated tickets in tickets.txt
int saveCurrentTickets(const struct Ticket ticketData[], int maxElements);
// To load tickets data from the tickets.txt file
int loadTickets(struct Ticket ticketData[], int maxElements);
// To archive closed removed tickets in tickets_arc.txt
int archiveRemovedClosedTickets(const struct Ticket* ticketData);
// To archive closed tickets in tickets_arc.txt
void archiveClosedTickets(const struct Ticket* ticketData);
#endif