| Requires any of the roles: | Worker, Agent, Administrator, Worker, Agent, Administrator |
| POST,OPTIONS | /v1/ActivityPlan | ||
|---|---|---|---|
| GET,OPTIONS | /v1/ActivityPlan/{AgentId}/{DateFrom}/{DateTo} |
import datetime
import decimal
from marshmallow.fields import *
from servicestack import *
from typing import *
from dataclasses import dataclass, field
from dataclasses_json import dataclass_json, LetterCase, Undefined, config
from enum import Enum, IntEnum
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class ActivityPlan:
id: int = 0
agent_id: int = 0
event_type_id: int = 0
goal: int = 0
date_from: datetime.datetime = datetime.datetime(1, 1, 1)
date_to: datetime.datetime = datetime.datetime(1, 1, 1)
date_created: datetime.datetime = datetime.datetime(1, 1, 1)
mthly_cash_flow: int = 0
ytd_cash_flow: int = 0
recruit: int = 0
event_type_name: Optional[str] = None
actual: int = 0
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class ActivityPlanExtended:
app_count: int = 0
avg_flow: int = 0
avg_transfer: int = 0
avg_life: int = 0
life_per_annuity: Decimal = decimal.Decimal(0)
flow_transfer: Decimal = decimal.Decimal(0)
transfer_ratio: Decimal = decimal.Decimal(0)
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class ActivityPlanResponse:
response_status: Optional[ResponseStatus] = None
activity_plans: List[ActivityPlan] = field(default_factory=list)
activity_data: Optional[ActivityPlanExtended] = None
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class ActivityPlanRequest:
activity_plan: Optional[ActivityPlan] = None
agent_id: int = 0
date_from: datetime.datetime = datetime.datetime(1, 1, 1)
date_to: datetime.datetime = datetime.datetime(1, 1, 1)
application_goal: int = 0
appointment_set_goal: int = 0
learning_goal: int = 0
marketing_goal: int = 0
referral_goal: int = 0
lead_goal: int = 0
client_update_goal: int = 0
first_contact_goal: int = 0
first_appointment_goal: int = 0
second_appointment_goal: int = 0
second_appointment_set_goal: int = 0
monthly_cash_flow_goal: int = 0
ytd_cash_flow_goal: int = 0
recruit_goal: int = 0
Python ActivityPlanRequest DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .jsv suffix or ?format=jsv
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /v1/ActivityPlan HTTP/1.1
Host: api.dev.dynamics.trendsic.com
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length
{
ActivityPlan:
{
Id: 0,
AgentId: 0,
EventTypeId: 0,
Goal: 0,
DateFrom: 0001-01-01,
DateTo: 0001-01-01,
DateCreated: 0001-01-01,
MthlyCashFlow: 0,
YTDCashFlow: 0,
Recruit: 0,
EventTypeName: String,
Actual: 0
},
AgentId: 0,
DateFrom: 0001-01-01,
DateTo: 0001-01-01,
ApplicationGoal: 0,
AppointmentSetGoal: 0,
LearningGoal: 0,
MarketingGoal: 0,
ReferralGoal: 0,
LeadGoal: 0,
ClientUpdateGoal: 0,
FirstContactGoal: 0,
FirstAppointmentGoal: 0,
SecondAppointmentGoal: 0,
SecondAppointmentSetGoal: 0,
MonthlyCashFlowGoal: 0,
YTDCashFlowGoal: 0,
RecruitGoal: 0
}
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length
{
ResponseStatus:
{
ErrorCode: String,
Message: String,
StackTrace: String,
Errors:
[
{
ErrorCode: String,
FieldName: String,
Message: String,
Meta:
{
String: String
}
}
],
Meta:
{
String: String
}
},
ActivityPlans:
[
{
Id: 0,
AgentId: 0,
EventTypeId: 0,
Goal: 0,
DateFrom: 0001-01-01,
DateTo: 0001-01-01,
DateCreated: 0001-01-01,
MthlyCashFlow: 0,
YTDCashFlow: 0,
Recruit: 0,
EventTypeName: String,
Actual: 0
}
],
ActivityData:
{
AppCount: 0,
AvgFlow: 0,
AvgTransfer: 0,
AvgLife: 0,
LifePerAnnuity: 0,
FlowTransfer: 0,
TransferRatio: 0
}
}