Agents (Dart)
Le module MultiServiceAgentModule permet de gérer les agents/employés.
Accès : applite.app.multiService.agent
Méthodes
list
final response = await applite.app.multiService.agent.list(
ListAgentsParams(apiKey: 'api_key', appId: 'app_id'),
);
for (final agent in response.data) {
print('${agent.name} - ${agent.role}');
}create
final response = await applite.app.multiService.agent.create(
CreateAgentParams(
apiKey: 'api_key',
appId: 'app_id',
name: 'Marie Kouassi',
email: 'marie@salon.com',
telephone: '+225070000000',
role: 'Coiffeuse Senior',
avatar: 'https://cdn.example.com/marie.jpg',
serviceIds: ['serv_123', 'serv_124'],
isActive: true,
),
);get
final response = await applite.app.multiService.agent.get(
GetAgentParams(apiKey: 'api_key', appId: 'app_id', id: 'agent_id'),
);
if (response.data != null) {
print('Services: ${response.data!.services?.length ?? 0}');
}update
final response = await applite.app.multiService.agent.update(
UpdateAgentParams(
apiKey: 'api_key',
appId: 'app_id',
id: 'agent_id',
role: 'Coiffeuse Chef',
serviceIds: ['serv_123', 'serv_124', 'serv_125'],
),
);delete
final response = await applite.app.multiService.agent.delete(
DeleteAgentParams(apiKey: 'api_key', appId: 'app_id', id: 'agent_id'),
);Les rendez-vous existants de l’agent sont conservés pour l’historique.
Last updated on