Documentation
¶
Index ¶
- Constants
- Variables
- func GetFormattedDate(s string) *time.Time
- type Customer
- type CustomerService
- func (cs *CustomerService) AddCustomer(cust *Customer)
- func (cs *CustomerService) DeleteCustomer(id string)
- func (cs *CustomerService) ListCustomers() []*Customer
- func (cs *CustomerService) SearchCustomer(name string) (*Customer, error)
- func (cs *CustomerService) UpdateCustomer(id string, newCust *Customer) error
- type Job
- type JobService
Constants ¶
View Source
const JOBS_MANAGER_CUSTOMERS_FILE = "jobsManager-customers.json"
View Source
const JOBS_MANAGER_JOBS_FILE = "jobsManager-jobs.json"
View Source
const JobsDateFormat string = "2006-01-02"
Variables ¶
View Source
var JobStatusList []string = []string{
"New ⭐️",
"Completed & Shipped ✅",
"Invoiced 🧾",
}
Functions ¶
func GetFormattedDate ¶
Types ¶
type CustomerService ¶
type CustomerService struct {
// contains filtered or unexported fields
}
func NewCustomerService ¶
func NewCustomerService(filepath string) *CustomerService
func (*CustomerService) AddCustomer ¶
func (cs *CustomerService) AddCustomer(cust *Customer)
func (*CustomerService) DeleteCustomer ¶
func (cs *CustomerService) DeleteCustomer(id string)
func (*CustomerService) ListCustomers ¶
func (cs *CustomerService) ListCustomers() []*Customer
func (*CustomerService) SearchCustomer ¶
func (cs *CustomerService) SearchCustomer(name string) (*Customer, error)
func (*CustomerService) UpdateCustomer ¶
func (cs *CustomerService) UpdateCustomer(id string, newCust *Customer) error
type Job ¶
type Job struct {
ID string `json:"id"`
OrderDate *time.Time `json:"order_date"`
DeadlineDate *time.Time `json:"deadline_date"`
Status string `json:"status"`
CustomerID string `json:"customer_id"`
Description string `json:"description"`
}
type JobService ¶
type JobService struct {
// contains filtered or unexported fields
}
func NewJobService ¶
func NewJobService(filepath string) *JobService
func (*JobService) AddJob ¶
func (js *JobService) AddJob(j *Job)
func (*JobService) DeleteJob ¶
func (js *JobService) DeleteJob(id string)
func (*JobService) FilterJobs ¶
func (js *JobService) FilterJobs(customerID string) []*Job
func (*JobService) ListJobs ¶
func (js *JobService) ListJobs() []*Job
Click to show internal directories.
Click to hide internal directories.