Pecuario.Backend

<back to all web services

GetDashboard

The following routes are available for this service:
GET/api/v1/dashboard

export class Status
{
    public message: string;
    public statusCode: number;

    public constructor(init?: Partial<Status>) { (Object as any).assign(this, init); }
}

export class BaseResponse
{
    public status: Status;

    public constructor(init?: Partial<BaseResponse>) { (Object as any).assign(this, init); }
}

export class AnimalCategory
{
    public id: number;
    // @Required()
    // @StringLength(50)
    public name: string;

    public alias: string;
    public order: number;
    public enabled: boolean;

    public constructor(init?: Partial<AnimalCategory>) { (Object as any).assign(this, init); }
}

export class DashboardLand
{
    public id: string;
    public description: string;
    public image: string;
    public type: string;
    public price: string;
    public cityRegionName: string;
    public priceType: string;

    public constructor(init?: Partial<DashboardLand>) { (Object as any).assign(this, init); }
}

export class GetDashboardResponse extends BaseResponse
{
    public animalCategories: AnimalCategory[];
    public animalsByCategory: { [index: number]: DashboardAnimal[]; };
    public lands: DashboardLand[];
    public greeting: string;
    public farmsCount: number;

    public constructor(init?: Partial<GetDashboardResponse>) { super(init); (Object as any).assign(this, init); }
}

export class GetDashboard implements IGet
{
    public countryId?: number;
    public maxAnimals?: number;
    public maxLands?: number;

    public constructor(init?: Partial<GetDashboard>) { (Object as any).assign(this, init); }
}

TypeScript GetDashboard DTOs

To override the Content-type in your clients, use the HTTP Accept Header, append the .jsv suffix or ?format=jsv

HTTP + JSV

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

GET /api/v1/dashboard HTTP/1.1 
Host: pecuario-backend.develsystems.com 
Accept: text/jsv
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length

{
	animalCategories: 
	[
		{
			id: 0,
			name: String,
			alias: String,
			order: 0,
			enabled: False
		}
	],
	animalsByCategory: 
	{
		0: 
		[
			{
				id: String,
				description: String,
				image: String,
				type: String,
				price: String,
				cityRegionName: String,
				priceType: String
			}
		]
	},
	lands: 
	[
		{
			id: String,
			description: String,
			image: String,
			type: String,
			price: String,
			cityRegionName: String,
			priceType: String
		}
	],
	greeting: String,
	farmsCount: 0
}