package mock

import (
	"fmt"
	"math/rand"
	"strconv"
	"strings"
	"time"

	"github.com/alcionai/corso/src/internal/common/dttm"
)

// Order of fields to fill in:
// 1. body
// 2. body preview
// 3. endDate (rfc3339nano)
// 4. organizer email
// 5. start date (rfc3339nano)
// 6. subject
// 7. hasAttachments
// 8. attachments
// 9. recurrence
// 10. attendees

//nolint:lll
var (
	eventTmpl = `{
	"categories":[],
	"changeKey":"0hATW1CAfUS+njw3hdxSGAAAJIxNug==",
	"createdDateTime":"2022-03-28T03:42:03Z",
	"lastModifiedDateTime":"2022-05-26T19:25:58Z",
	"allowNewTimeProposals":true,
	"body":{
		"content":"<html><head><meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\"></head><body>` +
		`<p>%s</p></body></html>",
		"contentType":"html"
	},
	"bodyPreview":"%s",
	"end":{
		"dateTime":"%s",
		"timeZone":"UTC"
	},
	"hideAttendees":false,
	"importance":"normal",
	"isAllDay":false,
	"isCancelled":false,
	"isDraft":false,
	"isOnlineMeeting":false,
	"isOrganizer":false,
	"isReminderOn":true,
	"location":{
		"displayName":"Umi Sake House (2230 1st Ave, Seattle, WA 98121 US)",
		"locationType":"default",
		"uniqueId":"Umi Sake House (2230 1st Ave, Seattle, WA 98121 US)",
		"uniqueIdType":"private"
	},
	"locations":[
		{
			"displayName":"Umi Sake House (2230 1st Ave, Seattle, WA 98121 US)",
			"locationType":"default",
			"uniqueId":"",
			"uniqueIdType":"unknown"
		}
	],
	"onlineMeetingProvider":"unknown",
	"organizer":{
		"emailAddress":{
			"address":"%s",
			"name":"Anu Pierson"
		}
	},
	%s
	"originalEndTimeZone":"UTC",
	"originalStartTimeZone":"UTC",
	"reminderMinutesBeforeStart":15,
	"responseRequested":true,
	"responseStatus":{
		"response":"notResponded",
		"time":"0001-01-01T00:00:00Z"
	},
	"sensitivity":"normal",
	"showAs":"tentative",
	"start":{
		"dateTime":"%s",
		"timeZone":"UTC"
	},
	"subject":"%s",
	"type":"%s",
	"hasAttachments":%v,
	%s
	"webLink":"https://outlook.office365.com/owa/?itemid=AAMkAGZmNjNlYjI3LWJlZWYtNGI4Mi04YjMyLTIxYThkNGQ4NmY1MwBGAAAAAADCNgjhM9QmQYWNcI7hCpPrBwDSEBNbUIB9RL6ePDeF3FIYAAAAAAENAADSEBNbUIB9RL6ePDeF3FIYAAAAAG76AAA%%3D&exvsurl=1&path=/calendar/item",
	"recurrence":%s,
	%s
	%s
	"attendees":%s
}`

	defaultEventBody        = "This meeting is to review the latest Tailspin Toys project proposal.<br>\\r\\nBut why not eat some sushi while we’re at it? :)"
	defaultEventBodyPreview = "This meeting is to review the latest Tailspin Toys project proposal.\\r\\nBut why not eat some sushi while we’re at it? :)"
	defaultEventOrganizer   = "foobar@8qzvrj.onmicrosoft.com"

	NoAttachments         = ""
	eventAttachmentFormat = "{\"id\":\"AAMkAGZmNjNlYjI3LWJlZWYtNGI4Mi04YjMyLTIxYThkNGQ4NmY1MwBGAAAAAADCNgjhM9QmQYWNcI7hCpPrBwDSEBNbUIB9RL6ePDeF3FIYAAAAAAENAADSEBNbUIB9RL6ePDeF3FIYAACLjfLQAAABEgAQAHoI0xBbBBVEh6bFMU78ZUo=\",\"@odata.type\":\"#microsoft.graph.fileAttachment\"," +
		"\"@odata.mediaContentType\":\"application/octet-stream\",\"contentType\":\"application/octet-stream\",\"isInline\":false,\"lastModifiedDateTime\":\"2022-10-26T15:19:42Z\",\"name\":\"%s\",\"size\":11418," +
		"\"contentBytes\":\"U1FMaXRlIGZvcm1hdCAzAAQAAQEAQCAgAAAATQAAAAsAAAAEAAAACAAAAAsAAAAEAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABNAC3mBw0DZwACAg8AAxUCDwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA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AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" +
		"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" +
		"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=\"}"
	defaultEventAttachments = "\"attachments\":[" + fmt.Sprintf(eventAttachmentFormat, "database.db") + "],"

	originalStartDateFormat = `"originalStart": "%s",`
	NoOriginalStartDate     = ``

	NoRecurrence   = `null`
	recurrenceTmpl = `{
		"pattern": {
			"type": "absoluteYearly",
			"interval": 1,
			"month": %s,
			"dayOfMonth": %s,
			"firstDayOfWeek": "sunday",
			"index": "first"
		},
		"range": {
			"type": "noEnd",
			"startDate": "%s",
			"endDate": "0001-01-01",
			"numberOfOccurrences": 0,
			"recurrenceTimeZone": %s
		}
	}`

	cancelledOccurrencesFormat        = `"cancelledOccurrences": [%s],`
	cancelledOccurrenceInstanceFormat = `"OID.AAMkAGJiZmE2NGU4LTQ4YjktNDI1Mi1iMWQzLTQ1MmMxODJkZmQyNABGAAAAAABFdiK7oifWRb4ADuqgSRcnBwBBFDg0JJk7TY1fmsJrh7tNAAAAAAENAABBFDg0JJk7TY1fmsJrh7tNAADHGTZoAAA=.%s"`
	NoCancelledOccurrences            = ""

	exceptionOccurrencesFormat = `"exceptionOccurrences": [%s],`
	NoExceptionOccurrences     = ""

	NoAttendees   = `[]`
	attendeesTmpl = `[{
		"emailAddress": {
			"address": "george.martinez@8qzvrj.onmicrosoft.com",
			"name": "George Martinez"
		},
		"type": "required",
		"status": {
			"response": "none",
			"time": "0001-01-01T00:00:00Z"
		}
	}, {
		"emailAddress": {
			"address": "LeeG@8qzvrj.onmicrosoft.com",
			"name": "Lee Gu"
		},
		"type": "required",
		"status": {
			"response": "none",
			"time": "0001-01-01T00:00:00Z"
		}
	}]`
)

