jobs

package
v0.0.0-...-d62c007 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 28, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

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

func GetFormattedDate(s string) *time.Time

Types

type Customer

type Customer struct {
	ID   string `json:"id"`
	Name string `json:"name"`
	Note string `json:"note"`
}

func NewCustomer

func NewCustomer(name, note string) *Customer

func NewCustomerSearchResponse

func NewCustomerSearchResponse(resp *http.Response) (*Customer, error)

func NewCustomersResponse

func NewCustomersResponse(resp *http.Response) ([]*Customer, error)

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"`
}

func NewJob

func NewJob(orderDate string, deadline string, status string,
	customerID string, description string) *Job

func NewJobsResponse

func NewJobsResponse(resp *http.Response) ([]*Job, error)

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

func (*JobService) UpdateJob

func (js *JobService) UpdateJob(id string, newJ *Job) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL