feat(project):add CLN_PROJECT_PRICE_REPORT
This commit is contained in:
@@ -35,12 +35,20 @@ class ProjectRepository(BaseRepository[ProjectModel]):
|
||||
coding.counter = last_project[0]["counter"]+1
|
||||
code = self.create_code(coding)
|
||||
coding.design.code = 'D'+code
|
||||
coding.init_id().cu_at()
|
||||
if coding.monitor:
|
||||
coding.monitor.code = 'S'+code
|
||||
coding.has_monitor = True
|
||||
if coding.monitor.detail and coding.monitor.detail.first_amount :
|
||||
price = {
|
||||
'_id': uuid.uuid4(),
|
||||
'project_id': coding.id,
|
||||
'first_amount': coding.monitor.detail.first_amount
|
||||
}
|
||||
await use_collection(TaskEnv.CLN_PROJECT_PRICE_REPORT).insert_one(price)
|
||||
else:
|
||||
coding.has_monitor = False
|
||||
coding.init_id().cu_at()
|
||||
|
||||
await use_collection(COLLECTION).insert_one(coding.mongo_dict())
|
||||
return await self.get(coding.id)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user