// generatePhoneNumber creates a random phone number
// @return string representation in format (xxx)xxx-xxxx
func generatePhoneNumber() string {
	numbers := make([]string, 0)

	for i := 0; i < 10; i++ {
		temp := rand.Intn(10)
		value := strconv.Itoa(temp)
		numbers = append(numbers, value)
	}

	area := strings.Join(numbers[:3], "")
	prefix := strings.Join(numbers[3:6], "")
	suffix := strings.Join(numbers[6:], "")
	phoneNo := "(" + area + ")" + prefix + "-" + suffix

	return phoneNo
}

// EventBytes returns test byte array representative of full Eventable item.
func EventBytes(subject string) []byte {
	return EventWithSubjectBytes(" " + subject + " Review + Lunch")
}

func EventWithSubjectBytes(subject string) []byte {
	var (
		tomorrow = time.Now().UTC().AddDate(0, 0, 1)
		at       = time.Date(tomorrow.Year(), tomorrow.Month(), tomorrow.Day(), tomorrow.Hour(), 0, 0, 0, time.UTC)
		atTime   = dttm.Format(at)
		endTime  = dttm.Format(at.Add(30 * time.Minute))
	)

	return EventWith(
		defaultEventOrganizer, subject,
		defaultEventBody, defaultEventBodyPreview,
		NoOriginalStartDate, atTime, endTime, NoRecurrence, NoAttendees,
		NoAttachments, NoCancelledOccurrences, NoExceptionOccurrences,
	)
}

