Kind: Class
Source: Pams/Logic/Pams.Business/BindingModels/DeleteDto.cs (line 3)
Part of: Pams
DeleteDto carries the identifiers and context needed to delete an entity or a related set of entities. It includes object, company, stage, parent, vendor, user, and item-list data so the receiving service can scope the delete operation.
Diagram
mermaidgraph LR Client[Client request] --> DTO[DeleteDto] DTO --> ID[ID] DTO --> User[UserId] DTO --> Object[ObjectId / ObjectTypeId / ObjectTitle] DTO --> Context[CompanyId / StageId / ParentId] DTO --> Vendor[LocalVendorId] DTO --> Items[ItemsIdList] DTO --> DeleteService[Delete handler]
Usage
tstype DeleteDto = {
ID: string;
UserId: string;
ObjectId: number;
CompanyId: number;
StageId: number;
ParentId: string;
ObjectTypeId: number;
ObjectTitle: string;
LocalVendorId: string;
ItemsIdList: string[];
};
async function deleteObject(endpoint: string, dto: DeleteDto) {
const response = await fetch(endpoint, {
method: "DELETE",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify(dto),
});
if (!response.ok) {
throw new Error("Delete request failed.");
}
}
const request: DeleteDto = {
ID: selectedRecord.id,
UserId: currentUser.id,
ObjectId: selectedRecord.objectId,
CompanyId: selectedRecord.companyId,
StageId: selectedRecord.stageId,
ParentId: selectedRecord.parentId,
ObjectTypeId: selectedRecord.objectTypeId,
ObjectTitle: selectedRecord.title,
LocalVendorId: selectedRecord.localVendorId,
ItemsIdList: selectedItemIds,
};
await deleteObject(deleteEndpoint, request);
AI Coding Instructions
- Keep property names aligned with the C# model, including
IDandItemsIdList. - Preserve
longvalues safely across the API boundary; send them as strings when JavaScript number precision may be an issue. - Populate
CompanyId,StageId, andObjectTypeIdfrom the selected entity context before sending a delete request. - Send
ItemsIdListwhen the delete operation applies to related items, and avoid sending unrelated item identifiers.
Relationships
- IMPORTS →
UserLogResultBindingModel
Used by
83 references from 83 files. Each is a place in this repository where the symbol is actually used — go read one rather than trusting an example.
Imported by (83)
AddressController—Pams/API/Pams.API/Controllers/Common/AddressController.cs:15BankAccountController—Pams/API/Pams.API/Controllers/Common/BankAccountController.cs:9BankController—Pams/API/Pams.API/Controllers/Common/BankController.cs:9CategoryController—Pams/API/Pams.API/Controllers/Common/CategroyController.cs:15ClientTypeController—Pams/API/Pams.API/Controllers/Common/ClientTypeController.cs:19ColorMarkerController—Pams/API/Pams.API/Controllers/Common/ColorMarkerController.cs:9ContactPersonController—Pams/API/Pams.API/Controllers/Common/ContactPersonController.cs:17CostItemController—Pams/API/Pams.API/Controllers/Common/CostItemController.cs:8
…and 75 more.
Was this page helpful?