first commit

This commit is contained in:
OnlyPapy98
2025-12-16 14:20:02 +01:00
commit dde2e8aebf
320 changed files with 30462 additions and 0 deletions

View File

@@ -0,0 +1,23 @@
export interface AgentLimit {
id: string;
code: string; // e.g., ALC001
configCode: string; // e.g., ALC001
nom: string;
isDefault: boolean;
actif: boolean;
// Bet limits
betMin?: number;
betMax?: number;
maxBet?: number;
maxDisburseBet?: number;
// Airtime
airtimeMin?: number;
airtimeMax?: number;
createdAt?: string;
createdBy?: string;
}

View File

@@ -0,0 +1,65 @@
import { TpeDevice } from './tpe';
export type AgentStatus = 'ACTIF' | 'INACTIF' | 'SUSPENDU';
export interface Agent {
id: string;
code: string;
profile: string; // ex. AGENT, SUPERVISEUR, CAISSIER
principalCode?: string; // Agent principal
caisseProfile?: string;
statut: AgentStatus;
zone?: string;
kiosk?: string;
fonction?: string;
dateEmbauche?: string; // ISO
nom: string;
prenom: string;
autresNoms?: string;
dateNaissance?: string;
lieuNaissance?: string;
ville?: string;
adresse?: string;
autoriserAides?: boolean;
phone: string;
pin?: string; // masked in UI
limiteInferieure?: number;
limiteSuperieure?: number;
limiteParTransaction?: number;
limiteMinAirtime?: number;
limiteMaxAirtime?: number;
maxPeripheriques?: number;
limitId?: string; // reference to AgentLimit config
// Légales
nationalite?: string;
cni?: string;
cniDelivreeLe?: string;
cniDelivreeA?: string;
residence?: string;
autreAdresse1?: string;
statutMarital?: string;
epoux?: string;
autreTelephone?: string;
// TPE assignés (actifs seulement)
tpes?: TpeDevice[];
createdAt?: string;
updatedAt?: string;
createdBy?: string;
}
export interface AgentFamilyMember {
id: string;
agentId: string;
nom: string;
statut?: string; // conjoint, enfant, etc.
dateNaissance?: string;
sexe?: 'M' | 'F';
}

View File

@@ -0,0 +1,58 @@
import { Reunion } from './reunion';
export enum CourseType {
TIERCE = 'TIERCE',
QUARTE = 'QUARTE + TIERCE',
QUINTE = 'QUINTE + TIERCE',
}
export enum CourseStatut {
PROGRAMMEE = 'PROGRAMMEE',
CREATED = 'CREATED',
VALIDATED = 'VALIDATED',
RUNNING = 'RUNNING',
CLOSED = 'CLOSED',
CANCELED = 'CANCELED',
}
export enum ResultatStatut {
NONE = 'NONE',
NON_GENERE = 'NON_GENERE',
CREATED = 'CREATED',
VALIDATED = 'VALIDATED',
CONFIRMED = 'CONFIRMED',
}
export interface Course {
id: string;
type: CourseType | string; // API returns "Plat" as string
numero: number;
nom: string;
dateDepartCourse: string;
dateDebutParis: string;
dateFinParis: string;
reunion: Reunion;
reunionCourse: number;
particularite?: string;
partants: number;
distance: number;
condition?: string;
statut: CourseStatut | string; // API returns "PROGRAMMEE" as string
nonPartants: string[];
// Additional API fields
estTerminee?: boolean;
estAnnulee?: boolean;
nombreChevauxInscrits?: number;
adeadHeat?: boolean;
createdBy: string;
validatedBy?: string | null;
createdAt: string | null;
updatedAt: string | null;
}

View File

@@ -0,0 +1,13 @@
export interface Hippodrome {
id: string;
nom: string;
ville: string;
pays: string;
actif: boolean;
capacite?: number;
description?: string;
reunionCount?: number;
courseCount?: number;
createdAt: string;
updatedAt: string;
}

View File

@@ -0,0 +1,7 @@
export interface MenuItem {
icon: string;
label: string;
exact?: boolean;
link?: string;
submenu?: MenuItem[];
}

View File

@@ -0,0 +1,26 @@
import { Course } from './course';
export type ReportStatut = 'Validé' | 'Non Validé' | 'En attente';
export type CourseCloseStatut = 'Clôturée' | 'Ouverte';
export interface CourseReportSummary {
id: string; // same as course id
course: Course; // full course reference; the course must be CLOSED
statut: ReportStatut;
confirmed?: boolean; // when true, report is locked (no further edits)
}
export interface CourseReportDetailRow {
typeGain: string; // e.g., QUINTE ORDRE
typeJeu: string; // e.g., Quinte+
montant: number; // amount per winning ticket
nombre: number; // number of winners
statut: 'Validée' | 'Non Validée';
distributed?: boolean;
externe?: boolean;
}
export interface CourseReportDetail {
summary: CourseReportSummary;
rows: CourseReportDetailRow[];
}