func EventWithAttachment(subject string) []byte {
	var (
		tomorrow = time.Now().UTC().AddDate(0, 0, 1)
		at       = time.Date(tomorrow.Year(), tomorrow.Month(), tomorrow.Day(), tomorrow.Hour(), 0, 0, 0, time.UTC)
		atTime   = dttm.Format(at)
	)

	return EventWith(
		defaultEventOrganizer, subject,
		defaultEventBody, defaultEventBodyPreview,
		NoOriginalStartDate, atTime, atTime, NoRecurrence, NoAttendees,
		defaultEventAttachments, NoCancelledOccurrences, NoExceptionOccurrences,
	)
}

func EventWithRecurrenceBytes(subject, recurrenceTimeZone string) []byte {
	var (
		tomorrow  = time.Now().UTC().AddDate(0, 0, 1)
		at        = time.Date(tomorrow.Year(), tomorrow.Month(), tomorrow.Day(), tomorrow.Hour(), 0, 0, 0, time.UTC)
		atTime    = dttm.Format(at)
		timeSlice = strings.Split(atTime, "T")
	)

	recurrence := string(fmt.Sprintf(
		recurrenceTmpl,
		strconv.Itoa(int(at.Month())),
		strconv.Itoa(at.Day()),
		timeSlice[0],
		recurrenceTimeZone,
	))

	return EventWith(
		defaultEventOrganizer, subject,
		defaultEventBody, defaultEventBodyPreview,
		NoOriginalStartDate, atTime, atTime, recurrence, attendeesTmpl,
		NoAttachments, NoCancelledOccurrences, NoExceptionOccurrences,
	)
}

func EventWithRecurrenceAndCancellationBytes(subject string) []byte {
	var (
		tomorrow  = time.Now().UTC().AddDate(0, 0, 1)
		at        = time.Date(tomorrow.Year(), tomorrow.Month(), tomorrow.Day(), tomorrow.Hour(), 0, 0, 0, time.UTC)
		atTime    = dttm.Format(at)
		timeSlice = strings.Split(atTime, "T")
		nextYear  = tomorrow.AddDate(1, 0, 0)
	)

	recurrence := string(fmt.Sprintf(
		recurrenceTmpl,
		strconv.Itoa(int(at.Month())),
		strconv.Itoa(at.Day()),
		timeSlice[0],
		`"UTC"`,
	))

	cancelledInstances := []string{fmt.Sprintf(cancelledOccurrenceInstanceFormat, dttm.FormatTo(nextYear, dttm.DateOnly))}
	cancelledOccurrences := fmt.Sprintf(cancelledOccurrencesFormat, strings.Join(cancelledInstances, ","))

	return EventWith(
		defaultEventOrganizer, subject,
		defaultEventBody, defaultEventBodyPreview,
		NoOriginalStartDate, atTime, atTime, recurrence, attendeesTmpl,
		defaultEventAttachments, cancelledOccurrences, NoExceptionOccurrences,
	)
}

func EventWithRecurrenceAndExceptionBytes(subject string) []byte {
	var (
		tomorrow          = time.Now().UTC().AddDate(0, 0, 1)
		at                = time.Date(tomorrow.Year(), tomorrow.Month(), tomorrow.Day(), tomorrow.Hour(), 0, 0, 0, time.UTC)
		atTime            = dttm.Format(at)
		timeSlice         = strings.Split(atTime, "T")
		newTime           = dttm.Format(tomorrow.AddDate(0, 0, 1))
		originalStartDate = dttm.FormatTo(at, dttm.TabularOutput)
	)

	recurrence := string(fmt.Sprintf(
		recurrenceTmpl,
		strconv.Itoa(int(at.Month())),
		strconv.Itoa(at.Day()),
		timeSlice[0],
		`"UTC"`,
	))

	exceptionEvent := EventWith(
		defaultEventOrganizer, subject+"(modified)",
		defaultEventBody, defaultEventBodyPreview,
		fmt.Sprintf(originalStartDateFormat, originalStartDate),
		newTime, newTime, NoRecurrence, attendeesTmpl,
		NoAttachments, NoCancelledOccurrences, NoExceptionOccurrences,
	)
	exceptionOccurrences := fmt.Sprintf(exceptionOccurrencesFormat, exceptionEvent)

	return EventWith(
		defaultEventOrganizer, subject,
		defaultEventBody, defaultEventBodyPreview,
		NoOriginalStartDate, atTime, atTime, recurrence, attendeesTmpl,
		defaultEventAttachments, NoCancelledOccurrences, exceptionOccurrences,
	)
}

