Fixing some quotes not showing up
This commit is contained in:
parent
a579380905
commit
e11013bd9f
|
|
@ -88,7 +88,7 @@ SELECT
|
|||
|
||||
FROM quotes q
|
||||
JOIN documents d ON d.id = q.document_id
|
||||
JOIN users u ON u.id = d.user_id
|
||||
LEFT JOIN users u ON u.id = d.user_id
|
||||
JOIN enquiries e ON e.id = q.enquiry_id
|
||||
JOIN users uu ON uu.id = e.contact_user_id
|
||||
JOIN latest_revision lr ON q.enquiry_id = lr.enquiry_id AND d.revision = lr.max_revision
|
||||
|
|
@ -105,18 +105,18 @@ ORDER BY q.valid_until
|
|||
`
|
||||
|
||||
type GetExpiringSoonQuotesRow struct {
|
||||
DocumentID int32 `json:"document_id"`
|
||||
Username string `json:"username"`
|
||||
UserEmail string `json:"user_email"`
|
||||
EnquiryID int32 `json:"enquiry_id"`
|
||||
EnquiryRef string `json:"enquiry_ref"`
|
||||
CustomerName string `json:"customer_name"`
|
||||
CustomerEmail string `json:"customer_email"`
|
||||
DateIssued time.Time `json:"date_issued"`
|
||||
ValidUntil time.Time `json:"valid_until"`
|
||||
LatestReminderType int32 `json:"latest_reminder_type"`
|
||||
LatestReminderSentTime time.Time `json:"latest_reminder_sent_time"`
|
||||
RemindersDisabled bool `json:"reminders_disabled"`
|
||||
DocumentID int32 `json:"document_id"`
|
||||
Username sql.NullString `json:"username"`
|
||||
UserEmail sql.NullString `json:"user_email"`
|
||||
EnquiryID int32 `json:"enquiry_id"`
|
||||
EnquiryRef string `json:"enquiry_ref"`
|
||||
CustomerName string `json:"customer_name"`
|
||||
CustomerEmail string `json:"customer_email"`
|
||||
DateIssued time.Time `json:"date_issued"`
|
||||
ValidUntil time.Time `json:"valid_until"`
|
||||
LatestReminderType int32 `json:"latest_reminder_type"`
|
||||
LatestReminderSentTime time.Time `json:"latest_reminder_sent_time"`
|
||||
RemindersDisabled bool `json:"reminders_disabled"`
|
||||
}
|
||||
|
||||
func (q *Queries) GetExpiringSoonQuotes(ctx context.Context, dateADD interface{}) ([]GetExpiringSoonQuotesRow, error) {
|
||||
|
|
@ -203,7 +203,7 @@ SELECT
|
|||
|
||||
FROM quotes q
|
||||
JOIN documents d ON d.id = q.document_id
|
||||
JOIN users u ON u.id = d.user_id
|
||||
LEFT JOIN users u ON u.id = d.user_id
|
||||
JOIN enquiries e ON e.id = q.enquiry_id
|
||||
JOIN users uu ON uu.id = e.contact_user_id
|
||||
JOIN latest_revision lr ON q.enquiry_id = lr.enquiry_id AND d.revision = lr.max_revision
|
||||
|
|
@ -226,17 +226,17 @@ type GetExpiringSoonQuotesOnDayParams struct {
|
|||
}
|
||||
|
||||
type GetExpiringSoonQuotesOnDayRow struct {
|
||||
DocumentID int32 `json:"document_id"`
|
||||
Username string `json:"username"`
|
||||
UserEmail string `json:"user_email"`
|
||||
EnquiryID int32 `json:"enquiry_id"`
|
||||
EnquiryRef string `json:"enquiry_ref"`
|
||||
CustomerName string `json:"customer_name"`
|
||||
CustomerEmail string `json:"customer_email"`
|
||||
DateIssued time.Time `json:"date_issued"`
|
||||
ValidUntil time.Time `json:"valid_until"`
|
||||
LatestReminderType int32 `json:"latest_reminder_type"`
|
||||
LatestReminderSentTime time.Time `json:"latest_reminder_sent_time"`
|
||||
DocumentID int32 `json:"document_id"`
|
||||
Username sql.NullString `json:"username"`
|
||||
UserEmail sql.NullString `json:"user_email"`
|
||||
EnquiryID int32 `json:"enquiry_id"`
|
||||
EnquiryRef string `json:"enquiry_ref"`
|
||||
CustomerName string `json:"customer_name"`
|
||||
CustomerEmail string `json:"customer_email"`
|
||||
DateIssued time.Time `json:"date_issued"`
|
||||
ValidUntil time.Time `json:"valid_until"`
|
||||
LatestReminderType int32 `json:"latest_reminder_type"`
|
||||
LatestReminderSentTime time.Time `json:"latest_reminder_sent_time"`
|
||||
}
|
||||
|
||||
func (q *Queries) GetExpiringSoonQuotesOnDay(ctx context.Context, arg GetExpiringSoonQuotesOnDayParams) ([]GetExpiringSoonQuotesOnDayRow, error) {
|
||||
|
|
@ -382,7 +382,7 @@ SELECT
|
|||
|
||||
FROM quotes q
|
||||
JOIN documents d ON d.id = q.document_id
|
||||
JOIN users u ON u.id = d.user_id
|
||||
LEFT JOIN users u ON u.id = d.user_id
|
||||
JOIN enquiries e ON e.id = q.enquiry_id
|
||||
JOIN users uu ON uu.id = e.contact_user_id
|
||||
JOIN latest_revision lr ON q.enquiry_id = lr.enquiry_id AND d.revision = lr.max_revision
|
||||
|
|
@ -399,17 +399,17 @@ ORDER BY q.valid_until DESC
|
|||
`
|
||||
|
||||
type GetRecentlyExpiredQuotesRow struct {
|
||||
DocumentID int32 `json:"document_id"`
|
||||
Username string `json:"username"`
|
||||
UserEmail string `json:"user_email"`
|
||||
EnquiryID int32 `json:"enquiry_id"`
|
||||
EnquiryRef string `json:"enquiry_ref"`
|
||||
CustomerName string `json:"customer_name"`
|
||||
CustomerEmail string `json:"customer_email"`
|
||||
DateIssued time.Time `json:"date_issued"`
|
||||
ValidUntil time.Time `json:"valid_until"`
|
||||
LatestReminderType int32 `json:"latest_reminder_type"`
|
||||
LatestReminderSentTime time.Time `json:"latest_reminder_sent_time"`
|
||||
DocumentID int32 `json:"document_id"`
|
||||
Username sql.NullString `json:"username"`
|
||||
UserEmail sql.NullString `json:"user_email"`
|
||||
EnquiryID int32 `json:"enquiry_id"`
|
||||
EnquiryRef string `json:"enquiry_ref"`
|
||||
CustomerName string `json:"customer_name"`
|
||||
CustomerEmail string `json:"customer_email"`
|
||||
DateIssued time.Time `json:"date_issued"`
|
||||
ValidUntil time.Time `json:"valid_until"`
|
||||
LatestReminderType int32 `json:"latest_reminder_type"`
|
||||
LatestReminderSentTime time.Time `json:"latest_reminder_sent_time"`
|
||||
}
|
||||
|
||||
func (q *Queries) GetRecentlyExpiredQuotes(ctx context.Context, dateSUB interface{}) ([]GetRecentlyExpiredQuotesRow, error) {
|
||||
|
|
@ -495,7 +495,7 @@ SELECT
|
|||
|
||||
FROM quotes q
|
||||
JOIN documents d ON d.id = q.document_id
|
||||
JOIN users u ON u.id = d.user_id
|
||||
LEFT JOIN users u ON u.id = d.user_id
|
||||
JOIN enquiries e ON e.id = q.enquiry_id
|
||||
JOIN users uu ON uu.id = e.contact_user_id
|
||||
JOIN latest_revision lr ON q.enquiry_id = lr.enquiry_id AND d.revision = lr.max_revision
|
||||
|
|
@ -512,17 +512,17 @@ ORDER BY q.valid_until DESC
|
|||
`
|
||||
|
||||
type GetRecentlyExpiredQuotesOnDayRow struct {
|
||||
DocumentID int32 `json:"document_id"`
|
||||
Username string `json:"username"`
|
||||
UserEmail string `json:"user_email"`
|
||||
EnquiryID int32 `json:"enquiry_id"`
|
||||
EnquiryRef string `json:"enquiry_ref"`
|
||||
CustomerName string `json:"customer_name"`
|
||||
CustomerEmail string `json:"customer_email"`
|
||||
DateIssued time.Time `json:"date_issued"`
|
||||
ValidUntil time.Time `json:"valid_until"`
|
||||
LatestReminderType int32 `json:"latest_reminder_type"`
|
||||
LatestReminderSentTime time.Time `json:"latest_reminder_sent_time"`
|
||||
DocumentID int32 `json:"document_id"`
|
||||
Username sql.NullString `json:"username"`
|
||||
UserEmail sql.NullString `json:"user_email"`
|
||||
EnquiryID int32 `json:"enquiry_id"`
|
||||
EnquiryRef string `json:"enquiry_ref"`
|
||||
CustomerName string `json:"customer_name"`
|
||||
CustomerEmail string `json:"customer_email"`
|
||||
DateIssued time.Time `json:"date_issued"`
|
||||
ValidUntil time.Time `json:"valid_until"`
|
||||
LatestReminderType int32 `json:"latest_reminder_type"`
|
||||
LatestReminderSentTime time.Time `json:"latest_reminder_sent_time"`
|
||||
}
|
||||
|
||||
func (q *Queries) GetRecentlyExpiredQuotesOnDay(ctx context.Context, dateSUB interface{}) ([]GetRecentlyExpiredQuotesOnDayRow, error) {
|
||||
|
|
|
|||
|
|
@ -86,9 +86,19 @@ type QuoteRow interface {
|
|||
|
||||
type ExpiringSoonQuoteRowWrapper struct{ db.GetExpiringSoonQuotesRow }
|
||||
|
||||
func (q ExpiringSoonQuoteRowWrapper) GetID() int32 { return q.DocumentID }
|
||||
func (q ExpiringSoonQuoteRowWrapper) GetUsername() string { return q.Username }
|
||||
func (q ExpiringSoonQuoteRowWrapper) GetUserEmail() string { return q.UserEmail }
|
||||
func (q ExpiringSoonQuoteRowWrapper) GetID() int32 { return q.DocumentID }
|
||||
func (q ExpiringSoonQuoteRowWrapper) GetUsername() string {
|
||||
if q.Username.Valid {
|
||||
return q.Username.String
|
||||
}
|
||||
return "Unknown"
|
||||
}
|
||||
func (q ExpiringSoonQuoteRowWrapper) GetUserEmail() string {
|
||||
if q.UserEmail.Valid {
|
||||
return q.UserEmail.String
|
||||
}
|
||||
return ""
|
||||
}
|
||||
func (q ExpiringSoonQuoteRowWrapper) GetEnquiryID() int32 { return q.EnquiryID }
|
||||
func (q ExpiringSoonQuoteRowWrapper) GetEnquiryRef() string { return q.EnquiryRef }
|
||||
func (q ExpiringSoonQuoteRowWrapper) GetDateIssued() time.Time { return q.DateIssued }
|
||||
|
|
@ -100,9 +110,19 @@ func (q ExpiringSoonQuoteRowWrapper) GetCustomerEmail() string { return q.Cust
|
|||
|
||||
type RecentlyExpiredQuoteRowWrapper struct{ db.GetRecentlyExpiredQuotesRow }
|
||||
|
||||
func (q RecentlyExpiredQuoteRowWrapper) GetID() int32 { return q.DocumentID }
|
||||
func (q RecentlyExpiredQuoteRowWrapper) GetUsername() string { return q.Username }
|
||||
func (q RecentlyExpiredQuoteRowWrapper) GetUserEmail() string { return q.UserEmail }
|
||||
func (q RecentlyExpiredQuoteRowWrapper) GetID() int32 { return q.DocumentID }
|
||||
func (q RecentlyExpiredQuoteRowWrapper) GetUsername() string {
|
||||
if q.Username.Valid {
|
||||
return q.Username.String
|
||||
}
|
||||
return "Unknown"
|
||||
}
|
||||
func (q RecentlyExpiredQuoteRowWrapper) GetUserEmail() string {
|
||||
if q.UserEmail.Valid {
|
||||
return q.UserEmail.String
|
||||
}
|
||||
return ""
|
||||
}
|
||||
func (q RecentlyExpiredQuoteRowWrapper) GetEnquiryID() int32 { return q.EnquiryID }
|
||||
func (q RecentlyExpiredQuoteRowWrapper) GetEnquiryRef() string { return q.EnquiryRef }
|
||||
func (q RecentlyExpiredQuoteRowWrapper) GetDateIssued() time.Time { return q.DateIssued }
|
||||
|
|
@ -116,9 +136,19 @@ type ExpiringSoonQuoteOnDayRowWrapper struct {
|
|||
db.GetExpiringSoonQuotesOnDayRow
|
||||
}
|
||||
|
||||
func (q ExpiringSoonQuoteOnDayRowWrapper) GetID() int32 { return q.DocumentID }
|
||||
func (q ExpiringSoonQuoteOnDayRowWrapper) GetUsername() string { return q.Username }
|
||||
func (q ExpiringSoonQuoteOnDayRowWrapper) GetUserEmail() string { return q.UserEmail }
|
||||
func (q ExpiringSoonQuoteOnDayRowWrapper) GetID() int32 { return q.DocumentID }
|
||||
func (q ExpiringSoonQuoteOnDayRowWrapper) GetUsername() string {
|
||||
if q.Username.Valid {
|
||||
return q.Username.String
|
||||
}
|
||||
return "Unknown"
|
||||
}
|
||||
func (q ExpiringSoonQuoteOnDayRowWrapper) GetUserEmail() string {
|
||||
if q.UserEmail.Valid {
|
||||
return q.UserEmail.String
|
||||
}
|
||||
return ""
|
||||
}
|
||||
func (q ExpiringSoonQuoteOnDayRowWrapper) GetEnquiryID() int32 { return q.EnquiryID }
|
||||
func (q ExpiringSoonQuoteOnDayRowWrapper) GetEnquiryRef() string { return q.EnquiryRef }
|
||||
func (q ExpiringSoonQuoteOnDayRowWrapper) GetDateIssued() time.Time { return q.DateIssued }
|
||||
|
|
@ -134,9 +164,19 @@ type RecentlyExpiredQuoteOnDayRowWrapper struct {
|
|||
db.GetRecentlyExpiredQuotesOnDayRow
|
||||
}
|
||||
|
||||
func (q RecentlyExpiredQuoteOnDayRowWrapper) GetID() int32 { return q.DocumentID }
|
||||
func (q RecentlyExpiredQuoteOnDayRowWrapper) GetUsername() string { return q.Username }
|
||||
func (q RecentlyExpiredQuoteOnDayRowWrapper) GetUserEmail() string { return q.UserEmail }
|
||||
func (q RecentlyExpiredQuoteOnDayRowWrapper) GetID() int32 { return q.DocumentID }
|
||||
func (q RecentlyExpiredQuoteOnDayRowWrapper) GetUsername() string {
|
||||
if q.Username.Valid {
|
||||
return q.Username.String
|
||||
}
|
||||
return "Unknown"
|
||||
}
|
||||
func (q RecentlyExpiredQuoteOnDayRowWrapper) GetUserEmail() string {
|
||||
if q.UserEmail.Valid {
|
||||
return q.UserEmail.String
|
||||
}
|
||||
return ""
|
||||
}
|
||||
func (q RecentlyExpiredQuoteOnDayRowWrapper) GetEnquiryID() int32 { return q.EnquiryID }
|
||||
func (q RecentlyExpiredQuoteOnDayRowWrapper) GetEnquiryRef() string { return q.EnquiryRef }
|
||||
func (q RecentlyExpiredQuoteOnDayRowWrapper) GetDateIssued() time.Time { return q.DateIssued }
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@ SELECT
|
|||
|
||||
FROM quotes q
|
||||
JOIN documents d ON d.id = q.document_id
|
||||
JOIN users u ON u.id = d.user_id
|
||||
LEFT JOIN users u ON u.id = d.user_id
|
||||
JOIN enquiries e ON e.id = q.enquiry_id
|
||||
JOIN users uu ON uu.id = e.contact_user_id
|
||||
JOIN latest_revision lr ON q.enquiry_id = lr.enquiry_id AND d.revision = lr.max_revision
|
||||
|
|
@ -109,7 +109,7 @@ SELECT
|
|||
|
||||
FROM quotes q
|
||||
JOIN documents d ON d.id = q.document_id
|
||||
JOIN users u ON u.id = d.user_id
|
||||
LEFT JOIN users u ON u.id = d.user_id
|
||||
JOIN enquiries e ON e.id = q.enquiry_id
|
||||
JOIN users uu ON uu.id = e.contact_user_id
|
||||
JOIN latest_revision lr ON q.enquiry_id = lr.enquiry_id AND d.revision = lr.max_revision
|
||||
|
|
@ -173,7 +173,7 @@ SELECT
|
|||
|
||||
FROM quotes q
|
||||
JOIN documents d ON d.id = q.document_id
|
||||
JOIN users u ON u.id = d.user_id
|
||||
LEFT JOIN users u ON u.id = d.user_id
|
||||
JOIN enquiries e ON e.id = q.enquiry_id
|
||||
JOIN users uu ON uu.id = e.contact_user_id
|
||||
JOIN latest_revision lr ON q.enquiry_id = lr.enquiry_id AND d.revision = lr.max_revision
|
||||
|
|
@ -236,7 +236,7 @@ SELECT
|
|||
|
||||
FROM quotes q
|
||||
JOIN documents d ON d.id = q.document_id
|
||||
JOIN users u ON u.id = d.user_id
|
||||
LEFT JOIN users u ON u.id = d.user_id
|
||||
JOIN enquiries e ON e.id = q.enquiry_id
|
||||
JOIN users uu ON uu.id = e.contact_user_id
|
||||
JOIN latest_revision lr ON q.enquiry_id = lr.enquiry_id AND d.revision = lr.max_revision
|
||||
|
|
|
|||
Loading…
Reference in a new issue