mirror of
https://github.com/TheAnachronism/docspell.git
synced 2025-06-22 02:18:26 +00:00
Allow to change use enum for org/equipment
This commit is contained in:
@ -392,7 +392,8 @@ trait Conversions {
|
||||
v.contacts.map(mkContact).toList,
|
||||
ro.notes,
|
||||
ro.created,
|
||||
ro.shortName
|
||||
ro.shortName,
|
||||
ro.use
|
||||
)
|
||||
}
|
||||
|
||||
@ -415,7 +416,7 @@ trait Conversions {
|
||||
now,
|
||||
now,
|
||||
v.shortName.map(_.trim),
|
||||
OrgUse.Correspondent
|
||||
v.use
|
||||
)
|
||||
} yield OOrganization.OrgAndContacts(org, cont)
|
||||
}
|
||||
@ -441,7 +442,7 @@ trait Conversions {
|
||||
v.created,
|
||||
now,
|
||||
v.shortName.map(_.trim),
|
||||
OrgUse.Correspondent
|
||||
v.use
|
||||
)
|
||||
} yield OOrganization.OrgAndContacts(org, cont)
|
||||
}
|
||||
@ -630,17 +631,17 @@ trait Conversions {
|
||||
|
||||
// equipment
|
||||
def mkEquipment(re: REquipment): Equipment =
|
||||
Equipment(re.eid, re.name, re.created, re.notes)
|
||||
Equipment(re.eid, re.name, re.created, re.notes, re.use)
|
||||
|
||||
def newEquipment[F[_]: Sync](e: Equipment, cid: Ident): F[REquipment] =
|
||||
timeId.map({ case (id, now) =>
|
||||
REquipment(id, cid, e.name.trim, now, now, e.notes, EquipmentUse.Concerning)
|
||||
REquipment(id, cid, e.name.trim, now, now, e.notes, e.use)
|
||||
})
|
||||
|
||||
def changeEquipment[F[_]: Sync](e: Equipment, cid: Ident): F[REquipment] =
|
||||
Timestamp
|
||||
.current[F]
|
||||
.map(now => REquipment(e.id, cid, e.name.trim, e.created, now, e.notes, EquipmentUse.Concerning))
|
||||
.map(now => REquipment(e.id, cid, e.name.trim, e.created, now, e.notes, e.use))
|
||||
|
||||
// idref
|
||||
|
||||
|
Reference in New Issue
Block a user