Commit inicial - upload de todos os arquivos da pasta
This commit is contained in:
0
src/types/.gitkeep
Normal file
0
src/types/.gitkeep
Normal file
58
src/types/allocation-template.types.ts
Normal file
58
src/types/allocation-template.types.ts
Normal file
@@ -0,0 +1,58 @@
|
||||
import type { SprintType } from './sprint.types';
|
||||
|
||||
export interface AllocationTemplateListItem {
|
||||
id: string;
|
||||
sprintType: SprintType;
|
||||
isActive: boolean;
|
||||
createdAt: string;
|
||||
updatedAt: string;
|
||||
contractItem: { id: string; code: string; name: string };
|
||||
_count: { items: number };
|
||||
}
|
||||
|
||||
export interface AllocationTemplateItem {
|
||||
id: string;
|
||||
quantity: number;
|
||||
allocationPercentage: number;
|
||||
profile: { id: string; name: string };
|
||||
}
|
||||
|
||||
export interface AllocationTemplateDetail {
|
||||
id: string;
|
||||
sprintType: SprintType;
|
||||
isActive: boolean;
|
||||
createdAt: string;
|
||||
updatedAt: string;
|
||||
contractItem: { id: string; code: string; name: string };
|
||||
items: AllocationTemplateItem[];
|
||||
}
|
||||
|
||||
export interface AllocationTemplatesListResponse {
|
||||
data: AllocationTemplateListItem[];
|
||||
total: number;
|
||||
page: number;
|
||||
limit: number;
|
||||
}
|
||||
|
||||
export interface AllocationTemplateFilters {
|
||||
sprintType?: SprintType;
|
||||
contractItemId?: string;
|
||||
page: number;
|
||||
limit: number;
|
||||
}
|
||||
|
||||
export interface CreateAllocationTemplateItemRequest {
|
||||
profileId: string;
|
||||
quantity: number;
|
||||
allocationPercentage: number;
|
||||
}
|
||||
|
||||
export interface CreateAllocationTemplateRequest {
|
||||
sprintType: SprintType;
|
||||
contractItemId: string;
|
||||
items: CreateAllocationTemplateItemRequest[];
|
||||
}
|
||||
|
||||
export interface UpdateAllocationTemplateRequest {
|
||||
items: CreateAllocationTemplateItemRequest[];
|
||||
}
|
||||
39
src/types/auth.types.ts
Normal file
39
src/types/auth.types.ts
Normal file
@@ -0,0 +1,39 @@
|
||||
export type UserRole =
|
||||
| 'ADMIN'
|
||||
| 'GESTOR_PROJETOS'
|
||||
| 'PO'
|
||||
| 'FISCAL_CONTRATO'
|
||||
| 'GESTOR_CONTRATO';
|
||||
|
||||
export const ISIS_ROLES = ['ADMIN', 'GESTOR_PROJETOS'] as const satisfies readonly UserRole[];
|
||||
export const CLIENT_ROLES = ['PO', 'FISCAL_CONTRATO', 'GESTOR_CONTRATO'] as const satisfies readonly UserRole[];
|
||||
|
||||
export interface User {
|
||||
id: string;
|
||||
name: string;
|
||||
email: string;
|
||||
role: UserRole;
|
||||
mustChangePassword?: boolean;
|
||||
clientId?: string | null;
|
||||
}
|
||||
|
||||
export interface AuthState {
|
||||
user: User | null;
|
||||
token: string | null;
|
||||
isAuthenticated: boolean;
|
||||
}
|
||||
|
||||
export interface LoginRequest {
|
||||
email: string;
|
||||
password: string;
|
||||
}
|
||||
|
||||
export interface LoginResponse {
|
||||
accessToken: string;
|
||||
user: User;
|
||||
}
|
||||
|
||||
export interface ChangePasswordRequest {
|
||||
currentPassword: string;
|
||||
newPassword: string;
|
||||
}
|
||||
35
src/types/client-profile.types.ts
Normal file
35
src/types/client-profile.types.ts
Normal file
@@ -0,0 +1,35 @@
|
||||
export interface ClientProfileListItem {
|
||||
id: string;
|
||||
name: string;
|
||||
isActive: boolean;
|
||||
createdAt: string;
|
||||
updatedAt: string;
|
||||
client: { id: string; name: string };
|
||||
}
|
||||
|
||||
export interface ClientProfilesListResponse {
|
||||
data: ClientProfileListItem[];
|
||||
total: number;
|
||||
page: number;
|
||||
limit: number;
|
||||
}
|
||||
|
||||
export interface ClientProfileFilters {
|
||||
search?: string;
|
||||
isActive?: string;
|
||||
page: number;
|
||||
limit: number;
|
||||
}
|
||||
|
||||
export interface ClientProfileActiveItem {
|
||||
id: string;
|
||||
name: string;
|
||||
}
|
||||
|
||||
export interface CreateClientProfileRequest {
|
||||
name: string;
|
||||
}
|
||||
|
||||
export interface UpdateClientProfileRequest {
|
||||
name?: string;
|
||||
}
|
||||
39
src/types/client.types.ts
Normal file
39
src/types/client.types.ts
Normal file
@@ -0,0 +1,39 @@
|
||||
export interface ClientListItem {
|
||||
id: string;
|
||||
name: string;
|
||||
document: string | null;
|
||||
email: string | null;
|
||||
phone: string | null;
|
||||
contactName: string | null;
|
||||
description: string | null;
|
||||
isActive: boolean;
|
||||
createdAt: string;
|
||||
updatedAt: string;
|
||||
}
|
||||
|
||||
export interface ClientsListResponse {
|
||||
data: ClientListItem[];
|
||||
total: number;
|
||||
page: number;
|
||||
limit: number;
|
||||
}
|
||||
|
||||
export interface ClientsFilters {
|
||||
search?: string;
|
||||
isActive?: string;
|
||||
page: number;
|
||||
limit: number;
|
||||
}
|
||||
|
||||
export interface CreateClientRequest {
|
||||
name: string;
|
||||
document?: string;
|
||||
email?: string;
|
||||
phone?: string;
|
||||
contactName?: string;
|
||||
description?: string;
|
||||
}
|
||||
|
||||
export interface UpdateClientRequest extends Partial<CreateClientRequest> {
|
||||
isActive?: boolean;
|
||||
}
|
||||
71
src/types/contract-item.types.ts
Normal file
71
src/types/contract-item.types.ts
Normal file
@@ -0,0 +1,71 @@
|
||||
export const ContractItemType = {
|
||||
UST: 'UST',
|
||||
SAAS_LICENSE: 'SAAS_LICENSE',
|
||||
} as const;
|
||||
export type ContractItemType = (typeof ContractItemType)[keyof typeof ContractItemType];
|
||||
|
||||
export interface ContractItemListItem {
|
||||
id: string;
|
||||
code: string;
|
||||
name: string;
|
||||
description: string | null;
|
||||
itemType: ContractItemType;
|
||||
totalUst: number;
|
||||
ustValue: number | null;
|
||||
timeboxDescoberta: number | null;
|
||||
timeboxDesign: number | null;
|
||||
timeboxArquitetura: number | null;
|
||||
timeboxConstrucao: number | null;
|
||||
isActive: boolean;
|
||||
createdAt: string;
|
||||
updatedAt: string;
|
||||
client: {
|
||||
id: string;
|
||||
name: string;
|
||||
};
|
||||
}
|
||||
|
||||
export interface ContractItemsListResponse {
|
||||
data: ContractItemListItem[];
|
||||
total: number;
|
||||
page: number;
|
||||
limit: number;
|
||||
}
|
||||
|
||||
export interface ContractItemFilters {
|
||||
search?: string;
|
||||
isActive?: string;
|
||||
itemType?: ContractItemType;
|
||||
page: number;
|
||||
limit: number;
|
||||
}
|
||||
|
||||
export interface ContractItemActiveItem {
|
||||
id: string;
|
||||
code: string;
|
||||
name: string;
|
||||
itemType: ContractItemType;
|
||||
totalUst: number;
|
||||
ustValue: number | null;
|
||||
timeboxDescoberta: number | null;
|
||||
timeboxDesign: number | null;
|
||||
timeboxArquitetura: number | null;
|
||||
timeboxConstrucao: number | null;
|
||||
}
|
||||
|
||||
export interface CreateContractItemRequest {
|
||||
code: string;
|
||||
name: string;
|
||||
description?: string;
|
||||
itemType: ContractItemType;
|
||||
totalUst: number;
|
||||
ustValue?: number;
|
||||
timeboxDescoberta?: number;
|
||||
timeboxDesign?: number;
|
||||
timeboxArquitetura?: number;
|
||||
timeboxConstrucao?: number;
|
||||
}
|
||||
|
||||
export interface UpdateContractItemRequest extends Partial<CreateContractItemRequest> {
|
||||
isActive?: boolean;
|
||||
}
|
||||
44
src/types/contract.types.ts
Normal file
44
src/types/contract.types.ts
Normal file
@@ -0,0 +1,44 @@
|
||||
export interface ContractListItem {
|
||||
id: string;
|
||||
name: string;
|
||||
code: string | null;
|
||||
description: string | null;
|
||||
startDate: string | null;
|
||||
endDate: string | null;
|
||||
ustValue: number | null;
|
||||
isActive: boolean;
|
||||
createdAt: string;
|
||||
updatedAt: string;
|
||||
client: {
|
||||
id: string;
|
||||
name: string;
|
||||
};
|
||||
}
|
||||
|
||||
export interface ContractsListResponse {
|
||||
data: ContractListItem[];
|
||||
total: number;
|
||||
page: number;
|
||||
limit: number;
|
||||
}
|
||||
|
||||
export interface ContractsFilters {
|
||||
search?: string;
|
||||
isActive?: string;
|
||||
page: number;
|
||||
limit: number;
|
||||
}
|
||||
|
||||
export interface CreateContractRequest {
|
||||
name: string;
|
||||
clientId: string;
|
||||
code?: string;
|
||||
description?: string;
|
||||
startDate?: string;
|
||||
endDate?: string;
|
||||
ustValue?: number;
|
||||
}
|
||||
|
||||
export interface UpdateContractRequest extends Partial<CreateContractRequest> {
|
||||
isActive?: boolean;
|
||||
}
|
||||
51
src/types/dashboard.types.ts
Normal file
51
src/types/dashboard.types.ts
Normal file
@@ -0,0 +1,51 @@
|
||||
import type { DeliverableStatus, TimelineEventType } from './deliverable.types';
|
||||
|
||||
export interface DashboardSummary {
|
||||
totalDeliverables: number;
|
||||
countByStatus: Partial<Record<DeliverableStatus, number>>;
|
||||
inProgress: number;
|
||||
awaitingValidation: number;
|
||||
recentlyCreated: number;
|
||||
}
|
||||
|
||||
export interface RecentDeliverable {
|
||||
id: string;
|
||||
code: string;
|
||||
title: string;
|
||||
status: DeliverableStatus;
|
||||
project: { name: string };
|
||||
client: { name: string };
|
||||
updatedAt: string;
|
||||
}
|
||||
|
||||
export interface TopValueDeliverable {
|
||||
id: string;
|
||||
code: string;
|
||||
title: string;
|
||||
status: DeliverableStatus;
|
||||
totalValue: number;
|
||||
client: { name: string };
|
||||
}
|
||||
|
||||
export interface BillingSummary {
|
||||
totalBilled: number;
|
||||
awaitingPayment: number;
|
||||
inProgress: number;
|
||||
approved: number;
|
||||
topValueDeliverables: TopValueDeliverable[];
|
||||
}
|
||||
|
||||
export interface DashboardFilter {
|
||||
startDate?: string;
|
||||
endDate?: string;
|
||||
}
|
||||
|
||||
export interface RecentActivity {
|
||||
id: string;
|
||||
type: TimelineEventType;
|
||||
title: string;
|
||||
description: string | null;
|
||||
createdAt: string;
|
||||
createdBy: string | null;
|
||||
deliverable: { id: string; code: string; title: string };
|
||||
}
|
||||
291
src/types/deliverable.types.ts
Normal file
291
src/types/deliverable.types.ts
Normal file
@@ -0,0 +1,291 @@
|
||||
import type { DeliverableType } from '../constants/deliverable-type';
|
||||
import type { ContractItemType } from './contract-item.types';
|
||||
|
||||
export const DeliverableStatus = {
|
||||
RASCUNHO: 'RASCUNHO',
|
||||
EMITIDA: 'EMITIDA',
|
||||
EM_EXECUCAO: 'EM_EXECUCAO',
|
||||
AGUARDANDO_VALIDACAO: 'AGUARDANDO_VALIDACAO',
|
||||
EM_REVISAO: 'EM_REVISAO',
|
||||
APROVADA: 'APROVADA',
|
||||
GLOSADA: 'GLOSADA',
|
||||
ENCERRADA: 'ENCERRADA',
|
||||
CANCELADA: 'CANCELADA',
|
||||
AGUARDANDO_PAGAMENTO: 'AGUARDANDO_PAGAMENTO',
|
||||
PAGA: 'PAGA',
|
||||
} as const;
|
||||
|
||||
export type DeliverableStatus = (typeof DeliverableStatus)[keyof typeof DeliverableStatus];
|
||||
|
||||
export interface DeliverableListItem {
|
||||
id: string;
|
||||
code: string;
|
||||
title: string;
|
||||
status: DeliverableStatus;
|
||||
type: DeliverableType;
|
||||
workOrderId: string;
|
||||
workOrder?: { id: string; code: string; name: string; status: string } | null;
|
||||
client: { id: string; name: string };
|
||||
contract: { id: string; name: string };
|
||||
project: { id: string; name: string };
|
||||
contractItem: {
|
||||
id: string;
|
||||
name: string;
|
||||
code: string;
|
||||
itemType: ContractItemType;
|
||||
ustValue: number | null;
|
||||
timeboxDescoberta: number | null;
|
||||
timeboxDesign: number | null;
|
||||
timeboxArquitetura: number | null;
|
||||
timeboxConstrucao: number | null;
|
||||
} | null;
|
||||
sprint: {
|
||||
id: string;
|
||||
name: string;
|
||||
startDate: string;
|
||||
endDate: string;
|
||||
} | null;
|
||||
startDate: string | null;
|
||||
expectedEndDate: string | null;
|
||||
numWeeks: number;
|
||||
timeboxManutencao: number | null;
|
||||
ustValue: number | null;
|
||||
ustQuantity: number | null;
|
||||
totalValue: number | null;
|
||||
createdAt: string;
|
||||
}
|
||||
|
||||
export interface DeliverableDetail extends DeliverableListItem {
|
||||
description: string | null;
|
||||
isActive: boolean;
|
||||
updatedAt: string;
|
||||
createdBy: string | null;
|
||||
updatedBy: string | null;
|
||||
_count: {
|
||||
assignments: number;
|
||||
backlogItems: number;
|
||||
notes: number;
|
||||
allocations: number;
|
||||
};
|
||||
statusHistory: Array<{
|
||||
previousStatus: DeliverableStatus | null;
|
||||
newStatus: DeliverableStatus;
|
||||
createdAt: string;
|
||||
}>;
|
||||
}
|
||||
|
||||
export interface DeliverablesListResponse {
|
||||
data: DeliverableListItem[];
|
||||
total: number;
|
||||
page: number;
|
||||
limit: number;
|
||||
}
|
||||
|
||||
export interface DeliverablesFilters {
|
||||
search?: string;
|
||||
status?: DeliverableStatus;
|
||||
type?: DeliverableType;
|
||||
clientId?: string;
|
||||
projectId?: string;
|
||||
sprintId?: string;
|
||||
workOrderId?: string;
|
||||
page: number;
|
||||
limit: number;
|
||||
}
|
||||
|
||||
export interface CreateDeliverableRequest {
|
||||
title: string;
|
||||
code: string;
|
||||
workOrderId: string;
|
||||
type: DeliverableType;
|
||||
projectId: string;
|
||||
sprintId: string;
|
||||
startDate: string;
|
||||
expectedEndDate: string;
|
||||
timeboxManutencao?: number;
|
||||
description?: string;
|
||||
}
|
||||
|
||||
export interface UpdateDeliverableRequest {
|
||||
title?: string;
|
||||
code?: string;
|
||||
type?: DeliverableType;
|
||||
projectId?: string;
|
||||
sprintId?: string;
|
||||
timeboxManutencao?: number | null;
|
||||
description?: string;
|
||||
startDate?: string;
|
||||
expectedEndDate?: string;
|
||||
}
|
||||
|
||||
export interface ChangeStatusRequest {
|
||||
status: DeliverableStatus;
|
||||
observation?: string;
|
||||
}
|
||||
|
||||
export interface ChangeStatusResponse extends DeliverableDetail {
|
||||
lowBalanceWarning?: boolean;
|
||||
}
|
||||
|
||||
export interface StatusHistoryItem {
|
||||
id: string;
|
||||
deliverableId: string;
|
||||
previousStatus: DeliverableStatus | null;
|
||||
newStatus: DeliverableStatus;
|
||||
observation: string | null;
|
||||
createdAt: string;
|
||||
createdBy: string | null;
|
||||
}
|
||||
|
||||
export interface AssignmentListItem {
|
||||
id: string;
|
||||
professional: { id: string; name: string; role: string | null };
|
||||
role: string | null;
|
||||
startDate: string | null;
|
||||
endDate: string | null;
|
||||
observation: string | null;
|
||||
}
|
||||
|
||||
export interface CreateAssignmentRequest {
|
||||
professionalId: string;
|
||||
role: string;
|
||||
startDate?: string;
|
||||
endDate?: string;
|
||||
observation?: string;
|
||||
}
|
||||
|
||||
export interface UpdateAssignmentRequest {
|
||||
role?: string;
|
||||
startDate?: string;
|
||||
endDate?: string;
|
||||
observation?: string;
|
||||
}
|
||||
|
||||
// Backlog
|
||||
|
||||
export const BacklogItemStatus = {
|
||||
PENDENTE: 'PENDENTE',
|
||||
ACEITO: 'ACEITO',
|
||||
REJEITADO: 'REJEITADO',
|
||||
} as const;
|
||||
|
||||
export type BacklogItemStatus = (typeof BacklogItemStatus)[keyof typeof BacklogItemStatus];
|
||||
|
||||
export interface BacklogItem {
|
||||
id: string;
|
||||
deliverableId: string;
|
||||
title: string;
|
||||
description: string | null;
|
||||
acceptanceCriteria: string | null;
|
||||
status: BacklogItemStatus;
|
||||
rejectionReason: string | null;
|
||||
sortOrder: number;
|
||||
isActive: boolean;
|
||||
createdAt: string;
|
||||
updatedAt: string;
|
||||
createdBy: string | null;
|
||||
updatedBy: string | null;
|
||||
}
|
||||
|
||||
export interface CreateBacklogItemRequest {
|
||||
title: string;
|
||||
description?: string;
|
||||
acceptanceCriteria?: string;
|
||||
}
|
||||
|
||||
export interface UpdateBacklogItemRequest {
|
||||
title?: string;
|
||||
description?: string;
|
||||
acceptanceCriteria?: string;
|
||||
}
|
||||
|
||||
export interface ReorderBacklogRequest {
|
||||
items: { id: string; sortOrder: number }[];
|
||||
}
|
||||
|
||||
export interface ChangeBacklogStatusRequest {
|
||||
status: BacklogItemStatus;
|
||||
rejectionReason?: string;
|
||||
}
|
||||
|
||||
// Timeline
|
||||
|
||||
export const TimelineEventType = {
|
||||
CRIACAO: 'CRIACAO',
|
||||
EDICAO: 'EDICAO',
|
||||
STATUS_CHANGE: 'STATUS_CHANGE',
|
||||
ASSIGNMENT: 'ASSIGNMENT',
|
||||
BACKLOG: 'BACKLOG',
|
||||
ANOTACAO: 'ANOTACAO',
|
||||
ALOCACAO: 'ALOCACAO',
|
||||
VALOR_RECALCULADO: 'VALOR_RECALCULADO',
|
||||
} as const;
|
||||
|
||||
export type TimelineEventType = (typeof TimelineEventType)[keyof typeof TimelineEventType];
|
||||
|
||||
export interface TimelineEvent {
|
||||
id: string;
|
||||
deliverableId: string;
|
||||
type: TimelineEventType;
|
||||
title: string;
|
||||
description: string | null;
|
||||
metadata: Record<string, unknown> | null;
|
||||
createdAt: string;
|
||||
createdBy: string | null;
|
||||
}
|
||||
|
||||
export interface TimelineFilters {
|
||||
type?: TimelineEventType;
|
||||
page?: number;
|
||||
limit?: number;
|
||||
}
|
||||
|
||||
export interface TimelineListResponse {
|
||||
data: TimelineEvent[];
|
||||
total: number;
|
||||
page: number;
|
||||
limit: number;
|
||||
}
|
||||
|
||||
// Notes
|
||||
|
||||
export const NoteType = {
|
||||
OBSERVACAO: 'OBSERVACAO',
|
||||
RISCO: 'RISCO',
|
||||
IMPEDIMENTO: 'IMPEDIMENTO',
|
||||
DECISAO: 'DECISAO',
|
||||
} as const;
|
||||
|
||||
export type NoteType = (typeof NoteType)[keyof typeof NoteType];
|
||||
|
||||
export interface NoteItem {
|
||||
id: string;
|
||||
deliverableId: string;
|
||||
type: NoteType;
|
||||
title: string;
|
||||
description: string | null;
|
||||
isRelevant: boolean;
|
||||
isActive: boolean;
|
||||
createdAt: string;
|
||||
updatedAt: string;
|
||||
createdBy: string | null;
|
||||
updatedBy: string | null;
|
||||
}
|
||||
|
||||
export interface CreateNoteRequest {
|
||||
type: NoteType;
|
||||
title: string;
|
||||
description?: string;
|
||||
isRelevant?: boolean;
|
||||
}
|
||||
|
||||
export interface UpdateNoteRequest {
|
||||
type?: NoteType;
|
||||
title?: string;
|
||||
description?: string;
|
||||
isRelevant?: boolean;
|
||||
}
|
||||
|
||||
export interface NotesFilters {
|
||||
type?: NoteType;
|
||||
}
|
||||
29
src/types/os-allocation.types.ts
Normal file
29
src/types/os-allocation.types.ts
Normal file
@@ -0,0 +1,29 @@
|
||||
export interface OSAllocationListItem {
|
||||
id: string;
|
||||
quantity: number;
|
||||
allocationPercentage: number;
|
||||
calculatedValue: number | null;
|
||||
ustValue: number;
|
||||
weeklyHours: number;
|
||||
weeks: number;
|
||||
isActive: boolean;
|
||||
createdAt: string;
|
||||
updatedAt: string;
|
||||
profile: { id: string; name: string };
|
||||
}
|
||||
|
||||
export interface CreateOSAllocationRequest {
|
||||
profileId: string;
|
||||
quantity: number;
|
||||
allocationPercentage: number;
|
||||
}
|
||||
|
||||
export interface UpdateOSAllocationRequest {
|
||||
profileId?: string;
|
||||
quantity?: number;
|
||||
allocationPercentage?: number;
|
||||
}
|
||||
|
||||
export interface BulkSetOSAllocationsRequest {
|
||||
items: CreateOSAllocationRequest[];
|
||||
}
|
||||
37
src/types/professional.types.ts
Normal file
37
src/types/professional.types.ts
Normal file
@@ -0,0 +1,37 @@
|
||||
export interface ProfessionalListItem {
|
||||
id: string;
|
||||
name: string;
|
||||
document: string | null;
|
||||
email: string | null;
|
||||
phone: string | null;
|
||||
role: string | null;
|
||||
isActive: boolean;
|
||||
createdAt: string;
|
||||
updatedAt: string;
|
||||
}
|
||||
|
||||
export interface ProfessionalsListResponse {
|
||||
data: ProfessionalListItem[];
|
||||
total: number;
|
||||
page: number;
|
||||
limit: number;
|
||||
}
|
||||
|
||||
export interface ProfessionalsFilters {
|
||||
search?: string;
|
||||
isActive?: string;
|
||||
page: number;
|
||||
limit: number;
|
||||
}
|
||||
|
||||
export interface CreateProfessionalRequest {
|
||||
name: string;
|
||||
document?: string;
|
||||
email?: string;
|
||||
phone?: string;
|
||||
role?: string;
|
||||
}
|
||||
|
||||
export interface UpdateProfessionalRequest extends Partial<CreateProfessionalRequest> {
|
||||
isActive?: boolean;
|
||||
}
|
||||
46
src/types/project.types.ts
Normal file
46
src/types/project.types.ts
Normal file
@@ -0,0 +1,46 @@
|
||||
export interface ProjectListItem {
|
||||
id: string;
|
||||
name: string;
|
||||
code: string | null;
|
||||
description: string | null;
|
||||
startDate: string | null;
|
||||
endDate: string | null;
|
||||
isActive: boolean;
|
||||
createdAt: string;
|
||||
updatedAt: string;
|
||||
contract: {
|
||||
id: string;
|
||||
name: string;
|
||||
client: {
|
||||
id: string;
|
||||
name: string;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
export interface ProjectsListResponse {
|
||||
data: ProjectListItem[];
|
||||
total: number;
|
||||
page: number;
|
||||
limit: number;
|
||||
}
|
||||
|
||||
export interface ProjectsFilters {
|
||||
search?: string;
|
||||
isActive?: string;
|
||||
page: number;
|
||||
limit: number;
|
||||
}
|
||||
|
||||
export interface CreateProjectRequest {
|
||||
name: string;
|
||||
contractId: string;
|
||||
code?: string;
|
||||
description?: string;
|
||||
startDate?: string;
|
||||
endDate?: string;
|
||||
}
|
||||
|
||||
export interface UpdateProjectRequest extends Partial<CreateProjectRequest> {
|
||||
isActive?: boolean;
|
||||
}
|
||||
77
src/types/sprint.types.ts
Normal file
77
src/types/sprint.types.ts
Normal file
@@ -0,0 +1,77 @@
|
||||
export type SprintType = 'DESCOBERTA' | 'DESIGN' | 'ARQUITETURA' | 'CONSTRUCAO';
|
||||
|
||||
export type SprintStatus = 'RASCUNHO' | 'EM_EXECUCAO' | 'FINALIZADA' | 'CANCELADA';
|
||||
|
||||
export interface SprintListItem {
|
||||
id: string;
|
||||
name: string;
|
||||
code: string | null;
|
||||
status: SprintStatus;
|
||||
startDate: string | null;
|
||||
endDate: string | null;
|
||||
goal: string | null;
|
||||
isActive: boolean;
|
||||
createdAt: string;
|
||||
updatedAt: string;
|
||||
}
|
||||
|
||||
export interface SprintDeliverable {
|
||||
id: string;
|
||||
code: string;
|
||||
title: string;
|
||||
status: string;
|
||||
client: { id: string; name: string };
|
||||
project: { id: string; name: string };
|
||||
}
|
||||
|
||||
export interface SprintHistoryItem {
|
||||
id: string;
|
||||
eventType: string;
|
||||
description: string;
|
||||
deliverableId: string | null;
|
||||
targetSprintId: string | null;
|
||||
previousStatus: SprintStatus | null;
|
||||
newStatus: SprintStatus | null;
|
||||
createdAt: string;
|
||||
createdBy: string | null;
|
||||
deliverable: { code: string; title: string } | null;
|
||||
}
|
||||
|
||||
export interface SprintDetail extends SprintListItem {
|
||||
deliverables: SprintDeliverable[];
|
||||
history: SprintHistoryItem[];
|
||||
totalDeliverables: number;
|
||||
statusSummary: Record<string, number>;
|
||||
}
|
||||
|
||||
export interface SprintsListResponse {
|
||||
data: SprintListItem[];
|
||||
total: number;
|
||||
page: number;
|
||||
limit: number;
|
||||
}
|
||||
|
||||
export interface SprintsFilters {
|
||||
search?: string;
|
||||
isActive?: string;
|
||||
status?: string;
|
||||
page: number;
|
||||
limit: number;
|
||||
}
|
||||
|
||||
export interface CreateSprintRequest {
|
||||
name: string;
|
||||
code?: string;
|
||||
startDate?: string;
|
||||
endDate?: string;
|
||||
goal?: string;
|
||||
}
|
||||
|
||||
export interface UpdateSprintRequest {
|
||||
name?: string;
|
||||
code?: string;
|
||||
startDate?: string;
|
||||
endDate?: string;
|
||||
goal?: string;
|
||||
isActive?: boolean;
|
||||
}
|
||||
47
src/types/user.types.ts
Normal file
47
src/types/user.types.ts
Normal file
@@ -0,0 +1,47 @@
|
||||
import type { UserRole } from './auth.types';
|
||||
|
||||
export interface UserListItem {
|
||||
id: string;
|
||||
name: string;
|
||||
email: string;
|
||||
role: UserRole;
|
||||
isActive: boolean;
|
||||
clientId?: string | null;
|
||||
client?: { id: string; name: string } | null;
|
||||
createdAt: string;
|
||||
updatedAt: string;
|
||||
}
|
||||
|
||||
export interface UsersListResponse {
|
||||
data: UserListItem[];
|
||||
total: number;
|
||||
page: number;
|
||||
limit: number;
|
||||
}
|
||||
|
||||
export interface UsersFilters {
|
||||
search?: string;
|
||||
role?: UserRole | '';
|
||||
isActive?: string;
|
||||
page: number;
|
||||
limit: number;
|
||||
}
|
||||
|
||||
export interface CreateUserRequest {
|
||||
name: string;
|
||||
email: string;
|
||||
role: UserRole;
|
||||
clientId?: string;
|
||||
}
|
||||
|
||||
export interface CreateUserResponse extends UserListItem {
|
||||
generatedPassword: string;
|
||||
}
|
||||
|
||||
export interface UpdateUserRequest {
|
||||
name?: string;
|
||||
email?: string;
|
||||
role?: UserRole;
|
||||
isActive?: boolean;
|
||||
clientId?: string | null;
|
||||
}
|
||||
121
src/types/work-order.types.ts
Normal file
121
src/types/work-order.types.ts
Normal file
@@ -0,0 +1,121 @@
|
||||
import type { ContractItemType } from './contract-item.types';
|
||||
|
||||
export const WorkOrderStatus = {
|
||||
RASCUNHO: 'RASCUNHO',
|
||||
EMITIDA: 'EMITIDA',
|
||||
EM_EXECUCAO: 'EM_EXECUCAO',
|
||||
TOTALMENTE_PAGA: 'TOTALMENTE_PAGA',
|
||||
CANCELADA: 'CANCELADA',
|
||||
} as const;
|
||||
|
||||
export type WorkOrderStatus = (typeof WorkOrderStatus)[keyof typeof WorkOrderStatus];
|
||||
|
||||
export interface WorkOrderListItem {
|
||||
id: string;
|
||||
code: string;
|
||||
name: string;
|
||||
description: string | null;
|
||||
status: WorkOrderStatus;
|
||||
reservedUst: number;
|
||||
totalValue: number | null;
|
||||
startDate: string;
|
||||
endDate: string | null;
|
||||
isActive: boolean;
|
||||
contract: { id: string; name: string; clientId: string };
|
||||
contractItem: { id: string; code: string; name: string; itemType: ContractItemType };
|
||||
_count: { deliverables: number };
|
||||
createdAt: string;
|
||||
updatedAt: string;
|
||||
}
|
||||
|
||||
export interface WorkOrderProjectRef {
|
||||
id: string;
|
||||
name: string;
|
||||
code: string;
|
||||
}
|
||||
|
||||
export interface WorkOrderStatusHistoryItem {
|
||||
id: string;
|
||||
previousStatus: WorkOrderStatus | null;
|
||||
newStatus: WorkOrderStatus;
|
||||
observation: string | null;
|
||||
createdAt: string;
|
||||
createdBy: string | null;
|
||||
}
|
||||
|
||||
export interface WorkOrderDetail extends WorkOrderListItem {
|
||||
description: string | null;
|
||||
contractId: string;
|
||||
contractItemId: string;
|
||||
contract: { id: string; name: string; code: string; clientId: string };
|
||||
contractItem: {
|
||||
id: string;
|
||||
code: string;
|
||||
name: string;
|
||||
itemType: ContractItemType;
|
||||
totalUst: number;
|
||||
ustValue: number | null;
|
||||
timeboxDescoberta: number | null;
|
||||
timeboxDesign: number | null;
|
||||
timeboxArquitetura: number | null;
|
||||
timeboxConstrucao: number | null;
|
||||
};
|
||||
projects: WorkOrderProjectRef[];
|
||||
deliverableCounts: Array<{ status: string; count: number }>;
|
||||
statusHistory?: WorkOrderStatusHistoryItem[];
|
||||
createdBy: string | null;
|
||||
updatedBy: string | null;
|
||||
}
|
||||
|
||||
export interface WorkOrderSummary {
|
||||
workOrderId: string;
|
||||
totalDeliverables: number;
|
||||
deliverablesByStatus: Record<string, number>;
|
||||
ustReserved: number;
|
||||
ustInExecution: number;
|
||||
ustPaid: number;
|
||||
ustConsumed: number;
|
||||
ustAvailable: number;
|
||||
consumptionPercent: number;
|
||||
valueReserved: number;
|
||||
valueConsumed: number;
|
||||
valueAvailable: number;
|
||||
lowBalanceAlert: boolean;
|
||||
}
|
||||
|
||||
export interface WorkOrdersListResponse {
|
||||
data: WorkOrderListItem[];
|
||||
total: number;
|
||||
page: number;
|
||||
limit: number;
|
||||
}
|
||||
|
||||
export interface WorkOrdersFilters {
|
||||
search?: string;
|
||||
clientId?: string;
|
||||
contractId?: string;
|
||||
contractItemId?: string;
|
||||
projectId?: string;
|
||||
status?: WorkOrderStatus;
|
||||
isActive?: boolean;
|
||||
page: number;
|
||||
limit: number;
|
||||
}
|
||||
|
||||
export interface CreateWorkOrderRequest {
|
||||
code: string;
|
||||
name: string;
|
||||
description?: string;
|
||||
contractId: string;
|
||||
contractItemId: string;
|
||||
projectIds: string[];
|
||||
reservedUst: number;
|
||||
startDate: string;
|
||||
endDate?: string;
|
||||
}
|
||||
|
||||
export type UpdateWorkOrderRequest = Partial<CreateWorkOrderRequest>;
|
||||
|
||||
export interface CancelWorkOrderRequest {
|
||||
observation: string;
|
||||
}
|
||||
Reference in New Issue
Block a user