33 AddInstallationType ,
44 CraftTimeReduced ,
55 DeprecateInstallation ,
6+ EditDeprecateTime ,
67 EditInstallationType ,
78 MintInstallation ,
89 MintInstallations ,
@@ -12,7 +13,7 @@ import {
1213 UpgradeTimeReduced ,
1314 URI ,
1415} from "../../generated/InstallationDiamond/InstallationDiamond" ;
15- import { URIEvent } from "../../generated/schema" ;
16+ import { EditDeprecateTimeEvent , URIEvent } from "../../generated/schema" ;
1617import { BIGINT_ONE , StatCategory } from "../helper/constants" ;
1718import {
1819 createAddInstallationType ,
@@ -277,3 +278,29 @@ export function handleURI(event: URI): void {
277278 installation . uri = event . params . _value ;
278279 installation . save ( ) ;
279280}
281+
282+ export function handleEditDeprecateTime ( event : EditDeprecateTime ) : void {
283+ // create Event entity
284+ let id =
285+ event . transaction . from . toHexString ( ) +
286+ "-" +
287+ event . params . _installationId . toString ( ) +
288+ "-" +
289+ event . block . number . toString ( ) ;
290+ let eventEntity = new EditDeprecateTimeEvent ( id ) ;
291+ eventEntity . transaction = event . transaction . hash ;
292+ eventEntity . block = event . block . number ;
293+ eventEntity . timestamp = event . block . timestamp ;
294+ eventEntity . contract = event . address ;
295+ eventEntity . installationId = event . params . _installationId . toI32 ( ) ;
296+ eventEntity . newDeprecatetime = event . params . _newDeprecatetime ;
297+ eventEntity . installationType = event . params . _installationId . toString ( ) ;
298+ eventEntity . save ( ) ;
299+
300+ // update installationType
301+ let installationType = getOrCreateInstallationType (
302+ event . params . _installationId
303+ ) ;
304+ installationType . deprecatedAt = event . params . _newDeprecatetime ;
305+ installationType . save ( ) ;
306+ }
0 commit comments