Skip to main content

tail_fin_pcc/
types.rs

1use serde::{Deserialize, Serialize};
2
3/// Brief info about a tender's companies.
4#[derive(Debug, Clone, Serialize, Deserialize)]
5pub struct CompanyBrief {
6    pub ids: Vec<String>,
7    pub names: Vec<String>,
8}
9
10/// A tender record from search results.
11#[derive(Debug, Clone, Serialize, Deserialize)]
12pub struct TenderRecord {
13    pub date: String,
14    pub filename: String,
15    pub job_number: String,
16    pub unit_id: String,
17    pub unit_name: String,
18    pub title: String,
19    pub tender_type: String,
20    pub companies: CompanyBrief,
21    pub url: String,
22    pub tender_api_url: String,
23}
24
25/// Search result with pagination.
26#[derive(Debug, Clone, Serialize, Deserialize)]
27pub struct SearchResult {
28    pub query: String,
29    pub page: u32,
30    pub total_records: u64,
31    pub total_pages: u32,
32    pub records: Vec<TenderRecord>,
33}
34
35/// Government unit/agency.
36#[derive(Debug, Clone, Serialize, Deserialize)]
37pub struct Unit {
38    pub unit_id: String,
39    pub name: String,
40    pub url: String,
41}
42
43/// API info response.
44#[derive(Debug, Clone, Serialize, Deserialize)]
45pub struct PccInfo {
46    pub latest_date: String,
47    pub oldest_date: String,
48    pub total_records: u64,
49}
50
51/// Special budget entry.
52#[derive(Debug, Clone, Serialize, Deserialize)]
53pub struct SpecialBudget {
54    pub name: String,
55    pub search_api_url: String,
56}