schemas of api added

This commit is contained in:
Berkay 2025-06-20 18:59:21 +03:00
parent 8022f5e725
commit 06ca2b0835
16 changed files with 1512 additions and 0 deletions

View File

@ -376,6 +376,7 @@ const TableCardComponentImproved: React.FC<DashboardPageProps> = React.memo((pro
footer: info => info.column.id
}),
], [columnHelper]) as ColumnDef<TableDataItem>[];
const table = useReactTable({
data: tableData,
columns,

View File

@ -7,6 +7,14 @@ const pageIndexMulti: Record<string, Record<string, React.FC<any>>> = {
"/build": { DashboardPage: DPage },
"/build/create": { DashboardPage: DPage },
"/build/update": { DashboardPage: DPage },
"/people": { DashboardPage: DPage },
"/people/create": { DashboardPage: DPage },
"/people/update": { DashboardPage: DPage },
"/decision/book": { DashboardPage: DPage },
"/decision/book/create": { DashboardPage: DPage },
"/decision/book/update": { DashboardPage: DPage },
"/assign/employee": { DashboardPage: DPage },
"/assign/occupant": { DashboardPage: DPage },
};
export { pageIndexMulti };

View File

@ -0,0 +1,212 @@
import { z } from 'zod';
// AccountBooks validation schema
export const accountBooksSchema = z.object({
country: z.string().nonempty(),
branch_type: z.number().int().default(0),
company_id: z.number().int().positive(),
company_uu_id: z.string().nonempty(),
branch_id: z.number().int().optional(),
branch_uu_id: z.string().optional().describe('Branch UU ID'),
});
export type AccountBooks = z.infer<typeof accountBooksSchema>;
// AccountCodes validation schema
export const accountCodesSchema = z.object({
account_code: z.string().max(48).nonempty().describe('Account Code'),
comment_line: z.string().max(128).nonempty().describe('Comment Line'),
is_receive_or_debit: z.boolean(),
product_id: z.number().int().default(0),
nvi_id: z.string().max(48).default(''),
status_id: z.number().int().default(0),
account_code_seperator: z.string().max(1).default('.'),
system_id: z.number().int().default(0),
locked: z.number().int().default(0),
company_id: z.number().int().optional(),
company_uu_id: z.string().nonempty().describe('Company UU ID'),
customer_id: z.number().int().optional(),
customer_uu_id: z.string().nonempty().describe('Customer UU ID'),
person_id: z.number().int().optional(),
person_uu_id: z.string().nonempty().describe('Person UU ID'),
});
export type AccountCodes = z.infer<typeof accountCodesSchema>;
// AccountCodeParser validation schema
export const accountCodeParserSchema = z.object({
account_code_1: z.string().nonempty().describe('Order'),
account_code_2: z.string().nonempty().describe('Order'),
account_code_3: z.string().nonempty().describe('Order'),
account_code_4: z.string().default(''),
account_code_5: z.string().default(''),
account_code_6: z.string().default(''),
account_code_id: z.number().int().positive(),
account_code_uu_id: z.string().nonempty().describe('Account Code UU ID'),
});
export type AccountCodeParser = z.infer<typeof accountCodeParserSchema>;
// AccountMaster validation schema
export const accountMasterSchema = z.object({
doc_date: z.string().datetime().describe('Document Date'),
plug_type: z.string().nonempty().describe('Plug Type'),
plug_number: z.number().int().positive().describe('Plug Number'),
special_code: z.string().max(12).default(''),
authorization_code: z.string().max(12).default(''),
doc_code: z.string().max(12).default(''),
doc_type: z.number().int().default(0),
comment_line1: z.string().default(''),
comment_line2: z.string().default(''),
comment_line3: z.string().default(''),
comment_line4: z.string().default(''),
comment_line5: z.string().default(''),
comment_line6: z.string().default(''),
project_code: z.string().max(12).default(''),
module_no: z.string().default(''),
journal_no: z.number().int().default(0),
status_id: z.number().int().default(0),
canceled: z.boolean().default(false),
print_count: z.number().int().default(0),
total_active: z.number().default(0),
total_passive: z.number().default(0),
total_active_1: z.number().default(0),
total_passive_1: z.number().default(0),
total_active_2: z.number().default(0),
total_passive_2: z.number().default(0),
total_active_3: z.number().default(0),
total_passive_3: z.number().default(0),
total_active_4: z.number().default(0),
total_passive_4: z.number().default(0),
cross_ref: z.number().int().default(0),
data_center_id: z.string().default(''),
data_center_rec_num: z.number().int().default(0),
account_header_id: z.number().int().positive(),
account_header_uu_id: z.string().nonempty().describe('Account Header UU ID'),
project_item_id: z.number().int().optional(),
project_item_uu_id: z.string().optional().describe('Project Item UU ID'),
department_id: z.number().int().optional(),
department_uu_id: z.string().optional().describe('Department UU ID'),
});
export type AccountMaster = z.infer<typeof accountMasterSchema>;
// AccountDetail validation schema
export const accountDetailSchema = z.object({
doc_date: z.string().datetime().describe('Document Date'),
line_no: z.number().int().positive().describe('Line Number'),
receive_debit: z.string().max(1).nonempty().describe('Receive Debit'),
debit: z.number().positive().describe('Debit'),
department: z.string().max(24).default(''),
special_code: z.string().max(12).default(''),
account_ref: z.number().int().default(0),
account_fiche_ref: z.number().int().default(0),
center_ref: z.number().int().default(0),
general_code: z.string().max(32).default(''),
credit: z.number().default(0),
currency_type: z.string().max(4).default('TL'),
exchange_rate: z.number().default(0),
debit_cur: z.number().default(0),
credit_cur: z.number().default(0),
discount_cur: z.number().default(0),
amount: z.number().default(0),
cross_account_code: z.string().max(32).default(''),
inf_index: z.number().default(0),
not_inflated: z.number().int().default(0),
not_calculated: z.number().int().default(0),
comment_line1: z.string().max(64).default(''),
comment_line2: z.string().max(64).default(''),
comment_line3: z.string().max(64).default(''),
comment_line4: z.string().max(64).default(''),
comment_line5: z.string().max(64).default(''),
comment_line6: z.string().max(64).default(''),
owner_acc_ref: z.number().int().default(0),
from_where: z.number().int().default(0),
orj_eid: z.number().int().default(0),
canceled: z.number().int().default(0),
cross_ref: z.number().int().default(0),
data_center_id: z.string().default(''),
data_center_rec_num: z.number().int().default(0),
status_id: z.number().int().default(0),
plug_type_id: z.number().int().nullable(),
plug_type_uu_id: z.string().nonempty().describe('Plug Type UU ID'),
account_header_id: z.number().int().positive(),
account_header_uu_id: z.string().nonempty().describe('Account Header UU ID'),
account_code_id: z.number().int().positive(),
account_code_uu_id: z.string().nonempty().describe('Account Code UU ID'),
account_master_id: z.number().int().positive(),
account_master_uu_id: z.string().nonempty().describe('Account Master UU ID'),
project_id: z.number().int().optional(),
project_uu_id: z.string().optional().describe('Project UU ID'),
});
export type AccountDetail = z.infer<typeof accountDetailSchema>;
// AccountRecordExchanges validation schema
export const accountRecordExchangesSchema = z.object({
are_currency: z.string().max(5).nonempty().describe('Unit of Currency'),
are_exchange_rate: z.number().default(1),
usd_exchange_rate_value: z.number().default(0).describe('It will be written by multiplying the usd exchange rate with the current value result.'),
eur_exchange_rate_value: z.number().default(0).describe('It will be written by multiplying the eur exchange rate with the current value result.'),
gbp_exchange_rate_value: z.number().default(0).describe('It will be written by multiplying the gpd exchange rate with the current value result.'),
cny_exchange_rate_value: z.number().default(0).describe('It will be written by multiplying the cny exchange rate with the current value result.'),
account_records_id: z.number().int().optional(),
account_records_uu_id: z.string().nullable().describe('Account Record UU ID'),
});
export type AccountRecordExchanges = z.infer<typeof accountRecordExchangesSchema>;
// AccountRecords validation schema
export const accountRecordsSchema = z.object({
iban: z.string().max(64).nonempty().describe('IBAN Number of Bank'),
bank_date: z.string().datetime().describe('Bank Transaction Date'),
currency_value: z.number().describe('Currency Value'),
bank_balance: z.number().describe('Bank Balance'),
currency: z.string().max(5).nonempty().describe('Unit of Currency'),
additional_balance: z.number().describe('Additional Balance'),
channel_branch: z.string().max(120).nonempty().describe('Branch Bank'),
process_name: z.string().nonempty().describe('Bank Process Type Name'),
process_type: z.string().nonempty().describe('Bank Process Type'),
process_comment: z.string().nonempty().describe('Transaction Record Comment'),
process_garbage: z.string().nullable().describe('Transaction Record Garbage'),
bank_reference_code: z.string().nonempty().describe('Bank Reference Code'),
add_comment_note: z.string().default(''),
is_receipt_mail_send: z.boolean().default(false),
found_from: z.string().default(''),
similarity: z.number().default(0),
remainder_balance: z.number().default(0),
bank_date_y: z.number().int(),
bank_date_m: z.number().int(),
bank_date_w: z.number().int(),
bank_date_d: z.number().int(),
approving_accounting_record: z.boolean().default(false),
accounting_receipt_date: z.string().datetime().default('1900-01-01T00:00:00Z'),
accounting_receipt_number: z.number().int().default(0),
status_id: z.number().int().default(0),
approved_record: z.boolean().default(false),
import_file_name: z.string().nullable().describe('XLS Key'),
receive_debit: z.number().int().nullable(),
receive_debit_uu_id: z.string().nullable().describe('Debit UU ID'),
budget_type: z.number().int().nullable(),
budget_type_uu_id: z.string().nullable().describe('Budget Type UU ID'),
company_id: z.number().int().nullable(),
company_uu_id: z.string().nullable().describe('Company UU ID'),
send_company_id: z.number().int().nullable(),
send_company_uu_id: z.string().nullable().describe('Send Company UU ID'),
send_person_id: z.number().int().nullable(),
send_person_uu_id: z.string().nullable().describe('Send Person UU ID'),
approving_accounting_person: z.number().int().nullable(),
approving_accounting_person_uu_id: z.string().nullable().describe('Approving Accounting Person UU ID'),
living_space_id: z.number().int().nullable(),
living_space_uu_id: z.string().nullable().describe('Living Space UU ID'),
customer_id: z.number().int().nullable(),
customer_uu_id: z.string().nullable().describe('Customer UU ID'),
build_id: z.number().int().nullable(),
build_uu_id: z.string().nullable().describe('Build UU ID'),
build_parts_id: z.number().int().nullable(),
build_parts_uu_id: z.string().nullable().describe('Build Parts UU ID'),
build_decision_book_id: z.number().int().nullable(),
build_decision_book_uu_id: z.string().nullable().describe('Build Decision Book UU ID'),
});
export type AccountRecords = z.infer<typeof accountRecordsSchema>;

View File

@ -0,0 +1,35 @@
import { z } from 'zod';
/**
* Zod schema for BuildIbans
* Corresponds to the BuildIbans class in Python
*/
export const buildIbansSchema = z.object({
iban: z.string().max(40).nonempty().describe('IBAN number'),
start_date: z.string().datetime().describe('Bank Transaction Start Date'),
stop_date: z.string().datetime().default('2900-01-01T00:00:00Z'),
bank_code: z.string().max(24).default('TR0000000000000'),
xcomment: z.string().max(64).default('????'),
build_id: z.number().int().nullable().describe('Building ID'),
build_uu_id: z.string().nullable().describe('Building UUID'),
});
export type BuildIbans = z.infer<typeof buildIbansSchema>;
/**
* Zod schema for BuildIbanDescription
* Corresponds to the BuildIbanDescription class in Python
*/
export const buildIbanDescriptionSchema = z.object({
iban: z.string().nonempty().describe('IBAN Number'),
group_id: z.number().int().describe('Group ID'),
search_word: z.string().nonempty().describe('Search Word'),
customer_id: z.number().int().nullable(),
customer_uu_id: z.string().nullable().describe('Customer UUID'),
company_id: z.number().int().nullable(),
company_uu_id: z.string().nullable().describe('Company UUID'),
build_parts_id: z.number().int().nullable(),
build_parts_uu_id: z.string().nullable().describe('Build Parts UUID'),
});
export type BuildIbanDescription = z.infer<typeof buildIbanDescriptionSchema>;

View File

@ -0,0 +1,183 @@
import { z } from 'zod';
/**
* Zod schema for RelationshipEmployee2PostCode
* Corresponds to the RelationshipEmployee2PostCode class in Python
*/
export const relationshipEmployee2PostCodeSchema = z.object({
company_id: z.number().int().nullable(),
employee_id: z.number().int(),
member_id: z.number().int(),
relationship_type: z.string().default('Employee'),
show_only: z.boolean().default(false),
});
export type RelationshipEmployee2PostCode = z.infer<typeof relationshipEmployee2PostCodeSchema>;
/**
* Zod schema for AddressPostcode
* Corresponds to the AddressPostcode class in Python
*/
export const addressPostcodeSchema = z.object({
street_id: z.number().int(),
street_uu_id: z.string().default('').describe('Street UUID'),
postcode: z.string().max(32).describe('Postcode'),
});
export type AddressPostcode = z.infer<typeof addressPostcodeSchema>;
/**
* Zod schema for Addresses
* Corresponds to the Addresses class in Python
*/
export const addressesSchema = z.object({
build_number: z.string().max(24).describe('Build Number'),
door_number: z.string().max(24).nullable().describe('Door Number'),
floor_number: z.string().max(24).nullable().describe('Floor Number'),
comment_address: z.string().describe('Address'),
letter_address: z.string().describe('Address'),
short_letter_address: z.string().describe('Address'),
latitude: z.number().default(0),
longitude: z.number().default(0),
street_id: z.number().int(),
street_uu_id: z.string().default('').describe('Street UUID'),
});
export type Addresses = z.infer<typeof addressesSchema>;
/**
* Zod schema for AddressGeographicLocations
* Corresponds to the AddressGeographicLocations class in Python
*/
export const addressGeographicLocationsSchema = z.object({
geo_table: z.string().describe('Address Table Name'),
geo_id: z.number().int().describe('Address Table ID'),
geo_name: z.string().describe('Geographic Location Name'),
geo_latitude: z.number().default(0).describe('Geographic Location Name'),
geo_longitude: z.number().default(0).describe('Geographic Location Latitude'),
geo_altitude: z.number().default(0).describe('Geographic Location Longitude'),
geo_description: z.string().describe('Geographic Location Description'),
geo_area_size: z.number().nullable().default(0).describe('Geographic Location Area Size'),
geo_population: z.number().int().nullable().describe('Geographic Location Population'),
});
export type AddressGeographicLocations = z.infer<typeof addressGeographicLocationsSchema>;
/**
* Zod schema for AddressCountry
* Corresponds to the AddressCountry class in Python
*/
export const addressCountrySchema = z.object({
country_code: z.string().max(16).describe('Country Code'),
country_name: z.string().describe('Country Name'),
money_code: z.string().max(12).nullable().describe('Money Code'),
language: z.string().nullable().describe('Language Code'),
address_geographic_id: z.number().int().nullable().describe('Address Geographic Id'),
});
export type AddressCountry = z.infer<typeof addressCountrySchema>;
/**
* Zod schema for AddressState
* Corresponds to the AddressState class in Python
*/
export const addressStateSchema = z.object({
state_code: z.string().max(16).describe('State Code'),
state_name: z.string().describe('State Name'),
licence_plate: z.string().max(24).nullable().describe('Sign Code'),
phone_code: z.string().max(36).nullable().describe('Phone Code'),
gov_code: z.string().max(128).nullable().describe('Government Code'),
address_geographic_id: z.number().int().nullable().describe('Address Geographic Id'),
country_id: z.number().int(),
country_uu_id: z.string().default('').describe('Country UUID'),
});
export type AddressState = z.infer<typeof addressStateSchema>;
/**
* Zod schema for AddressCity
* Corresponds to the AddressCity class in Python
*/
export const addressCitySchema = z.object({
city_code: z.string().max(24).describe('City Code'),
city_name: z.string().describe('City Name'),
licence_plate: z.string().max(24).nullable().describe('Sign Code'),
phone_code: z.string().max(36).nullable().describe('Phone Code'),
gov_code: z.string().max(128).nullable().describe('Government Code'),
address_geographic_id: z.number().int().nullable().describe('Address Geographic Id'),
state_id: z.number().int(),
state_uu_id: z.string().default('').describe('State UUID'),
});
export type AddressCity = z.infer<typeof addressCitySchema>;
/**
* Zod schema for AddressDistrict
* Corresponds to the AddressDistrict class in Python
*/
export const addressDistrictSchema = z.object({
district_code: z.string().max(16).describe('District Code'),
district_name: z.string().describe('District Name'),
phone_code: z.string().max(36).nullable().describe('Phone Code'),
gov_code: z.string().max(128).nullable().describe('Government Code'),
address_geographic_id: z.number().int().nullable().describe('Address Geographic Id'),
city_id: z.number().int().describe('City ID'),
city_uu_id: z.string().default('').describe('City UUID'),
});
export type AddressDistrict = z.infer<typeof addressDistrictSchema>;
/**
* Zod schema for AddressLocality
* Corresponds to the AddressLocality class in Python
*/
export const addressLocalitySchema = z.object({
locality_code: z.string().max(16).describe('Locality Code'),
locality_name: z.string().describe('Locality Name'),
type_code: z.string().nullable().describe('Type Name'),
type_description: z.string().nullable().describe('Type Name'),
gov_code: z.string().max(128).nullable().describe('Government Code'),
address_show: z.boolean().default(true),
address_geographic_id: z.number().int().nullable().describe('Address Geographic Id'),
district_id: z.number().int().describe('District ID'),
district_uu_id: z.string().default('').describe('District UUID'),
});
export type AddressLocality = z.infer<typeof addressLocalitySchema>;
/**
* Zod schema for AddressNeighborhood
* Corresponds to the AddressNeighborhood class in Python
*/
export const addressNeighborhoodSchema = z.object({
neighborhood_code: z.string().max(16).describe('Neighborhood Code'),
neighborhood_name: z.string().describe('Neighborhood Name'),
type_code: z.string().nullable().describe('Type Name'),
type_description: z.string().nullable().describe('Type Name'),
gov_code: z.string().max(128).nullable().describe('Government Code'),
address_show: z.boolean().default(true),
address_geographic_id: z.number().int().nullable().describe('Address Geographic Id'),
district_id: z.number().int().nullable().describe('District ID'),
district_uu_id: z.string().default('').describe('District UUID'),
locality_id: z.number().int().nullable().describe('Locality ID'),
locality_uu_id: z.string().default('').describe('Locality UUID'),
});
export type AddressNeighborhood = z.infer<typeof addressNeighborhoodSchema>;
/**
* Zod schema for AddressStreet
* Corresponds to the AddressStreet class in Python
*/
export const addressStreetSchema = z.object({
street_code: z.string().max(16).describe('Street Code'),
street_name: z.string().describe('Street Name'),
type_code: z.string().nullable().describe('Type Name'),
type_description: z.string().nullable().describe('Type Name'),
gov_code: z.string().max(128).nullable().describe('Government Code'),
address_geographic_id: z.number().int().nullable().describe('Address Geographic Id'),
neighborhood_id: z.number().int().describe('Neighborhood ID'),
neighborhood_uu_id: z.string().default('').describe('Neighborhood UUID'),
});
export type AddressStreet = z.infer<typeof addressStreetSchema>;

View File

@ -0,0 +1,69 @@
import { z } from 'zod';
/**
* Zod schema for DecisionBookBudgetBooks
* Corresponds to the DecisionBookBudgetBooks class in Python
*/
export const decisionBookBudgetBooksSchema = z.object({
country: z.string(),
branch_type: z.number().int().default(0),
company_id: z.number().int(),
company_uu_id: z.string(),
branch_id: z.number().int().nullable(),
branch_uu_id: z.string().nullable().describe('Branch UU ID'),
build_decision_book_id: z.number().int(),
build_decision_book_uu_id: z.string().nullable().describe('Build Decision Book UU ID'),
});
export type DecisionBookBudgetBooks = z.infer<typeof decisionBookBudgetBooksSchema>;
/**
* Zod schema for DecisionBookBudgetCodes
* Corresponds to the DecisionBookBudgetCodes class in Python
*/
export const decisionBookBudgetCodesSchema = z.object({
budget_code: z.string().max(48).describe('budget Code'),
comment_line: z.string().describe('Comment Line'),
build_decision_book_id: z.number().int().nullable(),
build_decision_book_uu_id: z.string().nullable().describe('Build Decision Book UU ID'),
build_parts_id: z.number().int().nullable(),
build_parts_uu_id: z.string().nullable().describe('Build Parts UU ID'),
company_id: z.number().int().nullable(),
company_uu_id: z.string().nullable().describe('Company UU ID'),
});
export type DecisionBookBudgetCodes = z.infer<typeof decisionBookBudgetCodesSchema>;
/**
* Zod schema for DecisionBookBudgetMaster
* Corresponds to the DecisionBookBudgetMaster class in Python
*/
export const decisionBookBudgetMasterSchema = z.object({
budget_type: z.string().max(50).describe('Budget type (e.g.: Operational, Investment)'),
currency: z.string().max(8).default('TRY').describe('Budget currency'),
total_budget: z.number().describe('Total budget'),
tracking_period_id: z.number().int().nullable(),
tracking_period_uu_id: z.string().nullable().describe('Part Direction UUID'),
budget_books_id: z.number().int(),
budget_books_uu_id: z.string().nullable().describe('Budget Books UU ID'),
department_id: z.number().int().describe('Relationship with department'),
department_uu_id: z.string().nullable().describe('Department UU ID'),
});
export type DecisionBookBudgetMaster = z.infer<typeof decisionBookBudgetMasterSchema>;
/**
* Zod schema for DecisionBookBudgets
* Corresponds to the DecisionBookBudgets class in Python
*/
export const decisionBookBudgetsSchema = z.object({
process_date: z.string().datetime().describe('Start date'),
budget_codes_id: z.number().int(),
total_budget: z.number().describe('Total budget'),
used_budget: z.number().default(0).describe('Used budget'),
remaining_budget: z.number().default(0).describe('Remaining budget'),
decision_book_budget_master_id: z.number().int(),
decision_book_budget_master_uu_id: z.string().nullable().describe('Decision Book Budget Master UU ID'),
});
export type DecisionBookBudgets = z.infer<typeof decisionBookBudgetsSchema>;

View File

@ -0,0 +1,199 @@
import { z } from 'zod';
/**
* Zod schema for BuildTypes
* Corresponds to the BuildTypes class in Python
*/
export const buildTypesSchema = z.object({
function_code: z.string().max(12).default('').describe('Function Code'),
type_code: z.string().max(12).default('').describe('Structure Type Code'),
lang: z.string().max(4).default('TR').describe('Language'),
type_name: z.string().max(48).default('').describe('Type Name'),
});
export type BuildTypes = z.infer<typeof buildTypesSchema>;
/**
* Zod schema for Part2Employee
* Corresponds to the Part2Employee class in Python
*/
export const part2EmployeeSchema = z.object({
build_id: z.number().int().describe('Building ID'),
part_id: z.number().int().describe('Part ID'),
employee_id: z.number().int().describe('Employee ID'),
});
export type Part2Employee = z.infer<typeof part2EmployeeSchema>;
/**
* Zod schema for RelationshipEmployee2Build
* Corresponds to the RelationshipEmployee2Build class in Python
*/
export const relationshipEmployee2BuildSchema = z.object({
company_id: z.number().int(),
employee_id: z.number().int(),
member_id: z.number().int(),
relationship_type: z.string().default('Employee'),
show_only: z.boolean().default(false),
});
export type RelationshipEmployee2Build = z.infer<typeof relationshipEmployee2BuildSchema>;
/**
* Zod schema for Build
* Corresponds to the Build class in Python
*/
export const buildSchema = z.object({
gov_address_code: z.string().default(''),
build_name: z.string().describe('Building Name'),
build_no: z.string().max(8).describe('Building Number'),
max_floor: z.number().int().default(1).describe('Max Floor'),
underground_floor: z.number().int().default(0).describe('Underground Floor'),
build_date: z.string().datetime().default('1900-01-01T00:00:00Z'),
decision_period_date: z.string().datetime().default('1900-01-01T00:00:00Z').describe('Building annual ordinary meeting period'),
tax_no: z.string().max(24).default(''),
lift_count: z.number().int().default(0),
heating_system: z.boolean().default(true),
cooling_system: z.boolean().default(false),
hot_water_system: z.boolean().default(false),
block_service_man_count: z.number().int().default(0),
security_service_man_count: z.number().int().default(0),
garage_count: z.number().int().default(0).describe('Garage Count'),
management_room_id: z.number().int().nullable().describe('Management Room ID'),
site_id: z.number().int().nullable(),
site_uu_id: z.string().nullable().describe('Site UUID'),
address_id: z.number().int(),
address_uu_id: z.string().describe('Address UUID'),
build_types_id: z.number().int().describe('Building Type'),
build_types_uu_id: z.string().describe('Building Type UUID'),
});
export type Build = z.infer<typeof buildSchema>;
/**
* Zod schema for BuildParts
* Corresponds to the BuildParts class in Python
*/
export const buildPartsSchema = z.object({
address_gov_code: z.string().describe('Goverment Door Code'),
part_no: z.number().int().default(0).describe('Part Number'),
part_level: z.number().int().default(0).describe('Building Part Level'),
part_code: z.string().default('').describe('Part Code'),
part_gross_size: z.number().int().default(0).describe('Part Gross Size'),
part_net_size: z.number().int().default(0).describe('Part Net Size'),
default_accessory: z.string().default('0').describe('Default Accessory'),
human_livable: z.boolean().default(true).describe('Human Livable'),
due_part_key: z.string().default('').describe('Constant Payment Group'),
build_id: z.number().int().describe('Building ID'),
build_uu_id: z.string().describe('Building UUID'),
part_direction_id: z.number().int().nullable(),
part_direction_uu_id: z.string().nullable().describe('Part Direction UUID'),
part_type_id: z.number().int().describe('Building Part Type'),
part_type_uu_id: z.string().describe('Building Part Type UUID'),
});
export type BuildParts = z.infer<typeof buildPartsSchema>;
/**
* Zod schema for BuildLivingSpace
* Corresponds to the BuildLivingSpace class in Python
*/
export const buildLivingSpaceSchema = z.object({
fix_value: z.number().default(0).describe('Fixed value is deducted from debit.'),
fix_percent: z.number().default(0).describe('Fixed percent is deducted from debit.'),
agreement_no: z.string().default('').describe('Agreement No'),
marketing_process: z.boolean().default(false),
marketing_layer: z.number().int().default(0),
build_parts_id: z.number().int().describe('Build Part ID'),
build_parts_uu_id: z.string().describe('Build Part UUID'),
person_id: z.number().int().describe('Responsible People ID'),
person_uu_id: z.string().describe('Responsible People UUID'),
occupant_type_id: z.number().int().describe('Occupant Type'),
occupant_type_uu_id: z.string().describe('Occupant Type UUID'),
});
export type BuildLivingSpace = z.infer<typeof buildLivingSpaceSchema>;
/**
* Zod schema for BuildManagement
* Corresponds to the BuildManagement class in Python
*/
export const buildManagementSchema = z.object({
discounted_percentage: z.number().default(0),
discounted_price: z.number().default(0),
calculated_price: z.number().default(0),
occupant_type: z.number().int().describe('Occupant Type'),
occupant_type_uu_id: z.string().describe('Occupant Type UUID'),
build_id: z.number().int().describe('Building ID'),
build_uu_id: z.string().describe('Building UUID'),
build_parts_id: z.number().int().describe('Build Part ID'),
build_parts_uu_id: z.string().describe('Build Part UUID'),
});
export type BuildManagement = z.infer<typeof buildManagementSchema>;
/**
* Zod schema for BuildArea
* Corresponds to the BuildArea class in Python
*/
export const buildAreaSchema = z.object({
area_name: z.string().default(''),
area_code: z.string().default(''),
area_type: z.string().default('GREEN'),
area_direction: z.string().max(2).default('NN'),
area_gross_size: z.number().default(0),
area_net_size: z.number().default(0),
width: z.number().int().default(0),
size: z.number().int().default(0),
build_id: z.number().int(),
build_uu_id: z.string().describe('Building UUID'),
part_type_id: z.number().int().nullable().describe('Building Part Type'),
part_type_uu_id: z.string().nullable().describe('Building Part Type UUID'),
});
export type BuildArea = z.infer<typeof buildAreaSchema>;
/**
* Zod schema for BuildSites
* Corresponds to the BuildSites class in Python
*/
export const buildSitesSchema = z.object({
site_name: z.string().max(24),
site_no: z.string().max(8),
address_id: z.number().int(),
address_uu_id: z.string().describe('Address UUID'),
});
export type BuildSites = z.infer<typeof buildSitesSchema>;
/**
* Zod schema for BuildCompaniesProviding
* Corresponds to the BuildCompaniesProviding class in Python
*/
export const buildCompaniesProvidingSchema = z.object({
build_id: z.number().int().describe('Building ID'),
build_uu_id: z.string().nullable().describe('Providing UUID'),
company_id: z.number().int(),
company_uu_id: z.string().nullable().describe('Providing UUID'),
provide_id: z.number().int().nullable(),
provide_uu_id: z.string().nullable().describe('Providing UUID'),
contract_id: z.number().int().nullable(),
});
export type BuildCompaniesProviding = z.infer<typeof buildCompaniesProvidingSchema>;
/**
* Zod schema for BuildPersonProviding
* Corresponds to the BuildPersonProviding class in Python
*/
export const buildPersonProvidingSchema = z.object({
build_id: z.number().int().describe('Building ID'),
build_uu_id: z.string().nullable().describe('Providing UUID'),
people_id: z.number().int(),
people_uu_id: z.string().nullable().describe('People UUID'),
provide_id: z.number().int().nullable(),
provide_uu_id: z.string().nullable().describe('Providing UUID'),
contract_id: z.number().int().nullable(),
});
export type BuildPersonProviding = z.infer<typeof buildPersonProvidingSchema>;

View File

@ -0,0 +1,273 @@
import { z } from 'zod';
/**
* Zod schema for BuildDecisionBook
* Corresponds to the BuildDecisionBook class in Python
* The start dates of the decision log periods are determined from the 'decision_period_date' field
* in the decision log table within the building information.
*/
export const buildDecisionBookSchema = z.object({
decision_book_pdf_path: z.string().nullable().default('').describe('Karar defteri pdf dosyasının yolu'),
resp_company_fix_wage: z.number().default(0).describe('Karar defterinin oluşmasını sağlayan dışardaki danışmanlık ücreti'),
is_out_sourced: z.boolean().default(false).describe('Karar defterinin dışardan alınan hizmetle oluşturulup oluşturulmadığı'),
meeting_date: z.string().datetime().default('1900-01-01T00:00:00Z').describe('Karar defterinin oluşmasını sağlayan toplantı tarihi'),
decision_type: z.string().max(3).default('RBM').describe('Karar defterinin tipi (Bina Yönetim Toplantısı (BYT), Yıllık Acil Toplantı (YAT)'),
meeting_is_completed: z.boolean().default(false),
meeting_completed_date: z.string().datetime().nullable().describe('Meeting Completed Date'),
build_id: z.number().int(),
build_uu_id: z.string().nullable().describe('Build UUID'),
resp_company_id: z.number().int(),
resp_company_uu_id: z.string().nullable().describe('Company UUID'),
contact_id: z.number().int().nullable().describe('Contract id'),
contact_uu_id: z.string().nullable().describe('Contract UUID'),
});
export type BuildDecisionBook = z.infer<typeof buildDecisionBookSchema>;
/**
* Zod schema for BuildDecisionBookInvitations
* Corresponds to the BuildDecisionBookInvitations class in Python
*/
export const buildDecisionBookInvitationsSchema = z.object({
build_id: z.number().int(),
build_uu_id: z.string().nullable().describe('Build UUID'),
decision_book_id: z.number().int(),
decision_book_uu_id: z.string().nullable().describe('Decision Book UUID'),
invitation_type: z.string().describe('Invite Type'),
invitation_attempt: z.number().int().default(1),
living_part_count: z.number().int().default(1),
living_part_percentage: z.number().default(0.51),
message: z.string().nullable().describe('Invitation Message'),
planned_date: z.string().datetime().describe('Planned Meeting Date'),
planned_date_expires: z.string().datetime().describe('Planned Meeting Date Expires'),
});
export type BuildDecisionBookInvitations = z.infer<typeof buildDecisionBookInvitationsSchema>;
/**
* Zod schema for BuildDecisionBookPerson
* Corresponds to the BuildDecisionBookPerson class in Python
* Karar Defteri toplantılarına katılan kişiler veya yetkililer
*/
export const buildDecisionBookPersonSchema = z.object({
dues_percent_discount: z.number().int().default(0).describe('Katılımcının aidat indirim oranı'),
dues_fix_discount: z.number().default(0).describe('Katılımcının aidat sabit miktarı'),
dues_discount_approval_date: z.string().datetime().default('1900-01-01T00:00:00Z'),
send_date: z.string().datetime().describe('Confirmation Date'),
is_attending: z.boolean().default(false).describe('Occupant is Attending to invitation'),
confirmed_date: z.string().datetime().nullable().describe('Confirmation Date'),
token: z.string().default('').describe('Invitation Token'),
vicarious_person_id: z.number().int().nullable().describe('Vicarious Person ID'),
vicarious_person_uu_id: z.string().nullable().describe('Vicarious Person UUID'),
invite_id: z.number().int(),
invite_uu_id: z.string().describe('Invite UUID'),
build_decision_book_id: z.number().int(),
build_decision_book_uu_id: z.string().describe('Decision Book UUID'),
build_living_space_id: z.number().int(),
build_living_space_uu_id: z.string().nullable().describe('Living Space UUID'),
person_id: z.number().int(),
});
export type BuildDecisionBookPerson = z.infer<typeof buildDecisionBookPersonSchema>;
/**
* Zod schema for BuildDecisionBookPersonOccupants
* Corresponds to the BuildDecisionBookPersonOccupants class in Python
*/
export const buildDecisionBookPersonOccupantsSchema = z.object({
build_decision_book_person_id: z.number().int(),
build_decision_book_person_uu_id: z.string().nullable().describe('Decision Book Person UUID'),
invite_id: z.number().int().nullable(),
invite_uu_id: z.string().nullable().describe('Invite UUID'),
occupant_type_id: z.number().int(),
occupant_type_uu_id: z.string().nullable().describe('Occupant UUID'),
});
export type BuildDecisionBookPersonOccupants = z.infer<typeof buildDecisionBookPersonOccupantsSchema>;
/**
* Zod schema for BuildDecisionBookItems
* Corresponds to the BuildDecisionBookItems class in Python
*/
export const buildDecisionBookItemsSchema = z.object({
item_order: z.number().int().describe('Order Number of Item'),
item_comment: z.string().describe('Comment Content'),
item_objection: z.string().nullable().describe('Objection Content'),
info_is_completed: z.boolean().default(false).describe('Info process is Completed'),
is_payment_created: z.boolean().default(false).describe('Are payment Records Created'),
info_type_id: z.number().int().nullable(),
info_type_uu_id: z.string().nullable().describe('Info Type UUID'),
build_decision_book_id: z.number().int(),
build_decision_book_uu_id: z.string().nullable().describe('Decision Book UUID'),
item_short_comment: z.string().max(24).nullable().describe('This field is reserved for use in grouping data or in the pivot heading.'),
});
export type BuildDecisionBookItems = z.infer<typeof buildDecisionBookItemsSchema>;
/**
* Zod schema for BuildDecisionBookItemsUnapproved
* Corresponds to the BuildDecisionBookItemsUnapproved class in Python
*/
export const buildDecisionBookItemsUnapprovedSchema = z.object({
item_objection: z.string().describe('Objection Content'),
item_order: z.number().int().describe('Order Number'),
decision_book_item_id: z.number().int(),
decision_book_item_uu_id: z.string().nullable().describe('Decision Book Item'),
person_id: z.number().int(),
person_uu_id: z.string().nullable().describe('Person UUID'),
build_decision_book_item: z.number().int(),
build_decision_book_item_uu_id: z.string().nullable().describe('Decision Book Item UUID'),
});
export type BuildDecisionBookItemsUnapproved = z.infer<typeof buildDecisionBookItemsUnapprovedSchema>;
/**
* Zod schema for BuildDecisionBookPayments
* Corresponds to the BuildDecisionBookPayments class in Python
*/
export const buildDecisionBookPaymentsSchema = z.object({
payment_plan_time_periods: z.string().max(10).describe('Payment Plan Time Periods'),
process_date: z.string().datetime().describe('Payment Due Date'),
payment_amount: z.number().describe('Payment Amount'),
currency: z.string().max(8).default('TRY'),
payment_types_id: z.number().int().nullable(),
payment_types_uu_id: z.string().nullable().describe('Dues Type UUID'),
period_time: z.string().max(12),
process_date_y: z.number().int(),
process_date_m: z.number().int(),
build_decision_book_item_id: z.number().int().describe('Build Decision Book Item ID'),
build_decision_book_item_uu_id: z.string().describe('Decision Book Item UUID'),
build_parts_id: z.number().int(),
build_parts_uu_id: z.string().describe('Build Part UUID'),
decision_book_project_id: z.number().int().nullable().describe('Decision Book Project ID'),
decision_book_project_uu_id: z.string().nullable().describe('Decision Book Project UUID'),
account_records_id: z.number().int().nullable(),
account_records_uu_id: z.string().nullable().describe('Account Record UU ID'),
});
export type BuildDecisionBookPayments = z.infer<typeof buildDecisionBookPaymentsSchema>;
/**
* Zod schema for BuildDecisionBookLegal
* Corresponds to the BuildDecisionBookLegal class in Python
* lawsuits_type C:Court Mehkeme M: mediator arabulucu
*/
export const buildDecisionBookLegalSchema = z.object({
period_start_date: z.string().datetime().describe('Start Date of Legal Period'),
lawsuits_decision_number: z.string().describe('Lawsuits Decision Number'),
lawsuits_decision_date: z.string().datetime().describe('Lawsuits Decision Date'),
period_stop_date: z.string().datetime().default('2099-12-31T23:59:59Z'),
decision_book_pdf_path: z.string().default('').nullable(),
resp_company_total_wage: z.number().default(0).nullable(),
contact_agreement_path: z.string().default('').nullable(),
contact_agreement_date: z.string().datetime().default('1900-01-01T00:00:00Z').nullable(),
meeting_date: z.string().datetime().default('1900-01-01T00:00:00Z'),
lawsuits_type: z.string().max(1).default('C'),
lawsuits_name: z.string().max(128),
lawsuits_note: z.string().max(512),
lawyer_cost: z.number(),
mediator_lawyer_cost: z.number(),
other_cost: z.number(),
legal_cost: z.number(),
approved_cost: z.number(),
total_price: z.number(),
build_db_item_id: z.number().int(),
build_db_item_uu_id: z.string().nullable().describe('Decision Book Item UUID'),
resp_attorney_id: z.number().int(),
resp_attorney_uu_id: z.string().nullable().describe('Attorney UUID'),
resp_attorney_company_id: z.number().int(),
resp_attorney_company_uu_id: z.string().nullable().describe('Company UUID'),
mediator_lawyer_person_id: z.number().int(),
mediator_lawyer_person_uu_id: z.string().nullable().describe('Mediator Lawyer UUID'),
});
export type BuildDecisionBookLegal = z.infer<typeof buildDecisionBookLegalSchema>;
/**
* Zod schema for BuildDecisionBookProjects
* Corresponds to the BuildDecisionBookProjects class in Python
* project_type = C:Court Mehkeme M: mediator arabulucu
*/
export const buildDecisionBookProjectsSchema = z.object({
project_no: z.string().max(12).nullable().describe('Project Number of Decision Book'),
project_name: z.string().describe('Project Name'),
project_start_date: z.string().datetime().describe('Project Start Date'),
project_stop_date: z.string().datetime().default('2099-12-31T23:59:59Z'),
project_type: z.string().default('C'),
project_note: z.string(),
decision_book_pdf_path: z.string().default('').nullable(),
is_completed: z.boolean().default(false).describe('Project is Completed'),
status_code: z.number().int().nullable(),
resp_company_fix_wage: z.number().default(0),
is_out_sourced: z.boolean().default(false),
meeting_date: z.string().datetime().default('1900-01-01T00:00:00Z'),
currency: z.string().max(8).default('TRY'),
bid_price: z.number().default(0),
approved_price: z.number().default(0),
final_price: z.number().default(0),
contact_id: z.number().int().nullable().describe('Contract id'),
contact_uu_id: z.string().nullable().describe('Contract UUID'),
build_decision_book_id: z.number().int(),
build_decision_book_uu_id: z.string().nullable().describe('Decision Book UUID'),
build_decision_book_item_id: z.number().int(),
build_decision_book_item_uu_id: z.string().nullable().describe('Decision Book Item UUID'),
project_response_living_space_id: z.number().int().nullable().describe('Project Response Person ID'),
project_response_living_space_uu_id: z.string().nullable().describe('Project Response Person UUID'),
resp_company_id: z.number().int().nullable(),
resp_company_uu_id: z.string().nullable().describe('Company UUID'),
});
export type BuildDecisionBookProjects = z.infer<typeof buildDecisionBookProjectsSchema>;
/**
* Zod schema for BuildDecisionBookProjectPerson
* Corresponds to the BuildDecisionBookProjectPerson class in Python
*/
export const buildDecisionBookProjectPersonSchema = z.object({
dues_percent_discount: z.number().int().default(0),
job_fix_wage: z.number().default(0),
bid_price: z.number().default(0),
decision_price: z.number().default(0),
build_decision_book_project_id: z.number().int(),
build_decision_book_project_uu_id: z.string().nullable().describe('Decision Book Project UUID'),
living_space_id: z.number().int(),
living_space_uu_id: z.string().nullable().describe('Living Space UUID'),
});
export type BuildDecisionBookProjectPerson = z.infer<typeof buildDecisionBookProjectPersonSchema>;
/**
* Zod schema for BuildDecisionBookProjectItems
* Corresponds to the BuildDecisionBookProjectItems class in Python
*/
export const buildDecisionBookProjectItemsSchema = z.object({
item_header: z.string().describe('Item Header'),
item_comment: z.string().describe('Item Comment'),
attachment_pdf_path: z.string().default('').nullable().describe('Attachment PDF Path'),
item_estimated_cost: z.number().default(0).describe('Estimated Cost'),
item_short_comment: z.string().max(24).nullable().describe('This field is reserved for use in grouping data or in the pivot heading.'),
build_decision_book_project_id: z.number().int(),
build_decision_book_project_uu_id: z.string().nullable().describe('Decision Book Project UUID'),
});
export type BuildDecisionBookProjectItems = z.infer<typeof buildDecisionBookProjectItemsSchema>;

View File

@ -0,0 +1,48 @@
import { z } from 'zod';
/**
* Zod schema for RelationshipDutyCompany
* Corresponds to the RelationshipDutyCompany class in Python
* Company -> Sub Company -> Sub-Sub Company
*/
export const relationshipDutyCompanySchema = z.object({
owner_id: z.number().int().describe('Company ID that owns the relationship'),
duties_id: z.number().int().describe('Duty ID reference'),
member_id: z.number().int().describe('Member company ID in the relationship'),
parent_id: z.number().int().nullable().describe('Parent company ID if applicable'),
relationship_type: z.string().default('Commercial').describe('Type of relationship: Commercial, Organization, Bulk'),
child_count: z.number().int(),
show_only: z.boolean().default(false),
});
export type RelationshipDutyCompany = z.infer<typeof relationshipDutyCompanySchema>;
/**
* Zod schema for Companies
* Corresponds to the Companies class in Python
* formal_name = Government register name by offical
* public_name = Public registered name by User
* nick_name = Search by nickname, commercial_type = Tüzel veya birey
*/
export const companiesSchema = z.object({
formal_name: z.string().describe('Formal Name'),
company_type: z.string().describe('Company Type'),
commercial_type: z.string().describe('Commercial Type'),
tax_no: z.string().describe('Tax No'),
public_name: z.string().describe('Public Name of a company'),
company_tag: z.string().describe('Company Tag'),
default_lang_type: z.string().default('TR'),
default_money_type: z.string().default('TL'),
is_commercial: z.boolean().default(false),
is_blacklist: z.boolean().default(false),
parent_id: z.number().int().nullable(),
workplace_no: z.string().nullable(),
official_address_id: z.number().int().nullable(),
official_address_uu_id: z.string().nullable().describe('Official Address UUID'),
top_responsible_company_id: z.number().int().nullable(),
top_responsible_company_uu_id: z.string().nullable().describe('Top Responsible Company UUID'),
});
export type Companies = z.infer<typeof companiesSchema>;

View File

@ -0,0 +1,46 @@
import { z } from 'zod';
/**
* Zod schema for Departments
* Corresponds to the Departments class in Python
*/
export const departmentsSchema = z.object({
parent_department_id: z.number().int().default(0),
department_code: z.string().max(16).describe('Department Code'),
department_name: z.string().max(128).describe('Department Name'),
department_description: z.string().default(''),
company_id: z.number().int(),
company_uu_id: z.string().describe('Company UUID'),
});
export type Departments = z.infer<typeof departmentsSchema>;
/**
* Zod schema for Duty
* Corresponds to the Duty class in Python
*/
export const dutySchema = z.object({
duty_name: z.string().describe('Duty Name'),
duty_code: z.string().describe('Duty Code'),
duty_description: z.string().describe('Duty Description'),
});
export type Duty = z.infer<typeof dutySchema>;
/**
* Zod schema for Duties
* Corresponds to the Duties class in Python
*/
export const dutiesSchema = z.object({
users_default_duty: z.number().int().nullable().describe('Default Duty for Users'),
company_id: z.number().int(),
company_uu_id: z.string().describe('Company UUID'),
duties_id: z.number().int(),
duties_uu_id: z.string().describe('Duty UUID'),
department_id: z.number().int().describe('Department ID'),
department_uu_id: z.string().describe('Department UUID'),
management_duty: z.boolean().default(false).describe('Is this a prime Company Duty?'),
});
export type Duties = z.infer<typeof dutiesSchema>;

View File

@ -0,0 +1,55 @@
import { z } from 'zod';
/**
* Zod schema for Staff
* Corresponds to the Staff class in Python
*/
export const staffSchema = z.object({
staff_description: z.string().default('').describe('Staff Description'),
staff_name: z.string().describe('Staff Name'),
staff_code: z.string().describe('Staff Code'),
duties_id: z.number().int(),
duties_uu_id: z.string().describe('Duty UUID'),
});
export type Staff = z.infer<typeof staffSchema>;
/**
* Zod schema for Employees
* Corresponds to the Employees class in Python
*/
export const employeesSchema = z.object({
staff_id: z.number().int(),
staff_uu_id: z.string().describe('Staff UUID'),
people_id: z.number().int().nullable(),
people_uu_id: z.string().nullable().describe('People UUID'),
});
export type Employees = z.infer<typeof employeesSchema>;
/**
* Zod schema for EmployeeHistory
* Corresponds to the EmployeeHistory class in Python
*/
export const employeeHistorySchema = z.object({
staff_id: z.number().int().describe('Staff ID'),
staff_uu_id: z.string().describe('Staff UUID'),
people_id: z.number().int().describe('People ID'),
people_uu_id: z.string().describe('People UUID'),
});
export type EmployeeHistory = z.infer<typeof employeeHistorySchema>;
/**
* Zod schema for EmployeesSalaries
* Corresponds to the EmployeesSalaries class in Python
*/
export const employeesSalariesSchema = z.object({
gross_salary: z.number().describe('Gross Salary'),
net_salary: z.number().describe('Net Salary'),
people_id: z.number().int(),
people_uu_id: z.string().describe('People UUID'),
});
export type EmployeesSalaries = z.infer<typeof employeesSalariesSchema>;

View File

@ -0,0 +1,220 @@
import { z } from 'zod';
/**
* Zod schema for Applications
* Corresponds to the Applications class in Python
*/
export const applicationsSchema = z.object({
name: z.string().describe('Application Name'),
site_url: z.string().describe('Site URL'),
application_code: z.string().describe('Application Code'),
application_type: z.string().describe('Application Type'),
application_for: z.string().default('EMP').describe('Application For'),
description: z.string().describe('Application Description'),
});
export type Applications = z.infer<typeof applicationsSchema>;
/**
* Zod schema for Events
* Corresponds to the Events class in Python
* If Events2Occupants and Events2Employees are not found for user request, response 401 Unauthorized
*/
export const eventsSchema = z.object({
function_code: z.string().describe('function code'),
function_class: z.string().describe('class name'),
description: z.string().default(''),
property_description: z.string().default(''),
marketing_layer: z.number().int().default(3),
cost: z.number().default(0.00),
unit_price: z.number().default(0.00),
endpoint_code: z.string().describe('Event Type'),
endpoint_id: z.number().int().nullable(),
endpoint_uu_id: z.string().nullable().describe('Endpoint UUID'),
});
export type Events = z.infer<typeof eventsSchema>;
/**
* Zod schema for Modules
* Corresponds to the Modules class in Python
*/
export const modulesSchema = z.object({
module_name: z.string().describe('Module Name'),
module_description: z.string().default(''),
module_code: z.string().describe('Module Code'),
module_layer: z.number().int().describe('Module Layer'),
is_default_module: z.boolean().default(false),
});
export type Modules = z.infer<typeof modulesSchema>;
/**
* Zod schema for ModulePrice
* Corresponds to the ModulePrice class in Python
*/
export const modulePriceSchema = z.object({
campaign_code: z.string().describe('Campaign Code'),
module_id: z.number().int(),
module_uu_id: z.string().describe('Module UUID'),
service_id: z.number().int(),
service_uu_id: z.string().describe('Service UUID'),
event_id: z.number().int(),
event_uu_id: z.string().describe('Event UUID'),
is_counted_percentage: z.number().default(0.00),
discounted_price: z.number().default(0.00),
calculated_price: z.number().default(0.00),
});
export type ModulePrice = z.infer<typeof modulePriceSchema>;
/**
* Zod schema for Services
* Corresponds to the Services class in Python
*/
export const servicesSchema = z.object({
module_id: z.number().int(),
module_uu_id: z.string().describe('Module UUID'),
service_name: z.string().describe('Service Name'),
service_description: z.string().default(''),
service_code: z.string().nullable().describe('Service Code'),
related_responsibility: z.string().default(''),
});
export type Services = z.infer<typeof servicesSchema>;
/**
* Zod schema for Service2Events
* Corresponds to the Service2Events class in Python
*/
export const service2EventsSchema = z.object({
service_id: z.number().int(),
service_uu_id: z.string().describe('Service UUID'),
event_id: z.number().int(),
event_uu_id: z.string().describe('Event UUID'),
});
export type Service2Events = z.infer<typeof service2EventsSchema>;
/**
* Zod schema for Service2Application
* Corresponds to the Service2Application class in Python
*/
export const service2ApplicationSchema = z.object({
application_id: z.number().int(),
application_uu_id: z.string().describe('Application UUID'),
service_id: z.number().int(),
service_uu_id: z.string().describe('Service UUID'),
application_code: z.string().describe('Application Code'),
site_url: z.string().describe('Site URL'),
});
export type Service2Application = z.infer<typeof service2ApplicationSchema>;
/**
* Zod schema for Event2OccupantExtra
* Corresponds to the Event2OccupantExtra class in Python
*/
export const event2OccupantExtraSchema = z.object({
build_living_space_id: z.number().int(),
build_living_space_uu_id: z.string().describe('Build Living Space UUID'),
event_id: z.number().int(),
event_uu_id: z.string().describe('Event UUID'),
});
export type Event2OccupantExtra = z.infer<typeof event2OccupantExtraSchema>;
/**
* Zod schema for Event2EmployeeExtra
* Corresponds to the Event2EmployeeExtra class in Python
*/
export const event2EmployeeExtraSchema = z.object({
employee_id: z.number().int(),
employee_uu_id: z.string().describe('Employee UUID'),
event_id: z.number().int(),
event_uu_id: z.string().describe('Event UUID'),
});
export type Event2EmployeeExtra = z.infer<typeof event2EmployeeExtraSchema>;
/**
* Zod schema for Event2Employee
* Corresponds to the Event2Employee class in Python
*/
export const event2EmployeeSchema = z.object({
employee_id: z.number().int(),
employee_uu_id: z.string().describe('Employee UUID'),
event_service_id: z.number().int(),
event_service_uu_id: z.string().describe('Event Cluster UUID'),
});
export type Event2Employee = z.infer<typeof event2EmployeeSchema>;
/**
* Zod schema for Event2Occupant
* Corresponds to the Event2Occupant class in Python
*/
export const event2OccupantSchema = z.object({
build_living_space_id: z.number().int(),
build_living_space_uu_id: z.string().describe('Build Living Space UUID'),
event_service_id: z.number().int(),
event_service_uu_id: z.string().describe('Event Cluster UUID'),
});
export type Event2Occupant = z.infer<typeof event2OccupantSchema>;
/**
* Zod schema for Application2Employee
* Corresponds to the Application2Employee class in Python
*/
export const application2EmployeeSchema = z.object({
employee_id: z.number().int(),
employee_uu_id: z.string().describe('Employee UUID'),
service_id: z.number().int(),
service_uu_id: z.string().describe('Service UUID'),
});
export type Application2Employee = z.infer<typeof application2EmployeeSchema>;
/**
* Zod schema for Application2Occupant
* Corresponds to the Application2Occupant class in Python
*/
export const application2OccupantSchema = z.object({
build_living_space_id: z.number().int(),
build_living_space_uu_id: z.string().describe('Build Living Space UUID'),
service_id: z.number().int(),
service_uu_id: z.string().describe('Service UUID'),
});
export type Application2Occupant = z.infer<typeof application2OccupantSchema>;
/**
* Zod schema for Application2EmployeeExtra
* Corresponds to the Application2EmployeeExtra class in Python
*/
export const application2EmployeeExtraSchema = z.object({
employee_id: z.number().int(),
employee_uu_id: z.string().describe('Employee UUID'),
application_id: z.number().int(),
application_uu_id: z.string().describe('Application UUID'),
site_url: z.string().describe('Site URL'),
application_code: z.string().describe('Application Code'),
});
export type Application2EmployeeExtra = z.infer<typeof application2EmployeeExtraSchema>;
/**
* Zod schema for Application2OccupantExtra
* Corresponds to the Application2OccupantExtra class in Python
*/
export const application2OccupantExtraSchema = z.object({
build_living_space_id: z.number().int(),
build_living_space_uu_id: z.string().describe('Build Living Space UUID'),
application_id: z.number().int(),
application_uu_id: z.string().describe('Application UUID'),
site_url: z.string().describe('Site URL'),
application_code: z.string().describe('Application Code'),
});
export type Application2OccupantExtra = z.infer<typeof application2OccupantExtraSchema>;

View File

@ -0,0 +1,130 @@
import { z } from 'zod';
/**
* Zod schema for UsersTokens
* Corresponds to the UsersTokens class in Python
*/
export const usersTokensSchema = z.object({
user_id: z.number().int(),
token_type: z.string().default('RememberMe'),
token: z.string().default(''),
domain: z.string().default(''),
expires_at: z.string().datetime(),
});
export type UsersTokens = z.infer<typeof usersTokensSchema>;
/**
* Zod schema for Credentials
* Corresponds to the Credentials class in Python
*/
export const credentialsSchema = z.object({
credential_token: z.string().default('').describe('Credential token for authentication'),
user_id: z.number().int().describe('Foreign key to users table'),
user_uu_id: z.string().default('').describe('User UUID'),
person_id: z.number().int().describe('Foreign key to person table'),
person_uu_id: z.string().default('').describe('Person UUID'),
name: z.string().default('').describe('Name of the user'),
surname: z.string().default('').describe('Surname of the user'),
email: z.string().default('').describe('Email address of the user'),
phone: z.string().default('').describe('Phone number of the user'),
is_verified: z.boolean().default(false).describe('Flag to check if user is verified'),
});
export type Credentials = z.infer<typeof credentialsSchema>;
/**
* Zod schema for Users
* Corresponds to the Users class in Python
* Application User frame to connect to API with assigned token-based HTTP connection
*/
export const usersSchema = z.object({
user_tag: z.string().max(64).default('').describe('Unique tag for the user'),
email: z.string().max(128).default('').describe('Email address of the user'),
phone_number: z.string().default('').describe('Phone number of the user'),
via: z.string().default('111').describe('Email 1/ Phone 2/ User Tag 3 All 111 Only 100'),
avatar: z.string().default('').describe('Avatar URL for the user'),
hash_password: z.string().max(256).default('').describe('Hashed password for security'),
password_token: z.string().max(256).default('').describe('Token for password reset'),
remember_me: z.boolean().default(false).describe('Flag to remember user login'),
password_expires_day: z.number().int().default(30).describe('Password expires in days'),
password_expiry_begins: z.string().datetime().describe('Timestamp when password expiry begins'),
related_company: z.string().describe('Related Company UUID'),
person_id: z.number().int().describe('Foreign key to person table'),
person_uu_id: z.string().default('').describe('Person UUID'),
local_timezone: z.string().default('GMT+3').describe('Local timezone of user'),
default_language: z.string().default('tr').describe('Default language of user'),
});
export type Users = z.infer<typeof usersSchema>;
/**
* Zod schema for RelationshipDutyPeople
* Corresponds to the RelationshipDutyPeople class in Python
*/
export const relationshipDutyPeopleSchema = z.object({
company_id: z.number().int(),
duties_id: z.number().int(),
member_id: z.number().int(),
relationship_type: z.string().default('Employee'),
show_only: z.boolean().default(false),
});
export type RelationshipDutyPeople = z.infer<typeof relationshipDutyPeopleSchema>;
/**
* Zod schema for People
* Corresponds to the People class in Python
* People that are related to users in the application
*/
export const peopleSchema = z.object({
firstname: z.string().describe('First name of the person'),
surname: z.string().max(24).describe('Surname of the person'),
middle_name: z.string().default('').describe('Middle name of the person'),
sex_code: z.string().max(1).describe('Sex code of the person (e.g., M/F)'),
person_ref: z.string().default('').describe('Reference ID for the person'),
person_tag: z.string().default('').describe('Unique tag for the person'),
father_name: z.string().default('').describe('Father\'s name of the person'),
mother_name: z.string().default('').describe('Mother\'s name of the person'),
country_code: z.string().max(4).default('TR').describe('Country code of the person'),
national_identity_id: z.string().default('').describe('National identity ID of the person'),
birth_place: z.string().default('').describe('Birth place of the person'),
birth_date: z.string().datetime().default('1900-01-01').describe('Birth date of the person'),
tax_no: z.string().default('').describe('Tax number of the person'),
});
export type People = z.infer<typeof peopleSchema>;
/**
* Zod schema for OccupantTypes
* Corresponds to the OccupantTypes class in Python
*/
export const occupantTypesSchema = z.object({
occupant_type: z.string().describe('Occupant Type'),
occupant_description: z.string().default(''),
occupant_code: z.string().default(''),
occupant_category: z.string().default(''),
occupant_category_type: z.string().default(''),
occupant_is_unique: z.boolean().default(false),
});
export type OccupantTypes = z.infer<typeof occupantTypesSchema>;
/**
* Zod schema for Contracts
* Corresponds to the Contracts class in Python
*/
export const contractsSchema = z.object({
contract_type: z.string().max(5).describe('The code for personnel is P and the code for companies is C.'),
contract_title: z.string().max(255),
contract_details: z.string(),
contract_terms: z.string(),
contract_code: z.string().max(100).describe('contract_code is the unique code given by the system.'),
contract_date: z.string().datetime().default('2099-12-31 23:59:59').describe('contract date is the date the contract is made. expire start is the start date of the contract, expire en is the end date of the contract.'),
company_id: z.number().int().nullable(),
company_uu_id: z.string().default('').describe('Company UUID'),
person_id: z.number().int().nullable(),
person_uu_id: z.string().default('').describe('Person UUID'),
});
export type Contracts = z.infer<typeof contractsSchema>;

View File

@ -0,0 +1,17 @@
import { z } from 'zod';
/**
* Zod schema for ApiEnumDropdown
* Corresponds to the ApiEnumDropdown class in Python
* Represents enum objects that are linked to tables
*/
export const apiEnumDropdownSchema = z.object({
id: z.number().int(),
uu_id: z.string().uuid(),
enum_class: z.string().describe('Enum Constant Name'),
key: z.string().describe('Enum Key'),
value: z.string().describe('Enum Value'),
description: z.string().nullable(),
});
export type ApiEnumDropdown = z.infer<typeof apiEnumDropdownSchema>;

View File

@ -0,0 +1,16 @@
import { z } from 'zod';
/**
* Zod schema for EndpointRestriction
* Corresponds to the EndpointRestriction class in Python
* Initialize Endpoint Restriction with default values
*/
export const endpointRestrictionSchema = z.object({
operation_uu_id: z.string().uuid().describe('UUID of the operation'),
endpoint_function: z.string().describe('Function name of the API endpoint'),
endpoint_name: z.string().describe('Name of the API endpoint'),
endpoint_method: z.string().describe('HTTP method used by the endpoint'),
endpoint_desc: z.string().default('').describe('Description of the endpoint'),
});
export type EndpointRestriction = z.infer<typeof endpointRestrictionSchema>;