Skip to content

Instantly share code, notes, and snippets.

View Maqq91's full-sized avatar
🎯
Focusing

PoC3 Maqq91

🎯
Focusing
View GitHub Profile
@Maqq91
Maqq91 / Utils
Last active July 30, 2025 09:55
Utils
/**
* address-utils.ts
*
* Utility functions for extracting, transforming, and displaying address-related
* metadata and qualifications from a TariffNode.
*
* Includes:
* - Gathering all dictionary IDs used for address fields (province, district, etc.)
* - Collecting ZIP code qualifications for display
* - Mapping address lookup API responses to dictionary maps
@Maqq91
Maqq91 / Store
Last active July 30, 2025 09:56
Store
import { createActionGroup, props } from '@ngrx/store';
import { ContractManagerResponseDto, HttpHeadersSchemaDto } from '../../models';
/**
* ContractManagerActions
* ----------------------
* Strongly-typed, event-driven actions for contract data lifecycle management.
* Powers all asynchronous flows: loading contract data, propagating success, and (optionally) error handling.
*
* @core
@Maqq91
Maqq91 / Serwisy
Last active July 30, 2025 09:59
Serwisy
import { HttpClient } from '@angular/common/http';
import { Injectable } from '@angular/core';
import {
EnvironmentManagerService,
UniversalActionFormEnv,
} from '@angular/environment';
import { Observable } from 'rxjs';
import { CONTRACT_MANAGER_API_ENDPOINTS } from '../../constants/api/contract-manager.endpoints';
import { ContractManagerResponseDto, HttpHeadersSchemaDto } from '../../models';
@Maqq91
Maqq91 / Modules
Last active July 30, 2025 09:58
Modules
import { CommonModule } from '@angular/common';
import { NgModule } from '@angular/core';
import { CustomersSectionComponent } from './steps/customers-section/customers-section.component';
import { ObjectsSectionComponent } from './steps/object-section/object-section.component';
import { PackagesSectionComponent } from './steps/packages-section/packages-section.component';
import { ProductsSectionComponent } from './steps/products-section/products-section.component';
import { ReviewSectionComponent } from './steps/review-section/review-section.component';
import { SummarySectionComponent } from './steps/summary-section/summary-section.component';
import { MaterialModule } from '../shared/material/material.module';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
@Maqq91
Maqq91 / Modele
Last active July 30, 2025 09:59
Modele
export const ACTION_FORM_API_ENDPOINTS = {
getActionForm: (contractId: number): string =>
`/api/actions-save-au-actions/${contractId}`,
};
export const CONTRACT_MANAGER_API_ENDPOINTS = {
getContracts: (contractId: number): string =>
`/api/v1/contracts/${contractId}`,
};
@Maqq91
Maqq91 / Komponenty
Last active July 30, 2025 10:00
Komponenty
<h2 mat-dialog-title>Dodaj pojazdu</h2>
<mat-dialog-content>
<form [formGroup]="vehicleForm" class="grid grid-cols-1 md:grid-cols-2 gap-4">
<!-- Rodzaj pojazdu -->
<mat-form-field appearance="fill">
<mat-label>Rodzaj pojazdu</mat-label>
<mat-select formControlName="vehicleType" required>
<mat-option *ngFor="let opt of data.typeOptions" [value]="opt.id">