Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- fetchCAWRecords(
- person,
- poi,
- warningCheckbox,
- exceptionsOnlyCheckbox,
- pplWithMissingDocs,
- nonAdminStatusCheckbox,
- cawFromDate,
- cawToDate
- ) {
- let params = NEW HttpParams();
- params = params.SET('was_here_before', warningCheckbox);
- params = params.SET('exceptions_only', exceptionsOnlyCheckbox);
- params = params.SET('show_non_admin_status_only', nonAdminStatusCheckbox);
- params = params.SET('display_only_ppl_missing_docs', pplWithMissingDocs);
- IF (person) {
- params = params.SET('person_id', person.person_id);
- }
- IF (poi) {
- params = params.SET('poi_id', poi.poi_id);
- }
- params = params.SET('history_from', cawFromDate);
- params = params.SET('history_to', cawToDate);
- this.http
- .get<StandardORDSGETResponse<PoiRegistration>>(
- `${this.dataBaseService.ordsTraxxeoURL}tracking/checkin`,
- { params }
- )
- .subscribe((caws) => {
- caws.items.forEach((item) => this.parseCAW(item));
- const itemsWithSelected = caws.items.map((item) => ({
- ...item,
- selected: FALSE
- }));
- const store = NEW Store({ modelClass: PoiRegistrationModel });
- store.add(
- NEW PoiRegistrationModel({
- work_date: NULL,
- social_office_transaction_id: NULL,
- poi_tin: NULL,
- wbs_id: NULL,
- so_transaction_status_name: NULL,
- creation_date: NULL,
- creation_user_name: NULL,
- so_creation_number: NULL,
- cancel_date: NULL,
- cancellation_user_name: NULL,
- so_cancellation_number: NULL,
- so_transaction_status_id: NULL,
- company_nr: NULL,
- person_id: NULL,
- first_name: NULL,
- last_name: NULL,
- creation_gui_user_id: NULL,
- cancellation_gui_user_id: NULL,
- sot_person_id: NULL,
- sot_wbs_id: NULL,
- day_string: NULL,
- day_nr: NULL,
- ref_number: NULL,
- creation_date_with_time_zone: NULL,
- cancel_date_with_time_zone: NULL,
- timezone: NULL,
- operation_center_id: NULL,
- person_category_name: NULL,
- vo_person_category_id: NULL,
- graphical_symbol: NULL,
- person_groups: NULL,
- start_time: NULL,
- duration: NULL,
- end_time: NULL,
- is_start_time_set: NULL,
- work_date_with_time_zone: NULL,
- so_comment: NULL,
- plan_mode: NULL,
- person_company_name: NULL,
- poi_name: NULL,
- poi_id: NULL,
- gui_user_id: NULL,
- gp_person_id: NULL,
- gp_gui_user_id: NULL,
- work_date_str: NULL,
- is_admin_status_ok: NULL,
- admin_status_category_str: NULL,
- description: NULL,
- doc_id_be: NULL,
- doc_sii: NULL,
- doc_lc: NULL,
- doc_limosa: NULL,
- doc_a1: NULL,
- doc_dim_or_cb: NULL,
- doc_id_xx: NULL,
- sot_status_desc: NULL,
- doc_dim: NULL,
- doc_cb: NULL,
- doc_annexxe: NULL,
- apc_proof_of_identity: NULL,
- apc_proof_of_residence: NULL,
- apc_proof_of_work: NULL,
- admin_profile_category: NULL,
- is_blacklisted: NULL,
- person_all_admin_attach_doc_validated: NULL,
- month_nr: NULL,
- company_name: NULL,
- vehicle_owner_id: NULL,
- real_employer_name: NULL,
- real_employer_tin: NULL,
- sot_admin_remark_translation: NULL,
- sot_remark_exist: NULL,
- rank1_sc_name: NULL,
- rank1_sc_tin: NULL,
- apc_covid: NULL,
- is_on_site: NULL,
- is_using_caw_robot: NULL,
- text: NULL,
- VALUE: NULL,
- name: NULL,
- unfiltered: NULL,
- selected: NULL
- })
- );
- store.removeAll();
- // store.add(caws.items);
- store.add(itemsWithSelected);
- store.COMMIT();
- this._cawStore.next(store);
- this.setIsFetching(FALSE);
- });
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement