Skip to content

Cannot send 2 transfers of the same batch from one distributor #18

@nguyenlamlll

Description

@nguyenlamlll

The context:

  • Manufacture AAA creates a medicine batch named "QT-001".
  • AAA sent a few to BBB, a distributor.
  • BBB sent them away.
  • AAA sent a few to BBB again.
  • BBB cannot send them this time.

HttpPost:

{
"medicineId": {
"id": "2dd822c5-034b-43b0-8a37-08d77ffc8347",
"registrationCode": "VD-15311-11",
"commercialName": "Q-Tyta",
"ingredientConcentration": "Đảng sâm, Bạch truật, Hoàng kỳ, Cam thảo, Đương quy, Toan táo nhân, Phục linh, Mộc hương, Long nhãn, Đại táo, Viễn chí 400 mg"
},
"medicineBatchId": "2ed16ad0-19c8-4960-4b16-08d77ffd7ecf",
"fromTenantId": "5ac7ad43-7878-4274-89a8-08d768e935ac",
"toTenantId": "ab22c773-dd0d-4396-94ee-08d77625d9af",
"quantity": "5000"
}

Response from server:

{
"ClassName": "System.InvalidOperationException",
"Message": "Sequence contains more than one element",
"Data": {},
"InnerException": null,
"HelpURL": null,
"StackTraceString": "   at System.Linq.Enumerable.SingleOrDefault[TSource](IEnumerable`1 source)
   at PharmaceuticalChain.API.Services.Implementations.MedicineBatchTransferService.PharmaceuticalChain.API.Services.Interfaces.IMedicineBatchTransferService.Create(Guid medicineBatchId, Guid fromTenantId, Guid toTenantId, UInt32 quantity) in C:\Users\lamle\Documents\LAM\Projects\Server\src\PharmaceuticalChain.API\Services\Implementations\MedicineBatchTransferService.cs:line 59
   at PharmaceuticalChain.API.Controllers.MedicineBatchTransfersController.CreateTransferAsync(CreateMedicineBatchTransferCommand command) in C:\Users\lamle\Documents\LAM\Projects\Server\src\PharmaceuticalChain.API\Controllers\MedicineBatchTransfersController.cs:line 40",
"RemoteStackTraceString": null,
"RemoteStackIndex": 0,
"ExceptionMethod": null,
"HResult": -2146233079,
"Source": "System.Linq",
"WatsonBuckets": null
}

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions