-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProvider.java
More file actions
128 lines (120 loc) · 4.1 KB
/
Copy pathProvider.java
File metadata and controls
128 lines (120 loc) · 4.1 KB
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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
package src;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Vector;
/**
* The Provider class, this constructs and holds all information and functionality related to a singular provider
*
* @author Ryan Moddesette
* @version 1.0
*/
public class Provider {
String name;
int accNumber;
String address;
String city;
String state;
int zipCode;
int numberOfConsultations;
double fee;
Vector<ServiceProvider> providerServiceList;
/**
* This is a constructor for the provider class
* @param name this is provider's name
* @param accNumber this is the provider's accountNumber
* @param address this is the provider's address
* @param city this is the provider's city
* @param state this is the provider's state
* @param zipCode this is the provider's zipcode
* @param fee this is the total fee that is owed to a provider
*/
public Provider(String name,int accNumber,String address,String city,String state,int zipCode,double fee){
this.name = name;
this.accNumber = accNumber;
this.address = address;
this.city = city;
this.state = state;
this.zipCode = zipCode;
this.fee = fee;
fee = 0;
this.numberOfConsultations = 0;
this.providerServiceList = new Vector<ServiceProvider>();
}
/**
* The getName function gets the name of the provider
* @return name of provider
*/
public String getName(){
return name;
}
/**
* The getAccountNumber function gets the account number of the provider
* @return account number of provider
*/
public int getAccountNumber(){
return accNumber;
}
/**
* The getAddress function gets the name of the provider
* @return address of provider
*/
public String getAddress(){
return address;
}
/**
* The getCity function gets the city of the provider
* @return city of provider
*/
public String getCity(){
return city;
}
/**
* The getState function gets the state of the provider
* @return state of provider
*/
public String getState(){
return state;
}
/**
* The getZipCode function gets the zip code of the provider
* @return zipCode of provider
*/
public int getZipCode(){
return zipCode;
}
/**
* The getFee function gets the total fee that the provider is owed
* @return total fee of provider
*/
public double getFee() {
return fee;
}
/**
* The servicesCompleted function gets necessary information related to the member, provider and service and constructs a service object to add to the provider's service vector
* @param serviceCode code of service that provider provided
* @param providerNum number of provider who is providing service
* @param memberNum number of member that is being serviced
*/
public void servicesCompleted(int serviceCode, int providerNum, int memberNum){
//date and time recieved
SimpleDateFormat formatter = new SimpleDateFormat("dd/MM/yyyy HH:mm:ss");
Date date = new Date();
String dateAndTimeNow = formatter.format(date);
String serviceDate = BillingInfo.getDateOfServiceString();
//member name
Member curMember = MemberFiles.searchMember(memberNum);
Provider curProvider = ProviderFiles.searchProvider(providerNum);
//same fix as for end of member class
int accNumber = curMember.getMemberAccountNumber();
OperatorMenu.findMem(accNumber);
//member number
//service code
//fee to be paid
//total consultations
//total fee for week
int consultNum = curProvider.numberOfConsultations++;
ServiceProvider newService = new ServiceProvider(dateAndTimeNow, serviceDate, providerNum, curProvider.name, memberNum, curMember.name, serviceCode, consultNum, fee);
//fix: below line okay to use add() or need to figure out a way to push back?
curProvider.providerServiceList.add(newService);
}
}