func EventWithRecurrenceAndExceptionAndAttachmentBytes(subject string) []byte {
	var (
		tomorrow          = time.Now().UTC().AddDate(0, 0, 1)
		at                = time.Date(tomorrow.Year(), tomorrow.Month(), tomorrow.Day(), tomorrow.Hour(), 0, 0, 0, time.UTC)
		atTime            = dttm.Format(at)
		timeSlice         = strings.Split(atTime, "T")
		newTime           = dttm.Format(tomorrow.AddDate(0, 0, 1))
		originalStartDate = dttm.FormatTo(at, dttm.TabularOutput)
	)

	recurrence := string(fmt.Sprintf(
		recurrenceTmpl,
		strconv.Itoa(int(at.Month())),
		strconv.Itoa(at.Day()),
		timeSlice[0],
		`"UTC"`,
	))

	exceptionEvent := EventWith(
		defaultEventOrganizer, subject+"(modified)",
		defaultEventBody, defaultEventBodyPreview,
		fmt.Sprintf(originalStartDateFormat, originalStartDate),
		newTime, newTime, NoRecurrence, attendeesTmpl,
		"\"attachments\":["+fmt.Sprintf(eventAttachmentFormat, "exception-database.db")+"],",
		NoCancelledOccurrences, NoExceptionOccurrences,
	)
	exceptionOccurrences := fmt.Sprintf(
		exceptionOccurrencesFormat,
		strings.Join([]string{string(exceptionEvent)}, ","),
	)

	return EventWith(
		defaultEventOrganizer, subject,
		defaultEventBody, defaultEventBodyPreview,
		NoOriginalStartDate, atTime, atTime, recurrence, attendeesTmpl,
		defaultEventAttachments, NoCancelledOccurrences, exceptionOccurrences,
	)
}

func EventWithAttendeesBytes(subject string) []byte {
	var (
		tomorrow = time.Now().UTC().AddDate(0, 0, 1)
		at       = time.Date(tomorrow.Year(), tomorrow.Month(), tomorrow.Day(), tomorrow.Hour(), 0, 0, 0, time.UTC)
		atTime   = dttm.Format(at)
	)

	return EventWith(
		defaultEventOrganizer, subject,
		defaultEventBody, defaultEventBodyPreview,
		NoOriginalStartDate, atTime, atTime, NoRecurrence, attendeesTmpl,
		defaultEventAttachments, NoCancelledOccurrences, NoExceptionOccurrences,
	)
}

// EventWith returns bytes for an Eventable item.
// start and end times should be in the format 2006-01-02T15:04:05.0000000Z.
// The timezone (Z) will be automatically stripped.  A non-utc timezone may
// produce unexpected results.
// Body must contain a well-formatted string, consumable in a json payload.  IE: no unescaped newlines.
func EventWith(
	organizer, subject, body, bodyPreview,
	originalStartDate, startDateTime, endDateTime, recurrence, attendees,
	attachments, cancelledOccurrences, exceptionOccurrences string,
) []byte {
	hasAttachments := len(attachments) > 0
	startDateTime = strings.TrimSuffix(startDateTime, "Z")
	endDateTime = strings.TrimSuffix(endDateTime, "Z")

	if len(startDateTime) == len("2022-10-19T20:00:00") {
		startDateTime += ".0000000"
	}

	if len(endDateTime) == len("2022-10-19T20:00:00") {
		endDateTime += ".0000000"
	}

	eventType := "singleInstance"
	if recurrence != "null" {
		eventType = "seriesMaster"
	}

	return []byte(fmt.Sprintf(
		eventTmpl,
		body,
		bodyPreview,
		endDateTime,
		organizer,
		originalStartDate,
		startDateTime,
		subject,
		eventType,
		hasAttachments,
		attachments,
		recurrence,
		cancelledOccurrences,
		exceptionOccurrences,
		attendees,
	))
}