View File

@@ -0,0 +1,58 @@
import { Course } from './course';
export interface Resultat {
id: string;
course: Course;
/**
* Ordre d'arrivée des chevaux.
* The backend returns an array of strings/numbers (cheval numbers);
* in the UI we normalize them to plain numbers.
*/
ordreArrivee: number[];
/**
* Chevaux en dead-heat (ex aequo), represented by their numbers.
*/
chevauxDeadHeat: number[];
totalMises: number;
masseAPartager: number;
prelevementsLegaux: number;
montantRembourse: number;
montantCagnotte: number;
adeadHeat: boolean;
createdAt?: string;
updatedAt?: string;
}
// API response structure (course may be just an ID in some cases)
export interface ResultatApiResponse {
id: string | number;
course: Course | string | number;
/**
* In the raw API this is an array of strings/numbers.
*/
ordreArrivee: (string | number)[];
chevauxDeadHeat: (string | number)[];
totalMises: number;
masseAPartager: number;
prelevementsLegaux: number;
montantRembourse: number;
montantCagnotte: number;
adeadHeat: boolean;
createdAt?: string;
updatedAt?: string;
}
// POST payload structure
export interface CreateResultatPayload {
course: {
id: string | number;
};
ordreArrivee: string[];
chevauxDeadHeat?: (string | number)[];
totalMises?: number;
masseAPartager?: number;
prelevementsLegaux?: number;
montantRembourse?: number;
montantCagnotte?: number;
adeadHeat?: boolean;
}

View File

@@ -0,0 +1,21 @@
import { Hippodrome } from './hippodrome';
export enum ReunionStatut {
PLANIFIEE = 'PLANIFIEE',
EN_COURS = 'EN_COURS',
TERMINEE = 'TERMINEE',
ANNULEE = 'ANNULEE',
}
export interface Reunion {
id: string;
code: string;
nom: string;
date: string;
numero: number;
statut: ReunionStatut;
hippodrome: Hippodrome;
totalCourses?: number;
createdAt: string;
updatedAt: string;
}

View File

@@ -0,0 +1,14 @@
export interface Permission {
id: string;
name: string;
description?: string;
}
export interface Role {
id: string;
name: string;
description?: string;
permissions: Permission[];
createdAt?: string;
updatedAt?: string;
}

View File

@@ -0,0 +1,27 @@
import { Agent } from './agent';
export type TpeStatus =
| 'VALIDE'
| 'INVALIDE'
| 'EN_PANNE'
| 'BLOQUE'
| 'DISPONIBLE'
| 'AFFECTE'
| 'EN_MAINTENANCE'
| 'HORS_SERVICE'
| 'VOLE';
export type TpeType = 'POS' | 'OTHER';
export interface TpeDevice {
id: string;
imei: string;
serial: string;
type: TpeType;
marque: string;
modele: string;
statut: TpeStatus;
agent?: Agent;
assigne: boolean;
createdAt?: string;
updatedAt?: string;
}

View File

@@ -0,0 +1,39 @@
export type UserStatus = 'ACTIVE' | 'CANCELLED' | 'SUSPENDED' | string;
import type { Role } from './role';
/**
* Frontend User model.
* Aligns with backend payload while keeping a convenient `role` object when available.
*/
export interface User {
id: string;
/** Nom (last name) */
nom: string;
/** Prénom (first name) */
prenom: string;
/** Identifiant de connexion (username/login) */
identifiant: string;
/** (Hashed) password never filled from backend in UI, only for create/update. */
password?: string;
/** Matricule Agent */
matriculeAgent: string;
/** Foreign key vers le rôle */
roleId: string;
/** Rôle complet (chargé séparément) */
role?: Role;
/** Restriction de connexion (manual) */
restrictionConnexion: boolean;
/** Restriction automatique */
restrictionAutomatique: boolean;
/** Nombre d'IP autorisé (manual) */
nombreIpAutorise: number;
/** Nombre d'IP auto autorisé (automatic) */
nombreIpAutoAutorise: number;
/** Statut (from grid / backend) */
statut: UserStatus;
/** Date de dernière connexion (ISO) */
derniereConnexion?: string;
/** Timestamps */
createdAt?: string;
updatedAt?: string;
}