fix(project):change required field to optional in detail

This commit is contained in:
shahzeydyfah
2025-01-19 00:25:50 +03:30
parent 0b86356d36
commit 0c02803092
+1 -9
View File
@@ -82,15 +82,7 @@ class ProjectRepository(BaseRepository[ProjectModel]):
update.monitor.code = 'S' + code
if update.monitor:
update.has_monitor = True
if update.monitor.detail and update.monitor.detail.first_amount:
price = await use_collection(TaskEnv.CLN_PROJECT_PRICE_REPORT).find_one({'project_id':_id})
if not price:
price = {
'_id': uuid.uuid4(),
'project_id': _id,
'first_amount': update.monitor.detail.first_amount
}
await use_collection(TaskEnv.CLN_PROJECT_PRICE_REPORT).insert_one(price)
await self.update_report_price(update)
update.u_at()
await use_collection(COLLECTION).update_one({"_id":_id},{"$set":update.mongo_dict()})