design

package
v0.0.0-...-5e42b0b Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2019 License: GPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CompanyMedia = MediaType("application/companyapi.companyentity", func() {
	Description("Company response")
	TypeName("CompanyMedia")
	ContentType("application/json")
	Reference(CompanyPayload)

	Attributes(func() {
		Attribute("id")
		Attribute("name")
		Attribute("contact")
		Attribute("street1")
		Attribute("street2")
		Attribute("city")
		Attribute("state")
		Attribute("zip")
		Attribute("url")
		Attribute("notes")
		Attribute("invoices", CollectionOf(InvoiceMedia))

		Required("id", "name", "contact", "street1", "street2", "city", "state", "zip", "url", "notes", "invoices")
	})

	View("default", func() {
		Attribute("id")
		Attribute("name")
		Attribute("contact")
		Attribute("street1")
		Attribute("street2")
		Attribute("city")
		Attribute("state")
		Attribute("zip")
		Attribute("url")
		Attribute("notes")
		Attribute("invoices")
	})

	View("tiny", func() {
		Attribute("id")
	})
})
View Source
var CompanyPayload = Type("CompanyPayload", func() {
	Description("Company Description.")

	Attribute("id", Integer, "ID", func() {
		Metadata("struct:tag:datastore", "id,noindex")
		Metadata("struct:tag:json", "id")
	})
	Attribute("name", String, "Company name", func() {
		Metadata("struct:tag:datastore", "name,noindex")
		Metadata("struct:tag:json", "name")
	})
	Attribute("contact", String, "Company contact", func() {
		Metadata("struct:tag:datastore", "contact,noindex")
		Metadata("struct:tag:json", "contact")
	})
	Attribute("street1", String, "Company street1", func() {
		Metadata("struct:tag:datastore", "street1,noindex")
		Metadata("struct:tag:json", "street1")
	})
	Attribute("street2", String, "Company street2", func() {
		Metadata("struct:tag:datastore", "street2,noindex")
		Metadata("struct:tag:json", "street2")
	})
	Attribute("city", String, "Company city", func() {
		Metadata("struct:tag:datastore", "city,noindex")
		Metadata("struct:tag:json", "city")
	})
	Attribute("state", String, "Company state", func() {
		Metadata("struct:tag:datastore", "state,noindex")
		Metadata("struct:tag:json", "state")
	})
	Attribute("zip", String, "Company zip", func() {
		Metadata("struct:tag:datastore", "zip,noindex")
		Metadata("struct:tag:json", "zip")
	})
	Attribute("url", String, "Company url", func() {
		Metadata("struct:tag:datastore", "url,noindex")
		Metadata("struct:tag:json", "url")
	})
	Attribute("notes", String, "Company notes", func() {
		Metadata("struct:tag:datastore", "notes,noindex")
		Metadata("struct:tag:json", "notes")
	})
	Attribute("invoices", Any, "Company invoices", func() {
		Metadata("struct:tag:datastore", "invoices,noindex")
		Metadata("struct:tag:json", "invoices")
	})

	Required("name", "contact", "street1", "street2", "city", "state", "zip", "url", "notes")
})
View Source
var EntryMedia = MediaType("application/entryapi.entryentity", func() {
	Description("Entry response")
	TypeName("EntryMedia")
	ContentType("application/json")
	Reference(EntryPayload)

	Attributes(func() {
		Attribute("id")
		Attribute("invoice_id")
		Attribute("title")
		Attribute("date")
		Attribute("reference", ArrayOf(String))
		Attribute("notes")
		Attribute("hours")

		Required("id", "invoice_id", "title", "date", "reference", "notes", "hours")
	})

	View("default", func() {
		Attribute("id")
		Attribute("invoice_id")
		Attribute("title")
		Attribute("date")
		Attribute("reference")
		Attribute("notes")
		Attribute("hours")
	})

	View("tiny", func() {
		Description("`tiny` is the view used to create new entrys.")
		Attribute("id")
	})
})
View Source
var EntryPayload = Type("EntryPayload", func() {
	Description("Entry Description.")

	Attribute("id", Integer, "ID", func() {
		Metadata("struct:tag:datastore", "id,noindex")
		Metadata("struct:tag:json", "id")
	})
	Attribute("invoice_id", Integer, "Invoice ID (foreign key)", func() {
		Metadata("struct:tag:datastore", "invoice_id,noindex")
		Metadata("struct:tag:json", "invoice_id")
	})
	Attribute("title", String, "Entry title", func() {
		Metadata("struct:tag:datastore", "title,noindex")
		Metadata("struct:tag:json", "title")
	})
	Attribute("date", String, "Entry date", func() {
		Metadata("struct:tag:datastore", "date,noindex")
		Metadata("struct:tag:json", "date")
	})
	Attribute("reference", ArrayOf(String), "Entry reference", func() {
		Metadata("struct:tag:datastore", "reference,noindex")
		Metadata("struct:tag:json", "reference")
	})
	Attribute("notes", String, "Entry notes", func() {
		Metadata("struct:tag:datastore", "notes,noindex")
		Metadata("struct:tag:json", "notes")
	})
	Attribute("hours", Number, "Entry hours", func() {
		Metadata("struct:tag:datastore", "hours,noindex")
		Metadata("struct:tag:json", "hours")
	})

	Required("invoice_id", "title", "date", "reference", "notes", "hours")
})
View Source
var InvoiceMedia = MediaType("application/invoiceapi.invoiceentity", func() {
	Description("Invoice response")
	TypeName("InvoiceMedia")
	ContentType("application/json")
	Reference(InvoicePayload)

	Attributes(func() {
		Attribute("id")
		Attribute("company_id")
		Attribute("dateFrom")
		Attribute("dateTo")
		Attribute("url")
		Attribute("notes")
		Attribute("rate")
		Attribute("paid")
		Attribute("totalHours", Number)
		Attribute("entries", CollectionOf(EntryMedia))

		Required("id", "company_id", "dateFrom", "dateTo", "url", "notes", "rate", "paid", "totalHours", "entries")
	})

	View("default", func() {
		Attribute("id")
		Attribute("company_id")
		Attribute("dateFrom")
		Attribute("dateTo")
		Attribute("url")
		Attribute("notes")
		Attribute("rate")
		Attribute("paid")
		Attribute("totalHours")
		Attribute("entries")
	})

	View("tiny", func() {
		Attribute("id")
	})
})
View Source
var InvoicePayload = Type("InvoicePayload", func() {
	Description("Invoice Description.")

	Attribute("id", Integer, "ID", func() {
		Metadata("struct:tag:datastore", "id,noindex")
		Metadata("struct:tag:json", "id")
	})
	Attribute("company_id", Integer, "Company ID (foreign key)", func() {
		Metadata("struct:tag:datastore", "company_id,noindex")
		Metadata("struct:tag:json", "company_id")
	})
	Attribute("dateFrom", String, "Invoice date from", func() {
		Metadata("struct:tag:datastore", "dateFrom,noindex")
		Metadata("struct:tag:json", "dateFrom")
	})
	Attribute("dateTo", String, "Invoice date to", func() {
		Metadata("struct:tag:datastore", "dateTo,noindex")
		Metadata("struct:tag:json", "dateTo")
	})
	Attribute("url", String, "Invoice url", func() {
		Metadata("struct:tag:datastore", "url,noindex")
		Metadata("struct:tag:json", "url")
	})
	Attribute("notes", String, "Invoice notes", func() {
		Metadata("struct:tag:datastore", "notes,noindex")
		Metadata("struct:tag:json", "notes")
	})
	Attribute("rate", Number, "Invoice rate", func() {
		Metadata("struct:tag:datastore", "rate,noindex")
		Metadata("struct:tag:json", "rate")
	})
	Attribute("paid", Boolean, "Invoice paid?", func() {
		Metadata("struct:tag:datastore", "paid,noindex")
		Metadata("struct:tag:json", "paid")
	})
	Attribute("entries", Any, "Invoice entries", func() {
		Metadata("struct:tag:datastore", "entries,noindex")
		Metadata("struct:tag:json", "entries")
	})

	Required("company_id", "dateFrom", "dateTo", "url", "notes", "rate", "paid")
})

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

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